From 662950690c4ca30d92a021b230f2b5aef94febca Mon Sep 17 00:00:00 2001 From: Bruno Barbieri Date: Wed, 4 Dec 2013 21:22:22 -0200 Subject: [PATCH] Delete unused legacy files --- docs/FilterData.txt | 18 - docs/todo/dvobsub.txt | 5 - docs/todo/mpc.txt | 71 - docs/todo/vsfilter.txt | 2 - docs/todo/vsrip.txt | 2 - include/IBitRateInfo.h | 29 - include/IBufferInfo.h | 30 - include/IChapterInfo.h | 66 - include/IKeyFrameInfo.h | 29 - include/ITrackInfo.h | 61 - include/atl/atlcache.h | 3246 ----- include/atl/atlcrypt.h | 376 - include/atl/atlcrypt.inl | 1062 -- include/atl/atlextmgmt.h | 1279 -- include/atl/atlhtml.h | 1682 --- include/atl/atlhttp.h | 725 -- include/atl/atlhttp.inl | 3144 ----- include/atl/atlisapi.h | 10609 ---------------- include/atl/atlmime.h | 2406 ---- include/atl/atlperf.h | 663 - include/atl/atlperf.inl | 2894 ----- include/atl/atlrx.h | 2013 --- include/atl/atlserr.h | 174 - include/atl/atlsession.h | 2490 ---- include/atl/atlsharedsvc.h | 202 - include/atl/atlsiface.h | 802 -- include/atl/atlsmtpconnection.h | 926 -- include/atl/atlsmtputil.h | 220 - include/atl/atlsoap.h | 8174 ------------ include/atl/atlspriv.h | 1017 -- include/atl/atlspriv.inl | 361 - include/atl/atlsrv.rc | 146 - include/atl/atlsrvres.h | 150 - include/atl/atlstencil.h | 4152 ------ include/atl/l.chs/atlsrv.rc | 146 - include/atl/l.cht/atlsrv.rc | 146 - include/atl/l.deu/atlsrv.rc | 146 - include/atl/l.esp/atlsrv.rc | 146 - include/atl/l.fra/atlsrv.rc | 146 - include/atl/l.ita/atlsrv.rc | 146 - include/atl/l.jpn/atlsrv.rc | 146 - include/atl/l.kor/atlsrv.rc | 146 - include/atl/readme.txt | 2 - include/atl/res/dllmgr.srf | 29 - include/atl/res/stencilmgr.srf | 69 - include/atl/res/threadmgr.srf | 24 - include/aviutl/filter.h | 476 - include/detours/detours.h | 616 - include/dsm/dsm.h | 38 - include/dsm/dsm.txt | 247 - include/qedit.h | 6580 ---------- include/realmedia/pnbastsd.h | 163 - include/realmedia/pncom.h | 715 -- include/realmedia/pnresult.h | 362 - include/realmedia/pntypes.h | 492 - include/realmedia/pnwintyp.h | 278 - include/realmedia/pxresult.h | 9 - include/realmedia/rmaaconf.h | 181 - include/realmedia/rmaallow.h | 272 - include/realmedia/rmaasm.h | 285 - include/realmedia/rmaausvc.h | 1261 -- include/realmedia/rmaauth.h | 342 - include/realmedia/rmaauthn.h | 716 -- include/realmedia/rmacfg.h | 166 - include/realmedia/rmaclsnk.h | 191 - include/realmedia/rmacmenu.h | 215 - include/realmedia/rmacomm.h | 568 - include/realmedia/rmacore.h | 844 -- include/realmedia/rmadb.h | 1304 -- include/realmedia/rmadtcvt.h | 533 - include/realmedia/rmaencod.h | 240 - include/realmedia/rmaengin.h | 1500 --- include/realmedia/rmaerror.h | 276 - include/realmedia/rmaevent.h | 90 - include/realmedia/rmafiles.h | 1583 --- include/realmedia/rmaformt.h | 518 - include/realmedia/rmagroup.h | 391 - include/realmedia/rmahyper.h | 85 - include/realmedia/rmaiids.h | 1094 -- include/realmedia/rmalvpix.h | 385 - include/realmedia/rmalvtxt.h | 324 - include/realmedia/rmamon.h | 1105 -- include/realmedia/rmapckts.h | 449 - include/realmedia/rmapends.h | 83 - include/realmedia/rmaphook.h | 302 - include/realmedia/rmaplgns.h | 152 - include/realmedia/rmaplugn.h | 696 - include/realmedia/rmappv.h | 394 - include/realmedia/rmaprefs.h | 284 - include/realmedia/rmapsink.h | 147 - include/realmedia/rmarendr.h | 247 - include/realmedia/rmasite2.h | 185 - include/realmedia/rmaslta.h | 191 - include/realmedia/rmasrc.h | 254 - include/realmedia/rmaupgrd.h | 178 - include/realmedia/rmavalue.h | 381 - include/realmedia/rmavsrc.h | 185 - include/realmedia/rmavsurf.h | 216 - include/realmedia/rmawin.h | 811 -- include/realmedia/rmaxmltg.h | 146 - lib/detours/detours.lib | Bin 178870 -> 0 bytes lib/detours/detours.pdb | Bin 110592 -> 0 bytes lib/qt6/qtmlClient.lib | Bin 774658 -> 0 bytes lib/wm7/wmstub.lib | Bin 926774 -> 0 bytes mpc_vs2005.sln | 849 -- mpc_vs2008.sln | 849 -- src/apps/mplayerc/AuthDlg.cpp | 171 - src/apps/mplayerc/AuthDlg.h | 57 - src/apps/mplayerc/BaseGraph.cpp | 354 - src/apps/mplayerc/BaseGraph.h | 255 - src/apps/mplayerc/CShockwaveFlash.cpp | 35 - src/apps/mplayerc/CShockwaveFlash.h | 462 - src/apps/mplayerc/ChildView.cpp | 286 - src/apps/mplayerc/ChildView.h | 65 - src/apps/mplayerc/ComPropertyPage.cpp | 109 - src/apps/mplayerc/ComPropertyPage.h | 52 - src/apps/mplayerc/ComPropertySheet.cpp | 246 - src/apps/mplayerc/ComPropertySheet.h | 61 - src/apps/mplayerc/ConvertChapDlg.cpp | 92 - src/apps/mplayerc/ConvertChapDlg.h | 45 - src/apps/mplayerc/ConvertDlg.cpp | 1366 -- src/apps/mplayerc/ConvertDlg.h | 190 - src/apps/mplayerc/ConvertPropsDlg.cpp | 202 - src/apps/mplayerc/ConvertPropsDlg.h | 60 - src/apps/mplayerc/ConvertResDlg.cpp | 125 - src/apps/mplayerc/ConvertResDlg.h | 49 - src/apps/mplayerc/DX7AllocatorPresenter.cpp | 1321 -- src/apps/mplayerc/DX7AllocatorPresenter.h | 40 - src/apps/mplayerc/DX9AllocatorPresenter.cpp | 2221 ---- src/apps/mplayerc/DX9AllocatorPresenter.h | 60 - src/apps/mplayerc/DeinterlacerFilter.cpp | 123 - src/apps/mplayerc/DeinterlacerFilter.h | 16 - src/apps/mplayerc/FGFilter.cpp | 621 - src/apps/mplayerc/FGFilter.h | 137 - src/apps/mplayerc/FGManager.cpp | 2067 --- src/apps/mplayerc/FGManager.h | 180 - src/apps/mplayerc/FakeFilterMapper2.cpp | 474 - src/apps/mplayerc/FakeFilterMapper2.h | 124 - src/apps/mplayerc/FavoriteAddDlg.cpp | 79 - src/apps/mplayerc/FavoriteAddDlg.h | 52 - src/apps/mplayerc/FavoriteOrganizeDlg.cpp | 284 - src/apps/mplayerc/FavoriteOrganizeDlg.h | 65 - src/apps/mplayerc/FileDropTarget.cpp | 78 - src/apps/mplayerc/FileDropTarget.h | 63 - src/apps/mplayerc/FloatEdit.cpp | 157 - src/apps/mplayerc/FloatEdit.h | 66 - src/apps/mplayerc/GoToDlg.cpp | 204 - src/apps/mplayerc/GoToDlg.h | 56 - src/apps/mplayerc/IGraphBuilder2.h | 44 - src/apps/mplayerc/IPinHook.cpp | 493 - src/apps/mplayerc/IPinHook.h | 180 - src/apps/mplayerc/IQTVideoSurface.h | 33 - src/apps/mplayerc/ISDb.cpp | 89 - src/apps/mplayerc/ISDb.h | 37 - src/apps/mplayerc/KeyProvider.cpp | 53 - src/apps/mplayerc/KeyProvider.h | 40 - src/apps/mplayerc/LineNumberEdit.cpp | 971 -- src/apps/mplayerc/LineNumberEdit.h | 99 - src/apps/mplayerc/MacrovisionKicker.cpp | 92 - src/apps/mplayerc/MacrovisionKicker.h | 44 - src/apps/mplayerc/MainFrm.cpp | 10066 --------------- src/apps/mplayerc/MainFrm.h | 671 - src/apps/mplayerc/MediaFormats.cpp | 366 - src/apps/mplayerc/MediaFormats.h | 89 - src/apps/mplayerc/MediaTypesDlg.cpp | 141 - src/apps/mplayerc/MediaTypesDlg.h | 57 - src/apps/mplayerc/OpenCapDeviceDlg.cpp | 448 - src/apps/mplayerc/OpenCapDeviceDlg.h | 58 - src/apps/mplayerc/OpenDlg.cpp | 195 - src/apps/mplayerc/OpenDlg.h | 58 - src/apps/mplayerc/OpenFileDlg.cpp | 153 - src/apps/mplayerc/OpenFileDlg.h | 59 - src/apps/mplayerc/PPageAccelTbl.cpp | 962 -- src/apps/mplayerc/PPageAccelTbl.h | 85 - src/apps/mplayerc/PPageAudioSwitcher.cpp | 338 - src/apps/mplayerc/PPageAudioSwitcher.h | 80 - src/apps/mplayerc/PPageBase.cpp | 102 - src/apps/mplayerc/PPageBase.h | 49 - src/apps/mplayerc/PPageDVD.cpp | 329 - src/apps/mplayerc/PPageDVD.h | 67 - src/apps/mplayerc/PPageExternalFilters.cpp | 731 -- src/apps/mplayerc/PPageExternalFilters.h | 84 - src/apps/mplayerc/PPageFileInfoClip.cpp | 110 - src/apps/mplayerc/PPageFileInfoClip.h | 58 - src/apps/mplayerc/PPageFileInfoDetails.cpp | 309 - src/apps/mplayerc/PPageFileInfoDetails.h | 63 - src/apps/mplayerc/PPageFileInfoRes.cpp | 151 - src/apps/mplayerc/PPageFileInfoRes.h | 60 - src/apps/mplayerc/PPageFileInfoSheet.cpp | 79 - src/apps/mplayerc/PPageFileInfoSheet.h | 51 - src/apps/mplayerc/PPageFormats.cpp | 761 -- src/apps/mplayerc/PPageFormats.h | 86 - src/apps/mplayerc/PPageInternalFilters.cpp | 295 - src/apps/mplayerc/PPageInternalFilters.h | 74 - src/apps/mplayerc/PPageLogo.cpp | 195 - src/apps/mplayerc/PPageLogo.h | 60 - src/apps/mplayerc/PPageOutput.cpp | 214 - src/apps/mplayerc/PPageOutput.h | 63 - src/apps/mplayerc/PPagePlayback.cpp | 210 - src/apps/mplayerc/PPagePlayback.h | 73 - src/apps/mplayerc/PPagePlayer.cpp | 181 - src/apps/mplayerc/PPagePlayer.h | 68 - src/apps/mplayerc/PPageSheet.cpp | 121 - src/apps/mplayerc/PPageSheet.h | 90 - src/apps/mplayerc/PPageSubDB.cpp | 117 - src/apps/mplayerc/PPageSubDB.h | 50 - src/apps/mplayerc/PPageSubStyle.cpp | 303 - src/apps/mplayerc/PPageSubStyle.h | 114 - src/apps/mplayerc/PPageSubtitles.cpp | 155 - src/apps/mplayerc/PPageSubtitles.h | 63 - src/apps/mplayerc/PPageTweaks.cpp | 139 - src/apps/mplayerc/PPageTweaks.h | 65 - src/apps/mplayerc/PPageWebServer.cpp | 255 - src/apps/mplayerc/PPageWebServer.h | 70 - src/apps/mplayerc/PixelShaderCompiler.cpp | 121 - src/apps/mplayerc/PixelShaderCompiler.h | 64 - src/apps/mplayerc/PlayerCaptureBar.cpp | 75 - src/apps/mplayerc/PlayerCaptureBar.h | 49 - src/apps/mplayerc/PlayerCaptureDialog.cpp | 1661 --- src/apps/mplayerc/PlayerCaptureDialog.h | 452 - src/apps/mplayerc/PlayerInfoBar.cpp | 219 - src/apps/mplayerc/PlayerInfoBar.h | 62 - src/apps/mplayerc/PlayerListCtrl.cpp | 871 -- src/apps/mplayerc/PlayerListCtrl.h | 150 - src/apps/mplayerc/PlayerPlaylistBar.cpp | 1419 --- src/apps/mplayerc/PlayerPlaylistBar.h | 118 - src/apps/mplayerc/PlayerSeekBar.cpp | 304 - src/apps/mplayerc/PlayerSeekBar.h | 73 - src/apps/mplayerc/PlayerShaderEditorBar.cpp | 84 - src/apps/mplayerc/PlayerShaderEditorBar.h | 52 - src/apps/mplayerc/PlayerStatusBar.cpp | 365 - src/apps/mplayerc/PlayerStatusBar.h | 69 - src/apps/mplayerc/PlayerSubresyncBar.cpp | 1301 -- src/apps/mplayerc/PlayerSubresyncBar.h | 107 - src/apps/mplayerc/PlayerToolBar.cpp | 276 - src/apps/mplayerc/PlayerToolBar.h | 69 - src/apps/mplayerc/Playlist.cpp | 289 - src/apps/mplayerc/Playlist.h | 75 - src/apps/mplayerc/PnSPresetsDlg.cpp | 247 - src/apps/mplayerc/PnSPresetsDlg.h | 68 - src/apps/mplayerc/QuicktimeGraph.cpp | 652 - src/apps/mplayerc/QuicktimeGraph.h | 125 - src/apps/mplayerc/RealMediaGraph.cpp | 714 -- src/apps/mplayerc/RealMediaGraph.h | 229 - src/apps/mplayerc/RealMediaWindowlessSite.cpp | 710 -- src/apps/mplayerc/RealMediaWindowlessSite.h | 218 - src/apps/mplayerc/RegFilterChooserDlg.cpp | 174 - src/apps/mplayerc/RegFilterChooserDlg.h | 56 - src/apps/mplayerc/SaveDlg.cpp | 239 - src/apps/mplayerc/SaveDlg.h | 61 - src/apps/mplayerc/SaveTextFileDialog.cpp | 93 - src/apps/mplayerc/SaveTextFileDialog.h | 56 - src/apps/mplayerc/SaveThumbnailsDialog.cpp | 91 - src/apps/mplayerc/SaveThumbnailsDialog.h | 50 - src/apps/mplayerc/SelectMediaType.cpp | 101 - src/apps/mplayerc/SelectMediaType.h | 55 - src/apps/mplayerc/ShaderAutoCompleteDlg.cpp | 179 - src/apps/mplayerc/ShaderAutoCompleteDlg.h | 33 - src/apps/mplayerc/ShaderCombineDlg.cpp | 131 - src/apps/mplayerc/ShaderCombineDlg.h | 38 - src/apps/mplayerc/ShaderEditorDlg.cpp | 482 - src/apps/mplayerc/ShaderEditorDlg.h | 83 - src/apps/mplayerc/ShockwaveGraph.cpp | 232 - src/apps/mplayerc/ShockwaveGraph.h | 79 - src/apps/mplayerc/StaticLink.cpp | 171 - src/apps/mplayerc/StaticLink.h | 81 - src/apps/mplayerc/StatusLabel.cpp | 98 - src/apps/mplayerc/StatusLabel.h | 47 - src/apps/mplayerc/StdAfx.cpp | 27 - src/apps/mplayerc/StdAfx.h | 54 - src/apps/mplayerc/SubWCRev.conf | 7 - src/apps/mplayerc/SubtitleDlDlg.cpp | 153 - src/apps/mplayerc/SubtitleDlDlg.h | 42 - src/apps/mplayerc/TextPassThruFilter.cpp | 249 - src/apps/mplayerc/TextPassThruFilter.h | 46 - src/apps/mplayerc/VolumeCtrl.cpp | 186 - src/apps/mplayerc/VolumeCtrl.h | 51 - src/apps/mplayerc/WebClientSocket.cpp | 732 -- src/apps/mplayerc/WebClientSocket.h | 44 - src/apps/mplayerc/WebServer.cpp | 615 - src/apps/mplayerc/WebServer.h | 50 - src/apps/mplayerc/WebServerSocket.cpp | 22 - src/apps/mplayerc/WebServerSocket.h | 15 - src/apps/mplayerc/jpeg.cpp | 404 - src/apps/mplayerc/jpeg.h | 59 - src/apps/mplayerc/jpeg_tables.h | 233 - src/apps/mplayerc/libpng.c | 115 - src/apps/mplayerc/libpng.h | 62 - src/apps/mplayerc/mplayerc.cpp | 2274 ---- src/apps/mplayerc/mplayerc.h | 508 - src/apps/mplayerc/mplayerc.rc | 2402 ---- src/apps/mplayerc/mplayerc_vs2005.sln | 189 - src/apps/mplayerc/mplayerc_vs2005.vcproj | 1493 --- src/apps/mplayerc/mplayerc_vs2008.vcproj | 1496 --- src/apps/mplayerc/pngdib.c | 1594 --- src/apps/mplayerc/pngdib.h | 291 - src/apps/mplayerc/res/Icon_114.ico | Bin 23558 -> 0 bytes src/apps/mplayerc/res/Icon_116.ico | Bin 22486 -> 0 bytes src/apps/mplayerc/res/Icon_41.ico | Bin 5854 -> 0 bytes src/apps/mplayerc/res/ani.avi | Bin 14848 -> 0 bytes src/apps/mplayerc/res/authhdrpic.bmp | Bin 57654 -> 0 bytes src/apps/mplayerc/res/icon.ico | Bin 142454 -> 0 bytes src/apps/mplayerc/res/logo.0.png | Bin 200 -> 0 bytes src/apps/mplayerc/res/logo.1.png | Bin 6110 -> 0 bytes src/apps/mplayerc/res/logo.2.png | Bin 13828 -> 0 bytes src/apps/mplayerc/res/logo.3.png | Bin 5210 -> 0 bytes src/apps/mplayerc/res/logo.4.png | Bin 17380 -> 0 bytes src/apps/mplayerc/res/logo.5.png | Bin 3954 -> 0 bytes src/apps/mplayerc/res/logo.6.png | Bin 36995 -> 0 bytes src/apps/mplayerc/res/logo.7.png | Bin 61474 -> 0 bytes src/apps/mplayerc/res/mono.bmp | Bin 1582 -> 0 bytes src/apps/mplayerc/res/mpc.png | Bin 9145 -> 0 bytes src/apps/mplayerc/res/mplayerc.manifest | 41 - src/apps/mplayerc/res/multi.ico | Bin 766 -> 0 bytes src/apps/mplayerc/res/noaudio.bmp | Bin 1666 -> 0 bytes src/apps/mplayerc/res/onoff.bmp | Bin 358 -> 0 bytes src/apps/mplayerc/res/shaders/EdgeSharpen.psh | 51 - .../mplayerc/res/shaders/SharpenComplex.psh | 52 - src/apps/mplayerc/res/shaders/contour.psh | 30 - .../res/shaders/deinterlace (blend).psh | 24 - src/apps/mplayerc/res/shaders/emboss.psh | 30 - src/apps/mplayerc/res/shaders/empty.psh | 19 - src/apps/mplayerc/res/shaders/grayscale.psh | 19 - src/apps/mplayerc/res/shaders/invert.psh | 19 - src/apps/mplayerc/res/shaders/letterbox.psh | 25 - src/apps/mplayerc/res/shaders/levels.psh | 9 - src/apps/mplayerc/res/shaders/nightvision.psh | 7 - src/apps/mplayerc/res/shaders/procamp.psh | 61 - src/apps/mplayerc/res/shaders/resizer.psh | 105 - src/apps/mplayerc/res/shaders/sharpen.psh | 30 - src/apps/mplayerc/res/shaders/sphere.psh | 60 - src/apps/mplayerc/res/shaders/spotlight.psh | 22 - src/apps/mplayerc/res/shaders/wave.psh | 29 - src/apps/mplayerc/res/single.ico | Bin 766 -> 0 bytes src/apps/mplayerc/res/stereo.bmp | Bin 1834 -> 0 bytes src/apps/mplayerc/res/streamtypes.bmp | Bin 6966 -> 0 bytes src/apps/mplayerc/res/toolbar1.bmp | Bin 2038 -> 0 bytes src/apps/mplayerc/res/web/1pix.gif | Bin 43 -> 0 bytes src/apps/mplayerc/res/web/404.html | 10 - src/apps/mplayerc/res/web/bottomside.png | Bin 97 -> 0 bytes src/apps/mplayerc/res/web/browser.html | 28 - src/apps/mplayerc/res/web/controlback.png | Bin 148 -> 0 bytes .../mplayerc/res/web/controlbuttondecrate.png | Bin 181 -> 0 bytes .../mplayerc/res/web/controlbuttonincrate.png | Bin 174 -> 0 bytes .../mplayerc/res/web/controlbuttonpause.png | Bin 143 -> 0 bytes .../mplayerc/res/web/controlbuttonplay.png | Bin 237 -> 0 bytes .../res/web/controlbuttonskipback.png | Bin 190 -> 0 bytes .../res/web/controlbuttonskipforward.png | Bin 190 -> 0 bytes .../mplayerc/res/web/controlbuttonstep.png | Bin 183 -> 0 bytes .../mplayerc/res/web/controlbuttonstop.png | Bin 149 -> 0 bytes src/apps/mplayerc/res/web/controls.html | 1735 --- .../mplayerc/res/web/controlvolumebar.png | Bin 239 -> 0 bytes .../mplayerc/res/web/controlvolumegrip.png | Bin 173 -> 0 bytes .../mplayerc/res/web/controlvolumeoff.png | Bin 410 -> 0 bytes src/apps/mplayerc/res/web/controlvolumeon.png | Bin 270 -> 0 bytes src/apps/mplayerc/res/web/default.css | 5 - src/apps/mplayerc/res/web/headerback.png | Bin 161 -> 0 bytes src/apps/mplayerc/res/web/headerclose.png | Bin 1658 -> 0 bytes src/apps/mplayerc/res/web/headericon.png | Bin 801 -> 0 bytes src/apps/mplayerc/res/web/index.html | 35 - src/apps/mplayerc/res/web/leftbottomside.png | Bin 180 -> 0 bytes src/apps/mplayerc/res/web/leftside.png | Bin 151 -> 0 bytes src/apps/mplayerc/res/web/player.html | 303 - src/apps/mplayerc/res/web/rightbottomside.png | Bin 118 -> 0 bytes src/apps/mplayerc/res/web/rightside.png | Bin 95 -> 0 bytes src/apps/mplayerc/res/web/seekbargrip.png | Bin 158 -> 0 bytes src/apps/mplayerc/res/web/seekbarleft.png | Bin 112 -> 0 bytes src/apps/mplayerc/res/web/seekbarmid.png | Bin 100 -> 0 bytes src/apps/mplayerc/res/web/seekbarright.png | Bin 107 -> 0 bytes src/apps/mplayerc/res/web/sliderback.gif | Bin 351 -> 0 bytes src/apps/mplayerc/res/web/sliderbar.gif | Bin 91 -> 0 bytes src/apps/mplayerc/res/web/slidergrip.gif | Bin 157 -> 0 bytes src/apps/mplayerc/res/web/vbg.GIF | Bin 228 -> 0 bytes src/apps/mplayerc/res/web/vbs.GIF | Bin 127 -> 0 bytes src/apps/mplayerc/resource.h | 739 -- src/filters/FilterApp.cpp | 52 - src/filters/FilterApp.h | 33 - src/filters/InternalPropertyPage.cpp | 312 - src/filters/InternalPropertyPage.h | 119 - src/filters/PinInfoWnd.cpp | 207 - src/filters/PinInfoWnd.h | 59 - src/filters/filters.h | 51 - src/filters/stdafx.cpp | 29 - src/filters/stdafx.h | 31 - src/libpng/LICENSE | 109 - src/libpng/README | 267 - src/libpng/libpng.txt | 3115 ----- src/libpng/libpng_vs2005.vcproj | 237 - src/libpng/libpng_vs2008.vcproj | 238 - src/libpng/png.c | 922 -- src/libpng/png.h | 3685 ------ src/libpng/pngconf.h | 1496 --- src/libpng/pngerror.c | 361 - src/libpng/pnggccrd.c | 103 - src/libpng/pngget.c | 939 -- src/libpng/pngmem.c | 617 - src/libpng/pngpread.c | 1724 --- src/libpng/pngread.c | 1470 --- src/libpng/pngrio.c | 174 - src/libpng/pngrtran.c | 4382 ------- src/libpng/pngrutil.c | 3244 ----- src/libpng/pngset.c | 1255 -- src/libpng/pngtest.c | 1689 --- src/libpng/pngtrans.c | 674 - src/libpng/pngwio.c | 256 - src/libpng/pngwrite.c | 1558 --- src/libpng/pngwtran.c | 572 - src/libpng/pngwutil.c | 2788 ---- src/ui/CmdUI/CmdUI.cpp | 208 - src/ui/CmdUI/CmdUI.h | 67 - src/ui/CmdUI/CmdUI.sln | 27 - src/ui/CmdUI/CmdUI.vcproj | 236 - src/ui/CmdUI/CmdUI_vs2005.sln | 25 - src/ui/CmdUI/CmdUI_vs2005.vcproj | 319 - src/ui/CmdUI/CmdUI_vs2008.vcproj | 316 - src/ui/CmdUI/stdafx.cpp | 8 - src/ui/CmdUI/stdafx.h | 19 - src/ui/ResizableLib/Artistic-License.txt | 99 - src/ui/ResizableLib/ResizableDialog.cpp | 161 - src/ui/ResizableLib/ResizableDialog.h | 101 - src/ui/ResizableLib/ResizableGrip.cpp | 310 - src/ui/ResizableLib/ResizableGrip.h | 81 - src/ui/ResizableLib/ResizableLayout.cpp | 518 - src/ui/ResizableLib/ResizableLayout.h | 196 - src/ui/ResizableLib/ResizableLib.sln | 27 - src/ui/ResizableLib/ResizableLib.vcproj | 281 - src/ui/ResizableLib/ResizableLib_vs2005.sln | 25 - .../ResizableLib/ResizableLib_vs2005.vcproj | 379 - .../ResizableLib/ResizableLib_vs2008.vcproj | 376 - src/ui/ResizableLib/ResizableMinMax.cpp | 95 - src/ui/ResizableLib/ResizableMinMax.h | 53 - src/ui/ResizableLib/ResizableMsgSupport.h | 61 - src/ui/ResizableLib/ResizableMsgSupport.inl | 56 - src/ui/ResizableLib/ResizablePage.cpp | 78 - src/ui/ResizableLib/ResizablePage.h | 78 - src/ui/ResizableLib/ResizableSheet.cpp | 355 - src/ui/ResizableLib/ResizableSheet.h | 114 - src/ui/ResizableLib/ResizableState.cpp | 111 - src/ui/ResizableLib/ResizableState.h | 38 - src/ui/ResizableLib/stdafx.cpp | 9 - src/ui/ResizableLib/stdafx.h | 21 - src/ui/TreePropSheet/PropPageFrame.cpp | 195 - src/ui/TreePropSheet/PropPageFrame.h | 306 - src/ui/TreePropSheet/PropPageFrameDefault.cpp | 399 - src/ui/TreePropSheet/PropPageFrameDefault.h | 119 - src/ui/TreePropSheet/TreePropSheet.cpp | 989 -- src/ui/TreePropSheet/TreePropSheet.h | 483 - src/ui/TreePropSheet/TreePropSheet.sln | 27 - src/ui/TreePropSheet/TreePropSheet.vcproj | 260 - src/ui/TreePropSheet/TreePropSheet_vs2005.sln | 25 - .../TreePropSheet/TreePropSheet_vs2005.vcproj | 328 - .../TreePropSheet/TreePropSheet_vs2008.vcproj | 329 - src/ui/TreePropSheet/stdafx.cpp | 8 - src/ui/TreePropSheet/stdafx.h | 18 - src/ui/sizecbar/scbarcf.cpp | 234 - src/ui/sizecbar/scbarcf.h | 78 - src/ui/sizecbar/scbarg.cpp | 242 - src/ui/sizecbar/scbarg.h | 114 - src/ui/sizecbar/sizecbar.cpp | 1419 --- src/ui/sizecbar/sizecbar.h | 250 - src/ui/sizecbar/sizecbar.sln | 27 - src/ui/sizecbar/sizecbar.vcproj | 255 - src/ui/sizecbar/sizecbar_vs2005.sln | 25 - src/ui/sizecbar/sizecbar_vs2005.vcproj | 338 - src/ui/sizecbar/sizecbar_vs2008.vcproj | 329 - src/ui/sizecbar/stdafx.cpp | 8 - src/ui/sizecbar/stdafx.h | 24 - src/ui/ui.h | 10 - src/ui/ui.sln | 63 - src/ui/ui_vs2005.sln | 55 - src/zlib/ChangeLog.txt | 855 -- src/zlib/Faq.txt | 339 - src/zlib/Readme.txt | 125 - src/zlib/ZLIB.DEF | 46 - src/zlib/ZLIB.RC | 32 - src/zlib/adler32.c | 149 - src/zlib/algorithm.txt | 209 - src/zlib/compress.c | 79 - src/zlib/crc32.c | 423 - src/zlib/crc32.h | 441 - src/zlib/deflate.c | 1736 --- src/zlib/deflate.h | 331 - src/zlib/gzio.c | 1026 -- src/zlib/infback.c | 623 - src/zlib/inffast.c | 318 - src/zlib/inffast.h | 11 - src/zlib/inffixed.h | 94 - src/zlib/inflate.c | 1368 -- src/zlib/inflate.h | 115 - src/zlib/inftrees.c | 329 - src/zlib/inftrees.h | 55 - src/zlib/minigzip.c | 322 - src/zlib/trees.c | 1219 -- src/zlib/trees.h | 128 - src/zlib/uncompr.c | 61 - src/zlib/zconf.h | 333 - src/zlib/zlib.h | 1357 -- src/zlib/zlib.sln | 21 - src/zlib/zlib.vcproj | 200 - src/zlib/zlib_vs2005.sln | 19 - src/zlib/zlib_vs2005.vcproj | 240 - src/zlib/zlib_vs2008.vcproj | 241 - src/zlib/zutil.c | 318 - src/zlib/zutil.h | 269 - 504 files changed, 205622 deletions(-) delete mode 100644 docs/FilterData.txt delete mode 100644 docs/todo/dvobsub.txt delete mode 100644 docs/todo/mpc.txt delete mode 100644 docs/todo/vsfilter.txt delete mode 100644 docs/todo/vsrip.txt delete mode 100644 include/IBitRateInfo.h delete mode 100644 include/IBufferInfo.h delete mode 100644 include/IChapterInfo.h delete mode 100644 include/IKeyFrameInfo.h delete mode 100644 include/ITrackInfo.h delete mode 100644 include/atl/atlcache.h delete mode 100644 include/atl/atlcrypt.h delete mode 100644 include/atl/atlcrypt.inl delete mode 100644 include/atl/atlextmgmt.h delete mode 100644 include/atl/atlhtml.h delete mode 100644 include/atl/atlhttp.h delete mode 100644 include/atl/atlhttp.inl delete mode 100644 include/atl/atlisapi.h delete mode 100644 include/atl/atlmime.h delete mode 100644 include/atl/atlperf.h delete mode 100644 include/atl/atlperf.inl delete mode 100644 include/atl/atlrx.h delete mode 100644 include/atl/atlserr.h delete mode 100644 include/atl/atlsession.h delete mode 100644 include/atl/atlsharedsvc.h delete mode 100644 include/atl/atlsiface.h delete mode 100644 include/atl/atlsmtpconnection.h delete mode 100644 include/atl/atlsmtputil.h delete mode 100644 include/atl/atlsoap.h delete mode 100644 include/atl/atlspriv.h delete mode 100644 include/atl/atlspriv.inl delete mode 100644 include/atl/atlsrv.rc delete mode 100644 include/atl/atlsrvres.h delete mode 100644 include/atl/atlstencil.h delete mode 100644 include/atl/l.chs/atlsrv.rc delete mode 100644 include/atl/l.cht/atlsrv.rc delete mode 100644 include/atl/l.deu/atlsrv.rc delete mode 100644 include/atl/l.esp/atlsrv.rc delete mode 100644 include/atl/l.fra/atlsrv.rc delete mode 100644 include/atl/l.ita/atlsrv.rc delete mode 100644 include/atl/l.jpn/atlsrv.rc delete mode 100644 include/atl/l.kor/atlsrv.rc delete mode 100644 include/atl/readme.txt delete mode 100644 include/atl/res/dllmgr.srf delete mode 100644 include/atl/res/stencilmgr.srf delete mode 100644 include/atl/res/threadmgr.srf delete mode 100644 include/aviutl/filter.h delete mode 100644 include/detours/detours.h delete mode 100644 include/dsm/dsm.h delete mode 100644 include/dsm/dsm.txt delete mode 100644 include/qedit.h delete mode 100644 include/realmedia/pnbastsd.h delete mode 100644 include/realmedia/pncom.h delete mode 100644 include/realmedia/pnresult.h delete mode 100644 include/realmedia/pntypes.h delete mode 100644 include/realmedia/pnwintyp.h delete mode 100644 include/realmedia/pxresult.h delete mode 100644 include/realmedia/rmaaconf.h delete mode 100644 include/realmedia/rmaallow.h delete mode 100644 include/realmedia/rmaasm.h delete mode 100644 include/realmedia/rmaausvc.h delete mode 100644 include/realmedia/rmaauth.h delete mode 100644 include/realmedia/rmaauthn.h delete mode 100644 include/realmedia/rmacfg.h delete mode 100644 include/realmedia/rmaclsnk.h delete mode 100644 include/realmedia/rmacmenu.h delete mode 100644 include/realmedia/rmacomm.h delete mode 100644 include/realmedia/rmacore.h delete mode 100644 include/realmedia/rmadb.h delete mode 100644 include/realmedia/rmadtcvt.h delete mode 100644 include/realmedia/rmaencod.h delete mode 100644 include/realmedia/rmaengin.h delete mode 100644 include/realmedia/rmaerror.h delete mode 100644 include/realmedia/rmaevent.h delete mode 100644 include/realmedia/rmafiles.h delete mode 100644 include/realmedia/rmaformt.h delete mode 100644 include/realmedia/rmagroup.h delete mode 100644 include/realmedia/rmahyper.h delete mode 100644 include/realmedia/rmaiids.h delete mode 100644 include/realmedia/rmalvpix.h delete mode 100644 include/realmedia/rmalvtxt.h delete mode 100644 include/realmedia/rmamon.h delete mode 100644 include/realmedia/rmapckts.h delete mode 100644 include/realmedia/rmapends.h delete mode 100644 include/realmedia/rmaphook.h delete mode 100644 include/realmedia/rmaplgns.h delete mode 100644 include/realmedia/rmaplugn.h delete mode 100644 include/realmedia/rmappv.h delete mode 100644 include/realmedia/rmaprefs.h delete mode 100644 include/realmedia/rmapsink.h delete mode 100644 include/realmedia/rmarendr.h delete mode 100644 include/realmedia/rmasite2.h delete mode 100644 include/realmedia/rmaslta.h delete mode 100644 include/realmedia/rmasrc.h delete mode 100644 include/realmedia/rmaupgrd.h delete mode 100644 include/realmedia/rmavalue.h delete mode 100644 include/realmedia/rmavsrc.h delete mode 100644 include/realmedia/rmavsurf.h delete mode 100644 include/realmedia/rmawin.h delete mode 100644 include/realmedia/rmaxmltg.h delete mode 100644 lib/detours/detours.lib delete mode 100644 lib/detours/detours.pdb delete mode 100644 lib/qt6/qtmlClient.lib delete mode 100644 lib/wm7/wmstub.lib delete mode 100644 mpc_vs2005.sln delete mode 100644 mpc_vs2008.sln delete mode 100644 src/apps/mplayerc/AuthDlg.cpp delete mode 100644 src/apps/mplayerc/AuthDlg.h delete mode 100644 src/apps/mplayerc/BaseGraph.cpp delete mode 100644 src/apps/mplayerc/BaseGraph.h delete mode 100644 src/apps/mplayerc/CShockwaveFlash.cpp delete mode 100644 src/apps/mplayerc/CShockwaveFlash.h delete mode 100644 src/apps/mplayerc/ChildView.cpp delete mode 100644 src/apps/mplayerc/ChildView.h delete mode 100644 src/apps/mplayerc/ComPropertyPage.cpp delete mode 100644 src/apps/mplayerc/ComPropertyPage.h delete mode 100644 src/apps/mplayerc/ComPropertySheet.cpp delete mode 100644 src/apps/mplayerc/ComPropertySheet.h delete mode 100644 src/apps/mplayerc/ConvertChapDlg.cpp delete mode 100644 src/apps/mplayerc/ConvertChapDlg.h delete mode 100644 src/apps/mplayerc/ConvertDlg.cpp delete mode 100644 src/apps/mplayerc/ConvertDlg.h delete mode 100644 src/apps/mplayerc/ConvertPropsDlg.cpp delete mode 100644 src/apps/mplayerc/ConvertPropsDlg.h delete mode 100644 src/apps/mplayerc/ConvertResDlg.cpp delete mode 100644 src/apps/mplayerc/ConvertResDlg.h delete mode 100644 src/apps/mplayerc/DX7AllocatorPresenter.cpp delete mode 100644 src/apps/mplayerc/DX7AllocatorPresenter.h delete mode 100644 src/apps/mplayerc/DX9AllocatorPresenter.cpp delete mode 100644 src/apps/mplayerc/DX9AllocatorPresenter.h delete mode 100644 src/apps/mplayerc/DeinterlacerFilter.cpp delete mode 100644 src/apps/mplayerc/DeinterlacerFilter.h delete mode 100644 src/apps/mplayerc/FGFilter.cpp delete mode 100644 src/apps/mplayerc/FGFilter.h delete mode 100644 src/apps/mplayerc/FGManager.cpp delete mode 100644 src/apps/mplayerc/FGManager.h delete mode 100644 src/apps/mplayerc/FakeFilterMapper2.cpp delete mode 100644 src/apps/mplayerc/FakeFilterMapper2.h delete mode 100644 src/apps/mplayerc/FavoriteAddDlg.cpp delete mode 100644 src/apps/mplayerc/FavoriteAddDlg.h delete mode 100644 src/apps/mplayerc/FavoriteOrganizeDlg.cpp delete mode 100644 src/apps/mplayerc/FavoriteOrganizeDlg.h delete mode 100644 src/apps/mplayerc/FileDropTarget.cpp delete mode 100644 src/apps/mplayerc/FileDropTarget.h delete mode 100644 src/apps/mplayerc/FloatEdit.cpp delete mode 100644 src/apps/mplayerc/FloatEdit.h delete mode 100644 src/apps/mplayerc/GoToDlg.cpp delete mode 100644 src/apps/mplayerc/GoToDlg.h delete mode 100644 src/apps/mplayerc/IGraphBuilder2.h delete mode 100644 src/apps/mplayerc/IPinHook.cpp delete mode 100644 src/apps/mplayerc/IPinHook.h delete mode 100644 src/apps/mplayerc/IQTVideoSurface.h delete mode 100644 src/apps/mplayerc/ISDb.cpp delete mode 100644 src/apps/mplayerc/ISDb.h delete mode 100644 src/apps/mplayerc/KeyProvider.cpp delete mode 100644 src/apps/mplayerc/KeyProvider.h delete mode 100644 src/apps/mplayerc/LineNumberEdit.cpp delete mode 100644 src/apps/mplayerc/LineNumberEdit.h delete mode 100644 src/apps/mplayerc/MacrovisionKicker.cpp delete mode 100644 src/apps/mplayerc/MacrovisionKicker.h delete mode 100644 src/apps/mplayerc/MainFrm.cpp delete mode 100644 src/apps/mplayerc/MainFrm.h delete mode 100644 src/apps/mplayerc/MediaFormats.cpp delete mode 100644 src/apps/mplayerc/MediaFormats.h delete mode 100644 src/apps/mplayerc/MediaTypesDlg.cpp delete mode 100644 src/apps/mplayerc/MediaTypesDlg.h delete mode 100644 src/apps/mplayerc/OpenCapDeviceDlg.cpp delete mode 100644 src/apps/mplayerc/OpenCapDeviceDlg.h delete mode 100644 src/apps/mplayerc/OpenDlg.cpp delete mode 100644 src/apps/mplayerc/OpenDlg.h delete mode 100644 src/apps/mplayerc/OpenFileDlg.cpp delete mode 100644 src/apps/mplayerc/OpenFileDlg.h delete mode 100644 src/apps/mplayerc/PPageAccelTbl.cpp delete mode 100644 src/apps/mplayerc/PPageAccelTbl.h delete mode 100644 src/apps/mplayerc/PPageAudioSwitcher.cpp delete mode 100644 src/apps/mplayerc/PPageAudioSwitcher.h delete mode 100644 src/apps/mplayerc/PPageBase.cpp delete mode 100644 src/apps/mplayerc/PPageBase.h delete mode 100644 src/apps/mplayerc/PPageDVD.cpp delete mode 100644 src/apps/mplayerc/PPageDVD.h delete mode 100644 src/apps/mplayerc/PPageExternalFilters.cpp delete mode 100644 src/apps/mplayerc/PPageExternalFilters.h delete mode 100644 src/apps/mplayerc/PPageFileInfoClip.cpp delete mode 100644 src/apps/mplayerc/PPageFileInfoClip.h delete mode 100644 src/apps/mplayerc/PPageFileInfoDetails.cpp delete mode 100644 src/apps/mplayerc/PPageFileInfoDetails.h delete mode 100644 src/apps/mplayerc/PPageFileInfoRes.cpp delete mode 100644 src/apps/mplayerc/PPageFileInfoRes.h delete mode 100644 src/apps/mplayerc/PPageFileInfoSheet.cpp delete mode 100644 src/apps/mplayerc/PPageFileInfoSheet.h delete mode 100644 src/apps/mplayerc/PPageFormats.cpp delete mode 100644 src/apps/mplayerc/PPageFormats.h delete mode 100644 src/apps/mplayerc/PPageInternalFilters.cpp delete mode 100644 src/apps/mplayerc/PPageInternalFilters.h delete mode 100644 src/apps/mplayerc/PPageLogo.cpp delete mode 100644 src/apps/mplayerc/PPageLogo.h delete mode 100644 src/apps/mplayerc/PPageOutput.cpp delete mode 100644 src/apps/mplayerc/PPageOutput.h delete mode 100644 src/apps/mplayerc/PPagePlayback.cpp delete mode 100644 src/apps/mplayerc/PPagePlayback.h delete mode 100644 src/apps/mplayerc/PPagePlayer.cpp delete mode 100644 src/apps/mplayerc/PPagePlayer.h delete mode 100644 src/apps/mplayerc/PPageSheet.cpp delete mode 100644 src/apps/mplayerc/PPageSheet.h delete mode 100644 src/apps/mplayerc/PPageSubDB.cpp delete mode 100644 src/apps/mplayerc/PPageSubDB.h delete mode 100644 src/apps/mplayerc/PPageSubStyle.cpp delete mode 100644 src/apps/mplayerc/PPageSubStyle.h delete mode 100644 src/apps/mplayerc/PPageSubtitles.cpp delete mode 100644 src/apps/mplayerc/PPageSubtitles.h delete mode 100644 src/apps/mplayerc/PPageTweaks.cpp delete mode 100644 src/apps/mplayerc/PPageTweaks.h delete mode 100644 src/apps/mplayerc/PPageWebServer.cpp delete mode 100644 src/apps/mplayerc/PPageWebServer.h delete mode 100644 src/apps/mplayerc/PixelShaderCompiler.cpp delete mode 100644 src/apps/mplayerc/PixelShaderCompiler.h delete mode 100644 src/apps/mplayerc/PlayerCaptureBar.cpp delete mode 100644 src/apps/mplayerc/PlayerCaptureBar.h delete mode 100644 src/apps/mplayerc/PlayerCaptureDialog.cpp delete mode 100644 src/apps/mplayerc/PlayerCaptureDialog.h delete mode 100644 src/apps/mplayerc/PlayerInfoBar.cpp delete mode 100644 src/apps/mplayerc/PlayerInfoBar.h delete mode 100644 src/apps/mplayerc/PlayerListCtrl.cpp delete mode 100644 src/apps/mplayerc/PlayerListCtrl.h delete mode 100644 src/apps/mplayerc/PlayerPlaylistBar.cpp delete mode 100644 src/apps/mplayerc/PlayerPlaylistBar.h delete mode 100644 src/apps/mplayerc/PlayerSeekBar.cpp delete mode 100644 src/apps/mplayerc/PlayerSeekBar.h delete mode 100644 src/apps/mplayerc/PlayerShaderEditorBar.cpp delete mode 100644 src/apps/mplayerc/PlayerShaderEditorBar.h delete mode 100644 src/apps/mplayerc/PlayerStatusBar.cpp delete mode 100644 src/apps/mplayerc/PlayerStatusBar.h delete mode 100644 src/apps/mplayerc/PlayerSubresyncBar.cpp delete mode 100644 src/apps/mplayerc/PlayerSubresyncBar.h delete mode 100644 src/apps/mplayerc/PlayerToolBar.cpp delete mode 100644 src/apps/mplayerc/PlayerToolBar.h delete mode 100644 src/apps/mplayerc/Playlist.cpp delete mode 100644 src/apps/mplayerc/Playlist.h delete mode 100644 src/apps/mplayerc/PnSPresetsDlg.cpp delete mode 100644 src/apps/mplayerc/PnSPresetsDlg.h delete mode 100644 src/apps/mplayerc/QuicktimeGraph.cpp delete mode 100644 src/apps/mplayerc/QuicktimeGraph.h delete mode 100644 src/apps/mplayerc/RealMediaGraph.cpp delete mode 100644 src/apps/mplayerc/RealMediaGraph.h delete mode 100644 src/apps/mplayerc/RealMediaWindowlessSite.cpp delete mode 100644 src/apps/mplayerc/RealMediaWindowlessSite.h delete mode 100644 src/apps/mplayerc/RegFilterChooserDlg.cpp delete mode 100644 src/apps/mplayerc/RegFilterChooserDlg.h delete mode 100644 src/apps/mplayerc/SaveDlg.cpp delete mode 100644 src/apps/mplayerc/SaveDlg.h delete mode 100644 src/apps/mplayerc/SaveTextFileDialog.cpp delete mode 100644 src/apps/mplayerc/SaveTextFileDialog.h delete mode 100644 src/apps/mplayerc/SaveThumbnailsDialog.cpp delete mode 100644 src/apps/mplayerc/SaveThumbnailsDialog.h delete mode 100644 src/apps/mplayerc/SelectMediaType.cpp delete mode 100644 src/apps/mplayerc/SelectMediaType.h delete mode 100644 src/apps/mplayerc/ShaderAutoCompleteDlg.cpp delete mode 100644 src/apps/mplayerc/ShaderAutoCompleteDlg.h delete mode 100644 src/apps/mplayerc/ShaderCombineDlg.cpp delete mode 100644 src/apps/mplayerc/ShaderCombineDlg.h delete mode 100644 src/apps/mplayerc/ShaderEditorDlg.cpp delete mode 100644 src/apps/mplayerc/ShaderEditorDlg.h delete mode 100644 src/apps/mplayerc/ShockwaveGraph.cpp delete mode 100644 src/apps/mplayerc/ShockwaveGraph.h delete mode 100644 src/apps/mplayerc/StaticLink.cpp delete mode 100644 src/apps/mplayerc/StaticLink.h delete mode 100644 src/apps/mplayerc/StatusLabel.cpp delete mode 100644 src/apps/mplayerc/StatusLabel.h delete mode 100644 src/apps/mplayerc/StdAfx.cpp delete mode 100644 src/apps/mplayerc/StdAfx.h delete mode 100644 src/apps/mplayerc/SubWCRev.conf delete mode 100644 src/apps/mplayerc/SubtitleDlDlg.cpp delete mode 100644 src/apps/mplayerc/SubtitleDlDlg.h delete mode 100644 src/apps/mplayerc/TextPassThruFilter.cpp delete mode 100644 src/apps/mplayerc/TextPassThruFilter.h delete mode 100644 src/apps/mplayerc/VolumeCtrl.cpp delete mode 100644 src/apps/mplayerc/VolumeCtrl.h delete mode 100644 src/apps/mplayerc/WebClientSocket.cpp delete mode 100644 src/apps/mplayerc/WebClientSocket.h delete mode 100644 src/apps/mplayerc/WebServer.cpp delete mode 100644 src/apps/mplayerc/WebServer.h delete mode 100644 src/apps/mplayerc/WebServerSocket.cpp delete mode 100644 src/apps/mplayerc/WebServerSocket.h delete mode 100644 src/apps/mplayerc/jpeg.cpp delete mode 100644 src/apps/mplayerc/jpeg.h delete mode 100644 src/apps/mplayerc/jpeg_tables.h delete mode 100644 src/apps/mplayerc/libpng.c delete mode 100644 src/apps/mplayerc/libpng.h delete mode 100644 src/apps/mplayerc/mplayerc.cpp delete mode 100644 src/apps/mplayerc/mplayerc.h delete mode 100644 src/apps/mplayerc/mplayerc.rc delete mode 100644 src/apps/mplayerc/mplayerc_vs2005.sln delete mode 100644 src/apps/mplayerc/mplayerc_vs2005.vcproj delete mode 100644 src/apps/mplayerc/mplayerc_vs2008.vcproj delete mode 100644 src/apps/mplayerc/pngdib.c delete mode 100644 src/apps/mplayerc/pngdib.h delete mode 100644 src/apps/mplayerc/res/Icon_114.ico delete mode 100644 src/apps/mplayerc/res/Icon_116.ico delete mode 100644 src/apps/mplayerc/res/Icon_41.ico delete mode 100644 src/apps/mplayerc/res/ani.avi delete mode 100644 src/apps/mplayerc/res/authhdrpic.bmp delete mode 100644 src/apps/mplayerc/res/icon.ico delete mode 100644 src/apps/mplayerc/res/logo.0.png delete mode 100644 src/apps/mplayerc/res/logo.1.png delete mode 100644 src/apps/mplayerc/res/logo.2.png delete mode 100644 src/apps/mplayerc/res/logo.3.png delete mode 100644 src/apps/mplayerc/res/logo.4.png delete mode 100644 src/apps/mplayerc/res/logo.5.png delete mode 100644 src/apps/mplayerc/res/logo.6.png delete mode 100644 src/apps/mplayerc/res/logo.7.png delete mode 100644 src/apps/mplayerc/res/mono.bmp delete mode 100644 src/apps/mplayerc/res/mpc.png delete mode 100644 src/apps/mplayerc/res/mplayerc.manifest delete mode 100644 src/apps/mplayerc/res/multi.ico delete mode 100644 src/apps/mplayerc/res/noaudio.bmp delete mode 100644 src/apps/mplayerc/res/onoff.bmp delete mode 100644 src/apps/mplayerc/res/shaders/EdgeSharpen.psh delete mode 100644 src/apps/mplayerc/res/shaders/SharpenComplex.psh delete mode 100644 src/apps/mplayerc/res/shaders/contour.psh delete mode 100644 src/apps/mplayerc/res/shaders/deinterlace (blend).psh delete mode 100644 src/apps/mplayerc/res/shaders/emboss.psh delete mode 100644 src/apps/mplayerc/res/shaders/empty.psh delete mode 100644 src/apps/mplayerc/res/shaders/grayscale.psh delete mode 100644 src/apps/mplayerc/res/shaders/invert.psh delete mode 100644 src/apps/mplayerc/res/shaders/letterbox.psh delete mode 100644 src/apps/mplayerc/res/shaders/levels.psh delete mode 100644 src/apps/mplayerc/res/shaders/nightvision.psh delete mode 100644 src/apps/mplayerc/res/shaders/procamp.psh delete mode 100644 src/apps/mplayerc/res/shaders/resizer.psh delete mode 100644 src/apps/mplayerc/res/shaders/sharpen.psh delete mode 100644 src/apps/mplayerc/res/shaders/sphere.psh delete mode 100644 src/apps/mplayerc/res/shaders/spotlight.psh delete mode 100644 src/apps/mplayerc/res/shaders/wave.psh delete mode 100644 src/apps/mplayerc/res/single.ico delete mode 100644 src/apps/mplayerc/res/stereo.bmp delete mode 100644 src/apps/mplayerc/res/streamtypes.bmp delete mode 100644 src/apps/mplayerc/res/toolbar1.bmp delete mode 100644 src/apps/mplayerc/res/web/1pix.gif delete mode 100644 src/apps/mplayerc/res/web/404.html delete mode 100644 src/apps/mplayerc/res/web/bottomside.png delete mode 100644 src/apps/mplayerc/res/web/browser.html delete mode 100644 src/apps/mplayerc/res/web/controlback.png delete mode 100644 src/apps/mplayerc/res/web/controlbuttondecrate.png delete mode 100644 src/apps/mplayerc/res/web/controlbuttonincrate.png delete mode 100644 src/apps/mplayerc/res/web/controlbuttonpause.png delete mode 100644 src/apps/mplayerc/res/web/controlbuttonplay.png delete mode 100644 src/apps/mplayerc/res/web/controlbuttonskipback.png delete mode 100644 src/apps/mplayerc/res/web/controlbuttonskipforward.png delete mode 100644 src/apps/mplayerc/res/web/controlbuttonstep.png delete mode 100644 src/apps/mplayerc/res/web/controlbuttonstop.png delete mode 100644 src/apps/mplayerc/res/web/controls.html delete mode 100644 src/apps/mplayerc/res/web/controlvolumebar.png delete mode 100644 src/apps/mplayerc/res/web/controlvolumegrip.png delete mode 100644 src/apps/mplayerc/res/web/controlvolumeoff.png delete mode 100644 src/apps/mplayerc/res/web/controlvolumeon.png delete mode 100644 src/apps/mplayerc/res/web/default.css delete mode 100644 src/apps/mplayerc/res/web/headerback.png delete mode 100644 src/apps/mplayerc/res/web/headerclose.png delete mode 100644 src/apps/mplayerc/res/web/headericon.png delete mode 100644 src/apps/mplayerc/res/web/index.html delete mode 100644 src/apps/mplayerc/res/web/leftbottomside.png delete mode 100644 src/apps/mplayerc/res/web/leftside.png delete mode 100644 src/apps/mplayerc/res/web/player.html delete mode 100644 src/apps/mplayerc/res/web/rightbottomside.png delete mode 100644 src/apps/mplayerc/res/web/rightside.png delete mode 100644 src/apps/mplayerc/res/web/seekbargrip.png delete mode 100644 src/apps/mplayerc/res/web/seekbarleft.png delete mode 100644 src/apps/mplayerc/res/web/seekbarmid.png delete mode 100644 src/apps/mplayerc/res/web/seekbarright.png delete mode 100644 src/apps/mplayerc/res/web/sliderback.gif delete mode 100644 src/apps/mplayerc/res/web/sliderbar.gif delete mode 100644 src/apps/mplayerc/res/web/slidergrip.gif delete mode 100644 src/apps/mplayerc/res/web/vbg.GIF delete mode 100644 src/apps/mplayerc/res/web/vbs.GIF delete mode 100644 src/apps/mplayerc/resource.h delete mode 100644 src/filters/FilterApp.cpp delete mode 100644 src/filters/FilterApp.h delete mode 100644 src/filters/InternalPropertyPage.cpp delete mode 100644 src/filters/InternalPropertyPage.h delete mode 100644 src/filters/PinInfoWnd.cpp delete mode 100644 src/filters/PinInfoWnd.h delete mode 100644 src/filters/filters.h delete mode 100644 src/filters/stdafx.cpp delete mode 100644 src/filters/stdafx.h delete mode 100644 src/libpng/LICENSE delete mode 100644 src/libpng/README delete mode 100644 src/libpng/libpng.txt delete mode 100644 src/libpng/libpng_vs2005.vcproj delete mode 100644 src/libpng/libpng_vs2008.vcproj delete mode 100644 src/libpng/png.c delete mode 100644 src/libpng/png.h delete mode 100644 src/libpng/pngconf.h delete mode 100644 src/libpng/pngerror.c delete mode 100644 src/libpng/pnggccrd.c delete mode 100644 src/libpng/pngget.c delete mode 100644 src/libpng/pngmem.c delete mode 100644 src/libpng/pngpread.c delete mode 100644 src/libpng/pngread.c delete mode 100644 src/libpng/pngrio.c delete mode 100644 src/libpng/pngrtran.c delete mode 100644 src/libpng/pngrutil.c delete mode 100644 src/libpng/pngset.c delete mode 100644 src/libpng/pngtest.c delete mode 100644 src/libpng/pngtrans.c delete mode 100644 src/libpng/pngwio.c delete mode 100644 src/libpng/pngwrite.c delete mode 100644 src/libpng/pngwtran.c delete mode 100644 src/libpng/pngwutil.c delete mode 100644 src/ui/CmdUI/CmdUI.cpp delete mode 100644 src/ui/CmdUI/CmdUI.h delete mode 100644 src/ui/CmdUI/CmdUI.sln delete mode 100644 src/ui/CmdUI/CmdUI.vcproj delete mode 100644 src/ui/CmdUI/CmdUI_vs2005.sln delete mode 100644 src/ui/CmdUI/CmdUI_vs2005.vcproj delete mode 100644 src/ui/CmdUI/CmdUI_vs2008.vcproj delete mode 100644 src/ui/CmdUI/stdafx.cpp delete mode 100644 src/ui/CmdUI/stdafx.h delete mode 100644 src/ui/ResizableLib/Artistic-License.txt delete mode 100644 src/ui/ResizableLib/ResizableDialog.cpp delete mode 100644 src/ui/ResizableLib/ResizableDialog.h delete mode 100644 src/ui/ResizableLib/ResizableGrip.cpp delete mode 100644 src/ui/ResizableLib/ResizableGrip.h delete mode 100644 src/ui/ResizableLib/ResizableLayout.cpp delete mode 100644 src/ui/ResizableLib/ResizableLayout.h delete mode 100644 src/ui/ResizableLib/ResizableLib.sln delete mode 100644 src/ui/ResizableLib/ResizableLib.vcproj delete mode 100644 src/ui/ResizableLib/ResizableLib_vs2005.sln delete mode 100644 src/ui/ResizableLib/ResizableLib_vs2005.vcproj delete mode 100644 src/ui/ResizableLib/ResizableLib_vs2008.vcproj delete mode 100644 src/ui/ResizableLib/ResizableMinMax.cpp delete mode 100644 src/ui/ResizableLib/ResizableMinMax.h delete mode 100644 src/ui/ResizableLib/ResizableMsgSupport.h delete mode 100644 src/ui/ResizableLib/ResizableMsgSupport.inl delete mode 100644 src/ui/ResizableLib/ResizablePage.cpp delete mode 100644 src/ui/ResizableLib/ResizablePage.h delete mode 100644 src/ui/ResizableLib/ResizableSheet.cpp delete mode 100644 src/ui/ResizableLib/ResizableSheet.h delete mode 100644 src/ui/ResizableLib/ResizableState.cpp delete mode 100644 src/ui/ResizableLib/ResizableState.h delete mode 100644 src/ui/ResizableLib/stdafx.cpp delete mode 100644 src/ui/ResizableLib/stdafx.h delete mode 100644 src/ui/TreePropSheet/PropPageFrame.cpp delete mode 100644 src/ui/TreePropSheet/PropPageFrame.h delete mode 100644 src/ui/TreePropSheet/PropPageFrameDefault.cpp delete mode 100644 src/ui/TreePropSheet/PropPageFrameDefault.h delete mode 100644 src/ui/TreePropSheet/TreePropSheet.cpp delete mode 100644 src/ui/TreePropSheet/TreePropSheet.h delete mode 100644 src/ui/TreePropSheet/TreePropSheet.sln delete mode 100644 src/ui/TreePropSheet/TreePropSheet.vcproj delete mode 100644 src/ui/TreePropSheet/TreePropSheet_vs2005.sln delete mode 100644 src/ui/TreePropSheet/TreePropSheet_vs2005.vcproj delete mode 100644 src/ui/TreePropSheet/TreePropSheet_vs2008.vcproj delete mode 100644 src/ui/TreePropSheet/stdafx.cpp delete mode 100644 src/ui/TreePropSheet/stdafx.h delete mode 100644 src/ui/sizecbar/scbarcf.cpp delete mode 100644 src/ui/sizecbar/scbarcf.h delete mode 100644 src/ui/sizecbar/scbarg.cpp delete mode 100644 src/ui/sizecbar/scbarg.h delete mode 100644 src/ui/sizecbar/sizecbar.cpp delete mode 100644 src/ui/sizecbar/sizecbar.h delete mode 100644 src/ui/sizecbar/sizecbar.sln delete mode 100644 src/ui/sizecbar/sizecbar.vcproj delete mode 100644 src/ui/sizecbar/sizecbar_vs2005.sln delete mode 100644 src/ui/sizecbar/sizecbar_vs2005.vcproj delete mode 100644 src/ui/sizecbar/sizecbar_vs2008.vcproj delete mode 100644 src/ui/sizecbar/stdafx.cpp delete mode 100644 src/ui/sizecbar/stdafx.h delete mode 100644 src/ui/ui.h delete mode 100644 src/ui/ui.sln delete mode 100644 src/ui/ui_vs2005.sln delete mode 100644 src/zlib/ChangeLog.txt delete mode 100644 src/zlib/Faq.txt delete mode 100644 src/zlib/Readme.txt delete mode 100644 src/zlib/ZLIB.DEF delete mode 100644 src/zlib/ZLIB.RC delete mode 100644 src/zlib/adler32.c delete mode 100644 src/zlib/algorithm.txt delete mode 100644 src/zlib/compress.c delete mode 100644 src/zlib/crc32.c delete mode 100644 src/zlib/crc32.h delete mode 100644 src/zlib/deflate.c delete mode 100644 src/zlib/deflate.h delete mode 100644 src/zlib/gzio.c delete mode 100644 src/zlib/infback.c delete mode 100644 src/zlib/inffast.c delete mode 100644 src/zlib/inffast.h delete mode 100644 src/zlib/inffixed.h delete mode 100644 src/zlib/inflate.c delete mode 100644 src/zlib/inflate.h delete mode 100644 src/zlib/inftrees.c delete mode 100644 src/zlib/inftrees.h delete mode 100644 src/zlib/minigzip.c delete mode 100644 src/zlib/trees.c delete mode 100644 src/zlib/trees.h delete mode 100644 src/zlib/uncompr.c delete mode 100644 src/zlib/zconf.h delete mode 100644 src/zlib/zlib.h delete mode 100644 src/zlib/zlib.sln delete mode 100644 src/zlib/zlib.vcproj delete mode 100644 src/zlib/zlib_vs2005.sln delete mode 100644 src/zlib/zlib_vs2005.vcproj delete mode 100644 src/zlib/zlib_vs2008.vcproj delete mode 100644 src/zlib/zutil.c delete mode 100644 src/zlib/zutil.h diff --git a/docs/FilterData.txt b/docs/FilterData.txt deleted file mode 100644 index 71772609e..000000000 --- a/docs/FilterData.txt +++ /dev/null @@ -1,18 +0,0 @@ -0000 02 00 00 00|01 00 80 00 -DWORD: format version? | DWORD: merit -0008 01 00 00 00|00 00 00 00 -DWORD: pin count | DWORD: ? -0010 3n|70 69|33|xx|00 00 00 -BYTE: 0x30+n, pin idx | WORD: 70 69, "pi" | BYTE: 0x33 (always?) | BYTE: (bit flags) 0 input, 8 output, 2 rendered, 1 allow none (unconfirmed), 4 allow many -0018 00 00 00 00|02 00 00 00 -DWORD: 0 | DWORD: type count -0020 00 00 00 00 00 00 00 00 -QWORD: 0 -0028 3n|74 79|33|00 00 00 00 -BYTE: 0x30+n, type idx | WORD: 74 79, "ty" | BYTE: 0x33 (always?) | DWORD: 0 -0030 38 00 00 00|48 00 00 00 -DWORD: major type offset | DWORD: subtype offset -0038 major type GUID ... -0040 ... major type GUID -0048 sub type GUID ... -0050 ... sub type GUID diff --git a/docs/todo/dvobsub.txt b/docs/todo/dvobsub.txt deleted file mode 100644 index db24bea22..000000000 --- a/docs/todo/dvobsub.txt +++ /dev/null @@ -1,5 +0,0 @@ -* stop sending ec_ole_event for external subs -* special sub file for redirecting to others, make it the only choice for web -* fix pitch probs with 180x... divx clip -- dragndrop subs to tray icon if possible -+ allow wildcards in search path, e.g. .\default.*.srt diff --git a/docs/todo/mpc.txt b/docs/todo/mpc.txt deleted file mode 100644 index 3f878e7db..000000000 --- a/docs/todo/mpc.txt +++ /dev/null @@ -1,71 +0,0 @@ -* accel table -* menu width -* new font chooser -* fix bbb.rm -* add cd/dvd loader to command line -* add functions for alt/ctrl/shift+wheel (alt:prev/next,ctrl:seekback/forw,shift:zoom in/out) -* shift+click seekbar seeks to keyframes -* save playlist -* enum audio outputs -* zoom presets -* toolbar presets -* dragndrop open video_ts.ifo as dvd -* also display frame size when displaying pannscan settings on status -* construct full path for playlist items -* menu/view/video frame/+50%,+200% -* open reg keys as readonly when possible for limited user accounts -* save capture bar/output to wav setting -* hide logo when going from one playlist item to another -* /add or /add /play to add to playlist -* vts*.ifo opening -* fullscreen resolution switch -* open whole dir with /cd too -* winlirc -* add more commands (e.g. dvd menu nav) and presets according to open *... modes -* add autolaunch handlers to reg -* open whole directory -* minimize to tray -* fix open dialog's filter -* avisynth's coinit workaround -* some mmx code in Rasterizer -* add secondary fullscreen to normal mode when resolution switching is enabled -* playlist/.. pos saving -* report media type when can't render pin -* calc autozoom window size incl.ing the sizing toolbars -* skip playlist items marked as invalid -* fix playlist playback order after dragndrop -* mark not openable files on the playlist (e.g. grayed out) after an error and do not open the again unless the user clicks them himself -* fix wm_appcommand for "usb soundcard speakers" -* menu/file/saveas... (cdda,cdxa,vts,other) -* dts reader reads ac3 too -* quicktime w/o activex -* audio switcher blocking OR returning error based on the stream -* offscreen rendering for quicktime -* remember last visited page in the options -* center window around the last center point when opening a new file with autozoom -* add dlg template to save subs in 8/16le/16be/utf8 encoding -* "ctrl+arrow" jump times in the options (for flash in frames), more levels, different commands for all of them -- activex -- seamless looping -- manually load filter when there are not rendered pins in the graph -- numpad +/- to ajdust audio timing -- open next/prev file in a directory when only one is on the playlist -+ right click menu on toolbars -+ tuner channel presets -+ rm/qt ripper -+ use playlist in dvd and capture mode -+ prebufferer reader filter -+ remember MRU sub/dub selection -+ open next file after "invalid" (done) and respect loop settings at the same time (not yet) -+ delete files from the playlist phisically (with yesno dialog) -* hook CreateFile to remove the share deny write flag with clsid_avidoc -+ hook dvd nav's reading and filter out all copy protection -* fix macrovision errors with the new detonators and the video renderers -+ replace the filters list box with treeview and list detailed info as the sub items -+ cue points, also modify the seekbar for it -+ make a subtitler filter for dvd subs and integrate it with the subtitle renderers -* search avi keyframes on a worker thread -+ auto-hide control bars in minimal mode -+ load winamp dsp plugins with the audio switcher -+ hook CreateFile and prebuffer files opened through (wireless) network using a worker thread for each. -+ "menu/play/goto last" AND/OR bookmarks to position only \ No newline at end of file diff --git a/docs/todo/vsfilter.txt b/docs/todo/vsfilter.txt deleted file mode 100644 index a07a87b24..000000000 --- a/docs/todo/vsfilter.txt +++ /dev/null @@ -1,2 +0,0 @@ -* special command for avisynth plugin to swap i420 and yv12 -* mod subpic to use bitsU/bitsV \ No newline at end of file diff --git a/docs/todo/vsrip.txt b/docs/todo/vsrip.txt deleted file mode 100644 index d3019e9e8..000000000 --- a/docs/todo/vsrip.txt +++ /dev/null @@ -1,2 +0,0 @@ -- detect menu vob or make it selectable -+ ALLVOBIDS \ No newline at end of file diff --git a/include/IBitRateInfo.h b/include/IBitRateInfo.h deleted file mode 100644 index d1eb116cd..000000000 --- a/include/IBitRateInfo.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#pragma once - -[uuid("EB2CD9E6-BA08-4acb-AA0F-3D8D0DD521CA")] -interface IBitRateInfo : public IUnknown -{ - STDMETHOD_(DWORD, GetCurrentBitRate) () = 0; - STDMETHOD_(DWORD, GetAverageBitRate) () = 0; -}; \ No newline at end of file diff --git a/include/IBufferInfo.h b/include/IBufferInfo.h deleted file mode 100644 index da72c1cca..000000000 --- a/include/IBufferInfo.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#pragma once - -[uuid("46070104-1318-4A82-8822-E99AB7CD15C1")] -interface IBufferInfo : public IUnknown -{ - STDMETHOD_(int, GetCount()) = 0; - STDMETHOD(GetStatus(int i, int& samples, int& size)) = 0; - STDMETHOD_(DWORD, GetPriority()) = 0; -}; \ No newline at end of file diff --git a/include/IChapterInfo.h b/include/IChapterInfo.h deleted file mode 100644 index 3cd126116..000000000 --- a/include/IChapterInfo.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - * Note: This interface was defined for the matroska container format - * originally, but can be implemented for other formats as well. - * - */ - -#pragma once - -typedef enum ChapterType { - AtomicChapter = 0, // only contain one element - SubChapter = 1, // contain a list of elements -}; - -#pragma pack(push, 1) -struct ChapterElement { - WORD Size; // size of this structure - BYTE Type; // see ChapterType - UINT ChapterId; // unique identifier for this element - REFERENCE_TIME rtStart; // REFERENCE_TIME in 100ns - REFERENCE_TIME rtStop; // REFERENCE_TIME in 100ns - struct ChapterElement() {Size = sizeof(*this);} -}; -struct ChapterElement2 : ChapterElement { - BOOL bDisabled; - struct ChapterElement2() {Size = sizeof(*this);} -}; -#pragma pack(pop) - -[uuid("8E128709-3DC8-4e49-B632-380FCF496B6D")] -interface IChapterInfo : public IUnknown -{ - #define CHAPTER_BAD_ID 0xFFFFFFFF - #define CHAPTER_ROOT_ID 0 - - // \param aChapterID is 0 for the top level one - STDMETHOD_(UINT, GetChapterCount) (UINT aChapterID) = 0; - - // \param aIndex start from 1 to GetChapterCount( aParentChapterId ) - STDMETHOD_(UINT, GetChapterId) (UINT aParentChapterId, UINT aIndex) = 0; - - STDMETHOD_(UINT, GetChapterCurrentId) () = 0; - - STDMETHOD_(BOOL, GetChapterInfo) (UINT aChapterID, struct ChapterElement* pStructureToFill) = 0; - - // \param PreferredLanguage Language code as in ISO-639-2 (3 chars) - // \param CountryCode Country code as in internet domains - STDMETHOD_(BSTR, GetChapterStringInfo) (UINT aChapterID, CHAR PreferredLanguage[3], CHAR CountryCode[2]) = 0; -}; \ No newline at end of file diff --git a/include/IKeyFrameInfo.h b/include/IKeyFrameInfo.h deleted file mode 100644 index fa40922f5..000000000 --- a/include/IKeyFrameInfo.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#pragma once - -[uuid("01A5BBD3-FE71-487C-A2EC-F585918A8724")] -interface IKeyFrameInfo : public IUnknown -{ - STDMETHOD (GetKeyFrameCount) (UINT& nKFs) = 0; // returns S_FALSE when every frame is a keyframe - STDMETHOD (GetKeyFrames) (const GUID* pFormat, REFERENCE_TIME* pKFs, UINT& nKFs /* in, out*/) = 0; -}; \ No newline at end of file diff --git a/include/ITrackInfo.h b/include/ITrackInfo.h deleted file mode 100644 index 59310d032..000000000 --- a/include/ITrackInfo.h +++ /dev/null @@ -1,61 +0,0 @@ -#pragma once - -typedef enum TrackType { - TypeVideo = 1, - TypeAudio = 2, - TypeComplex = 3, - TypeLogo = 0x10, - TypeSubtitle = 0x11, - TypeControl = 0x20 -}; - -#pragma pack(push, 1) - -struct TrackElement { - WORD Size; // Size of this structure - BYTE Type; // See TrackType - BOOL FlagDefault; // Set if the track is the default for its TrackType. - BOOL FlagLacing; // Set if the track may contain blocks using lacing. - UINT MinCache; // The minimum number of frames a player should be able to cache during playback. - UINT MaxCache; // The maximum cache size required to store referenced frames in and the current frame. 0 means no cache is needed. - CHAR Language[4]; // Specifies the language of the track, in the ISO-639-2 form. (end with '\0') -}; - -struct TrackExtendedInfoVideo { - WORD Size; // Size of this structure - BOOL Interlaced; // Set if the video is interlaced. - UINT PixelWidth; // Width of the encoded video frames in pixels. - UINT PixelHeight; // Height of the encoded video frames in pixels. - UINT DisplayWidth; // Width of the video frames to display. - UINT DisplayHeight; // Height of the video frames to display. - BYTE DisplayUnit; // Type of the unit for DisplayWidth/Height (0: pixels, 1: centimeters, 2: inches). - BYTE AspectRatioType; // Specify the possible modifications to the aspect ratio (0: free resizing, 1: keep aspect ratio, 2: fixed). -}; - -struct TrackExtendedInfoAudio { - WORD Size; // Size of this structure - FLOAT SamplingFreq; // Sampling frequency in Hz. - FLOAT OutputSamplingFrequency; // Real output sampling frequency in Hz (used for SBR techniques). - UINT Channels; // Numbers of channels in the track. - UINT BitDepth; // Bits per sample, mostly used for PCM. -}; - -#pragma pack(pop) - -[uuid("03E98D51-DDE7-43aa-B70C-42EF84A3A23D")] -interface ITrackInfo : public IUnknown -{ - STDMETHOD_(UINT, GetTrackCount) () = 0; - - // \param aTrackIdx the track index (from 0 to GetTrackCount()-1) - STDMETHOD_(BOOL, GetTrackInfo) (UINT aTrackIdx, struct TrackElement* pStructureToFill) = 0; - - // Get an extended information struct relative to the track type - STDMETHOD_(BOOL, GetTrackExtendedInfo) (UINT aTrackIdx, void* pStructureToFill) = 0; - - STDMETHOD_(BSTR, GetTrackCodecID) (UINT aTrackIdx) = 0; - STDMETHOD_(BSTR, GetTrackName) (UINT aTrackIdx) = 0; - STDMETHOD_(BSTR, GetTrackCodecName) (UINT aTrackIdx) = 0; - STDMETHOD_(BSTR, GetTrackCodecInfoURL) (UINT aTrackIdx) = 0; - STDMETHOD_(BSTR, GetTrackCodecDownloadURL) (UINT aTrackIdx) = 0; -}; diff --git a/include/atl/atlcache.h b/include/atl/atlcache.h deleted file mode 100644 index 7eacf9aa8..000000000 --- a/include/atl/atlcache.h +++ /dev/null @@ -1,3246 +0,0 @@ -// This is a part of the Active Template Library. -// Copyright (C) Microsoft Corporation -// All rights reserved. -// -// This source code is only intended as a supplement to the -// Active Template Library Reference and related -// electronic documentation provided with the library. -// See these sources for detailed information regarding the -// Active Template Library product. - -#ifndef __ATLCACHE_H__ -#define __ATLCACHE_H__ - -#pragma once - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#pragma warning (push) -#ifndef _ATL_NO_PRAGMA_WARNINGS -#pragma warning(disable: 4511) // copy constructor could not be generated -#pragma warning(disable: 4512) // assignment operator could not be generated -#endif //!_ATL_NO_PRAGMA_WARNINGS - -#pragma warning(disable: 4625) // copy constructor could not be generated because a base class copy constructor is inaccessible -#pragma warning(disable: 4626) // assignment operator could not be generated because a base class assignment operator is inaccessible - -#ifndef _CPPUNWIND -#pragma warning(disable: 4702) // unreachable code -#endif -#pragma pack(push,_ATL_PACKING) -namespace ATL { - -//forward declarations; -class CStdStatClass; -class CPerfStatClass; - -typedef struct __CACHEITEM -{ -} *HCACHEITEM; - -//Implementation of a cache that stores pointers to void -extern "C" __declspec(selectany) const IID IID_IMemoryCacheClient = {0xb721b49d, 0xbb57, 0x47bc, { 0xac, 0x43, 0xa8, 0xd4, 0xc0, 0x7d, 0x18, 0x3d } }; -extern "C" __declspec(selectany) const IID IID_IMemoryCache = { 0x9c6cfb46, 0xfbde, 0x4f8b, { 0xb9, 0x44, 0x2a, 0xa0, 0x5d, 0x96, 0xeb, 0x5c } }; -extern "C" __declspec(selectany) const IID IID_IMemoryCacheControl = { 0x7634b28b, 0xd819, 0x409d, { 0xb9, 0x6e, 0xfc, 0x9f, 0x3a, 0xba, 0x32, 0x9f } }; -extern "C" __declspec(selectany) const IID IID_IMemoryCacheStats = { 0xd4b6df2d, 0x4bc0, 0x4734, { 0x8a, 0xce, 0xb7, 0x3a, 0xb, 0x97, 0x59, 0x56 } }; - -__interface ATL_NO_VTABLE __declspec(uuid("b721b49d-bb57-47bc-ac43-a8d4c07d183d")) - IMemoryCacheClient : public IUnknown -{ - // IMemoryCacheClient methods - STDMETHOD( Free )(const void *pvData); -}; - -__interface ATL_NO_VTABLE __declspec(uuid("9c6cfb46-fbde-4f8b-b944-2aa05d96eb5c")) - IMemoryCache : public IUnknown -{ - // IMemoryCache Methods - STDMETHOD(Add)(LPCSTR szKey, void *pvData, DWORD dwSize, - FILETIME *pftExpireTime, - HINSTANCE hInstClient, HCACHEITEM *phEntry, - IMemoryCacheClient *pClient); - - STDMETHOD(LookupEntry)(LPCSTR szKey, HCACHEITEM * phEntry); - STDMETHOD(GetData)(const HCACHEITEM hEntry, void **ppvData, DWORD *pdwSize) const; - STDMETHOD(ReleaseEntry)(const HCACHEITEM hEntry); - STDMETHOD(RemoveEntry)(const HCACHEITEM hEntry); - STDMETHOD(RemoveEntryByKey)(LPCSTR szKey); - - STDMETHOD(Flush)(); -}; - -__interface ATL_NO_VTABLE __declspec(uuid("7634b28b-d819-409d-b96e-fc9f3aba329f")) - IMemoryCacheControl : public IUnknown -{ - // IMemoryCacheControl Methods - STDMETHOD(SetMaxAllowedSize)(DWORD dwSize); - STDMETHOD(GetMaxAllowedSize)(DWORD *pdwSize); - STDMETHOD(SetMaxAllowedEntries)(DWORD dwSize); - STDMETHOD(GetMaxAllowedEntries)(DWORD *pdwSize); - STDMETHOD(ResetCache)(); -}; - -__interface ATL_NO_VTABLE __declspec(uuid("d4b6df2d-4bc0-4734-8ace-b73a0b975956")) - IMemoryCacheStats : public IUnknown -{ - // IMemoryCacheStats Methods - STDMETHOD(ClearStats)(); - STDMETHOD(GetHitCount)(DWORD *pdwSize); - STDMETHOD(GetMissCount)(DWORD *pdwSize); - STDMETHOD(GetCurrentAllocSize)(DWORD *pdwSize); - STDMETHOD(GetMaxAllocSize)(DWORD *pdwSize); - STDMETHOD(GetCurrentEntryCount)(DWORD *pdwSize); - STDMETHOD(GetMaxEntryCount)(DWORD *pdwSize); - -}; - -struct DLL_CACHE_ENTRY -{ - HINSTANCE hInstDll; - DWORD dwRefs; - BOOL bAlive; - CHAR szDllName[MAX_PATH]; -}; - -inline bool operator==(const DLL_CACHE_ENTRY& entry1, const DLL_CACHE_ENTRY& entry2) -{ - return (entry1.hInstDll == entry2.hInstDll); -} - -// -// IDllCache -// An interface that is used to load and unload Dlls. -// -__interface ATL_NO_VTABLE __declspec(uuid("A12478AB-D261-42f9-B525-7589143C1C97")) - IDllCache : public IUnknown -{ - // IDllCache methods - virtual HINSTANCE Load(LPCSTR szFileName, void *pPeerInfo); - virtual BOOL Free(HINSTANCE hInstance); - virtual BOOL AddRefModule(HINSTANCE hInstance); - virtual BOOL ReleaseModule(HINSTANCE hInstance); - virtual HRESULT GetEntries(DWORD dwCount, DLL_CACHE_ENTRY *pEntries, DWORD *pdwCopied); - virtual HRESULT Flush(); -}; - -#ifndef ATL_CACHE_KEY_LENGTH -#define ATL_CACHE_KEY_LENGTH 128 -#endif - -typedef CFixedStringT CFixedStringKey; - -struct CFlusherCacheData -{ - CFlusherCacheData *pNext; - CFlusherCacheData *pPrev; - DWORD dwAccessed; - - CFlusherCacheData() - { - pNext = NULL; - pPrev = NULL; - dwAccessed = 0; - } -}; - -// No flusher -- only expired entries will be removed from the cache -// Also gives the skeleton for all of the flushers -class CNoFlusher -{ -public: - void Add(CFlusherCacheData * /*pItem*/) { } - void Remove(CFlusherCacheData * /*pItem*/) { } - void Access(CFlusherCacheData * /*pItem*/) { } - CFlusherCacheData * GetStart() const { return NULL; } - CFlusherCacheData * GetNext(CFlusherCacheData * /*pCur*/) const { return NULL; } - void Release(CFlusherCacheData * /*pItem*/){ } -}; - -// Old flusher -- oldest items are flushed first -class COldFlusher -{ -public: - CFlusherCacheData * pHead; - CFlusherCacheData * pTail; - - COldFlusher() : pHead(NULL), pTail(NULL) - { - } - - // Add it to the tail of the list - void Add(CFlusherCacheData * pItem) - { - ATLENSURE(pItem); - - pItem->pNext = NULL; - pItem->pPrev = pTail; - if (pHead) - { - pTail->pNext = pItem; - pTail = pItem; - } - else - { - pHead = pItem; - pTail = pItem; - } - } - - void Remove(CFlusherCacheData * pItem) - { - ATLENSURE(pItem); - - CFlusherCacheData * pPrev = pItem->pPrev; - CFlusherCacheData * pNext = pItem->pNext; - - if (pPrev) - pPrev->pNext = pNext; - else - pHead = pNext; - - if (pNext) - pNext->pPrev = pPrev; - else - pTail = pPrev; - - } - - void Access(CFlusherCacheData * /*pItem*/) - { - } - - void Release(CFlusherCacheData * /*pItem*/) - { - } - - CFlusherCacheData * GetStart() const - { - return pHead; - } - - CFlusherCacheData * GetNext(CFlusherCacheData * pCur) const - { - if (pCur != NULL) - return pCur->pNext; - else - return NULL; - } -}; - -// Least recently used flusher -- the item that was accessed the longest time ago is flushed -class CLRUFlusher : public COldFlusher -{ -public: - // Move it to the tail of the list - void Access(CFlusherCacheData * pItem) - { - ATLASSERT(pItem); - - Remove(pItem); - Add(pItem); - } -}; - -// Least often used flusher -class CLOUFlusher : public COldFlusher -{ -public: - // Adds to the tail of the list - void Add(CFlusherCacheData * pItem) - { - ATLENSURE(pItem); - pItem->dwAccessed = 1; - COldFlusher::Add(pItem); - } - - void Access(CFlusherCacheData * pItem) - { - ATLENSURE(pItem); - pItem->dwAccessed++; - - CFlusherCacheData * pMark = static_cast(pItem->pPrev); - if (!pMark) // The item is already at the head - return; - - if (pMark->dwAccessed >= pItem->dwAccessed) // The element before it has - return; // been accessed more times - - Remove(pItem); - - while (pMark && (pMark->dwAccessed < pItem->dwAccessed)) - pMark = static_cast(pMark->pPrev); - - // pMark points to the first element that has been accessed more times, - // so add pItem after pMark - if (pMark) - { - CFlusherCacheData *pNext = static_cast(pMark->pNext); - pMark->pNext = pItem; - pItem->pPrev = pMark; - - pItem->pNext = pNext; - pNext->pPrev = pItem; - } - else // Ran out of items -- put it on the head - { - pItem->pNext = pHead; - pItem->pPrev = NULL; - if (pHead) - pHead->pPrev = pItem; - else // the list was empty - pTail = pItem; - pHead = pItem; - } - } - - // We start at the tail and move forward for this flusher - CFlusherCacheData * GetStart() const - { - return pTail; - } - - CFlusherCacheData * GetNext(CFlusherCacheData * pCur) const - { - if (pCur != NULL) - return static_cast(pCur->pPrev); - else - return NULL; - } -}; - -template -class COrFlushers -{ - CFirst m_First; - CSecond m_Second; - BOOL m_bWhich; -public: - COrFlushers() - { - m_bWhich = FALSE; - } - - BOOL Switch() - { - m_bWhich = !m_bWhich; - return m_bWhich; - } - - void Add(CFlusherCacheData * pItem) - { - ATLASSERT(pItem); - m_First.Add(pItem); - m_Second.Add(pItem); - } - - void Remove(CFlusherCacheData * pItem) - { - ATLASSERT(pItem); - m_First.Remove(pItem); - m_Second.Remove(pItem); - } - - void Access(CFlusherCacheData * pItem) - { - ATLASSERT(pItem); - m_First.Access(pItem); - m_Second.Access(pItem); - } - void Release(CFlusherCacheData * pItem) - { - ATLASSERT(pItem); - m_First.Release(pItem); - m_Second.Release(pItem); - } - - CFlusherCacheData * GetStart() const - { - if (m_bWhich) - return m_First.GetStart(); - else - return m_Second.GetStart(); - } - - CFlusherCacheData * GetNext(CFlusherCacheData * pCur) const - { - if (m_bWhich) - return m_First.GetNext(pCur); - else - return m_Second.GetNext(pCur); - } -}; - -struct CCullerCacheData -{ - CCullerCacheData() - { - pNext = NULL; - pPrev = NULL; - nLifespan = 0; - } - CCullerCacheData *pNext; - CCullerCacheData *pPrev; - ULONGLONG nLifespan; - CFileTime cftExpireTime; -}; - -class CNoExpireCuller -{ -public: - void Add(CCullerCacheData * /*pItem*/) { } - void Commit(CCullerCacheData * /*pItem*/) { } - void Access(CCullerCacheData * /*pItem*/) { } - void Remove(CCullerCacheData * /*pItem*/) { } - void Start() { } - BOOL IsExpired(CCullerCacheData * /*pItem*/) { return FALSE; } - CCullerCacheData * GetExpired() { return NULL; } - void Release(CCullerCacheData * /*pItem*/){} - -}; - -class CExpireCuller -{ -public: - CFileTime m_cftCurrent; - CCullerCacheData *pHead; - CCullerCacheData *pTail; - - CExpireCuller() - { - pHead = NULL; - pTail = NULL; - } - - // Element is being added -- perform necessary initialization - void Add(CCullerCacheData * pItem) - { - (pItem); - ATLASSERT(pItem); - } - - // Expiration data has been set -- add to main list - // Head is the first item to expire - // a FILETIME of 0 indicates that the item should never expire - void Commit(CCullerCacheData * pItem) - { - ATLENSURE(pItem); - if (!pHead) - { - pHead = pItem; - pTail = pItem; - pItem->pNext = NULL; - pItem->pPrev = NULL; - return; - } - - if (CFileTime(pItem->cftExpireTime) == 0) - { - pTail->pNext = pItem; - pItem->pPrev = pTail; - pItem->pNext = NULL; - pTail = pItem; - return; - } - - CCullerCacheData * pMark = pHead; - while (pMark && (pMark->cftExpireTime < pItem->cftExpireTime)) - pMark = pMark->pNext; - - if (pMark) // An entry was found that expires after the added entry - { - CCullerCacheData *pPrev = pMark->pPrev; - if (pPrev) - pPrev->pNext = pItem; - else - pHead = pItem; - - pItem->pNext = pMark; - pItem->pPrev = pPrev; - pMark->pPrev = pItem; - } - else // Ran out of items -- put it on the tail - { - if (pTail) - pTail->pNext = pItem; - pItem->pPrev = pTail; - pItem->pNext = NULL; - pTail = pItem; - } - } - - void Access(CCullerCacheData * /*pItem*/) - { - } - - void Release(CCullerCacheData * /*pItem*/) - { - } - - void Remove(CCullerCacheData * pItem) - { - ATLENSURE(pItem); - CCullerCacheData *pPrev = pItem->pPrev; - CCullerCacheData *pNext = pItem->pNext; - - if (pPrev) - pPrev->pNext = pNext; - else - pHead = pNext; - - if (pNext) - pNext->pPrev = pPrev; - else - pTail = pPrev; - - } - - // About to start culling - void Start() - { - m_cftCurrent = CFileTime::GetCurrentTime(); - } - - BOOL IsExpired(CCullerCacheData *pItem) - { - if ((pItem->cftExpireTime != 0) && - m_cftCurrent > pItem->cftExpireTime) - return TRUE; - - return FALSE; - } - - // Get the next expired entry - CCullerCacheData * GetExpired() - { - if (!pHead) - return NULL; - if (IsExpired(pHead)) - return pHead; - - return NULL; - } -}; - -class CLifetimeCuller : public CExpireCuller -{ -public: - void Add(CCullerCacheData * pItem) - { - ATLENSURE(pItem); - pItem->nLifespan = 0; - CExpireCuller::Add(pItem); - } - - void Commit(CCullerCacheData * pItem) - { - ATLENSURE(pItem); - if (pItem->nLifespan == 0) - pItem->cftExpireTime = 0; - else - pItem->cftExpireTime = CFileTime(CFileTime::GetCurrentTime().GetTime() + pItem->nLifespan); - CExpireCuller::Commit(pItem); - } - - void Access(CCullerCacheData * pItem) - { - ATLASSERT(pItem); - CExpireCuller::Remove(pItem); - Commit(pItem); - } - - CCullerCacheData * GetExpired() - { - return static_cast(CExpireCuller::GetExpired()); - } -}; - -template <__int64 ftLifespan> -class CFixedLifetimeCuller : public CExpireCuller -{ -public: - void Commit(CCullerCacheData * pItem) - { - ATLASSERT(pItem); - __int64 nLifeSpan = ftLifespan; - if (nLifeSpan == 0) - pItem->cftExpireTime = 0; - else - pItem->cftExpireTime = CFileTime::GetCurrentTime() + CFileTimeSpan(ftLifespan); - - CExpireCuller::Commit(pItem); - } - - void Access(CCullerCacheData * pItem) - { - ATLASSERT(pItem); - CExpireCuller::Remove(pItem); - Commit(pItem); - } - - CCullerCacheData * GetExpired() - { - return static_cast(CExpireCuller::GetExpired()); - } -}; - - -template -class COrCullers -{ - CFirst m_First; - CSecond m_Second; -public: - void Add(CCullerCacheData * pItem) - { - m_First.Add(pItem); - m_Second.Add(pItem); - } - - void Access(CCullerCacheData * pItem) - { - m_First.Access(pItem); - m_Second.Access(pItem); - } - - void Remove(CCullerCacheData * pItem) - { - m_First.Remove(pItem); - m_Second.Remove(pItem); - } - - void Start() - { - m_First.Start(); - m_Second.Start(); - } - - void Release(CCullerCacheData *pItem) - { - m_First.Release(pItem); - m_Second.Release(pItem); - } - - void Commit(CCullerCacheData * pItem) - { - m_First.Commit(pItem); - m_Second.Commit(pItem); - } - CCullerCacheData * GetExpired() - { - CCullerCacheData *pItem = m_First.GetExpired(); - if (!pItem) - pItem = m_Second.GetExpired(); - - return pItem; - } - - BOOL IsExpired(CCullerCacheData * pItem) - { - return (m_First.IsExpired(pItem) || m_Second.IsExpired(pItem)); - } -}; - -// -//CMemoryCacheBase -// Description: -// This class provides the implementation of a generic cache that stores -// elements in memory. CMemoryCacheBase uses the CCacheDataBase generic -// cache element structure to hold items in the cache. The cache is -// implemented using the CAtlMap map class. CMemoryCache uses a wide -// character string as it's Key type to identify entries. Entries must -// have unique key values. If you try to add an entry with a key that -// is exactly the same as an existing key, the existing entry will be -// overwritten. -// -// Template Parameters: -// T: The class that inherits from this class. This class must implement -// void OnDestroyEntry(NodeType *pEntry); -// DataType: Specifies the type of the element to be stored in the memory -// cache such as CString or void* -// NodeInfo: Specifies any additional data that should be stored in each item -// in the cache -// keyType, keyTrait : specifies the key type and traits (see CAtlMap) -// Flusher : the class responsible for determining which data should be flushed -// when the cache is at a configuration limit -// Culler : the class responsible for determining which data should be removed -// from the cache due to expiration -// SyncClass:Specifies the class that will be used for thread synchronization -// when accessing the cache. The class interface for SyncClass must -// be identical to that of CComCriticalSection (see atlbase.h) -// StatClass: Class used to contain statistics about this cache. -template , - class Flusher=COldFlusher, - class Culler=CExpireCuller, - class SyncClass=CComCriticalSection, - class StatClass=CStdStatClass > - class CMemoryCacheBase -{ -protected: - typedef keyType keytype; - struct NodeType : public __CACHEITEM, - public NodeInfo, - public CFlusherCacheData, - public CCullerCacheData - { - NodeType() - { - pos = NULL; - dwSize = 0; - dwRef = 0; - } - - DataType Data; - POSITION pos; - DWORD dwSize; - DWORD dwRef; - }; - - typedef CAtlMap mapType; - SyncClass m_syncObj; - StatClass m_statObj; - Flusher m_flusher; - Culler m_culler; - - //memory cache configuration parameters - DWORD m_dwMaxAllocationSize; - DWORD m_dwMaxEntries; - - BOOL m_bInitialized; -public: - - mapType m_hashTable; - CMemoryCacheBase() : - m_dwMaxAllocationSize(0xFFFFFFFF), - m_dwMaxEntries(0xFFFFFFFF), - m_bInitialized(FALSE) - { - - } - - //Initializes the cache and the cache synchronization object - //Also the performance monitoring - HRESULT Initialize() - { - if (m_bInitialized) - return HRESULT_FROM_WIN32(ERROR_ALREADY_INITIALIZED); - HRESULT hr; - hr = m_syncObj.Init(); - - if (hr == S_OK) - hr = m_statObj.Initialize(); - - m_bInitialized = TRUE; - - return hr; - } - - //removes all entries whether or not they are initialized. - HRESULT Uninitialize() - { - if (!m_bInitialized) - return S_OK; - - //clear out the hash table - HRESULT hr = m_syncObj.Lock(); - if (FAILED(hr)) - return hr; - - RemoveAllEntries(); - m_statObj.Uninitialize(); - - m_syncObj.Unlock(); - m_syncObj.Term(); - - m_bInitialized = FALSE; - - return S_OK; - } - - //Adds an entry to the cache. - //Also, adds an initial reference on the entry if phEntry is not NULL - HRESULT AddEntry( - const keyType &Key, //key for entry - const DataType &data, //See the DataType template parameter - DWORD dwSize, //Size of memory to be stored in the cache - HCACHEITEM *phEntry = NULL //out pointer that will contain a handle to the new - //cache entry on success. - ) - { - _ATLTRY - { - ATLASSUME(m_bInitialized); - - CAutoPtr spEntry(new NodeType); - - if (!spEntry) - return E_OUTOFMEMORY; - - NodeType *pEntry = spEntry; - - //fill entry - if (phEntry) - { - *phEntry = static_cast(pEntry); - pEntry->dwRef++; - } - pEntry->Data = data; - pEntry->dwSize = dwSize; - - CComCritSecLock lock(m_syncObj, false); - - HRESULT hr = lock.Lock(); - if (FAILED(hr)) - { - return hr; - } - - POSITION pos = (POSITION)m_hashTable.Lookup(Key); - - if (pos != NULL) - { - RemoveAt(pos, FALSE); - m_hashTable.GetValueAt(pos) = pEntry; - } - else - { - pos = m_hashTable.SetAt(Key, pEntry); - } - spEntry.Detach(); - - pEntry->pos = pos; - m_statObj.AddElement(dwSize); - m_flusher.Add(pEntry); - m_culler.Add(pEntry); - - lock.Unlock(); - - if (!phEntry) - return CommitEntry(static_cast(pEntry)); - - return S_OK; - } - _ATLCATCHALL() - { - return E_FAIL; - } - } - - // Commits the entry to the cache - HRESULT CommitEntry(const HCACHEITEM hEntry) - { - ATLASSUME(m_bInitialized); - if (!hEntry || hEntry == INVALID_HANDLE_VALUE) - return E_INVALIDARG; - - HRESULT hr = m_syncObj.Lock(); - if (FAILED(hr)) - { - return hr; - } - - NodeType *pEntry = static_cast(hEntry); - m_culler.Commit(pEntry); - m_syncObj.Unlock(); - return S_OK; - } - - // Looks up an entry and returns a handle to it, - // also updates access count and reference count - HRESULT LookupEntry(const keyType &Key, HCACHEITEM * phEntry) - { - ATLASSUME(m_bInitialized); - HRESULT hr = m_syncObj.Lock(); - if (FAILED(hr)) - { - return hr; - } - - hr = E_FAIL; - - POSITION pos = (POSITION)m_hashTable.Lookup(Key); - if (pos != NULL) - { - NodeType * pEntry = m_hashTable.GetValueAt(pos); - m_flusher.Access(pEntry); - m_culler.Access(pEntry); - if (phEntry) - { - pEntry->dwRef++; - *phEntry = static_cast(pEntry); - } - - m_statObj.Hit(); - - hr = S_OK; - } - else - { - *phEntry = NULL; - m_statObj.Miss(); - } - m_syncObj.Unlock(); - - return hr; - } - - // Gets the data based on the handle. Is thread-safe as long as there is a - // reference on the data - HRESULT GetEntryData(const HCACHEITEM hEntry, DataType *pData, DWORD *pdwSize) const - { - ATLASSUME(m_bInitialized); - ATLASSERT(pData != NULL || pdwSize != NULL); // At least one should not be NULL - - if (!hEntry || hEntry == INVALID_HANDLE_VALUE) - return E_INVALIDARG; - - NodeType * pEntry = static_cast(hEntry); - if (pData) - *pData = pEntry->Data; - if (pdwSize) - *pdwSize = pEntry->dwSize; - - return S_OK; - } - - // Unreferences the entry based on the handle - DWORD ReleaseEntry(const HCACHEITEM hEntry) - { - ATLASSUME(m_bInitialized); - if (!hEntry || hEntry == INVALID_HANDLE_VALUE) - return (DWORD)-1; - - HRESULT hr = m_syncObj.Lock(); - if (FAILED(hr)) - return (DWORD)-1; - - NodeType * pEntry = static_cast(hEntry); - m_flusher.Release(pEntry); - m_culler.Release(pEntry); - ATLASSERT(pEntry->dwRef > 0); - - DWORD dwRef = --pEntry->dwRef; - if ((pEntry->pos == NULL) && (pEntry->dwRef == 0)) - InternalRemoveEntry(pEntry); - - m_syncObj.Unlock(); - - return dwRef; - } - - // Increments the entry's reference count - DWORD AddRefEntry(const HCACHEITEM hEntry) - { - ATLASSUME(m_bInitialized); - if (!hEntry || hEntry == INVALID_HANDLE_VALUE) - return (DWORD)-1; - - HRESULT hr = m_syncObj.Lock(); - if (FAILED(hr)) - return (DWORD)-1; - - NodeType * pEntry = static_cast(hEntry); - m_flusher.Access(pEntry); - m_culler.Access(pEntry); - DWORD dwRef = ++pEntry->dwRef; - m_syncObj.Unlock(); - - return dwRef; - } - - // Removes an entry from the cache regardless of whether or - // not it has expired. If there are references, it detaches - // the entry so that future lookups will fail, and when - // the ref count drops to zero, it will be deleted - HRESULT RemoveEntryByKey(const keyType &Key) - { - ATLASSUME(m_bInitialized); - HCACHEITEM hEntry; - HRESULT hr = LookupEntry(Key, &hEntry); - if (hr == S_OK) - hr = RemoveEntry(hEntry); - - return hr; - } - - // Removes the element from the cache. If there are still - // references, then the entry is detached. - HRESULT RemoveEntry(const HCACHEITEM hEntry) - { - ATLASSUME(m_bInitialized); - if (!hEntry || hEntry == INVALID_HANDLE_VALUE) - return E_INVALIDARG; - - _ATLTRY - { - CComCritSecLock lock(m_syncObj, false); - - HRESULT hr = lock.Lock(); - if (FAILED(hr)) - return hr; - - NodeType * pEntry = static_cast(hEntry); - m_flusher.Release(pEntry); - m_culler.Release(pEntry); - ATLASSERT(pEntry->dwRef > 0); - pEntry->dwRef--; - if (pEntry->pos) - RemoveAt(pEntry->pos, TRUE); - else if ((long)pEntry->dwRef == 0) - InternalRemoveEntry(pEntry); - lock.Unlock(); - } - _ATLCATCHALL() - { - return E_OUTOFMEMORY; - } - - return S_OK; - } - - // CullEntries removes all expired items - HRESULT CullEntries() - { - ATLASSUME(m_bInitialized); - - _ATLTRY - { - CComCritSecLock lock(m_syncObj, false); - HRESULT hr = lock.Lock(); - if (FAILED(hr)) - return hr; - - m_culler.Start(); - - while (NodeType *pNode = static_cast(m_culler.GetExpired())) - RemoveAt(pNode->pos, TRUE); - - lock.Unlock(); - } - _ATLCATCHALL() - { - return E_OUTOFMEMORY; - } - - return S_OK; - } - - // FlushEntries reduces the cache to meet the configuration requirements - HRESULT FlushEntries() - { - ATLASSUME(m_bInitialized); - HRESULT hr = CullEntries(); - if (FAILED(hr)) - return hr; - - _ATLTRY - { - CComCritSecLock lock(m_syncObj, false); - hr = lock.Lock(); - if (FAILED(hr)) - return hr; - - NodeType * pNode = static_cast(m_flusher.GetStart()); - - while (pNode && - (((m_statObj.GetCurrentEntryCount() > m_dwMaxEntries)) || - ((m_statObj.GetCurrentAllocSize() > m_dwMaxAllocationSize)))) - { - NodeType *pNext = static_cast(m_flusher.GetNext(pNode)); - - if (pNode->dwRef == 0) - RemoveAt(pNode->pos, TRUE); - - pNode = pNext; - } - lock.Unlock(); - } - _ATLCATCHALL() - { - return E_OUTOFMEMORY; - } - - return S_OK; - } - - HRESULT STDMETHODCALLTYPE SetMaxAllowedSize(DWORD dwSize) - { - m_dwMaxAllocationSize = dwSize; - return S_OK; - } - - HRESULT STDMETHODCALLTYPE GetMaxAllowedSize(DWORD *pdwSize) - { - if (!pdwSize) - return E_POINTER; - *pdwSize = m_dwMaxAllocationSize; - return S_OK; - } - - HRESULT STDMETHODCALLTYPE SetMaxAllowedEntries(DWORD dwSize) - { - m_dwMaxEntries = dwSize; - return S_OK; - } - - HRESULT STDMETHODCALLTYPE GetMaxAllowedEntries(DWORD *pdwSize) - { - if (!pdwSize) - return E_POINTER; - *pdwSize = m_dwMaxEntries; - return S_OK; - } - - - HRESULT ResetCache() - { - ATLASSUME(m_bInitialized); - HRESULT hr = E_UNEXPECTED; - if (SUCCEEDED(ClearStats())) - hr = RemoveAllEntries(); - return hr; - } - - HRESULT ClearStats() - { - m_statObj.ResetCounters(); - return S_OK; - } - - HRESULT RemoveAllEntries() - { - ATLASSUME(m_bInitialized); - HRESULT hr = m_syncObj.Lock(); - if (FAILED(hr)) - return hr; - - m_hashTable.DisableAutoRehash(); - POSITION pos = m_hashTable.GetStartPosition(); - POSITION oldpos; - while (pos != NULL) - { - oldpos = pos; - m_hashTable.GetNext(pos); - RemoveAt(oldpos, TRUE); - } - m_hashTable.EnableAutoRehash(); - m_syncObj.Unlock(); - - return S_OK; - } - -protected: - - // Checks to see if the cache can accommodate any new entries within - // its allocation and entry count limits. - bool CanAddEntry(DWORD dwSizeToAdd) - { - return CheckAlloc(dwSizeToAdd) && CheckEntryCount(1); - } - - // Checks to see if the cache can accommodate dwSizeToAdd additional - // allocation within its allocation limit. - bool CheckAlloc(DWORD dwSizeToAdd) - { - if (m_dwMaxAllocationSize == 0xFFFFFFFF) - return true; //max allocation size setting hasn't been set - DWORD dwNew = m_statObj.GetCurrentAllocSize() + dwSizeToAdd; - return dwNew < m_dwMaxAllocationSize; - } - - - // Checks to see if the cache can accommodate dwNumEntriesToAdd - // additional entries within its limits. - bool CheckEntryCount(DWORD dwNumEntriesToAdd) - { - if (m_dwMaxEntries == 0xFFFFFFFF) - return true; //max entry size hasn't been set - DWORD dwNew = m_statObj.GetCurrentEntryCount() + dwNumEntriesToAdd; - return dwNew < m_dwMaxEntries; - - } - -protected: - // Takes the element at pos in the hash table and removes it from - // the cache. If there are no references, then the entry is - // deleted, otherwise it is deleted by ReleaseEntry when the - // refcount goes to zero. - HRESULT RemoveAt(POSITION pos, BOOL bDelete) - { - HRESULT hr = S_OK; - ATLASSERT(pos != NULL); - NodeType * pEntry = m_hashTable.GetValueAt(pos); - m_flusher.Remove(pEntry); - m_culler.Remove(pEntry); - if (bDelete) - m_hashTable.RemoveAtPos(pos); - - if ((long)pEntry->dwRef == 0) - hr = InternalRemoveEntry(pEntry); - else - pEntry->pos = NULL; - - return S_OK; - } - - // Does the actual destruction of the node. Deletes the - // NodeType struct and calls the inherited class's - // OnDestroyEntry function, where other necessary destruction - // can take place. Also updates the cache statistics. - // Inherited classes should call RemoveAt unless the element's - // refcount is zero and it has been removed from the - // culler and flusher lists. - HRESULT InternalRemoveEntry(NodeType * pEntry) - { - ATLENSURE(pEntry != NULL); - - T* pT = static_cast(this); - - ATLASSERT((long)pEntry->dwRef == 0); - - pT->OnDestroyEntry(pEntry); - - m_statObj.ReleaseElement(pEntry->dwSize); - - delete pEntry; - - return S_OK; - } -}; // CMemoryCacheBase - -class CCacheDataBase -{ -}; - -struct CCacheDataEx : public CCacheDataBase -{ - CCacheDataEx() - { - hInstance = NULL; - pClient = NULL; - } - - HINSTANCE hInstance; - IMemoryCacheClient * pClient; -}; - - -template , - class SyncClass=CComCriticalSection, - class CullClass=CExpireCuller > -class CMemoryCache: - public CMemoryCacheBase, DataType, CCacheDataEx, - keyType, KeyTrait, FlushClass, CullClass, SyncClass, StatClass> -{ -protected: - CComPtr m_spServiceProv; - CComPtr m_spDllCache; - typedef CMemoryCacheBase, DataType, CCacheDataEx, - keyType, KeyTrait, FlushClass, CullClass, SyncClass, StatClass> baseClass; -public: - virtual ~CMemoryCache() - { - } - - HRESULT Initialize(IServiceProvider * pProvider) - { - baseClass::Initialize(); - m_spServiceProv = pProvider; - if (pProvider) - return m_spServiceProv->QueryService(__uuidof(IDllCache), __uuidof(IDllCache), (void**)&m_spDllCache); - else - return S_OK; - } - - HRESULT AddEntry( - const keyType &Key, - const DataType &data, - DWORD dwSize, - FILETIME * pftExpireTime = NULL, - HINSTANCE hInstance = NULL, - IMemoryCacheClient * pClient = NULL, - HCACHEITEM *phEntry = NULL - ) - { - _ATLTRY - { - HRESULT hr; - NodeType * pEntry = NULL; - hr = baseClass::AddEntry(Key, data, dwSize, (HCACHEITEM *)&pEntry); - if (hr != S_OK) - return hr; - - pEntry->hInstance = hInstance; - pEntry->pClient = pClient; - if (pftExpireTime) - pEntry->cftExpireTime = *pftExpireTime; - - if (hInstance && m_spDllCache) - m_spDllCache->AddRefModule(hInstance); - - baseClass::CommitEntry(static_cast(pEntry)); - - if (phEntry) - *phEntry = static_cast(pEntry); - else - baseClass::ReleaseEntry(static_cast(pEntry)); - - return S_OK; - } - _ATLCATCHALL() - { - return E_FAIL; - } - } - - virtual void OnDestroyEntry(const NodeType * pEntry) - { - ATLASSERT(pEntry); - if (!pEntry) - return; - - if (pEntry->pClient) - pEntry->pClient->Free((void *)&pEntry->Data); - if (pEntry->hInstance && m_spDllCache) - m_spDllCache->ReleaseModule(pEntry->hInstance); - } -}; // CMemoryCache - -// CStdStatData - contains the data that CStdStatClass keeps track of -#define ATL_PERF_CACHE_OBJECT 100 - -struct CPerfStatObject : public CPerfObject -{ - DECLARE_PERF_CATEGORY(CPerfStatObject, ATL_PERF_CACHE_OBJECT, IDS_PERFMON_CACHE, IDS_PERFMON_CACHE_HELP, -1); - - BEGIN_COUNTER_MAP(CPerfStatObject) - DEFINE_COUNTER(m_nHitCount, IDS_PERFMON_HITCOUNT, IDS_PERFMON_HITCOUNT_HELP, PERF_COUNTER_RAWCOUNT, -1) - DEFINE_COUNTER(m_nMissCount, IDS_PERFMON_MISSCOUNT, IDS_PERFMON_MISSCOUNT_HELP, PERF_COUNTER_RAWCOUNT, -1) - DEFINE_COUNTER(m_nCurrentAllocations, IDS_PERFMON_CURRENTALLOCATIONS, IDS_PERFMON_CURRENTALLOCATIONS_HELP, PERF_COUNTER_RAWCOUNT, -3) - DEFINE_COUNTER(m_nMaxAllocations, IDS_PERFMON_MAXALLOCATIONS, IDS_PERFMON_MAXALLOCATIONS_HELP, PERF_COUNTER_RAWCOUNT, -3) - DEFINE_COUNTER(m_nCurrentEntries, IDS_PERFMON_CURRENTENTRIES, IDS_PERFMON_CURRENTENTRIES_HELP, PERF_COUNTER_RAWCOUNT, -1) - DEFINE_COUNTER(m_nMaxEntries, IDS_PERFMON_MAXENTRIES, IDS_PERFMON_MAXENTRIES_HELP, PERF_COUNTER_RAWCOUNT, -1) - END_COUNTER_MAP() - - long m_nHitCount; - long m_nMissCount; - long m_nCurrentAllocations; - long m_nMaxAllocations; - long m_nCurrentEntries; - long m_nMaxEntries; -}; - -// CCachePerfMon - the interface to CPerfMon, with associated definitions -class CCachePerfMon : public CPerfMon -{ -public: - BEGIN_PERF_MAP(_T("ATL Server:Cache")) - CHAIN_PERF_CATEGORY(CPerfStatObject) - END_PERF_MAP() -}; - -// -//CStdStatClass -// Description -// This class provides the implementation of a standard cache statistics accounting class -class CStdStatClass -{ -protected: - CPerfStatObject* m_pStats; - CPerfStatObject m_stats; - -public: - - CStdStatClass() - { - m_pStats = &m_stats; - } - - // This function is not thread safe by design - HRESULT Initialize(CPerfStatObject* pStats = NULL) - { - if (pStats) - m_pStats = pStats; - else - m_pStats = &m_stats; - - ResetCounters(); - return S_OK; - } - - // This function is not thread safe by design - HRESULT Uninitialize() - { - m_pStats = &m_stats; - return S_OK; - } - - void Hit() - { - InterlockedIncrement(&m_pStats->m_nHitCount); - } - - void Miss() - { - InterlockedIncrement(&m_pStats->m_nMissCount); - } - - void AddElement(DWORD dwBytes) - { - DWORD nCurrentEntries = InterlockedIncrement(&m_pStats->m_nCurrentEntries); - AtlInterlockedUpdateMax(nCurrentEntries, &m_pStats->m_nMaxEntries); - - DWORD nCurrentAllocations = dwBytes + AtlInterlockedExchangeAdd(&m_pStats->m_nCurrentAllocations, dwBytes); - AtlInterlockedUpdateMax(nCurrentAllocations, &m_pStats->m_nMaxAllocations); - } - - void ReleaseElement(DWORD dwBytes) - { - InterlockedDecrement(&m_pStats->m_nCurrentEntries); - AtlInterlockedExchangeAdd(&m_pStats->m_nCurrentAllocations, -((long)dwBytes)); - } - - DWORD GetHitCount() - { - return m_pStats->m_nHitCount; - } - - DWORD GetMissCount() - { - return m_pStats->m_nMissCount; - } - - DWORD GetCurrentAllocSize() - { - return m_pStats->m_nCurrentAllocations; - } - - DWORD GetMaxAllocSize() - { - return m_pStats->m_nMaxAllocations; - } - - DWORD GetCurrentEntryCount() - { - return m_pStats->m_nCurrentEntries; - } - - DWORD GetMaxEntryCount() - { - return m_pStats->m_nMaxEntries; - } - - void ResetCounters() - { - m_pStats->m_nHitCount = 0; - m_pStats->m_nMissCount = 0; - m_pStats->m_nCurrentAllocations = 0; - m_pStats->m_nMaxAllocations = 0; - m_pStats->m_nCurrentEntries = 0; - m_pStats->m_nMaxEntries = 0; - } -}; // CStdStatClass - -// -// CNoStatClass -// This is a noop stat class -class CNoStatClass -{ -public: - HRESULT Initialize(){ return S_OK; } - HRESULT Uninitialize(){ return S_OK; } - void Hit(){ } - void Miss(){ } - void AddElement(DWORD){ } - void ReleaseElement(DWORD){ } - DWORD GetHitCount(){ return 0; } - DWORD GetMissCount(){ return 0; } - DWORD GetCurrentAllocSize(){ return 0; } - DWORD GetMaxAllocSize(){ return 0; } - DWORD GetCurrentEntryCount(){ return 0; } - DWORD GetMaxEntryCount(){ return 0; } - void ResetCounters(){ } -}; // CNoStatClass - -// -//CPerfStatClass -// Description -// This class provides the implementation of a cache statistics gathering class -// with PerfMon support -class CPerfStatClass : public CStdStatClass -{ - CPerfStatObject * m_pPerfObject; - CCachePerfMon m_PerfMon; - -public: - - HRESULT Initialize(__in_z_opt LPWSTR szName=NULL) - { - HRESULT hr; - WCHAR szPath[MAX_PATH]; - - if (!szName) - { - // default name is the name of the module - // we don't care about possible truncation if longer than max_path - // we just need an identifier - HINSTANCE hInst = _AtlBaseModule.GetModuleInstance(); - if (::GetModuleFileNameW(hInst, szPath, MAX_PATH) == 0) - { - return E_FAIL; - } - szPath[MAX_PATH-1] = 0; - szName = szPath; - } - - m_pPerfObject = NULL; - ATLTRACE(atlTraceCache, 2, _T("Initializing m_PerfMon\n")); - hr = m_PerfMon.Initialize(); - if (SUCCEEDED(hr)) - { - CPerfLock lock(&m_PerfMon); - if (FAILED(hr = lock.GetStatus())) - { - return hr; - } - - hr = m_PerfMon.CreateInstance(ATL_PERF_CACHE_OBJECT, 0, szName, reinterpret_cast(&m_pPerfObject)); - if (FAILED(hr)) - { - return hr; - } - - CStdStatClass::Initialize(m_pPerfObject); - } - else - ATLASSUME(m_pPerfObject == NULL); - - return hr; - } - - HRESULT Uninitialize() - { - CStdStatClass::Uninitialize(); - - if (m_pPerfObject != NULL) // Initialized m_pPerfObject successfully above - { - HRESULT hr = m_PerfMon.ReleaseInstance(m_pPerfObject); - if (hr != S_OK) - return hr; - - m_PerfMon.UnInitialize(); - } - - return S_OK; - } -}; // CPerfStatClass - -#ifndef ATL_BLOB_CACHE_TIMEOUT -#ifdef _DEBUG -#define ATL_BLOB_CACHE_TIMEOUT 1000 -#else -#define ATL_BLOB_CACHE_TIMEOUT 5000 -#endif // _DEBUG -#endif // ATL_BLOB_CACHE_TIMEOUT - -// -//CBlobCache -// Description: -// Implements a cache that stores pointers to void. Uses the generic CMemoryCacheBase class -// as the implementation. -template -class CBlobCache : public CMemoryCache, SyncObj, CullClass>, - public IMemoryCache, - public IMemoryCacheControl, - public IMemoryCacheStats, - public IWorkerThreadClient -{ - typedef CMemoryCache, SyncObj, CullClass> cacheBase; - - MonitorClass m_Monitor; - -protected: - HANDLE m_hTimer; - -public: - CBlobCache() : m_hTimer(NULL) - { - } - - HRESULT Initialize(IServiceProvider *pProv) - { - HRESULT hr = cacheBase::Initialize(pProv); - if (FAILED(hr)) - return hr; - hr = m_Monitor.Initialize(); - if (FAILED(hr)) - return hr; - return m_Monitor.AddTimer(ATL_BLOB_CACHE_TIMEOUT, - static_cast(this), (DWORD_PTR) this, &m_hTimer); - } - - template - HRESULT Initialize(IServiceProvider *pProv, CWorkerThread *pWorkerThread) - { - ATLASSERT(pWorkerThread); - - HRESULT hr = cacheBase::Initialize(pProv); - if (FAILED(hr)) - return hr; - - hr = m_Monitor.Initialize(pWorkerThread); - if (FAILED(hr)) - return hr; - - return m_Monitor.AddTimer(ATL_BLOB_CACHE_TIMEOUT, - static_cast(this), (DWORD_PTR) this, &m_hTimer); - } - - HRESULT Execute(DWORD_PTR dwParam, HANDLE /*hObject*/) - { - CBlobCache* pCache = (CBlobCache*)dwParam; - - if (pCache) - pCache->Flush(); - return S_OK; - } - - HRESULT CloseHandle(HANDLE hObject) - { - ATLASSUME(m_hTimer == hObject); - m_hTimer = NULL; - ::CloseHandle(hObject); - return S_OK; - } - - virtual ~CBlobCache() - { - if (m_hTimer) - { - ATLENSURE(SUCCEEDED(m_Monitor.RemoveHandle(m_hTimer))); - } - } - - HRESULT Uninitialize() - { - HRESULT hrMonitor=S_OK; - if (m_hTimer) - { - hrMonitor=m_Monitor.RemoveHandle(m_hTimer); - m_hTimer = NULL; - } - HRESULT hrShut=m_Monitor.Shutdown(); - HRESULT hrCache=cacheBase::Uninitialize(); - if(FAILED(hrMonitor)) - { - return hrMonitor; - } - if(FAILED(hrShut)) - { - return hrShut; - } - return hrCache; - } - // IUnknown methods - HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void **ppv) - { - HRESULT hr = E_NOINTERFACE; - if (!ppv) - hr = E_POINTER; - else - { - if (InlineIsEqualGUID(riid, __uuidof(IUnknown)) || - InlineIsEqualGUID(riid, __uuidof(IMemoryCache))) - { - *ppv = (IUnknown *) (IMemoryCache *) this; - AddRef(); - hr = S_OK; - } - if (InlineIsEqualGUID(riid, __uuidof(IMemoryCacheStats))) - { - *ppv = (IUnknown *) (IMemoryCacheStats*)this; - AddRef(); - hr = S_OK; - } - if (InlineIsEqualGUID(riid, __uuidof(IMemoryCacheControl))) - { - *ppv = (IUnknown *) (IMemoryCacheControl*)this; - AddRef(); - hr = S_OK; - } - - } - return hr; - } - - ULONG STDMETHODCALLTYPE AddRef() - { - return 1; - } - - ULONG STDMETHODCALLTYPE Release() - { - return 1; - } - - // IMemoryCache Methods - HRESULT STDMETHODCALLTYPE Add(LPCSTR szKey, void *pvData, DWORD dwSize, - FILETIME *pftExpireTime, - HINSTANCE hInstClient, - HCACHEITEM *phEntry, - IMemoryCacheClient *pClient) - { - HRESULT hr = E_FAIL; - //if it's a multithreaded cache monitor we'll let the monitor take care of - //cleaning up the cache so we don't overflow our configuration settings. - //if it's not a threaded cache monitor, we need to make sure we don't - //overflow the configuration settings by adding a new element - if (m_Monitor.GetThreadHandle()==NULL) - { - if (!cacheBase::CanAddEntry(dwSize)) - { - //flush the entries and check again to see if we can add - cacheBase::FlushEntries(); - if (!cacheBase::CanAddEntry(dwSize)) - return E_OUTOFMEMORY; - } - } - _ATLTRY - { - hr = cacheBase::AddEntry(szKey, pvData, dwSize, - pftExpireTime, hInstClient, pClient, phEntry); - return hr; - } - _ATLCATCHALL() - { - return E_FAIL; - } - } - - HRESULT STDMETHODCALLTYPE LookupEntry(LPCSTR szKey, HCACHEITEM * phEntry) - { - return cacheBase::LookupEntry(szKey, phEntry); - } - - HRESULT STDMETHODCALLTYPE GetData(const HCACHEITEM hKey, void **ppvData, DWORD *pdwSize) const - { - return cacheBase::GetEntryData(hKey, ppvData, pdwSize); - } - - HRESULT STDMETHODCALLTYPE ReleaseEntry(const HCACHEITEM hKey) - { - return cacheBase::ReleaseEntry(hKey); - } - - HRESULT STDMETHODCALLTYPE RemoveEntry(const HCACHEITEM hKey) - { - return cacheBase::RemoveEntry(hKey); - } - - HRESULT STDMETHODCALLTYPE RemoveEntryByKey(LPCSTR szKey) - { - return cacheBase::RemoveEntryByKey(szKey); - } - - HRESULT STDMETHODCALLTYPE Flush() - { - return cacheBase::FlushEntries(); - } - - - HRESULT STDMETHODCALLTYPE SetMaxAllowedSize(DWORD dwSize) - { - return cacheBase::SetMaxAllowedSize(dwSize); - } - - HRESULT STDMETHODCALLTYPE GetMaxAllowedSize(DWORD *pdwSize) - { - return cacheBase::GetMaxAllowedSize(pdwSize); - } - - HRESULT STDMETHODCALLTYPE SetMaxAllowedEntries(DWORD dwSize) - { - return cacheBase::SetMaxAllowedEntries(dwSize); - } - - HRESULT STDMETHODCALLTYPE GetMaxAllowedEntries(DWORD *pdwSize) - { - return cacheBase::GetMaxAllowedEntries(pdwSize); - } - - HRESULT STDMETHODCALLTYPE ResetCache() - { - return cacheBase::ResetCache(); - } - - // IMemoryCacheStats methods - HRESULT STDMETHODCALLTYPE ClearStats() - { - m_statObj.ResetCounters(); - return S_OK; - } - - HRESULT STDMETHODCALLTYPE GetHitCount(DWORD *pdwSize) - { - if (!pdwSize) - return E_POINTER; - *pdwSize = m_statObj.GetHitCount(); - return S_OK; - } - - HRESULT STDMETHODCALLTYPE GetMissCount(DWORD *pdwSize) - { - if (!pdwSize) - return E_POINTER; - *pdwSize = m_statObj.GetMissCount(); - return S_OK; - } - - HRESULT STDMETHODCALLTYPE GetMaxAllocSize(DWORD *pdwSize) - { - if (!pdwSize) - return E_POINTER; - *pdwSize = m_statObj.GetMaxAllocSize(); - return S_OK; - } - - HRESULT STDMETHODCALLTYPE GetCurrentAllocSize(DWORD *pdwSize) - { - if (!pdwSize) - return E_POINTER; - *pdwSize = m_statObj.GetCurrentAllocSize(); - return S_OK; - } - - HRESULT STDMETHODCALLTYPE GetMaxEntryCount(DWORD *pdwSize) - { - if (!pdwSize) - return E_POINTER; - *pdwSize = m_statObj.GetMaxEntryCount(); - return S_OK; - } - - HRESULT STDMETHODCALLTYPE GetCurrentEntryCount(DWORD *pdwSize) - { - if (!pdwSize) - return E_POINTER; - *pdwSize = m_statObj.GetCurrentEntryCount(); - return S_OK; - } - -}; // CBlobCache - - -// -// CDllCache -// This class manages a cache to handle calls to LoadLibrary -// and FreeLibrary. -// It keeps dlls loaded even after the last call to free library -// a worker thread then calls FreeLibrary on unused dlls -// -#ifndef ATL_DLL_CACHE_TIMEOUT - #ifdef _DEBUG - #define ATL_DLL_CACHE_TIMEOUT 1000 // 1 sec default for debug builds - #else - #define ATL_DLL_CACHE_TIMEOUT 10*60000 // 10 minute default for retail builds - #endif -#endif - -class CNoDllCachePeer -{ -public: - struct DllInfo - { - }; - - BOOL Add(HINSTANCE /*hInst*/, DllInfo * /*pInfo*/) - { - return TRUE; - } - - void Remove(HINSTANCE /*hInst*/, DllInfo * /*pInfo*/) - { - } -}; - -// CDllCache -// Implements IDllCache, an interface that is used to load and unload Dlls. -// To use it, construct an instance of a CDllCache and call Initialize. -// The Initialize call has to match with the type of monitor class you -// templatize on. The monitor thread will call IWorkerThreadClient::Execute -// after its timeout expires. Make sure to Uninitialize the object before -// it is destroyed by calling Uninitialize -// -template -class CDllCache : public IDllCache, - public IWorkerThreadClient -{ -protected: - CComCriticalSection m_critSec; - CSimpleArray m_Dlls; - CSimpleArray m_DllInfos; - MonitorClass m_Monitor; - HANDLE m_hTimer; - - void RemoveDllEntry(DLL_CACHE_ENTRY& entry) - { - ::FreeLibrary(entry.hInstDll); - entry.hInstDll = NULL; - m_Dlls.RemoveAt(m_Dlls.GetSize()-1); - } - -public: - Peer m_Peer; - - CDllCache() : - m_hTimer(NULL) - { - - } - - HRESULT Initialize(DWORD dwTimeout=ATL_DLL_CACHE_TIMEOUT) - { - HRESULT hr = m_critSec.Init(); - if (FAILED(hr)) - return hr; - hr = m_Monitor.Initialize(); - if (FAILED(hr)) - return hr; - return m_Monitor.AddTimer(dwTimeout, this, 0, &m_hTimer); - } - - template - HRESULT Initialize(CWorkerThread *pWorkerThread, - DWORD dwTimeout=ATL_DLL_CACHE_TIMEOUT) - { - HRESULT hr = m_critSec.Init(); - if (FAILED(hr)) - return hr; - hr = m_Monitor.Initialize(pWorkerThread); - if (FAILED(hr)) - return hr; - return m_Monitor.AddTimer(dwTimeout, this, 0, &m_hTimer); - } - - HRESULT Uninitialize() - { - HRESULT hr = S_OK; - HRESULT hrLatest = S_OK; - if (m_hTimer) - { - hrLatest=m_Monitor.RemoveHandle(m_hTimer); - if(FAILED(hrLatest) && SUCCEEDED(hr)) - { - hr=hrLatest; - } - m_hTimer = NULL; - } - m_Monitor.Shutdown(); - - // free all the libraries we've cached - int nLen = m_Dlls.GetSize(); - for (int i=0; i 0); - entry.bAlive = TRUE; - entry.dwRefs--; - m_critSec.Unlock(); - return TRUE; - } - } - - m_critSec.Unlock(); - // the dll wasn't found - // in the cache, so just - // pass along to ::FreeLibrary - return ::FreeLibrary(hInstDll); - } - - BOOL AddRefModule(HINSTANCE hInstDll) - { - HRESULT hr = m_critSec.Lock(); - if (FAILED(hr)) - return FALSE; - - int nLen = m_Dlls.GetSize(); - for (int i=0; i 0); - entry.dwRefs++; - m_critSec.Unlock(); - return TRUE; - } - } - - m_critSec.Unlock(); - return FALSE; - } - - BOOL ReleaseModule(HINSTANCE hInstDll) - { - HRESULT hr = m_critSec.Lock(); - if (FAILED(hr)) - return FALSE; - - int nLen = m_Dlls.GetSize(); - for (int i=0; i 0); - entry.bAlive = TRUE; - entry.dwRefs--; - m_critSec.Unlock(); - return TRUE; - } - } - m_critSec.Unlock(); - return FALSE; - } - - HRESULT GetEntries(DWORD dwCount, DLL_CACHE_ENTRY *pEntries, DWORD *pdwCopied) - { - if (!pdwCopied) - return E_POINTER; - - HRESULT hr = m_critSec.Lock(); - if (FAILED(hr)) - return hr; - - if (dwCount==0 || pEntries==NULL) - { - // just return the required size - *pdwCopied = m_Dlls.GetSize(); - m_critSec.Unlock(); - return S_OK; - } - - if (dwCount > (DWORD) m_Dlls.GetSize()) - dwCount = m_Dlls.GetSize(); - Checked::memcpy_s(pEntries, dwCount*sizeof(DLL_CACHE_ENTRY), m_Dlls.GetData(), dwCount*sizeof(DLL_CACHE_ENTRY)); - *pdwCopied = dwCount; - m_critSec.Unlock(); - return S_OK; - } - - HRESULT Flush() - { - HRESULT hr = m_critSec.Lock(); - if (FAILED(hr)) - return hr; - - int nLen = m_Dlls.GetSize(); - for (int i=0; i -class CStencilCache : - public CMemoryCacheBase, void *, CCacheDataEx, - CFixedStringKey, CStringElementTraitsI, - FlushClass, CullClass, SyncClass, StatClass>, - public IStencilCache, - public IStencilCacheControl, - public IWorkerThreadClient, - public IMemoryCacheStats, - public CComObjectRootEx -{ -protected: - typedef CMemoryCacheBase, void *, CCacheDataEx, - CFixedStringKey, CStringElementTraitsI, - FlushClass, CullClass, SyncClass, StatClass> cacheBase; - unsigned __int64 m_dwdwStencilLifespan; - - MonitorClass m_Monitor; - HANDLE m_hTimer; - CComPtr m_spDllCache; - -public: - - CStencilCache() : - m_dwdwStencilLifespan(ATL_STENCIL_LIFESPAN), - m_hTimer(NULL) - { - - } - - ~CStencilCache() - { - if (m_hTimer) - { - ATLENSURE(SUCCEEDED(m_Monitor.RemoveHandle(m_hTimer))); - } - } - - HRESULT Execute(DWORD_PTR dwParam, HANDLE /*hObject*/) - { - CStencilCache* pCache = (CStencilCache*)dwParam; - if (pCache) - pCache->FlushEntries(); - return S_OK; - } - - HRESULT CloseHandle(HANDLE hObject) - { - ATLASSUME(m_hTimer == hObject); - m_hTimer = NULL; - ::CloseHandle(hObject); - return S_OK; - } - - HRESULT Initialize(IServiceProvider *pProv, DWORD dwStencilCacheTimeout=ATL_STENCIL_CACHE_TIMEOUT, - __int64 dwdwStencilLifespan=ATL_STENCIL_LIFESPAN) - { - m_dwdwStencilLifespan = dwdwStencilLifespan; - HRESULT hr = cacheBase::Initialize(); - if (FAILED(hr)) - return hr; - hr = E_FAIL; - if (pProv) - hr = pProv->QueryService(__uuidof(IDllCache), __uuidof(IDllCache), (void**)&m_spDllCache); - if (FAILED(hr)) - return hr; - hr = m_Monitor.Initialize(); - if (FAILED(hr)) - return hr; - return m_Monitor.AddTimer(dwStencilCacheTimeout, this, (DWORD_PTR) this, &m_hTimer); - } - - template - HRESULT Initialize(IServiceProvider *pProv, CWorkerThread *pWorkerThread, - DWORD dwStencilCacheTimeout=ATL_STENCIL_CACHE_TIMEOUT, __int64 dwdwStencilLifespan=ATL_STENCIL_LIFESPAN) - { - m_dwdwStencilLifespan = dwdwStencilLifespan; - HRESULT hr = cacheBase::Initialize(); - if (FAILED(hr)) - return hr; - hr = E_FAIL; - if (pProv) - hr = pProv->QueryService(__uuidof(IDllCache), __uuidof(IDllCache), (void**)&m_spDllCache); - if (FAILED(hr)) - return hr; - hr = m_Monitor.Initialize(pWorkerThread); - if (FAILED(hr)) - return hr; - return m_Monitor.AddTimer(dwStencilCacheTimeout, this, (DWORD_PTR) this, &m_hTimer); - } - - - BEGIN_COM_MAP(CStencilCache) - COM_INTERFACE_ENTRY(IMemoryCacheStats) - COM_INTERFACE_ENTRY(IStencilCache) - COM_INTERFACE_ENTRY(IStencilCacheControl) - END_COM_MAP() -//IStencilCache methods - STDMETHOD(CacheStencil)(LPCSTR szName, void *pStencil, DWORD dwSize, HCACHEITEM *phEntry, - HINSTANCE hInstance, IMemoryCacheClient *pClient) - { - NodeType * pEntry = NULL; - HRESULT hr = m_syncObj.Lock(); - if (FAILED(hr)) - return hr; - - _ATLTRY - { - hr = cacheBase::AddEntry(szName, pStencil, dwSize, (HCACHEITEM *)&pEntry); - } - _ATLCATCHALL() - { - hr = E_FAIL; - } - if (hr != S_OK) - { - m_syncObj.Unlock(); - return hr; - } - - pEntry->hInstance = hInstance; - pEntry->pClient = pClient; - pEntry->nLifespan = m_dwdwStencilLifespan; - if (hInstance && m_spDllCache) - m_spDllCache->AddRefModule(hInstance); - - cacheBase::CommitEntry(static_cast(pEntry)); - - if (phEntry) - *phEntry = static_cast(pEntry); - else - cacheBase::ReleaseEntry(static_cast(pEntry)); - - m_syncObj.Unlock(); - return hr; - } - - STDMETHOD(LookupStencil)(LPCSTR szName, HCACHEITEM * phStencil) - { - return cacheBase::LookupEntry(szName, phStencil); - } - - STDMETHOD(GetStencil)(const HCACHEITEM hStencil, void ** pStencil) const - { - return cacheBase::GetEntryData(hStencil, pStencil, NULL); - } - - STDMETHOD(AddRefStencil)(const HCACHEITEM hStencil) - { - return cacheBase::AddRefEntry(hStencil); - } - - STDMETHOD(ReleaseStencil)(const HCACHEITEM hStencil) - { - return cacheBase::ReleaseEntry(hStencil); - } - - //IStencilCacheControl - - STDMETHOD(RemoveStencil)(const HCACHEITEM hStencil) - { - return cacheBase::RemoveEntry(hStencil); - } - - STDMETHOD(RemoveStencilByName)(LPCSTR szStencil) - { - return cacheBase::RemoveEntryByKey(szStencil); - } - - STDMETHOD(RemoveAllStencils)() - { - return cacheBase::RemoveAllEntries(); - } - - STDMETHOD(SetDefaultLifespan)(unsigned __int64 dwdwLifespan) - { - m_dwdwStencilLifespan = dwdwLifespan; - return S_OK; - } - - STDMETHOD(GetDefaultLifespan)(unsigned __int64 *pdwdwLifepsan) - { - HRESULT hr = E_POINTER; - if (pdwdwLifepsan) - { - *pdwdwLifepsan = m_dwdwStencilLifespan; - hr = S_OK; - } - return hr; - } - - virtual void OnDestroyEntry(const NodeType * pEntry) - { - ATLASSERT(pEntry); - if (!pEntry) - return; - - if (pEntry->pClient) - pEntry->pClient->Free((void *)&pEntry->Data); - if (pEntry->hInstance && m_spDllCache) - m_spDllCache->ReleaseModule(pEntry->hInstance); - } - - HRESULT Uninitialize() - { - HRESULT hrMonitor=S_OK; - if (m_hTimer) - { - hrMonitor=m_Monitor.RemoveHandle(m_hTimer); - m_hTimer = NULL; - } - m_Monitor.Shutdown(); - HRESULT hrCache=cacheBase::Uninitialize(); - if(FAILED(hrMonitor)) - { - return hrMonitor; - } - return hrCache; - } - // IMemoryCacheStats methods - HRESULT STDMETHODCALLTYPE ClearStats() - { - m_statObj.ResetCounters(); - return S_OK; - } - - HRESULT STDMETHODCALLTYPE GetHitCount(DWORD *pdwSize) - { - if (!pdwSize) - return E_POINTER; - *pdwSize = m_statObj.GetHitCount(); - return S_OK; - } - - HRESULT STDMETHODCALLTYPE GetMissCount(DWORD *pdwSize) - { - if (!pdwSize) - return E_POINTER; - *pdwSize = m_statObj.GetMissCount(); - return S_OK; - } - - HRESULT STDMETHODCALLTYPE GetMaxAllocSize(DWORD *pdwSize) - { - if (!pdwSize) - return E_POINTER; - *pdwSize = m_statObj.GetMaxAllocSize(); - return S_OK; - } - - HRESULT STDMETHODCALLTYPE GetCurrentAllocSize(DWORD *pdwSize) - { - if (!pdwSize) - return E_POINTER; - *pdwSize = m_statObj.GetCurrentAllocSize(); - return S_OK; - } - - HRESULT STDMETHODCALLTYPE GetMaxEntryCount(DWORD *pdwSize) - { - if (!pdwSize) - return E_POINTER; - *pdwSize = m_statObj.GetMaxEntryCount(); - return S_OK; - } - - HRESULT STDMETHODCALLTYPE GetCurrentEntryCount(DWORD *pdwSize) - { - if (!pdwSize) - return E_POINTER; - *pdwSize = m_statObj.GetCurrentEntryCount(); - return S_OK; - } -}; // CStencilCache - -// {105A8866-4059-45fe-86AE-FA0EABBFBBB4} -extern "C" __declspec(selectany) const IID IID_IFileCache = { 0x105a8866, 0x4059, 0x45fe, { 0x86, 0xae, 0xfa, 0xe, 0xab, 0xbf, 0xbb, 0xb4 } }; - -__interface ATL_NO_VTABLE __declspec(uuid("105A8866-4059-45fe-86AE-FA0EABBFBBB4")) - IFileCache : public IUnknown -{ - // IFileCache Methods - - STDMETHOD(AddFile)( - LPCSTR szFileName, - LPCSTR szTempFileName, - FILETIME *pftExpireTime, - void *pPeerInfo, - HCACHEITEM * phKey); - STDMETHOD(LookupFile)(LPCSTR szFileName, HCACHEITEM * phKey); - STDMETHOD(GetFile)(const HCACHEITEM hKey, LPSTR * pszFileName, void **ppPeerInfo); - STDMETHOD(ReleaseFile)(const HCACHEITEM hKey); - STDMETHOD(RemoveFile)(const HCACHEITEM hKey); - STDMETHOD(RemoveFileByName)(LPCSTR szFileName); - STDMETHOD(Flush)(); -}; - -#ifndef ATL_FILE_CACHE_TIMEOUT - #define ATL_FILE_CACHE_TIMEOUT 1000 -#endif - -class CNoFileCachePeer -{ -public: - struct PeerInfo - { - }; - - static BOOL Add(PeerInfo* /*pDest*/, PeerInfo * /*pSrc*/) - { - return TRUE; - } - - static BOOL Remove(const PeerInfo* /*pFileInfo*/) - { - return TRUE; - } -}; - -template -struct CCacheDataPeer : public CCacheDataBase -{ - typename Peer::PeerInfo PeerData; -}; - -// A class to keep track of files, with maintenance -- maximum size of cache, -// maximum number of entries, expiration of entries, etc. -- inherits from -// CMemoryCacheBase -template < - class MonitorClass, - class StatClass=CStdStatClass, - class FileCachePeer=CNoFileCachePeer, - class FlushClass=COldFlusher, - class SyncClass=CComCriticalSection, - class CullClass=CExpireCuller > -class CFileCache: - public CMemoryCacheBase, LPSTR, CCacheDataPeer, - CFixedStringKey, CStringElementTraits, - FlushClass, CullClass, SyncClass, StatClass>, - public IWorkerThreadClient, - public IFileCache, - public IMemoryCacheControl, - public IMemoryCacheStats -{ - typedef CMemoryCacheBase, LPSTR, CCacheDataPeer, - CFixedStringKey, CStringElementTraits, - FlushClass, CullClass, SyncClass, StatClass> cacheBase; - - MonitorClass m_Monitor; - -protected: - HANDLE m_hTimer; - -public: - - CFileCache() : m_hTimer(NULL) - { - } - - HRESULT Initialize() - { - HRESULT hr = cacheBase::Initialize(); - if (FAILED(hr)) - return hr; - hr = m_Monitor.Initialize(); - if (FAILED(hr)) - return hr; - return m_Monitor.AddTimer(ATL_FILE_CACHE_TIMEOUT, - static_cast(this), (DWORD_PTR) this, &m_hTimer); - } - - template - HRESULT Initialize(CWorkerThread *pWorkerThread) - { - ATLASSERT(pWorkerThread); - - HRESULT hr = cacheBase::Initialize(); - if (FAILED(hr)) - return hr; - hr = m_Monitor.Initialize(pWorkerThread); - if (FAILED(hr)) - return hr; - return m_Monitor.AddTimer(ATL_FILE_CACHE_TIMEOUT, - static_cast(this), (DWORD_PTR) this, &m_hTimer); - } - - - // Callback for CWorkerThread - HRESULT Execute(DWORD_PTR dwParam, HANDLE /*hObject*/) - { - CFileCache* pCache = (CFileCache*)dwParam; - - if (pCache) - pCache->Flush(); - return S_OK; - } - - HRESULT CloseHandle(HANDLE hObject) - { - ATLASSUME(m_hTimer == hObject); - m_hTimer = NULL; - ::CloseHandle(hObject); - return S_OK; - } - - ~CFileCache() - { - if (m_hTimer) - { - ATLENSURE(SUCCEEDED(m_Monitor.RemoveHandle(m_hTimer))); - m_hTimer = NULL; - } - } - - HRESULT Uninitialize() - { - HRESULT hrMonitor=S_OK; - if (m_hTimer) - { - hrMonitor=m_Monitor.RemoveHandle(m_hTimer); - m_hTimer = NULL; - } - m_Monitor.Shutdown(); - HRESULT hrCache=cacheBase::Uninitialize(); - if(FAILED(hrMonitor)) - { - return hrMonitor; - } - return hrCache; - } - - - // IUnknown methods - HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void **ppv) - { - HRESULT hr = E_NOINTERFACE; - if (!ppv) - hr = E_POINTER; - else - { - if (InlineIsEqualGUID(riid, __uuidof(IUnknown)) || - InlineIsEqualGUID(riid, __uuidof(IFileCache))) - { - *ppv = (IUnknown *) (IFileCache *) this; - AddRef(); - hr = S_OK; - } - if (InlineIsEqualGUID(riid, __uuidof(IMemoryCacheStats))) - { - *ppv = (IMemoryCacheStats*)this; - AddRef(); - hr = S_OK; - } - if (InlineIsEqualGUID(riid, __uuidof(IMemoryCacheControl))) - { - *ppv = (IMemoryCacheControl*)this; - AddRef(); - hr = S_OK; - } - - } - return hr; - } - - ULONG STDMETHODCALLTYPE AddRef() - { - return 1; - } - - ULONG STDMETHODCALLTYPE Release() - { - return 1; - } - - // Adds a file to the cache. A file is created with a - // temporary name, and then Add is called with the temp - // file name and the final file name, along with expiration data, - // etc. A search on the file name will return the name of - // the file on disk (i.e. the temporary file) - HRESULT STDMETHODCALLTYPE AddFile( - LPCSTR szFileName, - LPCSTR szTempFileName, - FILETIME *pftExpireTime, - void* pPeerInfo, - HCACHEITEM * phKey = NULL) - { - WIN32_FILE_ATTRIBUTE_DATA fadData; - BOOL bRet = GetFileAttributesExA(szTempFileName, GetFileExInfoStandard, &fadData); - if (!bRet) - return AtlHresultFromLastError(); - - __int64 ddwFileSize = (static_cast<__int64>(fadData.nFileSizeHigh) << 32) + fadData.nFileSizeLow; - - DWORD dwRecordedFileSize = (DWORD) (ddwFileSize >> 10); - // Round the file size up to 1K if it is < 1K - if (dwRecordedFileSize == 0) - dwRecordedFileSize = 1; - - if (m_Monitor.GetThreadHandle()==NULL) - { - if (!cacheBase::CanAddEntry(dwRecordedFileSize)) - { - cacheBase::FlushEntries(); - if (!cacheBase::CanAddEntry(dwRecordedFileSize)) - return E_OUTOFMEMORY; - } - } - - NodeType *pEntry = NULL; - HRESULT hr = m_syncObj.Lock(); - if (FAILED(hr)) - return hr; - - hr = E_FAIL; - - // Make a private copy of the file name - CHeapPtr szTempFileCopy; - if (szTempFileCopy.Allocate(MAX_PATH)) - { - if (strlen(szTempFileName) >= MAX_PATH) - { - m_syncObj.Unlock(); - return E_FAIL; - } - Checked::strncpy_s(szTempFileCopy, MAX_PATH, szTempFileName, _TRUNCATE); - - _ATLTRY - { - hr = cacheBase::AddEntry(szFileName, szTempFileCopy, dwRecordedFileSize, (HCACHEITEM*)&pEntry); - szTempFileCopy.Detach(); - } - _ATLCATCHALL() - { - hr = E_FAIL; - } - } - - if (hr != S_OK) - { - m_syncObj.Unlock(); - return hr; - } - - - hr = (TRUE == FileCachePeer::Add(&pEntry->PeerData, - static_cast(pPeerInfo)) ? S_OK : E_FAIL); - if (hr == S_OK) - hr = cacheBase::CommitEntry(static_cast(pEntry)); - - if (hr != S_OK) - { - cacheBase::RemoveEntry(static_cast(pEntry)); - m_syncObj.Unlock(); - return hr; - } - - - if (pftExpireTime) - pEntry->cftExpireTime = *pftExpireTime; - - if (phKey) - *phKey = static_cast(pEntry); - else - cacheBase::ReleaseEntry(pEntry); - - m_syncObj.Unlock(); - return hr; - } - - // Action to take when the entry is removed from the cache - virtual void OnDestroyEntry(const NodeType * pEntry) - { - ATLASSERT(pEntry); - if (!pEntry) - return; - FileCachePeer::Remove(&pEntry->PeerData); - if (pEntry->Data) - { - DeleteFileA(pEntry->Data); - free(pEntry->Data); - const_cast(pEntry)->Data = NULL; - } - } - - // Looks up a file by name. Must be released after use - HRESULT STDMETHODCALLTYPE LookupFile(LPCSTR szFileName, HCACHEITEM * phKey) - { - return cacheBase::LookupEntry(szFileName, phKey); - } - - // Gets the name of the file on disk - HRESULT STDMETHODCALLTYPE GetFile(__in const HCACHEITEM hKey, __deref_out_z_opt LPSTR * pszFileName, __deref_out_opt void **ppPeerInfo) - { - NodeType *pEntry = (NodeType *)hKey; - if (ppPeerInfo) - *ppPeerInfo = &pEntry->PeerData; - return cacheBase::GetEntryData(hKey, pszFileName, NULL); - } - - // Releases a file - HRESULT STDMETHODCALLTYPE ReleaseFile(const HCACHEITEM hKey) - { - return cacheBase::ReleaseEntry(hKey); - } - - // Releases a file and marks it for deletion - HRESULT STDMETHODCALLTYPE RemoveFile(const HCACHEITEM hKey) - { - return cacheBase::RemoveEntry(hKey); - } - - // Removes a file by name -- this calls IMemoryCacheClient->Free - // on the file name, which by default (for CFileCache) deletes the - // file. - HRESULT STDMETHODCALLTYPE RemoveFileByName(LPCSTR szFileName) - { - return cacheBase::RemoveEntryByKey(szFileName); - } - - // Flushes the entries in the cache, eliminates expired entries, - // or if the cache exceeds the parameters (alloc size, num entries), - // culls items based on the sweep mode - HRESULT STDMETHODCALLTYPE Flush() - { - return cacheBase::FlushEntries(); - } - - // IMemoryCacheControl methods - HRESULT STDMETHODCALLTYPE SetMaxAllowedSize(DWORD dwSize) - { - return cacheBase::SetMaxAllowedSize(dwSize); - } - - HRESULT STDMETHODCALLTYPE GetMaxAllowedSize(DWORD *pdwSize) - { - return cacheBase::GetMaxAllowedSize(pdwSize); - } - - HRESULT STDMETHODCALLTYPE SetMaxAllowedEntries(DWORD dwSize) - { - return cacheBase::SetMaxAllowedEntries(dwSize); - } - - HRESULT STDMETHODCALLTYPE GetMaxAllowedEntries(DWORD *pdwSize) - { - return cacheBase::GetMaxAllowedEntries(pdwSize); - } - - HRESULT STDMETHODCALLTYPE ResetCache() - { - return cacheBase::ResetCache(); - } - - - // IMemoryCacheStats methods - HRESULT STDMETHODCALLTYPE ClearStats() - { - m_statObj.ResetCounters(); - return S_OK; - } - - HRESULT STDMETHODCALLTYPE GetHitCount(DWORD *pdwSize) - { - if (!pdwSize) - return E_POINTER; - *pdwSize = m_statObj.GetHitCount(); - return S_OK; - } - - HRESULT STDMETHODCALLTYPE GetMissCount(DWORD *pdwSize) - { - if (!pdwSize) - return E_POINTER; - *pdwSize = m_statObj.GetMissCount(); - return S_OK; - } - - HRESULT STDMETHODCALLTYPE GetMaxAllocSize(DWORD *pdwSize) - { - if (!pdwSize) - return E_POINTER; - *pdwSize = m_statObj.GetMaxAllocSize(); - return S_OK; - } - - HRESULT STDMETHODCALLTYPE GetCurrentAllocSize(DWORD *pdwSize) - { - if (!pdwSize) - return E_POINTER; - *pdwSize = m_statObj.GetCurrentAllocSize(); - return S_OK; - } - - HRESULT STDMETHODCALLTYPE GetMaxEntryCount(DWORD *pdwSize) - { - if (!pdwSize) - return E_POINTER; - *pdwSize = m_statObj.GetMaxEntryCount(); - return S_OK; - } - - HRESULT STDMETHODCALLTYPE GetCurrentEntryCount(DWORD *pdwSize) - { - if (!pdwSize) - return E_POINTER; - *pdwSize = m_statObj.GetCurrentEntryCount(); - return S_OK; - } -}; // CFileCache - -class CDataConnection; // see atldbcli.h -__interface __declspec(uuid("52E7759B-D6CC-4a03-BDF3-80A6BDCA1F94")) -IDataSourceCache : public IUnknown -{ - // Method: Add - // Params: - // szConn: Connection string of data source to connect to - // ppDS: Out pointer to the newly added data source - // Comments: - // Attempts to open a connection to the specified data source - // using a CDataSource object. Once the connection is open, the - // CDatasource is cached. - STDMETHOD(Add)(LPCTSTR szID, LPCOLESTR szConn, CDataConnection *pDS); - - // Method: Remove - // Params: - // szConn: Specifies the connection string of the connection to close - // Comments: - // Closes the specified connection and removes it's entry from the cache - STDMETHOD(Remove)(LPCTSTR szID); - - // Method: Lookup - // Params: - // szConn: Specifies the connection string of the connection to look up - // ppDS: Out pointer to CDataSource object that is connected to the specified - // data source. - STDMETHOD(Lookup)(LPCTSTR szID, CDataConnection *pDS); - - // Method: Uninitialize - // Params: - // None - // Comments: - // Closes removes all connections from the cache. - STDMETHOD(Uninitialize)(); - -}; -#ifndef ATL_DS_CONN_STRING_LEN - #define ATL_DS_CONN_STRING_LEN 512 -#endif - -template <> -class CElementTraits< CDataConnection > : - public CElementTraitsBase< CDataConnection > -{ -public: - static ULONG Hash( INARGTYPE t ) - { - return( ULONG( ULONG_PTR( &t ) ) ); - } - - static bool CompareElements( INARGTYPE element1, INARGTYPE element2 ) - { - return( element1.m_session.m_spOpenRowset == element2.m_session.m_spOpenRowset); - } - - static int CompareElementsOrdered( INARGTYPE /*element1*/, INARGTYPE /*element2*/ ) - { - ATLASSERT(FALSE); - return -1; - } - -}; - -typedef CFixedStringT atlDataSourceKey; -typedef CAtlMap, CElementTraits > atlDataSourceCacheMap; - -template -class CDataSourceCache : - public IDataSourceCache, - public CComObjectRootEx -{ -public: - BEGIN_COM_MAP(CDataSourceCache) - COM_INTERFACE_ENTRY(IDataSourceCache) - END_COM_MAP() - - CDataSourceCache() - { - m_cs.Init(); - } - - virtual ~CDataSourceCache () - { - Uninitialize(); - } - - STDMETHOD(Uninitialize)() - { - HRESULT hr = m_cs.Lock(); - if (SUCCEEDED(hr)) - { - m_ConnectionMap.RemoveAll(); - m_cs.Unlock(); - } - - return hr; - } - - STDMETHOD(Add)(LPCTSTR szID, LPCOLESTR szConn, CDataConnection *pSession) - { - HRESULT hr = E_FAIL; - - if (!szID) - return E_INVALIDARG; // must have session name - - // Do a lookup to make sure we don't add multiple entries - // with the same name. Adding multiple entries with the same name - // could cause some entries to get orphaned. - hr = m_cs.Lock(); - if (FAILED(hr)) - { - return hr; - } - - const atlDataSourceCacheMap::CPair *pPair = - m_ConnectionMap.Lookup(szID); - if (!pPair) - { - // try to open connection - CDataConnection DS; - hr = DS.Open(szConn); - if (hr == S_OK) - { - _ATLTRY - { - if (m_ConnectionMap.SetAt(szID, DS)) - { - if (pSession) // we allow NULL here - *pSession = DS; // copy connection to output. - hr = S_OK; - } - else - hr = E_FAIL; // map add failed - } - _ATLCATCHALL() - { - hr = E_FAIL; - } - } - } - else // lookup succeeded, entry is already in cache - { - // Instead of opening a new connection, just copy - // the one we already have in the cache. - if (pSession) - *pSession = pPair->m_value; - hr = S_OK; - } - m_cs.Unlock(); - return hr; - } - - STDMETHOD(Remove)(LPCTSTR szID) - { - HRESULT hr = E_INVALIDARG; - if (!szID) - return hr; // must have session name - - hr = m_cs.Lock(); - if (SUCCEEDED(hr)) - { - hr = m_ConnectionMap.RemoveKey(szID) ? S_OK : E_FAIL; - m_cs.Unlock(); - } - - return hr; - } - - STDMETHOD(Lookup)(LPCTSTR szID, CDataConnection *pSession) - { - if (!szID||!pSession) - return E_POINTER; - - HRESULT hr = m_cs.Lock(); - bool bRet = true; - if (SUCCEEDED(hr)) - { - bRet = m_ConnectionMap.Lookup(szID, *pSession); - m_cs.Unlock(); - } - - return (bRet && (bool)*pSession)? hr : E_FAIL; - } - -protected: - atlDataSourceCacheMap m_ConnectionMap; - TCritSec m_cs; -}; - - -// Some helpers for using the datasource cache. -// -// Function: GetDataSource -// Params: -// pProvider: Pointer to IServiceProvider that provides the -// data source cache service -// szID: The name of the connection (can be same as szDS) -// szDS: OLEDB connection string for data source -// ppDS: Out pointer to CDataSource. The CDataSource will be connected -// to the OLEDB provider specified by szDS on successful return. -// RetVal: -// Returns S_OK on success. -static HRESULT ATL_NOINLINE GetDataSource(IServiceProvider *pProvider, - LPCTSTR szID, LPCOLESTR szConn, - CDataConnection *pSession) -{ - if (!pProvider || !szID || !szConn) - return E_POINTER; - - CComPtr spDSCache; - HRESULT hr; - hr = pProvider->QueryService(__uuidof(IDataSourceCache), __uuidof(IDataSourceCache), (void**)&spDSCache); - if (hr == S_OK && spDSCache) - { - hr = spDSCache->Add(szID, szConn, pSession); - } - return hr; -} - -// -// Function: RemoveDataSource -// Params: -// pProvider: Pointer to IServiceProvider that provides the -// data source cache service -// szID: Name of the datasource connection to remove from the cache -// RetVal: -// none -// Comments: -// Removes the datasource entry from the datasource cache. Since entries are -// copied to the client on calls to lookup and add, removing an entry will not -// release the connections of existing clients. -static HRESULT ATL_NOINLINE RemoveDataSource(IServiceProvider *pProvider, LPCTSTR szID) -{ - if (!pProvider || !szID) - return E_POINTER; - - CComPtr spDSCache; - HRESULT hr = pProvider->QueryService(__uuidof(IDataSourceCache), __uuidof(IDataSourceCache), (void**)&spDSCache); - if (spDSCache) - hr = spDSCache->Remove(szID); - return hr; -} - -} // namespace ATL -#pragma pack(pop) - -#pragma warning (pop) - -#endif // __ATLCACHE_H__ diff --git a/include/atl/atlcrypt.h b/include/atl/atlcrypt.h deleted file mode 100644 index 8e8ac7d4e..000000000 --- a/include/atl/atlcrypt.h +++ /dev/null @@ -1,376 +0,0 @@ -// This is a part of the Active Template Library. -// Copyright (C) Microsoft Corporation -// All rights reserved. -// -// This source code is only intended as a supplement to the -// Active Template Library Reference and related -// electronic documentation provided with the library. -// See these sources for detailed information regarding the -// Active Template Library product. - -#ifndef __ATLCRYPT_H__ -#define __ATLCRYPT_H__ - -#pragma once - -#include -#include - - -#pragma pack(push,_ATL_PACKING) -namespace ATL -{ - -class CCryptKey; - -class CCryptProv -{ -protected: - HCRYPTPROV m_hProv; - -public: - CCryptProv() throw(); - CCryptProv( const CCryptProv& prov ) throw(); - explicit CCryptProv( HCRYPTPROV hProv, BOOL bTakeOwnership = FALSE ) throw(); - ~CCryptProv() throw(); - - CCryptProv& operator=( const CCryptProv& prov ) throw(); - - HRESULT AddRef() throw(); - void Attach( HCRYPTPROV hProv, BOOL bTakeOwnership = FALSE ) throw(); - HCRYPTPROV Detach() throw(); - HRESULT Release() throw(); - - - HRESULT Initialize(DWORD dwProviderType = PROV_RSA_FULL, - LPCTSTR szContainer = NULL, LPCTSTR szProvider = MS_DEF_PROV, - DWORD dwFlags = 0) throw(); - HRESULT InitVerifyContext(DWORD dwProviderType = PROV_RSA_FULL, - LPCTSTR szProvider = MS_DEF_PROV, DWORD dwFlags = 0) throw(); - HRESULT InitCreateKeySet(DWORD dwProviderType = PROV_RSA_FULL, - LPCTSTR szContainer = NULL, LPCTSTR szProvider = MS_DEF_PROV, - DWORD dwFlags = 0) throw(); - - HRESULT DeleteKeySet(DWORD dwProviderType = PROV_RSA_FULL, - LPCTSTR szContainer = NULL, LPCTSTR szProvider = MS_DEF_PROV, - DWORD dwFlags = 0) throw(); - - HRESULT Uninitialize(); - - HRESULT GetParam(DWORD dwParam, BYTE * pbData, DWORD * pdwDataLen, DWORD dwFlags = 0) throw(); - HRESULT SetParam( DWORD dwParam, BYTE* pbData, DWORD dwFlags = 0) throw(); - HRESULT GetName(__out_ecount_part_z(*pdwLength, *pdwLength) LPSTR szBuf, __inout DWORD * pdwLength) throw(); - HRESULT GetContainer(__out_ecount_part_z(*pdwLength, *pdwLength) LPSTR szBuf, __inout DWORD * pdwLength) throw(); - HRESULT GetImpType(DWORD * pdwImpType) throw(); - HRESULT GetVersion(DWORD * pdwVersion) throw(); - HRESULT GetProvType(DWORD * pdwType) throw(); - HRESULT GetSecurityDesc(SECURITY_INFORMATION * pSecInfo) throw(); - HRESULT SetSecurityDesc(SECURITY_INFORMATION SecInfo) throw(); - - HRESULT GenRandom(ULONG nLength, BYTE* pbBuffer ) throw(); - - inline HCRYPTPROV GetHandle() throw() - { - return m_hProv; - } -}; // class CCryptProv - - -// class CCryptHash -// Provides base functionality of hashes. -class CCryptHash -{ -protected: - HCRYPTHASH m_hHash; - -public: - CCryptHash() throw(); - CCryptHash( const CCryptHash& hash ) throw(); - explicit CCryptHash( HCRYPTHASH hHash, BOOL bTakeOwnership = FALSE ) throw(); - ~CCryptHash() throw(); - - void Attach( HCRYPTHASH hHash, BOOL bTakeOwnership = FALSE ) throw(); - void Destroy() throw(); - HCRYPTHASH Detach() throw(); - HCRYPTHASH Duplicate() const throw(); - - HRESULT Uninitialize() throw(); - HRESULT Detach(HCRYPTHASH * phHash) throw(); - HRESULT AddData(const BYTE * pbData, DWORD dwDataLen, DWORD dwFlags = 0) throw(); - HRESULT AddString(LPCTSTR szData, DWORD dwFlags = 0) throw(); - HRESULT GetParam(DWORD dwParam, BYTE * pbData, DWORD * pdwDataLen, DWORD dwFlags = 0) throw(); - HRESULT SetParam(DWORD dwParam, BYTE * pbData, DWORD dwFlags = 0) throw(); - HRESULT GetAlgId(ALG_ID * pAlgId) throw(); - HRESULT GetSize(DWORD * pdwSize) throw(); - HRESULT GetValue(BYTE * pBuf, DWORD * pdwSize) throw(); - HRESULT SetValue(BYTE * pBuf) throw(); - HRESULT Sign( - BYTE * pbSignature, - DWORD * pdwSigLen, - DWORD dwFlags = 0, - DWORD dwKeySpec = AT_SIGNATURE) throw(); - HRESULT VerifySignature( - const BYTE * pbSignature, - DWORD pdwSignLen, - CCryptKey &PubKey, - DWORD dwFlags = 0) throw(); - - inline HCRYPTHASH GetHandle() - { - return m_hHash; - } - static CCryptHash EmptyHash; - -}; // class CCryptHash - -// class CCryptKey -// Provides the functionality for cryptographic keys, i.e. encrypting, decrypting. -class CCryptKey -{ -protected: - HCRYPTKEY m_hKey; - -public: - CCryptKey() throw(); - CCryptKey( const CCryptKey& key ) throw(); - explicit CCryptKey( HCRYPTKEY hKey, BOOL bTakeOwnership = FALSE ) throw(); - ~CCryptKey() throw(); - - void Attach( HCRYPTKEY hKey, BOOL bTakeOwnership = FALSE ) throw(); - void Destroy() throw(); - HCRYPTKEY Detach() throw(); - HCRYPTKEY Duplicate() const throw(); - - HRESULT Uninitialize() throw(); - HRESULT Encrypt( - BOOL final, - BYTE * pbData, - DWORD * pdwDataLen, - DWORD dwBufLen, - CCryptHash &Hash = CCryptHash::EmptyHash) throw(); - - HRESULT Encrypt( - const BYTE * pbPlainText, - DWORD dwPlainTextLen, - BYTE * pbCipherText, - DWORD * pdwCipherTextLen, - CCryptHash &Hash = CCryptHash::EmptyHash) throw(); - - HRESULT Decrypt( - BOOL final, - BYTE * pbData, - DWORD * pdwDataLen, - CCryptHash &Hash = CCryptHash::EmptyHash) throw(); - HRESULT Decrypt( - const BYTE * pbCipherText, - DWORD dwCipherTextLen, - BYTE * pbPlainText, - DWORD * pdwPlainTextLen, - CCryptHash &Hash = CCryptHash::EmptyHash) throw(); - HRESULT EncryptString( - LPCTSTR szPlainText, - BYTE * pbCipherText, - DWORD * pdwCipherTextLen, - CCryptHash &Hash = CCryptHash::EmptyHash) throw(); - HRESULT ExportSimpleBlob( - CCryptKey &ExpKey, - DWORD dwFlags, - BYTE * pbData, - DWORD * pdwDataLen) throw(); - HRESULT ExportPublicKeyBlob( - CCryptKey &ExpKey, - DWORD dwFlags, - BYTE * pbData, - DWORD * pdwDataLen) throw(); - HRESULT ExportPrivateKeyBlob( - CCryptKey &ExpKey, - DWORD dwFlags, - BYTE * pbData, - DWORD * pdwDataLen) throw(); - HRESULT GetParam(DWORD dwParam, BYTE * pbData, DWORD * pdwDataLen, DWORD dwFlags = 0) throw(); - HRESULT SetParam(DWORD dwParam, BYTE * pbData, DWORD dwFlags = 0) throw(); - HRESULT GetAlgId(ALG_ID * pAlgId) throw(); - HRESULT SetAlgId(ALG_ID AlgId, DWORD dwFlags) throw(); - HRESULT GetBlockLength(DWORD * pdwBlockLen) throw(); - HRESULT GetKeyLength(DWORD * pdwKeyLen) throw(); - HRESULT GetSalt(BYTE * pbSalt, DWORD * pdwLength) throw(); - HRESULT SetSalt(BYTE * pbSalt) throw(); - HRESULT SetSaltEx(_CRYPTOAPI_BLOB * pBlobSalt) throw(); - HRESULT GetPermissions(DWORD * pdwPerms) throw(); - HRESULT SetPermissions(DWORD dwPerms) throw(); - HRESULT GetP(BYTE * pbP, DWORD * pdwLength) throw(); - HRESULT SetP(_CRYPTOAPI_BLOB * pBlobP) throw(); - HRESULT SetP(BYTE * pbP, DWORD dwLength) throw(); - HRESULT GetQ(BYTE * pbQ, DWORD * pdwLength) throw(); - HRESULT SetQ(_CRYPTOAPI_BLOB * pBlobQ) throw(); - HRESULT SetQ(BYTE * pbQ, DWORD dwLength) throw(); - HRESULT GetG(BYTE * pbG, DWORD * pdwLength) throw(); - HRESULT SetG(_CRYPTOAPI_BLOB * pBlobG) throw(); - HRESULT SetG(BYTE * pbG, DWORD dwLength) throw(); - HRESULT SetX() throw(); - HRESULT GetEffKeyLen(DWORD * pdwEffKeyLen) throw(); - HRESULT SetEffKeyLen(DWORD dwEffKeyLen) throw(); - HRESULT GetPadding(DWORD * pdwPadding) throw(); - HRESULT SetPadding(DWORD dwPadding) throw(); - HRESULT GetIV(BYTE * pbIV, DWORD * pdwLength) throw(); - HRESULT SetIV(BYTE * pbIV) throw(); - HRESULT GetMode(DWORD * pdwMode) throw(); - HRESULT SetMode(DWORD dwMode) throw(); - HRESULT GetModeBits(DWORD * pdwModeBits) throw(); - HRESULT SetModeBits(DWORD dwModeBits) throw(); - - inline HCRYPTKEY GetHandle() throw() - { - return m_hKey; - } - - static CCryptKey EmptyKey; -}; // class CCryptKey - - - -// Specific instances of Keys and Hashes - -// class CCryptDerivedKey -// A key that is derived from a hashed password. Two keys derived -// from the same password will be identical. -class CCryptDerivedKey : public CCryptKey -{ -public: - HRESULT Initialize( - CCryptProv &Prov, - CCryptHash &Hash, - ALG_ID algid = CALG_RC4, - DWORD dwFlags = CRYPT_EXPORTABLE) throw(); -}; // class CCryptDerivedKey - -// class CCryptRandomKey -// A randomly generated key. Can be used internally by a program -// to protect data during execution, or can be exported with Crypt.Export -// -// Currently it is possible to pass in AT_KEYEXCHANGE or AT_SIGNATURE -// for algid, but these two will generate keys for the current key set, and -// the resulting handle can only be used for exporting and importing keys or -// signing hashes. -class CCryptRandomKey : public CCryptKey -{ -public: - HRESULT Initialize( - CCryptProv &Prov, - ALG_ID algid = CALG_RC4, - DWORD dwFlags = CRYPT_EXPORTABLE) throw(); -}; // class CCryptRandomKey - -// class CCryptUserExKey -// Obtains the user's key exchange key pair. -class CCryptUserExKey : public CCryptKey -{ -public: - HRESULT Initialize(CCryptProv &Prov) throw(); - HRESULT Create(CCryptProv &Prov) throw(); -}; // class CCryptUserExKey - -// class CCryptUserSigKey -// Obtains the user's signature key pair -class CCryptUserSigKey : public CCryptKey -{ -public: - HRESULT Initialize(CCryptProv &Prov) throw(); - HRESULT Create(CCryptProv &Prov) throw(); -}; // class CCryptUserSigKey - -// class CCryptImportKey -// Forms a key from an imported key blob -class CCryptImportKey : public CCryptKey -{ -public: - HRESULT Initialize( - CCryptProv &Prov, - BYTE * pbData, - DWORD dwDataLen, - CCryptKey &PubKey, - DWORD dwFlags) throw(); -}; // class CCryptImportKey - - -// class CCryptHash -// A generic hash that may or may not take a key. -class CCryptKeyedHash : public CCryptHash -{ -public: - - HRESULT Initialize(CCryptProv &Prov, ALG_ID Algid, CCryptKey &Key, DWORD dwFlags) throw(); -}; // class CCryptKeyedHash - -// class CCryptMD5Hash -// RSA's MD5 hash (RSA's most recent hash as of 9/7/99); -class CCryptMD5Hash : public CCryptHash -{ -public: - - HRESULT Initialize(CCryptProv &Prov, LPCTSTR szText = NULL) throw(); -}; // class CCryptMD5Hash - -// class CCryptMD4Hash -// RSA's MD4 hash -class CCryptMD4Hash : public CCryptHash -{ -public: - - HRESULT Initialize(CCryptProv &Prov, LPCTSTR szText = NULL) throw(); -}; // class CCryptMD4Hash - - -// class CCryptMD2Hash -// RSA's MD2 hash -class CCryptMD2Hash : public CCryptHash -{ -public: - - HRESULT Initialize(CCryptProv &Prov, LPCTSTR szText = NULL) throw(); -}; // class CCryptMD2Hash - - -// class CCryptSHAHash -// The Secure Hash Algorithm hash, from NIST and NSA. Technically, SHA-1. -class CCryptSHAHash : public CCryptHash -{ -public: - - HRESULT Initialize(CCryptProv &Prov, LPCTSTR szText = NULL) throw(); -}; // class CCryptSHAHash - -// The Secure Hash Algorithm, from NIST and NSA. Identical to CCryptSHA -typedef CCryptSHAHash CCryptSHA1Hash; - - -// class CCryptHMACHash -// Hash-base Message Authentication Code keyed hash -class CCryptHMACHash : public CCryptHash -{ -public: - HRESULT Initialize(CCryptProv &Prov, CCryptKey &Key, LPCTSTR szText = NULL) throw(); -}; // class CCryptHMACHash - -// class CCryptMACHash -// Message Authentication Code keyed hash. Believed to be less secure than HMAC -class CCryptMACHash : public CCryptHash -{ -public: - HRESULT Initialize(CCryptProv &Prov, CCryptKey &Key, LPCTSTR szText = NULL) throw(); -}; // class CCryptMACHash - -// class CCryptSSL3SHAMD5Hash -// Hash algorithm used by Secure Socket Layer -class CCryptSSL3SHAMD5Hash : public CCryptHash -{ -public: - HRESULT Initialize(CCryptProv &Prov, CCryptKey &Key, LPCTSTR szText = NULL) throw(); -}; // class CCryptSSl3SHAMD5Hash - -}; // namespace ATL - - -#include -#pragma pack(pop) -#endif // __ATLCRYPT_H__ diff --git a/include/atl/atlcrypt.inl b/include/atl/atlcrypt.inl deleted file mode 100644 index bfd119f87..000000000 --- a/include/atl/atlcrypt.inl +++ /dev/null @@ -1,1062 +0,0 @@ -// This is a part of the Active Template Library. -// Copyright (C) Microsoft Corporation -// All rights reserved. -// -// This source code is only intended as a supplement to the -// Active Template Library Reference and related -// electronic documentation provided with the library. -// See these sources for detailed information regarding the -// Active Template Library product. - - -#ifndef __ATLCRYPT_INL__ -#define __ATLCRYPT_INL__ - -#pragma once - -#ifndef __ATLCRYPT_H__ - #error atlcrypt.inl requires atlcrypt.h to be included first -#endif - - -namespace ATL -{ - -inline CCryptProv::CCryptProv( const CCryptProv& prov ) throw() -{ - m_hProv = prov.m_hProv; - if (m_hProv) - AddRef(); -} - -inline CCryptProv::CCryptProv( HCRYPTPROV hProv, BOOL bTakeOwnership ) throw() -{ - m_hProv = hProv; - if (m_hProv && !bTakeOwnership) - AddRef(); -} - -inline CCryptProv::~CCryptProv() throw() -{ - Release(); -} - -inline CCryptProv& CCryptProv::operator=( const CCryptProv& prov ) throw() -{ - if(this!=&prov) - { - Release(); - - m_hProv = prov.m_hProv; - if( m_hProv != NULL ) - { - AddRef(); - } - } - return( *this ); -} - -inline HRESULT CCryptProv::AddRef() throw() -{ - ATLASSUME( m_hProv != NULL ); - - if (!CryptContextAddRef( m_hProv, NULL, 0)) - { - return AtlHresultFromLastError(); - } - return S_OK; -} - -inline void CCryptProv::Attach( HCRYPTPROV hProv, BOOL bTakeOwnership ) throw() -{ - ATLASSUME( m_hProv == NULL ); - - m_hProv = hProv; - if (m_hProv && !bTakeOwnership) - AddRef(); -} - -inline HCRYPTPROV CCryptProv::Detach() throw() -{ - HCRYPTPROV hProv; - - hProv = m_hProv; - m_hProv = NULL; - - return( hProv ); -} - - -inline CCryptProv::CCryptProv() throw() : - m_hProv( NULL ) -{ -} - -inline HRESULT CCryptProv::Release() throw() -{ - if( m_hProv != NULL ) - { - if (!CryptReleaseContext( m_hProv, 0 )) - { - return AtlHresultFromLastError(); - } - m_hProv = NULL; - } - return S_OK; -} - -inline HRESULT CCryptProv::Initialize( - DWORD dwProviderType, - LPCTSTR szContainer, - LPCTSTR szProvider, - DWORD dwFlags) throw() -{ - ATLASSUME(m_hProv == NULL); - - if (!CryptAcquireContext(&m_hProv, szContainer, szProvider, dwProviderType, dwFlags)) - { - return AtlHresultFromLastError(); - } - else return S_OK; -} - -inline HRESULT CCryptProv::InitVerifyContext( - DWORD dwProviderType, - LPCTSTR szProvider, - DWORD dwFlags) throw() -{ - ATLASSUME(m_hProv == NULL); - - if (!CryptAcquireContext(&m_hProv, NULL, szProvider, dwProviderType, CRYPT_VERIFYCONTEXT | dwFlags)) - { - return AtlHresultFromLastError(); - } - else return S_OK; -} - -inline HRESULT CCryptProv::InitCreateKeySet( - DWORD dwProviderType, - LPCTSTR szContainer, - LPCTSTR szProvider, - DWORD dwFlags) throw() -{ - ATLASSUME(m_hProv == NULL); - - if (!CryptAcquireContext(&m_hProv, szContainer, szProvider, dwProviderType, CRYPT_NEWKEYSET | dwFlags)) - { - return AtlHresultFromLastError(); - } - else return S_OK; -} - -inline HRESULT CCryptProv::DeleteKeySet( - DWORD dwProviderType, - LPCTSTR szContainer, - LPCTSTR szProvider, - DWORD dwFlags) throw() -{ - HCRYPTPROV hProv = NULL; - if (!CryptAcquireContext(&hProv, szContainer, szProvider, dwProviderType, CRYPT_DELETEKEYSET | dwFlags)) - { - return AtlHresultFromLastError(); - } - else return S_OK; -} - - -inline HRESULT CCryptProv::Uninitialize() throw() -{ - ATLASSUME(m_hProv != NULL); - - if (!CryptReleaseContext(m_hProv, 0)) - { - return AtlHresultFromLastError(); - } - else - { - m_hProv = NULL; - return S_OK; - } -} - -inline HRESULT CCryptProv::GetParam(DWORD dwParam, BYTE * pbData, DWORD * pdwDataLen, DWORD dwFlags) throw() -{ - ATLASSUME(m_hProv != NULL); - - if (!CryptGetProvParam(m_hProv, dwParam, pbData, pdwDataLen, dwFlags)) - { - return AtlHresultFromLastError(); - } - else return S_OK; -} - -inline HRESULT CCryptProv::SetParam( DWORD dwParam, BYTE* pbData, DWORD dwFlags) throw() -{ - ATLASSUME(m_hProv != NULL); - - if (!CryptSetProvParam(m_hProv, dwParam, pbData, dwFlags )) - { - return AtlHresultFromLastError(); - } - else return S_OK; -} - -inline HRESULT CCryptProv::GetName(__out_bcount_part(*pdwLength, *pdwLength) LPSTR szBuf, __inout DWORD * pdwLength) throw() -{ - return GetParam(PP_NAME, (BYTE *)szBuf, pdwLength); -} - -inline HRESULT CCryptProv::GetContainer(__out_bcount_part(*pdwLength, *pdwLength) LPSTR szBuf, __inout DWORD * pdwLength) throw() -{ - return GetParam(PP_CONTAINER, (BYTE *)szBuf, pdwLength); -} - -inline HRESULT CCryptProv::GetImpType(DWORD * pdwImpType) throw() -{ - DWORD dwLength = sizeof(DWORD); - return GetParam(PP_IMPTYPE, (BYTE *)pdwImpType, &dwLength); -} - -inline HRESULT CCryptProv::GetVersion(DWORD * pdwVersion) throw() -{ - DWORD dwLength = sizeof(DWORD); - return GetParam(PP_VERSION, (BYTE *)pdwVersion, &dwLength); -} - -inline HRESULT CCryptProv::GetProvType(DWORD * pdwType) throw() -{ - DWORD dwLength = sizeof(DWORD); - return GetParam(PP_PROVTYPE, (BYTE * )pdwType, &dwLength); -} - -inline HRESULT CCryptProv::GetSecurityDesc(SECURITY_INFORMATION * pSecInfo) throw() -{ - DWORD dwSize = sizeof(SECURITY_INFORMATION); - return GetParam(PP_KEYSET_SEC_DESCR, (BYTE *)pSecInfo, &dwSize); -} - -inline HRESULT CCryptProv::SetSecurityDesc(SECURITY_INFORMATION SecInfo) throw() -{ - return SetParam(PP_KEYSET_SEC_DESCR, (BYTE *)&SecInfo); -} - -inline HRESULT CCryptProv::GenRandom(ULONG nLength, BYTE* pbBuffer ) throw() -{ - ATLASSUME(m_hProv != NULL); - - if (!CryptGenRandom( m_hProv, nLength, pbBuffer )) - { - return AtlHresultFromLastError(); - } - - return S_OK; -} - -inline CCryptHash::CCryptHash() throw() : - m_hHash( NULL ) -{ -} - -inline CCryptHash::CCryptHash( const CCryptHash& hash ) throw() -{ - m_hHash = hash.Duplicate(); -} - -inline CCryptHash::CCryptHash( HCRYPTHASH hHash, BOOL bTakeOwnership ) throw() -{ - if (bTakeOwnership) - m_hHash = hHash; - else - { - m_hHash = NULL; - BOOL bRet = ::CryptDuplicateHash( hHash, NULL, 0, &m_hHash ); - if (!bRet) - m_hHash = NULL; - } -} - -inline CCryptHash::~CCryptHash() throw() -{ - Destroy(); -} - -inline void CCryptHash::Attach( HCRYPTHASH hHash, BOOL bTakeOwnership ) throw() -{ - ATLASSUME( m_hHash == NULL ); - - if (bTakeOwnership) - m_hHash = hHash; - else - { - m_hHash = NULL; - BOOL bRet = ::CryptDuplicateHash( hHash, NULL, 0, &m_hHash ); - if (!bRet) - m_hHash = NULL; - } -} - -inline void CCryptHash::Destroy() throw() -{ - if( m_hHash != NULL ) - { - BOOL bSuccess; - - bSuccess = ::CryptDestroyHash( m_hHash ); - - // can fail if the cryptographic service provider - // (managed by CCryptProv) has already been destroyed - ATLASSERT( bSuccess ); - m_hHash = NULL; - } -} - -inline HCRYPTHASH CCryptHash::Detach() throw() -{ - HCRYPTHASH hHash; - - hHash = m_hHash; - m_hHash = NULL; - - return hHash; -} - -inline HCRYPTHASH CCryptHash::Duplicate() const throw() -{ - BOOL bSuccess; - HCRYPTHASH hHash; - - ATLASSUME( m_hHash != NULL ); - - hHash = NULL; - bSuccess = ::CryptDuplicateHash( m_hHash, NULL, 0, &hHash ); - if( !bSuccess ) - { - return NULL; - } - - return hHash; -} - -inline HRESULT CCryptHash::Uninitialize() throw() -{ - ATLASSUME(m_hHash != NULL); - - if (!CryptDestroyHash(m_hHash)) - { - return AtlHresultFromLastError(); - } - else - { - m_hHash = NULL; - return S_OK; - } -} - -inline HRESULT CCryptHash::Detach(HCRYPTHASH * phHash) throw() -{ - ATLASSERT(phHash); - if (!phHash) - return E_INVALIDARG; - - *phHash = m_hHash; - m_hHash = NULL; - - return S_OK; -} - -inline HRESULT CCryptHash::AddData(const BYTE * pbData, DWORD dwDataLen, DWORD dwFlags) throw() -{ - ATLASSUME(m_hHash != NULL); - - if (!CryptHashData(m_hHash, pbData, dwDataLen, dwFlags)) - { - return AtlHresultFromLastError(); - } - else return S_OK; - -} - -inline HRESULT CCryptHash::AddString(LPCTSTR szData, DWORD dwFlags) throw() -{ - return AddData((BYTE *)szData, (DWORD)_tcslen(szData) * sizeof(TCHAR), dwFlags); -} - -inline HRESULT CCryptHash::GetParam(DWORD dwParam, BYTE * pbData, DWORD * pdwDataLen, DWORD dwFlags) throw() -{ - ATLASSUME(m_hHash != NULL); - - if (!CryptGetHashParam(m_hHash, dwParam, pbData, pdwDataLen, dwFlags)) - { - return AtlHresultFromLastError(); - } - else return S_OK; -} - -inline HRESULT CCryptHash::SetParam(DWORD dwParam, BYTE * pbData, DWORD dwFlags) throw() -{ - ATLASSUME(m_hHash != NULL); - - if (!CryptSetHashParam(m_hHash, dwParam, pbData, dwFlags)) - { - return AtlHresultFromLastError(); - } - else return S_OK; -} - -inline HRESULT CCryptHash::GetAlgId(ALG_ID * pAlgId) throw() -{ - DWORD dwSize = sizeof(ALG_ID); - return GetParam(HP_ALGID, (BYTE *)pAlgId, &dwSize); -} - -inline HRESULT CCryptHash::GetSize(DWORD * pdwSize) throw() -{ - DWORD dwLength = sizeof(DWORD); - return GetParam(HP_HASHSIZE, (BYTE *)pdwSize, &dwLength); -} - -inline HRESULT CCryptHash::GetValue(BYTE * pBuf, DWORD * pdwSize) throw() -{ - return GetParam(HP_HASHVAL, pBuf, pdwSize); -} - -inline HRESULT CCryptHash::SetValue(BYTE * pBuf) throw() -{ - return SetParam(HP_HASHVAL, pBuf); -} - -inline HRESULT CCryptHash::Sign( - BYTE * pbSignature, - DWORD * pdwSigLen, - DWORD dwFlags, - DWORD dwKeySpec) throw() -{ - ATLASSUME(m_hHash != NULL); - - if (!CryptSignHash(m_hHash, dwKeySpec, NULL, dwFlags, pbSignature, pdwSigLen)) - { - return AtlHresultFromLastError(); - } - else return S_OK; -} - -inline HRESULT CCryptHash::VerifySignature( - const BYTE * pbSignature, - DWORD dwSigLen, - CCryptKey &PubKey, - DWORD dwFlags) throw() -{ - ATLASSUME(m_hHash != NULL); - - if (!CryptVerifySignature(m_hHash, pbSignature, dwSigLen, PubKey.GetHandle(), NULL, dwFlags)) - { - return AtlHresultFromLastError(); - } - else return S_OK; -} - -__declspec(selectany) CCryptHash CCryptHash::EmptyHash = CCryptHash(); -__declspec(selectany) CCryptKey CCryptKey::EmptyKey = CCryptKey(); -inline CCryptKey::CCryptKey() throw() : - m_hKey( NULL ) -{ -} - -inline CCryptKey::CCryptKey( const CCryptKey& key ) throw() -{ - m_hKey = key.Duplicate(); -} - -inline CCryptKey::CCryptKey( HCRYPTKEY hKey, BOOL bTakeOwnership ) throw() -{ - if (bTakeOwnership) - m_hKey = hKey; - else - { - BOOL bSuccess = ::CryptDuplicateKey( hKey, NULL, 0, &m_hKey ); - if( !bSuccess ) - m_hKey = NULL; - } -} - -inline CCryptKey::~CCryptKey() throw() -{ - Destroy(); -} - -inline void CCryptKey::Attach( HCRYPTKEY hKey, BOOL bTakeOwnership ) throw() -{ - ATLASSUME( m_hKey == NULL ); - if (bTakeOwnership) - m_hKey = hKey; - else - { - BOOL bSuccess = ::CryptDuplicateKey( hKey, NULL, 0, &m_hKey ); - if( !bSuccess ) - m_hKey = NULL; - } -} - -inline void CCryptKey::Destroy() throw() -{ - if( m_hKey != NULL ) - { - BOOL bSuccess; - - bSuccess = ::CryptDestroyKey( m_hKey ); - - // can fail if the cryptographic service provider - // (managed by CCryptProv) has already been destroyed - ATLASSERT( bSuccess ); - m_hKey = NULL; - } -} - -inline HCRYPTKEY CCryptKey::Detach() throw() -{ - HCRYPTKEY hKey; - - hKey = m_hKey; - m_hKey = NULL; - - return( hKey ); -} - -inline HCRYPTKEY CCryptKey::Duplicate() const throw() -{ - BOOL bSuccess; - - ATLASSUME( m_hKey != NULL ); - - HCRYPTKEY hKey = NULL; - bSuccess = ::CryptDuplicateKey( m_hKey, NULL, 0, &hKey ); - if( !bSuccess ) - return NULL; - - return hKey; -} - -inline HRESULT CCryptKey::Uninitialize() throw() -{ - ATLASSUME(m_hKey != NULL); - - if (!CryptDestroyKey(m_hKey)) - { - return AtlHresultFromLastError(); - } - else - { - m_hKey = NULL; - return S_OK; - } -} - -inline HRESULT CCryptKey::Encrypt( - BOOL final, - BYTE * pbData, - DWORD * pdwDataLen, - DWORD dwBufLen, - CCryptHash &Hash) throw() -{ - ATLASSUME(m_hKey != NULL); - - if (!::CryptEncrypt(m_hKey, Hash.GetHandle(), final, 0, pbData, pdwDataLen, dwBufLen)) - { - return AtlHresultFromLastError(); - } - else return S_OK; - -} - -inline HRESULT CCryptKey::Decrypt(BOOL final, BYTE * pbData, DWORD * pdwDataLen, CCryptHash &Hash) throw() -{ - ATLASSUME(m_hKey != NULL); - - if (!::CryptDecrypt(m_hKey, Hash.GetHandle(), final, 0, pbData, pdwDataLen)) - { - return AtlHresultFromLastError(); - } - else return S_OK; -} - - -inline HRESULT CCryptKey::Encrypt( - const BYTE * pbPlainText, - DWORD dwPlainTextLen, - BYTE * pbCipherText, - DWORD * pdwCipherTextLen, - CCryptHash &Hash) throw() -{ - ATLASSUME(m_hKey != NULL); - - if (*pdwCipherTextLen < dwPlainTextLen) - return ERROR_MORE_DATA; - - Checked::memcpy_s(pbCipherText, dwPlainTextLen, pbPlainText, dwPlainTextLen); - DWORD dwSize = dwPlainTextLen; - if (!::CryptEncrypt(m_hKey, Hash.GetHandle(), TRUE, 0, pbCipherText, &dwSize, *pdwCipherTextLen)) - { - return AtlHresultFromLastError(); - } - - *pdwCipherTextLen = dwSize; - return S_OK; - -} - -inline HRESULT CCryptKey::Decrypt( - const BYTE * pbCipherText, - DWORD dwCipherTextLen, - BYTE * pbPlainText, - DWORD * pdwPlainTextLen, - CCryptHash &Hash) throw() -{ - ATLASSUME(m_hKey != NULL); - - if (*pdwPlainTextLen < dwCipherTextLen) - return ERROR_MORE_DATA; - - Checked::memcpy_s(pbPlainText, dwCipherTextLen, pbCipherText, dwCipherTextLen); - DWORD dwSize = dwCipherTextLen; - if (!::CryptDecrypt(m_hKey, Hash.GetHandle(), TRUE, 0, pbPlainText, &dwSize)) - { - return AtlHresultFromLastError(); - } - - *pdwPlainTextLen = dwSize; - return S_OK; -} - -inline HRESULT CCryptKey::EncryptString( - LPCTSTR szPlainText, - BYTE * pbCipherText, - DWORD * pdwCipherTextLen, - CCryptHash &Hash) throw() -{ - DWORD dwSize = ((DWORD)_tcslen(szPlainText) + 1) * sizeof(TCHAR); - return Encrypt((BYTE *)szPlainText, dwSize, pbCipherText, pdwCipherTextLen, Hash); -} - -inline HRESULT CCryptKey::ExportSimpleBlob( - CCryptKey &ExpKey, - DWORD dwFlags, - BYTE * pbData, - DWORD * pdwDataLen) throw() -{ - ATLASSUME(m_hKey != NULL); - - if (!CryptExportKey(m_hKey, ExpKey.GetHandle(), SIMPLEBLOB, dwFlags, pbData, pdwDataLen)) - { - return AtlHresultFromLastError(); - } - else return S_OK; -} - -inline HRESULT CCryptKey::ExportPublicKeyBlob( - CCryptKey &ExpKey, - DWORD dwFlags, - BYTE * pbData, - DWORD * pdwDataLen) throw() -{ - ATLASSUME(m_hKey != NULL); - - if (!CryptExportKey(m_hKey, ExpKey.GetHandle(), PUBLICKEYBLOB, dwFlags, pbData, pdwDataLen)) - { - return AtlHresultFromLastError(); - } - else return S_OK; -} - -inline HRESULT CCryptKey::ExportPrivateKeyBlob( - CCryptKey &ExpKey, - DWORD dwFlags, - BYTE * pbData, - DWORD * pdwDataLen) throw() -{ - ATLASSUME(m_hKey != NULL); - - if (!CryptExportKey(m_hKey, ExpKey.GetHandle(), PRIVATEKEYBLOB, dwFlags, pbData, pdwDataLen)) - { - return AtlHresultFromLastError(); - } - else return S_OK; -} - -inline HRESULT CCryptKey::GetParam(DWORD dwParam, BYTE * pbData, DWORD * pdwDataLen, DWORD dwFlags) throw() -{ - ATLASSUME(m_hKey != NULL); - - if (!CryptGetKeyParam(m_hKey, dwParam, pbData, pdwDataLen, dwFlags)) - { - return AtlHresultFromLastError(); - } - else return S_OK; -} - -inline HRESULT CCryptKey::SetParam(DWORD dwParam, BYTE * pbData, DWORD dwFlags) throw() -{ - ATLASSUME(m_hKey != NULL); - - if (!CryptSetKeyParam(m_hKey, dwParam, pbData, dwFlags)) - { - return AtlHresultFromLastError(); - } - else return S_OK; -} - -inline HRESULT CCryptKey::GetAlgId(ALG_ID * pAlgId) throw() -{ - DWORD dwSize = sizeof(DWORD); - return GetParam(KP_ALGID, (BYTE *)pAlgId, &dwSize); -} - -inline HRESULT CCryptKey::SetAlgId(ALG_ID AlgId, DWORD dwFlags) throw() -{ - return SetParam(KP_ALGID, (BYTE *)&AlgId, dwFlags); -} - -inline HRESULT CCryptKey::GetBlockLength(DWORD * pdwBlockLen) throw() -{ - DWORD dwSize = sizeof(DWORD); - return GetParam(KP_BLOCKLEN, (BYTE *)pdwBlockLen, &dwSize); -} - -inline HRESULT CCryptKey::GetKeyLength(DWORD * pdwKeyLen) throw() -{ - DWORD dwSize = sizeof(DWORD); - return GetParam(KP_KEYLEN, (BYTE *)pdwKeyLen, &dwSize); -} - -inline HRESULT CCryptKey::GetSalt(BYTE * pbSalt, DWORD * pdwLength) throw() -{ - return GetParam(KP_SALT, pbSalt, pdwLength); -} - -inline HRESULT CCryptKey::SetSalt(BYTE * pbSalt) throw() -{ - return SetParam(KP_SALT, pbSalt); -} - -inline HRESULT CCryptKey::SetSaltEx(_CRYPTOAPI_BLOB * pBlobSalt) throw() -{ - return SetParam(KP_SALT_EX, (BYTE *)pBlobSalt); -} - -inline HRESULT CCryptKey::GetPermissions(DWORD * pdwPerms) throw() -{ - DWORD dwSize = sizeof(DWORD); - return GetParam(KP_PERMISSIONS, (BYTE *)pdwPerms, &dwSize); -} - -inline HRESULT CCryptKey::SetPermissions(DWORD dwPerms) throw() -{ - return SetParam(KP_PERMISSIONS, (BYTE *)&dwPerms); -} - -inline HRESULT CCryptKey::GetP(BYTE * pbP, DWORD * pdwLength) throw() -{ - return GetParam(KP_P, (BYTE *)pbP, pdwLength); -} - -inline HRESULT CCryptKey::SetP(_CRYPTOAPI_BLOB * pBlobP) throw() -{ - return SetParam(KP_P, (BYTE *)pBlobP); -} - -inline HRESULT CCryptKey::SetP(BYTE * pbP, DWORD dwLength) throw() -{ - _CRYPTOAPI_BLOB blob = { dwLength, pbP }; - return SetParam(KP_P, (BYTE *)&blob); -} - -inline HRESULT CCryptKey::GetQ(BYTE * pbQ, DWORD * pdwLength) throw() -{ - return GetParam(KP_Q, (BYTE *)pbQ, pdwLength); -} - -inline HRESULT CCryptKey::SetQ(_CRYPTOAPI_BLOB * pBlobQ) throw() -{ - return SetParam(KP_Q, (BYTE *)pBlobQ); -} - -inline HRESULT CCryptKey::SetQ(BYTE * pbQ, DWORD dwLength) throw() -{ - _CRYPTOAPI_BLOB blob = { dwLength, pbQ }; - return SetParam(KP_Q, (BYTE *)&blob); -} - -inline HRESULT CCryptKey::GetG(BYTE * pbG, DWORD * pdwLength) throw() -{ - return GetParam(KP_G, (BYTE *)pbG, pdwLength); -} - -inline HRESULT CCryptKey::SetG(_CRYPTOAPI_BLOB * pBlobG) throw() -{ - return SetParam(KP_G, (BYTE *)pBlobG); -} - -inline HRESULT CCryptKey::SetG(BYTE * pbG, DWORD dwLength) throw() -{ - _CRYPTOAPI_BLOB blob = { dwLength, pbG }; - return SetParam(KP_G, (BYTE *)&blob); -} - -inline HRESULT CCryptKey::SetX() throw() -{ - return SetParam(KP_X, NULL); -} - -inline HRESULT CCryptKey::GetEffKeyLen(DWORD * pdwEffKeyLen) throw() -{ - DWORD dwSize = sizeof(DWORD); - return GetParam(KP_EFFECTIVE_KEYLEN, (BYTE *)pdwEffKeyLen, &dwSize); -} - -inline HRESULT CCryptKey::SetEffKeyLen(DWORD dwEffKeyLen) throw() -{ - return SetParam(KP_EFFECTIVE_KEYLEN, (BYTE *)&dwEffKeyLen); -} - -inline HRESULT CCryptKey::GetPadding(DWORD * pdwPadding) throw() -{ - DWORD dwSize = sizeof(DWORD); - return GetParam(KP_PADDING, (BYTE *)pdwPadding, &dwSize); -} - -inline HRESULT CCryptKey::SetPadding(DWORD dwPadding) throw() -{ - return SetParam(KP_PADDING, (BYTE *)&dwPadding); -} - -inline HRESULT CCryptKey::GetIV(BYTE * pbIV, DWORD * pdwLength) throw() -{ - return GetParam(KP_IV, pbIV, pdwLength); -} - -inline HRESULT CCryptKey::SetIV(BYTE * pbIV) throw() -{ - return SetParam(KP_IV, pbIV); -} - -inline HRESULT CCryptKey::GetMode(DWORD * pdwMode) throw() -{ - DWORD dwSize = sizeof(DWORD); - return GetParam(KP_MODE, (BYTE *)pdwMode, &dwSize); -} - -inline HRESULT CCryptKey::SetMode(DWORD dwMode) throw() -{ - return SetParam(KP_MODE, (BYTE *)&dwMode); -} - -inline HRESULT CCryptKey::GetModeBits(DWORD * pdwModeBits) throw() -{ - DWORD dwSize = sizeof(DWORD); - return GetParam(KP_MODE_BITS, (BYTE *)pdwModeBits, &dwSize); -} - -inline HRESULT CCryptKey::SetModeBits(DWORD dwModeBits) throw() -{ - return SetParam(KP_MODE_BITS, (BYTE *)&dwModeBits); -} - -inline HRESULT CCryptDerivedKey::Initialize( - CCryptProv &Prov, - CCryptHash &Hash, - ALG_ID algid, - DWORD dwFlags) throw() -{ - ATLASSUME(m_hKey == NULL); - - if (!CryptDeriveKey(Prov.GetHandle(), algid, Hash.GetHandle(), dwFlags, &m_hKey)) - { - return AtlHresultFromLastError(); - } - else return S_OK; -} - -inline HRESULT CCryptRandomKey::Initialize(CCryptProv &Prov, ALG_ID algid, DWORD dwFlags) throw() -{ - ATLASSUME(m_hKey == NULL); - - if (!CryptGenKey(Prov.GetHandle(), algid, dwFlags, &m_hKey)) - { - return AtlHresultFromLastError(); - } - else return S_OK; - -} - -inline HRESULT CCryptUserExKey::Initialize(CCryptProv &Prov) throw() -{ - ATLASSUME(m_hKey == NULL); - - if (!CryptGetUserKey(Prov.GetHandle(), AT_KEYEXCHANGE, &m_hKey)) - { - return AtlHresultFromLastError(); - } - else return S_OK; -} - -inline HRESULT CCryptUserExKey::Create(CCryptProv &Prov) throw() -{ - ATLASSUME(m_hKey == NULL); - - if (!CryptGenKey(Prov.GetHandle(), AT_KEYEXCHANGE, 0, &m_hKey)) - { - return AtlHresultFromLastError(); - } - else return S_OK; -} - -inline HRESULT CCryptUserSigKey::Initialize(CCryptProv &Prov) throw() -{ - ATLASSUME(m_hKey == NULL); - - if (!CryptGetUserKey(Prov.GetHandle(), AT_SIGNATURE, &m_hKey)) - { - return AtlHresultFromLastError(); - } - else return S_OK; -} - -inline HRESULT CCryptUserSigKey::Create(CCryptProv &Prov) throw() -{ - ATLASSUME(m_hKey == NULL); - - if (!CryptGenKey(Prov.GetHandle(), AT_SIGNATURE, 0, &m_hKey)) - { - return AtlHresultFromLastError(); - } - else return S_OK; -} - -inline HRESULT CCryptImportKey::Initialize( - CCryptProv &Prov, - BYTE * pbData, - DWORD dwDataLen, - CCryptKey &PubKey, - DWORD dwFlags) throw() -{ - ATLASSUME(m_hKey == NULL); - - if (!CryptImportKey(Prov.GetHandle(), pbData, dwDataLen, PubKey.GetHandle(), dwFlags, &m_hKey)) - { - return AtlHresultFromLastError(); - } - else return S_OK; -} - -inline HRESULT CCryptKeyedHash::Initialize( - CCryptProv &Prov, - ALG_ID Algid, - CCryptKey &Key, - DWORD dwFlags) throw() -{ - ATLASSUME(m_hHash == NULL); - - if (!CryptCreateHash(Prov.GetHandle(), Algid, Key.GetHandle(), dwFlags, &m_hHash)) - { - return AtlHresultFromLastError(); - } - else return S_OK; -} - -inline HRESULT CCryptMD5Hash::Initialize(CCryptProv &Prov, LPCTSTR szText) throw() -{ - ATLASSUME(m_hHash == NULL); - - if (!CryptCreateHash(Prov.GetHandle(), CALG_MD5, 0, 0, &m_hHash)) - { - return AtlHresultFromLastError(); - } - - if (szText!=NULL) - return AddString(szText); - else return S_OK; -} - -inline HRESULT CCryptMD4Hash::Initialize(CCryptProv &Prov, LPCTSTR szText) throw() -{ - ATLASSUME(m_hHash == NULL); - - if (!CryptCreateHash(Prov.GetHandle(), CALG_MD4, 0, 0, &m_hHash)) - { - return AtlHresultFromLastError(); - } - if (szText!=NULL) - return AddString(szText); - else return S_OK; -} - -inline HRESULT CCryptMD2Hash::Initialize(CCryptProv &Prov, LPCTSTR szText) throw() -{ - ATLASSUME(m_hHash == NULL); - - if (!CryptCreateHash(Prov.GetHandle(), CALG_MD2, 0, 0, &m_hHash)) - { - return AtlHresultFromLastError(); - } - if (szText!=NULL) - return AddString(szText); - else return S_OK; -} - -inline HRESULT CCryptSHAHash::Initialize(CCryptProv &Prov, LPCTSTR szText) throw() -{ - ATLASSUME(m_hHash == NULL); - - if (!CryptCreateHash(Prov.GetHandle(), CALG_SHA, 0, 0, &m_hHash)) - { - return AtlHresultFromLastError(); - } - if (szText!=NULL) - return AddString(szText); - else return S_OK; -} - -inline HRESULT CCryptHMACHash::Initialize(CCryptProv &Prov, CCryptKey &Key, LPCTSTR szText) throw() -{ - ATLASSUME(m_hHash == NULL); - - if (!CryptCreateHash(Prov.GetHandle(), CALG_HMAC, Key.GetHandle(), 0, &m_hHash)) - { - return AtlHresultFromLastError(); - } - if (szText!=NULL) - return AddString(szText); - else return S_OK; - -} - -inline HRESULT CCryptMACHash::Initialize(CCryptProv &Prov, CCryptKey &Key, LPCTSTR szText) throw() -{ - ATLASSUME(m_hHash == NULL); - - if (!CryptCreateHash(Prov.GetHandle(), CALG_MAC, Key.GetHandle(), 0, &m_hHash)) - { - return AtlHresultFromLastError(); - } - if (szText!=NULL) - return AddString(szText); - else return S_OK; - -} - -inline HRESULT CCryptSSL3SHAMD5Hash::Initialize(CCryptProv &Prov, CCryptKey &Key, LPCTSTR szText) throw() -{ - ATLASSUME(m_hHash == NULL); - - if (!CryptCreateHash(Prov.GetHandle(), CALG_SSL3_SHAMD5, Key.GetHandle(), 0, &m_hHash)) - { - return AtlHresultFromLastError(); - } - if (szText!=NULL) - return AddString(szText); - else return S_OK; - -} - -}; // namespace ATL - -#endif //__ATLCRYPT_INL__ diff --git a/include/atl/atlextmgmt.h b/include/atl/atlextmgmt.h deleted file mode 100644 index 59f8d4353..000000000 --- a/include/atl/atlextmgmt.h +++ /dev/null @@ -1,1279 +0,0 @@ -// This is a part of the Active Template Library. -// Copyright (C) Microsoft Corporation -// All rights reserved. -// -// This source code is only intended as a supplement to the -// Active Template Library Reference and related -// electronic documentation provided with the library. -// See these sources for detailed information regarding the -// Active Template Library product. - -#ifndef __ATLEXTMGMT_H__ -#define __ATLEXTMGMT_H__ - -#pragma once -#pragma warning(push) -#pragma warning(disable: 4702) -#include -#include -#include -#include - -// -// You can change the local group that is used for authorizing -// site administrators by #define'ing ATL_DEFAULT_AUTH group -// to something else before including this header file. For -// example: -// #define ATL_DEFAULT_AUTHGRP CSid(_T("My Heros")) -// Verify that the logged on user is a member of -// the local group 'My Heros' before allowing them to -// administrate this site. -// -// #define ATL_DEFAULT_AUTHGRP Sids::World -// Allow everyone access -// -// #define ATL_DEFAULT_AUTHGRP Sids::Null -// Allow no one access -// -#ifndef ATL_DEFAULT_AUTHGRP - #define ATL_DEFAULT_AUTHGRP Sids::Admins() -#endif - -// If you #define ATL_NO_DEFAULT_AUTHORITY then there will be no authorization -// check before allowing access to management functions. You can also #define -// ATL_NO_DEFAULT_AUTHORITY and then declare you own instance of _Authority -// before #include-ing atlextmgmt.h to use a different authorization scheme. -#ifndef ATL_NO_DEFAULT_AUTHORITY - __declspec(selectany) CDefaultAuth _Authority; -#endif - -// You can choose which of the management handlers actually get used by -// #defining the following constants before including this header -// _ATL_THREADPOOL_MANAGEMENT (The thread pool manager web service and web based UI) -// _ATL_STENCILCACHE_MANAGEMENT (The stencil cache manager web service and web based UI) -// _ATL_DLLCACHE_MANAGEMENT (The DLL cache manager service and web based UI) - -// You can use the following constants to remove the web based UI if you don't -// want to use it. -// _ATL_THREADPOOL_NOUI (removes the thread pool mgr's stencil handler) -// _ATL_STENCILCACHE_NOUI (removes the stencil cache mgr's stencil handler) -// _ATL_DLLCACHE_NOUI (removes the dll cache mgr's stencil handler) - -// You can use the following constants to remove the web service management -// components individually -// _ATL_THREADPOOL_NOWEBSERVICE (removes the thread pool mgr's stencil handler) -// _ATL_STENCILCACHE_NOWEBSERVICE (removes the stencil cache mgr's stencil handler) -// _ATL_DLLCACHE_NOWEBSERVICE (removes the dll cache mgr's stencil handler) - - -// The following constants declare resource names of stencils included -// as resources in the module that uses this header. These stencils are -// used for the web based UI for the management objects. You can provide -// stencils of your own by including them as resources and redefining these -// constants before including this header. -#ifndef IDR_THREADMGR_SRF - #define IDR_THREADMGR_SRF "THREADMGR.SRF" -#endif - -#ifndef IDR_STENCILMGR_SRF - #define IDR_STENCILMGR_SRF "STENCILMGR.SRF" -#endif - -#ifndef IDR_DLLMGR_SRF - #define IDR_DLLMGR_SRF "DLLMGR.SRF" -#endif - -// A warning so users using the web based UI to manage their extension -// will remember to include the stencil resources in their projects -#if (defined(_ATL_THREADPOOL_MANAGEMENT) && !defined(_ATL_THREADPOOL_NOUI)) || (defined(_ATL_STENCILCACHE_MANAGEMENT) && !defined(_ATL_STENCILCACHE_NOUI)) || (defined(_ATL_DLLCACHE_MANAGEMENT) && !defined(_ATL_DLLCACHE_NOUI)) -#ifndef NO_ATL_MGMT_STENCIL_WARNING - #pragma message("*************** Please Note ***************") - #pragma message("Your usage of atlextmgmt.h requires you to include management") - #pragma message("stencil resources in your module's resource file.") - #pragma message("Please make sure you include atlsrv.rc in your resource file.\r\n") -#endif -#endif - -// These constants define the names used for the handler objects for the -// various services. You can change the names by redefining these constants -// before including this header - -#ifndef ID_THREADMGR_WEBSERVICE_NAME - #define ID_THREADMGR_WEBSERVICE_NAME "ThreadPoolManager" -#endif - -#ifndef ID_THREADMGR_WEBSERVICE_URL - #define ID_THREADMGR_WEBSERVICE_URL "http://www.microsoft.com/vc/atlserver/soap/ThreadPoolManager" -#endif - -#ifndef ID_THREADMGR_WEBSERVICE_WSDL - #define ID_THREADMGR_WEBSERVICE_WSDL "GenThreadPoolManagerWSDL" -#endif - -#ifndef ID_THREADMGR_SRFHANDLER_NAME - #define ID_THREADMGR_SRFHANDLER_NAME "ThreadMgrSrf" -#endif - -#ifndef ID_STENCILCACHEMGR_WEBSERVICE_NAME - #define ID_STENCILCACHEMGR_WEBSERVICE_NAME "StencilCacheManager" -#endif - -#ifndef ID_STENCILCACHEMGR_WEBSERVICE_URL - #define ID_STENCILCACHEMGR_WEBSERVICE_URL "http://www.microsoft.com/vc/atlserver/soap/StencilCacheManager" -#endif - -#ifndef ID_STENCILCACHEMGR_WEBSERVICE_WSDL - #define ID_STENCILCACHEMGR_WEBSERVICE_WSDL "GenStencilCacheManagerWSDL" -#endif - -#ifndef ID_STENCILCACHEMGR_SRFHANDLER_NAME - #define ID_STENCILCACHEMGR_SRFHANDLER_NAME "StencilMgrSrf" -#endif - -#ifndef ID_DLLCACHEMGR_WEBSERVICE_NAME - #define ID_DLLCACHEMGR_WEBSERVICE_NAME "DllCacheManager" -#endif - -#ifndef ID_DLLCACHEMGR_WEBSERVICE_URL - #define ID_DLLCACHEMGR_WEBSERVICE_URL "http://www.microsoft.com/vc/atlserver/soap/DllCacheManager" -#endif - -#ifndef ID_DLLCACHEMGR_WEBSERVICE_WSDL - #define ID_DLLCACHEMGR_WEBSERVICE_WSDL "GenDllCacheManagerWSDL" -#endif - - -#ifndef ID_DLLCACHEMGR_SRFHANDLER_NAME - #define ID_DLLCACHEMGR_SRFHANDLER_NAME "DllMgrSrf" -#endif - -#pragma pack(push,_ATL_PACKING) -namespace ATL { - -[emitidl(restricted)]; - -#define ATL_COLOR_TR1 RGB(0xd2, 0xff, 0xff) -#define ATL_COLOR_TR2 RGB(0xd2, 0xff, 0xd2) -#define ATL_COLOR_BODYBG RGB(0xec, 0xf9, 0xec) - -// _AtlRedirectToPage builds up a redirect URL from the -// current request plus a Handler= specification and -// redirects the user's browser to that page. -inline HTTP_CODE _AtlRedirectToPage( - IHttpServerContext *pContext, - CHttpRequest& request, - CHttpResponse& response, - const char *szHandler) -{ - ATLENSURE(pContext); - CStringA strRedirect("http://"); - - char buff[ATL_URL_MAX_URL_LENGTH]; - DWORD dwLen = static_cast(_countof(buff)); - if (!pContext->GetServerVariable("SERVER_NAME", buff, &dwLen)) - { - return HTTP_FAIL; - } - buff[_countof(buff)-1]='\0'; - strRedirect+=buff; - - dwLen = static_cast(_countof(buff)); - if (!request.GetUrl(buff, &dwLen)) - { - return HTTP_FAIL; - } - buff[_countof(buff)-1]='\0'; - strRedirect+=buff; - strRedirect+=szHandler; - - if (strRedirect.GetLength() >= ATL_URL_MAX_URL_LENGTH) - { - return HTTP_FAIL; - } - - BOOL bOK=response.Redirect(strRedirect.GetString()); - - return bOK ? HTTP_SUCCESS_NO_PROCESS : HTTP_FAIL; -} - -#ifdef _ATL_THREADPOOL_MANAGEMENT -/////////////////////////////////////////////////////////////////////// -// Thread pool management - -[ uuid("44e9962a-5207-4d2a-a466-5f08a76e0e5d"), object ] -__interface IThreadPoolMgr -{ - [id(0)] STDMETHOD(SetSize)([in] int nNumThreads); - [id(1)] STDMETHOD(GetSize)([out,retval] int *pnNumThreads); - -}; - - -class CThreadPoolMgrObject -{ -public: - CThreadPoolMgrObject() throw() - { - } - - HRESULT SetSize(int nNumThreads) throw() - { - if (!m_spThreadPoolConfig) - return E_UNEXPECTED; - - CRevertThreadToken revert; - if (!revert.Initialize()) - return E_FAIL; - - HRESULT hr = m_spThreadPoolConfig->SetSize(nNumThreads); - - DWORD dwErr = revert.Restore(); - if (dwErr) - return AtlHresultFromWin32(dwErr); - - return hr; - } - - - HRESULT GetSize(int *pnNumThreads) throw() - { - if (!m_spThreadPoolConfig) - return E_UNEXPECTED; - - return m_spThreadPoolConfig->GetSize(pnNumThreads); - - } - - HTTP_CODE Initialize(IServiceProvider *pProvider) throw() - { - ATLASSERT(pProvider); // should never be NULL - if (!pProvider) - return HTTP_ERROR(500, ISE_SUBERR_UNEXPECTED); - - if (m_spThreadPoolConfig) - return HTTP_SUCCESS; // already initialized - - pProvider->QueryService(__uuidof(IThreadPoolConfig), &m_spThreadPoolConfig); - return m_spThreadPoolConfig ? HTTP_SUCCESS : HTTP_ERROR(500, ISE_SUBERR_UNEXPECTED); - } - -private: - CComPtr m_spThreadPoolConfig; -}; - -#ifndef _ATL_THREADPOOL_NOWEBSERVICE -#pragma warning(push) -#pragma warning(disable:4199) -[ - soap_handler( - name= ID_THREADMGR_WEBSERVICE_NAME, - namespace= ID_THREADMGR_WEBSERVICE_URL, - protocol= "soap" - ), - request_handler( - name= ID_THREADMGR_WEBSERVICE_NAME, - sdl= ID_THREADMGR_WEBSERVICE_WSDL - ) -] -class CThreadPoolManager : - public IThreadPoolMgr -{ -#pragma warning(pop) -public: - [soap_method] - STDMETHOD(SetSize)(int nNumThreads) - { - return m_PoolMgr.SetSize(nNumThreads); - } - - [soap_method] - STDMETHOD(GetSize)(int *pnNumThreads) - { - return m_PoolMgr.GetSize(pnNumThreads); - } - - // override HandleRequest to Initialize our m_spServiceProvider - // and to handle authorizing the client. - HTTP_CODE HandleRequest(AtlServerRequest *pRequestInfo, IServiceProvider *pProvider) - { - HTTP_CODE hcErr = m_PoolMgr.Initialize(pProvider); - if (hcErr != HTTP_SUCCESS) - return hcErr; - - // Make sure caller is authorized on this system -__if_exists(_Authority) -{ - hcErr = HTTP_FAIL; - ATLTRY(hcErr = _Authority.IsAuthorized(pRequestInfo, ATL_DEFAULT_AUTHGRP)) -} - if (hcErr == HTTP_SUCCESS) - { - hcErr = __super::HandleRequest(pRequestInfo, pProvider); - } - return hcErr; - } -private: - CThreadPoolMgrObject m_PoolMgr; -}; -#endif //_ATL_THREADPOOL_NOWEBSERVICE - -#ifndef _ATL_THREADPOOL_NOUI -#define INVALID_COMMAND_ID -1 -#define MAX_COMMAND_ID 64 - -[request_handler(name=ID_THREADMGR_SRFHANDLER_NAME)] -class CThreadMgrStencil -{ -public: - CThreadMgrStencil() : - m_nColor(ATL_COLOR_TR1) - { - - } - - [tag_name("GetSize")] - HTTP_CODE GetSize() - { - int nSize = 0; - HRESULT hr = m_PoolMgr.GetSize(&nSize); - if (SUCCEEDED(hr)) - { - m_HttpResponse << nSize; - } - else - m_HttpResponse << "size not found"; - - return HTTP_SUCCESS; - } - - [tag_name("GetTRColor")] - HTTP_CODE GetTRColor() - { - m_nColor = (m_nColor == ATL_COLOR_TR1) ? ATL_COLOR_TR2 : ATL_COLOR_TR1; - TCHAR cr[8]; - if (RGBToHtml(m_nColor, cr, sizeof(cr))) - m_HttpResponse << cr; - - return HTTP_SUCCESS; - } - - [tag_name("GetBodyColor")] - HTTP_CODE GetBodyColor() - { - TCHAR cr[8]; - if (RGBToHtml(ATL_COLOR_BODYBG, cr, sizeof(cr))) - m_HttpResponse << cr; - return HTTP_SUCCESS; - } - - - HTTP_CODE ValidateAndExchange() throw() - { - _ATLTRY - { - // Initialize the thread pool manager instance. Internally - // the initialize function will only intialize it's data structures - // once. - HTTP_CODE hcErr = m_PoolMgr.Initialize(m_spServiceProvider); - if (hcErr != HTTP_SUCCESS) - return hcErr; - -__if_exists(_Authority) -{ - // Make sure caller is authorized on this system - hcErr = HTTP_FAIL; - ATLTRY(hcErr = _Authority.IsAuthorized(m_pRequestInfo, ATL_DEFAULT_AUTHGRP)) - if (hcErr != HTTP_SUCCESS) - return hcErr; -} - - - m_HttpResponse.SetContentType("text/html"); - - CString strHandler, strOptParam; - int nCmdToExec = INVALID_COMMAND_ID; - - if (m_HttpRequest.GetMethod() == CHttpRequest::HTTP_METHOD_POST) - { - // check to see if we have a "Method" form variable and can execute a command - DWORD dwErr = m_HttpRequest.FormVars.Exchange("Method", &strHandler); - if (dwErr == VALIDATION_S_OK) - { - if (strHandler == _T("ExecuteCommand")) - { - // get the value of the command parameter so we can execute it - dwErr = m_HttpRequest.FormVars.Validate("command", &nCmdToExec, 0, MAX_COMMAND_ID); - if (dwErr == VALIDATION_S_OK) - { - // get the optional parameter if it's there. - m_HttpRequest.FormVars.Validate("DynValue", &strOptParam, 0, MAX_COMMAND_ID); - - hcErr = ExecCommand(nCmdToExec, strOptParam); - return hcErr; - } - } - } - } - - // If we had a proper command to execute, we would have done it by now. - // Just handle like it's a normal request to view the thread count. - hcErr = LoadStencilResource(m_hInstHandler, IDR_THREADMGR_SRF); - return hcErr; - - } - _ATLCATCHALL() - { - return HTTP_FAIL; - } - } - - HTTP_CODE ExecCommand(int nCmdToExec, CString& strOptParam) - { - switch (nCmdToExec) - { - case 0: - TCHAR *pStop = NULL; - int nValue = _tcstoul(strOptParam, &pStop, 10); - m_PoolMgr.SetSize(nValue); - break; - }; - - return _AtlRedirectToPage( - m_spServerContext, - m_HttpRequest, - m_HttpResponse, - "?Handler=" ID_THREADMGR_SRFHANDLER_NAME - ); - } -private: - CThreadPoolMgrObject m_PoolMgr; - long m_nColor; - CString m_strUrl; - -}; - - -#endif // _ATL_THREADPOOL_NOUI -#endif // _ATL_THREADPOOL_MANAGEMENT - -#ifdef _ATL_STENCILCACHE_MANAGEMENT -////////////////////////////////////////////////////////////////////// -// Stencil cache management -class CStencilCacheMgrObject -{ -public: - CStencilCacheMgrObject() - { - - } - - HRESULT GetCurrentEntryCount(__int64 *pdwSize) - { - ATLASSUME(m_spMemCacheStats); - if (!pdwSize) - return E_INVALIDARG; - - DWORD dwValue; - HRESULT hr = m_spMemCacheStats->GetCurrentEntryCount(&dwValue); - if (hr == S_OK) - { - *pdwSize = dwValue; - } - return hr; - } - - HRESULT ClearStats() - { - ATLENSURE(m_spMemCacheStats); - return m_spMemCacheStats->ClearStats(); - } - - HRESULT GetHitCount(__int64 *pdwSize) - { - ATLENSURE(m_spMemCacheStats); - if (!pdwSize) - return E_INVALIDARG; - - DWORD dwValue; - HRESULT hr = m_spMemCacheStats->GetHitCount(&dwValue); - if (hr == S_OK) - { - *pdwSize = dwValue; - } - return hr; - } - - HRESULT GetMissCount(__int64 *pdwSize) - { - ATLENSURE(m_spMemCacheStats); - if (!pdwSize) - return E_INVALIDARG; - - DWORD dwValue; - - HRESULT hr = m_spMemCacheStats->GetMissCount(&dwValue); - if (hr == S_OK) - { - *pdwSize = dwValue; - } - return hr; - } - - HRESULT GetCurrentAllocSize(__int64 *pdwSize) - { - ATLENSURE(m_spMemCacheStats); - if (!pdwSize) - return E_INVALIDARG; - - DWORD dwValue; - - HRESULT hr = m_spMemCacheStats->GetCurrentAllocSize(&dwValue); - if (hr == S_OK) - { - *pdwSize = dwValue; - } - return hr; - } - - HRESULT GetMaxAllocSize(__int64 *pdwSize) - { - ATLENSURE(m_spMemCacheStats); - if (!pdwSize) - return E_INVALIDARG; - - DWORD dwValue; - - HRESULT hr = m_spMemCacheStats->GetMaxAllocSize(&dwValue); - if (hr == S_OK) - { - *pdwSize = dwValue; - } - return hr; - } - - - HRESULT GetMaxEntryCount(__int64 *pdwSize) - { - ATLENSURE(m_spMemCacheStats); - if (!pdwSize) - return E_INVALIDARG; - - DWORD dwValue; - - HRESULT hr = m_spMemCacheStats->GetMaxEntryCount(&dwValue); - if (hr == S_OK) - { - *pdwSize = dwValue; - } - return hr; - } - - - HRESULT RemoveStencil(__int64 hStencil) - { - ATLENSURE(m_spStencilCacheControl); - return m_spStencilCacheControl->RemoveStencil((const HCACHEITEM)hStencil); - } - - HRESULT RemoveStencilByName(BSTR szStencil) throw() - { - ATLENSURE_RETURN(m_spStencilCacheControl); - return m_spStencilCacheControl->RemoveStencilByName(CW2A(szStencil)); - } - - - HRESULT RemoveAllStencils() - { - ATLENSURE(m_spStencilCacheControl); - return m_spStencilCacheControl->RemoveAllStencils(); - } - - // we show lifespan in milliseconds in the UI so we have to - // do the conversion to 100ns intervals here. - HRESULT SetDefaultLifespan(unsigned __int64 dwdwLifespan) - { - ATLENSURE(m_spStencilCacheControl); - // convert to 100ns intervals - return m_spStencilCacheControl->SetDefaultLifespan(dwdwLifespan * CFileTime::Millisecond); - } - - HRESULT GetDefaultLifespan(unsigned __int64 *pdwdwLifespan) - { - ATLENSURE(m_spStencilCacheControl); - ATLENSURE(pdwdwLifespan!=NULL); - *pdwdwLifespan = 0; - unsigned __int64 dwls = 0; - HRESULT hr = m_spStencilCacheControl->GetDefaultLifespan(&dwls); - - // convert to milliseconds - if (SUCCEEDED(hr)) - { - dwls /= CFileTime::Millisecond; - *pdwdwLifespan = dwls; - } - - return hr; - } - - HTTP_CODE Initialize(IServiceProvider *pProvider) throw() - { - - ATLASSERT(pProvider); // should never be NULL - if (!pProvider) - return HTTP_ERROR(500, ISE_SUBERR_UNEXPECTED); - - - if (m_spMemCacheStats && m_spStencilCacheControl) - return HTTP_SUCCESS; // already initialized - - CComPtr spStencilCache; - pProvider->QueryService(__uuidof(IStencilCache), &spStencilCache); - if (spStencilCache) - { - if (!m_spMemCacheStats) - { - spStencilCache->QueryInterface(__uuidof(IMemoryCacheStats), - (void**)&m_spMemCacheStats); - } - if (!m_spStencilCacheControl) - { - spStencilCache->QueryInterface(__uuidof(IStencilCacheControl), - (void**)&m_spStencilCacheControl); - } - } - - return (m_spMemCacheStats && m_spStencilCacheControl) - ? HTTP_SUCCESS : HTTP_ERROR(500, ISE_SUBERR_UNEXPECTED); - } - -private: - CComPtr m_spMemCacheStats; - CComPtr m_spStencilCacheControl; -}; - - -#ifndef _ATL_STENCILCACHE_NOWEBSERVICE - -[ uuid("3813895C-4C4C-41df-95F4-12220140B164"), object ] -__interface IStencilCacheMgr -{ - // data access - [id(0)] STDMETHOD(GetCurrentEntryCount)([out,retval] __int64 *pdwSize); - [id(1)] STDMETHOD(GetHitCount)([out,retval] __int64 *pdwSize); - [id(2)] STDMETHOD(GetMissCount)([out,retval] __int64 *pdwSize); - [id(3)] STDMETHOD(GetCurrentAllocSize)([out,retval] __int64 *pdwSize); - [id(4)] STDMETHOD(GetMaxAllocSize)([out,retval] __int64 *pdwSize); - [id(5)] STDMETHOD(GetMaxEntryCount)([out,retval] __int64 *pdwSize); - [id(6)] STDMETHOD(GetDefaultLifespan)([out,retval] unsigned __int64 *pdwdwLifespan); - - // commands - [id(7)] STDMETHOD(ClearStats)(); - [id(8)] STDMETHOD(RemoveStencil)([in] __int64 hStencil); - [id(9)] STDMETHOD(RemoveStencilByName)([in] BSTR szStencil); - [id(10)] STDMETHOD(RemoveAllStencils)(); - [id(11)] STDMETHOD(SetDefaultLifespan)([in] unsigned __int64 dwdwLifespan); -}; - -#pragma warning(push) -#pragma warning(disable:4199) -[ - soap_handler( name= ID_STENCILCACHEMGR_WEBSERVICE_NAME, - namespace= ID_STENCILCACHEMGR_WEBSERVICE_URL, - protocol= "soap" - ), - request_handler( - name= ID_STENCILCACHEMGR_WEBSERVICE_NAME, - sdl= ID_STENCILCACHEMGR_WEBSERVICE_WSDL ) -] -class CStencilCacheManager : - public IStencilCacheMgr -{ -#pragma warning(pop) -public: - [ soap_method ] - STDMETHOD(GetCurrentEntryCount)(__int64 *pdwSize) - { - return m_MgrObj.GetCurrentEntryCount(pdwSize); - } - - [ soap_method ] - STDMETHOD(ClearStats)() - { - return m_MgrObj.ClearStats(); - } - - [ soap_method ] - STDMETHOD(GetHitCount)(__int64 *pdwSize) - { - return m_MgrObj.GetHitCount(pdwSize); - } - - [ soap_method ] - STDMETHOD(GetMissCount)(__int64 *pdwSize) - { - return m_MgrObj.GetMissCount(pdwSize); - } - - [ soap_method ] - STDMETHOD(GetCurrentAllocSize)(__int64 *pdwSize) - { - return m_MgrObj.GetCurrentAllocSize(pdwSize); - } - - [ soap_method ] - STDMETHOD(GetMaxAllocSize)(__int64 *pdwSize) - { - return m_MgrObj.GetMaxAllocSize(pdwSize); - } - - [ soap_method ] - STDMETHOD(GetMaxEntryCount)(__int64 *pdwSize) - { - return m_MgrObj.GetMaxEntryCount(pdwSize); - } - - [ soap_method ] - STDMETHOD(RemoveStencil)(__int64 hStencil) - { - return m_MgrObj.RemoveStencil(hStencil); - } - - [ soap_method ] - STDMETHOD(RemoveStencilByName)(BSTR bstrStencil) - { - return m_MgrObj.RemoveStencilByName(bstrStencil); - } - - [ soap_method ] - STDMETHOD(RemoveAllStencils)() - { - return m_MgrObj.RemoveAllStencils(); - } - - // we show lifespan in milliseconds in the UI. - // m_MgrObj handles the conversion to 100ns intervals. - [ soap_method ] - STDMETHOD(SetDefaultLifespan)(unsigned __int64 dwdwLifespan) - { - return m_MgrObj.SetDefaultLifespan(dwdwLifespan); - } - - [ soap_method ] - STDMETHOD(GetDefaultLifespan)(unsigned __int64 *pdwdwLifespan) - { - return m_MgrObj.GetDefaultLifespan(pdwdwLifespan); - } - - HTTP_CODE HandleRequest(AtlServerRequest *pRequestInfo, IServiceProvider *pProvider) - { - HTTP_CODE hcErr = m_MgrObj.Initialize(pProvider); - if (hcErr != HTTP_SUCCESS) - return hcErr; - -__if_exists(_Authority) -{ - // Make sure caller is authorized on this system - hcErr = HTTP_FAIL; - ATLTRY(hcErr = _Authority.IsAuthorized(pRequestInfo, ATL_DEFAULT_AUTHGRP)) -} - if (hcErr == HTTP_SUCCESS) - { - hcErr = __super::HandleRequest(pRequestInfo, pProvider); - } - return hcErr; - } -private: - CStencilCacheMgrObject m_MgrObj; -}; -#endif //_ATL_STENCILCACHE_NOWEBSERVICE -#ifndef _ATL_STENCILCACHE_NOUI -typedef HRESULT (CStencilCacheMgrObject::*PFNGETDATA)(__int64 *pdwSize); - -struct CCache_data -{ - PFNGETDATA m_pfn; - char m_sz[128]; -}; - -#define INVALID_DATA_PTR ((DWORD_PTR) -1) -#define INVALID_COMMAND_ID -1 -#define MAX_COMMAND_ID 64 -#define ATL_STENCILCACHECMD_CLEARALLSTATS 0 -#define ATL_STENCILCACHECMD_REMOVESTENCIL 1 -#define ATL_STENCILCACHECMD_REMOVEALLSTENCILS 2 -#define ATL_STENCILCACHECMD_SETDEFLIFESPAN 3 - -[request_handler(name=ID_STENCILCACHEMGR_SRFHANDLER_NAME)] -class CStencilMgr -{ -public: - CStencilMgr() - { - m_pData = (CCache_data*)INVALID_DATA_PTR; - m_nColor = ATL_COLOR_TR1; - } - - HTTP_CODE ValidateAndExchange() throw() - { - _ATLTRY - { - HTTP_CODE hcErr = m_MgrObj.Initialize(m_spServiceProvider); - if (hcErr != HTTP_SUCCESS) - return hcErr; - -__if_exists(_Authority) -{ - // Make sure caller is authorized on this system - hcErr = HTTP_FAIL; - ATLTRY(hcErr = _Authority.IsAuthorized(m_pRequestInfo, ATL_DEFAULT_AUTHGRP)) - if (hcErr != HTTP_SUCCESS) - return hcErr; -} - m_HttpResponse.SetContentType("text/html"); - - // check to see if we have a "Handler" form variable - CString strHandler, strOptParam; - int nCmdToExec; - - if (m_HttpRequest.GetMethod() == CHttpRequest::HTTP_METHOD_POST) - { - DWORD dwErr = m_HttpRequest.FormVars.Exchange("Method", &strHandler); - if (dwErr == VALIDATION_S_OK) - { - if (strHandler == _T("ExecuteCommand")) - { - // get the value of the command parameter so we can execute it - dwErr = m_HttpRequest.FormVars.Validate("command", &nCmdToExec, 0, MAX_COMMAND_ID); - if (dwErr == VALIDATION_S_OK) - { - // get the optional parameter if it's there. - m_HttpRequest.FormVars.Validate("DynValue", &strOptParam, 0, MAX_COMMAND_ID); - hcErr = ExecCommand(nCmdToExec, strOptParam); - return hcErr; - } - } - } - } - hcErr = LoadStencilResource(m_hInstHandler, IDR_STENCILMGR_SRF); - return hcErr; - } - _ATLCATCHALL() - { - return HTTP_FAIL; - } - } - - HTTP_CODE ExecCommand(int nCmdToExec, CString& strOptParam) - { - switch (nCmdToExec) - { - case ATL_STENCILCACHECMD_CLEARALLSTATS: - m_MgrObj.ClearStats(); - break; - - case ATL_STENCILCACHECMD_REMOVESTENCIL: - m_MgrObj.RemoveStencilByName(strOptParam.AllocSysString()); - break; - - case ATL_STENCILCACHECMD_REMOVEALLSTENCILS: - m_MgrObj.RemoveAllStencils(); - break; - - case ATL_STENCILCACHECMD_SETDEFLIFESPAN: - TCHAR *pStop = NULL; - m_MgrObj.SetDefaultLifespan(_tcstoul(strOptParam, &pStop, 10)); - break; - }; - - return _AtlRedirectToPage( - m_spServerContext, - m_HttpRequest, - m_HttpResponse, - "?Handler=" ID_STENCILCACHEMGR_SRFHANDLER_NAME - ); - - } - - [tag_name("GetNextStencilCacheStats")] - HTTP_CODE GetNextStencilCacheStats() - { - if (m_pData == (CCache_data*)INVALID_DATA_PTR) - { - m_pData = GetCacheData(); - return HTTP_SUCCESS; - } - m_pData++; - - if (m_pData->m_pfn != NULL) - return HTTP_SUCCESS; - - m_pData = (CCache_data*)INVALID_DATA_PTR; - return HTTP_S_FALSE; - - } - - [tag_name("GetCacheValue")] - HTTP_CODE GetCacheValue() - { - ATLENSURE(m_pData); - ATLENSURE(m_pData != (CCache_data*)INVALID_DATA_PTR); - m_HttpResponse << m_pData->m_sz; - return HTTP_SUCCESS; - } - - [tag_name("GetCacheQuantity")] - HTTP_CODE GetCacheQuantity() - { - ATLENSURE(m_pData); - ATLENSURE(m_pData != (CCache_data*)INVALID_DATA_PTR); - __int64 dwValue = 0; - PFNGETDATA pfn = m_pData->m_pfn; - ATLENSURE(pfn); - CStencilCacheMgrObject *pMgr = &m_MgrObj; - (pMgr->*pfn)(&dwValue); - - m_HttpResponse << dwValue; - return HTTP_SUCCESS; - } - - [tag_name("GetTRColor")] - HTTP_CODE GetTRColor() - { - m_nColor = (m_nColor == ATL_COLOR_TR1) ? ATL_COLOR_TR2 : ATL_COLOR_TR1; - TCHAR cr[8]; - if (RGBToHtml(m_nColor, cr, sizeof(cr))) - m_HttpResponse << cr; - - return HTTP_SUCCESS; - } - - [tag_name("GetBodyColor")] - HTTP_CODE GetBodyColor() - { - TCHAR cr[8]; - if (RGBToHtml(ATL_COLOR_BODYBG, cr, sizeof(cr))) - m_HttpResponse << cr; - return HTTP_SUCCESS; - } -private: - static CCache_data* GetCacheData() - { - static CCache_data cache_data[] = - { - {(PFNGETDATA)&CStencilCacheMgrObject::GetCurrentEntryCount, "Current Cache Entry Count(stencils)"}, - {(PFNGETDATA)&CStencilCacheMgrObject::GetHitCount, "Cache Hit Count(stencils)"}, - {(PFNGETDATA)&CStencilCacheMgrObject::GetMissCount, "Cache Miss Count(stencils)"}, - {(PFNGETDATA)&CStencilCacheMgrObject::GetCurrentAllocSize, "Cache memory allocation(bytes)"}, - {(PFNGETDATA)&CStencilCacheMgrObject::GetMaxAllocSize, "Cache maximum allocation size(bytes)"}, - {(PFNGETDATA)&CStencilCacheMgrObject::GetMaxEntryCount, "Cache maximum entry count(stencils)"}, - {(PFNGETDATA)&CStencilCacheMgrObject::GetDefaultLifespan, "Default stencil lifespan(ms)"}, - {NULL, NULL} - }; - return cache_data; - } - - CStencilCacheMgrObject m_MgrObj; - CCache_data *m_pData; - long m_nColor; -}; -//__declspec(selectany) CComObjectGlobal CStencilMgr::m_cachemgr; -#endif // _ATL_STENCILCACHE_NOUI -#endif // _ATL_STENCILCACHE_MANAGEMENT - -////////////////////////////////////////////////////////////////////// -// DLL cache management -#ifdef _ATL_DLLCACHE_MANAGEMENT - - -#ifndef _ATL_DLLCACHE_NOWEBSERVICE -[export] -#endif -struct _DLL_CACHE_ENTRY -{ - DWORD hInstDll; - DWORD dwRefs; - BSTR szDllName; -}; - - -class CDllMgrObject -{ -public: - HRESULT GetEntries(DWORD dwCount, _DLL_CACHE_ENTRY *pEntries, DWORD *pdwCopied) - { - ATLASSUME(m_spDllCache); - HRESULT hr = E_FAIL; - DLL_CACHE_ENTRY *pe = NULL; - - if (!m_spDllCache) - return E_UNEXPECTED; - - if (dwCount != 0 && pEntries == NULL) - return E_UNEXPECTED; // asking for entries but no place to put them - - if (!pdwCopied) - return E_POINTER; - *pdwCopied = 0; - - if (dwCount) - { - pe = new DLL_CACHE_ENTRY[dwCount]; - if (!pe) - return E_OUTOFMEMORY; - } - - hr = m_spDllCache->GetEntries(dwCount, pe, pdwCopied); - if (hr == S_OK && dwCount != 0 && pEntries != NULL) - { - // SysAllocString our path strings - for (DWORD i = 0; i<*pdwCopied; i++) - { - pEntries[i].hInstDll = (DWORD)(DWORD_PTR)pe[i].hInstDll; - pEntries[i].dwRefs = pe[i].dwRefs; - pEntries[i].szDllName = ::SysAllocString(CA2W(pe[i].szDllName)); - } - } - - delete [] pe; - return hr; - } - - - HRESULT GetEntryCount(DWORD *pdwCount) - { - ATLASSUME(m_spDllCache); - if (!m_spDllCache) - return E_UNEXPECTED; - - return m_spDllCache->GetEntries(0, NULL, pdwCount); - } - - HTTP_CODE Initialize(IServiceProvider *pProvider) - { - ATLASSERT(pProvider); // should never be NULL - if (!pProvider) - return HTTP_ERROR(500, ISE_SUBERR_UNEXPECTED); - - if (m_spDllCache) - return HTTP_SUCCESS; // already initialized - - pProvider->QueryService(__uuidof(IDllCache), &m_spDllCache); - return m_spDllCache ? HTTP_SUCCESS : HTTP_ERROR(500, ISE_SUBERR_UNEXPECTED); - } - -private: - CComPtr m_spDllCache; - -}; // CDllMgrObject - - -#ifndef _ATL_DLLCACHE_NOWEBSERVICE -// _DLL_CACHE_ENTRY is our own version of DLL_CACHE_ENTRY(atlcache.h) that -// uses a BSTR instead of a fixed length string for the szDllName for compatiblility -// with our SOAP implementation. -[ uuid("A0C00AF8-CEA5-46b9-97ED-FDEE55B583EF"), object ] -__interface IDllCacheMgr -{ - [id(0)] STDMETHOD(GetEntries)([in] DWORD dwCount, [out] _DLL_CACHE_ENTRY *pEntries, [out, retval] DWORD *pdwCopied); - [id(1)] STDMETHOD(GetEntryCount)([out, retval] DWORD *pdwCount); - -}; - - -#pragma warning(push) -#pragma warning(disable:4199) -[ - soap_handler( - name= ID_DLLCACHEMGR_WEBSERVICE_NAME, - namespace= ID_DLLCACHEMGR_WEBSERVICE_URL, - protocol= "soap" - ), - request_handler( - name= ID_DLLCACHEMGR_WEBSERVICE_NAME, - sdl= ID_DLLCACHEMGR_WEBSERVICE_WSDL - ) -] -class CDllCacheManager : - public IDllCacheMgr -{ -#pragma warning(pop) -public: - [soap_method] - HRESULT GetEntries(DWORD dwCount, _DLL_CACHE_ENTRY *pEntries, DWORD *pdwCopied) - { - return m_MgrObj.GetEntries(dwCount, pEntries, pdwCopied); - } - - [soap_method] - STDMETHOD(GetEntryCount)(DWORD *pdwCount) - { - return m_MgrObj.GetEntries(0, NULL, pdwCount); - } - - HTTP_CODE HandleRequest(AtlServerRequest *pRequestInfo, IServiceProvider *pProvider) - { - HTTP_CODE hcErr = m_MgrObj.Initialize(pProvider); - if (hcErr != HTTP_SUCCESS) - return hcErr; - -__if_exists(_Authority) -{ - // Make sure caller is authorized on this system - hcErr = HTTP_FAIL; - ATLTRY(hcErr = _Authority.IsAuthorized(pRequestInfo, ATL_DEFAULT_AUTHGRP)) -} - if (hcErr == HTTP_SUCCESS) - { - hcErr = __super::HandleRequest(pRequestInfo, pProvider); - } - return hcErr; - } - -protected: - CDllMgrObject m_MgrObj; -}; -#endif _ATL_DLLCACHE_NOWEBSERVICE - -#ifndef _ATL_DLLCACHE_NOUI -#define INVALID_INDEX -1 - -[ - request_handler(name=ID_DLLCACHEMGR_SRFHANDLER_NAME) -] -class CDllCacheMgr -{ -public: - CDllCacheMgr() : m_nColor(ATL_COLOR_TR1), - m_nEnumCount(INVALID_INDEX), - m_nEnumIndex(INVALID_INDEX), - m_pEntries(NULL) - { - - } - - [tag_name("GetTRColor")] - HTTP_CODE GetTRColor() - { - m_nColor = (m_nColor == ATL_COLOR_TR1) ? ATL_COLOR_TR2 : ATL_COLOR_TR1; - TCHAR cr[8]; - if (RGBToHtml(m_nColor, cr, sizeof(cr))) - m_HttpResponse << cr; - - return HTTP_SUCCESS; - } - - [tag_name("GetBodyColor")] - HTTP_CODE GetBodyColor() - { - TCHAR cr[8]; - if (RGBToHtml(ATL_COLOR_BODYBG, cr, sizeof(cr))) - m_HttpResponse << cr; - return HTTP_SUCCESS; - } - - - [tag_name("GetNumEntries")] - HTTP_CODE GetNumEntries() - { - DWORD dwEntries = 0; - m_MgrObj.GetEntryCount(&dwEntries); - m_HttpResponse << dwEntries; - return HTTP_SUCCESS; - } - - - [tag_name("EnumEntries")] - HTTP_CODE EnumEntries() - { - // we lock the cache while we enum entries so no entries - // will be removed during the enumeration request. - if (m_nEnumIndex == INVALID_INDEX) - { - // set up for the iteration - m_MgrObj.GetEntryCount((DWORD*)&m_nEnumCount); - if (!m_nEnumCount) - return HTTP_S_FALSE; // nothing to enum - - m_pEntries = new _DLL_CACHE_ENTRY[m_nEnumCount]; - if (!m_pEntries) - return HTTP_ERROR(500, ISE_SUBERR_OUTOFMEM); - - DWORD dwFetched = INVALID_INDEX; - - if (S_OK != m_MgrObj.GetEntries(m_nEnumCount, m_pEntries, &dwFetched)) - return HTTP_ERROR(500, ISE_SUBERR_UNEXPECTED); - - m_nEnumIndex = 0; - return HTTP_SUCCESS; - } - - m_nEnumIndex++; - if (m_nEnumIndex < m_nEnumCount) - return HTTP_SUCCESS; // continue iterating - - else - { - // done, clean up - for (int i = 0; i< m_nEnumCount; i++) - { - ::SysFreeString(m_pEntries[i].szDllName); - } - delete [] m_pEntries; - m_pEntries = NULL; - m_nEnumCount = INVALID_INDEX; - m_nEnumIndex = INVALID_INDEX; - return HTTP_S_FALSE; // terminate iterations. - } - } - - [tag_name("GetDllName")] - HTTP_CODE GetDllName() - { - m_HttpResponse << m_pEntries[m_nEnumIndex].szDllName; - return HTTP_SUCCESS; - } - - [tag_name("GetDllReferences")] - HTTP_CODE GetDllReferences() - { - m_HttpResponse << m_pEntries[m_nEnumIndex].dwRefs; - return HTTP_SUCCESS; - } - - HTTP_CODE ValidateAndExchange() - { - - HTTP_CODE hcErr = m_MgrObj.Initialize(m_spServiceProvider); - if (hcErr != HTTP_SUCCESS) - return hcErr; - -__if_exists(_Authority) -{ - // Make sure caller is authorized on this system - hcErr = HTTP_FAIL; - ATLTRY(hcErr = _Authority.IsAuthorized(m_pRequestInfo, ATL_DEFAULT_AUTHGRP)) - if (hcErr != HTTP_SUCCESS) - return hcErr; -} - hcErr = LoadStencilResource(m_hInstHandler, IDR_DLLMGR_SRF); - m_HttpResponse.SetContentType("text/html"); - return hcErr; - - } - - CDllMgrObject m_MgrObj; - long m_nColor; - int m_nEnumCount; - int m_nEnumIndex; - _DLL_CACHE_ENTRY *m_pEntries; - -}; - -#endif // _ATL_DLLCACHE_NOUI -#endif // _ATL_DLLCACHE_MANAGEMENT - -}; // ATL - -#pragma pack(pop) -#pragma warning(pop) -#endif // __ATLEXTMGMT_H__ diff --git a/include/atl/atlhtml.h b/include/atl/atlhtml.h deleted file mode 100644 index 4922e580d..000000000 --- a/include/atl/atlhtml.h +++ /dev/null @@ -1,1682 +0,0 @@ -// This is a part of the Active Template Library. -// Copyright (C) Microsoft Corporation -// All rights reserved. -// -// This source code is only intended as a supplement to the -// Active Template Library Reference and related -// electronic documentation provided with the library. -// See these sources for detailed information regarding the -// Active Template Library product. - -#ifndef __ATLHTML_H__ -#define __ATLHTML_H__ - -#pragma once - -#include -#include -#include - - - -#pragma pack(push,_ATL_PACKING) -namespace ATL { - -#define TAGF_NONE 0 -#define TAGF_HASEND 1 -#define TAGF_BLOCK 2 - - -struct ATL_HTML_TAG -{ - LPCTSTR szTagName; - UINT uFlags; -}; - -enum ATL_HTML_TAGS { - ATL_HTML_TAG_BODY, - ATL_HTML_TAG_A, - ATL_HTML_TAG_B, - ATL_HTML_TAG_I, - ATL_HTML_TAG_U, - ATL_HTML_TAG_FONT, - ATL_HTML_TAG_IMG, - ATL_HTML_TAG_HR, - ATL_HTML_TAG_BR, - ATL_HTML_TAG_DIV, - ATL_HTML_TAG_BLOCKQUOTE, - ATL_HTML_TAG_ADDRESS, - ATL_HTML_TAG_P, - ATL_HTML_TAG_H1, - ATL_HTML_TAG_H2, - ATL_HTML_TAG_H3, - ATL_HTML_TAG_H4, - ATL_HTML_TAG_H5, - ATL_HTML_TAG_H6, - ATL_HTML_TAG_PRE, - ATL_HTML_TAG_Q, - ATL_HTML_TAG_SUB, - ATL_HTML_TAG_SUP, - ATL_HTML_TAG_INS, - ATL_HTML_TAG_DEL, - ATL_HTML_TAG_EM, - ATL_HTML_TAG_STRONG, - ATL_HTML_TAG_DFN, - ATL_HTML_TAG_CODE, - ATL_HTML_TAG_SAMP, - ATL_HTML_TAG_KBD, - ATL_HTML_TAG_VAR, - ATL_HTML_TAG_CITE, - ATL_HTML_TAG_ABBR, - ATL_HTML_TAG_ACRONYM, - ATL_HTML_TAG_OL, - ATL_HTML_TAG_UL, - ATL_HTML_TAG_LI, - ATL_HTML_TAG_DL, - ATL_HTML_TAG_DT, - ATL_HTML_TAG_DD, - ATL_HTML_TAG_TABLE, - ATL_HTML_TAG_TR, - ATL_HTML_TAG_TD, - ATL_HTML_TAG_FORM, - ATL_HTML_TAG_INPUT, - ATL_HTML_TAG_SELECT, - ATL_HTML_TAG_OPTION, - ATL_HTML_TAG_HEAD, - ATL_HTML_TAG_HTML, - ATL_HTML_TAG_MAP, - ATL_HTML_TAG_AREA, - ATL_HTML_TAG_BASE, - ATL_HTML_TAG_BDO, - ATL_HTML_TAG_BIG, - ATL_HTML_TAG_BUTTON, - ATL_HTML_TAG_IFRAME, - ATL_HTML_TAG_LABEL, - ATL_HTML_TAG_LINK, - ATL_HTML_TAG_META, - ATL_HTML_TAG_NOFRAMES, - ATL_HTML_TAG_NOSCRIPT, - ATL_HTML_TAG_COL, - ATL_HTML_TAG_COLGROUP, - ATL_HTML_TAG_FIELDSET, - ATL_HTML_TAG_LEGEND, - ATL_HTML_TAG_TBODY, - ATL_HTML_TAG_TEXTAREA, - ATL_HTML_TAG_TFOOT, - ATL_HTML_TAG_TH, - ATL_HTML_TAG_TITLE, - ATL_HTML_TAG_TT, - ATL_HTML_TAG_SMALL, - ATL_HTML_TAG_SPAN, - ATL_HTML_TAG_OBJECT, - ATL_HTML_TAG_PARAM, - ATL_HTML_TAG_LAST }; - -extern __declspec(selectany) const ATL_HTML_TAG s_tags[] = -{ - { _T("body"), TAGF_HASEND | TAGF_BLOCK }, - { _T("a"), TAGF_HASEND }, - { _T("b"), TAGF_HASEND }, - { _T("i"), TAGF_HASEND }, - { _T("u"), TAGF_HASEND }, - { _T("font"), TAGF_HASEND }, - { _T("img"), TAGF_NONE }, - { _T("hr"), TAGF_NONE }, - { _T("br"), TAGF_NONE }, - { _T("div"), TAGF_HASEND | TAGF_BLOCK }, - { _T("blockquote"), TAGF_HASEND | TAGF_BLOCK }, - { _T("adress"), TAGF_HASEND }, - { _T("p"), TAGF_HASEND | TAGF_BLOCK }, - { _T("h1"), TAGF_HASEND | TAGF_BLOCK}, - { _T("h2"), TAGF_HASEND | TAGF_BLOCK}, - { _T("h3"), TAGF_HASEND | TAGF_BLOCK }, - { _T("h4"), TAGF_HASEND | TAGF_BLOCK }, - { _T("h5"), TAGF_HASEND | TAGF_BLOCK }, - { _T("h6"), TAGF_HASEND | TAGF_BLOCK }, - { _T("pre"), TAGF_HASEND | TAGF_BLOCK }, - { _T("q"), TAGF_HASEND }, - { _T("sub"), TAGF_HASEND }, - { _T("sup"), TAGF_HASEND }, - { _T("ins"), TAGF_HASEND }, - { _T("del"), TAGF_HASEND }, - { _T("em"), TAGF_HASEND }, - { _T("strong"), TAGF_HASEND }, - { _T("dfn"), TAGF_HASEND }, - { _T("code"), TAGF_HASEND }, - { _T("samp"), TAGF_HASEND }, - { _T("kbd"), TAGF_HASEND }, - { _T("var"), TAGF_HASEND }, - { _T("cite"), TAGF_HASEND }, - { _T("abbr"), TAGF_HASEND }, - { _T("acronym"), TAGF_HASEND }, - { _T("ol"), TAGF_HASEND | TAGF_BLOCK }, - { _T("ul"), TAGF_HASEND | TAGF_BLOCK }, - { _T("li"), TAGF_HASEND }, - { _T("dl"), TAGF_HASEND | TAGF_BLOCK }, - { _T("dt"), TAGF_HASEND }, - { _T("dd"), TAGF_HASEND }, - { _T("table"), TAGF_HASEND }, - { _T("tr"), TAGF_HASEND }, - { _T("td"), TAGF_HASEND }, - { _T("form"), TAGF_HASEND }, - { _T("input"), TAGF_HASEND }, - { _T("select"), TAGF_HASEND }, - { _T("option"), TAGF_HASEND }, - { _T("head"), TAGF_HASEND | TAGF_BLOCK }, - { _T("html"), TAGF_HASEND | TAGF_BLOCK }, - { _T("map"), TAGF_HASEND | TAGF_BLOCK }, - { _T("area"), TAGF_BLOCK }, - { _T("base"), TAGF_BLOCK }, - { _T("bdo"), TAGF_HASEND }, - { _T("big"), TAGF_HASEND }, - { _T("button"), TAGF_HASEND }, - { _T("iframe"), TAGF_HASEND }, - { _T("label"), TAGF_HASEND }, - { _T("link"), TAGF_NONE }, - { _T("meta"), TAGF_BLOCK }, - { _T("noframes"), TAGF_BLOCK }, - { _T("noscript"), TAGF_BLOCK }, - { _T("col"), TAGF_BLOCK }, - { _T("colgroup"), TAGF_HASEND | TAGF_BLOCK }, - { _T("fieldset"), TAGF_HASEND | TAGF_BLOCK }, - { _T("legend"), TAGF_HASEND | TAGF_BLOCK }, - { _T("tbody"), TAGF_HASEND | TAGF_BLOCK }, - { _T("textarea"), TAGF_HASEND | TAGF_BLOCK }, - { _T("tfoot"), TAGF_HASEND | TAGF_BLOCK }, - { _T("th"), TAGF_HASEND | TAGF_BLOCK }, - { _T("title"), TAGF_HASEND | TAGF_BLOCK }, - { _T("tt"), TAGF_HASEND }, - { _T("small"), TAGF_HASEND }, - { _T("span"), TAGF_HASEND }, - { _T("object"), TAGF_HASEND | TAGF_BLOCK }, - { _T("param"), TAGF_NONE }, -}; - -class AtlHtmlAttrs -{ -public: - CString m_strAttrs; - - AtlHtmlAttrs() - { - - } - -#pragma warning(push) -#pragma warning(disable : 4793) - AtlHtmlAttrs(int nCount, ...) - { - va_list args; - - va_start(args, nCount); - for (int i=0; i(szAttrs[0]))) -#else - if (!iswspace(szAttrs[0])) -#endif - m_strAttrs = _T(" "); - m_strAttrs += szAttrs; - } - } - - operator LPCTSTR() - { - return m_strAttrs; - } - -}; - -class CStreamOnWriteStream : public IStream -{ -public: - IWriteStream *m_pWriteStream; - - CStreamOnWriteStream() - { - m_pWriteStream = NULL; - } - - void Init(IWriteStream *pWriteStream) - { - m_pWriteStream = pWriteStream; - } - - // IUnknown methods - STDMETHOD(QueryInterface)(REFIID riid, void **ppv) - { - if (!ppv) - return E_POINTER; - - *ppv = NULL; - - if (IsEqualGUID(riid, IID_IUnknown) || - IsEqualGUID(riid, IID_IStream) || - IsEqualGUID(riid, IID_ISequentialStream)) - { - *ppv = (IStream *) this; - } - if (!*ppv) - return E_NOINTERFACE; - return S_OK; - } - - ULONG __stdcall AddRef() - { - return 1; - } - - ULONG __stdcall Release() - { - return 1; - } - - // ISequentialStream methods - HRESULT STDMETHODCALLTYPE Read(void * /*pDest*/, ULONG /*dwMaxLen*/, ULONG * /*pdwRead*/) - { - return E_NOTIMPL; - } - - HRESULT STDMETHODCALLTYPE Write(const void *pv, ULONG cb, ULONG *pcbWritten) - { - ATLASSUME(m_pWriteStream); - HRESULT hr = m_pWriteStream->WriteStream((const char *) pv, cb, pcbWritten); - return (hr==S_OK) ? S_OK : STG_E_WRITEFAULT; - } - - // IStream methods - HRESULT STDMETHODCALLTYPE Seek(LARGE_INTEGER /*dlibMove*/, DWORD /*dwOrigin*/, ULARGE_INTEGER * /*plibNewPosition*/) - { - return E_NOTIMPL; - } - - HRESULT STDMETHODCALLTYPE SetSize(ULARGE_INTEGER /*libNewSize*/) - { - return E_NOTIMPL; - } - - HRESULT STDMETHODCALLTYPE CopyTo(IStream * /*pstm*/, ULARGE_INTEGER /*cb*/, ULARGE_INTEGER * /*pcbRead*/, ULARGE_INTEGER * /*pcbWritten*/) - { - return E_NOTIMPL; - } - - HRESULT STDMETHODCALLTYPE Commit(DWORD /*grfCommitFlags*/) - { - return E_NOTIMPL; - } - - HRESULT STDMETHODCALLTYPE Revert(void) - { - return E_NOTIMPL; - } - - HRESULT STDMETHODCALLTYPE LockRegion(ULARGE_INTEGER /*libOffset*/, ULARGE_INTEGER /*cb*/, DWORD /*dwLockType*/) - { - return E_NOTIMPL; - } - - HRESULT STDMETHODCALLTYPE UnlockRegion(ULARGE_INTEGER /*libOffset*/, ULARGE_INTEGER /*cb*/, DWORD /*dwLockType*/) - { - return E_NOTIMPL; - } - - HRESULT STDMETHODCALLTYPE Stat(STATSTG * /*pstatstg*/, DWORD /*grfStatFlag*/) - { - return E_NOTIMPL; - } - - - HRESULT STDMETHODCALLTYPE Clone(IStream ** /*ppstm*/) - { - return E_NOTIMPL; - } -}; - -class CStreamFormatter -{ -protected: - CStreamOnWriteStream m_sows; - IStream *m_pStream; - BOOL m_bAddCRLF; - BOOL m_bEmitUnicode; - UINT m_nConversionCodepage; - -public: - CStreamFormatter() - { - m_pStream = NULL; - m_bAddCRLF = TRUE; - m_bEmitUnicode = FALSE; - m_nConversionCodepage = _AtlGetConversionACP(); - } - - void Initialize(IStream *pStream, BOOL bAddCRLF=TRUE) - { - m_pStream = pStream; - m_bAddCRLF = bAddCRLF; - } - - void Initialize(IWriteStream *pWriteStream, BOOL bAddCRLF=TRUE) - { - m_bAddCRLF = bAddCRLF; - m_sows.Init(pWriteStream); - m_pStream = &m_sows; - } - - void EmitUnicode(BOOL bEmitUnicode) - { - m_bEmitUnicode = bEmitUnicode; - } - - void SetConversionCodepage(UINT nConversionCodepage) - { - m_nConversionCodepage = nConversionCodepage; - } - - void AddCRLF(bool bNewVal) - { - m_bAddCRLF = bNewVal; - } - - HRESULT WriteRaw(LPCTSTR szString, int nCount=-1) - { - ATLENSURE_RETURN(szString != NULL); - if (!m_pStream) - return E_FAIL; - - if (m_bEmitUnicode) - { -#ifdef _UNICODE - LPCWSTR sz = szString; - if (nCount == -1) - nCount = (int) wcslen(szString); -#else - CA2W sz(szString, m_nConversionCodepage); - nCount = (int) wcslen(sz); -#endif - DWORD dwWritten; - return m_pStream->Write(sz, (DWORD) nCount*sizeof(WCHAR), &dwWritten); - } - else - { -#ifdef _UNICODE - CW2A sz(szString, m_nConversionCodepage); - nCount = (int) strlen(sz); -#else - LPCSTR sz = szString; - if (nCount == -1) - nCount = (int) strlen(szString); -#endif - DWORD dwWritten; - return m_pStream->Write(sz, (DWORD) nCount, &dwWritten); - } - } - - HRESULT StartTag(int nTagIndex, LPCTSTR szContent=NULL, LPCTSTR szAttrs=NULL) - { - if (nTagIndex < 0 || nTagIndex >= ATL_HTML_TAG_LAST) - return E_INVALIDARG; - if (m_bAddCRLF && (s_tags[nTagIndex].uFlags & TAGF_BLOCK)) - WriteRaw(_T("\r\n")); - HRESULT hr = StartTag(s_tags[nTagIndex].szTagName, szContent, szAttrs); - if (FAILED(hr)) - return hr; - if (m_bAddCRLF && (s_tags[nTagIndex].uFlags & TAGF_BLOCK)) - WriteRaw(_T("\r\n")); - return S_OK; - } - - HRESULT StartTag(LPCTSTR szTag, LPCTSTR szContent=NULL, LPCTSTR szAttrs=NULL) - { - HRESULT hr; - hr = WriteRaw(_T("<")); - if (FAILED(hr)) - return hr; - hr = WriteRaw(szTag); - if (FAILED(hr)) - return hr; - hr = WriteAttributes(szAttrs); - if (FAILED(hr)) - return hr; - hr = WriteRaw(_T(">")); - if (FAILED(hr)) - return hr; - if (szContent && *szContent) - { - WriteRaw(szContent); - EndTag(szTag); - } - return S_OK; - } - - HRESULT EndTag(int nTagIndex) - { - if (nTagIndex < 0 || nTagIndex >= ATL_HTML_TAG_LAST) - return E_INVALIDARG; - if (m_bAddCRLF && (s_tags[nTagIndex].uFlags & TAGF_BLOCK)) - WriteRaw(_T("\r\n")); - HRESULT hr = EndTag(s_tags[nTagIndex].szTagName); - if (FAILED(hr)) - return hr; - if (m_bAddCRLF && (s_tags[nTagIndex].uFlags & TAGF_BLOCK)) - WriteRaw(_T("\r\n")); - return S_OK; - } - - HRESULT EndTag(LPCTSTR szTag) - { - HRESULT hr = WriteRaw(_T("")); - } - - HRESULT WriteAttributes(LPCTSTR szAttrs) - { - if (szAttrs && szAttrs[0]) - { -#ifndef UNICODE - if (!isspace(static_cast(szAttrs[0]))) -#else - if (!iswspace(szAttrs[0])) -#endif - WriteRaw(_T(" ")); - return WriteRaw(szAttrs); - } - - return S_OK; - } - -#pragma warning(push) -#pragma warning(disable : 4793) - HRESULT WriteFormatted(LPCTSTR szFormat, ...) - { - ATLASSERT(szFormat != NULL); - if (!m_pStream) - return E_FAIL; - - va_list args; - va_start(args, szFormat); - - - TCHAR buffFixed[1024]; - CTempBuffer buffHeap; - TCHAR *szTemp = buffFixed; - int nCount = _vstprintf_s((LPTSTR)szTemp, _countof(buffFixed), szFormat, args); - if (nCount < 0) - { - // we'll have to dynamically allocate the buffer - nCount = _vsctprintf(szFormat, args); - szTemp = NULL; - ATLTRY(szTemp = buffHeap.Allocate(nCount + 1)); - if (!szTemp) - return E_OUTOFMEMORY; - nCount = _vstprintf_s(szTemp, nCount+1, szFormat, args); - } - - va_end(args); - - if (nCount > 0) - return WriteRaw(szTemp, (DWORD) nCount); - return E_UNEXPECTED; - } -#pragma warning(pop) -}; - -template -class CSimpleStack -{ -public: - int m_nTop; - TData m_Data[nMax]; - - CSimpleStack() - { - m_nTop = -1; - } - - bool IsEmpty() - { - return (m_nTop == -1); - } - - bool Push(const TData *pData) - { - if (m_nTop + 1 >= nMax) - return false; - - m_nTop++; - - m_Data[m_nTop] = *pData; - return true; - } - - bool Pop(TData *pData) - { - if (m_nTop < 0) - return false; - - *pData = m_Data[m_nTop]; - m_nTop--; - return true; - } -}; - - -struct HTML_SCHEME -{ - CString strBgColor; - CString strLinkColor; - CString strVLinkColor; - CString strALinkColor; - CString strBackground; - int nTopMargin; - int nLeftMargin; - - CString strTdBgColor; - CString strTableBgColor; - CString strTrBgColor; - - HTML_SCHEME() - { - nTopMargin = -1; - nLeftMargin = -1; - } -}; - -template -class CHtmlGenBase : public CStreamFormatter -{ -public: - T* GetOuter() - { - return static_cast(this); - } - - enum ATL_HTML_FORM_METHOD { ATL_HTML_FORM_METHOD_NONE=0, ATL_HTML_FORM_METHOD_GET, ATL_HTML_FORM_METHOD_POST, ATL_HTML_FORM_METHOD_MULTIPART }; - - CHtmlGenBase() - { - m_nWidthPercent = -1; - m_nHeightPercent = -1; - m_nFormMethod = ATL_HTML_FORM_METHOD_NONE; - m_pScheme = NULL; - } - - void SetScheme(HTML_SCHEME *pScheme) - { - m_pScheme = pScheme; - } - - HRESULT body(LPCTSTR szBgColor=NULL, LPCTSTR szBackground=NULL, LPCTSTR szTopMargin=NULL, LPCTSTR szLeftMargin=NULL, - LPCTSTR szAttrs=NULL) - { - AtlHtmlAttrs Attrs; - Attrs.Set(szAttrs); - - if (szBgColor && *szBgColor) - Attrs.Add(_T("bgColor"), szBgColor); - else if (m_pScheme && m_pScheme->strBgColor.GetLength()) - Attrs.Add(_T("bgColor"), m_pScheme->strBgColor); - - if (szBackground && *szBackground) - Attrs.Add(_T("background"), szBackground); - else if (m_pScheme && m_pScheme->strBackground.GetLength()) - Attrs.Add(_T("background"), m_pScheme->strBackground); - - if (m_pScheme && m_pScheme->strLinkColor.GetLength()) - Attrs.Add(_T("link"), m_pScheme->strLinkColor); - - if (m_pScheme && m_pScheme->strALinkColor.GetLength()) - Attrs.Add(_T("alink"), m_pScheme->strALinkColor); - - if (m_pScheme && m_pScheme->strVLinkColor.GetLength()) - Attrs.Add(_T("vlink"), m_pScheme->strVLinkColor); - - if (szTopMargin && *szTopMargin) - Attrs.Add(_T("topmargin"), szTopMargin); - else if (m_pScheme && m_pScheme->nTopMargin != -1) - Attrs.AddFormat(_T("topmargin=\"%d\""), m_pScheme->nTopMargin); - - if (szLeftMargin && *szLeftMargin) - Attrs.Add(_T("leftmargin"), szLeftMargin); - else if (m_pScheme && m_pScheme->nLeftMargin != -1) - Attrs.AddFormat(_T("leftmargin=\"%d\""), m_pScheme->nLeftMargin); - - return GetOuter()->StartTag(ATL_HTML_TAG_BODY, NULL, Attrs); - } - - HRESULT bodyEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_BODY); - } - - HRESULT a(LPCTSTR szHref, LPCTSTR szContent=NULL, LPCTSTR szAttrs=NULL) - { - AtlHtmlAttrs Attrs; - Attrs.Set(szAttrs); - - if (m_strState.GetLength()==0) - { - if (szHref && *szHref) - Attrs.Add(_T("href"), szHref); - return GetOuter()->StartTag(ATL_HTML_TAG_A, szContent, Attrs); - } - - const TCHAR *szQuestion = NULL; - if(szHref) - szQuestion = _tcschr(szHref, '?'); - - CString strHref = szHref; - if (!szQuestion) - strHref.Append("?"); - else - strHref.Append("&"); - - strHref += m_strState; - - if (szHref && *szHref) - Attrs.Add(_T("href"), strHref); - - return GetOuter()->StartTag(ATL_HTML_TAG_A, szContent, Attrs); - } - - HRESULT aEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_A); - } - - HRESULT b(LPCTSTR szContent=NULL, LPCTSTR szAttrs=NULL) - { - return GetOuter()->StartTag(ATL_HTML_TAG_B, szContent, szAttrs); - } - - HRESULT bEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_B); - } - - HRESULT i(LPCTSTR szContent=NULL, LPCTSTR szAttrs=NULL) - { - return GetOuter()->StartTag(ATL_HTML_TAG_I, szContent, szAttrs); - } - - HRESULT iEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_I); - } - - HRESULT u(LPCTSTR szContent=NULL, LPCTSTR szAttrs=NULL) - { - return GetOuter()->StartTag(ATL_HTML_TAG_U, szContent, szAttrs); - } - - HRESULT uEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_U); - } - - HRESULT font(LPCTSTR szFace, LPCTSTR szSize=NULL, LPCTSTR szColor=NULL, LPCTSTR szAttrs=NULL) - { - AtlHtmlAttrs Attrs; - Attrs.Set(szAttrs); - if (szFace && *szFace) - Attrs.Add(_T("face"), szFace); - if (szSize && *szSize) - Attrs.Add(_T("size"), szSize); - if (szColor && *szColor) - Attrs.Add(_T("color"), szColor); - return GetOuter()->StartTag(ATL_HTML_TAG_FONT, NULL, Attrs); - } - - HRESULT font(COLORREF clrColor, LPCTSTR szAttrs=NULL) - { - TCHAR szColor[8]; - _stprintf_s(szColor, _countof(szColor), _T("#%02x%02x%02x"), GetRValue(clrColor), - GetGValue(clrColor), GetBValue(clrColor)); - return GetOuter()->font(NULL, NULL, szColor, szAttrs); - } - - HRESULT fontEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_FONT); - } - - HRESULT img(LPCTSTR szSrc, LPCTSTR szAttrs=NULL) - { - ATLASSERT(szSrc && *szSrc); - - AtlHtmlAttrs Attrs; - Attrs.Set(szAttrs); - - Attrs.Add(_T("src"), szSrc); - - return GetOuter()->StartTag(ATL_HTML_TAG_IMG, NULL, Attrs); - } - - HRESULT br(LPCTSTR szAttrs=NULL) - { - return GetOuter()->StartTag(ATL_HTML_TAG_BR, NULL, szAttrs); - } - - HRESULT hr(LPCTSTR szAttrs=NULL) - { - return GetOuter()->StartTag(ATL_HTML_TAG_HR, NULL, szAttrs); - } - - HRESULT div(LPCTSTR szContent=NULL, LPCTSTR szAttrs=NULL) - { - return GetOuter()->StartTag(ATL_HTML_TAG_DIV, szContent, szAttrs); - } - - HRESULT divEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_DIV); - } - - HRESULT blockquote(LPCTSTR szContent=NULL, LPCTSTR szAttrs=NULL) - { - return GetOuter()->StartTag(ATL_HTML_TAG_BLOCKQUOTE, szContent, szAttrs); - } - - HRESULT blockquoteEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_BLOCKQUOTE); - } - - HRESULT address(LPCTSTR szContent=NULL, LPCTSTR szAttrs=NULL) - { - return GetOuter()->StartTag(ATL_HTML_TAG_ADDRESS, szContent, szAttrs); - } - - HRESULT addressEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_ADDRESS); - } - - HRESULT p(LPCTSTR szContent=NULL, LPCTSTR szAttrs=NULL) - { - return GetOuter()->StartTag(ATL_HTML_TAG_P, szContent, szAttrs); - } - - HRESULT pEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_P); - } - - HRESULT h(int nLevel=1, LPCTSTR szContent=NULL, LPCTSTR szAttrs=NULL) - { - if (nLevel < 1 || nLevel > 6) - return E_INVALIDARG; - return GetOuter()->StartTag(ATL_HTML_TAG_H1+nLevel-1, szContent, szAttrs); - } - - HRESULT hEnd(int nLevel=1) - { - if (nLevel < 1 || nLevel > 6) - return E_INVALIDARG; - return GetOuter()->EndTag(ATL_HTML_TAG_H1+nLevel-1); - } - - HRESULT pre(LPCTSTR szContent=NULL, LPCTSTR szAttrs=NULL) - { - return GetOuter()->StartTag(ATL_HTML_TAG_PRE, szContent, szAttrs); - } - - HRESULT preEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_PRE); - } - - HRESULT q(LPCTSTR szContent=NULL, LPCTSTR szAttrs=NULL) - { - return GetOuter()->StartTag(ATL_HTML_TAG_Q, szContent, szAttrs); - } - - HRESULT qEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_Q); - } - - HRESULT sub(LPCTSTR szContent=NULL, LPCTSTR szAttrs=NULL) - { - return GetOuter()->StartTag(ATL_HTML_TAG_SUB, szContent, szAttrs); - } - - HRESULT subEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_SUB); - } - - HRESULT sup(LPCTSTR szContent=NULL, LPCTSTR szAttrs=NULL) - { - return GetOuter()->StartTag(ATL_HTML_TAG_SUP, szContent, szAttrs); - } - - HRESULT supEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_SUP); - } - - HRESULT ins(LPCTSTR szContent=NULL, LPCTSTR szAttrs=NULL) - { - return GetOuter()->StartTag(ATL_HTML_TAG_INS, szContent, szAttrs); - } - - HRESULT insEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_INS); - } - - HRESULT del(LPCTSTR szContent=NULL, LPCTSTR szAttrs=NULL) - { - return GetOuter()->StartTag(ATL_HTML_TAG_DEL, szContent, szAttrs); - } - - HRESULT delEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_DEL); - } - - - HRESULT em(LPCTSTR szContent=NULL, LPCTSTR szAttrs=NULL) - { - return GetOuter()->StartTag(ATL_HTML_TAG_EM, szContent, szAttrs); - } - - HRESULT emEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_EM); - } - - HRESULT strong(LPCTSTR szContent=NULL, LPCTSTR szAttrs=NULL) - { - return GetOuter()->StartTag(ATL_HTML_TAG_STRONG, szContent, szAttrs); - } - - HRESULT strongEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_STRONG); - } - - HRESULT dfn(LPCTSTR szContent=NULL, LPCTSTR szAttrs=NULL) - { - return GetOuter()->StartTag(ATL_HTML_TAG_DFN, szContent, szAttrs); - } - - HRESULT dfnEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_DFN); - } - - HRESULT code(LPCTSTR szContent=NULL, LPCTSTR szAttrs=NULL) - { - return GetOuter()->StartTag(ATL_HTML_TAG_CODE, szContent, szAttrs); - } - - HRESULT codeEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_CODE); - } - - HRESULT samp(LPCTSTR szContent=NULL, LPCTSTR szAttrs=NULL) - { - return GetOuter()->StartTag(ATL_HTML_TAG_SAMP, szContent, szAttrs); - } - - HRESULT sampEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_SAMP); - } - - HRESULT kbd(LPCTSTR szContent=NULL, LPCTSTR szAttrs=NULL) - { - return GetOuter()->StartTag(ATL_HTML_TAG_KBD, szContent, szAttrs); - } - - HRESULT kbdEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_KBD); - } - - HRESULT var(LPCTSTR szContent=NULL, LPCTSTR szAttrs=NULL) - { - return GetOuter()->StartTag(ATL_HTML_TAG_VAR, szContent, szAttrs); - } - - HRESULT varEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_VAR); - } - - HRESULT cite(LPCTSTR szContent=NULL, LPCTSTR szAttrs=NULL) - { - return GetOuter()->StartTag(ATL_HTML_TAG_CITE, szContent, szAttrs); - } - - HRESULT citeEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_CITE); - } - - HRESULT abbr(LPCTSTR szContent=NULL, LPCTSTR szAttrs=NULL) - { - return GetOuter()->StartTag(ATL_HTML_TAG_ABBR, szContent, szAttrs); - } - - HRESULT abbrEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_ABBR); - } - - HRESULT acronym(LPCTSTR szContent=NULL, LPCTSTR szAttrs=NULL) - { - return GetOuter()->StartTag(ATL_HTML_TAG_ACRONYM, szContent, szAttrs); - } - - HRESULT acronymEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_ACRONYM); - } - - - HRESULT ol(LPCTSTR szAttrs=NULL) - { - return GetOuter()->StartTag(ATL_HTML_TAG_OL, NULL, szAttrs); - } - - HRESULT ul(LPCTSTR szAttrs=NULL) - { - return GetOuter()->StartTag(ATL_HTML_TAG_UL, NULL, szAttrs); - } - - HRESULT olEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_OL); - } - - HRESULT ulEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_UL); - } - - HRESULT li(LPCTSTR szContent=NULL, LPCTSTR szAttrs=NULL) - { - return GetOuter()->StartTag(ATL_HTML_TAG_LI, szContent, szAttrs); - } - - HRESULT liEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_LI); - } - - HRESULT dl(LPCTSTR szContent=NULL, LPCTSTR szAttrs=NULL) - { - return GetOuter()->StartTag(ATL_HTML_TAG_DL, szContent, szAttrs); - } - - HRESULT dlEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_DL); - } - - HRESULT dt(LPCTSTR szContent=NULL, LPCTSTR szAttrs=NULL) - { - return GetOuter()->StartTag(ATL_HTML_TAG_DT, szContent, szAttrs); - } - - HRESULT dtEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_DT); - } - - HRESULT dd(LPCTSTR szContent=NULL, LPCTSTR szAttrs=NULL) - { - return GetOuter()->StartTag(ATL_HTML_TAG_DD, szContent, szAttrs); - } - - HRESULT ddEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_DD); - } - - void SetSizePercent(int nWidth, int nHeight) - { - m_nWidthPercent = nWidth; - m_nHeightPercent = nHeight; - } - - HRESULT table(int nBorderWidth=0, LPCTSTR szAttrs=NULL) - { - AtlHtmlAttrs Attrs; - Attrs.Set(szAttrs); - - m_RowStack.Push(&m_tableState); - m_tableState.Clear(); - - Attrs.AddFormat(_T("border=\"%d\""), nBorderWidth); - - if (m_nWidthPercent != -1) - Attrs.AddFormat(_T("width=\"%d%%\""), m_nWidthPercent); - if (m_nHeightPercent != -1) - Attrs.AddFormat(_T("height=\"%d%%\""), m_nHeightPercent); - - if (m_pScheme && m_pScheme->strTableBgColor.GetLength()) - Attrs.Add(_T("bgcolor"), m_pScheme->strTableBgColor); - - m_nWidthPercent = -1; - m_nHeightPercent = -1; - return GetOuter()->StartTag(ATL_HTML_TAG_TABLE, NULL, Attrs); - } - - HRESULT tableEnd() - { - if (m_tableState.m_bRowOpen) - GetOuter()->trEnd(); - m_RowStack.Pop(&m_tableState); - return GetOuter()->EndTag(ATL_HTML_TAG_TABLE); - } - - HRESULT tr(LPCTSTR szAttrs=NULL) - { - AtlHtmlAttrs Attrs; - Attrs.Set(szAttrs); - - if (m_RowStack.IsEmpty()) - GetOuter()->table(); - if (m_tableState.m_bRowOpen) - GetOuter()->trEnd(); - m_tableState.m_bRowOpen = true; - - if (m_pScheme && m_pScheme->strTrBgColor.GetLength()) - Attrs.Add(_T("bgcolor"), m_pScheme->strTrBgColor); - return GetOuter()->StartTag(ATL_HTML_TAG_TR, NULL, Attrs); - } - - HRESULT td(LPCTSTR szContent=NULL, LPCTSTR szAttrs=NULL) - { - AtlHtmlAttrs Attrs; - Attrs.Set(szAttrs); - - if (!m_tableState.m_bRowOpen) - GetOuter()->tr(); - m_tableState.m_bDataOpen = true; - if (m_pScheme && m_pScheme->strTdBgColor.GetLength()) - Attrs.Add(_T("bgColor"), m_pScheme->strTdBgColor); - - HRESULT hr = GetOuter()->StartTag(ATL_HTML_TAG_TD, szContent, Attrs); - if (FAILED(hr)) - return hr; - if (szContent) - m_tableState.m_bDataOpen = false; - return S_OK; - } - - HRESULT tdEnd() - { - if (!m_tableState.m_bDataOpen) - return S_OK; - m_tableState.m_bDataOpen = false; - return GetOuter()->EndTag(ATL_HTML_TAG_TD); - } - - HRESULT trEnd() - { - if (!m_tableState.m_bRowOpen) - return S_OK; - if (m_tableState.m_bDataOpen) - GetOuter()->tdEnd(); - m_tableState.m_bRowOpen = false; - return GetOuter()->EndTag(ATL_HTML_TAG_TR); - } - - HRESULT form(LPCTSTR szAction, ATL_HTML_FORM_METHOD nMethod=ATL_HTML_FORM_METHOD_GET, LPCTSTR szAttrs=NULL) - { - static const LPCTSTR s_szFormMethods[] = { NULL, _T("get"), _T("post"), _T("multipart-www-url-encoded") }; - return GetOuter()->form(szAction, s_szFormMethods[nMethod], szAttrs); - } - - HRESULT form(LPCTSTR szAction, LPCTSTR szMethod, LPCTSTR szAttrs=NULL) - { - AtlHtmlAttrs Attrs; - Attrs.Set(szAttrs); - - if (szAction && *szAction) - Attrs.Add(_T("action"), szAction); - if (szMethod && *szMethod) - Attrs.Add(_T("method"), szMethod); - - return GetOuter()->StartTag(ATL_HTML_TAG_FORM, NULL, Attrs); - } - - HRESULT input(LPCTSTR szType, LPCTSTR szName, LPCTSTR szValue, LPCTSTR szAttrs=NULL) - { - AtlHtmlAttrs Attrs; - Attrs.Set(szAttrs); - - if (szType && *szType) - Attrs.Add(_T("type"), szType); - if (szName && *szName) - Attrs.Add(_T("name"), szName); - if (szValue && *szValue) - Attrs.Add(_T("value"), szValue); - return GetOuter()->StartTag(ATL_HTML_TAG_INPUT, NULL, Attrs); - } - - HRESULT submit(LPCTSTR szValue=NULL, LPCTSTR szName=NULL, LPCTSTR szAttrs=NULL) - { - return input(_T("submit"), szName, szValue, szAttrs); - } - - HRESULT textarea(LPCTSTR szContent=NULL, LPCTSTR szAttrs=NULL) - { - return GetOuter()->StartTag(ATL_HTML_TAG_TEXTAREA, szContent, szAttrs); - } - - HRESULT textareaEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_TEXTAREA); - } - - HRESULT formEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_FORM); - } - - - HRESULT select(LPCTSTR szName, BOOL bMultiple=FALSE, LPCTSTR szAttrs=NULL) - { - ATLASSERT(szName && *szName); - - AtlHtmlAttrs Attrs; - Attrs.Set(szAttrs); - - Attrs.Add(_T("name"), szName); - if (bMultiple) - Attrs.Add(_T("multiple"), NULL); - return GetOuter()->StartTag(ATL_HTML_TAG_SELECT, NULL, Attrs); - } - - HRESULT option(LPCTSTR szContent=NULL, LPCTSTR szAttrs=NULL) - { - return GetOuter()->StartTag(ATL_HTML_TAG_OPTION, szContent, szAttrs); - } - - HRESULT optionEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_OPTION); - } - - HRESULT selectEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_SELECT); - } - - - HRESULT head(LPCTSTR szAttrs=NULL) - { - return GetOuter()->StartTag(ATL_HTML_TAG_HEAD, NULL, szAttrs); - } - - HRESULT headEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_HEAD); - } - - HRESULT html(LPCTSTR szAttrs=NULL) - { - return GetOuter()->StartTag(ATL_HTML_TAG_HTML, NULL, szAttrs); - } - - HRESULT htmlEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_HTML); - } - - HRESULT map(LPCTSTR szName, LPCTSTR szAttrs=NULL) - { - ATLASSERT(szName && *szName); - - AtlHtmlAttrs Attrs; - Attrs.Set(szAttrs); - - Attrs.Add(_T("name"), szName); - return GetOuter()->StartTag(ATL_HTML_TAG_MAP, NULL, Attrs); - } - - HRESULT mapEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_MAP); - } - - HRESULT area(LPCTSTR szAlt, LPCTSTR szHref=NULL, LPCTSTR szAttrs=NULL) - { - AtlHtmlAttrs Attrs; - Attrs.Set(szAttrs); - - if (szAlt && *szAlt) - Attrs.Add(_T("alt"), szAlt); - if (szHref && *szHref) - Attrs.Add(_T("href"), szHref); - return GetOuter()->StartTag(ATL_HTML_TAG_AREA, NULL, Attrs); - } - - HRESULT base(LPCTSTR szHref, LPCTSTR szAttrs=NULL) - { - ATLASSERT(szHref && *szHref); - - AtlHtmlAttrs Attrs; - Attrs.Set(szAttrs); - - Attrs.Add(_T("href"), szHref); - return GetOuter()->StartTag(ATL_HTML_TAG_BASE, NULL, Attrs); - } - - HRESULT bdo(LPCTSTR szDir, LPCTSTR szContent=NULL, LPCTSTR szAttrs=NULL) - { - ATLASSERT(szDir&& *szDir); - - AtlHtmlAttrs Attrs; - Attrs.Set(szAttrs); - - Attrs.Add(_T("dir"), szDir); - return GetOuter()->StartTag(ATL_HTML_TAG_BDO, szContent, Attrs); - } - - HRESULT bdoEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_BDO); - } - - HRESULT big(LPCTSTR szContent=NULL, LPCTSTR szAttrs=NULL) - { - return GetOuter()->StartTag(ATL_HTML_TAG_BIG, szContent, szAttrs); - } - - HRESULT bigEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_BIG); - } - - HRESULT button(LPCTSTR szName=NULL, LPCTSTR szValue=NULL, LPCTSTR szContent=NULL, LPCTSTR szAttrs=NULL) - { - AtlHtmlAttrs Attrs; - Attrs.Set(szAttrs); - - if (szName && *szName) - Attrs.Add(_T("name"), szName); - if (szValue && *szValue) - Attrs.Add(_T("value"), szValue); - return GetOuter()->StartTag(ATL_HTML_TAG_BUTTON, szContent, Attrs); - } - - HRESULT buttonEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_BUTTON); - } - - HRESULT iframe(LPCTSTR szSrc=NULL, LPCTSTR szWidth=NULL, LPCTSTR szHeight=NULL, LPCTSTR szAttrs=NULL) - { - AtlHtmlAttrs Attrs; - Attrs.Set(szAttrs); - - if (szSrc && *szSrc) - Attrs.Add(_T("src"), szSrc); - if (szWidth && *szWidth) - Attrs.Add(_T("width"), szWidth); - if (szHeight && *szHeight) - Attrs.Add(_T("height"), szHeight); - return GetOuter()->StartTag(ATL_HTML_TAG_IFRAME, NULL, Attrs); - } - - HRESULT iframeEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_IFRAME); - } - - HRESULT label(LPCTSTR szFor=NULL, LPCTSTR szAccessKey=NULL, LPCTSTR szContent=NULL, LPCTSTR szAttrs=NULL) - { - AtlHtmlAttrs Attrs; - Attrs.Set(szAttrs); - - if (szFor && *szFor) - Attrs.Add(_T("for"), szFor); - if (szAccessKey && *szAccessKey) - Attrs.Add(_T("accesskey"), szAccessKey); - return GetOuter()->StartTag(ATL_HTML_TAG_LABEL, szContent, Attrs); - } - - HRESULT labelEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_LABEL); - } - - HRESULT link(LPCTSTR szRel=NULL, LPCTSTR szHref=NULL, LPCTSTR szAttrs=NULL) - { - AtlHtmlAttrs Attrs; - Attrs.Set(szAttrs); - - if (szRel && *szRel) - Attrs.Add(_T("rel"), szRel); - if (szHref && *szHref) - Attrs.Add(_T("href"), szHref); - return GetOuter()->StartTag(ATL_HTML_TAG_LINK, NULL, Attrs); - } - - HRESULT meta(LPCTSTR szName=NULL, LPCTSTR szContent=NULL, LPCTSTR szHttpEquiv=NULL, LPCTSTR szAttrs=NULL) - { - AtlHtmlAttrs Attrs; - Attrs.Set(szAttrs); - - if (szName && *szName) - Attrs.Add(_T("name"), szName); - if (szContent && *szContent) - Attrs.Add(_T("content"), szContent); - if (szHttpEquiv && *szHttpEquiv) - Attrs.Add(_T("http-equiv"), szHttpEquiv); - return GetOuter()->StartTag(ATL_HTML_TAG_META, NULL, Attrs); - } - - HRESULT noframes(LPCTSTR szContent=NULL, LPCTSTR szAttrs=NULL) - { - return GetOuter()->StartTag(ATL_HTML_TAG_NOFRAMES, szContent, szAttrs); - } - - HRESULT noframesEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_NOFRAMES); - } - - HRESULT noscript(LPCTSTR szContent=NULL, LPCTSTR szAttrs=NULL) - { - return GetOuter()->StartTag(ATL_HTML_TAG_NOSCRIPT, szContent, szAttrs); - } - - HRESULT noscriptEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_NOSCRIPT); - } - - HRESULT col(int nSpan=1, LPCTSTR szWidth=NULL, LPCTSTR szHeight=NULL, LPCTSTR szVAlign=NULL, - LPCTSTR szHAlign=NULL, LPCTSTR szAttrs=NULL) - { - AtlHtmlAttrs Attrs; - Attrs.Set(szAttrs); - - - if (nSpan != 1) - Attrs.AddFormat(_T("span"), _T("\"%d\""), nSpan); - if (szWidth && *szWidth) - Attrs.Add(_T("width"), szWidth); - if (szHeight && *szHeight) - Attrs.Add(_T("height"), szHeight); - if (szVAlign && *szVAlign) - Attrs.Add(_T("valign"), szVAlign); - if (szHAlign && *szHAlign) - Attrs.Add(_T("align"), szHAlign); - return GetOuter()->StartTag(ATL_HTML_TAG_COL, NULL, Attrs); - } - - HRESULT colgroup(int nSpan=1, LPCTSTR szWidth=NULL, LPCTSTR szHeight=NULL, LPCTSTR szVAlign=NULL, - LPCTSTR szHAlign=NULL, LPCTSTR szAttrs=NULL) - { - AtlHtmlAttrs Attrs; - Attrs.Set(szAttrs); - - if (nSpan != 1) - Attrs.AddFormat(_T("span"), _T("\"%d\""), nSpan); - if (szWidth && *szWidth) - Attrs.Add(_T("width"), szWidth); - if (szHeight && *szHeight) - Attrs.Add(_T("height"), szHeight); - if (szVAlign && *szVAlign) - Attrs.Add(_T("valign"), szVAlign); - if (szHAlign && *szHAlign) - Attrs.Add(_T("align"), szHAlign); - return GetOuter()->StartTag(ATL_HTML_TAG_COL, NULL, Attrs); - } - - HRESULT colgroupEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_COLGROUP); - } - - HRESULT fieldset(LPCTSTR szAttrs=NULL) - { - return GetOuter()->StartTag(ATL_HTML_TAG_FIELDSET, NULL, szAttrs); - } - - HRESULT fieldsetEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_FIELDSET); - } - - HRESULT legend(LPCTSTR szContent=NULL, LPCTSTR szAttrs=NULL) - { - return GetOuter()->StartTag(ATL_HTML_TAG_LEGEND, szContent, szAttrs); - } - - HRESULT legendEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_LEGEND); - } - - HRESULT tbody(LPCTSTR szAttrs=NULL) - { - return GetOuter()->StartTag(ATL_HTML_TAG_TBODY, NULL, szAttrs); - } - - HRESULT tbodyEnd() - { - return GetOuter()->StartTag(ATL_HTML_TAG_TBODY); - } - - HRESULT tfoot(LPCTSTR szAttrs=NULL) - { - return GetOuter()->StartTag(ATL_HTML_TAG_TFOOT, NULL, szAttrs); - } - - HRESULT tfootEnd() - { - return GetOuter()->StartTag(ATL_HTML_TAG_TFOOT); - } - - HRESULT th(LPCTSTR szContent=NULL, LPCTSTR szAttrs=NULL) - { - if (!m_tableState.m_bRowOpen) - GetOuter()->tr(); - m_tableState.m_bDataOpen = true; - return GetOuter()->StartTag(ATL_HTML_TAG_TH, szContent, szAttrs); - } - - HRESULT thEnd() - { - ATLASSUME(m_tableState.m_bDataOpen); - m_tableState.m_bDataOpen = false; - return GetOuter()->EndTag(ATL_HTML_TAG_TH); - } - - HRESULT title(LPCTSTR szContent=NULL, LPCTSTR szAttrs=NULL) - { - return GetOuter()->StartTag(ATL_HTML_TAG_TITLE, szContent, szAttrs); - } - - HRESULT titleEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_TITLE); - } - - HRESULT tt(LPCTSTR szContent=NULL, LPCTSTR szAttrs=NULL) - { - return GetOuter()->StartTag(ATL_HTML_TAG_TT, szContent, szAttrs); - } - - HRESULT ttEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_TT); - } - - // unfortunately, we can't use small since it is defined as char - // in rpcndr.h! - HRESULT _small(LPCTSTR szContent=NULL, LPCTSTR szAttrs=NULL) - { - return GetOuter()->StartTag(ATL_HTML_TAG_SMALL, szContent, szAttrs); - } - - HRESULT _smallEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_SMALL); - } - - HRESULT span(LPCTSTR szContent=NULL, LPCTSTR szAttrs=NULL) - { - return GetOuter()->StartTag(ATL_HTML_TAG_SPAN, szContent, szAttrs); - } - - HRESULT spanEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_SPAN); - } - - HRESULT object(LPCTSTR szClassId, LPCTSTR szContent=NULL, LPCTSTR szAttrs=NULL) - { - AtlHtmlAttrs Attrs; - Attrs.Set(szAttrs); - if (szClassId && *szClassId) - Attrs.Add(_T("classid"), szClassId); - return GetOuter()->StartTag(ATL_HTML_TAG_OBJECT, szContent, Attrs); - } - - HRESULT object(REFCLSID rclsid, LPCTSTR szContent=NULL, LPCTSTR szAttrs=NULL) - { - USES_CONVERSION_EX; - OLECHAR szClsid[64]; - CString strClassId; - int i = StringFromGUID2(rclsid, szClsid, 64); - if (!i) - return E_FAIL; - szClsid[i-2] = 0; // don't want curly braces - strClassId.Format(_T("clsid:%s"), OLE2T_EX_DEF(szClsid+1)); - return object(strClassId, szContent, szAttrs); - } - - HRESULT objectEnd() - { - return GetOuter()->EndTag(ATL_HTML_TAG_OBJECT); - } - - HRESULT param(LPCTSTR szName, LPCTSTR szValue, LPCTSTR szAttrs=NULL) - { - ATLASSERT(szName && *szName); - - AtlHtmlAttrs Attrs; - Attrs.Set(szAttrs); - - Attrs.Add(_T("name"), szName); - if (szValue && *szValue) - Attrs.Add(_T("value"), szValue); - return GetOuter()->StartTag(ATL_HTML_TAG_PARAM, NULL, Attrs); - } - -private: - CString m_strState; - HTML_SCHEME *m_pScheme; - - struct TableState - { - TableState() : m_bRowOpen(false), m_bDataOpen(false) - { - - } - - void Clear() - { - m_bRowOpen = false; - m_bDataOpen = false; - } - - bool m_bRowOpen; - bool m_bDataOpen; - }; - - ATL_HTML_FORM_METHOD m_nFormMethod; - - TableState m_tableState; - CSimpleStack m_RowStack; - - int m_nWidthPercent; - int m_nHeightPercent; -}; - -class CHtmlGen : public CHtmlGenBase -{ -public: -}; - -} // namespace ATL -#pragma pack(pop) - -#endif // __ATLHTML_H__ diff --git a/include/atl/atlhttp.h b/include/atl/atlhttp.h deleted file mode 100644 index e8a4321e6..000000000 --- a/include/atl/atlhttp.h +++ /dev/null @@ -1,725 +0,0 @@ -// This is a part of the Active Template Library. -// Copyright (C) Microsoft Corporation -// All rights reserved. -// -// This source code is only intended as a supplement to the -// Active Template Library Reference and related -// electronic documentation provided with the library. -// See these sources for detailed information regarding the -// Active Template Library product. - -#ifndef __ATLHTTP_H__ -#define __ATLHTTP_H__ - -#pragma once -#ifndef __CPPUNWIND -#pragma warning(push) -#pragma warning(disable: 4702) -#endif -#ifndef _WINSOCKAPI_ - #include -#endif -#include -#include -#include -#include -#define SECURITY_WIN32 -#include -#include -#ifndef _ATL_NO_DEFAULT_LIBS -#pragma comment(lib, "ws2_32.lib") -#pragma comment(lib, "SECUR32.LIB") -#endif // !_ATL_NO_DEFAULT_LIBS - -#include - -#pragma warning(push) -#pragma warning(disable: 4625) // copy constructor could not be generated because a base class copy constructor is inaccessible -#pragma warning(disable: 4626) // assignment operator could not be generated because a base class assignment operator is inaccessible - -#pragma pack(push,_ATL_PACKING) -namespace ATL { - -template -class CAtlHttpClientT; -class CAtlBaseAuthObject; - -enum status_headerparse{ - ATL_HEADER_PARSE_COMPLETE=0, - ATL_HEADER_PARSE_HEADERNOTCOMPLETE, - ATL_HEADER_PARSE_HEADERERROR -}; - -enum readstate{rs_init=0, rs_readheader, rs_scanheader, rs_readbody, rs_complete}; - -#define ATL_HEADER_END "\r\n\r\n" -#define ATL_HEADER_END_LEN 4 -#define ATL_DW_HEADER_END 0x0a0d0a0d -#define ATL_FIELDNAME_DELIMITER _T(':') -#define ATL_MAX_FIELDNAME_LEN 1024 -#define ATL_MAX_VALUE_LEN 1024 -#define ATL_AUTH_HDR_SIZE 1024 -#define ATL_READ_BUFF_SIZE 2048 -#define ATL_INVALID_STATUS -1 -#define ATL_HTTP_HEADER _T(" HTTP/1.1\r\n") -#define ATL_HTTP_HEADER_PROXY _T(" HTTP/1.1\r\n") -#ifndef ATL_HTTP_USERAGENT - #define ATL_HTTP_USERAGENT _T("User-Agent: Microsoft-ATL-Native/") _T(_ATL_VER_RBLD) _T("\r\n") -#endif - -#define ATL_IS_INVALIDCREDHANDLE(x) ((x.dwLower==0xFFFFFFFF) && (x.dwUpper==0xFFFFFFFF)) -#define ATL_HTTP_AUTHTYPE_NTLM _T("NTLM") -#define ATL_HTTP_AUTHTYPE_BASIC _T("BASIC") -#define ATL_HTTP_METHOD_GET _T("GET") -#define ATL_HTTP_METHOD_POST _T("POST") - -#ifndef MAX_REALM_LEN - #define MAX_REALM_LEN 1024 -#endif - -#ifndef _ATL_MAX_AUTH_BUFF - #define _ATL_MAX_AUTH_BUFF 512 -#endif - -__interface IAuthInfo; -typedef bool (WINAPI *PFNATLCHUNKEDCB)(BYTE** ppData, DWORD *pdwSize, DWORD_PTR dwParam); -typedef bool (WINAPI *PFNATLSTATUSCALLBACK)(DWORD dwBytesSent, DWORD_PTR dwParam); - -#define ATL_HTTP_FLAG_AUTO_REDIRECT 0x1 -#define ATL_HTTP_FLAG_PROCESS_RESULT 0x2 -#define ATL_HTTP_FLAG_SEND_CALLBACK 0x4 -#define ATL_HTTP_FLAG_SEND_BLOCKS 0x8 -#define ATL_HTTP_FLAG_INVALID_FLAGS 0xFFFFFFFF - -#ifndef ATL_HTTP_DEFAULT_BLOCK_SIZE - #define ATL_HTTP_DEFAULT_BLOCK_SIZE 4096 -#endif - -#define ATL_HTTP_CLIENT_EMPTY_READ_RETRIES 5 - -struct ATL_NAVIGATE_DATA -{ - LPCTSTR szExtraHeaders; - LPCTSTR szMethod; - LPCTSTR szDataType; - DWORD dwDataLen; - DWORD dwFlags; - DWORD dwTimeout; - DWORD dwSendBlockSize; - DWORD dwReadBlockSize; - DWORD_PTR m_lParamSend; - DWORD_PTR m_lParamRead; - DWORD_PTR m_lParamChunkCB; - short nPort; - BYTE *pData; - PFNATLCHUNKEDCB pfnChunkCallback; - PFNATLSTATUSCALLBACK pfnSendStatusCallback; - PFNATLSTATUSCALLBACK pfnReadStatusCallback; -}; - -class CAtlNavigateData : public ATL_NAVIGATE_DATA -{ -public: - CAtlNavigateData() throw(); // public construction - CAtlNavigateData(const CAtlNavigateData &rhs); - CAtlNavigateData(const ATL_NAVIGATE_DATA &rhs); - CAtlNavigateData& operator=(const CAtlNavigateData &rhs); - CAtlNavigateData& operator=(const ATL_NAVIGATE_DATA &rhs); - DWORD SetFlags(DWORD dwNewFlags) throw(); // set all flags - DWORD GetFlags() throw(); // get value of flags - DWORD AddFlags(DWORD dwFlagsToAdd) throw(); // add one or more flags to existing flags - DWORD RemoveFlags(DWORD dwFlagsToRemove) throw(); // remove one or more flags from existing flags - LPCTSTR SetExtraHeaders(LPCTSTR szNewHeaders) throw(); // set the extra request headers - LPCTSTR GetExtraHeaders() throw(); // get the extra request headers - LPCTSTR SetMethod(LPCTSTR szNewMethod) throw(); // set the HTTP request method - LPCTSTR GetMethod() throw(); // get the HTTP request method - short SetPort(short newPort) throw(); // set the TCP port for this request - short GetPort() throw(); // get the TCP port for this request - void SetPostData(BYTE *pData, DWORD dwDataLen, LPCTSTR szDataType) throw(); // Set data to be sent as the reqeust entity body - DWORD SetSocketTimeout(DWORD dwNewTimeout) throw(); // Set the timeout for this socket - DWORD GetSocketTimeout() throw(); // Get the timeout for this socket - DWORD SetSendBlockSize(DWORD dwBlockSize) throw(); // Set the size of the blocks used to send data - DWORD GetSendBlockSize() throw(); // get the size of the blocks used to send data - DWORD SetReadBlockSize(DWORD dwBlockSize) throw(); // Set the size of the blocks used to send data - DWORD GetReadBlockSize() throw(); // get the size of the blocks used to send data - PFNATLCHUNKEDCB SetChunkCallback(PFNATLCHUNKEDCB pfn, DWORD_PTR dwParam) throw(); // set the callback function used for sending chunked data - PFNATLCHUNKEDCB GetChunkCallback() throw(); // get the chunked callback function - PFNATLSTATUSCALLBACK SetSendStatusCallback(PFNATLSTATUSCALLBACK pfn, DWORD_PTR dwData) throw(); // sets a function pointer to be called after bytes are sent over the socket - PFNATLSTATUSCALLBACK GetSendStatusCallback() throw(); // returns current status callback function - PFNATLSTATUSCALLBACK SetReadStatusCallback(PFNATLSTATUSCALLBACK pfn, DWORD_PTR dwData) throw(); - PFNATLSTATUSCALLBACK GetReadStatusCallback() throw(); -}; - -template -class CAtlHttpClientT : - private TSocketClass -{ -public: - CAtlHttpClientT() throw(); - virtual ~CAtlHttpClientT() - { - } - - // Use these functions to send an HTTP request and retrieve - // the response. - bool Navigate( - const CUrl* pUrl, - ATL_NAVIGATE_DATA *pNavData = NULL - ) throw(...); - - bool Navigate( - LPCTSTR szServer, - LPCTSTR szPath, - ATL_NAVIGATE_DATA *pNavData = NULL - ) throw(...); - - bool Navigate( - LPCTSTR szURL, - ATL_NAVIGATE_DATA *pNavData = NULL - ) throw(...); - - - // Performs navigation, sending data with Transfer-Coding: chunked - bool NavigateChunked( - const CUrl *pUrl, - ATL_NAVIGATE_DATA *pData - ) throw(); - - bool NavigateChunked( - LPCTSTR szServer, - LPCTSTR szPath, - ATL_NAVIGATE_DATA *pNavData - ) throw(); - - bool NavigateChunked( - LPCTSTR szURL, - ATL_NAVIGATE_DATA *pNavData - ) throw(); - - // Use to set/retrieve information about the proxy server used - // when making this request via a proxy server. - bool SetProxy(LPCTSTR szProxy = NULL, short nProxyPort = 0) throw(); - void RemoveProxy() throw(); - LPCTSTR GetProxy() const throw(); - short GetProxyPort() const throw(); - - // Use these functions to add/remove/find objects that will - // be used to authorize request when a 401 Not Authorized response - // is received. This class maps these objects by scheme name in map. - // Override NegotiateAuth to change the way authorization negotiation occurs. - bool AddAuthObj(LPCTSTR szScheme, CAtlBaseAuthObject *pObject, IAuthInfo *pInfo=NULL) throw(); - const CAtlBaseAuthObject* FindAuthObject(LPCTSTR szScheme) throw(); - bool RemoveAuthObject(LPCTSTR szScheme) throw(); - virtual bool NegotiateAuth(bool bProxy) throw(); - - - // Retrieve the value of a response header - bool GetHeaderValue(LPCTSTR szName, CString& strValue) const throw(); - bool GetHeaderValue(__in_z LPCTSTR szName, __out_ecount_part_z_opt(*pdwLen, *pdwLen) LPTSTR szBuffer, __inout DWORD *pdwLen) const throw(); - - DWORD GetResponseLength() throw(); // Get the number of bytes in the response - const BYTE* GetResponse() throw(); // Get the entire response - DWORD GetBodyLength() const throw(); // Get the length of the body of the response (everything after the \r\n\r\n) - const BYTE* GetBody() throw(); // Get the body of the response (length is determined by GetBodyLength()) - DWORD GetRawResponseHeaderLength() throw(); // Get the length of the raw request headers - bool GetRawResponseHeader(LPBYTE szBuffer, DWORD *pdwLen) throw(); // Get the raw request headers - LPCURL GetCurrentUrl() const throw(); // Get a pointer to the current URL for this request - DWORD GetFlags() const throw(); // Retrieve flags used for processing this request - int GetStatus() throw(); // Get the HTTP status code that resulted from making this request - LPCTSTR GetMethod() throw(); // Get the HTTP method used for making this request - BYTE* GetPostData() throw(); // Get a pointer to raw data being sent with this request - DWORD GetPostDataLen() throw(); // Get the length of the raw data sent with this request - LPCTSTR GetPostDataType() throw(); // Get the data type (sent as Content-Type header) for this request - DWORD GetLastError() throw(); // Retrieves errors from the underlying socket - const SOCKET& GetSocket() throw(); // Retrieves the underlying socket. Be careful! - void Close() throw(); // Close the connection - DWORD SetSocketTimeout(DWORD dwNewTimeout) throw(); // Sets a new socket timeout, returns the old timeout. - DWORD GetSocketTimeout() throw(); // retrieves the current socket timeout - void AuthProtocolFailed(LPCTSTR szProto) throw(); // notifies us of failure to connect with the named protocol - const ATL_NAVIGATE_DATA* GetCurrentNavdata(); - enum HTTP_RESPONSE_READ_STATUS - { - RR_OK = 0, // response was successfully processed - RR_FAIL, // an unknown error occurred reading the HTTP response - RR_STATUS_INVALID, // could not parse the status line - RR_PARSEHEADERS_FAILED, // failed to parse HTTP response headers - RR_READSOCKET_FAILED, // failed to read response data from socket - RR_READBODY_FAILED, // failed to successfully read the entity body of the HTTP response - RR_READCHUNKEDBODY_FAILED, // failed to read a 'Transfer-Encoding: chunked' response body - RR_NOT_READ // we haven't started reading the response. - }; - HTTP_RESPONSE_READ_STATUS GetResponseStatus(); - - -// Implementation - HTTP_RESPONSE_READ_STATUS ReadHttpResponse() throw(); - void ResetConnection() throw(); - bool ProcessStatus(DWORD dwFlags) throw(); - bool BuildRequest(/*out*/CString *pstrRequest, - LPCTSTR szDataType=NULL, - LPCTSTR szExtraHeaders=NULL) throw(); - - void SetSilentLogonOk(bool bSet) - { - m_bSilentLogonOk = bSet; - } -protected: - DWORD WriteWithNoData(LPCSTR pRequest, DWORD dwRequestLen); - DWORD WriteWithCallback(LPCSTR pRequest, DWORD dwRequestLen); - DWORD WriteWithChunks(LPCSTR pRequest, DWORD dwRequestLen); - DWORD WriteWithData(LPCSTR pRequest, DWORD dwRequestLen); - bool SetDefaultUrl(LPCTSTR szUrl, short nPortNumber=ATL_URL_DEFAULT_HTTP_PORT) throw(); - bool SetDefaultUrl(LPCURL pUrl, short nPortNumber=ATL_URL_DEFAULT_HTTP_PORT) throw(); - bool SetDefaultMethod(LPCTSTR szMethod) throw(); - void InitializeObject() throw(); - void ResetRequest() throw(); - bool ReadSocket() throw(); - unsigned char* FindHeaderEnd(unsigned char** ppBegin) throw(); - bool LookupRegProxy() throw(); - bool DisconnectIfRequired() throw(); - bool ConnectSocket() throw(); - - long GetContentLength() throw(); - LPCSTR NextLine(BYTE* pCurr) throw(); - bool IsMsgBodyChunked() throw(); - LPCSTR FindEndOfHeader(LPCSTR pszStart) throw(); - bool DecodeHeader(LPCSTR pHeaderStart, LPCSTR pHeaderEnd) throw(); - virtual void OnSetCookie(LPCTSTR /*szCookie*/) throw(); - LPCSTR ParseStatusLine(BYTE* pBuffer) throw(); - int CrackResponseHeader(LPCSTR pBuffer, /*out*/ LPCSTR *pEnd) throw(); - bool ReadBody(int nContentLen, int nCurrentBodyLen) throw(); - bool ReadChunkedBody() throw(); - bool ReconnectIfRequired() throw(); - bool CompleteURL(CString& strURL) throw(); - bool ProcessObjectMoved() throw(); - bool _SetDefaultUrl(LPCTSTR szURL, short nPort) throw(); - - enum CHUNK_STATE{ - READ_CHUNK_SIZE, // need to read the size of a chunk. - READ_CHUNK_SIZE_FOOTER, - READ_CHUNK_DATA, // need to read the actual data - READ_CHUNK_DATA_FOOTER, // need to read the chunk footer. - READ_CHUNK_TRAILER, // Read the trailer headers at the end of the chunk data - READ_CHUNK_TRAILER_FOOTER, // read the final crlf - CHUNK_READ_DATA_COMPLETE, // done reading chunk data. - }; - - enum CHUNK_LEX_RESULT{ - LEX_OK, - LEX_OUTOFDATA, - LEX_ERROR, - LEX_TRAILER_COMPLETE - }; - - CHUNK_LEX_RESULT get_chunked_size(__deref_inout char *&pBuffStart, __deref_inout char *&pBuffEnd, __inout long* pnChunkSize) throw(); - bool move_leftover_bytes(__in_ecount(nLen) char *pBufferStart, __in int nLen, __deref_inout char *&pBuffStart, __deref_inout char *&pBuffEnd) throw(); - CHUNK_LEX_RESULT get_chunked_data(__deref_inout char *&pBufferStart, __deref_inout char *&pBufferEnd, long nChunkSize, - __deref_out_ecount_part(*pnDataLen, *pnDataLen) char **ppDataStart, __inout long *pnDataLen) throw(); - CHUNK_LEX_RESULT consume_chunk_trailer(__deref_inout char *&pBufferStart, __deref_inout char *pBufferEnd) throw(); - CHUNK_LEX_RESULT consume_chunk_footer(__deref_inout char *&pBufferStart, __deref_inout char *&pBufferEnd) throw(); - - typedef CAtlMap< - CString, - CString, - CStringElementTraitsI, - CStringElementTraitsI - > HeaderMapType; - - typedef CAtlMap < - CString, - CAtlBaseAuthObject*, - CStringElementTraitsI - > AuthMapType; - - typedef CAtlArray< - CString, - CStringElementTraitsI - > AuthListType; - - HeaderMapType m_HeaderMap; // Map of response headers - AuthMapType m_AuthMap; // Map of pointers to authorization objects. - AuthListType m_AuthTypes; // list of authorization types the server is willing to use. - BOOL m_bSilentLogonOk; - CAtlIsapiBuffer<> m_current; // The entire response - CUrl m_urlCurrent; // URL of current request - - CString m_strMethod; // Current request method. - CString m_strProxy; // Path to current proxy server. - - long m_nStatus; // Current response status (from status line) - short m_nProxyPort; // Port used on current proxy server - DWORD m_dwBodyLen; // Length of body - DWORD m_dwHeaderLen; // Length of current raw headers - DWORD m_dwHeaderStart; - BYTE *m_pCurrent; - BYTE *m_pEnd; // the end of the data we've read fromt he socket; - ATL_NAVIGATE_DATA *m_pNavData; - HTTP_RESPONSE_READ_STATUS m_LastResponseParseError; -}; //CAtlHttpClientT -typedef CAtlHttpClientT CAtlHttpClient; - - -// Interface used to acquire authentication information from clients -__interface IAuthInfo -{ - HRESULT GetPassword(__out_ecount_part_z_opt(*pdwBuffSize, *pdwBuffSize) LPTSTR szPwd, __inout DWORD *pdwBuffSize); - HRESULT GetUsername(__out_ecount_part_z_opt(*pdwBuffSize, *pdwBuffSize) LPTSTR szUid, __inout DWORD *pdwBuffSize); - HRESULT GetDomain(__out_ecount_part_z_opt(*pdwBuffSize, *pdwBuffSize) LPTSTR szDomain, __inout DWORD *pdwBuffSize); -}; -typedef HRESULT (IAuthInfo::*PFNAUTHFUNC)(LPTSTR szPwd, DWORD *pdwSize); - -// pure virtual class that describes required functions for authoriztion -// objects -class CAtlBaseAuthObject -{ -public: - CAtlBaseAuthObject(); - virtual bool Authenticate(LPCTSTR szAuthTypes, bool bProxy) = 0; - virtual void Init(CAtlHttpClient *pSocket, IAuthInfo *pAuthInfo) = 0; - bool m_bFailed; -}; - -// strings used for authentication. -extern __declspec(selectany)const TCHAR * const g_pszWWWAuthenticate = _T("www-authenticate"); -extern __declspec(selectany)const TCHAR * const g_pszProxyAuthenticate = _T("proxy-authenticate"); - -// Performs NTLM authentication -class CNTLMAuthObject : - public CAtlBaseAuthObject -{ -public: - virtual ~CNTLMAuthObject() throw(); - CNTLMAuthObject() throw(); - CNTLMAuthObject(IAuthInfo *pAuthInfo) throw(); - void SetAuthInfo(IAuthInfo *pAuthInfo) throw(); - bool GetCredentialNames(CString& theName); - -// Implementation - // Called by the CAtlHttpClient class to authenticate a user. - virtual void Init(CAtlHttpClient *pSocket, IAuthInfo *pAuthInfo=NULL) throw(); - - // Called by the CAtlHttpClient class to initialize this authentication object. - virtual bool Authenticate(LPCTSTR szAuthTypes, bool bProxy) throw(); -protected: - bool AcquireCredHandle() throw(); - // This function creates an NTML Authorization header - // and sends it to the HTTP server. - bool SendSecurityInfo(SecBuffer *pSecBuffer, LPSTR *pszBuffer) throw(); - bool DoNTLMAuthenticate() throw(); - - IAuthInfo *m_pAuthInfo; - CAtlHttpClient *m_pSocket; - CredHandle m_hCredentials; - int m_nMaxTokenSize; - TimeStamp m_ts; - bool m_bProxy; - static const char * const m_pszFmtWWW; - static const char * const m_pszFmtProxy; - CAtlNavigateData m_CurrentRequestData; - -}; // CNTLMAuthObject - -// Performs BASIC authentication for an CAtlHttpClient -// object. Caller must implement an IAuthInfo interface -// and pass it to this object before this object attempts -// to authenticate or authentication will fail. -class CBasicAuthObject : - public CAtlBaseAuthObject -{ -public: - CBasicAuthObject() throw(); - CBasicAuthObject(IAuthInfo *pAuthInfo) throw(); - void SetAuthInfo(IAuthInfo *pAuthInfo) throw(); - LPCTSTR GetRealm() throw(); // Retrieve's the realm being used. - -// Implementation - // Called by the CAtlHttpClient class to authenticate a user. - virtual bool Authenticate(LPCTSTR szAuthTypes, bool bProxy) throw(); - - // Called by the CAtlHttpClient class to initialize this authentication object. - virtual void Init(CAtlHttpClient *pSocket, IAuthInfo *pAuthInfo=NULL) throw(); -protected: - bool DoBasicAuthenticate() throw(); - bool CrackRealm(LPCTSTR szHeader) throw(); - - IAuthInfo *m_pAuthInfo; - CAtlHttpClient *m_pClient; - TCHAR m_szRealm[MAX_REALM_LEN]; - bool m_bProxy; - static const char * const m_pszFmtWWW; - static const char * const m_pszFmtProxy; -}; // CBasicAuthObject - -__declspec(selectany)const char * const CBasicAuthObject::m_pszFmtWWW = "Authorization: Basic "; -__declspec(selectany)const char * const CBasicAuthObject::m_pszFmtProxy = "Proxy-Authorization: Basic "; -__declspec(selectany)const char * const CNTLMAuthObject::m_pszFmtWWW = "Authorization: NTLM %s\r\n"; -__declspec(selectany)const char * const CNTLMAuthObject::m_pszFmtProxy = "Proxy-Authorization: NTLM %s\r\n"; - -typedef CTempBuffer CAuthInfoBuffType; -inline bool _AtlGetAuthInfoHelper(IAuthInfo *pObj, PFNAUTHFUNC pFunc, CAuthInfoBuffType& buff, DWORD *dwLen) throw() -{ - ATLENSURE_RETURN_VAL(pObj, false); - ATLENSURE_RETURN_VAL(pFunc, false); - DWORD dwSize = _ATL_MAX_AUTH_BUFF; - bool bRet = true; - TCHAR *szValue = NULL; - _ATLTRY - { - szValue = buff.Allocate(_ATL_MAX_AUTH_BUFF); - HRESULT hr = E_FAIL; - if (szValue) - { - hr = (pObj->*pFunc)(szValue, &dwSize); - if (hr != S_OK) - { - if (hr == E_OUTOFMEMORY) - { - // buffer not big enough, try to allocate - szValue = buff.Reallocate(dwSize); - if (szValue) - { - // retry the call - if (S_OK != (pObj->*pFunc)(szValue, &dwSize)) - bRet = false; - } - else - bRet = false; - } - else - bRet = false; - } - } - else - bRet = false; - - } - _ATLCATCHALL() - { - bRet = false; - } - if (bRet) - *dwLen = (DWORD)_tcslen(szValue); - else - *dwLen = 0; - return bRet; -} - -// -// Security Service Provider Interface (sspi) Helper classes -// These classes are used as helpers for structures used in -// SSPI functions. -// -class CSecAuthIdentity : public SEC_WINNT_AUTH_IDENTITY_EX -{ -public: - CSecAuthIdentity() throw() - { - Version = SEC_WINNT_AUTH_IDENTITY_VERSION; - Length = sizeof(SEC_WINNT_AUTH_IDENTITY_EX); -#ifdef _UNICODE - Flags = SEC_WINNT_AUTH_IDENTITY_UNICODE; -#else - Flags = SEC_WINNT_AUTH_IDENTITY_ANSI; -#endif - } - - - bool Init(IAuthInfo *pAuthInfo) throw() - { - if (!pAuthInfo) - return false; - - if (!_AtlGetAuthInfoHelper(pAuthInfo, &IAuthInfo::GetUsername, buffUserName, &UserLength)) - return false; - - if (!_AtlGetAuthInfoHelper(pAuthInfo, &IAuthInfo::GetPassword, buffPassword, &PasswordLength)) - return false; - - if (!_AtlGetAuthInfoHelper(pAuthInfo, &IAuthInfo::GetDomain, buffDomain, &DomainLength)) - return false; - -#ifndef _UNICODE - User = (unsigned char*)(char*)buffUserName; - Domain = DomainLength > 0 ? (unsigned char*)(char*)buffDomain : 0; - Password = PasswordLength > 0 ? (unsigned char*)(char*)buffPassword : 0; -#else - // have to cast to unsigned short *, because SEC_WINNT_AUTH_IDENTITY_EXW - // uses unsigned short instead of wchar_t - User = (unsigned short *)(wchar_t*)buffUserName; - Domain = DomainLength > 0 ? (unsigned short *)(wchar_t*)buffDomain : 0; - Password = PasswordLength > 0 ? (unsigned short *)(wchar_t*)buffPassword : 0; -#endif - return true; - } - -protected: - CAuthInfoBuffType buffUserName; - CAuthInfoBuffType buffPassword; - CAuthInfoBuffType buffDomain; -}; // CSecAuthIdentity - -class CSecBuffer : public SecBuffer -{ -public: - CSecBuffer() throw() - { - cbBuffer = 0; - BufferType = 0; - pvBuffer = NULL; - m_cbAlloc = 0; - } - - ~CSecBuffer() throw() - { - delete [] static_cast(pvBuffer); - } - - bool SetSize(unsigned long nSize) throw() - { - if (!nSize) - return false; - - if (pvBuffer) - { - delete [] static_cast(pvBuffer); - pvBuffer = NULL; - cbBuffer = 0; - m_cbAlloc = 0; - } - - ATLTRY(pvBuffer = static_cast(new unsigned char[nSize])); - if (pvBuffer) - { - cbBuffer = nSize; - BufferType = SECBUFFER_TOKEN; - m_cbAlloc = cbBuffer; - return true; - } - return false; - } - - bool ClearBuffer(unsigned long nSize) throw() - { - if(nSize > m_cbAlloc) - return false; - - ZeroMemory(pvBuffer, nSize); - cbBuffer = nSize; - return true; - } - - unsigned long Size() - { - return cbBuffer; - } - - unsigned char *Buffer() throw() - { - return static_cast(pvBuffer); - } - - operator SecBuffer*() throw() - { - return (SecBuffer*)this; - } - -protected: - unsigned long m_cbAlloc; - -}; // CSecBuffer - -class CSecBufferDesc : public SecBufferDesc -{ -public: - CSecBufferDesc() throw() - { - ulVersion = SECBUFFER_VERSION; - cBuffers = 0; - pBuffers = NULL; - } - - ~CSecBufferDesc() throw() - { - cBuffers = 0; - - if (pBuffers) - { - CSecBuffer *psb = (CSecBuffer*)pBuffers; - delete [] psb; - } - } - - // index is 0 based - CSecBuffer* Buffers(unsigned int i) throw() - { - if (i < cBuffers) - { - return (CSecBuffer*)(&pBuffers[i]); - } - - return NULL; - } - - bool AddBuffers(unsigned int nCount, unsigned int nBufferSize) throw() - { - if (!nCount) - return true; - - if (cBuffers == 0) - { - CSecBuffer *pSecBuffer = NULL; - ATLTRY(pSecBuffer = new CSecBuffer[nCount]); - if (!pSecBuffer) - return false; - CAutoVectorPtr spSecBuffer(pSecBuffer); - - for (unsigned int i=0; i spSecBuffer(pSecBuffer); - Checked::memcpy_s(pSecBuffer, (nCount + cBuffers)*sizeof(CSecBuffer), pBuffers, cBuffers*sizeof(CSecBuffer)); - delete [] pBuffers; - pBuffers=NULL; - - // initialize new buffers - for (unsigned int i=0; i(this); - } -}; // CSecBufferDesc - -} // namespace ATL - - -#include - -#pragma pack(pop) -#pragma warning(pop) - -#ifndef __CPPUNWIND -#pragma warning(pop) -#endif - -#endif // __ATLHTTP_H__ diff --git a/include/atl/atlhttp.inl b/include/atl/atlhttp.inl deleted file mode 100644 index 71294b49b..000000000 --- a/include/atl/atlhttp.inl +++ /dev/null @@ -1,3144 +0,0 @@ -// This is a part of the Active Template Library. -// Copyright (C) Microsoft Corporation -// All rights reserved. -// -// This source code is only intended as a supplement to the -// Active Template Library Reference and related -// electronic documentation provided with the library. -// See these sources for detailed information regarding the -// Active Template Library product. - -#ifndef __ATLHTTP_INL__ -#define __ATLHTTP_INL__ - -#include - -#pragma warning(push) -#pragma warning(disable: 4061) // enumerate 'enum value' in switch of enum 'enum type' is not explicitly handled by a case label -#pragma warning(disable: 4062) // enumerate 'enum value' in switch of enum 'enum type' is not handled - -namespace ATL -{ - -///////////////////////////////////////////////////////////////////////////////// -// -// CAtlHttpClient -// Implementation of CAtlHttpClient member functions -// -///////////////////////////////////////////////////////////////////////////////// -template -inline CAtlHttpClientT::CAtlHttpClientT() throw() -{ - InitializeObject(); -} - -// Sets this object to a known state. -template -inline void CAtlHttpClientT::InitializeObject() throw() -{ - Close(); // will close the socket if it's already open - ResetRequest(); - SetSilentLogonOk(FALSE); -} - -template -inline void CAtlHttpClientT::ResetRequest() throw() -{ - // reset all data that has to do with the current request - m_HeaderMap.RemoveAll(); - m_current.Empty(); - m_urlCurrent.Clear(); - m_strMethod.Empty(); - m_nStatus = ATL_INVALID_STATUS; - m_dwBodyLen = 0; - m_dwHeaderLen = 0; - m_dwHeaderStart = 0; - m_pCurrent = NULL; - m_pNavData = NULL; - m_LastResponseParseError = RR_NOT_READ; - m_pEnd = NULL; - -} - - -// Use this function to retrieve an entity from a server via an HTTP -// request. This function will either request a connection from the -// server specified in the szURL parameter or request a connection from -// the proxy server. If a proxy server is to be used, you must call -// SetProxy prior to calling this function to specify the proxy server -// being used. Once the connection is established, an HTTP request -// is built and sent to the HTTP server. An attempt to read the HTTP -// response is then made. If the response is successfully read, the -// response will be parsed and stored in this class instance. The -// headers can be parsed via the LookupHeader function and the body -// of the response can be retrieved using the GetBody function. You -// can also retrieve the contents of the entire response by calling -// GetResponse. -template -inline bool CAtlHttpClientT::Navigate( - - LPCTSTR szUrl, - ATL_NAVIGATE_DATA *pNavData - ) throw(...) -{ - if (!szUrl || *szUrl == _T('\0')) - return false; - - CUrl url; - TCHAR szTmp[ATL_URL_MAX_URL_LENGTH]; - if(!AtlEscapeUrl(szUrl,szTmp,0,ATL_URL_MAX_URL_LENGTH-1,ATL_URL_BROWSER_MODE)) - return false; - - if(!url.CrackUrl(szTmp)) - return false; - - // Navigate - return Navigate(&url, pNavData); -} - -template -inline bool CAtlHttpClientT::Navigate( - LPCTSTR szServer, - LPCTSTR szPath, - ATL_NAVIGATE_DATA *pNavData - ) throw(...) -{ - // Create a URL - if (!szServer || *szServer == _T('\0')) - return false; - if (!szPath || *szPath == _T('\0')) - return false; - CUrl url; - url.SetScheme(ATL_URL_SCHEME_HTTP); - url.SetHostName(szServer); - url.SetUrlPath(szPath); - if (pNavData) - url.SetPortNumber(pNavData->nPort); - else - url.SetPortNumber(ATL_URL_DEFAULT_HTTP_PORT); - - TCHAR szUrl[ATL_URL_MAX_URL_LENGTH]; - DWORD dwMaxLen = ATL_URL_MAX_URL_LENGTH; - if (!url.CreateUrl(szUrl, &dwMaxLen)) - return false; - - // Navigate - return Navigate(szUrl, pNavData); -} - -template -inline bool CAtlHttpClientT::Navigate( - const CUrl *pUrl, - ATL_NAVIGATE_DATA *pData - ) throw(...) -{ - bool bRet = false; - if (!pUrl) - return false; - - ResetRequest(); - - CAtlNavigateData default_nav_data; - if (!pData) - m_pNavData = &default_nav_data; - else - m_pNavData = pData; - - ATLASSUME(m_pNavData); - - _ATLTRY - { - m_strMethod = m_pNavData->szMethod; - } - _ATLCATCHALL() - { - return false; - } - - SetSocketTimeout(m_pNavData->dwTimeout); - - // set m_urlCurrent - if (!SetDefaultUrl(pUrl, m_pNavData->nPort)) - return false; - DWORD dwSent = 0; - CString strRequest; - CString strExtraInfo; - - if (!BuildRequest(&strRequest, - m_pNavData->szMethod, - m_pNavData->szExtraHeaders)) - { - return false; - } - - - if (!ConnectSocket()) - return false; - - LPCTSTR szTRequest = strRequest; - CT2CA strARequest(szTRequest); - DWORD dwRequestLen = (DWORD)strlen(strARequest); - DWORD dwAvailable = dwRequestLen + m_pNavData->dwDataLen; - - if (m_pNavData->dwFlags & ATL_HTTP_FLAG_SEND_CALLBACK) - { - dwSent = WriteWithCallback(strARequest, dwRequestLen); - } - else if (!m_pNavData->pData) - dwSent = WriteWithNoData(strARequest, dwRequestLen); - else if (m_pNavData->pData && (m_pNavData->dwFlags & ATL_HTTP_FLAG_SEND_BLOCKS)) - { - dwSent = WriteWithChunks(strARequest, dwRequestLen); - } - else if(m_pNavData->pData) - { - dwSent = WriteWithData(strARequest, dwRequestLen); - } - - - // make sure everything was sent - if (dwSent == dwAvailable) - { - // Read the response - if (RR_OK == ReadHttpResponse()) - { - // if navigation isn't complete, try to complete - // it based on the status code and flags - if ((m_pNavData->dwFlags & ATL_HTTP_FLAG_PROCESS_RESULT)&& - !ProcessStatus(m_pNavData->dwFlags)) - { - bRet = false; - } - else - bRet = true; - } - else - bRet = false; - } - - if (!bRet) - Close(); // some kind of failure happened, close the socket. - - m_pNavData = NULL; - return bRet; -} - -template -inline DWORD CAtlHttpClientT::WriteWithNoData(LPCSTR pRequest, DWORD dwRequestLen) -{ - ATLASSUME(m_pNavData); - WSABUF Buffer; - Buffer.buf = (char*)pRequest; - Buffer.len = (int)dwRequestLen; - DWORD dwWritten = 0; - Write(&Buffer, 1, &dwWritten); - if (m_pNavData->pfnSendStatusCallback) - m_pNavData->pfnSendStatusCallback(dwWritten, m_pNavData->m_lParamSend); - return dwWritten; -} - -// The entity body will be retrieved from the client by calling their -// callback function. -template -inline DWORD CAtlHttpClientT::WriteWithCallback(LPCSTR pRequest, DWORD dwRequestLen) -{ - ATLASSUME(m_pNavData); - if (!(m_pNavData->pfnChunkCallback && - (m_pNavData->dwFlags & ATL_HTTP_FLAG_SEND_CALLBACK))) - return 0; // error, must have flag set and callback function - - // write the request - DWORD dwTotalWritten = 0; - WSABUF Buffer; - Buffer.buf = (char*)pRequest; - Buffer.len = (int)dwRequestLen; - DWORD dwWritten = 0; - Write(&Buffer, 1, &dwWritten); - if (m_pNavData->pfnSendStatusCallback) - if (!m_pNavData->pfnSendStatusCallback(dwWritten, m_pNavData->m_lParamSend)) - return 0; - if (!dwWritten) - return 0; // failure - dwTotalWritten += dwWritten; - - // start writing data; - while (m_pNavData->pfnChunkCallback((BYTE**)&Buffer.buf, (DWORD*)&Buffer.len, m_pNavData->m_lParamChunkCB) && - Buffer.len > 0 && - Buffer.buf != NULL) - { - Write(&Buffer, 1, &dwWritten); - if (dwWritten != Buffer.len) - return 0; - if (m_pNavData->pfnSendStatusCallback) - if (!m_pNavData->pfnSendStatusCallback(dwWritten, m_pNavData->m_lParamSend)) - return 0; - dwTotalWritten += dwWritten; - } - return dwTotalWritten; -} - -template -inline DWORD CAtlHttpClientT::WriteWithChunks(LPCSTR pRequest, DWORD dwRequestLen) -{ - ATLASSUME(m_pNavData); - if (!(m_pNavData->dwSendBlockSize > 0 && (m_pNavData->dwFlags & ATL_HTTP_FLAG_SEND_BLOCKS))) - return 0; // error, must have flag set and callback function - - // write the request - DWORD dwTotalWritten = 0; - WSABUF Buffer; - Buffer.buf = (char*)pRequest; - Buffer.len = (int)dwRequestLen; - DWORD dwWritten = 0; - Write(&Buffer, 1, &dwWritten); - if (m_pNavData->pfnSendStatusCallback) - if (!m_pNavData->pfnSendStatusCallback(dwWritten, m_pNavData->m_lParamSend)) - return 0; - if (!dwWritten) - return 0; // failure - dwTotalWritten += dwWritten; - - // start writing data; - DWORD dwDataWritten = 0; - DWORD dwDataLeft = m_pNavData->dwDataLen; - while (dwDataLeft) - { - Buffer.buf = (char*)(m_pNavData->pData + dwDataWritten); - Buffer.len = __min(dwDataLeft, m_pNavData->dwSendBlockSize); - Write(&Buffer, 1, &dwWritten); - if (dwWritten != Buffer.len) - return 0; - if (m_pNavData->pfnSendStatusCallback) - if (!m_pNavData->pfnSendStatusCallback(dwWritten, m_pNavData->m_lParamSend)) - return false; - dwTotalWritten += dwWritten; - dwDataWritten += dwWritten; - dwDataLeft -= dwWritten; - } - return dwTotalWritten; -} - -template -inline DWORD CAtlHttpClientT::WriteWithData(LPCSTR pRequest, DWORD dwRequestLen) -{ - WSABUF Buffers[2]; - Buffers[0].buf = (char*)pRequest; - Buffers[0].len = dwRequestLen; - Buffers[1].buf = (char*)m_pNavData->pData; - Buffers[1].len = m_pNavData->dwDataLen; - - DWORD dwWritten = 0; - Write(Buffers, 2, &dwWritten); - if (m_pNavData->pfnSendStatusCallback) - m_pNavData->pfnSendStatusCallback(dwWritten, m_pNavData->m_lParamSend); - - return dwWritten; -} - -template -bool CAtlHttpClientT::NavigateChunked( - LPCTSTR szServer, - LPCTSTR szPath, - ATL_NAVIGATE_DATA *pNavData - ) throw() -{ - // Create a URL - if (!szServer || *szServer == _T('\0')) - return false; - if (!szPath || *szPath == _T('\0')) - return false; - - if (!pNavData) - { - // To do chunked navigation you must specify an - // ATL_NAVIGATE_DATA structure that has the pfnChunkCallback - // member filled out. - ATLASSERT(FALSE); - return false; - } - CUrl url; - url.SetScheme(ATL_URL_SCHEME_HTTP); - url.SetHostName(szServer); - url.SetUrlPath(szPath); - if (pNavData) - url.SetPortNumber(pNavData->nPort); - else - url.SetPortNumber(ATL_URL_DEFAULT_HTTP_PORT); - - TCHAR szUrl[ATL_URL_MAX_URL_LENGTH]; - DWORD dwMaxLen = ATL_URL_MAX_URL_LENGTH; - if (!url.CreateUrl(szUrl, &dwMaxLen)) - return false; - - // Navigate - return NavigateChunked(szUrl, pNavData); -} - -template -bool CAtlHttpClientT::NavigateChunked( - LPCTSTR szURL, - ATL_NAVIGATE_DATA *pNavData - ) throw() -{ - if (!szURL || *szURL == _T('\0')) - return false; - - ResetRequest(); - - ATLASSERT(pNavData); - - CUrl url; - if (!url.CrackUrl(szURL)) - return false; - - // Navigate - return NavigateChunked(&url, pNavData); -} - -template -inline bool CAtlHttpClientT::NavigateChunked( - const CUrl *pUrl, - ATL_NAVIGATE_DATA *pNavData - ) throw() -{ - if (!pUrl) - return false; - - if (!pNavData) - { - // To do chunked navigation you must specify an - // ATL_NAVIGATE_DATA structure that has the pfnChunkCallback - // member filled out. - ATLASSERT(FALSE); - return false; - } - - m_pNavData = pNavData; - if (!pNavData->pfnChunkCallback) - return false; - - bool bRet = true; - - _ATLTRY - { - m_strMethod = m_pNavData->szMethod; - } - _ATLCATCHALL() - { - return false; - } - - SetSocketTimeout(m_pNavData->dwTimeout); - - // set m_urlCurrent - if (!SetDefaultUrl(pUrl, m_pNavData->nPort)) - return false; - - - DWORD dwSent = 0; - CString strRequest; - CString strExtraInfo; - - if (!BuildRequest(&strRequest, - m_pNavData->szMethod, - m_pNavData->szExtraHeaders // extra headers - )) - { - return false; - } - - if (!ConnectSocket()) - return false; - - WSABUF Buffers[3]; - - _ATLTRY - { - CT2A pRequest(strRequest); - - Buffers[0].buf = (char*)pRequest; - Buffers[0].len = strRequest.GetLength(); - - // send the first buffer which is the request - if (!Write(Buffers, 1, &dwSent)) - { - Close(); - return false; - } - } - _ATLCATCHALL() - { - Close(); - return false; - } - Buffers[0].buf = NULL; - Buffers[0].len = 0; - - CStringA strChunkSize; - - Buffers[2].buf = "\r\n"; - Buffers[2].len = 2; - int z = 0; - - // start sending the chunks - do - { - z++; - Buffers[1].buf = NULL; - Buffers[1].len = 0; - if (m_pNavData->pfnChunkCallback((BYTE**)&Buffers[1].buf, &Buffers[1].len, - m_pNavData->m_lParamChunkCB)) - { - _ATLTRY - { - if (Buffers[1].len > 0) - { - // send the chunk - strChunkSize.Format("%x\r\n", Buffers[1].len); - Buffers[0].buf = (char*)(LPCSTR)strChunkSize; - Buffers[0].len = strChunkSize.GetLength(); - if (!Write(Buffers, 3, &dwSent)) - { - bRet = false; - break; - } - } - else if (Buffers[1].len == 0) - { - strChunkSize = "0\r\n\r\n\r\n"; - Buffers[0].buf = (char*)(LPCSTR)strChunkSize; - Buffers[0].len = strChunkSize.GetLength(); - if (!Write(Buffers, 1, &dwSent)) - { - bRet = false; - break; - } - break; - } - } - _ATLCATCHALL() - { - bRet = false; - break; - } - } - else - { - bRet = false; - break; // something went wrong in callback - } - }while (Buffers[1].len > 0); - - strRequest.ReleaseBuffer(); - - if (bRet) - { - // Read the response - if (RR_OK == ReadHttpResponse()) - { - // if navigation isn't complete, try to complete - // it based on the status code and flags - if ((m_pNavData->dwFlags & ATL_HTTP_FLAG_PROCESS_RESULT) - && !ProcessStatus(m_pNavData->dwFlags)) - { - bRet = false; - } - bRet = true; - } - else - bRet = false; - } - - if (!bRet) - Close(); - - return bRet; -} - -template -inline bool CAtlHttpClientT::ConnectSocket() throw() -{ - bool bRet=false; - // connect to the correct server - if (GetProxy()) - { - //if we're using a proxy connect to the proxy - bRet=Connect(m_strProxy, m_nProxyPort); - } - else - { - bRet=Connect(m_urlCurrent.GetHostName(),m_urlCurrent.GetPortNumber()); // connect to the server - } - return bRet; -} - - -template -inline bool CAtlHttpClientT::BuildRequest(/*out*/CString *pstrRequest, - LPCTSTR szMethod, - LPCTSTR szExtraHeaders) throw() -{ - if (!m_pNavData) - return false; - _ATLTRY - { - // build up the request - CString strRequest = szMethod; - strRequest += _T(" "); - if (GetProxy()) - { - TCHAR buffURL[ATL_URL_MAX_URL_LENGTH]; - DWORD dwSize = ATL_URL_MAX_URL_LENGTH; - m_urlCurrent.CreateUrl(buffURL, &dwSize); - strRequest += buffURL; - - strRequest += ATL_HTTP_HEADER_PROXY; - CString strHost; - if (m_urlCurrent.GetPortNumber() != ATL_URL_DEFAULT_HTTP_PORT) - strHost.Format(_T("Host: %s:%d\r\n"), m_urlCurrent.GetHostName(), m_urlCurrent.GetPortNumber()); - else - strHost.Format(_T("Host: %s\r\n"), m_urlCurrent.GetHostName()); - strRequest += strHost; - - if (m_pNavData->dwDataLen>0) - { - CString strCL; - strCL.Format(_T("Content-Length: %d\r\n"), m_pNavData->dwDataLen); - strRequest += strCL; - } - - if (m_pNavData->szDataType) - { - strRequest += _T("Content-Type: "); - strRequest += m_pNavData->szDataType; - strRequest += _T("\r\n"); - } - - if (m_pNavData->szExtraHeaders) - strRequest += szExtraHeaders; - strRequest += ATL_HTTP_USERAGENT; - } - else - { - strRequest += m_urlCurrent.GetUrlPath(); - strRequest += m_urlCurrent.GetExtraInfo(); - strRequest += ATL_HTTP_HEADER; - - if (m_pNavData->dwDataLen > 0) - { - CString strCL; - strCL.Format(_T("Content-Length: %d\r\n"), m_pNavData->dwDataLen); - strRequest += strCL; - } - - if (m_pNavData->szDataType && - *m_pNavData->szDataType) - { - strRequest += _T("Content-Type: "); - strRequest += m_pNavData->szDataType; - strRequest += _T("\r\n"); - } - - if (szExtraHeaders) - strRequest += szExtraHeaders; - - - CString strHost; - strHost.Format(_T("Host: %s\r\n"), m_urlCurrent.GetHostName()); - strRequest += strHost; - strRequest += ATL_HTTP_USERAGENT; - } - strRequest += _T("\r\n"); - - - *pstrRequest = strRequest; - return true; - } - _ATLCATCHALL() - { - return false; - } -} - -template -inline bool CAtlHttpClientT::ReadSocket() throw() -{ - bool bRet = false; - unsigned char read_buff[ATL_READ_BUFF_SIZE]; - int dwSize = ATL_READ_BUFF_SIZE; - - // read some data - for (int i = 0; i < ATL_HTTP_CLIENT_EMPTY_READ_RETRIES; ++i) - { - bRet = Read(read_buff, (DWORD*)&dwSize); - if (!bRet) - return bRet; - - // notify user - if (m_pNavData) - { - if (m_pNavData->pfnReadStatusCallback) - bRet = m_pNavData->pfnReadStatusCallback(dwSize, m_pNavData->m_lParamRead); - if (!bRet) - return bRet; - } - - if (dwSize > 0) - { - // append the data to our internal buffer - // m_current holds bytes (not UNICODE!) - - if (!m_current.Append((LPCSTR)read_buff, dwSize)) - return FALSE; - - m_pEnd = ((BYTE*)(LPCSTR)m_current) + m_current.GetLength(); - m_pCurrent = (BYTE*)(LPCSTR)m_current; - break; - } - bRet = false; // nothing was read - } - - return bRet; -} - -// Starts searching for a complete header set at -// m_pCurrent. This function will only move m_pCurrent -// if a complete set is found. Returns the header beginning -// optionally. -template -inline unsigned char* CAtlHttpClientT::FindHeaderEnd(unsigned char** ppBegin) throw() -{ - if (!m_pCurrent) - return NULL; - - BYTE *pCurr = m_pCurrent; - BYTE *pBegin = m_pCurrent; - int nLen = m_current.GetLength(); - - if (pCurr >= (BYTE*)(LPCSTR)m_current + m_current.GetLength()) - return NULL; // no more chars in buffer - // look for the end of the header (the \r\n\r\n) - while (pCurr <= (pBegin + nLen - ATL_HEADER_END_LEN)) - { - - if (* ((UNALIGNED DWORD*)pCurr)==ATL_DW_HEADER_END) - { - // set m_pCurrent pointer to the end of the header - m_pCurrent = pCurr + ATL_HEADER_END_LEN; - if (ppBegin) - *ppBegin = pBegin; - return m_pCurrent; - } - pCurr++; - } - return NULL; -} - -// Call this function after sending an HTTP request over the socket. The complete -// HTTP response will be read. This function will also parse -// response headers into the response header map. -template -inline typename CAtlHttpClientT::HTTP_RESPONSE_READ_STATUS CAtlHttpClientT::ReadHttpResponse() -{ - // Read until we at least have the response headers - HTTP_RESPONSE_READ_STATUS result = RR_OK; - readstate state = rs_init; - unsigned char *pBodyBegin = NULL; - unsigned char *pHeaderBegin = NULL; - m_current.Empty(); - m_pCurrent = NULL; - m_LastResponseParseError = RR_OK; - - while (state != rs_complete) - { - switch(state) - { - case rs_init: - m_HeaderMap.RemoveAll(); - m_nStatus = ATL_INVALID_STATUS; - m_dwHeaderLen = 0; - m_dwBodyLen = 0; - state = rs_readheader; - // fall through - - case rs_readheader: - - // read from the socket until we have a complete set of headers. - pBodyBegin = FindHeaderEnd(&pHeaderBegin); - if (!pBodyBegin) - { - if (!ReadSocket()) - { - // Either reading from the socket failed, or there - // was not data to read. Set the nav status to error - // and change the state to complete. - state = rs_complete; - result = RR_READSOCKET_FAILED; - break; - } - else - break; // loop back and FindHeaderEnd again. - } - // we have a complete set of headers - m_dwHeaderLen = (DWORD)(pBodyBegin-pHeaderBegin); - m_dwHeaderStart = (DWORD)(pHeaderBegin - (BYTE*)(LPCSTR)m_current); - // fall through - state = rs_scanheader; - - case rs_scanheader: - // set m_nStatus and check for valid status - ParseStatusLine(pHeaderBegin); - // failed to set m_nStatus; - if (m_nStatus == ATL_INVALID_STATUS) - { - state = rs_complete; - result = RR_STATUS_INVALID; - break; - } - - else if (m_nStatus == 100) // continue - { - state = rs_init; - break; - } - - // crack all the headers and put them into a header map. We've already - // done the check to make sure we have a complete set of headers in - // rs_readheader above - if (ATL_HEADER_PARSE_COMPLETE != CrackResponseHeader((LPCSTR)pHeaderBegin, - (LPCSTR*)&pBodyBegin)) - { - // something bad happened while parsing the headers! - state = rs_complete; - result = RR_PARSEHEADERS_FAILED; - break; - } - state = rs_readbody; - // fall through - - case rs_readbody: - // headers are parsed and cracked, we're ready to read the rest - // of the response. - if (IsMsgBodyChunked()) - { - if (!ReadChunkedBody()) - { - result = RR_READCHUNKEDBODY_FAILED; - state = rs_complete; - break; - } - } - else - if (!ReadBody(GetContentLength(), m_current.GetLength()-(m_dwHeaderStart+m_dwHeaderLen))) - result = RR_READBODY_FAILED; - state = rs_complete; - //fall through - - case rs_complete: - // clean up the connection if the server requested a close; - DisconnectIfRequired(); - break; - } - } - m_LastResponseParseError = result; - return result; -} - -template -inline typename CAtlHttpClientT::HTTP_RESPONSE_READ_STATUS CAtlHttpClientT::GetResponseStatus() -{ - return m_LastResponseParseError; -} - -// Checks to see if the server has closed the connection. -// If it has, we create a new socket and reconnect it to -// the current server. This also clears the contents of the -// current response buffer. -template -inline void CAtlHttpClientT::ResetConnection() throw() -{ - ReconnectIfRequired(); - m_HeaderMap.RemoveAll(); - m_current.Empty(); - m_nStatus = ATL_INVALID_STATUS; - m_AuthTypes.RemoveAll(); // the server will keep sending back www-authenticate - // headers until the connection is authorized -} - -// Takes action based on the flags passed and the current -// status for this object. -template -inline bool CAtlHttpClientT::ProcessStatus(DWORD dwFlags) throw() -{ - switch(m_nStatus) - { - case 200: // In all these cases there is no further action - case 201: // to take. Any additional informaion is returned - case 202: // in the entity body. - case 203: - case 204: - case 205: - case 206: - case 304: - case 305: - return true; - break; - case 301: - case 302: - case 303: - if (dwFlags & ATL_HTTP_FLAG_AUTO_REDIRECT) - return ProcessObjectMoved(); - break; - case 401: // auth required - return NegotiateAuth(false); - break; - case 407: // proxy auth required - return NegotiateAuth(true); - break; - - } - return false; -} - -// Looks up the value of a response header in the header map. Call with -// NULL szBuffer to have length of the required buffer placed in -// pdwLen on output. - -// szName is the name of the header to look up. -// szBuffer is the buffer that will contain the looked up string. -// pdwLen contains the length of szBuffer in characters on input and the length -// of the string including NULL terminator in characters on output. -template -inline bool CAtlHttpClientT::GetHeaderValue(LPCTSTR szName, CString& strValue) const throw() -{ - _ATLTRY - { - return m_HeaderMap.Lookup(szName, strValue); - } - _ATLCATCHALL() - { - return false; - } -} - -template -inline bool CAtlHttpClientT::GetHeaderValue(__in_z LPCTSTR szName, __out_ecount_part_z_opt(*pdwLen, *pdwLen) LPTSTR szBuffer, __inout DWORD *pdwLen) const throw() -{ - CString strValue; - bool bRet = GetHeaderValue(szName, strValue); - DWORD nLen = strValue.GetLength(); - if (!bRet) - return false; - - if ((pdwLen && *pdwLen < nLen+1) || - (!szBuffer && pdwLen) ) - { - *pdwLen = nLen+1; - return true; - } - - if (!szBuffer) - return false; - - Checked::tcsncpy_s(szBuffer, nLen+1, (LPCTSTR)strValue, _TRUNCATE); - if (pdwLen) - *pdwLen = nLen+1; - return true; -} - -// Adds an authorization object to use for a particular scheme. -// This will overwrite an existing entry if an object for the -// same scheme has already been set. -template -inline bool CAtlHttpClientT::AddAuthObj(LPCTSTR szScheme, - CAtlBaseAuthObject *pObject, IAuthInfo *pInfo/*=NULL*/) throw() -{ - if (!pObject) - return false; - - pObject->Init(this, pInfo); - - _ATLTRY - { - POSITION pos = m_AuthMap.SetAt(szScheme, pObject); - if (!pos) - return false; - } - _ATLCATCHALL() - { - return false; - } - - return true; -} - -// Tries to find an authorization object to use for a particular -// scheme -template -inline const CAtlBaseAuthObject* CAtlHttpClientT::FindAuthObject(LPCTSTR szScheme) throw() -{ - CAtlBaseAuthObject *pObject = NULL; - if (m_AuthMap.Lookup(szScheme, pObject)) - { - return const_cast(pObject); - } - return NULL; -} - -// Removes an existing authorization object from the map. -template -inline bool CAtlHttpClientT::RemoveAuthObject(LPCTSTR szScheme) throw() -{ - return m_AuthMap.RemoveKey(szScheme); -} - -// Sets the current proxy server and port -template -inline bool CAtlHttpClientT::SetProxy(LPCTSTR szProxy, short nProxyPort) throw() -{ - if (!szProxy) - { - if (!LookupRegProxy()) - return false; - } - else - { - _ATLTRY - { - m_strProxy = szProxy; - m_nProxyPort = nProxyPort; - } - _ATLCATCHALL() - { - return false; - } - } - return true; -} - -// Removes the current proxy settings. -template -inline void CAtlHttpClientT::RemoveProxy() throw() -{ - m_strProxy.Empty(); - m_nProxyPort = ATL_URL_INVALID_PORT_NUMBER; -} - -// retrieves the current proxy -template -inline LPCTSTR CAtlHttpClientT::GetProxy() const throw() -{ - if (m_strProxy.GetLength()) - return (LPCTSTR)m_strProxy; - return NULL; -} - -template -inline short CAtlHttpClientT::GetProxyPort() const throw() -{ - return m_nProxyPort; -} - -// Gets the contents of the entire response buffer. -template -inline const BYTE* CAtlHttpClientT::GetResponse() throw() -{ - return (const BYTE*)(LPCSTR)m_current; -} - -template -inline DWORD CAtlHttpClientT::GetResponseLength() throw() -{ - return m_current.GetLength(); -} - -// Gets the length in bytes of the body of the -// current response -template -inline DWORD CAtlHttpClientT::GetBodyLength() const throw() -{ - return m_dwBodyLen; -} - -// Gets the contents of the body of the current response. This -// is the response without the headers. -template -inline const BYTE* CAtlHttpClientT::GetBody() throw() -{ - return (BYTE*)((LPCSTR)m_current + m_dwHeaderLen + m_dwHeaderStart); -} - -// Get the length of the header part of the response in bytes. -template -inline DWORD CAtlHttpClientT::GetRawResponseHeaderLength() throw() -{ - return m_dwHeaderLen >= 2 ? m_dwHeaderLen-2 : 0; // m_dwHeaderLen includes the final \r\n -} - -// buffer must include space for null terminator. -// on input, pdwLen specifies the size of szBuffer, -// on output, pdwLen holds the number of bytes copied -// to szBuffer, or the required size of szBuffer if -// szBuffer wasn't big enough -template -inline bool CAtlHttpClientT::GetRawResponseHeader(LPBYTE szBuffer, DWORD *pdwLen) throw() -{ - if (!pdwLen) - return false; - - DWORD header_len = GetRawResponseHeaderLength(); - if (header_len == 0) - return false; - - if (!szBuffer || *pdwLen < header_len+1) - { - *pdwLen = header_len+1; - return false; - } - - Checked::memcpy_s(szBuffer, *pdwLen, (BYTE*)(LPCSTR)m_current, header_len); - szBuffer[header_len]='\0'; - - *pdwLen = header_len+1; - return true; -} - -// Gets the current URL object. -template -inline LPCURL CAtlHttpClientT::GetCurrentUrl() const throw() -{ - return (LPCURL)&m_urlCurrent; -} - -template -inline bool CAtlHttpClientT::SetDefaultUrl( LPCTSTR szUrl, - short nPortNumber) throw() -{ - return _SetDefaultUrl(szUrl,nPortNumber); -} - -template -inline bool CAtlHttpClientT::SetDefaultUrl( LPCURL pUrl, - short nPortNumber) throw() -{ - m_urlCurrent = *pUrl; - return _SetDefaultUrl(NULL, nPortNumber); -} - -template -inline bool CAtlHttpClientT::SetDefaultMethod(LPCTSTR szMethod) throw() - -{ - _ATLTRY - { - m_strMethod = szMethod; - return true; - } - _ATLCATCHALL() - { - return false; - } -} - -template -inline DWORD CAtlHttpClientT::GetFlags() const throw() -{ - if (m_pNavData) - return m_pNavData->dwFlags; - else - return ATL_HTTP_FLAG_INVALID_FLAGS; -} - -template -inline bool CAtlHttpClientT::LookupRegProxy() throw() -{ - // attempt to look it up from the registry - CRegKey rkProxy; - ULONG nChars = ATL_URL_MAX_URL_LENGTH+1; - TCHAR szUrl[ATL_URL_MAX_URL_LENGTH+1] = { 0 }; - - DWORD dwErr = rkProxy.Open(HKEY_CURRENT_USER, - _T("Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings"), KEY_READ); - if (dwErr == ERROR_SUCCESS) - { - dwErr = rkProxy.QueryStringValue(_T("ProxyServer"), szUrl, &nChars); - } - if (dwErr == ERROR_SUCCESS) - { - CUrl url; - if (url.CrackUrl(szUrl)) - { - if (url.GetScheme()==ATL_URL_SCHEME_UNKNOWN) - { - // without the scheme name (e.g. proxy:80) - m_strProxy = url.GetSchemeName(); - m_nProxyPort = (short)_ttoi(url.GetHostName()); - return true; - } - else if (url.GetHostName()) - { - // with the scheme (e.g. http://proxy:80) - m_strProxy = url.GetHostName(); - m_nProxyPort = url.GetPortNumber(); - return true; - } - } - } - return false; -} - -template -inline bool CAtlHttpClientT::DisconnectIfRequired() throw() -{ - CString strValue; - if (GetHeaderValue(_T("Connection"), strValue) && !strValue.CompareNoCase(_T("close"))) - { - Close(); - } - - return true; -} - -class CInitializeCOMThread -{ -public: - CInitializeCOMThread() - : m_bCoInit(FALSE),m_bShouldUninit(FALSE) - { - //At this point the Thread can be uninit, init to STA or init to MTA. - //CoInitialize can always fail unexpectedly. - HRESULT hr = ::CoInitialize(NULL); - if (SUCCEEDED(hr)) - { - m_bCoInit=TRUE; - m_bShouldUninit=TRUE; - } else if (hr == RPC_E_CHANGED_MODE) - { - m_bCoInit=TRUE; - } - } - ~CInitializeCOMThread() - { - if (m_bShouldUninit) - { - ::CoUninitialize(); - } - } - BOOL IsInitialized() { return m_bCoInit; } -protected: - BOOL m_bCoInit; - BOOL m_bShouldUninit; -}; -// Tries to find an authorization object that meets -template -inline bool CAtlHttpClientT::NegotiateAuth(bool bProxy) throw() -{ - //Test if can silently pass user credentials to server. - if (!m_bSilentLogonOk) - { - //Call CoInit, because ATL Http code cannot assume it has already been called by the user. - CInitializeCOMThread initThread; - if (initThread.IsInitialized()) - { - HRESULT hr = S_OK; - CComPtr spSecurityMgr; - - hr = CoCreateInstance(CLSID_InternetSecurityManager, NULL, CLSCTX_INPROC_SERVER, - IID_IInternetSecurityManager, (void**)&spSecurityMgr); - if (SUCCEEDED(hr)) - { - TCHAR szUrl[ATL_URL_MAX_URL_LENGTH]; - DWORD dwMaxLen = ATL_URL_MAX_URL_LENGTH; - if (!m_urlCurrent.CreateUrl(szUrl, &dwMaxLen)) - { - return false; - } - - CStringW strUrlW(szUrl); - DWORD dwPolicy=0xFFFF; - hr=spSecurityMgr->ProcessUrlAction(strUrlW.GetString(), - URLACTION_CREDENTIALS_USE, - reinterpret_cast(&dwPolicy), - sizeof(dwPolicy), - NULL, - 0, - PUAF_NOUI, - NULL); - - if (FAILED(hr) || dwPolicy != URLPOLICY_CREDENTIALS_SILENT_LOGON_OK) - { - return false; - } - } - else - { - // CoCreateInstance failed, return false - return false; - } - } - else - { - // CoInit failed, return false - return false; - } - } - - // szAuthHeaderValue should contain a comma separated list - // of authentication types - CAtlBaseAuthObject *pAuthObj = NULL; - bool bRet = false; - for (size_t i = 0; im_bFailed) - bRet = pAuthObj->Authenticate(m_AuthTypes[i], bProxy); - - if (bRet) - return bRet; - } - _ATLCATCHALL() - { - bRet = false; - } - } - return bRet; -} - -template -inline long CAtlHttpClientT::GetContentLength() throw() -{ - CString strValue; - if (GetHeaderValue(_T("Content-Length"), strValue)) - { - TCHAR *pStop = NULL; - return _tcstol(strValue, &pStop, 10); - } - else - return -1; -} - -template -inline LPCSTR CAtlHttpClientT::NextLine(BYTE* pCurr) throw() -{ - if (!pCurr) - return NULL; - - while ( pCurr < m_pEnd && *pCurr && !(*pCurr == '\r' && *(pCurr+1) == '\n')) - pCurr++; - - if (pCurr >= m_pEnd) - return NULL; - -// if (pCurr < m_pEnd-4) -// if (!memcmp(pCurr, ATL_HEADER_END, 4)) - //return NULL; - - return (LPCSTR)(pCurr+2); -} - -template -inline bool CAtlHttpClientT::IsMsgBodyChunked() throw() -{ - CString strValue; - return ( - GetHeaderValue(_T("Transfer-Encoding"), strValue) && - !strValue.CompareNoCase(_T("chunked")) - ); - -} - -// finds the end of an individual header field pointed to by -// pszStart. Header fields can be multi-line with multi-line -// header fields being a line that starts with some kind of -// white space. -template -inline LPCSTR CAtlHttpClientT::FindEndOfHeader(LPCSTR pszStart) throw() -{ - // move through all the lines until we come to one - // that doesn't start with white space - LPCSTR pLineStart = pszStart; - LPCSTR pHeaderEnd = NULL; - - do - { - pLineStart = NextLine((BYTE*)pLineStart); - }while (pLineStart && isspace(static_cast(*pLineStart)) && strncmp(pLineStart-2, ATL_HEADER_END, ATL_HEADER_END_LEN)); - - if (pLineStart > (LPCSTR)m_pEnd) - return NULL; // ran out of data in the buffer without finding the end of a line - // or the end of the headers. - - if (pLineStart) - pHeaderEnd = pLineStart-2; - else - pHeaderEnd = NULL; - - return pHeaderEnd; -} - -template -inline bool CAtlHttpClientT::DecodeHeader(LPCSTR pHeaderStart, LPCSTR pHeaderEnd) throw() -{ - _ATLTRY - { - if (!pHeaderStart || !pHeaderEnd) - return false; - LPCSTR pTemp = pHeaderStart; - while (*pTemp != ATL_FIELDNAME_DELIMITER && pTemp < pHeaderEnd) - pTemp++; - if (*pTemp == ATL_FIELDNAME_DELIMITER) - { - char szName[ATL_MAX_FIELDNAME_LEN]; - char szValue[ATL_MAX_VALUE_LEN]; - int nLen = (int)(pTemp-pHeaderStart) ; - ATLASSERT(nLen < ATL_MAX_FIELDNAME_LEN); - if (nLen >= ATL_MAX_FIELDNAME_LEN) - return false; // won't fit in the buffer. - Checked::memcpy_s(szName, ATL_MAX_FIELDNAME_LEN, pHeaderStart, nLen); - szName[nLen]=0; - - pTemp++; // move past delimiter; - while (isspace(static_cast(*pTemp)) && pTemp < pHeaderEnd) - pTemp++; - - nLen = (int)(pHeaderEnd-pTemp); - ATLASSERT(nLen < ATL_MAX_VALUE_LEN); - if (nLen >= ATL_MAX_VALUE_LEN) - return false; // won't fit in the buffer - Checked::memcpy_s(szValue, ATL_MAX_VALUE_LEN, pTemp, nLen); - szValue[nLen]=0; - - CString strExist; - CA2T pszName(szName); - CA2T pszValue(szValue); - - if (!_tcsicmp(pszName, _T("www-authenticate")) || - !_tcsicmp(pszName, _T("proxy-authenticate"))) - { - m_AuthTypes.Add(pszValue); - } - - if (!m_HeaderMap.Lookup(pszName, strExist)) - m_HeaderMap.SetAt(pszName, pszValue); - else - { - // field-values for headers with the same name can be appended - // per rfc2068 4.2, we do the appending so we don't have to - // store/lookup duplicate keys. - strExist += ','; - strExist += pszValue; - m_HeaderMap.SetAt(pszName, (LPCTSTR)strExist); - } - - // if it's a set-cookie header notify users so they can do - // somthing with it. - if (!_tcsicmp(pszName, _T("set-cookie"))) - OnSetCookie(pszValue); - } - - return true; - } - _ATLCATCHALL() - { - return false; - } -} - -template -inline void CAtlHttpClientT::OnSetCookie(LPCTSTR) throw() -{ - return; -} - -template -inline LPCSTR CAtlHttpClientT::ParseStatusLine(BYTE* pBuffer) throw() -{ - if (!pBuffer) - return NULL; - if (m_pEnd <= pBuffer) - return NULL; - - // find the first space' - while (pBuffer < m_pEnd && !isspace(static_cast(*pBuffer))) - pBuffer++; - - if (pBuffer >= m_pEnd) - return NULL; - - // move past the space - while (pBuffer < m_pEnd && isspace(static_cast(*pBuffer))) - pBuffer++; - - if (pBuffer >= m_pEnd) - return NULL; - - // pBuffer better be pointing at the status code now - LPCSTR pEnd = NULL; - if (*pBuffer >= '0' && *pBuffer <= '9') - { - // probably a good status code - errno_t errnoValue = AtlStrToNum(&m_nStatus, (LPSTR)pBuffer, (LPSTR*)&pEnd, 10); - if (errnoValue == ERANGE) - return NULL; // bad status code - } - else - return FALSE; // bad status code; - - if (!pEnd) - return FALSE; // bad status code; - - pBuffer = (BYTE*)pEnd; - // move to end of line - while (pBuffer < m_pEnd && *pBuffer != '\n') - pBuffer++; - - if (pBuffer >= m_pEnd) - return NULL; - - // set the return pointing to the first - // character after our status line. - return (LPCSTR)++pBuffer; -} - - -// pBuffer should start at the first character -// after the status line. -template -inline int CAtlHttpClientT::CrackResponseHeader(LPCSTR pBuffer, /*out*/ LPCSTR *pEnd) throw() -{ - // read up to the double /r/n - LPCSTR pszStartSearch = pBuffer; - if (!pEnd) - return ATL_HEADER_PARSE_HEADERERROR; - - *pEnd = NULL; - if (pszStartSearch == NULL) - return ATL_HEADER_PARSE_HEADERERROR; - - // start parsing headers - LPCSTR pHeaderStart = ParseStatusLine((BYTE*)pBuffer); - if (!pHeaderStart) - return ATL_HEADER_PARSE_HEADERERROR; - LPCSTR pHeaderEnd = NULL; - - while (pHeaderStart && *pHeaderStart && pHeaderStart < (LPCSTR)m_pEnd) - { - pHeaderEnd = FindEndOfHeader(pHeaderStart); - if (!pHeaderEnd) - break; // error - - DecodeHeader(pHeaderStart, pHeaderEnd); - - if (!strncmp(pHeaderEnd, ATL_HEADER_END, strlen(ATL_HEADER_END))) - { - *pEnd = pHeaderEnd + strlen(ATL_HEADER_END); - break; // we're done - } - else - pHeaderStart = pHeaderEnd+2; - } - - return ATL_HEADER_PARSE_COMPLETE; -} - -// Reads the body if the encoding is not chunked. -template -inline bool CAtlHttpClientT::ReadBody(int nContentLen, int nCurrentBodyLen) throw() -{ - // nCurrentBodyLen is the length of the body that has already been read - // nContentLen is the value of Content-Length - // current is the buffer that will contain the entire response - bool bRet = true; - ATLASSUME(m_pNavData); - if (!m_pNavData) - return false; - - CTempBuffer readbuff; - DWORD dwReadBuffSize = 0; - DWORD dwRead = 0; - if (m_pNavData->dwReadBlockSize) - { - ATLTRY(readbuff.Allocate(m_pNavData->dwReadBlockSize)); - dwReadBuffSize = m_pNavData->dwReadBlockSize; - } - else - { - ATLTRY(readbuff.Allocate(ATL_READ_BUFF_SIZE)); - dwReadBuffSize = ATL_READ_BUFF_SIZE; - } - - if (readbuff.operator BYTE*() == NULL) - return false; - - if (nContentLen != -1) // We know the content length. - { - // read the rest of the body. - while (nCurrentBodyLen < nContentLen) - { - dwRead = dwReadBuffSize; - // loop while dwRead == 0 - for (int nRetry = 0; nRetry < ATL_HTTP_CLIENT_EMPTY_READ_RETRIES; ++nRetry) - { - if (!Read(readbuff, &dwRead)) - return false; - - // notify user - if (m_pNavData) - { - if (m_pNavData->pfnReadStatusCallback) - if (!m_pNavData->pfnReadStatusCallback(dwRead, m_pNavData->m_lParamRead)) - return false; - } - - if (dwRead == 0) - continue; - nCurrentBodyLen += dwRead; - if (!m_current.Append((LPCSTR)(BYTE*)readbuff, dwRead)) - { - ATLASSERT(0); - return false; // error! - } - m_pEnd = ((BYTE*)(LPCSTR)m_current) + m_current.GetLength(); - break; - } - if (dwRead == 0) - return false; - } - m_dwBodyLen = nCurrentBodyLen; - } - else // We don't know content length. All we can do is - { // read until there is nothing else to read. - int nRetries = 0; - while (1) - { - dwRead = dwReadBuffSize; - if (Read((BYTE*)readbuff, (DWORD*)&dwRead)) - { - // notify user - if (m_pNavData) - { - if (m_pNavData->pfnReadStatusCallback) - bRet = m_pNavData->pfnReadStatusCallback(dwRead, m_pNavData->m_lParamRead); - if (!bRet) - return bRet; - } - - if (dwRead == 0) - { - if (nRetries++ < ATL_HTTP_CLIENT_EMPTY_READ_RETRIES) - continue; - break; - } - - nRetries = 0; - nCurrentBodyLen += dwRead; - if (!m_current.Append((LPCSTR)(BYTE*)readbuff, dwRead)) - return false; - m_pEnd = ((BYTE*)(LPCSTR)m_current) + m_current.GetLength(); - } - else - { - // notify user - if (m_pNavData) - { - if (m_pNavData->pfnReadStatusCallback) - bRet = m_pNavData->pfnReadStatusCallback(dwRead, m_pNavData->m_lParamRead); - if (!bRet) - return bRet; - } - - bRet = true; - break; - } - } - m_dwBodyLen = nCurrentBodyLen; - } - return bRet; -} - - -// This function moves pBuffStart only on success. On success, pBuffStart is moved -// to the element past the last element we consumed. -template -inline typename CAtlHttpClientT::CHUNK_LEX_RESULT CAtlHttpClientT::get_chunked_size(char *&pBuffStart, char *&pBuffEnd, long* pnChunkSize) throw() -{ - CHUNK_LEX_RESULT result = LEX_ERROR; - char *pStop = NULL; - - if (pBuffStart >= pBuffEnd) - result = LEX_OUTOFDATA; - else - { - long nResult = 0; - errno_t errnoValue = AtlStrToNum(&nResult, pBuffStart, &pStop, 16); - if (errnoValue != ERANGE && - nResult >= 0 && - nResult < 0xFFFFFFFF && - pStop <= pBuffEnd && - *pStop == '\r') - { - // move pBuffStart - // return chunk size - *pnChunkSize = nResult; - pBuffStart = pStop; - result = LEX_OK; - } - if (*pStop != '\r') - { - result = LEX_OUTOFDATA; // not enough data in the buffer - } - } - return result; -} - -template -inline bool CAtlHttpClientT::move_leftover_bytes( __in_ecount(nLen) char *pBufferStart, - __in int nLen, - __deref_inout_ecount(nLen) char *&pBuffStart, - __deref_inout char *& pBuffEnd) throw() -{ - bool bRet = true; - Checked::memcpy_s(pBufferStart, (pBuffEnd-pBuffStart), pBuffStart, nLen); - return bRet; -} - -template -inline typename CAtlHttpClientT::CHUNK_LEX_RESULT CAtlHttpClientT::get_chunked_data(char *&pBufferStart, - char *&pBufferEnd, - long nChunkSize, - char **ppDataStart, - long *pnDataLen) throw() -{ - CHUNK_LEX_RESULT result = LEX_ERROR; - if (pBufferStart + nChunkSize - 1 < pBufferEnd) - { - *ppDataStart = pBufferStart; - *pnDataLen = nChunkSize; - pBufferStart = pBufferStart + nChunkSize; - result = LEX_OK; - } - else if (pBufferStart + nChunkSize - 1 >= pBufferEnd) - result = LEX_OUTOFDATA; - - return result; -} - -template -inline typename CAtlHttpClientT::CHUNK_LEX_RESULT CAtlHttpClientT::consume_chunk_trailer(char *&pBufferStart, char *pBufferEnd) -{ - CHUNK_LEX_RESULT result = LEX_ERROR; - if (pBufferStart >= pBufferEnd) - return result; - - char *pHeaderEnd = NULL; - char *pTemp = pBufferStart; - // check for empty trailer, this means there are no more trailers - if ( (pTemp < pBufferEnd && *pTemp == '\r') && - (pTemp+1 < pBufferEnd && *(pTemp+1) == '\n')) - { - pBufferStart += 2; - return LEX_TRAILER_COMPLETE; - } - - while (pTemp <= pBufferEnd) - { - if ( (pTemp < pBufferEnd && *pTemp == '\r') && - (pTemp+1 < pBufferEnd && *(pTemp+1) == '\n')) - { - pHeaderEnd = pTemp; // success case - result = LEX_OK; - break; - } - pTemp++; - } - - if (result == LEX_OK) - { - DecodeHeader(pBufferStart, pHeaderEnd); - pBufferStart = pHeaderEnd + 2; - } - else if (result != LEX_OK && - pTemp > pBufferEnd) - result = LEX_OUTOFDATA; - return result; -} - -template -inline typename CAtlHttpClientT::CHUNK_LEX_RESULT CAtlHttpClientT::consume_chunk_footer(char *&pBufferStart, char *&pBufferEnd) -{ - CHUNK_LEX_RESULT result = LEX_ERROR; - if (pBufferStart < pBufferEnd && - (pBufferStart+1) <= pBufferEnd) - { - if ( *pBufferStart == '\r' && - *(pBufferStart+1) == '\n') - { - pBufferStart += 2; - result = LEX_OK; - } - } - else - result = LEX_OUTOFDATA; - return result; -} - -#define CHUNK_BUFF_SIZE 2048 - -template -inline bool CAtlHttpClientT::ReadChunkedBody() throw() -{ - // At this point, m_current contains the headers, up to and including the \r\n\r\n, - // plus any additional data that might have been read off the socket. So, we need - // to copy off the additional data into our read buffer before we start parsing the - // chunks. -#ifdef _DEBUG - // nReadCount, keeps track of how many socket reads we do. - int nReadCount = 0; -#endif - - // nChunkBuffCarryOver - // When we run out of data in the input buffer, this is the - // count of bytes that are left in the input that could not - // be lexed into anything useful. We copy this many bytes to - // the top of the input buffer before we fill the input buffer - // with more bytes from the socket - long nChunkBuffCarryOver = 0; - - // nChunkSize - // The size of the next chunk to be read from the input buffer. - long nChunkSize = 0; - - // t_chunk_buffer - // The heap allocated buffer that we holds data - // read from the socket. We will increase the size - // of this buffer to 2 times the max chunk size we - // need to read if we have to. - CHeapPtr t_chunk_buffer; - - // nTChunkBuffSize - // Keeps track of the allocated size of t_chunk_buffer. - // This size will change if we need to read chunks bigger - // than the currently allocated size of t_chunk_buffer. - long nTChunkBuffSize = CHUNK_BUFF_SIZE; - - // chunk_buffer & chunk_buffer_end - // Keeps track of the current location - // in t_chunk_buffer that we are lexing input from. - // chunk_buffer_end is the end of the input buffer we - // are lexing from. chunk_buffer_end is used as a marker - // to make sure we don't read past the end of our input buffer - char *chunk_buffer, *chunk_buffer_end; - - // cstate - // The current state of the chunk parsing state machine. We - // start out reading the size of the first chunk. - CHUNK_STATE cstate = READ_CHUNK_SIZE; - - // cresult - // Holds the value of the result of a lexing operation performed - // on the input buffer. - CHUNK_LEX_RESULT cresult = LEX_OK; - - CAtlIsapiBuffer<> result_buffer; - - // Initialize pointers and allocate the chunk buffer. - chunk_buffer = chunk_buffer_end = NULL; - if( !t_chunk_buffer.Allocate(nTChunkBuffSize) ) - return false; - - // copy the headers into a temporary buffer. - result_buffer.Append(m_current + m_dwHeaderStart, m_dwHeaderLen); - - // calculate number of bytes left in m_current past the headers - long leftover_in_m_current = m_current.GetLength() - (m_dwHeaderStart + m_dwHeaderLen); - - // copy the extra bytes that might have been read into m_current into the chunk buffer - if (leftover_in_m_current > 0) - { - if (leftover_in_m_current > nTChunkBuffSize) - { - if( ! t_chunk_buffer.Reallocate(leftover_in_m_current) ) - return false; - } - - chunk_buffer = (char*)t_chunk_buffer; - Checked::memcpy_s(chunk_buffer, leftover_in_m_current, ((LPCSTR)m_current)+ m_dwHeaderStart + m_dwHeaderLen, leftover_in_m_current); - chunk_buffer_end = chunk_buffer + leftover_in_m_current; - } - - m_current.Empty(); - m_dwBodyLen = 0; - m_dwHeaderStart = 0; - - // as we start the state machine, we should be either pointing at the first - // byte of chunked response or nothing, in which case we will need to get - // more data from the socket. - nChunkSize = 0; - - bool bDone = false; - - while(!bDone) - { - // if we run out of data during processing, chunk_buffer - // get set to null - if (!chunk_buffer || - chunk_buffer >= chunk_buffer_end) - { - // we ran out of data in our input buffer, we need - // to read more from the socket. - DWORD dwReadBuffSize = nTChunkBuffSize - nChunkBuffCarryOver; - chunk_buffer = t_chunk_buffer; - if (!Read((const unsigned char*)(chunk_buffer+nChunkBuffCarryOver), &dwReadBuffSize)) - { - ATLTRACE("ReadChunkedBody: Error reading from socket (%d)\n", GetLastError()); - return false; - } - else if(dwReadBuffSize == 0) - { - ATLTRACE("ReadChunkedBody: The socket read timed out and no bytes were read from the socket.\n"); - return false; - } -#ifdef _DEBUG - ATLTRACE("ReadChunkedBody read %d bytes from socket. Reads %d \n", dwReadBuffSize, ++nReadCount); -#endif - chunk_buffer_end = chunk_buffer + nChunkBuffCarryOver + dwReadBuffSize; - nChunkBuffCarryOver = 0; - } - - switch(cstate) - { - case READ_CHUNK_SIZE: - { - cresult = get_chunked_size(chunk_buffer, chunk_buffer_end, &nChunkSize); - switch(cresult) - { - case LEX_ERROR: - ATLTRACE("ReadChunkedBody Failed retrieving chunk size\n"); - return false; - break; - case LEX_OUTOFDATA: - nChunkBuffCarryOver = (long)(chunk_buffer_end - chunk_buffer); - if (!move_leftover_bytes((char*)t_chunk_buffer, nChunkBuffCarryOver, - chunk_buffer, chunk_buffer_end)) - { - ATLTRACE("failed to move leftover chunk data to head of buffer\n"); - return false; - } - chunk_buffer = chunk_buffer_end = NULL; - break; - case LEX_OK: - if (nChunkSize == 0) - { - cstate = CHUNK_READ_DATA_COMPLETE; - } - else if (nChunkSize + 2 > nTChunkBuffSize) - { - char *pBuffStart = (char*)t_chunk_buffer; - int nReadSoFar = (int)(chunk_buffer - pBuffStart); - int nTotal = (int)(chunk_buffer_end - pBuffStart); - if( FAILED(::ATL::AtlMultiply(&nTChunkBuffSize, nChunkSize, 2L))) - { - return false; - } - t_chunk_buffer.Reallocate(nTChunkBuffSize); - pBuffStart = (char*)t_chunk_buffer; - chunk_buffer = pBuffStart + nReadSoFar; - chunk_buffer_end = pBuffStart + nTotal; - cstate = READ_CHUNK_SIZE_FOOTER; - m_dwBodyLen += nChunkSize; - } - else - { - // everything is OK. move to next state - cstate = READ_CHUNK_SIZE_FOOTER; - m_dwBodyLen += nChunkSize; - } - break; - default: - ATLASSERT(0); - return false; - break; - } - } - break; - case READ_CHUNK_DATA: - { - char *pDataStart = NULL; - long nDataLen = 0; - cresult = LEX_OK; - cresult = get_chunked_data(chunk_buffer, chunk_buffer_end, - nChunkSize, &pDataStart, &nDataLen); - switch(cresult) - { - case LEX_ERROR: - ATLTRACE("ReadChunkedBody failed to retrieve chunk data\n"); - return false; - break; - case LEX_OUTOFDATA: - nChunkBuffCarryOver = (long)(chunk_buffer_end - chunk_buffer); - if (!move_leftover_bytes((char*)t_chunk_buffer, nChunkBuffCarryOver, - chunk_buffer, chunk_buffer_end)) - { - ATLTRACE("failed to move leftover chunk data to head of buffer\n"); - return false; - } - chunk_buffer = chunk_buffer_end = NULL; - break; - case LEX_OK: - result_buffer.Append(pDataStart, nDataLen); - cstate = READ_CHUNK_DATA_FOOTER; - break; - default: - ATLASSERT(0); - return false; - } - } - break; - case READ_CHUNK_SIZE_FOOTER: - case READ_CHUNK_DATA_FOOTER: - { - cresult = consume_chunk_footer(chunk_buffer, chunk_buffer_end); - switch(cresult) - { - case LEX_OK: - cstate = (cstate == READ_CHUNK_SIZE_FOOTER) ? READ_CHUNK_DATA : READ_CHUNK_SIZE; - break; - case LEX_ERROR: - ATLTRACE("Error consuming chunk footer!\n"); - return false; - break; - case LEX_OUTOFDATA: - nChunkBuffCarryOver = (long)(chunk_buffer_end - chunk_buffer); - if (!move_leftover_bytes((char*)t_chunk_buffer, nChunkBuffCarryOver, - chunk_buffer, chunk_buffer_end)) - { - ATLTRACE("failed to move leftover chunk data to head of buffer\n"); - return false; - } - chunk_buffer = chunk_buffer_end = NULL; - break; - default: - ATLASSERT(0); - return false; - - } - } - break; - case CHUNK_READ_DATA_COMPLETE: - { - // We read the chunk of size 0 - // consume the chunk footer. - DWORD dwLen = 0; - cresult = consume_chunk_footer(chunk_buffer, chunk_buffer_end); - if (GetHeaderValue((_T("Trailer")), NULL, &dwLen)) - { - cstate = READ_CHUNK_TRAILER; // start reading trailer headers - break; - } - else - bDone = true; - } - break; - case READ_CHUNK_TRAILER: - cresult = consume_chunk_trailer(chunk_buffer, chunk_buffer_end); - switch(cresult) - { - case LEX_OK: - cstate = READ_CHUNK_TRAILER; // keep reading - break; - case LEX_ERROR: - ATLTRACE("Error consuming chunk trailers!\n"); - return false; - break; - case LEX_OUTOFDATA: - nChunkBuffCarryOver = (long)(chunk_buffer_end - chunk_buffer); - if (!move_leftover_bytes((char*)t_chunk_buffer, nChunkBuffCarryOver, - chunk_buffer, chunk_buffer_end)) - { - ATLTRACE("failed to move leftover chunk data to head of buffer\n"); - return false; - } - chunk_buffer = chunk_buffer_end = NULL; - break; - case LEX_TRAILER_COMPLETE: - return true; - break; - default: - ATLASSERT(0); - return false; - - - - } - break; - - } - } - if (!m_current.Append((LPCSTR)result_buffer)) - return false; - - m_pEnd = ((BYTE*)(LPCSTR)m_current) + m_current.GetLength(); - - return true; -} - -template -inline bool CAtlHttpClientT::ReconnectIfRequired() throw() -{ - CString strValue; - // if we have a keep-alive header then return true - // else we have to close and re-open the connection - if (GetHeaderValue(_T("Connection"), strValue)) - { - if (!strValue.CompareNoCase(_T("keep-alive"))) - return true; // server said keep connection open. - } - else - { - return true; // there was no 'Connection' header - } - - if (!strValue.CompareNoCase(_T("close"))) - { - Close(); - ConnectSocket(); - } - return false; -} - -// Complete relative URLs and URLs -// that have a missing path. These are common with redirect headers. -// http://www.microsoft.com becomes http://www.microsoft.com/ -// localstart.asp becomes whatever our current (m_urlCurrent) -// path is plus localstart.asp -template -inline bool CAtlHttpClientT::CompleteURL(CString& strURL) throw() -{ - _ATLTRY - { - CString strUrlTemp = strURL; - strUrlTemp.Trim(); - CUrl url; - bool bErr = false; - if (url.CrackUrl(strUrlTemp)) - { - return true; // URL is already valid - } - - - // if we have a scheme and a host name but no - // path, then add the path of '/' - if (url.GetScheme() == ATL_URL_SCHEME_HTTP && - url.GetHostNameLength() > 0 && - !url.GetUrlPathLength() ) - { - url.SetUrlPath(_T("/")); - bErr = true; - } - // if we have leading / (absolute path) (ex: /Test/bbb.asp) we can concatinate it - // to it to our current URL (m_urlCurrent) scheme and host - else if (strUrlTemp[0] == _T('/')) - { - url = m_urlCurrent; - url.SetUrlPath(strUrlTemp); - bErr = true; - } - // relative path (ex: bbb.asp) - we don't have a valid url - // and the first char is not / - // Get the url from our current URL (m_urlCurrent) and add - // our relative paths - else - { - CString szPath; - url = m_urlCurrent; - - if (!url.GetUrlPathLength()) - { - szPath = _T('/'); // current URL has no path! - } - else - { - szPath = url.GetUrlPath(); - } - - // back up to the first / and insert our current url - int pos = szPath.ReverseFind(_T('/')); - if(pos == -1) - { - return false; - } - - szPath.GetBufferSetLength(pos+1); - szPath.ReleaseBuffer(); - - szPath += strURL; - url.SetUrlPath(szPath); - bErr = true; - } - if (!bErr) - { - return bErr; - } - DWORD dwLen = ATL_URL_MAX_PATH_LENGTH; - - return url.CreateUrl(strURL.GetBuffer(ATL_URL_MAX_PATH_LENGTH), - &dwLen) ? true : false; - } - _ATLCATCHALL() - { - return false; - } -} - -template -inline bool CAtlHttpClientT::ProcessObjectMoved() throw() -{ - _ATLTRY - { - // look for a location header - CString strValue; - CString strURLNew; - if (GetHeaderValue(_T("Location"), strValue)) - { - CString strRedirectReqHeaders=m_pNavData->szExtraHeaders; - ReconnectIfRequired(); - m_HeaderMap.RemoveAll(); - m_current.Empty(); - - - // create a new URL based on what is in the - // Location header and set it as this object's - // default Url - strURLNew = strValue; - CompleteURL(strURLNew); - CString strCurrHostName = m_urlCurrent.GetHostName(); - ATL_URL_PORT nCurrPort=m_urlCurrent.GetPortNumber(); - - SetDefaultUrl((LPCTSTR)strURLNew, m_urlCurrent.GetPortNumber()); - //If redirected (new url in strURLNew) to different host (server) or port, need a new socket. - if (m_urlCurrent.GetHostName()!=strCurrHostName || m_urlCurrent.GetPortNumber()!=nCurrPort) - { - Close(); - ConnectSocket(); - } - // build up a request. - CString strRequest; - BuildRequest(&strRequest, - m_strMethod, - strRedirectReqHeaders.GetString()); - - // send the request - DWORD dwSent = strRequest.GetLength(); - DWORD dwAvailable = dwSent; - if (!Write((BYTE*)((LPCSTR)CT2A(strRequest.GetBuffer(dwAvailable))), &dwSent)) - return false; - strRequest.ReleaseBuffer(); - - if (dwSent != dwAvailable) - return false; - - // read the response - if (RR_OK == ReadHttpResponse()) - { - if (m_pNavData) - ProcessStatus(m_pNavData->dwFlags); - } - } - return true; - } - _ATLCATCHALL() - { - return false; - } -} - -template -inline bool CAtlHttpClientT::_SetDefaultUrl(LPCTSTR szURL, short nPort) throw() -{ - - if (szURL) - if (!m_urlCurrent.CrackUrl(szURL)) // re-inits the field of the CUrl first - return false; - - ATL_URL_SCHEME currScheme = m_urlCurrent.GetScheme(); - if ( currScheme != ATL_URL_SCHEME_HTTP && - !TSocketClass::SupportsScheme(currScheme) ) - return false; // only support HTTP - - if (!m_urlCurrent.GetUrlPathLength()) - { - // no path, default to / - m_urlCurrent.SetUrlPath(_T("/")); - } - - if (!m_urlCurrent.GetHostNameLength()) - { - // no server name - return false; - } - - if (m_urlCurrent.GetPortNumber() == ATL_URL_INVALID_PORT_NUMBER) - m_urlCurrent.SetPortNumber(nPort); - return true; -} - -template -inline int CAtlHttpClientT::GetStatus() throw() -{ - return m_nStatus; -} - -template -inline LPCTSTR CAtlHttpClientT::GetMethod() throw() -{ - return m_strMethod; -} - -template -inline BYTE* CAtlHttpClientT::GetPostData() throw() -{ - if (m_pNavData) - return m_pNavData->pData; - return NULL; -} - -template -inline DWORD CAtlHttpClientT::GetPostDataLen() throw() -{ - if (m_pNavData) - return m_pNavData->dwDataLen; - return 0; -} - -template -inline LPCTSTR CAtlHttpClientT::GetPostDataType() throw() -{ - if (m_pNavData) - return m_pNavData->szDataType; - return NULL; -} - -template -inline DWORD CAtlHttpClientT::GetLastError() throw() -{ - return m_dwLastError; -} - -template -inline const SOCKET& CAtlHttpClientT::GetSocket() throw() -{ - return const_cast(m_socket); -} - -template -inline void CAtlHttpClientT::Close() throw() -{ - TSocketClass::Close(); -} - -template -inline DWORD CAtlHttpClientT::SetSocketTimeout(DWORD dwNewTimeout) throw() -{ - return TSocketClass::SetSocketTimeout(dwNewTimeout); -} - -template -inline DWORD CAtlHttpClientT::GetSocketTimeout() throw() -{ - return TSocketClass::GetSocketTimeout(); -} - -template -inline void CAtlHttpClientT::AuthProtocolFailed(LPCTSTR szProto) throw() -{ - CAtlBaseAuthObject *pAuthObj = NULL; - _ATLTRY - { - if (m_AuthMap.Lookup(szProto, pAuthObj) && pAuthObj) - { - pAuthObj->m_bFailed = true; - } - } - _ATLCATCHALL() - { - } -} - -template -inline const ATL_NAVIGATE_DATA* CAtlHttpClientT::GetCurrentNavdata() -{ - return m_pNavData; -} - - -///////////////////////////////////////////////////////////////////////////////// -// -// CNTLMAuthObject -// NTLM Security Authorization functions -// -///////////////////////////////////////////////////////////////////////////////// -inline CNTLMAuthObject::CNTLMAuthObject() throw() : - m_pSocket(NULL), - m_nMaxTokenSize(0), - m_pAuthInfo(NULL), - m_bProxy(false) -{ - SecInvalidateHandle(&m_hCredentials) -} - -inline CNTLMAuthObject::CNTLMAuthObject(IAuthInfo *pAuthInfo) throw() : - m_pSocket(NULL), - m_nMaxTokenSize(0), - m_pAuthInfo(pAuthInfo) -{ - SecInvalidateHandle(&m_hCredentials) -} - -inline CNTLMAuthObject::~CNTLMAuthObject() throw() -{ - if (!ATL_IS_INVALIDCREDHANDLE(m_hCredentials)) - FreeCredentialsHandle(&m_hCredentials); -} - -inline void CNTLMAuthObject::Init(CAtlHttpClient *pSocket, IAuthInfo *pAuthInfo) throw() -{ - m_pSocket = pSocket; - SetAuthInfo(pAuthInfo); -} - -inline void CNTLMAuthObject::SetAuthInfo(IAuthInfo *pAuthInfo) throw() -{ - m_pAuthInfo = pAuthInfo; -} - -inline bool CNTLMAuthObject::Authenticate(LPCTSTR /*szAuthTypes*/, bool bProxy) throw() -{ - m_bProxy = bProxy; - if (AcquireCredHandle()) - return DoNTLMAuthenticate(); - return false; -} - -inline bool CNTLMAuthObject::AcquireCredHandle() throw() -{ - PSecPkgInfo pPackageInfo = NULL; - SECURITY_STATUS SecurityStatus = SEC_E_OK; - - // Acquire a credentials handle on the NTLM security package - SecurityStatus = QuerySecurityPackageInfo(ATL_HTTP_AUTHTYPE_NTLM, - &pPackageInfo); - - if (SecurityStatus != SEC_E_OK) - return false; - - void *pAuthData = NULL; - CSecAuthIdentity CA; - if (m_pAuthInfo) - { - // if m_pAuthInfo has been set then the caller wants us - // to get credentials from them. - if (CA.Init(m_pAuthInfo)) - pAuthData = static_cast(&CA); - } - - SecurityStatus = AcquireCredentialsHandle( - 0, - pPackageInfo->Name, - SECPKG_CRED_OUTBOUND, - 0, - pAuthData, - 0, - 0, - &m_hCredentials, - &m_ts - ); - - m_nMaxTokenSize = pPackageInfo->cbMaxToken; - FreeContextBuffer(pPackageInfo); - return SecurityStatus == SEC_E_OK ? true : false; -} - -inline bool CNTLMAuthObject::DoNTLMAuthenticate() throw() -{ - bool bRet = false; - - m_CurrentRequestData = (*(const_cast(m_pSocket->GetCurrentNavdata()))); - // make sure we have a good credentials handle - ATLASSERT(!ATL_IS_INVALIDCREDHANDLE(m_hCredentials)); - if (ATL_IS_INVALIDCREDHANDLE(m_hCredentials)) - return false; - - SECURITY_STATUS SecurityStatus = SEC_E_OK; - - unsigned long ContextAttributes = 0; - CSecBufferDesc OutBufferDesc; - CtxtHandle SecurityContext; - SecInvalidateHandle(&SecurityContext); - - // Create a SecBufferDesc with one buffer of m_nMaxTokenSize - if (!OutBufferDesc.AddBuffers(1, m_nMaxTokenSize)) - return false; - - SecurityStatus = InitializeSecurityContext( - &m_hCredentials, - 0, - NULL, - ISC_REQ_CONNECTION, - 0, - 0, - 0, - 0, - &SecurityContext, - OutBufferDesc, - &ContextAttributes, - &m_ts - ); - - if ( (SecurityStatus == SEC_I_COMPLETE_NEEDED) || - (SecurityStatus == SEC_I_COMPLETE_AND_CONTINUE) ) - { - SecurityStatus = CompleteAuthToken( &SecurityContext, (PSecBufferDesc)OutBufferDesc); - } - - if (IS_ERROR(SecurityStatus)) - return false; - - // create an Authentication header with the contents of the - // security buffer and send it to the HTTP server. The output - // buffer will be pointing to a buffer that contains the - // response from the HTTP server on return. - LPSTR pszbuff = NULL; - if (!SendSecurityInfo(OutBufferDesc.Buffers(0), &pszbuff) || !pszbuff) - return false; - - CString strVal; - if (!m_pSocket->GetHeaderValue(m_bProxy ? g_pszProxyAuthenticate : g_pszWWWAuthenticate, strVal)) - return false; // wrong authentication type - - LPCTSTR szResponsecode = strVal; - TCHAR pszcode[ATL_AUTH_HDR_SIZE]; - if (szResponsecode) - { - // first four characters better be 'NTLM' - if (_tcsncicmp(szResponsecode, _T("NTLM"), 4) != 0) - return false; - - // skip NTLM - szResponsecode += 4; - - // skip space - while (*szResponsecode && _AtlIsHttpSpace(*szResponsecode)) - szResponsecode++; - - // find end of header - LPCTSTR pszend = szResponsecode; - while (*pszend && *pszend != _T('\r')) - pszend++; - bRet = false; - if (pszend) - { - // copy authentication data to our buffer - // and base64decode it. - int nlen = (int)(pszend-szResponsecode); - Checked::memcpy_s(pszcode, ATL_AUTH_HDR_SIZE, szResponsecode, nlen*sizeof(TCHAR)); - pszcode[pszend-szResponsecode]=0; - - // re-use OutBufferDesc here since we'll need to need - // a SecBufferDesc to pass to the next call to InitializeSecurityContext - // anyways. - if(!OutBufferDesc.Buffers(0)->ClearBuffer(m_nMaxTokenSize)) - return false; - - _ATLTRY - { - CT2A pszcode_a(pszcode); - bRet = Base64Decode(pszcode_a, - (int) strlen(pszcode_a), - (BYTE*)OutBufferDesc.Buffers(0)->pvBuffer, - (int*) &OutBufferDesc.Buffers(0)->cbBuffer) != FALSE; - } - _ATLCATCHALL() - { - bRet = false; - } - } - - if (!bRet) - return false; - - // Create buffers for the challenge data - CSecBufferDesc *InBufferDesc = &OutBufferDesc; - CSecBufferDesc OutBufferDesc2; - if (!OutBufferDesc2.AddBuffers(1, m_nMaxTokenSize)) - return false; - - // Process the challenge response from the server - SecurityStatus = InitializeSecurityContext( - 0, - &SecurityContext, - NULL, - 0, - 0, - 0 , - InBufferDesc, - 0, - &SecurityContext, - OutBufferDesc2, - &ContextAttributes, - &m_ts - ); - - if (IS_ERROR(SecurityStatus)) - return false; - - pszbuff = NULL; - if (SendSecurityInfo(OutBufferDesc2.Buffers(0), &pszbuff)) - { - // at this point we should be authenticated and either have the page - // we requested or be getting re-directed to another page under our - // authorization. Either way, we don't want to go through authorization - // code again if we are not authorized to prevent recursive authorization - // so we tell the client not to try this protocol again. - if (m_pSocket->GetStatus() == 401 || - m_pSocket->GetStatus() == 407) - { - // Authorization with this protocol failed. - // don't try it again. - m_pSocket->AuthProtocolFailed(_T("NTLM")); - } - bRet = m_pSocket->ProcessStatus(m_pSocket->GetFlags()); - } - } - - return bRet; -} -inline bool CNTLMAuthObject::GetCredentialNames(CString& theName) -{ - if (ATL_IS_INVALIDCREDHANDLE(m_hCredentials)) - return false; - - SecPkgCredentials_Names spcn; - if(!IS_ERROR(QueryCredentialsAttributes(&m_hCredentials, - SECPKG_CRED_ATTR_NAMES, (void*)&spcn))) - { - theName = spcn.sUserName; - return true; - } - return false; -} - -inline bool CNTLMAuthObject::SendSecurityInfo(SecBuffer *pSecBuffer, LPSTR *pszBuffer) throw() -{ - ATLASSERT(pSecBuffer); - ATLASSUME(m_pSocket); - ATLASSERT(pszBuffer); - - int nDest = ATL_AUTH_HDR_SIZE; - char auth_b64encoded[ATL_AUTH_HDR_SIZE]; - char auth_header[ATL_AUTH_HDR_SIZE]; - const char *pszFmtStr = m_bProxy ? m_pszFmtProxy : m_pszFmtWWW; - - if (!pSecBuffer || !pSecBuffer->pvBuffer || !pszBuffer) - return false; - *pszBuffer = 0; - - // Base64Encode will fail gracefully if buffer not big enough - if (Base64Encode((BYTE*)pSecBuffer->pvBuffer, pSecBuffer->cbBuffer, - auth_b64encoded, &nDest, ATL_BASE64_FLAG_NOCRLF)) - { - if (nDest < ATL_AUTH_HDR_SIZE) - { - auth_b64encoded[nDest]=0; - // make sure we have enough room in our header buffer - if ( (strlen(pszFmtStr)-2 + nDest) < ATL_AUTH_HDR_SIZE) - sprintf_s(auth_header, ATL_AUTH_HDR_SIZE, pszFmtStr, auth_b64encoded); - else - return false; - } - else - return false; - } - else - return false; - - // reset the connection if required - m_pSocket->ResetConnection(); - - // Resend the request with the authorization information - LPCURL pUrl = m_pSocket->GetCurrentUrl(); - bool bRet = false; - - TCHAR szUrl[ATL_URL_MAX_URL_LENGTH]; - DWORD dwMaxLen = ATL_URL_MAX_URL_LENGTH; - if( ! pUrl->CreateUrl(szUrl, &dwMaxLen) ) - return false; - - _ATLTRY - { - CA2CT hdr(auth_header); - CAtlNavigateData navigate_data(m_CurrentRequestData); - // append authorization header to extra headers - CString strHeaders = navigate_data.GetExtraHeaders(); - strHeaders += hdr; - navigate_data.SetExtraHeaders(strHeaders); - navigate_data.RemoveFlags(ATL_HTTP_FLAG_PROCESS_RESULT); - - bRet = m_pSocket->Navigate( szUrl, &navigate_data); - } - _ATLCATCHALL() - { - bRet = false; - } - if (bRet) - *pszBuffer = (LPSTR)m_pSocket->GetResponse(); - return bRet; -} - -///////////////////////////////////////////////////////////////////////////////// -// -// CBasicAuthObject -// BASIC Security Authorization functions -// -///////////////////////////////////////////////////////////////////////////////// -inline bool CBasicAuthObject::DoBasicAuthenticate() throw() -{ - bool bRet = false; - ATLASSUME(m_pClient); - ATLASSUME(m_pAuthInfo); - // Create an authentication string - CTempBuffer auth_string; - CAuthInfoBuffType buffUID; - CAuthInfoBuffType buffPWD; - - DWORD dwUID=0,dwPWD=0; - if (!_AtlGetAuthInfoHelper(m_pAuthInfo, &IAuthInfo::GetPassword, buffPWD, &dwPWD) || - !_AtlGetAuthInfoHelper(m_pAuthInfo, &IAuthInfo::GetUsername, buffUID, &dwUID)) - return false; - - _ATLTRY - { - if (!auth_string.Allocate((_ATL_MAX_AUTH_BUFF*2)+2)) - return false; - - Checked::tcscpy_s(auth_string, _ATL_MAX_AUTH_BUFF, buffUID); - Checked::tcscat_s(auth_string, _ATL_MAX_AUTH_BUFF, _T(":")); - Checked::tcscat_s(auth_string, _ATL_MAX_AUTH_BUFF, buffPWD); - - // Base64 encode the auth string - char *auth_string_enc = NULL; - CTempBuffer auth_string_buff; - CT2A auth_string_a(auth_string); - - int nLen = Base64EncodeGetRequiredLength((int)strlen((LPSTR)auth_string_a)); - auth_string_buff.Allocate(nLen+1); - if (!((char*)auth_string_buff)) - return false; - - auth_string_enc = (char*)auth_string_buff; - if (!Base64Encode((const BYTE*)(LPSTR)auth_string_a, (int)strlen((LPSTR)auth_string_a), - auth_string_enc, &nLen, ATL_BASE64_FLAG_NOCRLF)) - return false; - auth_string_buff[nLen]=0; - - // Format the Authentication header - int nLenFmt = (m_bProxy ? (int)strlen(m_pszFmtProxy) : (int)strlen(m_pszFmtWWW)) + 2; - nLen += nLenFmt; - ++nLen; // Space for '\0' - - CTempBuffer auth_header_buff; - ATLTRY(auth_header_buff.Allocate(nLen)); - if (!((char*)auth_header_buff)) - return false; - - char *auth_header = (char*)auth_header_buff; - Checked::strcpy_s(auth_header, nLen, m_bProxy ? m_pszFmtProxy : m_pszFmtWWW); - Checked::strcat_s(auth_header, nLen, auth_string_enc); - Checked::strcat_s(auth_header, nLen, "\r\n"); - - // Resend the request with the authorization information - LPCURL pUrl = m_pClient->GetCurrentUrl(); - TCHAR szUrl[ATL_URL_MAX_URL_LENGTH]; - DWORD dwMaxLen = ATL_URL_MAX_URL_LENGTH; - pUrl->CreateUrl(szUrl, &dwMaxLen); - - // reset the connection if required - m_pClient->ResetConnection(); - - CA2T hdr(auth_header); - CAtlNavigateData navigate_data(*(const_cast(m_pClient->GetCurrentNavdata()))); - // append authorization header to extra headers - CString strHeaders = navigate_data.GetExtraHeaders(); - strHeaders += hdr; - navigate_data.SetExtraHeaders(strHeaders); - navigate_data.RemoveFlags(ATL_HTTP_FLAG_PROCESS_RESULT); - bRet = m_pClient->Navigate( szUrl, - &navigate_data); - } - _ATLCATCHALL() - { - bRet = false; - } - - if (bRet) - { - // Request was successfully sent. Process the result. - if (m_pClient->GetStatus() == 401 || - m_pClient->GetStatus() == 407) - { - // Authorization with this protocol failed. - // don't try it again. - m_pClient->AuthProtocolFailed(_T("basic")); - } - bRet = m_pClient->ProcessStatus(m_pClient->GetFlags()); - } - return bRet; -} - -inline CBasicAuthObject::CBasicAuthObject() throw() -{ - m_pClient = NULL; - m_pAuthInfo = NULL; - m_szRealm[0] = 0; - m_bProxy = false; -} - -inline CBasicAuthObject::CBasicAuthObject(IAuthInfo *pAuthInfo) throw() -{ - m_pAuthInfo = pAuthInfo; - m_pClient = NULL; -} - -inline void CBasicAuthObject::SetAuthInfo(IAuthInfo *pAuthInfo) throw() -{ - m_pAuthInfo = pAuthInfo; -} - -// Called by the CAtlHttpClient class to -// authenticate a user. -inline bool CBasicAuthObject::Authenticate(LPCTSTR szAuthTypes, bool bProxy) throw() -{ - if (lstrlen(szAuthTypes) > ATL_AUTH_HDR_SIZE) - return false; - - m_bProxy = bProxy; - - if (!CrackRealm(szAuthTypes)) - return false; - return DoBasicAuthenticate(); -} - -inline LPCTSTR CBasicAuthObject::GetRealm() throw() -{ - return const_cast(m_szRealm); -} - -// Called by the CAtlHttpClient class to initialize -// this authentication object. -inline void CBasicAuthObject::Init(CAtlHttpClient *pSocket, IAuthInfo *pAuthInfo) throw() -{ - ATLASSERT(pSocket); - m_pClient = pSocket; - if (pAuthInfo) - SetAuthInfo(pAuthInfo); -} - -inline bool CBasicAuthObject::CrackRealm(LPCTSTR szHeader) throw() -{ - // szHeader is pointing at the - // "basic" in the header - // see if realm is available - const TCHAR *pStart = szHeader; - - // skip "basic" - pStart += 5; - - // skip space - while (*pStart && _AtlIsHttpSpace(*pStart)) - pStart++; - - // are we pointing at 'realm'? - if ((*pStart == 'r' || *pStart == 'R') && - (*(pStart+1) == 'e' || *(pStart+1) == 'E') && - (*(pStart+2) == 'a' || *(pStart+2) == 'A') && - (*(pStart+3) == 'l' || *(pStart+3) == 'L') && - (*(pStart+4) == 'm' || *(pStart+4) == 'M')) - { - // skip 'realm' - pStart += 5; - - // skip space - while (*pStart && _AtlIsHttpSpace(*pStart)) - pStart++; - - // skip '=' - if (*pStart && *pStart == _T('=')) - pStart++; - else - return false; // invalid realm - - // skip space - while (*pStart && _AtlIsHttpSpace(*pStart)) - pStart++; - - // skip quotes if they are there - if (*pStart == '\"') - pStart++; - - const TCHAR *pEnd = pStart; - while (*pEnd && *pEnd != '\"') - { - if (*pEnd == '\\' && *(pEnd + 1)) // escaped character, skip it - pEnd += 2; - else - pEnd++; - } - - if (*pEnd == '\"' && *(pEnd+1) != '\0') - return false; //trailing junk after the quoted realm - - if (*pEnd=='\0' || *pEnd =='\"') - { - int nLen = (int)(pEnd-pStart); - if (nLen < MAX_REALM_LEN) - { - Checked::tcsncpy_s(m_szRealm, _countof(m_szRealm), pStart, nLen); - m_szRealm[nLen]=0; - if (!AtlUnescapeUrl(m_szRealm, m_szRealm, NULL, MAX_REALM_LEN)) - return false; // error unescaping the string - } - else - return false; - } - } - return true; -} - -inline CAtlBaseAuthObject::CAtlBaseAuthObject() -{ - m_bFailed = false; -} - - -inline CAtlNavigateData::CAtlNavigateData() throw() -{ - dwFlags = ATL_HTTP_FLAG_AUTO_REDIRECT| - ATL_HTTP_FLAG_PROCESS_RESULT| - ATL_HTTP_FLAG_SEND_BLOCKS; - szExtraHeaders = NULL; - szMethod = ATL_HTTP_METHOD_GET; - nPort = ATL_URL_DEFAULT_HTTP_PORT; - pData = NULL; - dwDataLen = 0; - szDataType = NULL; - dwTimeout = ATL_SOCK_TIMEOUT; - dwSendBlockSize = ATL_HTTP_DEFAULT_BLOCK_SIZE; - dwReadBlockSize = ATL_HTTP_DEFAULT_BLOCK_SIZE; - pfnChunkCallback = NULL; - pfnSendStatusCallback = NULL; - pfnReadStatusCallback = NULL; - m_lParamSend = 0; - m_lParamRead = 0; -} - -inline CAtlNavigateData::CAtlNavigateData(const CAtlNavigateData &rhs) -{ - this->operator=(rhs); -} - -inline CAtlNavigateData::CAtlNavigateData(const ATL_NAVIGATE_DATA &rhs) -{ - this->operator=(rhs); -} - -inline CAtlNavigateData& CAtlNavigateData::operator=(const CAtlNavigateData &rhs) -{ - return this->operator=(static_cast(rhs)); -} - -inline CAtlNavigateData& CAtlNavigateData::operator=(const ATL_NAVIGATE_DATA &rhs) -{ - dwFlags = rhs.dwFlags; - szExtraHeaders = rhs.szExtraHeaders; - szMethod = rhs.szMethod; - nPort = rhs.nPort; - pData = rhs.pData; - dwDataLen = rhs.dwDataLen; - szDataType = rhs.szDataType; - dwTimeout = rhs.dwTimeout; - dwSendBlockSize = rhs.dwSendBlockSize; - dwReadBlockSize = rhs.dwReadBlockSize; - pfnChunkCallback = rhs.pfnChunkCallback; - pfnSendStatusCallback = rhs.pfnSendStatusCallback; - pfnReadStatusCallback = rhs.pfnReadStatusCallback; - m_lParamSend = rhs.m_lParamSend; - m_lParamRead = rhs.m_lParamRead; - return *this; -} - -inline DWORD CAtlNavigateData::SetFlags(DWORD dwNewFlags) throw() -{ - // check for mutually exclusive flags - if ((dwNewFlags & ATL_HTTP_FLAG_SEND_CALLBACK) && - (dwNewFlags & ATL_HTTP_FLAG_SEND_BLOCKS)) - { - ATLASSERT(0); - return ATL_HTTP_FLAG_INVALID_FLAGS; - } - - DWORD dwOldFlags = dwFlags; - dwFlags = dwNewFlags; - return dwOldFlags; -} - -inline DWORD CAtlNavigateData::GetFlags() throw() -{ - return dwFlags; -} - -inline DWORD CAtlNavigateData::AddFlags(DWORD dwFlagsToAdd) throw() -{ - // check for mutually exclusive flags - if ( - ((dwFlagsToAdd & ATL_HTTP_FLAG_SEND_CALLBACK) && - (dwFlags & ATL_HTTP_FLAG_SEND_BLOCKS)) || - ((dwFlagsToAdd & ATL_HTTP_FLAG_SEND_BLOCKS) && - (dwFlags & ATL_HTTP_FLAG_SEND_CALLBACK)) - ) - { - ATLASSERT(0); - return ATL_HTTP_FLAG_INVALID_FLAGS; - } - - DWORD dwOldFlags = dwFlags; - dwFlags |= dwFlagsToAdd; - return dwOldFlags; -} - -inline DWORD CAtlNavigateData::RemoveFlags(DWORD dwFlagsToRemove) throw() -{ - DWORD dwOldFlags = dwFlags; - dwFlags &= ~dwFlagsToRemove; - return dwOldFlags; -} - -inline LPCTSTR CAtlNavigateData::SetExtraHeaders(LPCTSTR szNewHeaders) throw() -{ - LPCTSTR szold = szExtraHeaders; - szExtraHeaders = szNewHeaders; - return szold; -} - -inline LPCTSTR CAtlNavigateData::GetExtraHeaders() throw() -{ - return szExtraHeaders; -} -inline LPCTSTR CAtlNavigateData::SetMethod(LPCTSTR szNewMethod) throw() -{ - LPCTSTR szold = szMethod; - szMethod = szNewMethod; - return szold; -} -inline LPCTSTR CAtlNavigateData::GetMethod() throw() -{ - return szMethod; -} -inline short CAtlNavigateData::SetPort(short newPort) throw() -{ - short oldport = nPort; - nPort = newPort; - return oldport; -} -inline short CAtlNavigateData::GetPort() throw() -{ - return nPort; -} -inline void CAtlNavigateData::SetPostData(BYTE *pd, DWORD len, LPCTSTR type) throw() -{ - pData = pd; - dwDataLen = len; - szDataType = type; -} - -inline DWORD CAtlNavigateData::SetSocketTimeout(DWORD dwNewTimeout) throw() -{ - DWORD dwold = dwTimeout; - dwTimeout = dwNewTimeout; - return dwold; -} -inline DWORD CAtlNavigateData::GetSocketTimeout() throw() -{ - return dwTimeout; -} -inline DWORD CAtlNavigateData::SetSendBlockSize(DWORD dwNewBlockSize) throw() -{ - DWORD dwold = dwSendBlockSize; - dwSendBlockSize = dwNewBlockSize; - return dwold; -} -inline DWORD CAtlNavigateData::GetSendBlockSize() throw() -{ - return dwSendBlockSize; -} - -inline DWORD CAtlNavigateData::SetReadBlockSize(DWORD dwNewBlockSize) throw() -{ - DWORD dwold = dwReadBlockSize; - dwReadBlockSize = dwNewBlockSize; - return dwold; -} - -inline DWORD CAtlNavigateData::GetReadBlockSize() throw() -{ - return dwReadBlockSize; -} - -inline PFNATLCHUNKEDCB CAtlNavigateData::SetChunkCallback(PFNATLCHUNKEDCB pfn, DWORD_PTR dwParam) throw() -{ - PFNATLCHUNKEDCB pold = pfnChunkCallback; - pfnChunkCallback = pfn; - m_lParamChunkCB = dwParam; - return pold; -} -inline PFNATLCHUNKEDCB CAtlNavigateData::GetChunkCallback() throw() -{ - return pfnChunkCallback; -} - -inline PFNATLSTATUSCALLBACK CAtlNavigateData::SetSendStatusCallback(PFNATLSTATUSCALLBACK pfn, DWORD_PTR dwData) throw() -{ - PFNATLSTATUSCALLBACK pold = pfnSendStatusCallback; - pfnSendStatusCallback = pfn; - m_lParamSend = dwData; - return pold; -} - -inline PFNATLSTATUSCALLBACK CAtlNavigateData::GetSendStatusCallback() throw() -{ - return pfnSendStatusCallback; -} - -inline PFNATLSTATUSCALLBACK CAtlNavigateData::SetReadStatusCallback(PFNATLSTATUSCALLBACK pfn, DWORD_PTR dwData) throw() -{ - PFNATLSTATUSCALLBACK pOld = pfnReadStatusCallback; - pfnReadStatusCallback = pfn; - m_lParamRead = dwData; - return pOld; -} - -inline PFNATLSTATUSCALLBACK CAtlNavigateData::GetReadStatusCallback() throw() -{ - return pfnReadStatusCallback; -} - -} // namespace ATL - -#pragma warning(pop) - -#endif // __ATLHTTP_INL__ diff --git a/include/atl/atlisapi.h b/include/atl/atlisapi.h deleted file mode 100644 index e812aecc5..000000000 --- a/include/atl/atlisapi.h +++ /dev/null @@ -1,10609 +0,0 @@ -// This is a part of the Active Template Library. -// Copyright (C) Microsoft Corporation -// All rights reserved. -// -// This source code is only intended as a supplement to the -// Active Template Library Reference and related -// electronic documentation provided with the library. -// See these sources for detailed information regarding the -// Active Template Library product. - -#ifndef __ATLSTENCIL_H__ -#include -#endif - -#ifndef __ATLISAPI_H__ -#define __ATLISAPI_H__ - -#pragma once -#include -#include // needed for cookie support -#include // needed for ECB and IIS support -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifndef ATL_NO_SOAP - #include -#endif -#ifndef ATL_NO_ACLAPI - #include -#endif -#ifndef ATL_NO_MMSYS -#pragma warning(push) -#pragma warning(disable:4201) // nonstandard extension used : nameless struct/union -#include -#pragma warning(pop) -#ifndef _ATL_NO_DEFAULT_LIBS -#pragma comment(lib, "winmm.lib") -#ifndef ATL_NO_SOAP -#pragma comment(lib, "msxml2.lib") -#endif -#endif // !_ATL_NO_DEFAULT_LIBS -#endif -#include - -#pragma warning(push) -#pragma warning(disable: 4291) // allow placement new -#pragma warning(disable: 4127) // conditional expression is constant -#pragma warning(disable: 4511) // copy constructor could not be generated -#pragma warning(disable: 4512) // assignment operator could not be generated -#pragma warning(disable: 4625) // copy constructor could not be generated because a base class copy constructor is inaccessible -#pragma warning(disable: 4626) // assignment operator could not be generated because a base class assignment operator is inaccessible -#pragma warning(disable: 4191) // unsafe conversion from 'functionptr1' to 'functionptr2' -#pragma warning(disable: 4702) // unreachable code - -#include -#include - -#ifndef SESSION_COOKIE_NAME - #define SESSION_COOKIE_NAME "SESSIONID" -#endif - -// override this if you want to use a different CLSID for SAX -#ifndef ATLS_SAXXMLREADER_CLSID - #define ATLS_SAXXMLREADER_CLSID __uuidof(SAXXMLReader) -#endif // ATLS_SAXXMLREADER_CLSID - - -// This function is used in CValidateObject to determine if an empty -// request parameter really should be empty. You can -// specialize this function in your own code such as -// the following specialization for type long: -// template <> -// inline bool IsNullByType(long type) throw() -// { -// return type == 0; -// } -// You should provide your own specialization for this -// function if the comparison of type==0 is not adequate -// to discover whether or not your type is 0. -template -inline bool IsNullByType(__in TComp type) throw() -{ - return type == 0; -} - - -#pragma pack(push,_ATL_PACKING) -namespace ATL { - -// Default file extension for server response files -#ifndef ATL_DEFAULT_STENCIL_EXTENSION - #define ATL_DEFAULT_STENCIL_EXTENSION ".srf" -#endif -extern __declspec(selectany) const char * const c_AtlSRFExtension = ATL_DEFAULT_STENCIL_EXTENSION; -extern __declspec(selectany) const TCHAR * const c_tAtlSRFExtension = _T(ATL_DEFAULT_STENCIL_EXTENSION); -#define ATLS_EXTENSION_LEN (sizeof(ATL_DEFAULT_STENCIL_EXTENSION)-2) - -// Default file extension for handler DLLs -#ifndef ATL_DEFAULT_DLL_EXTENSION - #define ATL_DEFAULT_DLL_EXTENSION ".dll" -#endif -extern __declspec(selectany) const char * const c_AtlDLLExtension = ATL_DEFAULT_DLL_EXTENSION; -extern __declspec(selectany) const TCHAR * const c_tAtlDLLExtension = _T(ATL_DEFAULT_DLL_EXTENSION); -#define ATLS_DLL_EXTENSION_LEN (sizeof(ATL_DEFAULT_DLL_EXTENSION)-2) - -// maximum handler name length -#ifndef ATL_MAX_HANDLER_NAME_LEN - #define ATL_MAX_HANDLER_NAME_LEN 64 -#endif - -#ifndef ATL_HANDLER_NAME_DEFAULT -#define ATL_HANDLER_NAME_DEFAULT "Default" -#endif // ATL_DEFAULT_HANDLER_NAME - - -// maximum timeout for async guard mutex -#ifndef ATLS_ASYNC_MUTEX_TIMEOUT - #define ATLS_ASYNC_MUTEX_TIMEOUT 10000 -#endif - -#if defined(_M_IA64) || defined (_M_AMD64) -#define ATLS_FUNCID_INITIALIZEHANDLERS "InitializeAtlHandlers" -#define ATLS_FUNCID_GETATLHANDLERBYNAME "GetAtlHandlerByName" -#define ATLS_FUNCID_UNINITIALIZEHANDLERS "UninitializeAtlHandlers" -#elif defined(_M_IX86) -#define ATLS_FUNCID_INITIALIZEHANDLERS "_InitializeAtlHandlers@8" -#define ATLS_FUNCID_GETATLHANDLERBYNAME "_GetAtlHandlerByName@12" -#define ATLS_FUNCID_UNINITIALIZEHANDLERS "_UninitializeAtlHandlers@0" -#else -#error Unknown Platform. -#endif - -#define ATL_MAX_COOKIE_LEN 2048 -#define ATL_MAX_COOKIE_ELEM 1024 - - -// Defines a small value used for comparing the equality of floating point numbers. -#ifndef ATL_EPSILON - #define ATL_EPSILON .0001 -#endif - -#ifndef ATL_DEFAULT_PRECISION - #define ATL_DEFAULT_PRECISION 6 -#endif - -// Call this function to URL-encode a buffer and have the result appended to a CString passed by reference. -// -// A space in the input string is encoded as a plus sign (+). -// Other unsafe characters (as determined by AtlIsUnsafeUrlChar) are encoded as escaped octets. -// An escaped octet is a percent sign (%) followed by two digits representing the hexadecimal code of the character. -// -// string A CStringA reference to which will be appended the encoded version of szBuf. -// -// szBuf The string to be URL-encoded. -ATL_NOINLINE inline bool EscapeToCString(__inout CStringA& string, __in LPCSTR szBuf) -{ - ATLENSURE( szBuf != NULL ); - - _ATLTRY - { - CHAR szEscaped[512]; - LPSTR pszStr = szEscaped; - DWORD dwLen = 0; - - while (*szBuf) - { - if (dwLen+4 >= _countof(szEscaped)) - { - *pszStr = '\0'; - string.Append(szEscaped, dwLen); - pszStr = szEscaped; - dwLen = 0; - } - if (AtlIsUnsafeUrlChar(*szBuf)) - { - if (*szBuf == ' ') - { - dwLen++; - *pszStr++ = '+'; - } - else - { - LPSTR pszTmp = pszStr; - *pszTmp++ = '%'; - unsigned char ch = (unsigned char)*szBuf; - if (ch < 16) - { - *pszTmp++ = '0'; - } - Checked::ultoa_s((unsigned char)ch, pszTmp, szEscaped + _countof(szEscaped) - pszTmp, 16); - pszStr+= sizeof("%FF")-1; - dwLen+= sizeof("%FF")-1; - } - } - else - { - *pszStr++ = *szBuf; - dwLen++; - } - szBuf++; - } - - *pszStr = '\0'; - string.Append(szEscaped, dwLen); - } - _ATLCATCHALL() - { - return false; - } - - return true; -} - -// UNICODE overload for EscapeToCString -// follow specifications detailed in RFC document on -// Internationalized Uniform Resource Identifiers (IURI) -inline bool EscapeToCString(__inout CStringA& string, __in_z LPCWSTR wszBuf) throw() -{ - _ATLTRY - { - // convert string to UTF8 - CFixedStringT strConvert; - - // get the required length for conversion - int nSrcLen = (int) wcslen(wszBuf); - int nLen = AtlUnicodeToUTF8(wszBuf, nSrcLen, NULL, 0); - if (!nLen) - { - return false; - } - - // allocate MBCS conversion string - LPSTR sz = strConvert.GetBuffer(nLen+1); - if (!sz) - { - return false; - } - - // do the UNICODE to UTF8 conversion - nLen = AtlUnicodeToUTF8(wszBuf, nSrcLen, sz, nLen); - if (!nLen) - { - return false; - } - - // null-terminate - sz[nLen] = '\0'; - - // delegate to ANSI version of EscapeToCString - if (!EscapeToCString(string, sz)) - { - return false; - } - - strConvert.ReleaseBuffer(nLen); - } - _ATLCATCHALL() - { - return false; - } - - return true; -} - -struct CDefaultErrorProvider -{ - struct HTTP_ERROR_TEXT - { - UINT uHttpError; // the Http Error value - UINT uHttpSubError; // Allows for customization of error text based on srf specific errors. - LPCSTR szHeader; // the string that should appear in the http response header - UINT uResId; // the resource id of the string to send back as the body - }; - - - // GetErrorText retrieves the http response header string - // and a resource id of the response body for a given - // http error code - // uError: Http error code to retrieve information for - // ppszHeader: pointer to LPCSTR that receives the response header string - // ppszHeader is optional - // puResId: pointer to UINT that receives the response body resource id - // puResId is optional - static BOOL GetErrorText(__in UINT uError, __in UINT uSubErr, __deref_out_opt LPCSTR *ppszHeader, __out_opt UINT *puResId) throw() - { - static const HTTP_ERROR_TEXT s_Errors[] = - { - { 200, SUBERR_NONE, "OK", 0 }, - { 201, SUBERR_NONE, "Created", 0 }, - { 202, SUBERR_NONE, "Accepted", 0 }, - { 203, SUBERR_NONE, "Non-Authoritative Information", 0 }, - { 204, SUBERR_NONE, "No Content", 0 }, - { 204, DBG_SUBERR_ALREADY_DEBUGGING, "Already being debugged by another user", 0}, - { 204, DBG_SUBERR_NOT_DEBUGGING, "Not currently debugging a process", 0}, - { 204, DBG_SUBERR_INVALID_SESSION, "Requested DebugSessionID does not match current DebugSessionID", 0}, - { 204, DBG_SUBERR_BAD_ID, "DebugSessionID corrupted or not provided", 0 }, - { 204, DBG_SUBERR_COCREATE, "Could not CoCreate the debugger", 0 }, - { 204, DBG_SUBERR_ATTACH, "Could not attach to process", 0 }, - { 205, SUBERR_NONE, "Reset Content", 0 }, - { 206, SUBERR_NONE, "Partial Content", 0 }, - { 300, SUBERR_NONE, "Multiple Choices", 0 }, - { 301, SUBERR_NONE, "Moved Permanently", 0 }, - { 302, SUBERR_NONE, "Found", 0 }, - { 303, SUBERR_NONE, "See Other", 0 }, - { 304, SUBERR_NONE, "Not Modified", 0 }, - { 305, SUBERR_NONE, "Use Proxy", 0 }, - { 306, SUBERR_NONE, "(Unused)", 0 }, - { 307, SUBERR_NONE, "Temporary Redirect", 0 }, - { 400, SUBERR_NONE, "Bad Request", IDS_ATLSRV_BAD_REQUEST }, - { 401, SUBERR_NONE, "Unauthorized", IDS_ATLSRV_AUTH_REQUIRED }, - { 402, SUBERR_NONE, "Payment Required", 0 }, - { 403, SUBERR_NONE, "Forbidden", IDS_ATLSRV_FORBIDDEN }, - { 404, SUBERR_NONE, "Not Found", IDS_ATLSRV_NOT_FOUND }, - { 405, SUBERR_NONE, "Method Not Allowed", 0 }, - { 406, SUBERR_NONE, "Not Acceptable", 0 }, - { 407, SUBERR_NONE, "Proxy Authentication Required", 0 }, - { 408, SUBERR_NONE, "Request Timeout", 0 }, - { 409, SUBERR_NONE, "Conflict", 0 }, - { 410, SUBERR_NONE, "Gone", 0 }, - { 411, SUBERR_NONE, "Length Required", 0 }, - { 412, SUBERR_NONE, "Precondition Failed", 0 }, - { 413, SUBERR_NONE, "Request Entity Too Long", 0 }, - { 414, SUBERR_NONE, "Request-URI Too Long", 0 }, - { 415, SUBERR_NONE, "Unsupported Media Type", 0 }, - { 416, SUBERR_NONE, "Requested Range Not Satisfiable", 0 }, - { 417, SUBERR_NONE, "Expectation Failed", 0 }, - { 500, SUBERR_NONE, "Internal Server Error", IDS_ATLSRV_SERVER_ERROR }, - { 500, ISE_SUBERR_BADSRF, "Internal Server Error", IDS_ATLSRV_SERVER_ERROR_BADSRF }, - { 500, ISE_SUBERR_HNDLFAIL, "Internal Server Error", IDS_ATLSRV_SERVER_ERROR_HNDLFAIL }, - { 500, ISE_SUBERR_SYSOBJFAIL, "Internal Server Error", IDS_ATLSRV_SERVER_ERROR_SYSOBJFAIL}, - { 500, ISE_SUBERR_READFILEFAIL, "Internal Server Error", IDS_ATLSRV_SERVER_ERROR_READFILEFAIL}, - { 500, ISE_SUBERR_LOADFILEFAIL, "Internal Server Error", IDS_ATLSRV_SERVER_ERROR_LOADFILEFAIL}, - { 500, ISE_SUBERR_LOADLIB, "Internal Server Error", IDS_ATLSRV_SERVER_ERROR_LOADLIB}, - { 500, ISE_SUBERR_HANDLERIF, "Internal Server Error", IDS_ATLSRV_SERVER_ERROR_HANDLERIF}, - { 500, ISE_SUBERR_OUTOFMEM, "Internal Server Error", IDS_ATLSRV_SERVER_ERROR_OUTOFMEM}, - { 500, ISE_SUBERR_UNEXPECTED, "Internal Server Error", IDS_ATLSRV_SERVER_ERROR_UNEXPECTED}, - { 500, ISE_SUBERR_STENCIL_PARSE_FAIL, "Internal Server Error", IDS_ATLSRV_SERVER_ERROR_STENCILPARSEFAIL}, - { 500, ISE_SUBERR_STENCIL_LOAD_FAIL, "Internal Server Error", IDS_ATLSRV_SERVER_ERROR_STENCILLOADFAIL}, - { 500, ISE_SUBERR_HANDLER_NOT_FOUND, "Internal Server Error", IDS_ATLSRV_SERVER_ERROR_HANDLERNOTFOUND}, - { 500, ISE_SUBERR_BAD_HANDLER_TAG, "Internal Server Error", IDS_ATLSRV_SERVER_ERROR_BADHANDLERTAG}, - { 500, ISE_SUBERR_LONGMETHODNAME, "Internal Server Error", IDS_ATLSRV_SERVER_ERROR_LONGMETHODNAME}, - { 500, ISE_SUBERR_LONGHANDLERNAME, "Internal Server Error", IDS_ATLSRV_SERVER_ERROR_LONGHANDLERNAME}, - { 500, ISE_SUBERR_NO_HANDLER_TAG, "Internal Server Error", IDS_ATLSRV_SERVER_ERROR_NOHANDLERTAG}, - { 500, ISE_SUBERR_IMPERSONATIONFAILED, "Internal Server Error", IDS_ATLSRV_SERVER_ERROR_IMPERSONATIONFAILED}, - { 500, ISE_SUBERR_ISAPISTARTUPFAILED, "Internal Server Error", IDS_ATLSRV_SERVER_ERROR_ISAPISTARTUPFAILED}, - { 500, ISE_SUBERR_SOAPNOSOAPACTION, "Internal Server Error", IDS_ATLSRV_SERVER_ERROR_SOAPNOSOAPACTION}, - - { 501, SUBERR_NONE, "Not Implemented", IDS_ATLSRV_NOT_IMPLEMENTED }, - { 502, SUBERR_NONE, "Bad Gateway", IDS_ATLSRV_BAD_GATEWAY }, - { 503, SUBERR_NONE, "Service Unavailable", IDS_ATLSRV_SERVICE_NOT_AVAILABLE }, - { 504, SUBERR_NONE, "Gateway Timeout", 0 }, - { 505, SUBERR_NONE, "HTTP Version Not Supported", 0 }, - }; - - // look for the error - for (int i=0; i -void GetStatusHeader(__inout CStringA &strStatus, __in DWORD dwStatus, __in DWORD dwSubStatus, __in HttpUserErrorTextProvider* pErrorProvider, __out_opt UINT *puResId = NULL) throw(...) -{ - ATLENSURE( pErrorProvider != NULL ); - - LPCSTR szHeadErr = NULL; - // First, we check for the error text in the extension's user error text provider - BOOL bRet = pErrorProvider->GetErrorText(dwStatus, dwSubStatus, &szHeadErr, puResId); - if (!bRet) - { - szHeadErr = ""; - } - - char szBuf[512]; - Checked::itoa_s(dwStatus, szBuf, _countof(szBuf), 10); - - // add the space after the 3 digit response code - szBuf[3] = ' '; - szBuf[4] = '\0'; - strStatus.SetString(szBuf, 4); - strStatus.Append(szHeadErr); -} - -template -void RenderError(__in IHttpServerContext *pServerContext, __in DWORD dwStatus, __in DWORD dwSubStatus, __in HttpUserErrorTextProvider* pErrorProvider) -{ - ATLENSURE( pServerContext != NULL ); - ATLENSURE( pErrorProvider != NULL ); - _ATLTRY - { - UINT uResId = 0; - - CFixedStringT strStatus; - GetStatusHeader(strStatus, dwStatus, dwSubStatus, pErrorProvider, &uResId); - pServerContext->SendResponseHeader(NULL, strStatus, FALSE); - - LPCSTR szBody = strStatus; - DWORD dwBodyLen = strStatus.GetLength(); - CFixedStringT strBody; - if (uResId) - { - // load the body string from a resource - if (strBody.LoadString(uResId)) - { - szBody = strBody; - dwBodyLen = strBody.GetLength(); - } - } - - pServerContext->WriteClient((void *) szBody, &dwBodyLen); - } - _ATLCATCHALL() - { - // last resort message when low on memory - LPCSTR szError; - BOOL bRes; - bRes = CDefaultErrorProvider::GetErrorText(dwStatus, dwSubStatus, &szError, 0); - if (!bRes) - bRes = CDefaultErrorProvider::GetErrorText(dwStatus, SUBERR_NONE, &szError, 0); - if (!bRes) - bRes = CDefaultErrorProvider::GetErrorText(500, SUBERR_NONE, &szError, 0); - if(!szError) - { - szError="Unknown Error"; // last resort, can't localize - } - DWORD dwBodyLen = (DWORD) strlen(szError); - pServerContext->WriteClient((void *) szError, &dwBodyLen); - } -} - -// Call this function to retrieve the full canonical physical path - // of a file relative to the current script. -// -// Returns TRUE on success, FALSE on error. -// -// szFile A file path relative to the current script directory for which -// you are trying to retrieve the full path. -// -// szFullFileName A caller-allocated buffer of at least MAX_PATH characters in length. -// On success, contains the the full canonical path of szFile. -// -// pServerContext The context for the current request. The context is used to obtain the -// current script directory. -inline BOOL GetScriptFullFileName( - __in LPCSTR szFile, - __in_ecount(MAX_PATH) LPSTR szFullFileName, - __in IHttpServerContext* pServerContext) throw(...) -{ - ATLENSURE( szFile != NULL ); - ATLASSERT( szFullFileName != NULL ); - ATLENSURE( pServerContext != NULL ); - - char szTmpScriptPath[MAX_PATH]; - LPCSTR szTmp = pServerContext->GetScriptPathTranslated(); - - if (!szTmp) - { - return FALSE; - } - - if (!SafeStringCopy(szTmpScriptPath, szTmp)) - { - // path is too long - return FALSE; - } - - CHAR *szScriptPath = szTmpScriptPath; - - LPSTR szBackslash; - if (*szFile != '\\') - { - szBackslash = strrchr(szScriptPath, '\\'); - - ATLASSERT( *(szScriptPath+strlen(szScriptPath)) != '\\'); - - if (szBackslash) - szBackslash++; - } - else - { - // handle case where szFile is of the form \directory\etc\etc - szBackslash = strchr(szScriptPath, '\\'); - } - - if (szBackslash) - *szBackslash = '\0'; - - int nScriptPathLen = (int)(szBackslash ? strlen(szScriptPath) : 0); - int nFileLen = (int) strlen(szFile); - int newLen = nScriptPathLen + nFileLen; - - if ((newLen < nScriptPathLen) || (newLen < nFileLen) || (newLen > MAX_PATH-1)) - { - return FALSE; - } - CHAR szTemp[MAX_PATH]; - if (nScriptPathLen) - { - Checked::memcpy_s(szTemp, MAX_PATH, szScriptPath, nScriptPathLen); - } - Checked::memcpy_s(szTemp + nScriptPathLen, MAX_PATH-nScriptPathLen, szFile, nFileLen); - *(szTemp + newLen) = 0; - - return PathCanonicalizeA(szFullFileName, szTemp); -} - -enum ATLSRV_STATE -{ - ATLSRV_STATE_BEGIN, // The request has just arrived, and the type has not been determined - ATLSRV_STATE_CONTINUE, // The request is a continuation of an async request - ATLSRV_STATE_DONE, // The request is a continuation of an async request, but the server is done with it - ATLSRV_STATE_CACHE_DONE // The request is the callback of a cached page -}; - -enum ATLSRV_REQUESTTYPE -{ - ATLSRV_REQUEST_UNKNOWN=-1, // The request type isn't known yet - ATLSRV_REQUEST_STENCIL, // The request is for a .srf file - ATLSRV_REQUEST_DLL // The request is for a .dll file -}; - -// Flags the InitRequest can return in dwStatus -#define ATLSRV_INIT_USECACHE 1 -#define ATLSRV_INIT_USEASYNC 2 -#define ATLSRV_INIT_USEASYNC_EX 4 // required for use of NOFLUSH status - -typedef HTTP_CODE (IRequestHandler::*PFnHandleRequest)(AtlServerRequest *pRequestInfo, IServiceProvider *pProvider); -typedef void (*PFnAsyncComplete)(AtlServerRequest *pRequestInfo, DWORD cbIO, DWORD dwError); - -struct AtlServerRequest -{ - DWORD cbSize; // For future compatibility - IHttpServerContext *pServerContext; // Necessary because it wraps the ECB - ATLSRV_REQUESTTYPE dwRequestType; // See the ATLSRV variables above - // Indicates whether it was called through an .srf file or through a .dll file - ATLSRV_STATE dwRequestState; // See the ATLSRV variables above - // Indicates what state of completion the request is in - IRequestHandler *pHandler; // Necessary because the callback (for async calls) must know where to - // route the request - HINSTANCE hInstDll; // Necessary in order to release the dll properly (for async calls) - IIsapiExtension *pExtension; // Necessary to requeue the request (for async calls) - IDllCache* pDllCache; // Necessary to release the dll in async callback - - HANDLE hFile; - HCACHEITEM hEntry; - IFileCache* pFileCache; - - HANDLE m_hMutex; // necessary to syncronize calls to HandleRequest - // if HandleRequest could potientially make an - // async call before returning. only used - // if indicated with ATLSRV_INIT_USEASYNC_EX - - DWORD dwStartTicks; // Tick count when the request was received - EXTENSION_CONTROL_BLOCK *pECB; - PFnHandleRequest pfnHandleRequest; - PFnAsyncComplete pfnAsyncComplete; - LPCSTR pszBuffer; // buffer to be flushed asyncronously - DWORD dwBufferLen; // length of data in pszBuffer - void* pUserData; // value that can be used to pass user data between parent and child handlers -}; - -inline void _ReleaseAtlServerRequest(__inout AtlServerRequest* pRequest) -{ - ATLENSURE(pRequest!=NULL); - if (pRequest->pHandler) - pRequest->pHandler->Release(); - if (pRequest->pServerContext) - pRequest->pServerContext->Release(); - if (pRequest->pDllCache && pRequest->hInstDll) - pRequest->pDllCache->ReleaseModule(pRequest->hInstDll); - if (pRequest->m_hMutex) - CloseHandle(pRequest->m_hMutex); -} - -typedef BOOL (__stdcall *GETATLHANDLERBYNAME)(LPCSTR szHandlerName, IIsapiExtension *pExtension, IUnknown **ppHandler); -typedef BOOL (__stdcall *INITIALIZEATLHANDLERS)(IHttpServerContext*, IIsapiExtension*); -typedef void (__stdcall *UNINITIALIZEATLHANDLERS)(); - -// initial size of thread worker heap (per thread) -// The heap is growable. The default initial is 16KB -#ifndef ATLS_WORKER_HEAP_SIZE -#define ATLS_WORKER_HEAP_SIZE 16384 -#endif - -class CIsapiWorker -{ -public: - typedef AtlServerRequest* RequestType; - HANDLE m_hHeap; -#ifndef ATL_NO_SOAP - CComPtr m_spReader; -#endif - - CIsapiWorker() throw() - { - m_hHeap = NULL; - } - - virtual ~CIsapiWorker() throw() - { - ATLASSUME(m_hHeap == NULL); - } - - virtual BOOL Initialize(__inout __crt_typefix(IIsapiExtension*) void *pvParam) - { - IIsapiExtension* pExtension = (IIsapiExtension*) pvParam; - ATLENSURE(pExtension); - if (!(pExtension->OnThreadAttach())) - return FALSE; - - m_hHeap = HeapCreate(HEAP_NO_SERIALIZE, ATLS_WORKER_HEAP_SIZE, 0); - if (!m_hHeap) - return FALSE; -#ifndef ATL_NO_SOAP - if (FAILED(m_spReader.CoCreateInstance(ATLS_SAXXMLREADER_CLSID, NULL, CLSCTX_INPROC_SERVER ))) - { - ATLASSERT( FALSE ); - ATLTRACE( atlTraceISAPI, 0, _T("MSXML3 is not installed -- web services will not work.") ); - } -#endif - return pExtension->SetThreadWorker(this); - } - - virtual void Terminate(__inout_opt __crt_typefix(IIsapiExtension*) void* pvParam) throw() - { - if (m_hHeap) - { - if (HeapDestroy(m_hHeap)) - m_hHeap = NULL; - else - { - ATLASSERT(FALSE); - } - } - -#ifndef ATL_NO_SOAP - m_spReader.Release(); -#endif - if (pvParam != NULL) - (static_cast(pvParam))->OnThreadTerminate(); - } - - void Execute(__inout AtlServerRequest *pRequestInfo, __inout __crt_typefix(IIsapiExtension*) void *pvParam, __reserved OVERLAPPED *pOverlapped) - { - ATLENSURE(pRequestInfo != NULL); - ATLENSURE(pvParam != NULL); - (pOverlapped); // unused - ATLASSUME(m_hHeap != NULL); - // any exceptions thrown at this point should have been caught in an - // override of DispatchStencilCall. They will not be thrown out of this - // function. - _ATLTRY - { - (static_cast(pvParam))->DispatchStencilCall(pRequestInfo); - } - _ATLCATCHALL() - { - ATLTRACE(_T("Warning. An uncaught exception was thrown from DispatchStencilCall\n")); - ATLASSERT(FALSE); - } - } - - virtual BOOL GetWorkerData(DWORD /*dwParam*/, void ** /*ppvData*/) throw() - { - return FALSE; - } -}; - -inline void _AtlGetScriptPathTranslated( - __in LPCSTR szPathTranslated, - __inout CFixedStringT& strScriptPathTranslated) -{ - ATLENSURE(szPathTranslated!=NULL); - LPCSTR szEnd = szPathTranslated; - - while (TRUE) - { - while (*szEnd != '.' && *szEnd != '\0') - szEnd++; - if (*szEnd == '\0') - break; - - szEnd++; - - size_t nLen(0); - if (!AsciiStrnicmp(szEnd, c_AtlDLLExtension+1, ATLS_DLL_EXTENSION_LEN)) - nLen = ATLS_DLL_EXTENSION_LEN; - else if (!AsciiStrnicmp(szEnd, c_AtlSRFExtension+1, ATLS_EXTENSION_LEN)) - nLen = ATLS_EXTENSION_LEN; - - if (nLen) - { - szEnd += nLen; - if (!*szEnd || *szEnd == '/' || *szEnd == '\\' || *szEnd == '?' || *szEnd == '#') - break; - } - } - - DWORD dwResult = (DWORD)(szEnd - szPathTranslated); - char *szScriptPathTranslated = NULL; - ATLTRY(szScriptPathTranslated = strScriptPathTranslated.GetBuffer(dwResult)); - if (szScriptPathTranslated) - { - Checked::memcpy_s(szScriptPathTranslated, dwResult, szPathTranslated, dwResult); - szScriptPathTranslated[dwResult] = '\0'; - strScriptPathTranslated.ReleaseBuffer(dwResult); - } -} - - -struct CStencilState -{ - CStencilState() throw() - { - dwIndex = 0; - locale = CP_ACP; - pIncludeInfo = NULL; - pParentInfo = NULL; - } - - DWORD dwIndex; - LCID locale; - AtlServerRequest* pIncludeInfo; - AtlServerRequest* pParentInfo; -}; - -class CWrappedServerContext: - public IHttpServerContext -{ -public: - CComPtr m_spParent; - - CWrappedServerContext() throw() - { - } - - virtual ~CWrappedServerContext() throw() - { - } - - CWrappedServerContext(__in IHttpServerContext *pParent) throw() - { - m_spParent = pParent; - } - - LPCSTR GetRequestMethod() - { - ATLENSURE(m_spParent); - return m_spParent->GetRequestMethod(); - } - - LPCSTR GetQueryString() - { - ATLENSURE(m_spParent); - return m_spParent->GetQueryString(); - } - - LPCSTR GetPathInfo() - { - ATLENSURE(m_spParent); - return m_spParent->GetPathInfo(); - } - - LPCSTR GetScriptPathTranslated() - { - ATLENSURE(m_spParent); - return m_spParent->GetScriptPathTranslated(); - } - - LPCSTR GetPathTranslated() - { - ATLENSURE(m_spParent); - return m_spParent->GetPathTranslated(); - } - - DWORD GetTotalBytes() - { - ATLENSURE(m_spParent); - return m_spParent->GetTotalBytes(); - } - - DWORD GetAvailableBytes() - { - ATLENSURE(m_spParent); - return m_spParent->GetAvailableBytes(); - } - - BYTE *GetAvailableData() - { - ATLENSURE(m_spParent); - return m_spParent->GetAvailableData(); - } - - LPCSTR GetContentType() - { - ATLENSURE(m_spParent); - return m_spParent->GetContentType(); - } - - __checkReturn BOOL GetServerVariable(__in_z LPCSTR pszVariableName, __out_ecount_part(*pdwSize,*pdwSize) LPSTR pvBuffer, __inout DWORD *pdwSize) - { - ATLENSURE(m_spParent); - return m_spParent->GetServerVariable(pszVariableName, pvBuffer, pdwSize); - } - - __checkReturn BOOL WriteClient(__in_bcount(*pdwBytes) void *pvBuffer, __inout DWORD *pdwBytes) - { - ATLENSURE(m_spParent); - return m_spParent->WriteClient(pvBuffer, pdwBytes); - } - - __checkReturn BOOL AsyncWriteClient(__in_bcount(*pdwBytes) void * pvBuffer, __inout DWORD * pdwBytes) - { - ATLENSURE(m_spParent); - return m_spParent->AsyncWriteClient(pvBuffer, pdwBytes); - } - - __checkReturn BOOL ReadClient(__out_bcount_part(*pdwSize,*pdwSize) void * pvBuffer, __inout DWORD * pdwSize) - { - ATLENSURE(m_spParent); - return m_spParent->ReadClient(pvBuffer, pdwSize); - } - - __checkReturn BOOL AsyncReadClient(__out_bcount_part(*pdwSize,*pdwSize) void * pvBuffer, __inout DWORD * pdwSize) - { - ATLENSURE(m_spParent); - return m_spParent->AsyncReadClient(pvBuffer, pdwSize); - } - - __checkReturn BOOL SendRedirectResponse(__in LPCSTR pszRedirectUrl) - { - ATLENSURE(m_spParent); - return m_spParent->SendRedirectResponse(pszRedirectUrl); - } - - __checkReturn BOOL GetImpersonationToken(__out HANDLE * pToken) - { - ATLENSURE(m_spParent); - return m_spParent->GetImpersonationToken(pToken); - } - - __checkReturn BOOL SendResponseHeader(__in LPCSTR pszHeader, __in LPCSTR pszStatusCode, __in BOOL fKeepConn) - { - ATLENSURE(m_spParent); - return m_spParent->SendResponseHeader(pszHeader, pszStatusCode, fKeepConn); - } - - __checkReturn BOOL DoneWithSession(__in DWORD dwHttpStatusCode) - { - ATLENSURE(m_spParent); - return m_spParent->DoneWithSession(dwHttpStatusCode); - } - - __checkReturn BOOL RequestIOCompletion(__in PFN_HSE_IO_COMPLETION pfn, DWORD * pdwContext) - { - ATLENSURE(m_spParent); - return m_spParent->RequestIOCompletion(pfn, pdwContext); - } - - BOOL TransmitFile(__in HANDLE hFile, __in_opt PFN_HSE_IO_COMPLETION pfn, void * pContext, - __in LPCSTR szStatusCode, __in DWORD dwBytesToWrite, __in DWORD dwOffset, __in_bcount_opt(dwHeadLen) void * pvHead, - __in DWORD dwHeadLen, __in_bcount_opt(dwTailLen) void * pvTail, __in DWORD dwTailLen, __in DWORD dwFlags) - { - ATLENSURE(m_spParent); - return m_spParent->TransmitFile(hFile, pfn, pContext, szStatusCode, - dwBytesToWrite, dwOffset, pvHead, dwHeadLen, pvTail, dwTailLen, - dwFlags); - } - - BOOL AppendToLog(__in LPCSTR szMessage, __in_opt DWORD* pdwLen) - { - ATLENSURE(m_spParent); - return m_spParent->AppendToLog(szMessage, pdwLen); - } - - BOOL MapUrlToPathEx(__in_bcount(dwLen) LPCSTR szLogicalPath, __in DWORD dwLen, __out HSE_URL_MAPEX_INFO *pumInfo) - { - ATLENSURE(m_spParent); - return m_spParent->MapUrlToPathEx(szLogicalPath, dwLen, pumInfo); - } -}; // class CWrappedServerContext - -// Wraps the EXTENSION_CONTROL_BLOCK structure used by IIS to provide -// an ISAPI extension with information about the current request and -// access to the web server's functionality. -class CServerContext : - public CComObjectRootEx, - public IHttpServerContext -{ -public: - BEGIN_COM_MAP(CServerContext) - COM_INTERFACE_ENTRY(IHttpServerContext) - END_COM_MAP() - - CServerContext() throw() - { - m_pECB = NULL; - m_bHeadersHaveBeenSent = false; - } - virtual ~CServerContext() throw() - { - } - - void Initialize(__in EXTENSION_CONTROL_BLOCK *pECB) - { - ATLENSURE(pECB); - m_pECB = pECB; - - // Initialize the translated script path - _AtlGetScriptPathTranslated(GetPathTranslated(), m_strScriptPathTranslated); - } - - // Returns a nul-terminated string that contains the HTTP method of the current request. - // Examples of common HTTP methods include "GET" and "POST". - // Equivalent to the REQUEST_METHOD server variable or EXTENSION_CONTROL_BLOCK::lpszMethod. - LPCSTR GetRequestMethod() - { - ATLENSURE(m_pECB); - return m_pECB->lpszMethod; - } - - // Returns a nul-terminated string that contains the query information. - // This is the part of the URL that appears after the question mark (?). - // Equivalent to the QUERY_STRING server variable or EXTENSION_CONTROL_BLOCK::lpszQueryString. - LPCSTR GetQueryString() - { - ATLENSURE(m_pECB); - return m_pECB->lpszQueryString; - } - - // Returns a nul-terminated string that contains the path of the current request. - // This is the part of the URL that appears after the server name, but before the query string. - // Equivalent to the PATH_INFO server variable or EXTENSION_CONTROL_BLOCK::lpszPathInfo. - LPCSTR GetPathInfo() - { - ATLENSURE(m_pECB); - return m_pECB->lpszPathInfo; - } - - // Call this function to retrieve a nul-terminated string containing the physical path of the script. - // - // Returns TRUE on success, and FALSE on failure. Call GetLastError to get extended error information. - // - // On entry, pdwSize should point to a DWORD that indicates the size of the buffer in bytes. - // On exit, the DWORD contains the number of bytes transferred or available to be transferred into the - // buffer (including the nul-terminating byte). - // The script path is the same as GetPathTranslated up to the first .srf or .dll. - // For example, if GetPathTranslated returns "c:\inetpub\vcisapi\hello.srf\goodmorning", - // then this function returns "c:\inetpub\vcisapi\hello.srf". - LPCSTR GetScriptPathTranslated() - { - ATLASSUME(m_pECB); - return m_strScriptPathTranslated; - } - - - // Returns a nul-terminated string that contains the translated path of the requested resource. - // This is the path of the resource on the local server. - // Equivalent to the PATH_TRANSLATED server variable or EXTENSION_CONTROL_BLOCK::lpszPathTranslated. - LPCSTR GetPathTranslated() - { - ATLENSURE(m_pECB); - return m_pECB->lpszPathTranslated; - } - - // Returns the total number of bytes to be received from the client. - // If this value is 0xffffffff, then there are four gigabytes or more of available data. - // In this case, ReadClient or AsyncReadClient should be called until no more data is returned. - // Equivalent to the CONTENT_LENGTH server variable or EXTENSION_CONTROL_BLOCK::cbTotalBytes. - DWORD GetTotalBytes() - { - ATLENSURE(m_pECB); - return m_pECB->cbTotalBytes; - } - - // Returns the number of bytes available in the request buffer accessible via GetAvailableData. - // If GetAvailableBytes returns the same value as GetTotalBytes, the request buffer contains the whole request. - // Otherwise, the remaining data should be read from the client using ReadClient or AsyncReadClient. - // Equivalent to EXTENSION_CONTROL_BLOCK::cbAvailable. - DWORD GetAvailableBytes() - { - ATLENSURE(m_pECB); - return m_pECB->cbAvailable; - } - - // Returns a pointer to the request buffer containing the data sent by the client. - // The size of the buffer can be determined by calling GetAvailableBytes. - // Equivalent to EXTENSION_CONTROL_BLOCK::lpbData - BYTE *GetAvailableData() - { - ATLENSURE(m_pECB); - return m_pECB->lpbData; - } - - // Returns a nul-terminated string that contains the content type of the data sent by the client. - // Equivalent to the CONTENT_TYPE server variable or EXTENSION_CONTROL_BLOCK::lpszContentType. - LPCSTR GetContentType() - { - ATLENSURE(m_pECB); - return m_pECB->lpszContentType; - } - - // Call this function to retrieve a nul-terminated string containing the value of the requested server variable. - // Returns TRUE on success, and FALSE on failure. Call GetLastError to get extended error information. - // On entry, pdwSize should point to a DWORD that indicates the size of the buffer in bytes. - // On exit, the DWORD contains the number of bytes transferred or available to be transferred into the buffer (including the nul-terminating byte). - // Equivalent to EXTENSION_CONTROL_BLOCK::GetServerVariable. - __checkReturn BOOL GetServerVariable( - __in LPCSTR pszVariableName, - __out_ecount_part(*pdwSize,*pdwSize) LPSTR pvBuffer, - __inout DWORD *pdwSize) - { - ATLENSURE(m_pECB); - ATLASSERT(pszVariableName); - ATLASSERT(pdwSize); - - if (pszVariableName && pdwSize) - { - return m_pECB->GetServerVariable(m_pECB->ConnID, (LPSTR) pszVariableName, - pvBuffer, pdwSize); - } - return FALSE; - } - - // Synchronously sends the data present in the given buffer to the client that made the request. - // Returns TRUE on success, and FALSE on failure. Call GetLastError to get extended error information. - // Equivalent to EXTENSION_CONTROL_BLOCK::WriteClient(..., HSE_IO_SYNC). - __checkReturn BOOL WriteClient(__in_bcount(*pdwBytes) void *pvBuffer, __inout DWORD *pdwBytes) - { - ATLENSURE(m_pECB); - ATLASSERT(pvBuffer); - ATLASSERT(pdwBytes); - - if (pvBuffer && pdwBytes) - { - return m_pECB->WriteClient(m_pECB->ConnID, pvBuffer, pdwBytes, HSE_IO_SYNC | HSE_IO_NODELAY); - } - return FALSE; - } - - // Asynchronously sends the data present in the given buffer to the client that made the request. - // Returns TRUE on success, and FALSE on failure. Call GetLastError to get extended error information. - // Equivalent to EXTENSION_CONTROL_BLOCK::WriteClient(..., HSE_IO_ASYNC). - __checkReturn BOOL AsyncWriteClient(__in_bcount(*pdwBytes) void *pvBuffer, __inout DWORD *pdwBytes) - { - ATLENSURE(m_pECB); - ATLASSERT(pvBuffer); - ATLASSERT(pdwBytes); - - if (pvBuffer && pdwBytes) - { - return m_pECB->WriteClient(m_pECB->ConnID, pvBuffer, pdwBytes, HSE_IO_ASYNC | HSE_IO_NODELAY); - } - return FALSE; - } - - // Call this function to synchronously read information from the body of the web client's HTTP request into the buffer supplied by the caller. - // Returns TRUE on success, and FALSE on failure. Call GetLastError to get extended error information. - // Equivalent to EXTENSION_CONTROL_BLOCK::ReadClient. - __checkReturn BOOL ReadClient(__out_ecount_part(*pdwSize,*pdwSize) void *pvBuffer, __inout DWORD *pdwSize) - { - ATLENSURE(m_pECB); - ATLASSERT(pvBuffer); - ATLASSERT(pdwSize); - - if (pvBuffer && pdwSize) - { - return m_pECB->ReadClient(m_pECB->ConnID, pvBuffer, pdwSize); - } - return FALSE; - } - - // Call this function to asynchronously read information from the body of the web client's HTTP request into the buffer supplied by the caller. - // Returns TRUE on success, and FALSE on failure. Call GetLastError to get extended error information. - // Equivalent to the HSE_REQ_ASYNC_READ_CLIENT server support function. - __checkReturn BOOL AsyncReadClient(__out_bcount_part(*pdwSize,*pdwSize) void *pvBuffer, __inout DWORD *pdwSize) - { - // To call this function successfully someone has to have already - // called RequestIOCompletion specifying the callback function - // to be used for IO completion. - ATLENSURE(m_pECB); - ATLASSERT(pvBuffer); - ATLASSERT(pdwSize); - - if (pvBuffer && pdwSize) - { - DWORD dwFlag = HSE_IO_ASYNC; - return m_pECB->ServerSupportFunction(m_pECB->ConnID, - HSE_REQ_ASYNC_READ_CLIENT, pvBuffer, pdwSize, - &dwFlag); - } - return FALSE; - } - - // Call this function to redirect the client to the specified URL. - // The client receives a 302 (Found) HTTP status code. - // Returns TRUE on success, and FALSE on failure. - // Equivalent to the HSE_REQ_SEND_URL_REDIRECT_RESP server support function. - __checkReturn BOOL SendRedirectResponse(__in LPCSTR pszRedirectUrl) - { - ATLENSURE(m_pECB); - ATLENSURE(pszRedirectUrl); - - if (pszRedirectUrl) - { - DWORD dwSize = (DWORD) strlen(pszRedirectUrl); - return m_pECB->ServerSupportFunction(m_pECB->ConnID, - HSE_REQ_SEND_URL_REDIRECT_RESP, - (void *) pszRedirectUrl, &dwSize, NULL); - } - return FALSE; - } - - // Call this function to retrieve a handle to the impersonation token for this request. - // An impersonation token represents a user context. You can use the handle in calls to ImpersonateLoggedOnUser or SetThreadToken. - // Do not call CloseHandle on the handle. - // Returns TRUE on success, and FALSE on failure. - // Equivalent to the HSE_REQ_GET_IMPERSONATION_TOKEN server support function. - __checkReturn BOOL GetImpersonationToken(__out HANDLE * pToken) - { - ATLENSURE(m_pECB); - if (pToken) - { - return m_pECB->ServerSupportFunction(m_pECB->ConnID, - HSE_REQ_GET_IMPERSONATION_TOKEN, pToken, - NULL, NULL); - } - return FALSE; - } - - // Call this function to send an HTTP response header to the client including the HTTP status, server version, message time, and MIME version. - // Returns TRUE on success, and FALSE on failure. - // Equivalent to the HSE_REQ_SEND_RESPONSE_HEADER_EX server support function. - __checkReturn BOOL SendResponseHeader( - __in LPCSTR pszHeader = "Content-Type: text/html\r\n\r\n", - __in LPCSTR pszStatusCode = "200 OK", - __in BOOL fKeepConn=FALSE) - { - ATLENSURE(m_pECB); - - if (m_bHeadersHaveBeenSent) - return TRUE; - - HSE_SEND_HEADER_EX_INFO hex; - hex.pszStatus = pszStatusCode; - hex.pszHeader = pszHeader; - hex.cchStatus = (DWORD)(pszStatusCode ? strlen(pszStatusCode) : 0); - hex.cchHeader = (DWORD)(pszHeader ? strlen(pszHeader) : 0); - hex.fKeepConn = fKeepConn; - - m_bHeadersHaveBeenSent = true; - - return m_pECB->ServerSupportFunction(m_pECB->ConnID, - HSE_REQ_SEND_RESPONSE_HEADER_EX, - &hex, NULL, NULL); - } - - // Call this function to terminate the session for the current request. - // Returns TRUE on success, and FALSE on failure. - // Equivalent to the HSE_REQ_DONE_WITH_SESSION server support function. - __checkReturn BOOL DoneWithSession(__in DWORD dwHttpStatusCode) - { - ATLENSURE(m_pECB); - - m_pECB->dwHttpStatusCode = dwHttpStatusCode; - - DWORD dwStatusCode = (dwHttpStatusCode >= 400) ? HSE_STATUS_ERROR : HSE_STATUS_SUCCESS; - - return m_pECB->ServerSupportFunction(m_pECB->ConnID, - HSE_REQ_DONE_WITH_SESSION, &dwStatusCode, NULL, NULL); - } - - // Call this function to set a special callback function that will be used for handling the completion of asynchronous I/O operations. - // Returns TRUE on success, and FALSE on failure. - // Equivalent to the HSE_REQ_IO_COMPLETION server support function. - __checkReturn BOOL RequestIOCompletion(__in PFN_HSE_IO_COMPLETION pfn, DWORD *pdwContext) - { - ATLENSURE(m_pECB); - ATLASSERT(pfn); - - if (pfn) - { - return m_pECB->ServerSupportFunction(m_pECB->ConnID, - HSE_REQ_IO_COMPLETION, pfn, NULL, pdwContext); - } - return FALSE; - } - - // Call this function to transmit a file asynchronously to the client. - // Returns TRUE on success, and FALSE on failure. - // Equivalent to the HSE_REQ_TRANSMIT_FILE server support function. - BOOL TransmitFile( - __in HANDLE hFile, - __in_opt PFN_HSE_IO_COMPLETION pfn, - void *pContext, - __in LPCSTR szStatusCode, - __in DWORD dwBytesToWrite, - __in DWORD dwOffset, - __in_bcount_opt(dwHeadLen) void *pvHead, - __in DWORD dwHeadLen, - __in_bcount_opt(dwTailLen) void *pvTail, - __in DWORD dwTailLen, - __in DWORD dwFlags) - { - ATLENSURE(m_pECB); - - HSE_TF_INFO tf; - tf.hFile = hFile; - tf.BytesToWrite = dwBytesToWrite; - tf.Offset = dwOffset; - tf.pContext = pContext; - tf.pfnHseIO = pfn; - tf.pHead = pvHead; - tf.HeadLength = dwHeadLen; - tf.pTail = pvTail; - tf.TailLength = dwTailLen; - tf.pszStatusCode = szStatusCode; - tf.dwFlags = dwFlags; - return m_pECB->ServerSupportFunction(m_pECB->ConnID, - HSE_REQ_TRANSMIT_FILE, &tf, NULL, NULL); - } - - // Appends the string szMessage to the web server log for the current - // request. - // Returns TRUE on success, FALSE on failure. - // Equivalent to the HSE_APPEND_LOG_PARAMETER server support function. - BOOL AppendToLog(__in LPCSTR szMessage, __in_opt DWORD *pdwLen) - { - DWORD dwLen = 0; - if (!pdwLen) - { - if(!szMessage) - { - return FALSE; - } - dwLen = (DWORD)strlen(szMessage); - } - else - { - dwLen = *pdwLen; - } - - return m_pECB->ServerSupportFunction(m_pECB->ConnID, - HSE_APPEND_LOG_PARAMETER, (void *)szMessage, - &dwLen, NULL); - } - - // Maps a logical Url Path to a physical path - // Returns TRUE on success, FALSE on failure. - // Equivalent to the HSE_REQ_MAP_URL_TO_PATH_EX server support function. - // you can pass 0 for dwLen if szLogicalPath is null terminated - BOOL MapUrlToPathEx(__in_bcount(dwLen) LPCSTR szLogicalPath, __in DWORD dwLen, __out HSE_URL_MAPEX_INFO *pumInfo) - { - ATLENSURE(m_pECB!=NULL); - if (dwLen == 0) - dwLen = (DWORD) strlen(szLogicalPath); - return m_pECB->ServerSupportFunction(m_pECB->ConnID, HSE_REQ_MAP_URL_TO_PATH_EX, (void *) szLogicalPath, - &dwLen, (DWORD *) pumInfo); - } - -protected: - // The pointer to the extension control block provided by IIS. - EXTENSION_CONTROL_BLOCK *m_pECB; - bool m_bHeadersHaveBeenSent; - - // The translated script path - CFixedStringT m_strScriptPathTranslated; - -}; // class CServerContext - -class CPageCachePeer -{ -public: - - struct PeerInfo - { - CStringA strHeader; - CStringA strStatus; - }; - - static BOOL Add(__inout PeerInfo * pDest, __in PeerInfo * pSrc) throw() - { - _ATLTRY - { - PeerInfo *pIn = (PeerInfo *)pSrc; - pDest->strHeader = pIn->strHeader; - pDest->strStatus = pIn->strStatus; - return TRUE; - } - _ATLCATCHALL() - { - return FALSE; - } - } - - static BOOL Remove(const PeerInfo * /*pDest*/) throw() - { - return TRUE; - } -}; - - -class CCacheServerContext : - public CComObjectRootEx, - public CWrappedServerContext, - public IPageCacheControl -{ -private: - - CAtlTemporaryFile m_cacheFile; - CComPtr m_spCache; - char m_szFullUrl[ATL_URL_MAX_URL_LENGTH + 1]; - FILETIME m_ftExpiration; - BOOL m_bIsCached; - CPageCachePeer::PeerInfo m_Headers; - -public: - - BEGIN_COM_MAP(CCacheServerContext) - COM_INTERFACE_ENTRY(IHttpServerContext) - COM_INTERFACE_ENTRY(IPageCacheControl) - END_COM_MAP() - - CCacheServerContext() throw() - { - } - virtual ~CCacheServerContext() throw() - { - } - - BOOL Initialize(__in IHttpServerContext *pParent, __in IFileCache *pCache) throw() - { - ATLASSERT(pParent); - ATLASSERT(pCache); - - if (pParent == NULL || pCache == NULL) - return FALSE; - - m_spParent = pParent; - m_spCache = pCache; - - if (FAILED(m_cacheFile.Create())) - return FALSE; - - LPCSTR szPathInfo = pParent->GetPathInfo(); - LPCSTR szQueryString = pParent->GetQueryString(); - if ( szPathInfo == NULL || szQueryString == NULL) - return FALSE; - - LPSTR szTo = m_szFullUrl; - int nSize = 0; - while (*szPathInfo && nSize < ATL_URL_MAX_URL_LENGTH) - { - *szTo++ = *szPathInfo++; - nSize++; - } - if (nSize >= ATL_URL_MAX_URL_LENGTH) - { - return FALSE; - } - *szTo++ = '?'; - nSize++; - while (*szQueryString && nSize < ATL_URL_MAX_URL_LENGTH) - { - *szTo++ = *szQueryString++; - nSize++; - } - if (nSize >= ATL_URL_MAX_URL_LENGTH) - { - return FALSE; - } - *szTo = '\0'; - - memset(&m_ftExpiration, 0x00, sizeof(FILETIME)); - m_bIsCached = TRUE; - - return TRUE; - } - - // IPageCacheControl methods - HRESULT GetExpiration(__out FILETIME *pftExpiration) throw() - { - ATLASSERT(pftExpiration); - if (!pftExpiration) - return E_INVALIDARG; - - *pftExpiration = m_ftExpiration; - - return S_OK; - } - - HRESULT SetExpiration(__in FILETIME ftExpiration) throw() - { - m_ftExpiration = ftExpiration; - - return S_OK; - } - - __checkReturn BOOL IsCached() throw() - { - return m_bIsCached; - } - - BOOL Cache(__in BOOL bCache) throw() - { - BOOL bRet = m_bIsCached; - m_bIsCached = bCache; - return bRet; - } - - __checkReturn BOOL WriteClient(__in_bcount(*pdwBytes) void *pvBuffer, __inout DWORD *pdwBytes) - { - ATLENSURE(pvBuffer); - ATLENSURE(pdwBytes); - - if (S_OK != m_cacheFile.Write(pvBuffer, *pdwBytes)) - return FALSE; - ATLENSURE(m_spParent); - return m_spParent->WriteClient(pvBuffer, pdwBytes); - } - - __checkReturn BOOL DoneWithSession(__in DWORD dwHttpStatusCode) - { - ATLENSURE(m_spParent); - - _ATLTRY - { - if (m_bIsCached) - { - CT2CA strFileName(m_cacheFile.TempFileName()); - m_cacheFile.HandsOff(); - m_spCache->AddFile(m_szFullUrl, strFileName, &m_ftExpiration, &m_Headers, NULL); - } - else - m_cacheFile.Close(); - } - _ATLCATCHALL() - { - m_cacheFile.Close(); - } - - return m_spParent->DoneWithSession(dwHttpStatusCode); - } - - __checkReturn BOOL GetImpersonationToken(__out HANDLE * pToken) - { - ATLTRACE(atlTraceISAPI, 0, _T("Getting impersonation token for cached page") - _T(" -- Caching a page that requires special privileges to build is a possible security problem. ") - _T("Future hits may get a cached page without going through the security checks done during the page creation process")); - ATLENSURE(m_spParent); - ATLASSERT(pToken); - return m_spParent->GetImpersonationToken(pToken); - } - - __checkReturn BOOL AppendToLog(__in LPCSTR szMessage, __in_opt DWORD* pdwLen) - { - ATLTRACE(atlTraceISAPI, 0, _T("Logging on cached page -- future hits will not log")); - ATLENSURE(m_spParent); - return m_spParent->AppendToLog(szMessage, pdwLen); - } - - __checkReturn BOOL SendResponseHeader( - __in LPCSTR pszHeader = "Content-Type: text/html\r\n\r\n", - __in LPCSTR pszStatusCode = "200 OK", - __in BOOL fKeepConn=FALSE) - { - ATLENSURE(m_spParent); - - m_Headers.strHeader = pszHeader; - m_Headers.strStatus = pszStatusCode; - - return m_spParent->SendResponseHeader(pszHeader, pszStatusCode, fKeepConn); - } - - // The methods below this point are actions that should not be performed on cached - // pages, as they will not behave correctly. - __checkReturn BOOL AsyncWriteClient(void * /*pvBuffer*/, DWORD * /*pdwBytes*/) - { - // Asynchronous calls will not work - ATLASSERT(FALSE); - return FALSE; - } - - __checkReturn BOOL ReadClient(void * /*pvBuffer*/, DWORD * /*pdwSize*/) - { - // Nobody should be reading from this client if the page is being cached - // Also, only GET's are cached anyway - ATLASSERT(FALSE); - return FALSE; - } - - __checkReturn BOOL AsyncReadClient(void * /*pvBuffer*/, DWORD * /*pdwSize*/) - { - ATLASSERT(FALSE); - return FALSE; - } - - __checkReturn BOOL SendRedirectResponse(LPCSTR /*pszRedirectUrl*/) - { - ATLASSERT(FALSE); - return FALSE; - } - - - __checkReturn BOOL RequestIOCompletion(PFN_HSE_IO_COMPLETION /*pfn*/, DWORD * /*pdwContext*/) - { - ATLASSERT(FALSE); - return FALSE; - } - - __checkReturn BOOL TransmitFile( - HANDLE /*hFile*/, - PFN_HSE_IO_COMPLETION /*pfn*/, - void * /*pContext*/, - LPCSTR /*szStatusCode*/, - DWORD /*dwBytesToWrite*/, - DWORD /*dwOffset*/, - void * /*pvHead*/, - DWORD /*dwHeadLen*/, - void * /*pvTail*/, - DWORD /*dwTailLen*/, - DWORD /*dwFlags*/) - { - ATLASSERT(FALSE); - return FALSE; - } -}; - - -// This class represents a collection of validation failures. -// Use this class in combination with CValidateObject to validate -// forms, cookies, or query strings and build up a collection of -// failures. If appropriate, use the information in the collection -// to return detailed responses to the client to help them correct the failures. - - -class CValidateContext -{ -public: - enum { ATL_EMPTY_PARAMS_ARE_FAILURES = 0x00000001 }; - - CValidateContext(__in DWORD dwFlags=0) throw() - { - m_bFailures = false; - m_dwFlags = dwFlags; - } - - bool SetResultAt(__in LPCSTR szName, __in DWORD type) - { - _ATLTRY - { - if (!VALIDATION_SUCCEEDED(type) || - (type == VALIDATION_S_EMPTY && (m_dwFlags & ATL_EMPTY_PARAMS_ARE_FAILURES))) - m_bFailures = true; - - return TRUE == m_results.SetAt(szName,type); - - } - _ATLCATCHALL() - { - } - - return false; - } - - // Call this function to add a validation result to the collection managed by this object. - // Each result is identified by a name and the type of result that occurred. - // The result codes are the VALIDATION_ codes defined at the top of this file. - // The bOnlyFailure parameter below is used to only allow failure results to - // be added to the list of failures. The reason you'd want to do this is that - // success codes should be the common case in validation routines so you can - // use bOnlyFailures to limit the number of allocations by this class's base - // map for mapping success results if you don't care about iterating successes. - - bool AddResult(__in LPCSTR szName, __in DWORD type, __in bool bOnlyFailures = true) throw() - { - _ATLTRY - { - if (!VALIDATION_SUCCEEDED(type) || - (type == VALIDATION_S_EMPTY && (m_dwFlags & ATL_EMPTY_PARAMS_ARE_FAILURES))) - m_bFailures = true; - - if (!bOnlyFailures) - return TRUE == m_results.Add(szName, type); // add everything - - else if (bOnlyFailures && - (!VALIDATION_SUCCEEDED(type) || - (type == VALIDATION_S_EMPTY && (m_dwFlags & ATL_EMPTY_PARAMS_ARE_FAILURES)))) - return TRUE == m_results.Add(szName, type); // only add failures - } - _ATLCATCHALL() - { - } - - return false; - } - - // Returns true if there are no validation failures in the collection, - // returns false otherwise. - __checkReturn bool ParamsOK() throw() - { - return !m_bFailures; - } - - // Returns the number of validation results in the collection. - __checkReturn int GetResultCount() throw() - { - return m_results.GetSize(); - } - - // Call this function to retrieve the name and type of a - // validation result based on its index in the collection. - // Returns true on success, false on failure. - // - // i The index of a result managed by this collection. - // - // strName On success, the name of the result with index i. - // - // type On success, the type of the result with index i. - __checkReturn bool GetResultAt(__in int i, __out CStringA& strName, __out DWORD& type) throw() - { - if ( i >= 0 && i < m_results.GetSize()) - { - _ATLTRY - { - strName = m_results.GetKeyAt(i); - type = m_results.GetValueAt(i); - } - _ATLCATCHALL() - { - return false; - } - return true; - } - return false; - } - - DWORD m_dwFlags; -protected: - CSimpleMap m_results; - bool m_bFailures; -}; // CValidateContext - - - -class CAtlValidator -{ -public: - template - static DWORD Validate( - __in T value, - __in TCompType nMinValue, - __in TCompType nMaxValue) throw() - { - DWORD dwRet = VALIDATION_S_OK; - if (value < static_cast(nMinValue)) - dwRet = VALIDATION_E_LENGTHMIN; - else if (value > static_cast(nMaxValue)) - dwRet = VALIDATION_E_LENGTHMAX; - return dwRet; - } - - static DWORD Validate( __in LPCSTR pszValue, __in int nMinChars, __in int nMaxChars) throw() - { - DWORD dwRet = VALIDATION_S_OK; - if(!pszValue) - { - return VALIDATION_E_FAIL; - } - int nChars = (int) strlen(pszValue); - if (nChars < nMinChars) - dwRet = VALIDATION_E_LENGTHMIN; - else if (nChars > nMaxChars) - dwRet = VALIDATION_E_LENGTHMAX; - return dwRet; - } - static DWORD Validate( __in double dblValue, __in double dblMinValue, __in double dblMaxValue) throw() - { - DWORD dwRet = VALIDATION_S_OK; - if ( dblValue < (dblMinValue - ATL_EPSILON) ) - dwRet = VALIDATION_E_LENGTHMIN; - else if ( dblValue > (dblMaxValue + ATL_EPSILON) ) - dwRet = VALIDATION_E_LENGTHMAX; - return dwRet; - } -}; - -// This class provides functions for retrieving and validating named values. -// -// The named values are expected to be provided in string form by the class used as -// the template parameter. CValidateObject provides the means of -// retrieving these values converted to data types chosen by you. You can validate the values -// by specifying a range for numeric values or by specifying a minimum and maximum length -// for string values. -// -// Call one of the Exchange overloads to retrieve a named value converted to your chosen data type. -// Call one of the Validate overloads to retrieve a named value converted to your chosen data type -// and validated against a minimum and maximum value or length supplied by you. -// -// To add validation functionality to the class TLookupClass, derive that class from CValidateObject -// and provide a Lookup function that takes a name as a string and returns the corresponding value -// also as a string: -// LPCSTR Lookup(LPCSTR szName); -template -class CValidateObject -{ -public: - // Exchange Routines - - // Call this function to retrieve a named value converted to your chosen data type. - // Returns one of the following validation status codes: - // VALIDATION_S_OK The named value was found and could be converted successfully - // VALIDATION_S_EMPTY The name was present, but the value was empty - // VALIDATION_E_PARAMNOTFOUND The named value was not found - // VALIDATION_E_INVALIDPARAM The name was present, but the value could not be converted to the requested data type - // VALIDATION_E_FAIL An unspecified error occurred - // Pass a pointer to a validation context object if you want to add - // failures to the collection managed by that object. - template - ATL_NOINLINE __checkReturn DWORD Exchange( - __in LPCSTR szParam, - __out T* pValue, - __inout_opt CValidateContext *pContext = NULL) const throw() - { - DWORD dwRet = VALIDATION_E_PARAMNOTFOUND; - if (pValue) - { - _ATLTRY - { - const TLookupClass *pT = static_cast(this); - LPCSTR szValue = pT->Lookup(szParam); - if (szValue) - { - if (*szValue=='\0') - dwRet = VALIDATION_S_EMPTY; - else - { - dwRet = ConvertNumber(szValue, pValue); - } - } - } - _ATLCATCHALL() - { - return VALIDATION_E_FAIL; - } - } - else - dwRet = VALIDATION_E_FAIL; // invalid input - - if (pContext) - pContext->AddResult(szParam, dwRet); - return dwRet; - } - - template<> - ATL_NOINLINE __checkReturn DWORD Exchange( - __in LPCSTR szParam, - __out_opt CString* pstrValue, - __in_opt CValidateContext *pContext) const throw() - { - _ATLTRY - { - LPCSTR pszValue = NULL; - DWORD dwRet = VALIDATION_E_PARAMNOTFOUND; - if (pstrValue) - { - dwRet = Exchange(szParam, &pszValue, pContext); - if (VALIDATION_SUCCEEDED(dwRet) && pstrValue != NULL) - *pstrValue = CA2T(pszValue); - } - else - { - dwRet = VALIDATION_E_FAIL; // invalid input - if (pContext) - pContext->AddResult(szParam, dwRet); - } - - return dwRet; - } - _ATLCATCHALL() - { - return VALIDATION_E_FAIL; - } - } - - template<> - ATL_NOINLINE __checkReturn DWORD Exchange( - __in LPCSTR szParam, - __deref_out_opt LPCSTR* ppszValue, - __inout_opt CValidateContext *pContext) const throw() - { - DWORD dwRet = VALIDATION_E_PARAMNOTFOUND; - if (ppszValue) - { - _ATLTRY - { - *ppszValue = NULL; - const TLookupClass *pT = static_cast(this); - LPCSTR szValue = pT->Lookup(szParam); - if (szValue) - { - if (*szValue=='\0') - dwRet = VALIDATION_S_EMPTY; - else - { - *ppszValue = szValue; - dwRet = VALIDATION_S_OK; - } - } - } - _ATLCATCHALL() - { - return VALIDATION_E_FAIL; - } - } - else - dwRet = VALIDATION_E_FAIL; // invalid input - - if (pContext) - pContext->AddResult(szParam, dwRet); - return dwRet; - } - - template<> - ATL_NOINLINE __checkReturn DWORD Exchange( - __in LPCSTR szParam, - __out GUID* pValue, - __inout_opt CValidateContext *pContext) const throw() - { - DWORD dwRet = VALIDATION_E_PARAMNOTFOUND; - if (pValue) - { - _ATLTRY - { - const TLookupClass *pT = static_cast(this); - LPCSTR szValue = pT->Lookup(szParam); - if (szValue) - { - if (*szValue=='\0') - dwRet = VALIDATION_S_EMPTY; - else - { - if (S_OK != CLSIDFromString(CA2W(szValue), pValue)) - { - dwRet = VALIDATION_E_INVALIDPARAM; - } - else - dwRet = VALIDATION_S_OK; - } - } - } - _ATLCATCHALL() - { - return VALIDATION_E_FAIL; - } - } - else - dwRet = VALIDATION_E_FAIL; // invalid input - - if (pContext) - pContext->AddResult(szParam, dwRet); - return dwRet; - } - - template<> - ATL_NOINLINE __checkReturn DWORD Exchange( - __in LPCSTR szParam, - __out bool* pbValue, - __inout_opt CValidateContext *pContext) const throw() - { - DWORD dwRet = VALIDATION_S_OK; - if (pbValue) - { - _ATLTRY - { - const TLookupClass *pT = static_cast(this); - LPCSTR szValue = pT->Lookup(szParam); - *pbValue = false; - if (szValue) - { - if (*szValue != '\0') - *pbValue = true; - } - } - _ATLCATCHALL() - { - return VALIDATION_E_FAIL; - } - } - else - dwRet = VALIDATION_E_FAIL; // invalid input - - if (pContext) - pContext->AddResult(szParam, dwRet); - - return dwRet; - } - - __checkReturn DWORD ConvertNumber(__in LPCSTR szVal, __out ULONGLONG *pnVal) const throw() - { - if (!szVal) - return VALIDATION_E_FAIL; - - ATLASSERT(pnVal); - if (!pnVal) - return VALIDATION_E_FAIL; - char *pEnd = NULL; - ULONGLONG n = 0; - errno_t errnoValue = AtlStrToNum(&n, szVal, &pEnd, 10); - if (pEnd == szVal || errnoValue == ERANGE) - { - return VALIDATION_E_INVALIDPARAM; - } - *pnVal = n; - return VALIDATION_S_OK; - } - - __checkReturn DWORD ConvertNumber(__in LPCSTR szVal, __out LONGLONG *pnVal) const throw() - { - if (!szVal) - return VALIDATION_E_FAIL; - - ATLASSERT(pnVal); - if (!pnVal) - return VALIDATION_E_FAIL; - char *pEnd = NULL; - LONGLONG n = 0; - errno_t errnoValue = AtlStrToNum(&n, szVal, &pEnd, 10); - if (pEnd == szVal || errnoValue == ERANGE) - { - return VALIDATION_E_INVALIDPARAM; - } - *pnVal = n; - return VALIDATION_S_OK; - } - - __checkReturn DWORD ConvertNumber(__in LPCSTR szVal, __out double *pdblVal) const throw() - { - if (!szVal) - return VALIDATION_E_FAIL; - - ATLASSERT(pdblVal); - if (!pdblVal) - return VALIDATION_E_FAIL; - char *pEnd = NULL; - double d = 0.0; - errno_t errnoValue = AtlStrToNum(&d, szVal, &pEnd); - if (pEnd == szVal || errnoValue == ERANGE) - { - return VALIDATION_E_INVALIDPARAM; - } - *pdblVal = d; - return VALIDATION_S_OK; - } - - __checkReturn DWORD ConvertNumber(__in LPCSTR szVal, __out int *pnVal) const throw() - { - return ConvertNumber(szVal, (long*)pnVal); - } - - __checkReturn DWORD ConvertNumber(__in LPCSTR szVal, __out unsigned int *pnVal) const throw() - { - return ConvertNumber(szVal, (unsigned long*)pnVal); - } - - __checkReturn DWORD ConvertNumber(__in LPCSTR szVal, __out long *pnVal) const throw() - { - if (!szVal) - return VALIDATION_E_FAIL; - - ATLASSERT(pnVal); - if (!pnVal) - return VALIDATION_E_FAIL; - char *pEnd = NULL; - long n = 0; - errno_t errnoValue = AtlStrToNum(&n, szVal, &pEnd, 10); - if (pEnd == szVal || errnoValue == ERANGE) - { - return VALIDATION_E_INVALIDPARAM; - } - *pnVal = n; - return VALIDATION_S_OK; - } - - __checkReturn DWORD ConvertNumber(__in LPCSTR szVal, __out unsigned long *pnVal) const throw() - { - if (!szVal) - return VALIDATION_E_FAIL; - - ATLASSERT(pnVal); - if (!pnVal) - return VALIDATION_E_FAIL; - char *pEnd = NULL; - unsigned long n = 0; - errno_t errnoValue = AtlStrToNum(&n, szVal, &pEnd, 10); - if (pEnd == szVal || errnoValue == ERANGE) - { - return VALIDATION_E_INVALIDPARAM; - } - *pnVal = n; - return VALIDATION_S_OK; - } - - __checkReturn DWORD ConvertNumber(__in LPCSTR szVal, __out short *pnVal) const throw() - { - if (!szVal) - return VALIDATION_E_FAIL; - - ATLASSERT(pnVal); - if (!pnVal) - return VALIDATION_E_FAIL; - long nVal = 0; - DWORD dwRet = ConvertNumber(szVal, &nVal); - if (dwRet == VALIDATION_S_OK) - { - // clamp to the size of a short - if(nVal <= SHRT_MAX && - nVal >= SHRT_MIN) - { - *pnVal = (short)nVal; - } - else - { - dwRet = VALIDATION_E_INVALIDPARAM; - } - } - return dwRet; - }; - - __checkReturn DWORD ConvertNumber(__in LPCSTR szVal, __out unsigned short *pnVal) const throw() - { - if (!szVal) - return VALIDATION_E_FAIL; - - ATLASSERT(pnVal); - if (!pnVal) - return VALIDATION_E_FAIL; - unsigned long nVal = 0; - DWORD dwRet = ConvertNumber(szVal, &nVal); - if (dwRet == VALIDATION_S_OK) - { - // clamp to the size of a short - if(nVal <= USHRT_MAX && - nVal >= 0) - { - *pnVal = (unsigned short)nVal; - } - else - { - dwRet = VALIDATION_E_INVALIDPARAM; - } - } - return dwRet; - }; - - // Call this function to retrieve a named value converted to your chosen data type - // and validated against a minimum and maximum value or length supplied by you. - // - // Returns one of the following validation status codes: - // VALIDATION_S_OK The named value was found and could be converted successfully - // VALIDATION_S_EMPTY The name was present, but the value was empty - // VALIDATION_E_PARAMNOTFOUND The named value was not found - // VALIDATION_E_INVALIDPARAM The name was present, but the value could not be converted to the requested data type - // VALIDATION_E_LENGTHMIN The name was present and could be converted to the requested data type, but the value was too small - // VALIDATION_E_LENGTHMAX The name was present and could be converted to the requested data type, but the value was too large - // VALIDATION_E_FAIL An unspecified error occurred - // - // Validate can be used to convert and validate name-value pairs - // such as those associated with HTTP requests (query string, form fields, or cookie values). - // The numeric specializations validate the minimum and maximum value. - // The string specializations validate the minimum and maximum length. - // - // Pass a pointer to a validation context object if you want to add - // failures to the collection managed by that object. - // - // Note that you can validate the value of a parameter without - // storing its value by passing NULL for the second parameter. However - // if you pass NULL for the second parameter, make sure you cast the NULL to a - // type so that the compiler will call the correct specialization of Validate. - template - ATL_NOINLINE __checkReturn DWORD Validate( - __in LPCSTR Param, - __out_opt T *pValue, - __in TCompType nMinValue, - __in TCompType nMaxValue, - __inout_opt CValidateContext *pContext = NULL) const throw() - { - T value; - DWORD dwRet = Exchange(Param, &value, pContext); - if ( dwRet == VALIDATION_S_OK ) - { - if (pValue) - *pValue = value; - dwRet = TValidator::Validate(value, nMinValue, nMaxValue); - if (pContext && dwRet != VALIDATION_S_OK) - pContext->AddResult(Param, dwRet); - } - else if (dwRet == VALIDATION_S_EMPTY && - !IsNullByType(nMinValue)) - { - dwRet = VALIDATION_E_LENGTHMIN; - if (pContext) - { - pContext->SetResultAt(Param, VALIDATION_E_LENGTHMIN); - } - } - - return dwRet; - } - - // Specialization for strings. Comparison is for number of characters. - template<> - ATL_NOINLINE __checkReturn DWORD Validate( - __in LPCSTR Param, - __deref_opt_out LPCSTR* ppszValue, - __in int nMinChars, - __in int nMaxChars, - __inout_opt CValidateContext *pContext) const throw() - { - LPCSTR pszValue = NULL; - DWORD dwRet = Exchange(Param, &pszValue, pContext); - if (dwRet == VALIDATION_S_OK ) - { - if (ppszValue) - *ppszValue = pszValue; - dwRet = TValidator::Validate(pszValue, nMinChars, nMaxChars); - if (pContext && dwRet != VALIDATION_S_OK) - pContext->AddResult(Param, dwRet); - } - else if (dwRet == VALIDATION_S_EMPTY && - nMinChars > 0) - { - dwRet = VALIDATION_E_LENGTHMIN; - if (pContext) - { - pContext->SetResultAt(Param, VALIDATION_E_LENGTHMIN); - } - } - - - return dwRet; - } - - // Specialization for CString so caller doesn't have to cast CString - template<> - ATL_NOINLINE __checkReturn DWORD Validate( - __in LPCSTR Param, - __out_opt CString* pstrValue, - __in int nMinChars, - __in int nMaxChars, - __inout_opt CValidateContext *pContext) const throw() - { - _ATLTRY - { - LPCSTR szValue; - DWORD dwRet = Validate(Param, &szValue, nMinChars, nMaxChars, pContext); - if (pstrValue && dwRet == VALIDATION_S_OK ) - *pstrValue = szValue; - return dwRet; - } - _ATLCATCHALL() - { - return VALIDATION_E_FAIL; - } - } - - // Specialization for doubles, uses a different comparison. - template<> - ATL_NOINLINE __checkReturn DWORD Validate( - __in LPCSTR Param, - __out_opt double* pdblValue, - __in double dblMinValue, - __in double dblMaxValue, - __inout_opt CValidateContext *pContext) const throw() - { - double dblValue; - DWORD dwRet = Exchange(Param, &dblValue, pContext); - if (dwRet == VALIDATION_S_OK) - { - if (pdblValue) - *pdblValue = dblValue; - dwRet = TValidator::Validate(dblValue, dblMinValue, dblMaxValue); - if (pContext && dwRet != VALIDATION_S_OK) - pContext->AddResult(Param, dwRet); - } - else if (dwRet == VALIDATION_S_EMPTY && - (dblMinValue < -ATL_EPSILON || - dblMinValue > ATL_EPSILON)) - { - dwRet = VALIDATION_E_LENGTHMIN; - if (pContext) - { - pContext->SetResultAt(Param, VALIDATION_E_LENGTHMIN); - } - } - return dwRet; - } -}; - -// Cookies provide a way for a server to store a small amount of data on a client -// and have that data returned to it on each request the client makes. -// Use this class to represent a cookie to be sent from the server to a client -// or to represent a cookie that has been returned by a client to the originating server. -// -// At the HTTP level, a cookie is an application-defined name-value pair -// plus some standard attribute-value pairs that describe the way in which the user agent (web browser) -// should interact with the cookie. The HTTP format of a cookie is described in RFC 2109. -// -// The CCookie class provides methods to set and get the application-defined name and value -// as well as methods for the standard attributes. In addition, CCookie provides an abstraction -// on top of the application-defined value that allows it to be treated as a collection of name-value -// pairs if that model makes sense to you. Cookies with a single value are known as single-valued cookies. -// Cookies whose value consists of name-value pairs are known as multi-valued cookies or dictionary cookies. -// -// You can set the name of a cookie by calling SetName or using the appropriate constructor. -// The name of a cookie can be 0 or more characters. -// -// You can set the value of a cookie by calling SetValue or using the appropriate constructor. -// If the cookie has a value set, it is a single-valued cookie and attempts to add a name-value pair will fail. -// You can remove the value of a cookie by calling SetValue(NULL). -// -// You can add a name-value pair to a cookie by calling AddValue. -// If the cookie has any name-value pairs, it is a multi-valued cookie and attempts to set the primary value will fail. -// You can remove all the name-value pairs of a cookie by calling RemoveAllValues. -// -// Class CCookie follows the same rules for creating cookies as ASP does. -class CCookie : - public CValidateObject -{ - typedef CAtlMap, - CStringElementTraits > mapType; - - const static DWORD ATLS_MAX_HTTP_DATE = 64; - -public: - // Constructs a named cookie. - CCookie(__in LPCSTR szName) throw(...) - { - ATLENSURE(SetName(szName)); - } - - // Constructs a single-valued cookie. - CCookie(__in LPCSTR szName, __in_opt LPCSTR szValue) throw(...) - { - ATLENSURE(SetName(szName)); - ATLENSURE(SetValue(szValue)); - } - - CCookie(__in const CCookie& thatCookie) throw(...) - { - Copy(thatCookie); - } - - CCookie& operator=(__in const CCookie& thatCookie) throw(...) - { - if(this!=&thatCookie) - { - return Copy(thatCookie); - } - return *this; - } - - CCookie() throw() - { - - } - - __checkReturn BOOL IsEmpty() const throw() - { - return m_strName.IsEmpty(); - } - - // Call this function to set the name of this cookie. - // Returns TRUE on success, FALSE on failure. - // The name of a cookie cannot contain whitespace, semicolons or commas. - // The name should not begin with a dollar sign ($) since such names are reserved for future use. - __checkReturn BOOL SetName(__in LPCSTR szName) throw() - { - _ATLTRY - { - if (szName && *szName) - { - m_strName = szName; - return TRUE; - } - } - _ATLCATCHALL() - { - } - return FALSE; - } - - // Call this function to retrieve the name of this cookie. - // Returns TRUE on success, FALSE on failure. - __checkReturn BOOL GetName(__out_ecount_part(*pdwSize,*pdwSize) LPSTR szBuff, __inout DWORD *pdwSize) const throw() - { - return CopyCString(m_strName, szBuff, pdwSize); - } - - // Call this function to retrieve the name of this cookie. - // Returns TRUE on success, FALSE on failure. - __checkReturn BOOL GetName(__out CStringA &strName) const throw() - { - _ATLTRY - { - strName = m_strName; - return TRUE; - } - _ATLCATCHALL() - { - } - return FALSE; - } - - // Call this function to set the value of this cookie. - // Returns TRUE on success, FALSE on failure. - // Will fail if the cookie is multi-valued. - // Pass NULL to remove the cookie's value. - __checkReturn BOOL SetValue(__in_opt LPCSTR szValue) throw() - { - _ATLTRY - { - if (m_Values.GetCount()) - return FALSE; //already dictionary values in the cookie - - if (!szValue) - m_strValue.Empty(); - else - m_strValue = szValue; - - return TRUE; - } - _ATLCATCHALL() - { - } - return FALSE; - } - - // Call this function to retrieve the value of this cookie. - // Returns TRUE on success, FALSE on failure. - // Returns TRUE if there is no value or the value is of zero length. - // On entry, pdwSize should point to a DWORD that indicates the size of the buffer in bytes. - // On exit, the DWORD contains the number of bytes transferred or available to be transferred into the buffer (including the nul-terminating byte). - __checkReturn BOOL GetValue(__out_ecount(*pdwSize) LPSTR szBuff, __inout DWORD *pdwSize) const throw() - { - return CopyCString(m_strValue, szBuff, pdwSize); - } - - // Call this function to retrieve the value of this cookie. - // Returns TRUE on success, FALSE on failure. - __checkReturn BOOL GetValue(__out CStringA &strValue) const throw() - { - _ATLTRY - { - strValue = m_strValue; - return TRUE; - } - _ATLCATCHALL() - { - } - return FALSE; - } - - // Call this function to add a name-value pair to the cookie. - // Returns TRUE on success, FALSE on failure. - // Will fail if the cookie is single-valued. - // If the named value is already present in the cookie, calling this function - // will modify the current value, otherwise a new name-value pair is added to the cookie. - // Call RemoveValue or RemoveAllValues to remove the name-value pairs - // added by this function. - __checkReturn BOOL AddValue(__in LPCSTR szName, __in_opt LPCSTR szValue) throw() - { - if (m_strValue.GetLength()) - return FALSE; - _ATLTRY - { - return m_Values.SetAt(szName, szValue) != NULL; - } - _ATLCATCHALL() - { - } - return FALSE; - } - - // Call this function to modify a name-value pair associated with the cookie. - // Returns TRUE on success, FALSE on failure. - // Will fail if the cookie is single-valued. - // This function just calls AddValue so the name-value pair will be added if not already present. - // Use this function instead of AddValue to document the intentions of your call. - __checkReturn BOOL ModifyValue(__in LPCSTR szName, __in LPCSTR szValue) throw() - { - return AddValue(szName, szValue); - } - - // Call this function to remove a name-value pair from the collection managed by this cookie. - // Returns TRUE on success, FALSE on failure. - __checkReturn BOOL RemoveValue(__in LPCSTR szName) throw() - { - return m_Values.RemoveKey(szName); - } - - // Call this function to remove all the name-value pairs from the collection managed by this cookie. - void RemoveAllValues() throw() - { - m_Values.RemoveAll(); - } - - // Call this function to add an attribute-value pair to the collection of attributes for this cookie. - // Returns TRUE on success, FALSE on failure. - // This function is equivalent to calling ModifyAttribute. - // Both functions will add the attribute if not already present or - // change its value if it has already been applied to the cookie. - __checkReturn BOOL AddAttribute(__in LPCSTR szName, __in LPCSTR szValue) throw() - { - if (!szName || !*szName || !szValue) - return FALSE; - - _ATLTRY - { - return (m_Attributes.SetAt(szName, szValue) != NULL); - } - _ATLCATCHALL() - { - } - return FALSE; - - } - - // Call this function to modify an attribute-value pair associated with the cookie. - // Returns TRUE on success, FALSE on failure. - // This function is equivalent to calling AddAttribute. - // Both functions will add the attribute if not already present or - // change its value if it has already been applied to the cookie. - __checkReturn BOOL ModifyAttribute(__in LPCSTR szName, __in LPCSTR szValue) throw() - { - return AddAttribute(szName, szValue); - } - - // Call this function to remove an attribute-value pair from the collection of attributes managed by this cookie. - // Returns TRUE on success, FALSE on failure. - __checkReturn BOOL RemoveAttribute(__in LPCSTR szName) throw() - { - return m_Attributes.RemoveKey(szName); - } - - // Call this function to remove all the attribute-value pairs from the collection of attributes managed by this cookie. - void RemoveAllAttributes() throw() - { - m_Attributes.RemoveAll(); - } - - - // Call this function to set the Comment attribute of the cookie. - // Returns TRUE on success, FALSE on failure. - // The Comment attribute allows a web server to document its - // intended use of a cookie. This information may be displayed - // by supporting browsers so that the user of the web site can - // decide whether to initiate or continue a session with this cookie. - // This attribute is optional. - // Version 1 attribute. - __checkReturn BOOL SetComment(__in LPCSTR szComment) throw() - { - BOOL bRet = SetVersion(1); - if (bRet) - bRet = AddAttribute("comment", szComment); - return bRet; - } - - // Call this function to set the CommentUrl attribute of the cookie. - // Returns TRUE on success, FALSE on failure. - // The CommentUrl attribute allows a web server to document its intended - // use of a cookie via a URL that the user of the web site can navigate to. - // The URL specified here should not send further cookies to the client to - // avoid frustrating the user. - // This attribute is optional. - // Version 1 attribute. - __checkReturn BOOL SetCommentUrl(__in LPCSTR szUrl) throw() - { - BOOL bRet = SetVersion(1); - if (bRet) - bRet = AddAttribute("commenturl", szUrl); - return bRet; - } - - // Call this function to add or remove the Discard attribute of the cookie. - // Returns TRUE on success, FALSE on failure. - // The Discard attribute does not have a value. - // Call SetDiscard(TRUE) to add the Discard attribute - // or SetDiscard(FALSE) to remove the Discard attribute. - // Setting the Discard attribute tells a web browser that it should - // discard this cookie when the browser exits regardless of the - // value of the Max-Age attribute. - // This attribute is optional. - // When omitted, the default behavior is that the Max-Age attribute - // controls the lifetime of the cookie. - // Version 1 attribute. - __checkReturn BOOL SetDiscard(__in BOOL bDiscard) throw() - { - BOOL bRet = FALSE; - LPCSTR szKey = "Discard"; - bRet = SetVersion(1); - if (bRet) - { - if (bDiscard == 0) - { - bRet = m_Attributes.RemoveKey(szKey); - } - else - { - _ATLTRY - { - bRet = m_Attributes.SetAt(szKey, " ") != 0; - } - _ATLCATCHALL() - { - bRet = FALSE; - } - } - } - return bRet; - } - - // Call this function to set the Domain attribute of the cookie. - // Returns TRUE on success, FALSE on failure. - // The Domain attribute is used to indicate the domain to which the current - // cookie applies. Browsers should only send cookies back to the relevant domains. - // This attribute is optional. - // When omitted, the default behavior is for - // browsers to use the full domain of the server originating the cookie. You can - // set this attribute value explicitly if you want to share cookies among several servers. - // Version 0 & Version 1 attribute. - __checkReturn BOOL SetDomain(__in LPCSTR szDomain) throw() - { - BOOL bRet = SetVersion(1); - if (bRet) - bRet = AddAttribute("domain", szDomain); - return bRet; - } - - // Call this function to set the Max-Age attribute of the cookie. - // Returns TRUE on success, FALSE on failure. - // The value of the Max-Age attribute is a lifetime in seconds for the cookie. - // When the time has expired, compliant browsers will discard this cookie - // (if they haven't already done so as a result of the Discard attribute). - // If Max-Age is set to zero, the browser discards the cookie immediately. - // This attribute is the Version 1 replacement for the Expires attribute. - // This attribute is optional. - // When omitted, the default behavior is for browsers to discard cookies - // when the user closes the browser. - // Version 1 attribute. - __checkReturn BOOL SetMaxAge(__in UINT nMaxAge) throw() - { - BOOL bRet = FALSE; - bRet = SetVersion(1); - if (bRet) - { - CHAR buff[20]; - if (0 == _itoa_s(nMaxAge, buff, _countof(buff), 10)) - { - bRet = AddAttribute("max-age", buff); - } - } - return bRet; - } - - // Call this function to set the Path attribute of the cookie. - // Returns TRUE on success, FALSE on failure. - // The Path attribute specifies the subset of URLs to which this cookie applies. - // Only URLs that contain that path are allowed to read or modify the cookie. - // This attribute is optional. - // When omitted the default behavior is for browsers to treat the path of a cookie - // as the path of the request URL that generated the Set-Cookie response, up to, - // but not including, the right-most /. - // Version 0 & Version 1 attribute. - __checkReturn BOOL SetPath(__in LPCSTR szPath) throw() - { - BOOL bRet = SetVersion(1); - if (bRet) - bRet = AddAttribute("path", szPath); - return bRet; - } - - // Call this function to set the Port attribute of the cookie. - // Returns TRUE on success, FALSE on failure. - // The Port attribute specifies the port to which this cookie applies. - // Only URLs accessed via that port are allowed to read or modify the cookie. - // This attribute is optional. - // When omitted the default behavior is for browsers to return the cookie via any port. - // Version 1 attribute. - __checkReturn BOOL SetPort(__in LPCSTR szPort) throw() - { - BOOL bRet = SetVersion(1); - if (bRet) - bRet = AddAttribute("port", szPort); - return bRet; - } - - // Call this function to add or remove the Secure attribute of the cookie. - // Returns TRUE on success, FALSE on failure. - // The Secure attribute does not have a value. - // Call SetSecure(TRUE) to add the Secure attribute - // or SetSecure(FALSE) to remove the Secure attribute. - // Setting the Secure attribute tells a browser that it should - // transmit the cookie to the web server only via secure means such as HTTPS. - // This attribute is optional. - // When omitted, the default behavior is that the cookie - // will be sent via unsecured protocols. - // Version 0 & Version 1 attribute. - __checkReturn BOOL SetSecure(__in BOOL bSecure) throw() - { - BOOL bRet = FALSE; - LPCSTR szKey = "secure"; - bRet = SetVersion(1); - if (bRet) - { - if (bSecure == 0) - { - bRet = m_Attributes.RemoveKey(szKey); - } - else - { - _ATLTRY - { - bRet = m_Attributes.SetAt(szKey, " ") != 0; - } - _ATLCATCHALL() - { - bRet = FALSE; - } - } - } - return bRet; - } - - // Call this function to set the Version attribute of the cookie. - // Returns TRUE on success, FALSE on failure. - // This attribute is required for Version 1 cookies by RFC 2109 and must have a value of 1. - // However, you do not need to call SetVersion explicitly from your own code unless you need to - // force RFC 2109 compliance. CCookie will automatically set this attribute whenever - // you use a Version 1 attribute in your cookie. - // Version 1 attribute. - __checkReturn BOOL SetVersion(__in UINT nVersion) throw() - { - BOOL bRet = FALSE; - CHAR buff[20]; - if (0 == _itoa_s(nVersion, buff, _countof(buff), 10)) - { - bRet = AddAttribute("version", buff); - } - return bRet; - } - - // Call this function to set the Expires attribute of the cookie. - // Returns TRUE on success, FALSE on failure. - // The Expires attribute specifies an absolute date and time at which this cookie - // should be discarded by web browsers. Pass a SYSTEMTIME holding a Greenwich Mean Time (GMT) - // value or a string in the following format: - // Wdy, DD-Mon-YY HH:MM:SS GMT - // This attribute is optional. - // When omitted, the default behavior is for browsers to discard cookies - // when the user closes the browser. - // This attribute has been superceded in Version 1 by the Max-Age attribute, - // but you should continue to use this attribute for Version 0 clients. - // Version 0 attribute. - __checkReturn BOOL SetExpires(__in LPCSTR szExpires) throw() - { - return AddAttribute("expires", szExpires); - } - - __checkReturn BOOL SetExpires(__in const SYSTEMTIME &st) throw() - { - _ATLTRY - { - CFixedStringT strTime; - SystemTimeToHttpDate(st, strTime); - return SetExpires(strTime); - } - _ATLCATCHALL() - { - } - return FALSE; - } - - // Call this function to look up the value of a name-value pair applied to this cookie. - // Returns the requested value if present or NULL if the name was not found. - __checkReturn LPCSTR Lookup(__in_opt LPCSTR szName=NULL) const throw() - { - if (IsEmpty()) - return NULL; - - if (m_strValue.GetLength()) - { - ATLASSERT(szName == NULL); - return m_strValue; - } - - if (m_Values.GetCount()) - { - ATLENSURE_RETURN_VAL(szName, NULL); - const mapType::CPair *pPair = NULL; - ATLTRY(pPair = m_Values.Lookup(szName)); - if (pPair) - return (LPCSTR)pPair->m_value; - } - - return NULL; - } - - // Call this function to clear the cookie of all content - // including name, value, name-value pairs, and attributes. - void Empty() throw() - { - m_strName.Empty(); - m_strValue.Empty(); - m_Attributes.RemoveAll(); - m_Values.RemoveAll(); - } - - // Call this function to create a CCookie from a buffer. - // The passed in buffer contains a cookie header retrieved - // from the HTTP_COOKIE request variable - bool ParseValue(__in const char *pstart) - { - ATLASSERT(pstart); - if (!pstart || *pstart == '\0') - return false; - - // could be just a value or could be an array of name=value pairs - LPCSTR pEnd = pstart; - LPCSTR pStart = pstart; - CStringA name, value; - - while (*pEnd != '\0') - { - while (*pEnd && *pEnd != '=' && *pEnd != '&') - pEnd++; - - if (*pEnd == '\0' || *pEnd == '&') - { - if (pEnd > pStart) - CopyToCString(value, pStart, pEnd); - SetValue(value); - if (*pEnd == '&') - { - pEnd++; - pStart = pEnd; - continue; - } - return true; // we're done; - } - else if (*pEnd == '=' ) - { - // we have name=value - if (pEnd > pStart) - { - CopyToCString(name, pStart, pEnd); - } - else - { - pEnd++; - pStart = pEnd; - break; - } - - // skip '=' and go for value - pEnd++; - pStart = pEnd; - while (*pEnd && *pEnd != '&' && *pEnd != '=') - pEnd++; - if (pEnd > pStart) - CopyToCString(value, pStart, pEnd); - - ATLENSURE(AddValue(name, value)); - - if (*pEnd != '\0') - pEnd++; - pStart = pEnd; - - } - } - - return true; - } - - // Call this function to render this cookie - // into a buffer. Returns TRUE on success, FALSE on failure. - // On entry, pdwLen should point to a DWORD that indicates - // the size of the buffer in bytes. On exit, the DWORD contains - // the number of bytes transferred or available to be transferred - // into the buffer (including the nul-terminating byte). On - // success, the buffer will contain the correct HTTP - // representation of the current cookie suitable for sending to - // a client as the body of a Set-Cookie header. - __success(return==true) ATL_NOINLINE __checkReturn BOOL Render(__out_ecount_part_opt(*pdwLen,*pdwLen) LPSTR szCookieBuffer, __inout DWORD *pdwLen) const throw() - { - if (!pdwLen) - return FALSE; - CStringA strCookie; - CStringA name, value; - DWORD dwLenBuff = *pdwLen; - *pdwLen = 0; - - // A cookie must have a name! - if (!m_strName.GetLength()) - { - *pdwLen = 0; - return FALSE; - } - _ATLTRY - { - strCookie = m_strName; - int nValSize = (int) m_Values.GetCount(); - if (nValSize) - { - strCookie += '='; - POSITION pos = m_Values.GetStartPosition(); - for (int i=0; pos; i++) - { - m_Values.GetNextAssoc(pos, name, value); - strCookie += name; - if (value.GetLength()) - { - strCookie += '='; - strCookie += value; - } - if (i <= nValSize-2) - strCookie += '&'; - } - } - else - { - strCookie += '='; - if (m_strValue.GetLength()) - strCookie += m_strValue; - } - - CStringA strAttributes; - if (!RenderAttributes(strAttributes)) - return FALSE; - if (strAttributes.GetLength() > 0) - { - strCookie += "; "; - strCookie += strAttributes; - } - - DWORD dwLenCookie = strCookie.GetLength() + 1; - *pdwLen = dwLenCookie; - if (!szCookieBuffer) - return TRUE; // caller just wanted the length - - // see if buffer is big enough - if (dwLenCookie > dwLenBuff) - return FALSE; //buffer wasn't big enough - - // copy the buffer - Checked::strcpy_s(szCookieBuffer, *pdwLen, strCookie); - } - _ATLCATCHALL() - { - return FALSE; - } - return TRUE; - } - - POSITION GetFirstAttributePos() const throw() - { - return m_Attributes.GetStartPosition(); - } - - const CStringA& GetNextAttributeName(__inout POSITION& pos) const throw() - { - return m_Attributes.GetNextKey(pos); - } - - const CStringA& GetAttributeValueAt(__in POSITION pos) const throw() - { - return m_Attributes.GetValueAt(pos); - } - - BOOL GetNextAttrAssoc(__inout POSITION& pos, __out CStringA& key, - __out CStringA& val) const throw() - { - _ATLTRY - { - m_Attributes.GetNextAssoc(pos, key, val); - } - _ATLCATCHALL() - { - return FALSE; - } - return TRUE; - } - - POSITION GetFirstValuePos() const throw() - { - return m_Values.GetStartPosition(); - } - - const CStringA& GetNextValueName(__inout POSITION& pos) const throw() - { - return m_Values.GetNextKey(pos); - } - - const CStringA& GetValueAt(__in POSITION pos) const throw() - { - return m_Values.GetValueAt(pos); - } - - BOOL GetNextValueAssoc(__inout POSITION& pos, __out CStringA& key, - __out CStringA& val) const throw() - { - _ATLTRY - { - m_Values.GetNextAssoc(pos, key, val); - } - _ATLCATCHALL() - { - return FALSE; - } - return TRUE; - } - -protected: -// Implementation - BOOL RenderAttributes(__out CStringA& strAttributes) const throw() - { - _ATLTRY - { - strAttributes.Empty(); - - POSITION pos = m_Attributes.GetStartPosition(); - CStringA key, val; - for (int i=0; pos; i++) - { - if (i) - strAttributes += ";"; - m_Attributes.GetNextAssoc(pos, key, val); - strAttributes += key; - strAttributes += '='; - strAttributes += val; - } - } - _ATLCATCHALL() - { - return FALSE; - } - return TRUE; - } -private: - CCookie& Copy(__in const CCookie& thatCookie) throw(...) - { - m_strName = thatCookie.m_strName; - m_strValue = thatCookie.m_strValue; - POSITION pos = NULL; - CStringA strName, strValue; - if (!thatCookie.m_Attributes.IsEmpty()) - { - pos = thatCookie.m_Attributes.GetStartPosition(); - while (pos) - { - thatCookie.m_Attributes.GetNextAssoc(pos, strName, strValue); - m_Attributes.SetAt(strName, strValue); - } - } - if (!thatCookie.m_Values.IsEmpty()) - { - strName.Empty(); - strValue.Empty(); - pos = thatCookie.m_Values.GetStartPosition(); - while (pos) - { - thatCookie.m_Values.GetNextAssoc(pos, strName, strValue); - m_Values.SetAt(strName, strValue); - } - } - return *this; - } - - // Call this function to copy a substring to a CString reference and ensure nul-termination. - void CopyToCString(__out CStringA& string, __in_ecount(pEnd-pStart) LPCSTR pStart, __in LPCSTR pEnd) throw( ... ) - { - ATLENSURE( pStart != NULL ); - ATLENSURE( pEnd != NULL ); - - string.SetString(pStart, (int)(pEnd-pStart)); - string.Trim(); - } - - -public: - // These are implementation only, use at your own risk! - // Map of attribute-value pairs applied to this cookie. - mapType m_Attributes; - - // Map of name-value pairs applied to this cookie. - mapType m_Values; - - // The name of this cookie. - CStringA m_strName; - - // The value of this cookie. - CStringA m_strValue; - -}; // class CCookie - -class CSessionCookie : public CCookie -{ -public: - CSessionCookie() throw(...) - { - if (!SetName(SESSION_COOKIE_NAME) || - !SetPath("/")) - AtlThrow(E_OUTOFMEMORY); - } - - CSessionCookie(LPCSTR szSessionID) throw(...) - { - if (!SetName(SESSION_COOKIE_NAME) || - !SetPath("/") || - !SetSessionID(szSessionID) ) - AtlThrow(E_OUTOFMEMORY); - } - - BOOL SetSessionID(LPCSTR szSessionID) throw() - { - ATLASSERT(szSessionID && szSessionID[0]); - return SetValue(szSessionID); - } -}; // class CSessionCookie - -template<> -class CElementTraits< CCookie > : - public CElementTraitsBase< CCookie > -{ -public: - typedef const CCookie& INARGTYPE; - typedef CCookie& OUTARGTYPE; - - static ULONG Hash( __in INARGTYPE cookie ) - { - return CStringElementTraits::Hash( cookie.m_strName ); - } - - static bool CompareElements( __in INARGTYPE cookie1, __in INARGTYPE cookie2 ) - { - return( cookie1.m_strName == cookie2.m_strName ); - } - - static int CompareElementsOrdered( __in INARGTYPE cookie1, __in INARGTYPE cookie2 ) - { - return( cookie1.m_strName.Compare( cookie2.m_strName ) ); - } -}; - - -/////////////////////////////////////////////////////////////////////////////// -// Request and response classes and support functions - - -// This class is a wrapper for CAtlMap that allows maps to be chained. -// It simply adds a bool that tells whether or not a map shares values -template , typename VTraits=CElementTraits > -class CHttpMap -{ -private: - -#ifdef ATL_HTTP_PARAM_MULTIMAP - typedef CRBMultiMap MAPTYPE; -#else - typedef CAtlMap MAPTYPE; -#endif // ATL_HTTP_PARAM_MULTIMAP - -public: - - typedef typename KTraits::INARGTYPE KINARGTYPE; - typedef typename KTraits::OUTARGTYPE KOUTARGTYPE; - typedef typename VTraits::INARGTYPE VINARGTYPE; - typedef typename VTraits::OUTARGTYPE VOUTARGTYPE; - - typedef typename MAPTYPE::CPair CPair; - -private: - - bool m_bShared; - - MAPTYPE m_map; - -public: - - CHttpMap() throw() - : m_bShared(false) - { - } - - virtual ~CHttpMap() - { - } - - inline bool IsShared() const throw() - { - return m_bShared; - } - - inline void SetShared(__in bool bShared) throw() - { - m_bShared = bShared; - } - - // - // exposed lookup and iteration functionality - // - - inline size_t GetCount() const throw() - { - return m_map.GetCount(); - } - - inline bool IsEmpty() const throw() - { - return m_map.IsEmpty(); - } - - inline POSITION GetStartPosition() const throw() - { -#ifdef ATL_HTTP_PARAM_MULTIMAP - return m_map.GetHeadPosition(); -#else - return m_map.GetStartPosition(); -#endif // ATL_HTTP_PARAM_MULTIMAP - } - - // Lookup wrappers - bool Lookup( __in KINARGTYPE key, __out VOUTARGTYPE value ) const throw() - { - _ATLTRY - { -#ifdef ATL_HTTP_PARAM_MULTIMAP - CPair *p = Lookup(key); - if (p != NULL) - { - value = p->m_value; - return true; - } - return false; -#else - return m_map.Lookup(key, value); -#endif // ATL_HTTP_PARAM_MULTIMAP - } - _ATLCATCHALL() - { - return false; - } - } - - const CPair* Lookup( __in KINARGTYPE key ) const throw() - { -#ifdef ATL_HTTP_PARAM_MULTIMAP - POSITION pos = m_map.FindFirstWithKey(key); - if (pos != NULL) - { - return m_map.GetAt(pos); - } - return NULL; -#else - return m_map.Lookup(key); -#endif // ATL_HTTP_PARAM_MULTIMAP - } - - CPair* Lookup( __in KINARGTYPE key ) throw() - { -#ifdef ATL_HTTP_PARAM_MULTIMAP - POSITION pos = m_map.FindFirstWithKey(key); - if (pos != NULL) - { - return m_map.GetAt(pos); - } - return NULL; -#else - return m_map.Lookup(key); -#endif // ATL_HTTP_PARAM_MULTIMAP - } - - // iteration wrappers - void GetNextAssoc( __inout POSITION& pos, __out KOUTARGTYPE key, __out VOUTARGTYPE value ) const throw(...) - { - m_map.GetNextAssoc(pos, key, value); - } - - const CPair* GetNext( __inout POSITION& pos ) const throw() - { - return m_map.GetNext(pos); - } - - CPair* GetNext( __inout POSITION& pos ) throw() - { - return m_map.GetNext(pos); - } - - const K& GetNextKey( __inout POSITION& pos ) const throw() - { - return m_map.GetNextKey(pos); - } - - const V& GetNextValue( __inout POSITION& pos ) const throw() - { - return m_map.GetNextValue(pos); - } - - V& GetNextValue( __inout POSITION& pos ) throw() - { - return m_map.GetNextValue(pos); - } - - void GetAt( __in POSITION pos, __out KOUTARGTYPE key, __out VOUTARGTYPE value ) const throw(...) - { - return m_map.GetAt(pos, key, value); - } - - CPair* GetAt( __in POSITION pos ) throw() - { - return m_map.GetAt(pos); - } - - const CPair* GetAt( __in POSITION pos ) const throw() - { - return m_map.GetAt(pos); - } - - const K& GetKeyAt( __in POSITION pos ) const throw() - { - return m_map.GetKeyAt(pos); - } - - const V& GetValueAt( __in POSITION pos ) const throw() - { - return m_map.GetValueAt(pos); - } - - V& GetValueAt( __in POSITION pos ) throw() - { - return m_map.GetValueAt(pos); - } - - // modification wrappers - POSITION SetAt( __in KINARGTYPE key, __in_opt VINARGTYPE value ) throw(...) - { -#ifdef ATL_HTTP_PARAM_MULTIMAP - return m_map.Insert(key, value); -#else - return m_map.SetAt(key, value); -#endif // ATL_HTTP_PARAM_MULTIMAP - } - - bool RemoveKey( __in KINARGTYPE key ) throw() - { -#ifdef ATL_HTTP_PARAM_MULTIMAP - return (m_map.RemoveKey(key) != 0); -#else - return m_map.RemoveKey(key); -#endif // ATL_HTTP_PARAM_MULTIMAP - } - - virtual void RemoveAll() - { - m_map.RemoveAll(); - } -}; - -// This class is a wrapper for CHttpMap that assumes it's values are pointers that -// should be deleted on RemoveAll -template , typename VTraits=CElementTraits > -class CHttpPtrMap : public CHttpMap -{ -public: - typedef CHttpMap Base; - - void RemoveAll() - { - if (!IsShared()) - { - POSITION pos = GetStartPosition(); - while (pos) - { - GetNextValue(pos)->Free(); - } - } - Base::RemoveAll(); - } - - ~CHttpPtrMap() - { - RemoveAll(); - } -}; - -// This class represents a collection of request parameters - the name-value pairs -// found, for example, in a query string or in the data provided when a form is submitted to the server. -// Call Parse to build the collection from a string of URL-encoded data. -// Use the standard collection methods of the CHttpMap base class to retrieve the -// decoded names and values. -// Use the methods of the CValidateObject base class to validate the parameters. -class CHttpRequestParams : -#if (defined(ATL_HTTP_PARAM_MAP_CASEINSENSITIVE)) - public CHttpMap, CStringElementTraitsI >, -#else - public CHttpMap, CStringElementTraits >, -#endif - public CValidateObject -{ -public: -#if (defined(ATL_HTTP_PARAM_MAP_CASEINSENSITIVE)) - typedef CHttpMap, CStringElementTraitsI > BaseMap; -#else - typedef CHttpMap, CStringElementTraits > BaseMap; -#endif - - LPCSTR Lookup(__in LPCSTR szName) const throw() - { - _ATLTRY - { - if (!szName) - return NULL; - - const CPair *p = BaseMap::Lookup(szName); - if (p) - { - return p->m_value; - } - } - _ATLCATCHALL() - { - } - return NULL; - } - - // Call this function to build a collection of name-value pairs from a string of URL-encoded data. - // Returns TRUE on success, FALSE on failure. - // URL-encoded data: - // Each name-value pair is separated from the next by an ampersand (&) - // Each name is separated from its corresponding value by an equals signs (=) - // The end of the data to be parsed is indicated by a nul character (\0) or a pound symbol (#) - // A plus sign (+) in the input will be decoded as a space - // A percent sign (%) in the input signifies the start of an escaped octet. - // The next two digits represent the hexadecimal code of the character. - // For example, %21 is the escaped encoding for the US-ASCII exclamation mark and will be decoded as !. - // Common sources of URL-encoded data are query strings and the bodies of POST requests with content type of application/x-www-form-urlencoded. - // - // Parse and Render are complementary operations. - // Parse creates a collection from a string. - // Render creates a string from a collection. - ATL_NOINLINE __checkReturn BOOL Parse(__inout LPSTR szQueryString) throw() - { - while (szQueryString && *szQueryString) - { - LPSTR szUrlCurrent = szQueryString; - LPSTR szName = szUrlCurrent; - LPSTR szPropValue; - - while (*szQueryString) - { - if (*szQueryString == '=') - { - szQueryString++; - break; - } - if (*szQueryString == '&') - { - break; - } - if (*szQueryString == '+') - *szUrlCurrent = ' '; - else if (*szQueryString == '%') - { - // if there is a % without two characters - // at the end of the url we skip it - if (*(szQueryString+1) && *(szQueryString+2)) - { - short nFirstDigit = AtlHexValue(szQueryString[1]); - short nSecondDigit = AtlHexValue(szQueryString[2]); - - if( nFirstDigit < 0 || nSecondDigit < 0 ) - { - break; - } - *szUrlCurrent = static_cast(16*nFirstDigit+nSecondDigit); - szQueryString += 2; - } - else - *szUrlCurrent = '\0'; - } - else - *szUrlCurrent = *szQueryString; - - szQueryString++; - szUrlCurrent++; - } - - if (*szUrlCurrent == '&') - { - *szUrlCurrent++ = '\0'; - szQueryString++; - szPropValue = ""; - } - else - { - if (*szUrlCurrent) - *szUrlCurrent++ = '\0'; - - // we have the property name - szPropValue = szUrlCurrent; - while (*szQueryString && *szQueryString != '#') - { - if (*szQueryString == '&') - { - szQueryString++; - break; - } - if (*szQueryString == '+') - *szUrlCurrent = ' '; - else if (*szQueryString == '%') - { - // if there is a % without two characters - // at the end of the url we skip it - if (*(szQueryString+1) && *(szQueryString+2)) - { - short nFirstDigit = AtlHexValue(szQueryString[1]); - short nSecondDigit = AtlHexValue(szQueryString[2]); - - if( nFirstDigit < 0 || nSecondDigit < 0 ) - { - break; - } - *szUrlCurrent = static_cast(16*nFirstDigit+nSecondDigit); - szQueryString += 2; - } - else - *szUrlCurrent = '\0'; - } - else - *szUrlCurrent = *szQueryString; - szQueryString++; - szUrlCurrent++; - } - // we have the value - *szUrlCurrent = '\0'; - szUrlCurrent++; - } - - _ATLTRY - { - SetAt(szName, szPropValue); - } - _ATLCATCHALL() - { - return FALSE; - } - } - return TRUE; - } - - // Call this function to render the map of names and values into a buffer as a URL-encoded string. - // Returns TRUE on success, FALSE on failure. - // On entry, pdwLen should point to a DWORD that indicates the size of the buffer in bytes. - // On exit, the DWORD contains the number of bytes transferred or available to be transferred into the buffer (including the nul-terminating byte). - // On success, the buffer will contain the correct URL-encoded representation of the current object - // suitable for sending to a server as a query string or in the body of a form. - // URL-encoding: - // Each name-value pair is separated from the next by an ampersand (&) - // Each name is separated from its corresponding value by an equals signs (=) - // A space is encoded as a plus sign (+). - // Other unsafe characters (as determined by AtlIsUnsafeUrlChar) are encoded as escaped octets. - // An escaped octet is a percent sign (%) followed by two digits representing the hexadecimal code of the character. - // - // Parse and Render are complementary operations. - // Parse creates a collection from a string. - // Render creates a string from a collection. - ATL_NOINLINE __checkReturn BOOL Render(__out_ecount(pdwLen) LPSTR szParameters, __inout LPDWORD pdwLen) - { - ATLENSURE(szParameters); - ATLENSURE(pdwLen); - _ATLTRY - { - if (GetCount() == 0) - { - *szParameters = '\0'; - *pdwLen = 0; - return TRUE; - } - - CStringA strParams; - POSITION pos = GetStartPosition(); - while (pos != NULL) - { - LPCSTR szBuf = GetKeyAt(pos); - EscapeToCString(strParams, szBuf); - szBuf = GetValueAt(pos); - if (*szBuf) - { - strParams+= '='; - EscapeToCString(strParams, szBuf); - } - strParams+= '&'; - GetNext(pos); - } - - DWORD dwLen = strParams.GetLength(); - strParams.Delete(dwLen-1); - BOOL bRet = TRUE; - if (dwLen > *pdwLen) - { - bRet = FALSE; - } - else - { - dwLen--; - Checked::memcpy_s(szParameters, *pdwLen, static_cast(strParams), dwLen); - szParameters[dwLen] = '\0'; - } - - *pdwLen = dwLen; - return bRet; - } - _ATLCATCHALL() - { - return FALSE; - } - } - -}; // class CHttpRequestParams - -#ifndef MAX_TOKEN_LENGTH -#define MAX_TOKEN_LENGTH (MAX_PATH) -#endif - -// This class represents the information about a file that has been uploaded to the web server. -class CHttpRequestFile : public IHttpFile -{ -private: - - // The name of the form field used to upload the file. - CHAR m_szParamName[MAX_TOKEN_LENGTH]; - - // The original file name of the uploaded file as set by the client. - CHAR m_szFileName[MAX_PATH]; - - // The original path and file name of the uploaded file as set by the client. - CHAR m_szFullFileName[MAX_PATH]; - - // The MIME type of the uploaded file. - CHAR m_szContentType[MAX_TOKEN_LENGTH]; - - // The name of the uploaded file on the server. - CHAR m_szTempFileName[MAX_PATH]; - - // The size of the file in bytes. - ULONGLONG m_nFileSize; - -public: - - CHttpRequestFile() throw() - { - *m_szParamName = '\0'; - *m_szFileName = '\0'; - *m_szFullFileName = '\0'; - *m_szContentType = '\0'; - m_nFileSize = 0; - } - - __checkReturn BOOL Initialize( - __in_opt LPCSTR pParamName, - __in LPCSTR pFileName, - __in_opt LPCSTR pTempFileName, - __in_opt LPCSTR pContentType, - __in const ULONGLONG &nFileSize) - { - ATLENSURE( pFileName != NULL ); - - if (!SafeStringCopy(m_szFullFileName, pFileName)) - { - // path too long - return FALSE; - } - - if (pParamName && *pParamName) - { - if (!SafeStringCopy(m_szParamName, pParamName)) - { - // string too long - return FALSE; - } - } - - if (pTempFileName && *pTempFileName) - { - if (!SafeStringCopy(m_szTempFileName, pTempFileName)) - { - // path too long - return FALSE; - } - } - - if (pContentType && *pContentType) - { - if (!SafeStringCopy(m_szContentType, pContentType)) - { - // string too long - return FALSE; - } - } - - // Set m_szFileName to be the file name without the path. - // This is likely to be the most meaningful part of the - // original file name once the file reaches the server. - - LPSTR szTmp = m_szFullFileName; - LPSTR szFile = m_szFileName; - LPSTR pszLastCharFileBuf=m_szFileName + _countof(m_szFileName) - 1; - while (*szTmp) - { - if (*szTmp == '\\') - { - szFile = m_szFileName; - } - else - { - if (szFile > pszLastCharFileBuf) - { - return FALSE; - } - *szFile++ = *szTmp; - } - szTmp++; - } - if (szFile > pszLastCharFileBuf) - { - return FALSE; - } - *szFile = 0; - - m_nFileSize = nFileSize; - return TRUE; - } - - - //======================================= - // IHttpFile interface - //======================================= - __checkReturn LPCSTR GetParamName() - { - return m_szParamName; - } - - __checkReturn LPCSTR GetFileName() - { - return m_szFileName; - } - - __checkReturn LPCSTR GetFullFileName() - { - return m_szFullFileName; - } - - __checkReturn LPCSTR GetContentType() - { - return m_szContentType; - } - - __checkReturn LPCSTR GetTempFileName() - { - return m_szTempFileName; - } - - __checkReturn ULONGLONG GetFileSize() - { - return m_nFileSize; - } - - void Free() - { - delete this; - } - -}; // class CHttpRequestFile - - -// utility function to ReadData from a ServerContext -ATL_NOINLINE inline -__checkReturn BOOL ReadClientData(__inout IHttpServerContext *pServerContext, __out_ecount_part(*pdwLen,*pdwLen) LPSTR pbDest, __inout LPDWORD pdwLen, __in DWORD dwBytesRead) -{ - ATLENSURE(pServerContext != NULL); - ATLENSURE(pdwLen != NULL); - ATLENSURE(pbDest != NULL); - - _ATLTRY - { - DWORD dwToRead = *pdwLen; - DWORD dwAvailableBytes = pServerContext->GetAvailableBytes(); - DWORD dwRead(0); - - // Read from available data first - if (dwBytesRead < dwAvailableBytes) - { - LPBYTE pbAvailableData = pServerContext->GetAvailableData(); - pbAvailableData+= dwBytesRead; - DWORD dwAvailableToRead = __min(dwToRead, dwAvailableBytes-dwBytesRead); - Checked::memcpy_s(pbDest, *pdwLen, pbAvailableData, dwAvailableToRead); - dwBytesRead+= dwAvailableToRead; - dwToRead-= dwAvailableToRead; - pbDest+= dwAvailableToRead; - dwRead+= dwAvailableToRead; - } - - DWORD dwTotalBytes = pServerContext->GetTotalBytes(); - - // If there is still more to read after the available data is exhausted - if (dwToRead && dwBytesRead < dwTotalBytes) - { - DWORD dwClientBytesToRead = __min(pServerContext->GetTotalBytes()-dwBytesRead, dwToRead); - DWORD dwClientBytesRead = 0; - - // keep on reading until we've read the amount requested - do - { - dwClientBytesRead = dwClientBytesToRead; - if (!pServerContext->ReadClient(pbDest, &dwClientBytesRead)) - { - return FALSE; - } - dwClientBytesToRead-= dwClientBytesRead; - dwRead+= dwClientBytesRead; - pbDest+= dwClientBytesRead; - - } while (dwClientBytesToRead != 0 && dwClientBytesRead != 0); - - - } - - *pdwLen = dwRead; - } - _ATLCATCHALL() - { - return FALSE; - } - - return TRUE; -} - -#ifndef MAX_MIME_BOUNDARY_LEN - #define MAX_MIME_BOUNDARY_LEN 128 -#endif - -enum ATL_FORM_FLAGS -{ - ATL_FORM_FLAG_NONE = 0, - ATL_FORM_FLAG_IGNORE_FILES = 1, - ATL_FORM_FLAG_REFUSE_FILES = 2, - ATL_FORM_FLAG_IGNORE_EMPTY_FILES = 4, - ATL_FORM_FLAG_IGNORE_EMPTY_FIELDS = 8, -}; - -// Use this class to read multipart/form-data from the associated server context -// and generate files as necessary from the data in the body of the request. -class CMultiPartFormParser -{ -protected: - - LPSTR m_pCurrent; - LPSTR m_pEnd; - LPSTR m_pStart; - CHAR m_szBoundary[MAX_MIME_BOUNDARY_LEN+2]; - DWORD m_dwBoundaryLen; - BOOL m_bFinished; - CComPtr m_spServerContext; - -public: - - typedef CHttpMap > FILEMAPTYPE; - - CMultiPartFormParser(__in IHttpServerContext* pServerContext) throw() : - m_pCurrent(NULL), - m_pEnd(NULL), - m_pStart(NULL), - m_dwBoundaryLen(0), - m_bFinished(FALSE), - m_spServerContext(pServerContext) - { - *m_szBoundary = '\0'; - } - - ~CMultiPartFormParser() throw() - { - _ATLTRY - { - // free memory if necessary - if (m_spServerContext->GetTotalBytes() > m_spServerContext->GetAvailableBytes()) - { - free(m_pStart); - } - } - _ATLCATCHALL() - { - } - } - - // Call this function to read multipart/form-data from the current HTTP request, - // allowing files to be uploaded to the web server. - // - // Returns TRUE on success, FALSE on failure. - // - // Forms can be sent to a web server using one of two encodings: application/x-www-form-urlencoded or multipart/form-data. - // In addition to the simple name-value pairs typically associated with - // application/x-www-form-urlencoded form data, multipart/form-data (as - // described in RFC 2388) can also contain files to be uploaded - // to the web server. - // - // This function will generate a physical file for each file contained in the multipart/form-data request body. - // The generated files are stored in the server's temporary directory as returned by the - // GetTempPath API and are named using the GetTempFileName API. - // The information about each file can be obtained from the elements of the Files array. - // You can retrieve the original name of the file on the client, the name of the generated file on the server, - // the MIME content type of the uploaded file, the name of the form field associated with that file, and the size in - // bytes of the file. All this information is exposed by the CHttpRequestFile objects in the array. - // - // In addition to generating files and populating the Files array with information about them, - // this function also populates the pQueryParams array with the names and values of the other form fields - // contained in the current request. The file fields are also added to this array. The value of these fields - // is the full name of the generated file on the server. - // - // Note that files can be generated even if this function returns FALSE unless you specify either the - // ATL_FORM_FLAG_IGNORE_FILES or the ATL_FORM_FLAG_REFUSE_FILES flag. If you don't specify one of these - // flags, you should always check the Files array for generated files and delete any that are no longer - // needed to prevent your web server from running out of disk space. - // - // dwFlags can be a combination of one or more of the following values: - // ATL_FORM_FLAG_NONE Default behavior. - // ATL_FORM_FLAG_IGNORE_FILES Any attempt to upload files is ignored. - // ATL_FORM_FLAG_REFUSE_FILES Any attempt to upload files is treated as a failure. The function will return FALSE. - // ATL_FORM_FLAG_IGNORE_EMPTY_FILES Files with a size of zero bytes are ignored. - // ATL_FORM_FLAG_IGNORE_EMPTY_FIELDS Fields with no content are ignored. - ATL_NOINLINE BOOL GetMultiPartData( - __inout FILEMAPTYPE& Files, - __inout CHttpRequestParams* pQueryParams, - __in DWORD dwFlags=ATL_FORM_FLAG_NONE) throw() - { - _ATLTRY - { - if (!InitializeParser()) - { - return FALSE; - } - - //Get to the first boundary - if (!ReadUntilBoundary()) - { - return FALSE; - } - - CStringA strParamName; - CStringA strFileName; - CStringA strContentType; - CStringA strData; - BOOL bFound; - - while (!m_bFinished) - { - // look for "name" field - if (!GetMimeData(strParamName, "name=", sizeof("name=")-1, &bFound, TRUE) || !bFound) - { - ATLTRACE(atlTraceISAPI, 0, _T("Malformed Form-Data")); - return FALSE; - } - - // see if it's a file - if (!GetMimeData(strFileName, "filename=", sizeof("filename=")-1, &bFound, TRUE)) - { - ATLTRACE(atlTraceISAPI, 0, _T("Malformed Form-Data")); - return FALSE; - } - - if (bFound) - { - if (dwFlags & ATL_FORM_FLAG_REFUSE_FILES) - { - return FALSE; - } - - if (!strFileName.GetLength()) - { - if(!ReadUntilBoundary()) - { - return FALSE; - } - continue; - } - - if (!GetMimeData(strContentType, "Content-Type:", sizeof("Content-Type:")-1, &bFound, TRUE)) - { - ATLTRACE(atlTraceISAPI, 0, _T("Malformed Form-Data")); - return FALSE; - } - - // move to the actual uploaded data - if (!MoveToData()) - { - ATLTRACE(atlTraceISAPI, 0, _T("Malformed Form-Data")); - return FALSE; - } - - // if the user doesn't want files, don't save the file - if (dwFlags & ATL_FORM_FLAG_IGNORE_FILES) - { - if (!ReadUntilBoundary(NULL, NULL)) - { - return FALSE; - } - continue; - } - - CAtlTemporaryFile ctf; - HRESULT hr = ctf.Create(); - if (hr != S_OK) - return FALSE; - - if (!ReadUntilBoundary(NULL, &ctf)) - { - ctf.Close(); - return FALSE; - } - ULONGLONG nFileSize = 0; - if (ctf.GetSize(nFileSize) != S_OK) - return FALSE; - - if ((dwFlags & ATL_FORM_FLAG_IGNORE_EMPTY_FILES) && nFileSize == 0) - { - ctf.Close(); - continue; - } - - CAutoPtr spFile; - - CT2AEX szTempFileNameA(ctf.TempFileName()); - - ATLTRY(spFile.Attach(new CHttpRequestFile())); - if (!spFile) - { - return FALSE; - } - - if (!spFile->Initialize(strParamName, strFileName, szTempFileNameA, strContentType, nFileSize)) - { - // one of the strings was too long - return FALSE; - } - - if (!Files.SetAt(szTempFileNameA, spFile)) - { - return FALSE; - } - - spFile.Detach(); - - if (!pQueryParams || !pQueryParams->SetAt(strParamName, szTempFileNameA)) - { - return FALSE; - } - - ctf.HandsOff(); - - continue; - } - - // move to the actual uploaded data - if (!MoveToData()) - { - ATLTRACE(atlTraceISAPI, 0, _T("Malformed Form-Data")); - return FALSE; - } - - if (!ReadUntilBoundary(&strData)) - { - return FALSE; - } - - if ((dwFlags & ATL_FORM_FLAG_IGNORE_EMPTY_FIELDS) && strData.GetLength() == 0) - continue; - - if (!pQueryParams || !pQueryParams->SetAt(strParamName, strData)) - { - return FALSE; - } - - } - - return TRUE; - } - _ATLCATCHALL() - { - return FALSE; - } - } - -private: - - // implementation - - // case insensitive substring search -- does not handle multibyte characters (unlike tolower) - // allows searching up to a maximum point in a string - inline char AtlCharLower(__in char ch) throw() - { - if (ch > 64 && ch < 91) - { - return ch+32; - } - - return ch; - } - - inline __checkReturn char * _stristr (__in const char * str1, __in const char * str2) - { - ATLENSURE(str1!=NULL); - ATLENSURE(str2!=NULL); - char *cp = (char *) str1; - char *s1, *s2; - - if ( !*str2 ) - return((char *)str1); - - while (*cp) - { - s1 = cp; - s2 = (char *) str2; - - while ( *s1 && *s2 && !(AtlCharLower(*s1)-AtlCharLower(*s2)) ) - { - s1++, s2++; - } - - if (!*s2) - { - return(cp); - } - - cp++; - } - - return(NULL); - } - - - inline __checkReturn char * _stristrex (__in const char * str1, __in const char * str2, __in const char * str1End) - { - ATLENSURE(str1!=NULL); - ATLENSURE(str2!=NULL); - char *cp = (char *) str1; - char *s1, *s2; - - if ( !*str2 ) - return((char *)str1); - - while (cp != str1End) - { - s1 = cp; - s2 = (char *) str2; - - while ( s1 != str1End && *s2 && !(AtlCharLower(*s1)-AtlCharLower(*s2)) ) - { - s1++, s2++; - } - - if (!*s2) - { - return (cp); - } - - if (s1 == str1End) - { - return (NULL); - } - - cp++; - } - - return(NULL); - } - - inline __checkReturn char * _strstrex (__in const char * str1, __in const char * str2, __in const char * str1End) - { - ATLENSURE(str1!=NULL); - ATLENSURE(str2!=NULL); - char *cp = (char *) str1; - char *s1, *s2; - - if ( !*str2 ) - return((char *)str1); - - while (cp != str1End) - { - s1 = cp; - s2 = (char *) str2; - - while ( s1 != str1End && *s2 && !((*s1)-(*s2)) ) - { - s1++, s2++; - } - - if (!*s2) - { - return (cp); - } - - if (s1 == str1End) - { - return (NULL); - } - - cp++; - } - - return(NULL); - } - - ATL_NOINLINE __checkReturn BOOL InitializeParser() throw() - { - ATLASSUME( m_spServerContext != NULL ); - - _ATLTRY - { - DWORD dwBytesTotal = m_spServerContext->GetTotalBytes(); - - // if greater than bytes available, allocate necessary space - if (dwBytesTotal > m_spServerContext->GetAvailableBytes()) - { - m_pStart = (LPSTR) malloc(dwBytesTotal); - if (!m_pStart) - { - return FALSE; - } - m_pCurrent = m_pStart; - DWORD dwLen = dwBytesTotal; - if (!ReadClientData(m_spServerContext, m_pStart, &dwLen, 0) || dwLen != dwBytesTotal) - { - return FALSE; - } - } - else - { - m_pStart = (LPSTR) m_spServerContext->GetAvailableData(); - } - - m_pCurrent = m_pStart; - m_pEnd = m_pCurrent + dwBytesTotal; - - //get the boundary - LPCSTR pszContentType = m_spServerContext->GetContentType(); - ATLASSERT(pszContentType != NULL); - - LPCSTR pszTmp = _stristr(pszContentType, "boundary="); - if (!pszTmp) - { - ATLTRACE(atlTraceISAPI, 0, _T("Malformed Form-Data")); - return FALSE; - } - - pszTmp += sizeof("boundary=")-1; - BOOL bInQuote = FALSE; - if (*pszTmp == '\"') - { - bInQuote = TRUE; - pszTmp++; - } - - LPSTR pszMimeBoundary = m_szBoundary; - *pszMimeBoundary++ = '-'; - *pszMimeBoundary++ = '-'; - m_dwBoundaryLen = 2; - while (*pszTmp && (bInQuote || IsStandardBoundaryChar(*pszTmp))) - { - if (m_dwBoundaryLen >= MAX_MIME_BOUNDARY_LEN) - { - ATLTRACE(atlTraceISAPI, 0, _T("Malformed MIME boundary")); - return FALSE; - } - - if (*pszTmp == '\r' || *pszTmp == '\n') - { - if (bInQuote) - { - pszTmp++; - continue; - } - break; - } - if (bInQuote && *pszTmp == '"') - { - break; - } - - *pszMimeBoundary++ = *pszTmp++; - m_dwBoundaryLen++; - } - - *pszMimeBoundary = '\0'; - } - _ATLCATCHALL() - { - return FALSE; - } - - return TRUE; - } - - inline __checkReturn BOOL MoveToData() throw() - { - LPSTR szEnd = _strstrex(m_pCurrent, "\r\n\r\n", m_pEnd); - if (!szEnd) - { - return FALSE; - } - - m_pCurrent = szEnd+4; - if (m_pCurrent >= m_pEnd) - { - return FALSE; - } - - return TRUE; - } - - inline __checkReturn BOOL GetMimeData(__inout CStringA &str, __in_ecount(dwFieldLen) LPCSTR szField, __in DWORD dwFieldLen, __out LPBOOL pbFound, __in BOOL bIgnoreCase = FALSE) throw() - { - _ATLTRY - { - ATLASSERT( szField != NULL ); - ATLENSURE( pbFound != NULL ); - - *pbFound = FALSE; - - LPSTR szEnd = _strstrex(m_pCurrent, "\r\n\r\n", m_pEnd); - if (!szEnd) - { - return FALSE; - } - - LPSTR szDataStart = NULL; - - if (!bIgnoreCase) - { - szDataStart = _strstrex(m_pCurrent, szField, szEnd); - } - else - { - szDataStart = _stristrex(m_pCurrent, szField, szEnd); - } - - if (szDataStart) - { - szDataStart+= dwFieldLen; - if (szDataStart >= m_pEnd) - { - return FALSE; - } - - BOOL bInQuote = FALSE; - if (*szDataStart == '\"') - { - bInQuote = TRUE; - szDataStart++; - } - - LPSTR szDataEnd = szDataStart; - while (!bInQuote && (szDataEnd < m_pEnd) && (*szDataEnd == ' ' || *szDataEnd == '\t')) - { - szDataEnd++; - } - - if (szDataEnd >= m_pEnd) - { - return FALSE; - } - - while (szDataEnd < m_pEnd) - { - if (!IsValidTokenChar(*szDataEnd)) - { - if (*szDataEnd == '\"' || !bInQuote) - { - break; - } - } - szDataEnd++; - } - - if (szDataEnd >= m_pEnd) - { - return FALSE; - } - - str.SetString(szDataStart, (int)(szDataEnd-szDataStart)); - *pbFound = TRUE; - } - - return TRUE; - } - _ATLCATCHALL() - { - return FALSE; - } - } - - ATL_NOINLINE __checkReturn BOOL ReadUntilBoundary(__inout_opt CStringA* pStrData=NULL, __inout_opt CAtlTemporaryFile* pCtf=NULL) throw() - { - _ATLTRY - { - LPSTR szBoundaryStart = m_pCurrent; - LPSTR szBoundaryEnd = NULL; - - do - { - szBoundaryStart = _strstrex(szBoundaryStart, m_szBoundary, m_pEnd); - if (szBoundaryStart) - { - if ((szBoundaryStart-m_pStart) >= 2) - { - if (*(szBoundaryStart-1) != 0x0a || *(szBoundaryStart-2) != 0x0d) - { - szBoundaryStart++; - continue; - } - } - szBoundaryEnd = szBoundaryStart+m_dwBoundaryLen; - if (szBoundaryEnd+2 >= m_pEnd) - { - return FALSE; - } - if (szBoundaryEnd[0] == '\r' && szBoundaryEnd[1] == '\n') - { - break; - } - if (szBoundaryEnd[0] == '-' && szBoundaryEnd[1] == '-') - { - m_bFinished = TRUE; - break; - } - szBoundaryStart++; - } - } while (szBoundaryStart && szBoundaryStart < m_pEnd); - - if (!szBoundaryStart || szBoundaryStart >= m_pEnd) - { - return FALSE; - } - - if ((szBoundaryStart-m_pStart) >= 2) - { - szBoundaryStart-= 2; - } - if (pStrData) - { - pStrData->SetString(m_pCurrent, (int)(szBoundaryStart-m_pCurrent)); - } - if (pCtf) - { - if (FAILED(pCtf->Write(m_pCurrent, (DWORD)(szBoundaryStart-m_pCurrent)))) - { - return FALSE; - } - } - - if (!m_bFinished) - { - m_pCurrent = szBoundaryEnd+2; - if (m_pCurrent >= m_pEnd) - { - return FALSE; - } - } - - return TRUE; - } - _ATLCATCHALL() - { - return FALSE; - } - } - - static inline __checkReturn BOOL IsStandardBoundaryChar(__in CHAR ch) throw() - { - if ( (ch >= 'A' && ch <= 'Z') || - (ch >= 'a' && ch <= 'z') || - (ch >= '0' && ch <= '9') || - (ch == '\'') || - (ch == '+') || - (ch == '_') || - (ch == '-') || - (ch == '=') || - (ch == '?') ) - { - return TRUE; - } - - return FALSE; - } - - inline __checkReturn BOOL IsValidTokenChar(__in CHAR ch) throw() - { - return ( (ch != 0) && (ch != 0xd) && (ch != 0xa) && (ch != ' ') && (ch != '\"') ); - } - -private: - // Prevents copying. - CMultiPartFormParser(__in const CMultiPartFormParser& /*that*/) throw() - { - ATLASSERT(FALSE); - } - - const CMultiPartFormParser& operator=(__in const CMultiPartFormParser& /*that*/) throw() - { - ATLASSERT(FALSE); - return (*this); - } -}; // class CMultiPartFormParser - - -// 48K max form size -#ifndef DEFAULT_MAX_FORM_SIZE -#define DEFAULT_MAX_FORM_SIZE 49152 -#endif - -// This class provides access to the information contained in an HTTP request submitted to a web server. -// -// CHttpRequest provides access to the query string parameters, form fields, cookies, and files -// that make up an HTTP request, as well as many other important properties of the request. -class CHttpRequest : public IHttpRequestLookup -{ -protected: - // Implementation: Array used to map an HTTP request method (for example, "GET" or "POST") - // from a string to a numeric constant from the HTTP_METHOD enum (HTTP_METHOD_GET or HTTP_METHOD_HEAD). - static const char* const m_szMethodStrings[]; - - // Implementation: The server context. - CComPtr m_spServerContext; - - // Implementation: The number of bytes read from the body of the request. - DWORD m_dwBytesRead; - - // Implementation: TRUE if the request method was POST and the encoding was - // multipart/form-data, FALSE otherwise. - BOOL m_bMultiPart; - - CCookie m_EmptyCookie; - - // Implementation: Constructor function used to reinitialize all data members. - void Construct() throw() - { - m_spServerContext.Release(); - m_bMultiPart = FALSE; - m_dwBytesRead = 0; - if (m_pFormVars != &m_QueryParams) - delete m_pFormVars; - - m_pFormVars = NULL; - m_pFormVars = &m_QueryParams; - m_QueryParams.RemoveAll(); - m_QueryParams.SetShared(false); - - ClearFilesAndCookies(); - } - - void ClearFilesAndCookies() throw() - { - m_Files.RemoveAll(); - m_Files.SetShared(false); - m_requestCookies.RemoveAll(); - m_requestCookies.SetShared(false); - } - -public: - - // Implementation: The collection of query parameters (name-value pairs) obtained from the query string. - CHttpRequestParams m_QueryParams; - - // Implementation: The collection of form fields (name-value pairs). - // The elements of this collection are obtained from the query string for a GET request, - // or from the body of the request for a POST request. - CHttpRequestParams *m_pFormVars; - - // The array of CHttpRequestFiles obtained from the current request. - // See CHttpRequest::Initialize and CMultiPartFormParser::GetMultiPartData for more information. - typedef CHttpPtrMap > FileMap; - FileMap m_Files; - - // Implementation: The array of cookies obtained from the current request. - typedef CHttpMap > CookieMap; - CookieMap m_requestCookies; - - // Numeric constants for the HTTP request methods (such as GET and POST). - enum HTTP_METHOD - { - HTTP_METHOD_UNKNOWN=-1, - HTTP_METHOD_GET, - HTTP_METHOD_POST, - HTTP_METHOD_HEAD, - HTTP_METHOD_DELETE, - HTTP_METHOD_LINK, - HTTP_METHOD_UNLINK, - HTTP_METHOD_DEBUG // Debugging support for VS7 - }; - - // The collection of query parameters (name-value pairs) obtained from the query string. - // A read-only property. - __declspec(property(get=GetQueryParams)) const CHttpRequestParams& QueryParams; - - // Returns a reference to the collection of query parameters(name-value pairs) - // obtained from the query string. - const CHttpRequestParams& GetQueryParams() const throw() - { - return m_QueryParams; - } - - // The collection of form fields (name-value pairs). - // The elements of this collection are obtained from the query string for a GET request, - // or from the body of the request for a POST request. - // A read-only property. - __declspec(property(get=GetFormVars)) const CHttpRequestParams& FormVars; - - // Returns a reference to the collection of form fields (name-value pairs) - // obtained from the query string for a GET request, - // or from the body of the request for a POST request. - const CHttpRequestParams& GetFormVars() const throw() - { - return *m_pFormVars; - } - - CHttpRequest() throw() - { - m_bMultiPart = FALSE; - m_dwBytesRead = 0; - m_pFormVars = &m_QueryParams; - } - - virtual ~CHttpRequest() throw() - { - DeleteFiles(); - - if (m_pFormVars != &m_QueryParams) - { - delete m_pFormVars; - m_pFormVars = NULL; - } - } - - // Constructs and initializes the object. - CHttpRequest( - __in IHttpServerContext *pServerContext, - __in DWORD dwMaxFormSize=DEFAULT_MAX_FORM_SIZE, - __in DWORD dwFlags=ATL_FORM_FLAG_NONE) throw(...) - :m_pFormVars(NULL) - { - Construct(); - if (!Initialize(pServerContext, dwMaxFormSize, dwFlags)) - AtlThrow(E_FAIL); - } - - CHttpRequest(__in IHttpRequestLookup *pRequestLookup) throw(...) - :m_pFormVars(NULL) - { - if (!Initialize(pRequestLookup)) // Calls Construct for you - AtlThrow(E_FAIL); - } - - //========================================================================================= - // BEGIN IHttpRequestLoookup interface - //========================================================================================= - __success(return != NULL) __checkReturn POSITION GetFirstQueryParam(__deref_out LPCSTR *ppszName, __deref_out LPCSTR *ppszValue) - { - POSITION pos = m_QueryParams.GetStartPosition(); - if (pos != NULL) - { - ATLENSURE(ppszName != NULL); - ATLENSURE(ppszValue != NULL); - *ppszName = m_QueryParams.GetKeyAt(pos); - *ppszValue = m_QueryParams.GetValueAt(pos); - } - - return pos; - } - - __success(return != NULL) __checkReturn POSITION GetNextQueryParam(__in POSITION pos, __deref_out LPCSTR *ppszName, __deref_out LPCSTR *ppszValue) - { - ATLENSURE(pos != NULL); - - - POSITION posNext(pos); - m_QueryParams.GetNext(posNext); - if (posNext != NULL) - { - ATLENSURE(ppszName != NULL); - ATLENSURE(ppszValue != NULL); - *ppszName = m_QueryParams.GetKeyAt(posNext); - *ppszValue = m_QueryParams.GetValueAt(posNext); - } - - return posNext; - } - - __success(return != NULL) __checkReturn POSITION GetFirstFormVar(__deref_out LPCSTR *ppszName, __deref_out LPCSTR *ppszValue) - { - // if no form vars and just pointing to the query params, - // then return NULL - if (m_pFormVars == &m_QueryParams) - return NULL; - - POSITION pos = m_pFormVars->GetStartPosition(); - if (pos != NULL) - { - ATLENSURE(ppszName != NULL); - ATLENSURE(ppszValue != NULL); - *ppszName = m_pFormVars->GetKeyAt(pos); - *ppszValue = m_pFormVars->GetValueAt(pos); - } - - return pos; - } - - __success(return != NULL) __checkReturn POSITION GetNextFormVar(__in POSITION pos, __deref_out LPCSTR *ppszName, __deref_out LPCSTR *ppszValue) - { - ATLASSERT(pos != NULL); - ATLASSERT(ppszName != NULL); - ATLASSERT(ppszValue != NULL); - - POSITION posNext(pos); - m_pFormVars->GetNext(posNext); - if (posNext != NULL) - { - *ppszName = m_pFormVars->GetKeyAt(posNext); - *ppszValue = m_pFormVars->GetValueAt(posNext); - } - - return posNext; - } - - POSITION GetFirstFile(__in LPCSTR *ppszName, __deref_out IHttpFile **ppFile) - { - ATLASSERT(ppszName != NULL); - ATLASSERT(ppFile != NULL); - - POSITION pos = m_Files.GetStartPosition(); - if (pos != NULL) - { - *ppszName = m_Files.GetKeyAt(pos); - *ppFile = m_Files.GetValueAt(pos); - } - - return pos; - } - - __success(return != NULL) __checkReturn POSITION GetNextFile(__in POSITION pos, __deref_out LPCSTR *ppszName, __deref_out IHttpFile **ppFile) - { - ATLASSERT(pos != NULL); - ATLASSERT(ppszName != NULL); - ATLASSERT(ppFile != NULL); - - m_Files.GetNext(pos); - if (pos != NULL) - { - *ppszName = m_Files.GetKeyAt(pos); - *ppFile = m_Files.GetValueAt(pos); - } - - return pos; - } - - // Returns a pointer to the IHttpServerContext interface for the current request. - HRESULT GetServerContext(__deref_out_opt IHttpServerContext ** ppOut) - { - return m_spServerContext.CopyTo(ppOut); - } - //========================================================================================= - // END IHttpRequestLookup interface - //========================================================================================= - - __success(return != NULL) __checkReturn POSITION GetFirstCookie(__deref_out LPCSTR *ppszName, __deref_out const CCookie **ppCookie) throw() - { - ATLASSERT(ppszName != NULL); - ATLASSERT(ppCookie != NULL); - POSITION pos = NULL; - if (GetRequestCookies()) - { - pos = m_requestCookies.GetStartPosition(); - if (pos != NULL) - { - *ppszName = m_requestCookies.GetKeyAt(pos); - *ppCookie = &(m_requestCookies.GetValueAt(pos)); - } - } - return pos; - } - - __success(return != NULL) __checkReturn POSITION GetNextCookie(__in POSITION pos, __deref_out LPCSTR *ppszName, __deref_out const CCookie **ppCookie) throw() - { - ATLASSERT(pos != NULL); - ATLASSERT(ppszName != NULL); - ATLASSERT(ppCookie != NULL); - - POSITION posNext(pos); - m_requestCookies.GetNext(posNext); - if (posNext != NULL) - { - *ppszName = m_requestCookies.GetKeyAt(posNext); - *ppCookie = &(m_requestCookies.GetValueAt(posNext)); - } - return posNext; - } - - void SetServerContext(__in IHttpServerContext *pServerContext) throw() - { - m_spServerContext = pServerContext; - } - - BOOL Initialize(__in IHttpRequestLookup *pRequestLookup) throw() - { - _ATLTRY - { - ATLASSERT(pRequestLookup != NULL); - // if there's no pRequestLookup, just return - if (!pRequestLookup) - return TRUE; - - Construct(); - HRESULT hr = pRequestLookup->GetServerContext(&m_spServerContext); - if (FAILED(hr)) - return FALSE; - - LPCSTR szName(NULL); - LPCSTR szValue(NULL); - - // Initialize query params from the IHttpRequestLookup* - POSITION pos(pRequestLookup->GetFirstQueryParam(&szName, &szValue)); - while (pos != NULL) - { - m_QueryParams.SetAt(szName, szValue); - pos = pRequestLookup->GetNextQueryParam(pos, &szName, &szValue); - } - m_QueryParams.SetShared(true); - - // Initialize the form vars from the IHttpRequestLookup* - pos = pRequestLookup->GetFirstFormVar(&szName, &szValue); - if (pos) - { - m_pFormVars = NULL; - ATLTRY(m_pFormVars = new CHttpRequestParams); - if (!m_pFormVars) - return FALSE; - - while (pos != NULL) - { - m_pFormVars->SetAt(szName, szValue); - pos = pRequestLookup->GetNextFormVar(pos, &szName, &szValue); - } - m_pFormVars->SetShared(true); - } - else - { - m_pFormVars = &m_QueryParams; - } - - // Initialize the files from the IHttpRequestLookup* - IHttpFile *pFile(NULL); - pos = pRequestLookup->GetFirstFile(&szName, &pFile); - while (pos != NULL) - { - m_Files.SetAt(szName, pFile); - pos = pRequestLookup->GetNextFile(pos, &szName, &pFile); - } - m_Files.SetShared(true); - - // Initialzie the cookies form the IHttpRequestLookup* - BOOL bRet = FALSE; - CStringA strCookies; - bRet = GetCookies(strCookies); - if (bRet) - { - bRet = Parse(strCookies); - } - m_requestCookies.SetShared(false); - return bRet; - } // _ATLTRY - _ATLCATCHALL() - { - } - return FALSE; - } - - // Call this function to initialize the object with information about the current request. - // - // Returns TRUE on success, FALSE on failure. - // - // Call Initialize directly or via the appropriate constructor before using the methods and - // properties of the request object. - // - // Initialize does the following: - // - // Parses and decodes the query string into a collection of name-value pairs. - // This collection is accessible via the GetQueryParams method or the QueryParams property. - // - // Sets m_bMultiPart to TRUE if the request is a POST request with multipart/form-data encoding. - // - // Parses the body of a POST request if the size of the request data is less than or equal to dwMaxFormSize. - // The body of the request will consist of simple form fields and may also contain files if the request is encoded as multipart/form-data. - // In that case, the dwFlags parameter is passed to CMultiPartFormParser::GetMultiPartData to control the creation of the files. - // The collection of form fields is accessible via the GetFormVars method or the FormVars property. - // The collection of files is accessible via the m_Files member. - // - // Note that Initialize does not parse the cookies associated with a request. - // Cookies are not processed until an attempt is made to access a cookie in the collection. - BOOL Initialize( - __in IHttpServerContext *pServerContext, - __in DWORD dwMaxFormSize=DEFAULT_MAX_FORM_SIZE, - __in DWORD dwFlags=ATL_FORM_FLAG_NONE) throw() - { - _ATLTRY - { - ATLASSERT(pServerContext != NULL); - if (!pServerContext) - { - return FALSE; - } - - m_spServerContext = pServerContext; - - HTTP_METHOD httpMethod = GetMethod(); - LPCSTR pszQueryString = GetQueryString(); - if (pszQueryString && *pszQueryString) - { - // Parse the query string. - CHAR szQueryString[ATL_URL_MAX_URL_LENGTH]; - if (!SafeStringCopy(szQueryString, pszQueryString)) - { - return FALSE; - } - - if (!m_QueryParams.Parse(szQueryString)) - { - return FALSE; - } - } - - if (m_QueryParams.IsShared()) - { - return TRUE; - } - - // If this is a GET request, the collection of form fields - // is the same as the collection of query parameters. - if (httpMethod == HTTP_METHOD_GET) - { - m_pFormVars = &m_QueryParams; - return TRUE; - } - else if (httpMethod == HTTP_METHOD_POST) - { - LPCSTR szContentType = GetContentType(); - if (!szContentType) - return FALSE; - - // Don't parse the form data if the size is bigger than the maximum specified. - if (m_spServerContext->GetTotalBytes() > dwMaxFormSize) - { - if (strncmp(szContentType, "multipart/form-data", 19) == 0) - m_bMultiPart = TRUE; - - m_dwBytesRead = 0; - - return TRUE; - } - - // If POSTed data is urlencoded, call InitFromPost. - if (strncmp(szContentType, "application/x-www-form-urlencoded", 33) == 0 && !m_pFormVars->IsShared()) - return InitFromPost(); - - // If POSTed data is encoded as multipart/form-data, use CMultiPartFormParser. - if (strncmp(szContentType, "multipart/form-data", 19) == 0 && !m_pFormVars->IsShared()) - { - if (m_pFormVars != &m_QueryParams) - delete m_pFormVars; - m_pFormVars = NULL; - - CMultiPartFormParser FormParser(m_spServerContext); - ATLTRY(m_pFormVars = new CHttpRequestParams); - if (!m_pFormVars) - return FALSE; - - BOOL bRet = FormParser.GetMultiPartData(m_Files, m_pFormVars, dwFlags); - return bRet; - } - - // else initialize m_dwBytesRead for ReadData - m_dwBytesRead = 0; - } - - return TRUE; - } - _ATLCATCHALL() - { - } - return FALSE; - - } - - // Implementation: Call this function to initialize the collection of form fields - // from the body of an application/x-www-form-urlencoded POST request. - ATL_NOINLINE BOOL InitFromPost() throw() - { - _ATLTRY - { - ATLASSUME(m_spServerContext != NULL); - - // create our m_pFormVars - if (m_pFormVars == NULL || m_pFormVars == &m_QueryParams) - { - ATLTRY(m_pFormVars = new CHttpRequestParams); - if (m_pFormVars == NULL) - { - return FALSE; - } - } - - // read the form data into a buffer - DWORD dwBytesTotal = m_spServerContext->GetTotalBytes(); - CAutoVectorPtr szBuff; - if ((dwBytesTotal+1 < dwBytesTotal) || (dwBytesTotal < 0)) - { - return FALSE; - } - if (!szBuff.Allocate(dwBytesTotal+1)) - { - return FALSE; - } - // first copy the available - BOOL bRet = ReadClientData(m_spServerContext, szBuff, &dwBytesTotal, 0); - if (bRet) - { - szBuff[dwBytesTotal] = '\0'; - bRet = m_pFormVars->Parse(szBuff); - } - - return bRet; - } - _ATLCATCHALL() - { - } - return FALSE; - } - - // Call this function to remove the files listed in m_Files from the web server's hard disk. - // Returns the number of files deleted. - int DeleteFiles() throw() - { - int nDeleted = 0; - POSITION pos = m_Files.GetStartPosition(); - while (pos != NULL) - { - LPCSTR szTempFile = m_Files.GetKeyAt(pos); - if (szTempFile && DeleteFileA(szTempFile)) - { - nDeleted++; - } - m_Files.GetNext(pos); - } - - return nDeleted; - } - - // Read a specified amount of data into pbDest and return the bytes read in pdwLen. - // Returns TRUE on success, FALSE on failure. - BOOL ReadData(__out_ecount_part(*pdwLen,*pdwLen) LPSTR pDest, __inout LPDWORD pdwLen) - { - ATLENSURE(pDest); - ATLENSURE(pdwLen); - - BOOL bRet = ReadClientData(m_spServerContext, pDest, pdwLen, m_dwBytesRead); - if (bRet) - m_dwBytesRead+= *pdwLen; - return bRet; - } - - // Returns the number of bytes available in the request buffer accessible via GetAvailableData. - // If GetAvailableBytes returns the same value as GetTotalBytes, the request buffer contains the whole request. - // Otherwise, the remaining data should be read from the client using ReadData. - // Equivalent to EXTENSION_CONTROL_BLOCK::cbAvailable. - __checkReturn DWORD GetAvailableBytes() throw(...) - { - ATLENSURE(m_spServerContext); - return m_spServerContext->GetAvailableBytes(); - } - - // Returns the total number of bytes to be received from the client. - // If this value is 0xffffffff, then there are four gigabytes or more of available data. - // In this case, ReadData should be called until no more data is returned. - // Equivalent to the CONTENT_LENGTH server variable or EXTENSION_CONTROL_BLOCK::cbTotalBytes. - __checkReturn DWORD GetTotalBytes() throw(...) - { - ATLENSURE(m_spServerContext); - return m_spServerContext->GetTotalBytes(); - } - - // Returns a pointer to the request buffer containing the data sent by the client. - // The size of the buffer can be determined by calling GetAvailableBytes. - // Equivalent to EXTENSION_CONTROL_BLOCK::lpbData - __checkReturn LPBYTE GetAvailableData() throw(...) - { - ATLENSURE(m_spServerContext); - return m_spServerContext->GetAvailableData(); - } - - - // Returns a nul-terminated string that contains the query information. - // This is the part of the URL that appears after the question mark (?). - // Equivalent to the QUERY_STRING server variable or EXTENSION_CONTROL_BLOCK::lpszQueryString. - __checkReturn LPCSTR GetQueryString() throw(...) - { - ATLENSURE(m_spServerContext); - return m_spServerContext->GetQueryString(); - } - - // Returns a nul-terminated string that contains the HTTP method of the current request. - // Examples of common HTTP methods include "GET" and "POST". - // Equivalent to the REQUEST_METHOD server variable or EXTENSION_CONTROL_BLOCK::lpszMethod. - __checkReturn LPCSTR GetMethodString() throw(...) - { - ATLENSURE(m_spServerContext); - return m_spServerContext->GetRequestMethod(); - } - - // Returns an HTTP_METHOD enum value corresponding to the HTTP method of the current request. - // Returns HTTP_METHOD_UNKNOWN if the request method is not one of the following methods: - // GET - // POST - // HEAD - // DELETE - // LINK - // UNLINK - __checkReturn HTTP_METHOD GetMethod() throw(...) - { - LPCSTR szMethod = GetMethodString(); - if (!szMethod) - return HTTP_METHOD_UNKNOWN; - for (int i=0; m_szMethodStrings[i]; i++) - { - if (strcmp(szMethod, m_szMethodStrings[i]) == 0) - return (HTTP_METHOD) i; - } - return HTTP_METHOD_UNKNOWN; - } - - // Returns a nul-terminated string that contains the content type of the data sent by the client. - // Equivalent to the CONTENT_TYPE server variable or EXTENSION_CONTROL_BLOCK::lpszContentType. - __checkReturn LPCSTR GetContentType() throw(...) - { - ATLENSURE(m_spServerContext); - return m_spServerContext->GetContentType(); - } - - - // Call this function to retrieve a nul-terminated string containing the value of the "AUTH_USER" server variable. - // - // Returns TRUE on success, FALSE on failure. Call GetLastError to get extended error information. - // - // On entry, pdwSize should point to a DWORD that indicates the size of the buffer in bytes. - // On exit, the DWORD contains the number of bytes transferred or available to be transferred into the buffer (including the nul-terminating byte). - __checkReturn BOOL GetAuthUserName(__out_ecount_part(*pdwSize,*pdwSize) LPSTR szBuff, __inout DWORD *pdwSize) throw(...) - { - ATLENSURE(m_spServerContext); - return m_spServerContext->GetServerVariable("AUTH_USER", szBuff, pdwSize); - } - - // Call this function to retrieve a nul-terminated string containing the value of the "APPL_PHYSICAL_PATH" server variable. - // - // Returns TRUE on success, FALSE on failure. Call GetLastError to get extended error information. - // - // On entry, pdwSize should point to a DWORD that indicates the size of the buffer in bytes. - // On exit, the DWORD contains the number of bytes transferred or available to be transferred into the buffer (including the nul-terminating byte). - __checkReturn BOOL GetPhysicalPath(__out_ecount_part(*pdwSize,*pdwSize) LPSTR szBuff, __inout DWORD *pdwSize) throw(...) - { - ATLENSURE(m_spServerContext); - return m_spServerContext->GetServerVariable("APPL_PHYSICAL_PATH", szBuff, pdwSize); - } - - // Call this function to retrieve a nul-terminated string containing the value of the "AUTH_PASSWORD" server variable. - // - // Returns TRUE on success, FALSE on failure. Call GetLastError to get extended error information. - // - // On entry, pdwSize should point to a DWORD that indicates the size of the buffer in bytes. - // On exit, the DWORD contains the number of bytes transferred or available to be transferred into the buffer (including the nul-terminating byte). - __checkReturn BOOL GetAuthUserPassword(__out_ecount_part(*pdwSize,*pdwSize) LPSTR szBuff, __inout DWORD *pdwSize) throw(...) - { - ATLENSURE(m_spServerContext); - return m_spServerContext->GetServerVariable("AUTH_PASSWORD", szBuff, pdwSize); - } - - // Call this function to retrieve a nul-terminated string containing the value of the "URL" server variable. - // - // Returns TRUE on success, FALSE on failure. Call GetLastError to get extended error information. - // - // On entry, pdwSize should point to a DWORD that indicates the size of the buffer in bytes. - // On exit, the DWORD contains the number of bytes transferred or available to be transferred into the buffer (including the nul-terminating byte). - __checkReturn BOOL GetUrl(__out_ecount_part(*pdwSize,*pdwSize) LPSTR szBuff, DWORD *pdwSize) throw(...) - { - ATLENSURE(m_spServerContext); - return m_spServerContext->GetServerVariable("URL", szBuff, pdwSize); - } - - // Call this function to retrieve a nul-terminated string containing the value of the "REMOTE_HOST" server variable. - // - // Returns TRUE on success, FALSE on failure. Call GetLastError to get extended error information. - // - // On entry, pdwSize should point to a DWORD that indicates the size of the buffer in bytes. - // On exit, the DWORD contains the number of bytes transferred or available to be transferred into the buffer (including the nul-terminating byte). - __checkReturn BOOL GetUserHostName(__out_ecount_part(*pdwSize,*pdwSize) LPSTR szBuff, __inout DWORD *pdwSize) throw(...) - { - ATLENSURE(m_spServerContext); - return m_spServerContext->GetServerVariable("REMOTE_HOST", szBuff, pdwSize); - } - - // Call this function to retrieve a nul-terminated string containing the value of the "REMOTE_ADDR" server variable. - // - // Returns TRUE on success, FALSE on failure. Call GetLastError to get extended error information. - // - // On entry, pdwSize should point to a DWORD that indicates the size of the buffer in bytes. - // On exit, the DWORD contains the number of bytes transferred or available to be transferred into the buffer (including the nul-terminating byte). - __checkReturn BOOL GetUserHostAddress(__out_ecount_part(*pdwSize,*pdwSize) LPSTR szBuff, __inout DWORD *pdwSize) throw(...) - { - ATLENSURE(m_spServerContext); - return m_spServerContext->GetServerVariable("REMOTE_ADDR", szBuff, pdwSize); - } - - // Call this function to retrieve a nul-terminated string containing the physical path of the script. - // - // Returns TRUE on success, FALSE on failure. Call GetLastError to get extended error information. - // - // On entry, pdwSize should point to a DWORD that indicates the size of the buffer in bytes. - // On exit, the DWORD contains the number of bytes transferred or available to be transferred into the buffer (including the nul-terminating byte). - // The script path is the same as GetPathTranslated up to the first .srf or .dll. - // For example, if GetPathTranslated returns "c:\inetpub\vcisapi\hello.srf\goodmorning", - // then this function returns "c:\inetpub\vcisapi\hello.srf". - __checkReturn LPCSTR GetScriptPathTranslated() throw(...) - { - ATLENSURE(m_spServerContext); - return m_spServerContext->GetScriptPathTranslated(); - } - - // Returns a nul-terminated string that contains the physical path of the requested resource on the local server. - // Equivalent to the PATH_TRANSLATED server variable or EXTENSION_CONTROL_BLOCK::lpszPathTranslated. - __checkReturn LPCSTR GetPathTranslated() throw(...) - { - ATLENSURE(m_spServerContext); - return m_spServerContext->GetPathTranslated(); - } - - // Returns a nul-terminated string that contains the path of the current request. - // This is the part of the URL that appears after the server name, but before the query string. - // Equivalent to the PATH_INFO server variable or EXTENSION_CONTROL_BLOCK::lpszPathInfo. - __checkReturn LPCSTR GetPathInfo() throw(...) - { - ATLENSURE(m_spServerContext); - return m_spServerContext->GetPathInfo(); - } - - // Call this function to determine whether the current request was authenticated. - __checkReturn BOOL GetAuthenticated() throw(...) - { - // We assume that if we get an authentication type from IIS, - // then the user has been authenticated. - CStringA strAuthType; - if (GetAuthenticationType(strAuthType) && - strAuthType.GetLength() > 0) - return TRUE; - - return FALSE; - } - - // Call this function to retrieve a nul-terminated string containing the value of the "AUTH_TYPE" server variable. - // - // Returns TRUE on success, FALSE on failure. Call GetLastError to get extended error information. - // - // On entry, pdwSize should point to a DWORD that indicates the size of the buffer in bytes. - // On exit, the DWORD contains the number of bytes transferred or available to be transferred into the buffer (including the nul-terminating byte). - __checkReturn BOOL GetAuthenticationType(__out_ecount_part(*pdwSize,*pdwSize) LPSTR szBuff, __inout DWORD *pdwSize) throw(...) - { - ATLENSURE(m_spServerContext); - return m_spServerContext->GetServerVariable("AUTH_TYPE", szBuff, pdwSize); - } - - // Call this function to retrieve a nul-terminated string containing the value of the "REMOTE_USER" server variable. - // - // Returns TRUE on success, FALSE on failure. Call GetLastError to get extended error information. - // - // On entry, pdwSize should point to a DWORD that indicates the size of the buffer in bytes. - // On exit, the DWORD contains the number of bytes transferred or available to be transferred into the buffer (including the nul-terminating byte). - __checkReturn BOOL GetUserName(__out_ecount_part(*pdwSize,*pdwSize) LPSTR szBuff, DWORD __inout *pdwSize) throw(...) - { - ATLENSURE(m_spServerContext); - return m_spServerContext->GetServerVariable("REMOTE_USER", szBuff, pdwSize); - } - - // Call this function to retrieve a nul-terminated string containing the value of the "HTTP_USER_AGENT" server variable. - // - // Returns TRUE on success, FALSE on failure. Call GetLastError to get extended error information. - // - // On entry, pdwSize should point to a DWORD that indicates the size of the buffer in bytes. - // On exit, the DWORD contains the number of bytes transferred or available to be transferred into the buffer (including the nul-terminating byte). - __checkReturn BOOL GetUserAgent(__out_ecount_part(*pdwSize,*pdwSize) LPSTR szBuff, __inout DWORD *pdwSize) throw(...) - { - ATLENSURE(m_spServerContext); - return m_spServerContext->GetServerVariable("HTTP_USER_AGENT", szBuff, pdwSize); - } - - // Call this function to retrieve a nul-terminated string containing the value of the "HTTP_ACCEPT_LANGUAGE" server variable. - // - // Returns TRUE on success, FALSE on failure. Call GetLastError to get extended error information. - // - // On entry, pdwSize should point to a DWORD that indicates the size of the buffer in bytes. - // On exit, the DWORD contains the number of bytes transferred or available to be transferred into the buffer (including the nul-terminating byte). - __checkReturn BOOL GetUserLanguages(__out_ecount_part(*pdwSize,*pdwSize) LPSTR szBuff, __inout DWORD *pdwSize) throw(...) - { - ATLENSURE(m_spServerContext); - return m_spServerContext->GetServerVariable("HTTP_ACCEPT_LANGUAGE", szBuff, pdwSize); - } - - // Call this function to retrieve a nul-terminated string containing the value of the "HTTP_ACCEPT" server variable. - // - // Returns TRUE on success, FALSE on failure. Call GetLastError to get extended error information. - // - // On entry, pdwSize should point to a DWORD that indicates the size of the buffer in bytes. - // On exit, the DWORD contains the number of bytes transferred or available to be transferred into the buffer (including the nul-terminating byte). - __checkReturn BOOL GetAcceptTypes(__out_ecount_part(*pdwSize,*pdwSize) LPSTR szBuff, __inout DWORD *pdwSize) throw(...) - { - ATLENSURE(m_spServerContext); - return m_spServerContext->GetServerVariable("HTTP_ACCEPT", szBuff, pdwSize); - } - - // Call this function to retrieve a nul-terminated string containing the value of the "HTTP_ACCEPT_ENCODING" server variable. - // - // Returns TRUE on success, FALSE on failure. Call GetLastError to get extended error information. - // - // On entry, pdwSize should point to a DWORD that indicates the size of the buffer in bytes. - // On exit, the DWORD contains the number of bytes transferred or available to be transferred into the buffer (including the nul-terminating byte). - __checkReturn BOOL GetAcceptEncodings(__out_ecount_part(*pdwSize,*pdwSize) LPSTR szBuff, __inout DWORD *pdwSize) throw(...) - { - ATLENSURE(m_spServerContext); - return m_spServerContext->GetServerVariable("HTTP_ACCEPT_ENCODING", szBuff, pdwSize); - } - - - // Call this function to retrieve a nul-terminated string containing the value of the "HTTP_REFERER" server variable. - // - // Returns TRUE on success, FALSE on failure. Call GetLastError to get extended error information. - // - // On entry, pdwSize should point to a DWORD that indicates the size of the buffer in bytes. - // On exit, the DWORD contains the number of bytes transferred or available to be transferred into the buffer (including the nul-terminating byte). - __checkReturn BOOL GetUrlReferer(__out_ecount_part(*pdwSize,*pdwSize) LPSTR szBuff, __inout DWORD *pdwSize) throw(...) - { - ATLENSURE(m_spServerContext); - return m_spServerContext->GetServerVariable("HTTP_REFERER", szBuff, pdwSize); - } - - // Call this function to retrieve a nul-terminated string containing the value of the "SCRIPT_NAME" server variable. - // - // Returns TRUE on success, FALSE on failure. Call GetLastError to get extended error information. - // - // On entry, pdwSize should point to a DWORD that indicates the size of the buffer in bytes. - // On exit, the DWORD contains the number of bytes transferred or available to be transferred into the buffer (including the nul-terminating byte). - __checkReturn BOOL GetScriptName(__out_ecount_part(*pdwSize,*pdwSize) LPSTR szBuff, __inout DWORD *pdwSize) throw(...) - { - ATLENSURE(m_spServerContext); - return m_spServerContext->GetServerVariable("SCRIPT_NAME", szBuff, pdwSize); - } - - // Fills a buffer with the contents of the HTTP_COOKIE headers sent - // from the browser. - __checkReturn BOOL GetCookies(__out_ecount_part(*pdwSize,*pdwSize) LPSTR szBuf, __inout LPDWORD pdwSize) const throw(...) - { - ATLASSERT(szBuf != NULL); - - CStringA strCookie; - if (GetCookies(strCookie)) - { - ATLENSURE(pdwSize != NULL); - if (pdwSize && *pdwSize > (DWORD)strCookie.GetLength()) - { - Checked::strcpy_s(szBuf, *pdwSize, strCookie); - *pdwSize = strCookie.GetLength(); - return true; - } - } - return false; - } - - // Fills a CStringA with the contents of the HTTP_COOKIE headers sent - // from the browser. - __checkReturn BOOL GetCookies(__inout CStringA& strBuff) const throw() - { - return GetServerVariable("HTTP_COOKIE", strBuff); - } - - // Call this function to retrieve a reference to the specified cookie. - // Returns a CCookie reference to the specified cookie or a - // reference to an empty cookie if the name can not be found. - ATL_NOINLINE const CCookie& Cookies(__in LPCSTR szName) throw(...) - { - if (GetRequestCookies()) - { - // p->m_value is a const CCookie& - CookieMap::CPair *p = NULL; - ATLTRY(p = m_requestCookies.Lookup(szName)); - if (p) - { - return p->m_value; - } - } - m_EmptyCookie.Empty(); // make sure it is cleared. - return m_EmptyCookie; - } - - - // Call this function to retrieve the session cookie. - const CCookie& GetSessionCookie() throw(...) - { - return Cookies(SESSION_COOKIE_NAME); - } - - // Call this function to retrieve the value of the requested server variable in a CStringA object. - // Returns TRUE on success, and FALSE on failure. Call GetLastError to get extended error information. - // Equivalent to EXTENSION_CONTROL_BLOCK::GetServerVariable. - BOOL GetServerVariable(__in LPCSTR szVariable, __out CStringA &str) const - { - ATLENSURE(m_spServerContext); - - DWORD dwSize = 0; - BOOL bRet = FALSE; - _ATLTRY - { - m_spServerContext->GetServerVariable(szVariable, NULL, &dwSize); - bRet = m_spServerContext->GetServerVariable(szVariable, str.GetBuffer(dwSize), &dwSize); - if (dwSize > 0) - dwSize--; - str.ReleaseBuffer(dwSize); - } - _ATLCATCHALL() - { - bRet = FALSE; - } - return bRet; - } - - // Call this function to retrieve the value of the "APPL_PHYSICAL_PATH" server variable. - // Returns TRUE on success, FALSE on failure. Call GetLastError to get extended error information. - __checkReturn BOOL GetPhysicalPath(__out CStringA &str) throw() - { - return GetServerVariable("APPL_PHYSICAL_PATH", str); - } - - // Call this function to retrieve the value of the "REMOTE_HOST" server variable. - // Returns TRUE on success, FALSE on failure. Call GetLastError to get extended error information. - __checkReturn BOOL GetUserHostName(__out CStringA &str) throw() - { - return GetServerVariable("REMOTE_HOST", str); - } - - // Call this function to retrieve the value of the "REMOTE_ADDR" server variable. - // Returns TRUE on success, FALSE on failure. Call GetLastError to get extended error information. - __checkReturn BOOL GetUserHostAddress(__out CStringA &str) throw() - { - return GetServerVariable("REMOTE_ADDR", str); - } - - // Call this function to retrieve the value of the "AUTH_TYPE" server variable. - // Returns TRUE on success, FALSE on failure. Call GetLastError to get extended error information. - __checkReturn BOOL GetAuthenticationType(__out CStringA &str) throw() - { - return GetServerVariable("AUTH_TYPE", str); - } - - // Call this function to retrieve the value of the "REMOTE_USER" server variable. - // Returns TRUE on success, FALSE on failure. Call GetLastError to get extended error information. - __checkReturn BOOL GetUserName(__out CStringA &str) throw() - { - return GetServerVariable("REMOTE_USER", str); - } - - // Call this function to retrieve the value of the "HTTP_USER_AGENT" server variable. - // Returns TRUE on success, FALSE on failure. Call GetLastError to get extended error information. - __checkReturn BOOL GetUserAgent(__out CStringA &str) throw() - { - return GetServerVariable("HTTP_USER_AGENT", str); - } - - // Call this function to retrieve the value of the "HTTP_ACCEPT_LANGUAGE" server variable. - // Returns TRUE on success, FALSE on failure. Call GetLastError to get extended error information. - __checkReturn BOOL GetUserLanguages(__out CStringA &str) throw() - { - return GetServerVariable("HTTP_ACCEPT_LANGUAGE", str); - } - - // Call this function to retrieve the value of the "AUTH_USER" server variable. - // Returns TRUE on success, FALSE on failure. Call GetLastError to get extended error information. - __checkReturn BOOL GetAuthUserName(__out CStringA &str) throw() - { - return GetServerVariable("AUTH_USER", str); - } - - // Call this function to retrieve the value of the "AUTH_PASSWORD" server variable. - // Returns TRUE on success, FALSE on failure. Call GetLastError to get extended error information. - __checkReturn BOOL GetAuthUserPassword(__out CStringA &str) throw() - { - return GetServerVariable("AUTH_PASSWORD", str); - } - - // Call this function to retrieve the value of the "URL" server variable. - // Returns TRUE on success, FALSE on failure. Call GetLastError to get extended error information. - __checkReturn BOOL GetUrl(__out CStringA &str) throw() - { - return GetServerVariable("URL", str); - } - - // Call this function to retrieve the value of the "HTTP_ACCEPT" server variable. - // Returns TRUE on success, FALSE on failure. Call GetLastError to get extended error information. - __checkReturn BOOL GetAcceptTypes(__out CStringA &str) throw() - { - return GetServerVariable("HTTP_ACCEPT", str); - } - - // Call this function to retrieve the value of the "HTTP_ACCEPT_ENCODING" server variable. - // Returns TRUE on success, FALSE on failure. Call GetLastError to get extended error information. - __checkReturn BOOL GetAcceptEncodings(__out CStringA& str) throw() - { - return GetServerVariable("HTTP_ACCEPT_ENCODING", str); - } - - // Call this function to retrieve the value of the "HTTP_REFERER" server variable. - // Returns TRUE on success, FALSE on failure. Call GetLastError to get extended error information. - __checkReturn BOOL GetUrlReferer(__out CStringA &str) throw() - { - return GetServerVariable("HTTP_REFERER", str); - } - - // Call this function to retrieve the value of the "SCRIPT_NAME" server variable. - // Returns TRUE on success, FALSE on failure. Call GetLastError to get extended error information. - __checkReturn BOOL GetScriptName(__out CStringA &str) throw() - { - return GetServerVariable("SCRIPT_NAME", str); - } - - // Implementation: Call this function to populate the collection - // of CCookie objects with the cookies in the current request. - // Returns TRUE on success, FALSE on failure. - __checkReturn BOOL GetRequestCookies() throw() - { - BOOL bRet = FALSE; - - if (m_requestCookies.GetCount()) - return TRUE; // we already got the cookies! - - CStringA strCookies; - if (GetCookies(strCookies)) - { - bRet = Parse(strCookies); - } - return bRet; - } - -private: - struct Pair - { - Pair(__in const CStringA &n, __in const CStringA& v) - { - name = n; - value = v; - } - - Pair(__in const Pair& rhs) - { - name = rhs.name; - value = rhs.value; - } - - CStringA name; - CStringA value; - }; - static const int INVALID_COOKIE_VERSION = -1; -public: - - // Implementation: Call this function to populate m_requestCookies - // with a collection of CCookie objects which represents the - // cookies contained in szCookie header sent from the browser. - BOOL Parse(__in LPCSTR szCookieIn) - { - ATLENSURE(szCookieIn!=NULL); - UINT acp = GetACP(); - LPCSTR szStart; - LPCSTR szEnd; - CStringA name, value; - CAtlList pair_list; - - // create a list of name=value pairs - // these are separated by or ; - szStart = szCookieIn; - szEnd = szStart; - while (*szStart) - { - name.Empty(); - value.Empty(); - szStart = SkipSpace(szStart, (WORD)acp); - if (*szStart == '\0') - break; - - szEnd = szStart; - while (*szEnd && *szEnd != '=' && *szEnd != ';' ) - szEnd++; - - if (szEnd <= szStart) - { - if (*szEnd ==';') - { - szEnd++; - szStart = szEnd; - continue; - } - szStart = szEnd; - break; // no name or error - } - - CopyToCString(name, szStart, szEnd); - if (*szEnd == '\0' || *szEnd == ';' ) - { - // no value expected; - pair_list.AddTail(Pair(name, value)); - szStart = szEnd; - } - else if ( *szEnd == '=') - { - szEnd++; // skip '=' - szStart = szEnd; - while (*szEnd && *szEnd != ';') - szEnd++; - - if (szEnd <= szStart) - { - if (*szEnd == ';') - { - szEnd++; - szStart = szEnd; - continue; - } - szStart = szEnd; - pair_list.AddTail(Pair(name,value)); - break; // no value - } - - CopyToCString(value, szStart, szEnd); - pair_list.AddTail(Pair(name,value)); - szStart = szEnd; - } - } - - // now make cookies out of the list - // The first item could be $Version, which would - // be the version for all cookies in the list. - // any other $Version's found in the list will be ignored. - if (pair_list.GetCount() <= 0) - return TRUE; // nothing in the list - - // check for $Version - static const char szVersion[] = "$Version"; - int nVersion = INVALID_COOKIE_VERSION; - if (!strncmp(pair_list.GetHead().name, szVersion, sizeof(szVersion)+1)) - { - char *pStop = NULL; - errno_t errnoValue = AtlStrToNum(&nVersion, pair_list.GetHead().value, &pStop, 10); - if (errnoValue == ERANGE) - nVersion = INVALID_COOKIE_VERSION; // $Version contained garbage - pair_list.RemoveHead(); // Remove $Version - } - - POSITION pos = pair_list.GetHeadPosition(); - bool bInCookie = false; - CCookie cookie; - - while (pos) - { - const Pair &p = pair_list.GetNext(pos); - if (p.name[0] == '$') - { - if (!bInCookie) - return FALSE; // invalid cookie string - else - { - //add attribute to current cookie - if(!cookie.AddAttribute(p.name.Right(p.name.GetLength()-1),p.value)) - { - return FALSE; - } - } - } - else - { - if (!bInCookie) - { - bInCookie = true; - cookie.SetName(p.name); - cookie.ParseValue(p.value); - if (nVersion != INVALID_COOKIE_VERSION) - cookie.SetVersion(nVersion); - } - else - { - // add previous cookie - CStringA strPrevName; - if(!cookie.GetName(strPrevName)) - { - return FALSE; - } - m_requestCookies.SetAt(strPrevName, cookie); - - // empty current cookie and start over - cookie.Empty(); - cookie.SetName(p.name); - cookie.ParseValue(p.value); - if (nVersion != INVALID_COOKIE_VERSION) - cookie.SetVersion(nVersion); - - } - } - } - - if (!cookie.IsEmpty()) - { - CStringA strName; - if(!cookie.GetName(strName)) - { - return FALSE; - } - m_requestCookies.SetAt(strName, cookie); - } - return TRUE; - - } - -private: - // Call this function to copy a substring to a CString reference and ensure nul-termination. - inline void CopyToCString(__out CStringA& string, __in_ecount(pEnd-pStart) LPCSTR pStart, __in LPCSTR pEnd) throw( ... ) - { - ATLENSURE( pStart != NULL ); - ATLENSURE( pEnd != NULL ); - ATLENSURE( pEnd>=pStart ); - - string.SetString(pStart, (int)(pEnd-pStart)); - string.Trim(); - } - - inline LPCSTR SkipSpace(__in LPCSTR sz, __in WORD nCodePage) throw() - { - if (sz == NULL) - return NULL; - - while (isspace(static_cast(*sz))) - sz = CharNextExA(nCodePage, sz, 0); - return sz; - } -public: - - - __success(SUCCEEDED(return)) __checkReturn HRESULT STDMETHODCALLTYPE QueryInterface(__in REFIID riid, __deref_out void **ppv) - { - if (!ppv) - return E_POINTER; - if (InlineIsEqualGUID(riid, __uuidof(IHttpRequestLookup))) - { - *ppv = static_cast(static_cast(this)); - AddRef(); - return S_OK; - } - if (InlineIsEqualGUID(riid, __uuidof(IUnknown))) - { - *ppv = static_cast(this); - AddRef(); - return S_OK; - } - return E_NOINTERFACE; - } - - ULONG STDMETHODCALLTYPE AddRef() - { - return 1; - } - - ULONG STDMETHODCALLTYPE Release() - { - return 1; - } -}; // class CHttpRequest - -__declspec(selectany) const char* const CHttpRequest::m_szMethodStrings[] = { - "GET", - "POST", - "HEAD", - "DELETE", - "LINK", - "UNLINK", - "DEBUG", // Debugging support for VS7 - NULL -}; - -// This class provides type conversions via the Write method -// and overloaded left shift << operator for writing -// data to the IWriteStream interface. The IWriteStream interface -// only accepts strings, but this helper class allows you to transparently -// pass many different types by providing automatic type conversions. -// -// Notes on Type Conversions: -// Numeric types are converted to their decimal representations. -// Floating point values are output with a precision of 6 decimal places. -// Currency values are converted according to the locale settings of the current thread. -class CWriteStreamHelper -{ -protected: - // Implementation: The IWriteStream interface. - IWriteStream *m_pStream; - UINT m_ulACP; - -public: - CWriteStreamHelper() throw() - :m_pStream(NULL) - { - m_ulACP = _AtlGetConversionACP(); - } - - CWriteStreamHelper(__in_opt IWriteStream *pStream) throw() - { - m_pStream = pStream; - m_ulACP = _AtlGetConversionACP(); - } - - // Attach a IWriteStream - IWriteStream *Attach(__in IWriteStream *pStream) throw() - { - IWriteStream *pRetStream = m_pStream; - m_pStream = pStream; - return pRetStream; - } - - // Call this function to write data to the IWriteStream interface managed by this object. - // Returns TRUE on success, FALSE on failure. - BOOL Write(__in_z LPCSTR szOut) throw() - { - ATLASSUME(m_pStream != NULL); - - if (!szOut) - return FALSE; - - DWORD dwWritten; - return SUCCEEDED(m_pStream->WriteStream(szOut, (int) strlen(szOut), &dwWritten)); - } - - // Call this function to write data to the IWriteStream interface managed by this object. - // Returns TRUE on success, FALSE on failure. - BOOL Write(__in int n) throw() - { - CHAR szTmp[21]; - Checked::itoa_s(n, szTmp, _countof(szTmp), 10); - return Write(szTmp); - } - - // Call this function to write data to the IWriteStream interface managed by this object. - // Returns TRUE on success, FALSE on failure. - BOOL Write(__in unsigned int u) throw() - { - CHAR szTmp[21]; - Checked::ultoa_s(u, szTmp, _countof(szTmp), 10); - return Write(szTmp); - } - - // Call this function to write data to the IWriteStream interface managed by this object. - // Returns TRUE on success, FALSE on failure. - BOOL Write(__in short int w) throw() - { - return Write((int) w); - } - - // Call this function to write data to the IWriteStream interface managed by this object. - // Returns TRUE on success, FALSE on failure. - BOOL Write(__in unsigned short int w) throw() - { - return Write((unsigned int) w); - } - - // Call this function to write data to the IWriteStream interface managed by this object. - // Returns TRUE on success, FALSE on failure. - BOOL Write(__in long int dw) throw() - { - CHAR szTmp[21]; - Checked::ltoa_s(dw, szTmp, _countof(szTmp), 10); - return Write(szTmp); - } - - // Call this function to write data to the IWriteStream interface managed by this object. - // Returns TRUE on success, FALSE on failure. - BOOL Write(__in unsigned long int dw) throw() - { - CHAR szTmp[21]; - Checked::ultoa_s(dw, szTmp, _countof(szTmp), 10); - return Write(szTmp); - } - - // Call this function to write data to the IWriteStream interface managed by this object. - // Returns TRUE on success, FALSE on failure. - BOOL Write(__in double d, __in int nDigitCount=ATL_DEFAULT_PRECISION) throw() - { - ATLASSUME(m_pStream != NULL); - - CHAR szTmp[512]; - int nDec = 0; - int nSign = 0; - bool fWriteDec=true; - if (0 != _fcvt_s(szTmp, _countof(szTmp), d, nDigitCount, &nDec, &nSign)) - { - // too large - return FALSE; - } - - if (nSign != 0) - m_pStream->WriteStream("-", 1, NULL); - if (nDec < 0) - { - nDec *= -1; - m_pStream->WriteStream("0.", 2, NULL); - for (int i=0;iWriteStream("0", 1, NULL); - } - nDec = 0; - fWriteDec=false; - } - - char *p = szTmp; - while (*p) - { - // if the decimal lies at the end of the number - // (no digits to the right of the decimal, we don't - // print it. - if (nDec == 0 && fWriteDec) - m_pStream->WriteStream(".", 1, NULL); - m_pStream->WriteStream(p, 1, NULL); - nDec--; - p++; - } - return TRUE; - } - - // Call this function to write data to the IWriteStream interface managed by this object. - // Returns TRUE on success, FALSE on failure. - BOOL Write(__in __int64 i) throw() - { - CHAR szTmp[21]; - Checked::i64toa_s(i, szTmp, _countof(szTmp), 10); - return Write(szTmp); - } - - // Call this function to write data to the IWriteStream interface managed by this object. - // Returns TRUE on success, FALSE on failure. - BOOL Write(__in unsigned __int64 i) throw() - { - CHAR szTmp[21]; - Checked::ui64toa_s(i, szTmp, _countof(szTmp), 10); - return Write(szTmp); - } - - // Call this function to write data to the IWriteStream interface managed by this object. - // Returns TRUE on success, FALSE on failure. - BOOL Write(__in CURRENCY c) throw() - { - CHAR szDest[256]; - CHAR szNumber[32]; - - Checked::i64toa_s(c.int64, szNumber, _countof(szNumber), 10); - int nLen = (int) strlen(szNumber); - if (nLen < 5) - { - // prepend ascii zeros - Checked::memmove_s(szNumber+5-nLen, 32-(5-nLen), szNumber, nLen+1); - memset(szNumber, '0', 5-nLen); - nLen = 5; - } - - Checked::memmove_s(szNumber+nLen-3, 32-(nLen-3), szNumber+nLen-4, 5); - szNumber[nLen-4] = '.'; - - int nRet = GetCurrencyFormatA(GetThreadLocale(), 0, szNumber, NULL, szDest, sizeof(szDest)); - if (nRet > 0) - return Write(szDest); - - ATLASSERT(GetLastError()==ERROR_INSUFFICIENT_BUFFER); - - nRet = GetCurrencyFormatA(GetThreadLocale(), 0, szNumber, NULL, NULL, 0); - ATLASSERT(nRet > 0); - - if (nRet <= 0) - return FALSE; - - CAutoVectorPtr szBuffer; - if (!szBuffer.Allocate(nRet)) - { - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return FALSE; - } - nRet = GetCurrencyFormatA(GetThreadLocale(), 0, szNumber, NULL, szBuffer, nRet); - - ATLASSERT(nRet > 0); - BOOL bRet = FALSE; - if (nRet > 0) - bRet = Write(szBuffer); - - return bRet; - } - - // Call this function to write data to the IWriteStream interface managed by this object. - // Returns TRUE on success, FALSE on failure. - BOOL Write(__in LPCWSTR wsz) throw() - { - ATLASSUME(m_pStream != NULL); - - BOOL bRet; - - _ATLTRY - { - CW2A sz(wsz, m_ulACP); - - if (!sz) - { - bRet = FALSE; - } - - DWORD dwWritten; - bRet = SUCCEEDED(m_pStream->WriteStream(sz, (int) strlen(sz), &dwWritten)); - } - _ATLCATCHALL() - { - bRet = FALSE; - } - - return bRet; - } - - // Use this operator to write data to the IWriteStream interface managed by this object. - CWriteStreamHelper& operator<<(__in LPCSTR szStr) throw(...) - { - if (!Write(szStr)) - AtlThrow(E_FAIL); - return *this; - } - - // Use this operator to write data to the IWriteStream interface managed by this object. - CWriteStreamHelper& operator<<(__in LPCWSTR wszStr) throw(...) - { - if (!Write(wszStr)) - AtlThrow(E_FAIL); - return *this; - } - - // Use this operator to write data to the IWriteStream interface managed by this object. - CWriteStreamHelper& operator<<(__in int n) throw(...) - { - if (!Write(n)) - AtlThrow(E_FAIL); - return *this; - } - - // Use this operator to write data to the IWriteStream interface managed by this object. - CWriteStreamHelper& operator<<(__in short int w) throw(...) - { - if (!Write(w)) - AtlThrow(E_FAIL); - return *this; - } - - // Use this operator to write data to the IWriteStream interface managed by this object. - CWriteStreamHelper& operator<<(__in unsigned int u) throw(...) - { - if (!Write(u)) - AtlThrow(E_FAIL); - return *this; - } - - // Use this operator to write data to the IWriteStream interface managed by this object. - CWriteStreamHelper& operator<<(__in long int dw) throw(...) - { - if (!Write(dw)) - AtlThrow(E_FAIL); - return *this; - } - - // Use this operator to write data to the IWriteStream interface managed by this object. - CWriteStreamHelper& operator<<(__in unsigned long int dw) throw(...) - { - if (!Write(dw)) - AtlThrow(E_FAIL); - return *this; - } - - // Use this operator to write data to the IWriteStream interface managed by this object. - CWriteStreamHelper& operator<<(__in double d) throw(...) - { - if (!Write(d)) - AtlThrow(E_FAIL); - return *this; - } - - // Use this operator to write data to the IWriteStream interface managed by this object. - CWriteStreamHelper& operator<<(__in __int64 i) throw(...) - { - if (!Write(i)) - AtlThrow(E_FAIL); - return *this; - } - - // Use this operator to write data to the IWriteStream interface managed by this object. - CWriteStreamHelper& operator<<(__in unsigned __int64 i) throw(...) - { - if (!Write(i)) - AtlThrow(E_FAIL); - return *this; - } - - // Use this operator to write data to the IWriteStream interface managed by this object. - CWriteStreamHelper& operator<<(__in CURRENCY c) throw(...) - { - if (!Write(c)) - AtlThrow(E_FAIL); - return *this; - } - - UINT SetConversionCodePage(__in UINT nNewCP) - { - UINT nOldCP = m_ulACP; - m_ulACP = nNewCP; - return nOldCP; - } -}; - - -template -class CAtlIsapiBuffer -{ -protected: - char m_szBuffer[dwSizeT]; - LPSTR m_pBuffer; - DWORD m_dwLen; - DWORD m_dwAlloc; - HANDLE m_hProcHeap; - -public: - CAtlIsapiBuffer() throw() - { - if (dwSizeT > 0) - m_szBuffer[0] = 0; - - m_pBuffer = m_szBuffer; - m_dwLen = 0; - m_dwAlloc = dwSizeT; - m_hProcHeap = GetProcessHeap(); - } - - CAtlIsapiBuffer(__in LPCSTR sz) - { - m_pBuffer = m_szBuffer; - m_dwLen = 0; - m_dwAlloc = dwSizeT; - m_hProcHeap = GetProcessHeap(); - - if (!Append(sz)) - AtlThrow(E_OUTOFMEMORY); - } - - ~CAtlIsapiBuffer() throw() - { - Free(); - } - - BOOL Alloc(__in DWORD dwSize) throw() - { - if (m_dwAlloc >= dwSize) - { - return TRUE; - } - if (m_pBuffer != m_szBuffer) - { - HeapFree(m_hProcHeap, 0, m_pBuffer); - m_dwLen = 0; - m_dwAlloc = 0; - } - m_pBuffer = (LPSTR)HeapAlloc(m_hProcHeap, 0, dwSize); - if (m_pBuffer) - { - m_dwAlloc = dwSize; - return TRUE; - } - return FALSE; - } - - BOOL ReAlloc(__in DWORD dwNewSize) throw() - { - if (dwNewSize <= m_dwAlloc) - return TRUE; - - if (m_pBuffer == m_szBuffer) - { - BOOL bRet = Alloc(dwNewSize); - if (bRet) - { - Checked::memcpy_s(m_pBuffer, dwNewSize, m_szBuffer, m_dwLen); - } - return bRet; - } - - LPSTR pvNew = (LPSTR )HeapReAlloc(m_hProcHeap, 0, m_pBuffer, dwNewSize); - if (pvNew) - { - m_pBuffer = pvNew; - m_dwAlloc = dwNewSize; - return TRUE; - } - return FALSE; - } - - void Free() throw() - { - if (m_pBuffer != m_szBuffer) - { - HeapFree(m_hProcHeap,0 , m_pBuffer); - m_dwAlloc = dwSizeT; - m_pBuffer = m_szBuffer; - } - Empty(); - } - - void Empty() throw() - { - if (m_pBuffer) - { - m_pBuffer[0]=0; - m_dwLen = 0; - } - } - - DWORD GetLength() throw() - { - return m_dwLen; - } - - BOOL Append(__in LPCSTR sz, __in int nLen = -1) throw() - { - if (!sz) - return FALSE; - - if (nLen == -1) - nLen = (int) strlen(sz); - - DWORD newLen = m_dwLen + nLen + 1; - if (newLen <= m_dwLen || newLen <= (DWORD)nLen) - { - return FALSE; - } - if (newLen > m_dwAlloc) - { - if (!ReAlloc(m_dwAlloc + (nLen+1 > ATL_ISAPI_BUFFER_SIZE ? nLen+1 : ATL_ISAPI_BUFFER_SIZE))) - return FALSE; - } - Checked::memcpy_s(m_pBuffer + m_dwLen, m_dwAlloc-m_dwLen, sz, nLen); - m_dwLen += nLen; - m_pBuffer[m_dwLen]=0; - return TRUE; - } - - operator LPCSTR() throw() - { - return m_pBuffer; - } - - CAtlIsapiBuffer& operator+=(__in LPCSTR sz) - { - if (!Append(sz)) - AtlThrow(E_OUTOFMEMORY); - return *this; - } -}; // class CAtlIsapiBuffer - -// This class represents the response that the web server will send back to the client. -// -// CHttpResponse provides friendly functions for building up the headers, cookies, and body of an HTTP response. -// The class derives from IWriteStream and CWriteStreamHelper, allowing you to call those classes' methods -// to build up the body of the response. By default, the class improves performance by buffering the response until it is complete before sending it back to the client. -class CHttpResponse : public IWriteStream, public CWriteStreamHelper -{ -private: - - // Implementation: A map of HTTP response headers. - // The key is the name of the response header. - // The value is the data for the response header. - CSimpleMap m_headers; - - // Implementation: Determines whether the response is currently being buffered. - BOOL m_bBufferOutput; - - // Implementation: Determines whether any output should be sent to the client. - // Intended mainly for HEAD requests, where the client should get the same headers - // (i.e. Content-Length) as for a GET request - BOOL m_bSendOutput; - - // Implementation: The limit in bytes of the response buffer. - // When the limit is reached, the buffer is automatically flushed - // and data is sent to the client. You can set this to ULONG_MAX - // to enable full buffering (this is the default, and is required - // for enabling keep alive connections). - DWORD m_dwBufferLimit; - - // Implementation: The server context. - CComPtr m_spServerContext; - - // Implementation: The HTTP status code for the response. - int m_nStatusCode; - - // Implementation: Determines whether the response headers have already been sent to the client. - BOOL m_bHeadersSent; - - // Implementation: Handle of the file being transmitted so it can be closed - // when the async I/O completes - HANDLE m_hFile; - -public: - // Implementation: The buffer used to store the response before - // the data is sent to the client. - CAtlIsapiBuffer<> m_strContent; - - // Numeric constants for the HTTP status codes used for redirecting client requests. - enum HTTP_REDIRECT - { - HTTP_REDIRECT_MULTIPLE=300, - HTTP_REDIRECT_MOVED=301, - HTTP_REDIRECT_FOUND=302, - HTTP_REDIRECT_SEE_OTHER=303, - HTTP_REDIRECT_NOT_MODIFIED=304, - HTTP_REDIRECT_USE_PROXY=305, - HTTP_REDIRECT_TEMPORARY_REDIRECT=307 - }; - - CHttpResponse() throw() - { - m_bBufferOutput = TRUE; - m_dwBufferLimit = ULONG_MAX; - m_nStatusCode = 200; - m_pStream = this; - m_bHeadersSent = FALSE; - m_bSendOutput = TRUE; - m_hFile = INVALID_HANDLE_VALUE; - } - - CHttpResponse(__in IHttpServerContext *pServerContext) - { - m_bBufferOutput = TRUE; - m_dwBufferLimit = ULONG_MAX; - m_nStatusCode = 200; - m_pStream = this; - m_bHeadersSent = FALSE; - ATLENSURE(Initialize(pServerContext)); - m_bSendOutput = TRUE; - m_hFile = INVALID_HANDLE_VALUE; - } - - // The destructor flushes the buffer if there is content that - // hasn't yet been sent to the client. - virtual ~CHttpResponse() throw() - { - Flush(TRUE); - if (m_hFile && m_hFile != INVALID_HANDLE_VALUE) - CloseHandle(m_hFile); - } - - // Call this function to initialize the response object with a pointer to the server context. - // Returns TRUE on success, FALSE on failure. - __checkReturn BOOL Initialize(__in IHttpServerContext *pServerContext) throw() - { - ATLASSERT(pServerContext != NULL); - if (!pServerContext) - return FALSE; - - m_spServerContext = pServerContext; - - return TRUE; - } - - // This is called to initialize the CHttpResponse for a child handler. By default, it - // assumes the parent will be responsible for sending the headers. - __checkReturn BOOL Initialize(__in IHttpRequestLookup *pLookup) throw(...) - { - ATLASSERT(pLookup); - if (!pLookup) - return FALSE; - - CComPtr spContext; - HRESULT hr = pLookup->GetServerContext(&spContext); - if (FAILED(hr)) - return FALSE; - - if (!Initialize(spContext)) - return FALSE; - - m_bHeadersSent = TRUE; - - return TRUE; - } - - // Returns a pointer to the IHttpServerContext interface for the current request. - __checkReturn HRESULT GetServerContext(__deref_out_opt IHttpServerContext ** ppOut) throw() - { - return m_spServerContext.CopyTo(ppOut); - } - - void Detach() - { - m_spServerContext.Release(); - HaveSentHeaders(TRUE); - } - // Call this function to set buffering options for the response. - // - // This function allows you to turn buffering on or off, and to set a size limit - // on the amount of data that will be buffered before being sent to the client. - // - // When you turn off buffering, the current contents of the buffer will be sent to the client. - // If you need to clear the buffer without sending the contents to the client, call ClearContent instead. - // - // When the size of the buffer is reduced below the current size of the buffered content, - // the entire buffer is flushed. - void SetBufferOutput(__in BOOL bBufferOutput, __in DWORD dwBufferLimit=ATL_ISAPI_BUFFER_SIZE) throw() - { - if (m_bBufferOutput && !bBufferOutput) - { - // before turning off buffering, flush - // the current contents - Flush(); - } - SetBufferLimit(dwBufferLimit); - - m_bBufferOutput = bBufferOutput; - } - - // Call this function to determine whether data written to the response object is being buffered or not. - // Returns TRUE if output is being buffered, FALSE otherwise. - __checkReturn BOOL GetBufferOutput() throw() - { - return m_bBufferOutput; - } - - // Call this function to determine whether the response headers have been sent - // Returns TRUE if headers have been sent, FALSE otherwise. - __checkReturn BOOL HaveSentHeaders() throw() - { - return m_bHeadersSent; - } - - // Call this function to override the m_bHeadersSent state. This is useful - // when you want child handlers (e.g. from an include or subhandler) to send the headers - void HaveSentHeaders(__in BOOL bSent) throw() - { - m_bHeadersSent = bSent; - } - - // Call this function to set a size limit on the amount of data buffered by the reponse object. - // When the size of the buffer is reduced below the current size of the buffered content, - // the entire buffer is flushed. - // See GetBufferLimit. - void SetBufferLimit(__in DWORD dwBufferLimit) throw() - { - if (m_bBufferOutput) - { - if (m_strContent.GetLength() >= dwBufferLimit) - { - // new buffer limit is less than the - // size currently buffered. So flush - // the current buffer - Flush(); - } - } - m_dwBufferLimit = dwBufferLimit; - } - - // Returns the current size limit of the buffer in bytes. - // See SetBufferLimit. - DWORD GetBufferLimit() throw() - { - return m_dwBufferLimit; - } - - // Returns the current value of the Content-Type header if present, otherwise returns NULL. - LPCSTR GetContentType() throw() - { - // return the content type from the - // header collection if any - _ATLTRY - { - CStringA strKey("Content-Type"); - - int nIndex = m_headers.FindKey(strKey); - if (nIndex >= 0) - return m_headers.GetValueAt(nIndex); - } - _ATLCATCHALL() - { - } - return NULL; - } - - // Call this function to set the Content-Type of the HTTP response. - // Examples of common MIME content types include text/html and text/plain. - BOOL SetContentType(__in_opt LPCSTR szContentType) throw() - { - _ATLTRY - { - if (!m_headers.SetAt("Content-Type", szContentType)) - return m_headers.Add("Content-Type", szContentType); - } - _ATLCATCHALL() - { - } - return FALSE; - } - - // Call this function to set the HTTP status code of the response. - // If not set explicitly, the default status code is 200 (OK). - // See GetStatusCode. - void SetStatusCode(__in int nCode) throw() - { - m_nStatusCode = nCode; - } - - // Returns the current HTTP status code of the response. - // See SetStatusCode. - int GetStatusCode() throw() - { - return m_nStatusCode; - } - - // Call this function to set the Cache-Control http header of the response. - // Examples of common Cache-Control header values: public, private, max-age=delta-seconds - BOOL SetCacheControl(__in_opt LPCSTR szCacheControl) throw() - { - _ATLTRY - { - if (!m_headers.SetAt("Cache-Control", szCacheControl)) - return m_headers.Add("Cache-Control", szCacheControl); - } - _ATLCATCHALL() - { - } - return FALSE; - } - - // Call this function to set the Expires HTTP header to the absolute date/time - // specified in the stExpires parameter - BOOL SetExpiresAbsolute(__in const SYSTEMTIME& stExpires) throw() - { - _ATLTRY - { - CStringA strExpires; - SystemTimeToHttpDate(stExpires, strExpires); - - if (!m_headers.SetAt("Expires", strExpires)) - return m_headers.Add("Expires", strExpires); - } - _ATLCATCHALL() - { - } - return FALSE; - } - - // Call this function to set the Expires HTTP header to a relative date/time - // value specified in minutes; - BOOL SetExpires(__in long lMinutes) throw() - { - CFileTime ft; - GetSystemTimeAsFileTime(&ft); - - // add the specified number of minutes - ft += CFileTimeSpan(((ULONGLONG)lMinutes)*60*10000000); - - SYSTEMTIME st; - FileTimeToSystemTime(&ft, &st); - return SetExpiresAbsolute(st); - } - - // Call this function to set whether or not to output to client. - // Intended primarily for HEAD requests - BOOL SetWriteToClient(__in BOOL bSendOutput) throw() - { - m_bSendOutput = bSendOutput; - return TRUE; - } - - // Call this function to determine whether or not the data is - // sent to the client. Intended primarily for HEAD requests - BOOL GetWriteToClient() throw() - { - return m_bSendOutput; - } - - // Call this function to write data to the response object. - // - // Returns S_OK on success, E_INVALIDARG or E_FAIL on failure. - // - // See WriteClient for comments on buffering. - // - // szOut A pointer to the first byte of the data to be written. - // - // nLen The number of bytes to write. If this parameter is -1, - // szOut is assumed to be a nul-terminated string and the - // whole string will be written. - // - // pdwWritten A DWORD pointer that can be used to get the number of bytes written. - // This parameter can be NULL. - __checkReturn HRESULT WriteStream(__in_z LPCSTR szOut, __in int nLen, __out_opt DWORD *pdwWritten) - { - ATLASSUME(m_spServerContext != NULL); - - if (pdwWritten) - *pdwWritten = 0; - if (nLen == -1) - { - if (!szOut) - return E_INVALIDARG; - nLen = (int) strlen(szOut); - } - BOOL bRet = WriteLen(szOut, nLen); - if (!bRet) - { - return AtlHresultFromLastError(); - } - if (pdwWritten) - *pdwWritten = nLen; - return S_OK; - } - - // Call this function to write data to the response object. - // - // Returns TRUE on success. FALSE on failure. - // - // If buffering is disabled, data is written directly to the client. - // If buffering is enabled, this function attempts to write to the buffer. - // If the buffer is too small to contain its existing data and the new data, - // the current contents of the buffer are flushed. - // If the buffer is still too small to contain the new data, that data is written - // directly to the client. Otherwise the new data is written to the buffer. - // - // Any headers that have been set in the response will be sent just before the - // data is written to the client if no headers have been sent up to that point. - // - // szOut A pointer to the first byte of the data to be written. - // - // nLen The number of bytes to write. - __checkReturn BOOL WriteLen(__in_ecount(dwLen) LPCSTR szOut, __in DWORD dwLen) throw() - { - ATLASSUME(m_spServerContext != NULL); - if (!szOut) - return FALSE; - - if (m_bBufferOutput) - { - if (m_strContent.GetLength()+dwLen >= m_dwBufferLimit) - { - if (!Flush()) - return FALSE; - } - if (dwLen <= m_dwBufferLimit) - return m_strContent.Append(szOut, dwLen); - } - BOOL bRet = SendHeadersInternal(); - - if (bRet && m_bSendOutput) - bRet = m_spServerContext->WriteClient((void *) szOut, &dwLen); - - return bRet; - } - - // Call this function to redirect the client to a different resource. - // - // Returns TRUE on success, FALSE on failure. - // - // szURL A nul-terminated string specifying the resource the client should navigate to. - // - // statusCode An HTTP status code from the HTTP_REDIRECT enumeration describing the reason - // for the redirection. - // - // bSendBody Specifies whether to generate and send a response body with the headers. - // - // This function allows (and RFC 2616 encourages) a response body to be sent - // with the following redirect types: - // HTTP_REDIRECT_MOVED - // HTTP_REDIRECT_FOUND - // HTTP_REDIRECT_SEE_OTHER - // HTTP_REDIRECT_TEMPORARY_REDIRECT - // No body will be sent with other redirect types. - // - // The response body contains a short hypertext note with a hyperlink to the new resource. - // A meta refresh tag is also included to allow browsers to automatically redirect - // the user to the resource even if they don't understand the redirect header. - // - // See RFC 2616 section 10.3 for more information on redirection. - BOOL Redirect(__in LPCSTR szUrl, __in HTTP_REDIRECT statusCode=HTTP_REDIRECT_MOVED, __in BOOL bSendBody=TRUE) throw(...) - { - CStringA strBody; - LPCSTR szBody = NULL; - if (bSendBody && - (HTTP_REDIRECT_MOVED == statusCode || HTTP_REDIRECT_FOUND == statusCode || - HTTP_REDIRECT_SEE_OTHER == statusCode || HTTP_REDIRECT_TEMPORARY_REDIRECT == statusCode)) - { - _ATLTRY - { - ATLENSURE(szUrl!=NULL); - strBody.Format( - "\r\n" - "\r\n" - "\r\n" - "\r\n" - "Please use the following link to access this resource:" - " %s\r\n" - "\r\n" - "\r\n", - szUrl, szUrl, szUrl); - } - _ATLCATCHALL() - { - return FALSE; - } - szBody = (LPCSTR) strBody; - } - return Redirect(szUrl, szBody, statusCode); - } - - // Call this function to redirect the client to a different resource. - // - // Returns TRUE on success, FALSE on failure. - // - // szURL A nul-terminated string specifying the resource the client should navigate to. - // - // szBody A nul-terminated string containing the body of the response to be sent to the client. - // - // statusCode An HTTP status code from the HTTP_REDIRECT enumeration describing the reason - // for the redirection. - // - // This function allows (and RFC 2616 encourages) a response body to be sent - // with the following redirect types: - // HTTP_REDIRECT_MOVED - // HTTP_REDIRECT_FOUND - // HTTP_REDIRECT_SEE_OTHER - // HTTP_REDIRECT_TEMPORARY_REDIRECT - // No body will be sent with other redirect types. - // - // The response body should contain a short hypertext note with a hyperlink to the new resource. - // You can include a meta refresh tag to allow browsers to automatically redirect - // the user to the resource even if they don't understand the redirect header. - // - // See RFC 2616 section 10.3 for more information on redirection. - BOOL Redirect(__in LPCSTR szUrl, __in LPCSTR szBody, __in HTTP_REDIRECT statusCode=HTTP_REDIRECT_MOVED) throw() - { - SetStatusCode(statusCode); - AppendHeader("Location", szUrl); - - _ATLTRY - { - if (!SendHeadersInternal()) - return FALSE; - } - _ATLCATCHALL() - { - return FALSE; - } - - if (szBody && - (HTTP_REDIRECT_MOVED == statusCode || HTTP_REDIRECT_FOUND == statusCode || - HTTP_REDIRECT_SEE_OTHER == statusCode || HTTP_REDIRECT_TEMPORARY_REDIRECT == statusCode)) - { - Write(szBody); - return Flush(); - } - return TRUE; - } - - // Call this function to append a header to the collection of HTTP headers managed by this object. - // - // szName A nul-teminated string containing the name of the HTTP header. - // - // szValue A nul-teminated string containing the value of the HTTP header. - BOOL AppendHeader(__in LPCSTR szName, __in_opt LPCSTR szValue) throw() - { - ATLASSERT(szName); - BOOL bRet = FALSE; - _ATLTRY - { - bRet = m_headers.Add(szName, szValue); - } - _ATLCATCHALL() - { - bRet = FALSE; - } - return bRet; - } - - // Call this function to add a Set-Cookie header to the collection of HTTP headers managed by this object. - // - // pCookie A pointer to a CCookie object describing the cookie to be sent to the client. - BOOL AppendCookie(__in const CCookie *pCookie) - { - ATLENSURE(pCookie); - return AppendCookie((const CCookie&)*pCookie); - } - - // Call this function to add a Set-Cookie header to the collection of HTTP headers managed by this object. - // - // cookie A reference to a CCookie object describing the cookie to be sent to the client. - BOOL AppendCookie(__in const CCookie& cookie) throw() - { - CHAR szCookie[ATL_MAX_COOKIE_LEN]; - DWORD dwBuffSize = ATL_MAX_COOKIE_LEN; - BOOL bRet = FALSE; - bRet = cookie.Render(szCookie, &dwBuffSize); - if (bRet) - { - _ATLTRY - { - bRet = m_headers.Add("Set-Cookie", szCookie); - } - _ATLCATCHALL() - { - bRet = FALSE; - dwBuffSize = 0; - } - } - - if (!bRet && dwBuffSize > 0 && dwBuffSize+1 > dwBuffSize) //static buffer wasn't big enough. - { - //We'll have to try dynamically allocating it - //allocate a buffer - CAutoVectorPtr sz; - if (sz.Allocate(dwBuffSize+1)) - { - DWORD dwSizeNew = dwBuffSize + 1; - if (cookie.Render(sz, &dwSizeNew)) - { - _ATLTRY - { - bRet = m_headers.Add("Set-Cookie", (const char *) sz); - } - _ATLCATCHALL() - { - bRet = FALSE; - } - } - } - } - return bRet; - } - - // Call this function to add a Set-Cookie header to the collection of HTTP headers managed by this object. - // - // szName A nul-terminated string containing the name of the cookie to be sent to the client. - // - // szValue A nul-terminated string containing the value of the cookie to be sent to the client. - BOOL AppendCookie(__in LPCSTR szName, __in_opt LPCSTR szValue) throw() - { - ATLASSERT(szName); - BOOL bRet = FALSE; - _ATLTRY - { - CCookie c(szName, szValue); - bRet = AppendCookie(c); - } - _ATLCATCHALL() - { - bRet = FALSE; - } - return bRet; - } - - // Call this function to add a Set-Cookie header that removes a cookie value - // to the collection of HTTP headers managed by this object. - // - // szName A nul-terminated string containing the name of the cookie to be deleted - BOOL DeleteCookie(__in LPCSTR szName) throw() - { - ATLASSERT(szName); - BOOL bRet = FALSE; - _ATLTRY - { - CCookie cookie(szName, ""); - bRet=cookie.SetMaxAge(0); - if(bRet) - { - bRet = AppendCookie(cookie); - } - } - _ATLCATCHALL() - { - bRet = FALSE; - } - return bRet; - - } - - // Call this function to clear the collection of HTTP response headers maintained by this object. - // - // Note that clearing the headers includes removing all cookies associated with the response - // object. Cookies are sent to the client as Set-Cookie HTTP headers. - void ClearHeaders() throw() - { - m_headers.RemoveAll(); - } - - // Call this function to clear theresponse buffer without sending the contents to the client. - // If you need to empty the buffer but you do want the current contents sent to the client, call Flush instead. - void ClearContent() throw() - { - m_strContent.Empty(); - } - - // Call this function to send the current headers associated with this object to the client. - // - // Returns TRUE on success, FALSE on failure. - // - // The response headers are sent to the client using the current status code for the - // response object. See SetStatusCode and GetStatusCode. - BOOL SendHeadersInternal(__in BOOL fKeepConn=FALSE) - { - if (m_bHeadersSent) - return TRUE; - - ATLENSURE(m_spServerContext != NULL); - - CStringA strHeaders; - RenderHeaders(strHeaders); - - BOOL bRet = FALSE; - _ATLTRY - { - if (m_nStatusCode == 200) - { - bRet = m_spServerContext->SendResponseHeader(strHeaders, "200 OK", fKeepConn); - if (bRet) - { - m_bHeadersSent = TRUE; - } - return bRet; - } - - CFixedStringT strStatus; - CDefaultErrorProvider prov; - GetStatusHeader(strStatus, m_nStatusCode, SUBERR_NONE, &prov); - bRet = m_spServerContext->SendResponseHeader(strHeaders, strStatus, fKeepConn); - if (bRet) - { - m_bHeadersSent = TRUE; - } - } - _ATLCATCHALL() - { - bRet = FALSE; - } - return bRet; - } - - // Call this function to get a string containing all the HTTP headers associated with - // this object in a format suitable for sending to a client. - // - // strHeaders A CStringA reference to which will be appended the HTTP headers. - void RenderHeaders(CStringA& strHeaders) throw() - { - _ATLTRY - { - strHeaders.Preallocate(::ATL::AtlMultiplyThrow(m_headers.GetSize(),64)); - for (int i=0; iGetServerVariable("SERVER_PROTOCOL", szProtocol, &dwProtocolLen) && - !strcmp(szProtocol, "HTTP/1.0")) - AppendHeader("Connection", "Keep-Alive"); - Checked::itoa_s(m_strContent.GetLength(), szProtocol, _countof(szProtocol), 10); - AppendHeader("Content-Length", szProtocol); - bRet = SendHeadersInternal(TRUE); - } - else - bRet = SendHeadersInternal(); - } - if (m_bBufferOutput) - { - DWORD dwLen = 0; - - dwLen = m_strContent.GetLength(); - if (dwLen) - { - if (m_bSendOutput && - m_spServerContext->WriteClient((void *) (LPCSTR) m_strContent, &dwLen) != TRUE) - { - m_strContent.Empty(); - return FALSE; - } - m_strContent.Empty(); - } - } - } // _ATLTRY - _ATLCATCHALL() - { - bRet = FALSE; - } - return bRet; - } - - // Call this function to clear the response object of any headers - // and the contents of the buffer. - void ClearResponse() throw() - { - m_strContent.Empty(); - m_headers.RemoveAll(); - } - - BOOL AsyncPrep(__in BOOL fKeepConn=FALSE) throw() - { - ATLASSUME(m_spServerContext != NULL); - - return SendHeadersInternal(fKeepConn); - } - - BOOL AsyncFlush() throw() - { - ATLASSUME(m_spServerContext != NULL); - - BOOL bRet = SendHeadersInternal(); - - if (bRet && m_bBufferOutput) - { - DWORD dwLen = 0; - - dwLen = m_strContent.GetLength(); - if (dwLen) - { - _ATLTRY - { - if (m_spServerContext->AsyncWriteClient((void *) (LPCSTR) m_strContent, &dwLen) != TRUE) - { - bRet = FALSE; - } - } - _ATLCATCHALL() - { - bRet = FALSE; - } - } - } - - return bRet; - } - - BOOL TransmitFile(__in HANDLE hFile, __in LPCSTR szContentType="text/plain") throw() - { - ATLASSUME(m_spServerContext != NULL); - ATLASSERT(hFile != NULL && hFile != INVALID_HANDLE_VALUE); - - SetContentType(szContentType); - - if (m_strContent.GetLength()) - if (!Flush()) - return FALSE; - - BOOL bRet = SendHeadersInternal(); - if (bRet) - { - _ATLTRY - { - bRet = m_spServerContext->TransmitFile(hFile, NULL, NULL, NULL, - 0, 0, NULL, 0, NULL, 0, HSE_IO_ASYNC | HSE_IO_NODELAY); - } - _ATLCATCHALL() - { - bRet = FALSE; - } - } - - return bRet; - } -}; // class CHttpResponse - - - -#define ATLS_FLAG_NONE 0 -#define ATLS_FLAG_ASYNC 1 // handler might do some async handling - -// push_macro/pop_macro doesn't work in a template definition. -#pragma push_macro("new") -#undef new -template -class PerThreadWrapper : public CComObjectNoLock -{ -public: - void *operator new(size_t /*size*/, void *p) throw() - { - return p; - } - - void operator delete(void * /*p*/) throw() - { - } - - STDMETHOD_(ULONG, Release)() throw() - { - ULONG l = InternalRelease(); - if (l == 0) - { - T *pT = static_cast(this); - ATLASSERT(pT->m_spExtension != NULL); - CIsapiWorker *pWorker = pT->m_spExtension->GetThreadWorker(); - ATLASSERT(pWorker); - - delete this; - if(pWorker) - { - HeapFree(pWorker->m_hHeap, HEAP_NO_SERIALIZE, this); - } - } - return l; - } -}; - -template -inline BOOL CreateRequestHandlerSync(__in IIsapiExtension *pExtension, __deref_out_opt IUnknown **ppOut) -{ - ATLENSURE(pExtension); - ATLENSURE(ppOut); - - CIsapiWorker *pWorker = pExtension->GetThreadWorker(); - ATLENSURE(pWorker); - void *pv = HeapAlloc(pWorker->m_hHeap, HEAP_NO_SERIALIZE, sizeof(PerThreadWrapper)); - if (!pv) - return FALSE; - - PerThreadWrapper *pHandler = new(pv) PerThreadWrapper; - *ppOut = static_cast(pHandler); - pHandler->m_spExtension = pExtension; - - (*ppOut)->AddRef(); - - return TRUE; -} -#pragma pop_macro("new") - -#define DECLARE_ASYNC_HANDLER() \ - static DWORD GetHandlerFlags() \ - { \ - return ATLS_FLAG_ASYNC; \ - } \ - DWORD GetAsyncFlags() \ - { \ - return ATLSRV_INIT_USEASYNC; \ - } - -#define DECLARE_ASYNC_HANDLER_EX() \ - static DWORD GetHandlerFlags() \ - { \ - return ATLS_FLAG_ASYNC; \ - } \ - DWORD GetAsyncFlags() \ - { \ - return (ATLSRV_INIT_USEASYNC|ATLSRV_INIT_USEASYNC_EX); \ - } - - -template -class IRequestHandlerImpl : public IRequestHandler -{ -public: - HINSTANCE m_hInstHandler; - CComPtr m_spServiceProvider; - CComPtr m_spServerContext; - CComPtr m_spExtension; - DWORD m_dwAsyncFlags; - - IRequestHandlerImpl() - :m_hInstHandler(NULL) - { - m_dwAsyncFlags = 0; - } - virtual ~IRequestHandlerImpl() - { - } - - HTTP_CODE GetFlags(__out DWORD *pdwStatus) - { - ATLASSERT(pdwStatus); - THandler *pT = static_cast(this); - - *pdwStatus = pT->GetAsyncFlags(); - if (pT->CachePage()) - *pdwStatus |= ATLSRV_INIT_USECACHE; - -#ifdef _DEBUG - if (*pdwStatus & (ATLSRV_INIT_USEASYNC|ATLSRV_INIT_USEASYNC_EX)) - ATLASSERT(pT->GetHandlerFlags() & ATLS_FLAG_ASYNC); -#endif - - return HTTP_SUCCESS; - } - - HTTP_CODE InitializeHandler(__in AtlServerRequest *pRequestInfo, __in IServiceProvider *pProvider) - { - ATLENSURE(pRequestInfo != NULL); - ATLENSURE(pProvider != NULL); - ATLENSURE(pRequestInfo->hInstDll != NULL); - ATLENSURE(pRequestInfo->pServerContext != NULL); - - // Initialize our internal references to required services - m_hInstHandler = pRequestInfo->hInstDll; - m_spServiceProvider = pProvider; - m_spServerContext = pRequestInfo->pServerContext; - - return HTTP_SUCCESS; - } - - HTTP_CODE InitializeChild(__in AtlServerRequest *pRequestInfo, __in IServiceProvider *pProvider, IHttpRequestLookup * /*pLookup*/) - { - return InitializeHandler(pRequestInfo, pProvider); - } - - void UninitializeHandler() - { - } - - HTTP_CODE HandleRequest( - AtlServerRequest* /*pRequestInfo*/, - IServiceProvider* /*pServiceProvider*/) - { - return HTTP_SUCCESS; - } - - DWORD GetAsyncFlags() - { - return m_dwAsyncFlags; - } - - void SetAsyncFlags(__in DWORD dwAsyncFlags) - { - ATLASSERT((dwAsyncFlags & ~(ATLSRV_INIT_USEASYNC|ATLSRV_INIT_USEASYNC_EX)) == 0); - m_dwAsyncFlags = dwAsyncFlags; - } - - BOOL CachePage() - { - return FALSE; - } - - static DWORD GetHandlerFlags() - { - return ATLS_FLAG_NONE; - } - - // Used to create new instance of this object. A pointer to this - // function is stored in the handler map in user's code. - static BOOL CreateRequestHandler(__in IIsapiExtension *pExtension, __deref_out_opt IUnknown **ppOut) - { - ATLASSERT(ppOut != NULL); - if (ppOut == NULL) - return false; - - *ppOut = NULL; - - if (THandler::GetHandlerFlags() & ATLS_FLAG_ASYNC) - { - THandler *pHandler = NULL; - ATLTRY(pHandler = new CComObjectNoLock); - if (!pHandler) - return FALSE; - *ppOut = static_cast(pHandler); - pHandler->m_spExtension = pExtension; - (*ppOut)->AddRef(); - } - else - { - if (!CreateRequestHandlerSync(pExtension, ppOut)) - return FALSE; - } - - return TRUE; - } - - // Used to initialize the class - // function is stored in the handler map in user's code. - static BOOL InitRequestHandlerClass(IHttpServerContext *pContext, IIsapiExtension *pExt) - { - (pContext); // unused - (pExt); // unused - return TRUE; - } - - // Used to uninitialize the class - // function is stored in the handler map in user's code. - static void UninitRequestHandlerClass() - { - return; - } -}; - -struct CRequestStats -{ - long m_lTotalRequests; - long m_lFailedRequests; - __int64 m_liTotalResponseTime; - long m_lAvgResponseTime; - long m_lCurrWaiting; - long m_lMaxWaiting; - long m_lActiveThreads; - - CRequestStats() throw() - { - m_lTotalRequests = 0; - m_lFailedRequests = 0; - m_liTotalResponseTime = 0; - m_lAvgResponseTime = 0; - m_lCurrWaiting = 0; - m_lMaxWaiting = 0; - m_lActiveThreads = 0; - } - - void RequestHandled(__in AtlServerRequest *pRequestInfo, __in BOOL bSuccess) - { - ATLENSURE(pRequestInfo); - - InterlockedIncrement(&m_lTotalRequests); - if (!bSuccess) - InterlockedIncrement(&m_lFailedRequests); - - long lTicks; - -#ifndef ATL_NO_MMSYS - lTicks = (long) (timeGetTime() - pRequestInfo->dwStartTicks); -#else - lTicks = (long) (GetTickCount() - pRequestInfo->dwStartTicks); -#endif - __int64 liTotalResponseTime = Add64(&m_liTotalResponseTime, lTicks); - long lAv = (long) (liTotalResponseTime / m_lTotalRequests); - InterlockedExchange(&m_lAvgResponseTime, lAv); - - InterlockedDecrement(&m_lActiveThreads); - } - - long GetTotalRequests() throw() - { - return m_lTotalRequests; - } - - long GetFailedRequests() throw() - { - return m_lFailedRequests; - } - - long GetAvgResponseTime() throw() - { - return m_lAvgResponseTime; - } - - void OnRequestReceived() throw() - { - long nCurrWaiting = InterlockedIncrement(&m_lCurrWaiting); - AtlInterlockedUpdateMax(nCurrWaiting, &m_lMaxWaiting); - } - - void OnRequestDequeued() throw() - { - InterlockedDecrement(&m_lCurrWaiting); - InterlockedIncrement(&m_lActiveThreads); - } - - long GetCurrWaiting() throw() - { - return m_lCurrWaiting; - } - - long GetMaxWaiting() throw() - { - return m_lMaxWaiting; - } - - long GetActiveThreads() throw() - { - return m_lActiveThreads; - } - -private: - // not actually atomic, but it will add safely. - - // the returned value is not 100% guaranteed to be - // correct, but should be correct more often than - // just reading the __int64 - // the 2 cases where the return value will not be - // a valid result value from an add are: - // * multiple threads wrap the low part in rapid succession - // * different threads are adding values with different signs - - // this is good enough for our use in RequestHandled - - // we always add positive values and we shouldn't wrap 32-bits often - inline __int64 Add64(__inout __int64* pn, long nAdd) - { - ATLENSURE(pn != NULL); - -#if defined(_WIN64) && defined(_M_CEE) - - // Use System::Threading::Interlocked::Add because InterlockedExchangeAdd is an intrisinc not supported in managed code - // with 64bits compilers. - // Also, System::Threading::Interlocked::Add support 64bits operands. - return System::Threading::Interlocked::Add(*pn, nAdd); - -#else - - long* pnLow = (long*)(LPBYTE(pn) + offsetof(LARGE_INTEGER, LowPart)); - long* pnHigh = (long*)(LPBYTE(pn) + offsetof(LARGE_INTEGER, HighPart)); - - long nOrigLow = InterlockedExchangeAdd(pnLow, nAdd); - long nNewLow = nOrigLow + nAdd; - long nNewHigh = *pnHigh; - if (nAdd > 0 && nNewLow < nOrigLow) - nNewHigh = InterlockedIncrement(pnHigh); - else if (nAdd < 0 && nNewLow > nOrigLow) - nNewHigh = InterlockedDecrement(pnHigh); - - LARGE_INTEGER li; - li.LowPart = nNewLow; - li.HighPart = nNewHigh; - return li.QuadPart; - -#endif - } -}; - -class CStdRequestStats : public CRequestStats -{ - -public: - HRESULT Initialize() throw() - { - return S_OK; - } - - void Uninitialize() throw() - { - } -}; - -#define PERF_REQUEST_OBJECT 100 - -struct CPerfRequestStatObject : public CPerfObject, - public CRequestStats -{ - DECLARE_PERF_CATEGORY_EX(PERF_REQUEST_OBJECT, IDS_PERFMON_REQUEST, IDS_PERFMON_REQUEST_HELP, PERF_DETAIL_NOVICE, 0, sizeof(CPerfRequestStatObject), MAX_PATH, -1); - BEGIN_COUNTER_MAP(CPerfRequestStatObject) - DEFINE_COUNTER(m_lTotalRequests, IDS_PERFMON_REQUEST_TOTAL, IDS_PERFMON_REQUEST_TOTAL_HELP, PERF_COUNTER_RAWCOUNT, -1) - DEFINE_COUNTER(m_lFailedRequests, IDS_PERFMON_REQUEST_FAILED, IDS_PERFMON_REQUEST_FAILED_HELP, PERF_COUNTER_RAWCOUNT, -1) - DEFINE_COUNTER(m_lTotalRequests, IDS_PERFMON_REQUEST_RATE, IDS_PERFMON_REQUEST_RATE_HELP, PERF_COUNTER_COUNTER, -1) - DEFINE_COUNTER(m_lAvgResponseTime, IDS_PERFMON_REQUEST_AVG_RESPONSE_TIME, IDS_PERFMON_REQUEST_AVG_RESPONSE_TIME_HELP, PERF_COUNTER_RAWCOUNT, -1) - DEFINE_COUNTER(m_lCurrWaiting, IDS_PERFMON_REQUEST_CURR_WAITING, IDS_PERFMON_REQUEST_CURR_WAITING_HELP, PERF_COUNTER_RAWCOUNT, -1) - DEFINE_COUNTER(m_lMaxWaiting, IDS_PERFMON_REQUEST_MAX_WAITING, IDS_PERFMON_REQUEST_MAX_WAITING_HELP, PERF_COUNTER_RAWCOUNT, -1) - DEFINE_COUNTER(m_lActiveThreads, IDS_PERFMON_REQUEST_ACTIVE_THREADS, IDS_PERFMON_REQUEST_ACTIVE_THREADS, PERF_COUNTER_RAWCOUNT, -1) - END_COUNTER_MAP() -}; - -class CRequestPerfMon : public CPerfMon -{ -public: - BEGIN_PERF_MAP(_T("ATL Server:Request")) - CHAIN_PERF_CATEGORY(CPerfRequestStatObject) - END_PERF_MAP() -}; - -class CPerfMonRequestStats -{ - CRequestPerfMon m_PerfMon; - CPerfRequestStatObject * m_pPerfObjectInstance; - CPerfRequestStatObject * m_pPerfObjectTotal; - -public: - CPerfMonRequestStats() throw() - { - m_pPerfObjectInstance = NULL; - m_pPerfObjectTotal = NULL; - } - - HRESULT Initialize() throw() - { - HRESULT hr; - - m_pPerfObjectInstance = NULL; - m_pPerfObjectTotal = NULL; - - hr = m_PerfMon.Initialize(); - if (SUCCEEDED(hr)) - { - CPerfLock lock(&m_PerfMon); - if (FAILED(hr = lock.GetStatus())) - { - return hr; - } - - HINSTANCE hInst = _AtlBaseModule.GetModuleInstance(); - WCHAR szName[MAX_PATH]; - if (GetModuleFileNameW(hInst, szName, MAX_PATH) == 0) - { - return E_FAIL; - } - szName[MAX_PATH-1] = 0; - - hr = m_PerfMon.CreateInstanceByName(L"_Total", &m_pPerfObjectTotal); - if (FAILED(hr)) - { - return hr; - } - - hr = m_PerfMon.CreateInstanceByName(szName, &m_pPerfObjectInstance); - if (FAILED(hr)) - { - m_PerfMon.ReleaseInstance(m_pPerfObjectTotal); - m_pPerfObjectTotal = NULL; - return hr; - } - } - - return hr; - } - - void Uninitialize() throw() - { - if (m_pPerfObjectInstance != NULL) - m_PerfMon.ReleaseInstance(m_pPerfObjectInstance); - if (m_pPerfObjectTotal != NULL) - m_PerfMon.ReleaseInstance(m_pPerfObjectTotal); - - m_pPerfObjectInstance = NULL; - m_pPerfObjectTotal = NULL; - - m_PerfMon.UnInitialize(); - } - - void RequestHandled(__in AtlServerRequest *pRequestInfo, __in BOOL bSuccess) throw() - { - if (m_pPerfObjectInstance != NULL) - m_pPerfObjectInstance->RequestHandled(pRequestInfo, bSuccess); - if (m_pPerfObjectTotal != NULL) - m_pPerfObjectTotal->RequestHandled(pRequestInfo, bSuccess); - } - - long GetTotalRequests() throw() - { - if (m_pPerfObjectInstance != NULL) - return m_pPerfObjectInstance->GetTotalRequests(); - - return 0; - } - - long GetFailedRequests() throw() - { - if (m_pPerfObjectInstance != NULL) - return m_pPerfObjectInstance->GetFailedRequests(); - - return 0; - } - - long GetAvgResponseTime() throw() - { - if (m_pPerfObjectInstance != NULL) - return m_pPerfObjectInstance->GetAvgResponseTime(); - - return 0; - } - - void OnRequestReceived() throw() - { - if (m_pPerfObjectInstance != NULL) - m_pPerfObjectInstance->OnRequestReceived(); - if (m_pPerfObjectTotal != NULL) - m_pPerfObjectTotal->OnRequestReceived(); - } - - void OnRequestDequeued() throw() - { - if (m_pPerfObjectInstance != NULL) - m_pPerfObjectInstance->OnRequestDequeued(); - if (m_pPerfObjectTotal != NULL) - m_pPerfObjectTotal->OnRequestDequeued(); - } - - long GetCurrWaiting() throw() - { - if (m_pPerfObjectInstance != NULL) - return m_pPerfObjectInstance->GetCurrWaiting(); - - return 0; - } - - long GetMaxWaiting() throw() - { - if (m_pPerfObjectInstance != NULL) - return m_pPerfObjectInstance->GetMaxWaiting(); - - return 0; - } - - long GetActiveThreads() throw() - { - if (m_pPerfObjectInstance != NULL) - return m_pPerfObjectInstance->GetActiveThreads(); - - return 0; - } -}; - -class CNoRequestStats -{ -protected: - -public: - - HRESULT Initialize() throw() - { - return S_OK; - } - - void Uninitialize() throw() - { - } - - void RequestHandled(AtlServerRequest * /*pRequestInfo*/, BOOL /*bSuccess*/) throw() - { - } - - long GetTotalRequests() throw() - { - return 0; - } - - long GetFailedRequests() throw() - { - return 0; - } - - long GetAvgResponseTime() throw() - { - return 0; - } - - void OnRequestReceived() throw() - { - } - - void OnRequestDequeued() throw() - { - } - - long GetCurrWaiting() throw() - { - return 0; - } - - long GetMaxWaiting() throw() - { - return 0; - } - - long GetActiveThreads() throw() - { - return 0; - } -}; - -struct ATLServerDllInfo -{ - GETATLHANDLERBYNAME pfnGetHandler; - UNINITIALIZEATLHANDLERS pfnUninitHandlers; - INITIALIZEATLHANDLERS pfnInitHandlers; - IIsapiExtension *pExtension; - IHttpServerContext *pContext; -}; - -class CDllCachePeer -{ -public: - struct DllInfo : public ATLServerDllInfo - { - DllInfo& operator=(__in const DllInfo& right) throw() - { - if (this != &right) - { - pfnGetHandler = right.pfnGetHandler; - pfnUninitHandlers = right.pfnUninitHandlers; - pfnInitHandlers = right.pfnInitHandlers; - pExtension = right.pExtension; - pContext = right.pContext; - } - return *this; - } - }; - - BOOL Add(__in HINSTANCE hInst, __out DllInfo *pInfo) throw(...) - { - ATLENSURE(pInfo!=NULL); - pInfo->pfnInitHandlers = (INITIALIZEATLHANDLERS) GetProcAddress(hInst, ATLS_FUNCID_INITIALIZEHANDLERS); - - pInfo->pfnGetHandler = (GETATLHANDLERBYNAME) GetProcAddress(hInst, ATLS_FUNCID_GETATLHANDLERBYNAME); - if (!pInfo->pfnGetHandler) - return FALSE; - - pInfo->pfnUninitHandlers = (UNINITIALIZEATLHANDLERS) GetProcAddress(hInst, ATLS_FUNCID_UNINITIALIZEHANDLERS); - - if (pInfo->pfnInitHandlers) - { - pInfo->pfnInitHandlers(pInfo->pContext, pInfo->pExtension); - pInfo->pContext = NULL; // won't be valid after this call - } - - return TRUE; - } - - void Remove(HINSTANCE /*hInst*/, __in DllInfo *pInfo) throw(...) - { - ATLENSURE(pInfo!=NULL); - if (pInfo->pfnUninitHandlers) - (*pInfo->pfnUninitHandlers)(); - } - -}; - -inline bool operator==(__in const CDllCachePeer::DllInfo& left, __in const CDllCachePeer::DllInfo& right) throw() -{ - return ( (left.pfnGetHandler == right.pfnGetHandler) && - (left.pfnUninitHandlers == right.pfnUninitHandlers) && - (left.pfnInitHandlers == right.pfnInitHandlers) && - (left.pExtension == right.pExtension) && - (left.pContext == right.pContext) - ); -} - - - -// Helper function to impersonate the client -// on the current thread -inline BOOL AtlImpersonateClient(__in IHttpServerContext *pServerContext) -{ - ATLENSURE(pServerContext); - - // impersonate the calling client on the current thread - HANDLE hToken; - _ATLTRY - { - if (!pServerContext->GetImpersonationToken(&hToken)) - return FALSE; - } - _ATLCATCHALL() - { - return FALSE; - } - - if (!SetThreadToken(NULL, hToken)) - return FALSE; - return TRUE; -} - -// Helper class to set the thread impersonation token -// This is mainly used internally to ensure that we -// don't forget to revert to the process impersonation -// level -class CSetThreadToken -{ -public: - CSetThreadToken() : m_bShouldRevert(FALSE) {} - - BOOL Initialize(__in AtlServerRequest *pRequestInfo) - { - ATLENSURE(pRequestInfo); - m_bShouldRevert = AtlImpersonateClient(pRequestInfo->pServerContext); - return m_bShouldRevert; - } - - ~CSetThreadToken() throw() - { - if( m_bShouldRevert && !RevertToSelf() ) - { - _AtlRaiseException( (DWORD)EXCEPTION_ACCESS_VIOLATION ); - } - } -protected: - BOOL m_bShouldRevert; -}; - - -// push_macro/pop_macro doesn't work in a template definition. -#pragma push_macro("new") -#undef new - - -//Base is the user's class that derives from CComObjectRoot and whatever -//interfaces the user wants to support on the object -template -class _CComObjectHeapNoLock : public Base -{ - public: - typedef Base _BaseClass; - HANDLE m_hHeap; - - _CComObjectHeapNoLock(void* = NULL, HANDLE hHeap = NULL) - { - m_hHeap = hHeap; - } - // Set refcount to -(LONG_MAX/2) to protect destruction and - // also catch mismatched Release in debug builds - ~_CComObjectHeapNoLock() - { - m_dwRef = -(LONG_MAX/2); - FinalRelease(); -#ifdef _ATL_DEBUG_INTERFACES - _AtlDebugInterfacesModule.DeleteNonAddRefThunk(_GetRawUnknown()); -#endif - } - - //If InternalAddRef or InternalRelease is undefined then your class - //doesn't derive from CComObjectRoot - STDMETHOD_(ULONG, AddRef)() throw() {return InternalAddRef();} - STDMETHOD_(ULONG, Release)() throw() - { - ULONG l = InternalRelease(); - if (l == 0) - { - HANDLE hHeap = m_hHeap;; - this->~_CComObjectHeapNoLock(); - if (hHeap != NULL) - { - HeapFree(hHeap, 0, this); - } - } - return l; - } - //if _InternalQueryInterface is undefined then you forgot BEGIN_COM_MAP - STDMETHOD(QueryInterface)(REFIID iid, void ** ppvObject) throw() - {return _InternalQueryInterface(iid, ppvObject);} - - static HRESULT WINAPI CreateInstance(_CComObjectHeapNoLock** pp, HANDLE hHeap) throw(); -}; - - - -template -HRESULT WINAPI _CComObjectHeapNoLock::CreateInstance(__deref_out _CComObjectHeapNoLock** pp, __in HANDLE hHeap) throw() -{ - ATLASSERT(pp != NULL); - if (pp == NULL) - return E_POINTER; - *pp = NULL; - - HRESULT hRes = E_OUTOFMEMORY; - // Allocate a fixed block size to avoid fragmentation - void *pv = HeapAlloc(hHeap, HEAP_ZERO_MEMORY, - __max(sizeof(AtlServerRequest), sizeof(_CComObjectHeapNoLock))); - if (pv == NULL) - { - return hRes; - } -#pragma warning(push) -#pragma warning(disable: 6280) - /* prefast noise VSW 493229 */ - _CComObjectHeapNoLock* p = new(pv) _CComObjectHeapNoLock(NULL, hHeap); -#pragma warning(pop) - - p->SetVoid(NULL); - p->InternalFinalConstructAddRef(); - hRes = p->_AtlInitialConstruct(); - if (SUCCEEDED(hRes)) - hRes = p->FinalConstruct(); - if (SUCCEEDED(hRes)) - hRes = p->_AtlFinalConstruct(); - p->InternalFinalConstructRelease(); - if (hRes != S_OK) - { - p->~_CComObjectHeapNoLock(); -#pragma warning(push) -#pragma warning(disable: 6280) - /* prefast noise VSW 493229 */ - HeapFree(hHeap, 0, p); -#pragma warning(pop) - p = NULL; - } - *pp = p; - return hRes; -} - -inline CServerContext* CreateServerContext(__in HANDLE hRequestHeap) throw() -{ - _CComObjectHeapNoLock* pContext; - _CComObjectHeapNoLock::CreateInstance(&pContext, hRequestHeap); - return pContext; -} -#pragma pop_macro("new") - -// _AtlGetHandlerName -// get handler name from stencil file. Ignore all server side comments -// szFileName - the file from which to extract the handler name -// szHandlerName - buffer into which handler name will be copied, -// it is assumed to be of size MAX_PATH+ATL_MAX_HANDLER_NAME+2 -inline HTTP_CODE _AtlGetHandlerName(__in LPCSTR szFileName, __out_ecount(MAX_PATH+ATL_MAX_HANDLER_NAME+2) LPSTR szHandlerName) -{ - ATLASSERT(szFileName); - ATLENSURE(szHandlerName); - - szHandlerName[0] = '\0'; - CAtlFile cfFile; - HRESULT hr; - - _ATLTRY - { - hr = cfFile.Create(CA2CTEX(szFileName), GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING); - if (FAILED(hr) || cfFile.m_h == NULL || GetFileType(cfFile.m_h) != FILE_TYPE_DISK) - { - if (hr == AtlHresultFromWin32(ERROR_FILE_NOT_FOUND)) - return HTTP_NOT_FOUND; - else if (hr == AtlHresultFromWin32(ERROR_ACCESS_DENIED)) - return HTTP_UNAUTHORIZED; - else - return AtlsHttpError(500, IDS_ATLSRV_SERVER_ERROR_STENCILLOADFAIL); - } - } - _ATLCATCHALL() - { - return AtlsHttpError(500, ISE_SUBERR_OUTOFMEM); // CA2CTEX threw - } - - HTTP_CODE hcErr = HTTP_SUCCESS; - DWORD dwRead=0; - LPCSTR szHandler = "handler"; - LPCSTR pszHandlerPos = NULL; - LPSTR pszHandlerName = szHandlerName; - char szBuf[4097]; - LPSTR szCurly = NULL; - LPSTR pszBuf = NULL; - bool bInQuote = false; - - // state: - // 0 = default/unknown - // 1 = have "{" - // 2 = have "{{" -- skip spaces - // 3 = have "{{" -- check "handler" - // 4 = have "handler" -- skip spaces - // 5 = have "handler" -- get name - // 6 = scan until first '}' - // 7 = better be '}' - // 8 = done - int nState = 0; - - do - { - hr = cfFile.Read(szBuf, _countof(szBuf)-1, dwRead); - if (hr != S_OK) - { - return AtlsHttpError(500, ISE_SUBERR_READFILEFAIL); // failed reading - } - - szBuf[dwRead] = '\0'; - pszBuf = szBuf; - - while (*pszBuf && nState != 8) - { - switch (nState) - { - case 0: - // 0 = default/unknown - - // look for the first curly - szCurly = strchr(pszBuf, '{'); - if (!szCurly) - { - // skip to the end of the buffer - pszBuf = szBuf+dwRead-1; - } - else - { - pszBuf = szCurly; - nState = 1; - } - break; - case 1: - // 1 = have "{" - if (*pszBuf == '{') - { - nState = 2; - } - else - { - nState = 0; // if the next character is not a '{', start over - } - break; - case 2: - if (!isspace(static_cast(*pszBuf))) - { - pszHandlerPos = szHandler; - pszBuf--; - nState = 3; - } - break; - case 3: - // 3 = partial handler "h..." - if (*pszBuf != *pszHandlerPos) - { - // not a handler, skip tag - nState = 6; - } - else - { - pszHandlerPos++; - if (!*pszHandlerPos) // at the end of the "handler" part - nState = 4; - } - break; - case 4: - // 4 = have "handler" -- skip spaces - if (!isspace(static_cast(*pszBuf))) - { - if (*pszBuf == '\"') - { - bInQuote = true; - } - else - { - pszBuf--; - } - nState = 5; - } - break; - case 5: - // 5 = have "handler" -- get name - if (isspace(static_cast(*pszBuf)) && !bInQuote) - { - if (*(pszHandlerName-1) != '/') - { - // end of the name -- jump to getting the first '}' - nState = 6; - } - else - { - nState = 4; - } - } - else if (*pszBuf == '}') - { - // end of the name -- jump to getting the second '}' - nState = 7; - } - else if (*pszBuf == '\"') - { - if (bInQuote) - { - bInQuote = false; - } - else - { - hcErr = HTTP_FAIL; - nState = 8; - } - } - else - { - // ensure we don't overwrite the buffer - if (pszHandlerName-szHandlerName >= MAX_PATH+ATL_MAX_HANDLER_NAME_LEN+1) - { - hcErr = HTTP_FAIL; - nState = 8; - } - else - { - *pszHandlerName++ = *pszBuf; - } - } - break; - case 6: - // 6 = scan until first '}' - if (*pszBuf == '}') - nState = 7; - break; - case 7: - // 7 = better be '}' - if (*pszBuf != '}') - { - hcErr = AtlsHttpError(500, ISE_SUBERR_BAD_HANDLER_TAG); - nState = 8; - } - if (*szHandlerName) - nState = 8; - else - nState = 0; - break; - default: - ATLASSERT(FALSE); - return HTTP_INTERNAL_SERVER_ERROR; - } - - pszBuf++; - } - } while (dwRead != 0 && nState != 8); - - *pszHandlerName = '\0'; - - return hcErr; -} - -// _AtlCrackHandler cracks a request path of the form dll_path/handler_name into its -// constituent parts -// szHandlerDllName - the full handler path of the form "dll_path/handler_name" -// szDllPath - the DLL path (should be of length MAX_PATH) -// szHandlerName - the handler name (should be of length ATL_MAX_HANDLER_NAME_LEN+1) -// -inline BOOL _AtlCrackHandler( - __in_z LPCSTR szHandlerDllName, - __out_ecount_part(*pdwszDllPathLen,*pdwszDllPathLen) LPSTR szDllPath, - __inout LPDWORD pdwDllPathLen, - __out_ecount_part(*pdwHandlerNameLen,*pdwHandlerNameLen) LPSTR szHandlerName, - __inout LPDWORD pdwHandlerNameLen) -{ - ATLENSURE( szHandlerDllName != NULL ); - ATLASSERT( szDllPath != NULL ); - ATLENSURE( pdwDllPathLen != NULL ); - ATLASSERT( szHandlerName != NULL ); - ATLASSERT( pdwHandlerNameLen != NULL ); - - BOOL bRet = TRUE; - - // skip leading spaces - while (*szHandlerDllName && isspace(static_cast(*szHandlerDllName))) - ++szHandlerDllName; - - // get the handler name - LPCSTR szSlash = strchr(szHandlerDllName, '/'); - LPCSTR szEnd = NULL; - LPCSTR szSlashEnd = NULL; - - // if it is of the form / - if (szSlash) - { - szEnd = szSlash; - - // skip trailing spaces on - while (szEnd>szHandlerDllName && isspace(static_cast(*(szEnd-1)))) - --szEnd; - - szSlash++; - // skip leading whitespace - while (*szSlash && isspace(static_cast(*szSlash))) - szSlash++; - - // right trim szSlash; - szSlashEnd = szSlash; - while (*szSlashEnd && !isspace(static_cast(*szSlashEnd))) - szSlashEnd++; - } - else // only the - { - szSlash = ATL_HANDLER_NAME_DEFAULT; - szSlashEnd = szSlash+sizeof(ATL_HANDLER_NAME_DEFAULT)-1; - - // do it this way to handle paths with spaces - // (e.g. "some path\subdirectory one\subdirectory two\dll_name.dll") - szEnd = szHandlerDllName+strlen(szHandlerDllName); - - // skip trailing spaces - while (szEnd>szHandlerDllName && isspace(static_cast(*(szEnd-1)))) - --szEnd; - } - - // if the dll path is quoted, strip the quotes - if (*szHandlerDllName == '\"' && *(szEnd-1) == '\"' && szEnd > szHandlerDllName+2) - { - szHandlerDllName++; - szEnd--; - } - - if (*pdwDllPathLen > (DWORD)(szEnd-szHandlerDllName) && (szEnd-szHandlerDllName >= 0)) - { - Checked::memcpy_s(szDllPath, *pdwDllPathLen, szHandlerDllName, szEnd-szHandlerDllName); - szDllPath[szEnd-szHandlerDllName] = '\0'; - *pdwDllPathLen = (DWORD)(szEnd-szHandlerDllName); - } - else - { - *pdwDllPathLen = (DWORD)(szEnd-szHandlerDllName)+1; - bRet = FALSE; - } - - if (*pdwHandlerNameLen > (DWORD)(szSlashEnd-szSlash) && (szSlashEnd-szSlash >= 0)) - { - Checked::memcpy_s(szHandlerName, *pdwHandlerNameLen, szSlash, (szSlashEnd-szSlash)); - szHandlerName[szSlashEnd-szSlash] = '\0'; - *pdwHandlerNameLen = (DWORD)(szSlashEnd-szSlash); - } - else - { - *pdwHandlerNameLen = (DWORD)(szSlashEnd-szSlash)+1; - bRet = FALSE; - } - - return bRet; -} - -inline __checkReturn __success(return==HTTP_SUCCESS) HTTP_CODE _AtlLoadRequestHandler( - __in LPCSTR szDllPath, - __in LPCSTR szHandlerName, - __in IHttpServerContext *pServerContext, - __out HINSTANCE *phInstance, - __deref_out_opt IRequestHandler **ppHandler, - __in IIsapiExtension *pExtension, - __in IDllCache *pDllCache) throw(...) -{ - ATLENSURE(phInstance!=NULL); - ATLENSURE(ppHandler!=NULL); - ATLENSURE(pDllCache!=NULL); - *phInstance = NULL; - *ppHandler = NULL; - - ATLServerDllInfo DllInfo; - DllInfo.pExtension = pExtension; - DllInfo.pContext = pServerContext; - if (!IsFullPathA(szDllPath)) - { - CHAR szFileName[MAX_PATH]; - if (!GetScriptFullFileName(szDllPath, szFileName, pServerContext)) - { - return HTTP_FAIL; - } - - *phInstance = pDllCache->Load(szFileName, (void *)&DllInfo); - } - else - { - *phInstance = pDllCache->Load(szDllPath, (void *)&DllInfo); - } - if (!*phInstance) - { - ATLTRACE( "LoadLibrary failed: '%s' with error: %d\r\n", szDllPath, GetLastError() ); - return AtlsHttpError(500, ISE_SUBERR_LOADLIB); - } - - CComPtr spUnk; - - if (!DllInfo.pfnGetHandler || - !DllInfo.pfnGetHandler(szHandlerName, pExtension, &spUnk) || - FAILED(spUnk->QueryInterface(ppHandler))) - { - pDllCache->Free(*phInstance); - *phInstance = NULL; - return AtlsHttpError(500, ISE_SUBERR_HANDLER_NOT_FOUND); - } - - return HTTP_SUCCESS; -} // _AtlLoadRequestHandler - - -class CTransferServerContext : public CComObjectRootEx, - public CWrappedServerContext -{ -public: - char m_szFileName[MAX_PATH]; - char m_szQueryString[ATL_URL_MAX_PATH_LENGTH+1]; - CStringA m_strUrl; - IWriteStream *m_pStream; - - BEGIN_COM_MAP(CTransferServerContext) - COM_INTERFACE_ENTRY(IHttpServerContext) - END_COM_MAP() - - CTransferServerContext() throw() - { - m_pStream = NULL; - } - - BOOL Initialize(__in CTransferServerContext *pOtherContext) - { - ATLENSURE(pOtherContext!=NULL); - return Initialize(pOtherContext->m_strUrl, pOtherContext->m_pStream, pOtherContext->m_spParent); - } - - BOOL Initialize(__in LPCSTR szUrl, __in IWriteStream *pStream, __in IHttpServerContext *pParent) throw() - { - m_pStream = pStream; - m_spParent = pParent; - - _ATLTRY - { - m_strUrl = szUrl; // we store the URL in case we need to initialize another context from this context - } - _ATLCATCHALL() - { - return FALSE; - } - - long nUrlLen = m_strUrl.GetLength(); - m_szFileName[0] = '\0'; - - if (!IsFullPathA(szUrl)) - { - DWORD dwLen = MAX_PATH; - BOOL bRet = TRUE; - _ATLTRY - { - bRet = m_spParent->GetServerVariable( - "APPL_PHYSICAL_PATH", - m_szFileName, - &dwLen); - } - _ATLCATCHALL() - { - bRet = FALSE; - } - - if (!bRet) - { - return bRet; - } - } - - // check for query params - LPCSTR szMark = strchr(szUrl, '?'); - if (szMark) - { - size_t nPathLen = szMark - szUrl; - size_t nLen; - - if ((nPathLen >= 0) && (nPathLen < MAX_PATH)) - { - nLen = strlen(m_szFileName) + nPathLen; - if (nLen < MAX_PATH) - { -#pragma warning(push) -#pragma warning(disable: 22008) - /* Prefast false warning about unbound nPathLen in the below fragment - - we already have necessary checks few lines above - */ - if (m_szFileName[0]) - { - Checked::strcat_s(m_szFileName, MAX_PATH-nLen, szUrl); - } - else - { - Checked::memcpy_s(m_szFileName, MAX_PATH, szUrl, nPathLen); - m_szFileName[nPathLen] = '\0'; - } -#pragma warning(pop) - } - else - { - return FALSE; // path would overwrite buffer - } - } - else - { - return FALSE; // path would overwrite buffer - } - - // save query params - nLen = strlen(szMark + 1); - if (nLen < ATL_URL_MAX_PATH_LENGTH) - { - Checked::strcpy_s(m_szQueryString, ATL_URL_MAX_PATH_LENGTH, szMark+1); - } - else - { - return FALSE; // url would overwrite buffer - } - } - else - { - // no query string - size_t nLen = strlen(m_szFileName) + nUrlLen; - if (nLen < MAX_PATH) - { - if (m_szFileName[0]) - { - Checked::strcat_s(m_szFileName, MAX_PATH-nLen, szUrl); - } - else - { - Checked::strcpy_s(m_szFileName, MAX_PATH, szUrl); - } - } - else - { - return FALSE; // path would be too long - } - m_szQueryString[0] = '\0'; - } - - return TRUE; - } - BOOL WriteClient(__in_bcount(*pdwBytes) void *pvBuffer, __inout DWORD *pdwBytes) - { - ATLENSURE(m_pStream != NULL); - - HRESULT hr = S_OK; - _ATLTRY - { - m_pStream->WriteStream((LPCSTR) pvBuffer, *pdwBytes, pdwBytes); - } - _ATLCATCHALL() - { - return FALSE; - } - - return SUCCEEDED(hr); - } - - LPCSTR GetQueryString() - { - ATLASSUME(m_spParent); - return m_szQueryString; - } - - LPCSTR GetScriptPathTranslated() - { - ATLASSUME(m_spParent); - return m_szFileName; - } - - LPCSTR GetPathTranslated() - { - ATLASSUME(m_spParent); - return m_szFileName; - } - - // Asynchronous writes will not work properly in a child handler - BOOL AsyncWriteClient(void * /*pvBuffer*/, DWORD * /*pdwBytes*/) - { - ATLASSERT(FALSE); - return FALSE; - } - - // These next few methods are to protect against attempting to parse form data twice - // We tell the new handler that it was a GET request - LPCSTR GetRequestMethod() - { - ATLASSUME(m_spParent); - return "GET"; - } - - // The handler should not query these methods -- they are only useful if attempting to - // parse form data, which is not allowed in child handlers. - BOOL ReadClient(void * /*pvBuffer*/, DWORD * /*pdwSize*/) - { - return FALSE; - } - - BOOL AsyncReadClient(void * /*pvBuffer*/, DWORD * /*pdwSize*/) - { - return FALSE; - } - - DWORD GetTotalBytes() - { - ATLASSERT(FALSE); - return 0; - } - - DWORD GetAvailableBytes() - { - ATLASSERT(FALSE); - return 0; - } - - BYTE *GetAvailableData() - { - ATLASSERT(FALSE); - return NULL; - } - - LPCSTR GetContentType() - { - ATLASSERT(FALSE); - return NULL; - } -}; - -class CAllocContextBase -{ -public: - virtual HTTP_CODE Alloc(IHttpServerContext **ppNewContext) = 0; -}; - -ATL_NOINLINE inline HTTP_CODE _AtlRenderInclude( - __in IHttpServerContext *pServerContextNew, - __in LPCSTR szFileName, - __in LPCSTR szQueryParams, - __in WORD wCodePage, - __in CAllocContextBase *pAllocContext, - __in IServiceProvider *pServiceProvider, - __in_opt IHttpRequestLookup *pLookup, - __inout_opt CStencilState* pState = NULL) -{ - ATLENSURE(pServiceProvider!=NULL); - AtlServerRequest* pRequestInfo = NULL; - HTTP_CODE hcErr = HTTP_SUCCESS; - - // get a pointer to the ISAPI extension - CComPtr spExtension; - if (S_OK != pServiceProvider->QueryInterface(&spExtension) || - !spExtension) - { - return AtlsHttpError(500, ISE_SUBERR_UNEXPECTED); - } - - // get a pointer to the extension's dll cache - CComPtr spDllCache; - if (S_OK != pServiceProvider->QueryService(__uuidof(IDllCache), - __uuidof(IDllCache), - (void**)&spDllCache) || - !spDllCache) - { - return AtlsHttpError(500, ISE_SUBERR_UNEXPECTED); - } - -#ifdef _DEBUG - bool bAsyncAllowed = false; -#endif - if (pState && pState->pIncludeInfo) - { - pRequestInfo = pState->pIncludeInfo; - pState->pIncludeInfo = NULL; -#ifdef _DEBUG - bAsyncAllowed = true; -#endif - } - else - { - ATLASSERT(spDllCache); - ATLASSERT(spExtension); - - pRequestInfo = spExtension->CreateRequest(); - if (pRequestInfo == NULL) - { - return AtlsHttpError(500, ISE_SUBERR_OUTOFMEM); - } - - pRequestInfo->dwRequestState = ATLSRV_STATE_BEGIN; - pRequestInfo->dwRequestType = ATLSRV_REQUEST_STENCIL; - pRequestInfo->pDllCache = spDllCache; - pRequestInfo->pExtension = spExtension; - pRequestInfo->pServerContext = pServerContextNew; - if (pState && pState->pParentInfo) - { - pRequestInfo->pUserData = pState->pParentInfo->pUserData; - } - - // Extract the file extension of the included file by searching - // for the first '.' from the right. - // Can't use _tcsrchr because we have to use the stencil's codepage - LPCSTR szDot = NULL; - LPCSTR szMark = szFileName; - ATLENSURE(szMark!=NULL); - while (*szMark) - { - if (*szMark == '.') - szDot = szMark; - - LPCSTR szNext = CharNextExA(wCodePage, szMark, 0); - if (szNext == szMark) - { - // embedded null - pRequestInfo->pServerContext = NULL; - spExtension->FreeRequest(pRequestInfo); - return HTTP_FAIL; - } - szMark = szNext; - } - - if (szDot && AsciiStricmp(szDot, c_AtlSRFExtension) == 0) - { - hcErr = spExtension->LoadDispatchFile(szFileName, pRequestInfo); - if (hcErr) - { - pRequestInfo->pServerContext = NULL; - spExtension->FreeRequest(pRequestInfo); - return hcErr; - } - } - else if (szDot && AsciiStricmp(szDot, c_AtlDLLExtension) == 0) - { - // Get the handler name if they used the asdf.dll?Handler=Default notation - char szHandlerName[ATL_MAX_HANDLER_NAME_LEN+1] = { '\0' }; - - LPCSTR szStart = strstr(szQueryParams, "Handler="); - if (szStart && - ((szStart == szQueryParams) || - ((szStart > szQueryParams) && (*(szStart-1) == '&')))) - { - szStart += 8; // Skip past "Handler" and the "=" - LPCSTR szEnd = strchr(szStart, '&'); - if (szEnd) - { - Checked::memcpy_s(szHandlerName, ATL_MAX_HANDLER_NAME_LEN+1, szStart, __min((szEnd-szStart), ATL_MAX_HANDLER_NAME_LEN)); - szHandlerName[__min((szEnd-szStart), ATL_MAX_HANDLER_NAME_LEN)] = '\0'; - } - else - { - if (!SafeStringCopy(szHandlerName, szStart)) - { - // handler name too long - pRequestInfo->pServerContext = NULL; - spExtension->FreeRequest(pRequestInfo); - return HTTP_FAIL; - } - } - } - else - { - ATLASSERT( ATL_MAX_HANDLER_NAME_LEN >= sizeof(ATL_HANDLER_NAME_DEFAULT) ); - Checked::memcpy_s(szHandlerName, ATL_MAX_HANDLER_NAME_LEN+1, ATL_HANDLER_NAME_DEFAULT, sizeof(ATL_HANDLER_NAME_DEFAULT)); - } - - pRequestInfo->dwRequestType = ATLSRV_REQUEST_DLL; - - hcErr = spExtension->LoadRequestHandler(szFileName, szHandlerName, pRequestInfo->pServerContext, - &pRequestInfo->hInstDll, &pRequestInfo->pHandler); - if (hcErr) - { - pRequestInfo->pServerContext = NULL; - spExtension->FreeRequest(pRequestInfo); - return hcErr; - } - } - else - { - // unknown extension - pRequestInfo->pServerContext = NULL; - spExtension->FreeRequest(pRequestInfo); - return HTTP_ERROR(500, ISE_SUBERR_UNEXPECTED); - } - - DWORD dwStatus; - hcErr = pRequestInfo->pHandler->GetFlags(&dwStatus); - - if (hcErr) - { - pRequestInfo->pHandler->UninitializeHandler(); - pRequestInfo->pServerContext = NULL; - spExtension->FreeRequest(pRequestInfo); - return hcErr; - } - - if (dwStatus & (ATLSRV_INIT_USEASYNC | ATLSRV_INIT_USEASYNC_EX)) - { -#ifdef _DEBUG - bAsyncAllowed = true; -#endif - ATLENSURE(pAllocContext!=NULL); - hcErr = pAllocContext->Alloc(&pRequestInfo->pServerContext); - if (hcErr) - { - pRequestInfo->pHandler->UninitializeHandler(); - if (pRequestInfo->pServerContext == pServerContextNew) - { - pRequestInfo->pServerContext = NULL; - } - spExtension->FreeRequest(pRequestInfo); - return hcErr; - } - } - - hcErr = pRequestInfo->pHandler->InitializeChild(pRequestInfo, pServiceProvider, pLookup); - if (hcErr) - { - pRequestInfo->pHandler->UninitializeHandler(); - if (pRequestInfo->pServerContext == pServerContextNew) - { - pRequestInfo->pServerContext = NULL; - } - spExtension->FreeRequest(pRequestInfo); - return hcErr; - } - - pRequestInfo->pfnHandleRequest = &IRequestHandler::HandleRequest; - } - - if (pRequestInfo) - { - if (!hcErr) - { - ATLASSERT(pRequestInfo->pfnHandleRequest != NULL); - hcErr = (pRequestInfo->pHandler->*pRequestInfo->pfnHandleRequest)(pRequestInfo, pServiceProvider); - -#ifdef _DEBUG - // must use ATLSRV_INIT_USEASYNC to use ASYNC returns - if (IsAsyncStatus(hcErr)) - { - ATLASSERT(bAsyncAllowed); - } -#endif - - if (IsAsyncStatus(hcErr)) - { - ATLASSERT(pState); // state is required for async - if (IsAsyncContinueStatus(hcErr)) - { - pState->pIncludeInfo = pRequestInfo; - pRequestInfo->dwRequestState = ATLSRV_STATE_CONTINUE; - } - else if (IsAsyncDoneStatus(hcErr)) - { - pRequestInfo->pHandler->UninitializeHandler(); - if (pRequestInfo->pServerContext == pServerContextNew) - { - pRequestInfo->pServerContext = NULL; - } - spExtension->FreeRequest(pRequestInfo); - } - } - else - { - pRequestInfo->pHandler->UninitializeHandler(); - if (pRequestInfo->pServerContext == pServerContextNew) - { - pRequestInfo->pServerContext = NULL; - } - spExtension->FreeRequest(pRequestInfo); - } - } - } - else - { - hcErr = AtlsHttpError(500, ISE_SUBERR_UNEXPECTED); - } - - return hcErr; -} - -// CAllocTransferAsyncContext is an unsupported implementation detail, used -// for implementing _AtlTransferRequest. -class CAllocTransferAsyncContext : - public CAllocContextBase -{ -public: - CAllocTransferAsyncContext(CTransferServerContext *pInitialContext): - m_pInitialContext(pInitialContext) - { - } - - HTTP_CODE Alloc(IHttpServerContext** ppNewContext) - { - if (!ppNewContext) - return AtlsHttpError(500, ISE_SUBERR_UNEXPECTED); - *ppNewContext = NULL; - - CComObjectNoLock* pServerContext = NULL; - ATLTRY(pServerContext = new CComObjectNoLock); - if (pServerContext == NULL) - return AtlsHttpError(500, ISE_SUBERR_OUTOFMEM); - pServerContext->Initialize(m_pInitialContext); - pServerContext->AddRef(); - *ppNewContext = pServerContext; - return HTTP_SUCCESS; - } -private: - CTransferServerContext *m_pInitialContext; -}; - -inline HTTP_CODE _AtlTransferRequest( - __in AtlServerRequest *pRequest, - __in IServiceProvider *pServiceProvider, - __in IWriteStream *pWriteStream, - __in_opt IHttpRequestLookup *pLookup, - __in LPCSTR szNewUrl, - __in WORD nCodePage, - __in bool bContinueAfterProcess, - __inout_opt CStencilState *pState) -{ - CComObjectStackEx serverContext; - if (!serverContext.Initialize(szNewUrl, pWriteStream, pRequest->pServerContext)) - return AtlsHttpError(500, 0); - CAllocTransferAsyncContext AsyncAllocObj(&serverContext); - HTTP_CODE hcErr = _AtlRenderInclude(static_cast(&serverContext), - serverContext.m_szFileName, - serverContext.m_szQueryString, - nCodePage, - &AsyncAllocObj, - pServiceProvider, - pLookup, - pState); - if (hcErr == HTTP_SUCCESS && bContinueAfterProcess) - return hcErr; - return HTTP_SUCCESS_NO_PROCESS; -} - -// -// This function is now deprecated. ATL is not using it anymore. -// -inline ATL_DEPRECATED("Do not use this function.") -void __cdecl AtlsSecErrHandlerFunc(int /* nCode */, void * /* pv */) -{ - // - // a buffer overflow has occurred in your code - // - ATLASSERT( FALSE ); - - // - // terminate process (safest thing to do) - // - TerminateProcess( GetCurrentProcess(), 1 ); -} - -// -// Class CIsapiExtension -// The main ISAPI Extension implementation. -// Template parameters -// ThreadPoolClass: Specifies the thread pool that will be used by the -// extension to queue incoming requests. CThreadPool is the -// default and is declared and implemented in ATLUTIL.H. This class -// templatizes on a worker thread class. The worker thread class -// represents an abstraction of a thread that will be used to -// process requests as they are dequeued from the pool's work queue. -// You would change this parameter if you wanted to use a completely -// different thread pool, or, more commonly, if you wanted to use -// a different worker thread class. Request processing code can -// access a pointer to the worker thread class, which allows the -// request handling code to easily access per-thread data. -// CRequestStatClass: Specifies the class to be used to track request statistics -// CNoRequestStats is the default which is a noop class. -// You would change this parameter to provide a class that will -// track request statistics for you. ATL provides CStdRequestStats -// and CPerfRequestStatObject but these classes should be used -// with caution because they require interlocked operations to -// keep track of request statistics which can affect server performance. -// HttpUserErrorTextProvider: This class provides error text messages -// and headers, including resource IDs of error messages to the -// isapi extension's error handling functions. You would change this -// parameter if you wanted to provide your own error headers and/or -// messages in response to error encountered during request processing. -// CPageCacheStats, CStencilCacheStats: These two classes are used to keep -// statistics about the page and stencil caches. You could change these -// paramters if you wanted to track statistics for these caches. ATL -// provides CPerfStatClass and CStdStatClass to store the stat data but -// using these classes can affect server performance because they use -// interlocked operations internally to store the data. -template < class ThreadPoolClass=CThreadPool, - class CRequestStatClass=CNoRequestStats, - class HttpUserErrorTextProvider=CDefaultErrorProvider, - class WorkerThreadTraits=DefaultThreadTraits, - class CPageCacheStats=CNoStatClass, - class CStencilCacheStats=CNoStatClass> -class CIsapiExtension : - public IServiceProvider, public IIsapiExtension, public IRequestStats -{ -private: - -#ifndef ATL_NO_CRITICAL_ISAPI_ERROR - - DWORD m_dwCriticalIsapiError; - -#endif // ATL_NO_CRITICAL_ISAPI_ERROR - -protected: - DWORD m_dwTlsIndex; - - typedef CWorkerThread extWorkerType; - - extWorkerType m_WorkerThread; - ThreadPoolClass m_ThreadPool; - - CDllCache m_DllCache; - CFileCache m_PageCache; - CComObjectGlobal > m_StencilCache; - HttpUserErrorTextProvider m_UserErrorProvider; - HANDLE m_hRequestHeap; - CComCriticalSection m_critSec; - - // Dynamic services stuff - struct ServiceNode - { - HINSTANCE hInst; - IUnknown *punk; - GUID guidService; - IID riid; - - ServiceNode() throw() - { - } - - ServiceNode(const ServiceNode& that) throw() - :hInst(that.hInst), punk(that.punk), guidService(that.guidService), riid(that.riid) - { - } - }; - - class CServiceEqualHelper - { - public: - static bool IsEqual(__in const ServiceNode& t1, __in const ServiceNode& t2) throw() - { - return (InlineIsEqualGUID(t1.guidService, t2.guidService) != 0 && - InlineIsEqualGUID(t1.riid, t2.riid) != 0); - } - }; - - CSimpleArray m_serviceMap; - -public: - CWin32Heap m_heap; - - CRequestStatClass m_reqStats; - - AtlServerRequest *CreateRequest() - { - // Allocate a fixed block size to avoid fragmentation - AtlServerRequest *pRequest = (AtlServerRequest *) HeapAlloc(m_hRequestHeap, - HEAP_ZERO_MEMORY, __max(sizeof(AtlServerRequest), sizeof(_CComObjectHeapNoLock))); - if (!pRequest) - return NULL; - pRequest->cbSize = sizeof(AtlServerRequest); - - return pRequest; - } - - void FreeRequest(__inout AtlServerRequest *pRequest) - { - _ReleaseAtlServerRequest(pRequest); - HeapFree(m_hRequestHeap, 0, pRequest); - } - - CIsapiExtension() throw() - { - m_hRequestHeap = NULL; -#ifdef _DEBUG - m_bDebug = FALSE; -#endif - -#ifndef ATL_NO_CRITICAL_ISAPI_ERROR - - m_dwCriticalIsapiError = 0; - -#endif // ATL_NO_CRITICAL_ISAPI_ERROR - } - - HTTP_CODE TransferRequest( - __in AtlServerRequest *pRequest, - __in IServiceProvider *pServiceProvider, - __in IWriteStream *pWriteStream, - __in_opt IHttpRequestLookup *pLookup, - __in LPCSTR szNewUrl, - __in WORD nCodePage, - __in bool bContinueAfterProcess, - __inout_opt CStencilState *pState) - { - HTTP_CODE hcErr; - _ATLTRY - { - hcErr = _AtlTransferRequest(pRequest, pServiceProvider, pWriteStream, - pLookup, szNewUrl, nCodePage, bContinueAfterProcess, pState); - } - _ATLCATCHALL() - { - hcErr = HTTP_FAIL; - } - return hcErr; - } - -#ifndef ATL_NO_CRITICAL_ISAPI_ERROR - - DWORD ReturnCriticalError(__in EXTENSION_CONTROL_BLOCK *pECB) - { - - _ATLTRY - { - ATLENSURE(pECB); - UINT uResId = 0; - LPCSTR szHeader = NULL; - - CStringA strStatus; - CStringA strBody; - CStringA strFormat; - CStringA strError; - - DWORD dwErr = GetCriticalIsapiError(); - if (!strError.LoadString(dwErr)) - { - strError.Format("Unknown Error %d", dwErr); - } - -#ifdef ATL_CRITICAL_ISAPI_ERROR_LOGONLY - // we've logged the real error - don't send detailed internal info to the user - m_UserErrorProvider.GetErrorText(500, - SUBERR_NONE, - &szHeader, - &uResId); - - if (!uResId || !strBody.LoadString(uResId)) - { - strBody = "A server error has occurred."; - } -#else - m_UserErrorProvider.GetErrorText(500, - ISE_SUBERR_ISAPISTARTUPFAILED, - &szHeader, - &uResId); - if (!uResId || !strFormat.LoadString(uResId)) - { - strFormat = "A critical error has occurred initializing this ISAPI extension: %s"; - } - strBody.Format(strFormat, strError); -#endif - strStatus.Format("500 %s", szHeader); - - HSE_SEND_HEADER_EX_INFO hex; - hex.pszStatus = (LPCSTR)strStatus; - hex.pszHeader = NULL; - hex.cchStatus = (DWORD)strStatus.GetLength(); - hex.cchHeader = 0; - hex.fKeepConn = FALSE; - - pECB->ServerSupportFunction(pECB->ConnID, - HSE_REQ_SEND_RESPONSE_HEADER_EX, - &hex, - NULL, - NULL); - - DWORD dwBodyLen = strBody.GetLength(); - pECB->WriteClient(pECB->ConnID, - (void *) (LPCSTR) strBody, - &dwBodyLen, - NULL); - } - _ATLCATCHALL() - { - return HSE_STATUS_ERROR; - } - return HSE_STATUS_SUCCESS; - } - -#endif // ATL_NO_CRITICAL_ISAPI_ERROR - - DWORD HttpExtensionProc(LPEXTENSION_CONTROL_BLOCK lpECB) throw() - { - -#ifndef ATL_NO_CRITICAL_ISAPI_ERROR - - if (GetCriticalIsapiError() != 0) - { - return ReturnCriticalError(lpECB); - } - -#endif // ATL_NO_CRITICAL_ISAPI_ERROR - - AtlServerRequest *pRequestInfo = NULL; - - _ATLTRY - { - pRequestInfo = CreateRequest(); - if (pRequestInfo == NULL) - return HSE_STATUS_ERROR; - - CServerContext *pServerContext = NULL; - ATLTRY(pServerContext = CreateServerContext(m_hRequestHeap)); - if (pServerContext == NULL) - { - FreeRequest(pRequestInfo); - return HSE_STATUS_ERROR; - } - - pServerContext->Initialize(lpECB); - pServerContext->AddRef(); - - pRequestInfo->pServerContext = pServerContext; - pRequestInfo->dwRequestType = ATLSRV_REQUEST_UNKNOWN; - pRequestInfo->dwRequestState = ATLSRV_STATE_BEGIN; - pRequestInfo->pExtension = static_cast(this); - pRequestInfo->pDllCache = static_cast(&m_DllCache); -#ifndef ATL_NO_MMSYS - pRequestInfo->dwStartTicks = timeGetTime(); -#else - pRequestInfo->dwStartTicks = GetTickCount(); -#endif - pRequestInfo->pECB = lpECB; - - m_reqStats.OnRequestReceived(); - - if (m_ThreadPool.QueueRequest(pRequestInfo)) - return HSE_STATUS_PENDING; - - if (pRequestInfo != NULL) - { - FreeRequest(pRequestInfo); - } - - } - _ATLCATCHALL() - { - } - - - - return HSE_STATUS_ERROR; - } - - - BOOL QueueRequest(__in AtlServerRequest * pRequestInfo) - { - return m_ThreadPool.QueueRequest(pRequestInfo); - } - - CIsapiWorker *GetThreadWorker() - { - return (CIsapiWorker *) TlsGetValue(m_dwTlsIndex); - } - - BOOL SetThreadWorker(__in CIsapiWorker *pWorker) - { - return TlsSetValue(m_dwTlsIndex, (void*)pWorker); - } - - // Configuration functions -- override in base class if another value is desired - virtual LPCSTR GetExtensionDesc() throw() { return "VC Server Classes"; } - virtual int GetNumPoolThreads() throw() { return 0; } - virtual int GetPoolStackSize() throw() { return 0; } - virtual HANDLE GetIOCompletionHandle() throw() { return INVALID_HANDLE_VALUE; } - virtual DWORD GetDllCacheTimeout() throw() { return ATL_DLL_CACHE_TIMEOUT; } - virtual DWORD GetStencilCacheTimeout() throw() { return ATL_STENCIL_CACHE_TIMEOUT; } - virtual LONGLONG GetStencilLifespan() throw() { return ATL_STENCIL_LIFESPAN; } - - BOOL OnThreadAttach() - { - return SUCCEEDED(CoInitializeEx(NULL, COINIT_APARTMENTTHREADED)); - } - - void OnThreadTerminate() - { - CoUninitialize(); - } - -#ifndef ATL_NO_CRITICAL_ISAPI_ERROR - - BOOL SetCriticalIsapiError(__in DWORD dwErr = 1) throw() - { - m_dwCriticalIsapiError = dwErr; - - // send the error to the event log - _ATLTRY - { - CStringA strBody; - CStringA strFormat; - CStringA strError; - - // format an error message - if (!strError.LoadString(dwErr)) - { - strError.Format("Unknown Error %d", dwErr); - } - - if (!strFormat.LoadString(IDS_ATLSRV_CRITICAL_LOGMESSAGE)) - { - strFormat = "A critical error has occurred initializing the ISAPI extension: %s"; - } - strBody.Format(strFormat, strError); - - // take the base module name as the app name - CPath path; - { - CStrBuf buf(path, MAX_PATH); - DWORD dwLen = ::GetModuleFileName(_AtlBaseModule.GetModuleInstance(), buf, MAX_PATH); - if (dwLen == MAX_PATH) - buf.SetLength(MAX_PATH); - } - path.StripPath(); - - // log the event - HANDLE h = RegisterEventSource(NULL, path); - if (h) - { - LPCSTR szBody = strBody; - ReportEventA(h, EVENTLOG_ERROR_TYPE, 0, 0, NULL, 1, 0, &szBody, NULL); - DeregisterEventSource(h); - } - } - _ATLCATCHALL() - { - } - - return TRUE; - } - - DWORD GetCriticalIsapiError() throw() - { - return m_dwCriticalIsapiError; - } - -#else - - BOOL SetCriticalIsapiError(__in DWORD dwErr = 1) throw() - { - dwErr; // not used - return FALSE; - } - - DWORD GetCriticalIsapiError() throw() - { - return 0; - } - -#endif // ATL_NO_CRITICAL_ISAPI_ERROR - - - BOOL GetExtensionVersion(__out HSE_VERSION_INFO* pVer) throw() - { - ATLASSERT(pVer!=NULL); - if(pVer==NULL) - { - return FALSE; - } - // allocate a Tls slot for storing per thread data - m_dwTlsIndex = TlsAlloc(); - - // create a private heap for request data - // this heap has to be thread safe to allow for - // async processing of requests - m_hRequestHeap = HeapCreate(0, 0, 0); - if (!m_hRequestHeap) - { - ATLTRACE(atlTraceISAPI, 0, _T("Failed creating request heap. Using process heap\n")); - m_hRequestHeap = GetProcessHeap(); - if (!m_hRequestHeap) - { - return SetCriticalIsapiError(IDS_ATLSRV_CRITICAL_HEAPCREATEFAILED); - } - - } - - // create a private heap (synchronized) for - // allocations. This reduces fragmentation overhead - // as opposed to the process heap - HANDLE hHeap = HeapCreate(0, 0, 0); - if (!hHeap) - { - ATLTRACE(atlTraceISAPI, 0, _T("Failed creating extension heap. Using process heap\n")); - hHeap = GetProcessHeap(); - m_heap.Attach(hHeap, false); - } - else - { - m_heap.Attach(hHeap, true); - } - hHeap = NULL; - - if (S_OK != m_reqStats.Initialize()) - { - ATLTRACE(atlTraceISAPI, - 0, - _T("Initialization failed for request statistics perfmon support.\n") - _T("Check request statistics perfmon dll registration\n") ); - } - - if (S_OK != m_WorkerThread.Initialize()) - { - return SetCriticalIsapiError(IDS_ATLSRV_CRITICAL_WORKERINITFAILED); - } - - if (m_critSec.Init() != S_OK) - { - HRESULT hrIgnore=m_WorkerThread.Shutdown(); - (hrIgnore); - return SetCriticalIsapiError(IDS_ATLSRV_CRITICAL_CRITSECINITFAILED); - } - - if (S_OK != m_ThreadPool.Initialize(static_cast(this), GetNumPoolThreads(), GetPoolStackSize(), GetIOCompletionHandle())) - { - HRESULT hrIgnore=m_WorkerThread.Shutdown(); - (hrIgnore); - m_critSec.Term(); - return SetCriticalIsapiError(IDS_ATLSRV_CRITICAL_THREADPOOLFAILED); - } - - if (FAILED(m_DllCache.Initialize(&m_WorkerThread, GetDllCacheTimeout()))) - { - HRESULT hrIgnore=m_WorkerThread.Shutdown(); - (hrIgnore); - m_ThreadPool.Shutdown(); - m_critSec.Term(); - return SetCriticalIsapiError(IDS_ATLSRV_CRITICAL_DLLCACHEFAILED); - } - - if (FAILED(m_PageCache.Initialize(&m_WorkerThread))) - { - HRESULT hrIgnore=m_WorkerThread.Shutdown(); - (hrIgnore); - m_ThreadPool.Shutdown(); - m_DllCache.Uninitialize(); - m_critSec.Term(); - return SetCriticalIsapiError(IDS_ATLSRV_CRITICAL_PAGECACHEFAILED); - } - - if (S_OK != m_StencilCache.Initialize(static_cast(this), - &m_WorkerThread, - GetStencilCacheTimeout(), - GetStencilLifespan())) - { - HRESULT hrIgnore=m_WorkerThread.Shutdown(); - (hrIgnore); - m_ThreadPool.Shutdown(); - m_DllCache.Uninitialize(); - m_PageCache.Uninitialize(); - m_critSec.Term(); - return SetCriticalIsapiError(IDS_ATLSRV_CRITICAL_STENCILCACHEFAILED); - } - - pVer->dwExtensionVersion = HSE_VERSION; - Checked::strncpy_s(pVer->lpszExtensionDesc, HSE_MAX_EXT_DLL_NAME_LEN, GetExtensionDesc(), _TRUNCATE); - pVer->lpszExtensionDesc[HSE_MAX_EXT_DLL_NAME_LEN - 1] = '\0'; - - return TRUE; - } - - BOOL TerminateExtension(DWORD /*dwFlags*/) throw() - { - m_critSec.Lock(); - for (int i=0; i < m_serviceMap.GetSize(); i++) - { - ATLASSUME(m_serviceMap[i].punk != NULL); - if(m_serviceMap[i].punk != NULL) - { - m_serviceMap[i].punk->Release(); - } - m_DllCache.ReleaseModule(m_serviceMap[i].hInst); - } - m_critSec.Unlock(); - - m_ThreadPool.Shutdown(); - m_StencilCache.Uninitialize(); - m_DllCache.Uninitialize(); - m_PageCache.Uninitialize(); - HRESULT hrShutdown=m_WorkerThread.Shutdown(); - m_reqStats.Uninitialize(); - m_critSec.Term(); - - // free the request heap - if (m_hRequestHeap != GetProcessHeap()) - HeapDestroy(m_hRequestHeap); - - // free the Tls slot that we allocated - TlsFree(m_dwTlsIndex); - - return SUCCEEDED(hrShutdown); - } - - static void WINAPI AsyncCallback(LPEXTENSION_CONTROL_BLOCK /*lpECB*/, - __in PVOID pContext, - __in DWORD cbIO, - __in DWORD dwError) throw(...) - { - AtlServerRequest *pRequestInfo = reinterpret_cast(pContext); - ATLENSURE(pRequestInfo); - if (pRequestInfo->m_hMutex) - { - // synchronize in case the previous async_noflush call isn't finished - // setting up state for the next call. - DWORD dwStatus = WaitForSingleObject(pRequestInfo->m_hMutex, ATLS_ASYNC_MUTEX_TIMEOUT); - if (dwStatus != WAIT_OBJECT_0 && dwStatus != WAIT_ABANDONED) - { - _ATLTRY - { - pRequestInfo->pExtension->RequestComplete(pRequestInfo, 500, ISE_SUBERR_UNEXPECTED); - } - _ATLCATCHALL() - { - ATLTRACE(_T("Warning: Uncaught user exception thrown and caught in AsyncCallback.\n")); - _ATLRETHROW; - } - return; - } - } - - if (pRequestInfo->pfnAsyncComplete != NULL) - ATLTRY((*pRequestInfo->pfnAsyncComplete)(pRequestInfo, cbIO, dwError)); - - if (pRequestInfo->dwRequestState == ATLSRV_STATE_DONE) - { - pRequestInfo->pExtension->RequestComplete(pRequestInfo, HTTP_ERROR_CODE(HTTP_SUCCESS), 0); - } - else if (pRequestInfo->dwRequestState == ATLSRV_STATE_CACHE_DONE) - { - CloseHandle(pRequestInfo->hFile); - pRequestInfo->pFileCache->ReleaseFile(pRequestInfo->hEntry); - pRequestInfo->pExtension->RequestComplete(pRequestInfo, HTTP_ERROR_CODE(HTTP_SUCCESS), 0); - } - else - { - HANDLE hMutex = pRequestInfo->m_hMutex; - pRequestInfo->pExtension->QueueRequest(pRequestInfo); - if (hMutex) - ReleaseMutex(hMutex); - } - } - - void HandleError(__in IHttpServerContext *pServerContext, __in DWORD dwStatus, __in DWORD dwSubStatus) throw() - { - RenderError(pServerContext, dwStatus, dwSubStatus, &m_UserErrorProvider); - } - - void RequestComplete(__inout AtlServerRequest *pRequestInfo, __in DWORD dwStatus, __in DWORD dwSubStatus) - { - ATLASSERT(pRequestInfo); - - if (pRequestInfo->pHandler != NULL) - pRequestInfo->pHandler->UninitializeHandler(); - - DWORD dwReqStatus = dwStatus; - if (!dwReqStatus) - dwReqStatus = 200; - - if (dwStatus >= 400) - { - if (dwSubStatus != SUBERR_NO_PROCESS) - HandleError(pRequestInfo->pServerContext, dwStatus, dwSubStatus); - m_reqStats.RequestHandled(pRequestInfo, FALSE); - } - else - m_reqStats.RequestHandled(pRequestInfo, TRUE); - - CComPtr spServerContext = pRequestInfo->pServerContext; - - FreeRequest(pRequestInfo); - - spServerContext->DoneWithSession(dwReqStatus); - } - - HTTP_CODE GetHandlerName(__in LPCSTR szFileName, __out_ecount(MAX_PATH+ATL_MAX_HANDLER_NAME+2) LPSTR szHandlerName) throw() - { - return _AtlGetHandlerName(szFileName, szHandlerName); - } - - HTTP_CODE LoadDispatchFile(__in LPCSTR szFileName, __out AtlServerRequest *pRequestInfo) - { - ATLASSERT(szFileName); - ATLASSERT(pRequestInfo); - - CStencil *pStencil = NULL; - HCACHEITEM hStencil = NULL; - - // Must have space for the path to the handler + the maximum size - // of the handler, plus the '/' plus the '\0' - CHAR szDllPath[MAX_PATH]; - CHAR szHandlerName[ATL_MAX_HANDLER_NAME_LEN+1]; - - pRequestInfo->pHandler = NULL; - pRequestInfo->hInstDll = NULL; - - m_StencilCache.LookupStencil(szFileName, &hStencil); - - // Stencil was found, check to see if it needs to be refreshed - if (hStencil) - { - m_StencilCache.GetStencil(hStencil, (void **) &pStencil); - pStencil->GetHandlerName(szDllPath, MAX_PATH, szHandlerName, ATL_MAX_HANDLER_NAME_LEN + 1); - - CFileTime cftCurr; - CFileTime cftLastChecked; - cftCurr = CFileTime::GetCurrentTime(); - - pStencil->GetLastChecked(&cftLastChecked); - - CFileTimeSpan span(ATL_STENCIL_CHECK_TIMEOUT * CFileTime::Millisecond); - - if (cftLastChecked + span < cftCurr) - { - CComPtr spCacheCtrl; - m_StencilCache.QueryInterface(__uuidof(IStencilCacheControl), reinterpret_cast(&spCacheCtrl)); - if (spCacheCtrl) - { - CFileTime cftLastModified; - pStencil->GetLastModified(&cftLastModified); - - // Resource based stencils have a last modified filetime of 0 - if (cftLastModified != 0) - { - // for file base stencils, we check whether the file - // has been modified since being put in the cache - WIN32_FILE_ATTRIBUTE_DATA fad; - pStencil->SetLastChecked(&cftCurr); - BOOL bRet = GetFileAttributesExA(szFileName, GetFileExInfoStandard, &fad); - - if ((bRet && cftLastModified < fad.ftLastWriteTime) || - !bRet) - { - // the file has changed or an error has occurred trying to read the file, - // so remove it from the cache and force a reload - spCacheCtrl->RemoveStencil(hStencil); - pStencil = NULL; - hStencil = NULL; - } - } - } - } - } - - - if (!hStencil) - { - CHAR szHandlerDllName[MAX_PATH+ATL_MAX_HANDLER_NAME_LEN+1]; - *szHandlerDllName = '\0'; - - // not in the cache, so open the file - HTTP_CODE hcErr = GetHandlerName(szFileName, szHandlerDllName); - if (hcErr) - return hcErr; - DWORD dwDllPathLen = MAX_PATH; - DWORD dwHandlerNameLen = ATL_MAX_HANDLER_NAME_LEN+1; - if (!_AtlCrackHandler(szHandlerDllName, szDllPath, &dwDllPathLen, szHandlerName, &dwHandlerNameLen)) - { - return AtlsHttpError(500, ISE_SUBERR_HANDLER_NOT_FOUND); - } - ATLASSERT(*szHandlerName); - ATLASSERT(*szDllPath); - if (!*szHandlerName) - { - return AtlsHttpError(500, ISE_SUBERR_HANDLER_NOT_FOUND); - } - } - else - { - m_StencilCache.ReleaseStencil(hStencil); - } - - - return LoadRequestHandler(szDllPath, szHandlerName, pRequestInfo->pServerContext, - &pRequestInfo->hInstDll, &pRequestInfo->pHandler); - } - - HTTP_CODE LoadDllHandler(__in LPCSTR szFileName, __in AtlServerRequest *pRequestInfo) - { - ATLASSERT(szFileName); - ATLENSURE(pRequestInfo); - - _ATLTRY - { - HTTP_CODE hcErr = HTTP_SUCCESS; - CHAR szHandler[ATL_MAX_HANDLER_NAME_LEN+1] = { 'D', 'e', 'f', 'a', 'u', 'l', 't', '\0' }; - LPCSTR szQueryString = pRequestInfo->pServerContext->GetQueryString(); - if (szQueryString != NULL) - { - LPCSTR szHdlr = strstr(szQueryString, "Handler="); - if (szHdlr != NULL) - { - if ((szHdlr == szQueryString) || - ((szHdlr > szQueryString) && (*(szHdlr-1) == '&'))) - { - int nCnt = 0; - LPSTR pszHandler = szHandler; - szHdlr += sizeof("Handler=")-1; - while (*szHdlr && *szHdlr != '&') - { - if (nCnt < ATL_MAX_HANDLER_NAME_LEN) - { - *pszHandler++ = *szHdlr++; - nCnt++; - } - else - { - hcErr = AtlsHttpError(500, ISE_SUBERR_HANDLER_NOT_FOUND); - break; - } - } - if (hcErr == HTTP_SUCCESS) - { - *pszHandler = '\0'; - } - } - } - } - - if (hcErr == HTTP_SUCCESS) - { - CHAR szFile[MAX_PATH+ATL_MAX_HANDLER_NAME_LEN+1]; - if (SafeStringCopy(szFile, szFileName)) - { - hcErr = LoadRequestHandler(szFile, szHandler, pRequestInfo->pServerContext, &pRequestInfo->hInstDll, &pRequestInfo->pHandler); - } - else - { - hcErr = AtlsHttpError(500, ISE_SUBERR_UNEXPECTED); - } - } - - return hcErr; - } - _ATLCATCHALL() - { - return AtlsHttpError(500, ISE_SUBERR_UNEXPECTED); - } - } - -#pragma warning(push) -#pragma warning(disable: 6014) - virtual __success(return) __checkReturn BOOL GetCacheServerContext(__in AtlServerRequest *pRequestInfo, __in IFileCache *pCache, __deref_out_opt IHttpServerContext **pCacheCtx) - { - ATLENSURE(pCacheCtx); - *pCacheCtx = NULL; - - CComObjectNoLock *pCacheServerContext = NULL; - ATLTRY(pCacheServerContext = new CComObjectNoLock); - if (!pCacheServerContext) - return FALSE; - - if (!pCacheServerContext->Initialize(pRequestInfo->pServerContext, pCache)) - { - delete pCacheServerContext; - return FALSE; - } - - pCacheServerContext->QueryInterface(__uuidof(IHttpServerContext), (void **) pCacheCtx); - - if (*pCacheCtx) - return TRUE; - - delete pCacheServerContext; - return FALSE; - } -#pragma warning(pop) - - virtual BOOL TransmitFromCache(__in AtlServerRequest* pRequestInfo, __out BOOL *pbAllowCaching) - { - ATLENSURE(pRequestInfo); - ATLENSURE(pbAllowCaching); - - *pbAllowCaching = TRUE; - - _ATLTRY - { - if (strcmp(pRequestInfo->pServerContext->GetRequestMethod(), "GET")) - return FALSE; - - char szUrl[ATL_URL_MAX_URL_LENGTH + 1]; - LPCSTR szPathInfo = pRequestInfo->pServerContext->GetPathInfo(); - LPCSTR szQueryString = pRequestInfo->pServerContext->GetQueryString(); - - int nSize = 0; - LPSTR szTo = szUrl; - ATLENSURE(szPathInfo!=NULL); - while (*szPathInfo && nSize < ATL_URL_MAX_URL_LENGTH) - { - *szTo++ = *szPathInfo++; - nSize++; - } - if (nSize >= ATL_URL_MAX_URL_LENGTH) - { - return FALSE; - } - *szTo++ = '?'; - nSize++; - ATLENSURE(szQueryString!=NULL); - while (*szQueryString && nSize < ATL_URL_MAX_URL_LENGTH) - { - *szTo++ = *szQueryString++; - nSize++; - } - if (nSize >= ATL_URL_MAX_URL_LENGTH) - { - return FALSE; - } - *szTo = '\0'; - - HCACHEITEM hEntry; - - if (S_OK == m_PageCache.LookupFile(szUrl, &hEntry)) - { - LPSTR szFileName; - CPageCachePeer::PeerInfo *pInfo; - m_PageCache.GetFile(hEntry, &szFileName, (void **)&pInfo); - ATLENSURE(pInfo); - CAtlFile file; - HRESULT hr = E_FAIL; - - CA2CTEX strFile(szFileName); - hr = file.Create(strFile, - GENERIC_READ, - FILE_SHARE_READ, - OPEN_EXISTING, - FILE_FLAG_SEQUENTIAL_SCAN | FILE_FLAG_OVERLAPPED); - - if (FAILED(hr) || GetFileType(file) != FILE_TYPE_DISK) - { - m_PageCache.ReleaseFile(hEntry); - *pbAllowCaching = FALSE; - return FALSE; - } - - pRequestInfo->pServerContext->SendResponseHeader( - pInfo->strHeader, pInfo->strStatus, FALSE); - HANDLE hFile = file.Detach(); - BOOL bRet = FALSE; - - pRequestInfo->dwRequestState = ATLSRV_STATE_CACHE_DONE; - pRequestInfo->hFile = hFile; - pRequestInfo->hEntry = hEntry; - pRequestInfo->pFileCache = &m_PageCache; - - bRet = pRequestInfo->pServerContext->TransmitFile( - hFile, // The file to transmit - AsyncCallback, pRequestInfo, // The async callback and context - pInfo->strStatus, // HTTP status code - 0, // Send entire file - 0, // Start at the beginning of the file - NULL, 0, // Head and length - NULL, 0, // Tail and length - HSE_IO_ASYNC | HSE_IO_DISCONNECT_AFTER_SEND | HSE_IO_NODELAY // Send asynchronously - ); - - if (!bRet) - { - m_PageCache.ReleaseFile(hEntry); - CloseHandle(hFile); - *pbAllowCaching = FALSE; - return FALSE; - } - return TRUE; - } - } - _ATLCATCHALL() - { - } - - return FALSE; - } - -#if defined(_DEBUG) || defined(ATLS_ENABLE_DEBUGGING) - - BOOL m_bDebug; - // F5 debugging support for VS7 - BOOL ProcessDebug(__inout AtlServerRequest *pRequestInfo) -{ - ATLENSURE(pRequestInfo); - static GUID clsidDebugger[] = { - {0x70F65411, 0xFE8C, 0x4248, {0xBC,0xFF,0x70,0x1C,0x8B,0x2F,0x45,0x29}}, // debugger clsid - {0x62A78AC2, 0x7D9A, 0x4377, {0xB9,0x7E,0x69,0x65,0x91,0x9F,0xDD,0x02}}, // reserved - {0xCC23651F, 0x4574, 0x438F, {0xB4,0xAA,0xBC,0xB2,0x8B,0x6B,0x3E,0xCF}}, // reserved - {0xDBFDB1D0, 0x04A4, 0x4315, {0xB1,0x5C,0xF8,0x74,0xF6,0xB6,0xE9,0x0B}}, // reserved - {0xA4FCB474, 0x2687, 0x4924, {0xB0,0xAD,0x7C,0xAF,0x33,0x1D,0xB8,0x26}}, // reserved - {0xBEB261F6, 0xD5F0, 0x43BA, {0xBA,0xF4,0x8B,0x79,0x78,0x5F,0xFF,0xAF}}, // reserved - {0x8E2F5E28, 0xD4E2, 0x44C0, {0xAA,0x02,0xF8,0xC5,0xBE,0xB7,0x0C,0xAC}}, // reserved - {0x08100915, 0x0F41, 0x4CCF, {0x95,0x64,0xEB,0xAA,0x5D,0x49,0x44,0x6C}} // reserved - }; - _ATLTRY - { - if (!_stricmp(pRequestInfo->pServerContext->GetRequestMethod(), "debug")) - { - // Debugger must be able to validate the client we are impersonating - // on an NT Domain so the client needs to use either NTLM or Negotiate. - DWORD dwAuthTypeSize = 64; - char szAuthType[64] = { 0 }; - - if ( !pRequestInfo->pServerContext->GetServerVariable("AUTH_TYPE", szAuthType, &dwAuthTypeSize) ) - { - // error retrieving authentication type - RequestComplete(pRequestInfo, 501, 0); - return FALSE; - } - - // if it's empty or not NTLM or negotiate we fail. - if ( !( *szAuthType != '\0 ' && - ( !_stricmp(szAuthType, "NTLM") || - !_stricmp(szAuthType, "Negotiate")) - ) ) - { - // wrong authorization type or not authorized - RequestComplete(pRequestInfo, 401, 0); - return FALSE; - } - - DWORD dwHeadersLen = 0; - CStringA strHeaders; - pRequestInfo->pServerContext->GetServerVariable("ALL_HTTP", NULL, &dwHeadersLen); - BOOL bRet = pRequestInfo->pServerContext->GetServerVariable("ALL_HTTP", strHeaders.GetBuffer(dwHeadersLen), &dwHeadersLen); - if (!bRet) - { - RequestComplete(pRequestInfo, 501, 0); - return FALSE; - } - strHeaders.ReleaseBuffer(dwHeadersLen - 1); - LPCSTR szCur = strHeaders; - - while(*szCur) - { - if (!strncmp(szCur, "HTTP_COMMAND:", 13)) - { - szCur += 13; - break; - } - - szCur = strchr(szCur, '\n'); - if (!szCur) - { - RequestComplete(pRequestInfo, 501, 0); - return FALSE; - } - - szCur++; - } - - - if (!_strnicmp(szCur, "start-debug", sizeof("start-debug")-sizeof('\0'))) - { - CCritSecLock Lock(m_critSec.m_sec); - if (m_bDebug) - { - HandleError(pRequestInfo->pServerContext, 204, DBG_SUBERR_ALREADY_DEBUGGING); - RequestComplete(pRequestInfo, 204, DBG_SUBERR_ALREADY_DEBUGGING); // Already being debugged by another process - return FALSE; - } - CHttpRequest HttpRequest; - HttpRequest.Initialize(pRequestInfo->pServerContext); - HttpRequest.InitFromPost(); - LPCSTR szString; - szString = HttpRequest.FormVars.Lookup("DebugSessionID"); - if (!szString || !*szString) - { - HandleError(pRequestInfo->pServerContext, 204, DBG_SUBERR_INVALID_SESSION); - RequestComplete(pRequestInfo, 204, DBG_SUBERR_INVALID_SESSION); - return FALSE; - } - CA2W szSessionID(szString); - if (!szSessionID) - { - HandleError(pRequestInfo->pServerContext, 500, ISE_SUBERR_OUTOFMEM); - RequestComplete(pRequestInfo, 500, ISE_SUBERR_OUTOFMEM); - return FALSE; - } - DWORD dwPid = GetCurrentProcessId(); - LPWSTR szPoint = szSessionID; - while (szPoint && *szPoint && wcsncmp(szPoint, L"autoattachclsid=", 16)) - { - szPoint = wcschr(szPoint, ';'); - if (szPoint) - szPoint++; - } - - if (!szPoint || !*szPoint) - { - HandleError(pRequestInfo->pServerContext, 204, DBG_SUBERR_BAD_ID); - RequestComplete(pRequestInfo, 204, DBG_SUBERR_BAD_ID); - return FALSE; - } - - szPoint += (sizeof("autoattachclsid=") - 1); - WCHAR szClsid[39]; - szClsid[38] = '\0'; - Checked::wcsncpy_s(szClsid, _countof(szClsid), szPoint, _TRUNCATE); - if (szClsid[38] != '\0') - { - HandleError(pRequestInfo->pServerContext, 204, DBG_SUBERR_BAD_ID); - RequestComplete(pRequestInfo, 204, DBG_SUBERR_BAD_ID); - return FALSE; - } - szClsid[38] = '\0'; - - CLSID clsidDebugAutoAttach = CLSID_NULL; - HRESULT hr = CLSIDFromString(szClsid, &clsidDebugAutoAttach); - - if (hr != S_OK) - { - HandleError(pRequestInfo->pServerContext, 204, DBG_SUBERR_BAD_ID); - RequestComplete(pRequestInfo, 204, DBG_SUBERR_BAD_ID); - return FALSE; - } - - size_t i=0, - nArrSize = sizeof(clsidDebugger)/sizeof(GUID); - for (i=0; i= nArrSize) - { - HandleError(pRequestInfo->pServerContext, 204, DBG_SUBERR_BAD_ID); - RequestComplete(pRequestInfo, 204, DBG_SUBERR_BAD_ID); - return FALSE; - } - - CComPtr spDebugAutoAttach; - hr = CoCreateInstance(clsidDebugAutoAttach, NULL, CLSCTX_LOCAL_SERVER | CLSCTX_INPROC_SERVER, __uuidof(IDebugAutoAttach), (void**)&spDebugAutoAttach); - if (FAILED(hr)) - { - if (hr == E_ACCESSDENIED) - RequestComplete(pRequestInfo, 401, 0); - else - { - HandleError(pRequestInfo->pServerContext, 204, DBG_SUBERR_COCREATE); - RequestComplete(pRequestInfo, 204, DBG_SUBERR_COCREATE); - } - return FALSE; - } - hr = spDebugAutoAttach->AutoAttach(GUID_NULL, dwPid, AUTOATTACH_PROGRAM_WIN32, 0, szSessionID); - if (FAILED(hr)) - { - char szRetBuf[256]; - int nLen = sprintf_s(szRetBuf, _countof(szRetBuf), "204 HRESULT=0x%.08X;ErrorString=Unable to attach to worker process", hr); - if (nLen > 0) - { - DWORD dwLen = nLen; - pRequestInfo->pServerContext->SendResponseHeader(NULL, szRetBuf, FALSE); - pRequestInfo->pServerContext->WriteClient(szRetBuf, &dwLen); - RequestComplete(pRequestInfo, 204, DBG_SUBERR_ATTACH); - } - return FALSE; - } - m_bDebug = TRUE; - HandleError(pRequestInfo->pServerContext, 200, SUBERR_NONE); - RequestComplete(pRequestInfo, 200, SUBERR_NONE); - return FALSE; - } - else if (!_strnicmp(szCur, "stop-debug", sizeof("stop-debug")-sizeof('\0'))) - { - m_bDebug = FALSE; - HandleError(pRequestInfo->pServerContext, 200, SUBERR_NONE); - RequestComplete(pRequestInfo, 200, SUBERR_NONE); - return FALSE; - } - else - { - RequestComplete(pRequestInfo, 501, SUBERR_NONE); // Not Implemented - return FALSE; - } - } - return TRUE; - } - _ATLCATCHALL() - { - return FALSE; - } - } -#endif // defined(_DEBUG) || defined(ATLS_ENABLE_DEBUGGING) - - BOOL DispatchStencilCall(__inout AtlServerRequest *pRequestInfo) - { - ATLENSURE(pRequestInfo!=NULL); - CSetThreadToken sec; - - m_reqStats.OnRequestDequeued(); - - if (!sec.Initialize(pRequestInfo)) - { - RequestComplete(pRequestInfo, 500, ISE_SUBERR_IMPERSONATIONFAILED); - return FALSE; - } - -#if defined(_DEBUG) || defined(ATLS_ENABLE_DEBUGGING) - if (!ProcessDebug(pRequestInfo)) - return TRUE; -#endif // defined(ATLS_ENABLE_DEBUGGING) - - if (pRequestInfo->m_hMutex) - { - // synchronize in case the previous async_noflush call isn't finished - // setting up state for the next call. - DWORD dwStatus = WaitForSingleObject(pRequestInfo->m_hMutex, ATLS_ASYNC_MUTEX_TIMEOUT); - if (dwStatus != WAIT_OBJECT_0 && dwStatus != WAIT_ABANDONED) - { - RequestComplete(pRequestInfo, 500, ISE_SUBERR_UNEXPECTED); - return FALSE; - } - } - -#ifdef _DEBUG - bool bAsyncAllowed = false; -#endif - HTTP_CODE hcErr = HTTP_SUCCESS; - if (pRequestInfo->dwRequestState == ATLSRV_STATE_BEGIN) - { - BOOL bAllowCaching = TRUE; - if (TransmitFromCache(pRequestInfo, &bAllowCaching)) // Page is in the cache, send it and bail - { // Async Callback will handle freeing pRequestInfo - return TRUE; - } - - // get the srf filename - LPCSTR szFileName = pRequestInfo->pServerContext->GetScriptPathTranslated(); - - if (!szFileName) - { - RequestComplete(pRequestInfo, 500, ISE_SUBERR_UNEXPECTED); - return FALSE; - } - - LPCSTR szDot = szFileName + strlen(szFileName) - 1; - - // load a handler - if (AsciiStricmp(szDot - ATLS_EXTENSION_LEN, c_AtlSRFExtension) == 0) - { - pRequestInfo->dwRequestType = ATLSRV_REQUEST_STENCIL; - hcErr = LoadDispatchFile(szFileName, pRequestInfo); - } - else if (AsciiStricmp(szDot - ATLS_DLL_EXTENSION_LEN, c_AtlDLLExtension) == 0) - { - pRequestInfo->dwRequestType = ATLSRV_REQUEST_DLL; - hcErr = LoadDllHandler(szFileName, pRequestInfo); - } - else - { - hcErr = HTTP_FAIL; - } - - if (hcErr) - { - RequestComplete(pRequestInfo, HTTP_ERROR_CODE(hcErr), HTTP_SUBERROR_CODE(hcErr)); - return TRUE; - } - - pRequestInfo->pfnHandleRequest = &IRequestHandler::HandleRequest; - - // initialize the handler - DWORD dwStatus = 0; - - hcErr = pRequestInfo->pHandler->GetFlags(&dwStatus); - if (hcErr) - { - RequestComplete(pRequestInfo, HTTP_ERROR_CODE(hcErr), HTTP_SUBERROR_CODE(hcErr)); - return FALSE; - } - - if (bAllowCaching && ((dwStatus & ATLSRV_INIT_USECACHE) != 0) && - !strcmp(pRequestInfo->pServerContext->GetRequestMethod(), "GET")) - { - CComPtr spCacheCtx; - if (!GetCacheServerContext(pRequestInfo, &m_PageCache, &spCacheCtx) || - !spCacheCtx) - { - RequestComplete(pRequestInfo, 500, ISE_SUBERR_OUTOFMEM); - return FALSE; - } - - pRequestInfo->pServerContext->Release(); - pRequestInfo->pServerContext = spCacheCtx.Detach(); - } - - if (dwStatus & (ATLSRV_INIT_USEASYNC | ATLSRV_INIT_USEASYNC_EX)) - { -#ifdef _DEBUG - bAsyncAllowed = true; -#endif - if (!pRequestInfo->pServerContext->RequestIOCompletion(AsyncCallback, (DWORD *)pRequestInfo)) - { - RequestComplete(pRequestInfo, 500, SUBERR_NONE); - return FALSE; - } - } - - if (dwStatus & ATLSRV_INIT_USEASYNC_EX) - { - pRequestInfo->m_hMutex = CreateMutex(NULL, FALSE, NULL); - if (pRequestInfo->m_hMutex == NULL) - { - RequestComplete(pRequestInfo, 500, ISE_SUBERR_SYSOBJFAIL); - return FALSE; - } - - DWORD dwMutexStatus = WaitForSingleObject(pRequestInfo->m_hMutex, 10000); - if (dwMutexStatus != WAIT_OBJECT_0 && dwMutexStatus != WAIT_ABANDONED) - { - RequestComplete(pRequestInfo, 500, ISE_SUBERR_UNEXPECTED); - return FALSE; - } - } - hcErr = pRequestInfo->pHandler->InitializeHandler(pRequestInfo, static_cast(this)); - } -#ifdef _DEBUG - else // pRequestInfo->dwRequestState != ATLSRV_STATE_BEGIN - { - bAsyncAllowed = true; - } -#endif - - ATLENSURE(pRequestInfo->pfnHandleRequest != NULL); - - if (hcErr == HTTP_SUCCESS) - hcErr = (pRequestInfo->pHandler->*pRequestInfo->pfnHandleRequest)(pRequestInfo, static_cast(this)); - - if (hcErr == HTTP_SUCCESS_NO_CACHE) - { - CComPtr spControl; - HRESULT hr = pRequestInfo->pServerContext->QueryInterface(__uuidof(IPageCacheControl), reinterpret_cast(&spControl)); - if (hr == S_OK) - spControl->Cache(FALSE); - } - -#ifdef _DEBUG - // must use ATLSRV_INIT_USEASYNC to use ASYNC returns - if (IsAsyncStatus(hcErr)) - ATLASSERT(bAsyncAllowed); - - // must use ATLSRV_INIT_USEASYNC_EX to use NOFLUSH returns - if (IsAsyncNoFlushStatus(hcErr)) - ATLASSERT(pRequestInfo->m_hMutex); -#endif - - // save hMutex in case pRequestInfo is deleted by AsyncCallback after - // we call StartAsyncFlush but before we check to see if we need to - // call ReleaseMutex - HANDLE hMutex = pRequestInfo->m_hMutex; - - if (IsAsyncStatus(hcErr)) - { - if (IsAsyncDoneStatus(hcErr)) - pRequestInfo->dwRequestState = ATLSRV_STATE_DONE; - else - pRequestInfo->dwRequestState = ATLSRV_STATE_CONTINUE; - - if (IsAsyncFlushStatus(hcErr) && !StartAsyncFlush(pRequestInfo)) - { - RequestComplete(pRequestInfo, 500, SUBERR_NONE); - pRequestInfo = NULL; - } - } - else - { - RequestComplete(pRequestInfo, HTTP_ERROR_CODE(hcErr), HTTP_SUBERROR_CODE(hcErr)); - pRequestInfo = NULL; - } - - if (hMutex) - ReleaseMutex(hMutex); - - return TRUE; - } - - BOOL StartAsyncFlush(__in AtlServerRequest *pRequestInfo) - { - ATLENSURE(pRequestInfo); - if (pRequestInfo->pszBuffer == NULL || pRequestInfo->dwBufferLen == 0) - { - ATLASSERT(FALSE); - return FALSE; - } - - ATLENSURE(pRequestInfo->pServerContext); - BOOL bRet = TRUE; - _ATLTRY - { - bRet = pRequestInfo->pServerContext->AsyncWriteClient( - LPVOID(pRequestInfo->pszBuffer), - &pRequestInfo->dwBufferLen); - } - _ATLCATCHALL() - { - bRet = FALSE; - } - - return bRet; - } - - long GetTotalRequests() - { - return m_reqStats.GetTotalRequests(); - } - - long GetFailedRequests() - { - return m_reqStats.GetFailedRequests(); - } - - long GetAvgResponseTime() - { - return m_reqStats.GetAvgResponseTime(); - } - - long GetCurrWaiting() - { - return m_reqStats.GetCurrWaiting(); - } - - long GetMaxWaiting() - { - return m_reqStats.GetMaxWaiting(); - } - - long GetActiveThreads() - { - return m_reqStats.GetActiveThreads(); - } - - __success(SUCCEEDED(return)) __checkReturn HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, __deref_out void **ppv) - { - if (!ppv) - return E_POINTER; - if (InlineIsEqualGUID(riid, __uuidof(IRequestStats))) - { - *ppv = static_cast(this); - AddRef(); - return S_OK; - } - if (InlineIsEqualGUID(riid, __uuidof(IUnknown)) || - InlineIsEqualGUID(riid, __uuidof(IServiceProvider))) - { - *ppv = static_cast(this); - AddRef(); - return S_OK; - } - if (InlineIsEqualGUID(riid, __uuidof(IIsapiExtension))) - { - *ppv = static_cast(this); - AddRef(); - return S_OK; - } - return E_NOINTERFACE; - } - - ULONG STDMETHODCALLTYPE AddRef() - { - return 1; - } - - ULONG STDMETHODCALLTYPE Release() - { - return 1; - } - - virtual __checkReturn HRESULT STDMETHODCALLTYPE QueryService( - __in REFGUID guidService, - __in REFIID riid, - __deref_out void **ppvObject) - { - if (!ppvObject) - return E_POINTER; - - if (InlineIsEqualGUID(guidService, __uuidof(IDllCache))) - return m_DllCache.QueryInterface(riid, ppvObject); - else if (InlineIsEqualGUID(guidService, __uuidof(IStencilCache))) - return m_StencilCache.QueryInterface(riid, ppvObject); - else if (InlineIsEqualGUID(guidService, __uuidof(IThreadPoolConfig))) - return m_ThreadPool.QueryInterface(riid, ppvObject); - else if (InlineIsEqualGUID(guidService, __uuidof(IAtlMemMgr))) - { - *ppvObject = static_cast(&m_heap); - return S_OK; - } -#ifndef ATL_NO_SOAP - else if (InlineIsEqualGUID(guidService, __uuidof(ISAXXMLReader))) - { - CIsapiWorker *p = GetThreadWorker(); - ATLENSURE( p != NULL ); - return p->m_spReader->QueryInterface(riid, ppvObject); - } -#endif - - // otherwise look it up in the servicemap - return GetService(guidService, riid, ppvObject); - } - - virtual HRESULT AddService(REFGUID guidService, REFIID riid, IUnknown *punkService, HINSTANCE hInstance) - { - if (!punkService) - return E_INVALIDARG; - - if (!m_DllCache.AddRefModule(hInstance)) - return E_FAIL; - - ServiceNode srvNode; - srvNode.hInst = hInstance; - srvNode.punk = punkService; - Checked::memcpy_s(&srvNode.guidService, sizeof(GUID), &guidService, sizeof(guidService)); - Checked::memcpy_s(&srvNode.riid, sizeof(IID), &riid, sizeof(riid)); - - CComCritSecLock lock(m_critSec, false); - HRESULT hr = lock.Lock(); - if (FAILED(hr)) - { - return hr; - } - - // if the service is already there, return S_FALSE - int nIndex = m_serviceMap.Find(srvNode); - if (nIndex >= 0) - return S_FALSE; - - if (!m_serviceMap.Add(srvNode)) - return E_OUTOFMEMORY; - - punkService->AddRef(); - return S_OK; - } - - virtual HRESULT RemoveService(__in REFGUID guidService, __in REFIID riid) - { - ServiceNode srvNode; - Checked::memcpy_s(&srvNode.guidService, sizeof(GUID), &guidService, sizeof(guidService)); - Checked::memcpy_s(&srvNode.riid, sizeof(IID), &riid, sizeof(riid)); - - CComCritSecLock lock(m_critSec, false); - HRESULT hr = lock.Lock(); - if (FAILED(hr)) - { - return hr; - } - - int nIndex = m_serviceMap.Find(srvNode); - if (nIndex < 0) - return S_FALSE; - - ATLASSUME(m_serviceMap[nIndex].punk != NULL); - m_serviceMap[nIndex].punk->Release(); - - HINSTANCE hInstRemove = m_serviceMap[nIndex].hInst; - - m_serviceMap.RemoveAt(nIndex); - - if (!m_DllCache.ReleaseModule(hInstRemove)) - return S_FALSE; - - return S_OK; - } - - __success(SUCCEEDED(return)) __checkReturn HRESULT GetService(__in REFGUID guidService, __in REFIID riid, __deref_out void **ppvObject) throw() - { - if (!ppvObject) - return E_POINTER; - - *ppvObject = NULL; - if (!m_serviceMap.GetSize()) - return E_NOINTERFACE; - - ServiceNode srvNode; - Checked::memcpy_s(&srvNode.guidService, sizeof(GUID), &guidService, sizeof(guidService)); - Checked::memcpy_s(&srvNode.riid, sizeof(IID), &riid, sizeof(riid)); - - CComCritSecLock lock(m_critSec, false); - HRESULT hr = lock.Lock(); - if (FAILED(hr)) - { - return hr; - } - - int nIndex = m_serviceMap.Find(srvNode); - if (nIndex < 0) - return E_NOINTERFACE; - - ATLASSUME(m_serviceMap[nIndex].punk != NULL); - return m_serviceMap[nIndex].punk->QueryInterface(riid, ppvObject); - } - - HTTP_CODE LoadRequestHandler(__in LPCSTR szDllPath, __in LPCSTR szHandlerName, __in IHttpServerContext *pServerContext, - __out HINSTANCE *phInstance, __deref_out IRequestHandler **ppHandler) - { - return _AtlLoadRequestHandler(szDllPath, szHandlerName, pServerContext, - phInstance, ppHandler, this, static_cast(&m_DllCache)); - } // LoadRequestHandler - -}; // class CIsapiExtension - - -//=========================================================================================== -// IMPORTANT NOTE TO USERS: -// DO NOT ASSUME *ANYTHING* ABOUT THE STRUCTURE OF THESE MAPS/ENTRIES/FUNCTIONS--THEY CAN -// AND *WILL* CHANGE IN THE FUTURE. CORRECT USAGE MANDATES THAT YOU USE THE MACROS PROVIDED. -// ABSOLUTELY NO GUARANTEES ABOUT BACKWARD COMPATABILITY ARE MADE FOR MANUALLY DEFINED -// HANDLERS OR FUNCTIONS. -//=========================================================================================== - -typedef BOOL (*CREATEHANDLERFUNC)(IIsapiExtension *pExtension, IUnknown **ppOut); -typedef BOOL (*INITHANDLERFUNC)(IHttpServerContext*, IIsapiExtension*); -typedef void (*UNINITHANDLERFUNC)(); - -struct _HANDLER_ENTRY -{ - LPCSTR szName; - CREATEHANDLERFUNC pfnCreate; - INITHANDLERFUNC pfnInit; - UNINITHANDLERFUNC pfnUninit; -}; -// definitions of data segments and _HANDLER_ENTRY delimiters -#pragma section("ATLS$A", read, shared) -#pragma section("ATLS$Z", read, shared) -#pragma section("ATLS$C", read, shared) -extern "C" -{ -__declspec(selectany) __declspec(allocate("ATLS$A")) ATL::_HANDLER_ENTRY * __phdlrA = NULL; -__declspec(selectany) __declspec(allocate("ATLS$Z")) ATL::_HANDLER_ENTRY * __phdlrZ = NULL; -} - -#if !defined(_M_IA64) -#pragma comment(linker, "/merge:ATLS=.rdata") -#endif - -#ifndef HANDLER_ENTRY_PRAGMA - -#if defined(_M_IX86) -#define HANDLER_ENTRY_PRAGMA(class, line) __pragma(comment(linker, "/include:___phdlrEntry_" #class "_" #line)); -#elif defined(_M_IA64) -#define HANDLER_ENTRY_PRAGMA(class, line) __pragma(comment(linker, "/include:__phdlrEntry_" #class "_" #line)); -#elif defined(_M_AMD64) -#define HANDLER_ENTRY_PRAGMA(class, line) __pragma(comment(linker, "/include:__phdlrEntry_" #class "_" #line)); -#else -#error Unknown Platform. define HANDLER_ENTRY_PRAGMA -#endif - -#endif // HANDLER_ENTRY_PRAGMA - -// DECLARE_REQUEST_HANDLER macro -#define __DECLARE_REQUEST_HANDLER_INTERNAL(handlerName, className, classQName, lineNum) \ -__declspec(selectany) ATL::_HANDLER_ENTRY __hdlrEntry_ ## className ## _ ## lineNum = { handlerName, classQName::CreateRequestHandler, classQName::InitRequestHandlerClass, classQName::UninitRequestHandlerClass }; \ -extern "C" __declspec(allocate("ATLS$C")) __declspec(selectany) \ -ATL::_HANDLER_ENTRY * const __phdlrEntry_ ## className ## _ ## lineNum = &__hdlrEntry_ ## className ## _ ## lineNum; \ -HANDLER_ENTRY_PRAGMA(className, lineNum) \ -__if_not_exists(GetAtlHandlerByName) \ -{ \ -extern "C" ATL_NOINLINE inline BOOL __declspec(dllexport) __stdcall GetAtlHandlerByName(LPCSTR szHandlerName, IIsapiExtension *pExtension, IUnknown **ppHandler) throw() \ -{ \ - *ppHandler = NULL; \ - ATL::_HANDLER_ENTRY **pEntry = &__phdlrA; \ - while (pEntry != &__phdlrZ) \ - { \ - if (*pEntry && (*pEntry)->szName) \ - { \ - if (strcmp((*pEntry)->szName, szHandlerName)==0) \ - { \ - return (*(*pEntry)->pfnCreate)(pExtension, ppHandler); \ - } \ - } \ - pEntry++; \ - } \ - return FALSE; \ -} \ -extern "C" ATL_NOINLINE inline BOOL __declspec(dllexport) __stdcall InitializeAtlHandlers(IHttpServerContext *pContext, IIsapiExtension *pExt) throw() \ -{ \ - ATL::_HANDLER_ENTRY **pEntry = &__phdlrA; \ - BOOL bRet = TRUE; \ - while (pEntry != &__phdlrZ) \ - { \ - if (*pEntry && (*pEntry)->szName && (*pEntry)->pfnInit) \ - { \ - bRet = (*(*pEntry)->pfnInit)(pContext, pExt); \ - if (!bRet) \ - break; \ - } \ - pEntry++; \ - } \ - if (!bRet) \ - { \ - if (pEntry == &__phdlrA) \ - return FALSE; \ - do \ - { \ - pEntry--; \ - if(*pEntry) \ - (*(*pEntry)->pfnUninit)(); \ - } \ - while (pEntry != &__phdlrA); \ - } \ - return bRet; \ -} \ -extern "C" ATL_NOINLINE inline void __declspec(dllexport) __stdcall UninitializeAtlHandlers() throw() \ -{\ - ATL::_HANDLER_ENTRY **pEntry = &__phdlrA; \ - while (pEntry != &__phdlrZ) \ - { \ - if (*pEntry && (*pEntry)->szName && (*pEntry)->pfnUninit) \ - { \ - (*(*pEntry)->pfnUninit)(); \ - } \ - pEntry++; \ - } \ -} \ -} - -#define __DECLARE_REQUEST_HANDLER(handlerName, className, classQName, lineNum) __DECLARE_REQUEST_HANDLER_INTERNAL(handlerName, className, classQName, lineNum) -#define DECLARE_REQUEST_HANDLER(handlerName, className, classQName) __DECLARE_REQUEST_HANDLER(handlerName, className, classQName, __COUNTER__) - -#define BEGIN_HANDLER_MAP() -#define HANDLER_ENTRY(handlerName, className) DECLARE_REQUEST_HANDLER(handlerName, className, className) -#define HANDLER_ENTRY_EX(handlerName, className, classQName) DECLARE_REQUEST_HANDLER(handlerName, className, classQName) -#define END_HANDLER_MAP() - -#define __HANDLER_ENTRY_SDL_INTERNAL(handlerString, handlerClass, handlerQClass, sdlClassName, lineNum)\ -_ATLSOAP_DECLARE_WSDL_SRF() \ -extern __declspec(selectany) const char const s_szClassName##sdlClassName##lineNum[]=handlerString;\ -typedef ATL::CSDLGenerator sdlClassName; \ -HANDLER_ENTRY_EX(handlerString, handlerClass, handlerQClass)\ -HANDLER_ENTRY(#sdlClassName, sdlClassName) - -#define __HANDLER_ENTRY_SDL(handlerString, handlerClass, handlerQClass, sdlClassName, lineNum) __HANDLER_ENTRY_SDL_INTERNAL(handlerString, handlerClass, handlerQClass, sdlClassName, lineNum) -#define HANDLER_ENTRY_SDL(handlerString, handlerClass, handlerQClass, sdlClassName) __HANDLER_ENTRY_SDL(handlerString, handlerClass, handlerQClass, sdlClassName, __COUNTER__) -// -// Use this class to check the authorization level of a client who is making -// a request to this application. This class checks for the stronger authentication -// levels (NTLM and Negotiate). You can call it directly from an implementation -// of HandleRequest to check authorization before handling a request. -#define MAX_AUTH_TYPE 50 -#define MAX_NAME_LEN 255 - -template -class CVerifyAuth -{ -public: - HTTP_CODE IsAuthorized(__in AtlServerRequest *pInfo, __in_opt const SID* psidAuthGroup) - { - ATLENSURE(pInfo); - ATLENSURE(pInfo->pServerContext); - ATLASSERT(psidAuthGroup); - ATLASSERT(::IsValidSid((PSID) psidAuthGroup)); - - HTTP_CODE hcErr = HTTP_UNAUTHORIZED; - char szAuthType[MAX_AUTH_TYPE]; - DWORD dwSize = MAX_AUTH_TYPE; - _ATLTRY - { - if (pInfo->pServerContext->GetServerVariable("AUTH_TYPE", - szAuthType, &dwSize)) - { - if (szAuthType[0] && (!_stricmp(szAuthType, "NTLM") - || !_stricmp(szAuthType, "Negotiate"))) - { - // if we were passed a group name - // we check to see that the logged on user is part - // of that group, else we just return success. - if (psidAuthGroup) - { - T* pT = static_cast(this); - if (pT->CheckAccount(pInfo->pServerContext, psidAuthGroup)) - hcErr = HTTP_SUCCESS; - else - hcErr = pT->HandleError(pInfo); - } - else - hcErr = HTTP_SUCCESS; - } - } - } - _ATLCATCHALL() - { - hcErr = HTTP_FAIL; - } - - return hcErr; - } - - virtual bool CheckAccount(IHttpServerContext *pContext, const SID *psidAuthGroup) throw() - { - (pContext); // unused - (psidAuthGroup); // unused - return false; - } - - HTTP_CODE HandleError(AtlServerRequest *pRequestInfo) throw() - { - pRequestInfo; // unused - return HTTP_FAIL; - } - - __checkReturn bool CheckAuthAccount(__in IHttpServerContext *pContext, __in const SID* psidAuthGroup) throw() - { - ATLASSERT(pContext); - ATLASSERT(psidAuthGroup); - if (!pContext || !psidAuthGroup) - return false; - - HANDLE hToken = INVALID_HANDLE_VALUE; - bool bIsMember; - _ATLTRY - { - if (!pContext->GetImpersonationToken(&hToken) || - hToken == INVALID_HANDLE_VALUE) - return false; - - CAccessToken tok; - tok.Attach(hToken); - bool bRet = tok.CheckTokenMembership(CSid(psidAuthGroup), &bIsMember); - tok.Detach(); - - if (!bRet) - return false; - } - _ATLCATCHALL() - { - bIsMember = false; - } - - return bIsMember; - } -}; - -// Checks that the user that is logging on is in the required group -class CDefaultAuth : - public CVerifyAuth -{ -public: - virtual bool CheckAccount(__in IHttpServerContext *pContext, __in const SID* psidAuthGroup) throw() - { - return CheckAuthAccount(pContext, psidAuthGroup); - } - - HTTP_CODE HandleError(__in AtlServerRequest *pRequestInfo) throw() - { - ATLASSERT(pRequestInfo); // should always be valid - if(!pRequestInfo) - { - return HTTP_FAIL; - } - - _ATLTRY - { - CHttpResponse response(pRequestInfo->pServerContext); - response.Write(GetErrorResponse()); - response.Flush(); - } - _ATLCATCHALL() - { - return HTTP_FAIL; - } - - return HTTP_SUCCESS_NO_PROCESS; - } - - virtual LPCSTR GetErrorResponse() - { - static const char *szResponse = "" - "

NOT AUTHORIZED

" - ""; - return szResponse; - } - -}; - -} // namespace ATL -#pragma pack(pop) - -#pragma warning(pop) - -#endif // __ATLISAPI_H__ diff --git a/include/atl/atlmime.h b/include/atl/atlmime.h deleted file mode 100644 index 06d4fd2f4..000000000 --- a/include/atl/atlmime.h +++ /dev/null @@ -1,2406 +0,0 @@ -// This is a part of the Active Template Library. -// Copyright (C) Microsoft Corporation -// All rights reserved. -// -// This source code is only intended as a supplement to the -// Active Template Library Reference and related -// electronic documentation provided with the library. -// See these sources for detailed information regarding the -// Active Template Library product. - -#ifndef __ATLMIME_H__ -#define __ATLMIME_H__ - -#pragma once - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#pragma warning(push) -#pragma warning(disable: 4625) // copy constructor could not be generated because a base class copy constructor is inaccessible -#pragma warning(disable: 4626) // assignment operator could not be generated because a base class assignment operator is inaccessible - -#ifndef _CPPUNWIND -#pragma warning (push) -#pragma warning(disable: 4702) // unreachable code -#endif // _CPPUNWIND - -#pragma pack(push,_ATL_PACKING) -namespace ATL { - -#ifndef ATLMIME_SEPARATOR -#define ATLMIME_SEPARATOR "\r\n\r\n--" -#endif//ATLMIME_SEPARATOR - -#ifndef ATLMIME_VERSION -#define ATLMIME_VERSION "MIME-Version: 1.0" -#endif//ATLMIME_VERSION - -#ifndef ATLMIME_EMAIL -#define ATLMIME_EMAIL "email" -#endif//ATLMIME_EMAIL - -extern __declspec(selectany) const DWORD ATL_MIME_BOUNDARYLEN = 32; -extern __declspec(selectany) const DWORD ATL_MIME_DATE_LEN = 64; - -// Called when message is sent - sets the "Date:" field -inline size_t SetRfc822Time(__out_ecount_part_z_opt(dwLen, return) LPSTR szDate, __in size_t dwLen) throw() -{ - // Max buffer size required(including NULL) - 38 - const size_t s_dwMaxBufferLen = 38; - if (szDate == NULL) - { - return s_dwMaxBufferLen; - } - - if (dwLen < 38) - { - return 0; - } - static const LPCSTR s_months[12] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; - - static const LPCSTR s_days[7] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; - - SYSTEMTIME st; - DWORD dwTimeZoneId=TIME_ZONE_ID_UNKNOWN; - CHAR cDiff; - LONG ltzBias=0; - LONG ltzHour; - LONG ltzMinute; - TIME_ZONE_INFORMATION tzi; - - GetLocalTime(&st); - - // Gets TIME_ZONE_INFORMATION - memset(&tzi, 0, sizeof(tzi)); - dwTimeZoneId = GetTimeZoneInformation(&tzi); - switch (dwTimeZoneId) - { - case TIME_ZONE_ID_STANDARD: - ltzBias = tzi.Bias + tzi.StandardBias; - break; - - case TIME_ZONE_ID_DAYLIGHT: - ltzBias = tzi.Bias + tzi.DaylightBias; - break; - - case TIME_ZONE_ID_UNKNOWN: - default: - ltzBias = tzi.Bias; - break; - } - - // Set Hour Minutes and time zone dif - ltzHour = ltzBias / 60; - ltzMinute = ltzBias % 60; - cDiff = (ltzHour < 0) ? '+' : '-'; - - int nDay = (st.wDayOfWeek > 6) ? 0 : st.wDayOfWeek; - int nMonth = st.wMonth = (WORD)((st.wMonth < 1 || st.wMonth > 12) ? 0 : st.wMonth - 1); - - - // Constructs RFC 822 format: "ddd, dd mmm yyyy hh:mm:ss +/- hhmm\0" - sprintf_s(szDate, dwLen, "Date: %3s, %d %3s %4d %02d:%02d:%02d %c%02d%02d", - s_days[nDay], // "ddd" - st.wDay, // "dd" - s_months[nMonth], // "mmm" - st.wYear, // "yyyy" - st.wHour, // "hh" - st.wMinute, // "mm" - st.wSecond, // "ss" - cDiff, // "+" / "-" - abs (ltzHour), // "hh" - abs (ltzMinute)); // "mm" - return s_dwMaxBufferLen; -} - -inline DWORD GetContentTypeFromFileName(LPCTSTR szFileName, CSimpleString& strContentType) throw() -{ - if (szFileName == NULL) - { - return ERROR_INVALID_DATA; - } - - DWORD dwErr = ERROR_PATH_NOT_FOUND; - _ATLTRY - { - // get the file extension - TCHAR szExt[_MAX_EXT]; - Checked::tsplitpath_s(szFileName, NULL, 0, NULL, 0, NULL, 0, szExt, _countof(szExt)); - if (*szExt) - { - // Query the content type from the registry - CRegKey rkContentType; - dwErr = rkContentType.Open(HKEY_CLASSES_ROOT, szExt, KEY_READ); - if (dwErr == ERROR_SUCCESS) - { - ULONG nChars=0; - dwErr = rkContentType.QueryStringValue(_T("Content Type"), NULL, &nChars); - if (dwErr == ERROR_SUCCESS) - { - LPTSTR szBuf = strContentType.GetBuffer(nChars); - dwErr = rkContentType.QueryStringValue(_T("Content Type"), szBuf, &nChars); - strContentType.ReleaseBuffer(nChars); - } - } - } - - if (dwErr != ERROR_SUCCESS) - { - // default to application/octet-stream - strContentType.SetString(_T("application/octet-stream"), sizeof("application/octet-stream")-1); - } - } - _ATLCATCHALL() - { - dwErr = ERROR_OUTOFMEMORY; - } - - return dwErr; -} - -// CMimeBodyPart is an abstract base class for the body parts -// CMimeAttachment, CMimeText, CMimeHeader. -class CMimeBodyPart -{ -public: - - virtual ~CMimeBodyPart() = 0 {} - - // WriteData - pure virtual method to dump the data for a body part. - virtual BOOL WriteData(HANDLE hFile, LPOVERLAPPED pOverlapped, LPCSTR szBoundary, DWORD dwFlags = 0) = 0; - - // GetContentType - pure virtual method to get the content of a body part - virtual LPCSTR GetContentType() = 0; - - // GetCharset - virtual method to get the character set of a body part - // (defaults to ATLSMTP_DEFAULT_CSET). - virtual LPCSTR GetCharset() - { - return ATLSMTP_DEFAULT_CSET; - } - - virtual CMimeBodyPart* Copy() = 0; - -protected: - - // MakeMimeHeader - pure virutal method to create a MIME header for a - // body part. - virtual BOOL MakeMimeHeader(CStringA& header, LPCSTR szBoundary) = 0; -}; // class CMimeBodyPart - - -// This enum is used with the X-Priority part of the message header -enum ATL_MIME_PRIORITY -{ - ATL_MIME_HIGH_PRIORITY = 1, - ATL_MIME_NORMAL_PRIORITY = 3, - ATL_MIME_LOW_PRIORITY = 5, - ATL_MIME_PRIORITY_ERROR = 0 -}; - - -// CMimeHeader describes the basic RFC 822 message header. -// It also serves as the base class for the CMimeMessage object. -class CMimeHeader : public CMimeBodyPart -{ -protected: - - // Pointer to MLANG's IMultiLanguage interface. - // This is used in doing conversion from code pages - // to MIME-compatible character sets. - CComPtr m_spMultiLanguage; - - //Basic Header Parts - CStringA m_strFrom; - CStringA m_strTo; - CStringA m_strCc; - CStringA m_strBcc; - CStringA m_strSubject; - - //Extended Header Parts - ATL_MIME_PRIORITY m_nPriority; - CStringA m_XHeader; - - //Display Names - CStringA m_strSenderName; - - //MIME Character Sets - char m_szSubjectCharset[ATL_MAX_ENC_CHARSET_LENGTH]; - char m_szSenderCharset[ATL_MAX_ENC_CHARSET_LENGTH]; - - //Recipient and CC charsets are encoded in the Add methods - -public: - - CMimeHeader() throw() - :m_nPriority(ATL_MIME_NORMAL_PRIORITY) - { - m_szSubjectCharset[0] = '\0'; - m_szSenderCharset[0] = '\0'; - } - - ~CMimeHeader() throw() - { - } - - // Initialize MLang for multilanguage support - inline BOOL Initialize(IMultiLanguage* pMultiLanguage = NULL) throw() - { - if (pMultiLanguage != NULL) - { - m_spMultiLanguage = pMultiLanguage; - } - else - { - HRESULT hr = m_spMultiLanguage.CoCreateInstance(__uuidof(CMultiLanguage), NULL, CLSCTX_INPROC_SERVER); - if (hr != S_OK) - return FALSE; - } - return TRUE; - } - - // Get the content type - virtual inline LPCSTR GetContentType() throw() - { - return "text/plain"; - } - - // Get the character set - virtual inline LPCSTR GetCharset() throw() - { - return "iso-8859-1"; - } - - virtual ATL_NOINLINE CMimeBodyPart* Copy() throw( ... ) - { - CAutoPtr pNewHeader; - ATLTRY(pNewHeader.Attach(new CMimeHeader)); - if (pNewHeader) - *pNewHeader = *this; - - return pNewHeader.Detach(); - } - - const CMimeHeader& operator=(const CMimeHeader& that) throw( ... ) - { - if (this != &that) - { - m_spMultiLanguage = that.m_spMultiLanguage; - m_strFrom = that.m_strFrom; - m_strTo = that.m_strTo; - m_strCc = that.m_strCc; - m_strSubject = that.m_strSubject; - - m_nPriority = that.m_nPriority; - m_XHeader = that.m_XHeader; - - m_strSenderName = that.m_strSenderName; - - Checked::strcpy_s(m_szSubjectCharset, ATL_MAX_ENC_CHARSET_LENGTH, that.m_szSubjectCharset); - Checked::strcpy_s(m_szSenderCharset, ATL_MAX_ENC_CHARSET_LENGTH, that.m_szSenderCharset); - } - - return *this; - } - - // Set the priority of the message - inline BOOL SetPriority(ATL_MIME_PRIORITY nPriority) throw() - { - if (nPriority < 0) - return FALSE; - m_nPriority = nPriority; - return TRUE; - } - - // Get the priority of the message - inline ATL_MIME_PRIORITY GetPriority() throw() - { - return m_nPriority; - } - - // Set the display (friendly) name for the header - inline BOOL SetSenderName(LPCTSTR szName, UINT uiCodePage = 0) throw() - { - if (szName == NULL) - return FALSE; - - CHeapPtr szNamePtr; - UINT nLen(0); - - BOOL bRet = AtlMimeConvertString(m_spMultiLanguage, uiCodePage, szName, &szNamePtr, &nLen); - if (bRet) - { - _ATLTRY - { - m_strSenderName.Empty(); - m_strSenderName.Append(szNamePtr, (int) nLen); - } - _ATLCATCHALL() - { - return FALSE; - } - bRet = AtlMimeCharsetFromCodePage(m_szSenderCharset, uiCodePage, m_spMultiLanguage, ATL_MAX_ENC_CHARSET_LENGTH); - } - - return bRet; - } - - // Get the display (friendly) name for the sender - inline LPCSTR GetSenderName() throw() - { - return m_strSenderName; - } - - // Append a user defined header (should not contain CRLF) - inline BOOL AppendUserDefinedHeader(LPCTSTR szHeaderName, LPCTSTR szHeader, UINT uiCodePage = 0) throw() - { - if ((szHeader == NULL) || (szHeaderName == NULL)) - return FALSE; - - _ATLTRY - { - CHeapPtr szName; - UINT nLen(0); - - BOOL bRet = AtlMimeConvertString(m_spMultiLanguage, uiCodePage, szHeader, &szName, &nLen); - if (bRet) - { - // get the charset - char szCharset[ATL_MAX_ENC_CHARSET_LENGTH]; - bRet = AtlMimeCharsetFromCodePage(szCharset, uiCodePage, m_spMultiLanguage, ATL_MAX_ENC_CHARSET_LENGTH); - - if (bRet) - { - CStringA str; - str.Append(szName, (int)nLen); - - // encode the string - CHeapPtr szBuf; - DWORD dwReqLen = QEncodeGetRequiredLength(str.GetLength(), - ATL_MAX_ENC_CHARSET_LENGTH); - - if (szBuf.Allocate(dwReqLen) == false) - { - return FALSE; - } - - DWORD dwLength(0); - BOOL bEncoded = FALSE; - if (!GetEncodedString(str, szCharset, szBuf, dwReqLen, dwLength, bEncoded)) - { - return FALSE; - } - - // add to m_XHeader - m_XHeader += CT2CA(szHeaderName); - m_XHeader.Append(": ", 2); - m_XHeader.Append(szBuf, dwLength); - m_XHeader.Append("\r\n", 2); - } - } - - return bRet; - } - _ATLCATCHALL() - { - return FALSE; - } - } - - // Add a recipient ("To:" line) - inline BOOL AddRecipient(LPCTSTR szAddress, LPCTSTR szName = NULL, UINT uiCodePage = 0) throw() - { - return AddRecipientHelper(m_strTo, szAddress, szName, uiCodePage); - } - - // Get the recipients string ("To:" line) - inline LPCSTR GetRecipients() throw() - { - return m_strTo; - } - - // Clear all recipients ("To:" line) - inline BOOL ClearRecipients() throw() - { - m_strTo.Empty(); - return TRUE; - } - - // Add a recipient ("CC:" line) - inline BOOL AddCc(LPCTSTR szAddress, LPCTSTR szName = NULL, UINT uiCodePage = 0) throw() - { - return AddRecipientHelper(m_strCc, szAddress, szName, uiCodePage); - } - - // Get the recipients string ("CC:" line) - inline LPCSTR GetCc() throw() - { - return m_strCc; - } - - // Clear the recipients string ("CC:" line) - inline BOOL ClearCc() throw() - { - m_strCc.Empty(); - return TRUE; - } - - // Add a Bcc recipient (not output as part of message) - inline BOOL AddBcc(LPCTSTR szAddress) throw() - { - if (szAddress == NULL) - { - return FALSE; - } - - _ATLTRY - { - CStringA str = m_strBcc; - - if (m_strBcc.GetLength() > 0) - str.Append(",", 1); - - str += CT2CA(szAddress); - - m_strBcc = str; - - return TRUE; - } - _ATLCATCHALL() - { - return FALSE; - } - } - - // Get the recipients string (Bcc part) - inline LPCSTR GetBcc() throw() - { - return m_strBcc; - } - - // Clear the recipients string (Bcc part) - inline BOOL ClearBcc() throw() - { - m_strBcc.Empty(); - return TRUE; - } - - - inline DWORD GetRequiredRecipientsStringLength() throw() - { - DWORD dwRet = m_strTo.GetLength(); - if (m_strCc.GetLength()) - { - dwRet += dwRet ? 1 : 0; - dwRet += m_strCc.GetLength(); - } - if (m_strBcc.GetLength()) - { - dwRet += dwRet ? 1 : 0; - dwRet += m_strBcc.GetLength(); - } - dwRet++; - return dwRet; - } - - // returns the recipients string to be (addresses only, in comma separated format) - ATL_NOINLINE BOOL GetRecipientsString(__out_ecount_part_z(*pdwLen, *pdwLen) LPSTR szRecip, __inout LPDWORD pdwLen) throw() - { - if ( (szRecip == NULL) || (pdwLen == NULL) ) - { - return FALSE; - } - - if ( *pdwLen < GetRequiredRecipientsStringLength()) - { - *pdwLen = GetRequiredRecipientsStringLength(); - return FALSE; - } - - DWORD dwMaxLen = *pdwLen; - *pdwLen = 0; - - DWORD dwLen = 0; - DWORD dwTotalLen = 0; - if (m_strTo.GetLength() > 0) - { - dwLen = *pdwLen - dwTotalLen; - if (AtlMimeMakeRecipientsString(m_strTo, szRecip, &dwLen) != TRUE) - { - return FALSE; - } - szRecip+= dwLen; - dwTotalLen = dwLen; - } - - if (m_strCc.GetLength() > 0) - { - if (dwTotalLen) - { - *szRecip++ = ','; - dwTotalLen++; - } - dwLen = *pdwLen - dwTotalLen; - if (AtlMimeMakeRecipientsString(m_strCc, szRecip, &dwLen) != TRUE) - { - return FALSE; - } - szRecip+= dwLen; - dwTotalLen+= dwLen; - } - - if (m_strBcc.GetLength() > 0) - { - dwLen = m_strBcc.GetLength(); - if (dwTotalLen) - { - *szRecip++ = ','; - dwTotalLen++; - } - dwLen = *pdwLen - dwTotalLen; - Checked::memcpy_s(szRecip, dwMaxLen-dwTotalLen, m_strBcc, dwLen); - szRecip+= dwLen; - dwTotalLen+= dwLen; - } - - *szRecip = '\0'; - *pdwLen = dwTotalLen; - - return TRUE; - } - - - // Get the sender - inline LPCSTR GetSender() throw() - { - return m_strFrom; - } - - // Set the sender - inline BOOL SetSender(LPCTSTR szSender) throw() - { - if (szSender == NULL) - return FALSE; - - _ATLTRY - { - m_strFrom = CT2CA(szSender); - return TRUE; - } - _ATLCATCHALL() - { - return FALSE; - } - } - - // Set the subject - inline BOOL SetSubject(LPCTSTR szSubject, UINT uiCodePage = 0) throw() - { - if (szSubject == NULL) - return FALSE; - - _ATLTRY - { - CHeapPtr szName; - UINT nLen(0); - - BOOL bRet = AtlMimeConvertString(m_spMultiLanguage, uiCodePage, szSubject, &szName, &nLen); - if (bRet) - { - m_strSubject.Empty(); - m_strSubject.Append(szName, (int)nLen); - bRet = AtlMimeCharsetFromCodePage(m_szSubjectCharset, uiCodePage, m_spMultiLanguage, ATL_MAX_ENC_CHARSET_LENGTH); - } - - return bRet; - } - _ATLCATCHALL() - { - return FALSE; - } - } - - // Get the subject - inline LPCSTR GetSubject() throw() - { - return (LPCSTR)m_strSubject; - } - - // Dump the header to hFile - virtual inline BOOL WriteData(HANDLE hFile, LPOVERLAPPED pOverlapped, LPCSTR /*szBoundary*/, DWORD dwFlags = 0) throw() - { - if (pOverlapped == NULL) - { - return FALSE; - } - - int nMaxSendLen = GetRequiredBufferSize(ATLSMTP_MAX_LINE_LENGTH-4); - CHeapPtr spSendBuffer; - if (!spSendBuffer.Allocate(nMaxSendLen)) - return FALSE; - - // choose QEncode here, because the max QEncodeGetRequiredLength will always - // return a value greater than BEncodeGetRequiredLength - int nBufLen = __max(QEncodeGetRequiredLength(m_strSubject.GetLength(), - ATL_MAX_ENC_CHARSET_LENGTH), - QEncodeGetRequiredLength(m_strSenderName.GetLength(), - ATL_MAX_ENC_CHARSET_LENGTH)+m_strFrom.GetLength()+2); - - CHeapPtr spBuf; - if (!spBuf.Allocate(nBufLen)) - return FALSE; - - int nMaxLen = nBufLen; - DWORD dwOffset = 0; - - char szDate[ATL_MIME_DATE_LEN]; - - SetRfc822Time(szDate, ATL_MIME_DATE_LEN); - char *pSendBuffer = spSendBuffer; - - DWORD dwLength = (DWORD) strlen(szDate); - - if(dwLength > ATLSMTP_MAX_LINE_LENGTH -2 -dwOffset ) - return FALSE; - - Checked::memcpy_s(pSendBuffer+dwOffset, nMaxSendLen-dwOffset, szDate, dwLength); - dwOffset += dwLength; - *(pSendBuffer+dwOffset++) = '\r'; - *(pSendBuffer+dwOffset++) = '\n'; - - int dwHeaderPartLength = 0; - *spBuf = '\0'; - - // Get the sender name - BOOL bRet = TRUE; - BOOL bEncoded = FALSE; - if (m_strSenderName.GetLength() > 0) - { - bRet = GetEncodedString(m_strSenderName, m_szSenderCharset, spBuf, nBufLen, dwLength, bEncoded); - dwHeaderPartLength += dwLength; - } - - // Get the sender email address - if (bRet && m_strFrom.GetLength() > 0) - { - - if (dwHeaderPartLength != 0) - { - if(dwHeaderPartLength + 1 > nBufLen) - return FALSE; - - *(spBuf+dwHeaderPartLength++) = ' '; - } - - if(dwHeaderPartLength + m_strFrom.GetLength() + 2 > nBufLen) - return FALSE; - - *(spBuf+dwHeaderPartLength++) = '<'; - if (dwHeaderPartLength < 0 || dwHeaderPartLength > nMaxLen) - { - return FALSE; - } - Checked::memcpy_s(spBuf+dwHeaderPartLength, nMaxLen-dwHeaderPartLength, (LPCSTR)m_strFrom, m_strFrom.GetLength()); - dwHeaderPartLength+= m_strFrom.GetLength(); - *(spBuf+dwHeaderPartLength++) = '>'; - } - - // Output the "From: " line - if (bRet && dwHeaderPartLength != 0) - { - const char szFrom[] = "From: "; - if(sizeof(szFrom)/sizeof(szFrom[0])-1 > ATLSMTP_MAX_LINE_LENGTH -2 -dwOffset ) - return FALSE; - if (dwOffset > static_cast(nMaxSendLen)) - { - return FALSE; - } - Checked::memcpy_s(pSendBuffer+dwOffset, nMaxSendLen-dwOffset, szFrom, _countof(szFrom)-1); - dwOffset+= (sizeof(szFrom)/sizeof(szFrom[0])-1) ; - DWORD dwWritten = ATLSMTP_MAX_LINE_LENGTH - 2 - dwOffset; - bRet = FormatField((LPBYTE)(char*)spBuf, dwHeaderPartLength, (LPBYTE)(pSendBuffer+dwOffset), &dwWritten, dwFlags); - dwOffset += dwWritten; - *(pSendBuffer+dwOffset++) = '\r'; - *(pSendBuffer+dwOffset++) = '\n'; - } - - // Output the subject - if (bRet && m_strSubject.GetLength() > 0) - { - dwLength = 0; - bRet = GetEncodedString(m_strSubject, m_szSubjectCharset, spBuf, nBufLen, dwLength, bEncoded); - if (bRet && dwLength != 0) - { - const char szSubject[] = "Subject: "; - if(sizeof(szSubject)/sizeof(szSubject[0])-1 > ATLSMTP_MAX_LINE_LENGTH -2 -dwOffset ) - return FALSE; - if (dwOffset > static_cast(nMaxSendLen)) - { - return FALSE; - } - Checked::memcpy_s(pSendBuffer+dwOffset, nMaxSendLen-dwOffset, szSubject, _countof(szSubject)-1); - dwOffset+= (sizeof(szSubject)/sizeof(szSubject[0])-1); - DWORD dwWritten = ATLSMTP_MAX_LINE_LENGTH - 2 - dwOffset; - bRet = FormatField((LPBYTE)(char*)spBuf, dwLength, (LPBYTE)(pSendBuffer+dwOffset), &dwWritten, dwFlags); - dwOffset += dwWritten; - *(pSendBuffer+dwOffset++) = '\r'; - *(pSendBuffer+dwOffset++) = '\n'; - } - } - - // Output the "To:" line - if (bRet && m_strTo.GetLength() > 0) - { - const char szTo[] = "To: "; - if(sizeof(szTo)/sizeof(szTo[0])-1 > ATLSMTP_MAX_LINE_LENGTH -2 -dwOffset ) - return FALSE; - if (dwOffset > static_cast(nMaxSendLen)) - { - return FALSE; - } - Checked::memcpy_s(pSendBuffer+dwOffset, nMaxSendLen-dwOffset, szTo, _countof(szTo)-1); - dwOffset+= (sizeof(szTo)/sizeof(szTo[0]) -1); - DWORD dwWritten = ATLSMTP_MAX_LINE_LENGTH - 2 - dwOffset; - bRet = FormatRecipients((LPBYTE)((LPCSTR)m_strTo), m_strTo.GetLength(), (LPBYTE)(pSendBuffer+dwOffset), &dwWritten); - dwOffset+= dwWritten; - *(pSendBuffer+dwOffset++) = '\r'; - *(pSendBuffer+dwOffset++) = '\n'; - } - - // Output the "CC:" line - if (bRet && m_strCc.GetLength() > 0) - { - const char szCC[] = "CC: "; - if(sizeof(szCC)/sizeof(szCC[0])-1 > ATLSMTP_MAX_LINE_LENGTH -2 -dwOffset ) - return FALSE; - if (dwOffset > static_cast(nMaxSendLen)) - { - return FALSE; - } - Checked::memcpy_s(pSendBuffer+dwOffset, nMaxSendLen-dwOffset, szCC, _countof(szCC)-1); - dwOffset+= (sizeof(szCC)/sizeof(szCC[0]) -1); - DWORD dwWritten = ATLSMTP_MAX_LINE_LENGTH - 2 - dwOffset; - bRet = FormatRecipients((LPBYTE)((LPCSTR)m_strCc), m_strCc.GetLength(), (LPBYTE)(pSendBuffer+dwOffset), &dwWritten); - dwOffset+= dwWritten; - *(pSendBuffer+dwOffset++) = '\r'; - *(pSendBuffer+dwOffset++) = '\n'; - } - - // Send the header - if (bRet && dwOffset) - bRet = AtlSmtpSendAndWait(hFile, pSendBuffer, dwOffset, pOverlapped); - - return bRet; - } - -protected: - - // Make the mime header - virtual inline BOOL MakeMimeHeader(CStringA& /*header*/, LPCSTR /*szBoundary*/) throw() - { - // The message header does not have its own MIME header - ATLASSERT(FALSE); - return TRUE; - } - - // Get an encoded string for a header field - inline BOOL GetEncodedString(__in CStringA& headerString, __in LPCSTR szCharset, __out_ecount_part_z(nBufLen, dwLength) LPSTR szBuf, __in int nBufLen, __out DWORD& dwLength, __out BOOL& bEncoded) throw() - { -// BOOL bEncoded = FALSE; - bEncoded = FALSE; - if (m_spMultiLanguage.p) - { - // only encode if there are 8bit characters - int nExtendedChars = GetExtendedChars(headerString, headerString.GetLength()); - if (nExtendedChars) - { - // choose smallest encoding - if (((nExtendedChars*100)/headerString.GetLength()) < 17) - { - int nEncCnt = 0; - if (!QEncode((LPBYTE)((LPCSTR)headerString), headerString.GetLength(), szBuf, &nBufLen, szCharset, &nEncCnt)) - { - return FALSE; - } - - //if no unsafe characters were encountered, just output it - if (nEncCnt != 0) - { - bEncoded = TRUE; - } - } - else - { - if (!BEncode((LPBYTE)((LPCSTR)headerString), headerString.GetLength(), szBuf, &nBufLen, szCharset)) - { - return FALSE; - } - - bEncoded = TRUE; - } - } - } - - if (!bEncoded) - { - // there was no encoding - dwLength = (DWORD) headerString.GetLength(); - if(dwLength > DWORD(nBufLen)) - return FALSE; - Checked::memcpy_s(szBuf, nBufLen, headerString, dwLength); - } - else - { - dwLength = nBufLen; - } - return TRUE; - } - - - // Helper function for adding recipients - inline BOOL AddRecipientHelper(CStringA& str, LPCTSTR szAddress, LPCTSTR szName = NULL, UINT uiCodePage = 0) throw() - { - if ((szAddress == NULL) && (szName == NULL)) - { - return FALSE; - } - - _ATLTRY - { - if (szName) - { - CHeapPtr szNamePtr; - UINT nLen(0); - - BOOL bRet = AtlMimeConvertString(m_spMultiLanguage, uiCodePage, szName, &szNamePtr, &nLen); - if (bRet) - { - CStringA Name(szNamePtr, (int)nLen); - - char szCharset[ATL_MAX_ENC_CHARSET_LENGTH]; - - if (!AtlMimeCharsetFromCodePage(szCharset, uiCodePage, m_spMultiLanguage, ATL_MAX_ENC_CHARSET_LENGTH)) - { - return FALSE; - } - - CFixedStringT strBuf; - - int nBufLen = QEncodeGetRequiredLength(Name.GetLength(), - ATL_MAX_ENC_CHARSET_LENGTH)+1; - - char * szBuf = strBuf.GetBuffer(nBufLen); - if (szBuf == NULL) - { - return FALSE; - } - - DWORD dwLength = 0; - BOOL bEncoded = FALSE; - if (!GetEncodedString(Name, szCharset, szBuf, nBufLen, dwLength, bEncoded)) - { - strBuf.ReleaseBuffer(); - return FALSE; - } - - strBuf.ReleaseBuffer(dwLength); - - // append comma if there are existing recipients - if (str.GetLength() != 0) - { - str.Append(", ", 2); - } - - if (bEncoded == FALSE) - { - // need to escape the string if no encoding - strBuf.Replace("\\", "\\\\"); - strBuf.Replace("\"", "\\\""); - - // wrap the unescaped name in quotes - str.Append("\"", 1); - } - str += strBuf; - if (bEncoded == FALSE) - { - // close quote - str.Append("\"", 1); - } - } - else - { - return bRet; - } - } - - if (szAddress) - { - if (szName) - { - str.Append(" ", 1); - } - else - { - // append comma if there are existing recipients - if (str.GetLength() != 0) - { - str.Append(", ", 2); - } - } - str.Append("<", 1); - str += CT2CA(szAddress); - str.Append(">", 1); - } - return TRUE; - } - _ATLCATCHALL() - { - return FALSE; - } - } - - // Get the formatted header information - inline BOOL FormatField(LPBYTE pbSrcData, int nSrcLen, LPBYTE pbDest, - DWORD* pnBufLen, DWORD dwFlags = 0) throw() - { - if(pnBufLen == NULL) - return FALSE; - - int nRead = 0; - - // 9 is the length of the maximum field name : "Subject :" - // we set that here for simplicity - int nLineLen = 9; - DWORD nWritten = 0; - - //subtract 2 from these because it's easier for when we have - //to break lines with a CRLF (and tab if necessary) - int nMaxLineLength = ATLSMTP_MAX_LINE_LENGTH-3; - while (nRead < nSrcLen) - { - //if we're at the end of the line, break it - if (nLineLen == nMaxLineLength) - { - if( nWritten + 2 > *pnBufLen) - return FALSE; - - *pbDest++ = '\r'; - *pbDest++ = '\n'; - nWritten+= 2; - nLineLen = -1; - - if ((dwFlags & ATLSMTP_FORMAT_SMTP)) - { - if(nWritten + 1 > *pnBufLen) - return FALSE; - - *pbDest++ = '\t'; - nWritten++; - nLineLen++; - } - } - - //if we hit a CRLF, reset nLineLen - if (*pbSrcData == '\n' && nRead > 0 && *(pbSrcData-1) == '\r') - { - nLineLen = -1; - } - - if(nWritten + 1 > *pnBufLen) - return FALSE; - - *pbDest++ = *pbSrcData++; - nRead++; - nWritten++; - nLineLen++; - } - - *pnBufLen = (DWORD)nWritten; - - return TRUE; - } - - - // Get the formatted recipient information - inline BOOL FormatRecipients(LPBYTE pbSrcData, int nSrcLen, LPBYTE pbDest, - DWORD* pnBufLen) throw() - { - - if(pnBufLen == NULL) - return FALSE; - - int nRead = 0; - DWORD nWritten = 0; - - while (nRead < nSrcLen) - { - if (*pbSrcData == ',') - { - if(nWritten + 4 > *pnBufLen) - return FALSE; - - *pbDest++ = *pbSrcData++; - nRead++; - if (nRead+1 <= nSrcLen && *pbSrcData == ' ') - { - pbSrcData++; - nRead++; - } - *pbDest++ = '\r'; - *pbDest++ = '\n'; - *pbDest++ = '\t'; - nWritten+= 4; - - continue; - } - - if(nWritten + 1 > *pnBufLen) - return FALSE; - - *pbDest++ = *pbSrcData++; - nRead++; - nWritten++; - } - - *pnBufLen = nWritten; - - return TRUE; - } - - // Get the required buffer size for the header - inline int GetRequiredBufferSize(int nMaxLineLength) throw() - { - const static DWORD DATELINE = 27; - const static DWORD FROMLINE = 10; - const static DWORD TOLINE = 6; - const static DWORD CCLINE = 6; - const static DWORD SUBJECTLINE = 11; - - //data lengths (QEncoding potentially takes up more space than BEncoding, - //so default to it) - int nRequiredLength = QEncodeGetRequiredLength(m_strSenderName.GetLength(), ATL_MAX_ENC_CHARSET_LENGTH) - +QEncodeGetRequiredLength(m_strSubject.GetLength(), ATL_MAX_ENC_CHARSET_LENGTH); - nRequiredLength += m_strFrom.GetLength()+m_strTo.GetLength()+m_strCc.GetLength(); - - //Add space for date - nRequiredLength += DATELINE; - - //Add space for From: line - nRequiredLength += FROMLINE; - - //Add space for To: line - nRequiredLength += TOLINE; - - //Add space for Cc: line - nRequiredLength += CCLINE; - - //Add space for Subject: line - nRequiredLength += SUBJECTLINE; - - //Add space for line breaks and tabs - nRequiredLength += 3*(nRequiredLength/nMaxLineLength); - - //Trailing CRLF - nRequiredLength += 2; - - return nRequiredLength; - } - -}; // class CMimeHeader - - -// CMimeAttachment is an abstract base class for MIME message attachments. -// It serves as a base class for CMimeFileAttachment and CMimeRawAttachment -class CMimeAttachment : public CMimeBodyPart -{ -protected: - - // the encoding scheme (ATLSMTP_BASE64_ENCODE, ATLSMTP_UUENCODE, ATLSMTP_QP_ENCODE) - int m_nEncodingScheme; - - // the content type of the attachment - CStringA m_ContentType; - - // the character set - char m_szCharset[ATL_MAX_ENC_CHARSET_LENGTH]; - - // the encode string ("base64", "quoted-printable", "uuencode") - char *m_pszEncodeString; - - // the display name of the attachment - TCHAR m_szDisplayName[_MAX_FNAME]; - -public: - CMimeAttachment() throw() - :m_nEncodingScheme(ATLSMTP_BASE64_ENCODE), m_pszEncodeString(NULL) - { - m_szCharset[0] = 0; - m_szDisplayName[0] = 0; - } - - virtual ~CMimeAttachment() throw() - { - } - - // CMimeFileAttachment and CMimeRawAttachment have to handle their own dumping - virtual inline BOOL WriteData(HANDLE hFile, LPOVERLAPPED pOverlapped, LPCSTR szBoundary, DWORD dwFlags = 0) = 0; - - // Set the encoding scheme of the attachment - inline BOOL SetEncodingScheme(int nScheme) throw() - { - if (nScheme != ATLSMTP_BASE64_ENCODE && nScheme != ATLSMTP_UUENCODE && nScheme != ATLSMTP_QP_ENCODE) - { - return FALSE; - } - - m_nEncodingScheme = nScheme; - return TRUE; - } - - // Set the Content-Type of the attachment - inline BOOL SetContentType(LPCTSTR szContent) throw() - { - _ATLTRY - { - m_ContentType = CT2CA(szContent); - return TRUE; - } - _ATLCATCHALL() - { - return FALSE; - } - } - - // Get the content type of the attachment - virtual inline LPCSTR GetContentType() throw() - { - return m_ContentType; - } - - // Get the character set of the attachment - virtual inline LPCSTR GetCharset() throw() - { - return m_szCharset; - } - - virtual ATL_NOINLINE CMimeBodyPart* Copy() = 0; - - const CMimeAttachment& operator=(const CMimeAttachment& that) throw( ... ) - { - if (this != &that) - { - m_nEncodingScheme = that.m_nEncodingScheme; - m_ContentType = that.m_ContentType; - Checked::strcpy_s(m_szCharset, ATL_MAX_ENC_CHARSET_LENGTH, that.m_szCharset); - m_pszEncodeString = that.m_pszEncodeString; - Checked::tcscpy_s(m_szDisplayName, _countof(m_szDisplayName), that.m_szDisplayName); - } - - return *this; - } - -protected: - - // Make the MIME header for the attachment - virtual inline BOOL MakeMimeHeader(CStringA& header, LPCSTR szBoundary) throw() - { - // if no display name is specified, default to "rawdata" - return MakeMimeHeader(header, szBoundary, _T("rawdata")); - } - - // Make the MIME header with the specified filename - virtual inline BOOL MakeMimeHeader(CStringA& header, LPCSTR szBoundary, LPCTSTR szFileName) - { - ATLENSURE(szBoundary != NULL); - ATLASSERT(szFileName != NULL); - ATLASSUME(m_pszEncodeString != NULL); - - char szBegin[256]; - if (*szBoundary) - { - // this is not the only body part - Checked::memcpy_s(szBegin, 256, ATLMIME_SEPARATOR, sizeof(ATLMIME_SEPARATOR)); - Checked::memcpy_s(szBegin+6, 250, szBoundary, ATL_MIME_BOUNDARYLEN); - *(szBegin+(ATL_MIME_BOUNDARYLEN+6)) = '\0'; - } - else - { - // this is the only body part, so output the MIME header - Checked::memcpy_s(szBegin, 256, ATLMIME_VERSION, sizeof(ATLMIME_VERSION)); - } - - // Get file name with the path stripped out - TCHAR szFile[MAX_PATH+1]; - TCHAR szExt[_MAX_EXT+1]; - Checked::tsplitpath_s(szFileName, NULL, 0, NULL, 0, szFile, _countof(szFile), szExt, _countof(szExt)); - Checked::tcscat_s(szFile, _countof(szFile), szExt); - - _ATLTRY - { - CT2CAEX szFileNameA(szFile); - - CStringA szDisplayName(szFile); - if (m_szDisplayName[0] != '\0') - { - szDisplayName = CT2CAEX<_MAX_FNAME+1>(m_szDisplayName); - } - - header.Format("%s\r\nContent-Type: %s;\r\n\tcharset=\"%s\"\r\n\tname=\"%s\"\r\n" - "Content-Transfer-Encoding: %s\r\nContent-Disposition: attachment;\r\n\tfilename=\"%s\"\r\n\r\n", - szBegin, (LPCSTR) m_ContentType, m_szCharset, (LPCSTR) szDisplayName, m_pszEncodeString, (LPCSTR) szFileNameA); - return TRUE; - } - _ATLCATCHALL() - { - return FALSE; - } - } - - // Get encoding information - inline BOOL GetEncodingInformation(int* pnRequiredLength, int* pnLineLength) - { - ATLENSURE(pnRequiredLength != NULL); - ATLENSURE(pnLineLength != NULL); - - switch(m_nEncodingScheme) - { - case ATLSMTP_BASE64_ENCODE: - m_pszEncodeString = "base64"; - *pnLineLength = ATLSMTP_MAX_BASE64_LINE_LENGTH; - *pnRequiredLength = Base64EncodeGetRequiredLength(ATLSMTP_MAX_BASE64_LINE_LENGTH); - break; - case ATLSMTP_UUENCODE: - m_pszEncodeString ="uuencode"; - *pnLineLength = ATLSMTP_MAX_UUENCODE_LINE_LENGTH; - *pnRequiredLength = UUEncodeGetRequiredLength(ATLSMTP_MAX_UUENCODE_LINE_LENGTH); - break; - case ATLSMTP_QP_ENCODE: - m_pszEncodeString = "quoted-printable"; - *pnLineLength = ATLSMTP_MAX_QP_LINE_LENGTH; - *pnRequiredLength = QPEncodeGetRequiredLength(ATLSMTP_MAX_QP_LINE_LENGTH); - break; - default: - return FALSE; - } - return TRUE; - } - -}; // class CMimeAttachment - - -// CMimeFileAttachment represents a MIME file attachment body part -class CMimeFileAttachment : public CMimeAttachment -{ - -protected: - // The filename - TCHAR m_szFileName[MAX_PATH+1]; - -public: - CMimeFileAttachment() throw() - { - m_szFileName[0] = 0; - } - - virtual ATL_NOINLINE CMimeBodyPart* Copy() throw( ... ) - { - CAutoPtr pNewAttachment; - ATLTRY(pNewAttachment.Attach(new CMimeFileAttachment)); - if (pNewAttachment) - *pNewAttachment = *this; - - return pNewAttachment.Detach(); - } - - const CMimeFileAttachment& operator=(const CMimeFileAttachment& that) throw( ... ) - { - if (this != &that) - { - CMimeAttachment::operator=(that); - Checked::tcscpy_s(m_szFileName, _countof(m_szFileName), that.m_szFileName); - } - - return *this; - } - - - // Initialize the file attachment - // szFileName - the actual file name - // szDisplayName - the display name for the file (optional) - // pMultiLanguage - the IMulitLanguage pointer for codepage to charset conversion (optional) - // uiCodePage - the code page (optional) - inline BOOL Initialize(LPCTSTR szFileName, LPCTSTR szDisplayName = NULL, IMultiLanguage* pMultiLanguage = NULL, UINT uiCodePage = 0) throw() - { - if (!AtlMimeCharsetFromCodePage(m_szCharset, uiCodePage, pMultiLanguage, ATL_MAX_ENC_CHARSET_LENGTH)) - return FALSE; - - if( _tcslen(szFileName) > MAX_PATH ) - { - return FALSE; - } - Checked::tcscpy_s(m_szFileName, _countof(m_szFileName), szFileName); - - if (szDisplayName) - { - // use the user-specified display name - size_t nLen = _tcslen(szDisplayName)+1; - if (nLen <= _countof(m_szDisplayName)) - { - Checked::tcscpy_s(m_szDisplayName, _countof(m_szDisplayName), szDisplayName); - } - else - { - Checked::tcsncpy_s(m_szDisplayName, _countof(m_szDisplayName), szDisplayName, _countof(m_szDisplayName) - 4); - Checked::tcscpy_s(m_szDisplayName + _countof(m_szDisplayName) - 4, 4, _T("...")); - } - } - else - { - // otherwise there is no display name - *m_szDisplayName = '\0'; - } - return TRUE; - } - - // Dump the data for the file attachment - virtual inline BOOL WriteData(HANDLE hFile, LPOVERLAPPED pOverlapped, LPCSTR szBoundary, DWORD dwFlags = 0) throw() - { - if ((pOverlapped == NULL) || (szBoundary == NULL)) - { - return FALSE; - } - - int nLineLength = 0; - int nRequiredLength = 0; - - if (!GetEncodingInformation(&nRequiredLength, &nLineLength)) - return FALSE; - - //Try to open the file that is being attached - CAtlFile readFile; - if (FAILED(readFile.Create(m_szFileName, GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING))) - return FALSE; - - //Make the mime header - CStringA header; - if (!MakeMimeHeader(header, szBoundary, m_szFileName)) - { - return FALSE; - } - - //Try to send the mime header - if (!AtlSmtpSendAndWait(hFile, ((LPCSTR)header), header.GetLength(), pOverlapped)) - { - return FALSE; - } - - int nGetLines = ATLSMTP_GET_LINES; - - nRequiredLength *= nGetLines; - - //dwToGet is the total number of characters to attempt to get - DWORD dwToGet = (DWORD)nGetLines*nLineLength; - - //allocate the data array - CHeapPtr spData; - if (!spData.Allocate(dwToGet+1)) - return FALSE; - -// if double buffering is defined, create two buffers -#ifdef ATLSMTP_DOUBLE_BUFFERED - CHeapPtr buffer1; - if (!buffer1.Allocate(nRequiredLength+3)) - return FALSE; - - CHeapPtr buffer2; - if (!buffer2.Allocate(nRequiredLength+3)) - return FALSE; - - char* currBuffer = buffer1; - char* prevBuffer = NULL; - int nCurrBuffer = 0; - DWORD dwPrevLength = 0; -#else - CHeapPtr currBuffer; - if (!currBuffer.Allocate(nRequiredLength+3)) - return FALSE; - -#endif // ATLSMTP_DOUBLE_BUFFERED - - int nEncodedLength = nRequiredLength; - BOOL bRet = FALSE; - DWORD dwRead = 0; - DWORD dwTotalRead = 0; - DWORD dwCurrRead = 0; - - do - { - do - { - //Read a chunk of data from the file increment buffer offsets and amount to read - //based on what's already been read in this iteration of the loop - HRESULT hr = readFile.Read(((LPBYTE)spData)+dwCurrRead, dwToGet-dwCurrRead, dwRead); - if (FAILED(hr)) - { - if (hr != AtlHresultFromWin32(ERROR_MORE_DATA)) - { - return FALSE; - } - } - dwCurrRead += dwRead; - - } while (dwRead != 0 && dwCurrRead < dwToGet); - - //reset nEncodedLength - nEncodedLength = nRequiredLength; - switch (m_nEncodingScheme) - { - case ATLSMTP_BASE64_ENCODE: - //if we are at the end of input (dwCurrRead < dwToGet), output the trailing padding if necessary - //(ATL_FLAG_NONE) - bRet = Base64Encode(spData, dwCurrRead, currBuffer, &nEncodedLength, - (dwCurrRead < dwToGet ? ATL_BASE64_FLAG_NONE: ATL_BASE64_FLAG_NOPAD)); - //Base64Encoding needs explicit CRLF added - if (dwCurrRead < dwToGet) - { - currBuffer[nEncodedLength++] = '\r'; - currBuffer[nEncodedLength++] = '\n'; - } - break; - case ATLSMTP_UUENCODE: - //if we are at the beginning of the input, output the header (ATL_UUENCODE_HEADER) - //if we are the end of input (dwCurrRead < dwToGet), output the 'end' - //we are encoding for purposes of sending mail, so stuff dots (ATL_UUENCODE_DOT) - bRet = UUEncode(spData, dwCurrRead, currBuffer, &nEncodedLength, m_szFileName, - (dwTotalRead > 0 ? 0 : ATLSMTP_UUENCODE_HEADER) | - (dwCurrRead < dwToGet ? ATLSMTP_UUENCODE_END : 0) | - ((dwFlags & ATLSMTP_FORMAT_SMTP) ? ATLSMTP_UUENCODE_DOT : 0)); - break; - case ATLSMTP_QP_ENCODE: - //we are encoding for purposes of sending mail, so stuff dots - bRet = QPEncode(spData, dwCurrRead, currBuffer, &nEncodedLength, - ((dwFlags & ATLSMTP_FORMAT_SMTP) ? ATLSMTP_QPENCODE_DOT : 0) | - (dwCurrRead < dwToGet ? 0 : ATLSMTP_QPENCODE_TRAILING_SOFT)); - break; - } - //try to send the encoded data -#ifdef ATLSMTP_DOUBLE_BUFFERED - if (bRet) - { - bRet = AtlSmtpSendOverlapped(hFile, currBuffer, nEncodedLength, - prevBuffer, dwPrevLength, pOverlapped); - } - - //swap the buffers - dwPrevLength = nEncodedLength; - prevBuffer = currBuffer; - currBuffer = (nCurrBuffer == 0 ? buffer2 : buffer1); - nCurrBuffer = (nCurrBuffer == 0 ? 1 : 0); -#else - if (bRet) - { - bRet = AtlSmtpSendAndWait(hFile, currBuffer, nEncodedLength, pOverlapped); - } -#endif // ATLSMTP_DOUBLE_BUFFERED - - dwTotalRead += dwCurrRead; - if (dwRead != 0) - dwCurrRead = 0; - - nEncodedLength = nRequiredLength; - - } while (dwRead != 0 && bRet); - - //ensure that the last Send sent all the data -#ifdef ATLSMTP_DOUBLE_BUFFERED - DWORD dwWritten = 0, dwErr = 0; - if (!GetOverlappedResult(hFile, pOverlapped, &dwWritten, TRUE)) - { - if ((dwErr = GetLastError()) != ERROR_IO_PENDING && dwErr != ERROR_IO_INCOMPLETE) - { - bRet = FALSE; - } - else if (dwWritten < dwPrevLength) - { - bRet = AtlSmtpSendAndWait(hFile, prevBuffer+dwWritten, - dwPrevLength-dwWritten, pOverlapped); - } - } -#endif // ATLSMTP_DOUBLE_BUFFERED - - //for uuencoding, if the last chunk read was of size dwToGet, but it was also the end of the file, - //the "end" keyword will not get encoded, so a check is necessary - if (m_nEncodingScheme == ATLSMTP_UUENCODE && dwCurrRead == dwToGet) - { - bRet = UUEncode(spData, 0, currBuffer, &nEncodedLength, m_szFileName, - (dwFlags & ATLSMTP_FORMAT_SMTP ? ATLSMTP_UUENCODE_DOT : 0) | - ATLSMTP_UUENCODE_END); - if (bRet) - { - bRet = AtlSmtpSendAndWait(hFile, currBuffer, nEncodedLength, pOverlapped); - } - } - - return bRet; - } -}; // class CMimeFileAttachment - -// CMimeRawAttachment represents a file attachment MIME body part. -// The data provided is not a file, but a blob of raw data. -class CMimeRawAttachment : public CMimeAttachment -{ -protected: - - //the raw data - void* m_pvRaw; - - //the length - DWORD m_dwLength; - - //whether or not we own it - bool m_bShared; - -public: - CMimeRawAttachment() throw() - :m_dwLength(0), m_bShared(false), m_pvRaw(NULL) - { - } - - ~CMimeRawAttachment() throw() - { - //If we own the raw data, free it - if (!m_bShared && m_pvRaw) - free(m_pvRaw); - } - - virtual ATL_NOINLINE CMimeBodyPart* Copy() throw( ... ) - { - CAutoPtr pNewAttachment; - ATLTRY(pNewAttachment.Attach(new CMimeRawAttachment)); - if (pNewAttachment) - *pNewAttachment = *this; - - return pNewAttachment.Detach(); - } - - const CMimeRawAttachment& operator=(const CMimeRawAttachment& that) throw( ... ) - { - if (this != &that) - { - CMimeAttachment::operator=(that); - if (!m_bShared && m_pvRaw) - free(m_pvRaw); - - m_bShared = that.m_bShared; - m_dwLength = that.m_dwLength; - - if (m_bShared) - { - m_pvRaw = that.m_pvRaw; - } - else - { - m_pvRaw = malloc(m_dwLength); - if (m_pvRaw) - { - Checked::memcpy_s(m_pvRaw, m_dwLength, that.m_pvRaw, m_dwLength); - } - } - } - - return *this; - } - - // Initialize the attachment - // pData - the data - // nDataLength - the size of pData in BYTEs - // bCopyData - flag specifying whether CMimeRawAttachment should make a copy of the data (optional) - // pMultiLanguage - the IMultiLanguage pointer for codepage to character set conversion (optional) - // uiCodePage - the codepage (optional) - inline BOOL Initialize(void* pData, DWORD nDataLength, BOOL bCopyData = TRUE, LPCTSTR szDisplayName = NULL, - IMultiLanguage* pMultiLanguage = NULL, UINT uiCodePage = 0) throw() - { - // if we're already attached to some data, and it's not shared, free it - if (m_pvRaw && !m_bShared) - free(m_pvRaw); - m_pvRaw = NULL; - - m_dwLength = nDataLength; - if (bCopyData) - { - m_pvRaw = calloc(sizeof(BYTE),m_dwLength); - if (!m_pvRaw) - { - return FALSE; - } - Checked::memcpy_s(m_pvRaw, m_dwLength, pData, m_dwLength); - m_bShared = false; - } - else - { - m_pvRaw = pData; - m_bShared = true; - } - - if (!AtlMimeCharsetFromCodePage(m_szCharset, uiCodePage, pMultiLanguage, ATL_MAX_ENC_CHARSET_LENGTH)) - return FALSE; - - if (szDisplayName) - { - // use the user-specified display name - Checked::tcscpy_s(m_szDisplayName, _countof(m_szDisplayName), szDisplayName); - m_szDisplayName[_countof(m_szDisplayName)-1] = 0; - } - else - { - // no display name - *m_szDisplayName = '\0'; - } - return TRUE; - } - - // Output the data--similar to CFileAttachment::WriteData - // See CFileAttachment::WriteData for comments - virtual inline BOOL WriteData(HANDLE hFile, LPOVERLAPPED pOverlapped, LPCSTR szBoundary, DWORD dwFlags = 0) throw() - { - if ((pOverlapped == NULL) || (szBoundary == NULL)) - { - return FALSE; - } - - if (!m_pvRaw) - return FALSE; - - int nLineLength = 0, nRequiredLength = 0; - if (!GetEncodingInformation(&nRequiredLength, &nLineLength)) - return FALSE; - - CStringA header; - - if (!MakeMimeHeader(header, szBoundary)) - { - return FALSE; - } - - if (!AtlSmtpSendAndWait(hFile, ((LPCSTR)header), header.GetLength(), pOverlapped)) - { - return FALSE; - } - - int nGetLines = ATLSMTP_GET_LINES; - DWORD dwCurrChunk = 0; - nRequiredLength *= nGetLines; - DWORD dwToGet = (DWORD)nGetLines*nLineLength; - int nDestLen = nRequiredLength; - BOOL bRet = FALSE; - DWORD dwRead = 0; -#ifdef ATLSMTP_DOUBLE_BUFFERED - CHeapPtr buffer1; - if (!buffer1.Allocate(nRequiredLength+3)) - return FALSE; - - CHeapPtr buffer2; - if (!buffer2.Allocate(nRequiredLength+3)) - return FALSE; - - char* currBuffer = buffer1; - char* prevBuffer = NULL; - int nCurrBuffer = 0; - DWORD dwPrevLength = 0; -#else - CHeapPtr currBuffer; - if (!currBuffer.Allocate(nRequiredLength+3)) - return FALSE; -#endif // ATLSMTP_DOUBLE_BUFFERED - - do - { - if ((m_dwLength-dwRead) <= dwToGet) - dwCurrChunk = m_dwLength-dwRead; - else - dwCurrChunk = dwToGet; - switch(m_nEncodingScheme) - { - case ATLSMTP_BASE64_ENCODE: - bRet = Base64Encode(((LPBYTE)(m_pvRaw))+dwRead, dwCurrChunk, currBuffer, &nDestLen, - (dwRead < m_dwLength) ? ATL_BASE64_FLAG_NONE : ATL_BASE64_FLAG_NOPAD); - if (dwRead+dwCurrChunk == m_dwLength) - { - currBuffer[nDestLen++] = '\r'; - currBuffer[nDestLen++] = '\n'; - } - break; - case ATLSMTP_UUENCODE: - bRet = UUEncode(((LPBYTE)(m_pvRaw))+dwRead, dwCurrChunk, currBuffer, &nDestLen, _T("rawdata"), - (dwRead > 0 ? 0 : ATLSMTP_UUENCODE_HEADER) | - (dwRead+dwCurrChunk == m_dwLength ? ATLSMTP_UUENCODE_END : 0) | - ((dwFlags & ATLSMTP_FORMAT_SMTP) ? ATLSMTP_UUENCODE_DOT : 0)); - break; - case ATLSMTP_QP_ENCODE: - bRet = QPEncode(((LPBYTE)(m_pvRaw))+dwRead, dwCurrChunk, currBuffer, &nDestLen, - ((dwFlags & ATLSMTP_FORMAT_SMTP) ? ATLSMTP_QPENCODE_DOT : 0) | - (dwRead+dwCurrChunk == m_dwLength ? 0 : ATLSMTP_QPENCODE_TRAILING_SOFT)); - break; - } - if (!bRet) - break; -#ifdef ATLSMTP_DOUBLE_BUFFERED - bRet = AtlSmtpSendOverlapped(hFile, currBuffer, nDestLen, prevBuffer, dwPrevLength, pOverlapped); - dwPrevLength = (DWORD)nDestLen; - prevBuffer = currBuffer; - currBuffer = (nCurrBuffer == 0 ? buffer2 : buffer1); - nCurrBuffer = (nCurrBuffer == 0 ? 1 : 0); -#else - bRet = AtlSmtpSendAndWait(hFile, currBuffer, nDestLen, pOverlapped); -#endif // ATLSMTP_DOUBLE_BUFFERED - - nDestLen = nRequiredLength; - dwRead += dwCurrChunk; - } while (bRet && (dwRead < m_dwLength)); - - //ensure all data is sent from prevBuffer -#ifdef ATLSMTP_DOUBLE_BUFFERED - DWORD dwWritten = 0, dwErr = 0; - if (!GetOverlappedResult(hFile, pOverlapped, &dwWritten, TRUE)) - { - if ((dwErr = GetLastError()) != ERROR_IO_PENDING && dwErr != ERROR_IO_INCOMPLETE) - bRet = FALSE; - else if (dwWritten < dwPrevLength) - bRet = AtlSmtpSendAndWait(hFile, prevBuffer+dwWritten, dwPrevLength-dwWritten, pOverlapped); - } -#endif // ATLSMTP_DOUBLE_BUFFERED - - return bRet; - } -}; // class CMimeRawAttachment - - -// CMimeText - represents a text body part in MIME body -class CMimeText : public CMimeBodyPart -{ -protected: - - // the text - CHeapPtr m_szText; - - // the character set - char m_szCharset[ATL_MAX_ENC_CHARSET_LENGTH]; - - // the text length - int m_nTextLen; - -public: - CMimeText() throw() - :m_nTextLen(0) - { - Checked::strcpy_s(m_szCharset, ATL_MAX_ENC_CHARSET_LENGTH, ATLSMTP_DEFAULT_CSET); - } - - virtual ~CMimeText() throw() - { - } - - // Get the content type - virtual inline LPCSTR GetContentType() throw() - { - return "text/plain"; - } - - // Get the character set - virtual inline LPCSTR GetCharset() throw() - { - return m_szCharset; - } - - virtual ATL_NOINLINE CMimeBodyPart* Copy() throw( ... ) - { - CAutoPtr pNewText; - ATLTRY(pNewText.Attach(new CMimeText)); - if (pNewText) - *pNewText = *this; - - return pNewText.Detach(); - } - - const CMimeText& operator=(const CMimeText& that) throw( ... ) - { - if (this != &that) - { - m_nTextLen = that.m_nTextLen; - Checked::strcpy_s(m_szCharset, ATL_MAX_ENC_CHARSET_LENGTH, that.m_szCharset); - m_szText.Free(); - if (m_szText.AllocateBytes(m_nTextLen) != false) - { - Checked::memcpy_s((char *)m_szText, m_nTextLen, (char *)that.m_szText, m_nTextLen); - } - } - - return *this; - } - - // Initialize the body part - // szText - the text (required) - // nTextLen - the text length in bytes (optional--if not specified a _tcslen will be done) - // pMultiLanguage - the IMultiLanguagte pointer for converting codepages to MIME character sets (optional) - // uiCodePage - the codepage - inline BOOL Initialize(LPCTSTR szText, int nTextLen = -1, IMultiLanguage* pMultiLanguage = NULL, UINT uiCodePage = 0) throw() - { - BOOL bRet = TRUE; - - // if IMultiLanguage is there, respect the codepage - if (pMultiLanguage) - { - CHeapPtr szTextPtr; - UINT nLen(0); - - bRet = AtlMimeConvertString(pMultiLanguage, uiCodePage, szText, &szTextPtr, &nLen); - if (bRet) - { - m_szText.Free(); - m_szText.Attach(szTextPtr.Detach()); - m_nTextLen = nLen; - } - } - else // no multilanguage support - { - if (nTextLen < 0) - { - nTextLen = (int) _tcslen(szText); - nTextLen*= sizeof(TCHAR); - } - - m_szText.Free(); - if (m_szText.AllocateBytes(nTextLen) != false) - { - Checked::memcpy_s((char *)m_szText, nTextLen, szText, nTextLen); - m_nTextLen = nTextLen; - } - } - - if (bRet) - { - bRet = AtlMimeCharsetFromCodePage(m_szCharset, uiCodePage, pMultiLanguage, ATL_MAX_ENC_CHARSET_LENGTH); - } - - return bRet; - } - - // Dump the data to hFile - virtual inline BOOL WriteData(HANDLE hFile, LPOVERLAPPED pOverlapped, LPCSTR szBoundary, DWORD dwFlags = 0) throw() - { - if ((pOverlapped == NULL) || (szBoundary == NULL)) - { - return FALSE; - } - - CStringA strHeader; - char sendBuffer[ATLSMTP_READBUFFER_SIZE]; - LPSTR pSendBuffer = sendBuffer; - LPSTR szText = m_szText; - - if (!MakeMimeHeader(strHeader, szBoundary)) - { - return FALSE; - } - - //copy the header into the sendbuffer - int nWritten = strHeader.GetLength(); - if(nWritten > ATLSMTP_READBUFFER_SIZE) - return FALSE; - - Checked::memcpy_s(pSendBuffer, ATLSMTP_READBUFFER_SIZE, (LPCSTR)strHeader, nWritten); - pSendBuffer+= nWritten; - int nRead = 0; - int nLineLen = 0; - - //subtract 2 from these because it's easier for when we have - //to break lines with a CRLF - int nMaxLineLength = ATLSMTP_MAX_LINE_LENGTH-2; - int nMaxBufferSize = ATLSMTP_READBUFFER_SIZE-2; - while (nRead <= m_nTextLen) - { - //if the buffer is full or we've reached the end of the text, - //send it - if (nWritten >= nMaxBufferSize || nRead == m_nTextLen) - { - if (!AtlSmtpSendAndWait(hFile, sendBuffer, nWritten, pOverlapped)) - return FALSE; - nWritten = 0; - pSendBuffer = sendBuffer; - if (nRead == m_nTextLen) - { - break; // job done, no need to run the code below - } - } - - //if we're at the end of the line, break it - if (nLineLen == nMaxLineLength) - { - if(nWritten + 2 > ATLSMTP_READBUFFER_SIZE) - return FALSE; - *pSendBuffer++ = '\r'; - *pSendBuffer++ = '\n'; - nWritten+= 2; - nLineLen = -1; - continue; - } - - //stuff dots at the start of the line - if (nLineLen == 0 && (dwFlags & ATLSMTP_FORMAT_SMTP) && *szText == '.') - { - if(nWritten + 1 > ATLSMTP_READBUFFER_SIZE) - return FALSE; - *pSendBuffer++ = '.'; - nWritten++; - nLineLen++; - continue; - } - - //if we hit a CRLF, reset nLineLen - if (*szText == '\n' && nRead > 0 && *(szText-1) == '\r') - nLineLen = -1; - - if(nWritten + 1 > ATLSMTP_READBUFFER_SIZE) - return FALSE; - *pSendBuffer++ = (*szText++); - nRead++; - nWritten++; - nLineLen++; - } - - return TRUE; - } - -protected: - - // Make the MIME header - virtual inline BOOL MakeMimeHeader(CStringA& header, LPCSTR szBoundary) throw() - { - char szBegin[256]; - if (*szBoundary) - { - // this is not the only body part - Checked::memcpy_s(szBegin, sizeof(szBegin), ATLMIME_SEPARATOR, sizeof(ATLMIME_SEPARATOR)); - Checked::memcpy_s(szBegin+6, sizeof(szBegin)-6, szBoundary, ATL_MIME_BOUNDARYLEN); - *(szBegin+(ATL_MIME_BOUNDARYLEN+6)) = '\0'; - } - else - { - // this is the only body part, so output the full MIME header - Checked::memcpy_s(szBegin, sizeof(szBegin), ATLMIME_VERSION, sizeof(ATLMIME_VERSION)); - } - - _ATLTRY - { - header.Format("%s\r\nContent-Type: text/plain;\r\n\tcharset=\"%s\"\r\nContent-Transfer-Encoding: 8bit\r\n\r\n", - szBegin, m_szCharset); - return TRUE; - } - _ATLCATCHALL() - { - return FALSE; - } - } -}; // class CMimeText - - -// CMimeMessage - the MIME message class. Represents a full MIME message -class CMimeMessage : public CMimeHeader -{ -protected: - - // The list of the MIME body parts - CAutoPtrList m_BodyParts; - - // The display name of the message - char m_szDisplayName[MAX_PATH+1]; - -public: - CMimeMessage(IMultiLanguage *pMultiLanguage = NULL) throw() - { - Initialize(pMultiLanguage); - Checked::memcpy_s(m_szDisplayName, MAX_PATH+1, ATLMIME_EMAIL, sizeof(ATLMIME_EMAIL)); - } - - virtual ~CMimeMessage() throw() - { - RemoveParts(); - } - - void RemoveParts() throw() - { - m_BodyParts.RemoveAll(); - } - - - virtual ATL_NOINLINE CMimeBodyPart* Copy() throw( ... ) - { - CAutoPtr pNewMessage; - ATLTRY(pNewMessage.Attach(new CMimeMessage)); - if (pNewMessage) - *pNewMessage = *this; - - return pNewMessage.Detach(); - } - - - const CMimeMessage& operator=(const CMimeMessage& that) throw( ... ) - { - if (this != &that) - { - CMimeHeader::operator=(that); - Checked::strcpy_s(m_szDisplayName, MAX_PATH+1, that.m_szDisplayName); - - RemoveParts(); - POSITION pos = that.m_BodyParts.GetHeadPosition(); - while (pos != NULL) - { - CAutoPtr pCopy(that.m_BodyParts.GetNext(pos)->Copy()); - if (pCopy) - { - m_BodyParts.AddTail(pCopy); - } - } - } - - return *this; - } - - // Set the display name of the message - inline BOOL SetDisplayName(LPCTSTR szDisplayName) throw() - { - if (szDisplayName == NULL) - { - return FALSE; - } - - _ATLTRY - { - CT2CA szDisplayNameA(szDisplayName); - if (szDisplayNameA == NULL || strlen(szDisplayNameA) > MAX_PATH) - return FALSE; - Checked::strcpy_s(m_szDisplayName, MAX_PATH+1, szDisplayNameA); - return TRUE; - } - _ATLCATCHALL() - { - return FALSE; - } - } - - // Add some text to the message at position nPos in the body parts list - // szText - the text - // nTextLen - the size of the text in bytes (optional - if not specified a _tcslen will be done) - // nPos - the position in the message at which to insert the text (optional) - // uiCodePage - the codepage (optional) - inline BOOL AddText(LPCTSTR szText, int nTextLen = -1, int nPos = 1, UINT uiCodePage = 0) throw() - { - if (szText == NULL) - return FALSE; - - if (nPos < 1) - { - nPos = 1; - } - - CAutoPtr spNewText; - CMimeText *pNewText = NULL; - ATLTRY(spNewText.Attach(pNewText = new CMimeText())); - if (!spNewText || !pNewText) - return FALSE; - - BOOL bRet = pNewText->Initialize(szText, nTextLen, m_spMultiLanguage, uiCodePage); - if (bRet) - { - _ATLTRY - { - POSITION currPos = m_BodyParts.FindIndex(nPos-1); - - if (!currPos) - { - if (!m_BodyParts.AddTail(spNewText)) - bRet = FALSE; - } - else - { - if (!m_BodyParts.InsertBefore(currPos, spNewText)) - bRet = FALSE; - } - - } - _ATLCATCHALL() - { - bRet = FALSE; - } - } - - return bRet; - } - - // Dump the data - virtual BOOL WriteData(HANDLE hFile, LPOVERLAPPED pOverlapped, LPCSTR szBoundary=NULL, DWORD dwFlags = 0) throw() - { - if (pOverlapped == NULL) - { - return FALSE; - } - - // Make the MIME boundary for this message - char szBoundaryBuf[ATL_MIME_BOUNDARYLEN+1]; - if(MakeBoundary(szBoundaryBuf,ATL_MIME_BOUNDARYLEN+1) == FALSE) - return FALSE; - - // if the passed boundary is valid, this is an attached message - if (szBoundary && *szBoundary != '\0') - { - _ATLTRY - { - // output the MIME header for a message attachment - CStringA strHeader; - strHeader.Format("\r\n\r\n--%s\r\nContent-Type: message/rfc822\r\n\tname=\"%s\"\r\nContent-Transfer-Encoding: 8bit\r\n" - "Content-Disposition: attachment;\r\n\tfilename=\"%s\"\r\n\r\n", - szBoundary, m_szDisplayName, m_szDisplayName); - - if (!AtlSmtpSendAndWait(hFile, ((LPCSTR)strHeader), strHeader.GetLength(), pOverlapped)) - { - return FALSE; - } - } - _ATLCATCHALL() - { - return FALSE; - } - } - - if (!CMimeHeader::WriteData(hFile, pOverlapped, szBoundaryBuf, dwFlags)) - return FALSE; - - // Create and output the header - CStringA strHeader; - - if (!MakeMimeHeader(strHeader, szBoundaryBuf)) - { - return FALSE; - } - - if (!AtlSmtpSendAndWait(hFile, ((LPCSTR)strHeader), strHeader.GetLength(), pOverlapped)) - { - return FALSE; - } - - CMimeBodyPart* pCurrPart; - POSITION currPos = m_BodyParts.GetHeadPosition(); - - //Dump the body parts - while (currPos != NULL) - { - pCurrPart = m_BodyParts.GetAt(currPos); - if (!pCurrPart->WriteData(hFile, pOverlapped, szBoundaryBuf, dwFlags)) - { - return FALSE; - } - m_BodyParts.GetNext(currPos); - } - - char szBuf[ATL_MIME_BOUNDARYLEN+(sizeof("\r\n\r\n--%s--\r\n"))]; - //output a trailing boundary - if (*szBoundaryBuf) - { - int nBufLen = sprintf_s(szBuf, ATL_MIME_BOUNDARYLEN+(sizeof("\r\n\r\n--%s--\r\n")), - "\r\n\r\n--%s--\r\n", szBoundaryBuf); - if ((nBufLen < 0) || (!AtlSmtpSendAndWait(hFile, szBuf, nBufLen, pOverlapped))) - { - return FALSE; - } - } - - return TRUE; - } - - // Attach a file. - // szFileName - the filename - // szDisplayName - the display name (optional) - // szContentType - the content type (optional - defaults to NULL -- lookup will be attempted, otherwise default to application/octet-stream) - // nEncodingScheme - the encoding scheme to use for the attachment (optional - defaults to base64 - // uiCodePage - the codepage (optional) - inline BOOL AttachFile(LPCTSTR szFileName, LPCTSTR szDisplayName = NULL, LPCTSTR szContentType = NULL, - int nEncodingScheme = ATLSMTP_BASE64_ENCODE, UINT uiCodepage = 0) - { - if (szFileName == NULL) - return FALSE; - - CAutoPtr spFileAttach; - CMimeFileAttachment* pFileAttach = NULL; - ATLTRY(spFileAttach.Attach(pFileAttach = new CMimeFileAttachment())); - if (!spFileAttach || !pFileAttach) - return FALSE; - - BOOL bRet = pFileAttach->Initialize(szFileName, szDisplayName, m_spMultiLanguage, uiCodepage); - - if (bRet) - bRet = pFileAttach->SetEncodingScheme(nEncodingScheme); - - CString strContentType; - if (bRet && (szContentType == NULL)) - { - if (GetContentTypeFromFileName(szFileName, strContentType) != ERROR_OUTOFMEMORY) - { - szContentType = strContentType; - } - else - { - bRet = FALSE; - } - } - - _ATLTRY - { - if (bRet) - { - bRet = pFileAttach->SetContentType(szContentType); - if (bRet) - { - if (!m_BodyParts.AddTail(spFileAttach)) - { - bRet = FALSE; - } - } - } - } - _ATLCATCHALL() - { - bRet = FALSE; - } - - return bRet; - } - - // Attach some raw data - // pRawData - the data - // nDataLength - the size of the data in bytes - // nEncodingScheme - the encoding scheme to use for the attachment (optional - defaults to base64 - // uiCodePage - the codepage (optional) - inline BOOL AttachRaw(void* pRawData, DWORD dwDataLength, int nEncodingScheme = ATLSMTP_BASE64_ENCODE, BOOL bCopyData = TRUE, - LPCTSTR szDisplayName = NULL, LPCTSTR szContentType = _T("application/octet-stream"), UINT uiCodepage = 0) - { - if (!pRawData) - return FALSE; - - CAutoPtr spRawAttach; - CMimeRawAttachment* pRawAttach; - ATLTRY(spRawAttach.Attach(pRawAttach = new CMimeRawAttachment())); - if (!spRawAttach) - { - return FALSE; - } - - BOOL bRet = pRawAttach->Initialize(pRawData, dwDataLength, bCopyData, szDisplayName, m_spMultiLanguage, uiCodepage); - - if (bRet) - bRet = pRawAttach->SetEncodingScheme(nEncodingScheme); - if (bRet) - bRet = pRawAttach->SetContentType(szContentType); - - _ATLTRY - { - if (bRet) - if(!m_BodyParts.AddTail(spRawAttach)) - bRet = FALSE; - } - _ATLCATCHALL() - { - bRet = FALSE; - } - - return bRet; - } - - // Attach a CMimeMessage - // pMsg - pointer to the Msg object - inline BOOL AttachMessage(CMimeMessage* pMsg) throw( ... ) - { - if (!pMsg) - return FALSE; - - _ATLTRY - { - CAutoPtr spMsg(pMsg->Copy()); - if (!m_BodyParts.AddTail(spMsg)) - return FALSE; - } - _ATLCATCHALL() - { - return FALSE; - } - - return TRUE; - } - -protected: - // Make the MIME header - virtual inline BOOL MakeMimeHeader(CStringA& header, LPCSTR szBoundary) throw() - { - _ATLTRY - { - if (!*szBoundary) - { - header.Format("X-Priority: %d\r\n%s", m_nPriority, (LPCSTR) m_XHeader); - } - else if (m_BodyParts.GetCount() > 1) - { - header.Format("X-Priority: %d\r\n%sMIME-Version: 1.0\r\nContent-Type: multipart/mixed;\r\n\tboundary=\"%s\"\r\n", - m_nPriority, (LPCSTR) m_XHeader, szBoundary); - } - return TRUE; - } - _ATLCATCHALL() - { - return FALSE; - } - } - - // Make the MIME boundary - inline BOOL MakeBoundary(__out_ecount_z(nBufLen) LPSTR szBoundary, __in int nBufLen) - { - ATLENSURE(szBoundary != NULL); - - if(nBufLen < 1) - { - return FALSE; - } - - if (m_BodyParts.GetCount() < 2) - { - *szBoundary = '\0'; - } - else - { - int ret = sprintf_s(szBoundary, nBufLen, "------=_Next_Part_%.10u.%.3u", GetTickCount(), rand()%1000); - if (ret == -1 || ret >= nBufLen) - return FALSE; - } - return TRUE; - } - -}; // class CMimeMessage - -} // namespace ATL -#pragma pack(pop) - -#ifndef _CPPUNWIND -#pragma warning (pop) -#endif //_CPPUNWIND - -#pragma warning(pop) - -#endif // __ATLMIME_H__ diff --git a/include/atl/atlperf.h b/include/atl/atlperf.h deleted file mode 100644 index a1e8d9ea4..000000000 --- a/include/atl/atlperf.h +++ /dev/null @@ -1,663 +0,0 @@ -// This is a part of the Active Template Library. -// Copyright (C) Microsoft Corporation -// All rights reserved. -// -// This source code is only intended as a supplement to the -// Active Template Library Reference and related -// electronic documentation provided with the library. -// See these sources for detailed information regarding the -// Active Template Library product. - -#ifndef __ATLPERF_H__ -#define __ATLPERF_H__ - -#pragma once - -#ifndef __cplusplus - #error ATL requires C++ compilation (use a .cpp suffix) -#endif - -#include -#include -#include -#include -#include -#include -#include -#include - -#ifndef _ATL_PERF_NOXML -#include -#include -#include - -/* xmldsodid and mshtmdid both have the same identifiers defined, with differing values. So we are renaming the XML ones since there are less identifiers dependent on those. */ -#ifdef DISPID_XOBJ_MIN -/* in case the HTM one was included first, we'll undef these first */ -#define _ATL_MSHTMDID_INCLUDED_ALREADY -#undef DISPID_XOBJ_MIN -#undef DISPID_XOBJ_MAX -#undef DISPID_XOBJ_BASE -#endif - -#include -#include - -/* re-undef the clashing names, and their direct dependents */ -#undef DISPID_XOBJ_MIN -#undef DISPID_XOBJ_MAX -#undef DISPID_XOBJ_BASE -#undef DISPID_XMLDSO -#undef DISPID_XMLELEMENTCOLLECTION - -/* re-def the clashing names, and their direct dependents, with un-clashed values */ -#define DISPID_XMLDSO_XOBJ_MIN 0x00010000 -#define DISPID_XMLDSO_XOBJ_MAX 0x0001FFFF -#define DISPID_XMLDSO_XOBJ_BASE DISPID_XMLDSO_XOBJ_MIN -#define DISPID_XMLDSO DISPID_XMLDSO_XOBJ_BASE -#define DISPID_XMLELEMENTCOLLECTION DISPID_XMLDSO_XOBJ_BASE -#ifdef _ATL_MSHTMDID_INCLUDED_ALREADY - -/* redef the clashing names to the HTM values */ -#define DISPID_XOBJ_MIN 0x80010000 -#define DISPID_XOBJ_MAX 0x8001FFFF -#define DISPID_XOBJ_BASE DISPID_XOBJ_MIN -#endif -#include -#endif - -#pragma warning(push) -#pragma warning(disable: 4625) // copy constructor could not be generated because a base class copy constructor is inaccessible -#pragma warning(disable: 4626) // assignment operator could not be generated because a base class assignment operator is inaccessible - - -#pragma pack(push,_ATL_PACKING) -namespace ATL -{ - -const DWORD ATLPERF_SIZE_MASK = 0x00000300; -const DWORD ATLPERF_TYPE_MASK = 0x00000C00; -const DWORD ATLPERF_TEXT_MASK = 0x00010000; - -#ifndef ATLPERF_DEFAULT_MAXINSTNAMELENGTH -#define ATLPERF_DEFAULT_MAXINSTNAMELENGTH 64 -#endif - -// base class for user-defined perf objects -struct CPerfObject -{ - // implementation - - ULONG m_nAllocSize; - DWORD m_dwCategoryId; - DWORD m_dwInstance; - ULONG m_nRefCount; - ULONG m_nInstanceNameOffset; // byte offset from beginning of PerfObject to LPWSTR szInstanceName -}; - -class CPerfMon -{ -public: - virtual ~CPerfMon() throw(); - -#ifdef _ATL_PERF_REGISTER - // registration - HRESULT Register( - LPCTSTR szOpenFunc, - LPCTSTR szCollectFunc, - LPCTSTR szCloseFunc, - HINSTANCE hDllInstance = _AtlBaseModule.GetModuleInstance()) throw(); - HRESULT RegisterStrings( - LANGID wLanguage = MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), - HINSTANCE hResInstance = _AtlBaseModule.GetResourceInstance()) throw(); - HRESULT RegisterAllStrings(HINSTANCE hResInstance = NULL) throw(); - HRESULT Unregister() throw(); -#endif - - HRESULT Initialize() throw(); - void UnInitialize() throw(); - HRESULT CreateInstance( - DWORD dwCategoryId, - DWORD dwInstance, - LPCWSTR szInstanceName, - CPerfObject** ppInstance) throw(); - HRESULT CreateInstanceByName( - DWORD dwCategoryId, - LPCWSTR szInstanceName, - CPerfObject** ppInstance) throw(); - - template - HRESULT CreateInstance( - DWORD dwInstance, - LPCWSTR szInstanceName, - T** ppInstance) throw() - { - // Ensure T derives from CPerfObject - static_cast(*ppInstance); - - return CreateInstance( - T::kCategoryId, - dwInstance, - szInstanceName, - reinterpret_cast(ppInstance) - ); - } - - template - HRESULT CreateInstanceByName( - LPCWSTR szInstanceName, - T** ppInstance) throw() - { - // Ensure T derives from CPerfObject - static_cast(*ppInstance); - - return CreateInstanceByName( - T::kCategoryId, - szInstanceName, - reinterpret_cast(ppInstance) - ); - } - - HRESULT ReleaseInstance(CPerfObject* pInstance) throw(); - HRESULT LockPerf(DWORD dwTimeout = INFINITE) throw(); - void UnlockPerf() throw(); - -#ifndef _ATL_PERF_NOXML - HRESULT PersistToXML(IStream *pStream, BOOL bFirst=TRUE, BOOL bLast=TRUE) throw(...); - HRESULT LoadFromXML(IStream *pStream) throw(...); -#endif - - // implementation - -public: - // PerfMon entry point helpers - DWORD Open(LPWSTR lpDeviceNames) throw(); - DWORD Collect(__in_z LPWSTR lpwszValue, __deref_inout_bcount(*pcbBytes) LPVOID* lppData, __inout LPDWORD lpcbBytes, __inout LPDWORD lpcObjectTypes) throw(); - DWORD Close() throw(); - - // map building routines - HRESULT AddCategoryDefinition( - DWORD dwCategoryId, - LPCTSTR szCategoryName, - LPCTSTR szHelpString, - DWORD dwDetailLevel, - INT nDefaultCounter, - BOOL bInstanceLess, - UINT nStructSize, - UINT nMaxInstanceNameLen = ATLPERF_DEFAULT_MAXINSTNAMELENGTH) throw(); - HRESULT AddCounterDefinition( - DWORD dwCounterId, - LPCTSTR szCounterName, - LPCTSTR szHelpString, - DWORD dwDetailLevel, - DWORD dwCounterType, - ULONG nMaxCounterSize, - UINT nOffset, - INT nDefaultScale) throw(); - - // macro helpers - HRESULT RegisterCategory( - WORD wLanguage, - HINSTANCE hResInstance, - UINT* pSampleRes, - DWORD dwCategoryId, - UINT nNameString, - UINT nHelpString, - DWORD dwDetail, - BOOL bInstanceless, - UINT nStructSize, - UINT nMaxInstanceNameLen, - INT nDefaultCounter) throw(); - HRESULT RegisterCategory( - WORD wLanguage, - HINSTANCE hResInstance, - UINT* pSampleRes, - DWORD dwCategoryId, - LPCTSTR szNameString, - LPCTSTR szHelpString, - DWORD dwDetail, - BOOL bInstanceless, - UINT nStructSize, - UINT nMaxInstanceNameLen, - INT nDefaultCounter) throw(); - HRESULT RegisterCounter( - WORD wLanguage, - HINSTANCE hResInstance, - DWORD dwCounterId, - UINT nNameString, - UINT nHelpString, - DWORD dwDetail, - DWORD dwCounterType, - ULONG nMaxCounterSize, - UINT nOffset, - INT nDefaultScale) throw(); - HRESULT RegisterCounter( - WORD wLanguage, - HINSTANCE hResInstance, - DWORD dwCounterId, - LPCTSTR szNameString, - LPCTSTR szHelpString, - DWORD dwDetail, - DWORD dwCounterType, - ULONG nMaxCounterSize, - UINT nOffset, - INT nDefaultScale) throw(); - -protected: - void ClearMap() throw(); - - virtual LPCTSTR GetAppName() const throw() = 0; - virtual HRESULT CreateMap(WORD wLanguage, HINSTANCE hResInstance, UINT* pSampleRes = NULL) throw(); - virtual void OnBlockAlloc(CAtlFileMappingBase* /*pNewBlock*/) { } -#ifdef _ATL_PERF_REGISTER - static BOOL CALLBACK EnumResLangProc(HINSTANCE hModule, LPCTSTR szType, LPCTSTR szName, LANGID wIDLanguage, LPARAM lParam); -#endif - - // implementation helpers - struct CounterInfo - { - CounterInfo() : m_dwCounterId(0), m_dwDetailLevel(0), m_nNameId(0), - m_nHelpId(0), m_dwCounterType(0), m_nDefaultScale(0), - m_nMaxCounterSize(0), m_nDataOffset(0) - { - ZeroMemory (&m_cache, sizeof(m_cache)); - } - // implementation - - DWORD m_dwCounterId; - CString m_strName; - CString m_strHelp; - DWORD m_dwDetailLevel; - - // the ids that correspond to the name and help strings stored in the registry - UINT m_nNameId; - UINT m_nHelpId; - - // counter data - - DWORD m_dwCounterType; - LONG m_nDefaultScale; - - // the maximum size of the string counter data in characters, including the null terminator - // ignored if not a string counter - ULONG m_nMaxCounterSize; - - ULONG m_nDataOffset; - - // cached data to be copied into request - PERF_COUNTER_DEFINITION m_cache; - }; - - struct CategoryInfo - { - // implementation - - DWORD m_dwCategoryId; - CString m_strName; - CString m_strHelp; - DWORD m_dwDetailLevel; - - // the ids that correspond to the name and help strings stored in the registry - UINT m_nNameId; - UINT m_nHelpId; - - // category data - - LONG m_nDefaultCounter; - LONG m_nInstanceLess; // PERF_NO_INSTANCES if instanceless - - // the size of the struct not counting the name and string counters - ULONG m_nStructSize; - - // in characters including the null terminator - ULONG m_nMaxInstanceNameLen; - - ULONG m_nAllocSize; - - // cached data to be copied into request - PERF_OBJECT_TYPE m_cache; - ULONG m_nCounterBlockSize; - - // counters - UINT _GetNumCounters() throw(); - CounterInfo* _GetCounterInfo(UINT nIndex) throw(); - - CAtlArray m_counters; - }; - - LPBYTE _AllocData(LPBYTE& pData, ULONG nBytesAvail, ULONG* pnBytesUsed, size_t nBytesNeeded) throw(); - template T* _AllocStruct(LPBYTE& pData, ULONG nBytesAvail, ULONG* pnBytesUsed, T*) throw() - { - return reinterpret_cast(_AllocData(pData, nBytesAvail, pnBytesUsed, sizeof(T))); - } - - UINT _GetNumCategoriesAndCounters() throw(); - CategoryInfo* _GetCategoryInfo(UINT nIndex) throw(); - UINT _GetNumCategories() throw(); - CPerfObject* _GetFirstInstance(CAtlFileMappingBase* pBlock) throw(); - CPerfObject* _GetNextInstance(CPerfObject* pInstance) throw(); - CAtlFileMappingBase* _GetNextBlock(CAtlFileMappingBase* pBlock) throw(); - CAtlFileMappingBase* _OpenNextBlock(CAtlFileMappingBase* pPrev) throw(); - CAtlFileMappingBase* _AllocNewBlock(CAtlFileMappingBase* pPrev, BOOL* pbExisted = NULL) throw(); - HRESULT _OpenAllBlocks() throw(); - DWORD& _GetBlockId(CAtlFileMappingBase* pBlock) throw(...); - DWORD* _GetBlockId_NoThrow(CAtlFileMappingBase* pBlock) throw(); - CategoryInfo* _FindCategoryInfo(DWORD dwCategoryId) throw(); - CounterInfo* _FindCounterInfo(CategoryInfo* pCategoryInfo, DWORD dwCounterId) throw(); - CounterInfo* _FindCounterInfo(DWORD dwCategoryId, DWORD dwCounterId) throw(); - BOOL _WantCategoryType(__in_z LPWSTR lpwszValue, __in DWORD dwPerfId) throw(...); - void _FillCategoryType(CategoryInfo* pCategoryInfo) throw(); - void _FillCounterDef(CounterInfo* pCounterInfo, ULONG* pnCounterBlockSize) throw(); - HRESULT CPerfMon::_CollectInstance( - CategoryInfo* pCategoryInfo, - LPBYTE& pData, - ULONG nBytesAvail, - ULONG* pnBytesUsed, - CPerfObject* pInstance, - PERF_OBJECT_TYPE* pObjectType, - PERF_COUNTER_DEFINITION* pCounterDefs - ) throw(); - HRESULT _CollectInstance( - CategoryInfo* pCategoryInfo, - LPBYTE& pData, - ULONG nBytesAvail, - ULONG* pnBytesUsed, - PERF_OBJECT_TYPE* pObjectType, - PERF_COUNTER_DEFINITION* pCounterDefs - ) throw(); - HRESULT _CollectCategoryType( - CategoryInfo* pCategoryInfo, - LPBYTE pData, - ULONG nBytesAvail, - ULONG* pnBytesUsed) throw(); - HRESULT _LoadMap(DWORD* pData) throw(); - HRESULT _SaveMap() throw(); - HRESULT _GetAttribute( - IXMLDOMNode *pNode, - LPCWSTR szAttrName, - BSTR *pbstrVal) throw(); - HRESULT CPerfMon::_CreateInstance( - DWORD dwCategoryId, - DWORD dwInstance, - LPCWSTR szInstanceName, - CPerfObject** ppInstance, - bool bByName) throw(); - -#ifdef _ATL_PERF_REGISTER - void _AppendStrings( - LPTSTR& pszNew, - CAtlArray& astrStrings, - ULONG iFirstIndex - ) throw(); - HRESULT _AppendRegStrings( - CRegKey& rkLang, - LPCTSTR szValue, - CAtlArray& astrStrings, - ULONG nNewStringSize, - ULONG iFirstIndex, - ULONG iLastIndex) throw(); - HRESULT _RemoveRegStrings( - CRegKey& rkLang, - LPCTSTR szValue, - ULONG iFirstIndex, - ULONG iLastIndex) throw(); - HRESULT _ReserveStringRange(DWORD& dwFirstCounter, DWORD& dwFirstHelp) throw(); - HRESULT _UnregisterStrings() throw(); - HRESULT _RegisterAllStrings(UINT nRes, HINSTANCE hResInstance) throw(); -#endif -private: - CAtlArray m_categories; - CAutoPtrArray m_aMem; - CMutex m_lock; - ULONG m_nAllocSize; - ULONG m_nHeaderSize; - ULONG m_nSchemaSize; - CSecurityDesc m_sd; -}; - -class CPerfLock -{ -public: - CPerfLock(CPerfMon* pPerfMon, DWORD dwTimeout = INFINITE) - { - ATLENSURE(pPerfMon != NULL); - m_pPerfMon = pPerfMon; - m_hrStatus = m_pPerfMon->LockPerf(dwTimeout); - } - - ~CPerfLock() throw() - { - if (SUCCEEDED(m_hrStatus)) - m_pPerfMon->UnlockPerf(); - } - - HRESULT GetStatus() const throw() - { - return m_hrStatus; - } - -private: - CPerfMon* m_pPerfMon; - HRESULT m_hrStatus; -}; - -//////////////////////////////////////////////////////////////////////// -// map macros - -// empty definition just for ease of use with code wizards, etc. -#define BEGIN_PERFREG_MAP() - -// empty definition just for ease of use with code wizards, etc. -#define END_PERFREG_MAP() - -#if !defined(_ATL_PERF_REGISTER) | defined(_ATL_PERF_NOEXPORT) -#define PERFREG_ENTRY(className) -#endif - -#ifdef _ATL_PERF_REGISTER -#define BEGIN_PERF_MAP(AppName) \ - private: \ - LPCTSTR GetAppName() const throw() { return AppName; } \ - HRESULT CreateMap(WORD wLanguage, HINSTANCE hResInstance, UINT* pSampleRes = NULL) throw() \ - { \ - if (pSampleRes) \ - *pSampleRes = 0; \ - ClearMap(); - -#define BEGIN_COUNTER_MAP(categoryclass) \ - public: \ - typedef categoryclass _PerfCounterClass; \ - static HRESULT CreateMap(CPerfMon* pPerf, WORD wLanguage, HINSTANCE hResInstance, UINT* pSampleRes) throw() \ - { \ - HRESULT hr = RegisterCategory(pPerf, wLanguage, hResInstance, pSampleRes); \ - if (FAILED(hr)) \ - return hr; - -#define DECLARE_PERF_CATEGORY_EX(dwCategoryId, namestring, helpstring, detail, instanceless, structsize, maxinstnamelen, defcounter) \ - static HRESULT RegisterCategory(CPerfMon* pPerf, WORD wLanguage, HINSTANCE hResInstance, UINT* pSampleRes) throw() \ - { \ - return pPerf->RegisterCategory(wLanguage, hResInstance, pSampleRes, dwCategoryId, namestring, helpstring, detail, instanceless, structsize, maxinstnamelen, defcounter); \ - } \ - /* NOTE: put a semicolon after your call to DECLARE_PERF_CATEGORY*(...) */ \ - /* this is needed for the code wizards to parse things properly */ \ - static const DWORD kCategoryId = dwCategoryId - -#define CHAIN_PERF_CATEGORY(categoryclass) \ - if (FAILED(categoryclass::CreateMap(this, wLanguage, hResInstance, pSampleRes))) \ - return E_FAIL; - -// CAssertValidField ensures that the member variable that's being passed to -// DEFINE_COUNTER[_EX] is the proper type. only 32-bit integral types can be used with -// PERF_SIZE_DWORD and only 64-bit integral types can be used with PERF_SIZE_LARGE -template< DWORD t_dwSize > -class CAssertValidField -{ -}; - -template<> -class CAssertValidField< PERF_SIZE_DWORD > -{ -public: - template< class C > static void AssertValidFieldType( ULONG C::* ) throw() { } - template< class C > static void AssertValidFieldType( LONG C::* ) throw() { } -}; - -template<> -class CAssertValidField< PERF_SIZE_LARGE > -{ -public: - template< class C > static void AssertValidFieldType( ULONGLONG C::* ) throw() { } - template< class C > static void AssertValidFieldType( LONGLONG C::* ) throw() { } -}; - -#define DEFINE_COUNTER_EX(member, dwCounterId, namestring, helpstring, detail, countertype, maxcountersize, defscale) \ - CAssertValidField< (countertype) & ATLPERF_SIZE_MASK >::AssertValidFieldType( &_PerfCounterClass::member ); \ - hr = pPerf->RegisterCounter(wLanguage, hResInstance, dwCounterId, namestring, helpstring, detail, countertype, maxcountersize, (ULONG) offsetof(_PerfCounterClass, member), defscale); \ - if (FAILED(hr)) \ - return hr; - -#define END_PERF_MAP() \ - return S_OK; \ - } - -#define END_COUNTER_MAP() \ - return S_OK; \ - } - -#else // _ATL_PERF_REGISTER - -#define BEGIN_PERF_MAP(AppName) \ - private: \ - LPCTSTR GetAppName() const throw() { return AppName; } - -#define BEGIN_COUNTER_MAP(objectclass) - -#define DECLARE_PERF_CATEGORY_EX(dwCategoryId, namestring, helpstring, detail, instanceless, structsize, maxinstnamelen, defcounter) \ - /* NOTE: put a semicolon after your call to DECLARE_PERF_CATEGORY*(...) */ \ - /* this is needed for the code wizards to parse things properly */ \ - static const DWORD kCategoryId = dwCategoryId - -#define CHAIN_PERF_CATEGORY(objectclass) -#define DEFINE_COUNTER_EX(member, dwCounterId, namestring, helpstring, detail, countertype, maxcountersize, defscale) - -#define END_PERF_MAP() -#define END_COUNTER_MAP() - -#endif // _ATL_PERF_REGISTER - -#define DECLARE_PERF_CATEGORY(objectclass, dwCategoryId, namestring, helpstring, defcounter) \ - DECLARE_PERF_CATEGORY_EX(dwCategoryId, namestring, helpstring, PERF_DETAIL_NOVICE, 0, sizeof(objectclass), ATLPERF_DEFAULT_MAXINSTNAMELENGTH, defcounter) -#define DECLARE_PERF_CATEGORY_NO_INSTANCES(objectclass, dwCategoryId, namestring, helpstring, defcounter) \ - DECLARE_PERF_CATEGORY_EX(dwCategoryId, namestring, helpstring, PERF_DETAIL_NOVICE, PERF_NO_INSTANCES, sizeof(objectclass), 0, defcounter) - -#define DEFINE_COUNTER(member, namestring, helpstring, countertype, defscale) \ - DEFINE_COUNTER_EX(member, 0, namestring, helpstring, PERF_DETAIL_NOVICE, countertype, 0, defscale) - -#pragma deprecated( DECLARE_PERF_OBJECT_EX ) -#pragma deprecated( DECLARE_PERF_OBJECT ) -#pragma deprecated( DECLARE_PERF_OBJECT_NO_INSTANCES ) -#pragma deprecated( CHAIN_PERF_OBJECT ) -#define DECLARE_PERF_OBJECT_EX DECLARE_PERF_CATEGORY_EX -#define DECLARE_PERF_OBJECT DECLARE_PERF_CATEGORY -#define DECLARE_PERF_OBJECT_NO_INSTANCES DECLARE_PERF_CATEGORY_NO_INSTANCES -#define CHAIN_PERF_OBJECT CHAIN_PERF_CATEGORY - -//////////////////////////////////////////////////////////////////////// -// automagic registration stuff - -#if defined(_ATL_PERF_REGISTER) & !defined(_ATL_PERF_NOEXPORT) - -// define _ATL_PERF_NOEXPORT if you don't want to use the PERFREG map and don't want these -// functions exported from your DLL - -// Perf register map stuff -// this is for ease of integration with the module attribute and for the -// perfmon wizard - -#pragma section("ATLP$A", read, shared) -#pragma section("ATLP$Z", read, shared) -#pragma section("ATLP$C", read, shared) -extern "C" -{ -__declspec(selectany) __declspec(allocate("ATLP$A")) CPerfMon * __pperfA = NULL; -__declspec(selectany) __declspec(allocate("ATLP$Z")) CPerfMon * __pperfZ = NULL; -} - -#if !defined(_M_IA64) -#pragma comment(linker, "/merge:ATLP=.rdata") -#endif - -#if defined(_M_IA64) || defined(_M_AMD64) - #define ATLPERF_FUNCID_OPEN "OpenPerfMon" - #define ATLPERF_FUNCID_COLLECT "CollectPerfMon" - #define ATLPERF_FUNCID_CLOSE "ClosePerfMon" -#elif defined(_M_IX86) - #define ATLPERF_FUNCID_OPEN "_OpenPerfMon@4" - #define ATLPERF_FUNCID_COLLECT "_CollectPerfMon@16" - #define ATLPERF_FUNCID_CLOSE "_ClosePerfMon@0" -#else -#if !defined(ATLPERF_FUNCID_OPEN) || !defined(ATLPERF_FUNCID_COLLECT) || !defined (ATLPERF_FUNCID_CLOSE) -#error "Unknown platform. Define ATLPERF_FUNCID_OPEN, ATLPERF_FUNCID_COLLECT, ATLPERF_FUNCID_CLOSE" -#endif -#endif - -HRESULT RegisterPerfMon(HINSTANCE hDllInstance = _AtlBaseModule.GetModuleInstance()) throw(); -HRESULT UnregisterPerfMon() throw(); - -extern "C" DWORD __declspec(dllexport) WINAPI OpenPerfMon(LPWSTR lpDeviceNames) throw(); -extern "C" DWORD __declspec(dllexport) WINAPI CollectPerfMon(LPWSTR lpwszValue, LPVOID* lppData, - LPDWORD lpcbBytes, LPDWORD lpcObjectTypes) throw(); -extern "C" DWORD __declspec(dllexport) WINAPI ClosePerfMon() throw(); - -// this class handles integrating the registration with CComModule -class _CAtlPerfSetFuncPtr -{ -public: - _CAtlPerfSetFuncPtr() - { - _pPerfRegFunc = RegisterPerfMon; - _pPerfUnRegFunc = UnregisterPerfMon; - } -}; - -extern "C" { __declspec(selectany) _CAtlPerfSetFuncPtr g_atlperfinit; } - -#if defined(_M_IX86) -#pragma comment(linker, "/INCLUDE:_g_atlperfinit") -#elif defined(_M_IA64) || defined(_M_AMD64) -#pragma comment(linker, "/INCLUDE:g_atlperfinit") -#else -#pragma message("Unknown platform. Make sure the linker includes g_atlperfinit") -#endif - -#ifndef PERF_ENTRY_PRAGMA - -#if defined(_M_IX86) -#define PERF_ENTRY_PRAGMA(class) __pragma(comment(linker, "/include:___pperf_" #class)); -#elif defined(_M_IA64) -#define PERF_ENTRY_PRAGMA(class) __pragma(comment(linker, "/include:__pperf_" #class)); -#elif defined(_M_AMD64) -#define PERF_ENTRY_PRAGMA(class) __pragma(comment(linker, "/include:__pperf_" #class)); -#else -#error Unknown Platform. define PERF_ENTRY_PRAGMA -#endif - -#endif // PERF_ENTRY_PRAGMA - -#define PERFREG_ENTRY(className) \ - __declspec(selectany) className __perf_##className; \ - extern "C" __declspec(allocate("ATLP$C")) __declspec(selectany) CPerfMon * const __pperf_##className = \ - static_cast(&__perf_##className); \ - PERF_ENTRY_PRAGMA(className) - -#endif // _ATL_PERF_NOEXPORT - -} // namespace ATL - - -#include - -#pragma pack(pop) -#pragma warning(pop) - -#endif // __ATLPERF_H__ diff --git a/include/atl/atlperf.inl b/include/atl/atlperf.inl deleted file mode 100644 index 398fd1b0a..000000000 --- a/include/atl/atlperf.inl +++ /dev/null @@ -1,2894 +0,0 @@ -// This is a part of the Active Template Library. -// Copyright (C) Microsoft Corporation -// All rights reserved. -// -// This source code is only intended as a supplement to the -// Active Template Library Reference and related -// electronic documentation provided with the library. -// See these sources for detailed information regarding the -// Active Template Library product. - -#ifndef __ATLPERF_INL__ -#define __ATLPERF_INL__ - -#pragma once - -#ifndef __ATLPERF_H__ - #error atlperf.inl requires atlperf.h to be included first -#endif - -#pragma warning(push) - -#ifndef _CPPUNWIND -#pragma warning(disable: 4702) // unreachable code -#endif - -namespace ATL -{ - -extern __declspec(selectany) const TCHAR * const c_szAtlPerfCounter = _T("Counter"); -extern __declspec(selectany) const TCHAR * const c_szAtlPerfFirstCounter = _T("First Counter"); -extern __declspec(selectany) const TCHAR * const c_szAtlPerfLastCounter = _T("Last Counter"); -extern __declspec(selectany) const TCHAR * const c_szAtlPerfHelp = _T("Help"); -extern __declspec(selectany) const TCHAR * const c_szAtlPerfFirstHelp = _T("First Help"); -extern __declspec(selectany) const TCHAR * const c_szAtlPerfLastHelp = _T("Last Help"); - -extern __declspec(selectany) const WCHAR * const c_szAtlPerfGlobal = L"Global"; -extern __declspec(selectany) const TCHAR * const c_szAtlPerfLibrary = _T("Library"); -extern __declspec(selectany) const TCHAR * const c_szAtlPerfOpen = _T("Open"); -extern __declspec(selectany) const TCHAR * const c_szAtlPerfCollect = _T("Collect"); -extern __declspec(selectany) const TCHAR * const c_szAtlPerfClose = _T("Close"); -extern __declspec(selectany) const TCHAR * const c_szAtlPerfLanguages = _T("Languages"); -extern __declspec(selectany) const TCHAR * const c_szAtlPerfMap = _T("Map"); -extern __declspec(selectany) const TCHAR * const c_szAtlPerfPerformance = _T("Performance"); -extern __declspec(selectany) const TCHAR * const c_szAtlPerfServicesKey = _T("SYSTEM\\CurrentControlSet\\Services\\%s"); -extern __declspec(selectany) const TCHAR * const c_szAtlPerfPerformanceKey = _T("SYSTEM\\CurrentControlSet\\Services\\%s\\Performance"); -extern __declspec(selectany) const TCHAR * const c_szAtlPerfPerfLibKey = _T("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Perflib"); -extern __declspec(selectany) const TCHAR * const c_szAtlPerfPerfLibLangKey = _T("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Perflib\\%3.3x"); - -inline CPerfMon::CounterInfo* CPerfMon::CategoryInfo::_GetCounterInfo(UINT nIndex) throw() -{ - ATLASSERT(nIndex < _GetNumCounters()); - return &m_counters[nIndex]; -} - -inline UINT CPerfMon::CategoryInfo::_GetNumCounters() throw() -{ - return (UINT) m_counters.GetCount(); -} - -inline CPerfMon::~CPerfMon() throw() -{ - UnInitialize(); -} - -inline HRESULT CPerfMon::CreateMap(LANGID language, HINSTANCE hResInstance, UINT* pSampleRes) throw() -{ - (language); // unused - (hResInstance); // unused - (pSampleRes); // unused - return S_OK; -} - -inline UINT CPerfMon::_GetNumCategoriesAndCounters() throw() -{ - UINT nResult = _GetNumCategories(); - for (UINT i=0; i<_GetNumCategories(); i++) - { - nResult += _GetCategoryInfo(i)->_GetNumCounters(); - } - - return nResult; -} - -inline CPerfMon::CategoryInfo* CPerfMon::_GetCategoryInfo(UINT nIndex) throw() -{ - ATLASSERT(nIndex < _GetNumCategories()); - return &m_categories[nIndex]; -} - -inline UINT CPerfMon::_GetNumCategories() throw() -{ - return (UINT) m_categories.GetCount(); -} - -inline CPerfObject* CPerfMon::_GetFirstInstance(CAtlFileMappingBase* pBlock) -{ - ATLENSURE(pBlock != NULL); - - // should never happen if Initialize succeeded - // are you checking return codes? - ATLASSERT(pBlock->GetData() != NULL); - - return reinterpret_cast(LPBYTE(pBlock->GetData()) + m_nHeaderSize); -} - -inline CPerfObject* CPerfMon::_GetNextInstance(CPerfObject* pInstance) -{ - ATLENSURE_RETURN_VAL(pInstance != NULL, NULL); - ATLENSURE_RETURN_VAL(pInstance->m_nAllocSize != (ULONG)-1, NULL); - ATLASSERT(pInstance->m_nAllocSize != (ULONG)0); - - return reinterpret_cast(LPBYTE(pInstance) + pInstance->m_nAllocSize); -} - -inline CAtlFileMappingBase* CPerfMon::_GetNextBlock(CAtlFileMappingBase* pBlock) throw() -{ - // calling _GetNextBlock(NULL) will return the first block - DWORD dwNextBlockIndex = 0; - DWORD* pDw= _GetBlockId_NoThrow(pBlock); - if (pDw) - { - dwNextBlockIndex = *pDw +1; - } - if (m_aMem.GetCount() == dwNextBlockIndex) - return NULL; - return m_aMem[dwNextBlockIndex]; -} - -inline CAtlFileMappingBase* CPerfMon::_OpenNextBlock(CAtlFileMappingBase* pPrev) throw() -{ - CAutoPtr spMem; - CAtlFileMappingBase* pMem = NULL; - ATLTRY(spMem.Attach(new CAtlFileMappingBase)); - if (spMem == NULL) - return NULL; - - // create a unique name for the shared mem segment based on the index - DWORD dwNextBlockIndex; - DWORD* pDw= _GetBlockId_NoThrow(pPrev); - if (pDw) - { - dwNextBlockIndex = *pDw +1; - } - else - { - // use the system allocation granularity (65536 currently. may be different in the future) - SYSTEM_INFO si; - GetSystemInfo(&si); - m_nAllocSize = si.dwAllocationGranularity; - - dwNextBlockIndex = 0; - } - - _ATLTRY - { - CString strName; - strName.Format(_T("Global\\ATLPERF_%s_%3.3d"), GetAppName(), dwNextBlockIndex); - - HRESULT hr = spMem->OpenMapping(strName, m_nAllocSize, 0, FILE_MAP_READ); - if (FAILED(hr)) - return NULL; - - pMem = spMem; - m_aMem.Add(spMem); - } - _ATLCATCHALL() - { - return NULL; - } - - return pMem; -} - -inline CAtlFileMappingBase* CPerfMon::_AllocNewBlock(CAtlFileMappingBase* pPrev, BOOL* pbExisted /* == NULL */) throw() -{ - CAtlFileMappingBase* pMem = NULL; - _ATLTRY - { - CSecurityAttributes sa; - sa.Set(m_sd); - - CAutoPtr spMem; - spMem.Attach(new CAtlFileMappingBase); - if (spMem == NULL) - { - return NULL; - } - - // create a unique name for the shared mem segment based on the index - DWORD dwNextBlockIndex; - if (pPrev != NULL) - { - dwNextBlockIndex = _GetBlockId(pPrev) +1; - } - else - { - // use the system allocation granularity (65536 currently. may be different in the future) - SYSTEM_INFO si; - GetSystemInfo(&si); - m_nAllocSize = si.dwAllocationGranularity; - - dwNextBlockIndex = 0; - } - - BOOL bExisted = FALSE; - CString strName; - strName.Format(_T("Global\\ATLPERF_%s_%3.3d"), GetAppName(), dwNextBlockIndex); - - HRESULT hr = spMem->MapSharedMem(m_nAllocSize, strName, &bExisted, &sa); - if (FAILED(hr)) - { - return NULL; - } - - if(!bExisted) - { - memset(spMem->GetData(), 0, m_nAllocSize); - // save the index of this block - // don't for first block since we don't know m_nSchemaSize yet - if (dwNextBlockIndex) - { - _GetBlockId(spMem) = dwNextBlockIndex; - } - } - else - { - CSid owner; - CDacl dacl; - - m_sd.GetOwner(&owner); - m_sd.GetDacl(&dacl); - - // prevent us from using an object someone else has opened - if (::SetSecurityInfo(spMem->GetHandle(), SE_KERNEL_OBJECT, - DACL_SECURITY_INFORMATION | OWNER_SECURITY_INFORMATION, - const_cast(owner.GetPSID()), - NULL, - const_cast(dacl.GetPACL()), - NULL) != ERROR_SUCCESS) - { - return NULL; - } - } - - if (pbExisted) - { - *pbExisted = bExisted; - } - - pMem = spMem; - m_aMem.Add(spMem); - - OnBlockAlloc(pMem); - } - _ATLCATCHALL() - { - return NULL; - } - - return pMem; -} - -inline HRESULT CPerfMon::_OpenAllBlocks() throw() -{ - HRESULT hr; - - // if we haven't opened any yet, initialize - if (m_aMem.GetCount() == 0) - { - CAtlFileMappingBase* pMem = _OpenNextBlock(NULL); - if (pMem == NULL) - return S_OK; - - hr = _LoadMap(LPDWORD(pMem->GetData())); - if (FAILED(hr)) - { - m_aMem.RemoveAll(); - return hr; - } - - m_nSchemaSize = *LPDWORD(pMem->GetData()); - m_nHeaderSize = m_nSchemaSize + sizeof(DWORD); - m_nHeaderSize = AtlAlignUp(m_nHeaderSize,16); - } - - // open any new blocks - CAtlFileMappingBase* pMem = m_aMem[m_aMem.GetCount()-1]; - while (pMem) - pMem = _OpenNextBlock(pMem); - - return S_OK; -} - -inline HRESULT CPerfMon::_LoadMap(DWORD* pData) throw() -{ - _ATLTRY - { - HRESULT hr; - - ClearMap(); - - DWORD dwDataSize = *pData++; // blob size - DWORD dwNumItems = *pData++; // number of items - - // see if we have name data - DWORD* pNameData = NULL; - if (dwDataSize > (2+dwNumItems*9) * sizeof(DWORD)) - pNameData = pData + dwNumItems*9; // blob size and item count already skipped. skip item data - - for (DWORD i=0; im_nNameId = dwNameId; - pCategoryInfo->m_nHelpId = dwHelpId; - } - else - { - DWORD dwCounterType = *pData++; - DWORD dwMaxCounterSize = *pData++; - DWORD dwDataOffset = *pData++; - DWORD dwDefaultScale = *pData++; - - hr = AddCounterDefinition( - dwPerfId, - strName, - NULL, - dwDetailLevel, - dwCounterType, - dwMaxCounterSize, - dwDataOffset, - dwDefaultScale); - if (FAILED(hr)) - { - ClearMap(); - return hr; - } - - DWORD dwNameId = *pData++; - DWORD dwHelpId = *pData++; - CategoryInfo* pCategoryInfo = _GetCategoryInfo(_GetNumCategories()-1); - CounterInfo* pCounterInfo = pCategoryInfo->_GetCounterInfo(pCategoryInfo->_GetNumCounters()-1); - pCounterInfo->m_nNameId = dwNameId; - pCounterInfo->m_nHelpId = dwHelpId; - } - } - - // fill in cache data - ULONG* pnCounterBlockSize = NULL; // pointer to the object's counter block size - for (DWORD i=0; i<_GetNumCategories(); i++) - { - CategoryInfo* pCategoryInfo = _GetCategoryInfo(i); - // align at 8 bytes per Q262335 - pCategoryInfo->m_nCounterBlockSize = (ULONG) AtlAlignUp(sizeof(PERF_COUNTER_BLOCK), 8); - pnCounterBlockSize = &pCategoryInfo->m_nCounterBlockSize; - _FillCategoryType(pCategoryInfo); - for (DWORD j=0; j_GetNumCounters(); j++) - { - CounterInfo* pCounterInfo = pCategoryInfo->_GetCounterInfo(j); - _FillCounterDef(pCounterInfo, pnCounterBlockSize); - } - // align at 8 bytes per Q262335 - pCategoryInfo->m_nCounterBlockSize = (ULONG) AtlAlignUp(pCategoryInfo->m_nCounterBlockSize, 8); - } - - return S_OK; - } - _ATLCATCHALL() - { - return E_OUTOFMEMORY; - } -} - -inline HRESULT CPerfMon::_SaveMap() throw() -{ - _ATLTRY - { - // figure out how much memory we need - size_t nSize = (2 + 9*_GetNumCategoriesAndCounters()) * sizeof(DWORD); - for (UINT i=0; i<_GetNumCategories(); i++) - { - // if any of the entries have names, they'd better all have names - CategoryInfo* pCategoryInfo = _GetCategoryInfo(i); - if (!pCategoryInfo->m_strName.IsEmpty()) - { - nSize += sizeof(DWORD) + AtlAlignUp(sizeof(WCHAR) * pCategoryInfo->m_strName.GetLength(), sizeof(DWORD)); - for (UINT j=0; j_GetNumCounters(); j++) - { - CounterInfo* pCounterInfo = pCategoryInfo->_GetCounterInfo(j); - nSize += sizeof(DWORD) + AtlAlignUp(sizeof(WCHAR) * pCounterInfo->m_strName.GetLength(), sizeof(DWORD)); - } - } - } - - CHeapPtr blob; - if (!blob.Allocate(nSize)) - return E_OUTOFMEMORY; - - // start with blob size and number of items in the blob - DWORD* pCurrent = reinterpret_cast(blob.m_pData); - memset(pCurrent, 0, nSize); - *pCurrent++ = (DWORD) nSize; // blob size - *pCurrent++ = _GetNumCategoriesAndCounters(); // number of items - size_t nSizeLast = nSize; - nSize -= 2 * sizeof(DWORD); - if(nSize > nSizeLast) return E_FAIL; - - for (UINT i=0; i<_GetNumCategories(); i++) - { - // add all the relevant runtime info to the blob for each item - CategoryInfo* pCategoryInfo = _GetCategoryInfo(i); - - *pCurrent++ = TRUE; // is object - *pCurrent++ = pCategoryInfo->m_dwCategoryId; - *pCurrent++ = pCategoryInfo->m_dwDetailLevel; - *pCurrent++ = pCategoryInfo->m_nDefaultCounter; - *pCurrent++ = pCategoryInfo->m_nInstanceLess; - *pCurrent++ = pCategoryInfo->m_nStructSize; - *pCurrent++ = pCategoryInfo->m_nMaxInstanceNameLen; - *pCurrent++ = pCategoryInfo->m_nNameId; - *pCurrent++ = pCategoryInfo->m_nHelpId; - nSizeLast = nSize; - nSize -= 9 * sizeof(DWORD); - if(nSize > nSizeLast) return E_FAIL; - - for (UINT j=0; j_GetNumCounters(); j++) - { - CounterInfo* pCounterInfo = pCategoryInfo->_GetCounterInfo(j); - - *pCurrent++ = FALSE; // is object - *pCurrent++ = pCounterInfo->m_dwCounterId; - *pCurrent++ = pCounterInfo->m_dwDetailLevel; - *pCurrent++ = pCounterInfo->m_dwCounterType; - *pCurrent++ = pCounterInfo->m_nMaxCounterSize; - *pCurrent++ = pCounterInfo->m_nDataOffset; - *pCurrent++ = pCounterInfo->m_nDefaultScale; - *pCurrent++ = pCounterInfo->m_nNameId; - *pCurrent++ = pCounterInfo->m_nHelpId; - nSizeLast = nSize; - nSize -= 9 * sizeof(DWORD); - if(nSize > nSizeLast) return E_FAIL; - } - } - - // add names to the blob - for (UINT i=0; i<_GetNumCategories(); i++) - { - CategoryInfo* pCategoryInfo = _GetCategoryInfo(i); - // copy the len of the string (in characters) then the wide-char version of the string - // pad the string to a dword boundary - int nLen = pCategoryInfo->m_strName.GetLength(); - *pCurrent++ = nLen; - nSizeLast = nSize; - nSize -= sizeof(DWORD); - if(nSize > nSizeLast) return E_FAIL; - - Checked::memcpy_s(pCurrent, nSize, CT2CW(pCategoryInfo->m_strName), sizeof(WCHAR)*nLen); - pCurrent += AtlAlignUp(sizeof(WCHAR) * nLen, sizeof(DWORD))/sizeof(DWORD); - nSizeLast = nSize; - nSize -= sizeof(WCHAR)*nLen; - if(nSize > nSizeLast) return E_FAIL; - - for (UINT j=0; j_GetNumCounters(); j++) - { - CounterInfo* pCounterInfo = pCategoryInfo->_GetCounterInfo(j); - // copy the len of the string (in characters) then the wide-char version of the string - // pad the string to a dword boundary - int nCounterLen = pCounterInfo->m_strName.GetLength(); - *pCurrent++ = nCounterLen; - nSizeLast = nSize; - nSize -= sizeof(DWORD); - if(nSize > nSizeLast) return E_FAIL; - - Checked::memcpy_s(pCurrent, nSize, CT2CW(pCounterInfo->m_strName), sizeof(WCHAR)*nCounterLen); - pCurrent += AtlAlignUp(sizeof(WCHAR) * nCounterLen, sizeof(DWORD))/sizeof(DWORD); - nSizeLast = nSize; - nSize -= sizeof(WCHAR)*nCounterLen; - if(nSize > nSizeLast) return E_FAIL; - } - } - - CRegKey rkApp; - CString str; - DWORD dwErr; - - str.Format(c_szAtlPerfPerformanceKey, GetAppName()); - dwErr = rkApp.Open(HKEY_LOCAL_MACHINE, str); - if (dwErr != ERROR_SUCCESS) - return AtlHresultFromWin32(dwErr); - - rkApp.SetBinaryValue(c_szAtlPerfMap, blob, *LPDWORD(blob.m_pData)); - - return S_OK; - } - _ATLCATCHALL() - { - return E_OUTOFMEMORY; - } -} - -inline CPerfMon::CategoryInfo* CPerfMon::_FindCategoryInfo(DWORD dwCategoryId) throw() -{ - for (UINT i=0; i<_GetNumCategories(); i++) - { - CategoryInfo* pCategoryInfo = _GetCategoryInfo(i); - if (pCategoryInfo->m_dwCategoryId == dwCategoryId) - return pCategoryInfo; - } - - return NULL; -} - -inline CPerfMon::CounterInfo* CPerfMon::_FindCounterInfo(CategoryInfo* pCategoryInfo, DWORD dwCounterId) -{ - ATLENSURE_RETURN_VAL(pCategoryInfo != NULL, NULL); - - for (DWORD i=0; i_GetNumCounters(); i++) - { - CounterInfo* pCounter = pCategoryInfo->_GetCounterInfo(i); - if (pCounter->m_dwCounterId == dwCounterId) - return pCounter; - } - - return NULL; -} - -inline CPerfMon::CounterInfo* CPerfMon::_FindCounterInfo(DWORD dwCategoryId, DWORD dwCounterId) throw() -{ - CategoryInfo* pCategoryInfo = _FindCategoryInfo(dwCategoryId); - if (pCategoryInfo != NULL) - return _FindCounterInfo(pCategoryInfo, dwCounterId); - - return NULL; -} - -inline BOOL CPerfMon::_WantCategoryType(__in_z LPWSTR szValue, __in DWORD dwCategoryId) throw(...) -{ - ATLASSERT(szValue != NULL); - - if (lstrcmpiW(c_szAtlPerfGlobal, szValue) == 0) - return TRUE; - - CString strList(szValue); - int nStart = 0; - - CString strNum = strList.Tokenize(_T(" "), nStart); - while (!strNum.IsEmpty()) - { - if (_ttoi(strNum) == int(dwCategoryId)) - return TRUE; - - strNum = strList.Tokenize(_T(" "), nStart); - } - - return FALSE; -} - -inline LPBYTE CPerfMon::_AllocData(LPBYTE& pData, ULONG nBytesAvail, ULONG* pnBytesUsed, size_t nBytesNeeded) -{ - ATLENSURE_RETURN_VAL(pnBytesUsed != NULL, NULL); - ULONG newSize = *pnBytesUsed+static_cast(nBytesNeeded); - - if ((newSize < *pnBytesUsed) || (newSize < (ULONG) nBytesNeeded) || (nBytesAvail < newSize)) - return NULL; - - LPBYTE p = pData; - pData += nBytesNeeded; - *pnBytesUsed += (ULONG) nBytesNeeded; - - return p; -} - -inline DWORD& CPerfMon::_GetBlockId(CAtlFileMappingBase* pBlock) -{ - DWORD* pDw = _GetBlockId_NoThrow(pBlock); - ATLENSURE(pDw); - return *pDw; -} - -inline DWORD* CPerfMon::_GetBlockId_NoThrow(CAtlFileMappingBase* pBlock) -{ - if (pBlock == NULL) - return NULL; - - return LPDWORD(LPBYTE(pBlock->GetData()) + m_nSchemaSize); -} - -inline void CPerfMon::_FillCategoryType(CategoryInfo* pCategoryInfo) throw() -{ - PERF_OBJECT_TYPE& type = pCategoryInfo->m_cache; - type.DefinitionLength = sizeof(PERF_OBJECT_TYPE) + sizeof(PERF_COUNTER_DEFINITION) * pCategoryInfo->_GetNumCounters(); - type.TotalByteLength = type.DefinitionLength; // we will add the instance definitions/counter blocks as we go - type.HeaderLength = sizeof(PERF_OBJECT_TYPE); - type.ObjectNameTitleIndex = pCategoryInfo->m_nNameId; - type.ObjectNameTitle = NULL; - type.ObjectHelpTitleIndex = pCategoryInfo->m_nHelpId; - type.ObjectHelpTitle = NULL; - type.DetailLevel = pCategoryInfo->m_dwDetailLevel; - type.NumCounters = pCategoryInfo->_GetNumCounters(); - type.DefaultCounter = pCategoryInfo->m_nDefaultCounter; - if (pCategoryInfo->m_nInstanceLess == PERF_NO_INSTANCES) - type.NumInstances = PERF_NO_INSTANCES; - else - type.NumInstances = 0; // this will be calculated as objects are processed - type.CodePage = 0; - type.PerfTime.QuadPart = 0; - QueryPerformanceFrequency (&(type.PerfFreq)); -} - -inline void CPerfMon::_FillCounterDef(CounterInfo* pCounterInfo, ULONG* pnCounterBlockSize) throw() -{ - PERF_COUNTER_DEFINITION& def = pCounterInfo->m_cache; - - def.ByteLength = sizeof(PERF_COUNTER_DEFINITION); - def.CounterNameTitleIndex = pCounterInfo->m_nNameId; - def.CounterNameTitle = NULL; - def.CounterHelpTitleIndex = pCounterInfo->m_nHelpId; - def.CounterHelpTitle = NULL; - def.DefaultScale = pCounterInfo->m_nDefaultScale; - def.DetailLevel = pCounterInfo->m_dwDetailLevel; - def.CounterType = pCounterInfo->m_dwCounterType; - DWORD dwAlignOfCounter=0; - switch (pCounterInfo->m_dwCounterType & ATLPERF_SIZE_MASK) - { - case PERF_SIZE_DWORD: - def.CounterSize = sizeof(DWORD); - dwAlignOfCounter = sizeof(DWORD); - break; - case PERF_SIZE_LARGE: - def.CounterSize = sizeof(__int64); - dwAlignOfCounter = sizeof(__int64); - break; - case PERF_SIZE_ZERO: - def.CounterSize = 0; - dwAlignOfCounter = 0; - break; - case PERF_SIZE_VARIABLE_LEN: - ATLASSERT((pCounterInfo->m_dwCounterType & ATLPERF_TYPE_MASK) == PERF_TYPE_TEXT); - if ((pCounterInfo->m_dwCounterType & ATLPERF_TEXT_MASK) == PERF_TEXT_UNICODE) - { - def.CounterSize = (DWORD) AtlAlignUp(pCounterInfo->m_nMaxCounterSize * sizeof(WCHAR), sizeof(DWORD)); - } - else - { - def.CounterSize = (DWORD) AtlAlignUp(pCounterInfo->m_nMaxCounterSize * sizeof(char), sizeof(DWORD)); - } - break; - } - *pnCounterBlockSize = AtlAlignUp(*pnCounterBlockSize, dwAlignOfCounter); - def.CounterOffset = *pnCounterBlockSize; - *pnCounterBlockSize += def.CounterSize; -} - -inline HRESULT CPerfMon::_CollectInstance( - CategoryInfo* pCategoryInfo, - LPBYTE& pData, - ULONG nBytesAvail, - ULONG* pnBytesUsed, - CPerfObject* _pInstance, - PERF_OBJECT_TYPE* pObjectType, - PERF_COUNTER_DEFINITION* pCounterDefs - ) throw() -{ - DWORD dwInstance = _pInstance->m_dwInstance; - - // grab a snapshot of the object - USES_ATL_SAFE_ALLOCA; - CPerfObject* pInstance = (CPerfObject*) _ATL_SAFE_ALLOCA(_pInstance->m_nAllocSize, _ATL_SAFE_ALLOCA_DEF_THRESHOLD); - if (pInstance == NULL) - { - return E_OUTOFMEMORY; - } - Checked::memcpy_s(pInstance, _pInstance->m_nAllocSize, _pInstance, _pInstance->m_nAllocSize); - - // if it was changed or deleted between when we first saw it and when we copied - // it, then forget about whatever happens to be there for this collection period - if (pInstance->m_dwCategoryId != pCategoryInfo->m_dwCategoryId || - dwInstance != pInstance->m_dwInstance || - pInstance->m_nRefCount == 0) - return S_OK; - - // we have a copy of something that claims to be the object type we're expecting - // put it into the data blob - PERF_INSTANCE_DEFINITION* pInstanceDef = NULL; - - if (pCategoryInfo->m_nInstanceLess == PERF_NO_INSTANCES) - pObjectType->NumInstances = PERF_NO_INSTANCES; - else - { - pObjectType->NumInstances++; - - // create an instance definition - pInstanceDef = _AllocStruct(pData, nBytesAvail, pnBytesUsed, (PERF_INSTANCE_DEFINITION*) NULL); - if (pInstanceDef == NULL) - return E_OUTOFMEMORY; - - pInstanceDef->ParentObjectTitleIndex = 0; - pInstanceDef->ParentObjectInstance = 0; - pInstanceDef->UniqueID = PERF_NO_UNIQUE_ID; - - // handle the instance name - LPCWSTR szInstNameSrc = LPCWSTR(LPBYTE(pInstance)+pInstance->m_nInstanceNameOffset); - pInstanceDef->NameLength = (ULONG)(wcslen(szInstNameSrc)+1)*sizeof(WCHAR); - // align at 8 bytes per Q262335 - ULONG nNameAlloc = (ULONG) AtlAlignUp(pInstanceDef->NameLength, 8); - LPWSTR szInstNameDest = (LPWSTR) _AllocData(pData, nBytesAvail, pnBytesUsed, nNameAlloc); - if (szInstNameDest == NULL) - return E_OUTOFMEMORY; - - Checked::memcpy_s(szInstNameDest, nNameAlloc, szInstNameSrc, pInstanceDef->NameLength); - pInstanceDef->NameOffset = ULONG(LPBYTE(szInstNameDest) - LPBYTE(pInstanceDef)); - - pInstanceDef->ByteLength = DWORD(sizeof(PERF_INSTANCE_DEFINITION) + nNameAlloc); - } - - // create the counter block + data - LPBYTE pCounterData = _AllocData(pData, nBytesAvail, pnBytesUsed, pCategoryInfo->m_nCounterBlockSize); - if (pCounterData == NULL) - return E_OUTOFMEMORY; - - // fill in the counter block header for the data - PERF_COUNTER_BLOCK* pCounterBlock = (PERF_COUNTER_BLOCK*) pCounterData; - pCounterBlock->ByteLength = pCategoryInfo->m_nCounterBlockSize; - - // fill in the data - for (ULONG i=0; iNumCounters; i++) - { - CounterInfo* pCounterInfo = pCategoryInfo->_GetCounterInfo(i); - PERF_COUNTER_DEFINITION& def = pCounterDefs[i]; - LPBYTE pSrc = LPBYTE(pInstance)+pCounterInfo->m_nDataOffset; - LPBYTE pDest = pCounterData+def.CounterOffset; - switch (pCounterInfo->m_dwCounterType & ATLPERF_SIZE_MASK) - { - case PERF_SIZE_DWORD: - *LPDWORD(pDest) = *LPDWORD(pSrc); - break; - case PERF_SIZE_LARGE: - *(ULONGLONG*)(pDest) = *(ULONGLONG*)(pSrc); - break; - case PERF_SIZE_VARIABLE_LEN: - if ((pCounterInfo->m_dwCounterType & ATLPERF_TEXT_MASK) == PERF_TEXT_UNICODE) - { - LPCWSTR szSrc = reinterpret_cast(pSrc); - LPWSTR szDest = reinterpret_cast(pDest); - size_t nLen = __min(wcslen(szSrc), pCounterInfo->m_nMaxCounterSize-1); - Checked::wcsncpy_s(szDest, pCounterInfo->m_nMaxCounterSize-1, szSrc, nLen); - szDest[nLen] = 0; - } - else - { - LPCSTR szSrc = reinterpret_cast(pSrc); - LPSTR szDest = reinterpret_cast(pDest); - size_t nLen = __min(strlen(szSrc), pCounterInfo->m_nMaxCounterSize-1); - Checked::strncpy_s(szDest, pCounterInfo->m_nMaxCounterSize-1, szSrc, nLen); - szDest[nLen] = 0; - } - break; - } - } - - if (pInstanceDef != NULL) - pObjectType->TotalByteLength += pInstanceDef->ByteLength; - pObjectType->TotalByteLength += pCounterBlock->ByteLength; - - return S_OK; -} - -inline HRESULT CPerfMon::_CollectInstance( - CategoryInfo* pCategoryInfo, - LPBYTE& pData, - ULONG nBytesAvail, - ULONG* pnBytesUsed, - PERF_OBJECT_TYPE* pObjectType, - PERF_COUNTER_DEFINITION* pCounterDefs - ) throw() -{ - // specialization to collect an instanceless object with no instance data - ATLASSERT(pCategoryInfo->m_nInstanceLess == PERF_NO_INSTANCES); - pObjectType->NumInstances = PERF_NO_INSTANCES; - - // create the counter block + data - LPBYTE pCounterData = _AllocData(pData, nBytesAvail, pnBytesUsed, pCategoryInfo->m_nCounterBlockSize); - if (pCounterData == NULL) - return E_OUTOFMEMORY; - - // fill in the counter block header for the data - PERF_COUNTER_BLOCK* pCounterBlock = (PERF_COUNTER_BLOCK*) pCounterData; - pCounterBlock->ByteLength = pCategoryInfo->m_nCounterBlockSize; - - // fill in the data - for (ULONG i=0; iNumCounters; i++) - { - CounterInfo* pCounterInfo = pCategoryInfo->_GetCounterInfo(i); - PERF_COUNTER_DEFINITION& def = pCounterDefs[i]; - LPBYTE pDest = pCounterData+def.CounterOffset; - switch (pCounterInfo->m_dwCounterType & ATLPERF_SIZE_MASK) - { - case PERF_SIZE_DWORD: - *LPDWORD(pDest) = 0; - break; - case PERF_SIZE_LARGE: - *PULONGLONG(pDest) = 0; - break; - case PERF_SIZE_VARIABLE_LEN: - if ((pCounterInfo->m_dwCounterType & ATLPERF_TEXT_MASK) == PERF_TEXT_UNICODE) - memset(pDest, 0, pCounterInfo->m_nMaxCounterSize*sizeof(WCHAR)); - else - memset(pDest, 0, pCounterInfo->m_nMaxCounterSize*sizeof(CHAR)); - break; - } - } - - pObjectType->TotalByteLength += pCounterBlock->ByteLength; - - return S_OK; -} - -inline HRESULT CPerfMon::_CollectCategoryType( - CategoryInfo* pCategoryInfo, - LPBYTE pData, - ULONG nBytesAvail, - ULONG* pnBytesUsed - ) throw() -{ - ATLENSURE_RETURN(pCategoryInfo != NULL); - ATLASSERT(pnBytesUsed != NULL); - - // write the object definition out - PERF_OBJECT_TYPE* pObjectType = _AllocStruct(pData, nBytesAvail, pnBytesUsed, (PERF_OBJECT_TYPE*) NULL); - if (pObjectType == NULL) - return E_OUTOFMEMORY; - - Checked::memcpy_s(pObjectType, sizeof(PERF_OBJECT_TYPE), &pCategoryInfo->m_cache, sizeof(PERF_OBJECT_TYPE)); - - // save a pointer to the first counter entry and counter definition. - // we'll need them when we create the PERF_COUNTER_BLOCK data - PERF_COUNTER_DEFINITION* pCounterDefs = reinterpret_cast(pData); - - // write the counter definitions out - for (DWORD i=0; i_GetNumCounters(); i++) - { - CounterInfo* pCounterInfo = pCategoryInfo->_GetCounterInfo(i); - - PERF_COUNTER_DEFINITION* pCounterDef = _AllocStruct(pData, nBytesAvail, pnBytesUsed, (PERF_COUNTER_DEFINITION*) NULL); - if (pCounterDef == NULL) - return E_OUTOFMEMORY; - - Checked::memcpy_s(pCounterDef, sizeof(PERF_COUNTER_DEFINITION), &pCounterInfo->m_cache, sizeof(PERF_COUNTER_DEFINITION)); - - // set PerfTime and PerfFreq for PERF_ELAPSED_TIME counter. - if(pCounterDef->CounterType == PERF_ELAPSED_TIME) - { - LARGE_INTEGER currTime; - if (FALSE != QueryPerformanceCounter(&currTime)) - pObjectType->PerfTime = currTime; - else - pObjectType->PerfTime.QuadPart = 0; - QueryPerformanceFrequency (&(pObjectType->PerfFreq)); - } - } - - // search for objects of the appropriate type and write out their instance/counter data - bool bGotInstance = false; - - CAtlFileMappingBase* pCurrentBlock = _GetNextBlock(NULL); - if (pCurrentBlock != NULL) - { - CPerfObject* pInstance = _GetFirstInstance(pCurrentBlock); - while (pInstance && pInstance->m_nAllocSize != 0) - { - if (pInstance->m_dwCategoryId == pCategoryInfo->m_dwCategoryId) - { - bGotInstance = true; - HRESULT hr = _CollectInstance(pCategoryInfo, pData, nBytesAvail, - pnBytesUsed, pInstance, pObjectType, pCounterDefs); - if (FAILED(hr)) - return hr; - } - - pInstance = _GetNextInstance(pInstance); - ATLENSURE_RETURN(pInstance!= NULL); - - if (pInstance->m_nAllocSize == (ULONG) -1) - { - pCurrentBlock = _GetNextBlock(pCurrentBlock); - if (pCurrentBlock == NULL) - pInstance = NULL; - else - pInstance = _GetFirstInstance(pCurrentBlock); - } - } - } - - if (pCategoryInfo->m_nInstanceLess == PERF_NO_INSTANCES && !bGotInstance) - { - // we have an instanceless (singleton) object with no data. send zeroed data - HRESULT hr = _CollectInstance(pCategoryInfo, pData, nBytesAvail, - pnBytesUsed, pObjectType, pCounterDefs); - if (FAILED(hr)) - return hr; - } - - return S_OK; -} - -inline DWORD CPerfMon::Open(LPWSTR szDeviceNames) throw() -{ - (szDeviceNames); // unused - - return 0; -} - -inline DWORD CPerfMon::Collect( - __in_z LPWSTR szValue, - __deref_inout_bcount(*pcbBytes) LPVOID* ppData, - __inout LPDWORD pcbBytes, - __inout LPDWORD pcObjectTypes - ) throw() -{ - - - - - - _ATLTRY - { - if (FAILED(_OpenAllBlocks())) - { - *pcbBytes = 0; - *pcObjectTypes = 0; - return ERROR_SUCCESS; - } - - LPBYTE pData = LPBYTE(*ppData); - ULONG nBytesLeft = *pcbBytes; - *pcbBytes = 0; - - if (_GetNumCategories() == 0) - { - // nothing is providing data. we need to load the map directly - // from the registry in order to provide category/counter data - CRegKey rkApp; - DWORD dwErr; - CString strAppKey; - - strAppKey.Format(c_szAtlPerfPerformanceKey, GetAppName()); - - dwErr = rkApp.Open(HKEY_LOCAL_MACHINE, strAppKey, KEY_READ); - if (dwErr != ERROR_SUCCESS) - { - *pcbBytes = 0; - *pcObjectTypes = 0; - return ERROR_SUCCESS; - } - - ULONG nBytes = 0; - dwErr = rkApp.QueryBinaryValue(c_szAtlPerfMap, NULL, &nBytes); - if (dwErr != ERROR_SUCCESS) - { - *pcbBytes = 0; - *pcObjectTypes = 0; - return ERROR_SUCCESS; - } - - CHeapPtr buf; - if (!buf.Allocate((nBytes+3)/4)) - { - *pcbBytes = 0; - *pcObjectTypes = 0; - return ERROR_SUCCESS; - } - - dwErr = rkApp.QueryBinaryValue(c_szAtlPerfMap, buf, &nBytes); - if (dwErr != ERROR_SUCCESS) - { - *pcbBytes = 0; - *pcObjectTypes = 0; - return ERROR_SUCCESS; - } - - if (FAILED(_LoadMap(buf))) - { - *pcbBytes = 0; - *pcObjectTypes = 0; - return ERROR_SUCCESS; - } - } - - for (UINT i=0; i<_GetNumCategories(); i++) - { - CategoryInfo* pCategoryInfo = _GetCategoryInfo(i); - if (_WantCategoryType(szValue, pCategoryInfo->m_nNameId)) - { - ULONG nBytesUsed = 0; - HRESULT hr = _CollectCategoryType(pCategoryInfo, pData, nBytesLeft, &nBytesUsed); - if (hr == E_OUTOFMEMORY) - { - *pcbBytes = 0; - *pcObjectTypes = 0; - return ERROR_MORE_DATA; - } - else if (FAILED(hr)) - { - *pcbBytes = 0; - *pcObjectTypes = 0; - return ERROR_SUCCESS; - } - - (*pcObjectTypes)++; - (*pcbBytes) += nBytesUsed; - nBytesLeft -= nBytesUsed; - pData += nBytesUsed; - } - } - - *ppData = pData; - return ERROR_SUCCESS; - } - _ATLCATCHALL() - { - *pcbBytes = 0; - *pcObjectTypes = 0; - return ERROR_SUCCESS; - } -} - -inline DWORD CPerfMon::Close() throw() -{ - UnInitialize(); - return ERROR_SUCCESS; -} - -#ifdef _ATL_PERF_REGISTER -#pragma warning (push) -#pragma warning(disable : 4996) - -inline void CPerfMon::_AppendStrings( - LPTSTR& pszNew, - CAtlArray& astrStrings, - ULONG iFirstIndex - ) throw() -{ - for (UINT iString = 0; iString < astrStrings.GetCount(); iString++) - { - INT nFormatChars = _stprintf(pszNew, _T("%d"), iFirstIndex+2*iString); - pszNew += nFormatChars + 1; - _tcscpy(pszNew, astrStrings[iString]); - pszNew += astrStrings[iString].GetLength() + 1; - } -} - -#pragma warning (pop) - -inline HRESULT CPerfMon::_AppendRegStrings( - CRegKey& rkLang, - LPCTSTR szValue, - CAtlArray& astrStrings, - ULONG nNewStringSize, - ULONG iFirstIndex, - ULONG iLastIndex - ) throw() -{ - _ATLTRY - { - // load the existing strings, add the new data, and resave the strings - ULONG nCharsOrig = 0; - ULONG nCharsNew; - DWORD dwErr; - - dwErr = rkLang.QueryMultiStringValue(szValue, NULL, &nCharsOrig); - if (dwErr != ERROR_SUCCESS) - return AtlHresultFromWin32(dwErr); - - nCharsNew = nCharsOrig + nNewStringSize; - - CString strOrig; - dwErr = rkLang.QueryMultiStringValue(szValue, CStrBuf(strOrig, nCharsOrig, CStrBuf::SET_LENGTH), &nCharsOrig); - if (dwErr != ERROR_SUCCESS) - return AtlHresultFromWin32(dwErr); - LPCTSTR pszOrig = strOrig; - - CString strNew; - CStrBuf szNew(strNew, nCharsNew, CStrBuf::SET_LENGTH); - LPTSTR pszNew = szNew; - - bool bNewStringsAdded = false; - - while (*pszOrig != '\0') - { - ULONG iIndex = _ttoi(pszOrig); - int nLen = (int) _tcslen(pszOrig) + 1; // get the length of the index and null - nLen += (int) _tcslen(pszOrig+nLen) + 1; // add the length of the description and null - - if (!bNewStringsAdded && iIndex >= iFirstIndex) - { - LPTSTR pszOld =pszNew; - _AppendStrings(pszNew, astrStrings, iFirstIndex); - bNewStringsAdded = true; - ULONG nCharsNewLast = nCharsNew; - nCharsNew -= ULONG(pszNew-pszOld); - if(nCharsNew > nCharsNewLast) - { - return E_FAIL; - } - } - - if (iIndex < iFirstIndex || iIndex > iLastIndex) - { - Checked::memmove_s(pszNew, nCharsNew, pszOrig, nLen*sizeof(TCHAR)); - pszNew += nLen; - } - pszOrig += nLen; - } - if (!bNewStringsAdded) - _AppendStrings(pszNew, astrStrings, iFirstIndex); - - *pszNew++ = '\0'; // must have 2 null terminators at end of multi_sz - - dwErr = rkLang.SetMultiStringValue(szValue, strNew); - if (dwErr != ERROR_SUCCESS) - return AtlHresultFromWin32(dwErr); - - return S_OK; - } - _ATLCATCHALL() - { - return E_OUTOFMEMORY; - } -} - -inline HRESULT CPerfMon::_RemoveRegStrings( - CRegKey& rkLang, - LPCTSTR szValue, - ULONG iFirstIndex, - ULONG iLastIndex - ) throw() -{ - _ATLTRY - { - // load the existing strings, remove the data, and resave the strings - DWORD nChars = 0; - DWORD dwErr; - - dwErr = rkLang.QueryMultiStringValue(szValue, NULL, &nChars); - if (dwErr != ERROR_SUCCESS) - return AtlHresultFromWin32(dwErr); - - CString str; - CStrBuf szBuf(str, nChars, CStrBuf::SET_LENGTH); - DWORD nMaxLen = nChars*sizeof(TCHAR); - - dwErr = rkLang.QueryMultiStringValue(szValue, szBuf, &nChars); - if (dwErr != ERROR_SUCCESS) - return AtlHresultFromWin32(dwErr); - - LPCTSTR pszRead = szBuf; - LPTSTR pszWrite = szBuf; - while (*pszRead != '\0') - { - ULONG iIndex = _ttoi(pszRead); - int nLen = (int) _tcslen(pszRead) + 1; // get the length of the index and null - nLen += (int) _tcslen(pszRead+nLen) + 1; // add the length of the description and null - if (iIndex < iFirstIndex || iIndex > iLastIndex) - { - Checked::memmove_s(pszWrite, nMaxLen , pszRead, nLen*sizeof(TCHAR)); - UINT nMaxLenLast = nMaxLen; - nMaxLen -= nLen*sizeof(TCHAR); - if(nMaxLen > nMaxLenLast) return E_FAIL; - pszWrite += nLen; - } - pszRead += nLen; - } - *pszWrite++ = '\0'; // must have 2 null terminators at end of multi_sz - - dwErr = rkLang.SetMultiStringValue(szValue, szBuf); - if (dwErr != ERROR_SUCCESS) - return AtlHresultFromWin32(dwErr); - - return S_OK; - } - _ATLCATCHALL() - { - return E_OUTOFMEMORY; - } -} - -inline HRESULT CPerfMon::_ReserveStringRange(DWORD& dwFirstCounter, DWORD& dwFirstHelp) throw() -{ - CRegKey rkApp; - CString strAppKey; - DWORD dwErr; - - _ATLTRY - { - strAppKey.Format(c_szAtlPerfPerformanceKey, GetAppName()); - } - _ATLCATCHALL() - { - return E_OUTOFMEMORY; - } - - DWORD nNumStrings = _GetNumCategoriesAndCounters(); - - dwErr = rkApp.Open(HKEY_LOCAL_MACHINE, strAppKey); - if (dwErr == ERROR_SUCCESS) - { - // see if we already have a sufficient range reserved - DWORD dwFirstAppCounter; - DWORD dwFirstAppHelp; - DWORD dwLastAppCounter; - DWORD dwLastAppHelp; - - if (rkApp.QueryDWORDValue(c_szAtlPerfFirstCounter, dwFirstAppCounter) == ERROR_SUCCESS && - rkApp.QueryDWORDValue(c_szAtlPerfFirstHelp, dwFirstAppHelp) == ERROR_SUCCESS && - rkApp.QueryDWORDValue(c_szAtlPerfLastCounter, dwLastAppCounter) == ERROR_SUCCESS && - rkApp.QueryDWORDValue(c_szAtlPerfLastHelp, dwLastAppHelp) == ERROR_SUCCESS && - dwLastAppCounter-dwFirstAppCounter+2 >= 2*nNumStrings && - dwLastAppHelp-dwFirstAppHelp+2 >= 2*nNumStrings) - { - dwFirstCounter = dwFirstAppCounter; - dwFirstHelp = dwFirstAppHelp; - return S_OK; - } - } - - CRegKey rkPerfLib; - - dwErr = rkPerfLib.Open(HKEY_LOCAL_MACHINE, c_szAtlPerfPerfLibKey); - if (dwErr != ERROR_SUCCESS) - return AtlHresultFromWin32(dwErr); - - if (!rkApp) - { - dwErr = rkApp.Create(HKEY_LOCAL_MACHINE, strAppKey); - if (dwErr != ERROR_SUCCESS) - return AtlHresultFromWin32(dwErr); - } - - // figure out the counter range - DWORD dwLastCounter; - DWORD dwLastHelp; - - dwErr = rkPerfLib.QueryDWORDValue(c_szAtlPerfLastCounter, dwLastCounter); - if (dwErr != ERROR_SUCCESS) - return AtlHresultFromWin32(dwErr); - - dwErr = rkPerfLib.QueryDWORDValue(c_szAtlPerfLastHelp, dwLastHelp); - if (dwErr != ERROR_SUCCESS) - return AtlHresultFromWin32(dwErr); - - dwFirstCounter = dwLastCounter + 2; - dwFirstHelp = dwLastHelp + 2; - dwLastCounter += 2*nNumStrings; - dwLastHelp += 2*nNumStrings; - - dwErr = rkPerfLib.SetDWORDValue(c_szAtlPerfLastCounter, dwLastCounter); - if (dwErr != ERROR_SUCCESS) - return AtlHresultFromWin32(dwErr); - - dwErr = rkPerfLib.SetDWORDValue(c_szAtlPerfLastHelp, dwLastHelp); - if (dwErr != ERROR_SUCCESS) - return AtlHresultFromWin32(dwErr); - - // register the used counter range - dwErr = rkApp.SetDWORDValue(c_szAtlPerfFirstCounter, dwFirstCounter); - if (dwErr != ERROR_SUCCESS) - return AtlHresultFromWin32(dwErr); - - dwErr = rkApp.SetDWORDValue(c_szAtlPerfLastCounter, dwLastCounter); - if (dwErr != ERROR_SUCCESS) - return AtlHresultFromWin32(dwErr); - - dwErr = rkApp.SetDWORDValue(c_szAtlPerfFirstHelp, dwFirstHelp); - if (dwErr != ERROR_SUCCESS) - return AtlHresultFromWin32(dwErr); - - dwErr = rkApp.SetDWORDValue(c_szAtlPerfLastHelp, dwLastHelp); - if (dwErr != ERROR_SUCCESS) - return AtlHresultFromWin32(dwErr); - - return S_OK; -} - -inline HRESULT CPerfMon::Register( - LPCTSTR szOpenFunc, - LPCTSTR szCollectFunc, - LPCTSTR szCloseFunc, - HINSTANCE hDllInstance /* == _AtlBaseModule.GetModuleInstance() */ - ) throw() -{ - ATLASSERT(szOpenFunc != NULL); - ATLASSERT(szCollectFunc != NULL); - ATLASSERT(szCloseFunc != NULL); - - CString str; - DWORD dwErr; - HRESULT hr; - hr = CreateMap(LANGIDFROMLCID(GetThreadLocale()), hDllInstance); - if (FAILED(hr)){ - hr = CreateMap(LANGIDFROMLCID(1033), hDllInstance); - if (FAILED(hr)) - return hr; - } - - CString strAppKey; - _ATLTRY - { - strAppKey.Format(c_szAtlPerfPerformanceKey, GetAppName()); - } - _ATLCATCHALL() - { - return E_OUTOFMEMORY; - } - - // if we're already registered, unregister so we can redo registration - _UnregisterStrings(); - - // reserve a range for our counter and help strings - DWORD dwFirstCounter = 0; - DWORD dwFirstHelp = 0; - hr = _ReserveStringRange(dwFirstCounter, dwFirstHelp); - if (FAILED(hr)) - return hr; - - DWORD dwCurrentName = dwFirstCounter; - DWORD dwCurrentHelp = dwFirstHelp; - for (UINT i=0; i<_GetNumCategories(); i++) - { - CategoryInfo* pCategoryInfo = _GetCategoryInfo(i); - - pCategoryInfo->m_nNameId = dwCurrentName; - dwCurrentName += 2; - pCategoryInfo->m_nHelpId = dwCurrentHelp; - dwCurrentHelp += 2; - - for (UINT j=0; j_GetNumCounters(); j++) - { - CounterInfo* pCounterInfo = pCategoryInfo->_GetCounterInfo(j); - - pCounterInfo->m_nNameId = dwCurrentName; - dwCurrentName += 2; - pCounterInfo->m_nHelpId = dwCurrentHelp; - dwCurrentHelp += 2; - } - } - - // register the app entry points - CRegKey rkApp; - - dwErr = rkApp.Create(HKEY_LOCAL_MACHINE, strAppKey); - if (dwErr != ERROR_SUCCESS) - return AtlHresultFromWin32(dwErr); - - _ATLTRY - { - DWORD dwFLen = GetModuleFileName(hDllInstance, CStrBuf(str, MAX_PATH), MAX_PATH); - if( dwFLen == 0 ) - return AtlHresultFromLastError(); - else if( dwFLen == MAX_PATH ) - return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - _ATLCATCHALL() - { - return E_OUTOFMEMORY; - } - - dwErr = rkApp.SetStringValue(c_szAtlPerfLibrary, str); - if (dwErr != ERROR_SUCCESS) - return AtlHresultFromWin32(dwErr); - - dwErr = rkApp.SetStringValue(c_szAtlPerfOpen, szOpenFunc); - if (dwErr != ERROR_SUCCESS) - return AtlHresultFromWin32(dwErr); - - dwErr = rkApp.SetStringValue(c_szAtlPerfCollect, szCollectFunc); - if (dwErr != ERROR_SUCCESS) - return AtlHresultFromWin32(dwErr); - - dwErr = rkApp.SetStringValue(c_szAtlPerfClose, szCloseFunc); - if (dwErr != ERROR_SUCCESS) - return AtlHresultFromWin32(dwErr); - - dwErr = rkApp.SetStringValue(c_szAtlPerfLanguages, _T("")); - if (dwErr != ERROR_SUCCESS) - return AtlHresultFromWin32(dwErr); - - hr = _SaveMap(); - if (FAILED(hr)) - return hr; - - // if the dll is disabled, reenable it since we just reregistered it - rkApp.DeleteValue(_T("Disable Performance Counters")); - - return S_OK; -} - -inline HRESULT CPerfMon::RegisterStrings( - LANGID language /* = MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL) */, - HINSTANCE hResInstance /* = _AtlBaseModule.GetResourceInstance() */ - ) throw() -{ - _ATLTRY - { - CString str; - DWORD dwErr; - HRESULT hr; - CRegKey rkLang; - CRegKey rkApp; - - LANGID wPrimaryLanguage = (LANGID) PRIMARYLANGID(language); - - if (language == MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL)) - { - //First try current thread locale - language = LANGIDFROMLCID(GetThreadLocale()); - wPrimaryLanguage = (LANGID) PRIMARYLANGID(language); - } - str.Format(c_szAtlPerfPerfLibLangKey, wPrimaryLanguage); - dwErr = rkLang.Open(HKEY_LOCAL_MACHINE, str); - if (dwErr == ERROR_FILE_NOT_FOUND) - { - // failed using current thread, so try default system lcid - language = GetSystemDefaultLangID(); - wPrimaryLanguage = (LANGID) PRIMARYLANGID(language); - str.Format(c_szAtlPerfPerfLibLangKey, wPrimaryLanguage); - dwErr = rkLang.Open(HKEY_LOCAL_MACHINE, str); - } - if (dwErr == ERROR_FILE_NOT_FOUND) - return S_FALSE; // the language isn't installed on the system - if (dwErr != ERROR_SUCCESS) - return AtlHresultFromWin32(dwErr); - - hr = CreateMap(language, hResInstance); - if (FAILED(hr)) - return hr; - - // load list of language strings already registered - str.Format(c_szAtlPerfPerformanceKey, GetAppName()); - dwErr = rkApp.Open(HKEY_LOCAL_MACHINE, str); - if (dwErr != ERROR_SUCCESS) - return AtlHresultFromWin32(dwErr); - - DWORD dwLangsLen = 0; - CString strLangs; - - dwErr = rkApp.QueryStringValue(c_szAtlPerfLanguages, NULL, &dwLangsLen); - if (dwErr != ERROR_SUCCESS) - return AtlHresultFromWin32(dwErr); - - ULONG nLangsBuffSize = dwLangsLen+4; - CStrBuf szLangs(strLangs, nLangsBuffSize, CStrBuf::SET_LENGTH); // reserve room for adding new language - dwErr = rkApp.QueryStringValue(c_szAtlPerfLanguages, szLangs, &dwLangsLen); - if (dwErr != ERROR_SUCCESS) - return AtlHresultFromWin32(dwErr); - dwLangsLen--; // don't count '\0' - - // see if this language has already been registered and if so, return - TCHAR szNewLang[5]; - _sntprintf_s(szNewLang, _countof(szNewLang), _countof(szNewLang)-1, _T("%3.3x "), wPrimaryLanguage); - if (strLangs.Find(szNewLang) != -1) - return S_OK; - - // load the strings we want to append and figure out how much extra space is needed for them - // (including up to 5-digit index values and 2 null separators) - CAtlArray astrCounters; - CAtlArray astrHelp; - ULONG nNewCounterSize = 0; - ULONG nNewHelpSize = 0; - - for (UINT i=0; i<_GetNumCategories(); i++) - { - CategoryInfo* pCategoryInfo = _GetCategoryInfo(i); - - astrCounters.Add(pCategoryInfo->m_strName); - astrHelp.Add(pCategoryInfo->m_strHelp); - - for (UINT j=0; j_GetNumCounters(); j++) - { - CounterInfo* pCounterInfo = pCategoryInfo->_GetCounterInfo(j); - - astrCounters.Add(pCounterInfo->m_strName); - astrHelp.Add(pCounterInfo->m_strHelp); - } - } - - for (size_t i=0; i* pLangs = reinterpret_cast*>(lParam); - _ATLTRY - { - pLangs->Add(wIDLanguage); - } - _ATLCATCHALL() - { - return FALSE; - } - - return TRUE; -} - -inline HRESULT CPerfMon::RegisterAllStrings( - HINSTANCE hResInstance /* = NULL */ - ) throw() -{ - HRESULT hrReturn = S_FALSE; - HRESULT hr; - - UINT nRes; - hr = CreateMap(0, hResInstance, &nRes); - if (FAILED(hr)) - return hr; - - if (nRes == 0) - return RegisterStrings(0, hResInstance); - - if (hResInstance != NULL) - return _RegisterAllStrings(nRes, hResInstance); - - for (int i = 0; hResInstance = _AtlBaseModule.GetHInstanceAt(i), hResInstance != NULL; i++) - { - hr = _RegisterAllStrings(nRes, hResInstance); - if (FAILED(hr)) - return hr; - if (hr == S_OK) - hrReturn = S_OK; - } - - return hrReturn; -} - -inline HRESULT CPerfMon::_RegisterAllStrings( - UINT nRes, - HINSTANCE hResInstance - ) throw() -{ - HRESULT hrReturn = S_FALSE; - HRESULT hr; - - CAtlArray langs; - if (!EnumResourceLanguages(hResInstance, RT_STRING, MAKEINTRESOURCE((nRes>>4)+1), EnumResLangProc, reinterpret_cast(&langs))) - return AtlHresultFromLastError(); - - for (UINT i=0; i(self.GetPSID()), - NULL, - const_cast(dacl.GetPACL()), - NULL) != ERROR_SUCCESS) - return E_FAIL; - } - - // now set up the dacl for creating shared memory segments and store it - dacl.AddAllowedAce(Sids::Interactive(), GENERIC_READ); - m_sd.SetDacl(dacl); - - // create a shared memory area to share data between the app being measured and the client doing the measuring - { - CMutexLock lock(tempLock); - - BOOL bExisted = FALSE; - - CAtlFileMappingBase* pMem; - pMem = _AllocNewBlock(NULL, &bExisted); - if (pMem == NULL) - return E_OUTOFMEMORY; - - if (!bExisted) - { - // copy the map from the registry to the shared memory - CRegKey rkApp; - DWORD dwErr; - CString strAppKey; - - strAppKey.Format(c_szAtlPerfPerformanceKey, GetAppName()); - - dwErr = rkApp.Open(HKEY_LOCAL_MACHINE, strAppKey, KEY_READ); - if (dwErr != ERROR_SUCCESS) - { - m_aMem.RemoveAll(); - return AtlHresultFromWin32(dwErr); - } - - ULONG nBytes = m_nAllocSize; - dwErr = rkApp.QueryBinaryValue(c_szAtlPerfMap, pMem->GetData(), &nBytes); - if (dwErr != ERROR_SUCCESS) - { - m_aMem.RemoveAll(); - return AtlHresultFromWin32(dwErr); - } - } - - hr = _LoadMap(LPDWORD(pMem->GetData())); - if (FAILED(hr)) - { - m_aMem.RemoveAll(); - return hr; - } - - m_nSchemaSize = *LPDWORD(pMem->GetData()); - m_nHeaderSize = m_nSchemaSize + sizeof(DWORD); - m_nHeaderSize = AtlAlignUp(m_nHeaderSize,16); - } - - m_lock.Attach(tempLock.Detach()); - } - _ATLCATCHALL() - { - m_aMem.RemoveAll(); - return E_OUTOFMEMORY; - } - - return S_OK; -} - -inline void CPerfMon::UnInitialize() throw() -{ - if (m_lock.m_h != NULL) - m_lock.Close(); - m_aMem.RemoveAll(); - ClearMap(); -} - -inline HRESULT CPerfMon::_CreateInstance( - DWORD dwCategoryId, - DWORD dwInstance, - LPCWSTR szInstanceName, - CPerfObject** ppInstance, - bool bByName - ) throw() -{ - CPerfObject* pEmptyBlock = NULL; - - if (ppInstance == NULL) - return E_POINTER; - - CAtlFileMappingBase* pCurrentBlock = _GetNextBlock(NULL); - if (pCurrentBlock == NULL || pCurrentBlock->GetData() == NULL || m_lock.m_h == NULL) - return E_UNEXPECTED; // Initialize must succeed before calling CreateInstance - - *ppInstance = NULL; - - CategoryInfo* pCategoryInfo = _FindCategoryInfo(dwCategoryId); - if (pCategoryInfo == NULL) - return E_INVALIDARG; - if (szInstanceName == NULL && bByName) - return E_INVALIDARG; - if (pCategoryInfo->m_nInstanceLess == PERF_NO_INSTANCES && - (dwInstance != 0 || szInstanceName != NULL)) - return E_INVALIDARG; - - CPerfLock lock(this); - if (FAILED(lock.GetStatus())) - return lock.GetStatus(); - - CPerfObject* pInstance = _GetFirstInstance(pCurrentBlock); - ULONG nMaxInstance = 0; - ULONG nUsedSpace = 0; - - // walk all of the existing objects trying to find one that matches the request - while (pInstance->m_nAllocSize != 0) - { - nUsedSpace += pInstance->m_nAllocSize; - - if (pInstance->m_dwCategoryId == dwCategoryId) - { - nMaxInstance = __max(nMaxInstance, pInstance->m_dwInstance); - - // check to see if we've found the one the caller wants - if (!bByName && pInstance->m_dwInstance == dwInstance && - (pCategoryInfo->m_nInstanceLess == PERF_NO_INSTANCES || dwInstance != 0)) - { - *ppInstance = pInstance; - pInstance->m_nRefCount++; - return S_OK; - } - if (bByName) - { - LPWSTR szInstName = (LPWSTR(LPBYTE(pInstance)+pInstance->m_nInstanceNameOffset)); - if (wcsncmp(szInstName, szInstanceName, pCategoryInfo->m_nMaxInstanceNameLen-1) == 0) - { - *ppInstance = pInstance; - pInstance->m_nRefCount++; - return S_OK; - } - } - } - - if (pInstance->m_nAllocSize == pCategoryInfo->m_nAllocSize && pInstance->m_nRefCount == 0) - pEmptyBlock = pInstance; - - pInstance = _GetNextInstance(pInstance); - ATLENSURE_RETURN(pInstance!= NULL); - - if (pInstance->m_nAllocSize == 0 && - m_nHeaderSize + nUsedSpace + pCategoryInfo->m_nAllocSize + sizeof(CPerfObject) > m_nAllocSize) - { - // we've reached the end of the block and have no room to allocate an object of this - // type. cap the block with a sentinel - pInstance->m_nAllocSize = (ULONG) -1; - } - - // check for an end-of-shared-mem sentinel - if (pInstance->m_nAllocSize == (ULONG) -1) - { - nUsedSpace = 0; - CAtlFileMappingBase* pNextBlock = _GetNextBlock(pCurrentBlock); - if (pNextBlock == NULL) - { - // we've reached the last block of shared mem. - // the instance hasn't been found, so either use a - // previously freed instance block (pEmptyBlock) or allocate a new - // shared mem block to hold the new instance - if (pEmptyBlock == NULL) - { - pNextBlock = _AllocNewBlock(pCurrentBlock); - if (pNextBlock == NULL) - return E_OUTOFMEMORY; - } - else - break; - } - pCurrentBlock = pNextBlock; - pInstance = _GetFirstInstance(pCurrentBlock); - } - } - - // allocate a new object - if (pEmptyBlock != NULL) - pInstance = pEmptyBlock; - else - pInstance->m_nAllocSize = pCategoryInfo->m_nAllocSize; - - if (dwInstance == 0 && pCategoryInfo->m_nInstanceLess != PERF_NO_INSTANCES) - pInstance->m_dwInstance = nMaxInstance + 1; - else - pInstance->m_dwInstance = dwInstance; - - pInstance->m_nRefCount = 1; - - // copy the instance name, truncate if necessary - if (pCategoryInfo->m_nInstanceLess != PERF_NO_INSTANCES) - { - ULONG nNameLen = (ULONG)__min(wcslen(szInstanceName), pCategoryInfo->m_nMaxInstanceNameLen-1); - ULONG nNameBytes = (nNameLen+1) * sizeof(WCHAR); - pInstance->m_nInstanceNameOffset = pInstance->m_nAllocSize-nNameBytes; - Checked::memcpy_s(LPBYTE(pInstance)+pInstance->m_nInstanceNameOffset, pInstance->m_nAllocSize-pInstance->m_nInstanceNameOffset, szInstanceName, nNameBytes); - LPWSTR(LPBYTE(pInstance)+pInstance->m_nInstanceNameOffset)[nNameLen] = 0; - } - - // copy the CategoryId last: it won't be collected until this is set - pInstance->m_dwCategoryId = pCategoryInfo->m_dwCategoryId; - - *ppInstance = pInstance; - - return S_OK; -} - -inline HRESULT CPerfMon::CreateInstance( - DWORD dwCategoryId, - DWORD dwInstance, - LPCWSTR szInstanceName, - CPerfObject** ppInstance - ) throw() -{ - return _CreateInstance(dwCategoryId, dwInstance, szInstanceName, ppInstance, false); -} - -inline HRESULT CPerfMon::CreateInstanceByName( - DWORD dwCategoryId, - LPCWSTR szInstanceName, - CPerfObject** ppInstance - ) throw() -{ - return _CreateInstance(dwCategoryId, 0, szInstanceName, ppInstance, true); -} - -inline HRESULT CPerfMon::ReleaseInstance(CPerfObject* pInstance) throw() -{ - ATLASSERT(pInstance != NULL); - if (pInstance == NULL) - return E_INVALIDARG; - - CPerfLock lock(this); - if (FAILED(lock.GetStatus())) - return lock.GetStatus(); - - if (--pInstance->m_nRefCount == 0) - { - pInstance->m_dwInstance = 0; - pInstance->m_dwCategoryId = 0; - } - - return S_OK; -} - -inline HRESULT CPerfMon::LockPerf(DWORD dwTimeout /* == INFINITE */) throw() -{ - if (m_lock.m_h == NULL) - return E_UNEXPECTED; - - DWORD dwRes = WaitForSingleObject(m_lock.m_h, dwTimeout); - if (dwRes == WAIT_ABANDONED || dwRes == WAIT_OBJECT_0) - return S_OK; - if (dwRes == WAIT_TIMEOUT) - return HRESULT_FROM_WIN32(ERROR_TIMEOUT); - return AtlHresultFromLastError(); -} - -inline void CPerfMon::UnlockPerf() throw() -{ - m_lock.Release(); -} - -// map building routines -inline HRESULT CPerfMon::AddCategoryDefinition( - DWORD dwCategoryId, - LPCTSTR szCategoryName, - LPCTSTR szHelpString, - DWORD dwDetailLevel, - INT nDefaultCounter, - BOOL bInstanceLess, - UINT nStructSize, - UINT nMaxInstanceNameLen) throw() -{ - // must have one and only one of these - ATLASSERT(!bInstanceLess ^ !nMaxInstanceNameLen); - - // get the things that can fail out of the way first - CString strName; - CString strHelp; - _ATLTRY - { - strName = szCategoryName; - strHelp = szHelpString; - } - _ATLCATCHALL() - { - return E_OUTOFMEMORY; - } - - if (!m_categories.SetCount(m_categories.GetCount()+1)) - { - return E_OUTOFMEMORY; - } - - // category has been added, set the data - CategoryInfo* pCategoryInfo = _GetCategoryInfo(_GetNumCategories()-1); - - pCategoryInfo->m_dwCategoryId = dwCategoryId; - pCategoryInfo->m_dwDetailLevel = dwDetailLevel; - pCategoryInfo->m_nDefaultCounter = nDefaultCounter; - pCategoryInfo->m_nInstanceLess = bInstanceLess ? PERF_NO_INSTANCES : 0; - pCategoryInfo->m_nStructSize = nStructSize; - pCategoryInfo->m_nMaxInstanceNameLen = nMaxInstanceNameLen; - pCategoryInfo->m_nAllocSize = nStructSize + nMaxInstanceNameLen*sizeof(WCHAR); - pCategoryInfo->m_strName = strName; - pCategoryInfo->m_strHelp = strHelp; - pCategoryInfo->m_nNameId = 0; - pCategoryInfo->m_nHelpId = 0; - - return S_OK; -} - -inline HRESULT CPerfMon::AddCounterDefinition( - DWORD dwCounterId, - LPCTSTR szCounterName, - LPCTSTR szHelpString, - DWORD dwDetailLevel, - DWORD dwCounterType, - ULONG nMaxCounterSize, - UINT nOffset, - INT nDefaultScale) throw() -{ - // must add category BEFORE adding counter! - ATLASSERT(_GetNumCategories() > 0); - - CounterInfo counter; - - counter.m_dwCounterId = dwCounterId; - _ATLTRY - { - counter.m_strName = szCounterName; - counter.m_strHelp = szHelpString; - } - _ATLCATCHALL() - { - return E_OUTOFMEMORY; - } - counter.m_dwDetailLevel = dwDetailLevel; - counter.m_dwCounterType = dwCounterType; - counter.m_nDefaultScale = nDefaultScale; - counter.m_nMaxCounterSize = nMaxCounterSize; - counter.m_nDataOffset = nOffset; - - counter.m_nNameId = 0; - counter.m_nHelpId = 0; - - // add the counter to the category - CategoryInfo* pCategoryInfo = _GetCategoryInfo(_GetNumCategories()-1); - _ATLTRY - { - pCategoryInfo->m_counters.Add(counter); - } - _ATLCATCHALL() - { - return E_OUTOFMEMORY; - } - - if (counter.m_nMaxCounterSize > 0) - { - ATLASSERT(counter.m_dwCounterType & PERF_TYPE_TEXT); - pCategoryInfo->m_nAllocSize += counter.m_nMaxCounterSize * sizeof(WCHAR); - } - - return S_OK; -} - -inline HRESULT CPerfMon::RegisterCategory( - WORD wLanguage, - HINSTANCE hResInstance, - UINT* pSampleRes, - DWORD dwCategoryId, - UINT nNameString, - UINT nHelpString, - DWORD dwDetail, - BOOL bInstanceless, - UINT nStructSize, - UINT nMaxInstanceNameLen, - INT nDefaultCounter) throw() -{ - if (pSampleRes) - *pSampleRes = nNameString; - - CString strName; - CString strHelp; - - _ATLTRY - { - - if (!strName.LoadString(hResInstance, nNameString, wLanguage) || - !strHelp.LoadString(hResInstance, nHelpString, wLanguage)) - { - return E_FAIL; - } - } - _ATLCATCHALL() - { - return E_OUTOFMEMORY; - } - - return RegisterCategory( - wLanguage, - hResInstance, - pSampleRes, - dwCategoryId, - strName, - strHelp, - dwDetail, - bInstanceless, - nStructSize, - nMaxInstanceNameLen, - nDefaultCounter); -} - -inline HRESULT CPerfMon::RegisterCategory( - WORD /* wLanguage */, - HINSTANCE /* hResInstance */, - UINT* /* pSampleRes */, - DWORD dwCategoryId, - LPCTSTR szNameString, - LPCTSTR szHelpString, - DWORD dwDetail, - BOOL bInstanceless, - UINT nStructSize, - UINT nMaxInstanceNameLen, - INT nDefaultCounter) throw() -{ - return AddCategoryDefinition( - dwCategoryId, - szNameString, - szHelpString, - dwDetail, - nDefaultCounter, - bInstanceless, - nStructSize, - nMaxInstanceNameLen); -} - -inline HRESULT CPerfMon::RegisterCounter( - WORD wLanguage, - HINSTANCE hResInstance, - DWORD dwCounterId, - UINT nNameString, - UINT nHelpString, - DWORD dwDetail, - DWORD dwCounterType, - ULONG nMaxCounterSize, - UINT nOffset, - INT nDefaultScale) throw() -{ - CString strName; - CString strHelp; - - _ATLTRY - { - - if (!strName.LoadString(hResInstance, nNameString, wLanguage) || - !strHelp.LoadString(hResInstance, nHelpString, wLanguage)) - { - return E_FAIL; - } - } - _ATLCATCHALL() - { - return E_OUTOFMEMORY; - } - - return RegisterCounter( - wLanguage, - hResInstance, - dwCounterId, - strName, - strHelp, - dwDetail, - dwCounterType, - nMaxCounterSize, - nOffset, - nDefaultScale); -} - -inline HRESULT CPerfMon::RegisterCounter( - WORD /* wLanguage */, - HINSTANCE /* hResInstance */, - DWORD dwCounterId, - LPCTSTR szNameString, - LPCTSTR szHelpString, - DWORD dwDetail, - DWORD dwCounterType, - ULONG nMaxCounterSize, - UINT nOffset, - INT nDefaultScale) throw() -{ - return AddCounterDefinition( - dwCounterId, - szNameString, - szHelpString, - dwDetail, - dwCounterType, - nMaxCounterSize, - nOffset, - nDefaultScale); -} - -inline void CPerfMon::ClearMap() throw() -{ - m_categories.RemoveAll(); -} - -#ifndef _ATL_PERF_NOXML - -ATL_NOINLINE inline HRESULT CPerfMon::PersistToXML(IStream *pStream, BOOL bFirst/*=TRUE*/, BOOL bLast/*=TRUE*/) throw(...) -{ - ATLASSERT(pStream != NULL); - if (pStream == NULL) - return E_INVALIDARG; - - CPerfLock lock(this); - if (FAILED(lock.GetStatus())) - return ERROR_SUCCESS; - - CStringA strXML; - HRESULT hr = S_OK; - ULONG nLen = 0; - - if (bFirst) - { - strXML = "\r\n\r\n"; - hr = pStream->Write(strXML, strXML.GetLength(), &nLen); - if (hr != S_OK) - return hr; - } - - strXML.Format("\t\r\n", CT2CA(GetAppName())); - hr = pStream->Write(strXML, strXML.GetLength(), &nLen); - - for (UINT i=0; i<_GetNumCategories(); i++) - { - CategoryInfo* pCategoryInfo = _GetCategoryInfo(i); - - CAtlFileMappingBase *pCurrentBlock = _GetNextBlock(NULL); - CPerfObject *pInstance = _GetFirstInstance(pCurrentBlock); - - strXML.Format("\t\t\r\n", - pCategoryInfo->m_dwCategoryId, pCategoryInfo->m_nNameId, pCategoryInfo->m_nHelpId); - - hr = pStream->Write(strXML, strXML.GetLength(), &nLen); - if (hr != S_OK) - return E_FAIL; - - while (pInstance && pInstance->m_nAllocSize) - { - if (pInstance->m_dwCategoryId == pCategoryInfo->m_dwCategoryId) - { - if (pCategoryInfo->m_nInstanceLess != PERF_NO_INSTANCES) - { - // handle the instance name - LPCWSTR wszInstNameSrc = LPCWSTR(LPBYTE(pInstance)+pInstance->m_nInstanceNameOffset); - int nInstLen = (int) wcslen(wszInstNameSrc); - - // convert to UTF8 - int nLength = AtlUnicodeToUTF8(wszInstNameSrc, nInstLen, NULL, 0); - CHeapPtr szUTF8; - if ((nLength < 0) || (nLength+1\r\n", szUTF8, pInstance->m_dwInstance); - hr = pStream->Write(strXML, strXML.GetLength(), &nLen); - if (hr != S_OK) - return hr; - } - - for (UINT j=0; j_GetNumCounters(); j++) - { - CounterInfo *pCounterInfo = pCategoryInfo->_GetCounterInfo(j); - switch (pCounterInfo->m_dwCounterType & ATLPERF_SIZE_MASK) - { - case PERF_SIZE_DWORD: - { - strXML.Format("\t\t\t\t\r\n", - *LPDWORD(LPBYTE(pInstance)+pCounterInfo->m_nDataOffset), - pCounterInfo->m_nDataOffset); - break; - } - case PERF_SIZE_LARGE: - { - strXML.Format("\t\t\t\t\r\n", - *PULONGLONG(LPBYTE(pInstance)+pCounterInfo->m_nDataOffset), - pCounterInfo->m_nDataOffset); - break; - } - case PERF_SIZE_VARIABLE_LEN: - { - CHeapPtr szUTF8; - LPBYTE pSrc = LPBYTE(pInstance)+pCounterInfo->m_nDataOffset; - if ((pCounterInfo->m_dwCounterType & ATLPERF_TEXT_MASK) == PERF_TEXT_UNICODE) - { - ULONG nTextLen = (ULONG)wcslen(LPCWSTR(pSrc)); - // convert to UTF8 - nLen = AtlUnicodeToUTF8(LPCWSTR(pSrc), nTextLen, NULL, 0); - if (!szUTF8.Allocate(nLen+1)) - return E_OUTOFMEMORY; - - nLen = AtlUnicodeToUTF8(LPCWSTR(pSrc), nTextLen, szUTF8, nLen); - szUTF8[nLen] = '\0'; - strXML.Format("\t\t\t\t\r\n", - szUTF8, - pCounterInfo->m_nDataOffset); - } - else - { - ULONG nTextLen = (ULONG)strlen(LPCSTR(pSrc)); - if (!szUTF8.Allocate(nTextLen+1)) - return E_OUTOFMEMORY; - Checked::strcpy_s(szUTF8, nTextLen+1, LPCSTR(pSrc)); - strXML.Format("\t\t\t\t\r\n", - szUTF8, - pCounterInfo->m_nDataOffset); - } - break; - } - default: - // error: - return E_FAIL; - } - hr = pStream->Write(strXML, strXML.GetLength(), &nLen); - if (hr != S_OK) - return hr; - } - - if (pCategoryInfo->m_nInstanceLess != PERF_NO_INSTANCES) - { - hr = pStream->Write("\t\t\t\r\n", sizeof("\t\t\t\r\n")-1, &nLen); - if (hr != S_OK) - return hr; - } - } - - pInstance = _GetNextInstance(pInstance); - ATLENSURE_RETURN(pInstance!= NULL); - - if (pInstance->m_nAllocSize == (ULONG)-1) - { - pCurrentBlock = _GetNextBlock(pCurrentBlock); - if (pCurrentBlock == NULL) - pInstance = NULL; - else - pInstance = _GetFirstInstance(pCurrentBlock); - } - } - - hr = pStream->Write("\t\t\r\n", sizeof("\t\t\r\n")-1, &nLen); - if (hr != S_OK) - return hr; - } - - hr = pStream->Write("\t\r\n", sizeof("\t\r\n")-1, &nLen); - if (hr != S_OK) - return hr; - - if (hr == S_OK && bLast) - hr = pStream->Write("", sizeof("")-1, &nLen); - - return hr; -} - -// This function is very lenient with inappropriate XML -ATL_NOINLINE inline HRESULT CPerfMon::LoadFromXML(IStream *pStream) throw(...) -{ - ATLASSERT(pStream != NULL); - if (pStream == NULL) - return E_INVALIDARG; - - // Get a lock - CPerfLock lock(this); - if (FAILED(lock.GetStatus())) - return ERROR_SUCCESS; - - CComPtr spdoc; - - // load the xml - HRESULT hr = CoCreateInstance(__uuidof(DOMDocument), NULL, CLSCTX_INPROC, __uuidof(IXMLDOMDocument), (void **) &spdoc); - if (FAILED(hr)) - { - return hr; - } - - spdoc->put_async(VARIANT_FALSE); - - CComPtr spSI; - hr = spdoc->QueryInterface(&spSI); - if (hr != S_OK) - return hr; - hr = spSI->Load(pStream); - if (hr != S_OK) - return hr; - - // validate that it is a perfPersist stream - CComPtr spRoot; - - hr = spdoc->get_documentElement(&spRoot); - if (hr != S_OK) - return hr; - - CComBSTR bstrName; - hr = spRoot->get_baseName(&bstrName); - if (wcscmp(bstrName, L"perfPersist")) - return S_FALSE; - - // find the appropriate perfmon node - CComPtr spChild; - hr = spRoot->get_firstChild(&spChild); - while (hr == S_OK) - { - bstrName.Empty(); - hr = spChild->get_baseName(&bstrName); - if (hr == S_OK) - { - if (!wcscmp(bstrName, L"perfmon")) - { - bstrName.Empty(); - hr = _GetAttribute(spChild, L"name", &bstrName); - if (hr == S_OK) - { - if (!_tcscmp(CW2CT(bstrName), GetAppName())) - break; - } - } - } - - CComPtr spNext; - hr = spChild->get_nextSibling(&spNext); - spChild.Attach(spNext.Detach()); - } - - // there is no perfmon node in the XML for the current CPerfMon class - if (hr != S_OK) - return S_FALSE; - - CComPtr spPerfRoot; - spPerfRoot.Attach(spChild.Detach()); - - // iterate over the objects in the perfmon subtree - // this is the loop that does the real work - hr = spPerfRoot->get_firstChild(&spChild); - while (hr == S_OK) - { - // see if it's a perfObject - bstrName.Empty(); - hr = spChild->get_baseName(&bstrName); - if (hr != S_OK || wcscmp(bstrName, L"perfObject")) - return S_FALSE; - - // get the perfid - bstrName.Empty(); - hr = _GetAttribute(spChild, L"perfid", &bstrName); - DWORD dwPerfId = _wtoi(bstrName); - - // iterate over children - CComPtr spInstChild; - hr = spChild->get_firstChild(&spInstChild); - while (hr == S_OK) - { - // see if it's a instance - bstrName.Empty(); - hr = spInstChild->get_baseName(&bstrName); - if (hr != S_OK || wcscmp(bstrName, L"instance")) - return S_FALSE; - - // get the instance name - bstrName.Empty(); - hr = _GetAttribute(spInstChild, L"name", &bstrName); - if (hr != S_OK) - return S_FALSE; - - // get the instance id - bstrName.Empty(); - hr = _GetAttribute(spChild, L"id", &bstrName); - if (hr != S_OK) - return S_FALSE; - DWORD dwInstance = _wtoi(bstrName); - - // create the instance - CPerfObject *pInstance = NULL; - hr = CreateInstance(dwPerfId, dwInstance++, bstrName, &pInstance); - if (hr != S_OK) - return S_FALSE; - - // iterate over the counters and set the data - CComPtr spCntrChild; - hr = spInstChild->get_firstChild(&spCntrChild); - while (hr == S_OK) - { - // get the base name - bstrName.Empty(); - hr = spCntrChild->get_baseName(&bstrName); - if (hr != S_OK || wcscmp(bstrName, L"counter")) - return S_FALSE; - - // get the type - bstrName.Empty(); - hr = _GetAttribute(spCntrChild, L"type", &bstrName); - if (hr != S_OK) - return S_FALSE; - - DWORD dwType; - if (!wcscmp(bstrName, L"perf_size_dword")) - dwType = PERF_SIZE_DWORD; - else if (!wcscmp(bstrName, L"perf_size_large")) - dwType = PERF_SIZE_LARGE; - else if (!wcscmp(bstrName, L"perf_size_variable_len_ansi")) - dwType = PERF_SIZE_VARIABLE_LEN; - else if (!wcscmp(bstrName, L"perf_size_variable_len_unicode")) - dwType = PERF_SIZE_VARIABLE_LEN | PERF_TEXT_UNICODE; - else - return S_FALSE; - - // get the value - bstrName.Empty(); - hr = _GetAttribute(spCntrChild, L"value", &bstrName); - if (hr != S_OK) - return S_FALSE; - - CComBSTR bstrOffset; - hr = _GetAttribute(spCntrChild, L"offset", &bstrOffset); - if (hr != S_OK) - return S_FALSE; - - WCHAR *pStop = NULL; - DWORD dwOffset = wcstoul(bstrOffset, &pStop, 10); - - if (dwType == PERF_SIZE_DWORD) // add it as a DWORD - { - DWORD dwVal = wcstoul(bstrName, &pStop, 10); - *LPDWORD(LPBYTE(pInstance)+dwOffset) = dwVal; - } - else if (dwType == PERF_SIZE_LARGE) // add it is a ULONGLONG - { - ULONGLONG qwVal = _wcstoui64(bstrName, &pStop, 10); - *PULONGLONG(LPBYTE(pInstance)+dwOffset) = qwVal; - } - else if (dwType == PERF_SIZE_VARIABLE_LEN) // add it as an ansi string - { - AtlW2AHelper(LPSTR(LPBYTE(pInstance)+dwOffset), bstrName, bstrName.Length(), ATL::_AtlGetConversionACP()); - } - else // add it as a unicode string - { - Checked::memcpy_s(LPBYTE(pInstance)+dwOffset, pInstance->m_nAllocSize-dwOffset, bstrName, bstrName.Length()*sizeof(WCHAR)); - } - - CComPtr spCntrNext; - hr = spCntrChild->get_nextSibling(&spCntrNext); - spCntrChild.Attach(spCntrNext.Detach()); - } - - CComPtr spInstNext; - hr = spInstChild->get_nextSibling(&spInstNext); - spInstChild.Attach(spInstNext.Detach()); - } - - CComPtr spNext; - hr = spChild->get_nextSibling(&spNext); - spChild.Attach(spNext.Detach()); - } - - return S_OK; -} - -// a little utility function to retrieve a named attribute from a node -ATL_NOINLINE inline HRESULT CPerfMon::_GetAttribute(IXMLDOMNode *pNode, LPCWSTR szAttrName, BSTR *pbstrVal) throw() -{ - ATLENSURE_RETURN(pNode != NULL); - ATLASSERT(szAttrName != NULL); - ATLENSURE_RETURN(pbstrVal != NULL); - - *pbstrVal = NULL; - CComPtr spAttrs; - - HRESULT hr = pNode->get_attributes(&spAttrs); - if (hr != S_OK) - return hr; - - CComPtr spAttr; - - hr = spAttrs->getNamedItem((BSTR) szAttrName, &spAttr); - if (hr != S_OK) - return hr; - - CComVariant varVal; - hr = spAttr->get_nodeValue(&varVal); - if (hr != S_OK) - return hr; - - hr = varVal.ChangeType(VT_BSTR); - if (hr != S_OK) - return hr; - - *pbstrVal = varVal.bstrVal; - varVal.vt = VT_EMPTY; - - return S_OK; -} - -#endif // _ATL_PERF_NOXML - -#if defined(_ATL_PERF_REGISTER) & !defined(_ATL_PERF_NOEXPORT) - -ATL_NOINLINE inline HRESULT RegisterPerfMon(HINSTANCE hDllInstance /* = _AtlBaseModule.GetModuleInstance() */) throw() -{ - CPerfMon **ppPerf = &__pperfA; - HRESULT hr = S_OK; - while (ppPerf != &__pperfZ) - { - if (*ppPerf != NULL) - { - hr = (*ppPerf)->Register(_T( ATLPERF_FUNCID_OPEN ), _T( ATLPERF_FUNCID_COLLECT ), _T( ATLPERF_FUNCID_CLOSE ), hDllInstance); - if (FAILED(hr)) - return hr; - hr = (*ppPerf)->RegisterAllStrings(hDllInstance); - if (FAILED(hr)) - return hr; - } - ppPerf++; - } - return S_OK; -} - -ATL_NOINLINE inline HRESULT UnregisterPerfMon() throw() -{ - CPerfMon **ppPerf = &__pperfA; - HRESULT hr = S_OK; - while (ppPerf != &__pperfZ) - { - if (*ppPerf != NULL) - { - hr = (*ppPerf)->Unregister(); - if (FAILED(hr)) - return hr; - } - ppPerf++; - } - return S_OK; -} - -extern "C" ATL_NOINLINE inline DWORD __declspec(dllexport) WINAPI OpenPerfMon(LPWSTR lpDeviceNames) throw() -{ - CPerfMon **ppPerf = &__pperfA; - DWORD dwErr = 0; - while (ppPerf != &__pperfZ) - { - if (*ppPerf != NULL) - { - dwErr = (*ppPerf)->Open(lpDeviceNames); - if (dwErr != 0) - return dwErr; - } - ppPerf++; - } - return 0; -} - -extern "C" ATL_NOINLINE inline DWORD __declspec(dllexport) WINAPI CollectPerfMon(LPWSTR lpwszValue, LPVOID* lppData, - LPDWORD lpcbBytes, LPDWORD lpcObjectTypes) throw() -{ - DWORD dwOrigBytes = *lpcbBytes; - DWORD dwBytesRemaining = *lpcbBytes; - CPerfMon **ppPerf = &__pperfA; - DWORD dwErr = 0; - while (ppPerf != &__pperfZ) - { - if (*ppPerf != NULL) - { - dwErr = (*ppPerf)->Collect(lpwszValue, lppData, lpcbBytes, lpcObjectTypes); - if (dwErr != 0) - return dwErr; - dwBytesRemaining -= *lpcbBytes; - *lpcbBytes = dwBytesRemaining; - } - ppPerf++; - } - *lpcbBytes = dwOrigBytes - dwBytesRemaining; - return 0; -} - -extern "C" ATL_NOINLINE inline DWORD __declspec(dllexport) WINAPI ClosePerfMon() throw() -{ - CPerfMon **ppPerf = &__pperfA; - while (ppPerf != &__pperfZ) - { - if (*ppPerf != NULL) - { - (*ppPerf)->Close(); - } - ppPerf++; - } - return 0; -} - -#endif // defined(_ATL_PERF_REGISTER) & !defined(_ATL_PERF_NOEXPORT) - -} // namespace ATL - -#pragma warning(pop) - -#endif // __ATLPERF_INL__ diff --git a/include/atl/atlrx.h b/include/atl/atlrx.h deleted file mode 100644 index 1f2b07a1f..000000000 --- a/include/atl/atlrx.h +++ /dev/null @@ -1,2013 +0,0 @@ -// This is a part of the Active Template Library. -// Copyright (C) Microsoft Corporation -// All rights reserved. -// -// This source code is only intended as a supplement to the -// Active Template Library Reference and related -// electronic documentation provided with the library. -// See these sources for detailed information regarding the -// Active Template Library product. - -#ifndef __ATLRX_H__ -#define __ATLRX_H__ - -#pragma once - -#include -#include -#include - -#ifndef ATL_REGEXP_MIN_STACK -#define ATL_REGEXP_MIN_STACK 256 -#endif - -/* - Regular Expression Grammar - - R - top level grammar rule - RE - regular expression - AltE - Alternative expression - E - expression - SE - simple expression - - R -> RE - '^'RE (matches begining of string) - - RE -> AltE RE - AltE - - - AltE -> E - E '|' AltE - E -> SE (RepeatOp '?'?)? - SE -> Arg - Group - CharClass - '\'Abbrev (see below) - '\'EscapedChar (any character including reserved symbols) - '\'Digit+ (Arg back reference) - '!' (not) - '.' (any char) - '$' (end of input) - Symbol (any non-reserved character) - Arg -> '{'RE'}' - Group -> '('RE')' - CharClass -> '[' '^'? CharSet ']' - CharSet -> CharItem+ - CharItem -> Char('-'Char)? - RepeatOp -> '*' - '+' - '?' - Abbrev -> Abbreviation defined in CAtlRECharTraits - Abbrev Expansion Meaning - a ([a-zA-Z0-9]) alpha numeric - b ([ \\t]) white space (blank) - c ([a-zA-Z]) alpha - d ([0-9]) digit - h ([0-9a-fA-F]) hex digit - n (\r|(\r?\n)) newline - q (\"[^\"]*\")|(\'[^\']*\') quoted string - w ([a-zA-Z]+) simple word - z ([0-9]+) integer -*/ - -#pragma pack(push,_ATL_PACKING) -namespace ATL { - -//Convertion utility classes used to convert char* to RECHAR. -//Used by rx debugging printing. -template -class CAToREChar -{ -public: - CAToREChar(const char* psz) throw() - : m_psz(psz) - { - } - operator const RECHARTYPE*() const throw() { return m_psz; } - const char* m_psz; -}; - -template<> -class CAToREChar -{ -public: - CAToREChar(const char* psz) throw() - : m_a2w(psz) - { - } - operator const wchar_t*() const throw() { return (wchar_t*)m_a2w; } - -private: - CA2W m_a2w; -}; - -class CAtlRECharTraitsA -{ -public: - typedef char RECHARTYPE; - - static size_t GetBitFieldForRangeArrayIndex(const RECHARTYPE *sz) throw() - { -#ifndef ATL_NO_CHECK_BIT_FIELD - ATLASSERT(UseBitFieldForRange()); -#endif - return static_cast(static_cast(*sz)); - } - static RECHARTYPE *Next(const RECHARTYPE *sz) throw() - { - return (RECHARTYPE *) (sz+1); - } - - static int Strncmp(const RECHARTYPE *szLeft, const RECHARTYPE *szRight, size_t nCount) throw() - { - return strncmp(szLeft, szRight, nCount); - } - - static int Strnicmp(const RECHARTYPE *szLeft, const RECHARTYPE *szRight, size_t nCount) throw() - { - return _strnicmp(szLeft, szRight, nCount); - } - - _ATL_INSECURE_DEPRECATE("CAtlRECharTraitsA::Strlwr must be passed a buffer size.") - static RECHARTYPE *Strlwr(RECHARTYPE *sz) throw() - { - #pragma warning (push) - #pragma warning(disable : 4996) - return _strlwr(sz); - #pragma warning (pop) - } - - static RECHARTYPE *Strlwr(RECHARTYPE *sz, int nSize) throw() - { - Checked::strlwr_s(sz, nSize); - return sz; - } - - static long Strtol(const RECHARTYPE *sz, RECHARTYPE **szEnd, int nBase) throw() - { - return strtol(sz, szEnd, nBase); - } - - static int Isdigit(RECHARTYPE ch) throw() - { - return isdigit(static_cast(ch)); - } - - static const RECHARTYPE** GetAbbrevs() - { - static const RECHARTYPE *s_szAbbrevs[] = - { - "a([a-zA-Z0-9])", // alpha numeric - "b([ \\t])", // white space (blank) - "c([a-zA-Z])", // alpha - "d([0-9])", // digit - "h([0-9a-fA-F])", // hex digit - "n(\r|(\r?\n))", // newline - "q(\"[^\"]*\")|(\'[^\']*\')", // quoted string - "w([a-zA-Z]+)", // simple word - "z([0-9]+)", // integer - NULL - }; - - return s_szAbbrevs; - } - - static BOOL UseBitFieldForRange() throw() - { - return TRUE; - } - - static int ByteLen(const RECHARTYPE *sz) throw() - { - return int(strlen(sz)); - } -}; - -class CAtlRECharTraitsW -{ -public: - typedef WCHAR RECHARTYPE; - - static size_t GetBitFieldForRangeArrayIndex(const RECHARTYPE *sz) throw() - { -#ifndef ATL_NO_CHECK_BIT_FIELD - ATLASSERT(UseBitFieldForRange()); -#endif - return static_cast(*sz); - } - static RECHARTYPE *Next(const RECHARTYPE *sz) throw() - { - return (RECHARTYPE *) (sz+1); - } - - static int Strncmp(const RECHARTYPE *szLeft, const RECHARTYPE *szRight, size_t nCount) throw() - { - return wcsncmp(szLeft, szRight, nCount); - } - - static int Strnicmp(const RECHARTYPE *szLeft, const RECHARTYPE *szRight, size_t nCount) throw() - { - return _wcsnicmp(szLeft, szRight, nCount); - } - - _ATL_INSECURE_DEPRECATE("CAtlRECharTraitsW::Strlwr must be passed a buffer size.") - static RECHARTYPE *Strlwr(RECHARTYPE *sz) throw() - { - #pragma warning (push) - #pragma warning(disable : 4996) - return _wcslwr(sz); - #pragma warning (pop) - } - - static RECHARTYPE *Strlwr(RECHARTYPE *sz, int nSize) throw() - { - Checked::wcslwr_s(sz, nSize); - return sz; - } - - static long Strtol(const RECHARTYPE *sz, RECHARTYPE **szEnd, int nBase) throw() - { - return wcstol(sz, szEnd, nBase); - } - - static int Isdigit(RECHARTYPE ch) throw() - { - return iswdigit(ch); - } - - static const RECHARTYPE** GetAbbrevs() - { - static const RECHARTYPE *s_szAbbrevs[] = - { - L"a([a-zA-Z0-9])", // alpha numeric - L"b([ \\t])", // white space (blank) - L"c([a-zA-Z])", // alpha - L"d([0-9])", // digit - L"h([0-9a-fA-F])", // hex digit - L"n(\r|(\r?\n))", // newline - L"q(\"[^\"]*\")|(\'[^\']*\')", // quoted string - L"w([a-zA-Z]+)", // simple word - L"z([0-9]+)", // integer - NULL - }; - - return s_szAbbrevs; - } - - static BOOL UseBitFieldForRange() throw() - { - return FALSE; - } - - static int ByteLen(const RECHARTYPE *sz) throw() - { - return int(wcslen(sz)*sizeof(WCHAR)); - } -}; - -class CAtlRECharTraitsMB -{ -public: - typedef unsigned char RECHARTYPE; - - static size_t GetBitFieldForRangeArrayIndex(const RECHARTYPE *sz) throw() - { -#ifndef ATL_NO_CHECK_BIT_FIELD - ATLASSERT(UseBitFieldForRange()); -#endif - - return static_cast(*sz); - } - - static RECHARTYPE *Next(const RECHARTYPE *sz) throw() - { - return _mbsinc(sz); - } - - static int Strncmp(const RECHARTYPE *szLeft, const RECHARTYPE *szRight, size_t nCount) throw() - { - return _mbsncmp(szLeft, szRight, nCount); - } - - static int Strnicmp(const RECHARTYPE *szLeft, const RECHARTYPE *szRight, size_t nCount) throw() - { - return _mbsnicmp(szLeft, szRight, nCount); - } - - _ATL_INSECURE_DEPRECATE("CAtlRECharTraitsMB::Strlwr must be passed a buffer size.") - static RECHARTYPE *Strlwr(RECHARTYPE *sz) throw() - { - #pragma warning (push) - #pragma warning(disable : 4996) - return _mbslwr(sz); - #pragma warning (pop) - } - - static RECHARTYPE *Strlwr(RECHARTYPE *sz, int nSize) throw() - { - Checked::mbslwr_s(sz, nSize); - return sz; - } - - static long Strtol(const RECHARTYPE *sz, RECHARTYPE **szEnd, int nBase) throw() - { - return strtol((const char *) sz, (char **) szEnd, nBase); - } - - static int Isdigit(RECHARTYPE ch) throw() - { - return _ismbcdigit((unsigned int) ch); - } - - static const RECHARTYPE** GetAbbrevs() - { - return reinterpret_cast(CAtlRECharTraitsA::GetAbbrevs()); - } - - static BOOL UseBitFieldForRange() throw() - { - return FALSE; - } - - static int ByteLen(const RECHARTYPE *sz) throw() - { - return (int)strlen((const char *) sz); - } -}; - -#ifndef _UNICODE -typedef CAtlRECharTraitsA CAtlRECharTraits; -#else // _UNICODE -typedef CAtlRECharTraitsW CAtlRECharTraits; -#endif // !_UNICODE -// Note: If you want to use CAtlRECharTraitsMB you must pass it in -// as a template argument - -template -class CAtlRegExp; // forward declaration - -template -class CAtlREMatchContext -{ -public: - friend CAtlRegExp; - typedef typename CharTraits::RECHARTYPE RECHAR; - - struct MatchGroup - { - const RECHAR *szStart; - const RECHAR *szEnd; - }; - - UINT m_uNumGroups; - - MatchGroup m_Match; - - void GetMatch(UINT nIndex, const RECHAR **szStart, const RECHAR **szEnd) - { - ATLENSURE(szStart != NULL); - ATLENSURE(szEnd != NULL); - ATLENSURE(nIndex >=0 && nIndex < m_uNumGroups); - *szStart = m_Matches[nIndex].szStart; - *szEnd = m_Matches[nIndex].szEnd; - } - - void GetMatch(UINT nIndex, MatchGroup *pGroup) - { - - ATLENSURE(pGroup != NULL); - ATLENSURE(nIndex >=0&&(static_cast(nIndex))< m_uNumGroups); - pGroup->szStart = m_Matches[nIndex].szStart; - pGroup->szEnd = m_Matches[nIndex].szEnd; - } - -protected: - CAutoVectorPtr m_Mem; - CAutoVectorPtr m_Matches; - CAtlArray m_stack; - size_t m_nTos; - -public: - CAtlREMatchContext(size_t nInitStackSize=ATL_REGEXP_MIN_STACK) - { - m_uNumGroups = 0; - m_nTos = 0; - m_stack.SetCount(nInitStackSize); - m_Match.szStart = NULL; - m_Match.szEnd = NULL; - } - -protected: - BOOL Initialize(UINT uRequiredMem, UINT uNumGroups) throw() - { - m_nTos = 0; - - m_uNumGroups = 0; - m_Matches.Free(); - - if (!m_Matches.Allocate(uNumGroups)) - return FALSE; - - m_uNumGroups = uNumGroups; - - m_Mem.Free(); - - if (!m_Mem.Allocate(uRequiredMem)) - return FALSE; - - memset(m_Mem.m_p, 0x00, uRequiredMem*sizeof(void *)); - - memset(m_Matches, 0x00, m_uNumGroups * sizeof(MatchGroup)); - return TRUE; - } - - BOOL Push(void *p) - { - m_nTos++; - if (m_stack.GetCount() <= (UINT) m_nTos) - { - if (!m_stack.SetCount((m_nTos+1)*2)) - { - m_nTos--; - return FALSE; - } - } - m_stack[m_nTos] = p; - return TRUE; - } - - BOOL Push(size_t n) - { - return Push((void *) n); - } - - void *Pop() throw() - { - if (m_nTos==0) - { - // stack underflow - // this should never happen at match time. - // (the parsing succeeded when it shouldn't have) - ATLASSERT(FALSE); - return NULL; - } - void *p = m_stack[m_nTos]; - m_nTos--; - return p; - } -}; - -enum REParseError { - REPARSE_ERROR_OK = 0, // No error occurred - REPARSE_ERROR_OUTOFMEMORY, // Out of memory - REPARSE_ERROR_BRACE_EXPECTED, // A closing brace was expected - REPARSE_ERROR_PAREN_EXPECTED, // A closing parenthesis was expected - REPARSE_ERROR_BRACKET_EXPECTED, // A closing bracket was expected - REPARSE_ERROR_UNEXPECTED, // An unspecified fatal error occurred - REPARSE_ERROR_EMPTY_RANGE, // A range expression was empty - REPARSE_ERROR_INVALID_GROUP, // A backreference was made to a group - // that did not exist - REPARSE_ERROR_INVALID_RANGE, // An invalid range was specified - REPARSE_ERROR_EMPTY_REPEATOP, // A possibly empty * or + was detected - REPARSE_ERROR_INVALID_INPUT, // The input string was invalid -}; - -template -class CAtlRegExp -{ -public: - CAtlRegExp() throw() - { - m_uNumGroups = 0; - m_uRequiredMem = 0; - m_bCaseSensitive = TRUE; - m_LastError = REPARSE_ERROR_OK; - } - - typedef typename CharTraits::RECHARTYPE RECHAR; - - // CAtlRegExp::Parse - // Parses the regular expression - // returns REPARSE_ERROR_OK if successful, an REParseError otherwise - REParseError Parse(const RECHAR *szRE, BOOL bCaseSensitive=TRUE) - { - ATLASSERT(szRE); - if (!szRE) - return REPARSE_ERROR_INVALID_INPUT; - - Reset(); - - m_bCaseSensitive = bCaseSensitive; - - const RECHAR *szInput = szRE; - - if (!bCaseSensitive) - { - // copy the string - int nSize = CharTraits::ByteLen(szRE)+sizeof(RECHAR); - szInput = (const RECHAR *) malloc(nSize); - if (!szInput) - return REPARSE_ERROR_OUTOFMEMORY; - - Checked::memcpy_s((char *) szInput, nSize, szRE, nSize); - - CharTraits::Strlwr(const_cast(szInput), nSize/sizeof(RECHAR)); - } - const RECHAR *sz = szInput; - - int nCall = AddInstruction(RE_CALL); - if (nCall < 0) - return REPARSE_ERROR_OUTOFMEMORY; - - if (*sz == '^') - { - if (AddInstruction(RE_FAIL) < 0) - return REPARSE_ERROR_OUTOFMEMORY; - sz++; - } - else - { - if (AddInstruction(RE_ADVANCE) < 0) - return REPARSE_ERROR_OUTOFMEMORY; - } - - bool bEmpty = true; - ParseRE(&sz, bEmpty); - if (!GetLastParseError()) - { - GetInstruction(nCall).call.nTarget = 2; - - if (AddInstruction(RE_MATCH) < 0) - return REPARSE_ERROR_OUTOFMEMORY; - } - - if (szInput != szRE) - free((void *) szInput); - - return GetLastParseError(); - } - - BOOL Match(const RECHAR *szIn, CAtlREMatchContext *pContext, const RECHAR **ppszEnd=NULL) - { - ATLASSERT(szIn); - ATLASSERT(pContext); - - if (!szIn || !pContext) - return FALSE; - - if (ppszEnd) - *ppszEnd = NULL; - - const RECHAR *szInput = szIn; - - if (!m_bCaseSensitive) - { - int nSize = CharTraits::ByteLen(szIn)+sizeof(RECHAR); - szInput = (const RECHAR *) malloc(nSize); - if (!szInput) - return FALSE; - - Checked::memcpy_s((char *) szInput, nSize, szIn, nSize); - CharTraits::Strlwr(const_cast(szInput), nSize/sizeof(RECHAR)); - } - - if (!pContext->Initialize(m_uRequiredMem, m_uNumGroups)) - { - if (szInput != szIn) - free((void *) szInput); - return FALSE; - } - - size_t ip = 0; - - const RECHAR *sz = szInput; - const RECHAR *szCurrInput = szInput; - -#pragma warning(push) -#pragma warning(disable:4127) // conditional expression is constant - - while (1) - { -#ifdef ATLRX_DEBUG - OnDebugEvent(ip, szInput, sz, pContext); -#endif - if (ip == 0) - pContext->m_Match.szStart = sz; - - switch (GetInstruction(ip).type) - { - case RE_NOP: - ip++; - break; - - case RE_SYMBOL: - if (GetInstruction(ip).symbol.nSymbol == static_cast(static_cast<_TUCHAR>(*sz))) - { - sz = CharTraits::Next(sz); - ip++; - } - else - { - ip = (size_t) pContext->Pop(); - } - break; - - case RE_ANY: - if (*sz) - { - sz = CharTraits::Next(sz); - ip++; - } - else - { - ip = (size_t) pContext->Pop(); - } - break; - - case RE_GROUP_START: - pContext->m_Matches[GetInstruction(ip).group.nGroup].szStart = sz; - ip++; - break; - - case RE_GROUP_END: - pContext->m_Matches[GetInstruction(ip).group.nGroup].szEnd = sz; - ip++; - break; - - case RE_PUSH_CHARPOS: - pContext->Push((void *) sz); - ip++; - break; - - case RE_POP_CHARPOS: - sz = (RECHAR *) pContext->Pop(); - ip++; - break; - - case RE_CALL: - pContext->Push(ip+1); - ip = GetInstruction(ip).call.nTarget; - break; - - case RE_JMP: - ip = GetInstruction(ip).jmp.nTarget; - break; - - case RE_RETURN: - ip = (size_t) pContext->Pop(); - break; - - case RE_PUSH_MEMORY: - pContext->Push((void *) (pContext->m_Mem[GetInstruction(ip).memory.nIndex])); - ip++; - break; - - case RE_POP_MEMORY: - pContext->m_Mem[GetInstruction(ip).memory.nIndex] = pContext->Pop(); - ip++; - break; - - case RE_STORE_CHARPOS: - pContext->m_Mem[GetInstruction(ip).memory.nIndex] = (void *) sz; - ip++; - break; - - case RE_GET_CHARPOS: - sz = (RECHAR *) pContext->m_Mem[GetInstruction(ip).memory.nIndex]; - ip++; - break; - - case RE_STORE_STACKPOS: - pContext->m_Mem[GetInstruction(ip).memory.nIndex] = (void *) pContext->m_nTos; - ip++; - break; - - case RE_GET_STACKPOS: - pContext->m_nTos = (size_t) pContext->m_Mem[GetInstruction(ip).memory.nIndex]; - ip++; - break; - - case RE_RET_NOMATCH: - if (sz == (RECHAR *) pContext->m_Mem[GetInstruction(ip).memory.nIndex]) - { - // do a return - ip = (size_t) pContext->Pop(); - } - else - ip++; - break; - - case RE_ADVANCE: - sz = CharTraits::Next(szCurrInput); - szCurrInput = sz; - if (*sz == '\0') - goto Error; - ip = 0; - pContext->m_nTos = 0; - break; - - case RE_FAIL: - goto Error; - - case RE_RANGE: - { - if (*sz == '\0') - { - ip = (size_t) pContext->Pop(); - break; - } - - RECHAR *pBits = reinterpret_cast((&m_Instructions[ip]+1)); - size_t u = CharTraits::GetBitFieldForRangeArrayIndex(sz); - if (pBits[u >> 3] & 1 << (u & 0x7)) - { - ip += InstructionsPerRangeBitField(); - ip++; - sz = CharTraits::Next(sz); - } - else - { - ip = (size_t) pContext->Pop(); - } - } - break; - - case RE_NOTRANGE: - { - if (*sz == '\0') - { - ip = (size_t) pContext->Pop(); - break; - } - - RECHAR *pBits = reinterpret_cast((&m_Instructions[ip]+1)); - size_t u = static_cast(static_cast<_TUCHAR>(* ((RECHAR *) sz))); - if (pBits[u >> 3] & 1 << (u & 0x7)) - { - ip = (size_t) pContext->Pop(); - } - else - { - ip += InstructionsPerRangeBitField(); - ip++; - sz = CharTraits::Next(sz); - } - } - break; - - case RE_RANGE_EX: - { - if (*sz == '\0') - { - ip = (size_t) pContext->Pop(); - break; - } - - BOOL bMatch = FALSE; - size_t inEnd = GetInstruction(ip).range.nTarget; - ip++; - - while (ip < inEnd) - { - if (static_cast(static_cast<_TUCHAR>(*sz)) >= GetInstruction(ip).memory.nIndex && - static_cast(static_cast<_TUCHAR>(*sz)) <= GetInstruction(ip+1).memory.nIndex) - { - // if we match, we jump to the end - sz = CharTraits::Next(sz); - ip = inEnd; - bMatch = TRUE; - } - else - { - ip += 2; - } - } - if (!bMatch) - { - ip = (size_t) pContext->Pop(); - } - } - break; - - case RE_NOTRANGE_EX: - { - if (*sz == '\0') - { - ip = (size_t) pContext->Pop(); - break; - } - - BOOL bMatch = TRUE; - size_t inEnd = GetInstruction(ip).range.nTarget; - ip++; - - while (ip < inEnd) - { - if (static_cast(static_cast<_TUCHAR>(*sz)) >= GetInstruction(ip).memory.nIndex && - static_cast(static_cast<_TUCHAR>(*sz)) <= GetInstruction(ip+1).memory.nIndex) - { - ip = (size_t) pContext->Pop(); - bMatch = FALSE; - break; - } - else - { - // if we match, we jump to the end - ip += 2; - } - } - if (bMatch) - sz = CharTraits::Next(sz); - } - break; - - case RE_PREVIOUS: - { - BOOL bMatch = FALSE; - if (m_bCaseSensitive) - { - bMatch = !CharTraits::Strncmp(sz, pContext->m_Matches[GetInstruction(ip).prev.nGroup].szStart, - pContext->m_Matches[GetInstruction(ip).prev.nGroup].szEnd-pContext->m_Matches[GetInstruction(ip).prev.nGroup].szStart); - } - else - { - bMatch = !CharTraits::Strnicmp(sz, pContext->m_Matches[GetInstruction(ip).prev.nGroup].szStart, - pContext->m_Matches[GetInstruction(ip).prev.nGroup].szEnd-pContext->m_Matches[GetInstruction(ip).prev.nGroup].szStart); - } - if (bMatch) - { - sz += pContext->m_Matches[GetInstruction(ip).prev.nGroup].szEnd-pContext->m_Matches[GetInstruction(ip).prev.nGroup].szStart; - ip++; - break; - } - ip = (size_t) pContext->Pop(); - } - break; - - case RE_MATCH: - pContext->m_Match.szEnd = sz; - if (!m_bCaseSensitive) - FixupMatchContext(pContext, szIn, szInput); - if (ppszEnd) - *ppszEnd = szIn + (sz - szInput); - if (szInput != szIn) - free((void *) szInput); - return TRUE; - break; - - case RE_PUSH_GROUP: - pContext->Push((void *) pContext->m_Matches[GetInstruction(ip).group.nGroup].szStart); - pContext->Push((void *) pContext->m_Matches[GetInstruction(ip).group.nGroup].szEnd); - ip++; - break; - - case RE_POP_GROUP: - pContext->m_Matches[GetInstruction(ip).group.nGroup].szEnd = (const RECHAR *) pContext->Pop(); - pContext->m_Matches[GetInstruction(ip).group.nGroup].szStart = (const RECHAR *) pContext->Pop(); - ip++; - break; - - default: - ATLASSERT(FALSE); - break; - } - } - -#pragma warning(pop) // 4127 - - ATLASSERT(FALSE); -Error: - pContext->m_Match.szEnd = sz; - if (!m_bCaseSensitive) - FixupMatchContext(pContext, szIn, szInput); - if (ppszEnd) - *ppszEnd = szIn + (sz - szInput); - if (szInput != szIn) - free((void *) szInput); - return FALSE; - } - -protected: - REParseError m_LastError; - - REParseError GetLastParseError() throw() - { - return m_LastError; - } - - void SetLastParseError(REParseError Error) throw() - { - m_LastError = Error; - } - // CAtlRegExp::Reset - // Removes all instructions to allow reparsing into the same instance - void Reset() throw() - { - m_Instructions.RemoveAll(); - m_uRequiredMem = 0; - m_bCaseSensitive = TRUE; - m_uNumGroups = 0; - SetLastParseError(REPARSE_ERROR_OK); - } - - - enum REInstructionType { - RE_NOP, - RE_GROUP_START, - RE_GROUP_END, - RE_SYMBOL, - RE_ANY, - RE_RANGE, - RE_NOTRANGE, - RE_RANGE_EX, - RE_NOTRANGE_EX, - RE_PLUS, - RE_NG_PLUS, - RE_QUESTION, - RE_NG_QUESTION, - RE_JMP, - RE_PUSH_CHARPOS, - RE_POP_CHARPOS, - RE_CALL, - RE_RETURN, - RE_STAR_BEGIN, - RE_NG_STAR_BEGIN, - RE_PUSH_MEMORY, - RE_POP_MEMORY, - RE_STORE_CHARPOS, - RE_STORE_STACKPOS, - RE_GET_CHARPOS, - RE_GET_STACKPOS, - RE_RET_NOMATCH, - RE_PREVIOUS, - RE_FAIL, - RE_ADVANCE, - RE_MATCH, - RE_PUSH_GROUP, - RE_POP_GROUP, - }; - - struct INSTRUCTION_SYMBOL - { - size_t nSymbol; - }; - - struct INSTRUCTION_JMP - { - size_t nTarget; - }; - - struct INSTRUCTION_GROUP - { - size_t nGroup; - }; - - struct INSTRUCTION_CALL - { - size_t nTarget; - }; - - struct INSTRUCTION_MEMORY - { - size_t nIndex; - }; - - struct INSTRUCTION_PREVIOUS - { - size_t nGroup; - }; - - struct INSTRUCTION_RANGE_EX - { - size_t nTarget; - }; - - struct INSTRUCTION - { - REInstructionType type; - union - { - INSTRUCTION_SYMBOL symbol; - INSTRUCTION_JMP jmp; - INSTRUCTION_GROUP group; - INSTRUCTION_CALL call; - INSTRUCTION_MEMORY memory; - INSTRUCTION_PREVIOUS prev; - INSTRUCTION_RANGE_EX range; - }; - }; - - inline int InstructionsPerRangeBitField() throw() - { - return (256/8) / sizeof(INSTRUCTION) + (((256/8) % sizeof(INSTRUCTION)) ? 1 : 0); - } - - CAtlArray m_Instructions; - - UINT m_uNumGroups; - UINT m_uRequiredMem; - BOOL m_bCaseSensitive; - - - // class used internally to restore - // parsing state when unwinding - class CParseState - { - public: - int m_nNumInstructions; - UINT m_uNumGroups; - UINT m_uRequiredMem; - - CParseState(CAtlRegExp *pRegExp) throw() - { - m_nNumInstructions = (int) pRegExp->m_Instructions.GetCount(); - m_uNumGroups = pRegExp->m_uNumGroups; - m_uRequiredMem = pRegExp->m_uRequiredMem; - } - - void Restore(CAtlRegExp *pRegExp) - { - pRegExp->m_Instructions.SetCount(m_nNumInstructions); - pRegExp->m_uNumGroups = m_uNumGroups; - pRegExp->m_uRequiredMem = m_uRequiredMem; - } - }; - - int AddInstruction(REInstructionType type) - { - if (!m_Instructions.SetCount(m_Instructions.GetCount()+1)) - { - SetLastParseError(REPARSE_ERROR_OUTOFMEMORY); - return -1; - } - - m_Instructions[m_Instructions.GetCount()-1].type = type; - return (int) m_Instructions.GetCount()-1; - } - - BOOL PeekToken(const RECHAR **ppszRE, int ch) throw() - { - if (**ppszRE != ch) - return FALSE; - return TRUE; - } - - BOOL MatchToken(const RECHAR **ppszRE, int ch) throw() - { - if (!PeekToken(ppszRE, ch)) - return FALSE; - *ppszRE = CharTraits::Next(*ppszRE); - return TRUE; - } - - INSTRUCTION &GetInstruction(size_t nIndex) throw() - { - return m_Instructions[nIndex]; - } - - // ParseArg: parse grammar rule Arg - int ParseArg(const RECHAR **ppszRE, bool &bEmpty) - { - int nPushGroup = AddInstruction(RE_PUSH_GROUP); - if (nPushGroup < 0) - return -1; - - GetInstruction(nPushGroup).group.nGroup = m_uNumGroups; - - int p = AddInstruction(RE_GROUP_START); - if (p < 0) - return -1; - GetInstruction(p).group.nGroup = m_uNumGroups++; - - int nCall = AddInstruction(RE_CALL); - if (nCall < 0) - return -1; - - int nPopGroup = AddInstruction(RE_POP_GROUP); - if (nPopGroup < 0) - return -1; - GetInstruction(nPopGroup).group.nGroup = GetInstruction(nPushGroup).group.nGroup; - - if (AddInstruction(RE_RETURN) < 0) - return -1; - - int nAlt = ParseRE(ppszRE, bEmpty); - if (nAlt < 0) - { - if (GetLastParseError()) - return -1; - - if (!PeekToken(ppszRE, '}')) - { - SetLastParseError(REPARSE_ERROR_BRACE_EXPECTED); - return -1; - } - - // in the case of an empty group, we add a nop - nAlt = AddInstruction(RE_NOP); - if (nAlt < 0) - return -1; - } - - GetInstruction(nCall).call.nTarget = nAlt; - - if (!MatchToken(ppszRE, '}')) - { - SetLastParseError(REPARSE_ERROR_BRACE_EXPECTED); - return -1; - } - - int nEnd = AddInstruction(RE_GROUP_END); - if (nEnd < 0) - return -1; - GetInstruction(nEnd).group.nGroup = GetInstruction(p).group.nGroup; - return nPushGroup; - } - - // ParseGroup: parse grammar rule Group - int ParseGroup(const RECHAR **ppszRE, bool &bEmpty) - { - int nCall = AddInstruction(RE_CALL); - if (nCall < 0) - return -1; - - if (AddInstruction(RE_RETURN) < 0) - return -1; - - int nAlt = ParseRE(ppszRE, bEmpty); - if (nAlt < 0) - { - if (GetLastParseError()) - return -1; - - if (!PeekToken(ppszRE, ')')) - { - SetLastParseError(REPARSE_ERROR_PAREN_EXPECTED); - return -1; - } - - // in the case of an empty group, we add a nop - nAlt = AddInstruction(RE_NOP); - if (nAlt < 0) - return -1; - } - - GetInstruction(nCall).call.nTarget = nAlt; - - if (!MatchToken(ppszRE, ')')) - { - SetLastParseError(REPARSE_ERROR_PAREN_EXPECTED); - return -1; - } - - return nCall; - } - - RECHAR GetEscapedChar(RECHAR ch) throw() - { - if (ch == 't') - return '\t'; - return ch; - } - - // ParseCharItem: parse grammar rule CharItem - int ParseCharItem(const RECHAR **ppszRE, RECHAR *pchStartChar, RECHAR *pchEndChar) throw() - { - if (**ppszRE == '\\') - { - *ppszRE = CharTraits::Next(*ppszRE); - *pchStartChar = GetEscapedChar(**ppszRE); - } - else - *pchStartChar = **ppszRE; - *ppszRE = CharTraits::Next(*ppszRE); - - if (!MatchToken(ppszRE, '-')) - { - *pchEndChar = *pchStartChar; - return 0; - } - - // check for unterminated range - if (!**ppszRE || PeekToken(ppszRE, ']')) - { - SetLastParseError(REPARSE_ERROR_BRACKET_EXPECTED); - return -1; - } - - *pchEndChar = **ppszRE; - *ppszRE = CharTraits::Next(*ppszRE); - - if (*pchEndChar < *pchStartChar) - { - SetLastParseError(REPARSE_ERROR_INVALID_RANGE); - return -1; - } - return 0; - } - - int AddInstructions(int nNumInstructions) - { - size_t nCurr = m_Instructions.GetCount(); - if (!m_Instructions.SetCount(nCurr+nNumInstructions)) - { - SetLastParseError(REPARSE_ERROR_OUTOFMEMORY); - return -1; - } - return (int) nCurr; - } - - // ParseCharSet: parse grammar rule CharSet - int ParseCharSet(const RECHAR **ppszRE, BOOL bNot) - { - int p = -1; - - unsigned char *pBits = NULL; - - if (CharTraits::UseBitFieldForRange()) - { - // we use a bit field to represent the characters - // a 1 bit means match against the character - // the last 5 bits are used as an index into - // the byte array, and the first 3 bits - // are used to index into the selected byte - - p = AddInstruction(bNot ? RE_NOTRANGE : RE_RANGE); - if (p < 0) - return -1; - - // add the required space to hold the character - // set. We use one bit per character for ansi - if (AddInstructions(InstructionsPerRangeBitField()) < 0) - return -1; - - pBits = (unsigned char *) (&m_Instructions[p+1]); - memset(pBits, 0x00, 256/8); - } - else - { - p = AddInstruction(bNot ? RE_NOTRANGE_EX : RE_RANGE_EX); - if (p < 0) - return -1; - } - - RECHAR chStart; - RECHAR chEnd; - - while (**ppszRE && **ppszRE != ']') - { - if (ParseCharItem(ppszRE, &chStart, &chEnd)) - return -1; - - if (CharTraits::UseBitFieldForRange()) - { - for (int i=chStart; i<=chEnd; i++) - pBits[i >> 3] |= 1 << (i & 0x7); - } - else - { - int nStart = AddInstruction(RE_NOP); - if (nStart < 0) - return -1; - - int nEnd = AddInstruction(RE_NOP); - if (nEnd < 0) - return -1; - - GetInstruction(nStart).memory.nIndex = (int) chStart; - GetInstruction(nEnd).memory.nIndex = (int) chEnd; - } - } - - if (!CharTraits::UseBitFieldForRange()) - GetInstruction(p).range.nTarget = m_Instructions.GetCount(); - - return p; - } - - // ParseCharClass: parse grammar rule CharClass - int ParseCharClass(const RECHAR **ppszRE, bool &bEmpty) - { - bEmpty = false; - if (MatchToken(ppszRE, ']')) - { - SetLastParseError(REPARSE_ERROR_EMPTY_RANGE); - return -1; - } - - BOOL bNot = FALSE; - if (MatchToken(ppszRE, '^')) - bNot = TRUE; - - if (MatchToken(ppszRE, ']')) - { - SetLastParseError(REPARSE_ERROR_EMPTY_RANGE); - return -1; - } - - int p = ParseCharSet(ppszRE, bNot); - if (p < 0) - return p; - if (!MatchToken(ppszRE, ']')) - { - SetLastParseError(REPARSE_ERROR_BRACKET_EXPECTED); - return -1; - } - - return p; - } - - int AddMemInstruction(REInstructionType type) - { - int p = AddInstruction(type); - if (p < 0) - return p; - GetInstruction(p).memory.nIndex = m_uRequiredMem++; - return p; - } - - // helper for parsing !SE - int ParseNot(const RECHAR **ppszRE, bool &bEmpty) - { - int nStoreCP = AddMemInstruction(RE_STORE_CHARPOS); - int nStoreSP = AddMemInstruction(RE_STORE_STACKPOS); - - int nCall = AddInstruction(RE_CALL); - if (nCall < 0) - return -1; - - int nGetCP = AddInstruction(RE_GET_CHARPOS); - if (nGetCP < 0) - return -1; - GetInstruction(nGetCP).memory.nIndex = GetInstruction(nStoreCP).memory.nIndex; - - int nGetSP = AddInstruction(RE_GET_STACKPOS); - if (nGetSP < 0) - return -1; - GetInstruction(nGetSP).memory.nIndex = GetInstruction(nStoreSP).memory.nIndex; - - int nJmp = AddInstruction(RE_JMP); - if (nJmp < 0) - return -1; - - int nSE = ParseSE(ppszRE, bEmpty); - if (nSE < 0) - return nSE; - - // patch the call - GetInstruction(nCall).call.nTarget = nSE; - - int nGetCP1 = AddInstruction(RE_GET_CHARPOS); - if (nGetCP1 < 0) - return -1; - GetInstruction(nGetCP1).memory.nIndex = GetInstruction(nStoreCP).memory.nIndex; - - int nGetSP1 = AddInstruction(RE_GET_STACKPOS); - if (nGetSP1 < 0) - return -1; - GetInstruction(nGetSP1).memory.nIndex = GetInstruction(nStoreSP).memory.nIndex; - - int nRet = AddInstruction(RE_RETURN); - if (nRet < 0) - return -1; - - GetInstruction(nJmp).jmp.nTarget = nRet+1; - - return nStoreCP; - } - - // ParseAbbrev: parse grammar rule Abbrev - int ParseAbbrev(const RECHAR **ppszRE, bool &bEmpty) - { - const RECHAR **szAbbrevs = CharTraits::GetAbbrevs(); - - while (*szAbbrevs) - { - if (**ppszRE == **szAbbrevs) - { - const RECHAR *szAbbrev = (*szAbbrevs)+1; - int p = ParseE(&szAbbrev, bEmpty); - if (p < 0) - { - SetLastParseError(REPARSE_ERROR_UNEXPECTED); - return p; - } - *ppszRE = CharTraits::Next(*ppszRE); - return p; - } - szAbbrevs++; - } - return -1; - } - - // ParseSE: parse grammar rule SE (simple expression) - int ParseSE(const RECHAR **ppszRE, bool &bEmpty) - { - - if (MatchToken(ppszRE, '{')) - return ParseArg(ppszRE, bEmpty); - if (MatchToken(ppszRE, '(')) - return ParseGroup(ppszRE, bEmpty); - if (MatchToken(ppszRE, '[')) - return ParseCharClass(ppszRE, bEmpty); - - if (MatchToken(ppszRE, '\\')) - { - if (!CharTraits::Isdigit(**ppszRE)) - { - // check for abbreviations - int p; - p = ParseAbbrev(ppszRE, bEmpty); - if (p >= 0) - return p; - - if (GetLastParseError()) - return -1; - - // escaped char - p = AddInstruction(RE_SYMBOL); - if (p < 0) - return -1; - GetInstruction(p).symbol.nSymbol = (int) **ppszRE; - *ppszRE = CharTraits::Next(*ppszRE); - return p; - } - // previous match - bEmpty = false; - int nPrev = AddInstruction(RE_PREVIOUS); - if (nPrev < 0) - return -1; - - UINT uValue = (UINT) CharTraits::Strtol(*ppszRE, (RECHAR **) ppszRE, 10); - if (uValue >= m_uNumGroups) - { - SetLastParseError(REPARSE_ERROR_INVALID_GROUP); - return -1; - } - GetInstruction(nPrev).prev.nGroup = (size_t) uValue; - return nPrev; - } - - if (MatchToken(ppszRE, '!')) - return ParseNot(ppszRE, bEmpty); - - if (**ppszRE == '}' || **ppszRE == ']' || **ppszRE == ')') - { - return -1; - } - - if (**ppszRE == '\0') - { - return -1; - } - - int p; - if (**ppszRE == '.') - { - p = AddInstruction(RE_ANY); - if (p < 0) - return -1; - bEmpty = false; - } - else if (**ppszRE == '$' && (*ppszRE)[1] == '\0') - { - p = AddInstruction(RE_SYMBOL); - if (p < 0) - return -1; - GetInstruction(p).symbol.nSymbol = 0; - bEmpty = false; - } - else - { - p = AddInstruction(RE_SYMBOL); - if (p < 0) - return -1; - GetInstruction(p).symbol.nSymbol = (int) **ppszRE; - bEmpty = false; - } - *ppszRE = CharTraits::Next(*ppszRE); - return p; - } - - // ParseE: parse grammar rule E (expression) - int ParseE(const RECHAR **ppszRE, bool &bEmpty) - { - CParseState ParseState(this); - const RECHAR *sz = *ppszRE; - - int nSE; - - int nFirst = ParseSE(ppszRE, bEmpty); - if (nFirst < 0) - return nFirst; - - REInstructionType type = RE_MATCH; - - if (MatchToken(ppszRE, '*')) - if(MatchToken(ppszRE, '?')) - type = RE_NG_STAR_BEGIN; - else - type = RE_STAR_BEGIN; - - - else if (MatchToken(ppszRE, '+')) - if(MatchToken(ppszRE, '?')) - type = RE_NG_PLUS; - else - type = RE_PLUS; - - else if (MatchToken(ppszRE, '?')) - if(MatchToken(ppszRE, '?')) - type = RE_NG_QUESTION; - else - type = RE_QUESTION; - - - if (type == RE_MATCH) - return nFirst; - - if (type == RE_STAR_BEGIN || type == RE_QUESTION|| type == RE_NG_STAR_BEGIN || type == RE_NG_QUESTION) - { - ParseState.Restore(this); - } - else - { - m_uNumGroups = ParseState.m_uNumGroups; - } - *ppszRE = sz; - - int nE; - - if (type == RE_NG_STAR_BEGIN || type == RE_NG_PLUS || type == RE_NG_QUESTION) // Non-Greedy - { - int nCall = AddInstruction(RE_CALL); - if (nCall < 0) - return -1; - - bEmpty = false; - - nSE = ParseSE(ppszRE, bEmpty); - if (nSE < 0) - return nSE; - - if (bEmpty && (type == RE_NG_STAR_BEGIN || type == RE_NG_PLUS)) - { - SetLastParseError(REPARSE_ERROR_EMPTY_REPEATOP); - return -1; - } - bEmpty = true; - - *ppszRE = CharTraits::Next(*ppszRE); - *ppszRE = CharTraits::Next(*ppszRE); - - if (type == RE_NG_STAR_BEGIN || type == RE_NG_PLUS) - { - int nJmp = AddInstruction(RE_JMP); - if (nJmp < 0) - return -1; - GetInstruction(nCall).call.nTarget = nJmp+1; - GetInstruction(nJmp).jmp.nTarget = nCall; - } - else - GetInstruction(nCall).call.nTarget = nSE+1; - - if (type == RE_NG_PLUS) - nE = nFirst; - else - nE = nCall; - } - else // Greedy - { - - int nPushMem = AddInstruction(RE_PUSH_MEMORY); - if (nPushMem < 0) - return -1; - - int nStore = AddInstruction(RE_STORE_CHARPOS); - if (nStore < 0) - return -1; - - if (AddInstruction(RE_PUSH_CHARPOS) < 0) - return -1; - - int nCall = AddInstruction(RE_CALL); - if (nCall < 0) - return -1; - - if (AddInstruction(RE_POP_CHARPOS) < 0) - return -1; - - int nPopMem = AddInstruction(RE_POP_MEMORY); - if (nPopMem < 0) - return -1; - - int nJmp = AddInstruction(RE_JMP); - if (nJmp < 0) - return -1; - - GetInstruction(nPushMem).memory.nIndex = m_uRequiredMem++; - GetInstruction(nStore).memory.nIndex = GetInstruction(nPushMem).memory.nIndex; - GetInstruction(nCall).call.nTarget = nJmp+1; - GetInstruction(nPopMem).memory.nIndex = GetInstruction(nPushMem).memory.nIndex; - - bEmpty = false; - - nSE = ParseSE(ppszRE, bEmpty); - if (nSE < 0) - return nSE; - - if (bEmpty && (type == RE_STAR_BEGIN || type == RE_PLUS)) - { - SetLastParseError(REPARSE_ERROR_EMPTY_REPEATOP); - return -1; - } - - if (type != RE_PLUS && type != RE_NG_PLUS) - bEmpty = true; - - *ppszRE = CharTraits::Next(*ppszRE); - - - int nRetNoMatch = AddInstruction(RE_RET_NOMATCH); - if (nRetNoMatch < 0) - return -1; - - int nStore1 = AddInstruction(RE_STORE_CHARPOS); - if (nStore1 < 0) - return -1; - - GetInstruction(nRetNoMatch).memory.nIndex = GetInstruction(nPushMem).memory.nIndex; - GetInstruction(nStore1).memory.nIndex = GetInstruction(nPushMem).memory.nIndex; - - if (type != RE_QUESTION) - { - int nJmp1 = AddInstruction(RE_JMP); - if (nJmp1 < 0) - return -1; - GetInstruction(nJmp1).jmp.nTarget = nPushMem; - } - - GetInstruction(nJmp).jmp.nTarget = m_Instructions.GetCount(); - if (type == RE_PLUS) - nE = nFirst; - else - nE = nPushMem; - } - - return nE; - } - - - // ParseAltE: parse grammar rule AltE - int ParseAltE(const RECHAR **ppszRE, bool &bEmpty) - { - const RECHAR *sz = *ppszRE; - CParseState ParseState(this); - - int nPush = AddInstruction(RE_PUSH_CHARPOS); - if (nPush < 0) - return -1; - - int nCall = AddInstruction(RE_CALL); - if (nCall < 0) - return -1; - - GetInstruction(nCall).call.nTarget = nPush+4; - if (AddInstruction(RE_POP_CHARPOS) < 0) - return -1; - - int nJmpNext = AddInstruction(RE_JMP); - if (nJmpNext < 0) - return -1; - - int nE = ParseE(ppszRE, bEmpty); - if (nE < 0) - { - if (GetLastParseError()) - return -1; - ParseState.Restore(this); - return nE; - } - - int nJmpEnd = AddInstruction(RE_JMP); - if (nJmpEnd < 0) - return -1; - - GetInstruction(nJmpNext).jmp.nTarget = nJmpEnd+1; - - if (!MatchToken(ppszRE, '|')) - { - ParseState.Restore(this); - *ppszRE = sz; - - return ParseE(ppszRE, bEmpty); - } - - bool bEmptyAltE; - int nAltE = ParseAltE(ppszRE, bEmptyAltE); - GetInstruction(nJmpEnd).jmp.nTarget = m_Instructions.GetCount(); - GetInstruction(nJmpNext).jmp.nTarget = nAltE; - if (nAltE < 0) - { - if (GetLastParseError()) - return -1; - ParseState.Restore(this); - return nAltE; - } - bEmpty = bEmpty | bEmptyAltE; - return nPush; - } - - // ParseRE: parse grammar rule RE (regular expression) - int ParseRE(const RECHAR **ppszRE, bool &bEmpty) - { - if (**ppszRE == '\0') - return -1; - - int p = ParseAltE(ppszRE, bEmpty); - if (p < 0) - return p; - - bool bEmptyRE = true; - ParseRE(ppszRE, bEmptyRE); - if (GetLastParseError()) - return -1; - bEmpty = bEmpty && bEmptyRE; - return p; - } - - //pointers to the matched string and matched groups, currently point into an internal allocated - //buffer that hold a copy of the input string. - //This function fix these pointers to point into the original, user supplied buffer (first param to Match method). - //Example: If a ptr (szStart) currently point to +3, it is fixed to +3 - void FixupMatchContext(CAtlREMatchContext *pContext, const RECHAR *szOrig, const RECHAR *szNew) - { - ATLENSURE(pContext); - ATLASSERT(szOrig); - ATLASSERT(szNew); - - pContext->m_Match.szStart = szOrig + (pContext->m_Match.szStart - szNew); - pContext->m_Match.szEnd = szOrig + (pContext->m_Match.szEnd - szNew); - for (UINT i=0; im_uNumGroups; i++) - { - if (pContext->m_Matches[i].szStart==NULL || pContext->m_Matches[i].szEnd==NULL) - { - continue; //Do not fix unmatched groups. - } - pContext->m_Matches[i].szStart = szOrig + (pContext->m_Matches[i].szStart - szNew); - pContext->m_Matches[i].szEnd = szOrig + (pContext->m_Matches[i].szEnd - szNew); - } - } - // implementation - // helpers for dumping and debugging the rx engine -public: -#ifdef ATL_REGEXP_DUMP - size_t DumpInstruction(size_t ip) - { - printf("%08x ", ip); - switch (GetInstruction(ip).type) - { - case RE_NOP: - printf("NOP\n"); - ip++; - break; - - case RE_SYMBOL: - AtlprintfT(CAToREChar("Symbol %c\n"),GetInstruction(ip).symbol.nSymbol); - ip++; - break; - - case RE_ANY: - printf("Any\n"); - ip++; - break; - - case RE_RANGE: - printf("Range\n"); - ip++; - ip += InstructionsPerRangeBitField(); - break; - - case RE_NOTRANGE: - printf("NOT Range\n"); - ip++; - ip += InstructionsPerRangeBitField(); - break; - - case RE_RANGE_EX: - printf("RangeEx %08x\n", GetInstruction(ip).range.nTarget); - ip++; - break; - - case RE_NOTRANGE_EX: - printf("NotRangeEx %08x\n", GetInstruction(ip).range.nTarget); - ip++; - break; - - case RE_GROUP_START: - printf("Start group %d\n", GetInstruction(ip).group.nGroup); - ip++; - break; - - case RE_GROUP_END: - printf("Group end %d\n", GetInstruction(ip).group.nGroup); - ip++; - break; - - case RE_PUSH_CHARPOS: - printf("Push char pos\n"); - ip++; - break; - - case RE_POP_CHARPOS: - printf("Pop char pos\n"); - ip++; - break; - - case RE_STORE_CHARPOS: - printf("Store char pos %d\n", GetInstruction(ip).memory.nIndex); - ip++; - break; - - case RE_GET_CHARPOS: - printf("Get char pos %d\n", GetInstruction(ip).memory.nIndex); - ip++; - break; - - case RE_STORE_STACKPOS: - printf("Store stack pos %d\n", GetInstruction(ip).memory.nIndex); - ip++; - break; - - case RE_GET_STACKPOS: - printf("Get stack pos %d\n", GetInstruction(ip).memory.nIndex); - ip++; - break; - - case RE_CALL: - printf("Call %08x\n", GetInstruction(ip).call.nTarget); - ip++; - break; - - case RE_JMP: - printf("Jump %08x\n", GetInstruction(ip).jmp.nTarget); - ip++; - break; - - case RE_RETURN: - printf("return\n"); - ip++; - break; - - case RE_PUSH_MEMORY: - printf("Push memory %08x\n", GetInstruction(ip).memory.nIndex); - ip++; - break; - - case RE_POP_MEMORY: - printf("Pop memory %08x\n", GetInstruction(ip).memory.nIndex); - ip++; - break; - - case RE_RET_NOMATCH: - printf("Return no match %08x\n", GetInstruction(ip).memory.nIndex); - ip++; - break; - - case RE_MATCH: - printf("END\n"); - ip++; - break; - - case RE_ADVANCE: - printf("ADVANCE\n"); - ip++; - break; - - case RE_FAIL: - printf("FAIL\n"); - ip++; - break; - - case RE_PREVIOUS: - printf("Prev %d\n", GetInstruction(ip).prev.nGroup); - ip++; - break; - - case RE_PUSH_GROUP: - printf("Push group %d\n", GetInstruction(ip).group.nGroup); - ip++; - break; - - case RE_POP_GROUP: - printf("Pop group %d\n", GetInstruction(ip).group.nGroup); - ip++; - break; - - - default: - printf("????\n"); - ip++; - break; - } - return ip; - } - - void Dump(size_t ipCurrent = 0) - { - size_t ip = 0; - - while (ip < m_Instructions.GetCount()) - { - if (ip == ipCurrent) - printf("->"); - ip = DumpInstruction(ip); - } - } -#endif - -#ifdef ATLRX_DEBUG - void cls( HANDLE hConsole ) - { - COORD coordScreen = { 0, 0 }; /* here's where we'll home the - cursor */ - BOOL bSuccess; - DWORD cCharsWritten; - CONSOLE_SCREEN_BUFFER_INFO csbi; /* to get buffer info */ - DWORD dwConSize; /* number of character cells in - the current buffer */ - - /* get the number of character cells in the current buffer */ - - bSuccess = GetConsoleScreenBufferInfo( hConsole, &csbi ); - dwConSize = csbi.dwSize.X * csbi.dwSize.Y; - - /* fill the entire screen with blanks */ - - bSuccess = FillConsoleOutputCharacter( hConsole, (TCHAR) ' ', - dwConSize, coordScreen, &cCharsWritten ); - - /* get the current text attribute */ - - bSuccess = GetConsoleScreenBufferInfo( hConsole, &csbi ); - - /* now set the buffer's attributes accordingly */ - - bSuccess = FillConsoleOutputAttribute( hConsole, csbi.wAttributes, - dwConSize, coordScreen, &cCharsWritten ); - - /* put the cursor at (0, 0) */ - - bSuccess = SetConsoleCursorPosition( hConsole, coordScreen ); - return; - } - - void DumpStack(CAtlREMatchContext *pContext) - { - for (size_t i=pContext->m_nTos; i>0; i--) - { - if (pContext->m_stack[i] < (void *) m_Instructions.GetCount()) - printf("0x%p\n", pContext->m_stack[i]); - else - { - // assume a pointer into the input - AtlprintfT(CAToREChar("%s\n"), pContext->m_stack[i]); - } - } - } - - void DumpMemory(CAtlREMatchContext *pContext) - { - for (UINT i=0; i(CAToREChar("%d: %s\n"), i, pContext->m_Mem.m_p[i]); - } - } - - virtual void OnDebugEvent(size_t ip, const RECHAR *szIn, const RECHAR *sz, CAtlREMatchContext *pContext) - { - cls(GetStdHandle(STD_OUTPUT_HANDLE)); - printf("----------Code---------\n"); - Dump(ip); - printf("----------Input---------\n"); - AtlprintfT(CAToREChar("%s\n"), szIn); - for (int s=0; szIn+s < sz; s++) - { - printf(" "); - } - printf("^\n"); - printf("----------Memory---------\n"); - DumpMemory(pContext); - printf("----------Stack---------\n"); - DumpStack(pContext); - getchar(); - } -#endif - -}; - -} // namespace ATL -#pragma pack(pop) - -#endif // __ATLRX_H__ diff --git a/include/atl/atlserr.h b/include/atl/atlserr.h deleted file mode 100644 index 1e90016fb..000000000 --- a/include/atl/atlserr.h +++ /dev/null @@ -1,174 +0,0 @@ -// This is a part of the Active Template Library. -// Copyright (C) Microsoft Corporation -// All rights reserved. -// -// This source code is only intended as a supplement to the -// Active Template Library Reference and related -// electronic documentation provided with the library. -// See these sources for detailed information regarding the -// Active Template Library product. - -#ifndef __ATLSERR_H__ -#define __ATLSERR_H__ - -#pragma once -#pragma pack(push,_ATL_PACKING) -namespace ATL{ - -#define VALIDATION_S_OK 0x00000000 -#define VALIDATION_S_EMPTY 0x00000001 -#define VALIDATION_E_PARAMNOTFOUND 0x00000002 -#define VALIDATION_E_LENGTHMIN 0x80000083 -#define VALIDATION_E_LENGTHMAX 0x80000084 -#define VALIDATION_E_INVALIDLENGTH 0x80000080 -#define VALIDATION_E_INVALIDPARAM 0x80000005 -#define VALIDATION_E_FAIL 0x80000006 - -#define VALIDATION_SUCCEEDED(x) (((x == VALIDATION_S_OK) || (x == VALIDATION_S_EMPTY ))) - -typedef DWORD HTTP_CODE; - -#define HTTP_ERROR(err, sub) ((HTTP_CODE)(DWORD_PTR)MAKELONG((WORD)err, (WORD)sub)) -#define HTTP_ERROR_CODE(err) ((DWORD)LOWORD(err)) -#define HTTP_SUBERROR_CODE(err) ((DWORD)HIWORD(err)) -#define HTTP_SUCCESS HTTP_ERROR(0, 0) - -#define SUBERR_NONE 0 -#define ISE_SUBERR_BADSRF 1 -#define ISE_SUBERR_HNDLFAIL 2 -#define ISE_SUBERR_SYSOBJFAIL 3 -#define ISE_SUBERR_READFILEFAIL 4 -#define ISE_SUBERR_LOADFILEFAIL 6 -#define ISE_SUBERR_LOADLIB 7 -#define ISE_SUBERR_HANDLERIF 8 -#define ISE_SUBERR_OUTOFMEM 9 -#define ISE_SUBERR_UNEXPECTED 10 -#define ISE_SUBERR_STENCIL_INVALIDFUNCOFFSET 11 -#define ISE_SUBERR_STENCIL_MISMATCHWHILE 12 -#define ISE_SUBERR_STENCIL_MISMATCHIF 13 -#define ISE_SUBERR_STENCIL_UNEXPECTEDTYPE 14 -#define ISE_SUBERR_STENCIL_INVALIDINDEX 15 -#define ISE_SUBERR_STENCIL_INDEXOUTOFRANGE 16 -#define ISE_SUBERR_STENCIL_PARSE_FAIL 17 -#define ISE_SUBERR_STENCIL_LOAD_FAIL 18 -#define ISE_SUBERR_HANDLER_NOT_FOUND 19 -#define ISE_SUBERR_BAD_HANDLER_TAG 20 -#define ISE_SUBERR_NO_HANDLER_TAG 21 -#define ISE_SUBERR_LONGMETHODNAME 22 -#define ISE_SUBERR_LONGHANDLERNAME 23 -#define ISE_SUBERR_IMPERSONATIONFAILED 24 -#define ISE_SUBERR_ISAPISTARTUPFAILED 25 -#define ISE_SUBERR_SOAPNOSOAPACTION 26 -#define SUBERR_NO_PROCESS 27 -#define SUBERR_S_FALSE 28 -#define SUBERR_ASYNC 29 -#define SUBERR_ASYNC_DONE 30 -#define SUBERR_ASYNC_NOFLUSH 31 -#define SUBERR_ASYNC_NOFLUSH_DONE 32 -#define SUBERR_NO_CACHE 33 -#define DBG_SUBERR_ALREADY_DEBUGGING 34 -#define DBG_SUBERR_NOT_DEBUGGING 35 -#define DBG_SUBERR_INVALID_SESSION 36 -#define DBG_SUBERR_BAD_ID 37 -#define DBG_SUBERR_COCREATE 38 -#define DBG_SUBERR_ATTACH 39 - - -#define HTTP_FAIL HTTP_ERROR(500, SUBERR_NONE) -#define HTTP_SUCCESS_NO_PROCESS HTTP_ERROR(200, SUBERR_NO_PROCESS) -#define HTTP_S_FALSE HTTP_ERROR(HTTP_ERROR_CODE(HTTP_SUCCESS), SUBERR_S_FALSE) -#define HTTP_SUCCESS_ASYNC HTTP_ERROR(200, SUBERR_ASYNC) -#define HTTP_SUCCESS_ASYNC_DONE HTTP_ERROR(200, SUBERR_ASYNC_DONE) -#define HTTP_SUCCESS_ASYNC_NOFLUSH HTTP_ERROR(200, SUBERR_ASYNC_NOFLUSH) -#define HTTP_SUCCESS_ASYNC_NOFLUSH_DONE HTTP_ERROR(200, SUBERR_ASYNC_NOFLUSH_DONE) -#define HTTP_SUCCESS_NO_CACHE HTTP_ERROR(200, SUBERR_NO_CACHE) -#define HTTP_OK HTTP_ERROR(200, SUBERR_NONE) -#define HTTP_CONTINUE HTTP_ERROR(100, SUBERR_NONE) - -#define HTTP_CREATED HTTP_ERROR(201, SUBERR_NONE) -#define HTTP_ACCEPTED HTTP_ERROR(202, SUBERR_NONE) -#define HTTP_NON_AUTHORITATIVE HTTP_ERROR(203, SUBERR_NONE) -#define HTTP_NO_CONTENT HTTP_ERROR(204, SUBERR_NONE) -#define HTTP_RESET_CONTENT HTTP_ERROR(205, SUBERR_NONE) -#define HTTP_PARTIAL_CONTENT HTTP_ERROR(206, SUBERR_NONE) - -#define HTTP_MULTIPLE_CHOICES HTTP_ERROR(300, SUBERR_NONE) -#define HTTP_MOVED_PERMANENTLY HTTP_ERROR(301, SUBERR_NONE) -#define HTTP_FOUND HTTP_ERROR(302, SUBERR_NONE) -#define HTTP_SEE_OTHER HTTP_ERROR(303, SUBERR_NONE) -#define HTTP_NOT_MODIFIED HTTP_ERROR(304, SUBERR_NONE) -#define HTTP_USE_PROXY HTTP_ERROR(305, SUBERR_NONE) -#define HTTP_TEMPORARY_REDIRECT HTTP_ERROR(307, SUBERR_NONE) - -#define HTTP_BAD_REQUEST HTTP_ERROR(400, SUBERR_NONE) -#define HTTP_UNAUTHORIZED HTTP_ERROR(401, SUBERR_NONE) -#define HTTP_PAYMENT_REQUIRED HTTP_ERROR(402, SUBERR_NONE) -#define HTTP_FORBIDDEN HTTP_ERROR(403, SUBERR_NONE) -#define HTTP_NOT_FOUND HTTP_ERROR(404, SUBERR_NONE) -#define HTTP_METHOD_NOT_ALLOWED HTTP_ERROR(405, SUBERR_NONE) -#define HTTP_NOT_ACCEPTABLE HTTP_ERROR(406, SUBERR_NONE) -#define HTTP_PROXY_AUTHENTICATION_REQUIRED HTTP_ERROR(407, SUBERR_NONE) -#define HTTP_REQUEST_TIMEOUT HTTP_ERROR(408, SUBERR_NONE) -#define HTTP_CONFLICT HTTP_ERROR(409, SUBERR_NONE) -#define HTTP_GONE HTTP_ERROR(410, SUBERR_NONE) -#define HTTP_LENGTH_REQUIRED HTTP_ERROR(411, SUBERR_NONE) -#define HTTP_PRECONDITION_FAILED HTTP_ERROR(412, SUBERR_NONE) -#define HTTP_REQUEST_ENTITY_TOO_LONG HTTP_ERROR(413, SUBERR_NONE) -#define HTTP_REQUEST_URI_TOO_LONG HTTP_ERROR(414, SUBERR_NONE) -#define HTTP_UNSUPPORTED_MEDIA_TYPE HTTP_ERROR(415, SUBERR_NONE) -#define HTTP_RANGE_NOT_SATISFIABLE HTTP_ERROR(416, SUBERR_NONE) -#define HTTP_EXPECTATION_FAILED HTTP_ERROR(417, SUBERR_NONE) - -#define HTTP_INTERNAL_SERVER_ERROR HTTP_ERROR(500, SUBERR_NONE) -#define HTTP_NOT_IMPLEMENTED HTTP_ERROR(501, SUBERR_NONE) -#define HTTP_BAD_GATEWAY HTTP_ERROR(502, SUBERR_NONE) -#define HTTP_SERVICE_UNAVAILABLE HTTP_ERROR(503, SUBERR_NONE) -#define HTTP_GATEWAY_TIMEOUT HTTP_ERROR(504, SUBERR_NONE) -#define HTTP_VERSION_NOT_SUPPORTED HTTP_ERROR(505, SUBERR_NONE) - -inline bool IsAsyncStatus(HTTP_CODE hcStatus) -{ - return - hcStatus == HTTP_SUCCESS_ASYNC || - hcStatus == HTTP_SUCCESS_ASYNC_DONE || - hcStatus == HTTP_SUCCESS_ASYNC_NOFLUSH || - hcStatus == HTTP_SUCCESS_ASYNC_NOFLUSH_DONE; -} - -inline bool IsAsyncContinueStatus(HTTP_CODE hcStatus) -{ - return - hcStatus == HTTP_SUCCESS_ASYNC || - hcStatus == HTTP_SUCCESS_ASYNC_NOFLUSH; -} - -inline bool IsAsyncDoneStatus(HTTP_CODE hcStatus) -{ - return - hcStatus == HTTP_SUCCESS_ASYNC_DONE || - hcStatus == HTTP_SUCCESS_ASYNC_NOFLUSH_DONE; -} - -inline bool IsAsyncFlushStatus(HTTP_CODE hcStatus) -{ - return - hcStatus == HTTP_SUCCESS_ASYNC || - hcStatus == HTTP_SUCCESS_ASYNC_DONE; -} - -inline bool IsAsyncNoFlushStatus(HTTP_CODE hcStatus) -{ - return - hcStatus == HTTP_SUCCESS_ASYNC_NOFLUSH || - hcStatus == HTTP_SUCCESS_ASYNC_NOFLUSH_DONE; -} - -ATL_NOINLINE inline HTTP_CODE AtlsHttpError(WORD wStatus, WORD wSubErr) throw() -{ - return HTTP_ERROR(wStatus, wSubErr); -} - -}; // namespace ATL -#pragma pack(pop) - -#endif // __ATLSERR_H__ diff --git a/include/atl/atlsession.h b/include/atl/atlsession.h deleted file mode 100644 index 808748b21..000000000 --- a/include/atl/atlsession.h +++ /dev/null @@ -1,2490 +0,0 @@ -// This is a part of the Active Template Library. -// Copyright (C) Microsoft Corporation -// All rights reserved. -// -// This source code is only intended as a supplement to the -// Active Template Library Reference and related -// electronic documentation provided with the library. -// See these sources for detailed information regarding the -// Active Template Library product. - -#ifndef __ATLSESSION_H__ -#define __ATLSESSION_H__ - -#pragma once -#pragma warning(push) -#pragma warning(disable: 4702) // unreachable code - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#pragma warning(disable: 4625) // copy constructor could not be generated because a base class copy constructor is inaccessible -#pragma warning(disable: 4626) // assignment operator could not be generated because a base class assignment operator is inaccessible - -#ifndef MAX_SESSION_KEY_LEN - #define MAX_SESSION_KEY_LEN 128 -#endif - -#ifndef MAX_VARIABLE_NAME_LENGTH - #define MAX_VARIABLE_NAME_LENGTH 50 -#endif - -#ifndef MAX_VARIABLE_VALUE_LENGTH - #define MAX_VARIABLE_VALUE_LENGTH 1024 -#endif - -#ifndef MAX_CONNECTION_STRING_LEN - #define MAX_CONNECTION_STRING_LEN 2048 -#endif - -#ifndef SESSION_COOKIE_NAME - #define SESSION_COOKIE_NAME "SESSIONID" -#endif - -#ifndef ATL_SESSION_TIMEOUT - #define ATL_SESSION_TIMEOUT 600000 //10 min -#endif - -#ifndef ATL_SESSION_SWEEPER_TIMEOUT - #define ATL_SESSION_SWEEPER_TIMEOUT 1000 // 1sec -#endif - -#define INVALID_DB_SESSION_POS 0x0 -#define ATL_DBSESSION_ID _T("__ATL_SESSION_DB_CONNECTION") - -#pragma pack(push,_ATL_PACKING) -namespace ATL { - -// CSessionNameGenerator -// This is a helper class that generates random data for session key -// names. This class tries to use the CryptoApi to generate random -// bytes for the session key name. If the CryptoApi isn't available -// then the CRT rand() is used to generate the random bytes. This -// class's GetNewSessionName member function is used to actually -// generate the session name. -class CSessionNameGenerator : - public CCryptProv -{ -public: - bool m_bCryptNotAvailable; - enum {MIN_SESSION_KEY_LEN=5}; - - CSessionNameGenerator() throw() : - m_bCryptNotAvailable(false) - { - // Note that the crypto api is being - // initialized with no private key - // information - HRESULT hr = InitVerifyContext(); - m_bCryptNotAvailable = FAILED(hr) ? true : false; - } - - // This function creates a new session name and base64 encodes it. - // The base64 encoding algorithm used needs at least MIN_SESSION_KEY_LEN - // bytes to work correctly. Since we stack allocate the temporary - // buffer that holds the key name, the buffer must be less than or equal to - // the MAX_SESSION_KEY_LEN in size. - HRESULT GetNewSessionName(__out_ecount_part_z(*pdwSize, *pdwSize) LPSTR szNewID, __inout DWORD *pdwSize) throw() - { - HRESULT hr = E_FAIL; - - if (!pdwSize) - return E_POINTER; - - if (*pdwSize < MIN_SESSION_KEY_LEN || - *pdwSize > MAX_SESSION_KEY_LEN) - return E_INVALIDARG; - - if (!szNewID) - return E_POINTER; - - BYTE key[MAX_SESSION_KEY_LEN] = {0x0}; - - - // calculate the number of bytes that will fit in the - // buffer we've been passed - DWORD dwDataSize = CalcMaxInputSize(*pdwSize); - - if (dwDataSize && *pdwSize >= (DWORD)(Base64EncodeGetRequiredLength(dwDataSize, - ATL_BASE64_FLAG_NOCRLF))) - { - int dwKeySize = *pdwSize; - hr = GenerateRandomName(key, dwDataSize); - if (SUCCEEDED(hr)) - { - if( Base64Encode(key, - dwDataSize, - szNewID, - &dwKeySize, - ATL_BASE64_FLAG_NOCRLF) ) - { - //null terminate - szNewID[dwKeySize]=0; - *pdwSize = dwKeySize+1; - } - else - hr = E_FAIL; - } - else - { - *pdwSize = (DWORD)(Base64EncodeGetRequiredLength(dwDataSize, - ATL_BASE64_FLAG_NOCRLF)); - return E_OUTOFMEMORY; - } - } - return hr; - } - - DWORD CalcMaxInputSize(DWORD nOutputSize) throw() - { - if (nOutputSize < (DWORD)MIN_SESSION_KEY_LEN) - return 0; - // subtract one from the output size to make room - // for the NULL terminator in the output then - // calculate the biggest number of input bytes that - // when base64 encoded will fit in a buffer of size - // nOutputSize (including base64 padding) - int nInputSize = ((nOutputSize-1)*3)/4; - int factor = ((nInputSize*4)/3)%4; - if (factor) - nInputSize -= factor; - return nInputSize; - } - - - HRESULT GenerateRandomName(BYTE *pBuff, DWORD dwBuffSize) throw() - { - if (!pBuff) - return E_POINTER; - - if (!dwBuffSize) - return E_UNEXPECTED; - - if (!m_bCryptNotAvailable && GetHandle()) - { - // Use the crypto api to generate random data. - return GenRandom(dwBuffSize, pBuff); - } - - // CryptoApi isn't available so we generate - // random data using rand. We seed the random - // number generator with a seed that is a combination - // of bytes from an arbitrary number and the system - // time which changes every millisecond so it will - // be different for every call to this function. - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - static DWORD dwVal = 0x21; - DWORD dwSeed = (dwVal++ << 0x18) | (ft.dwLowDateTime & 0x00ffff00) | dwVal++ & 0x000000ff; - srand(dwSeed); - BYTE *pCurr = pBuff; - // fill buffer with random bytes - for (int i=0; i < (int)dwBuffSize; i++) - { - *pCurr = (BYTE) (rand() & 0x000000ff); - pCurr++; - } - return S_OK; - } -}; - - -// -// CDefaultQueryClass -// returns Query strings for use in SQL queries used -// by the database persisted session service. -class CDefaultQueryClass -{ -public: - LPCTSTR GetSessionRefDelete() throw() - { - return _T("DELETE FROM SessionReferences ") - _T("WHERE SessionID=? AND RefCount <= 0 ") - _T("AND DATEDIFF(millisecond, LastAccess, getdate()) > TimeoutMs"); - } - - LPCTSTR GetSessionRefIsExpired() throw() - { - return _T("SELECT SessionID FROM SessionReferences ") - _T("WHERE (SessionID=?) AND (DATEDIFF(millisecond, LastAccess, getdate()) > TimeoutMs)"); - } - - LPCTSTR GetSessionRefDeleteFinal() throw() - { - return _T("DELETE FROM SessionReferences ") - _T("WHERE SessionID=?"); - } - - LPCTSTR GetSessionRefCreate() throw() - { - return _T("INSERT INTO SessionReferences ") - _T("(SessionID, LastAccess, RefCount, TimeoutMs) ") - _T("VALUES (?, getdate(), 1, ?)"); - } - - LPCTSTR GetSessionRefUpdateTimeout() throw() - { - return _T("UPDATE SessionReferences ") - _T("SET TimeoutMs=? WHERE SessionID=?"); - } - - LPCTSTR GetSessionRefAddRef() throw() - { - return _T("UPDATE SessionReferences ") - _T("SET RefCount=RefCount+1, ") - _T("LastAccess=getdate() ") - _T("WHERE SessionID=?"); - } - - LPCTSTR GetSessionRefRemoveRef() throw() - { - return _T("UPDATE SessionReferences ") - _T("SET RefCount=RefCount-1, ") - _T("LastAccess=getdate() ") - _T("WHERE SessionID=?"); - } - - LPCTSTR GetSessionRefAccess() throw() - { - return _T("UPDATE SessionReferences ") - _T("SET LastAccess=getdate() ") - _T("WHERE SessionID=?"); - } - - LPCTSTR GetSessionRefSelect() throw() - { - return _T("SELECT * FROM SessionReferences ") - _T("WHERE SessionID=?"); - } - - LPCTSTR GetSessionRefGetCount() throw() - { - return _T("SELECT COUNT(*) FROM SessionReferences"); - } - - - LPCTSTR GetSessionVarCount() throw() - { - return _T("SELECT COUNT(*) FROM SessionVariables WHERE SessionID=?"); - } - - LPCTSTR GetSessionVarInsert() throw() - { - return _T("INSERT INTO SessionVariables ") - _T("(VariableValue, SessionID, VariableName) ") - _T("VALUES (?, ?, ?)"); - } - - LPCTSTR GetSessionVarUpdate() throw() - { - return _T("UPDATE SessionVariables ") - _T("SET VariableValue=? ") - _T("WHERE SessionID=? AND VariableName=?"); - } - - LPCTSTR GetSessionVarDeleteVar() throw() - { - return _T("DELETE FROM SessionVariables ") - _T("WHERE SessionID=? AND VariableName=?"); - } - - LPCTSTR GetSessionVarDeleteAllVars() throw() - { - return _T("DELETE FROM SessionVariables WHERE (SessionID=?)"); - } - - LPCTSTR GetSessionVarSelectVar()throw() - { - return _T("SELECT SessionID, VariableName, VariableValue ") - _T("FROM SessionVariables ") - _T("WHERE SessionID=? AND VariableName=?"); - } - - LPCTSTR GetSessionVarSelectAllVars() throw() - { - return _T("SELECT SessionID, VariableName, VariableValue ") - _T("FROM SessionVariables ") - _T("WHERE SessionID=?"); - } - - LPCTSTR GetSessionReferencesSet() throw() - { - return _T("UPDATE SessionReferences SET TimeoutMs=?"); - } -}; - - -// Contains the data for the session variable accessors -class CSessionDataBase -{ -public: - TCHAR m_szSessionID[MAX_SESSION_KEY_LEN]; - TCHAR m_VariableName[MAX_VARIABLE_NAME_LENGTH]; - BYTE m_VariableValue[MAX_VARIABLE_VALUE_LENGTH]; - DBLENGTH m_VariableLen; - CSessionDataBase() throw() - { - m_szSessionID[0] = '\0'; - m_VariableName[0] = '\0'; - m_VariableValue[0] = '\0'; - m_VariableLen = 0; - } - HRESULT Assign(LPCTSTR szSessionID, LPCTSTR szVarName, VARIANT *pVal) throw() - { - HRESULT hr = S_OK; - CVariantStream stream; - if ( szSessionID ) - { - if (Checked::tcsnlen(szSessionID, MAX_SESSION_KEY_LEN)< MAX_SESSION_KEY_LEN) - Checked::tcscpy_s(m_szSessionID, _countof(m_szSessionID), szSessionID); - else - hr = E_OUTOFMEMORY; - } - else - return E_INVALIDARG; - - if (hr == S_OK && szVarName) - if (Checked::tcsnlen(szVarName, MAX_VARIABLE_NAME_LENGTH) < MAX_VARIABLE_NAME_LENGTH) - Checked::tcscpy_s(m_VariableName, _countof(m_VariableName), szVarName); - else - hr = E_OUTOFMEMORY; - - if (hr == S_OK && pVal) - { - hr = stream.InsertVariant(pVal); - if (hr == S_OK) - { - BYTE *pBytes = stream.m_stream; - size_t size = stream.GetVariantSize(); - if (pBytes && size && size < MAX_VARIABLE_VALUE_LENGTH) - { - Checked::memcpy_s(m_VariableValue, MAX_VARIABLE_VALUE_LENGTH, pBytes, size); - m_VariableLen = static_cast(size); - } - else - hr = E_INVALIDARG; - } - } - - return hr; - } -}; - -// Use to select a session variable given the name -// of a session and the name of a variable. -class CSessionDataSelector : public CSessionDataBase -{ -public: - BEGIN_COLUMN_MAP(CSessionDataSelector) - COLUMN_ENTRY(1, m_szSessionID) - COLUMN_ENTRY(2, m_VariableName) - COLUMN_ENTRY_LENGTH(3, m_VariableValue, m_VariableLen) - END_COLUMN_MAP() - BEGIN_PARAM_MAP(CSessionDataSelector) - SET_PARAM_TYPE(DBPARAMIO_INPUT) - COLUMN_ENTRY(1, m_szSessionID) - COLUMN_ENTRY(2, m_VariableName) - END_PARAM_MAP() -}; - -// Use to select all session variables given the name of -// of a session. -class CAllSessionDataSelector : public CSessionDataBase -{ -public: - BEGIN_COLUMN_MAP(CAllSessionDataSelector) - COLUMN_ENTRY(1, m_szSessionID) - COLUMN_ENTRY(2, m_VariableName) - COLUMN_ENTRY_LENGTH(3, m_VariableValue, m_VariableLen) - END_COLUMN_MAP() - BEGIN_PARAM_MAP(CAllSessionDataSelector) - SET_PARAM_TYPE(DBPARAMIO_INPUT) - COLUMN_ENTRY(1, m_szSessionID) - END_PARAM_MAP() -}; - -// Use to update the value of a session variable -class CSessionDataUpdator : public CSessionDataBase -{ -public: - BEGIN_PARAM_MAP(CSessionDataUpdator) - SET_PARAM_TYPE(DBPARAMIO_INPUT) - COLUMN_ENTRY_LENGTH(1, m_VariableValue, m_VariableLen) - COLUMN_ENTRY(2, m_szSessionID) - COLUMN_ENTRY(3, m_VariableName) - END_PARAM_MAP() -}; - -// Use to delete a session variable given the -// session name and the name of the variable -class CSessionDataDeletor -{ -public: - CSessionDataDeletor() - { - m_szSessionID[0] = '\0'; - m_VariableName[0] = '\0'; - } - - TCHAR m_szSessionID[MAX_SESSION_KEY_LEN]; - TCHAR m_VariableName[MAX_VARIABLE_NAME_LENGTH]; - HRESULT Assign(LPCTSTR szSessionID, LPCTSTR szVarName) throw() - { - if (szSessionID) - { - if (Checked::tcsnlen(szSessionID, MAX_SESSION_KEY_LEN) < MAX_SESSION_KEY_LEN) - Checked::tcscpy_s(m_szSessionID, _countof(m_szSessionID), szSessionID); - else - return E_OUTOFMEMORY; - } - - if (szVarName) - { - if(Checked::tcsnlen(szVarName, MAX_VARIABLE_NAME_LENGTH) < MAX_VARIABLE_NAME_LENGTH) - Checked::tcscpy_s(m_VariableName, _countof(m_VariableName), szVarName); - else - return E_OUTOFMEMORY; - } - return S_OK; - } - - BEGIN_PARAM_MAP(CSessionDataDeletor) - SET_PARAM_TYPE(DBPARAMIO_INPUT) - COLUMN_ENTRY(1, m_szSessionID) - COLUMN_ENTRY(2, m_VariableName) - END_PARAM_MAP() -}; - -class CSessionDataDeleteAll -{ -public: - TCHAR m_szSessionID[MAX_SESSION_KEY_LEN]; - HRESULT Assign(LPCTSTR szSessionID) throw() - { - if (!szSessionID) - return E_INVALIDARG; - - if (Checked::tcsnlen(szSessionID, MAX_SESSION_KEY_LEN) < MAX_SESSION_KEY_LEN) - Checked::tcscpy_s(m_szSessionID, _countof(m_szSessionID), szSessionID); - else - return E_OUTOFMEMORY; - - return S_OK; - } - - BEGIN_PARAM_MAP(CSessionDataDeleteAll) - SET_PARAM_TYPE(DBPARAMIO_INPUT) - COLUMN_ENTRY(1, m_szSessionID) - END_PARAM_MAP() -}; - -// Used for retrieving the count of session variables for -// a given session ID. -class CCountAccessor -{ -public: - LONG m_nCount; - TCHAR m_szSessionID[MAX_SESSION_KEY_LEN]; - CCountAccessor() throw() - { - m_szSessionID[0] = '\0'; - m_nCount = 0; - } - - HRESULT Assign(LPCTSTR szSessionID) throw() - { - if (!szSessionID) - return E_INVALIDARG; - - if (Checked::tcsnlen(szSessionID, MAX_SESSION_KEY_LEN) < MAX_SESSION_KEY_LEN) - Checked::tcscpy_s(m_szSessionID, _countof(m_szSessionID), szSessionID); - else - return E_OUTOFMEMORY; - - return S_OK; - } - - BEGIN_COLUMN_MAP(CCountAccessor) - COLUMN_ENTRY(1, m_nCount) - END_COLUMN_MAP() - BEGIN_PARAM_MAP(CCountAccessor) - SET_PARAM_TYPE(DBPARAMIO_INPUT) - COLUMN_ENTRY(1, m_szSessionID) - END_PARAM_MAP() -}; - - -// Used for updating entries in the session -// references table, given a session ID -class CSessionRefUpdator -{ -public: - TCHAR m_SessionID[MAX_SESSION_KEY_LEN]; - HRESULT Assign(LPCTSTR szSessionID) throw() - { - if (!szSessionID) - return E_INVALIDARG; - if (Checked::tcsnlen(szSessionID, MAX_SESSION_KEY_LEN) < MAX_SESSION_KEY_LEN) - Checked::tcscpy_s(m_SessionID, _countof(m_SessionID), szSessionID); - else - return E_OUTOFMEMORY; - return S_OK; - } - BEGIN_PARAM_MAP(CSessionRefUpdator) - SET_PARAM_TYPE(DBPARAMIO_INPUT) - COLUMN_ENTRY(1, m_SessionID) - END_PARAM_MAP() -}; - -class CSessionRefIsExpired -{ -public: - TCHAR m_SessionID[MAX_SESSION_KEY_LEN]; - TCHAR m_SessionIDOut[MAX_SESSION_KEY_LEN]; - HRESULT Assign(LPCTSTR szSessionID) throw() - { - m_SessionIDOut[0]=0; - if (!szSessionID) - return E_INVALIDARG; - if (Checked::tcsnlen(szSessionID, MAX_SESSION_KEY_LEN) < MAX_SESSION_KEY_LEN) - Checked::tcscpy_s(m_SessionID, _countof(m_SessionID), szSessionID); - else - return E_OUTOFMEMORY; - return S_OK; - } - BEGIN_COLUMN_MAP(CSessionRefIsExpired) - COLUMN_ENTRY(1, m_SessionIDOut) - END_COLUMN_MAP() - BEGIN_PARAM_MAP(CSessionRefIsExpired) - SET_PARAM_TYPE(DBPARAMIO_INPUT) - COLUMN_ENTRY(1, m_SessionID) - END_PARAM_MAP() -}; - -class CSetAllTimeouts -{ -public: - unsigned __int64 m_dwNewTimeout; - HRESULT Assign(unsigned __int64 dwNewValue) - { - m_dwNewTimeout = dwNewValue; - return S_OK; - } - BEGIN_PARAM_MAP(CSetAllTimeouts) - SET_PARAM_TYPE(DBPARAMIO_INPUT) - COLUMN_ENTRY(1, m_dwNewTimeout) - END_PARAM_MAP() -}; - -class CSessionRefUpdateTimeout -{ -public: - TCHAR m_SessionID[MAX_SESSION_KEY_LEN]; - unsigned __int64 m_nNewTimeout; - HRESULT Assign(LPCTSTR szSessionID, unsigned __int64 nNewTimeout) throw() - { - if (!szSessionID) - return E_INVALIDARG; - - if (Checked::tcsnlen(szSessionID, MAX_SESSION_KEY_LEN) < MAX_SESSION_KEY_LEN) - Checked::tcscpy_s(m_SessionID, _countof(m_SessionID), szSessionID); - else - return E_OUTOFMEMORY; - - m_nNewTimeout = nNewTimeout; - - return S_OK; - } - - BEGIN_PARAM_MAP(CSessionRefUpdateTimeout) - SET_PARAM_TYPE(DBPARAMIO_INPUT) - COLUMN_ENTRY(1, m_nNewTimeout) - COLUMN_ENTRY(2, m_SessionID) - END_PARAM_MAP() -}; - -class CSessionRefSelector -{ -public: - TCHAR m_SessionID[MAX_SESSION_KEY_LEN]; - int m_RefCount; - HRESULT Assign(LPCTSTR szSessionID) throw() - { - if (!szSessionID) - return E_INVALIDARG; - if (Checked::tcsnlen(szSessionID, MAX_SESSION_KEY_LEN) < MAX_SESSION_KEY_LEN) - Checked::tcscpy_s(m_SessionID, _countof(m_SessionID), szSessionID); - else - return E_OUTOFMEMORY; - return S_OK; - } - BEGIN_COLUMN_MAP(CSessionRefSelector) - COLUMN_ENTRY(1, m_SessionID) - COLUMN_ENTRY(3, m_RefCount) - END_COLUMN_MAP() - BEGIN_PARAM_MAP(CSessionRefSelector) - SET_PARAM_TYPE(DBPARAMIO_INPUT) - COLUMN_ENTRY(1, m_SessionID) - END_PARAM_MAP() -}; - -class CSessionRefCount -{ -public: - LONG m_nCount; - BEGIN_COLUMN_MAP(CSessionRefCount) - COLUMN_ENTRY(1, m_nCount) - END_COLUMN_MAP() -}; - -// Used for creating new entries in the session -// references table. -class CSessionRefCreator -{ -public: - TCHAR m_SessionID[MAX_SESSION_KEY_LEN]; - unsigned __int64 m_TimeoutMs; - HRESULT Assign(LPCTSTR szSessionID, unsigned __int64 timeout) throw() - { - if (!szSessionID) - return E_INVALIDARG; - if (Checked::tcsnlen(szSessionID, MAX_SESSION_KEY_LEN) < MAX_SESSION_KEY_LEN) - { - Checked::tcscpy_s(m_SessionID, _countof(m_SessionID), szSessionID); - m_TimeoutMs = timeout; - } - else - return E_OUTOFMEMORY; - return S_OK; - } - BEGIN_PARAM_MAP(CSessionRefCreator) - SET_PARAM_TYPE(DBPARAMIO_INPUT) - COLUMN_ENTRY(1, m_SessionID) - COLUMN_ENTRY(2, m_TimeoutMs) - END_PARAM_MAP() -}; - - -// CDBSession -// This session persistance class persists session variables to -// an OLEDB datasource. The following table gives a general description -// of the table schema for the tables this class uses. -// -// TableName: SessionVariables -// Column Name Type Description -// 1 SessionID char[MAX_SESSION_KEY_LEN] Session Key name -// 2 VariableName char[MAX_VARIABLE_NAME_LENGTH] Variable Name -// 3 VariableValue varbinary[MAX_VARIABLE_VALUE_LENGTH] Variable Value - -// -// TableName: SessionReferences -// Column Name Type Description -// 1 SessionID char[MAX_SESSION_KEY_LEN] Session Key Name. -// 2 LastAccess datetime Date and time of last access to this session. -// 3 RefCount int Current references on this session. -// 4 TimeoutMS int Timeout value for the session in milli seconds - -typedef bool (*PFN_GETPROVIDERINFO)(DWORD_PTR, wchar_t **); - -template -class CDBSession: - public ISession, - public CComObjectRootEx - -{ - typedef CCommand > iterator_accessor; -public: - typedef QueryClass DBQUERYCLASS_TYPE; - BEGIN_COM_MAP(CDBSession) - COM_INTERFACE_ENTRY(ISession) - END_COM_MAP() - - CDBSession() throw(): - m_dwTimeout(ATL_SESSION_TIMEOUT) - { - m_szSessionName[0] = '\0'; - } - - ~CDBSession() throw() - { - } - - void FinalRelease()throw() - { - SessionUnlock(); - } - - STDMETHOD(SetVariable)(LPCSTR szName, VARIANT Val) throw() - { - HRESULT hr = E_FAIL; - if (!szName) - return E_INVALIDARG; - - // Get the data connection for this thread. - CDataConnection dataconn; - hr = GetSessionConnection(&dataconn, m_spServiceProvider); - if (hr != S_OK) - return hr; - - // Update the last access time for this session - hr = Access(); - if (hr != S_OK) - return hr; - - // Allocate an updator command and fill out it's input parameters. - CCommand > command; - _ATLTRY - { - CA2CT name(szName); - hr = command.Assign(m_szSessionName, name, &Val); - } - _ATLCATCHALL() - { - hr = E_OUTOFMEMORY; - } - if (hr != S_OK) - return hr; - - // Try an update. Update will fail if the variable is not already there. - DBROWCOUNT nRows = 0; - - hr = command.Open(dataconn, - m_QueryObj.GetSessionVarUpdate(), - NULL, &nRows, DBGUID_DEFAULT, false); - if (hr == S_OK && nRows <= 0) - hr = E_UNEXPECTED; - if (hr != S_OK) - { - // Try an insert - hr = command.Open(dataconn, m_QueryObj.GetSessionVarInsert(), NULL, &nRows, DBGUID_DEFAULT, false); - if (hr == S_OK && nRows <=0) - hr = E_UNEXPECTED; - } - - return hr; - } - - // Warning: For string data types, depending on the configuration of - // your database, strings might be returned with trailing white space. - STDMETHOD(GetVariable)(LPCSTR szName, VARIANT *pVal) throw() - { - HRESULT hr = E_FAIL; - if (!szName) - return E_INVALIDARG; - if (pVal) - VariantInit(pVal); - else - return E_POINTER; - - // Get the data connection for this thread - CDataConnection dataconn; - hr = GetSessionConnection(&dataconn, m_spServiceProvider); - if (hr != S_OK) - return hr; - - // Update the last access time for this session - hr = Access(); - if (hr != S_OK) - return hr; - - // Allocate a command a fill out it's input parameters. - CCommand > command; - _ATLTRY - { - CA2CT name(szName); - hr = command.Assign(m_szSessionName, name, NULL); - } - _ATLCATCHALL() - { - hr = E_OUTOFMEMORY; - } - - if (hr == S_OK) - { - hr = command.Open(dataconn, m_QueryObj.GetSessionVarSelectVar()); - if (SUCCEEDED(hr)) - { - if ( S_OK == (hr = command.MoveFirst())) - { - CStreamOnByteArray stream(command.m_VariableValue); - CComVariant vOut; - hr = vOut.ReadFromStream(static_cast(&stream)); - if (hr == S_OK) - hr = vOut.Detach(pVal); - } - } - } - return hr; - } - - STDMETHOD(RemoveVariable)(LPCSTR szName) throw() - { - HRESULT hr = E_FAIL; - if (!szName) - return E_INVALIDARG; - - // Get the data connection for this thread. - CDataConnection dataconn; - hr = GetSessionConnection(&dataconn, m_spServiceProvider); - if (hr != S_OK) - return hr; - - // update the last access time for this session - hr = Access(); - if (hr != S_OK) - return hr; - - // allocate a command and set it's input parameters - CCommand > command; - _ATLTRY - { - CA2CT name(szName); - hr = command.Assign(m_szSessionName, name); - } - _ATLCATCHALL() - { - return E_OUTOFMEMORY; - } - - // execute the command - DBROWCOUNT nRows = 0; - if (hr == S_OK) - hr = command.Open(dataconn, m_QueryObj.GetSessionVarDeleteVar(), - NULL, &nRows, DBGUID_DEFAULT, false); - if (hr == S_OK && nRows <= 0) - hr = E_FAIL; - return hr; - } - - // Gives the count of rows in the table for this session ID. - STDMETHOD(GetCount)(long *pnCount) throw() - { - HRESULT hr = S_OK; - if (pnCount) - *pnCount = 0; - else - return E_POINTER; - - // Get the database connection for this thread. - CDataConnection dataconn; - hr = GetSessionConnection(&dataconn, m_spServiceProvider); - if (hr != S_OK) - return hr; - hr = Access(); - if (hr != S_OK) - return hr; - CCommand > command; - - hr = command.Assign(m_szSessionName); - if (hr == S_OK) - { - hr = command.Open(dataconn, m_QueryObj.GetSessionVarCount()); - if (hr == S_OK) - { - if (S_OK == (hr = command.MoveFirst())) - { - *pnCount = command.m_nCount; - hr = S_OK; - } - } - } - return hr; - } - - STDMETHOD(RemoveAllVariables)() throw() - { - HRESULT hr = E_UNEXPECTED; - - // Get the data connection for this thread. - CDataConnection dataconn; - hr = GetSessionConnection(&dataconn, m_spServiceProvider); - if (hr != S_OK) - return hr; - - CCommand > command; - hr = command.Assign(m_szSessionName); - if (hr != S_OK) - return hr; - - // delete all session variables - hr = command.Open(dataconn, m_QueryObj.GetSessionVarDeleteAllVars(), NULL, NULL, DBGUID_DEFAULT, false); - return hr; - } - - // Iteration of variables works by taking a snapshot - // of the sessions at the point in time BeginVariableEnum - // is called, and then keeping an index variable that you use to - // move through the snapshot rowset. It is important to know - // that the handle returned in phEnum is not thread safe. It - // should only be used by the calling thread. - STDMETHOD(BeginVariableEnum)(POSITION *pPOS, HSESSIONENUM *phEnum) throw() - { - HRESULT hr = E_FAIL; - if (!pPOS) - return E_POINTER; - - if (phEnum) - *phEnum = NULL; - else - return E_POINTER; - - // Get the data connection for this thread. - CDataConnection dataconn; - hr = GetSessionConnection(&dataconn, m_spServiceProvider); - if (hr != S_OK) - return hr; - - // Update the last access time for this session. - hr = Access(); - if (hr != S_OK) - return hr; - - // Allocate a new iterator accessor and initialize it's input parameters. - iterator_accessor *pIteratorAccessor = NULL; - ATLTRYALLOC(pIteratorAccessor = new iterator_accessor); - if (!pIteratorAccessor) - return E_OUTOFMEMORY; - - hr = pIteratorAccessor->Assign(m_szSessionName, NULL, NULL); - if (hr == S_OK) - { - // execute the command and move to the first row of the recordset. - hr = pIteratorAccessor->Open(dataconn, - m_QueryObj.GetSessionVarSelectAllVars()); - if (hr == S_OK) - { - hr = pIteratorAccessor->MoveFirst(); - if (hr == S_OK) - { - *pPOS = (POSITION) INVALID_DB_SESSION_POS + 1; - *phEnum = reinterpret_cast(pIteratorAccessor); - } - } - - if (hr != S_OK) - { - *pPOS = INVALID_DB_SESSION_POS; - *phEnum = NULL; - delete pIteratorAccessor; - } - } - return hr; - } - - // The values for hEnum and pPos must have been initialized in a previous - // call to BeginVariableEnum. On success, the out variant will hold the next - // variable - STDMETHOD(GetNextVariable)(POSITION *pPOS, VARIANT *pVal, HSESSIONENUM hEnum, LPSTR szName=NULL, DWORD dwLen=0) throw() - { - if (!pPOS) - return E_INVALIDARG; - - if (pVal) - VariantInit(pVal); - else - return E_POINTER; - - if (!hEnum) - return E_UNEXPECTED; - - if (*pPOS <= INVALID_DB_SESSION_POS) - return E_UNEXPECTED; - - iterator_accessor *pIteratorAccessor = reinterpret_cast(hEnum); - - // update the last access time. - HRESULT hr = Access(); - - POSITION posCurrent = *pPOS; - - if (szName) - { - // caller wants entry name - _ATLTRY - { - CT2CA szVarName(pIteratorAccessor->m_VariableName); - if (szVarName != NULL && dwLen > Checked::strnlen(szVarName, dwLen)) - { - Checked::strcpy_s(szName, dwLen, szVarName); - } - else - hr = E_OUTOFMEMORY; // buffer not big enough - } - _ATLCATCHALL() - { - hr = E_OUTOFMEMORY; - } - - } - - if (hr == S_OK) - { - CStreamOnByteArray stream(pIteratorAccessor->m_VariableValue); - CComVariant vOut; - hr = vOut.ReadFromStream(static_cast(&stream)); - if (hr == S_OK) - vOut.Detach(pVal); - else - return hr; - } - else - return hr; - - hr = pIteratorAccessor->MoveNext(); - *pPOS = ++posCurrent; - - if (hr == DB_S_ENDOFROWSET) - { - // We're done iterating, reset everything - *pPOS = INVALID_DB_SESSION_POS; - hr = S_OK; - } - - if (hr != S_OK) - { - VariantClear(pVal); - } - return hr; - } - - // CloseEnum frees up any resources allocated by the iterator - STDMETHOD(CloseEnum)(HSESSIONENUM hEnum) throw() - { - iterator_accessor *pIteratorAccessor = reinterpret_cast(hEnum); - if (!pIteratorAccessor) - return E_INVALIDARG; - pIteratorAccessor->Close(); - delete pIteratorAccessor; - return S_OK; - } - - // - // Returns S_FALSE if it's not expired - // S_OK if it is expired and an error HRESULT - // if an error occurred. - STDMETHOD(IsExpired)() throw() - { - HRESULT hrRet = S_FALSE; - HRESULT hr = E_UNEXPECTED; - - // Get the data connection for this thread. - CDataConnection dataconn; - hr = GetSessionConnection(&dataconn, m_spServiceProvider); - if (hr != S_OK) - return hr; - - CCommand > command; - hr = command.Assign(m_szSessionName); - if (hr != S_OK) - return hr; - - hr = command.Open(dataconn, m_QueryObj.GetSessionRefIsExpired(), - NULL, NULL, DBGUID_DEFAULT, true); - if (hr == S_OK) - { - if (S_OK == command.MoveFirst()) - { - if (!_tcscmp(command.m_SessionIDOut, m_szSessionName)) - hrRet = S_OK; - } - } - - if (hr == S_OK) - return hrRet; - return hr; - } - - STDMETHOD(SetTimeout)(unsigned __int64 dwNewTimeout) throw() - { - HRESULT hr = E_UNEXPECTED; - - // Get the data connection for this thread. - CDataConnection dataconn; - hr = GetSessionConnection(&dataconn, m_spServiceProvider); - if (hr != S_OK) - return hr; - - // allocate a command and set it's input parameters - CCommand > command; - hr = command.Assign(m_szSessionName, dwNewTimeout); - if (hr != S_OK) - return hr; - - hr = command.Open(dataconn, m_QueryObj.GetSessionRefUpdateTimeout(), - NULL, NULL, DBGUID_DEFAULT, false); - - return hr; - } - - // SessionLock increments the session reference count for this session. - // If there is not a session by this name in the session references table, - // a new session entry is created in the the table. - HRESULT SessionLock() throw() - { - HRESULT hr = E_UNEXPECTED; - if (!m_szSessionName || m_szSessionName[0]==0) - return hr; // no session to lock. - - // retrieve the data connection for this thread - CDataConnection dataconn; - hr = GetSessionConnection(&dataconn, m_spServiceProvider); - if (hr != S_OK) - return hr; - - // first try to update a session with this name - DBROWCOUNT nRows = 0; - CCommand > updator; - if (S_OK == updator.Assign(m_szSessionName)) - { - if (S_OK != (hr = updator.Open(dataconn, m_QueryObj.GetSessionRefAddRef(), - NULL, &nRows, DBGUID_DEFAULT, false)) || - nRows == 0) - { - // No session to update. Use the creator accessor - // to create a new session reference. - CCommand > creator; - hr = creator.Assign(m_szSessionName, m_dwTimeout); - if (hr == S_OK) - hr = creator.Open(dataconn, m_QueryObj.GetSessionRefCreate(), - NULL, &nRows, DBGUID_DEFAULT, false); - } - } - - // We should have been able to create or update a session. - ATLASSERT(nRows > 0); - if (hr == S_OK && nRows <= 0) - hr = E_UNEXPECTED; - - return hr; - } - - // SessionUnlock decrements the session RefCount for this session. - // Sessions cannot be removed from the database unless the session - // refcount is 0 - HRESULT SessionUnlock() throw() - { - HRESULT hr = E_UNEXPECTED; - if (!m_szSessionName || - m_szSessionName[0]==0) - return hr; - - // get the data connection for this thread - CDataConnection dataconn; - hr = GetSessionConnection(&dataconn, m_spServiceProvider); - if (hr != S_OK) - return hr; - - // The session must exist at this point in order to unlock it - // so we can just use the session updator here. - DBROWCOUNT nRows = 0; - CCommand > updator; - hr = updator.Assign(m_szSessionName); - if (hr == S_OK) - { - hr = updator.Open( dataconn, - m_QueryObj.GetSessionRefRemoveRef(), - NULL, - &nRows, - DBGUID_DEFAULT, - false); - } - if (hr != S_OK) - return hr; - - // delete the session from the database if - // nobody else is using it and it's expired. - hr = FreeSession(); - return hr; - } - - // Access updates the last access time for the session. The access - // time for sessions is updated using the SQL GETDATE function on the - // database server so that all clients will be using the same clock - // to compare access times against. - HRESULT Access() throw() - { - HRESULT hr = E_UNEXPECTED; - - if (!m_szSessionName || - m_szSessionName[0]==0) - return hr; // no session to access - - // get the data connection for this thread - CDataConnection dataconn; - hr = GetSessionConnection(&dataconn, m_spServiceProvider); - if (hr != S_OK) - return hr; - - // The session reference entry in the references table must - // be created prior to calling this function so we can just - // use an updator to update the current entry. - CCommand > updator; - - DBROWCOUNT nRows = 0; - hr = updator.Assign(m_szSessionName); - if (hr == S_OK) - { - hr = updator.Open( dataconn, - m_QueryObj.GetSessionRefAccess(), - NULL, - &nRows, - DBGUID_DEFAULT, - false); - } - - ATLASSERT(nRows > 0); - if (hr == S_OK && nRows <= 0) - hr = E_UNEXPECTED; - return hr; - } - - // If the session is expired and it's reference is 0, - // it can be deleted. SessionUnlock calls this function to - // unlock the session and delete it after we release a session - // lock. Note that our SQL command will only delete the session - // if it is expired and it's refcount is <= 0 - HRESULT FreeSession() throw() - { - HRESULT hr = E_UNEXPECTED; - if (!m_szSessionName || - m_szSessionName[0]==0) - return hr; - - // Get the data connection for this thread. - CDataConnection dataconn; - hr = GetSessionConnection(&dataconn, m_spServiceProvider); - if (hr != S_OK) - return hr; - - CCommand > updator; - - // The SQL for this command only deletes the - // session reference from the references table if it's access - // count is 0 and it has expired. - return updator.Open(dataconn, - m_QueryObj.GetSessionRefDelete(), - NULL, - NULL, - DBGUID_DEFAULT, - false); - } - - // Initialize is called each time a new session is created. - HRESULT Initialize( LPCSTR szSessionName, - IServiceProvider *pServiceProvider, - DWORD_PTR dwCookie, - PFN_GETPROVIDERINFO pfnInfo) throw() - { - if (!szSessionName) - return E_INVALIDARG; - - if (!pServiceProvider) - return E_INVALIDARG; - - if (!pfnInfo) - return E_INVALIDARG; - - m_pfnInfo = pfnInfo; - m_dwProvCookie = dwCookie; - m_spServiceProvider = pServiceProvider; - - _ATLTRY - { - CA2CT tcsSessionName(szSessionName); - if (Checked::tcsnlen(tcsSessionName, MAX_SESSION_KEY_LEN) < MAX_SESSION_KEY_LEN) - Checked::tcscpy_s(m_szSessionName, _countof(m_szSessionName), tcsSessionName); - else - return E_OUTOFMEMORY; - } - _ATLCATCHALL() - { - return E_OUTOFMEMORY; - } - return SessionLock(); - } - - HRESULT GetSessionConnection(CDataConnection *pConn, - IServiceProvider *pProv) throw() - { - if (!pProv) - return E_INVALIDARG; - - if (!m_pfnInfo || - !m_dwProvCookie) - return E_UNEXPECTED; - - wchar_t *wszProv = NULL; - if (m_pfnInfo(m_dwProvCookie, &wszProv) && wszProv!=NULL) - { - return GetDataSource(pProv, - ATL_DBSESSION_ID, - wszProv, - pConn); - } - return E_FAIL; - } - - -protected: - TCHAR m_szSessionName[MAX_SESSION_KEY_LEN]; - unsigned __int64 m_dwTimeout; - CComPtr m_spServiceProvider; - DWORD_PTR m_dwProvCookie; - PFN_GETPROVIDERINFO m_pfnInfo; - DBQUERYCLASS_TYPE m_QueryObj; -}; // CDBSession - - -template > -class CDBSessionServiceImplT -{ - wchar_t m_szConnectionString[MAX_CONNECTION_STRING_LEN]; - CComPtr m_spServiceProvider; - typename TDBSession::DBQUERYCLASS_TYPE m_QueryObj; -public: - typedef const wchar_t* SERVICEIMPL_INITPARAM_TYPE; - CDBSessionServiceImplT() throw() - { - m_dwTimeout = ATL_SESSION_TIMEOUT; - m_szConnectionString[0] = '\0'; - } - - static bool GetProviderInfo(DWORD_PTR dwProvCookie, wchar_t **ppszProvInfo) throw() - { - if (dwProvCookie && - ppszProvInfo) - { - CDBSessionServiceImplT *pSvc = - reinterpret_cast*>(dwProvCookie); - *ppszProvInfo = pSvc->m_szConnectionString; - return true; - } - return false; - } - - HRESULT GetSessionConnection(CDataConnection *pConn, - IServiceProvider *pProv) throw() - { - if (!pProv) - return E_INVALIDARG; - - if(!m_szConnectionString[0]) - return E_UNEXPECTED; - - return GetDataSource(pProv, - ATL_DBSESSION_ID, - m_szConnectionString, - pConn); - } - - HRESULT Initialize(SERVICEIMPL_INITPARAM_TYPE pData, - IServiceProvider *pProvider, - unsigned __int64 dwInitialTimeout) throw() - { - if (!pData || !pProvider) - return E_INVALIDARG; - - if (Checked::wcsnlen(pData, MAX_CONNECTION_STRING_LEN) < MAX_CONNECTION_STRING_LEN) - { - Checked::wcscpy_s(m_szConnectionString, _countof(m_szConnectionString), pData); - } - else - return E_OUTOFMEMORY; - - m_dwTimeout = dwInitialTimeout; - m_spServiceProvider = pProvider; - return S_OK; - } - - HRESULT CreateNewSession(__out_ecount_part_z(*pdwSize, *pdwSize) LPSTR szNewID, __inout DWORD *pdwSize, __deref_out ISession** ppSession) throw() - { - HRESULT hr = E_FAIL; - CComObject *pNewSession = NULL; - - if (!pdwSize) - return E_POINTER; - - if (ppSession) - *ppSession = NULL; - else - return E_POINTER; - - if (szNewID) - *szNewID = NULL; - else - return E_INVALIDARG; - - - // Create new session - CComObject::CreateInstance(&pNewSession); - if (pNewSession == NULL) - return E_OUTOFMEMORY; - - // Create a session name and initialize the object - hr = m_SessionNameGenerator.GetNewSessionName(szNewID, pdwSize); - if (hr == S_OK) - { - hr = pNewSession->Initialize(szNewID, - m_spServiceProvider, - reinterpret_cast(this), - GetProviderInfo); - if (hr == S_OK) - { - // we don't hold a reference to the object - hr = pNewSession->QueryInterface(ppSession); - } - } - - if (hr != S_OK) - delete pNewSession; - return hr; - } - - HRESULT CreateNewSessionByName(__in_z LPSTR szNewID, __deref_out ISession** ppSession) throw() - { - HRESULT hr = E_FAIL; - CComObject *pNewSession = NULL; - - if (!szNewID || *szNewID == 0) - return E_INVALIDARG; - - if (ppSession) - *ppSession = NULL; - else - return E_POINTER; - - // Create new session - CComObject::CreateInstance(&pNewSession); - if (pNewSession == NULL) - return E_OUTOFMEMORY; - - hr = pNewSession->Initialize(szNewID, - m_spServiceProvider, - reinterpret_cast(this), - GetProviderInfo); - if (hr == S_OK) - { - // we don't hold a reference to the object - hr = pNewSession->QueryInterface(ppSession); - } - - - if (hr != S_OK) - delete pNewSession; - return hr; - } - - - HRESULT GetSession(LPCSTR szID, ISession **ppSession) throw() - { - HRESULT hr = E_FAIL; - if (!szID) - return E_INVALIDARG; - - if (ppSession) - *ppSession = NULL; - else - return E_POINTER; - - CComObject *pNewSession = NULL; - - // Check the DB to see if the session ID is a valid session - _ATLTRY - { - CA2CT session(szID); - hr = IsValidSession(session); - } - _ATLCATCHALL() - { - hr = E_OUTOFMEMORY; - } - if (hr == S_OK) - { - // Create new session object to represent this session - CComObject::CreateInstance(&pNewSession); - if (pNewSession == NULL) - return E_OUTOFMEMORY; - - hr = pNewSession->Initialize(szID, - m_spServiceProvider, - reinterpret_cast(this), - GetProviderInfo); - if (hr == S_OK) - { - // we don't hold a reference to the object - hr = pNewSession->QueryInterface(ppSession); - } - } - - if (hr != S_OK && pNewSession) - delete pNewSession; - return hr; - } - - HRESULT CloseSession(LPCSTR szID) throw() - { - if (!szID) - return E_INVALIDARG; - - CDataConnection conn; - HRESULT hr = GetSessionConnection(&conn, - m_spServiceProvider); - if (hr != S_OK) - return hr; - - // set up accessors - CCommand > updator; - CCommand > command; - _ATLTRY - { - CA2CT session(szID); - hr = updator.Assign(session); - if (hr == S_OK) - hr = command.Assign(session); - } - _ATLCATCHALL() - { - hr = E_OUTOFMEMORY; - } - - if (hr == S_OK) - { - // delete all session variables (may not be any!) - hr = command.Open(conn, - m_QueryObj.GetSessionVarDeleteAllVars(), - NULL, - NULL, - DBGUID_DEFAULT, - false); - if (hr == S_OK) - { - DBROWCOUNT nRows = 0; - nRows = 0; - // delete references in the session references table - hr = updator.Open(conn, - m_QueryObj.GetSessionRefDeleteFinal(), - NULL, - &nRows, - DBGUID_DEFAULT, - false); - if (nRows == 0) - hr = E_UNEXPECTED; - } - } - return hr; - } - - HRESULT SetSessionTimeout(unsigned __int64 nTimeout) throw() - { - // Get the data connection for this thread - CDataConnection conn; - - HRESULT hr = GetSessionConnection(&conn, m_spServiceProvider); - if (hr != S_OK) - return hr; - - // all sessions get the same timeout - CCommand > command; - hr = command.Assign(nTimeout); - if (hr == S_OK) - { - hr = command.Open(conn, m_QueryObj.GetSessionReferencesSet(), - NULL, - NULL, - DBGUID_DEFAULT, - false); - if (hr == S_OK) - { - m_dwTimeout = nTimeout; - } - } - return hr; - } - - - HRESULT GetSessionTimeout(unsigned __int64* pnTimeout) throw() - { - if (pnTimeout) - *pnTimeout = m_dwTimeout; - else - return E_INVALIDARG; - - return S_OK; - } - - HRESULT GetSessionCount(DWORD *pnCount) throw() - { - if (pnCount) - *pnCount = 0; - else - return E_POINTER; - - CCommand > command; - CDataConnection conn; - HRESULT hr = GetSessionConnection(&conn, - m_spServiceProvider); - if (hr != S_OK) - return hr; - - hr = command.Open(conn, - m_QueryObj.GetSessionRefGetCount()); - if (hr == S_OK) - { - hr = command.MoveFirst(); - if (hr == S_OK) - { - *pnCount = (DWORD)command.m_nCount; - } - } - - return hr; - } - - void ReleaseAllSessions() throw() - { - // nothing to do - } - - void SweepSessions() throw() - { - // nothing to do - } - - - // Helpers - HRESULT IsValidSession(LPCTSTR szID) throw() - { - if (!szID) - return E_INVALIDARG; - // Look in the sessionreferences table to see if there is an entry - // for this session. - if (m_szConnectionString[0] == 0) - return E_UNEXPECTED; - - CDataConnection conn; - HRESULT hr = GetSessionConnection(&conn, - m_spServiceProvider); - if (hr != S_OK) - return hr; - - // Check the session references table to see if - // this is a valid session - CCommand > selector; - hr = selector.Assign(szID); - if (hr != S_OK) - return hr; - - hr = selector.Open(conn, - m_QueryObj.GetSessionRefSelect(), - NULL, - NULL, - DBGUID_DEFAULT, - true); - if (hr == S_OK) - return selector.MoveFirst(); - return hr; - } - - CSessionNameGenerator m_SessionNameGenerator; // Object for generating session names - unsigned __int64 m_dwTimeout; -}; // CDBSessionServiceImplT - -typedef CDBSessionServiceImplT<> CDBSessionServiceImpl; - - - - - -////////////////////////////////////////////////////////////////// -// -// In-memory persisted session -// -////////////////////////////////////////////////////////////////// - -// In-memory persisted session service keeps a pointer -// to the session obejct around in memory. The pointer is -// contained in a CComPtr, which is stored in a CAtlMap, so -// we have to have a CElementTraits class for that. -typedef CComPtr SESSIONPTRTYPE; - -template<> -class CElementTraits : - public CElementTraitsBase -{ -public: - static ULONG Hash( INARGTYPE obj ) throw() - { - return( (ULONG)(ULONG_PTR)obj.p); - } - - static BOOL CompareElements( OUTARGTYPE element1, OUTARGTYPE element2 ) throw() - { - return element1.IsEqualObject(element2.p) ? TRUE : FALSE; - } - - static int CompareElementsOrdered( INARGTYPE , INARGTYPE ) throw() - { - ATLASSERT(0); // NOT IMPLEMENTED - return 0; - } -}; - - -// CMemSession -// This session persistance class persists session variables in memory. -// Note that this type of persistance should only be used on single server -// web sites. -class CMemSession : - public ISession, - public CComObjectRootEx -{ -public: - BEGIN_COM_MAP(CMemSession) - COM_INTERFACE_ENTRY(ISession) - END_COM_MAP() - - CMemSession() throw(...) - { - } - virtual ~CMemSession() - { - } - - STDMETHOD(GetVariable)(LPCSTR szName, VARIANT *pVal) throw() - { - if (!szName) - return E_INVALIDARG; - - if (pVal) - VariantInit(pVal); - else - return E_POINTER; - - HRESULT hr = Access(); - if (hr == S_OK) - { - CSLockType lock(m_cs, false); - hr = lock.Lock(); - if (FAILED(hr)) - return hr; - - hr = E_FAIL; - _ATLTRY - { - CComVariant val; - if (m_Variables.Lookup(szName, val)) - { - hr = VariantCopy(pVal, &val); - } - } - _ATLCATCHALL() - { - hr = E_UNEXPECTED; - } - } - return hr; - } - - STDMETHOD(SetVariable)(LPCSTR szName, VARIANT vNewVal) throw() - { - if (!szName) - return E_INVALIDARG; - - HRESULT hr = Access(); - if (hr == S_OK) - { - CSLockType lock(m_cs, false); - hr = lock.Lock(); - if (FAILED(hr)) - return hr; - _ATLTRY - { - hr = m_Variables.SetAt(szName, vNewVal) ? S_OK : E_FAIL; - } - _ATLCATCHALL() - { - hr = E_UNEXPECTED; - } - } - return hr; - } - - STDMETHOD(RemoveVariable)(LPCSTR szName) throw() - { - if (!szName) - return E_INVALIDARG; - - HRESULT hr = Access(); - if (hr == S_OK) - { - CSLockType lock(m_cs, false); - hr = lock.Lock(); - if (FAILED(hr)) - return hr; - _ATLTRY - { - hr = m_Variables.RemoveKey(szName) ? S_OK : E_FAIL; - } - _ATLCATCHALL() - { - hr = E_UNEXPECTED; - } - } - return hr; - } - - STDMETHOD(GetCount)(long *pnCount) throw() - { - if (pnCount) - *pnCount = 0; - else - return E_POINTER; - - HRESULT hr = Access(); - if (hr == S_OK) - { - CSLockType lock(m_cs, false); - hr = lock.Lock(); - if (FAILED(hr)) - return hr; - *pnCount = (long) m_Variables.GetCount(); - } - return hr; - } - - STDMETHOD(RemoveAllVariables)() throw() - { - HRESULT hr = Access(); - if (hr == S_OK) - { - CSLockType lock(m_cs, false); - hr = lock.Lock(); - if (FAILED(hr)) - return hr; - m_Variables.RemoveAll(); - } - - return hr; - } - - STDMETHOD(BeginVariableEnum)(POSITION *pPOS, HSESSIONENUM *phEnumHandle=NULL) throw() - { - if (phEnumHandle) - *phEnumHandle = NULL; - - if (pPOS) - *pPOS = NULL; - else - return E_POINTER; - - HRESULT hr = Access(); - if (hr == S_OK) - { - CSLockType lock(m_cs, false); - hr = lock.Lock(); - if (FAILED(hr)) - return hr; - *pPOS = m_Variables.GetStartPosition(); - } - return hr; - } - - STDMETHOD(GetNextVariable)(POSITION *pPOS, VARIANT *pVal, - HSESSIONENUM hEnum=NULL, - LPSTR szName=NULL, - DWORD dwLen=0 ) throw() - { - (hEnum); // Unused! - if (pVal) - VariantInit(pVal); - else - return E_POINTER; - - if (!pPOS) - return E_POINTER; - - CComVariant val; - POSITION pos = *pPOS; - HRESULT hr = Access(); - if (hr == S_OK) - { - CSLockType lock(m_cs, false); - hr = lock.Lock(); - if (FAILED(hr)) - return hr; - - hr = E_FAIL; - _ATLTRY - { - if (szName) - { - CStringA strName = m_Variables.GetKeyAt(pos); - if (strName.GetLength()) - { - if (dwLen > (DWORD)strName.GetLength()) - { - Checked::strcpy_s(szName, dwLen, strName); - hr = S_OK; - } - else - hr = E_OUTOFMEMORY; - } - } - else - hr = S_OK; - - if (hr == S_OK) - { - val = m_Variables.GetNextValue(pos); - hr = VariantCopy(pVal, &val); - if (hr == S_OK) - *pPOS = pos; - } - } - _ATLCATCHALL() - { - hr = E_UNEXPECTED; - } - } - return hr; - } - - STDMETHOD(CloseEnum)(HSESSIONENUM /*hEnumHandle*/) throw() - { - return S_OK; - } - - STDMETHOD(IsExpired)() throw() - { - CTime tmNow = CTime::GetCurrentTime(); - CTimeSpan span = tmNow-m_tLastAccess; - if ((unsigned __int64)((span.GetTotalSeconds()*1000)) > m_dwTimeout) - return S_OK; - return S_FALSE; - } - - HRESULT Access() throw() - { - // We lock here to protect against multiple threads - // updating the same member concurrently. - CSLockType lock(m_cs, false); - HRESULT hr = lock.Lock(); - if (FAILED(hr)) - return hr; - m_tLastAccess = CTime::GetCurrentTime(); - return S_OK; - } - - STDMETHOD(SetTimeout)(unsigned __int64 dwNewTimeout) throw() - { - // We lock here to protect against multiple threads - // updating the same member concurrently - CSLockType lock(m_cs, false); - HRESULT hr = lock.Lock(); - if (FAILED(hr)) - return hr; - m_dwTimeout = dwNewTimeout; - return S_OK; - } - - HRESULT SessionLock() throw() - { - Access(); - return S_OK; - } - - HRESULT SessionUnlock() throw() - { - return S_OK; - } - -protected: - typedef CAtlMap > VarMapType; - unsigned __int64 m_dwTimeout; - CTime m_tLastAccess; - VarMapType m_Variables; - CComAutoCriticalSection m_cs; - typedef CComCritSecLock CSLockType; -}; // CMemSession - - -// -// CMemSessionServiceImpl -// Implements the service part of in-memory persisted session services. -// -class CMemSessionServiceImpl -{ -public: - typedef void* SERVICEIMPL_INITPARAM_TYPE; - CMemSessionServiceImpl() throw() - { - m_dwTimeout = ATL_SESSION_TIMEOUT; - } - - ~CMemSessionServiceImpl() throw() - { - m_CritSec.Term(); - } - - HRESULT CreateNewSession(__out_ecount_part_z(*pdwSize, *pdwSize) LPSTR szNewID, __inout DWORD *pdwSize, __deref_out_opt ISession** ppSession) throw() - { - HRESULT hr = E_FAIL; - CComObject *pNewSession = NULL; - - if (!szNewID) - return E_INVALIDARG; - - if (!pdwSize) - return E_POINTER; - - if (ppSession) - *ppSession = NULL; - else - return E_POINTER; - - _ATLTRY - { - // Create new session - CComObject::CreateInstance(&pNewSession); - if (pNewSession == NULL) - return E_OUTOFMEMORY; - - // Initialize and add to list of CSessionData - hr = m_SessionNameGenerator.GetNewSessionName(szNewID, pdwSize); - - if (SUCCEEDED(hr)) - { - CComPtr spSession; - hr = pNewSession->QueryInterface(&spSession); - if (SUCCEEDED(hr)) - { - pNewSession->SetTimeout(m_dwTimeout); - pNewSession->Access(); - CSLockType lock(m_CritSec, false); - hr = lock.Lock(); - if (FAILED(hr)) - return hr; - hr = m_Sessions.SetAt(szNewID, spSession) != NULL ? S_OK : E_FAIL; - if (hr == S_OK) - *ppSession = spSession.Detach(); - } - } - } - _ATLCATCHALL() - { - hr = E_UNEXPECTED; - } - - return hr; - - } - - HRESULT CreateNewSessionByName(__in_z LPSTR szNewID, __deref_out_opt ISession** ppSession) throw() - { - HRESULT hr = E_FAIL; - CComObject *pNewSession = NULL; - - if (!szNewID || *szNewID == 0) - return E_INVALIDARG; - - if (ppSession) - *ppSession = NULL; - else - return E_POINTER; - - CComPtr spSession; - // If the session already exists, you get a pointer to the - // existing session. You can't have multiple entries with the - // same name in CAtlMap - hr = GetSession(szNewID, &spSession); - if (hr == S_OK) - { - *ppSession = spSession.Detach(); - return hr; - } - - _ATLTRY - { - // Create new session - CComObject::CreateInstance(&pNewSession); - if (pNewSession == NULL) - return E_OUTOFMEMORY; - - - hr = pNewSession->QueryInterface(&spSession); - if (SUCCEEDED(hr)) - { - pNewSession->SetTimeout(m_dwTimeout); - pNewSession->Access(); - CSLockType lock(m_CritSec, false); - hr = lock.Lock(); - if (FAILED(hr)) - return hr; - - hr = m_Sessions.SetAt(szNewID, spSession) != NULL ? S_OK : E_FAIL; - - if (hr == S_OK) - *ppSession = spSession.Detach(); - } - } - _ATLCATCHALL() - { - hr = E_UNEXPECTED; - } - - return hr; - - } - - HRESULT GetSession(LPCSTR szID, ISession **ppSession) throw() - { - HRESULT hr = E_FAIL; - SessMapType::CPair *pPair = NULL; - - if (ppSession) - *ppSession = NULL; - else - return E_POINTER; - - if (!szID) - return E_INVALIDARG; - - CSLockType lock(m_CritSec, false); - hr = lock.Lock(); - if (FAILED(hr)) - return hr; - - hr = E_FAIL; - _ATLTRY - { - pPair = m_Sessions.Lookup(szID); - if (pPair) // the session exists and is in our local map of sessions - { - hr = pPair->m_value.QueryInterface(ppSession); - } - } - _ATLCATCHALL() - { - return E_UNEXPECTED; - } - - return hr; - } - - HRESULT CloseSession(LPCSTR szID) throw() - { - if (!szID) - return E_INVALIDARG; - - HRESULT hr = E_FAIL; - CSLockType lock(m_CritSec, false); - hr = lock.Lock(); - if (FAILED(hr)) - return hr; - _ATLTRY - { - hr = m_Sessions.RemoveKey(szID) ? S_OK : E_UNEXPECTED; - } - _ATLCATCHALL() - { - hr = E_UNEXPECTED; - } - return hr; - } - - void SweepSessions() throw() - { - POSITION posRemove = NULL; - const SessMapType::CPair *pPair = NULL; - POSITION pos = NULL; - - CSLockType lock(m_CritSec, false); - if (FAILED(lock.Lock())) - return; - pos = m_Sessions.GetStartPosition(); - while (pos) - { - posRemove = pos; - pPair = m_Sessions.GetNext(pos); - if (pPair) - { - if (pPair->m_value.p && - S_OK == pPair->m_value->IsExpired()) - { - // remove our reference on the session - m_Sessions.RemoveAtPos(posRemove); - } - } - } - } - - HRESULT SetSessionTimeout(unsigned __int64 nTimeout) throw() - { - HRESULT hr = S_OK; - CComPtr spSession; - m_dwTimeout = nTimeout; - - CSLockType lock(m_CritSec, false); - hr = lock.Lock(); - if (FAILED(hr)) - return hr; - - POSITION pos = m_Sessions.GetStartPosition(); - if (!pos) - return S_OK; // no sessions to set the timeout on - - - while (pos) - { - SessMapType::CPair *pPair = const_cast(m_Sessions.GetNext(pos)); - if (pPair) - { - spSession = pPair->m_value; - if (spSession) - { - // if we fail on any of the sets we will return the - // error code immediately - hr = spSession->SetTimeout(nTimeout); - spSession.Release(); - if (hr != S_OK) - break; - } - else - { - hr = E_UNEXPECTED; - break; - } - } - else - { - hr = E_UNEXPECTED; - break; - } - } - - return hr; - } - - HRESULT GetSessionTimeout(unsigned __int64* pnTimeout) throw() - { - if (pnTimeout) - *pnTimeout = m_dwTimeout; - else - return E_POINTER; - - return S_OK; - } - - HRESULT GetSessionCount(DWORD *pnCount) throw() - { - if (pnCount) - *pnCount = 0; - else - return E_POINTER; - - CSLockType lock(m_CritSec, false); - HRESULT hr = lock.Lock(); - if (FAILED(hr)) - return hr; - *pnCount = (DWORD)m_Sessions.GetCount(); - - return S_OK; - } - - void ReleaseAllSessions() throw() - { - CSLockType lock(m_CritSec, false); - if (FAILED(lock.Lock())) - return; - m_Sessions.RemoveAll(); - } - - HRESULT Initialize(SERVICEIMPL_INITPARAM_TYPE, - IServiceProvider*, - unsigned __int64 dwNewTimeout) throw() - { - m_dwTimeout = dwNewTimeout; - return m_CritSec.Init(); - } - - typedef CAtlMap, - CElementTraitsBase > SessMapType; - - SessMapType m_Sessions; // map for holding sessions in memory - CComCriticalSection m_CritSec; // for synchronizing access to map - typedef CComCritSecLock CSLockType; - CSessionNameGenerator m_SessionNameGenerator; // Object for generating session names - unsigned __int64 m_dwTimeout; -}; // CMemSessionServiceImpl - - - -// -// CSessionStateService -// This class implements the session state service which can be -// exposed to request handlers. -// -// Template Parameters: -// MonitorClass: Provides periodic sweeping services for the session service class. -// TServiceImplClass: The class that actually implements the methods of the -// ISessionStateService and ISessionStateControl interfaces. -template -class CSessionStateService : - public ISessionStateService, - public ISessionStateControl, - public IWorkerThreadClient, - public CComObjectRootEx -{ -protected: - MonitorClass m_Monitor; - HANDLE m_hTimer; - CComPtr m_spServiceProvider; - TServiceImplClass m_SessionServiceImpl; -public: - // Construction/Initialization - CSessionStateService() throw() : - m_hTimer(NULL) - { - - } - ~CSessionStateService() throw() - { - ATLASSUME(m_hTimer == NULL); - } - BEGIN_COM_MAP(CSessionStateService) - COM_INTERFACE_ENTRY(ISessionStateService) - COM_INTERFACE_ENTRY(ISessionStateControl) - END_COM_MAP() - -// ISessionStateServie methods - STDMETHOD(CreateNewSession)(LPSTR szNewID, DWORD *pdwSize, ISession** ppSession) throw() - { - return m_SessionServiceImpl.CreateNewSession(szNewID, pdwSize, ppSession); - } - - STDMETHOD(CreateNewSessionByName)(LPSTR szNewID, ISession** ppSession) throw() - { - return m_SessionServiceImpl.CreateNewSessionByName(szNewID, ppSession); - } - - STDMETHOD(GetSession)(LPCSTR szID, ISession **ppSession) throw() - { - return m_SessionServiceImpl.GetSession(szID, ppSession); - } - - STDMETHOD(CloseSession)(LPCSTR szSessionID) throw() - { - return m_SessionServiceImpl.CloseSession(szSessionID); - } - - STDMETHOD(SetSessionTimeout)(unsigned __int64 nTimeout) throw() - { - return m_SessionServiceImpl.SetSessionTimeout(nTimeout); - } - - STDMETHOD(GetSessionTimeout)(unsigned __int64 *pnTimeout) throw() - { - return m_SessionServiceImpl.GetSessionTimeout(pnTimeout); - } - - STDMETHOD(GetSessionCount)(DWORD *pnSessionCount) throw() - { - return m_SessionServiceImpl.GetSessionCount(pnSessionCount); - } - - void SweepSessions() throw() - { - m_SessionServiceImpl.SweepSessions(); - } - - void ReleaseAllSessions() throw() - { - m_SessionServiceImpl.ReleaseAllSessions(); - } - - HRESULT Initialize( - IServiceProvider *pServiceProvider = NULL, - typename TServiceImplClass::SERVICEIMPL_INITPARAM_TYPE pInitData = NULL, - unsigned __int64 dwTimeout = ATL_SESSION_TIMEOUT) throw() - { - HRESULT hr = S_OK; - if (pServiceProvider) - m_spServiceProvider = pServiceProvider; - - hr = m_SessionServiceImpl.Initialize(pInitData, pServiceProvider, dwTimeout); - - return hr; - } - - - template - HRESULT Initialize( - CWorkerThread *pWorker, - IServiceProvider *pServiceProvider = NULL, - typename TServiceImplClass::SERVICEIMPL_INITPARAM_TYPE pInitData = NULL, - unsigned __int64 dwTimeout = ATL_SESSION_TIMEOUT) throw() - { - if (!pWorker) - return E_INVALIDARG; - - HRESULT hr = Initialize(pServiceProvider, pInitData, dwTimeout); - if (hr == S_OK) - { - hr = m_Monitor.Initialize(pWorker); - if (hr == S_OK) - { - //sweep every 500ms - hr = m_Monitor.AddTimer(ATL_SESSION_SWEEPER_TIMEOUT, this, 0, &m_hTimer); - } - } - return hr; - } - - void Shutdown() throw() - { - if (m_hTimer) - { - if(FAILED(m_Monitor.RemoveHandle(m_hTimer))) - { - /* can't report from here */ - ATLASSERT(FALSE); - } - m_hTimer = NULL; - } - ReleaseAllSessions(); - } -// Implementation - HRESULT Execute(DWORD_PTR /*dwParam*/, HANDLE /*hObject*/) throw() - { - SweepSessions(); - return S_OK; - } - - HRESULT CloseHandle(HANDLE hHandle) throw() - { - ::CloseHandle(hHandle); - m_hTimer = NULL; - return S_OK; - } - -}; // CSessionStateService - -} // namespace ATL -#pragma pack(pop) - -#pragma warning(pop) -#endif // __ATLSESSION_H__ diff --git a/include/atl/atlsharedsvc.h b/include/atl/atlsharedsvc.h deleted file mode 100644 index b309f12c6..000000000 --- a/include/atl/atlsharedsvc.h +++ /dev/null @@ -1,202 +0,0 @@ -// This is a part of the Active Template Library. -// Copyright (C) Microsoft Corporation -// All rights reserved. -// -// This source code is only intended as a supplement to the -// Active Template Library Reference and related -// electronic documentation provided with the library. -// See these sources for detailed information regarding the -// Active Template Library product. - -#ifndef __ATLSHAREDSVC_H__ -#define __ATLSHAREDSVC_H__ - -#pragma once - -#include -#include -#pragma pack(push,_ATL_PACKING) -namespace ATL{ - -#ifndef ATL_SHAREDBLOBCACHE_TIMEOUT - #define ATL_SHAREDBLOBCACHE_TIMEOUT 36000000000 // in 100 nano second intervals - // each entry will be free'd if - // no access in 1 hour. -#endif - -// Interface used by to access the shared blob cache. -[ uuid("AB4AF9CD-8DB1-4974-A617-CF0449578FB9"), object ] -__interface ISharedBlobCache -{ - [id(0)] STDMETHOD(AddItem)([in] BSTR szItemName, [in] BSTR szData); - [id(1)] STDMETHOD(GetItem)([in] BSTR szItemName, [out,retval] BSTR *szData); -}; - -class CSharedCache: - public CBlobCache, CStdStatClass >, - public IMemoryCacheClient, - public ISharedBlobCache -{ - typedef CBlobCache, CStdStatClass > basecache; -public: - - // IMemoryCacheClient method, frees data in the memory cache. - STDMETHOD( Free )(const void *pvData) - { - if (pvData) - { - ::SysFreeString((BSTR)pvData); - } - return S_OK; - } - - - STDMETHODIMP AddItem(BSTR szItemName, BSTR szData) - { - - HRESULT hr = E_UNEXPECTED; - - // We make a copy of the BSTR and stick it in the cache. - // The BSTR will be freed in our IMemoryCacheClient::Free - // implementation above. - BSTR szEntry = SysAllocString(szData); - if(szEntry) - { - USES_CONVERSION_EX; - // create a time span and for the entry - CFileTime tm = CFileTime::GetCurrentTime(); - CFileTimeSpan span; - span.SetTimeSpan(ATL_SHAREDBLOBCACHE_TIMEOUT); - tm += span; - HCACHEITEM h; - hr = basecache::Add(OLE2A_EX(szItemName, _ATL_SAFE_ALLOCA_DEF_THRESHOLD), szEntry, sizeof(BSTR), - &tm, _AtlBaseModule.m_hInst, &h, static_cast(this)); - - if (hr == S_OK) - { - // On successful add, we have to release our - // reference on the entry. - basecache::ReleaseEntry(h); - } - } - return hr; - } - - STDMETHODIMP GetItem(BSTR szItemName, BSTR *szData) - { - USES_CONVERSION_EX; - HRESULT hr = E_UNEXPECTED; - HCACHEITEM hEntry = NULL; - - if (!szItemName || !szData) - return hr; - - hr = basecache::LookupEntry(OLE2A_EX(szItemName, _ATL_SAFE_ALLOCA_DEF_THRESHOLD), &hEntry); - if (hr == S_OK) - { - void *pData = NULL; - DWORD dwSize = 0; - hr = basecache::GetData(hEntry, &pData, &dwSize); - if (hr == S_OK) - { - // make a copy of the string - *szData = ::SysAllocString((BSTR)pData); - } - basecache::ReleaseEntry(hEntry); - } - return hr; - } - - - STDMETHODIMP QueryInterface(REFIID riid, void **ppv) - { - HRESULT hr = E_NOINTERFACE; - if (InlineIsEqualGUID(__uuidof(IMemoryCacheClient), riid)|| - InlineIsEqualGUID(__uuidof(IUnknown), riid)) - { - *ppv = static_cast(static_cast(this)); - hr = S_OK; - } - else if( InlineIsEqualGUID(__uuidof(ISharedBlobCache), riid)) - { - *ppv = static_cast(static_cast(this)); - hr = S_OK; - } - return hr; - } - ULONG STDMETHODCALLTYPE AddRef() - { - return 1; - } - ULONG STDMETHODCALLTYPE Release() - { - return 1; - } -}; - - -// This class implements the SOAP interface for the shared blob cache. -[ - soap_handler( - name="SharedBlobCache", - namespace="http://www.microsoft.com/vc/atlserver/soap/SharedBlobCache", - protocol="soap" - ), - request_handler( - name="SharedBlobCache", - sdl="GenSharedBlobCacheWSDL" - ) -] -class CSharedCacheHandler: - public ISharedBlobCache -{ -public: - [soap_method] - STDMETHOD(AddItem)(BSTR szItemName, BSTR szData) - { - if (!m_spMemCache) - return E_UNEXPECTED; - return m_spMemCache->AddItem(szItemName, szData); - } - - [soap_method] - STDMETHOD(GetItem)(BSTR szItemName, BSTR *szData) - { - if (!m_spMemCache) - return E_UNEXPECTED; - return m_spMemCache->GetItem(szItemName, szData); - } - - HTTP_CODE Initialize(IServiceProvider *pProvider) - { - ATLASSERT(pProvider); // should never be NULL - if (!pProvider) - return HTTP_ERROR(500, ISE_SUBERR_UNEXPECTED); - - if (m_spMemCache) - return HTTP_SUCCESS; // already initialized - - pProvider->QueryService(__uuidof(ISharedBlobCache), &m_spMemCache); - return m_spMemCache ? HTTP_SUCCESS : HTTP_ERROR(500, ISE_SUBERR_UNEXPECTED); - } - - // override HandleRequest to Initialize our m_spServiceProvider - // and to handle authorizing the client. - HTTP_CODE HandleRequest(AtlServerRequest *pRequestInfo, IServiceProvider *pProvider) - { - HTTP_CODE dwErr = Initialize(pProvider); - if (dwErr != HTTP_SUCCESS) - return dwErr; - - dwErr = CSoapHandler::HandleRequest(pRequestInfo, - pProvider); - return dwErr; - } - CComPtr m_spMemCache; -}; - -} //ATL - -#pragma pack(pop) - -#endif // __ATLSHAREDSVC_H__ diff --git a/include/atl/atlsiface.h b/include/atl/atlsiface.h deleted file mode 100644 index 08480225a..000000000 --- a/include/atl/atlsiface.h +++ /dev/null @@ -1,802 +0,0 @@ -// This is a part of the Active Template Library. -// Copyright (C) Microsoft Corporation -// All rights reserved. -// -// This source code is only intended as a supplement to the -// Active Template Library Reference and related -// electronic documentation provided with the library. -// See these sources for detailed information regarding the -// Active Template Library product. - -#ifndef __ATLSIFACE_H__ -#define __ATLSIFACE_H__ - -#pragma once -#include -#include -#include -#include -#include -#include - -#pragma pack(push,_ATL_PACKING) -namespace ATL{ - -// Forward declarations of custom data types used in -// interfaces declared in this file. -struct AtlServerRequest; -class CIsapiWorker; -__interface IAtlMemMgr; -class CCookie; - -// Forward declarations of all interfaces declared in this file. -__interface IWriteStream; -__interface IHttpFile; -__interface IHttpServerContext; -__interface IHttpRequestLookup; -__interface IRequestHandler; -__interface ITagReplacer; -__interface IIsapiExtension; -__interface IPageCacheControl; -__interface IRequestStats; -__interface IBrowserCaps; -__interface IBrowserCapsSvc; - - -// ATLS Interface declarations. - -// IWriteStream -// Interface for writing to a stream. -__interface IWriteStream -{ - HRESULT WriteStream(LPCSTR szOut, int nLen, DWORD *pdwWritten); - HRESULT FlushStream(); -}; - -// IHttpFile -// This is an interface that provides for basic accessor -// functionality for files (see CHttpRequestFile). -__interface IHttpFile -{ - LPCSTR GetParamName(); - LPCSTR GetFileName(); - LPCSTR GetFullFileName(); - LPCSTR GetContentType(); - LPCSTR GetTempFileName(); - ULONGLONG GetFileSize(); - void Free(); -}; - -// IHttpServerContext -// This interface encapsulates the capabilities of the web server and provides information about -// the current request being handled. See CServerContext for implementation. -__interface ATL_NO_VTABLE __declspec(uuid("813F3F00-3881-11d3-977B-00C04F8EE25E")) - IHttpServerContext : public IUnknown -{ - HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void **ppv); - ULONG STDMETHODCALLTYPE AddRef(); - ULONG STDMETHODCALLTYPE Release(); - - LPCSTR GetRequestMethod(); - LPCSTR GetQueryString(); - LPCSTR GetPathInfo(); - LPCSTR GetPathTranslated(); - LPCSTR GetScriptPathTranslated(); - DWORD GetTotalBytes(); - DWORD GetAvailableBytes(); - BYTE *GetAvailableData(); - LPCSTR GetContentType(); - BOOL GetServerVariable(__in_z LPCSTR pszVariableName, - __out_ecount_part_opt(*pdwSize, *pdwSize) LPSTR pvBuffer, __inout DWORD *pdwSize); - BOOL GetImpersonationToken(HANDLE * pToken); - BOOL WriteClient(void *pvBuffer, DWORD *pdwBytes); - BOOL AsyncWriteClient(void *pvBuffer, DWORD *pdwBytes); - BOOL ReadClient(void *pvBuffer, DWORD *pdwSize); - BOOL AsyncReadClient(void *pvBuffer, DWORD *pdwSize); - BOOL SendRedirectResponse(LPCSTR pszRedirectUrl); - BOOL SendResponseHeader(LPCSTR pszHeader, LPCSTR pszStatusCode, - BOOL fKeepConn); - BOOL DoneWithSession(DWORD dwHttpStatusCode); - BOOL RequestIOCompletion(PFN_HSE_IO_COMPLETION pfn, DWORD *pdwContext); - BOOL TransmitFile(HANDLE hFile, PFN_HSE_IO_COMPLETION pfn, void *pContext, - LPCSTR szStatusCode, DWORD dwBytesToWrite, DWORD dwOffset, - void *pvHead, DWORD dwHeadLen, void *pvTail, - DWORD dwTailLen, DWORD dwFlags); - BOOL AppendToLog(LPCSTR szMessage, DWORD* pdwLen); - BOOL MapUrlToPathEx(LPCSTR szLogicalPath, DWORD dwLen, HSE_URL_MAPEX_INFO *pumInfo); -}; - -// IHttpRequestLookup -// This interface is designed to allow one map to chain to another map. -// The interface is implemented by the CHttpThunkMap and CHttpRequest classes. -// Pointers to this interface are passed around by CRequestHandlerT and CHtmlTagReplacer. -// dwType - the type of item being requested -__interface ATL_NO_VTABLE __declspec(uuid("A5990B44-FF74-4bfe-B66D-F9E7E9F42D42")) - IHttpRequestLookup : public IUnknown -{ - POSITION GetFirstQueryParam(LPCSTR *ppszName, LPCSTR *ppszValue); - POSITION GetNextQueryParam(POSITION pos, LPCSTR *ppszName, LPCSTR *ppszValue); - - POSITION GetFirstFormVar(LPCSTR *ppszName, LPCSTR *ppszValue); - POSITION GetNextFormVar(POSITION pos, LPCSTR *ppszName, LPCSTR *ppszValue); - - POSITION GetFirstFile(LPCSTR *ppszName, IHttpFile **ppFile); - POSITION GetNextFile(POSITION pos, LPCSTR *ppszName, IHttpFile **ppFile); - - HRESULT GetServerContext(IHttpServerContext **ppOut); -}; - - -// IRequestHandler -// This interface is impelemented by clients who want to be request handlers in an -// atl server application. Server default implementations are provided in ATL, including -// IRequestHandlerImpl (atlisapi.h) and CRequestHandlerT (atlstencil.h) -__interface ATL_NO_VTABLE __declspec(uuid("D57F8D0C-751A-4223-92BC-0B29F65D2453")) -IRequestHandler : public IUnknown -{ - HTTP_CODE GetFlags(DWORD *pdwStatus); - HTTP_CODE InitializeHandler(AtlServerRequest *pRequestInfo, IServiceProvider *pProvider); - HTTP_CODE InitializeChild(AtlServerRequest *pRequestInfo, IServiceProvider *pProvider, IHttpRequestLookup *pLookup); - HTTP_CODE HandleRequest(AtlServerRequest *pRequestInfo, IServiceProvider *pProvider); - void UninitializeHandler(); -}; - -// ITagReplacer -// This interface defines the methods necessary for server response file processing. -__interface ATL_NO_VTABLE __declspec(uuid("8FF5E90C-8CE0-43aa-96C4-3BF930837512")) - ITagReplacer : public IUnknown -{ - HTTP_CODE FindReplacementOffset(LPCSTR szMethodName, DWORD *pdwMethodOffset, - LPCSTR szObjectName, DWORD *pdwObjOffset, DWORD *pdwMap, void **ppvParam, IAtlMemMgr *pMemMgr); - HTTP_CODE RenderReplacement(DWORD dwFnOffset, DWORD dwObjOffset, DWORD dwMap, void *pvParam); - HRESULT GetContext(REFIID riid, void** ppv); - IWriteStream *SetStream(IWriteStream *pStream); -}; - - -struct CStencilState; - -// IIsapiExtension -// Tnis is the interface to the ISAPI extension of a running ATL Server web -// application. Provides request handler clients with access to functions of the -// ISAPI server. -__interface __declspec(uuid("79DD4A27-D820-4fa6-954D-E1DFC2C05978")) - IIsapiExtension : public IUnknown -{ - BOOL DispatchStencilCall(AtlServerRequest *pRequestInfo); - void RequestComplete(AtlServerRequest *pRequestInfo, DWORD hStatus, DWORD dwSubStatus); - BOOL OnThreadAttach(); - void OnThreadTerminate(); - BOOL QueueRequest(AtlServerRequest *pRequestInfo); - CIsapiWorker *GetThreadWorker(); - BOOL SetThreadWorker(CIsapiWorker *pWorker); - HTTP_CODE LoadRequestHandler(LPCSTR szDllPath, LPCSTR szHandlerName, IHttpServerContext *pServerContext, - HINSTANCE *phInstance, IRequestHandler **ppHandler); - HRESULT AddService(REFGUID guidService, REFIID riid, IUnknown *punk, HINSTANCE hInstance); - HRESULT RemoveService(REFGUID guidService, REFIID riid); - HTTP_CODE LoadDispatchFile(LPCSTR szFileName, AtlServerRequest *pRequestInfo); - - AtlServerRequest* CreateRequest(); - void FreeRequest(AtlServerRequest* pRequest); - HTTP_CODE TransferRequest( - AtlServerRequest *pRequest, - IServiceProvider *pServiceProvider, - IWriteStream *pWriteStream, - IHttpRequestLookup *pLookup, - LPCSTR szNewUrl, - WORD nCodePage, - bool bContinueAfterProcess, - CStencilState *pState); -}; - -// IPageCacheControl -// This interface controls the cacheability of the current page -__interface ATL_NO_VTABLE __declspec(uuid("9868BFC0-D44D-4154-931C-D186EC0C45D5")) - IPageCacheControl : public IUnknown -{ - HRESULT GetExpiration(FILETIME *pftExpiration); - HRESULT SetExpiration(FILETIME ftExpiration); - BOOL IsCached(); - BOOL Cache(BOOL bCache); -}; - -// IRequestStats -// Used to query request statistics from a running ATL server ISAPI application. -__interface ATL_NO_VTABLE __declspec(uuid("2B75C68D-0DDF-48d6-B58A-CC7C2387A6F2")) - IRequestStats : public IUnknown -{ - long GetTotalRequests(); - long GetFailedRequests(); - long GetAvgResponseTime(); - long GetCurrWaiting(); - long GetMaxWaiting(); - long GetActiveThreads(); -}; - -// IBrowserCaps -// Interface that provides information about a particular web brorwser. -// See atlutil.h and the ATL Browser Capabilities service for information -// about this interface's implementation -__interface __declspec(uuid("3339FCE2-99BC-4985-A702-4ABC8304A995")) - IBrowserCaps : public IUnknown -{ - HRESULT GetPropertyString(BSTR bstrProperty, BSTR * pbstrOut); - HRESULT GetBooleanPropertyValue(BSTR bstrProperty, BOOL* pbOut); - HRESULT GetBrowserName(BSTR * pbstrName); - HRESULT GetPlatform(BSTR * pbstrPlatform); - HRESULT GetVersion(BSTR * pbstrVersion); - HRESULT GetMajorVer(BSTR * pbstrMajorVer); - HRESULT GetMinorVer(BSTR * pbstrMinorVer); - HRESULT SupportsFrames(BOOL* pbFrames); - HRESULT SupportsTables(BOOL* pbTables); - HRESULT SupportsCookies(BOOL* pbCookies); - HRESULT SupportsBackgroundSounds(BOOL* pbBackgroundSounds); - HRESULT SupportsVBScript(BOOL* pbVBScript); - HRESULT SupportsJavaScript(BOOL* pbJavaScript); - HRESULT SupportsJavaApplets(BOOL* pbJavaApplets); - HRESULT SupportsActiveXControls(BOOL* pbActiveXControls); - HRESULT SupportsCDF(BOOL* pbCDF); - HRESULT SupportsAuthenticodeUpdate(BOOL* pbAuthenticodeUpdate); - HRESULT IsBeta(BOOL* pbIsBeta); - HRESULT IsCrawler(BOOL* pbIsCrawler); - HRESULT IsAOL(BOOL* pbIsAOL); - HRESULT IsWin16(BOOL* pbIsWin16); - HRESULT IsAK(BOOL* pbIsAK); - HRESULT IsSK(BOOL* pbIsSK); - HRESULT IsUpdate(BOOL* pbIsUpdate); -}; - -// IBrowserCapsSvc. -// Interface on the browser caps service. Used by clients to query a running -// instance of the browser capabilities service for information about a user's web -// browser. See atlutil.h for implementation of the browser capabilities services. -__interface __declspec(uuid("391E7418-863B-430e-81BB-1312ED2FF3E9")) - IBrowserCapsSvc : public IUnknown -{ - HRESULT GetCaps(IHttpServerContext * pContext, IBrowserCaps ** ppOut); - HRESULT GetCapsUserAgent(BSTR bstrAgent, IBrowserCaps ** ppOut); -}; - -class CBrowserCapsSvc : public IBrowserCapsSvc, - public CComObjectRootEx -{ -public: - virtual ~CBrowserCapsSvc() - { - } - - BEGIN_COM_MAP(CBrowserCapsSvc) - COM_INTERFACE_ENTRY(IBrowserCapsSvc) - END_COM_MAP() - - __success(SUCCEEDED(return)) __checkReturn HRESULT GetCaps(__in IHttpServerContext * pContext, __deref_out_opt IBrowserCaps ** ppOut) - { - if (!pContext) - return E_POINTER; - - if (!ppOut) - return E_POINTER; - - *ppOut = NULL; - - char szUserAgent[256]; - DWORD dwSize = sizeof(szUserAgent); - if (!pContext->GetServerVariable("HTTP_USER_AGENT", szUserAgent, &dwSize)) - return E_FAIL; - - return GetCapsUserAgent(CComBSTR(szUserAgent), ppOut); - } - - __success(SUCCEEDED(return)) __checkReturn HRESULT GetCapsUserAgent(__in BSTR bstrAgent, __deref_out IBrowserCaps ** ppOut) - { - if (::SysStringLen(bstrAgent) == 0 || ppOut == NULL) - { - return E_POINTER; - } - - *ppOut = NULL; - - BrowserCaps* pCaps = NULL; - - _ATLTRY - { - CW2CT szUserAgent(bstrAgent); - - if (!m_mapAgent.Lookup(szUserAgent, pCaps)) - { - pCaps = NULL; - for (size_t i=0; i *pRet = NULL; - - ATLTRY(pRet = new CComObjectNoLock); - - if (!pRet) - return E_OUTOFMEMORY; - pRet->AddRef(); - - HRESULT hr = pRet->Initialize(pCaps); - if (FAILED(hr)) - { - pRet->Release(); - return hr; - } - - *ppOut = pRet; - return S_OK; - } -#pragma warning(pop) - - return E_FAIL; - } - - __checkReturn HRESULT Initialize(__in HINSTANCE hInstance) throw() - { - // tries loading browscap.ini from the same directory as the module - if (hInstance != NULL) - { - _ATLTRY - { - CPath strBrowscapPath; - - LPTSTR sz = strBrowscapPath.m_strPath.GetBuffer(MAX_PATH); - UINT nChars = ::GetModuleFileName(hInstance, sz, MAX_PATH); - strBrowscapPath.m_strPath.ReleaseBuffer(nChars); - if (nChars != 0 && - nChars != MAX_PATH && - strBrowscapPath.RemoveFileSpec()) - { - strBrowscapPath += _T("\\browscap.ini"); - if (SUCCEEDED(Load(strBrowscapPath))) - return S_OK; - } - } - _ATLCATCHALL() - { - return E_FAIL; - } - } - - // falls back to the system browscap.ini if previous Load failed - return Load(); - } - - HRESULT Uninitialize() - { - Clear(); - return S_OK; - } - -private: - static bool IsEqualAgentString(__in LPCTSTR szPattern, __in LPCTSTR szInput) - { - while (*szPattern && *szInput && (*szPattern == *szInput || *szPattern == '?')) - { - szPattern++; - szInput++; - } - - if (*szPattern == *szInput) - { - return true; - } - - if (*szPattern == '*') - { - szPattern++; - if (!*szPattern) - { - return true; - } - while(*szInput) - { - if (IsEqualAgentString(szPattern, szInput)) - { - return true; - } - - szInput++; - } - } - - return false; - } - - __checkReturn HRESULT Load(__in_opt LPCTSTR szPath = NULL) - { - _ATLTRY - { - Clear(); - - CString strBrowscapPath(szPath); - - // use default load path if a path isn't specified - if (strBrowscapPath.IsEmpty()) - { - LPTSTR sz = strBrowscapPath.GetBuffer(MAX_PATH); - UINT nChars = ::GetSystemDirectory(sz, MAX_PATH); - strBrowscapPath.ReleaseBuffer(nChars); - if (nChars == 0 || nChars == MAX_PATH) - return E_FAIL; - - strBrowscapPath += _T("\\inetsrv\\browscap.ini"); - } - - size_t nCurrent = 16384; - CHeapPtr data; - - if (!data.Allocate(nCurrent)) - return E_OUTOFMEMORY; - - // load the list of all the user agents - bool bRetrieved = false; - - do - { - DWORD dwRetrieved = ::GetPrivateProfileSectionNames(data, (DWORD) nCurrent, strBrowscapPath); - if (dwRetrieved == 0) - { - return AtlHresultFromWin32(ERROR_FILE_NOT_FOUND); - } - else if (dwRetrieved < nCurrent-2) - { - bRetrieved = true; - } - else if(SIZE_MAX/2, CStringElementTraits > m_props; - }; - - // map from UserAgent string to caps - // used for non-wildcard lookup and parent lookup - CAtlMap > m_mapAgent; - - // all of the caps - CAtlArray m_caps; - - class CBrowserCaps : public IBrowserCaps, public CComObjectRootEx - { - public: - - BEGIN_COM_MAP(CBrowserCaps) - COM_INTERFACE_ENTRY(IBrowserCaps) - END_COM_MAP() - - CBrowserCaps() - { - } - - HRESULT Initialize(__in CBrowserCapsSvc::BrowserCaps * pCaps) - { - m_pCaps = pCaps; - return S_OK; - } - - __checkReturn HRESULT GetPropertyString(__in BSTR bstrProperty, __out BSTR * pbstrOut) - { - _ATLTRY - { - ATLASSUME(m_pCaps); - if (!m_pCaps) - return E_UNEXPECTED; - - if (!pbstrOut) - return E_POINTER; - - *pbstrOut = NULL; - - CString strName(bstrProperty); - CString strVal; - - CBrowserCapsSvc::BrowserCaps * pCaps = m_pCaps; - while (pCaps) - { - if (pCaps->m_props.Lookup(strName, strVal)) - { - CComBSTR bstrVal(strVal); - *pbstrOut = bstrVal.Detach(); - return S_OK; - } - - pCaps = pCaps->m_pParent; - } - - return S_FALSE; - } - _ATLCATCHALL() - { - return E_FAIL; - } - } - - __checkReturn HRESULT GetBooleanPropertyValue(__in BSTR bstrProperty, __out BOOL* pbOut) - { - if (!pbOut) - return E_POINTER; - - CComBSTR bstrOut; - HRESULT hr = GetPropertyString(bstrProperty, &bstrOut); - if (FAILED(hr) || S_FALSE == hr) - return hr; - - if (_wcsicmp(bstrOut, L"true") == 0) - *pbOut = TRUE; - else - *pbOut = FALSE; - - return S_OK; - } - - __checkReturn HRESULT GetBrowserName(__out BSTR * pbstrName) - { - return GetPropertyString(CComBSTR(L"browser"), pbstrName); - } - - __checkReturn HRESULT GetPlatform(__out BSTR * pbstrPlatform) - { - return GetPropertyString(CComBSTR(L"platform"), pbstrPlatform); - } - - __checkReturn HRESULT GetVersion(__out BSTR * pbstrVersion) - { - return GetPropertyString(CComBSTR(L"version"), pbstrVersion); - } - - __checkReturn HRESULT GetMajorVer(__out BSTR * pbstrMajorVer) - { - return GetPropertyString(CComBSTR(L"majorver"), pbstrMajorVer); - } - - __checkReturn HRESULT GetMinorVer(__out BSTR * pbstrMinorVer) - { - return GetPropertyString(CComBSTR(L"minorver"), pbstrMinorVer); - } - - __checkReturn HRESULT SupportsFrames(__out BOOL* pbFrames) - { - return GetBooleanPropertyValue(CComBSTR(L"frames"), pbFrames); - } - - __checkReturn HRESULT SupportsTables(__out BOOL* pbTables) - { - return GetBooleanPropertyValue(CComBSTR(L"tables"), pbTables); - } - __checkReturn HRESULT SupportsCookies(__out BOOL* pbCookies) - { - return GetBooleanPropertyValue(CComBSTR(L"cookies"), pbCookies); - } - __checkReturn HRESULT SupportsBackgroundSounds(__out BOOL* pbBackgroundSounds) - { - return GetBooleanPropertyValue(CComBSTR(L"backgroundsounds"), pbBackgroundSounds); - } - __checkReturn HRESULT SupportsVBScript(__out BOOL* pbVBScript) - { - return GetBooleanPropertyValue(CComBSTR(L"vbscript"), pbVBScript); - } - __checkReturn HRESULT SupportsJavaScript(__out BOOL* pbJavaScript) - { - return GetBooleanPropertyValue(CComBSTR(L"javascript"), pbJavaScript); - } - __checkReturn HRESULT SupportsJavaApplets(__out BOOL* pbJavaApplets) - { - return GetBooleanPropertyValue(CComBSTR(L"javaapplets"), pbJavaApplets); - } - __checkReturn HRESULT SupportsActiveXControls(__out BOOL* pbActiveXControls) - { - return GetBooleanPropertyValue(CComBSTR(L"ActiveXControls"), pbActiveXControls); - } - __checkReturn HRESULT SupportsCDF(__out BOOL* pbCDF) - { - return GetBooleanPropertyValue(CComBSTR(L"CDF"), pbCDF); - } - __checkReturn HRESULT SupportsAuthenticodeUpdate(__out BOOL* pbAuthenticodeUpdate) - { - return GetBooleanPropertyValue(CComBSTR(L"AuthenticodeUpdate"), pbAuthenticodeUpdate); - } - __checkReturn HRESULT IsBeta(__out BOOL* pbIsBeta) - { - return GetBooleanPropertyValue(CComBSTR(L"beta"), pbIsBeta); - } - __checkReturn HRESULT IsCrawler(__out BOOL* pbIsCrawler) - { - return GetBooleanPropertyValue(CComBSTR(L"Crawler"), pbIsCrawler); - } - __checkReturn HRESULT IsAOL(__out BOOL* pbIsAOL) - { - return GetBooleanPropertyValue(CComBSTR(L"AOL"), pbIsAOL); - } - __checkReturn HRESULT IsWin16(__out BOOL* pbIsWin16) - { - return GetBooleanPropertyValue(CComBSTR(L"Win16"), pbIsWin16); - } - __checkReturn HRESULT IsAK(__out BOOL* pbIsAK) - { - return GetBooleanPropertyValue(CComBSTR(L"AK"), pbIsAK); - } - __checkReturn HRESULT IsSK(__out BOOL* pbIsSK) - { - return GetBooleanPropertyValue(CComBSTR(L"SK"), pbIsSK); - } - __checkReturn HRESULT IsUpdate(__out BOOL* pbIsUpdate) - { - return GetBooleanPropertyValue(CComBSTR(L"Update"), pbIsUpdate); - } - - private: - CBrowserCapsSvc::BrowserCaps * m_pCaps; - }; -}; - -typedef DWORD_PTR HSESSIONENUM; - -// ISession -// Interface on a single client session. Used to access variables in the client -// session in the session state services. See atlsession.h for implementation of -// this interface. -__interface __declspec(uuid("DEB69BE3-7AC9-4a13-9519-266C1EA3AB39")) - ISession : public IUnknown -{ - STDMETHOD(SetVariable)(LPCSTR szName, VARIANT NewVal); - STDMETHOD(GetVariable)(LPCSTR szName, VARIANT *pVal); - STDMETHOD(GetCount)(long *pnCount); - STDMETHOD(RemoveVariable)(LPCSTR szName); - STDMETHOD(RemoveAllVariables)(); - STDMETHOD(BeginVariableEnum)(POSITION *pPOS, HSESSIONENUM *phEnumHandle); - STDMETHOD(GetNextVariable)(POSITION *pPOS, VARIANT *pVal, HSESSIONENUM hEnum, LPSTR szName, DWORD dwLen); - STDMETHOD(CloseEnum)(HSESSIONENUM hEnumHandle); - STDMETHOD(IsExpired)(); - STDMETHOD(SetTimeout)(unsigned __int64 dwNewTimeout); -}; //ISession - - -// ISessionStateService -// Interface on the session state service for an ISAPI application. Request -// handler objects will use this interface to access user sessions. See -// atlsession.h for implementation of this interface. -__interface __declspec(uuid("C5740C4F-0C6D-4b43-92C4-2AF778F35DDE")) - ISessionStateService : public IUnknown -{ - STDMETHOD(CreateNewSession)(LPSTR szNewID, DWORD *pdwSize, ISession** ppSession); - STDMETHOD(CreateNewSessionByName)(LPSTR szNewID, ISession** ppSession); - STDMETHOD(GetSession)(LPCSTR szID, ISession **ppSession); - STDMETHOD(CloseSession)(LPCSTR szID); -}; - -// ISessionStateControl -// Interface used by session state service to get information about the service. -// Currently you can get the count of active sessions and the current default -// timeout for a session. -__interface __declspec(uuid("6C7F5F56-6CBD-49ee-9797-4C837D4C527A")) - ISessionStateControl : public IUnknown -{ - STDMETHOD(SetSessionTimeout)(unsigned __int64 nTimeout); - STDMETHOD(GetSessionTimeout)(unsigned __int64 *pnTimeout); - STDMETHOD(GetSessionCount)(DWORD *pnSessionCount); -}; - -}; // namespace ATL -#pragma pack(pop) - -#endif // __ATLSIFACE_H__ diff --git a/include/atl/atlsmtpconnection.h b/include/atl/atlsmtpconnection.h deleted file mode 100644 index 5cda41d1d..000000000 --- a/include/atl/atlsmtpconnection.h +++ /dev/null @@ -1,926 +0,0 @@ -// This is a part of the Active Template Library. -// Copyright (C) Microsoft Corporation -// All rights reserved. -// -// This source code is only intended as a supplement to the -// Active Template Library Reference and related -// electronic documentation provided with the library. -// See these sources for detailed information regarding the -// Active Template Library product. - -#ifndef __ATLSMTPCONNECTION_H__ -#define __ATLSMTPCONNECTION_H__ - -#pragma once - -#ifndef _ATL_NO_DEFAULT_LIBS -#pragma comment(lib, "ws2_32.lib") -#endif // !_ATL_NO_DEFAULT_LIBS - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// SMTP Return Codes -#define ATLSMTP_MAIL_SUCCESS 250 -#define ATLSMTP_RCPT_SUCCESS 250 -#define ATLSMTP_RCPT_NOT_LOCAL 251 -#define ATLSMTP_DATA_INTERMEDIATE 354 - -#define ATLSMTP_CONN_SUCC "220" -#define ATLSMTP_HELO_SUCC "250" -#define ATLSMTP_MAIL_SUCC "250" -#define ATLSMTP_RCPT_SUCC "250" -#define ATLSMTP_RCPT_NLOC "251" -#define ATLSMTP_DATA_INTM "354" -#define ATLSMTP_DATA_SUCC "250" -#define ATLSMTP_RSET_SUCC "250" - -// SMTP flags -#define ATLSMTP_DUMP_SENDER 1 -#define ATLSMTP_DUMP_RECIPS 2 -#define ATLSMTP_FOR_SEND 4 - - -struct CSMTPWSAStartup -{ -private: - bool m_bInit; - -public: - CSMTPWSAStartup() throw() - :m_bInit(false) - { - Init(); - } - - ~CSMTPWSAStartup() throw() - { - Uninit(); - } - - bool Init() throw() - { - if (m_bInit) - return true; - - WSADATA wsadata; - if (WSAStartup(ATLSMTP_WSA_VERSION, &wsadata)) - return false; - m_bInit = true; - ATLASSERT(wsadata.wHighVersion >= 2); - return true; - } - - bool Uninit() throw() - { - if (m_bInit) - if (WSACleanup()) - return false; - m_bInit = false; - return true; - } -}; - -__declspec(selectany) CSMTPWSAStartup _g_smtp_init; - -#pragma pack(push,_ATL_PACKING) -namespace ATL { - -class CSMTPConnection -{ -protected: - - // the socket - SOCKET m_hSocket; - - // the OVERLAPPED struct - OVERLAPPED m_Overlapped; - -public: - - CSMTPConnection() throw() - :m_hSocket(INVALID_SOCKET) - { - // initialize the OVERLAPPED struct - memset(&m_Overlapped, 0, sizeof(OVERLAPPED)); - } - - ~CSMTPConnection() throw() - { - Disconnect(); - } - - // Attempt to connect to the socket - // lpszHostName - the host name to connect to - BOOL Connect(LPCTSTR lpszHostName, DWORD dwTimeout = 10000) throw() - { - ATLASSERT(lpszHostName != NULL); - - // If we're already connected - if (Connected()) - { - return FALSE; - } - - if (!_g_smtp_init.Init()) - { - return FALSE; - } - - CSocketAddr address; - if (address.FindAddr(lpszHostName, IPPORT_SMTP, 0, PF_UNSPEC, SOCK_STREAM, 0)) - { - return FALSE; - } - - ADDRINFOT *pAI; - - BOOL bRet = FALSE; - int nIndex = 0; - while ((pAI = address.GetAddrInfo(nIndex++)) != NULL) - { - // create the socket - m_hSocket = WSASocket(pAI->ai_family, pAI->ai_socktype, pAI->ai_protocol, NULL, 0, WSA_FLAG_OVERLAPPED); - - if (m_hSocket == INVALID_SOCKET) - { - return FALSE; - } - - bRet = FALSE; - WSAEVENT hEventConnect = WSACreateEvent(); - if (hEventConnect != NULL) - { - if (SOCKET_ERROR != WSAEventSelect(m_hSocket, hEventConnect, FD_CONNECT)) - { - if (WSAConnect(m_hSocket, pAI->ai_addr, (int)pAI->ai_addrlen, - NULL, NULL, NULL, NULL)) - { - if (WSAGetLastError() == WSAEWOULDBLOCK) - { - DWORD dwWait = WaitForSingleObject((HANDLE) hEventConnect, dwTimeout); - if (dwWait == WAIT_OBJECT_0) - { - // make sure there were no connection errors. - WSANETWORKEVENTS wse; - ZeroMemory(&wse, sizeof(wse)); - WSAEnumNetworkEvents(m_hSocket, NULL, &wse); - if (wse.iErrorCode[FD_CONNECT_BIT]==0) - { - bRet = TRUE; - } - } - } - } - } - - // we're done with the event - WSACloseEvent(hEventConnect); - } - if (bRet) - { - break; - } - - shutdown(m_hSocket, SD_BOTH); - closesocket(m_hSocket); - m_hSocket = INVALID_SOCKET; - } - - - // Create an event for asynchronous I/O - if (bRet) - { - ATLASSUME(m_Overlapped.hEvent == NULL); - m_Overlapped.hEvent = CreateEvent(NULL, TRUE, TRUE, NULL); - if (m_Overlapped.hEvent == NULL) - { - bRet = FALSE; - } - } - - char szBuf[ATLSMTP_MAX_LINE_LENGTH+1]; - int nBufLen = ATLSMTP_MAX_LINE_LENGTH; - if (bRet) - { - // See if the connect returns success - bRet = AtlSmtpReadData((HANDLE)m_hSocket, szBuf, &nBufLen, &m_Overlapped); - if (bRet) - { - if (strncmp(szBuf, ATLSMTP_CONN_SUCC, ATLSMTP_RETCODE_LEN)) - { - bRet = FALSE; - } - } - } - - char szLocalHost[ATLSMTP_MAX_SERVER_NAME_LENGTH+1]; - - // gethostname should return 0 on success - if (bRet && gethostname(szLocalHost, ATLSMTP_MAX_SERVER_NAME_LENGTH)) - { - bRet = FALSE; - } - - // Send HELO command and get reply - if (bRet) - { - nBufLen = sprintf_s(szBuf, ATLSMTP_MAX_LINE_LENGTH+1, "HELO %s\r\n", szLocalHost); - if (nBufLen > 0) - { - bRet = AtlSmtpSendAndCheck((HANDLE)m_hSocket, szBuf, nBufLen, szBuf, &nBufLen, - ATLSMTP_MAX_LINE_LENGTH, ATLSMTP_HELO_SUCC, &m_Overlapped); - } - else - { - bRet = FALSE; - } - } - - if (!bRet) - { - if (m_Overlapped.hEvent != NULL) - CloseHandle(m_Overlapped.hEvent); - shutdown(m_hSocket, SD_BOTH); - closesocket(m_hSocket); - m_hSocket = INVALID_SOCKET; - } - - return bRet; - } - - // Disconnect the socket - inline BOOL Disconnect() throw() - { - if (!Connected()) - { - return FALSE; - } - - // shutdown should return 0 on success - if (shutdown(m_hSocket, SD_BOTH)) - { - return FALSE; - } - - // closesocket should return 0 on success - if (closesocket(m_hSocket)) - { - return FALSE; - } - - // close the handle to the overlapped event - CloseHandle(m_Overlapped.hEvent); - m_hSocket = INVALID_SOCKET; - memset((void*)&m_Overlapped, 0, sizeof(OVERLAPPED)); - return TRUE; - } - - // Are we connected? - inline BOOL Connected() throw() - { - return (m_hSocket != INVALID_SOCKET ? TRUE : FALSE); - } - - // Send a message from a file - // lpszFileName - the file containing the message - // lpszRecipients - the recipients to send to (optional - if not specified, the recipients specified - // in the file will be used - // lpszSender - the sender (optional - if not specified, the recipients specified in the file - // will be used - BOOL SendMessage(LPCTSTR lpszFileName, LPCTSTR lpszRecipients = NULL, LPCTSTR lpszSender = NULL) throw() - { - if (!Connected()) - { - return FALSE; - } - - //Try to open the file - CAtlFile readFile; - if (FAILED(readFile.Create(lpszFileName, GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL))) - { - return FALSE; - } - - char szBuf[ATLSMTP_MAX_LINE_LENGTH+1]; - int nBufLen = ATLSMTP_MAX_LINE_LENGTH; - BOOL bDumpedSender = FALSE; - - //If the caller specifies the sender, rather than having an existing one in the file... - if (lpszSender) - { - nBufLen = sprintf_s(szBuf, ATLSMTP_MAX_LINE_LENGTH+1, - "MAIL FROM:<%s>\r\n", (LPCSTR) CT2CA(lpszSender)); - if ((nBufLen < 0) || - (!AtlSmtpSendAndCheck((HANDLE)m_hSocket, szBuf, nBufLen, szBuf, &nBufLen, ATLSMTP_MAX_LINE_LENGTH, - ATLSMTP_MAIL_SUCC, &m_Overlapped))) - { - return FALSE; - } - bDumpedSender = TRUE; - } - nBufLen = ATLSMTP_MAX_LINE_LENGTH; - -#ifdef ATLSMTP_DOUBLE_BUFFERED - char buffer1[ATLSMTP_READBUFFER_SIZE]; - char buffer2[ATLSMTP_READBUFFER_SIZE]; - char* currBuffer = buffer1; - char* prevBuffer = NULL; - - int nCurrBuffer = 0; - DWORD dwPrevLength = 0; - DWORD dwWritten = 0; -#else - char bakBuffer[ATLSMTP_READBUFFER_SIZE]; - char* currBuffer = bakBuffer; - -#endif // ATLSMTP_DOUBLE_BUFFERED - DWORD dwRead = 0; - DWORD dwBytesInBuffer = 0; - DWORD dwBufPos = 0; - - //first handle the MAIL FROM and RCPT TO commands - BOOL bDumpedRecipients = FALSE; - BOOL bRet = TRUE; - while (bRet) - { - int nRetCode = 0; - - //if we have dumped the sender, and we have extra recipients to send, - //and we haven't alredy done so, do it - if (lpszRecipients && !bDumpedRecipients && bDumpedSender) - { - bRet = DumpRecipients((HANDLE)m_hSocket, CT2A(lpszRecipients), &m_Overlapped, ATLSMTP_FOR_SEND); - } - - if (bRet) - { - dwRead = 0; - BOOL bFullLine = FALSE; - bRet = ReadLine(readFile, currBuffer, szBuf, &dwBytesInBuffer, &dwBufPos, - ATLSMTP_READBUFFER_SIZE, ATLSMTP_MAX_LINE_LENGTH, &dwRead, &bFullLine); - if (dwRead == 0 || bFullLine == FALSE) - bRet = FALSE; - } - - if (bRet) - { - bRet = AtlSmtpSendAndWait((HANDLE)m_hSocket, szBuf, (int)(dwRead), &m_Overlapped); - } - - if (bRet) - { - nBufLen = ATLSMTP_MAX_LINE_LENGTH; - bRet = AtlSmtpReadData((HANDLE)m_hSocket, szBuf, &nBufLen, &m_Overlapped); - } - - if (bRet) - { - nRetCode = atoi(szBuf); - //if the command is equal to ATLSMTP_MAIL_SUCC (or RCPT_SUCC: they are equivalent) - if (nRetCode == ATLSMTP_MAIL_SUCCESS || nRetCode == ATLSMTP_RCPT_NOT_LOCAL || nRetCode == ATLSMTP_RCPT_SUCCESS) - { - bDumpedSender = TRUE; - continue; - } - - //If the command is equal to the data intermediate success code, - //break out of the loop - if (nRetCode == ATLSMTP_DATA_INTERMEDIATE) - break; - } - - //otherwise, we got an error code - CancelMessage(); - return FALSE; - } - - dwRead = dwBytesInBuffer; - currBuffer+= dwBufPos; - DWORD dwErr = 0; - do - { - dwErr = 0; - - //Try to send the data -#ifdef ATLSMTP_DOUBLE_BUFFERED - if (!AtlSmtpSendOverlapped((HANDLE)m_hSocket, currBuffer, dwRead, prevBuffer, dwPrevLength, &m_Overlapped)) - { - bRet = FALSE; - break; - } -#else - if (!AtlSmtpSendAndWait((HANDLE)m_hSocket, currBuffer, dwRead, &m_Overlapped)) - { - bRet = FALSE; - break; - } -#endif // ATLSMTP_DOUBLE_BUFFERED - - //swap the current and previous buffer -#ifdef ATLSMTP_DOUBLE_BUFFERED - prevBuffer = currBuffer; - currBuffer = (nCurrBuffer == 0 ? buffer2 : buffer1); - nCurrBuffer = (nCurrBuffer == 0 ? 1 : 0); - dwPrevLength = dwBytesInBuffer; -#else - currBuffer = bakBuffer; -#endif // ATLSMTP_DOUBLE_BUFFERED - - if (FAILED(readFile.Read(currBuffer, ATLSMTP_READBUFFER_SIZE, dwRead))) - { - bRet = FALSE; - break; - } - } while (dwRead != 0); - - //ensure that the last of the data is sent -#ifdef ATLSMTP_DOUBLE_BUFFERED - if (!GetOverlappedResult((HANDLE)m_hSocket, &m_Overlapped, &dwWritten, TRUE)) - { - if ((dwErr = GetLastError()) != ERROR_IO_PENDING && dwErr != ERROR_IO_INCOMPLETE) - bRet = FALSE; - else if (dwWritten < dwPrevLength) - bRet = AtlSmtpSendAndWait((HANDLE)m_hSocket, prevBuffer+dwWritten, dwPrevLength-dwWritten, &m_Overlapped); - } -#endif // ATLSMTP_DOUBLE_BUFFERED - - - if (bRet) - { - // End the message with a CRLF.CRLF - nBufLen = sprintf_s(szBuf, _countof(szBuf), "\r\n.\r\n"); - if (!AtlSmtpSendAndCheck((HANDLE)m_hSocket, szBuf, nBufLen, - szBuf, &nBufLen, ATLSMTP_MAX_LINE_LENGTH, ATLSMTP_DATA_SUCC, &m_Overlapped)) - { - bRet = FALSE; - } - } - - return bRet; - } - - // Send the message - // msg - the CMimeMessage to send - // lpszSender - the sender - inline BOOL SendMessage(CMimeMessage& msg, LPCTSTR lpszRecipients = NULL, LPCTSTR lpszSender = NULL) throw() - { - if (!Connected()) - { - return FALSE; - } - - char szBuf[ATLSMTP_MAX_LINE_LENGTH+1]; - - //Send MAIL FROM command and get reply - int nBufLen = sprintf_s(szBuf, ATLSMTP_MAX_LINE_LENGTH+1, "MAIL FROM:<%s>\r\n", - (lpszSender ? (LPCSTR) CT2CA(lpszSender) : msg.GetSender())); - if ((nBufLen < 0) || - (!AtlSmtpSendAndCheck((HANDLE)m_hSocket, szBuf, nBufLen, - szBuf, &nBufLen, ATLSMTP_MAX_LINE_LENGTH, ATLSMTP_MAIL_SUCC, &m_Overlapped))) - { - return FALSE; - } - - BOOL bRet = TRUE; - if (!lpszRecipients) - { - LPSTR lpszRecipientsA = NULL; - DWORD dwLen = msg.GetRequiredRecipientsStringLength(); - lpszRecipientsA = static_cast(calloc(sizeof(char),dwLen)); - if (!lpszRecipientsA || msg.GetRecipientsString(lpszRecipientsA, &dwLen) == FALSE) - { - bRet = FALSE; - } - if (bRet) - bRet = DumpRecipients((HANDLE)m_hSocket, lpszRecipientsA, &m_Overlapped, ATLSMTP_FOR_SEND); - free(lpszRecipientsA); - } - else - { - bRet = DumpRecipients((HANDLE)m_hSocket, CT2CA(lpszRecipients), - &m_Overlapped, ATLSMTP_FOR_SEND); - } - - //Begin the data output - if (bRet) - { - nBufLen = sprintf_s(szBuf, _countof(szBuf), "DATA\r\n"); - bRet = AtlSmtpSendAndCheck((HANDLE)m_hSocket, szBuf, nBufLen, - szBuf, &nBufLen, ATLSMTP_MAX_LINE_LENGTH, ATLSMTP_DATA_INTM, &m_Overlapped); - } - - if (!bRet) - CancelMessage(); - - //Attempt to write the data to the socket - if (bRet) - { - bRet = msg.WriteData((HANDLE)m_hSocket, &m_Overlapped, NULL, ATLSMTP_FORMAT_SMTP); - } - - if (bRet) - { - //End the message with a . - nBufLen = sprintf_s(szBuf, _countof(szBuf), "\r\n.\r\n"); - if (!AtlSmtpSendAndCheck((HANDLE)m_hSocket, szBuf, nBufLen, - szBuf, &nBufLen, ATLSMTP_MAX_LINE_LENGTH, ATLSMTP_DATA_SUCC, &m_Overlapped)) - { - return FALSE; - } - } - - return bRet; - } - - // Send a chunk of raw data - inline BOOL SendRaw(LPCTSTR lpszRawData, DWORD dwLen, LPCTSTR lpszRecipients, LPCTSTR lpszSender) throw() - { - ATLASSERT(lpszRawData != NULL); - ATLASSERT(lpszRecipients != NULL); - ATLASSERT(lpszSender != NULL); - - if (!Connected()) - return FALSE; - - char szBuf[ATLSMTP_MAX_LINE_LENGTH+1]; - - //Send MAIL FROM command and get reply - int nBufLen = sprintf_s(szBuf, ATLSMTP_MAX_LINE_LENGTH+1, - "MAIL FROM:<%s>\r\n", (LPCSTR) CT2CA(lpszSender)); - if ((nBufLen < 0) || - (!AtlSmtpSendAndCheck((HANDLE)m_hSocket, szBuf, nBufLen, - szBuf, &nBufLen, ATLSMTP_MAX_LINE_LENGTH, ATLSMTP_MAIL_SUCC, &m_Overlapped))) - { - return FALSE; - } - - BOOL bRet = DumpRecipients((HANDLE)m_hSocket, CT2CA(lpszRecipients), - &m_Overlapped, ATLSMTP_FOR_SEND); - - // Begin the data output - if (bRet) - { - nBufLen = sprintf_s(szBuf, _countof(szBuf), "DATA\r\n"); - bRet = AtlSmtpSendAndCheck((HANDLE)m_hSocket, szBuf, nBufLen, - szBuf, &nBufLen, ATLSMTP_MAX_LINE_LENGTH, ATLSMTP_DATA_INTM, &m_Overlapped); - } - - if (!bRet) - CancelMessage(); - - if (bRet) - { - bRet = AtlSmtpSendAndWait((HANDLE)m_hSocket, (LPSTR)(lpszRawData), dwLen, &m_Overlapped); - } - - if (bRet) - { - //End the message with a . - nBufLen = sprintf_s(szBuf, _countof(szBuf), "\r\n.\r\n"); - if (!AtlSmtpSendAndCheck((HANDLE)m_hSocket, szBuf, nBufLen, - szBuf, &nBufLen, ATLSMTP_MAX_LINE_LENGTH, ATLSMTP_DATA_SUCC, &m_Overlapped)) - { - return FALSE; - } - } - - return bRet; - } - - inline BOOL SendSimple(LPCTSTR lpszRecipients, LPCTSTR lpszSender, LPCTSTR lpszSubject, LPCTSTR lpszBody, int nTextLen = -1) throw() - { - CMimeMessage msg; - BOOL bRet = msg.SetSubject(lpszSubject); - if (bRet) - bRet = msg.AddText(lpszBody, nTextLen); - - CFixedStringT strRecip; - LPCTSTR szTmp = lpszRecipients; - LPCTSTR szTmp2 = lpszRecipients; - while (*szTmp && bRet) - { - if (AtlSmtpIsRecipientDelimiter((char) *szTmp2)) - { - _ATLTRY - { - strRecip.SetString(szTmp, (int)(szTmp2-szTmp)); - bRet = msg.AddRecipient((LPCTSTR) strRecip); - - if (*szTmp2) - { - while (*szTmp2 && AtlSmtpIsRecipientDelimiter((char) *szTmp2)) - { - szTmp2++; - } - } - szTmp = szTmp2; - } - _ATLCATCHALL() - { - bRet = FALSE; - } - } - else - { - szTmp2++; - } - } - - if (bRet) - bRet = SendMessage(msg, lpszRecipients, lpszSender); - - return bRet; - } - - // Save a MIME message to a file - // lpszFileName - the file name - // lpszRecipients - the recipients string (optional) - // lpszSender - the sender (optional) - // dwFlags - the flags (optional) - inline BOOL WriteToFile(LPCTSTR lpszFileName, CMimeMessage& msg, LPCTSTR lpszRecipients = NULL, - LPCTSTR lpszSender = NULL, DWORD dwFlags = 0) throw() - { - //Try to create/open the file - HANDLE hFile = CreateFile(lpszFileName, GENERIC_WRITE, 0, NULL, - CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, NULL); - - if (hFile == INVALID_HANDLE_VALUE) - { - return FALSE; - } - - // Use CHandle to close the file handle - // (CAtlFile does not allow for overlapped I/O) - CHandle hdlFile(hFile); - - //Create and initialize the OVERLAPPED struct - OVERLAPPED writeOverlapped; - memset((void*)&writeOverlapped, 0, sizeof(OVERLAPPED)); - writeOverlapped.hEvent = CreateEvent(NULL, TRUE, TRUE, NULL); - if (writeOverlapped.hEvent == NULL) - { - return FALSE; - } - - // Use CHandle to close the event handle - CHandle hdlEvent(writeOverlapped.hEvent); - - char szBuf[ATLSMTP_MAX_LINE_LENGTH+1]; - BOOL bRet = TRUE; - - int nBufLen = 0; - - //if writing to file for purposes of sending, write out the - //commands as well - if (lpszSender || (dwFlags & ATLSMTP_DUMP_SENDER)) - { - nBufLen = sprintf_s(szBuf, ATLSMTP_MAX_LINE_LENGTH+1, "MAIL FROM:<%s>\r\n", - (lpszSender ? (LPCSTR) CT2CA(lpszSender) : msg.GetSender())); - if (nBufLen > 0) - { - bRet = AtlSmtpSendAndWait(hFile, szBuf, nBufLen, &writeOverlapped); - } - else - { - bRet = FALSE; - } - } - - if (bRet && (lpszRecipients || (dwFlags & ATLSMTP_DUMP_RECIPS))) - { - if (!lpszRecipients) - { - LPSTR lpszRecipientsA = NULL; - DWORD dwLen = msg.GetRequiredRecipientsStringLength(); - lpszRecipientsA = static_cast(calloc(sizeof(char),dwLen)); - if (!lpszRecipientsA || msg.GetRecipientsString(lpszRecipientsA, &dwLen) == FALSE) - { - bRet = FALSE; - } - if (bRet) - bRet = DumpRecipients(hFile, lpszRecipientsA, &writeOverlapped); - free(lpszRecipientsA); - } - else - { - bRet = DumpRecipients(hFile, CT2CA(lpszRecipients), &writeOverlapped); - } - } - - if (bRet) - { - nBufLen = sprintf_s(szBuf, _countof(szBuf), "DATA\r\n"); - bRet = AtlSmtpSendAndWait(hFile, szBuf, nBufLen, &writeOverlapped); - } - - if (bRet) - { - bRet = msg.WriteData(hFile, &writeOverlapped, NULL, ATLSMTP_FORMAT_SMTP); - } - - return bRet; - } - -protected: - - // disallow copy construction - CSMTPConnection(const CSMTPConnection&) throw() - { - ATLASSERT(FALSE); - } - - // disallow assignment - const CSMTPConnection& operator=(const CSMTPConnection&) throw() - { - ATLASSERT(FALSE); - return *this; - } - - // Tell the server we are aborting the message - inline BOOL CancelMessage() throw() - { - char szBuf[ATLSMTP_MAX_LINE_LENGTH+1]; - int nBufLen = 0; - nBufLen = sprintf_s(szBuf, _countof(szBuf), "RSET\r\n"); - if (!AtlSmtpSendAndCheck((HANDLE)m_hSocket, szBuf, nBufLen, szBuf, &nBufLen, ATLSMTP_MAX_LINE_LENGTH, - ATLSMTP_RSET_SUCC, &m_Overlapped)) - { - Disconnect(); - return FALSE; - } - return TRUE; - } - - // Dump the recipients to hFile - // lpszRecipients - the recipients string - // pOverlapped - the OVERALAPPED struct - // dwFlags - the flags - inline BOOL DumpRecipients(HANDLE hFile, LPCSTR lpszRecipients, LPOVERLAPPED pOverlapped, DWORD dwFlags = 0) - { - ATLENSURE(lpszRecipients != NULL); - ATLASSERT(pOverlapped != NULL); - - char rcptBuf[ATLSMTP_MAX_LINE_LENGTH-12+1]; - char szBuf[ATLSMTP_MAX_LINE_LENGTH+1]; - LPSTR tmpBuf = rcptBuf; - char ch; - BOOL bRet = TRUE; - int nMaxLength = ATLSMTP_MAX_LINE_LENGTH; - int nRetCode = 0; - size_t nCnt = 0; - do - { - ch = *lpszRecipients; - if (ch) - lpszRecipients++; - if (AtlSmtpIsRecipientDelimiter(ch)) - { - *tmpBuf = 0; - int nBufLen = sprintf_s(szBuf, ATLSMTP_MAX_LINE_LENGTH, - "RCPT TO:<%s>\r\n", rcptBuf); - if (nBufLen > 0) - { - bRet = AtlSmtpSendAndWait(hFile, szBuf, nBufLen, pOverlapped); - } - else - { - bRet = FALSE; - } - - if (bRet && (dwFlags & ATLSMTP_FOR_SEND)) - { - bRet = AtlSmtpReadData(hFile, szBuf, &nMaxLength, pOverlapped); - nRetCode = atoi(szBuf); - if (!bRet || (nRetCode != ATLSMTP_RCPT_SUCCESS && nRetCode != ATLSMTP_RCPT_NOT_LOCAL)) - { - bRet = FALSE; - break; - } - } - tmpBuf = rcptBuf; - nCnt = 0; - nMaxLength = ATLSMTP_MAX_LINE_LENGTH; - while (isspace(static_cast(*lpszRecipients))) - lpszRecipients++; - continue; - } - - if (nCnt >= sizeof(rcptBuf)-1) - { - // recipient string too long - bRet = FALSE; - break; - } - - *tmpBuf++ = ch; - nCnt++; - } while (ch != '\0'); - - return bRet; - } - - // Implementation - used from ReadLine - // fills pBuf with up to dwMaxLen bytes - BOOL FillBuffer(__in HANDLE hFile, __out_ecount_part(dwMaxLen, *pdwLen) LPSTR pBuf, __in DWORD dwMaxLen, __out LPDWORD pdwLen) throw() - { - ATLASSERT(hFile != INVALID_HANDLE_VALUE); - ATLASSERT(pdwLen != NULL); - - DWORD dwRead = 0; - DWORD dwTotalRead = 0; - int nRet = 0; - - do - { - nRet = ReadFile(hFile, pBuf, dwMaxLen-dwTotalRead, &dwRead, NULL); - if (!nRet && GetLastError() != ERROR_HANDLE_EOF) - { - return FALSE; - } - - if (dwRead == 0) - break; - - dwTotalRead+= dwRead; - } while (dwTotalRead < dwMaxLen); - - *pdwLen = dwTotalRead; - - return TRUE; - } - - // Implementation - // Read a line (terminated by LF) from hFile - BOOL ReadLine(__in HANDLE hFile, __out_ecount_part_z(dwMaxSrcLen, *pdwSrcLen) LPSTR pSrc, __out_ecount_part_z(dwMaxDestLen, *pdwRead) LPSTR pDest, __inout LPDWORD pdwSrcLen, __inout LPDWORD pdwBufPos, __in DWORD dwMaxSrcLen, - __in DWORD dwMaxDestLen, __out_opt LPDWORD pdwRead=NULL, __out_opt LPBOOL pbFullLine=NULL) - { - ATLENSURE(hFile != INVALID_HANDLE_VALUE); - ATLENSURE(pSrc != NULL); - ATLENSURE(pDest != NULL); - ATLENSURE(pdwSrcLen != NULL); - ATLENSURE(pdwBufPos != NULL); - - BOOL bRet = TRUE; - DWORD dwLen = 0; - DWORD dwBufPos = 0; - DWORD dwSrcLen = *pdwSrcLen; - LPSTR pSrcCurrent = pSrc + *pdwBufPos; - - while (bRet && dwLen < dwMaxDestLen) - { - if (dwSrcLen == 0) - { - if (!FillBuffer(hFile, pSrc, dwMaxSrcLen, pdwSrcLen) || *pdwSrcLen == 0) - break; - - dwBufPos = 0; - *pdwBufPos = 0; - dwSrcLen = *pdwSrcLen; - pSrcCurrent = pSrc; - } - - --dwSrcLen; - *pDest = *pSrcCurrent++; - dwLen++; - dwBufPos++; - if (*pDest == '\n') - { - break; - } - pDest++; - } - - *pdwSrcLen = dwSrcLen; - - if (pbFullLine) - { - if (*pDest != '\n') - *pbFullLine = FALSE; - else - *pbFullLine = TRUE; - } - - if (pdwRead) - *pdwRead = dwLen; - - *pdwBufPos += dwBufPos; - - return bRet; - } - -}; // class CSMTPConnection - -} // namespace ATL -#pragma pack(pop) - -#endif // __ATLSMTPCONNECTION_H__ diff --git a/include/atl/atlsmtputil.h b/include/atl/atlsmtputil.h deleted file mode 100644 index 6ce443861..000000000 --- a/include/atl/atlsmtputil.h +++ /dev/null @@ -1,220 +0,0 @@ -// This is a part of the Active Template Library. -// Copyright (C) Microsoft Corporation -// All rights reserved. -// -// This source code is only intended as a supplement to the -// Active Template Library Reference and related -// electronic documentation provided with the library. -// See these sources for detailed information regarding the -// Active Template Library product. - -#ifndef __ATLSMTPUTIL_H__ -#define __ATLSMTPUTIL_H__ - -#pragma once - -#if (defined(_WINSOCKAPI_) && !defined(_WINSOCK2API_)) -#error requires -- include before you include or -#endif -#include -#include -#include -#include -#include -#include -#include -#include - -//======================================================================= -//defines for SMTPMail module -//======================================================================= - -//If overlapped I/O is desired, need 2.0 or greater -#define ATLSMTP_WSA_VERSION ATL_WINSOCK_VER - -//The maximum number of characters on a SMTP line -#define ATLSMTP_MAX_LINE_LENGTH 1000 - -#define ATLSMTP_MAX_SERVER_NAME_LENGTH 256 - -//Encoding schemes -#define ATLSMTP_BASE64_ENCODE 0 -#define ATLSMTP_UUENCODE 1 -#define ATLSMTP_QP_ENCODE 2 - -//I/O Defines -#define ATLSMTP_READBUFFER_SIZE 4096 -#define ATLSMTP_GET_LINES 100 - - -//Miscellaneous defines -#define ATLSMTP_SEND_FILE 1 -#define ATLSMTP_FORMAT_SMTP 8 - -#define ATLSMTP_RETCODE_LEN 3 - - -#pragma pack(push,_ATL_PACKING) -namespace ATL -{ - -//======================================================================= -// Miscellaneous Utility Functions -//======================================================================= -//A list of recipients in a string must by separated by one -//of the following characters -inline BOOL AtlSmtpIsRecipientDelimiter(char ch) throw() -{ - return (ch == ',' || ch == ';' || ch == ' ' || ch == '\0'); -} - -//Send data to hFile and wait for it to finish sending -inline BOOL AtlSmtpSendAndWait(HANDLE hFile, LPCSTR lpData, int nDataLength, LPOVERLAPPED pOverlapped) throw() -{ - ATLASSERT(lpData != NULL); - ATLENSURE_RETURN_VAL(pOverlapped != NULL, FALSE); - - DWORD dwWritten = 0, dwErr = 0; - int nRet = 0, nBufPos = 0; - - //write all the data - do - { - //Write a chunk of data, offsetting the buffer and amount to write by what's already - //been written - nRet = WriteFile(hFile, (void*)(lpData+nBufPos), nDataLength-nBufPos, &dwWritten, pOverlapped); - if (!nRet && (dwErr = GetLastError()) != ERROR_IO_INCOMPLETE && dwErr != ERROR_IO_PENDING) - return FALSE; - - //Get the result of the write operation (wait for it) - nRet = GetOverlappedResult(hFile, pOverlapped, &dwWritten, TRUE); - if (!nRet) - return FALSE; - - //Need to update offsets when writing to a file - pOverlapped->Offset += dwWritten; - nBufPos += dwWritten; - - } while (nBufPos < nDataLength); - return TRUE; -} - - -//Read up to nDestLen bytes from hFile, keep reading while there's more data and there's -//room in the buffer -inline BOOL AtlSmtpReadData(__in HANDLE hFile, __out_ecount_part_z(*pnDestLen, *pnDestLen) LPSTR lpData, __inout int* pnDestLen, __in LPOVERLAPPED pOverlapped) -{ - ATLASSERT(lpData != NULL); - ATLASSERT(pnDestLen != NULL); - ATLENSURE(pOverlapped != NULL); - - DWORD dwRead = 0, dwErr = 0; - int nBufPos = 0; - do - { - //REad a chunk of data, offsetting the buffer and amount to read by what's already been read - int nRet = ReadFile(hFile, (void*)(lpData+nBufPos), (*pnDestLen)-nBufPos, &dwRead, pOverlapped); - if (!nRet && (dwErr = GetLastError()) != ERROR_MORE_DATA && dwErr != ERROR_IO_PENDING && dwErr != ERROR_IO_INCOMPLETE) - return FALSE; - - //Get the result of the read operation (wait for it) - nRet = GetOverlappedResult(hFile, pOverlapped, &dwRead, TRUE); - if (!nRet) - return FALSE; - - //Handle offsets when reading from a file - pOverlapped->Offset += dwRead; - nBufPos += dwRead; - } while (nBufPos < *pnDestLen && dwErr == ERROR_MORE_DATA); - *pnDestLen = nBufPos; - return TRUE; -} - - -//Used in sending encoded data -//lpData is the data to be sent now -//lpPrev is a pointer to the buffer that the previous call was made on -//This allows the new buffer (lpData) to be filled while lpPrev is being sent -//If all the data in lpPrev had not finished sending, we complete the send and wait -inline BOOL AtlSmtpSendOverlapped(HANDLE hFile, LPCSTR lpData, int nDataLength, LPCSTR lpPrev, DWORD dwPrevLength, LPOVERLAPPED pOverlapped) -{ - ATLASSERT(lpData != NULL); - ATLENSURE(pOverlapped != NULL); - - DWORD dwWritten = 0, dwErr = 0, dwBufPos = 0; - int nRet = 0; - - //Get the results of the previous call (if any) - if (lpPrev && (!GetOverlappedResult(hFile, pOverlapped, &dwWritten, FALSE) || dwWritten < dwPrevLength)) - { - //If any error but IO_INCOMPLETE, return failure - if ((dwErr = GetLastError()) != ERROR_SUCCESS && dwErr != ERROR_IO_INCOMPLETE && dwErr != ERROR_IO_PENDING) - { - return FALSE; - } - //Finish writing lpPrev if we need to - while (dwBufPos < dwPrevLength) - { - //Get the result of the previous write (wait for it) - nRet = GetOverlappedResult(hFile, pOverlapped, &dwWritten, TRUE); - if (!nRet || (dwBufPos += dwWritten) == dwPrevLength) - { - if ((dwErr = GetLastError()) != ERROR_IO_INCOMPLETE && dwErr != ERROR_IO_PENDING) - break; - } - - //If we are writing to a file, we need to update the offsets - pOverlapped->Offset += dwWritten; - if(dwBufPos>dwPrevLength) - { - /* shouldn't happen */ - ATLASSERT(false); - break; - } - nRet = WriteFile(hFile, (void*)(lpPrev+dwBufPos), dwPrevLength-dwBufPos, &dwWritten, pOverlapped); - - //If any error but IO_PENDING and IO_INCOMPLETE, break - if (!nRet && (dwErr = GetLastError()) != ERROR_IO_PENDING && dwErr != ERROR_IO_INCOMPLETE) - break; - } - if (dwBufPos < dwPrevLength) - return FALSE; - } - - //Now that all the previous data has been sent, start sending the current data - nRet = WriteFile(hFile, (void*)lpData, nDataLength, &dwWritten, pOverlapped); - GetOverlappedResult(hFile, pOverlapped, &dwWritten, FALSE); - - pOverlapped->Offset += dwWritten; - - //If any error but IO_PENDING - if (!nRet && (dwErr = GetLastError()) != ERROR_IO_PENDING && dwErr != ERROR_IO_INCOMPLETE) - return FALSE; - return TRUE; -} - - -//Send a SMTP command and read the response -//return TRUE if it matches szResponse, FALSE otherwise -inline BOOL AtlSmtpSendAndCheck(__in HANDLE hFile, __in LPCSTR lpData, __in int nDataLength, __out_ecount_part(nMaxResponseLength, *pnResponseLength) LPSTR lpResponse, __out int* pnResponseLength, __in int nMaxResponseLength, - __in_z LPCSTR szResponse, __in LPOVERLAPPED pOverlapped) throw() -{ - ATLASSERT(lpData != NULL); - ATLASSERT(lpResponse != NULL); - ATLASSERT(pnResponseLength != NULL); - - BOOL bRet = AtlSmtpSendAndWait(hFile, lpData, nDataLength, pOverlapped); - if (bRet) - { - *pnResponseLength = nMaxResponseLength; - bRet = AtlSmtpReadData(hFile, lpResponse, pnResponseLength, pOverlapped); - } - if (!bRet || strncmp((char*)lpResponse, szResponse, ATLSMTP_RETCODE_LEN)) - return FALSE; - return TRUE; -} - -} // namespace ATL -#pragma pack(pop) - -#endif // __ATLSMTPUTIL_H__ diff --git a/include/atl/atlsoap.h b/include/atl/atlsoap.h deleted file mode 100644 index b286e7c61..000000000 --- a/include/atl/atlsoap.h +++ /dev/null @@ -1,8174 +0,0 @@ -// This is a part of the Active Template Library. -// Copyright (C) Microsoft Corporation -// All rights reserved. -// -// This source code is only intended as a supplement to the -// Active Template Library Reference and related -// electronic documentation provided with the library. -// See these sources for detailed information regarding the -// Active Template Library product. - -#ifndef __ATLSOAP_H__ -#define __ATLSOAP_H__ - -#pragma once - -#if (defined(_WINSOCKAPI_) && !defined(_WINSOCK2API_)) - #error require winsock2.h -- include before you include -#endif - -#if ((_WIN32_WINNT < 0x0400) && (_WIN32_WINDOWS <= 0x0400)) - #error require _WIN32_WINNT >= 0x0400 or _WIN32_WINDOWS > 0x0400 -#endif - -#ifndef ATLSOAP_TRACE - #ifdef _ATLSOAP_TRACE_XML - #define ATLSOAP_TRACE(__data, __len) AtlSoapTraceXML(__data, __len) - #else - #define ATLSOAP_TRACE(__data, __len) __noop - #endif -#endif // ATLSOAP_TRACE - -// override this macro to ATL_BASE64_FLAG_NOCRLF if you do -// not want Base64-encoded binary data to contain CRLFs -#ifndef ATLSOAP_BASE64_FLAGS - #define ATLSOAP_BASE64_FLAGS ATL_BASE64_FLAG_NONE -#endif // ATLSOAP_BASE64_FLAGS - -[ emitidl(restricted) ]; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#pragma warning(push) -#pragma warning(disable: 4625) // copy constructor could not be generated because a base class copy constructor is inaccessible -#pragma warning(disable: 4626) // assignment operator could not be generated because a base class assignment operator is inaccessible -#pragma warning(disable: 4061) // enumerate 'enum value' in switch of enum 'enum type' is not explicitly handled by a case label - -#ifndef _CPPUNWIND -#pragma warning(disable: 4702) // unreachable code -#endif // _CPPUNWIND - -#ifndef ATLSOAP_NOWININET - #include - #ifndef ATLSOAPINET_CLIENT - #define ATLSOAPINET_CLIENT _T("VCSoapClient") - #endif -#endif - -#ifndef _ATL_NO_DEFAULT_LIBS -#pragma comment(lib, "msxml2.lib") - #ifndef ATLSOAP_NOWININET - #pragma comment(lib, "wininet.lib") - #endif -#endif - -#define _ATLSOAP_MAKEWIDESTR( str ) L ## str -#define ATLSOAP_MAKEWIDESTR( str ) _ATLSOAP_MAKEWIDESTR( str ) - - -#pragma pack(push,_ATL_PACKING) -namespace ATL -{ - -ATL_NOINLINE inline void AtlSoapTraceXML(LPBYTE pdwData, DWORD dwLen) -{ - HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE); - if (hStdOut != INVALID_HANDLE_VALUE) - { - DWORD dwWritten; - WriteFile(hStdOut, - "\n-----------------------------------------------------------------\n", - sizeof("\n-----------------------------------------------------------------\n")-1, - &dwWritten, NULL); - - WriteFile(hStdOut, pdwData, dwLen, &dwWritten, NULL); - - WriteFile(hStdOut, - "\n-----------------------------------------------------------------\n", - sizeof("\n-----------------------------------------------------------------\n")-1, - &dwWritten, NULL); - } -} - -//////////////////////////////////////////////////////////////////////////////// -// -// IStreamImpl - stub IStream implementation class -// -//////////////////////////////////////////////////////////////////////////////// - -class IStreamImpl : public IStream -{ -public: - - HRESULT __stdcall Read(void * /*pDest*/, ULONG /*nMaxLen*/, ULONG * /*pnRead*/) - { - return E_NOTIMPL; - } - - HRESULT __stdcall Write(const void * /*pv*/, ULONG /*cb*/, ULONG * /*pcbWritten*/) - { - return E_NOTIMPL; - } - - HRESULT __stdcall Seek(LARGE_INTEGER /*dlibMove*/, DWORD /*dwOrigin*/, - ULARGE_INTEGER * /*pLibNewPosition*/) - { - return E_NOTIMPL; - } - - HRESULT __stdcall SetSize(ULARGE_INTEGER /*libNewSize*/) - { - return E_NOTIMPL; - } - - HRESULT __stdcall CopyTo(IStream * /*pStream*/, ULARGE_INTEGER /*cb*/, - ULARGE_INTEGER * /*pcbRead*/, ULARGE_INTEGER * /*pcbWritten*/) - { - return E_NOTIMPL; - } - - HRESULT __stdcall Commit(DWORD /*grfCommitFlags*/) - { - return E_NOTIMPL; - } - - HRESULT __stdcall Revert() - { - return E_NOTIMPL; - } - - HRESULT __stdcall LockRegion(ULARGE_INTEGER /*libOffset*/, ULARGE_INTEGER /*cb*/, DWORD /*dwLockType*/) - { - return E_NOTIMPL; - } - - HRESULT __stdcall UnlockRegion(ULARGE_INTEGER /*libOffset*/, ULARGE_INTEGER /*cb*/, DWORD /*dwLockType*/) - { - return E_NOTIMPL; - } - - HRESULT __stdcall Stat(STATSTG * /*pstatstg*/, DWORD /*grfStatFlag*/) - { - return E_NOTIMPL; - } - - HRESULT __stdcall Clone(IStream ** /*ppstm*/) - { - return E_NOTIMPL; - } -}; // class IStreamImpl - -//////////////////////////////////////////////////////////////////////////////// -// -// CStreamOnServerContext -// -//////////////////////////////////////////////////////////////////////////////// - -class CStreamOnServerContext : public IStreamImpl -{ -public: - - HRESULT __stdcall QueryInterface(REFIID riid, void **ppv) - { - if (ppv == NULL) - { - return E_POINTER; - } - - *ppv = NULL; - - if (InlineIsEqualGUID(riid, IID_IUnknown) || - InlineIsEqualGUID(riid, IID_IStream) || - InlineIsEqualGUID(riid, IID_ISequentialStream)) - { - *ppv = static_cast(this); - return S_OK; - } - - return E_NOINTERFACE; - } - - ULONG __stdcall AddRef() - { - return 1; - } - - ULONG __stdcall Release() - { - return 1; - } - -private: - - IHttpServerContext * m_pServerContext; - DWORD m_dwBytesRead; - -public: - - CStreamOnServerContext(IHttpServerContext *pServerContext = NULL) - : m_pServerContext(pServerContext), m_dwBytesRead(0) - { - } - - void SetServerContext(IHttpServerContext *pServerContext) - { - ATLASSUME( m_pServerContext == NULL ); - - m_pServerContext = pServerContext; - } - - HRESULT __stdcall Read(void *pDest, ULONG nMaxLen, ULONG *pnRead) - { - ATLENSURE( pDest != NULL ); - ATLASSUME( m_pServerContext != NULL ); - - DWORD dwToRead = __min(m_pServerContext->GetTotalBytes()-m_dwBytesRead, nMaxLen); - if (ReadClientData(m_pServerContext, (LPSTR) pDest, &dwToRead, m_dwBytesRead) != FALSE) - { - m_dwBytesRead+= dwToRead; - - if (pnRead != NULL) - { - *pnRead = dwToRead; - } - - return S_OK; - } - - ATLTRACE( _T("ATLSOAP: CStreamOnServerContext::Read -- ReadClientData failed.\r\n") ); - - return E_FAIL; - } -}; // class CStreamOnServerContext - -//////////////////////////////////////////////////////////////////////////////// -// -// CReadStreamOnSocket -// -//////////////////////////////////////////////////////////////////////////////// - -template -class CReadStreamOnSocket : public IStreamImpl -{ -public: - - HRESULT __stdcall QueryInterface(REFIID riid, void **ppv) - { - if (ppv == NULL) - { - return E_POINTER; - } - - *ppv = NULL; - - if (InlineIsEqualGUID(riid, IID_IUnknown) || - InlineIsEqualGUID(riid, IID_IStream) || - InlineIsEqualGUID(riid, IID_ISequentialStream)) - { - *ppv = static_cast(this); - return S_OK; - } - - return E_NOINTERFACE; - } - - ULONG __stdcall AddRef() - { - return 1; - } - - ULONG __stdcall Release() - { - return 1; - } - -private: - - CAtlHttpClientT * m_pSocket; - LPCSTR m_szBuffer; - LPCSTR m_szCurr; - long m_nBodyLen; - -public: - - CReadStreamOnSocket() - : m_pSocket(NULL), m_szBuffer(NULL), m_szCurr(NULL), m_nBodyLen(0) - { - } - - BOOL Init(CAtlHttpClientT *pSocket) - { - ATLENSURE( pSocket != NULL ); - - m_pSocket = pSocket; - m_szBuffer = (LPCSTR) pSocket->GetBody(); - - ATLSOAP_TRACE( (LPBYTE) pSocket->GetBody(), pSocket->GetBodyLength() ); - - if (m_szBuffer != NULL) - { - m_szCurr = m_szBuffer; - m_nBodyLen = pSocket->GetBodyLength(); - if (m_nBodyLen != 0) - { - return TRUE; - } - } - - ATLTRACE( _T("ATLSOAP: CReadStreamOnSocket::Init failed.\r\n") ); - - return FALSE; - } - - HRESULT __stdcall Read(void *pDest, ULONG nMaxLen, ULONG *pnRead) - { - ATLASSERT( pDest != NULL ); - ATLASSUME( m_pSocket != NULL ); - ATLASSUME( m_szBuffer != NULL ); - - if (pnRead != NULL) - { - *pnRead = 0; - } - - long nRead = (int) (m_szCurr-m_szBuffer); - if (nRead < m_nBodyLen) - { - long nLength = __min((int)(m_nBodyLen-nRead), (LONG) nMaxLen); - Checked::memcpy_s(pDest, nMaxLen, m_szCurr, nLength); - m_szCurr+= nLength; - - if (pnRead != NULL) - { - *pnRead = (ULONG) nLength; - } - } - - return S_OK; - } -}; // class CReadStreamOnSocket - -//////////////////////////////////////////////////////////////////////////////// -// -// CWriteStreamOnCString -// -//////////////////////////////////////////////////////////////////////////////// - -class CWriteStreamOnCString : public IWriteStream -{ - -public: - CStringA m_str; - - virtual ~CWriteStreamOnCString() - { - } - - HRESULT WriteStream(LPCSTR szOut, int nLen, LPDWORD pdwWritten) - { - ATLENSURE_RETURN( szOut != NULL ); - - if (nLen < 0) - { - nLen = (int) strlen(szOut); - } - - _ATLTRY - { - m_str.Append(szOut, nLen); - } - _ATLCATCHALL() - { - return E_OUTOFMEMORY; - } - - if (pdwWritten != NULL) - { - *pdwWritten = (DWORD) nLen; - } - - return S_OK; - } - - HRESULT FlushStream() - { - return S_OK; - } - - void Cleanup() - { - m_str.Empty(); - } -}; // class CWriteStreamOnCString - -//////////////////////////////////////////////////////////////////////////////// -// -// Namespaces -// -//////////////////////////////////////////////////////////////////////////////// - -#define SOAPENV_NAMESPACEA "http://schemas.xmlsoap.org/soap/envelope/" -#define SOAPENV_NAMESPACEW ATLSOAP_MAKEWIDESTR( SOAPENV_NAMESPACEA ) - -#define SOAPENC_NAMESPACEA "http://schemas.xmlsoap.org/soap/encoding/" -#define SOAPENC_NAMESPACEW ATLSOAP_MAKEWIDESTR( SOAPENC_NAMESPACEA ) - -#define XSI_NAMESPACEA "http://www.w3.org/2001/XMLSchema-instance" -#define XSI_NAMESPACEW ATLSOAP_MAKEWIDESTR( XSI_NAMESPACEA ) - -#define XSD_NAMESPACEA "http://www.w3.org/2001/XMLSchema" -#define XSD_NAMESPACEW ATLSOAP_MAKEWIDESTR( XSD_NAMESPACEA ) - -#ifndef ATLSOAP_GENERIC_NAMESPACE -#define ATLSOAP_GENERIC_NAMESPACE L"http://www.tempuri.org" -#endif - -//////////////////////////////////////////////////////////////////////////////// -// -// Helpers -// -//////////////////////////////////////////////////////////////////////////////// - -inline HRESULT GetAttribute( - __in ISAXAttributes *pAttributes, - __in_ecount(cchName) const wchar_t *wszAttrName, __in int cchName, - __out_ecount_part(*pcchValue, *pcchValue) const wchar_t **pwszValue, __inout int *pcchValue, - __in_ecount_opt(cchNamespace) wchar_t *wszNamespace = NULL, __in int cchNamespace = 0) -{ - if (!pAttributes || !wszAttrName || !pwszValue || !pcchValue) - { - return E_INVALIDARG; - } - - *pwszValue = NULL; - *pcchValue = 0; - if (!wszNamespace) - { - return (pAttributes->getValueFromQName(wszAttrName, cchName, pwszValue, pcchValue) == S_OK ? S_OK : E_FAIL); - } - return (pAttributes->getValueFromName(wszNamespace, cchNamespace, - wszAttrName, cchName, pwszValue, pcchValue) == S_OK ? S_OK : E_FAIL); -} - -inline HRESULT GetAttribute( - __in ISAXAttributes *pAttributes, - __in_ecount(cchName) const wchar_t *wszAttrName, __in int cchName, - __inout CStringW &strValue, - __in_ecount_opt(cchNamespace) wchar_t *wszNamespace = NULL, __in int cchNamespace = 0) -{ - const wchar_t *wszValue = NULL; - int cchValue = 0; - - if (!pAttributes || !wszAttrName) - { - return E_INVALIDARG; - } - - HRESULT hr; - if (!wszNamespace) - { - hr = (pAttributes->getValueFromQName(wszAttrName, cchName, &wszValue, &cchValue) == S_OK ? S_OK : E_FAIL); - } - else - { - hr = (pAttributes->getValueFromName(wszNamespace, cchNamespace, - wszAttrName, cchName, &wszValue, &cchValue) == S_OK ? S_OK : E_FAIL); - } - - if (hr == S_OK) - { - _ATLTRY - { - strValue.SetString(wszValue, cchValue); - } - _ATLCATCHALL() - { - ATLTRACE( _T("ATLSOAP: GetAttribute -- out of memory.\r\n") ); - - hr = E_OUTOFMEMORY; - } - } - - return hr; -} - -inline const wchar_t *SkipWhitespace(const wchar_t *wsz) -{ - while (*wsz && iswspace(*wsz)) - ++wsz; - return wsz; -} - -} // namespace ATL -#pragma pack(pop) - -//////////////////////////////////////////////////////////////////////////////// -// -// BLOB data type - use this struct when you want to send BLOB data -// the attribute provider and proxy generator will only properly special -// case blob data when using this struct. -// -//////////////////////////////////////////////////////////////////////////////// - -[ export ] -typedef struct _tagATLSOAP_BLOB -{ - unsigned long size; - unsigned char *data; -} ATLSOAP_BLOB; - -#ifndef _ATL_SOAP_NO_PARAMETER_VALIDATIONS -#define _ATL_VALIDATE_PARAMETER_END(p)\ - do \ - { \ - if(*(p) !='\0') \ - return E_FAIL; \ - } while(0) -#else -#define _ATL_VALIDATE_PARAMETER_END(p) -#endif - -// All non-integral types have specializations which -// will be called. The following function will be called -// only for integral types - -#pragma push_macro("max") -#pragma push_macro("min") -#undef max -#undef min -template -inline HRESULT AtlGetSAXValue(T * pVal , const wchar_t * wsz , int cch ) -{ - __int64 nVal = *pVal; - if (FAILED(AtlGetSAXValue(&nVal, wsz, cch))) - return E_FAIL; - -#ifndef _ATL_SOAP_NO_PARAMETER_VALIDATIONS - if(nVal < std::numeric_limits::min() || nVal > std::numeric_limits::max()) - return E_FAIL; -#endif - - *pVal = T(nVal); - return S_OK; - - -} -#pragma pop_macro("max") -#pragma pop_macro("min") - -//////////////////////////////////////////////////////////////////////////////// -// -// AtlGetXMLValue (for IXMLDOMDocument) - get the real type from the XML data -// -/////////////////////////////////////////////////////////////////////////////// - -// -// generic IXMLDOMNode template function -// delegates to AtlGetSAXValue -// -template -inline HRESULT AtlGetXMLValue(IXMLDOMNode *pParam, T *pVal) -{ - CComBSTR bstrVal; - HRESULT hr = AtlGetXMLValue(pParam, &bstrVal); - if (SUCCEEDED(hr)) - { - hr = AtlGetSAXValue(pVal, bstrVal, bstrVal.Length()); - } - - return hr; -} - -// specialization for BSTR -template <> -inline HRESULT AtlGetXMLValue(IXMLDOMNode *pParam, BSTR *pbstrVal) -{ - if (pParam == NULL) - { - return E_INVALIDARG; - } - if (pbstrVal == NULL) - { - return E_POINTER; - } - - CComPtr spChild; - if (pParam->get_firstChild(&spChild) == S_OK) - { - CComPtr spXmlChild; - if (spChild->get_firstChild(&spXmlChild) == S_OK) - { - return (pParam->get_xml(pbstrVal) == S_OK ? S_OK : E_FAIL); - } - } - - return (pParam->get_text(pbstrVal) == S_OK) ? S_OK : E_FAIL; -} - -//////////////////////////////////////////////////////////////////////////////// -// -// AtlGetSAXValue - (for SAX or generic) get the real type from the XML data -// -//////////////////////////////////////////////////////////////////////////////// - -template <> -inline HRESULT AtlGetSAXValue(bool *pVal, __in_z const wchar_t *wsz, int cch) -{ - ATLENSURE( wsz != NULL ); - - if (!pVal) - { - return E_POINTER; - } - - *pVal = false; - - HRESULT hr = E_FAIL; - switch (wsz[0]) - { - case L'1': - { - if (cch==1) - { - *pVal = true; - hr = S_OK; - } - break; - } - case L'0': - { - if (cch==1) - { - *pVal = false; - hr = S_OK; - } - break; - } - case L't': - { - if (cch==sizeof("true")-1 && !wcsncmp(wsz, L"true", cch)) - { - *pVal = true; - hr = S_OK; - } - break; - } - case L'f': - { - if (cch==sizeof("false")-1 && !wcsncmp(wsz, L"false", cch)) - { - *pVal = false; - hr = S_OK; - } - break; - } - } - - return hr; -} - -template <> -inline HRESULT AtlGetSAXValue<__int64>(__int64 *pVal, __in_z const wchar_t *wsz, int cch) -{ - ATLENSURE_RETURN( wsz != NULL ); - - if (!pVal) - { - return E_POINTER; - } - - _ATLTRY - { - CFixedStringT wstr(wsz, cch); - const wchar_t *pStart = ATL::SkipWhitespace(static_cast(wstr)); - const wchar_t *pEnd; - - __int64 i = 0; - errno_t errnoValue = AtlStrToNum(&i, pStart, const_cast(&pEnd), 10); - if (errnoValue == ERANGE) - { - return E_FAIL;//overflow or underflow case - } - pEnd = ATL::SkipWhitespace(pEnd); - _ATL_VALIDATE_PARAMETER_END(pEnd); - *pVal = i; - } - _ATLCATCHALL() - { - return E_OUTOFMEMORY; - } - - return S_OK; -} - -template <> -inline HRESULT AtlGetSAXValue(unsigned __int64 *pVal, __in_z const wchar_t *wsz, int cch) -{ - ATLENSURE_RETURN( wsz != NULL ); - - if (!pVal) - { - return E_POINTER; - } - - _ATLTRY - { - CFixedStringT wstr(wsz, cch); - const wchar_t *pStart = ATL::SkipWhitespace(static_cast(wstr)); - const wchar_t *pEnd; - - unsigned __int64 i = 0; - errno_t errnoValue = AtlStrToNum(&i, pStart, const_cast(&pEnd), 10); - if (errnoValue == ERANGE) - { - return E_FAIL;//overflow or underflow case - } - pEnd = ATL::SkipWhitespace(pEnd); - _ATL_VALIDATE_PARAMETER_END(pEnd); - *pVal = i; - } - _ATLCATCHALL() - { - return E_OUTOFMEMORY; - } - - return S_OK; -} -template <> -inline HRESULT AtlGetSAXValue(double *pVal, __in_z const wchar_t *wsz, int cch) -{ - ATLENSURE_RETURN( wsz != NULL ); - - if (!pVal) - { - return E_POINTER; - } - - if ((cch == 3) && (wsz[0]==L'I') && (!wcsncmp(wsz, L"INF", cch))) - { - *(((int *) pVal)+0) = 0x0000000; - *(((int *) pVal)+1) = 0x7FF00000; - } - else if ((cch == 3) && (wsz[0]==L'N') && (!wcsncmp(wsz, L"NaN", cch))) - { - *(((int *) pVal)+0) = 0x0000000; - *(((int *) pVal)+1) = 0xFFF80000; - } - else if ((cch == 4) && (wsz[1]==L'I') && (!wcsncmp(wsz, L"-INF", cch))) - { - *(((int *) pVal)+0) = 0x0000000; - *(((int *) pVal)+1) = 0xFFF00000; - } - else - { - errno_t errnoValue = 0; - - _ATLTRY - { - CFixedStringT wstr(wsz, cch); - const wchar_t *pStart = ATL::SkipWhitespace(static_cast(wstr)); - const wchar_t *pEnd; - double d = 0.0; - errnoValue = AtlStrToNum(&d, pStart, const_cast(&pEnd)); - pEnd = ATL::SkipWhitespace(pEnd); - _ATL_VALIDATE_PARAMETER_END(pEnd); - *pVal = d; - } - _ATLCATCHALL() - { - return E_OUTOFMEMORY; - } - - if ((*pVal == -HUGE_VAL) || (*pVal == HUGE_VAL) || (errnoValue == ERANGE)) - { - return E_FAIL; - } - } - - return S_OK; -} - -template <> -inline HRESULT AtlGetSAXValue(float *pVal, __in_z const wchar_t *wsz, int cch) -{ - ATLASSERT( wsz != NULL ); - - if (!pVal) - { - return E_POINTER; - } - - double d = *pVal; - if (SUCCEEDED(AtlGetSAXValue(&d, wsz, cch))) - { -#ifdef _ATL_SOAP_PARAMETER_VALIDATIONS - if(d > FLT_MAX || d < -FLT_MAX) - return E_FAIL; -#endif - *pVal = (float) d; - return S_OK; - } - - return E_FAIL; -} - -template <> -inline HRESULT AtlGetSAXValue(BSTR *pVal, __in_z const wchar_t *wsz, int cch) -{ - ATLASSERT( wsz != NULL ); - - if (pVal == NULL) - { - return E_POINTER; - } - - *pVal = SysAllocStringLen(wsz, cch); - - return ((*pVal != NULL) ? S_OK : E_OUTOFMEMORY); -} - -inline HRESULT AtlGetSAXBlobValue( - ATLSOAP_BLOB *pVal, - const wchar_t *wsz, - int cch, - IAtlMemMgr *pMemMgr, - bool bHex = false) -{ - ATLENSURE_RETURN( wsz != NULL ); - ATLENSURE_RETURN( pMemMgr != NULL ); - - if (pVal == NULL) - { - return E_POINTER; - } - - if (pVal->data != NULL) - { - return E_INVALIDARG; - } - - pVal->data = NULL; - pVal->size = 0; - - int nLength = AtlUnicodeToUTF8(wsz, cch, NULL, 0); - - if (nLength != 0) - { - char * pSrc = (char *) pMemMgr->Allocate(nLength); - if (pSrc != NULL) - { - nLength = AtlUnicodeToUTF8(wsz, cch, pSrc, nLength); - if (nLength != 0) - { - pVal->data = (unsigned char *) pMemMgr->Allocate(nLength); - if (pVal->data != NULL) - { - BOOL bRet; - int nDataLength = nLength; - if (!bHex) - { - bRet = Base64Decode(pSrc, nLength, pVal->data, &nDataLength); - } - else - { - bRet = AtlHexDecode(pSrc, nLength, pVal->data, &nDataLength); - } - if (bRet) - { - pVal->size = nDataLength; - } - } - } - - pMemMgr->Free(pSrc); - } - } - - if (pVal->size == 0) - { - if (pVal->data != NULL) - { - pMemMgr->Free(pVal->data); - pVal->data = NULL; - } - } - - return S_OK; -} - -//////////////////////////////////////////////////////////////////////////////// -// -// AtlGenXMLValue template and specializations -// -//////////////////////////////////////////////////////////////////////////////// - -template -inline HRESULT AtlGenXMLValue(__in IWriteStream *pStream, __in T *pVal) -{ - if ((pStream == NULL) || (pVal == NULL)) - { - return E_INVALIDARG; - } - - // - // delegate to CWriteStreamHelper - // - CWriteStreamHelper s(pStream); - - return (s.Write(*pVal) == TRUE ? S_OK : E_FAIL); -} - -#ifdef _NATIVE_WCHAR_T_DEFINED -template <> -inline HRESULT AtlGenXMLValue(__in IWriteStream *pStream, __in wchar_t *pVal) -{ - return AtlGenXMLValue(pStream, (unsigned short *)pVal); -} -#endif - -template <> -inline HRESULT AtlGenXMLValue(__in IWriteStream *pStream, __deref_inout_z wchar_t **pVal) -{ - if ((pStream == NULL) || (*pVal == NULL)) - { - return E_INVALIDARG; - } - - wchar_t *wszWrite = *pVal; - int nSrcLen = (int)wcslen(*pVal); - int nCnt = EscapeXML(*pVal, nSrcLen, NULL, 0); - if (nCnt > nSrcLen) - { - nCnt++; - wszWrite = (wchar_t *)calloc((nCnt),sizeof(wchar_t)); - if (wszWrite == NULL) - { - return E_OUTOFMEMORY; - } - - nCnt = EscapeXML(*pVal, nSrcLen, wszWrite, nCnt); - if (nCnt == 0) - { - free(wszWrite); - return E_FAIL; - } - wszWrite[nCnt] = L'\0'; - nSrcLen = nCnt; - } - - nCnt = AtlUnicodeToUTF8(wszWrite, nSrcLen, NULL, 0); - HRESULT hr = E_FAIL; - if ((nCnt == 0) || (nCnt == nSrcLen)) - { - CWriteStreamHelper s(pStream); - - hr = (s.Write(wszWrite) == TRUE ? S_OK : E_FAIL); - } - else - { - nCnt++; - CHeapPtr szWrite; - szWrite.AllocateBytes((size_t)(nCnt)); - if (szWrite != NULL) - { - nCnt = AtlUnicodeToUTF8(wszWrite, nSrcLen, szWrite, nCnt); - if (nCnt != 0) - { - hr = pStream->WriteStream(szWrite, nCnt, NULL); - } - } - else - { - ATLTRACE( _T("ATLSOAP: AtlGenXMLValue -- out of memory.\r\n") ); - - hr = E_OUTOFMEMORY; - } - } - - if (wszWrite != *pVal) - { - free(wszWrite); - } - - return hr; -} - -template <> -inline HRESULT AtlGenXMLValue(IWriteStream *pStream, double *pVal) -{ - if ((pStream == NULL) || (pVal == NULL)) - { - return E_INVALIDARG; - } - - HRESULT hr; - switch (_fpclass(*pVal)) - { - case _FPCLASS_SNAN: - case _FPCLASS_QNAN: - { - hr = pStream->WriteStream("NaN", 3, NULL); - break; - } - case _FPCLASS_NINF: - { - hr = pStream->WriteStream("-INF", 4, NULL); - break; - } - case _FPCLASS_PINF: - { - hr = pStream->WriteStream("INF", 3, NULL); - break; - } - case _FPCLASS_NZ: - { - hr = pStream->WriteStream("-0", 2, NULL); - break; - } - default: - { - /*** - * 2 = sign + decimal point - * ndec = decimal digits - * 5 = exponent letter (e or E), exponent sign, three digits exponent - * 1 = extra space for rounding - * 1 = string terminator '\0' - ***/ - const int ndec = 512; - CHAR szBuf[ndec+9]; - szBuf[0] = '\0'; - Checked::gcvt_s(szBuf, _countof(szBuf), *pVal, ndec); - size_t nLen = strlen(szBuf); - if (nLen && szBuf[nLen-1] == '.') - { - szBuf[--nLen] = '\0'; - } - - hr = pStream->WriteStream(szBuf, (int)nLen, NULL); - break; - } - } - - return hr; -} - -template <> -inline HRESULT AtlGenXMLValue(IWriteStream *pStream, float *pVal) -{ - if ((pStream == NULL) || (pVal == NULL)) - { - return E_INVALIDARG; - } - - double d = *pVal; - - return AtlGenXMLValue(pStream, &d); -} - -template <> -inline HRESULT AtlGenXMLValue(IWriteStream *pStream, bool *pVal) -{ - if ((pStream == NULL) || (pVal == NULL)) - { - return E_INVALIDARG; - } - - if (*pVal == true) - { - return pStream->WriteStream("true", sizeof("true")-1, NULL); - } - - return pStream->WriteStream("false", sizeof("false")-1, NULL); -} - -inline HRESULT AtlGenXMLBlobValue( - IWriteStream *pStream, - ATLSOAP_BLOB *pVal, - IAtlMemMgr *pMemMgr, - bool bHex = false) -{ - if ((pStream == NULL) || (pVal == NULL) || (pMemMgr == NULL)) - { - return E_INVALIDARG; - } - - HRESULT hr = E_FAIL; - int nLength; - if (!bHex) - { - nLength = Base64EncodeGetRequiredLength(pVal->size, ATLSOAP_BASE64_FLAGS); - } - else - { - nLength = AtlHexEncodeGetRequiredLength(pVal->size); - } - - char *pEnc = (char *) pMemMgr->Allocate(nLength); - if (pEnc != NULL) - { - BOOL bRet; - if (!bHex) - { - bRet = Base64Encode(pVal->data, pVal->size, pEnc, &nLength, ATLSOAP_BASE64_FLAGS); - } - else - { - bRet = AtlHexEncode(pVal->data, pVal->size, pEnc, &nLength); - } - if (bRet) - { - hr = pStream->WriteStream(pEnc, nLength, NULL); - } - - pMemMgr->Free(pEnc); - } - - return hr; -} - -template -inline HRESULT AtlCleanupValue(T * /*pVal*/) -{ - return S_OK; -} - -inline HRESULT AtlCleanupBlobValue(ATLSOAP_BLOB *pVal, IAtlMemMgr *pMemMgr) -{ - if ((pVal == NULL) || (pMemMgr == NULL)) - { - return E_INVALIDARG; - } - - if (pVal->data != NULL) - { - pMemMgr->Free(pVal->data); - pVal->data = NULL; - pVal->size = 0; - } - - return S_OK; -} - -template <> -inline HRESULT AtlCleanupValue(ATLSOAP_BLOB *pVal) -{ - ATLTRACE( _T("Warning: AtlCleanupValue was called -- assuming CRT allocator.\r\n") ); - - if (pVal == NULL) - { - return E_INVALIDARG; - } - - if (pVal->data != NULL) - { - free(pVal->data); - pVal->data = NULL; - pVal->size = 0; - } - - return S_OK; -} - -template <> -inline HRESULT AtlCleanupValue(BSTR *pVal) -{ - if (pVal == NULL) - { - // should never happen - ATLASSERT( FALSE ); - return E_INVALIDARG; - } - - if ((*pVal) != NULL) - { - // null strings are okay - SysFreeString(*pVal); - *pVal = NULL; - } - - return S_OK; -} - -template -inline HRESULT AtlCleanupValueEx(T *pVal, IAtlMemMgr *pMemMgr) -{ - pMemMgr; - - return AtlCleanupValue(pVal); -} - -template <> -inline HRESULT AtlCleanupValueEx(ATLSOAP_BLOB *pVal, IAtlMemMgr *pMemMgr) -{ - return AtlCleanupBlobValue(pVal, pMemMgr); -} - -// single dimensional arrays -template -inline HRESULT AtlCleanupArray(T *pArray, int nCnt) -{ - if (pArray == NULL) - { - return E_INVALIDARG; - } - - for (int i=0; i -inline HRESULT AtlCleanupArrayEx(T *pArray, int nCnt, IAtlMemMgr *pMemMgr) -{ - if (pArray == NULL) - { - return E_INVALIDARG; - } - - for (int i=0; i -inline HRESULT AtlCleanupArrayMD(T *pArray, const int *pDims) -{ - if ((pArray == NULL) || (pDims == NULL)) - { - return E_INVALIDARG; - } - - // calculate size - int nCnt = 1; - for (int i=1; i<=pDims[0]; i++) - { - nCnt*= pDims[i]; - } - - return AtlCleanupArray(pArray, nCnt); -} - -template -inline HRESULT AtlCleanupArrayMDEx(T *pArray, const int *pDims, IAtlMemMgr *pMemMgr) -{ - if ((pArray == NULL) || (pDims == NULL)) - { - return E_INVALIDARG; - } - - // calculate size - int nCnt = 1; - for (int i=1; i<=pDims[0]; i++) - { - nCnt*= pDims[i]; - } - - return AtlCleanupArrayEx(pArray, nCnt, pMemMgr); -} - - -#pragma pack(push,_ATL_PACKING) -namespace ATL -{ - -//////////////////////////////////////////////////////////////////////////////// -// -// CSAXSoapErrorHandler -// -//////////////////////////////////////////////////////////////////////////////// - -class CSAXSoapErrorHandler : public ISAXErrorHandler -{ -private: - - CFixedStringT m_strParseError; - -public: - virtual ~CSAXSoapErrorHandler() - { - } - - HRESULT __stdcall QueryInterface(REFIID riid, void **ppv) - { - if (!ppv) - { - return E_POINTER; - } - - if (InlineIsEqualGUID(riid, __uuidof(ISAXErrorHandler)) || - InlineIsEqualGUID(riid, __uuidof(IUnknown))) - { - *ppv = static_cast(this); - return S_OK; - } - return E_NOINTERFACE; - } - - ULONG __stdcall AddRef() - { - return 1; - } - - ULONG __stdcall Release() - { - return 1; - } - - const CStringW& GetParseError() - { - return m_strParseError; - } - - HRESULT __stdcall error( - ISAXLocator *pLocator, - const wchar_t *wszErrorMessage, - HRESULT hrErrorCode) - { - (pLocator); - (wszErrorMessage); - (hrErrorCode); - - ATLTRACE( _T("ATLSOAP: parse error: %ws\r\n"), wszErrorMessage ); - - _ATLTRY - { - m_strParseError = wszErrorMessage; - } - _ATLCATCHALL() - { - return E_FAIL; - } - - return hrErrorCode; - } - - HRESULT __stdcall fatalError( - ISAXLocator *pLocator, - const wchar_t *wszErrorMessage, - HRESULT hrErrorCode) - { - (pLocator); - (wszErrorMessage); - (hrErrorCode); - - ATLTRACE( _T("ATLSOAP: fatal parse error: %ws\r\n"), wszErrorMessage ); - - _ATLTRY - { - m_strParseError = wszErrorMessage; - } - _ATLCATCHALL() - { - return E_FAIL; - } - - return hrErrorCode; - } - - HRESULT __stdcall ignorableWarning( - ISAXLocator *pLocator, - const wchar_t *wszErrorMessage, - HRESULT hrErrorCode) - { - (pLocator); - (wszErrorMessage); - (hrErrorCode); - - ATLTRACE( _T("ATLSOAP: ignorable warning: %ws\r\n"), wszErrorMessage ); - - return hrErrorCode; - } -}; - -//////////////////////////////////////////////////////////////////////////////// -// -// ISAXContentHandlerImpl -// -//////////////////////////////////////////////////////////////////////////////// - -class ISAXContentHandlerImpl : - public ISAXContentHandler -{ -public: - - // - // ISAXContentHandler interface - // - - HRESULT __stdcall putDocumentLocator(ISAXLocator * /*pLocator*/) - { - return S_OK; - } - - HRESULT __stdcall startDocument() - { - return S_OK; - } - - HRESULT __stdcall endDocument() - { - return S_OK; - } - - HRESULT __stdcall startPrefixMapping( - const wchar_t * /*wszPrefix*/, - int /*cchPrefix*/, - const wchar_t * /*wszUri*/, - int /*cchUri*/) - { - return S_OK; - } - - HRESULT __stdcall endPrefixMapping( - const wchar_t * /*wszPrefix*/, - int /*cchPrefix*/) - { - return S_OK; - } - - HRESULT __stdcall startElement( - const wchar_t * /*wszNamespaceUri*/, - int /*cchNamespaceUri*/, - const wchar_t * /*wszLocalName*/, - int /*cchLocalName*/, - const wchar_t * /*wszQName*/, - int /*cchQName*/, - ISAXAttributes * /*pAttributes*/) - { - return S_OK; - } - - HRESULT __stdcall endElement( - const wchar_t * /*wszNamespaceUri*/, - int /*cchNamespaceUri*/, - const wchar_t * /*wszLocalName*/, - int /*cchLocalName*/, - const wchar_t * /*wszQName*/, - int /*cchQName*/) - { - return S_OK; - } - - HRESULT __stdcall characters( - const wchar_t * /*wszChars*/, - int /*cchChars*/) - { - return S_OK; - } - - HRESULT __stdcall ignorableWhitespace( - const wchar_t * /*wszChars*/, - int /*cchChars*/) - { - return S_OK; - } - - HRESULT __stdcall processingInstruction( - const wchar_t * /*wszTarget*/, - int /*cchTarget*/, - const wchar_t * /*wszData*/, - int /*cchData*/) - { - return S_OK; - } - - HRESULT __stdcall skippedEntity( - const wchar_t * /*wszName*/, - int /*cchName*/) - { - return S_OK; - } -}; // class ISAXContentHandlerImpl - -//////////////////////////////////////////////////////////////////////////////// -// -// SAX skip element handler utility class -// (skip an element and all its child elements) -// -//////////////////////////////////////////////////////////////////////////////// - -class CSkipHandler : public ISAXContentHandlerImpl -{ -public: - virtual ~CSkipHandler() - { - } - - HRESULT __stdcall QueryInterface(REFIID riid, void **ppv) - { - if (ppv == NULL) - { - return E_POINTER; - } - - *ppv = NULL; - - if (InlineIsEqualGUID(riid, IID_IUnknown) || - InlineIsEqualGUID(riid, IID_ISAXContentHandler)) - { - *ppv = static_cast(this); - return S_OK; - } - - return E_NOINTERFACE; - } - - ULONG __stdcall AddRef() - { - return 1; - } - - ULONG __stdcall Release() - { - return 1; - } - -private: - - DWORD m_dwReset; - CComPtr m_spReader; - CComPtr m_spParent; - - DWORD DisableReset(DWORD dwCnt = 1) - { - m_dwReset += dwCnt; - - return m_dwReset; - } - - DWORD EnableReset() - { - if (m_dwReset > 0) - { - --m_dwReset; - } - - return m_dwReset; - } - -public: - - CSkipHandler(ISAXContentHandler *pParent = NULL, ISAXXMLReader *pReader = NULL) - : m_spParent(pParent), m_spReader(pReader), m_dwReset(1) - { - } - - void SetParent(ISAXContentHandler *pParent) - { - m_spParent = pParent; - } - void DetachParent() - { - m_spParent.Detach(); - } - - void SetReader(ISAXXMLReader *pReader) - { - m_spReader = pReader; - } - - HRESULT __stdcall startElement( - const wchar_t * /*wszNamespaceUri*/, - int /*cchNamespaceUri*/, - const wchar_t * /*wszLocalName*/, - int /*cchLocalName*/, - const wchar_t * /*wszQName*/, - int /*cchQName*/, - ISAXAttributes * /*pAttributes*/) - { - DisableReset(); - return S_OK; - } - - HRESULT __stdcall endElement( - const wchar_t * /*wszNamespaceUri*/, - int /*cchNamespaceUri*/, - const wchar_t * /*wszLocalName*/, - int /*cchLocalName*/, - const wchar_t * /*wszQName*/, - int /*cchQName*/) - { - if (EnableReset() == 0) - { - m_spReader->putContentHandler(m_spParent); - } - - return S_OK; - } -}; // class CSkipHandler - - -//////////////////////////////////////////////////////////////////////////////// -// -// SAX string builder class -// -//////////////////////////////////////////////////////////////////////////////// - -class CSAXStringBuilder : public ISAXContentHandlerImpl -{ -public: - - HRESULT __stdcall QueryInterface(REFIID riid, void **ppv) - { - if (ppv == NULL) - { - return E_POINTER; - } - - *ppv = NULL; - - if (InlineIsEqualGUID(riid, IID_IUnknown) || - InlineIsEqualGUID(riid, IID_ISAXContentHandler)) - { - *ppv = static_cast(this); - return S_OK; - } - - return E_NOINTERFACE; - } - - ULONG __stdcall AddRef() - { - return 1; - } - - ULONG __stdcall Release() - { - return 1; - } - -private: - - ISAXContentHandler * m_pParent; - ISAXXMLReader * m_pReader; - DWORD m_dwReset; - CFixedStringT m_str; - - DWORD DisableReset(DWORD dwReset = 1) - { - m_dwReset+= dwReset; - - return m_dwReset; - } - - DWORD EnableReset() - { - if (m_dwReset > 0) - { - --m_dwReset; - } - - return m_dwReset; - } - -public: - - CSAXStringBuilder(ISAXXMLReader *pReader = NULL, ISAXContentHandler *pParent = NULL) - :m_pReader(pReader), m_pParent(pParent), m_dwReset(0) - { - } - - virtual ~CSAXStringBuilder() - { - } - - void SetReader(ISAXXMLReader *pReader) - { - m_pReader = pReader; - } - - void SetParent(ISAXContentHandler *pParent) - { - m_pParent = pParent; - } - - const CStringW& GetString() - { - return m_str; - } - - void Clear() - { - m_str.Empty(); - m_dwReset = 0; - } - - HRESULT __stdcall startElement( - const wchar_t * /*wszNamespaceUri*/, - int /*cchNamespaceUri*/, - const wchar_t * /*wszLocalName*/, - int /*cchLocalName*/, - const wchar_t *wszQName, - int cchQName, - ISAXAttributes *pAttributes) - { - if (m_dwReset == 0) - { - // if there is unescaped, nested XML, must disable - // an additional time for the first element - DisableReset(); - } - DisableReset(); - - int nAttrs = 0; - HRESULT hr = pAttributes->getLength(&nAttrs); - - _ATLTRY - { - if (SUCCEEDED(hr)) - { - m_str.Append(L"<", 1); - m_str.Append(wszQName, cchQName); - - const wchar_t *wszAttrNamespaceUri = NULL; - const wchar_t *wszAttrLocalName = NULL; - const wchar_t *wszAttrQName = NULL; - const wchar_t *wszAttrValue = NULL; - int cchAttrUri = 0; - int cchAttrLocalName = 0; - int cchAttrQName = 0; - int cchAttrValue = 0; - - for (int i=0; igetName(i, &wszAttrNamespaceUri, &cchAttrUri, - &wszAttrLocalName, &cchAttrLocalName, &wszAttrQName, &cchAttrQName); - - if (FAILED(hr)) - { - ATLTRACE( _T("ATLSOAP: CSAXStringBuilder::startElement -- MSXML error.\r\n") ); - - break; - } - - m_str.Append(L" ", 1); - m_str.Append(wszAttrQName, cchAttrQName); - - hr = pAttributes->getValue(i, &wszAttrValue, &cchAttrValue); - - if (FAILED(hr)) - { - ATLTRACE( _T("ATLSOAP: CSAXStringBuilder::startElement -- MSXML error.\r\n") ); - - break; - } - - m_str.Append(L"=\"", sizeof("=\"")-1); - if (cchAttrValue != 0) - { - m_str.Append(wszAttrValue, cchAttrValue); - } - m_str.Append(L"\"", 1); - } - - if (SUCCEEDED(hr)) - { - m_str.Append(L">", 1); - } - } - } - _ATLCATCHALL() - { - ATLTRACE( _T("ATLSOAP: CSAXStringBuilder::startElement -- out of memory.\r\n") ); - - hr = E_OUTOFMEMORY; - } - - return hr; - } - - HRESULT __stdcall endElement( - const wchar_t * wszNamespaceUri, - int cchNamespaceUri, - const wchar_t * wszLocalName, - int cchLocalName, - const wchar_t *wszQName, - int cchQName) - { - HRESULT hr = S_OK; - _ATLTRY - { - if (EnableReset() == 0) - { - hr = m_pParent->characters((LPCWSTR) m_str, m_str.GetLength()); - if (SUCCEEDED(hr)) - { - hr = m_pParent->endElement(wszNamespaceUri, cchNamespaceUri, - wszLocalName, cchLocalName, wszQName, cchQName); - } - - m_pReader->putContentHandler(m_pParent); - } - - if (m_dwReset > 0) - { - m_str.Append(L"", 1); - } - } - _ATLCATCHALL() - { - ATLTRACE( _T("ATLSOAP: CSAXStringBuilder::endElement -- out of memory.\r\n") ); - - hr = E_OUTOFMEMORY; - } - - return hr; - } - - HRESULT __stdcall characters( - const wchar_t *wszChars, - int cchChars) - { - _ATLTRY - { - m_str.Append(wszChars, cchChars); - } - _ATLCATCHALL() - { - ATLTRACE( _T("ATLSOAP: CSAXStringBuilder::characters -- out of memory.\r\n") ); - - return E_OUTOFMEMORY; - } - - return S_OK; - } - - HRESULT __stdcall ignorableWhitespace( - const wchar_t *wszChars, - int cchChars) - { - _ATLTRY - { - m_str.Append(wszChars, cchChars); - } - _ATLCATCHALL() - { - ATLTRACE( _T("ATLSOAP: CSAXStringBuilder::ignorableWhitespace -- out of memory.\r\n") ); - - return E_OUTOFMEMORY; - } - - return S_OK; - } -}; // class CSAXStringBuilder - -} // namespace ATL -#pragma pack(pop) - -//////////////////////////////////////////////////////////////////////////////// -// -// SOAP data structure definitions -// -//////////////////////////////////////////////////////////////////////////////// - -// -// ***************************** WARNING ***************************** -// THESE STRUCTURES ARE INTERNAL ONLY, FOR USE WITH THE ATL SERVER SOAP -// ATTRIBUTES. USERS SHOULD NOT USE THESE TYPES DIRECTLY. ABSOLUTELY NO -// GUARANTEES ARE MADE ABOUT BACKWARD COMPATIBILITY FOR DIRECT USE OF -// THESE TYPES. -// - -//////////////////////////////////////////////////////////////////////////////// -// -// BEGIN PRIVATE DEFINITIONS -// -//////////////////////////////////////////////////////////////////////////////// - -inline HRESULT AtlSoapGetArraySize(ISAXAttributes *pAttributes, size_t *pnSize, - const wchar_t **pwszTypeStart = NULL, const wchar_t **pwszTypeEnd = NULL) -{ - if (pnSize == NULL) - { - return E_POINTER; - } - - if (pAttributes == NULL) - { - return E_INVALIDARG; - } - - *pnSize = 0; - - HRESULT hr = S_OK; - - _ATLTRY - { - const wchar_t *wszTmp; - int cch; - - hr = GetAttribute(pAttributes, L"arrayType", sizeof("arrayType")-1, - &wszTmp, &cch, SOAPENC_NAMESPACEW, sizeof(SOAPENC_NAMESPACEA)-1); - - if ((SUCCEEDED(hr)) && (wszTmp != NULL)) - { - hr = E_FAIL; - - CFixedStringT wstrArrayType(wszTmp, cch); - const wchar_t *wsz = static_cast(wstrArrayType); - - const wchar_t *wszTypeStart = NULL; - const wchar_t *wszTypeEnd = NULL; - - // skip spaces - while (iswspace(*wsz) != 0) - { - wsz++; - } - - // no need to walk the string if the caller is not interested - if ((pwszTypeStart != NULL) && (pwszTypeEnd != NULL)) - { - wszTypeStart = wsz; - wszTypeEnd = wcschr(wszTypeStart, L':'); - if (wszTypeEnd != NULL) - { - wszTypeStart = wszTypeEnd+1; - } - } - - // SOAP Section 5 encodings are of the form: - // :arrayType="[dim1(,dim_i)*] - // for example: SOAP-ENC:arrayType="xsd:string[2,4]" - - wsz = wcschr(wsz, L'['); - if (wsz != NULL) - { - wszTypeEnd = wsz-1; - if (wsz[1] == ']') - { - return S_FALSE; - } - - *pnSize = 1; - - // get the size of each dimension - while (wsz != NULL) - { - wsz++; - int nDim = _wtoi(wsz); - if (nDim < 0) - { - hr = E_FAIL; - break; - } - *pnSize *= (size_t) nDim; - if (!nDim) - { - break; - } - - wsz = wcschr(wsz, L','); - } - - if ((pwszTypeStart != NULL) && (pwszTypeEnd != NULL)) - { - *pwszTypeStart = wszTypeStart; - *pwszTypeEnd = wszTypeEnd; - } - - hr = S_OK; - } - } - else - { - // not a section-5 encoding - hr = S_FALSE; - } - } - _ATLCATCHALL() - { - hr = E_OUTOFMEMORY; - } - - return hr; -} - -inline size_t AtlSoapGetArrayDims(const int *pDims) -{ - if (pDims == NULL) - { - return 0; - } - - size_t nRet = 1; - for (int i=1; i<=pDims[0]; i++) - { - nRet *= pDims[i]; - } - - return nRet; -} - -enum SOAPFLAGS -{ - SOAPFLAG_NONE = 0x00000000, - SOAPFLAG_IN = 0x00000001, - SOAPFLAG_OUT = 0x00000002, - SOAPFLAG_RETVAL = 0x00000004, - SOAPFLAG_DYNARR = 0x00000008, - SOAPFLAG_FIXEDARR = 0x00000010, - SOAPFLAG_MUSTUNDERSTAND = 0x00000020, - SOAPFLAG_UNKSIZE = 0x00000040, - SOAPFLAG_READYSTATE = 0x00000080, - SOAPFLAG_FIELD = 0x00000100, - SOAPFLAG_NOMARSHAL = 0x00000200, - SOAPFLAG_NULLABLE = 0x00000400, - SOAPFLAG_DOCUMENT = 0x00000800, - SOAPFLAG_RPC = 0x00001000, - SOAPFLAG_LITERAL = 0x00002000, - SOAPFLAG_ENCODED = 0x00004000, - SOAPFLAG_PID = 0x00008000, - SOAPFLAG_PAD = 0x00010000, - SOAPFLAG_CHAIN = 0x00020000, - SOAPFLAG_SIZEIS = 0x00040000, - SOAPFLAG_DYNARRWRAPPER = 0x00080000 -}; - -enum SOAPMAPTYPE -{ - SOAPMAP_ERR = 0, - SOAPMAP_ENUM, - SOAPMAP_FUNC, - SOAPMAP_STRUCT, - SOAPMAP_UNION, - SOAPMAP_HEADER, - SOAPMAP_PARAM -}; - -struct _soapmap; - -struct _soapmapentry -{ - ULONG nHash; - const char * szField; - const WCHAR * wszField; - int cchField; - int nVal; - DWORD dwFlags; - - size_t nOffset; - const int * pDims; - - const _soapmap * pChain; - - int nSizeIs; - - ULONG nNamespaceHash; - const char *szNamespace; - const wchar_t *wszNamespace; - int cchNamespace; -}; - -struct _soapmap -{ - ULONG nHash; - const char * szName; - const wchar_t * wszName; - int cchName; - int cchWName; - SOAPMAPTYPE mapType; - const _soapmapentry * pEntries; - size_t nElementSize; - size_t nElements; - int nRetvalIndex; - - DWORD dwCallFlags; - - ULONG nNamespaceHash; - const char *szNamespace; - const wchar_t *wszNamespace; - int cchNamespace; -}; - -enum SOAPTYPES -{ - SOAPTYPE_ERR = -2, - SOAPTYPE_UNK = -1, - SOAPTYPE_STRING = 0, - SOAPTYPE_BOOLEAN, - SOAPTYPE_FLOAT, - SOAPTYPE_DOUBLE, - SOAPTYPE_DECIMAL, - SOAPTYPE_DURATION, - SOAPTYPE_HEXBINARY, - SOAPTYPE_BASE64BINARY, - SOAPTYPE_ANYURI, - SOAPTYPE_ID, - SOAPTYPE_IDREF, - SOAPTYPE_ENTITY, - SOAPTYPE_NOTATION, - SOAPTYPE_QNAME, - SOAPTYPE_NORMALIZEDSTRING, - SOAPTYPE_TOKEN, - SOAPTYPE_LANGUAGE, - SOAPTYPE_IDREFS, - SOAPTYPE_ENTITIES, - SOAPTYPE_NMTOKEN, - SOAPTYPE_NMTOKENS, - SOAPTYPE_NAME, - SOAPTYPE_NCNAME, - SOAPTYPE_INTEGER, - SOAPTYPE_NONPOSITIVEINTEGER, - SOAPTYPE_NEGATIVEINTEGER, - SOAPTYPE_LONG, - SOAPTYPE_INT, - SOAPTYPE_SHORT, - SOAPTYPE_BYTE, - SOAPTYPE_NONNEGATIVEINTEGER, - SOAPTYPE_UNSIGNEDLONG, - SOAPTYPE_UNSIGNEDINT, - SOAPTYPE_UNSIGNEDSHORT, - SOAPTYPE_UNSIGNEDBYTE, - SOAPTYPE_POSITIVEINTEGER, - SOAPTYPE_DATETIME, - SOAPTYPE_TIME, - SOAPTYPE_DATE, - SOAPTYPE_GMONTH, - SOAPTYPE_GYEARMONTH, - SOAPTYPE_GYEAR, - SOAPTYPE_GMONTHDAY, - SOAPTYPE_GDAY, - - SOAPTYPE_USERBASE = 0x00001000 -}; - -inline ULONG AtlSoapHashStr(const char * sz) -{ - ULONG nHash = 0; - while (*sz != 0) - { - nHash = (nHash<<5)+nHash+(*sz); - sz++; - } - - return nHash; -} - -inline ULONG AtlSoapHashStr(const wchar_t * sz) -{ - ULONG nHash = 0; - while (*sz != 0) - { - nHash = (nHash<<5)+nHash+(*sz); - sz++; - } - - return nHash; -} - -inline ULONG AtlSoapHashStr(const char * sz, int cch) -{ - ULONG nHash = 0; - for (int i=0; i m_spReader; - CSAXStringBuilder m_stringBuilder; - CSkipHandler m_skipHandler; - - const wchar_t *m_wszSoapPrefix; - int m_cchSoapPrefix; - -public: - virtual ~CSoapFaultParser() - { - m_skipHandler.DetachParent(); - } - - // IUnknown interface - HRESULT __stdcall QueryInterface(REFIID riid, void **ppv) - { - if (ppv == NULL) - { - return E_POINTER; - } - - *ppv = NULL; - - if (InlineIsEqualGUID(riid, IID_IUnknown) || - InlineIsEqualGUID(riid, IID_ISAXContentHandler)) - { - *ppv = static_cast(this); - return S_OK; - } - - return E_NOINTERFACE; - } - - ULONG __stdcall AddRef() - { - return 1; - } - - ULONG __stdcall Release() - { - return 1; - } - - // constructor - - CSoapFaultParser(CSoapFault *pFault, ISAXXMLReader *pReader) - :m_pFault(pFault), m_dwState(STATE_ERROR), m_spReader(pReader) - { - ATLASSERT( pFault != NULL ); - ATLASSERT( pReader != NULL ); - } - - // ISAXContentHandler interface - HRESULT __stdcall startElement( - const wchar_t * wszNamespaceUri, - int cchNamespaceUri, - const wchar_t * wszLocalName, - int cchLocalName, - const wchar_t * /*wszQName*/, - int /*cchQName*/, - ISAXAttributes * /*pAttributes*/) - { - struct _faultmap - { - const wchar_t *wszTag; - int cchTag; - DWORD dwState; - }; - - const static _faultmap s_faultParseMap[] = - { - { L"Envelope", sizeof("Envelope")-1, CSoapFaultParser::STATE_ENVELOPE }, - { L"Body", sizeof("Body")-1, CSoapFaultParser::STATE_BODY }, - { L"Header", sizeof("Header")-1, CSoapFaultParser::STATE_BODY }, - { L"Fault", sizeof("Fault")-1, CSoapFaultParser::STATE_START }, - { L"faultcode", sizeof("faultcode")-1, CSoapFaultParser::STATE_FAULTCODE }, - { L"faultstring", sizeof("faultstring")-1, CSoapFaultParser::STATE_FAULTSTRING }, - { L"faultactor", sizeof("faultactor")-1, CSoapFaultParser::STATE_FAULTACTOR }, - { L"detail", sizeof("detail")-1, CSoapFaultParser::STATE_DETAIL } - }; - - if (m_spReader.p == NULL) - { - ATLTRACE( _T("ATLSOAP: CSoapFaultParser::startElement -- ISAXXMLReader is NULL.\r\n" ) ); - - return E_INVALIDARG; - } - - m_dwState &= ~STATE_RESET; - for (int i=0; i<(sizeof(s_faultParseMap)/sizeof(s_faultParseMap[0])); i++) - { - if ((cchLocalName == s_faultParseMap[i].cchTag) && - (!wcsncmp(wszLocalName, s_faultParseMap[i].wszTag, cchLocalName))) - { - DWORD dwState = s_faultParseMap[i].dwState; - if ((dwState & (STATE_START | STATE_ENVELOPE | STATE_BODY)) == 0) - { - m_stringBuilder.SetReader(m_spReader); - m_stringBuilder.SetParent(this); - - m_stringBuilder.Clear(); - m_spReader->putContentHandler( &m_stringBuilder ); - } - else - { - if ((dwState <= m_dwState) || - (cchNamespaceUri != sizeof(SOAPENV_NAMESPACEA)-1) || - (wcsncmp(wszNamespaceUri, SOAPENV_NAMESPACEW, cchNamespaceUri))) - { - ATLTRACE( _T("ATLSOAP: CSoapFaultParser::startElement -- malformed SOAP fault.\r\n" ) ); - - return E_FAIL; - } - } - - m_dwState = dwState; - return S_OK; - } - } - if (m_dwState > STATE_START) - { - m_dwState = STATE_SKIP; - m_skipHandler.SetReader(m_spReader); - m_skipHandler.SetParent(this); - - m_spReader->putContentHandler( &m_skipHandler ); - return S_OK; - } - - ATLTRACE( _T("ATLSOAP: CSoapFaultParser::startElement -- malformed SOAP fault.\r\n" ) ); - - return E_FAIL; - } - - HRESULT __stdcall startPrefixMapping( - const wchar_t * wszPrefix, - int cchPrefix, - const wchar_t * wszUri, - int cchUri) - { - if ((cchUri == sizeof(SOAPENV_NAMESPACEA)-1) && - (!wcsncmp(wszUri, SOAPENV_NAMESPACEW, cchUri))) - { - m_wszSoapPrefix = wszPrefix; - m_cchSoapPrefix = cchPrefix; - } - - return S_OK; - } - - HRESULT __stdcall characters( - const wchar_t * wszChars, - int cchChars); -}; - -extern __declspec(selectany) const int ATLS_SOAPFAULT_CNT = 4; - -class CSoapFault -{ -private: - - struct _faultcode - { - const wchar_t *wsz; - int cch; - const wchar_t *wszFaultString; - int cchFaultString; - SOAP_ERROR_CODE errCode; - }; - - static const _faultcode s_faultCodes[]; - -public: - - // members - SOAP_ERROR_CODE m_soapErrCode; - CStringW m_strFaultCode; - CStringW m_strFaultString; - CStringW m_strFaultActor; - CStringW m_strDetail; - - CSoapFault() - : m_soapErrCode(SOAP_E_UNK) - { - } - - HRESULT SetErrorCode( - const wchar_t *wsz, - const wchar_t *wszSoapPrefix, - int cch = -1, - int cchSoapPrefix = -1, - bool bSetFaultString = true) - { - if ((wsz == NULL) || (wszSoapPrefix == NULL)) - { - return E_INVALIDARG; - } - - if (cch == -1) - { - cch = (int) wcslen(wsz); - } - - while (*wsz && iswspace(*wsz)) - { - ++wsz; - --cch; - } - - if (cchSoapPrefix == -1) - { - cchSoapPrefix = (int) wcslen(wszSoapPrefix); - } - - const wchar_t *wszLocalName = wcschr(wsz, L':'); - if (wszLocalName == NULL) - { - // faultCode must be QName - - ATLTRACE( _T("ATLSOAP: CSoapFault::SetErrorCode -- faultCode is not a QName.\r\n" ) ); - - return E_FAIL; - } - - // make sure the namespace of the fault is the - // SOAPENV namespace - if ((cchSoapPrefix != (int)(wszLocalName-wsz)) || - (wcsncmp(wsz, wszSoapPrefix, cchSoapPrefix))) - { - ATLTRACE( _T("ATLSOAP: CSoapFault::SetErrorCode -- fault namespace is incorrect.\r\n" ) ); - - return E_FAIL; - } - - wszLocalName++; - cch -= (int) (wszLocalName-wsz); - - _ATLTRY - { - for (int i=0; i spReader; - if (pReader != NULL) - { - spReader = pReader; - } - else - { - if (FAILED(spReader.CoCreateInstance(ATLS_SAXXMLREADER_CLSID, NULL, CLSCTX_INPROC_SERVER))) - { - ATLTRACE( _T("ATLSOAP: CSoapFault::ParseFault -- CoCreateInstance of SAXXMLReader failed.\r\n" ) ); - - return E_FAIL; - } - } - - Clear(); - CSoapFaultParser parser(const_cast(this), spReader); - spReader->putContentHandler(&parser); - - CComVariant varStream; - varStream = static_cast(pStream); - - HRESULT hr = spReader->parse(varStream); - spReader->putContentHandler(NULL); - return hr; - } - - HRESULT GenerateFault(IWriteStream *pWriteStream) - { - if ((pWriteStream == NULL) || (m_soapErrCode == SOAP_E_UNK)) - { - return E_INVALIDARG; - } - - ATLASSERT( (m_soapErrCode == SOAP_E_UNK) || - (m_soapErrCode == SOAP_E_VERSION_MISMATCH) || - (m_soapErrCode == SOAP_E_MUST_UNDERSTAND) || - (m_soapErrCode == SOAP_E_CLIENT) || - (m_soapErrCode == SOAP_E_SERVER) ); - - HRESULT hr = S_OK; - _ATLTRY - { - const wchar_t *wszFaultCode = NULL; - if (m_strFaultCode.GetLength() == 0) - { - for (int i=0; i<4; i++) - { - if (s_faultCodes[i].errCode == m_soapErrCode) - { - if (m_strFaultString.GetLength() == 0) - { - m_strFaultString.SetString(s_faultCodes[i].wszFaultString, - s_faultCodes[i].cchFaultString); - } - - wszFaultCode = s_faultCodes[i].wsz; - break; - } - } - } - - if (wszFaultCode == NULL) - { - if (m_strFaultCode.GetLength() != 0) - { - wszFaultCode = m_strFaultCode; - } - else - { - ATLTRACE( _T("CSoapFault::GenerateFault -- missing/invalid fault code.\r\n") ); - return E_FAIL; - } - } - - const LPCSTR s_szErrorFormat = - "" - "" - "" - "SOAP:%ws" - "%ws" - "%s%ws%s" - "%ws" - "" - "" - ""; - - CStringA strFault; - strFault.Format(s_szErrorFormat, wszFaultCode, m_strFaultString, - m_strFaultActor.GetLength() ? "" : "", m_strFaultActor, - m_strFaultActor.GetLength() ? "" : "", - m_strDetail); - - hr = pWriteStream->WriteStream(strFault, strFault.GetLength(), NULL); - } - _ATLCATCHALL() - { - ATLTRACE( _T("ATLSOAP: CSoapFault::GenerateFault -- out of memory.\r\n" ) ); - hr = E_OUTOFMEMORY; - } - - return hr; - } - - void Clear() - { - m_soapErrCode = SOAP_E_UNK; - m_strFaultCode.Empty(); - m_strFaultString.Empty(); - m_strFaultActor.Empty(); - m_strDetail.Empty(); - } -}; // class CSoapFault - -#define DECLARE_SOAP_FAULT(__name, __faultstring, __errcode) \ - { L ## __name, sizeof(__name)-1, L ## __faultstring, sizeof(__faultstring), __errcode }, - -__declspec(selectany) const CSoapFault::_faultcode CSoapFault::s_faultCodes[] = -{ - DECLARE_SOAP_FAULT("VersionMismatch", "SOAP Version Mismatch Error", SOAP_E_VERSION_MISMATCH) - DECLARE_SOAP_FAULT("MustUnderstand", "SOAP Must Understand Error", SOAP_E_MUST_UNDERSTAND) - DECLARE_SOAP_FAULT("Client", "SOAP Invalid Request", SOAP_E_CLIENT) - DECLARE_SOAP_FAULT("Server", "SOAP Server Application Faulted", SOAP_E_SERVER) -}; - -ATL_NOINLINE inline HRESULT __stdcall CSoapFaultParser::characters( - const wchar_t * wszChars, - int cchChars) -{ - if (m_pFault == NULL) - { - return E_INVALIDARG; - } - - if (m_dwState & STATE_RESET) - { - return S_OK; - } - - HRESULT hr = E_FAIL; - _ATLTRY - { - switch (m_dwState) - { - case STATE_FAULTCODE: - if (m_pFault->m_soapErrCode == SOAP_E_UNK) - { - hr = m_pFault->SetErrorCode(wszChars, m_wszSoapPrefix, - cchChars, m_cchSoapPrefix, false); - } - break; - case STATE_FAULTSTRING: - if (m_pFault->m_strFaultString.GetLength() == 0) - { - m_pFault->m_strFaultString.SetString(wszChars, cchChars); - hr = S_OK; - } - break; - case STATE_FAULTACTOR: - if (m_pFault->m_strFaultActor.GetLength() == 0) - { - m_pFault->m_strFaultActor.SetString(wszChars, cchChars); - hr = S_OK; - } - break; - case STATE_DETAIL: - if (m_pFault->m_strDetail.GetLength() == 0) - { - m_pFault->m_strDetail.SetString(wszChars, cchChars); - hr = S_OK; - } - break; - case STATE_START: case STATE_ENVELOPE : case STATE_BODY : case STATE_SKIP: - hr = S_OK; - break; - default: - // should never get here - ATLASSERT( FALSE ); - break; - } - } - _ATLCATCHALL() - { - ATLTRACE( _T("ATLSOAP: CSoapFaultParser::characters -- out of memory.\r\n" ) ); - - hr = E_OUTOFMEMORY; - } - - m_dwState |= STATE_RESET; - - return hr; -} - -//////////////////////////////////////////////////////////////////////////////// -// -// CSoapRootHandler - the class that does most of the work -// -//////////////////////////////////////////////////////////////////////////////// - -#ifndef ATLSOAP_STACKSIZE - // 16 will be plenty for the 99% case - #define ATLSOAP_STACKSIZE 16 -#endif - -#ifndef ATLSOAP_GROWARRAY - #define ATLSOAP_GROWARRAY 10 -#endif - -class CSoapRootHandler : public ISAXContentHandlerImpl -{ -private: - - friend class _CSDLGenerator; - - // - // state constants - // - const static DWORD SOAP_START = 0; - const static DWORD SOAP_ENVELOPE = 1; - const static DWORD SOAP_HEADERS = 2; - const static DWORD SOAP_BODY = 3; - const static DWORD SOAP_PARAMS = 4; - const static DWORD SOAP_CALLED = 5; - const static DWORD SOAP_RESPONSE = 6; - const static DWORD SOAP_HEADERS_DONE = 7; - - // - // hash values for SOAP namespaces and elements - // - const static ULONG SOAP_ENV = 0x5D3574E2; - const static ULONG SOAP_ENC = 0xBD62724B; - const static ULONG ENVELOPE = 0xDBE6009E; - const static ULONG HEADER = 0xAF4DFFC9; - const static ULONG BODY = 0x0026168E; - - // - // XSD Names - // - struct XSDEntry - { - wchar_t * wszName; - char * szName; - int cchName; - }; - - const static XSDEntry s_xsdNames[]; - - // - // CBitVector - a dynamically sized bit vector class - // - class CBitVector - { - private: - - // 64 bits will handle the 99% case - unsigned __int64 m_nBits; - - // when we need to grow - unsigned __int64 * m_pBits; - - size_t m_nSize; - - bool Grow(size_t nIndex) - { - // Think carefully - // In our current implementation, CHAR_BIT==8, and sizeof(m_nBits)==8. Easy to confuse the two. - - // We do math in bits, so this is our max size - ATLENSURE(nIndex= m_nSize) - { - return false; - } - - size_t i = nIndex/(sizeof(m_nBits)*CHAR_BIT); - size_t nBits = nIndex-i*(sizeof(m_nBits)*CHAR_BIT); - return ((m_pBits[i] >> nBits) & 0x01); - } - - bool SetBit(size_t nIndex) - { - if (nIndex >= m_nSize) - { - if (!Grow(nIndex)) - { - return false; - } - } - - size_t i = nIndex/(sizeof(m_nBits)*CHAR_BIT); - size_t nBits = nIndex-i*(sizeof(m_nBits)*CHAR_BIT); - m_pBits[i] |= (((unsigned __int64) 1) << nBits); - - return true; - } - - void Clear() - { - if (m_pBits == &m_nBits) - { - m_nBits = 0; - } - else - { - memset(m_pBits, 0x00, (m_nSize/CHAR_BIT)); - } - } - - ~CBitVector() - { - if (m_pBits != &m_nBits) - { - free(m_pBits); - } - - m_pBits = &m_nBits; - m_nSize = sizeof(m_nBits)*CHAR_BIT; - } - - void RelocateFixup() - { - if (m_nSize <= sizeof(m_nBits)*CHAR_BIT) - { - m_pBits = &m_nBits; - } - } - }; // class CBitVector - - // - // Parsing State - // - struct ParseState - { - void *pvElement; - DWORD dwFlags; - size_t nAllocSize; - size_t nExpectedElements; - size_t nElement; - const _soapmap *pMap; - const _soapmapentry *pEntry; - - // mark when we get an item - CBitVector vec; - - size_t nDepth; - - ParseState(void *pvElement_ = NULL, DWORD dwFlags_ = 0, - size_t nAllocSize_ = 0, size_t nExpectedElements_ = 0, - size_t nElement_ = 0, const _soapmap *pMap_ = NULL, - const _soapmapentry *pEntry_ = NULL) - : pvElement(pvElement_), dwFlags(dwFlags_), nAllocSize(nAllocSize_), - nExpectedElements(nExpectedElements_), nElement(nElement_), pMap(pMap_), - pEntry(pEntry_), nDepth(0) - { - vec.Clear(); - } - - ParseState(const ParseState& that) - { - pvElement = that.pvElement; - dwFlags = that.dwFlags; - nAllocSize = that.nAllocSize; - nExpectedElements = that.nExpectedElements; - nElement = that.nElement; - pMap = that.pMap; - pEntry = that.pEntry; - nDepth = that.nDepth; - vec.Clear(); - } - - ~ParseState() - { - pvElement = NULL; - dwFlags = 0; - nAllocSize = 0; - nExpectedElements = 0; - nElement = 0; - pMap = NULL; - pEntry = NULL; - nDepth = 0; - vec.Clear(); - } - - void RelocateFixup() - { - vec.RelocateFixup(); - } - }; // struct ParseState - - class CParseStateElementTraits : public CDefaultElementTraits - { - public: - // CBitVector relocate fixup - static void RelocateElements( ParseState* pDest, ParseState* pSrc, size_t nElements ) - { - CDefaultElementTraits::RelocateElements(pDest, pSrc, nElements); - - // fixup CBitVector - for (size_t i=0; iWriteStream("", - - sizeof("")-1, - - NULL); - } - - HRESULT StartHeaders(IWriteStream *pStream, const _soapmap *pMap) - { - ATLENSURE_RETURN( pStream != NULL ); - ATLENSURE_RETURN( pMap != NULL ); - - HRESULT hr = pStream->WriteStream("dwCallFlags & (SOAPFLAG_RPC | SOAPFLAG_ENCODED)) != - (SOAPFLAG_RPC | SOAPFLAG_ENCODED)) - { - // qualify document/literal by default - // For this version, ATL Server will not respect - // the elementForm* attributes in an XSD schema - - hr = pStream->WriteStream(" xmlns=\"", sizeof(" xmlns=\"")-1, NULL); - if (SUCCEEDED(hr)) - { - hr = pStream->WriteStream(pMap->szNamespace, pMap->cchNamespace, NULL); - if (SUCCEEDED(hr)) - { - hr = pStream->WriteStream("\">", sizeof("\">")-1, NULL); - } - } - } - else - { - // rpc/encoded - hr = pStream->WriteStream(">", sizeof(">")-1, NULL); - } - } - return hr; - } - - HRESULT EndHeaders(IWriteStream *pStream) - { - ATLENSURE_RETURN( pStream != NULL ); - - return pStream->WriteStream("", sizeof("")-1, NULL); - } - - virtual HRESULT StartBody(IWriteStream *pStream) - { - ATLENSURE_RETURN( pStream != NULL ); - - return pStream->WriteStream( - "", sizeof("")-1, NULL); - } - - HRESULT EndBody(IWriteStream *pStream) - { - ATLENSURE_RETURN( pStream != NULL ); - - return pStream->WriteStream("", sizeof("")-1, NULL); - } - - HRESULT EndEnvelope(IWriteStream *pStream) - { - ATLENSURE_RETURN( pStream != NULL ); - - return pStream->WriteStream("", sizeof("")-1, NULL); - } - - virtual HRESULT StartMap(IWriteStream *pStream, const _soapmap *pMap, bool bClient) = 0; - virtual HRESULT EndMap(IWriteStream *pStream, const _soapmap *pMap, bool bClient) = 0; - - virtual HRESULT StartEntry(IWriteStream *pStream, const _soapmap *pMap, const _soapmapentry *pEntry) - { - ATLENSURE_RETURN( pStream != NULL ); - ATLENSURE_RETURN( pEntry != NULL ); - - // output name - HRESULT hr = pStream->WriteStream("<", 1, NULL); - if (SUCCEEDED(hr)) - { - const char *szHeaderNamespace = NULL; - int cchHeaderNamespace = 0; - - if ((pMap != NULL) && (pMap->mapType == SOAPMAP_HEADER) && - ((pEntry->pChain != NULL) && - (pEntry->pChain->szNamespace !=NULL)) || - (pEntry->szNamespace != NULL)) - { - hr = pStream->WriteStream("snp:", sizeof("snp:")-1, NULL); - if (SUCCEEDED(hr)) - { - szHeaderNamespace = pEntry->pChain ? - pEntry->pChain->szNamespace : pEntry->szNamespace; - - cchHeaderNamespace = pEntry->pChain ? - pEntry->pChain->cchNamespace : pEntry->cchNamespace; - } - } - - if (SUCCEEDED(hr)) - { - if ((pEntry->dwFlags & SOAPFLAG_RETVAL)==0) - { - hr = pStream->WriteStream(pEntry->szField, pEntry->cchField, NULL); - } - else - { - hr = pStream->WriteStream("return", sizeof("return")-1, NULL); - } - if (SUCCEEDED(hr)) - { - if (szHeaderNamespace != NULL) - { - ATLASSERT( cchHeaderNamespace != 0 ); - - hr = pStream->WriteStream(" xmlns:snp=\"", sizeof(" xmlns:snp=\"")-1, NULL); - if (SUCCEEDED(hr)) - { - hr = pStream->WriteStream(szHeaderNamespace, cchHeaderNamespace, NULL); - if (SUCCEEDED(hr)) - { - hr = pStream->WriteStream("\"", sizeof("\"")-1, NULL); - } - } - } - } - } - } - if (SUCCEEDED(hr)) - { - if (pEntry->dwFlags & SOAPFLAG_MUSTUNDERSTAND) - { - // output mustUnderstand - hr = pStream->WriteStream(" soap:mustUnderstand=\"1\"", sizeof(" soap:mustUnderstand=\"1\"")-1, NULL); - } - } - return hr; - } - - HRESULT EndEntry(IWriteStream *pStream, const _soapmap *pMap, const _soapmapentry *pEntry) - { - ATLENSURE_RETURN( pStream != NULL ); - ATLENSURE_RETURN( pEntry != NULL ); - - HRESULT hr = pStream->WriteStream("mapType == SOAPMAP_HEADER) && - ((pEntry->pChain != NULL) && - (pEntry->pChain->szNamespace !=NULL)) || - (pEntry->szNamespace != NULL)) - { - hr = pStream->WriteStream("snp:", sizeof("snp:")-1, NULL); - } - if ((pEntry->dwFlags & SOAPFLAG_RETVAL)==0) - { - hr = pStream->WriteStream(pEntry->szField, pEntry->cchField, NULL); - } - else - { - hr = pStream->WriteStream("return", sizeof("return")-1, NULL); - } - if (SUCCEEDED(hr)) - { - hr = pStream->WriteStream(">", 1, NULL); - } - } - return hr; - } - }; // class CResponseGenerator - - class CDocLiteralGenerator : public CResponseGenerator - { - public: - - HRESULT StartMap(IWriteStream *pStream, const _soapmap *pMap, bool bClient) - { - ATLENSURE_RETURN( pStream != NULL ); - ATLENSURE_RETURN( pMap != NULL ); - - HRESULT hr = S_OK; - // output type name - hr = pStream->WriteStream("<", 1, NULL); - if (SUCCEEDED(hr)) - { - hr = pStream->WriteStream(pMap->szName, pMap->cchName, NULL); - if (SUCCEEDED(hr)) - { - if ((pMap->mapType == SOAPMAP_FUNC) && - (bClient == false) && - (pMap->dwCallFlags & SOAPFLAG_PID)) - { - hr = pStream->WriteStream("Response", sizeof("Response")-1, NULL); - if (FAILED(hr)) - { - return hr; - } - } - - if (pMap->mapType == SOAPMAP_FUNC) - { - hr = pStream->WriteStream(" xmlns=\"", sizeof(" xmlns=\"")-1, NULL); - if (SUCCEEDED(hr)) - { - hr = pStream->WriteStream(pMap->szNamespace, pMap->cchNamespace, NULL); - if (SUCCEEDED(hr)) - { - hr = pStream->WriteStream("\">", sizeof("\">")-1, NULL); - } - } - } - else - { - hr = pStream->WriteStream(">", 1, NULL); - } - } - } - return hr; - } - - HRESULT EndMap(IWriteStream *pStream, const _soapmap *pMap, bool bClient) - { - ATLENSURE_RETURN( pStream != NULL ); - ATLENSURE_RETURN( pMap != NULL ); - - HRESULT hr = pStream->WriteStream("WriteStream(pMap->szName, pMap->cchName, NULL); - if (SUCCEEDED(hr)) - { - if ((pMap->mapType == SOAPMAP_FUNC) && - (bClient == false) && - (pMap->dwCallFlags & SOAPFLAG_PID)) - { - hr = pStream->WriteStream("Response", sizeof("Response")-1, NULL); - if (FAILED(hr)) - { - return hr; - } - } - hr = pStream->WriteStream(">", 1, NULL); - } - } - - return hr; - } - - }; // class CDocLiteralGenerator - - class CPIDGenerator : public CDocLiteralGenerator - { - }; - - class CPADGenerator : public CDocLiteralGenerator - { - public: - - virtual HRESULT StartEntry(IWriteStream *pStream, const _soapmap *pMap, const _soapmapentry *pEntry) - { - ATLENSURE_RETURN( pStream != NULL ); - ATLENSURE_RETURN( pEntry != NULL ); - - HRESULT hr = __super::StartEntry(pStream, pMap, pEntry); - if (SUCCEEDED(hr) && (pMap->dwCallFlags & SOAPFLAG_PAD)) - { - hr = pStream->WriteStream(" xmlns=\"", sizeof(" xmlns=\"")-1, NULL); - if (SUCCEEDED(hr)) - { - hr = pStream->WriteStream(pMap->szNamespace, pMap->cchNamespace, NULL); - if (SUCCEEDED(hr)) - { - hr = pStream->WriteStream("\"", sizeof("\"")-1, NULL); - } - } - } - - return hr; - } - }; // class CPADGenerator - - class CRpcEncodedGenerator : public CResponseGenerator - { - public: - - HRESULT StartBody(IWriteStream *pStream) - { - ATLENSURE_RETURN( pStream != NULL ); - - return pStream->WriteStream( - "", - sizeof("")-1, NULL); - } - - HRESULT StartMap(IWriteStream *pStream, const _soapmap *pMap, bool bClient) - { - ATLENSURE_RETURN( pStream != NULL ); - ATLENSURE_RETURN( pMap != NULL ); - - (bClient); // unused for rpc/encoded - - HRESULT hr = pStream->WriteStream("WriteStream(pMap->szName, pMap->cchName, NULL); - if (SUCCEEDED(hr)) - { - if (pMap->mapType == SOAPMAP_FUNC) - { - hr = pStream->WriteStream(" xmlns:snp=\"", sizeof(" xmlns:snp=\"")-1, NULL); - if (SUCCEEDED(hr)) - { - ATLASSERT( pMap->szNamespace != NULL ); - hr = pStream->WriteStream(pMap->szNamespace, pMap->cchNamespace, NULL); - if (SUCCEEDED(hr)) - { - hr = pStream->WriteStream("\">", sizeof("\">")-1, NULL); - } - } - } - else - { - hr = pStream->WriteStream(">", 1, NULL); - } - } - } - return hr; - } - - HRESULT EndMap(IWriteStream *pStream, const _soapmap *pMap, bool bClient) - { - ATLENSURE_RETURN( pStream != NULL ); - ATLENSURE_RETURN( pMap != NULL ); - - (bClient); // unused for rpc/encoded - - HRESULT hr = pStream->WriteStream("WriteStream(pMap->szName, pMap->cchName, NULL); - if (SUCCEEDED(hr)) - { - hr = pStream->WriteStream(">", 1, NULL); - } - } - - return hr; - } - }; // class CRpcEncodedGenerator - - // - // members - // - CAtlArray m_stateStack; - size_t m_nState; - - DWORD m_dwState; - - CComPtr m_spReader; - - CSAXStringBuilder m_stringBuilder; - CSkipHandler m_skipHandler; - - IAtlMemMgr * m_pMemMgr; - - static CCRTHeap m_crtHeap; - - bool m_bClient; - - void *m_pvParam; - - bool m_bNullCheck; - bool m_bChildCheck; - bool m_bCharacters; - size_t m_nDepth; - - typedef CFixedStringT REFSTRING; - - // used for rpc/encoded messages with href's - typedef CAtlMap > REFMAP; - REFMAP m_refMap; - - // - // Implementation helpers - // - - HRESULT PushState(void *pvElement = NULL, const _soapmap *pMap = NULL, - const _soapmapentry *pEntry = NULL, DWORD dwFlags = 0, size_t nAllocSize = 0, - size_t nExpectedElements = 0, size_t nElement = 0) - { - if (m_stateStack.IsEmpty()) - { - // 16 will be plenty for the 99% case - if (!m_stateStack.SetCount(0, 16)) - { - ATLTRACE( _T("ATLSOAP: CSoapRootHandler::PushState -- out of memory.\r\n" ) ); - - return E_OUTOFMEMORY; - } - } - - size_t nCnt = m_stateStack.GetCount(); - m_nState = m_stateStack.Add(); - if (m_stateStack.GetCount() <= nCnt) - { - ATLTRACE( _T("ATLSOAP: CSoapRootHandler::PushState -- out of memory.\r\n" ) ); - - return E_OUTOFMEMORY; - } - - ParseState &state = m_stateStack[m_nState]; - - state.pvElement = pvElement; - state.dwFlags = dwFlags; - state.nAllocSize = nAllocSize; - state.nExpectedElements = nExpectedElements; - state.nElement = nElement; - state.pMap = pMap; - state.pEntry = pEntry; - state.nDepth = m_nDepth; - - return S_OK; - } - - ParseState& GetState() - { - return m_stateStack[m_nState]; - } - - void PopState(bool bForce = false) - { - if ((m_nState != 0) || (bForce != false)) - { - m_stateStack.RemoveAt(m_nState); - --m_nState; - } - } - - BOOL IsEqualElement(int cchLocalNameCheck, const wchar_t *wszLocalNameCheck, - int cchNamespaceUriCheck, const wchar_t *wszNamespaceUriCheck, - int cchLocalName, const wchar_t *wszLocalName, - int cchNamespaceUri, const wchar_t *wszNamespaceUri) - { - ATLENSURE(wszLocalName); - ATLENSURE(wszLocalNameCheck); - ATLENSURE(wszNamespaceUri); - ATLENSURE(wszNamespaceUriCheck); - - if (cchLocalName == cchLocalNameCheck && - cchNamespaceUri == cchNamespaceUriCheck && - !wcsncmp(wszLocalName, wszLocalNameCheck, cchLocalName) && - !wcsncmp(wszNamespaceUri, wszNamespaceUriCheck, cchNamespaceUri)) - { - return TRUE; - } - - return FALSE; - } - - ATL_FORCEINLINE BOOL IsEqualString(const wchar_t *wszStr1, int cchStr1, const wchar_t *wszStr2, int cchStr2) - { - ATLENSURE( wszStr1 != NULL ); - ATLENSURE( wszStr2 != NULL ); - ATLENSURE( cchStr1 >= 0 ); - ATLENSURE( cchStr2 >= 0 ); - - if (cchStr1 == cchStr2) - { - return !wcsncmp(wszStr1, wszStr2, cchStr2); - } - return FALSE; - } - - ATL_FORCEINLINE BOOL IsEqualStringHash(const wchar_t *wszStr1, int cchStr1, ULONG nHash1, - const wchar_t *wszStr2, int cchStr2, ULONG nHash2) - { - ATLENSURE( wszStr1 != NULL ); - ATLENSURE( wszStr2 != NULL ); - ATLENSURE( cchStr1 >= 0 ); - ATLENSURE( cchStr2 >= 0 ); - - if (nHash1 == nHash2) - { - return IsEqualString(wszStr1, cchStr1, wszStr2, cchStr2); - } - - return FALSE; - } - - BOOL IsEqualElement(int cchLocalNameCheck, const wchar_t *wszLocalNameCheck, - int cchLocalName, const wchar_t *wszLocalName) - { - if (cchLocalName == cchLocalNameCheck && - !wcsncmp(wszLocalName, wszLocalNameCheck, cchLocalName)) - { - return TRUE; - } - - return FALSE; - } - - void SetOffsetValue(void *pBase, void *pSrc, size_t nOffset) - { - void **ppDest = (void **)(((unsigned char *)pBase)+nOffset); - *ppDest = pSrc; - } - - bool IsRpcEncoded() - { - if ((m_stateStack[0].pMap->dwCallFlags & (SOAPFLAG_RPC | SOAPFLAG_ENCODED)) == - (SOAPFLAG_RPC | SOAPFLAG_ENCODED)) - { - return true; - } - return false; - } - - - HRESULT ValidateArrayEntry( - ParseState& state, - const wchar_t *wszLocalName, - int cchLocalName) - { - (cchLocalName); - (wszLocalName); - - ATLASSERT( state.pEntry != NULL ); - - // SOAP Section 5.4.2 - - // check number of elements - if (state.nElement == state.nExpectedElements) - { - // too many elements - if ((state.dwFlags & SOAPFLAG_UNKSIZE)==0) - { - ATLTRACE( _T("ATLSOAP: CSoapRootHandler::ValidateArrayEntry -- too many elements.\r\n" ) ); - return E_FAIL; - } - - ATLASSERT( IsRpcEncoded() == false ); - - // see if we need to allocate more - if (state.nElement == state.nAllocSize) - { - unsigned char **ppArr = (unsigned char **)state.pvElement; - size_t nNewElement=0; - HRESULT hr=E_FAIL; - if(FAILED(hr=::ATL::AtlMultiply(&nNewElement, state.nElement, static_cast(2)))) - { - return hr; - } - hr = AllocateArray(state.pEntry, (void **)ppArr, __max(nNewElement, ATLSOAP_GROWARRAY), state.nElement); - - if (SUCCEEDED(hr)) - { - state.nAllocSize = __max((state.nElement)*2, ATLSOAP_GROWARRAY); - } - - return hr; - } - } - - return S_OK; - } - - HRESULT CheckID( - const wchar_t *wszNamespaceUri, - const wchar_t *wszLocalName, - int cchLocalName, - ISAXAttributes *pAttributes) - { - (cchLocalName); - (wszLocalName); - (wszNamespaceUri); - ATLASSERT( pAttributes != NULL ); - - const wchar_t *wsz = NULL; - int cch = 0; - - HRESULT hr = GetAttribute(pAttributes, L"id", sizeof("id")-1, &wsz, &cch); - if ((hr == S_OK) && (wsz != NULL)) - { - const REFMAP::CPair *p = NULL; - _ATLTRY - { - REFSTRING strRef(wsz, cch); - p = m_refMap.Lookup(strRef); - if (p == NULL) - { - return S_FALSE; - } - } - _ATLCATCHALL() - { - ATLTRACE( _T("ATLSOAP: CSoapRootHandler::CheckID -- out of memory.\r\n" ) ); - - return E_OUTOFMEMORY; - } - - ATLASSERT( IsRpcEncoded() == true ); - - const ParseState& state = p->m_value; - - // disallow href-chaining - hr = CheckHref(state.pEntry, state.pvElement, pAttributes); - if (hr != S_FALSE) - { - return E_FAIL; - } - - hr = S_OK; - - // do array stuff - if (state.dwFlags & (SOAPFLAG_FIXEDARR | SOAPFLAG_DYNARR)) - { - hr = GetSection5Info(state, state.pEntry, pAttributes); - } - else - { - // only structs and arrays are allowed for hrefs - ATLASSERT( state.pEntry->pChain != NULL ); - ATLASSERT( state.pEntry->pChain->mapType == SOAPMAP_STRUCT ); - - // structs must have child entries - m_bChildCheck = state.pEntry->pChain->nElements != 0; - - if (S_OK != PushState(state.pvElement, state.pEntry->pChain, state.pEntry, - state.dwFlags, 0, state.pEntry->pChain->nElements)) - { - ATLTRACE( _T("ATLSOAP: CSoapRootHandler::CheckID -- out of memory.\n" ) ); - hr = E_OUTOFMEMORY; - } - } - - m_refMap.DisableAutoRehash(); - m_refMap.RemoveAtPos(const_cast(p)); - m_refMap.EnableAutoRehash(); - - return hr; - } - - return S_FALSE; - } - - HRESULT GetElementEntry( - ParseState& state, - const wchar_t *wszNamespaceUri, - const wchar_t *wszLocalName, - int cchLocalName, - ISAXAttributes *pAttributes, - const _soapmapentry **ppEntry) - { - ATLENSURE_RETURN( state.pMap != NULL ); - ATLENSURE_RETURN( ppEntry != NULL ); - - *ppEntry = NULL; - const _soapmapentry *pEntries = state.pMap->pEntries; - DWORD dwIncludeFlags; - DWORD dwExcludeFlags; - - HRESULT hr = CheckID(wszNamespaceUri, wszLocalName, cchLocalName, pAttributes); - if (hr != S_FALSE) - { - if (hr == S_OK) - { - hr = S_FALSE; - } - return hr; - } - - if (m_bClient != false) - { - dwIncludeFlags = SOAPFLAG_OUT; - dwExcludeFlags = SOAPFLAG_IN; - } - else - { - dwIncludeFlags = SOAPFLAG_IN; - dwExcludeFlags = SOAPFLAG_OUT; - } - - ULONG nHash = AtlSoapHashStr(wszLocalName, cchLocalName); - - for (size_t i=0; pEntries[i].nHash != 0; i++) - { - if (nHash == pEntries[i].nHash && - ((pEntries[i].dwFlags & dwIncludeFlags) || - ((pEntries[i].dwFlags & dwExcludeFlags) == 0)) && - IsEqualElement(pEntries[i].cchField, pEntries[i].wszField, - cchLocalName, wszLocalName)/* && - !wcscmp(wszNamespaceUri, wszNamespace)*/) - { - // check bit vector - - if (state.vec.GetBit(i) == false) - { - if (state.vec.SetBit(i) == false) - { - return E_OUTOFMEMORY; - } - } - else - { - // already received this element - ATLTRACE( _T("ATLSOAP: CSoapRootHandler::GetElementEntry -- duplicate element was sent.\r\n" ) ); - - return E_FAIL; - } - - state.nElement++; - *ppEntry = &pEntries[i]; - - return S_OK; - } - } - - ATLTRACE( _T("ATLSOAP: CSoapRootHandler::GetElementEntry -- element not found: %.*ws.\r\n" ), cchLocalName, wszLocalName ); - - return E_FAIL; - } - - HRESULT CheckMustUnderstandHeader(ISAXAttributes *pAttributes) - { - ATLASSERT( pAttributes != NULL ); - - const wchar_t* wszMustUnderstand; - int cchMustUnderstand; - bool bMustUnderstand= false; - - if (SUCCEEDED(GetAttribute(pAttributes, L"mustUnderstand", sizeof("mustUnderstand")-1, - &wszMustUnderstand, &cchMustUnderstand, - SOAPENV_NAMESPACEW, sizeof(SOAPENV_NAMESPACEA)-1)) && - (wszMustUnderstand != NULL)) - { - if (FAILED(AtlGetSAXValue(&bMustUnderstand, wszMustUnderstand, cchMustUnderstand))) - { - bMustUnderstand = true; - } - } - - if (bMustUnderstand == false) - { - ATLASSERT( GetReader() != NULL ); - - m_skipHandler.SetReader(GetReader()); - m_skipHandler.SetParent(this); - - return GetReader()->putContentHandler( &m_skipHandler ); - } - else - { - SoapFault(SOAP_E_MUST_UNDERSTAND, NULL, 0); - } - - ATLTRACE( _T("ATLSOAP: CSoapRootHandler::CheckMustUnderstandHeader -- unknown \"mustUnderstand\" SOAP Header was received.\r\n" ) ); - - return E_FAIL; - } - - HRESULT AllocateArray( - const _soapmapentry *pEntry, - void **ppArr, size_t nElements, - size_t nCurrElements = 0) - { - ATLENSURE_RETURN( ppArr != NULL ); - ATLENSURE_RETURN( pEntry != NULL ); - - size_t nElementSize; - if (pEntry->nVal != SOAPTYPE_UNK) - { - nElementSize = AtlSoapGetElementSize((SOAPTYPES) pEntry->nVal); - } - else // UDT - { - ATLENSURE_RETURN( pEntry->pChain != NULL ); - nElementSize = pEntry->pChain->nElementSize; - } - if (nElementSize != 0) - { - if (*ppArr == NULL) - { - ATLASSERT( nCurrElements == 0 ); - size_t nBytes=0; - HRESULT hr=S_OK; - if( FAILED(hr=::ATL::AtlMultiply(&nBytes, nElementSize, nElements))) - { - return hr; - } - *ppArr = m_pMemMgr->Allocate(nBytes); - } - else // *ppArr != NULL - { - ATLASSERT( nCurrElements != 0 ); - size_t nBytes=0; - HRESULT hr=S_OK; - if( FAILED(hr=::ATL::AtlAdd(&nBytes, nElements, nCurrElements)) || - FAILED(hr=::ATL::AtlMultiply(&nBytes, nElementSize, nBytes))) - { - return hr; - } - *ppArr = m_pMemMgr->Reallocate(*ppArr, nBytes); - } - } - else - { - // internal error - ATLASSERT( FALSE ); - return E_FAIL; - } - - if (*ppArr == NULL) - { - return E_OUTOFMEMORY; - } - - memset(((unsigned char *)(*ppArr))+(nCurrElements*nElementSize), 0x00, nElements*nElementSize); - - return S_OK; - } - - HRESULT GetSection5Info( - const ParseState& state, - const _soapmapentry *pEntry, - ISAXAttributes *pAttributes) - { - ATLENSURE_RETURN( pEntry != NULL ); - ATLENSURE_RETURN( pAttributes != NULL ); - - HRESULT hr; - if (IsRpcEncoded() != false) - { - // check for href - // we ONLY do this for rpc/encoded (required for interop) - // NOTE: ATL Server does not support object graphs, so - // only single-reference elements are allowed - hr = CheckHref(pEntry, state.pvElement, pAttributes, - pEntry->dwFlags, SOAPFLAG_READYSTATE); - if (hr != S_FALSE) - { - return hr; - } - } - - size_t nElements; - DWORD dwFlags = 0; - hr = AtlSoapGetArraySize(pAttributes, &nElements); - if (FAILED(hr)) - { - return hr; - } - - size_t nAllocSize = 0; - size_t nElementsPush = 0; - - if (pEntry->dwFlags & SOAPFLAG_DYNARR) - { - // set size_is value - ATLENSURE_RETURN( state.pMap != NULL ); - int *pnSizeIs = (int *)(((unsigned char *)state.pvElement)+ - (state.pMap->pEntries[pEntry->nSizeIs].nOffset)); - - if (hr != S_OK) - { - if (IsRpcEncoded()) - { - // rpc/encoded requires soapenc:arrayType attribute - return E_FAIL; - } - - nElements = ATLSOAP_GROWARRAY; - nAllocSize = ATLSOAP_GROWARRAY; - dwFlags |= SOAPFLAG_UNKSIZE; - *pnSizeIs = 0; - } - else - { - *pnSizeIs = (int)nElements; - if (nElements == 0) - { - // soapenc:arrayType="type[0]" - // treat as null array - - m_bNullCheck = true; - - // push an emtpy state - return PushState(); - } - - nElementsPush = nElements; - } - void *p = NULL; - hr = AllocateArray(pEntry, &p, nElements); - if (hr != S_OK) - { - return hr; - } - - SetOffsetValue(state.pvElement, p, pEntry->nOffset); - } - else - { - // for fixed-size arrays, we know the number of elements - ATLASSERT( pEntry->dwFlags & SOAPFLAG_FIXEDARR ); - if (hr == S_OK) - { - if (nElements != AtlSoapGetArrayDims(pEntry->pDims)) - { - return E_FAIL; - } - } - else - { - hr = S_OK; - nElements = AtlSoapGetArrayDims(pEntry->pDims); - } - nElementsPush = nElements; - } - - dwFlags |= pEntry->dwFlags; - - // push element with array flag - - if (S_OK != PushState(((unsigned char *)state.pvElement)+pEntry->nOffset, - state.pMap, pEntry, dwFlags & ~SOAPFLAG_READYSTATE, nAllocSize, nElementsPush)) - { - return E_OUTOFMEMORY; - } - - m_bChildCheck = true; - - return S_OK; - } - - void * UpdateArray(ParseState& state, const _soapmapentry *pEntry) - { - ATLENSURE(pEntry); - - size_t nSize; - void *pVal = NULL; - - if (pEntry->nVal != SOAPTYPE_UNK) - { - nSize = AtlSoapGetElementSize((SOAPTYPES) pEntry->nVal); - } - else - { - ATLENSURE( pEntry->pChain != NULL ); - - nSize = pEntry->pChain->nElementSize; - } - - if (state.dwFlags & SOAPFLAG_FIXEDARR) - { - unsigned char *ppArr = (unsigned char *)state.pvElement; - pVal = ppArr+(state.nElement*nSize); - } - else - { - ATLASSERT( state.dwFlags & SOAPFLAG_DYNARR ); - - unsigned char **ppArr = (unsigned char **)state.pvElement; - pVal = (*ppArr)+(state.nElement*nSize); - if (state.dwFlags & SOAPFLAG_UNKSIZE) - { - ATLASSERT( IsRpcEncoded() == false ); - - // need to use the previous state's pvElement to update the size_is value - ATLASSUME( m_nState > 0 ); - int *pnSizeIs = (int *)(((unsigned char *)m_stateStack[m_nState-1].pvElement)+ - (state.pMap->pEntries[pEntry->nSizeIs].nOffset)); - - // update size_is parameter - *pnSizeIs = (int)(state.nElement+1); - state.nExpectedElements++; - } - } - state.nElement++; - - return pVal; - } - - HRESULT ProcessString(const _soapmapentry *pEntry, void *pVal) - { - ATLENSURE_RETURN( pEntry != NULL ); - - // set to the string builder class - - ATLASSERT( GetReader() != NULL ); - - m_stringBuilder.SetReader(GetReader()); - m_stringBuilder.SetParent(this); - - m_stringBuilder.Clear(); - GetReader()->putContentHandler( &m_stringBuilder ); - - if (S_OK != PushState(pVal, NULL, pEntry, SOAPFLAG_READYSTATE | pEntry->dwFlags)) - { - return E_OUTOFMEMORY; - } - - return S_OK; - } - - - HRESULT CheckHref( - const _soapmapentry *pEntry, - void *pVal, - ISAXAttributes *pAttributes, - DWORD dwIncludeFlags = 0, - DWORD dwExcludeFlags = 0) - { - ATLASSERT( pEntry != NULL ); - ATLASSERT( pVal != NULL ); - ATLASSERT( pAttributes != NULL ); - - const wchar_t *wsz = NULL; - int cch = 0; - - HRESULT hr = GetAttribute(pAttributes, L"href", sizeof("href")-1, &wsz, &cch); - if ((hr == S_OK) && (wsz != NULL)) - { - // only allow hrefs on structs and arrays - if (((pEntry->dwFlags & (SOAPFLAG_FIXEDARR | SOAPFLAG_DYNARR))==0) && - (pEntry->pChain == NULL || pEntry->pChain->mapType != SOAPMAP_STRUCT)) - { - ATLTRACE( _T("ATL Server only allows href's on arrays and structs.\r\n") ); - - return E_FAIL; - } - - ATLASSERT( IsRpcEncoded() == true ); - - _ATLTRY - { - if (*wsz == L'#') - { - wsz++; - cch--; - } - - REFSTRING strRef(wsz, cch); - if (m_refMap.Lookup(strRef) != NULL) - { - // ATL Server does not support multi-reference objects - ATLASSERT( FALSE ); - return E_FAIL; - } - - ParseState& currState = GetState(); - if ((currState.pEntry != NULL) && (currState.pEntry->dwFlags & (SOAPFLAG_FIXEDARR | SOAPFLAG_DYNARR))) - { - // it is an array item - ATLASSERT( currState.nElement != 0 ); - - // exclude array flags for href'd array elements - dwExcludeFlags |= SOAPFLAG_FIXEDARR | SOAPFLAG_DYNARR; - } - - ParseState state; - state.pvElement = pVal; - state.dwFlags = (pEntry->dwFlags | dwIncludeFlags) & ~dwExcludeFlags; - state.nExpectedElements = 0; - - state.nElement = 0; - state.pMap = GetState().pMap; - state.pEntry = pEntry; - - if (!m_refMap.SetAt(strRef, state)) - { - ATLTRACE( _T("ATLSOAP: CSoapRootHandler::CheckHref -- out of memory.\r\n" ) ); - - return E_OUTOFMEMORY; - } - - // make sure there are no child elements - m_bNullCheck = true; - - // push an emtpy state - return PushState(); - } - _ATLCATCHALL() - { - ATLTRACE( _T("ATLSOAP: CSoapRootHandler::CheckHref -- out of memory.\r\n" ) ); - - return E_OUTOFMEMORY; - } - } - - return S_FALSE; - } - - HRESULT ProcessUDT( - const _soapmapentry *pEntry, - void *pVal) - { - ATLENSURE_RETURN( pEntry != NULL ); - ATLENSURE_RETURN( pVal != NULL ); - ATLENSURE_RETURN( pEntry->nVal != SOAPTYPE_ERR ); - ATLENSURE_RETURN( pEntry->nVal != SOAPTYPE_USERBASE ); - - // if it is a complex type, get the chain entry - // and push the new state on the stack - - DWORD dwFlags = pEntry->dwFlags; - if (pEntry->pChain->mapType != SOAPMAP_ENUM) - { - // struct - dwFlags &= ~(SOAPFLAG_FIXEDARR | SOAPFLAG_DYNARR); - m_bChildCheck = pEntry->pChain->nElements != 0; - } - else - { - // enum - dwFlags |= SOAPFLAG_READYSTATE; - - // enums must not have child elements - m_bNullCheck = true; - - // enums must be specified - m_bCharacters = true; - } - - if (S_OK != PushState(pVal, pEntry->pChain, pEntry, dwFlags, 0, pEntry->pChain->nElements)) - { - return E_OUTOFMEMORY; - } - - return S_OK; - } - - HRESULT ChainEntry( - const ParseState& state, - const wchar_t *wszNamespaceUri, - int cchNamespaceUri, - const wchar_t *wszLocalName, - int cchLocalName, - ISAXAttributes *pAttributes) - { - ATLENSURE_RETURN( state.pMap != NULL ); - - // PAD is only supported on the client - const _soapmap *pMap = state.pMap; - if ((pMap->dwCallFlags & SOAPFLAG_CHAIN)==0) - { - return S_FALSE; - } - - ATLENSURE_RETURN( pMap->dwCallFlags & SOAPFLAG_PAD ); - ATLASSUME( m_bClient == true ); - ATLENSURE_RETURN( pMap->nElements == 1 ); - const _soapmapentry *pEntries = pMap->pEntries; - ATLENSURE_RETURN( pEntries != NULL ); - - int nIndex; - if (pEntries[0].dwFlags & SOAPFLAG_OUT) - { - nIndex = 0; - } - else - { - nIndex = 1; - } - - const _soapmapentry *pEntry = &pEntries[nIndex]; - ATLENSURE_RETURN( pEntry->nHash != 0 ); - ATLENSURE_RETURN( pEntry->pChain != NULL ); - - if (S_OK != PushState(state.pvElement, pEntry->pChain, pEntry, pEntry->dwFlags, 0, pEntry->pChain->nElements)) - { - return E_OUTOFMEMORY; - } - - return ProcessParams(wszNamespaceUri, cchNamespaceUri, wszLocalName, cchLocalName, pAttributes); - } - - HRESULT IsNullEntry(const _soapmapentry *pEntry, ISAXAttributes *pAttributes) - { - ATLASSERT( pEntry != NULL ); - ATLASSERT( pAttributes != NULL ); - - HRESULT hr = E_FAIL; - bool bNull = false; - const wchar_t *wszNull = NULL; - int cchNull = 0; - hr = GetAttribute(pAttributes, L"nil", sizeof("nil")-1, &wszNull, &cchNull, - XSI_NAMESPACEW, sizeof(XSI_NAMESPACEA)-1); - if ((hr == S_OK) && (wszNull != NULL)) - { - hr = AtlGetSAXValue(&bNull, wszNull, cchNull); - if (hr == S_OK) - { - if (bNull != false) - { - if (pEntry->dwFlags & SOAPFLAG_NULLABLE) - { - m_bNullCheck = true; - - // push an emtpy state - return PushState(); - } - - // non-nullable element - return E_FAIL; - } - } - } - - return S_FALSE; - } - - HRESULT ProcessParams( - const wchar_t *wszNamespaceUri, - int cchNamespaceUri, - const wchar_t *wszLocalName, - int cchLocalName, - ISAXAttributes *pAttributes) - { - (wszNamespaceUri); - (cchNamespaceUri); - - if (m_stateStack.IsEmpty()) - { - if (m_dwState == SOAP_HEADERS) - { - return CheckMustUnderstandHeader(pAttributes); - } - - return E_FAIL; - } - - ParseState &state = GetState(); - - ATLASSERT( state.pvElement != NULL ); - HRESULT hr = E_FAIL; - const _soapmapentry *pEntry = NULL; - - // if array element - if (state.dwFlags & (SOAPFLAG_FIXEDARR | SOAPFLAG_DYNARR)) - { - hr = ValidateArrayEntry(state, wszLocalName, cchLocalName); - - if (SUCCEEDED(hr)) - { - pEntry = state.pEntry; - } - else - { - return hr; - } - } - else // not an array element - { - // special-case for PAD with type= - hr = ChainEntry(state, wszNamespaceUri, cchNamespaceUri, - wszLocalName, cchLocalName, pAttributes); - - if (hr == S_FALSE) - { - hr = GetElementEntry(state, wszNamespaceUri, wszLocalName, cchLocalName, pAttributes, &pEntry); - if (hr != S_OK) - { - if (hr == S_FALSE) - { - hr = S_OK; - } - else if (m_dwState == SOAP_HEADERS) - { - hr = CheckMustUnderstandHeader(pAttributes); - } - return hr; - } - - ATLASSERT( pEntry != NULL ); - } - else - { - return hr; - } - } - - hr = IsNullEntry(pEntry, pAttributes); - if (hr != S_FALSE) - { - return hr; - } - hr = S_OK; - ATLENSURE_RETURN(pEntry); - // if is array - if (((pEntry->pDims != NULL) || (pEntry->dwFlags & (SOAPFLAG_FIXEDARR | SOAPFLAG_DYNARR))) && - ((state.dwFlags & (SOAPFLAG_FIXEDARR | SOAPFLAG_DYNARR)) == 0)) - { - // get SOAP section-5 info (if it is there) - return GetSection5Info(state, pEntry, pAttributes); - } - else - { - // if it is a simple type, push a new (ready) state on the stack - void *pVal; - if (state.dwFlags & (SOAPFLAG_FIXEDARR | SOAPFLAG_DYNARR)) - { - pVal = UpdateArray(state, pEntry); - ATLASSERT( pVal != NULL ); - } - else - { - pVal = (((unsigned char *)state.pvElement)+pEntry->nOffset); - } - - if (IsRpcEncoded() != false) - { - // check for href - // we ONLY do this for rpc/encoded (required for interop) - // NOTE: ATL Server does not support object graphs, so - // only single-reference elements are allowed - hr = CheckHref(pEntry, pVal, pAttributes); - if (hr != S_FALSE) - { - return hr; - } - hr = S_OK; - } - - if (pEntry->nVal != SOAPTYPE_UNK) - { - // simple types should not have child elements - m_bNullCheck = true; - - // if it is a string - if ((pEntry->nVal == SOAPTYPE_STRING) || (pEntry->nVal == SOAPTYPE_BASE64BINARY)) - { - hr = ProcessString(pEntry, pVal); - } - else - { - // expect characters for all non-string simple types - m_bCharacters = true; - - // basic simple type - if (S_OK != PushState(pVal, NULL, pEntry, SOAPFLAG_READYSTATE | pEntry->dwFlags)) - { - hr = E_OUTOFMEMORY; - } - } - } - else - { - hr = ProcessUDT(pEntry, pVal); - if (pEntry->dwFlags & (SOAPFLAG_DYNARRWRAPPER)) - { - // We're moving to the **first** entry in the dynamic array wrapper. - // We know it is the first entry because the dynamic array wrapper is created - // by sproxy and it guarantees this layouts. - ++m_nDepth; - ProcessParams (wszNamespaceUri, cchNamespaceUri, pEntry->pChain->pEntries[0].wszField, - pEntry->pChain->pEntries[0].cchField, pAttributes); - } - } - } - - return hr; - } - - size_t GetSizeIsValue(void *pvParam, const _soapmap *pMap, const _soapmapentry *pEntry) - { - ATLENSURE( pvParam != NULL ); - ATLENSURE( pMap != NULL ); - ATLENSURE( pEntry != NULL ); - - int nSizeIs = pEntry->nSizeIs; - size_t nOffset = pMap->pEntries[nSizeIs].nOffset; - void *pVal = ((unsigned char *)pvParam)+nOffset; - - __int64 nVal = 0; - switch(pMap->pEntries[nSizeIs].nVal) - { - case SOAPTYPE_INTEGER: - case SOAPTYPE_NONPOSITIVEINTEGER: - case SOAPTYPE_NEGATIVEINTEGER: - case SOAPTYPE_LONG: - nVal = *((__int64 *)pVal); - break; - case SOAPTYPE_INT: - nVal = *((int *)pVal); - break; - case SOAPTYPE_SHORT: - nVal = *((short *)pVal); - break; - case SOAPTYPE_BYTE: - nVal = *((char *)pVal); - break; - case SOAPTYPE_POSITIVEINTEGER: - case SOAPTYPE_NONNEGATIVEINTEGER: - case SOAPTYPE_UNSIGNEDLONG: - unsigned __int64 n; - n = *((unsigned __int64 *)pVal); - if (n > _I64_MAX) - { - // come on ... - nVal = 0; - } - else - { - nVal = (__int64)n; - } - break; - case SOAPTYPE_UNSIGNEDINT: - nVal = *((unsigned int *)pVal); - break; - case SOAPTYPE_UNSIGNEDSHORT: - nVal = *((unsigned short *)pVal); - break; - case SOAPTYPE_UNSIGNEDBYTE: - nVal = *((unsigned char *)pVal); - break; - default: - nVal = 0; - } - - if (nVal < 0) - { - nVal = 0; - } - - return (size_t) nVal; - } - - HRESULT GenerateArrayInfo(const _soapmapentry *pEntry, const int *pDims, IWriteStream *pStream) - { - ATLENSURE_RETURN( pEntry != NULL ); - ATLENSURE_RETURN( pStream != NULL ); - - HRESULT hr = S_OK; - if (pEntry->nVal != SOAPTYPE_UNK) - { - // xsd type - hr = pStream->WriteStream(" soapenc:arrayType=\"xsd:", - sizeof(" soapenc:arrayType=\"xsd:")-1, NULL); - } - else - { - ATLENSURE_RETURN( pEntry->pChain != NULL ); - - hr = pStream->WriteStream(" xmlns:q1=\"", sizeof(" xmlns:q1=\"")-1, NULL); - if (SUCCEEDED(hr)) - { - if (pEntry->pChain->szNamespace != NULL) - { - hr = pStream->WriteStream(pEntry->pChain->szNamespace, pEntry->pChain->cchNamespace, NULL); - } - else - { - hr = pStream->WriteStream(GetNamespaceUriA(), -1, NULL); - } - if (SUCCEEDED(hr)) - { - hr = pStream->WriteStream("\"", 1, NULL); - if (SUCCEEDED(hr)) - { - hr = pStream->WriteStream(" soapenc:arrayType=\"q1:", - sizeof(" soapenc:arrayType=\"q1:")-1, NULL); - } - } - } - } - - if (FAILED(hr)) - { - return hr; - } - - if (pEntry->nVal != SOAPTYPE_UNK) - { - hr = pStream->WriteStream(s_xsdNames[pEntry->nVal].szName , - s_xsdNames[pEntry->nVal].cchName, NULL); - } - else - { - ATLASSERT( pEntry->pChain != NULL ); - - hr = pStream->WriteStream(pEntry->pChain->szName, pEntry->pChain->cchName, NULL); - } - - if (FAILED(hr)) - { - return hr; - } - - hr = pStream->WriteStream("[", 1, NULL); - if (FAILED(hr)) - { - return hr; - } - - CWriteStreamHelper s( pStream ); - for (int i=1; i<=pDims[0]; i++) - { - if (!s.Write(pDims[i]) || - ((i < pDims[0]) && (S_OK != pStream->WriteStream(", ", 2, NULL)))) - { - return E_FAIL; - } - } - - hr = pStream->WriteStream("]\"", 2, NULL); - if (FAILED(hr)) - { - return hr; - } - - return S_OK; - } - - HRESULT GenerateXSDWrapper(bool bStart, int nVal, bool bNull, IWriteStream *pStream) - { - ATLENSURE_RETURN( pStream != NULL ); - - HRESULT hr = pStream->WriteStream((bStart != false) ? "<" : "WriteStream(s_xsdNames[nVal].szName, - s_xsdNames[nVal].cchName, NULL); - if ((bNull != false) && (SUCCEEDED(hr))) - { - hr = pStream->WriteStream(" xsi:nil=\"1\"", sizeof(" xsi:nil=\"1\"")-1, NULL); - } - if (SUCCEEDED(hr)) - { - hr = pStream->WriteStream(">", 1, NULL); - } - } - - return hr; - } - - HRESULT GenerateGenericWrapper(bool bStart, const _soapmap *pMap, IWriteStream *pStream) - { - ATLENSURE_RETURN( pStream != NULL ); - ATLENSURE_RETURN( pMap != NULL ); - - HRESULT hr = pStream->WriteStream((bStart != false) ? "<" : "WriteStream(pMap->szName, pMap->cchName, NULL); - if (SUCCEEDED(hr)) - { - hr = pStream->WriteStream(">", 1, NULL); - } - } - - return hr; - } - - HRESULT GetArrayInformation( - IWriteStream *pStream, - const _soapmap *pMap, - const _soapmapentry *pEntry, - void *pvParam, - size_t &nCnt, - size_t &nElementSize) - { - ATLENSURE_RETURN( pStream != NULL ); - ATLENSURE_RETURN( pMap != NULL ); - ATLENSURE_RETURN( pEntry != NULL ); - ATLENSURE_RETURN( pvParam != NULL ); - - const int *pDims = NULL; - int arrDims[2] = { 0 }; - - if (pEntry->dwFlags & SOAPFLAG_FIXEDARR) - { - pDims = pEntry->pDims; - } - else - { - ATLASSERT( pEntry->dwFlags & SOAPFLAG_DYNARR ); - nCnt = GetSizeIsValue(pvParam, pMap, pEntry); - - if (nCnt == 0) - { - // array size should only be zero if array is NULL - // did you forget to set the array size? - ATLASSERT( FALSE ); - return E_FAIL; - } - - arrDims[0] = 1; - arrDims[1] = (int) nCnt; - - pDims = arrDims; - } - - // output array information - HRESULT hr = GenerateArrayInfo(pEntry, pDims, pStream); - if (FAILED(hr)) - { - return hr; - } - if (SUCCEEDED(hr)) - { - nCnt = AtlSoapGetArrayDims(pDims); - - // did you forget to set the size_is value? - ATLASSERT( nCnt != 0 ); - - if (pEntry->nVal != SOAPTYPE_UNK) - { - nElementSize = AtlSoapGetElementSize((SOAPTYPES) pEntry->nVal); - } - else - { - ATLENSURE_RETURN( pEntry->pChain != NULL ); - - nElementSize = pEntry->pChain->nElementSize; - } - } - - return hr; - } - - HRESULT GenerateEnum(IWriteStream *pStream, void *pVal, const _soapmapentry *pEntry, bool bArray) - { - ATLENSURE_RETURN( pStream != NULL ); - ATLENSURE_RETURN( pVal != NULL ); - ATLENSURE_RETURN( pEntry != NULL ); - - int nVal = *((int *)pVal); - const _soapmapentry *pEnumEntries = pEntry->pChain->pEntries; - - ATLENSURE_RETURN( pEnumEntries != NULL ); - size_t j; - HRESULT hr = E_FAIL; - for (j=0; pEnumEntries[j].nHash != 0; j++) - { - if (nVal == pEnumEntries[j].nVal) - { - hr = pStream->WriteStream(pEnumEntries[j].szField, pEnumEntries[j].cchField, NULL); - if ((bArray != false) && (SUCCEEDED(hr))) - { - hr = GenerateGenericWrapper(false, pEntry->pChain, pStream); - } - break; - } - } - - return hr; - } - - HRESULT GenerateHeaders(CResponseGenerator *pGenerator, const _soapmap *pMap, IWriteStream *pStream) - { - ATLENSURE_RETURN( pStream != NULL ); - ATLENSURE_RETURN( pMap != NULL ); - - ATLENSURE_RETURN( pGenerator != NULL ); - - DWORD dwIncludeFlags = SOAPFLAG_OUT; - if (m_bClient != false) - { - dwIncludeFlags = SOAPFLAG_IN; - } - - size_t nCnt = 0; - for (size_t i=0; pMap->pEntries[i].nHash != 0; i++) - { - if (pMap->pEntries[i].dwFlags & dwIncludeFlags) - { - nCnt++; - } - } - - // no headers to be sent - if (nCnt == 0) - { - return S_OK; - } - - HRESULT hr = pGenerator->StartHeaders(pStream, pMap); - if (SUCCEEDED(hr)) - { - hr = GenerateResponseHelper(pGenerator, pMap, GetHeaderValue(), pStream); - if (SUCCEEDED(hr)) - { - hr = pGenerator->EndHeaders(pStream); - } - } - - return hr; - } - - bool IsNullElement(const _soapmapentry *pEntry, void *pVal, DWORD dwExcludeFlags=0) - { - ATLENSURE( pEntry != NULL ); - ATLENSURE( pVal != NULL ); - - bool bNull = false; - - DWORD dwFlags = pEntry->dwFlags & ~dwExcludeFlags; - - if (dwFlags & SOAPFLAG_DYNARR) - { - unsigned char **ppArr = (unsigned char **)pVal; - if (*ppArr == NULL) - { - bNull = true; - } - } - else if (pEntry->nVal == SOAPTYPE_STRING) - { - BSTR *pBSTR = (BSTR *)pVal; - if (*pBSTR == NULL) - { - bNull = true; - } - } - else if ((pEntry->nVal == SOAPTYPE_BASE64BINARY) || (pEntry->nVal == SOAPTYPE_HEXBINARY)) - { - if (((ATLSOAP_BLOB *)pVal)->data == NULL) - { - bNull = true; - } - } - - return bNull; - } - - HRESULT GenerateNull(IWriteStream *pStream) - { - ATLENSURE_RETURN( pStream != NULL ); - return pStream->WriteStream(" xsi:nil=\"1\"/>", sizeof(" xsi:nil=\"1\"/>")-1, NULL); - } - - HRESULT GenerateResponseHelper(CResponseGenerator *pGenerator, const _soapmap *pMap, void *pvParam, IWriteStream *pStream, - bool bArrayElement = false) - { - ATLENSURE_RETURN( pGenerator != NULL ); - ATLENSURE_RETURN( pMap != NULL ); - ATLENSURE_RETURN( pStream != NULL ); - - HRESULT hr = S_OK; - - if ((bArrayElement != false) && - ((pMap->dwCallFlags & SOAPFLAG_PAD)==0)) - { - hr = pGenerator->StartMap(pStream, pMap, m_bClient); - if (FAILED(hr)) - { - return hr; - } - } - - ATLENSURE_RETURN( pMap->pEntries != NULL ); - - const _soapmapentry *pEntries = pMap->pEntries; - size_t i; - - DWORD dwIncludeFlags; - DWORD dwExcludeFlags; - if (m_bClient != false) - { - dwIncludeFlags = SOAPFLAG_IN; - dwExcludeFlags = SOAPFLAG_OUT; - } - else - { - dwIncludeFlags = SOAPFLAG_OUT; - dwExcludeFlags = SOAPFLAG_IN; - } - - for (i=0; pEntries[i].nHash != 0; i++) - { - if (((pEntries[i].dwFlags & dwIncludeFlags) || - ((pEntries[i].dwFlags & dwExcludeFlags)==0)) && - ((pEntries[i].dwFlags & SOAPFLAG_NOMARSHAL)==0)) - { - hr = pGenerator->StartEntry(pStream, pMap, &pEntries[i]); - if (FAILED(hr)) - { - return hr; - } - - size_t nElementSize = 0; - size_t nCnt = 1; - - ATLASSERT( pvParam != NULL ); - - void *pvCurrent = ((unsigned char *)pvParam)+pEntries[i].nOffset; - - if (IsNullElement(&pEntries[i], pvCurrent)) - { - hr = GenerateNull(pStream); - if (SUCCEEDED(hr)) - { - continue; - } - return hr; - } - - bool bArray = (pEntries[i].dwFlags & (SOAPFLAG_FIXEDARR | SOAPFLAG_DYNARR)) != 0; - if (bArray != false) - { - hr = GetArrayInformation(pStream, pMap, &pEntries[i], pvParam, nCnt, nElementSize); - } - - hr = pStream->WriteStream(">", 1, NULL); - if (FAILED(hr)) - { - return hr; - } - - for (size_t nElement=0; nElementmapType != SOAPMAP_ENUM) - { - // struct - hr = GenerateResponseHelper(pGenerator, pEntries[i].pChain, pVal, pStream, bArray); - } - else - { - if (bArray != false) - { - hr = GenerateGenericWrapper(true, pEntries[i].pChain, pStream); - if (FAILED(hr)) - { - return hr; - } - } - - hr = GenerateEnum(pStream, pVal, &pEntries[i], bArray); - } - } - } - - // output element close - if (SUCCEEDED(hr)) - { - hr = pGenerator->EndEntry(pStream, pMap, &pEntries[i]); - } - } - - if (FAILED(hr)) - { - return hr; - } - } - - if ((bArrayElement != false) && - ((pMap->dwCallFlags & SOAPFLAG_PAD)==0)) - { - // output type name - hr = pGenerator->EndMap(pStream, pMap, m_bClient); - } - - return hr; - } - - void CleanupHelper(const _soapmap *pMap, void *pvParam) - { - ATLENSURE( pMap != NULL ); - ATLENSURE( pMap->pEntries != NULL ); - - if (pvParam == NULL) - { - return; - } - - const _soapmapentry *pEntries = pMap->pEntries; - size_t i; - - for (i=0; pEntries[i].nHash != 0; i++) - { - if ((m_bClient != false) && ((pEntries[i].dwFlags & SOAPFLAG_OUT)==0)) - { - // skip in-only headers on the client - continue; - } - - void *pvCheck = ((unsigned char *)pvParam)+pEntries[i].nOffset; - if (IsNullElement(&pEntries[i], pvCheck)) - { - continue; - } - - size_t nElementSize = 0; - size_t nCnt = 1; - - const int *pDims = NULL; - int arrDims[2] = { 0 }; - - bool bArray = (pEntries[i].dwFlags & (SOAPFLAG_FIXEDARR | SOAPFLAG_DYNARR)) != 0; - - if (bArray != false) - { - if (pEntries[i].dwFlags & SOAPFLAG_FIXEDARR) - { - pDims = pEntries[i].pDims; - } - else - { - ATLASSERT( pEntries[i].dwFlags & SOAPFLAG_DYNARR ); - nCnt = GetSizeIsValue(pvParam, pMap, &pEntries[i]); - - arrDims[0] = 1; - arrDims[1] = (int) nCnt; - - pDims = arrDims; - } - - nCnt = AtlSoapGetArrayDims(pDims); - - if (pEntries[i].nVal != SOAPTYPE_UNK) - { - nElementSize = AtlSoapGetElementSize((SOAPTYPES) pEntries[i].nVal); - } - else - { - ATLENSURE( pEntries[i].pChain != NULL ); - - nElementSize = pEntries[i].pChain->nElementSize; - } - } - - void *pvCurrent = ((unsigned char *)pvParam)+pEntries[i].nOffset; - - for (size_t nElement=0; nElementmapType != SOAPMAP_ENUM) - { - CleanupHelper(pEntries[i].pChain, pVal); - } - } - } - - if (pEntries[i].dwFlags & SOAPFLAG_DYNARR) - { - // free it - unsigned char **ppArr = (unsigned char **)pvCurrent; - - ATLENSURE( ppArr != NULL ); - - if (*ppArr != NULL) - { - m_pMemMgr->Free(*ppArr); - *ppArr = NULL; - } - } - } - } - - const _soapmap * GetSoapMapFromName( - const wchar_t * wszName, - int cchName = -1, - const wchar_t * wszNamespaceUri = NULL, - int cchNamespaceUri = -1, - int *pnVal = NULL, - bool bHeader = false) - { - (cchNamespaceUri); - - const _soapmap ** pEntry = NULL; - - if (bHeader == false) - { - pEntry = GetFunctionMap(); - } - else - { - pEntry = GetHeaderMap(); - } - - if (pEntry == NULL) - { - return NULL; - } - - if (cchName < 0) - { - cchName = (int)wcslen(wszName); - } - if ((cchNamespaceUri < 0) && (wszNamespaceUri != NULL)) - { - cchNamespaceUri = (int)wcslen(wszNamespaceUri); - } - - ULONG nFunctionHash = AtlSoapHashStr(wszName, cchName); - ULONG nNamespaceHash = wszNamespaceUri ? AtlSoapHashStr(wszNamespaceUri, cchNamespaceUri) : 0; - - int i; - for (i=0; pEntry[i] != NULL; i++) - { - if ((IsEqualStringHash(wszName, cchName, nFunctionHash, - pEntry[i]->wszName, pEntry[i]->cchWName, pEntry[i]->nHash) != FALSE) && - (!wszNamespaceUri || - IsEqualStringHash(wszNamespaceUri, cchNamespaceUri, nNamespaceHash, - pEntry[i]->wszNamespace, pEntry[i]->cchNamespace, pEntry[i]->nNamespaceHash) != FALSE)) - { - break; - } - } - - if (pnVal != NULL) - { - *pnVal = i; - } - return pEntry[i]; - } - - HRESULT CheckEndElement(const ParseState& state) - { - // check for all elements - if (state.nElement == state.nExpectedElements) - { - return S_OK; - } - - // error check for fixed arrays - if (state.dwFlags & SOAPFLAG_FIXEDARR) - { - return E_FAIL; - } - - // check for dynamic arrays - if (state.dwFlags & SOAPFLAG_DYNARR) - { - // check for dynamic arrays with known size - // (from soap:arrayType attribute) - if ((state.dwFlags & SOAPFLAG_UNKSIZE)==0) - { - return E_FAIL; - } - } - - DWORD dwIncludeFlags; - DWORD dwExcludeFlags; - - if (m_bClient != false) - { - dwIncludeFlags = SOAPFLAG_OUT; - dwExcludeFlags = SOAPFLAG_IN; - } - else - { - dwIncludeFlags = SOAPFLAG_IN; - dwExcludeFlags = SOAPFLAG_OUT; - } - - if (state.pMap != NULL) - { - // ensure all omitted elements were nullable elements or nomarshal elements - const _soapmapentry *pEntries = state.pMap->pEntries; - for (size_t i=0; pEntries[i].nHash != 0; i++) - { - if ((pEntries[i].dwFlags & dwIncludeFlags) || - ((pEntries[i].dwFlags & dwExcludeFlags)==0)) - { - if (state.vec.GetBit(i) == false) - { - if (((pEntries[i].dwFlags & (SOAPFLAG_NULLABLE | SOAPFLAG_NOMARSHAL))==0) && (pEntries[i].nVal != SOAPTYPE_UNK)) - { - ATLTRACE( _T("ATLSOAP: CSoapRootHandler::CheckEndElement -- invalid number of elements for parameter/field\r\n") ); - return E_FAIL; - } - } - } - } - } - - return S_OK; - } - - HRESULT CheckSoapHeaders(const ParseState &state) - { - DWORD dwIncludeFlags; - DWORD dwExcludeFlags; - - if (m_bClient != false) - { - dwIncludeFlags = SOAPFLAG_OUT; - dwExcludeFlags = SOAPFLAG_IN; - } - else - { - dwIncludeFlags = SOAPFLAG_IN; - dwExcludeFlags = SOAPFLAG_OUT; - } - - if (state.pMap != NULL) - { - ATLASSERT( state.pMap->mapType == SOAPMAP_HEADER ); - - // ensure all omitted elements were nullable elements, nomarshal elements, or non-required elements - const _soapmapentry *pEntries = state.pMap->pEntries; - for (size_t i=0; pEntries[i].nHash != 0; i++) - { - if ((pEntries[i].dwFlags & dwIncludeFlags) || - ((pEntries[i].dwFlags & dwExcludeFlags)==0)) - { - if (state.vec.GetBit(i) == false) - { - bool bNoOmit = (pEntries[i].dwFlags & (SOAPFLAG_NULLABLE | SOAPFLAG_NOMARSHAL))==0; - - if ((bNoOmit != false) || - ((bNoOmit != false) && (pEntries[i].dwFlags & SOAPFLAG_MUSTUNDERSTAND))) - { - ATLTRACE( _T("ATLSOAP: CSoapRootHandler::CheckSoapHeaders -- missing header\r\n") ); - return E_FAIL; - } - } - } - } - } - - return S_OK; - } - - HRESULT CheckEndHeaders( - const wchar_t * wszNamespaceUri, - int cchNamespaceUri, - const wchar_t * wszLocalName, - int cchLocalName) - { - if (IsEqualElement(sizeof(SOAP_HEADERA)-1, SOAP_HEADERW, - sizeof(SOAPENV_NAMESPACEA)-1, SOAPENV_NAMESPACEW, - cchLocalName, wszLocalName, - cchNamespaceUri, wszNamespaceUri)) - { - m_dwState = SOAP_HEADERS_DONE; - return S_OK; - } - - // some sort of error - ATLTRACE( _T("ATLSOAP: CSoapRootHandler::endElement -- invalid SOAP message format while processing headers.\r\n" ) ); - - return E_FAIL; - } - -protected: - - ISAXXMLReader * SetReader(ISAXXMLReader *pReader) - { - ISAXXMLReader *pPrevRdr = m_spReader; - m_spReader = pReader; - - return pPrevRdr; - } - - ISAXXMLReader * GetReader() - { - return m_spReader; - } - - HRESULT SetSoapMapFromName( - const wchar_t * wszName, - int cchName = -1, - const wchar_t * wszNamespaceUri = NULL, - int cchNamespaceUri = -1, - bool bHeader = false) - { - ATLENSURE_RETURN( wszName != NULL ); - - int nVal; - const _soapmap *pMap = NULL; - if (m_stateStack.GetCount() != 0) - { - ATLASSUME( m_stateStack[0].pMap != NULL ); - nVal = (int) m_stateStack[0].nAllocSize; - ATLASSERT( GetFunctionMap() != NULL ); - pMap = GetFunctionMap()[nVal]; - } - else - { - pMap = GetSoapMapFromName(wszName, cchName, - wszNamespaceUri, cchNamespaceUri, &nVal, bHeader); - } - - if (pMap == NULL) - { - ATLTRACE( _T("ATLSOAP: CSoapRootHandler::SetSoapMapFromName -- _soapmap not found for: %.*ws, with namespace %.*ws\r\n"), - (int)wcslen(wszName), wszName, wszNamespaceUri ? (int)wcslen(wszNamespaceUri) : 0, wszNamespaceUri ? wszNamespaceUri : L""); - - return E_FAIL; - } - - HRESULT hr = E_OUTOFMEMORY; - - // allocate the parameter struct - - void *pvParam = NULL; - if (bHeader != false) - { - pvParam = GetHeaderValue(); - } - else - { - if (m_bClient == false) - { - m_pvParam = m_pMemMgr->Allocate(pMap->nElementSize); - } - pvParam = m_pvParam; - } - - if (pvParam != NULL) - { - if (bHeader == false) - { - memset(pvParam, 0x00, pMap->nElementSize); - } - - // push initial state - - if (m_stateStack.GetCount() != 0) - { - m_stateStack.RemoveAll(); - } - - hr = PushState(pvParam, pMap, NULL, 0, nVal, pMap->nElements); - - if (FAILED(hr)) - { - if ((m_bClient == false) && (bHeader == false)) - { - m_pMemMgr->Free(pvParam); - } - } - } - -#ifdef _DEBUG - if (hr == E_OUTOFMEMORY) - { - ATLTRACE( _T("ATLSOAP: CSoapRootHandler::SetSoapMapFromName -- out of memory.\r\n" ) ); - } -#endif // _DEBUG - - return hr; - } - - // implementation - virtual const _soapmap ** GetFunctionMap() = 0; - virtual const _soapmap ** GetHeaderMap() = 0; - virtual const wchar_t * GetNamespaceUri() = 0; - virtual const char * GetServiceName() = 0; - virtual const char * GetNamespaceUriA() = 0; - virtual HRESULT CallFunction( - void *pvParam, - const wchar_t *wszLocalName, int cchLocalName, - size_t nItem) = 0; - virtual void * GetHeaderValue() = 0; - -public: - - CSoapRootHandler(ISAXXMLReader *pReader = NULL) - : m_pMemMgr(&m_crtHeap), m_spReader(pReader), m_bClient(false), - m_nState(0), m_pvParam(NULL), m_nDepth(0) - { - InitHandlerState(); - } - virtual ~CSoapRootHandler() - { - m_skipHandler.DetachParent(); - } - - IAtlMemMgr * SetMemMgr(IAtlMemMgr *pMemMgr) - { - IAtlMemMgr *pPrevMgr = m_pMemMgr; - m_pMemMgr = pMemMgr; - - return pPrevMgr; - } - - IAtlMemMgr * GetMemMgr() - { - return m_pMemMgr; - } - - // override this function to do SOAP Fault handling - virtual HRESULT SoapFault( - SOAP_ERROR_CODE /*errCode*/, - const wchar_t * /*wszDetail*/, - int /*cchDetail*/) - { - if (m_bClient != false) - { - return S_OK; - } - - // SOAP servers must implement this function - ATLASSERT( FALSE ); - return E_FAIL; - } - - // - // implementation - // - - void InitHandlerState() - { - m_bNullCheck = false; - m_bCharacters = false; - m_bChildCheck = false; - m_dwState = SOAP_START; - } - HRESULT __stdcall startDocument() - { - InitHandlerState(); - return S_OK; - } - - HRESULT __stdcall startElement( - const wchar_t *wszNamespaceUri, - int cchNamespaceUri, - const wchar_t *wszLocalName, - int cchLocalName, - const wchar_t * wszQName, - int cchQName, - ISAXAttributes *pAttributes) - { - if (m_bNullCheck || m_bCharacters) - { - // make sure elements that aren't supposed to have child elements - // do not have child elements, and where we were expecting - // characters, we got them - return E_FAIL; - } - - m_bChildCheck = false; - ++m_nDepth; - - HRESULT hr = S_OK; - switch (m_dwState) - { - case SOAP_PARAMS: case SOAP_HEADERS: - { - hr = ProcessParams(wszNamespaceUri, cchNamespaceUri, wszLocalName, - cchLocalName, pAttributes); - - break; - } - case SOAP_START: case SOAP_ENVELOPE: case SOAP_HEADERS_DONE: - { - ULONG nNamespaceHash = AtlSoapHashStr(wszNamespaceUri, - cchNamespaceUri); - if (nNamespaceHash != SOAP_ENV) - { - ATLTRACE( _T("ATLSOAP: CSoapRootHandler::startElement -- incorrect SOAP-ENV namespace.\r\n" ) ); - - return E_FAIL; - } - - ULONG nElementHash = AtlSoapHashStr(wszLocalName, cchLocalName); - - if (nElementHash == ENVELOPE && - IsEqualElement( - sizeof(SOAP_ENVELOPEA)-1, SOAP_ENVELOPEW, - sizeof(SOAPENV_NAMESPACEA)-1, SOAPENV_NAMESPACEW, - cchLocalName, wszLocalName, - cchNamespaceUri, wszNamespaceUri)) - { - // Envelope must be first element in package - - if (m_dwState != SOAP_START) - { - ATLTRACE( _T("ATLSOAP: CSoapRootHandler::startElement -- invalid SOAP message format: \"Envelope\" in unexpected location.\r\n" ) ); - - hr = E_FAIL; - } - m_dwState = SOAP_ENVELOPE; - } - else if (nElementHash == HEADER && - IsEqualElement(sizeof(SOAP_HEADERA)-1, SOAP_HEADERW, - sizeof(SOAPENV_NAMESPACEA)-1, SOAPENV_NAMESPACEW, - cchLocalName, wszLocalName, - cchNamespaceUri, wszNamespaceUri)) - { - if (m_dwState != SOAP_ENVELOPE) - { - ATLTRACE( _T("ATLSOAP: CSoapRootHandler::startElement -- invalid SOAP message format: \"Headers\" in unexpected location.\r\n" ) ); - - hr = E_FAIL; - } - - m_dwState = SOAP_HEADERS; - } - else if (nElementHash == BODY && - IsEqualElement(sizeof(SOAP_BODYA)-1, SOAP_BODYW, - sizeof(SOAPENV_NAMESPACEA)-1, SOAPENV_NAMESPACEW, - cchLocalName, wszLocalName, - cchNamespaceUri, wszNamespaceUri)) - { - if (m_dwState == SOAP_START) - { - ATLTRACE( _T("ATLSOAP: CSoapRootHandler::startElement -- invalid SOAP message format: \"Body\" in unexpected location.\r\n" ) ); - - hr = E_FAIL; - } - m_dwState = SOAP_BODY; - } - - break; - } - case SOAP_BODY: - { - hr = DispatchSoapCall(wszNamespaceUri, cchNamespaceUri, - wszLocalName, cchLocalName); - - m_dwState = SOAP_PARAMS; - - if (SUCCEEDED(hr)) - { - if (GetState().pMap->dwCallFlags & SOAPFLAG_PAD) - { - hr = startElement(wszNamespaceUri, cchNamespaceUri, - wszLocalName, cchLocalName, wszQName, cchQName, - pAttributes); - } - } - - break; - } - -#ifdef _DEBUG - - default: - { - // should never get here -- internal error - ATLASSERT( FALSE ); - } - -#endif // _DEBUG - } - - return hr; - } - - HRESULT __stdcall characters( - const wchar_t *wszChars, - int cchChars) - { - m_bCharacters = false; - - // if it is a ready state, get the value - if (m_stateStack.IsEmpty() == false) - { - ParseState& state = GetState(); - if ((state.dwFlags & SOAPFLAG_READYSTATE) && - ((state.dwFlags & SOAPFLAG_SIZEIS)==0)) // don't marshal struct size_is elements -- should be filled in by array marshaling code - { - if ((state.pMap == NULL) || (state.pMap->mapType != SOAPMAP_ENUM)) - { - return AtlSoapGetElementValue(wszChars, cchChars, - state.pvElement, (SOAPTYPES)state.pEntry->nVal, GetMemMgr()); - } - else - { - // enum - - ATLASSERT( state.pMap != NULL ); - ATLASSERT( state.pMap->pEntries != NULL ); - - ULONG nHash = AtlSoapHashStr(wszChars, cchChars); - const _soapmapentry *pEntries = state.pMap->pEntries; - - size_t i; - for (i=0; pEntries[i].nHash != 0; i++) - { - if ((nHash == pEntries[i].nHash) && - (cchChars == pEntries[i].cchField) && - (!wcsncmp(wszChars, pEntries[i].wszField, cchChars))) - { - break; - } - } - - if (pEntries[i].nHash != 0) - { - *((int *)state.pvElement) = pEntries[i].nVal; - state.nElement++; - return S_OK; - } - - // no matching enum entry found - ATLTRACE( _T("ATLSOAP: CSoapRootHandler::characters -- no matching enum entry found for: %.*ws.\r\n" ), cchChars, wszChars ); - - return E_FAIL; - } - } - } - - // otherwise, ignore - - return S_OK; - } - - HRESULT __stdcall endElement( - const wchar_t * wszNamespaceUri, - int cchNamespaceUri, - const wchar_t * wszLocalName, - int cchLocalName, - const wchar_t * /*wszQName*/, - int /*cchQName*/) - { - static bool bDynArrWrapper = false; - if (m_bCharacters) - { - return E_FAIL; - } - - m_bNullCheck = false; - - if (m_stateStack.IsEmpty() != false) - { - return S_OK; - } - - if (!bDynArrWrapper && (m_nState > 1)) - { - ParseState prevState = m_stateStack.GetAt(m_nState - 1); - ParseState curState = m_stateStack.GetAt(m_nState); - if (prevState.dwFlags & SOAPFLAG_DYNARRWRAPPER) - { - bDynArrWrapper = true; - endElement (wszNamespaceUri, cchNamespaceUri, curState.pEntry->wszField, - curState.pEntry->cchField, NULL, 0); - } - } - else - { - bDynArrWrapper = false; - } - - --m_nDepth; - - const ParseState& state = GetState(); - - if ((m_dwState == SOAP_HEADERS) && (m_stateStack.GetCount() == 1)) - { - return CheckEndHeaders(wszNamespaceUri, cchNamespaceUri, wszLocalName, cchLocalName); - } - - if (state.dwFlags & (SOAPFLAG_FIXEDARR | SOAPFLAG_DYNARR)) - { - if (state.dwFlags & SOAPFLAG_READYSTATE) - { - PopState(); - } - - const ParseState& currstate = GetState(); - ATLENSURE_RETURN( currstate.pEntry != NULL ); - - if (m_nDepth == (currstate.nDepth-1)) - { - if (S_OK != CheckEndElement(currstate)) - { - // invalid number of elements - ATLTRACE( _T("ATLSOAP: CSoapRootHandler::endElement -- invalid number of array elements for array parameter %.*ws.\r\n"), - currstate.pEntry->cchField, currstate.pEntry->wszField ); - - return E_FAIL; - } - - PopState(); - } - } - else - { - if (S_OK != CheckEndElement(state)) - { - return E_FAIL; - } - - PopState(); - } - - return S_OK; - } - - HRESULT SetClientStruct(void *pvParam, int nMapIndex) - { - ATLENSURE_RETURN( pvParam != NULL ); - ATLENSURE_RETURN( nMapIndex >= 0 ); - - // this is the params struct - // store for later use - m_pvParam = pvParam; - - const _soapmap ** pEntries = GetHeaderMap(); - ATLENSURE_RETURN( pEntries != NULL ); - - // push header value - return PushState(GetHeaderValue(), pEntries[nMapIndex], NULL, 0, nMapIndex, pEntries[nMapIndex]->nElements); - } - - void ResetClientState(bool bFull = false) - { - m_stateStack.RemoveAll(); - m_nState = 0; - if (bFull != false) - { - m_dwState = SOAP_START; - m_pvParam = NULL; - } - } - - HRESULT CreateReader() - { - return m_spReader.CoCreateInstance(ATLS_SAXXMLREADER_CLSID, NULL, CLSCTX_INPROC_SERVER); - } - - HRESULT InitializeSOAP(IServiceProvider *pProvider) - { - HRESULT hr = S_OK; - - if (m_spReader.p == NULL) - { - hr = E_FAIL; - if (pProvider != NULL) - { - IAtlMemMgr *pMemMgr = NULL; - hr = pProvider->QueryService(__uuidof(IAtlMemMgr), - __uuidof(IAtlMemMgr), (void **)&pMemMgr); - if ((SUCCEEDED(hr)) && (pMemMgr != NULL)) - { - SetMemMgr(pMemMgr); - } - - hr = pProvider->QueryService(__uuidof(ISAXXMLReader), - __uuidof(ISAXXMLReader), (void **)&m_spReader); - } - - if (FAILED(hr)) - { - hr = CreateReader(); - } - } - - if (SUCCEEDED(hr)) - { - hr = m_spReader->putContentHandler(this); - } - -#ifdef _DEBUG - else - { - ATLTRACE( _T("ATLSOAP: CSoapRootHandler::InitializeSOAP -- failed to get SAXXMLReader.\r\n" ) ); - } -#endif // _DEBUG - - return hr; - } - - void UninitializeSOAP() - { - if (m_spReader.p != NULL) - { - m_spReader->putContentHandler(NULL); - m_spReader.Release(); - } - } - - virtual HRESULT DispatchSoapCall(const wchar_t *wszNamespaceUri, - int cchNamespaceUri, const wchar_t *wszLocalName, - int cchLocalName) - { - HRESULT hr = S_OK; - - if (m_stateStack.IsEmpty() == false) - { - ATLASSUME( m_stateStack[0].pMap != NULL ); - - // check to see if all required and non-nullable SOAP headers were sent - if (m_stateStack[0].pMap->mapType == SOAPMAP_HEADER) - { - hr = CheckSoapHeaders(m_stateStack[0]); - } - if (SUCCEEDED(hr)) - { - hr = SetSoapMapFromName(wszLocalName, cchLocalName, - wszNamespaceUri, cchNamespaceUri); - } - } - else - { - // get the appropriate function map - hr = SetSoapMapFromName(wszLocalName, cchLocalName, - wszNamespaceUri, cchNamespaceUri); - - if (SUCCEEDED(hr)) - { - // set the SOAP Header map for the function - ATLASSUME( m_stateStack.IsEmpty() == false ); - - const _soapmap **ppHeaderMap = GetHeaderMap(); - ATLENSURE_RETURN( ppHeaderMap != NULL ); - - // create a temporary parse state for checking headers - ParseState state; - state.pMap = ppHeaderMap[m_stateStack[0].nAllocSize]; - ATLENSURE_RETURN( state.pMap != NULL ); - - // check to see if all required and non-nullable SOAP headers were sent - hr = CheckSoapHeaders(state); - } - } - - return hr; - } - - virtual HRESULT BeginParse(IStream *pStream) - { - ATLASSERT( pStream != NULL ); - - CComVariant varStream; - varStream = static_cast(pStream); - - HRESULT hr = m_spReader->parse(varStream); - if (SUCCEEDED(hr)) - { - if (m_refMap.GetCount() != 0) - { - hr = E_FAIL; - } - } - return hr; - } - - HRESULT CallFunctionInternal() - { - HRESULT hr = E_FAIL; - const ParseState& state = m_stateStack[0]; - hr = CallFunction( - state.pvElement, - state.pMap->wszName, - state.pMap->cchWName, - state.nAllocSize); - - return hr; - } - - virtual HRESULT GenerateResponse(IWriteStream *pStream) - { - ATLASSUME( m_stateStack.IsEmpty() == false ); - ATLASSUME( m_stateStack[0].pMap != NULL ); - ATLASSUME( m_stateStack[0].pvElement != NULL ); - - const ParseState& state = m_stateStack[0]; - - const _soapmap *pHeaderMap = NULL; - if (m_bClient == false) - { - const _soapmap **ppHeaderMap = GetHeaderMap(); - if (ppHeaderMap != NULL) - { - pHeaderMap = ppHeaderMap[state.nAllocSize]; - } - } - else - { - pHeaderMap = state.pMap; - } - - const _soapmap *pFuncMap = NULL; - if (m_bClient == false) - { - pFuncMap = state.pMap; - } - else - { - const _soapmap **ppFuncMap = GetFunctionMap(); - ATLENSURE_RETURN( ppFuncMap != NULL ); - pFuncMap = ppFuncMap[state.nAllocSize]; - } - - ATLENSURE_RETURN( pFuncMap != NULL ); - - CRpcEncodedGenerator rpcGen; - CPADGenerator padGen; - CPIDGenerator pidGen; - - CResponseGenerator *pGenerator = NULL; - - if ((pFuncMap->dwCallFlags & (SOAPFLAG_RPC | SOAPFLAG_ENCODED)) == (SOAPFLAG_RPC | SOAPFLAG_ENCODED)) - { - pGenerator = &rpcGen; - } - else if (pFuncMap->dwCallFlags & SOAPFLAG_PID) - { - ATLASSERT( (pFuncMap->dwCallFlags & (SOAPFLAG_DOCUMENT | SOAPFLAG_LITERAL)) == (SOAPFLAG_DOCUMENT | SOAPFLAG_LITERAL) ); - pGenerator = &pidGen; - } - else - { - ATLASSERT( (pFuncMap->dwCallFlags & (SOAPFLAG_DOCUMENT | SOAPFLAG_LITERAL)) == (SOAPFLAG_DOCUMENT | SOAPFLAG_LITERAL) ); - ATLASSERT( pFuncMap->dwCallFlags & SOAPFLAG_PAD ); - pGenerator = &padGen; - } - - HRESULT hr = pGenerator->StartEnvelope(pStream); - if (SUCCEEDED(hr)) - { - // generate headers if necessary - hr = GenerateHeaders(pGenerator, pHeaderMap, pStream); - if (SUCCEEDED(hr)) - { - hr = pGenerator->StartBody(pStream); - if (SUCCEEDED(hr)) - { - hr = GenerateResponseHelper(pGenerator, pFuncMap, m_pvParam, pStream, true); - if (SUCCEEDED(hr)) - { - hr = pGenerator->EndBody(pStream); - if (SUCCEEDED(hr)) - { - hr = pGenerator->EndEnvelope(pStream); - } - } - } - } - } - - return hr; - } - - virtual void Cleanup() - { - // cleanup headers - CleanupHeaders(); - - if ((m_stateStack.IsEmpty() == false) && (m_pvParam != NULL)) - { - const _soapmap **ppFuncMap = GetFunctionMap(); - ATLENSURE( ppFuncMap != NULL ); - - const _soapmap *pFuncMap = ppFuncMap[m_stateStack[0].nAllocSize]; - ATLENSURE( pFuncMap != NULL ); - - CleanupHelper(pFuncMap, m_pvParam); - if (m_bClient == false) - { - m_pMemMgr->Free(m_pvParam); - m_stateStack.RemoveAll(); - } - } - } - - virtual void CleanupHeaders() - { - if (m_stateStack.IsEmpty() == false) - { - const _soapmap **ppHeaderMap = GetHeaderMap(); - ATLENSURE( ppHeaderMap != NULL ); - - const _soapmap *pHeaderMap = ppHeaderMap[m_stateStack[0].nAllocSize]; - ATLENSURE( pHeaderMap != NULL ); - - CleanupHelper(pHeaderMap, GetHeaderValue()); - } - } - - void SetClient(bool bClient) - { - m_bClient = bClient; - } - -}; // class CSoapRootHandler - -#define DECLARE_XSD_ENTRY( __name ) \ - { L ## __name, __name, sizeof(__name)-1 }, - -__declspec(selectany) const CSoapRootHandler::XSDEntry CSoapRootHandler::s_xsdNames[] = -{ - DECLARE_XSD_ENTRY("string") - DECLARE_XSD_ENTRY("boolean") - DECLARE_XSD_ENTRY("float") - DECLARE_XSD_ENTRY("double") - DECLARE_XSD_ENTRY("decimal") - DECLARE_XSD_ENTRY("duration") - DECLARE_XSD_ENTRY("hexBinary") - DECLARE_XSD_ENTRY("base64Binary") - DECLARE_XSD_ENTRY("anyURI") - DECLARE_XSD_ENTRY("ID") - DECLARE_XSD_ENTRY("IDREF") - DECLARE_XSD_ENTRY("ENTITY") - DECLARE_XSD_ENTRY("NOTATION") - DECLARE_XSD_ENTRY("QName") - DECLARE_XSD_ENTRY("normalizedString") - DECLARE_XSD_ENTRY("token") - DECLARE_XSD_ENTRY("language") - DECLARE_XSD_ENTRY("IDREFS") - DECLARE_XSD_ENTRY("ENTITIES") - DECLARE_XSD_ENTRY("NMTOKEN") - DECLARE_XSD_ENTRY("NMTOKENS") - DECLARE_XSD_ENTRY("Name") - DECLARE_XSD_ENTRY("NCName") - DECLARE_XSD_ENTRY("integer") - DECLARE_XSD_ENTRY("nonPositiveInteger") - DECLARE_XSD_ENTRY("negativeInteger") - DECLARE_XSD_ENTRY("long") - DECLARE_XSD_ENTRY("int") - DECLARE_XSD_ENTRY("short") - DECLARE_XSD_ENTRY("byte") - DECLARE_XSD_ENTRY("nonNegativeInteger") - DECLARE_XSD_ENTRY("unsignedLong") - DECLARE_XSD_ENTRY("unsignedInt") - DECLARE_XSD_ENTRY("unsignedShort") - DECLARE_XSD_ENTRY("unsignedByte") - DECLARE_XSD_ENTRY("positiveInteger") - DECLARE_XSD_ENTRY("dateTime") - DECLARE_XSD_ENTRY("time") - DECLARE_XSD_ENTRY("date") - DECLARE_XSD_ENTRY("gMonth") - DECLARE_XSD_ENTRY("gYearMonth") - DECLARE_XSD_ENTRY("gYear") - DECLARE_XSD_ENTRY("gMonthDay") - DECLARE_XSD_ENTRY("gDay") -}; - -__declspec(selectany) CCRTHeap CSoapRootHandler::m_crtHeap; - -template -class CSoapHandler : - public CSoapRootHandler, - public CComObjectRootEx, - public IRequestHandlerImpl -{ -protected: - - HTTP_CODE m_hcErr; - CHttpResponse *m_pHttpResponse; - - // heap for SOAP requests - CWin32Heap m_heap; - - // default heap is COM heap (SOAP Servers can double as COM objects) - CComHeap m_comHeap; - -public: - - BEGIN_COM_MAP(CSoapHandler) - COM_INTERFACE_ENTRY(ISAXContentHandler) - COM_INTERFACE_ENTRY(IRequestHandler) - END_COM_MAP() - - CSoapHandler() - :m_pHttpResponse(NULL), m_hcErr(HTTP_SUCCESS) - { - SetMemMgr(&m_comHeap); - } - - void SetHttpError(HTTP_CODE hcErr) - { - m_hcErr = hcErr; - } - - HRESULT SoapFault( - SOAP_ERROR_CODE errCode, - const wchar_t *wszDetail, - int cchDetail) - { - ATLASSUME( m_pHttpResponse != NULL ); - - SetHttpError(AtlsHttpError(500, SUBERR_NO_PROCESS)); - - m_pHttpResponse->ClearHeaders(); - m_pHttpResponse->ClearContent(); - m_pHttpResponse->SetContentType("text/xml"); - m_pHttpResponse->SetStatusCode(500); - - CSoapFault fault; - if (wszDetail != NULL) - { - if (cchDetail < 0) - { - cchDetail = (int) wcslen(wszDetail); - } - - _ATLTRY - { - fault.m_strDetail.SetString(wszDetail, cchDetail); - } - _ATLCATCHALL() - { - ATLTRACE( _T("CSoapHandler::SoapFault -- out of memory.\r\n" ) ); - - return E_OUTOFMEMORY; - } - } - - fault.m_soapErrCode = errCode; - fault.GenerateFault(m_pHttpResponse); - return S_OK; - } - - HTTP_CODE InitializeHandler(AtlServerRequest *pRequestInfo, IServiceProvider *pProvider) - { - m_hcErr = IRequestHandlerImpl::InitializeHandler(pRequestInfo, pProvider); - if (m_hcErr == HTTP_SUCCESS) - { - HRESULT hr = InitializeSOAP(m_spServiceProvider); - if (SUCCEEDED(hr)) - { - // try to use the per-thread heap - CIsapiWorker *pWorker = pRequestInfo->pExtension->GetThreadWorker(); - if (pWorker != NULL) - { - m_heap.Attach(pWorker->m_hHeap, false); - SetMemMgr(&m_heap); - } - - return m_hcErr; - } - } - - // some initialization failure - CHttpResponse HttpResponse(pRequestInfo->pServerContext); - m_pHttpResponse = &HttpResponse; - - SoapFault(SOAP_E_SERVER, NULL, 0); - - m_pHttpResponse = NULL; - - return m_hcErr; - } - - HTTP_CODE HandleRequest(AtlServerRequest *pRequestInfo, IServiceProvider * /*pProvider*/) - { - // SOAPACTION header is required per the SOAP 1.1 - // mainly so firewalls can filter on it. - char szBuf[ATL_URL_MAX_URL_LENGTH+1]; - szBuf[0] = '\0'; - DWORD dwLen = ATL_URL_MAX_URL_LENGTH; - if ( m_spServerContext->GetServerVariable("HTTP_SOAPACTION", szBuf, &dwLen) != FALSE ) - { - if ( dwLen >= 2 ) - { - // drop the last " - szBuf[dwLen-2] = '\0'; - char *szMethod = strrchr(szBuf, '#'); - if (szMethod != NULL) - { - _ATLTRY - { - // ignore return code here - SetSoapMapFromName(CA2W( szMethod+1 ), -1, GetNamespaceUri(), -1, true); - } - _ATLCATCHALL() - { - return AtlsHttpError(500, ISE_SUBERR_OUTOFMEM); - } - } - } - } - else - { - // SOAP requestion that use the HTTP transport - // must have a SOAPACTION header. - return HTTP_ERROR(500, ISE_SUBERR_SOAPNOSOAPACTION); - } - - // set the header map - CHttpResponse HttpResponse(pRequestInfo->pServerContext); - m_pHttpResponse = &HttpResponse; - - CStreamOnServerContext s(pRequestInfo->pServerContext); - -#ifdef _DEBUG - - CSAXSoapErrorHandler err; - GetReader()->putErrorHandler(&err); - -#endif // _DEBUG - - HRESULT hr = BeginParse(&s); - -#ifdef _DEBUG - // release the error handler - GetReader()->putErrorHandler(NULL); -#endif // _DEBUG - - if (FAILED(hr)) - { - Cleanup(); - if (m_hcErr == HTTP_SUCCESS) - { - SoapFault(SOAP_E_CLIENT, NULL, NULL); - } - - return m_hcErr; - } - - _ATLTRY - { - hr = CallFunctionInternal(); - } - _ATLCATCHALL() - { - // cleanup before propagating user exception - Cleanup(); - HttpResponse.Detach(); - _ATLRETHROW; - } - - if (FAILED(hr)) - { - Cleanup(); - HttpResponse.ClearHeaders(); - HttpResponse.ClearContent(); - if (m_hcErr != HTTP_SUCCESS) - { - HttpResponse.SetStatusCode(HTTP_ERROR_CODE(m_hcErr)); - return HTTP_SUCCESS_NO_PROCESS; - } - HttpResponse.SetStatusCode(500); - GenerateAppError(&HttpResponse, hr); - return AtlsHttpError(500, SUBERR_NO_PROCESS); - } - - HttpResponse.SetContentType("text/xml"); - hr = GenerateResponse(&HttpResponse); - Cleanup(); - if (FAILED(hr)) - { - SoapFault(SOAP_E_SERVER, NULL, 0); - return m_hcErr; - } - - return HTTP_SUCCESS; - } - - virtual ATL_NOINLINE HRESULT GenerateAppError(IWriteStream *pStream, HRESULT hr) - { - if (pStream == NULL) - { - return E_INVALIDARG; - } - - LPWSTR pwszMessage = NULL; - DWORD dwLen = ::FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM, - NULL, hr, 0, (LPWSTR) &pwszMessage, 0, NULL); - - if (dwLen == 0) - { - pwszMessage = L"Application Error"; - } - - hr = SoapFault(SOAP_E_SERVER, pwszMessage, dwLen ? dwLen : -1); - if (dwLen != 0) - { - ::LocalFree(pwszMessage); - } - - return hr; - } - - void UninitializeHandler() - { - UninitializeSOAP(); - } -}; - - -// client error states -enum SOAPCLIENT_ERROR -{ - SOAPCLIENT_SUCCESS=0, // everything succeeded - SOAPCLIENT_INITIALIZE_ERROR, // initialization failed -- most likely an MSXML installation problem - SOAPCLIENT_OUTOFMEMORY, // out of memory - SOAPCLIENT_GENERATE_ERROR, // failed in generating the response - SOAPCLIENT_CONNECT_ERROR, // failed connecting to server - SOAPCLIENT_SEND_ERROR, // failed in sending message - SOAPCLIENT_SERVER_ERROR, // server error - SOAPCLIENT_SOAPFAULT, // a SOAP Fault was returned by the server - SOAPCLIENT_PARSEFAULT_ERROR, // failed in parsing SOAP fault - SOAPCLIENT_READ_ERROR, // failed in reading response - SOAPCLIENT_PARSE_ERROR // failed in parsing response -}; - -template -class CSoapSocketClientT -{ -private: - - CUrl m_url; - CWriteStreamOnCString m_writeStream; - CReadStreamOnSocket m_readStream; - DWORD m_dwTimeout; - - SOAPCLIENT_ERROR m_errorState; - -protected: - - virtual HRESULT GetClientReader(ISAXXMLReader **pReader) - { - if (pReader == NULL) - { - return E_POINTER; - } - *pReader = NULL; - - CComPtr spReader; - HRESULT hr = spReader.CoCreateInstance(ATLS_SAXXMLREADER_CLSID, NULL, CLSCTX_INPROC_SERVER); - if (SUCCEEDED(hr)) - { - *pReader = spReader.Detach(); - } - return hr; - } - -public: - - // note : not shared across stock client implementations - CAtlHttpClientT m_socket; - - CSoapFault m_fault; - - // constructor - CSoapSocketClientT(LPCTSTR szUrl) - : m_dwTimeout(0), m_errorState(SOAPCLIENT_SUCCESS) - { - TCHAR szTmp[ATL_URL_MAX_URL_LENGTH]; - if(AtlEscapeUrl(szUrl,szTmp,0,ATL_URL_MAX_URL_LENGTH-1,ATL_URL_BROWSER_MODE)) - m_url.CrackUrl(szTmp); - } - - CSoapSocketClientT(LPCTSTR szServer, LPCTSTR szUri, ATL_URL_PORT nPort=80) - : m_dwTimeout(0), m_errorState(SOAPCLIENT_SUCCESS) - { - ATLASSERT( szServer != NULL ); - ATLASSERT( szUri != NULL ); - - m_url.SetUrlPath(szUri); - m_url.SetHostName(szServer); - m_url.SetPortNumber(nPort); - } - - ~CSoapSocketClientT() - { - CleanupClient(); - } - - SOAPCLIENT_ERROR GetClientError() - { - return m_errorState; - } - - void SetClientError(SOAPCLIENT_ERROR errorState) - { - m_errorState = errorState; - } - - IWriteStream * GetWriteStream() - { - return &m_writeStream; - } - - HRESULT GetReadStream(IStream **ppStream) - { - if (ppStream == NULL) - { - return E_POINTER; - } - - *ppStream = &m_readStream; - return S_OK; - } - - void CleanupClient() - { - m_writeStream.Cleanup(); - m_fault.Clear(); - SetClientError(SOAPCLIENT_SUCCESS); - } - - HRESULT SendRequest(LPCTSTR szAction) - { - HRESULT hr = E_FAIL; - _ATLTRY - { - // create extra headers to send with request - CFixedStringT strExtraHeaders(szAction); - strExtraHeaders.Append(_T("Accept: text/xml\r\n"), sizeof("Accept: text/xml\r\n")-1); - CAtlNavigateData navData; - navData.SetMethod(ATL_HTTP_METHOD_POST); - navData.SetPort(m_url.GetPortNumber()); - navData.SetExtraHeaders(strExtraHeaders); - navData.SetPostData((LPBYTE)(LPCSTR) m_writeStream.m_str, m_writeStream.m_str.GetLength(), _T("text/xml; charset=utf-8")); - - ATLSOAP_TRACE( (LPBYTE)(LPCSTR)m_writeStream.m_str, m_writeStream.m_str.GetLength() ); - - if (m_dwTimeout != 0) - { - navData.SetSocketTimeout(m_dwTimeout); - } - - if (m_socket.Navigate(&m_url, &navData) != false) - { - if (GetStatusCode() == 200) - { - hr = (m_readStream.Init(&m_socket) != FALSE ? S_OK : E_FAIL); - if (hr != S_OK) - { - SetClientError(SOAPCLIENT_READ_ERROR); - } - } - else if (GetStatusCode() == 202) - { - // for one-way methods - hr = S_OK; - } - else - { - SetClientError(SOAPCLIENT_SERVER_ERROR); - } - } - else if (GetStatusCode() == 500) - { - SetClientError(SOAPCLIENT_SOAPFAULT); - - // if returned 500, get the SOAP fault - if (m_readStream.Init(&m_socket) != FALSE) - { - CComPtr spReader; - if (SUCCEEDED(GetClientReader(&spReader))) - { - CComPtr spReadStream; - if (SUCCEEDED(GetReadStream(&spReadStream))) - { - if (FAILED(m_fault.ParseFault(spReadStream, spReader))) - { - SetClientError(SOAPCLIENT_PARSEFAULT_ERROR); - } - } - } - } - } - else - { - SetClientError(SOAPCLIENT_SEND_ERROR); - } - } - _ATLCATCHALL() - { - hr = E_FAIL; - } - - return hr; - } - - HRESULT SetUrl(LPCTSTR szUrl) - { - TCHAR szTmp[ATL_URL_MAX_URL_LENGTH]; - if(!AtlEscapeUrl(szUrl,szTmp,0,ATL_URL_MAX_URL_LENGTH-1,ATL_URL_BROWSER_MODE)) - { - return E_FAIL; - } - - return (m_url.CrackUrl(szTmp) != FALSE) ? S_OK : E_FAIL; - } - - HRESULT GetUrl(__out_ecount_part_z(*pdwLen, *pdwLen) LPTSTR szUrl, __inout LPDWORD pdwLen) - { - if ((szUrl == NULL) || (pdwLen == NULL)) - { - return E_INVALIDARG; - } - - return (m_url.CreateUrl(szUrl, pdwLen) != FALSE) ? S_OK : E_FAIL; - } - - HRESULT SetProxy(LPCTSTR szProxy = NULL, short nProxyPort = 80) - { - BOOL bRet = m_socket.SetProxy(szProxy, nProxyPort); - return (bRet != FALSE) ? S_OK : E_FAIL; - } - - void SetTimeout(DWORD dwTimeout) - { - m_dwTimeout = dwTimeout; - } - - int GetStatusCode() - { - return m_socket.GetStatus(); - } - -}; // CSoapSocketClientT - -#ifndef ATLSOAP_NOWININET - -class CReadStreamOnInet : public IStreamImpl -{ -public: - - HRESULT __stdcall QueryInterface(REFIID riid, void **ppv) - { - if (ppv == NULL) - { - return E_POINTER; - } - - *ppv = NULL; - - if (InlineIsEqualGUID(riid, IID_IUnknown) || - InlineIsEqualGUID(riid, IID_IStream) || - InlineIsEqualGUID(riid, IID_ISequentialStream)) - { - *ppv = static_cast(this); - return S_OK; - } - - return E_NOINTERFACE; - } - - ULONG __stdcall AddRef() - { - return 1; - } - - ULONG __stdcall Release() - { - return 1; - } - -private: - - HINTERNET m_hFile; - -public: - - CReadStreamOnInet() - :m_hFile(NULL) - { - } - - void Init(HINTERNET hFile) - { - m_hFile = hFile; - } - - HRESULT STDMETHODCALLTYPE Read(void *pDest, ULONG dwMaxLen, ULONG *pdwRead) - { - BOOL bRet = InternetReadFile(m_hFile, pDest, dwMaxLen, pdwRead); - return (bRet != FALSE) ? S_OK : E_FAIL; - } - -}; // CStreamOnInet - -class CSoapWininetClient -{ -private: - - CUrl m_url; - CWriteStreamOnCString m_writeStream; - CReadStreamOnInet m_readStream; - CString m_strProxy; - DWORD m_dwTimeout; - CFixedStringT m_strUrl; - SOAPCLIENT_ERROR m_errorState; - - void CloseAll() - { - if (m_hRequest != NULL) - { - InternetCloseHandle(m_hRequest); - m_hRequest = NULL; - } - if (m_hConnection != NULL) - { - InternetCloseHandle(m_hConnection); - m_hConnection = NULL; - } - if (m_hInternet != NULL) - { - InternetCloseHandle(m_hInternet); - m_hInternet = NULL; - } - } - - HRESULT ConnectToServer() - { - if (m_hConnection != NULL) - { - return S_OK; - } - - m_hInternet = InternetOpen( - ATLSOAPINET_CLIENT, - m_strProxy.GetLength() ? (INTERNET_OPEN_TYPE_PRECONFIG | INTERNET_OPEN_TYPE_PROXY) : INTERNET_OPEN_TYPE_PRECONFIG, - m_strProxy.GetLength() ? (LPCTSTR) m_strProxy : NULL, - NULL, 0); - - if (m_hInternet != NULL) - { - if (m_dwTimeout != 0) - { - InternetSetOption(m_hInternet, INTERNET_OPTION_CONNECT_TIMEOUT, - &m_dwTimeout, sizeof(m_dwTimeout)); - InternetSetOption(m_hInternet, INTERNET_OPTION_RECEIVE_TIMEOUT, - &m_dwTimeout, sizeof(m_dwTimeout)); - InternetSetOption(m_hInternet, INTERNET_OPTION_SEND_TIMEOUT, - &m_dwTimeout, sizeof(m_dwTimeout)); - } - m_hConnection = InternetConnect(m_hInternet, m_url.GetHostName(), - (INTERNET_PORT) m_url.GetPortNumber(), NULL, NULL, - INTERNET_SERVICE_HTTP, 0, NULL); - - if (m_hConnection != NULL) - { - return S_OK; - } - } - CloseAll(); - return E_FAIL; - } - -protected: - - virtual HRESULT GetClientReader(ISAXXMLReader **pReader) - { - if (pReader == NULL) - { - return E_POINTER; - } - *pReader = NULL; - - CComPtr spReader; - HRESULT hr = spReader.CoCreateInstance(ATLS_SAXXMLREADER_CLSID, NULL, CLSCTX_INPROC_SERVER); - if (SUCCEEDED(hr)) - { - *pReader = spReader.Detach(); - } - return hr; - } - -public: - - // note : not shared across stock client implementations - HINTERNET m_hInternet; - HINTERNET m_hConnection; - HINTERNET m_hRequest; - - CSoapFault m_fault; - - CSoapWininetClient(LPCTSTR szUrl) - :m_hInternet(NULL), m_hConnection(NULL), m_hRequest(NULL), m_dwTimeout(0), m_errorState(SOAPCLIENT_SUCCESS) - { - TCHAR szTmp[ATL_URL_MAX_URL_LENGTH]; - if(AtlEscapeUrl(szUrl,szTmp,0,ATL_URL_MAX_URL_LENGTH-1,ATL_URL_BROWSER_MODE)) - { - if (m_url.CrackUrl(szTmp) != FALSE) - { - SetProxy(); - _ATLTRY - { - m_strUrl.SetString(m_url.GetUrlPath(), m_url.GetUrlPathLength()); - m_strUrl.Append(m_url.GetExtraInfo(), m_url.GetExtraInfoLength()); - } - _ATLCATCHALL() - { - } - } - } - } - - CSoapWininetClient(LPCTSTR szServer, LPCTSTR szUri, short nPort=80) - :m_hInternet(NULL), m_hConnection(NULL), m_hRequest(NULL), m_dwTimeout(0), m_errorState(SOAPCLIENT_SUCCESS) - { - if (m_url.SetHostName(szServer) != FALSE) - { - if (m_url.SetUrlPath(szUri) != FALSE) - { - if (m_url.SetPortNumber((ATL_URL_PORT) nPort) != FALSE) - { - _ATLTRY - { - m_strUrl.SetString(m_url.GetUrlPath(), m_url.GetUrlPathLength()); - m_strUrl.Append(m_url.GetExtraInfo(), m_url.GetExtraInfoLength()); - } - _ATLCATCHALL() - { - } - } - } - } - } - - virtual ~CSoapWininetClient() - { - CleanupClient(); - CloseAll(); - } - - SOAPCLIENT_ERROR GetClientError() - { - return m_errorState; - } - - void SetClientError(SOAPCLIENT_ERROR errorState) - { - m_errorState = errorState; - } - - IWriteStream * GetWriteStream() - { - return &m_writeStream; - } - - HRESULT GetReadStream(IStream **ppStream) - { - if (ppStream == NULL) - { - return E_POINTER; - } - - *ppStream = &m_readStream; - return S_OK; - } - - void CleanupClient() - { - m_writeStream.Cleanup(); - if (m_hRequest != NULL) - { - InternetCloseHandle(m_hRequest); - m_hRequest = NULL; - } - m_fault.Clear(); - SetClientError(SOAPCLIENT_SUCCESS); - } - - HRESULT SendRequest(LPCTSTR szAction) - { - if (ConnectToServer() != S_OK) - { - SetClientError(SOAPCLIENT_CONNECT_ERROR); - return E_FAIL; - } - - CString strHeaders; - _ATLTRY - { - strHeaders.Append(szAction); - strHeaders.Append(_T("Content-Type: text/xml; charset=utf-8\r\n")); - } - _ATLCATCHALL() - { - return E_OUTOFMEMORY; - } - - static LPCTSTR s_szAcceptTypes[] = { _T("text/*"), NULL }; - m_hRequest = HttpOpenRequest(m_hConnection, _T("POST"), - m_strUrl, _T("HTTP/1.0"), NULL, - s_szAcceptTypes, - INTERNET_FLAG_NO_UI | INTERNET_FLAG_KEEP_CONNECTION | ((m_url.GetScheme() == ATL_URL_SCHEME_HTTPS) ? INTERNET_FLAG_SECURE : 0) - , NULL); - - if (m_hRequest != NULL) - { - if (FALSE != HttpSendRequest(m_hRequest, strHeaders, (DWORD) strHeaders.GetLength(), - (void *)(LPCSTR)m_writeStream.m_str, m_writeStream.m_str.GetLength())) - { - m_readStream.Init(m_hRequest); - if (GetStatusCode() != HTTP_STATUS_SERVER_ERROR) - { - return S_OK; - } - else - { - SetClientError(SOAPCLIENT_SOAPFAULT); - - CComPtr spReader; - if (SUCCEEDED(GetClientReader(&spReader))) - { - CComPtr spReadStream; - if (SUCCEEDED(GetReadStream(&spReadStream))) - { - if (FAILED(m_fault.ParseFault(spReadStream, spReader))) - { - SetClientError(SOAPCLIENT_PARSEFAULT_ERROR); - } - } - } - } - } - } - else - { - SetClientError(SOAPCLIENT_SEND_ERROR); - } - - return E_FAIL; - } - - HRESULT SetUrl(LPCTSTR szUrl) - { - CloseAll(); - TCHAR szTmp[ATL_URL_MAX_URL_LENGTH]; - if(!AtlEscapeUrl(szUrl,szTmp,0,ATL_URL_MAX_URL_LENGTH-1,ATL_URL_BROWSER_MODE)) - { - return E_FAIL; - } - - if (m_url.CrackUrl(szTmp) != FALSE) - { - _ATLTRY - { - m_strUrl.SetString(m_url.GetUrlPath(), m_url.GetUrlPathLength()); - m_strUrl.Append(m_url.GetExtraInfo(), m_url.GetExtraInfoLength()); - } - _ATLCATCHALL() - { - return E_OUTOFMEMORY; - } - return S_OK; - } - return E_FAIL; - } - - HRESULT GetUrl(LPTSTR szUrl, LPDWORD pdwLen) - { - if ((szUrl == NULL) || (pdwLen == NULL)) - { - return E_INVALIDARG; - } - - return (m_url.CreateUrl(szUrl, pdwLen) != FALSE) ? S_OK : E_FAIL; - } - - HRESULT SetProxy(LPCTSTR szProxy = NULL, short nProxyPort = 80) - { - _ATLTRY - { - if (szProxy && szProxy[0]) - { - m_strProxy.Format(_T("http=http://%s:%d https=http://%s:%d"), szProxy, nProxyPort, szProxy, nProxyPort); - } - else - { - m_strProxy.Empty(); - } - } - _ATLCATCHALL() - { - return E_OUTOFMEMORY; - } - - return S_OK; - } - - void SetTimeout(DWORD dwTimeout) - { - m_dwTimeout = dwTimeout; - } - - int GetStatusCode() - { - DWORD dwLen = 255; - TCHAR szBuf[256]; - if (HttpQueryInfo(m_hRequest, HTTP_QUERY_STATUS_CODE, szBuf, &dwLen, NULL)) - { - szBuf[dwLen] = '\0'; - return _ttoi(szBuf); - } - return 0; - } -}; // CSoapWininetClient -#endif - -#ifndef ATLSOAP_NOMSXML_INET -class CSoapMSXMLInetClient -{ -private: - - CUrl m_url; - CWriteStreamOnCString m_writeStream; - DWORD m_dwTimeout; - SOAPCLIENT_ERROR m_errorState; - - HRESULT ConnectToServer() - { - TCHAR szURL[ATL_URL_MAX_URL_LENGTH]; - DWORD dwLen = ATL_URL_MAX_URL_LENGTH; - HRESULT hr = E_FAIL; - - if (m_spHttpRequest) - return S_OK; - - if (!m_url.CreateUrl(szURL, &dwLen)) - return E_FAIL; - - - hr = m_spHttpRequest.CoCreateInstance(__uuidof(ServerXMLHTTP30)); - if (hr != S_OK) - return hr; - - CComVariant vEmpty; - hr = m_spHttpRequest->open( CComBSTR(L"POST"), - CComBSTR(szURL), - CComVariant(VARIANT_BOOL(VARIANT_FALSE)), - vEmpty, - vEmpty ); - if (hr != S_OK) - { - m_spHttpRequest.Release(); - return hr; - } - - return S_OK; - } - -protected: - - virtual HRESULT GetClientReader(ISAXXMLReader **pReader) - { - if (pReader == NULL) - { - return E_POINTER; - } - *pReader = NULL; - - CComPtr spReader; - HRESULT hr = spReader.CoCreateInstance(ATLS_SAXXMLREADER_CLSID, NULL, CLSCTX_INPROC_SERVER); - if (SUCCEEDED(hr)) - { - *pReader = spReader.Detach(); - } - return hr; - } - -public: - - // note : not shared across stock client implementations - CComPtr m_spHttpRequest; - - CSoapFault m_fault; - - CSoapMSXMLInetClient(LPCTSTR szUrl) - :m_dwTimeout(0), m_errorState(SOAPCLIENT_SUCCESS) - { - m_url.CrackUrl(szUrl); - } - - CSoapMSXMLInetClient(LPCTSTR szServer, LPCTSTR szUri, short nPort=80) - : m_dwTimeout(0), m_errorState(SOAPCLIENT_SUCCESS) - { - m_url.SetHostName(szServer); - m_url.SetUrlPath(szUri); - m_url.SetPortNumber((ATL_URL_PORT) nPort); - } - - virtual ~CSoapMSXMLInetClient() - { - CleanupClient(); - } - - SOAPCLIENT_ERROR GetClientError() - { - return m_errorState; - } - - void SetClientError(SOAPCLIENT_ERROR errorState) - { - m_errorState = errorState; - } - - IWriteStream * GetWriteStream() - { - return &m_writeStream; - } - - HRESULT GetReadStream(IStream **ppStream) - { - if (ppStream == NULL) - { - return E_POINTER; - } - - *ppStream = NULL; - HRESULT hr = E_FAIL; - - if (m_spHttpRequest) - { - VARIANT vResponseStream; - VariantInit(&vResponseStream); - hr = m_spHttpRequest->get_responseStream(&vResponseStream); - if (S_OK == hr) - { - hr = E_FAIL; - if ((vResponseStream.vt == VT_UNKNOWN) && (vResponseStream.punkVal != NULL)) - { - // we return the refcount with the pointer! - hr = vResponseStream.punkVal->QueryInterface(__uuidof(IStream), (void **)ppStream); - } - else - { - SetClientError(SOAPCLIENT_READ_ERROR); - } - } - VariantClear(&vResponseStream); - } - return hr; - } - - void CleanupClient() - { - m_writeStream.Cleanup(); - m_spHttpRequest.Release(); - m_fault.Clear(); - SetClientError(SOAPCLIENT_SUCCESS); - } - - HRESULT SendRequest(LPCTSTR szAction) - { - if (ConnectToServer() != S_OK) - { - SetClientError(SOAPCLIENT_CONNECT_ERROR); - return E_FAIL; - } - - // set the action header - LPCTSTR szColon = _tcschr(szAction, _T(':')); - if (szColon != NULL) - { - do - { - szColon++; - } while (_istspace(static_cast(*szColon))); - - if (FAILED(m_spHttpRequest->setRequestHeader( - CComBSTR( L"SOAPAction" ), CComBSTR( szColon )))) - { - SetClientError(SOAPCLIENT_SEND_ERROR); - return E_FAIL; - } - } // if SOAPAction header not properly formed, attempt to send anyway - - if (FAILED(m_spHttpRequest->setRequestHeader(CComBSTR( L"Content-Type" ), CComBSTR(L"text/xml; charset=utf-8")))) - { - SetClientError(SOAPCLIENT_SEND_ERROR); - return E_FAIL; - } - - // set timeout - if (m_dwTimeout != 0) - { - long nTimeout = (long) m_dwTimeout; - m_spHttpRequest->setTimeouts(nTimeout, nTimeout, nTimeout, nTimeout); - // reset timeout - m_dwTimeout = 0; - } - - CComVariant vBody(m_writeStream.m_str); - HRESULT hr = m_spHttpRequest->send(vBody); - if ((SUCCEEDED(hr)) && (GetStatusCode() == 500)) - { - hr = E_FAIL; - CComPtr spReader; - if (SUCCEEDED(GetClientReader(&spReader))) - { - SetClientError(SOAPCLIENT_SOAPFAULT); - - CComPtr spReadStream; - if (SUCCEEDED(GetReadStream(&spReadStream))) - { - if (FAILED(m_fault.ParseFault(spReadStream, spReader))) - { - SetClientError(SOAPCLIENT_PARSEFAULT_ERROR); - } - } - } - } - else if (FAILED(hr)) - { - SetClientError(SOAPCLIENT_SEND_ERROR); - } - - return hr; - } - - HRESULT SetUrl(LPCTSTR szUrl) - { - CleanupClient(); - return (m_url.CrackUrl(szUrl) != FALSE ? S_OK : E_FAIL); - } - - HRESULT GetUrl(LPTSTR szUrl, LPDWORD pdwLen) - { - if ((szUrl == NULL) || (pdwLen == NULL)) - { - return E_INVALIDARG; - } - - return (m_url.CreateUrl(szUrl, pdwLen) != FALSE) ? S_OK : E_FAIL; - } - - void SetTimeout(DWORD dwTimeout) - { - m_dwTimeout = dwTimeout; - } - - int GetStatusCode() - { - long lStatus; - if (m_spHttpRequest->get_status(&lStatus) == S_OK) - { - return (int) lStatus; - } - return 0; - } - - HRESULT SetProxy(LPCTSTR szProxy = NULL, short nProxyPort = 80) - { - (szProxy); - (nProxyPort); - - ATLTRACE( _T("CSoapMSXMLInetClient does not support SetProxy") ); - - return S_OK; - } -}; // CSoapMSXMLInetClient -#endif - - -class _CSDLGenerator : public ITagReplacerImpl<_CSDLGenerator> -{ -private: - - typedef CAtlMap > WSDLMAP; - typedef CAtlMap > HEADERMAP; - - HRESULT GenerateWSDLHelper(const _soapmap *pMap, WSDLMAP& structMap, WSDLMAP& enumMap) - { - ATLENSURE_RETURN( pMap != NULL ); - - const _soapmapentry *pEntries = pMap->pEntries; - ATLENSURE_RETURN( pEntries != NULL ); - - HRESULT hr = S_OK; - - for (int i=0; pEntries[i].nHash != 0; i++) - { - if (pEntries[i].nVal == SOAPTYPE_UNK) - { - ATLENSURE_RETURN( pEntries[i].pChain != NULL ); - - _ATLTRY - { - POSITION pos = NULL; - CStringA strName(pEntries[i].pChain->szName, pEntries[i].pChain->cchName); - if (pEntries[i].pChain->mapType == SOAPMAP_STRUCT) - { - pos = structMap.SetAt(strName, pEntries[i].pChain); - } - else if (pEntries[i].pChain->mapType == SOAPMAP_ENUM) - { - pos = enumMap.SetAt(strName, pEntries[i].pChain); - } - if (pos == NULL) - { - hr = E_OUTOFMEMORY; - break; - } - } - _ATLCATCHALL() - { - hr = E_OUTOFMEMORY; - break; - } - - hr = GenerateWSDLHelper(pEntries[i].pChain, structMap, enumMap); - if (FAILED(hr)) - { - break; - } - } - } - - return hr; - } - - HTTP_CODE IsUDT(const _soapmapentry *pEntry) - { - ATLENSURE( pEntry != NULL ); - return (pEntry->nVal != SOAPTYPE_UNK) ? HTTP_S_FALSE : HTTP_SUCCESS; - } - - HTTP_CODE GetSoapDims(const _soapmapentry *pEntry) - { - ATLENSURE( pEntry != NULL ); - if (pEntry->pDims[0] != 0) - { - if (SUCCEEDED(m_pWriteStream->WriteStream("[", 1, NULL))) - { - for (int i=1; i<=pEntry->pDims[0]; i++) - { - if (m_writeHelper.Write(pEntry->pDims[i]) != FALSE) - { - if (i < pEntry->pDims[0]) - { - if (FAILED(m_pWriteStream->WriteStream(", ", 2, NULL))) - { - return HTTP_FAIL; - } - } - } - } - if (SUCCEEDED(m_pWriteStream->WriteStream("]", 1, NULL))) - { - return HTTP_SUCCESS; - } - } - } - return HTTP_FAIL; - } - - const _soapmap **m_pFuncs; - const _soapmap **m_pHeaders; - int m_nFunc; - int m_nParam; - int m_nHeader; - WSDLMAP m_structMap; - WSDLMAP m_enumMap; - POSITION m_currUDTPos; - int m_nCurrUDTField; - - HEADERMAP m_headerMap; - POSITION m_currHeaderPos; - - CWriteStreamHelper m_writeHelper; - - CStringA m_strServiceName; - CStringA m_strNamespaceUri; - - IWriteStream *m_pWriteStream; - - CComPtr m_spHttpServerContext; - - DWORD m_dwCallFlags; - -protected: - - void SetWriteStream(IWriteStream *pStream) - { - m_pWriteStream = pStream; - m_writeHelper.Attach(m_pWriteStream); - } - - void SetHttpServerContext(IHttpServerContext *pServerContext) - { - m_spHttpServerContext = pServerContext; - } - - static HTTP_CODE GetSoapType(int nVal, IWriteStream *pStream) - { - return (pStream->WriteStream(CSoapRootHandler::s_xsdNames[nVal].szName, - CSoapRootHandler::s_xsdNames[nVal].cchName, NULL) == S_OK) ? HTTP_SUCCESS : HTTP_FAIL; - } - - - HRESULT InitializeSDL(CSoapRootHandler *pHdlr) - { - m_pFuncs = pHdlr->GetFunctionMap(); - - if (m_pFuncs == NULL) - { - return E_FAIL; - } - - ATLASSUME( m_pFuncs[0] != NULL ); - - m_dwCallFlags = m_pFuncs[0]->dwCallFlags; - - size_t i; - for (i=0; m_pFuncs[i] != NULL; i++) - { - const _soapmap *pMap = m_pFuncs[i]; - HRESULT hr = GenerateWSDLHelper(pMap, m_structMap, m_enumMap); - if (FAILED(hr)) - { - return hr; - } - } - - m_pHeaders = pHdlr->GetHeaderMap(); - if (m_pHeaders != NULL) - { - for (i=0; m_pHeaders[i] != NULL; i++) - { - const _soapmap *pMap = m_pHeaders[i]; - HRESULT hr = GenerateWSDLHelper(pMap, m_structMap, m_enumMap); - if (FAILED(hr)) - { - return hr; - } - } - - for (i=0; m_pHeaders[i] != NULL; i++) - { - const _soapmap *pMap = m_pHeaders[i]; - for (size_t j=0; pMap->pEntries[j].nHash != 0; j++) - { - HRESULT hr = S_OK; - _ATLTRY - { - if (m_headerMap.SetAt(pMap->pEntries[j].szField, &pMap->pEntries[j]) == NULL) - { - hr = E_OUTOFMEMORY; - } - } - _ATLCATCHALL() - { - hr = E_OUTOFMEMORY; - } - if (FAILED(hr)) - { - return hr; - } - } - } - } - - _ATLTRY - { - m_strServiceName = pHdlr->GetServiceName(); - m_strNamespaceUri = pHdlr->GetNamespaceUriA(); - } - _ATLCATCHALL() - { - return E_OUTOFMEMORY; - } - return S_OK; - } - - virtual const char * GetHandlerName() = 0; - -public: - - _CSDLGenerator() - :m_pFuncs(NULL), m_nFunc(-1), m_nParam(-1), - m_currUDTPos(NULL), m_nCurrUDTField(-1), - m_pWriteStream(NULL), m_nHeader(-1), m_currHeaderPos(NULL) - { - } - virtual ~_CSDLGenerator() - { - } - - HTTP_CODE OnGetURL() - { - char szURL[ATL_URL_MAX_URL_LENGTH]; - DWORD dwUrlSize = sizeof(szURL); - char szServer[ATL_URL_MAX_HOST_NAME_LENGTH]; - DWORD dwServerSize = sizeof(szServer); - char szHttps[16]; - DWORD dwHttpsLen = sizeof(szHttps); - char szPort[ATL_URL_MAX_PORT_NUMBER_LENGTH+1]; - DWORD dwPortLen = sizeof(szPort); - - if (m_spHttpServerContext->GetServerVariable("URL", szURL, &dwUrlSize) != FALSE) - { - if (m_spHttpServerContext->GetServerVariable("SERVER_NAME", szServer, &dwServerSize) != FALSE) - { - bool bHttps = false; - if ((m_spHttpServerContext->GetServerVariable("HTTPS", szHttps, &dwHttpsLen) != FALSE) && - (!_stricmp(szHttps, "ON"))) - { - bHttps = true; - } - - if (m_spHttpServerContext->GetServerVariable("SERVER_PORT", szPort, &dwPortLen) != FALSE) - { - _ATLTRY - { - CStringA strUrl; - strUrl.Format("http%s://%s:%s%s?Handler=%s", bHttps ? "s" : "", szServer, szPort, szURL, GetHandlerName()); - - CA2W wszUrl(strUrl); - wchar_t *pwszUrl = wszUrl; - HRESULT hr = AtlGenXMLValue(m_pWriteStream, &pwszUrl); - return SUCCEEDED(hr) ? HTTP_SUCCESS : HTTP_FAIL; - } - _ATLCATCHALL() - { - return HTTP_FAIL; - } - } - } - } - return HTTP_FAIL; - } - - HTTP_CODE OnGetNamespace() - { - return (m_pWriteStream->WriteStream(m_strNamespaceUri, - m_strNamespaceUri.GetLength(), NULL) == S_OK) ? HTTP_SUCCESS : HTTP_FAIL; - } - - HTTP_CODE OnGetNextFunction() - { - m_nFunc++; - if (m_pFuncs[m_nFunc] == NULL) - { - m_nFunc = -1; - return HTTP_S_FALSE; - } - return HTTP_SUCCESS; - } - - HTTP_CODE OnGetFunctionName() - { - return (m_pWriteStream->WriteStream(m_pFuncs[m_nFunc]->szName, - m_pFuncs[m_nFunc]->cchName, NULL) == S_OK) ? HTTP_SUCCESS : HTTP_S_FALSE; - } - - HTTP_CODE OnGetNextParameter() - { - ++m_nParam; - if (m_pFuncs[m_nFunc]->pEntries[m_nParam].nHash != 0) - { - if (m_pFuncs[m_nFunc]->pEntries[m_nParam].dwFlags & SOAPFLAG_NOMARSHAL) - { - return OnGetNextParameter(); - } - return HTTP_SUCCESS; - } - m_nParam = -1; - return HTTP_S_FALSE; - } - - HTTP_CODE OnIsInParameter() - { - return (m_pFuncs[m_nFunc]->pEntries[m_nParam].dwFlags & SOAPFLAG_IN) ? HTTP_SUCCESS : HTTP_S_FALSE; - } - - HTTP_CODE OnGetParameterName() - { - HRESULT hr = S_OK; - if (m_pFuncs[m_nFunc]->pEntries[m_nParam].dwFlags & SOAPFLAG_RETVAL) - { - hr = m_pWriteStream->WriteStream("return", sizeof("return")-1, NULL); - } - else - { - hr = m_pWriteStream->WriteStream(m_pFuncs[m_nFunc]->pEntries[m_nParam].szField, - m_pFuncs[m_nFunc]->pEntries[m_nParam].cchField, NULL); - } - - return (hr == S_OK) ? HTTP_SUCCESS : HTTP_FAIL; - } - - HTTP_CODE OnNotIsArrayParameter() - { - return (m_pFuncs[m_nFunc]->pEntries[m_nParam].dwFlags & (SOAPFLAG_FIXEDARR | SOAPFLAG_DYNARR)) - ? HTTP_S_FALSE: HTTP_SUCCESS; - } - - HTTP_CODE OnIsParameterUDT() - { - return IsUDT(&m_pFuncs[m_nFunc]->pEntries[m_nParam]); - } - - HTTP_CODE OnGetParameterSoapType() - { - if (m_pFuncs[m_nFunc]->pEntries[m_nParam].nVal != SOAPTYPE_UNK) - { - return GetSoapType(m_pFuncs[m_nFunc]->pEntries[m_nParam].nVal, m_pWriteStream); - } - ATLASSUME( m_pFuncs[m_nFunc]->pEntries[m_nParam].pChain != NULL ); - return (m_pWriteStream->WriteStream(m_pFuncs[m_nFunc]->pEntries[m_nParam].pChain->szName, - m_pFuncs[m_nFunc]->pEntries[m_nParam].pChain->cchName, NULL) == S_OK) ? HTTP_SUCCESS : HTTP_S_FALSE; - } - - HTTP_CODE OnIsParameterDynamicArray() - { - return (m_pFuncs[m_nFunc]->pEntries[m_nParam].dwFlags & SOAPFLAG_DYNARR) ? HTTP_SUCCESS: HTTP_S_FALSE; - } - - HTTP_CODE OnIsArrayParameter() - { - return (OnNotIsArrayParameter() != HTTP_SUCCESS) ? HTTP_SUCCESS : HTTP_S_FALSE; - } - - HTTP_CODE OnIsParameterOneDimensional() - { - return (m_pFuncs[m_nFunc]->pEntries[m_nParam].pDims[0] == 1) ? HTTP_SUCCESS : HTTP_S_FALSE; - } - - HTTP_CODE OnGetParameterArraySize() - { - return (m_writeHelper.Write(m_pFuncs[m_nFunc]->pEntries[m_nParam].pDims[1]) != FALSE) - ? HTTP_SUCCESS : HTTP_FAIL; - } - - HTTP_CODE OnGetParameterArraySoapDims() - { - return GetSoapDims(&m_pFuncs[m_nFunc]->pEntries[m_nParam]); - } - - HTTP_CODE OnIsOutParameter() - { - return (m_pFuncs[m_nFunc]->pEntries[m_nParam].dwFlags & SOAPFLAG_OUT) ? HTTP_SUCCESS : HTTP_S_FALSE; - } - - HTTP_CODE OnGetNextEnum() - { - if (m_currUDTPos == NULL) - { - m_currUDTPos = m_enumMap.GetStartPosition(); - } - else - { - m_enumMap.GetNext(m_currUDTPos); - } - - return (m_currUDTPos != NULL) ? HTTP_SUCCESS : HTTP_S_FALSE; - } - - HTTP_CODE OnGetEnumName() - { - const _soapmap *pMap = m_enumMap.GetValueAt(m_currUDTPos); - return (m_pWriteStream->WriteStream(pMap->szName, pMap->cchName, NULL) == S_OK) ? HTTP_SUCCESS : HTTP_S_FALSE; - } - - HTTP_CODE OnGetNextEnumElement() - { - const _soapmap *pMap = m_enumMap.GetValueAt(m_currUDTPos); - ++m_nCurrUDTField; - if (pMap->pEntries[m_nCurrUDTField].nHash != 0) - { - return HTTP_SUCCESS; - } - m_nCurrUDTField = -1; - return HTTP_S_FALSE; - } - - HTTP_CODE OnGetEnumElementName() - { - const _soapmap *pMap = m_enumMap.GetValueAt(m_currUDTPos); - return (m_pWriteStream->WriteStream(pMap->pEntries[m_nCurrUDTField].szField, - pMap->pEntries[m_nCurrUDTField].cchField, NULL) == S_OK) ? HTTP_SUCCESS : HTTP_S_FALSE; - } - - HTTP_CODE OnGetNextStruct() - { - if (m_currUDTPos == NULL) - { - m_currUDTPos = m_structMap.GetStartPosition(); - } - else - { - m_structMap.GetNext(m_currUDTPos); - } - - return (m_currUDTPos != NULL) ? HTTP_SUCCESS : HTTP_S_FALSE; - } - - HTTP_CODE OnGetStructName() - { - const _soapmap *pMap = m_enumMap.GetValueAt(m_currUDTPos); - return (m_pWriteStream->WriteStream(pMap->szName, pMap->cchName, NULL) == S_OK) ? HTTP_SUCCESS : HTTP_S_FALSE; - } - - HTTP_CODE OnGetNextStructField() - { - const _soapmap *pMap = m_structMap.GetValueAt(m_currUDTPos); - ++m_nCurrUDTField; - if (pMap->pEntries[m_nCurrUDTField].nHash != 0) - { - return HTTP_SUCCESS; - } - m_nCurrUDTField = -1; - return HTTP_S_FALSE; - } - - HTTP_CODE OnGetStructFieldName() - { - const _soapmap *pMap = m_structMap.GetValueAt(m_currUDTPos); - return (m_pWriteStream->WriteStream(pMap->pEntries[m_nCurrUDTField].szField, - pMap->pEntries[m_nCurrUDTField].cchField, NULL) == S_OK) ? HTTP_SUCCESS : HTTP_S_FALSE; - } - - HTTP_CODE OnNotIsArrayField() - { - const _soapmap *pMap = m_structMap.GetValueAt(m_currUDTPos); - return (pMap->pEntries[m_nCurrUDTField].dwFlags & (SOAPFLAG_FIXEDARR | SOAPFLAG_DYNARR)) ? HTTP_S_FALSE : HTTP_SUCCESS; - } - - HTTP_CODE OnIsFieldUDT() - { - const _soapmap *pMap = m_structMap.GetValueAt(m_currUDTPos); - return IsUDT(&pMap->pEntries[m_nCurrUDTField]); - } - - HTTP_CODE OnGetStructFieldSoapType() - { - const _soapmap *pMap = m_structMap.GetValueAt(m_currUDTPos); - if (pMap->pEntries[m_nCurrUDTField].nVal != SOAPTYPE_UNK) - { - return GetSoapType(pMap->pEntries[m_nCurrUDTField].nVal, m_pWriteStream); - } - ATLASSERT( pMap->pEntries[m_nCurrUDTField].pChain != NULL ); - return (m_pWriteStream->WriteStream(pMap->pEntries[m_nCurrUDTField].pChain->szName, - pMap->pEntries[m_nCurrUDTField].pChain->cchName, NULL) == S_OK) ? HTTP_SUCCESS : HTTP_S_FALSE; - } - - HTTP_CODE OnIsArrayField() - { - return (OnNotIsArrayField() != HTTP_SUCCESS) ? HTTP_SUCCESS : HTTP_S_FALSE; - } - - HTTP_CODE OnIsFieldDynamicArray() - { - const _soapmap *pMap = m_structMap.GetValueAt(m_currUDTPos); - return (pMap->pEntries[m_nCurrUDTField].dwFlags & SOAPFLAG_DYNARR) ? HTTP_SUCCESS : HTTP_S_FALSE; - } - - HTTP_CODE OnGetFieldSizeIsName() - { - const _soapmap *pMap = m_structMap.GetValueAt(m_currUDTPos); - int nIndex = pMap->pEntries[m_nCurrUDTField].nSizeIs; - ATLASSERT( nIndex >= 0 ); - return (m_pStream->WriteStream(pMap->pEntries[nIndex].szField, - pMap->pEntries[nIndex].cchField, NULL) == S_OK) ? HTTP_SUCCESS : HTTP_S_FALSE; - } - - HTTP_CODE OnIsFieldOneDimensional() - { - const _soapmap *pMap = m_structMap.GetValueAt(m_currUDTPos); - return (pMap->pEntries[m_nCurrUDTField].pDims[0] == 1) ? HTTP_SUCCESS : HTTP_S_FALSE; - } - - HTTP_CODE OnGetFieldArraySize() - { - const _soapmap *pMap = m_structMap.GetValueAt(m_currUDTPos); - return (m_writeHelper.Write(pMap->pEntries[m_nCurrUDTField].pDims[1]) != FALSE) ? - HTTP_SUCCESS : HTTP_S_FALSE; - } - - HTTP_CODE OnGetFieldArraySoapDims() - { - const _soapmap *pMap = m_structMap.GetValueAt(m_currUDTPos); - return GetSoapDims(&pMap->pEntries[m_nCurrUDTField]); - } - - HTTP_CODE OnGetServiceName() - { - return (m_pWriteStream->WriteStream(m_strServiceName, - m_strServiceName.GetLength(), NULL) == S_OK) ? HTTP_SUCCESS : HTTP_FAIL; - } - - HTTP_CODE OnGetNextHeader() - { - if (m_currHeaderPos == NULL) - { - m_currHeaderPos = m_headerMap.GetStartPosition(); - } - else - { - m_headerMap.GetNext(m_currHeaderPos); - } - - return (m_currHeaderPos != NULL) ? HTTP_SUCCESS : HTTP_S_FALSE; - } - - HTTP_CODE OnIsInHeader() - { - return (m_pHeaders[m_nFunc]->pEntries[m_nHeader].dwFlags & SOAPFLAG_IN) - ? HTTP_SUCCESS : HTTP_S_FALSE; - } - - HTTP_CODE OnIsOutHeader() - { - return (m_pHeaders[m_nFunc]->pEntries[m_nHeader].dwFlags & SOAPFLAG_OUT) - ? HTTP_SUCCESS : HTTP_S_FALSE; - } - - HTTP_CODE OnIsRequiredHeader() - { - return (m_pHeaders[m_nFunc]->pEntries[m_nHeader].dwFlags & SOAPFLAG_MUSTUNDERSTAND) - ? HTTP_SUCCESS : HTTP_S_FALSE; - } - - HTTP_CODE OnGetHeaderName() - { - const _soapmapentry *pEntry = m_headerMap.GetValueAt(m_currHeaderPos); - return (m_pWriteStream->WriteStream(pEntry->szField, - pEntry->cchField, NULL) == S_OK) ? HTTP_SUCCESS : HTTP_FAIL; - } - - HTTP_CODE OnNotIsArrayHeader() - { - const _soapmapentry *pEntry = m_headerMap.GetValueAt(m_currHeaderPos); - return (pEntry->dwFlags & SOAPFLAG_FIXEDARR) ? HTTP_S_FALSE : HTTP_SUCCESS; - } - - HTTP_CODE OnIsHeaderUDT() - { - return IsUDT(m_headerMap.GetValueAt(m_currHeaderPos)); - } - - HTTP_CODE OnGetHeaderSoapType() - { - const _soapmapentry *pEntry = m_headerMap.GetValueAt(m_currHeaderPos); - if (pEntry->nVal != SOAPTYPE_UNK) - { - return GetSoapType(pEntry->nVal, m_pWriteStream); - } - ATLENSURE( pEntry->pChain != NULL ); - return (m_pWriteStream->WriteStream(pEntry->pChain->szName, - pEntry->pChain->cchName, NULL) == S_OK) ? HTTP_SUCCESS : HTTP_S_FALSE; - } - - HTTP_CODE OnIsHeaderOneDimensional() - { - const _soapmapentry *pEntry = m_headerMap.GetValueAt(m_currHeaderPos); - return (pEntry->pDims[0] == 1) ? HTTP_SUCCESS : HTTP_S_FALSE; - } - - HTTP_CODE OnGetHeaderArraySize() - { - const _soapmapentry *pEntry = m_headerMap.GetValueAt(m_currHeaderPos); - return (m_writeHelper.Write(pEntry->pDims[1]) != FALSE) ? - HTTP_SUCCESS : HTTP_S_FALSE; - } - - HTTP_CODE OnGetHeaderArraySoapDims() - { - return GetSoapDims(m_headerMap.GetValueAt(m_currHeaderPos)); - } - - HTTP_CODE OnGetNextFunctionHeader() - { - ++m_nHeader; - if (m_pHeaders[m_nFunc]->pEntries[m_nHeader].nHash != 0) - { - if (m_pHeaders[m_nFunc]->pEntries[m_nHeader].dwFlags & SOAPFLAG_NOMARSHAL) - { - return OnGetNextHeader(); - } - return HTTP_SUCCESS; - } - m_nHeader = -1; - return HTTP_S_FALSE; - } - - HTTP_CODE OnGetFunctionHeaderName() - { - return (m_pWriteStream->WriteStream( - m_pHeaders[m_nFunc]->pEntries[m_nHeader].szField, - m_pHeaders[m_nFunc]->pEntries[m_nHeader].cchField, - NULL) == S_OK) ? HTTP_SUCCESS : HTTP_FAIL; - } - - HTTP_CODE OnIsArrayHeader() - { - return (OnNotIsArrayHeader() == HTTP_SUCCESS) ? HTTP_S_FALSE : HTTP_SUCCESS; - } - - HTTP_CODE OnIsDocumentLiteral() - { - if ((m_dwCallFlags & (SOAPFLAG_DOCUMENT | SOAPFLAG_LITERAL)) == - (SOAPFLAG_DOCUMENT | SOAPFLAG_LITERAL)) - { - return HTTP_SUCCESS; - } - return HTTP_S_FALSE; - } - - HTTP_CODE OnIsRpcEncoded() - { - if ((m_dwCallFlags & (SOAPFLAG_RPC | SOAPFLAG_ENCODED)) == - (SOAPFLAG_RPC | SOAPFLAG_ENCODED)) - { - return HTTP_SUCCESS; - } - return HTTP_S_FALSE; - } - -#pragma warning (push) -#pragma warning (disable : 4640) // construction of local static object is not thread-safe - - BEGIN_REPLACEMENT_METHOD_MAP(_CSDLGenerator) - REPLACEMENT_METHOD_ENTRY("GetNamespace", OnGetNamespace) - REPLACEMENT_METHOD_ENTRY("GetNextFunction", OnGetNextFunction) - REPLACEMENT_METHOD_ENTRY("GetFunctionName", OnGetFunctionName) - REPLACEMENT_METHOD_ENTRY("GetNextParameter", OnGetNextParameter) - REPLACEMENT_METHOD_ENTRY("IsInParameter", OnIsInParameter) - REPLACEMENT_METHOD_ENTRY("GetParameterName", OnGetParameterName) - REPLACEMENT_METHOD_ENTRY("NotIsArrayParameter", OnNotIsArrayParameter) - REPLACEMENT_METHOD_ENTRY("IsParameterUDT", OnIsParameterUDT) - REPLACEMENT_METHOD_ENTRY("GetParameterSoapType", OnGetParameterSoapType) - REPLACEMENT_METHOD_ENTRY("IsParameterDynamicArray", OnIsParameterDynamicArray) - REPLACEMENT_METHOD_ENTRY("IsArrayParameter", OnIsArrayParameter) - REPLACEMENT_METHOD_ENTRY("IsParameterOneDimensional", OnIsParameterOneDimensional) - REPLACEMENT_METHOD_ENTRY("GetParameterArraySize", OnGetParameterArraySize) - REPLACEMENT_METHOD_ENTRY("GetParameterArraySoapDims", OnGetParameterArraySoapDims) - REPLACEMENT_METHOD_ENTRY("IsOutParameter", OnIsOutParameter) - REPLACEMENT_METHOD_ENTRY("GetNextEnum", OnGetNextEnum) - REPLACEMENT_METHOD_ENTRY("GetEnumName", OnGetEnumName) - REPLACEMENT_METHOD_ENTRY("GetNextEnumElement", OnGetNextEnumElement) - REPLACEMENT_METHOD_ENTRY("GetEnumElementName", OnGetEnumElementName) - REPLACEMENT_METHOD_ENTRY("GetNextStruct", OnGetNextStruct) - REPLACEMENT_METHOD_ENTRY("GetStructName", OnGetStructName) - REPLACEMENT_METHOD_ENTRY("GetNextStructField", OnGetNextStructField) - REPLACEMENT_METHOD_ENTRY("GetStructFieldName", OnGetStructFieldName) - REPLACEMENT_METHOD_ENTRY("NotIsArrayField", OnNotIsArrayField) - REPLACEMENT_METHOD_ENTRY("IsFieldUDT", OnIsFieldUDT) - REPLACEMENT_METHOD_ENTRY("GetStructFieldSoapType", OnGetStructFieldSoapType) - REPLACEMENT_METHOD_ENTRY("IsArrayField", OnIsArrayField) - REPLACEMENT_METHOD_ENTRY("IsFieldOneDimensional", OnIsFieldOneDimensional) - REPLACEMENT_METHOD_ENTRY("GetFieldArraySize", OnGetFieldArraySize) - REPLACEMENT_METHOD_ENTRY("GetFieldArraySoapDims", OnGetFieldArraySoapDims) - REPLACEMENT_METHOD_ENTRY("GetServiceName", OnGetServiceName) - REPLACEMENT_METHOD_ENTRY("GetURL", OnGetURL) - - REPLACEMENT_METHOD_ENTRY("GetNextHeader", OnGetNextHeader) - REPLACEMENT_METHOD_ENTRY("GetHeaderName", OnGetHeaderName) - REPLACEMENT_METHOD_ENTRY("NotIsArrayHeader", OnNotIsArrayHeader) - REPLACEMENT_METHOD_ENTRY("IsArrayHeader", OnIsArrayHeader) - REPLACEMENT_METHOD_ENTRY("IsHeaderUDT", OnIsHeaderUDT) - REPLACEMENT_METHOD_ENTRY("GetHeaderSoapType", OnGetHeaderSoapType) - REPLACEMENT_METHOD_ENTRY("IsHeaderOneDimensional", OnIsHeaderOneDimensional) - REPLACEMENT_METHOD_ENTRY("GetHeaderArraySize", OnGetHeaderArraySize) - REPLACEMENT_METHOD_ENTRY("GetHeaderArraySoapDims", OnGetHeaderArraySoapDims) - REPLACEMENT_METHOD_ENTRY("GetNextFunctionHeader", OnGetNextFunctionHeader) - REPLACEMENT_METHOD_ENTRY("GetFunctionHeaderName", OnGetFunctionHeaderName) - REPLACEMENT_METHOD_ENTRY("IsInHeader", OnIsInHeader) - REPLACEMENT_METHOD_ENTRY("IsOutHeader", OnIsOutHeader) - REPLACEMENT_METHOD_ENTRY("IsRequiredHeader", OnIsRequiredHeader) - - REPLACEMENT_METHOD_ENTRY("IsDocumentLiteral", OnIsDocumentLiteral) - REPLACEMENT_METHOD_ENTRY("IsRpcEncoded", OnIsRpcEncoded) - REPLACEMENT_METHOD_ENTRY("IsFieldDynamicArray", OnIsFieldDynamicArray) - REPLACEMENT_METHOD_ENTRY("GetFieldSizeIsName", OnGetFieldSizeIsName) - END_REPLACEMENT_METHOD_MAP() - -#pragma warning (pop) - -}; // class _CSDLGenerator - -template -class CSDLGenerator : - public _CSDLGenerator, - public IRequestHandlerImpl< CSDLGenerator >, - public CComObjectRootEx -{ -private: - -public: - typedef CSDLGenerator _sdlGenerator; - - BEGIN_COM_MAP(_sdlGenerator) - COM_INTERFACE_ENTRY(IRequestHandler) - COM_INTERFACE_ENTRY(ITagReplacer) - END_COM_MAP() - - HTTP_CODE InitializeHandler(AtlServerRequest *pRequestInfo, IServiceProvider *pServiceProvider) - { - IRequestHandlerImpl::InitializeHandler(pRequestInfo, pServiceProvider); - - CComObjectStack handler; - if (FAILED(InitializeSDL(&handler))) - { - return HTTP_FAIL; - } - - CStencil s; - HTTP_CODE hcErr = s.LoadFromString(s_szAtlsWSDLSrf, (DWORD) strlen(s_szAtlsWSDLSrf)); - if (hcErr == HTTP_SUCCESS) - { - hcErr = HTTP_FAIL; - CHttpResponse HttpResponse(pRequestInfo->pServerContext); - HttpResponse.SetContentType("text/xml"); - if (s.ParseReplacements(this) != false) - { - s.FinishParseReplacements(); - - SetStream(&HttpResponse); - SetWriteStream(&HttpResponse); - SetHttpServerContext(m_spServerContext); - - ATLASSERT( s.ParseSuccessful() != false ); - - hcErr = s.Render(this, &HttpResponse); - } - } - - return hcErr; - } - - const char * GetHandlerName() - { - return szHandlerName; - } -}; // class CSDLGenerator - -} // namespace ATL -#pragma pack(pop) - -#pragma warning(pop) - -#endif // __ATLSOAP_H__ diff --git a/include/atl/atlspriv.h b/include/atl/atlspriv.h deleted file mode 100644 index f278e4761..000000000 --- a/include/atl/atlspriv.h +++ /dev/null @@ -1,1017 +0,0 @@ -// This is a part of the Active Template Library. -// Copyright (C) Microsoft Corporation -// All rights reserved. -// -// This source code is only intended as a supplement to the -// Active Template Library Reference and related -// electronic documentation provided with the library. -// See these sources for detailed information regarding the -// Active Template Library product. - -#ifndef __ATLSPRIV_H__ -#define __ATLSPRIV_H__ - -#pragma once -#include - -#ifndef _WINSOCK2API_ -#error Winsock2.h has to be included before including windows.h or use atlbase.h instead of windows.h -#endif - -#ifndef _ATL_NO_DEFAULT_LIBS -#pragma comment(lib, "ws2_32.lib") -#endif // !_ATL_NO_DEFAULT_LIBS - -#include -#include -#include -#include - -// ATL_SOCK_TIMEOUT defines the amount of time -// this socket will block the calling thread waiting -// for the socket before the call times out. -#ifndef ATL_SOCK_TIMEOUT - #define ATL_SOCK_TIMEOUT 10000 -#endif - -#define ATL_WINSOCK_VER MAKELONG(2,0) - -// This file contains unsupported code used in ATL implementation files. Most of -// this code is support code for various ATL Server functions. -#pragma pack(push,_ATL_PACKING) -namespace ATL{ - - // One of these objects can be created globally to turn -// on the socket stuff at CRT startup and shut it down -// on CRT term. -class _AtlWSAInit -{ -public: - _AtlWSAInit() throw() - { - m_dwErr = WSAEFAULT; - } - - bool Init() - { - if (!IsStarted()) - m_dwErr = WSAStartup(ATL_WINSOCK_VER, &m_stData); - - return m_dwErr == 0; - } - - bool IsStarted(){ return m_dwErr == 0; } - - ~_AtlWSAInit() throw() - { - if (!m_dwErr) - WSACleanup(); - } - - WSADATA m_stData; - DWORD m_dwErr; -}; - -#ifndef _ATL_NO_GLOBAL_SOCKET_STARTUP - __declspec(selectany)_AtlWSAInit g_HttpInit; -#endif - - -class ZEvtSyncSocket -{ -public: - ZEvtSyncSocket() throw(); - ~ZEvtSyncSocket() throw(); - operator SOCKET() throw(); - void Close() throw(); - void Term() throw(); - bool Create(const ADDRINFOT* pAI, WORD wFlags=0) throw(); - bool Create(int af, int st, int proto, WORD wFlags=0) throw(); - bool Connect(LPCTSTR szAddr, unsigned short nPort) throw(); - bool Connect(const SOCKADDR* psa, int len) throw(); - bool Connect(const ADDRINFOT *pAI) throw(); - bool Write(WSABUF *pBuffers, int nCount, DWORD *pdwSize) throw(); - bool Write(const unsigned char *pBuffIn, DWORD *pdwSize) throw(); - bool Read(const unsigned char *pBuff, DWORD *pdwSize) throw(); - bool Init(SOCKET hSocket, void * /*pData=NULL*/) throw(); - DWORD GetSocketTimeout() throw(); - DWORD SetSocketTimeout(DWORD dwNewTimeout) throw(); - bool SupportsScheme(ATL_URL_SCHEME scheme) throw(); - -protected: - DWORD m_dwCreateFlags; - WSAEVENT m_hEventRead; - WSAEVENT m_hEventWrite; - WSAEVENT m_hEventConnect; - - CComAutoCriticalSection m_csRead; - CComAutoCriticalSection m_csWrite; - SOCKET m_socket; - bool m_bConnected; - DWORD m_dwLastError; - DWORD m_dwSocketTimeout; -}; -inline bool _AtlIsHttpSpace(TCHAR c) -{ - return (c == 0x09 || - c == 0x0A || - c == 0x0D || - c == 0x20); -} - -// MIME helper functions - -extern __declspec(selectany) const DWORD ATL_MIME_DEFAULT_CP = 28591; - -// This function is used to create an CSMTPConnection-compatible recipient string -// from a recipient string that is in a CMimeMessage object. -inline BOOL AtlMimeMakeRecipientsString(_In_ LPCSTR szNames, _Out_z_cap_post_count_(*pdwLen, *pdwLen) LPSTR szRecipients, _Inout_ LPDWORD pdwLen) -{ - ATLENSURE(szNames != NULL); - ATLENSURE(szRecipients != NULL); - ATLENSURE(pdwLen != NULL); - - char ch; - DWORD dwLen = 0; - while ((ch = *szNames++) != '\0') - { - // Skip everything that is in double quotes - if (ch == '"') - { - while (*szNames && *szNames++ != '"'); - } - if (ch == '<') - { - // Extract the address from within the <> - while (*szNames && *szNames != '>') - { - if( dwLen >= *pdwLen ) - { - return FALSE; - } - *szRecipients++ = *szNames++; - dwLen++; - } - if( dwLen >= *pdwLen ) - { - return FALSE; - } - // End it with a comma - *szRecipients++ = ','; - dwLen++; - } - if (ch == '=') - { - // Skip any BEncoded or QEncoded parts - while (*szNames) - { - if (*szNames == '?' && *(szNames+1) == '=') - { - szNames+=2; - break; - } - szNames++; - } - } - szNames++; - } - if (dwLen != 0) - { - szRecipients--; - dwLen--; - } - *szRecipients = '\0'; - *pdwLen = dwLen; - - return TRUE; -} - -// AtlMimeCharsetFromCodePage, AtlMimeConvertString -// are MIME multilanguage support functions. - -// Get the MIME character set of the of the code page. The character set is copied -// into szCharset. - -#ifndef ATLSMTP_DEFAULT_CSET - #define ATLSMTP_DEFAULT_CSET "iso-8859-1" -#endif - -inline BOOL AtlMimeCharsetFromCodePage(_Out_z_cap_(cch) LPSTR szCharset, _In_ UINT uiCodePage, _In_opt_ IMultiLanguage* pMultiLanguage, _In_ size_t cch) throw() -{ - ATLASSERT(szCharset != NULL); - - if (!pMultiLanguage) - { - if ((uiCodePage == 0) || (uiCodePage == ATL_MIME_DEFAULT_CP)) - { - ATLASSERT(_countof(ATLSMTP_DEFAULT_CSET) <= cch); - Checked::strcpy_s(szCharset, cch, ATLSMTP_DEFAULT_CSET); - } - else - { - return FALSE; - } - } - else - { - if (uiCodePage == 0) - uiCodePage = GetACP(); - - HRESULT hr; - MIMECPINFO cpInfo; - memset(&cpInfo, 0x00, sizeof(cpInfo)); - -#ifdef __IMultiLanguage2_INTERFACE_DEFINED__ - - // if IMultiLanguage2 is available, use it - CComPtr spMultiLanguage2; - hr = pMultiLanguage->QueryInterface(__uuidof(IMultiLanguage2), (void **)&spMultiLanguage2); - if (FAILED(hr) || !spMultiLanguage2.p) - hr = pMultiLanguage->GetCodePageInfo(uiCodePage, &cpInfo); - else - hr = spMultiLanguage2->GetCodePageInfo(uiCodePage, - LANGIDFROMLCID(GetThreadLocale()), &cpInfo); - -#else // __IMultiLanguage2_INTERFACE_DEFINED__ - - hr = pMultiLanguage->GetCodePageInfo(uiCodePage, &cpInfo); - -#endif // __IMultiLanguage2_INTERFACE_DEFINED__ - - if (hr != S_OK) - return FALSE; - _ATLTRY - { - CW2A charSet(cpInfo.wszWebCharset); - if (strlen(charSet) >= cch) - return FALSE; - Checked::strcpy_s(szCharset, cch, charSet); - } - _ATLCATCHALL() - { - return FALSE; - } - } - - return TRUE; -} - -inline BOOL AtlMimeConvertStringW( - _In_ IMultiLanguage *pMultiLanguage, - _In_ UINT uiCodePage, - _In_ LPCWSTR wszIn, - _Out_z_cap_post_count_(*pnLen, *pnLen) LPSTR *ppszOut, - _Inout_ UINT *pnLen) throw() -{ - ATLENSURE_RETURN_VAL( pMultiLanguage != NULL, FALSE ); - ATLENSURE_RETURN_VAL( wszIn != NULL, FALSE ); - ATLENSURE_RETURN_VAL( ppszOut != NULL, FALSE ); - ATLENSURE_RETURN_VAL( pnLen != NULL, FALSE ); - - *ppszOut = NULL; - *pnLen = 0; - - if (uiCodePage == 0) - { - uiCodePage = GetACP(); - } - - DWORD dwMode = 0; - CHeapPtr pszOut; - - // get the length - HRESULT hr = pMultiLanguage->ConvertStringFromUnicode(&dwMode, uiCodePage, const_cast(wszIn), NULL, NULL, pnLen); - if (SUCCEEDED(hr)) - { - // allocate the buffer - if (pszOut.Allocate(*pnLen)) - { - dwMode = 0; - // do the conversion - hr = pMultiLanguage->ConvertStringFromUnicode(&dwMode, uiCodePage, const_cast(wszIn), NULL, pszOut, pnLen); - if (SUCCEEDED(hr)) - { - *ppszOut = pszOut.Detach(); - return TRUE; - } - } - } - - return FALSE; -} - -inline BOOL AtlMimeConvertStringA( - _In_ IMultiLanguage *pMultiLanguage, - _In_ UINT uiCodePage, - _In_ LPCSTR szIn, - _Out_z_cap_post_count_(*pnLen, *pnLen) LPSTR *ppszOut, - _Inout_ UINT *pnLen) throw() -{ - _ATLTRY - { - return AtlMimeConvertStringW(pMultiLanguage, uiCodePage, CA2W(szIn), ppszOut, pnLen); - } - _ATLCATCHALL() - { - return FALSE; - } -} - -#ifdef _UNICODE - #define AtlMimeConvertString AtlMimeConvertStringW -#else - #define AtlMimeConvertString AtlMimeConvertStringA -#endif - -class CStreamOnSequentialStream : - public IStream -{ - CComPtr m_spStream; -public: - CStreamOnSequentialStream(ISequentialStream *pStream) throw() - { - ATLASSERT(pStream); - m_spStream = pStream; - } - virtual ~CStreamOnSequentialStream() - { - } - - STDMETHOD(Read)(void *pv, ULONG cb, ULONG *pcbRead) throw() - { - if (!m_spStream) - return E_UNEXPECTED; - return m_spStream->Read(pv, cb, pcbRead); - } - - STDMETHOD(Write)(const void *pv, ULONG cb, ULONG *pcbWritten) throw() - { - if (!m_spStream) - return E_UNEXPECTED; - return m_spStream->Write(pv, cb, pcbWritten); - } - - STDMETHOD(Seek)(LARGE_INTEGER , DWORD , ULARGE_INTEGER *) throw() - { - return E_NOTIMPL; - } - - STDMETHOD(SetSize)(ULARGE_INTEGER ) throw() - { - return E_NOTIMPL; - } - - STDMETHOD(CopyTo)(IStream *, ULARGE_INTEGER , ULARGE_INTEGER *, - ULARGE_INTEGER *) throw() - { - return E_NOTIMPL; - } - - STDMETHOD(Commit)(DWORD ) throw() - { - return E_NOTIMPL; - } - - STDMETHOD(Revert)( void) throw() - { - return E_NOTIMPL; - } - - STDMETHOD(LockRegion)(ULARGE_INTEGER , ULARGE_INTEGER , DWORD ) throw() - { - return E_NOTIMPL; - } - - STDMETHOD(UnlockRegion)(ULARGE_INTEGER , ULARGE_INTEGER , - DWORD ) throw() - { - return E_NOTIMPL; - } - - STDMETHOD(Stat)(STATSTG *, DWORD ) throw() - { - return E_NOTIMPL; - } - - STDMETHOD(Clone)(IStream **) throw() - { - return E_NOTIMPL; - } - - STDMETHOD(QueryInterface)(REFIID iid, void **ppUnk) throw() - { - *ppUnk = NULL; - if (::InlineIsEqualGUID(iid, IID_IUnknown) || - ::InlineIsEqualGUID(iid, IID_ISequentialStream) || - ::InlineIsEqualGUID(iid, IID_IStream)) - { - *ppUnk = (void*)(IStream*)this; - AddRef(); - return S_OK; - } - return E_NOINTERFACE; - } - - ULONG STDMETHODCALLTYPE AddRef( void) throw() - { - return (ULONG)1; - } - - ULONG STDMETHODCALLTYPE Release( void) throw() - { - return (ULONG)1; - } -}; - -class CStreamOnByteArray : - public IStream -{ -public: - BYTE *m_pArray; - DWORD m_dwRead; - - CStreamOnByteArray(BYTE *pBytes) throw() - { - ATLASSERT(pBytes); - m_pArray = pBytes; - m_dwRead = 0; - } - - STDMETHOD(Read)(void *pv, ULONG cb, ULONG *pcbRead) throw() - { - if (!pv) - return E_INVALIDARG; - - if (cb == 0) - return S_OK; - - if (!m_pArray) - return E_UNEXPECTED; - - BYTE *pCurr = m_pArray; - pCurr += m_dwRead; - Checked::memcpy_s(pv, cb, pCurr, cb); - if (pcbRead) - *pcbRead = cb; - m_dwRead += cb; - return S_OK; - } - - STDMETHOD(Write)(const void* , ULONG , ULONG* ) throw() - { - return E_UNEXPECTED; - } - - STDMETHOD(Seek)(LARGE_INTEGER , DWORD , ULARGE_INTEGER *) throw() - { - return E_NOTIMPL; - } - - STDMETHOD(SetSize)(ULARGE_INTEGER ) throw() - { - return E_NOTIMPL; - } - - STDMETHOD(CopyTo)(IStream *, ULARGE_INTEGER , ULARGE_INTEGER *, - ULARGE_INTEGER *) throw() - { - return E_NOTIMPL; - } - - STDMETHOD(Commit)(DWORD ) throw() - { - return E_NOTIMPL; - } - - STDMETHOD(Revert)( void) throw() - { - return E_NOTIMPL; - } - - STDMETHOD(LockRegion)(ULARGE_INTEGER , ULARGE_INTEGER , DWORD ) throw() - { - return E_NOTIMPL; - } - - STDMETHOD(UnlockRegion)(ULARGE_INTEGER , ULARGE_INTEGER , - DWORD ) throw() - { - return E_NOTIMPL; - } - - STDMETHOD(Stat)(STATSTG *, DWORD ) throw() - { - return E_NOTIMPL; - } - - STDMETHOD(Clone)(IStream **) throw() - { - return E_NOTIMPL; - } - - STDMETHOD(QueryInterface)(REFIID iid, void **ppUnk) throw() - { - *ppUnk = NULL; - if (::InlineIsEqualGUID(iid, IID_IUnknown) || - ::InlineIsEqualGUID(iid, IID_ISequentialStream) || - ::InlineIsEqualGUID(iid, IID_IStream)) - { - *ppUnk = (void*)(IStream*)this; - AddRef(); - return S_OK; - } - return E_NOINTERFACE; - } - - ULONG STDMETHODCALLTYPE AddRef( void) throw() - { - return (ULONG)1; - } - - ULONG STDMETHODCALLTYPE Release( void) throw() - { - return (ULONG)1; - } -}; - -class CVariantStream : - public IStream -{ -public: - CVariantStream() throw() - { - m_nCurrRead = 0; - m_nVariantSize = 0; - m_nRef = 1; - } - virtual ~CVariantStream() - { - } - - // input variant is put into contained BYTE array. - HRESULT InsertVariant(const VARIANT *pVarIn) throw() - { - CComVariant vIn; - HRESULT hr = E_FAIL; - m_nCurrRead = 0; - m_nVariantSize = 0; - hr = vIn.Attach(const_cast(pVarIn)); - if (hr == S_OK) - { - hr = vIn.WriteToStream(static_cast(this)); - vIn.Detach(const_cast(pVarIn)); - } - return hr; - } - - // variant is read from contained byte array into - // out variant. - HRESULT RetrieveVariant(VARIANT *pVarOut) throw() - { - CComVariant vOut; - HRESULT hr = vOut.ReadFromStream(static_cast(this)); - if (hr == S_OK) - hr = vOut.Detach(pVarOut); - - m_nCurrRead = 0; - return hr; - } - - HRESULT LoadFromStream(ISequentialStream *stream) throw() - { - m_nCurrRead = 0; - CStreamOnSequentialStream stm(stream); - CComVariant v; - HRESULT hr = v.ReadFromStream(&stm); - if (hr == S_OK) - hr = v.WriteToStream(static_cast(this)); - return hr; - } - - ISequentialStream* GetStream() throw() - { - return static_cast(this); - } - - size_t GetVariantSize() throw() - { - return m_nVariantSize; - } - -// Implementation - // IStream implementation; - STDMETHOD(Read)(void *pv, ULONG cb, ULONG *pcbRead) throw() - { - if (!pv) - return E_INVALIDARG; - - if (cb == 0) - return S_OK; - - if (pcbRead) - *pcbRead = 0; - - if (!m_nVariantSize) - return S_OK; // nothing to do. - - size_t nLeft = m_nVariantSize - m_nCurrRead; - if (nLeft > 0) - { - size_t nRead = __min(nLeft, cb); - BYTE *pCurr = m_stream; - pCurr += m_nCurrRead; - Checked::memcpy_s(pv, cb, pCurr, nRead); - m_nCurrRead += nRead; - if (pcbRead) - *pcbRead = (ULONG)nRead; - } - - return S_OK; - } - - STDMETHOD(Write)(const void *pv, ULONG cb, ULONG *pcbWritten) throw() - { - HRESULT hr = E_OUTOFMEMORY; - if (!pv) - return E_INVALIDARG; - - if (cb == 0) - return S_OK; - - if (pcbWritten) - *pcbWritten = 0; - - ULONG newsz = cb + (ULONG)m_nVariantSize; - if (newsz < cb || newsz < m_nVariantSize) - { - return E_OUTOFMEMORY; - } - BYTE *pBytes = NULL; - ATLTRY(pBytes = m_stream.Reallocate(newsz)); - if (pBytes) - { - pBytes += m_nVariantSize; - Checked::memcpy_s(pBytes, cb, pv, cb); - if (pcbWritten) - *pcbWritten = cb; - m_nVariantSize += cb; - hr = S_OK; - } - return hr; - } - - STDMETHOD(Seek)(LARGE_INTEGER , DWORD , ULARGE_INTEGER *) throw() - { - return E_NOTIMPL; - } - - STDMETHOD(SetSize)(ULARGE_INTEGER ) throw() - { - return E_NOTIMPL; - } - - STDMETHOD(CopyTo)(IStream *, ULARGE_INTEGER , ULARGE_INTEGER *, - ULARGE_INTEGER *) throw() - { - return E_NOTIMPL; - } - - STDMETHOD(Commit)(DWORD ) throw() - { - return E_NOTIMPL; - } - - STDMETHOD(Revert)( void) throw() - { - return E_NOTIMPL; - } - - STDMETHOD(LockRegion)(ULARGE_INTEGER , ULARGE_INTEGER , DWORD ) throw() - { - return E_NOTIMPL; - } - - STDMETHOD(UnlockRegion)(ULARGE_INTEGER , ULARGE_INTEGER , - DWORD ) throw() - { - return E_NOTIMPL; - } - - STDMETHOD(Stat)(STATSTG *, DWORD ) throw() - { - return E_NOTIMPL; - } - - STDMETHOD(Clone)(IStream **) throw() - { - return E_NOTIMPL; - } - - STDMETHOD(QueryInterface)(REFIID iid, void **ppUnk) throw() - { - *ppUnk = NULL; - if (::InlineIsEqualGUID(iid, IID_IUnknown)) - { - *ppUnk = (void*)(IUnknown*)this; - } - else if (::InlineIsEqualGUID(iid, IID_ISequentialStream)) - { - *ppUnk = (void*)(ISequentialStream*)this; - } - else if (::InlineIsEqualGUID(iid, IID_IStream)) - { - *ppUnk = (void*)(IStream*)this; - } - - if (*ppUnk) - { - AddRef(); - return S_OK; - } - return E_NOINTERFACE; - } - - ULONG STDMETHODCALLTYPE AddRef( void) throw() - { - return (ULONG)1; - } - - ULONG STDMETHODCALLTYPE Release( void) throw() - { - return (ULONG)1; - } - - CTempBuffer m_stream; - size_t m_nVariantSize; - size_t m_nCurrRead; - long m_nRef; -}; - -// given a nCurrent and a pointer to a value representing the -// maximum value that has been seen in nCurrent, -// will update pnMax if nCurrent is greater -inline void AtlInterlockedUpdateMax(long nCurrent, long* pnMax) -{ - ATLENSURE(pnMax != NULL); - - long nMax; - long nOrigMax; - - do - { - nMax = *pnMax; - nOrigMax = 0; - if (nCurrent > nMax) - nOrigMax = InterlockedCompareExchange(pnMax, nCurrent, nMax); - } - while (nOrigMax != 0 && nOrigMax != nMax); -} - -// wrapper around InterlockedExchangeAdd -inline LONG AtlInterlockedExchangeAdd(_Inout_ long volatile* pAddend, _In_ long nValue) -{ -#if defined(_WIN64) && defined(_M_CEE) - - // We use System::Threading::Interlocked::Add because InterlockedExchangeAdd is an intrisinc not supported in managed code with 64bits compilers. - // System::Threading::Interlocked::Add returns the value after the addition, but we maintain the same semantics as InterlockedExchangeAdd. - _STATIC_ASSERT(sizeof(int) == sizeof(long)); - return (System::Threading::Interlocked::Add(*((int*)pAddend), nValue) - nValue); - -#else - - return InterlockedExchangeAdd(pAddend, nValue); - -#endif -} - -// SOAP helpers -#define _ATLSOAP_DECLARE_WSDL_SRF() \ -__if_not_exists(s_szAtlsWSDLSrf) \ -{ \ -extern __declspec(selectany) const char * const s_szAtlsWSDLSrf = \ -"\r\n" \ -"\r\n" \ -"\r\n" \ -" \r\n" \ -" \r\n" \ -" \r\n" \ -"{{if IsRpcEncoded}}\r\n" \ -"{{while GetNextFunction}}\r\n" \ -"{{while GetNextParameter}}\r\n" \ -"{{if IsArrayParameter}}\r\n" \ -" \r\n" \ -" \r\n" \ -" \r\n" \ -" \r\n" \ -" \r\n" \ -" \r\n" \ -" \r\n" \ -"{{endif}}\r\n" \ -"{{endwhile}}\r\n" \ -"{{endwhile}}\r\n" \ -"{{endif}}\r\n" \ -"{{while GetNextHeader}}\r\n" \ -"{{if IsHeaderUDT}}\r\n" \ -"{{else}}\r\n" \ -"{{if IsArrayHeader}}\r\n" \ -"{{else}}\r\n" \ -" \r\n" \ -" \r\n" \ -" \r\n" \ -"{{endif}}\r\n" \ -"{{endif}}\r\n" \ -"{{if IsRpcEncoded}}\r\n" \ -"{{if IsArrayHeader}}\r\n" \ -" \r\n" \ -" \r\n" \ -" \r\n" \ -" \r\n" \ -" \r\n" \ -" \r\n" \ -" \r\n" \ -"{{endif}}\r\n" \ -"{{endif}}\r\n" \ -"{{endwhile}}\r\n" \ -"{{if IsDocumentLiteral}}\r\n" \ -"{{while GetNextFunction}}\r\n" \ -" \r\n" \ -" \r\n" \ -" \r\n" \ -"{{while GetNextParameter}}\r\n" \ -"{{if IsInParameter}}\r\n" \ -" \r\n" \ -"{{if IsArrayParameter}}\r\n" \ -" \r\n" \ -" \r\n" \ -" \r\n" \ -" \r\n" \ -" \r\n" \ -" \r\n" \ -"{{endif}}\r\n" \ -"{{endif}}\r\n" \ -"{{endwhile}}\r\n" \ -" \r\n" \ -" \r\n" \ -" \r\n" \ -" \r\n" \ -" \r\n" \ -" \r\n" \ -"{{while GetNextParameter}}\r\n" \ -"{{if IsOutParameter}}\r\n" \ -" \r\n" \ -"{{if IsArrayParameter}}\r\n" \ -" \r\n" \ -" \r\n" \ -" \r\n" \ -" \r\n" \ -" \r\n" \ -" \r\n" \ -"{{endif}}\r\n" \ -"{{endif}}\r\n" \ -"{{endwhile}}\r\n" \ -" \r\n" \ -" \r\n" \ -" \r\n" \ -"{{endwhile}}\r\n" \ -"{{endif}}\r\n" \ -"{{while GetNextEnum}}\r\n" \ -" \r\n" \ -" \r\n" \ -"{{while GetNextEnumElement}}\r\n" \ -" \r\n" \ -"{{endwhile}}\r\n" \ -" \r\n" \ -" \r\n" \ -"{{endwhile}}\r\n" \ -"{{while GetNextStruct}}\r\n" \ -" \r\n" \ -" \r\n" \ -"{{while GetNextStructField}}\r\n" \ -" \r\n" \ -"{{if IsArrayField}}\r\n" \ -" \r\n" \ -"{{if IsRpcEncoded}}\r\n" \ -" \r\n" \ -" \r\n" \ -" \r\n" \ -" \r\n" \ -" \r\n" \ -"{{else}}\r\n" \ -" \r\n" \ -" \r\n" \ -" \r\n" \ -"{{endif}}\r\n" \ -" \r\n" \ -" \r\n" \ -"{{endif}}\r\n" \ -"{{endwhile}}\r\n" \ -" \r\n" \ -" \r\n" \ -"{{endwhile}}\r\n" \ -"{{if IsDocumentLiteral}}\r\n" \ -"{{while GetNextHeader}}\r\n" \ -" \r\n" \ -"{{if IsArrayHeader}}\r\n" \ -" \r\n" \ -" \r\n" \ -" \r\n" \ -" \r\n" \ -" \r\n" \ -" \r\n" \ -"{{endif}}\r\n" \ -"{{endwhile}}\r\n" \ -"{{endif}}\r\n" \ -" \r\n" \ -" \r\n" \ -"{{while GetNextFunction}}\r\n" \ -" \r\n" \ -"{{if IsDocumentLiteral}}\r\n" \ -" \r\n" \ -"{{endif}}\r\n" \ -"{{if IsRpcEncoded}}\r\n" \ -"{{while GetNextParameter}}\r\n" \ -"{{if IsInParameter}}\r\n" \ -" \r\n" \ -"{{endif}}\r\n" \ -"{{endwhile}}\r\n" \ -"{{endif}}\r\n" \ -" \r\n" \ -" \r\n" \ -"{{if IsDocumentLiteral}}\r\n" \ -" \r\n" \ -"{{endif}}\r\n" \ -"{{if IsRpcEncoded}}\r\n" \ -"{{while GetNextParameter}}\r\n" \ -"{{if IsOutParameter}}\r\n" \ -" \r\n" \ -"{{endif}}\r\n" \ -"{{endwhile}}\r\n" \ -"{{endif}}\r\n" \ -" \r\n" \ -"{{endwhile}}\r\n" \ -"{{while GetNextHeader}}\r\n" \ -" \r\n" \ -"{{if IsDocumentLiteral}}\r\n" \ -" \r\n" \ -"{{endif}}\r\n" \ -"{{if IsRpcEncoded}}\r\n" \ -" \r\n" \ -"{{endif}}\r\n" \ -" \r\n" \ -"{{endwhile}}\r\n" \ -" \r\n" \ -"{{while GetNextFunction}}\r\n" \ -" \r\n" \ -" \r\n" \ -" \r\n" \ -" \r\n" \ -"{{endwhile}}\r\n" \ -" \r\n" \ -" \r\n" \ -" \r\n" \ -"{{while GetNextFunction}}\r\n" \ -" \r\n" \ -" \r\n" \ -" \r\n" \ -" \r\n" \ -"{{while GetNextFunctionHeader}}\r\n" \ -"{{if IsInHeader}}\r\n" \ -" \r\n" \ -"{{endif}}\r\n" \ -"{{endwhile}}\r\n" \ -" \r\n" \ -" \r\n" \ -" \r\n" \ -"{{while GetNextFunctionHeader}}\r\n" \ -"{{if IsOutHeader}}\r\n" \ -" \r\n" \ -"{{endif}}\r\n" \ -"{{endwhile}}\r\n" \ -" \r\n" \ -" \r\n" \ -"{{endwhile}}\r\n" \ -" \r\n" \ -" \r\n" \ -" \r\n" \ -" \r\n" \ -" \r\n" \ -" \r\n" \ -""; \ -} - -#include -}; // namespace ATL -#pragma pack(pop) - -#endif // __ATLSPRIV_H__ diff --git a/include/atl/atlspriv.inl b/include/atl/atlspriv.inl deleted file mode 100644 index 9693d33d5..000000000 --- a/include/atl/atlspriv.inl +++ /dev/null @@ -1,361 +0,0 @@ -// This is a part of the Active Template Library. -// Copyright (C) Microsoft Corporation -// All rights reserved. -// -// This source code is only intended as a supplement to the -// Active Template Library Reference and related -// electronic documentation provided with the library. -// See these sources for detailed information regarding the -// Active Template Library product. - -///////////////////////////////////////////////////////////////////////////////// -// -// ZEvtSyncSocket -// ************ This is an implementation only class ************ -// Class ZEvtSyncSocket is a non-supported, implementation only -// class used by the ATL HTTP client class CAtlHttpClient. Do not -// use this class in your code. Use of this class is not supported by Microsoft. -// -///////////////////////////////////////////////////////////////////////////////// - -#ifndef __ATLSPRIV_INL__ -#define __ATLSPRIV_INL__ - -#pragma once - -#pragma warning(push) -#pragma warning(disable:4312) - -inline ZEvtSyncSocket::ZEvtSyncSocket() -{ - m_dwCreateFlags = WSA_FLAG_OVERLAPPED; - m_hEventRead = m_hEventWrite = m_hEventConnect = NULL; - m_socket = INVALID_SOCKET; - m_bConnected = false; - m_dwLastError = 0; - m_dwSocketTimeout = ATL_SOCK_TIMEOUT; - g_HttpInit.Init(); -} - -inline ZEvtSyncSocket::~ZEvtSyncSocket() -{ - Close(); -} - -inline ZEvtSyncSocket::operator SOCKET() -{ - return m_socket; -} - -inline void ZEvtSyncSocket::Close() -{ - if (m_socket != INVALID_SOCKET) - { - m_bConnected = false; - closesocket(m_socket); - m_socket = INVALID_SOCKET; - Term(); - } -} - -inline void ZEvtSyncSocket::Term() -{ - if (m_hEventRead) - { - WSACloseEvent(m_hEventRead); - m_hEventRead = NULL; - } - if (m_hEventWrite) - { - WSACloseEvent(m_hEventWrite); - m_hEventWrite = NULL; - } - if (m_hEventConnect) - { - WSACloseEvent(m_hEventConnect); - m_hEventConnect = NULL; - } - m_socket = INVALID_SOCKET; -} - -inline bool ZEvtSyncSocket::Create(const ADDRINFOT* pAI, WORD wFlags) -{ - return Create(pAI->ai_family, pAI->ai_socktype, pAI->ai_protocol, wFlags); -} - -inline bool ZEvtSyncSocket::Create(int af, int st, int proto, WORD wFlags) -{ - bool bRet = true; - if (m_socket != INVALID_SOCKET) - { - m_dwLastError = WSAEALREADY; - return false; // Must close this socket first - } - - m_socket = WSASocket(af, st, proto, NULL, 0, - wFlags | m_dwCreateFlags); - if (m_socket == INVALID_SOCKET) - { - m_dwLastError = ::WSAGetLastError(); - bRet = false; - } - else - bRet = Init(m_socket, NULL); - return bRet; -} - -inline bool ZEvtSyncSocket::Connect(LPCTSTR szAddr, unsigned short nPort) throw() -{ - if (m_bConnected) - return true; - - bool bRet = true; - CSocketAddr address; - // Find address information - if ((m_dwLastError = address.FindAddr(szAddr, nPort, 0, PF_UNSPEC, SOCK_STREAM, 0)) != ERROR_SUCCESS) - { - bRet = false; - } - else - { - bRet = Connect(address.GetAddrInfo()); - } - return bRet; -} - -inline bool ZEvtSyncSocket::Connect(const ADDRINFOT *pAI) -{ - if (m_socket == INVALID_SOCKET && !Create(pAI)) - return false; - - return Connect((SOCKADDR*)pAI->ai_addr, (int)pAI->ai_addrlen); -} - -inline bool ZEvtSyncSocket::Connect(const SOCKADDR* psa, int len) -{ - if (m_bConnected) - return true; // already connected - - DWORD dwLastError; - bool bRet = true; - - // if you try to connect the socket without - // creating it first it's reasonable to automatically - // try the create for you. - if (m_socket == INVALID_SOCKET) - return false; - - if (WSAConnect(m_socket, - psa, len, - NULL, NULL, NULL, NULL)) - { - dwLastError = WSAGetLastError(); - if (dwLastError != WSAEWOULDBLOCK) - { - m_dwLastError = dwLastError; - bRet = false; - } - else - { - dwLastError = WaitForSingleObject((HANDLE)m_hEventConnect, m_dwSocketTimeout); - if (dwLastError == WAIT_OBJECT_0) - { - // make sure there were no connection errors. - WSANETWORKEVENTS wse; - ZeroMemory(&wse, sizeof(wse)); - WSAEnumNetworkEvents(m_socket, NULL, &wse); - if (wse.iErrorCode[FD_CONNECT_BIT]!=0) - { - m_dwLastError = (DWORD)(wse.iErrorCode[FD_CONNECT_BIT]); - bRet = false; - } - } - else - bRet = false; - } - - } - - m_bConnected = bRet; - return bRet; -} - -inline bool ZEvtSyncSocket::Write(WSABUF *pBuffers, int nCount, DWORD *pdwSize) -{ - // if we aren't already connected we'll wait to see if the connect - // event happens - if (WAIT_OBJECT_0 != WaitForSingleObject((HANDLE)m_hEventConnect , m_dwSocketTimeout)) - { - m_dwLastError = WSAENOTCONN; - return false; // not connected - } - - // make sure we aren't already writing - if (WAIT_TIMEOUT == WaitForSingleObject((HANDLE)m_hEventWrite, 0)) - { - m_dwLastError = WSAEINPROGRESS; - return false; // another write on is blocking this socket - } - - bool bRet = true; - *pdwSize = 0; - WSAOVERLAPPED o; - m_csWrite.Lock(); - o.hEvent = m_hEventWrite; - WSAResetEvent(o.hEvent); - if (WSASend(m_socket, pBuffers, nCount, pdwSize, 0, &o, 0)) - { - DWORD dwLastError = WSAGetLastError(); - if (dwLastError != WSA_IO_PENDING) - { - m_dwLastError = dwLastError; - bRet = false; - } - } - - // wait for write to complete - if (bRet) - { - if (WaitForSingleObject((HANDLE)m_hEventWrite, m_dwSocketTimeout) == WAIT_OBJECT_0) - { - DWORD dwFlags = 0; - if (WSAGetOverlappedResult(m_socket, &o, pdwSize, FALSE, &dwFlags)) - bRet = true; - else - { - m_dwLastError = ::GetLastError(); - bRet = false; - } - } - else - bRet = false; - } - - m_csWrite.Unlock(); - return bRet; -} - -inline bool ZEvtSyncSocket::Write(const unsigned char *pBuffIn, DWORD *pdwSize) -{ - WSABUF buff; - buff.buf = (char*)pBuffIn; - buff.len = *pdwSize; - return Write(&buff, 1, pdwSize); -} - -inline bool ZEvtSyncSocket::Read(const unsigned char *pBuff, DWORD *pdwSize) -{ - // if we aren't already connected we'll wait to see if the connect - // event happens - if (WAIT_OBJECT_0 != WaitForSingleObject((HANDLE)m_hEventConnect , m_dwSocketTimeout)) - { - m_dwLastError = WSAENOTCONN; - return false; // not connected - } - - if (WAIT_ABANDONED == WaitForSingleObject((HANDLE)m_hEventRead, 0)) - { - m_dwLastError = WSAEINPROGRESS; - return false; // another write on is blocking this socket - } - - bool bRet = true; - WSABUF buff; - buff.buf = (char*)pBuff; - buff.len = *pdwSize; - *pdwSize = 0; - DWORD dwFlags = 0; - WSAOVERLAPPED o; - ZeroMemory(&o, sizeof(o)); - - // protect against re-entrency - m_csRead.Lock(); - o.hEvent = m_hEventRead; - WSAResetEvent(o.hEvent); - if (WSARecv(m_socket, &buff, 1, pdwSize, &dwFlags, &o, 0)) - { - DWORD dwLastError = WSAGetLastError(); - if (dwLastError != WSA_IO_PENDING) - { - m_dwLastError = dwLastError; - bRet = false; - } - } - - // wait for the read to complete - if (bRet) - { - if (WAIT_OBJECT_0 == WaitForSingleObject((HANDLE)o.hEvent, m_dwSocketTimeout)) - { - dwFlags = 0; - if (WSAGetOverlappedResult(m_socket, &o, pdwSize, FALSE, &dwFlags)) - bRet = true; - else - { - m_dwLastError = ::GetLastError(); - bRet = false; - } - } - else - bRet = false; - } - - m_csRead.Unlock(); - return bRet; -} - -inline bool ZEvtSyncSocket::Init(SOCKET hSocket, void * /*pData=NULL*/) -{ - ATLASSERT(hSocket != INVALID_SOCKET); - - if (hSocket == INVALID_SOCKET) - { - m_dwLastError = WSAENOTSOCK; - return false; - } - - m_socket = hSocket; - - // Allocate Events. On error, any open event handles will be closed - // in the destructor - if (NULL != (m_hEventRead = WSACreateEvent())) - if (NULL != (m_hEventWrite = WSACreateEvent())) - if (NULL != (m_hEventConnect = WSACreateEvent())) - { - if (!WSASetEvent(m_hEventWrite) || !WSASetEvent(m_hEventRead)) - { - m_dwLastError = ::GetLastError(); - return false; - } - - if (SOCKET_ERROR != WSAEventSelect(m_socket, m_hEventRead, FD_READ)) - if (SOCKET_ERROR != WSAEventSelect(m_socket, m_hEventWrite, FD_WRITE)) - if (SOCKET_ERROR != WSAEventSelect(m_socket, m_hEventConnect, FD_CONNECT)) - return true; - } - m_dwLastError = ::GetLastError(); - return false; -} - -inline DWORD ZEvtSyncSocket::GetSocketTimeout() throw() -{ - return m_dwSocketTimeout; -} - -inline DWORD ZEvtSyncSocket::SetSocketTimeout(DWORD dwNewTimeout) throw() -{ - DWORD dwOldTimeout = m_dwSocketTimeout; - m_dwSocketTimeout = dwNewTimeout; - return dwOldTimeout; -} - -inline bool ZEvtSyncSocket::SupportsScheme(ATL_URL_SCHEME scheme) throw() -{ - // default only supports HTTP - return scheme == ATL_URL_SCHEME_HTTP ? true : false; -} - - -#pragma warning(pop) - -#endif // __ATLSPRIV_INL__ diff --git a/include/atl/atlsrv.rc b/include/atl/atlsrv.rc deleted file mode 100644 index a9d6b93a0..000000000 --- a/include/atl/atlsrv.rc +++ /dev/null @@ -1,146 +0,0 @@ -// This is a part of the Active Template Library. -// Copyright (C) Microsoft Corporation -// All rights reserved. -// -// This source code is only intended as a supplement to the -// Active Template Library Reference and related -// electronic documentation provided with the library. -// See these sources for detailed information regarding the -// Active Template Library product. - -#include -#include "atlsrvres.h" - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ATLSRV_BAD_REQUEST "Bad RequestBad Request" - IDS_ATLSRV_AUTH_REQUIRED - "Authorization RequiredAuthorization is required" - IDS_ATLSRV_FORBIDDEN "ForbiddenForbidden" - IDS_ATLSRV_NOT_FOUND "Not FoundNot Found" - IDS_ATLSRV_SERVER_ERROR "Server ErrorServer Error" - IDS_ATLSRV_NOT_IMPLEMENTED - "Not ImplementedNot Implemented" - IDS_ATLSRV_BAD_GATEWAY "Bad GatewayBad Gateway" - IDS_ATLSRV_SERVICE_NOT_AVAILABLE - "Service Not AvailableService Not Available" - IDS_ATLSRV_SERVER_ERROR_BADSRF "Server Error

Server Error

SRF file could not be loaded." - IDS_ATLSRV_SERVER_ERROR_HNDLFAIL "Server Error

Server Error

The requested SRF file was loaded but could not be successfully processed." - IDS_ATLSRV_SERVER_ERROR_SYSOBJFAIL "Server Error

Server Error

A Windows system object could not be created." - IDS_ATLSRV_SERVER_ERROR_READFILEFAIL "Server Error

Server Error

A File read operation failed." - IDS_ATLSRV_SERVER_ERROR_LOADFILEFAIL "Server Error

Server Error

The specified file could not be opened." - IDS_ATLSRV_SERVER_ERROR_LOADLIB "Server Error

Server Error

LoadLibrary failed." - IDS_ATLSRV_SERVER_ERROR_HANDLERIF "Server Error

Server Error

Failed to retrieve the request handler interface." - IDS_ATLSRV_SERVER_ERROR_OUTOFMEM "Server Error

Server Error

Server is out of memory." - IDS_ATLSRV_SERVER_ERROR_UNEXPECTED "Server Error

Server Error

The server encountered an unexpected error." - IDS_ATLSRV_SERVER_ERROR_STENCILPARSEFAIL "Server Error

Server Error

The server encountered an unexpected error while trying to parse the requested stencil." - IDS_ATLSRV_SERVER_ERROR_STENCILLOADFAIL "Server Error

Server Error

The server failed to load the requested stencil. The stencil file may be damaged or missing on this web server." - IDS_ATLSRV_SERVER_ERROR_HANDLERNOTFOUND "Server Error

Server Error

One of the handlers named in a handler tag for the requested stencil could not be found in the specified handler .dll." - IDS_ATLSRV_SERVER_ERROR_BADHANDLERTAG "Server Error

Server Error

This stencil contains a handler tag that could not be properly parsed by the stencil processor or does not contain a handler tag at all. Check the requested stencil for proper stencil syntax." - IDS_ATLSRV_SERVER_ERROR_NOHANDLERTAG "Server Error

Server Error

The requested stencil does not contain a handler tag." - IDS_ATLSRV_SERVER_ERROR_LONGMETHODNAME "Server Error

Server Error

A replacement tag was encountered in the requested stencil that had a replacement name that was too long. The maximum length of the replacment name must be less than or equal to the ATL_MAX_METHOD_NAME constant defined in atlstencil.h" - IDS_ATLSRV_SERVER_ERROR_LONGHANDLERNAME "Server Error

Server Error

A replacement tag that uses the id.tagname syntax was encountered in the requested stencil that had a handler name that was too long. The maximum length of the handler name must be less than or equal to the ATL_MAX_METHOD_NAME constant defined in atlstencil.h" - IDS_ATLSRV_SERVER_ERROR_IMPERSONATIONFAILED "Server Error

Server Error

An attempt to impersonate the client making the request failed." - IDS_ATLSRV_SERVER_ERROR_ISAPISTARTUPFAILED "Server Error

Server Error

The ISAPI extension used to service this request failed to load correctly due to an unknown error." - IDS_ATLSRV_SERVER_ERROR_SOAPNOSOAPACTION "Server Error

Server Error

SOAP request did not provide SOAPACTION header." - - IDS_ATLSRV_CRITICAL_HEAPCREATEFAILED "Request heap creation failed" - IDS_ATLSRV_CRITICAL_WORKERINITFAILED "Worker Thread initialization failed" - IDS_ATLSRV_CRITICAL_CRITSECINITFAILED "Critical section initialization failed" - IDS_ATLSRV_CRITICAL_THREADPOOLFAILED "Thread pool initialization failed" - IDS_ATLSRV_CRITICAL_DLLCACHEFAILED "DLL cache initialization failed" - IDS_ATLSRV_CRITICAL_PAGECACHEFAILED "Page cache initialization failed" - IDS_ATLSRV_CRITICAL_STENCILCACHEFAILED "Stencil cache initialization failed" - IDS_ATLSRV_CRITICAL_SESSIONSTATEFAILED "Session state service initialization failed" - IDS_ATLSRV_CRITICAL_BLOBCACHEFAILED "Blob cache initialization failed" - IDS_ATLSRV_CRITICAL_FILECACHEFAILED "File cache initialization failed" - - IDS_PERFMON_CACHE "ATL Server:Cache" - IDS_PERFMON_CACHE_HELP "Information about the ATL Server cache" - IDS_PERFMON_HITCOUNT "Cache Hit Count" - IDS_PERFMON_HITCOUNT_HELP "Number of cache hits" - IDS_PERFMON_MISSCOUNT "Cache Miss Count" - IDS_PERFMON_MISSCOUNT_HELP "Number of cache misses" - IDS_PERFMON_CURRENTALLOCATIONS "Cache Current Allocations" - IDS_PERFMON_CURRENTALLOCATIONS_HELP "Current Memory allocated for cache" - IDS_PERFMON_MAXALLOCATIONS "Cache Max Allocations" - IDS_PERFMON_MAXALLOCATIONS_HELP "Maximum memory allocated for cache" - IDS_PERFMON_CURRENTENTRIES "Cache Current Entries" - IDS_PERFMON_CURRENTENTRIES_HELP "Current number of cache entries" - IDS_PERFMON_MAXENTRIES "Cache Max Entries" - IDS_PERFMON_MAXENTRIES_HELP "Maximum number of cache entries" - IDS_PERFMON_HITCOUNTRATE "Cache Hit Count Rate" - IDS_PERFMON_HITCOUNTRATE_HELP "Number of hit counts per second" - IDS_PERFMON_REQUEST "ATL Server:Request" - IDS_PERFMON_REQUEST_HELP "Statistics about the requests coming into the server" - IDS_PERFMON_REQUEST_TOTAL "Server Total Requests" - IDS_PERFMON_REQUEST_TOTAL_HELP "The total number of requests" - IDS_PERFMON_REQUEST_FAILED "Server Failed Requests" - IDS_PERFMON_REQUEST_FAILED_HELP "The number of failed requests" - IDS_PERFMON_REQUEST_RATE "Server Requests /sec" - IDS_PERFMON_REQUEST_RATE_HELP "Number of requests per second" - IDS_PERFMON_REQUEST_AVG_RESPONSE_TIME "Average Response Time" - IDS_PERFMON_REQUEST_AVG_RESPONSE_TIME_HELP "Average time spent handling a request" - IDS_PERFMON_REQUEST_CURR_WAITING "Current Queued Requests" - IDS_PERFMON_REQUEST_CURR_WAITING_HELP "Current number of requests waiting to be handled" - IDS_PERFMON_REQUEST_MAX_WAITING "Maximum Queued Requests" - IDS_PERFMON_REQUEST_MAX_WAITING_HELP "Maximum number of requests waiting to be handled" - IDS_PERFMON_REQUEST_ACTIVE_THREADS "Active Threads" - IDS_PERFMON_REQUEST_ACTIVE_THREADS_HELP "The number of threads actively handling requests" -END - - -#ifndef ATL_NO_DEFAULT_STENCIL_RESOURCE -dllmgr.srf HTML "res\\dllmgr.srf" -stencilmgr.srf HTML "res\\stencilmgr.srf" -threadmgr.srf HTML "res\\threadmgr.srf" -#endif - - -// -// Stencil parse error support -// -#ifdef ATL_DEBUG_STENCILS - -STRINGTABLE DISCARDABLE -BEGIN - IDS_STENCIL_ERROR_STENCIL -"{{codepage 0}}

While trying to parse a stencil file, the following errors occurred:

\r\n{{while GetNextError}}\r\n\r\n\r\n\r\n
Error type{{GetErrorText}}
Line number{{GetErrorLineNumber}}
Error text
{{GetErrorLine}}
\r\n{{endwhile}}
Stencil output follows:\r\n
" - - IDS_STENCIL_UNCLOSEDBLOCK_IF "{{if}} without {{endif}}" - IDS_STENCIL_UNCLOSEDBLOCK_ELSE "{{else}} without {{endif}}" - IDS_STENCIL_UNCLOSEDBLOCK_WHILE "{{while}} without {{endwhile}}" - IDS_STENCIL_UNOPENEDBLOCK_ENDWHILE "{{endwhile}} without {{while}}" - IDS_STENCIL_UNOPENEDBLOCK_ELSE "{{else}} without {{if}}" - IDS_STENCIL_UNOPENEDBLOCK_ENDIF "{{endif}} without {{if}} or {{else}}" - - IDS_STENCIL_INVALID_HANDLER "Invalid handler tag" - IDS_STENCIL_NULLPARAM "NULL parameter to ParseReplacements" - IDS_STENCIL_INVALIDSTRING "Empty or negative string passed to ParseReplacements" - IDS_STENCIL_EMBEDDED_NULL "Embedded null character in stencil" - IDS_STENCIL_UNMATCHED_TAG_START "Unmatched {{" - IDS_STENCIL_MISMATCHED_TAG_START "Mismatched {{" - IDS_STENCIL_BAD_PARAMETER "Bad parameter" - IDS_STENCIL_METHODNAME_TOO_LONG "Method name too long" - IDS_STENCIL_HANDLERNAME_TOO_LONG "Handler name too long" - IDS_STENCIL_INVALID_SUBHANDLER "Invalid subhandler tag" - IDS_STENCIL_UNRESOLVED_REPLACEMENT "Unresolved replacement : '%s'" - - IDS_STENCIL_INCLUDE_ERROR "Could not open included file" - IDS_STENCIL_INCLUDE_INVALID "Included file is not a disk file" - - IDS_STENCIL_MLANG_COCREATE "Couldn't create CMultiLanguage" - IDS_STENCIL_MLANG_LCID "Error getting lcid" - IDS_STENCIL_MLANG_GETLOCALE "GetLocaleInfo failed" - IDS_STENCIL_MLANG_GETCHARSET "GetCharsetInfo failed" - - IDS_STENCIL_OUTOFMEMORY "Out of memory" - IDS_STENCIL_UNEXPECTED "Unexpected error" -END - -#endif diff --git a/include/atl/atlsrvres.h b/include/atl/atlsrvres.h deleted file mode 100644 index ff2a1fc48..000000000 --- a/include/atl/atlsrvres.h +++ /dev/null @@ -1,150 +0,0 @@ -// This is a part of the Active Template Library. -// Copyright (C) Microsoft Corporation -// All rights reserved. -// -// This source code is only intended as a supplement to the -// Active Template Library Reference and related -// electronic documentation provided with the library. -// See these sources for detailed information regarding the -// Active Template Library product. - -// Used by atlsrv.rc -// -#ifndef ATLSRV_RESID_BASE -#define ATLSRV_RESID_BASE 0x6000 -#endif - -#ifndef PERFMON_RESID_BASE -#define PERFMON_RESID_BASE 0x6100 -#endif - -#ifndef STENCIL_RESID_BASE -#define STENCIL_RESID_BASE 0x6200 -#endif - -#define IDS_ATLSRV_BAD_REQUEST (ATLSRV_RESID_BASE+1) -#define IDS_ATLSRV_AUTH_REQUIRED (ATLSRV_RESID_BASE+2) -#define IDS_ATLSRV_FORBIDDEN (ATLSRV_RESID_BASE+3) -#define IDS_ATLSRV_NOT_FOUND (ATLSRV_RESID_BASE+4) -#define IDS_ATLSRV_SERVER_ERROR (ATLSRV_RESID_BASE+5) -#define IDS_ATLSRV_NOT_IMPLEMENTED (ATLSRV_RESID_BASE+6) -#define IDS_ATLSRV_BAD_GATEWAY (ATLSRV_RESID_BASE+7) -#define IDS_ATLSRV_SERVICE_NOT_AVAILABLE (ATLSRV_RESID_BASE+8) -#define IDS_ATLSRV_SERVER_ERROR_BADSRF (ATLSRV_RESID_BASE+9) -#define IDS_ATLSRV_SERVER_ERROR_HNDLFAIL (ATLSRV_RESID_BASE+10) -#define IDS_ATLSRV_SERVER_ERROR_SYSOBJFAIL (ATLSRV_RESID_BASE+11) -#define IDS_ATLSRV_SERVER_ERROR_READFILEFAIL (ATLSRV_RESID_BASE+12) -#define IDS_ATLSRV_SERVER_ERROR_LOADLIB (ATLSRV_RESID_BASE+13) -#define IDS_ATLSRV_SERVER_ERROR_HANDLERIF (ATLSRV_RESID_BASE+14) -#define IDS_ATLSRV_SERVER_ERROR_OUTOFMEM (ATLSRV_RESID_BASE+15) -#define IDS_ATLSRV_SERVER_ERROR_UNEXPECTED (ATLSRV_RESID_BASE+16) -#define IDS_ATLSRV_SERVER_ERROR_STENCILPARSEFAIL (ATLSRV_RESID_BASE+17) -#define IDS_ATLSRV_SERVER_ERROR_STENCILLOADFAIL (ATLSRV_RESID_BASE+18) -#define IDS_ATLSRV_SERVER_ERROR_HANDLERNOTFOUND (ATLSRV_RESID_BASE+19) -#define IDS_ATLSRV_SERVER_ERROR_BADHANDLERTAG (ATLSRV_RESID_BASE+20) -#define IDS_ATLSRV_SERVER_ERROR_NOHANDLERTAG (ATLSRV_RESID_BASE+21) -#define IDS_ATLSRV_SERVER_ERROR_LONGMETHODNAME (ATLSRV_RESID_BASE+22) -#define IDS_ATLSRV_SERVER_ERROR_LONGHANDLERNAME (ATLSRV_RESID_BASE+23) -#define IDS_ATLSRV_SERVER_ERROR_IMPERSONATIONFAILED (ATLSRV_RESID_BASE+24) -#define IDS_ATLSRV_SERVER_ERROR_ISAPISTARTUPFAILED (ATLSRV_RESID_BASE+25) -#define IDS_ATLSRV_SERVER_ERROR_LOADFILEFAIL (ATLSRV_RESID_BASE+26) -#define IDS_ATLSRV_CRITICAL_LOGMESSAGE (ATLSRV_RESID_BASE+27) -#define IDS_ATLSRV_CRITICAL_HEAPCREATEFAILED (ATLSRV_RESID_BASE+28) -#define IDS_ATLSRV_CRITICAL_WORKERINITFAILED (ATLSRV_RESID_BASE+29) -#define IDS_ATLSRV_CRITICAL_CRITSECINITFAILED (ATLSRV_RESID_BASE+30) -#define IDS_ATLSRV_CRITICAL_THREADPOOLFAILED (ATLSRV_RESID_BASE+31) -#define IDS_ATLSRV_CRITICAL_DLLCACHEFAILED (ATLSRV_RESID_BASE+32) -#define IDS_ATLSRV_CRITICAL_PAGECACHEFAILED (ATLSRV_RESID_BASE+33) -#define IDS_ATLSRV_CRITICAL_STENCILCACHEFAILED (ATLSRV_RESID_BASE+34) -#define IDS_ATLSRV_CRITICAL_SESSIONSTATEFAILED (ATLSRV_RESID_BASE+35) -#define IDS_ATLSRV_CRITICAL_BLOBCACHEFAILED (ATLSRV_RESID_BASE+36) -#define IDS_ATLSRV_CRITICAL_FILECACHEFAILED (ATLSRV_RESID_BASE+37) -#define IDS_ATLSRV_SERVER_ERROR_SOAPNOSOAPACTION (ATLSRV_RESID_BASE+38) - -#define IDS_PERFMON_CACHE (PERFMON_RESID_BASE+1) -#define IDS_PERFMON_CACHE_HELP (PERFMON_RESID_BASE+2) -#define IDS_PERFMON_HITCOUNT (PERFMON_RESID_BASE+3) -#define IDS_PERFMON_HITCOUNT_HELP (PERFMON_RESID_BASE+4) -#define IDS_PERFMON_MISSCOUNT (PERFMON_RESID_BASE+5) -#define IDS_PERFMON_MISSCOUNT_HELP (PERFMON_RESID_BASE+6) -#define IDS_PERFMON_CURRENTALLOCATIONS (PERFMON_RESID_BASE+7) -#define IDS_PERFMON_CURRENTALLOCATIONS_HELP (PERFMON_RESID_BASE+8) -#define IDS_PERFMON_MAXALLOCATIONS (PERFMON_RESID_BASE+9) -#define IDS_PERFMON_MAXALLOCATIONS_HELP (PERFMON_RESID_BASE+10) -#define IDS_PERFMON_CURRENTENTRIES (PERFMON_RESID_BASE+11) -#define IDS_PERFMON_CURRENTENTRIES_HELP (PERFMON_RESID_BASE+12) -#define IDS_PERFMON_MAXENTRIES (PERFMON_RESID_BASE+13) -#define IDS_PERFMON_MAXENTRIES_HELP (PERFMON_RESID_BASE+14) -#define IDS_PERFMON_HITCOUNTRATE (PERFMON_RESID_BASE+15) -#define IDS_PERFMON_HITCOUNTRATE_HELP (PERFMON_RESID_BASE+16) - -#define IDS_PERFMON_REQUEST (PERFMON_RESID_BASE+17) -#define IDS_PERFMON_REQUEST_HELP (PERFMON_RESID_BASE+18) -#define IDS_PERFMON_REQUEST_TOTAL (PERFMON_RESID_BASE+19) -#define IDS_PERFMON_REQUEST_TOTAL_HELP (PERFMON_RESID_BASE+20) -#define IDS_PERFMON_REQUEST_FAILED (PERFMON_RESID_BASE+21) -#define IDS_PERFMON_REQUEST_FAILED_HELP (PERFMON_RESID_BASE+22) -#define IDS_PERFMON_REQUEST_RATE (PERFMON_RESID_BASE+23) -#define IDS_PERFMON_REQUEST_RATE_HELP (PERFMON_RESID_BASE+24) -#define IDS_PERFMON_REQUEST_AVG_RESPONSE_TIME (PERFMON_RESID_BASE+25) -#define IDS_PERFMON_REQUEST_AVG_RESPONSE_TIME_HELP (PERFMON_RESID_BASE+26) -#define IDS_PERFMON_REQUEST_CURR_WAITING (PERFMON_RESID_BASE+27) -#define IDS_PERFMON_REQUEST_CURR_WAITING_HELP (PERFMON_RESID_BASE+28) -#define IDS_PERFMON_REQUEST_MAX_WAITING (PERFMON_RESID_BASE+29) -#define IDS_PERFMON_REQUEST_MAX_WAITING_HELP (PERFMON_RESID_BASE+30) -#define IDS_PERFMON_REQUEST_ACTIVE_THREADS (PERFMON_RESID_BASE+31) -#define IDS_PERFMON_REQUEST_ACTIVE_THREADS_HELP (PERFMON_RESID_BASE+32) - - -// -// Stencil parse error support -// - -// the error stencil -#define IDS_STENCIL_ERROR_STENCIL (STENCIL_RESID_BASE+1) - -// parse errors -#define IDS_STENCIL_UNCLOSEDBLOCK_IF (STENCIL_RESID_BASE+2) -#define IDS_STENCIL_UNCLOSEDBLOCK_ELSE (STENCIL_RESID_BASE+3) -#define IDS_STENCIL_UNCLOSEDBLOCK_WHILE (STENCIL_RESID_BASE+4) -#define IDS_STENCIL_UNOPENEDBLOCK_ENDWHILE (STENCIL_RESID_BASE+5) -#define IDS_STENCIL_UNOPENEDBLOCK_ELSE (STENCIL_RESID_BASE+6) -#define IDS_STENCIL_UNOPENEDBLOCK_ENDIF (STENCIL_RESID_BASE+7) - -#define IDS_STENCIL_INVALID_HANDLER (STENCIL_RESID_BASE+8) -#define IDS_STENCIL_NULLPARAM (STENCIL_RESID_BASE+9) -#define IDS_STENCIL_INVALIDSTRING (STENCIL_RESID_BASE+10) -#define IDS_STENCIL_EMBEDDED_NULL (STENCIL_RESID_BASE+11) -#define IDS_STENCIL_UNMATCHED_TAG_START (STENCIL_RESID_BASE+12) -#define IDS_STENCIL_MISMATCHED_TAG_START (STENCIL_RESID_BASE+13) -#define IDS_STENCIL_BAD_PARAMETER (STENCIL_RESID_BASE+14) -#define IDS_STENCIL_METHODNAME_TOO_LONG (STENCIL_RESID_BASE+15) -#define IDS_STENCIL_HANDLERNAME_TOO_LONG (STENCIL_RESID_BASE+16) -#define IDS_STENCIL_INCLUDE_ERROR (STENCIL_RESID_BASE+17) -#define IDS_STENCIL_INCLUDE_INVALID (STENCIL_RESID_BASE+18) -#define IDS_STENCIL_INVALID_SUBHANDLER (STENCIL_RESID_BASE+19) -#define IDS_STENCIL_UNRESOLVED_REPLACEMENT (STENCIL_RESID_BASE+20) - -// mlang errors -#define IDS_STENCIL_MLANG_COCREATE (STENCIL_RESID_BASE+21) -#define IDS_STENCIL_MLANG_LCID (STENCIL_RESID_BASE+22) -#define IDS_STENCIL_MLANG_GETLOCALE (STENCIL_RESID_BASE+23) -#define IDS_STENCIL_MLANG_GETCHARSET (STENCIL_RESID_BASE+24) - -// misceallaneous -#define IDS_STENCIL_OUTOFMEMORY (STENCIL_RESID_BASE+25) -#define IDS_STENCIL_UNEXPECTED (STENCIL_RESID_BASE+26) - - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NO_MFC 1 -#define _APS_NEXT_RESOURCE_VALUE 101 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1000 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif - diff --git a/include/atl/atlstencil.h b/include/atl/atlstencil.h deleted file mode 100644 index 8694a0f42..000000000 --- a/include/atl/atlstencil.h +++ /dev/null @@ -1,4152 +0,0 @@ -// This is a part of the Active Template Library. -// Copyright (C) Microsoft Corporation -// All rights reserved. -// -// This source code is only intended as a supplement to the -// Active Template Library Reference and related -// electronic documentation provided with the library. -// See these sources for detailed information regarding the -// Active Template Library product. - -#ifndef __ATLSTENCIL_H__ -#define __ATLSTENCIL_H__ - -#pragma once - -#include -#include -#include -#include - -#ifdef ATL_DEBUG_STENCILS -#include - - #ifndef ATL_STENCIL_MAX_ERROR_LEN - #define ATL_STENCIL_MAX_ERROR_LEN 256 - #endif -#endif // ATL_DEBUG_STENCILS - -#ifndef ATL_NO_MLANG -#include -#endif - -#ifndef _ATL_NO_DEFAULT_LIBS -#pragma comment(lib, "shlwapi.lib") -#endif // !_ATL_NO_DEFAULT_LIBS - -#pragma warning( push ) -#pragma warning(disable: 4127) // conditional expression is constant -#pragma warning(disable: 4511) // copy constructor could not be generated -#pragma warning(disable: 4512) // assignment operator could not be generated -#pragma warning(disable: 4702) // assignment operator could not be generated -#pragma warning(disable: 4625) // copy constructor could not be generated because a base class copy constructor is inaccessible -#pragma warning(disable: 4626) // assignment operator could not be generated because a base class assignment operator is inaccessible -#pragma warning(disable: 4191) // unsafe conversion from 'functionptr1' to 'functionptr2' - - -#pragma pack(push,_ATL_PACKING) -namespace ATL { - -// Token types -// These tags are token tags for the standard tag replacer implementation -extern __declspec(selectany) const DWORD STENCIL_TEXTTAG = 0x00000000; -extern __declspec(selectany) const DWORD STENCIL_REPLACEMENT = 0x00000001; -extern __declspec(selectany) const DWORD STENCIL_ITERATORSTART = 0x00000002; -extern __declspec(selectany) const DWORD STENCIL_ITERATOREND = 0x00000003; -extern __declspec(selectany) const DWORD STENCIL_CONDITIONALSTART = 0x00000004; -extern __declspec(selectany) const DWORD STENCIL_CONDITIONALELSE = 0x00000005; -extern __declspec(selectany) const DWORD STENCIL_CONDITIONALEND = 0x00000006; -extern __declspec(selectany) const DWORD STENCIL_STENCILINCLUDE = 0x00000007; -extern __declspec(selectany) const DWORD STENCIL_STATICINCLUDE = 0x00000008; -extern __declspec(selectany) const DWORD STENCIL_LOCALE = 0x00000009; -extern __declspec(selectany) const DWORD STENCIL_CODEPAGE = 0x0000000a; - -// The base for user defined token types -extern __declspec(selectany) const DWORD STENCIL_USER_TOKEN_BASE = 0x00001000; - -// Symbols to use in error handling in the stencil processor -#define STENCIL_INVALIDINDEX 0xFFFFFFFF -#define STENCIL_INVALIDOFFSET 0xFFFFFFFF - -// error codes -#define STENCIL_SUCCESS HTTP_SUCCESS -#define STENCL_FAIL HTTP_FAIL - -#define STENCIL_BASIC_MAP 0 -#define STENCIL_ATTR_MAP 1 - -#ifndef ATL_MAX_METHOD_NAME_LEN - #define ATL_MAX_METHOD_NAME_LEN 64 -#endif - -#ifndef ATL_MAX_BLOCK_STACK - #define ATL_MAX_BLOCK_STACK 128 -#endif - -template -struct CTagReplacerMethodsEx -{ - typedef HTTP_CODE (TBase::*REPLACE_FUNC)(); - typedef HTTP_CODE (TBase::*REPLACE_FUNC_EX)(T*); - typedef HTTP_CODE (TBase::*PARSE_FUNC)(IAtlMemMgr *, LPCSTR, T**); - typedef HTTP_CODE (TBase::*REPLACE_FUNC_EX_V)(void *); - typedef HTTP_CODE (TBase::*PARSE_FUNC_V)(IAtlMemMgr *, LPCSTR, void**); - - static REPLACE_FUNC_EX_V CheckRepl(REPLACE_FUNC p) throw() - { - return (REPLACE_FUNC_EX_V) p; - } - - static REPLACE_FUNC_EX_V CheckReplEx(REPLACE_FUNC_EX p) throw() - { - return (REPLACE_FUNC_EX_V) p; - } - - static PARSE_FUNC_V CheckParse(PARSE_FUNC p) throw() - { - return (PARSE_FUNC_V) p; - } -}; - -template -struct CTagReplacerMethods -{ - union - { - HTTP_CODE (TBase::*pfnMethodEx)(void *); - HTTP_CODE (TBase::*pfnMethod)(); - }; - HTTP_CODE (TBase::*pfnParse)(IAtlMemMgr *pMemMgr, LPCSTR, void **); -}; - -#define REPLACEMENT_ENTRY_DEFAULT 0 -#define REPLACEMENT_ENTRY_ARGS 1 - -template -struct CTagReplacerMethodEntry -{ - int nType; // REPLACEMENT_ENTRY_* - LPCSTR szMethodName; - CTagReplacerMethods Methods; -}; - - -#define BEGIN_REPLACEMENT_METHOD_MAP(className)\ -public:\ - void GetReplacementMethodMap(const ATL::CTagReplacerMethodEntry ** ppOut) const\ - {\ - typedef className __className;\ - static const ATL::CTagReplacerMethodEntry methods[] = { - -#define REPLACEMENT_METHOD_ENTRY(methodName, methodFunc)\ - { 0, methodName, { ATL::CTagReplacerMethodsEx<__className, void>::CheckRepl(&__className::methodFunc), NULL } }, - -#define REPLACEMENT_METHOD_ENTRY_EX(methodName, methodFunc, paramType, parseFunc)\ - { 1, methodName, { ATL::CTagReplacerMethodsEx<__className, paramType>::CheckReplEx(&__className::methodFunc), ATL::CTagReplacerMethodsEx<__className, paramType>::CheckParse(&__className::parseFunc) } }, - -#define REPLACEMENT_METHOD_ENTRY_EX_STR(methodName, methodFunc) \ - { 1, methodName, { ATL::CTagReplacerMethodsEx<__className, char>::CheckReplEx(&__className::methodFunc), ATL::CTagReplacerMethodsEx<__className, char>::CheckParse(&__className::DefaultParseString) } }, - -#define END_REPLACEMENT_METHOD_MAP()\ - { 0, NULL, NULL } };\ - *ppOut = methods;\ - } - -#define BEGIN_ATTR_REPLACEMENT_METHOD_MAP(className)\ -public:\ - void GetAttrReplacementMethodMap(const CTagReplacerMethodEntry ** ppOut) const\ - {\ - typedef className __className;\ - static const ATL::CTagReplacerMethodEntry methods[] = { - -#define END_ATTR_REPLACEMENT_METHOD_MAP()\ - { NULL, NULL, NULL } };\ - *ppOut = methods;\ - } - -template -class ITagReplacerImpl : public ITagReplacer -{ -protected: - IWriteStream *m_pStream; - -public: - typedef HTTP_CODE (T::*REPLACEMENT_METHOD)(); - typedef HTTP_CODE (T::*REPLACEMENT_METHOD_EX)(void *pvParam); - - ITagReplacerImpl() throw() - :m_pStream(NULL) - { - } - - IWriteStream *SetStream(IWriteStream *pStream) - { - IWriteStream *pRetStream = m_pStream; - m_pStream = pStream; - return pRetStream; - } - - // Looks up the replacement method offset. Optionally, it will - // look up the replacement method and object offset of an alternate - // tag replacer. - HTTP_CODE FindReplacementOffset( - LPCSTR szMethodName, - DWORD *pdwMethodOffset, - LPCSTR szHandlerName, - DWORD *pdwHandlerOffset, - DWORD *pdwMap, void **ppvParam, IAtlMemMgr *pMemMgr) - { - ATLENSURE(szMethodName != NULL); - ATLENSURE(pdwMethodOffset != NULL); - ATLENSURE((szHandlerName == NULL && pdwHandlerOffset == NULL) || - (szHandlerName != NULL && pdwHandlerOffset != NULL)); - ATLENSURE(pdwMap != NULL); - ATLENSURE(ppvParam != NULL); - ATLENSURE(pMemMgr != NULL); - - // we at least have to be looking up a method offset - if (!pdwMethodOffset || !szMethodName) - return AtlsHttpError(500, ISE_SUBERR_UNEXPECTED); - - *pdwMethodOffset = STENCIL_INVALIDOFFSET; - HTTP_CODE hcErr = HTTP_FAIL; - T *pT = static_cast(this); - - char szName[ATL_MAX_METHOD_NAME_LEN+1]; - - // if a handler name was supplied, we will try to - // find a different object to handle the method - if (szHandlerName && *szHandlerName) - { - if (!pdwHandlerOffset) - return AtlsHttpError(500, ISE_SUBERR_UNEXPECTED); - - hcErr = pT->GetHandlerOffset(szHandlerName, pdwHandlerOffset); - // got the alternate handler, now look up the method offset on - // the handler. - if (!hcErr) - { - CComPtr spAltTagReplacer; - hcErr = pT->GetReplacementObject(*pdwHandlerOffset, &spAltTagReplacer); - if (!hcErr) - hcErr = spAltTagReplacer->FindReplacementOffset(szMethodName, pdwMethodOffset, - NULL, NULL, pdwMap, ppvParam, pMemMgr); - return hcErr; - } - else - return hcErr; - } - - if (!SafeStringCopy(szName, szMethodName)) - { - return AtlsHttpError(500, ISE_SUBERR_LONGMETHODNAME); - } - - // check for params - char *szLeftPar = strchr(szName, '('); - if (szLeftPar) - { - *szLeftPar = '\0'; - szLeftPar++; - - char *szRightPar = strchr(szLeftPar, ')'); - if (!szRightPar) - return AtlsHttpError(500, ISE_SUBERR_UNEXPECTED); - - *szRightPar = '\0'; - - szMethodName = szName; - - } - - // No handler name is specified, so we look up the method name in - // T's replacement method map - const CTagReplacerMethodEntry *pEntry = NULL; - pT->GetReplacementMethodMap(&pEntry); - - hcErr = FindReplacementOffsetInMap(szMethodName, pdwMethodOffset, pEntry); - if (hcErr != HTTP_SUCCESS) - { - pT->GetAttrReplacementMethodMap(&pEntry); - hcErr = FindReplacementOffsetInMap(szMethodName, pdwMethodOffset, pEntry); - if (hcErr == HTTP_SUCCESS) - *pdwMap = STENCIL_ATTR_MAP; - } - else - { - *pdwMap = STENCIL_BASIC_MAP; - } - - // This assert will be triggered if arguments are passed to a replacement method that doesn't handle them - ATLASSERT( szLeftPar == NULL || (szLeftPar != NULL && (pEntry != NULL && pEntry[*pdwMethodOffset].Methods.pfnParse != NULL)) ); - - if (hcErr == HTTP_SUCCESS && pEntry && pEntry[*pdwMethodOffset].Methods.pfnParse) - hcErr = (pT->*pEntry[*pdwMethodOffset].Methods.pfnParse)(pMemMgr, szLeftPar, ppvParam); - return hcErr; - } - - HTTP_CODE FindReplacementOffsetInMap( - LPCSTR szMethodName, - LPDWORD pdwMethodOffset, - const CTagReplacerMethodEntry *pEntry) throw() - { - if (pEntry == NULL) - return HTTP_FAIL; - - const CTagReplacerMethodEntry *pEntryHead = pEntry; - - while (pEntry->szMethodName) - { - if (strcmp(pEntry->szMethodName, szMethodName) == 0) - { - if (pEntry->Methods.pfnMethod) - { - *pdwMethodOffset = (DWORD)(pEntry-pEntryHead); - return HTTP_SUCCESS; - } - } - pEntry++; - } - - return HTTP_FAIL; - } - - - // Used to render a single replacement tag into a stream. - // Looks up a pointer to a member function in user code by offseting into the users - // replacement map. Much faster than the other overload of this function since - // no string compares are performed. - HTTP_CODE RenderReplacement(DWORD dwFnOffset, DWORD dwObjOffset, DWORD dwMap, void *pvParam) - { - HTTP_CODE hcErr = HTTP_FAIL; - T *pT = static_cast(this); - - // if we were not passed an object offset, then we assume - // that the function at dwFnOffset is in T's replacement - // map - if (dwObjOffset == STENCIL_INVALIDOFFSET) - { - // call a function in T's replacement map - ATLASSERT(dwFnOffset != STENCIL_INVALIDOFFSET); - const CTagReplacerMethodEntry *pEntry = NULL; - if (dwMap == STENCIL_BASIC_MAP) - pT->GetReplacementMethodMap(&pEntry); - else - pT->GetAttrReplacementMethodMap(&pEntry); - if (pEntry) - { - if (pEntry[dwFnOffset].nType == REPLACEMENT_ENTRY_DEFAULT) - { - REPLACEMENT_METHOD pfn = NULL; - pfn = pEntry[dwFnOffset].Methods.pfnMethod; - ATLASSERT(pfn); - if (pfn) - { - hcErr = (pT->*pfn)(); - } - } - else if (pEntry[dwFnOffset].nType == REPLACEMENT_ENTRY_ARGS) - { - REPLACEMENT_METHOD_EX pfn = NULL; - pfn = pEntry[dwFnOffset].Methods.pfnMethodEx; - ATLASSERT(pfn); - if (pfn) - { - hcErr = (pT->*pfn)(pvParam); - } - } - else - { - // unknown entry type - ATLASSERT(FALSE); - } - } - } - else - { - // otherwise, we were passed an object offset. The object - // offset is a dword ID that T can use to look up the - // ITagReplacer* of a tag replacer that will render this - // replacement. - CComPtr spAltReplacer = NULL; - if (!pT->GetReplacementObject(dwObjOffset, &spAltReplacer)) - { - spAltReplacer->SetStream(m_pStream); - hcErr = spAltReplacer->RenderReplacement(dwFnOffset, STENCIL_INVALIDOFFSET, dwMap, pvParam); - } - } - return hcErr; - } - - // Default GetHandlerOffset, does nothing - HTTP_CODE GetHandlerOffset(LPCSTR /*szHandlerName*/, DWORD* pdwOffset) - { - if (pdwOffset) - *pdwOffset = 0; - return HTTP_FAIL; - } - - // Default GetReplacementObject, does nothing - HTTP_CODE GetReplacementObject(DWORD /*dwObjOffset*/, ITagReplacer **ppReplacer) - { - if (ppReplacer) - *ppReplacer = NULL; - return HTTP_FAIL; - } - - void GetReplacementMethodMap(const CTagReplacerMethodEntry ** ppOut) const - { - static const CTagReplacerMethodEntry methods[] = { { NULL, NULL } }; - *ppOut = methods; - } - - void GetAttrReplacementMethodMap(const CTagReplacerMethodEntry **ppOut) const - { - static const CTagReplacerMethodEntry methods[] = { { NULL, NULL } }; - *ppOut = methods; - } - - HRESULT GetContext(REFIID, void**) - { - return E_NOINTERFACE; - } - - virtual HINSTANCE GetResourceInstance() - { - return GetModuleHandle(NULL); - } - - HTTP_CODE DefaultParseString(IAtlMemMgr *pMemMgr, LPCSTR szParams, char **ppParam) throw(...) - { - ATLENSURE( pMemMgr != NULL ); - ATLENSURE( szParams != NULL ); - ATLENSURE( ppParam != NULL ); - - size_t nLen = strlen(szParams); - if (nLen) - { - nLen++; - *ppParam = (char *) pMemMgr->Allocate(nLen); - if (*ppParam) - Checked::memcpy_s(*ppParam, nLen, szParams, nLen); - else - return AtlsHttpError(500, ISE_SUBERR_OUTOFMEM); - } - - return HTTP_SUCCESS; - } - - HTTP_CODE DefaultParseUChar(IAtlMemMgr *pMemMgr, LPCSTR szParams, unsigned char **ppParam) throw(...) - { - ATLENSURE( pMemMgr != NULL ); - ATLENSURE( szParams != NULL ); - ATLENSURE( ppParam != NULL ); - - *ppParam = (unsigned char *) pMemMgr->Allocate(sizeof(unsigned char)); - if (*ppParam) - { - char *szEnd; - **ppParam = (unsigned char) strtoul(szParams, &szEnd, 10); - } - else - { - return AtlsHttpError(500, ISE_SUBERR_OUTOFMEM); - } - return HTTP_SUCCESS; - } - - HTTP_CODE DefaultParseShort(IAtlMemMgr *pMemMgr, LPCSTR szParams, short **ppParam) throw(...) - { - ATLENSURE( pMemMgr != NULL ); - ATLENSURE( szParams != NULL ); - ATLENSURE( ppParam != NULL ); - - *ppParam = (short *) pMemMgr->Allocate(sizeof(short)); - if (*ppParam) - { - **ppParam = (short)atoi(szParams); - } - else - { - return AtlsHttpError(500, ISE_SUBERR_OUTOFMEM); - } - return HTTP_SUCCESS; - } - - HTTP_CODE DefaultParseUShort(IAtlMemMgr *pMemMgr, LPCSTR szParams, unsigned short **ppParam) throw(...) - { - ATLENSURE( pMemMgr != NULL ); - ATLENSURE( szParams != NULL ); - ATLENSURE( ppParam != NULL ); - - *ppParam = (unsigned short *) pMemMgr->Allocate(sizeof(short)); - if (*ppParam) - { - char *szEnd; - **ppParam = (unsigned short) strtoul(szParams, &szEnd, 10); - } - else - { - return AtlsHttpError(500, ISE_SUBERR_OUTOFMEM); - } - return HTTP_SUCCESS; - } - - HTTP_CODE DefaultParseInt(IAtlMemMgr *pMemMgr, LPCSTR szParams, int **ppParam) throw(...) - { - ATLENSURE( pMemMgr != NULL ); - ATLENSURE( szParams != NULL ); - ATLENSURE( ppParam != NULL ); - - *ppParam = (int *) pMemMgr->Allocate(sizeof(int)); - if (*ppParam) - { - **ppParam = atoi(szParams); - } - else - { - return AtlsHttpError(500, ISE_SUBERR_OUTOFMEM); - } - return HTTP_SUCCESS; - } - - HTTP_CODE DefaultParseUInt(IAtlMemMgr *pMemMgr, LPCSTR szParams, unsigned int **ppParam) throw(...) - { - ATLENSURE( pMemMgr != NULL ); - ATLENSURE( szParams != NULL ); - ATLENSURE( ppParam != NULL ); - - *ppParam = (unsigned int *) pMemMgr->Allocate(sizeof(unsigned int)); - if (*ppParam) - { - char *szEnd; - **ppParam = strtoul(szParams, &szEnd, 10); - } - else - { - return AtlsHttpError(500, ISE_SUBERR_OUTOFMEM); - } - return HTTP_SUCCESS; - } - - HTTP_CODE DefaultParseInt64(IAtlMemMgr *pMemMgr, LPCSTR szParams, __int64 **ppParam) throw(...) - { - ATLENSURE( pMemMgr != NULL ); - ATLENSURE( szParams != NULL ); - ATLENSURE( ppParam != NULL ); - - *ppParam = (__int64 *) pMemMgr->Allocate(sizeof(__int64)); - if (*ppParam) - { - **ppParam = _atoi64(szParams); - } - else - { - return AtlsHttpError(500, ISE_SUBERR_OUTOFMEM); - } - return HTTP_SUCCESS; - } - - HTTP_CODE DefaultParseUInt64(IAtlMemMgr *pMemMgr, LPCSTR szParams, unsigned __int64 **ppParam) throw(...) - { - ATLENSURE( pMemMgr != NULL ); - ATLENSURE( szParams != NULL ); - ATLENSURE( ppParam != NULL ); - - *ppParam = (unsigned __int64 *) pMemMgr->Allocate(sizeof(unsigned __int64)); - if (*ppParam) - { - char *szEnd; - **ppParam = _strtoui64(szParams, &szEnd, 10); - } - else - { - return AtlsHttpError(500, ISE_SUBERR_OUTOFMEM); - } - return HTTP_SUCCESS; - } - - HTTP_CODE DefaultParseBool(IAtlMemMgr *pMemMgr, LPCSTR szParams, bool **ppParam) throw(...) - { - ATLENSURE( pMemMgr != NULL ); - ATLENSURE( szParams != NULL ); - ATLENSURE( ppParam != NULL ); - - *ppParam = (bool *) pMemMgr->Allocate(sizeof(bool)); - if (*ppParam) - { - if (!_strnicmp(szParams, "true", sizeof("true")-sizeof('\0'))) - **ppParam = true; - else - **ppParam = false; - } - else - { - return AtlsHttpError(500, ISE_SUBERR_OUTOFMEM); - } - - return HTTP_SUCCESS; - } - - HTTP_CODE DefaultParseDouble(IAtlMemMgr *pMemMgr, LPCSTR szParams, double **ppParam) throw(...) - { - ATLENSURE( pMemMgr != NULL ); - ATLENSURE( szParams != NULL ); - ATLENSURE( ppParam != NULL ); - - *ppParam = (double *) pMemMgr->Allocate(sizeof(double)); - if (*ppParam) - { - **ppParam = atof(szParams); - } - else - { - return AtlsHttpError(500, ISE_SUBERR_OUTOFMEM); - } - return HTTP_SUCCESS; - } - - HTTP_CODE DefaultParseFloat(IAtlMemMgr *pMemMgr, LPCSTR szParams, float **ppParam) throw(...) - { - ATLENSURE( pMemMgr != NULL ); - ATLENSURE( szParams != NULL ); - ATLENSURE( ppParam != NULL ); - - errno_t errnoValue = 0; - *ppParam = (float *) pMemMgr->Allocate(sizeof(float)); - if (*ppParam) - { - errno_t saveErrno = Checked::get_errno(); - Checked::set_errno(0); - **ppParam = (float) atof(szParams); - errnoValue = Checked::get_errno(); - Checked::set_errno(saveErrno); - } - else - { - return AtlsHttpError(500, ISE_SUBERR_OUTOFMEM); - } - if ((**ppParam == -HUGE_VAL) || (**ppParam == HUGE_VAL) || (errnoValue == ERANGE)) - { - return HTTP_FAIL; - } - return HTTP_SUCCESS; - } -}; - -inline LPCSTR SkipSpace(LPCSTR sz, WORD nCodePage) throw() -{ - if (sz == NULL) - return NULL; - - while (isspace(static_cast(*sz))) - sz = CharNextExA(nCodePage, sz, 0); - return sz; -} - -inline LPCSTR RSkipSpace(LPCSTR pStart, LPCSTR sz, WORD nCodePage) throw() -{ - if (sz == NULL || pStart == NULL) - return NULL; - - while (isspace(static_cast(*sz)) && sz != pStart) - sz = CharPrevExA(nCodePage, pStart, sz, 0); - return sz; -} - -// -// StencilToken -// The stencil class will create an array of these tokens during the parse -// phase and use them during rendering to render the stencil -struct StencilToken -{ - LPCSTR pStart; // Start of fragment to be rendered - LPCSTR pEnd; // End of fragment to be rendered - DWORD type; // Type of token - DWORD dwFnOffset; // Offset into the replacement map for the handler function. - DWORD dwMap; - DWORD dwObjOffset; // An identifier for the caller to use in identifiying the - // object that will render this token. - CHAR szHandlerName[ATL_MAX_HANDLER_NAME_LEN + 1]; // Name of handler object. - CHAR szMethodName[ATL_MAX_METHOD_NAME_LEN + 1]; // Name of handler method. - DWORD dwLoopIndex; // Offset into array of StencilTokens of the other loop tag - DWORD_PTR dwData; - BOOL bDynamicAlloc; -}; - - -// -// Class CStencil -// The CStencil class is used to map in a stencil from a file or resource -// and parse the stencil into an array of StencilTokens. We then render -// the stencil from the array of tokens. This class's parse and render -// functions depend on an IReplacementHandlerLookup interface pointer to be -// passed so it can retrieve the IReplacementHandler interface pointer of the -// handler object that will be called to render replacement tags -class CStencil : - public IMemoryCacheClient -{ -private: - LPCSTR m_pBufferStart; // Beginning of CHAR buffer that holds the stencil. - // For mapped files this is the beginning of the mapping. - LPCSTR m_pBufferEnd; // End of CHAR buffer that holds the stencil. - CAtlArray m_arrTokens; //An array of tokens. - FILETIME m_ftLastModified; // Last modified time (0 for resource) - FILETIME m_ftLastChecked; // Last time we retrieved last modified time (0 for resource) - HCACHEITEM m_hCacheItem; - WORD m_nCodePage; - BOOL m_bUseLocaleACP; - char m_szDllPath[MAX_PATH]; - char m_szHandlerName[ATL_MAX_HANDLER_NAME_LEN+1]; // Room for the path, the handler - // the '/' and the '\0' -#ifdef ATL_DEBUG_STENCILS - struct ParseError - { - char m_szError[ATL_STENCIL_MAX_ERROR_LEN]; - LPCSTR m_szPosition; - LPCSTR m_szStartLine; - LPCSTR m_szEndLine; - int m_nLineNumber; - - bool operator==(const ParseError& that) const throw() - { - return (m_nLineNumber == that.m_nLineNumber); - } - }; - - CSimpleArray m_Errors; - HINSTANCE m_hResInst; - - class CParseErrorProvider : public ITagReplacerImpl, - public CComObjectRootEx - { - public: - BEGIN_COM_MAP(CParseErrorProvider) - COM_INTERFACE_ENTRY(ITagReplacer) - END_COM_MAP() - CSimpleArray *m_pErrors; - int m_nCurrentError; - - CParseErrorProvider() throw() : - m_pErrors(NULL), - m_nCurrentError(-1) - { - } - - void Initialize(CSimpleArray *pErrors) throw() - { - m_pErrors = pErrors; - } - - HTTP_CODE OnGetNextError() throw() - { - m_nCurrentError++; - if (m_nCurrentError >= m_pErrors->GetSize() || - m_nCurrentError < 0 ) - { - m_nCurrentError = -1; - return HTTP_S_FALSE; - } - else - return HTTP_SUCCESS; - } - - HTTP_CODE OnGetErrorLineNumber() throw(...) - { - if (m_pErrors->GetSize() == 0) - return HTTP_SUCCESS; - if (m_nCurrentError > m_pErrors->GetSize() || - m_nCurrentError < 0) - m_nCurrentError = 0; - - CWriteStreamHelper c(m_pStream); - if (!c.Write((*m_pErrors)[m_nCurrentError].m_nLineNumber)) - return HTTP_FAIL; - - return HTTP_SUCCESS; - } - - HTTP_CODE OnGetErrorText() throw(...) - { - if (m_pErrors->GetSize() == 0) - return HTTP_SUCCESS; - if (m_nCurrentError > m_pErrors->GetSize() || - m_nCurrentError < 0) - m_nCurrentError = 0; - - CWriteStreamHelper c(m_pStream); - - if (!c.Write(static_cast((*m_pErrors)[m_nCurrentError].m_szError))) - return HTTP_FAIL; - - return HTTP_SUCCESS; - } - - HTTP_CODE OnGetErrorLine() throw(...) - { - ATLASSUME(m_pStream != NULL); - - if (m_pErrors->GetSize() == 0) - return HTTP_SUCCESS; - if (m_nCurrentError > m_pErrors->GetSize() || - m_nCurrentError < 0) - m_nCurrentError = 0; - - m_pStream->WriteStream((*m_pErrors)[m_nCurrentError].m_szStartLine, - (int)((*m_pErrors)[m_nCurrentError].m_szEndLine - (*m_pErrors)[m_nCurrentError].m_szStartLine), NULL); - - return HTTP_SUCCESS; - } - - BEGIN_REPLACEMENT_METHOD_MAP(CParseErrorProvider) - REPLACEMENT_METHOD_ENTRY("GetNextError", OnGetNextError) - REPLACEMENT_METHOD_ENTRY("GetErrorText", OnGetErrorText) - REPLACEMENT_METHOD_ENTRY("GetErrorLine", OnGetErrorLine) - REPLACEMENT_METHOD_ENTRY("GetErrorLineNumber", OnGetErrorLineNumber) - END_REPLACEMENT_METHOD_MAP() - }; - -#else - bool m_bErrorsOccurred; -#endif - - class CSaveThreadLocale - { - LCID m_locale; - public: - CSaveThreadLocale() throw() - { - m_locale = GetThreadLocale(); - } - ~CSaveThreadLocale() throw() - { - SetThreadLocale(m_locale); - } - }; - - HTTP_CODE LoadFromResourceInternal(HINSTANCE hInstRes, HRSRC hRsrc) throw() - { - ATLASSERT( hRsrc != NULL ); - - HGLOBAL hgResource = NULL; - hgResource = LoadResource(hInstRes, hRsrc); - if (!hgResource) - { - return HTTP_FAIL; - } - - DWORD dwSize = SizeofResource(hInstRes, hRsrc); - if (dwSize != 0) - { - m_pBufferStart = (LPSTR)LockResource(hgResource); - if (m_pBufferStart != NULL) - { - m_pBufferEnd = m_pBufferStart+dwSize; - return HTTP_SUCCESS; - } - } - - // failed to load resource - return HTTP_FAIL; - } - -protected: - - ITagReplacer *m_pReplacer; - IAtlMemMgr *m_pMemMgr; - static CCRTHeap m_crtHeap; - - inline BOOL CheckTag(LPCSTR szTag, DWORD dwTagLen, LPCSTR szStart, DWORD dwLen) throw() - { - if (dwLen < dwTagLen) - return FALSE; - - if (memcmp(szStart, szTag, dwTagLen)) - return FALSE; - - if (isspace(static_cast(szStart[dwTagLen])) || szStart[dwTagLen] == '}') - return TRUE; - - return FALSE; - } - - inline void FindTagArgs(LPCSTR& szstart, LPCSTR& szend, int nKeywordChars) throw() - { - // this function should only be called after finding a valid tag - // the first two characters of szstart should be {{ - ATLASSERT(szstart[0] == '{' && szstart[1] == '{'); - - if (*szstart == '{') - szstart += 2; // move past {{ - szstart = SkipSpace(szstart, m_nCodePage); // move past whitespace - szstart += nKeywordChars; // move past keyword - szstart = SkipSpace(szstart, m_nCodePage); // move past whitespace after keyword - if (*szend == '}') - szend -=2; // chop off }} - szend = RSkipSpace(szstart, szend, m_nCodePage); // chop of trailing whitespace - } - - DWORD CheckTopAndPop(DWORD *pBlockStack, DWORD *pdwTop, DWORD dwToken) throw() - { - if (*pdwTop == 0) - return STENCIL_INVALIDINDEX; - if (m_arrTokens[pBlockStack[*pdwTop]].type == dwToken) - { - *pdwTop = (*pdwTop) - 1; - return pBlockStack[(*pdwTop)+1]; - } - return STENCIL_INVALIDINDEX; - } - - DWORD PushToken(DWORD *pBlockStack, DWORD *pdwTop, DWORD dwIndex) throw() - { - if (*pdwTop < (ATL_MAX_BLOCK_STACK-1)) - { - *pdwTop = (*pdwTop) + 1; - pBlockStack[*pdwTop] = dwIndex; - } - else - { - dwIndex = STENCIL_INVALIDINDEX; - } - - return dwIndex; - } - -public: - - enum PARSE_TOKEN_RESULT { INVALID_TOKEN, NORMAL_TOKEN, RESERVED_TOKEN }; - - CStencil(IAtlMemMgr *pMemMgr=NULL) throw() - { - m_pBufferStart = NULL; - m_pBufferEnd = NULL; - m_hCacheItem = NULL; - m_ftLastModified.dwLowDateTime = 0; - m_ftLastModified.dwHighDateTime = 0; - m_ftLastChecked.dwLowDateTime = 0; - m_ftLastChecked.dwHighDateTime = 0; - m_arrTokens.SetCount(0, 128); - m_nCodePage = CP_ACP; - m_bUseLocaleACP = TRUE; - m_szHandlerName[0] = '\0'; - m_szDllPath[0] = '\0'; - m_pMemMgr = pMemMgr; - if (!pMemMgr) - m_pMemMgr = &m_crtHeap; -#ifdef ATL_DEBUG_STENCILS - m_hResInst = NULL; -#else - m_bErrorsOccurred = false; -#endif - - } - - virtual ~CStencil() throw() - { - Uninitialize(); - } - -#ifdef ATL_DEBUG_STENCILS - - bool RenderErrors(IWriteStream *pStream) throw(...) - { - if (pStream == NULL) - { - return false; - } - - CComObjectStackEx Errors; - - Errors.Initialize(&m_Errors); - CStencil ErrorStencil; - - if (m_hResInst != NULL) - { - CFixedStringT strErrorStencil; - _ATLTRY - { - if (strErrorStencil.LoadString(m_hResInst, IDS_STENCIL_ERROR_STENCIL) == FALSE) - { - return false; - } - } - _ATLCATCHALL() - { - return false; - } - - HTTP_CODE hcRet = ErrorStencil.LoadFromString(strErrorStencil, strErrorStencil.GetLength()); - - if (hcRet == HTTP_SUCCESS) - { - if (ErrorStencil.ParseReplacements(static_cast(&Errors)) != false) - { - ErrorStencil.FinishParseReplacements(); - if (ErrorStencil.ParseSuccessful() != false) - { - hcRet = ErrorStencil.Render(static_cast(&Errors), pStream); - - if (HTTP_ERROR_CODE(hcRet) < 400) - { - return true; - } - } - } - } - } - - return false; - } - - void SetErrorResource(HINSTANCE hResInst) - { - m_hResInst = hResInst; - } - - bool ParseSuccessful() - { - return (m_Errors.GetSize() == 0); - } - - bool AddErrorInternal(LPCSTR szErrorText, LPCSTR szPosition) throw() - { - int nLineNum = 0; - LPCSTR szStartLine = NULL; - LPCSTR szPtr = m_pBufferStart; - while (szPtr < szPosition) - { - if (*szPtr == '\n') - { - szStartLine = szPtr + 1; - nLineNum++; - } - - LPSTR szNext = CharNextExA(m_nCodePage, szPtr, 0); - if (szNext == szPtr) - { - break; - } - szPtr = szNext; - } - LPCSTR szEndLine = szPtr; - while (*szPtr) - { - if (*szPtr == '\n') - break; - szEndLine = szPtr; - LPSTR szNext = CharNextExA(m_nCodePage, szPtr, 0); - if (szNext == szPtr) - { - break; - } - szPtr = szNext; - } - - ParseError p; - SafeStringCopy(p.m_szError, szErrorText); - p.m_szPosition = szPosition; - p.m_nLineNumber = nLineNum; - p.m_szStartLine = szStartLine; - p.m_szEndLine = szEndLine; - - return (m_Errors.Add(p) == TRUE); - } - - bool AddError(UINT uID, LPCSTR szPosition) throw() - { - if (m_hResInst != NULL) - { - _ATLTRY - { - CFixedStringT strRes; - if (strRes.LoadString(m_hResInst, uID) != FALSE) - { - return AddErrorInternal(strRes, szPosition); - } - } - _ATLCATCHALL() - { - } - } - return AddErrorInternal("Could not load resource for error string", szPosition); - } - - bool AddReplacementError(LPCSTR szReplacement, LPCSTR szPosition) throw() - { - if (m_hResInst != NULL) - { - _ATLTRY - { - CFixedStringT strRes; - if (strRes.LoadString(m_hResInst, IDS_STENCIL_UNRESOLVED_REPLACEMENT) != FALSE) - { - CFixedStringT strErrorText; - strErrorText.Format(strRes, szReplacement); - return AddErrorInternal(strErrorText, szPosition); - } - else - { - return AddErrorInternal("Could not load resource for error string", szPosition); - } - } - _ATLCATCHALL() - { - return false; - } - } - - return false; - } - -#else - - bool ParseSuccessful() - { - return !m_bErrorsOccurred; - } - - bool AddError(UINT /*uID*/, LPCSTR /*szPosition*/) throw() - { - m_bErrorsOccurred = true; - return true; - } - - bool AddReplacementError(LPCSTR /*szReplacement*/, LPCSTR /*szPosition*/) throw() - { - m_bErrorsOccurred = true; - return true; - } - - void SetErrorResource(HINSTANCE) throw() - { - } - -#endif - - // Call Uninitialize if you want to re-use an already initialized CStencil - void Uninitialize() throw() - { - int nSize = (int) m_arrTokens.GetCount(); - for (int nIndex = 0; nIndex < nSize; nIndex++) - { - if (m_arrTokens[nIndex].bDynamicAlloc) - delete [] m_arrTokens[nIndex].pStart; - if (m_arrTokens[nIndex].dwData != 0 && m_arrTokens[nIndex].type != STENCIL_LOCALE) - m_pMemMgr->Free((void *) m_arrTokens[nIndex].dwData); - } - - m_arrTokens.RemoveAll(); - if ((m_ftLastModified.dwLowDateTime || m_ftLastModified.dwHighDateTime) && m_pBufferStart) - { - delete [] m_pBufferStart; - } - m_pBufferStart = NULL; - m_pBufferEnd = NULL; - } - - void GetLastModified(FILETIME *pftLastModified) - { - ATLENSURE(pftLastModified); - *pftLastModified = m_ftLastModified; - } - - void GetLastChecked(FILETIME *pftLastChecked) - { - ATLENSURE(pftLastChecked); - *pftLastChecked = m_ftLastChecked; - } - - void SetLastChecked(FILETIME *pftLastChecked) - { - ATLENSURE(pftLastChecked); - m_ftLastChecked = *pftLastChecked; - } - - HCACHEITEM GetCacheItem() - { - return m_hCacheItem; - } - - void SetCacheItem(HCACHEITEM hCacheItem) - { - ATLASSUME(m_hCacheItem == NULL); - m_hCacheItem = hCacheItem; - } - - bool GetHandlerName(__out_ecount_z(nPathLen) LPSTR szDllPath, __in size_t nPathLen, __out_ecount_z(nHandlerNameLen) LPSTR szHandlerName, __in size_t nHandlerNameLen) throw() - { - if(strlen(m_szDllPath) >= nPathLen) - { - return false; - } - - if(strlen(m_szHandlerName) >= nHandlerNameLen) - { - return false; - } - - if(0 != strcpy_s(szDllPath, nPathLen, m_szDllPath)) - { - return false; - } - - if(0 != strcpy_s(szHandlerName, nHandlerNameLen, m_szHandlerName)) - { - return false; - } - - return true; - } - - // Adds a token to the token array, handler name, method name - // and handler function offset are optional - ATL_NOINLINE DWORD AddToken( - LPCSTR pStart, - LPCSTR pEnd, - DWORD dwType, - LPCSTR szHandlerName = NULL, - LPCSTR szMethodName = NULL, - DWORD dwFnOffset = STENCIL_INVALIDOFFSET, - DWORD dwObjOffset = STENCIL_INVALIDOFFSET, - DWORD_PTR dwData = 0, - DWORD dwMap = 0, - BOOL bDynamicAlloc = 0) throw() - { - StencilToken t; - - memset(&t, 0x00, sizeof(t)); - - t.pStart = pStart; - t.pEnd = pEnd; - t.type = dwType; - t.dwLoopIndex = STENCIL_INVALIDINDEX; - t.dwFnOffset = dwFnOffset; - t.dwObjOffset = dwObjOffset; - t.dwData = dwData; - t.dwMap = dwMap; - t.bDynamicAlloc = bDynamicAlloc; - - // this should never assert unless the user has overriden something incorrectly - if ((szHandlerName != NULL) && (*szHandlerName)) - { - ATLVERIFY( SafeStringCopy(t.szHandlerName, szHandlerName) ); - } - if ((szMethodName != NULL) && (*szMethodName)) - { - ATLVERIFY( SafeStringCopy(t.szMethodName, szMethodName) ); - } - - _ATLTRY - { - return (DWORD) m_arrTokens.Add(t); - } - _ATLCATCHALL() - { - return STENCIL_INVALIDINDEX; - } - } - - HTTP_CODE LoadFromFile(LPCSTR szFileName) throw() - { - HRESULT hr = E_FAIL; - ULONGLONG dwLen = 0; - CAtlFile file; - - _ATLTRY - { - hr = file.Create(CA2CTEX(szFileName), GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING); - if (FAILED(hr) || GetFileType(file) != FILE_TYPE_DISK) - return AtlsHttpError(500, ISE_SUBERR_STENCIL_LOAD_FAIL); // couldn't load SRF! - - if (GetFileTime(file, NULL, NULL, &m_ftLastModified)) - { - if (SUCCEEDED(file.GetSize(dwLen))) - { - ATLASSERT(!m_pBufferStart); - - GetSystemTimeAsFileTime(&m_ftLastChecked); - - m_pBufferStart = NULL; - CAutoVectorPtr buffer; - if (!buffer.Allocate((size_t) dwLen)) - return AtlsHttpError(500, ISE_SUBERR_OUTOFMEM); // out of memory - - DWORD dwRead = 0; - hr = file.Read(buffer, (DWORD) dwLen, dwRead); - if (FAILED(hr)) - return AtlsHttpError(500, ISE_SUBERR_READFILEFAIL); // ReadFile failed - - m_pBufferStart = buffer.Detach(); - m_pBufferEnd = m_pBufferStart + dwRead; - } - } - } - _ATLCATCHALL() - { - return AtlsHttpError(500, ISE_SUBERR_OUTOFMEM); - } - - return HTTP_SUCCESS; - } - - // loads a stencil from the specified resource. - HTTP_CODE LoadFromResource(HINSTANCE hInstRes, LPCSTR szID, LPCSTR szType = NULL) throw() - { - if (szType == NULL) - { - szType = (LPCSTR) RT_HTML; - } - - HRSRC hRsrc = FindResourceA(hInstRes, szID, szType); - if (hRsrc != NULL) - { - return LoadFromResourceInternal(hInstRes, hRsrc); - } - - return HTTP_FAIL; - } - - HTTP_CODE LoadFromResourceEx(HINSTANCE hInstRes, LPCSTR szID, WORD wLanguage, LPCSTR szType = NULL) throw() - { - if (szType == NULL) - { - szType = (LPCSTR) RT_HTML; - } - - HRSRC hRsrc = FindResourceExA(hInstRes, szType, szID, wLanguage); - if (hRsrc != NULL) - { - return LoadFromResourceInternal(hInstRes, hRsrc); - } - - return HTTP_FAIL; - } - - // loads a stencil from the specified resource - HTTP_CODE LoadFromResource(HINSTANCE hInstRes, UINT nId, LPCSTR szType = NULL) throw() - { - return LoadFromResource(hInstRes, MAKEINTRESOURCEA(nId), szType); - } - - HTTP_CODE LoadFromResourceEx(HINSTANCE hInstRes, UINT nId, WORD wLanguage, LPCSTR szType = NULL) throw() - { - return LoadFromResourceEx(hInstRes, MAKEINTRESOURCEA(nId), wLanguage, szType); - } - - // loads a stencil from a string - HTTP_CODE LoadFromString(LPCSTR szString, DWORD dwSize) throw() - { - m_pBufferStart = szString; - m_pBufferEnd = m_pBufferStart+dwSize; - return HTTP_SUCCESS; - } - - // Cracks the loaded stencil into an array of StencilTokens in preparation for - // rendering. LoadStencil must be called prior to calling this function. - virtual bool ParseReplacements(ITagReplacer* pReplacer) throw(...) - { - return ParseReplacementsFromBuffer(pReplacer, GetBufferStart(), GetBufferEnd()); - } - - virtual bool FinishParseReplacements() throw(...) - { - DWORD dwSize = (DWORD) m_arrTokens.GetCount(); - for (DWORD dwIndex = 0; dwIndex < dwSize; dwIndex++) - { - StencilToken& token = m_arrTokens[dwIndex]; - bool bUnclosedBlock = ((token.type == STENCIL_CONDITIONALSTART || - token.type == STENCIL_CONDITIONALELSE || - token.type == STENCIL_ITERATORSTART) && - token.dwLoopIndex == STENCIL_INVALIDINDEX); - if ((token.szMethodName[0] && token.dwFnOffset == STENCIL_INVALIDOFFSET) || bUnclosedBlock) - { - if (bUnclosedBlock || - m_pReplacer->FindReplacementOffset( - token.szMethodName, &token.dwFnOffset, - token.szHandlerName, &token.dwObjOffset, - &token.dwMap, (void **)(&token.dwData), m_pMemMgr) != HTTP_SUCCESS) - { - if (bUnclosedBlock && token.type == STENCIL_CONDITIONALSTART) - { - AddError(IDS_STENCIL_UNCLOSEDBLOCK_IF, token.pStart); - } - else if (bUnclosedBlock && token.type == STENCIL_CONDITIONALELSE) - { - AddError(IDS_STENCIL_UNCLOSEDBLOCK_ELSE, token.pStart); - } - else if (bUnclosedBlock && token.type == STENCIL_ITERATORSTART) - { - AddError(IDS_STENCIL_UNCLOSEDBLOCK_WHILE, token.pStart); - } - else - { - AddReplacementError(token.szMethodName, token.pStart); - } - - // unresolved replacement, convert it to a text token - token.type = STENCIL_TEXTTAG; - - // convert all linked tokens to text tokens as well - // this includes: endif, else, endwhile - DWORD dwLoopIndex = token.dwLoopIndex; - while (dwLoopIndex != dwIndex && dwLoopIndex != STENCIL_INVALIDINDEX) - { - m_arrTokens[dwLoopIndex].type = STENCIL_TEXTTAG; - dwLoopIndex = m_arrTokens[dwLoopIndex].dwLoopIndex; - } - } - } - } - - return ParseSuccessful(); - } - - virtual bool Parse(ITagReplacer *pReplacer) throw( ... ) - { - if (ParseReplacements(pReplacer)) - { - return FinishParseReplacements(); - } - return false; - } - - - DWORD ParseReplacement( LPCSTR szTokenStart, - LPCSTR szTokenEnd, - DWORD dwTokenType = STENCIL_REPLACEMENT, - DWORD dwKeywordLen = 0) throw() - { - // hold on to the start and end pointers (before removing curlies and whitespace) - // this is needed so that we can convert the token to a text token if the method - // is not resolved (in FinishParseReplacements) - LPCSTR szStart = szTokenStart; - LPCSTR szEnd = szTokenEnd; - - FindTagArgs(szTokenStart, szTokenEnd, dwKeywordLen); - - char szMethodName[ATL_MAX_METHOD_NAME_LEN+1]; - char szHandlerName[ATL_MAX_HANDLER_NAME_LEN+1]; - - DWORD dwIndex; - //look up the handler name, method name and handler interface - if (HTTP_SUCCESS == GetHandlerAndMethodNames(szTokenStart, szTokenEnd, - szMethodName, ATL_MAX_METHOD_NAME_LEN+1, - szHandlerName, ATL_MAX_HANDLER_NAME_LEN+1)) - dwIndex = AddToken(szStart, szEnd, dwTokenType, - szHandlerName, szMethodName, - STENCIL_INVALIDINDEX, STENCIL_INVALIDINDEX, - 0, STENCIL_BASIC_MAP); - else - dwIndex = STENCIL_INVALIDINDEX; - return dwIndex; - } - - DWORD ParseWhile(LPCSTR szTokenStart, LPCSTR szTokenEnd, DWORD *pBlockStack, DWORD *pdwTop) throw() - { - DWORD dwIndex = ParseReplacement(szTokenStart, szTokenEnd, STENCIL_ITERATORSTART, sizeof("while")-1); - if (dwIndex == STENCIL_INVALIDINDEX) - return dwIndex; - return PushToken(pBlockStack, pdwTop, dwIndex); - } - - DWORD ParseEndWhile(LPCSTR szTokenStart, LPCSTR szTokenEnd, DWORD *pBlockStack, DWORD *pdwTop) throw() - { - DWORD dwTopIndex = CheckTopAndPop(pBlockStack, pdwTop, STENCIL_ITERATORSTART); - if (dwTopIndex == STENCIL_INVALIDINDEX) - { - AddError(IDS_STENCIL_UNOPENEDBLOCK_ENDWHILE, szTokenStart); - return dwTopIndex; - } - - DWORD dwIndex = AddToken(szTokenStart, szTokenEnd, STENCIL_ITERATOREND); - if (dwIndex != STENCIL_INVALIDINDEX) - { - m_arrTokens[dwTopIndex].dwLoopIndex = dwIndex; - m_arrTokens[dwIndex].dwLoopIndex = dwTopIndex; - } - return dwIndex; - } - - DWORD ParseIf(LPCSTR szTokenStart, LPCSTR szTokenEnd, DWORD *pBlockStack, DWORD *pdwTop) throw() - { - DWORD dwIndex = ParseReplacement(szTokenStart, szTokenEnd, STENCIL_CONDITIONALSTART, sizeof("if")-1); - if (dwIndex == STENCIL_INVALIDINDEX) - return dwIndex; - return PushToken(pBlockStack, pdwTop, dwIndex); - } - - DWORD ParseElse(LPCSTR szTokenStart, LPCSTR szTokenEnd, DWORD *pBlockStack, DWORD *pdwTop) throw() - { - DWORD dwTopIndex = CheckTopAndPop(pBlockStack, pdwTop, STENCIL_CONDITIONALSTART); - if (dwTopIndex == STENCIL_INVALIDINDEX) - { - AddError(IDS_STENCIL_UNOPENEDBLOCK_ELSE, szTokenStart); - return dwTopIndex; - } - - DWORD dwIndex = AddToken(szTokenStart, szTokenEnd, STENCIL_CONDITIONALELSE); - if (dwIndex != STENCIL_INVALIDINDEX) - { - m_arrTokens[dwTopIndex].dwLoopIndex = dwIndex; - - return PushToken(pBlockStack, pdwTop, dwIndex); - } - return dwIndex; - } - - DWORD ParseEndIf(LPCSTR szTokenStart, LPCSTR szTokenEnd, DWORD *pBlockStack, DWORD *pdwTop) throw() - { - DWORD dwTopIndex = CheckTopAndPop(pBlockStack, pdwTop, STENCIL_CONDITIONALSTART); - if (dwTopIndex == STENCIL_INVALIDINDEX) - { - dwTopIndex = CheckTopAndPop(pBlockStack, pdwTop, STENCIL_CONDITIONALELSE); - if (dwTopIndex == STENCIL_INVALIDINDEX) - { - AddError(IDS_STENCIL_UNOPENEDBLOCK_ENDIF, szTokenStart); - return dwTopIndex; - } - } - DWORD dwIndex = AddToken(szTokenStart, szTokenEnd, STENCIL_CONDITIONALEND); - if (dwIndex != STENCIL_INVALIDINDEX) - { - m_arrTokens[dwTopIndex].dwLoopIndex = dwIndex; - } - return dwIndex; - } - - DWORD ParseLocale(LPCSTR szTokenStart, LPCSTR szTokenEnd) throw() - { - LPCSTR szstart = szTokenStart; - LPCSTR szend = szTokenEnd; - LCID locale = 0xFFFFFFFF; - FindTagArgs(szstart, szend, 6); -#ifndef ATL_NO_MLANG - if (isdigit(static_cast(szstart[0]))) - { - locale = (LCID) atoi(szstart); - } - else - { - HRESULT hr; - - CComPtr pML; - hr = pML.CoCreateInstance(__uuidof(CMultiLanguage), NULL, CLSCTX_INPROC_SERVER); - if (FAILED(hr)) - { - ATLTRACE(atlTraceStencil, 0, _T("Couldn't create CMultiLanguage object. check MLANG installation.")); - AddError(IDS_STENCIL_MLANG_COCREATE, szTokenStart); - } - else - { - CStringW str(szstart, (int)((szend-szstart)+1)); - -#ifdef __IMultiLanguage2_INTERFACE_DEFINED__ - - // use IMultiLanguage2 if possible - CComPtr spML2; - hr = pML.QueryInterface(&spML2); - if (FAILED(hr) || !spML2.p) - hr = pML->GetLcidFromRfc1766(&locale, CComBSTR(str)); - else - hr = spML2->GetLcidFromRfc1766(&locale, CComBSTR(str)); - -#else // __IMultiLanguage2_INTERFACE_DEFINED__ - - hr = pML->GetLcidFromRfc1766(&locale, CComBSTR(str)); - -#endif // __IMultiLanguage2_INTERFACE_DEFINED__ - - if (FAILED(hr)) - { - AddError(IDS_STENCIL_MLANG_LCID, szTokenStart); - } - } - if (FAILED(hr)) - locale = 0xFFFFFFFF; - } -#else - locale = (LCID) atoi(szstart); -#endif - - if (m_bUseLocaleACP) - { - TCHAR szACP[7]; - if (GetLocaleInfo(locale, LOCALE_IDEFAULTANSICODEPAGE, szACP, 7) != 0) - { - m_nCodePage = (WORD) _ttoi(szACP); - } - else - { - AddError(IDS_STENCIL_MLANG_GETLOCALE, szTokenStart); - } - } - DWORD dwCurrentTokenIndex = STENCIL_INVALIDINDEX; - if (locale != 0xFFFFFFFF) - dwCurrentTokenIndex = AddToken(NULL, NULL, STENCIL_LOCALE, - NULL, NULL, STENCIL_INVALIDOFFSET, STENCIL_INVALIDOFFSET, locale); - else - return STENCIL_INVALIDINDEX; - return dwCurrentTokenIndex; - } - - DWORD ParseCodepage(LPCSTR szTokenStart, LPCSTR szTokenEnd) throw() - { - LPCSTR szstart = szTokenStart; - LPCSTR szend = szTokenEnd; - WORD nCodePage = 0xFFFF; - - FindTagArgs(szstart, szend, 8); -#ifndef ATL_NO_MLANG - if (isdigit(static_cast(szstart[0]))) - { - nCodePage = (WORD) atoi(szstart); - } - else - { - HRESULT hr; - - CComPtr pML; - hr = pML.CoCreateInstance(__uuidof(CMultiLanguage), NULL, CLSCTX_INPROC_SERVER); - if (FAILED(hr)) - { - ATLTRACE(atlTraceStencil, 0, _T("Couldn't create CMultiLanguage object. check MLANG installation.")); - AddError(IDS_STENCIL_MLANG_COCREATE, szTokenStart); - } - else - { - CStringW str(szstart, (int)((szend-szstart)+1)); - MIMECSETINFO info; - -#ifdef __IMultiLanguage2_INTERFACE_DEFINED__ - - // use IMultiLanguage2 if possible - CComPtr spML2; - hr = pML.QueryInterface(&spML2); - if (FAILED(hr) || !spML2.p) - hr = pML->GetCharsetInfo(CComBSTR(str), &info); - else - hr = spML2->GetCharsetInfo(CComBSTR(str), &info); - -#else // __IMultiLanguage2_INTERFACE_DEFINED__ - - hr = pML->GetCharsetInfo(CComBSTR(str), &info); - -#endif // __IMultiLanguage2_INTERFACE_DEFINED__ - - // for most character sets, uiCodePage and uiInternetEncoding - // are the same. UTF-8 is the exception that we're concerned about. - // for that character set, we want uiInternetEncoding (65001 - UTF-8) - // instead of uiCodePage (1200 - UCS-2) - if (SUCCEEDED(hr)) - { - nCodePage = (WORD) info.uiInternetEncoding; - } - else - { - AddError(IDS_STENCIL_MLANG_GETCHARSET, szTokenStart); - } - } - if (FAILED(hr)) - nCodePage = 0xFFFF; - } -#else - nCodePage = (WORD) atoi(szstart); -#endif - if (nCodePage != 0xFFFF) - m_nCodePage = nCodePage; - m_bUseLocaleACP = FALSE; - - return STENCIL_INVALIDINDEX; - } - - PARSE_TOKEN_RESULT ParseHandler(LPCSTR szTokenStart, LPCSTR szTokenEnd) throw() - { - LPCSTR szstart = szTokenStart; - LPCSTR szend = szTokenEnd; - - if (m_szHandlerName[0] && m_szDllPath[0]) - return RESERVED_TOKEN; // already found the handler and path dll names - - FindTagArgs(szstart, szend, 7); - size_t nlen = (szend-szstart)+1; - char szHandlerDllName[MAX_PATH + ATL_MAX_HANDLER_NAME_LEN + 1]; - if (nlen < MAX_PATH + ATL_MAX_HANDLER_NAME_LEN + 1) - { - Checked::memcpy_s(szHandlerDllName, MAX_PATH + ATL_MAX_HANDLER_NAME_LEN + 1, szstart, szend-szstart+1); - szHandlerDllName[szend-szstart+1] = '\0'; - - DWORD dwDllPathLen = MAX_PATH; - DWORD dwHandlerNameLen = ATL_MAX_HANDLER_NAME_LEN+1; - - if (!_AtlCrackHandler(szHandlerDllName, m_szDllPath, &dwDllPathLen, m_szHandlerName, &dwHandlerNameLen)) - { - AddError(IDS_STENCIL_INVALID_HANDLER, szTokenStart); - return INVALID_TOKEN; - } - } - - return RESERVED_TOKEN; - } - - virtual PARSE_TOKEN_RESULT ParseToken(LPCSTR szTokenStart, LPCSTR szTokenEnd, DWORD *pBlockStack, DWORD *pdwTop) - { - LPCSTR pStart = szTokenStart; - pStart += 2; //skip curlies - pStart = SkipSpace(pStart, m_nCodePage); - DWORD dwLen = (DWORD)(szTokenEnd - szTokenStart); - - DWORD dwIndex = STENCIL_INVALIDINDEX; - PARSE_TOKEN_RESULT ret = RESERVED_TOKEN; - - if (CheckTag("endwhile", 8, pStart, dwLen)) - dwIndex = ParseEndWhile(szTokenStart, szTokenEnd, pBlockStack, pdwTop); - else if (CheckTag("while", 5, pStart, dwLen)) - dwIndex = ParseWhile(szTokenStart, szTokenEnd, pBlockStack, pdwTop); - else if (CheckTag("endif", 5, pStart, dwLen)) - dwIndex = ParseEndIf(szTokenStart, szTokenEnd, pBlockStack, pdwTop); - else if (CheckTag("else", 4, pStart, dwLen)) - dwIndex = ParseElse(szTokenStart, szTokenEnd, pBlockStack, pdwTop); - else if (CheckTag("if", 2, pStart, dwLen)) - dwIndex = ParseIf(szTokenStart, szTokenEnd, pBlockStack, pdwTop); - else if (CheckTag("locale", 6, pStart, dwLen)) - dwIndex = ParseLocale(szTokenStart, szTokenEnd); - else if (CheckTag("handler", 7, pStart, dwLen)) - { - return ParseHandler(szTokenStart, szTokenEnd); - } - else if (CheckTag("codepage", 8, pStart, dwLen)) - { - ParseCodepage(szTokenStart, szTokenEnd); - return RESERVED_TOKEN; - } - else - { - dwIndex = ParseReplacement(szTokenStart, szTokenEnd, STENCIL_REPLACEMENT); - if (dwIndex == STENCIL_INVALIDINDEX) - return INVALID_TOKEN; - ret = NORMAL_TOKEN; - } - - if (dwIndex == STENCIL_INVALIDINDEX) - return INVALID_TOKEN; - return ret; - } - - virtual bool ParseReplacementsFromBuffer(ITagReplacer* pReplacer, LPCSTR pStart, LPCSTR pEnd) - { - LPCSTR szCurr = pStart; - DWORD BlockStack[ATL_MAX_BLOCK_STACK]; - DWORD dwTop = 0; - - m_pReplacer = pReplacer; - - DWORD dwCurrentTokenIndex = 0; - - if (!szCurr) - { - ATLASSERT(FALSE); - AddError(IDS_STENCIL_NULLPARAM, NULL); - return false; - } - - LPCSTR szEnd = pEnd; - if (szEnd <= szCurr) - { - ATLASSERT(FALSE); - AddError(IDS_STENCIL_INVALIDSTRING, NULL); - return true; - } - - while(szCurr < szEnd) - { - //mark the start of this block, then find the end of the block - //the end is denoted by an opening curly - LPCSTR szStart = szCurr; - while (szCurr < szEnd && (*szCurr != '{' || szCurr[1] != '{')) - { - LPSTR szNext = CharNextExA(m_nCodePage, szCurr, 0); - if (szNext == szCurr) - { - // embedded null - AddError(IDS_STENCIL_EMBEDDED_NULL, NULL); - return true; - } - szCurr = szNext; - } - - //special case for the last text block, if there is one - if (szCurr >= szEnd) - { - // add the last token. This is everything after the last - // double curly block, which is text. - dwCurrentTokenIndex = AddToken(szStart, szEnd-1, STENCIL_TEXTTAG); - break; - } - - //if there are any characters between szStart and szCurr inclusive, - //copy them to a text token. - if (szCurr-1 >= szStart) - dwCurrentTokenIndex = AddToken(szStart, szCurr-1, STENCIL_TEXTTAG); - - if (dwCurrentTokenIndex == STENCIL_INVALIDINDEX) - { - AddError(IDS_STENCIL_OUTOFMEMORY, pStart); - return false; - } - - //find the end of the tag - LPSTR szEndTag; - szStart = szCurr; - szCurr += 2; // Skip over the two '{' s - while (szCurr < szEnd) - { - if (szCurr[0] == '}' && szCurr[1] == '}') - break; - else if (szCurr[0] == '{') - break; - - LPSTR szNext = CharNextExA(m_nCodePage, szCurr, 0); - if (szNext == szCurr) - { - // embedded null - AddError(IDS_STENCIL_EMBEDDED_NULL, NULL); - return true; - } - szCurr = szNext; - } - - if (szCurr >= szEnd) - { - AddError(IDS_STENCIL_UNMATCHED_TAG_START, szStart); - if (AddToken(szStart, szCurr-1, STENCIL_TEXTTAG) == STENCIL_INVALIDINDEX) - { - AddError(IDS_STENCIL_OUTOFMEMORY, pStart); - return false; - } - - break; - } - - if (szCurr[0] == '{') - { - if (szCurr[1] != '{') - { - szCurr--; - } - AddError(IDS_STENCIL_MISMATCHED_TAG_START, szStart); - if (AddToken(szStart, szCurr-1, STENCIL_TEXTTAG) == STENCIL_INVALIDINDEX) - { - AddError(IDS_STENCIL_OUTOFMEMORY, pStart); - return false; - } - - continue; - } - - szEndTag = CharNextExA(m_nCodePage, szCurr, 0); - if (szEndTag == szCurr) - { - // embedded null - AddError(IDS_STENCIL_EMBEDDED_NULL, NULL); - return true; - } - - PARSE_TOKEN_RESULT ret = ParseToken(szStart, szEndTag, BlockStack, &dwTop); - - if (ret == INVALID_TOKEN) - { - dwCurrentTokenIndex = AddToken(szStart, szEndTag, STENCIL_TEXTTAG); - if (dwCurrentTokenIndex == STENCIL_INVALIDINDEX) - { - AddError(IDS_STENCIL_OUTOFMEMORY, pStart); - return false; - } - - szCurr = CharNextExA(m_nCodePage, szEndTag, 0); - continue; - } - - szCurr = CharNextExA(m_nCodePage, szEndTag, 0); - if (szEndTag == szCurr) - { - // embedded null - AddError(IDS_STENCIL_EMBEDDED_NULL, NULL); - return true; - } - - if (ret == RESERVED_TOKEN) - { - if (szCurr < szEnd && *szCurr == '\n') - szCurr++; - else if ((szCurr+1 < szEnd && *szCurr == '\r' && *(szCurr+1) == '\n')) - szCurr += 2; - } - } - - return true; - } - - HTTP_CODE GetHandlerAndMethodNames( - __in LPCSTR pStart, - __in LPCSTR pEnd, - __out_ecount_z(nMethodNameLen) LPSTR pszMethodName, - __in size_t nMethodNameLen, - __out_ecount_z(nHandlerNameLen) LPSTR pszHandlerName, - __in size_t nHandlerNameLen) throw() - { - - ATLASSERT(pStart); - ATLASSERT(pEnd); - ATLASSERT(pEnd > pStart); - - if (!pszMethodName || !pszHandlerName || nMethodNameLen < 1 || nHandlerNameLen < 1) - { - ATLASSERT(FALSE); - AddError(IDS_STENCIL_BAD_PARAMETER, pStart); - return AtlsHttpError(500, ISE_SUBERR_UNEXPECTED); - } - - - *pszMethodName = '\0'; - *pszHandlerName = '\0'; - CHAR szMethodString[ATL_MAX_METHOD_NAME_LEN + ATL_MAX_HANDLER_NAME_LEN+1]; - HTTP_CODE hcErr = HTTP_SUCCESS; - // - // copy the method string - // - size_t nMethodLen = (pEnd-pStart)+1; - if (nMethodLen >= (ATL_MAX_METHOD_NAME_LEN + ATL_MAX_HANDLER_NAME_LEN+1)) - { - AddError(IDS_STENCIL_METHODNAME_TOO_LONG, pStart); - return AtlsHttpError(500, ISE_SUBERR_LONGMETHODNAME); - } - - Checked::memcpy_s(szMethodString, ATL_MAX_METHOD_NAME_LEN + ATL_MAX_HANDLER_NAME_LEN+1, pStart, nMethodLen); - szMethodString[nMethodLen] = '\0'; - - // - // now crack the method string and get the handler - // id and function name - // - LPSTR szParen = strchr(szMethodString, '('); - LPSTR szDot = strchr(szMethodString, '.'); - if (szDot && (!szParen || (szDot < szParen))) - { - *szDot = '\0'; - szDot++; - - // copy method name - if (strlen(szDot) < nMethodNameLen) - Checked::strcpy_s(pszMethodName, nMethodNameLen, szDot); - else - { - AddError(IDS_STENCIL_METHODNAME_TOO_LONG, pStart + (szDot - szMethodString)); - hcErr = AtlsHttpError(500, ISE_SUBERR_LONGMETHODNAME); - } - // copy handler name - if (!hcErr) - { - if (strlen(szMethodString) < nHandlerNameLen) - Checked::strcpy_s(pszHandlerName, nHandlerNameLen, szMethodString); - else - { - AddError(IDS_STENCIL_HANDLERNAME_TOO_LONG, pStart); - hcErr = AtlsHttpError(500, ISE_SUBERR_LONGHANDLERNAME); - } - } - } - else - { - // only a method name so just copy it. - if (strlen(szMethodString) < nMethodNameLen) - Checked::strcpy_s(pszMethodName, nMethodNameLen, szMethodString); - else - { - AddError(IDS_STENCIL_METHODNAME_TOO_LONG, pStart); - hcErr = AtlsHttpError(500, ISE_SUBERR_LONGMETHODNAME); - } - } - return hcErr; - } - - virtual HTTP_CODE Render( - ITagReplacer *pReplacer, - IWriteStream *pWriteStream, - CStencilState* pState = NULL) const throw(...) - { - ATLENSURE(pReplacer != NULL); - ATLENSURE(pWriteStream != NULL); - - HTTP_CODE hcErrorCode = HTTP_SUCCESS; - DWORD dwIndex = 0; - DWORD dwArraySize = GetTokenCount(); - - // set up locale info - CSaveThreadLocale lcidSave; - - if (pState) - { - dwIndex = pState->dwIndex; - - // restore the locale if we're restarting rendering - if (pState->locale != CP_ACP) - SetThreadLocale(pState->locale); - } - - pReplacer->SetStream(pWriteStream); - while (dwIndex < dwArraySize) - { - // RenderToken advances dwIndex appropriately for us. - dwIndex = RenderToken(dwIndex, pReplacer, pWriteStream, &hcErrorCode, pState); - - if (dwIndex == STENCIL_INVALIDINDEX || - hcErrorCode != HTTP_SUCCESS) - break; - } - - if (IsAsyncStatus(hcErrorCode)) - { - ATLASSERT( pState != NULL ); // state is required for async - if (pState) - pState->dwIndex = dwIndex; - } - // lcidSave destructor will restore the locale info in case it was changed - - return hcErrorCode; - } - - inline BOOL IsValidIndex(DWORD dwIndex) const throw() - { - if (dwIndex == STENCIL_INVALIDINDEX) - return FALSE; - if (dwIndex < GetTokenCount()) - return TRUE; - else - return FALSE; - } - - virtual DWORD RenderToken( - DWORD dwIndex, - ITagReplacer *pReplacer, - IWriteStream *pWriteStream, - HTTP_CODE *phcErrorCode, - CStencilState* pState = NULL) const throw(...) - { - ATLENSURE(pReplacer != NULL); - ATLENSURE(pWriteStream != NULL); - - const StencilToken* pToken = GetToken(dwIndex); - DWORD dwNextToken = 0; - HTTP_CODE hcErrorCode = HTTP_SUCCESS; - - if (!pToken) - return STENCIL_INVALIDINDEX; - - switch (pToken->type) - { - case STENCIL_TEXTTAG: - { - pWriteStream->WriteStream(pToken->pStart, - (int)((pToken->pEnd-pToken->pStart)+1), NULL); - dwNextToken = dwIndex+1; - } - break; - case STENCIL_ITERATORSTART: - { - HTTP_CODE hcErr = STENCIL_SUCCESS; - -#ifdef ATL_DEBUG_STENCILS - // A 'while' token has to at least be followed by an endwhile! - if (!IsValidIndex(dwIndex+1)) - { - // This should have been caught at parse time - dwNextToken = STENCIL_INVALIDINDEX; - hcErrorCode = AtlsHttpError(500, ISE_SUBERR_STENCIL_INVALIDINDEX); - ATLASSERT(FALSE); - break; - } - - // End of loop should be valid - if (!IsValidIndex(pToken->dwLoopIndex)) - { - // This should have been caught at parse time - dwNextToken = STENCIL_INVALIDINDEX; - hcErrorCode = AtlsHttpError(500, ISE_SUBERR_STENCIL_MISMATCHWHILE); - ATLASSERT(FALSE); - break; - } - - if (pToken->dwFnOffset == STENCIL_INVALIDOFFSET) - { - // This should have been caught at parse time - dwNextToken = STENCIL_INVALIDINDEX; - hcErrorCode = AtlsHttpError(500, ISE_SUBERR_STENCIL_INVALIDFUNCOFFSET); - ATLASSERT(FALSE); - break; - } -#endif // ATL_DEBUG_STENCILS - - DWORD dwLoopIndex = pToken->dwLoopIndex; // points to the end of the loop - - // Call the replacement method - // if it returns HTTP_SUCCESS, enter the loop - // if it returns HTTP_S_FALSE, terminate the loop - hcErr = pReplacer->RenderReplacement(pToken->dwFnOffset, - pToken->dwObjOffset, pToken->dwMap, (void *) pToken->dwData); - - if (hcErr == HTTP_SUCCESS) - { - dwNextToken = dwIndex+1; - hcErrorCode = HTTP_SUCCESS; - } - else if (hcErr == HTTP_S_FALSE) - { - dwNextToken = dwLoopIndex+1; - hcErrorCode = HTTP_SUCCESS; - } - else - { - dwNextToken = STENCIL_INVALIDINDEX; - hcErrorCode = hcErr; - break; - } - } - break; - case STENCIL_REPLACEMENT: - { -#ifdef ATL_DEBUG_STENCILS - if (pToken->dwFnOffset == STENCIL_INVALIDOFFSET) - { - // This should have been caught at parse time - ATLASSERT(FALSE); - dwNextToken = STENCIL_INVALIDINDEX; - hcErrorCode = AtlsHttpError(500, ISE_SUBERR_STENCIL_INVALIDFUNCOFFSET); - break; - } -#endif // ATL_DEBUG_STENCILS - - hcErrorCode = pReplacer->RenderReplacement(pToken->dwFnOffset, - pToken->dwObjOffset, pToken->dwMap, (void *)pToken->dwData); - - if (IsAsyncContinueStatus(hcErrorCode)) - dwNextToken = dwIndex; // call the tag again after we get back - else - { - dwNextToken = dwIndex + 1; - - // when returned from a handler, these indicate that the handler is done - // and that we should move on to the next handler when called back - if (hcErrorCode == HTTP_SUCCESS_ASYNC_DONE) - hcErrorCode = HTTP_SUCCESS_ASYNC; - else if (hcErrorCode == HTTP_SUCCESS_ASYNC_NOFLUSH_DONE) - hcErrorCode = HTTP_SUCCESS_ASYNC_NOFLUSH; - } - } - break; - case STENCIL_ITERATOREND: - { - dwNextToken = pToken->dwLoopIndex; - hcErrorCode = HTTP_SUCCESS; - ATLASSERT(GetToken(dwNextToken)->type == STENCIL_ITERATORSTART); - } - break; - case STENCIL_CONDITIONALSTART: - { -#ifdef ATL_DEBUG_STENCILS - if (pToken->type == STENCIL_CONDITIONALSTART && pToken->dwFnOffset == STENCIL_INVALIDOFFSET) - { - // This should have been caught at parse time - ATLASSERT(FALSE); - dwNextToken = STENCIL_INVALIDINDEX; - hcErrorCode = AtlsHttpError(500, ISE_SUBERR_STENCIL_INVALIDFUNCOFFSET); - break; - } - - if (pToken->dwLoopIndex == STENCIL_INVALIDINDEX) - { - // This should have been caught at parse time - ATLASSERT(FALSE); - dwNextToken = STENCIL_INVALIDINDEX; - hcErrorCode = AtlsHttpError(500, ISE_SUBERR_STENCIL_MISMATCHIF); - break; - } -#endif // ATL_DEBUG_STENCILS - - DWORD dwLoopIndex = pToken->dwLoopIndex; // points to the end of the loop - - HTTP_CODE hcErr; - // Call the replacement method. - // If it returns HTTP_SUCCESS, we render everything up to - // the end of the conditional. - // if it returns HTTP_S_FALSE, the condition is not met and we - // render the else part if it exists or jump past the endif otherwise - hcErr = pReplacer->RenderReplacement(pToken->dwFnOffset, - pToken->dwObjOffset, pToken->dwMap, (void *)pToken->dwData); - - if (hcErr == HTTP_SUCCESS) - { - dwNextToken = dwIndex+1; - hcErrorCode = HTTP_SUCCESS; - } - else if (hcErr == HTTP_S_FALSE) - { - dwNextToken = dwLoopIndex+1; - hcErrorCode = HTTP_SUCCESS; - } - else - { - dwNextToken = STENCIL_INVALIDINDEX; - hcErrorCode = hcErr; - break; - } - } - break; - case STENCIL_CONDITIONALELSE: - { -#ifdef ATL_DEBUG_STENCILS - if (pToken->dwLoopIndex == STENCIL_INVALIDINDEX) - { - // This should have been caught at parse time - ATLASSERT(FALSE); - dwNextToken = STENCIL_INVALIDINDEX; - hcErrorCode = AtlsHttpError(500, ISE_SUBERR_STENCIL_MISMATCHIF); - break; - } -#endif // ATL_DEBUG_STENCILS - - dwNextToken = pToken->dwLoopIndex+1; - hcErrorCode = HTTP_SUCCESS; - } - break; - case STENCIL_CONDITIONALEND: - { - dwNextToken = dwIndex+1; - hcErrorCode = HTTP_SUCCESS; - } - break; - case STENCIL_LOCALE: - { - if (pState) - { - pState->locale = (LCID) pToken->dwData; - } - SetThreadLocale((LCID) pToken->dwData); - dwNextToken = dwIndex + 1; - } - break; - default: - { - ATLASSERT(FALSE); - dwNextToken = STENCIL_INVALIDINDEX; - hcErrorCode = AtlsHttpError(500, ISE_SUBERR_STENCIL_UNEXPECTEDTYPE); - break; - } - } - - ATLASSERT(dwNextToken != dwIndex || IsAsyncContinueStatus(hcErrorCode)); - - if (phcErrorCode) - *phcErrorCode = hcErrorCode; - - return dwNextToken; - } - - DWORD GetTokenCount() const throw() - { - return (DWORD) m_arrTokens.GetCount(); - } - - const StencilToken* GetToken(DWORD dwIndex) const throw() - { - return &(m_arrTokens[dwIndex]); - } - - StencilToken* GetToken(DWORD dwIndex) throw() - { - return &(m_arrTokens[dwIndex]); - } - - LPCSTR GetBufferStart() const throw() - { - return m_pBufferStart; - } - - LPCSTR GetBufferEnd() const throw() - { - return m_pBufferEnd; - } - - WORD GetCodePage() const throw() - { - return m_nCodePage; - } - - // IMemoryCacheClient - STDMETHOD(QueryInterface)(REFIID riid, void **ppv) - { - if (!ppv) - return E_POINTER; - - if (InlineIsEqualGUID(riid, __uuidof(IUnknown)) || - InlineIsEqualGUID(riid, __uuidof(IMemoryCacheClient))) - { - *ppv = static_cast(this); - return S_OK; - } - - *ppv = NULL; - return E_NOINTERFACE; - } - - STDMETHOD_(ULONG, AddRef)() - { - return 1; - } - - STDMETHOD_(ULONG, Release)() - { - return 1; - } - - STDMETHOD(Free)(const void *pData) - { - if (!pData) - return E_POINTER; - - ATLASSERT(*((void **) pData) == static_cast(this)); - - delete this; - - return S_OK; - } -}; // class CStencil - -struct StencilIncludeInfo -{ -public: - CHAR m_szQueryString[ATL_URL_MAX_URL_LENGTH+1]; - CHAR m_szFileName[MAX_PATH]; -}; - - -class CIncludeServerContext : - public CComObjectRootEx, - public CWrappedServerContext -{ -public: - BEGIN_COM_MAP(CIncludeServerContext) - COM_INTERFACE_ENTRY(IHttpServerContext) - END_COM_MAP() - - IWriteStream * m_pStream; - const StencilIncludeInfo * m_pIncludeInfo; - - CIncludeServerContext() throw() - { - m_pStream = NULL; - m_pIncludeInfo = NULL; - } - - void Initialize( - IWriteStream *pStream, - IHttpServerContext* pServerContext, - const StencilIncludeInfo * pIncludeInfo) throw() - { - ATLASSERT(pStream != NULL); - ATLASSERT(pServerContext != NULL); - ATLASSERT(pIncludeInfo != NULL); - m_pStream = pStream; - m_spParent = pServerContext; - m_pIncludeInfo = pIncludeInfo; - } - - void Initialize(CIncludeServerContext *pOtherContext) - { - ATLENSURE(pOtherContext != NULL); - m_pStream = pOtherContext->m_pStream; - m_spParent = pOtherContext->m_spParent; - m_pIncludeInfo = pOtherContext->m_pIncludeInfo; - } - - LPCSTR GetRequestMethod() - { - return "GET"; - } - - LPCSTR GetQueryString() - { - ATLASSUME(m_pIncludeInfo != NULL); - return m_pIncludeInfo->m_szQueryString; - } - - LPCSTR GetPathTranslated() - { - ATLASSUME(m_pIncludeInfo != NULL); - return m_pIncludeInfo->m_szFileName; - } - - LPCSTR GetScriptPathTranslated() - { - ATLASSUME(m_pIncludeInfo != NULL); - return m_pIncludeInfo->m_szFileName; - } - - DWORD GetTotalBytes() - { - return 0; - } - - DWORD GetAvailableBytes() - { - return 0; - } - - BYTE *GetAvailableData() - { - return NULL; - } - - LPCSTR GetContentType() - { - return 0; - } - - BOOL WriteClient(void *pvBuffer, DWORD *pdwBytes) - { - ATLASSUME(m_pStream != NULL); - ATLENSURE(pvBuffer != NULL); - ATLENSURE(pdwBytes != NULL); - - HRESULT hr = S_OK; - _ATLTRY - { - hr = m_pStream->WriteStream((LPCSTR) pvBuffer, *pdwBytes, pdwBytes); - } - _ATLCATCHALL() - { - hr = E_FAIL; - } - - return SUCCEEDED(hr); - } - - BOOL ReadClient(void * /*pvBuffer*/, DWORD * /*pdwSize*/) - { - return FALSE; - } - - BOOL AsyncReadClient(void * /*pvBuffer*/, DWORD * /*pdwSize*/) - { - return FALSE; - } - - BOOL SendRedirectResponse(LPCSTR /*pszRedirectURL*/) - { - return FALSE; - } - - BOOL SendResponseHeader( - LPCSTR /*pszHeader*/, - LPCSTR /*pszStatusCode*/, - BOOL /*fKeepConn*/) - { - return TRUE; - } - - BOOL DoneWithSession(DWORD /*dwHttpStatusCode*/) - { - return TRUE; - } - - BOOL RequestIOCompletion(PFN_HSE_IO_COMPLETION /*pfn*/, DWORD * /*pdwContext*/) - { - return FALSE; - } -}; // class CIncludeServerContext - -class CIDServerContext : - public CComObjectRootEx, - public CWrappedServerContext -{ -public: - CHttpResponse *m_pResponse; - CHttpRequest *m_pRequest; - - BEGIN_COM_MAP(CIDServerContext) - COM_INTERFACE_ENTRY(IHttpServerContext) - END_COM_MAP() - - CIDServerContext() throw() - : m_pResponse(NULL), m_pRequest(NULL) - { - } - - BOOL Initialize( - CHttpResponse *pResponse, - CHttpRequest *pRequest) throw() - { - ATLASSERT(pResponse != NULL); - ATLASSERT(pRequest != NULL); - m_pResponse = pResponse; - m_pRequest = pRequest; - if(!m_pRequest) - { - return FALSE; - } - - HRESULT hr = m_pRequest->GetServerContext(&m_spParent); - return (SUCCEEDED(hr)); - } - - LPCSTR GetRequestMethod() - { - ATLASSUME(m_pRequest != NULL); - return m_pRequest->GetMethodString(); - } - - LPCSTR GetQueryString() - { - ATLASSUME(m_pRequest != NULL); - return m_pRequest->GetQueryString(); - } - - LPCSTR GetPathInfo() - { - ATLASSUME(m_pRequest != NULL); - return m_pRequest->GetPathInfo(); - } - - LPCSTR GetPathTranslated() - { - ATLASSUME(m_pRequest != NULL); - return m_pRequest->GetPathTranslated(); - } - - DWORD GetTotalBytes() - { - ATLASSUME(m_pRequest != NULL); - return m_pRequest->GetTotalBytes(); - } - - DWORD GetAvailableBytes() - { - ATLASSUME(m_pRequest != NULL); - return m_pRequest->GetAvailableBytes(); - } - - BYTE *GetAvailableData() - { - ATLASSUME(m_pRequest != NULL); - return m_pRequest->GetAvailableData(); - } - - LPCSTR GetContentType() - { - ATLASSUME(m_pRequest != NULL); - return m_pRequest->GetContentType(); - } - - LPCSTR GetScriptPathTranslated() - { - ATLASSUME(m_pRequest != NULL); - return m_pRequest->GetScriptPathTranslated(); - } - - BOOL WriteClient(void *pvBuffer, DWORD *pdwBytes) - { - ATLASSUME(m_pResponse != NULL); - return m_pResponse->WriteLen((LPCSTR)pvBuffer, *pdwBytes); - } - - BOOL ReadClient(void *pvBuffer, DWORD *pdwSize) - { - ATLASSUME(m_pRequest != NULL); - return m_pRequest->ReadData((LPSTR)pvBuffer, pdwSize); - } - - BOOL SendRedirectResponse(LPCSTR pszRedirectURL) - { - ATLASSUME(m_pResponse != NULL); - return m_pResponse->Redirect(pszRedirectURL); - } - - BOOL TransmitFile( - HANDLE hFile, - PFN_HSE_IO_COMPLETION pfn, - void *pContext, - LPCSTR szStatusCode, - DWORD dwBytesToWrite, - DWORD dwOffset, - void *pvHead, - DWORD dwHeadLen, - void *pvTail, - DWORD dwTailLen, - DWORD dwFlags) - { - ATLASSUME(m_pResponse != NULL); - ATLASSUME(m_spParent != NULL); - - m_pResponse->Flush(); - return m_spParent->TransmitFile(hFile, pfn, pContext, szStatusCode, - dwBytesToWrite, dwOffset, pvHead, dwHeadLen, pvTail, dwTailLen, dwFlags); - } - -}; // class CIDServerContext - -// -// CHtmlStencil -// CHtmlStencil is a specialization of CStencil. CHtmlStencil adds the following -// capabilities to CStencil: -// -// Support for rendering {{include }} tags -// The {{include }} tags specify another stencil to be included in-place during -// stencil rendering. The {{include }} tag takes a single parameter which is the -// URL of the stencil to include. That URL can optionally include parameters. -// An example: -// {{include mystencil.srf?param1=value1}} -// -// We also grab the handler name and the name of any subhandlers. The syntax for the -// handler specification is: -// {{handler MyDynamicHandler.dll/Default}} -// which would cause the MyDynamicHandler.dll to be loaded. Once loaded, the stencil -// processor will ask for the IReplacementHandler interface of the object named "Default". -// -// Additional handlers can be specified after the default handler. An example of an -// additional handler would be: -// {{subhandler OtherHandler MyOtherHandler.dll/Default}} -// would cause the MyOtherHandler.dll to be loaded. Once loaded, the stencil processor will -// ask for the IReplacementHandler interface of the object named "Default" and use it in -// processing the stencil anywhere it sees a stencil tag of the form -// {{OtherHandler.RenderReplacement}} - -struct CStringPair -{ - typedef CFixedStringT PathStrType; - typedef CFixedStringT HdlrNameStrType; - PathStrType strDllPath; - HdlrNameStrType strHandlerName; - - CStringPair()throw() - { - } - - CStringPair(PathStrType &strDllPath_, HdlrNameStrType &strHandlerName_) throw(...) - :strDllPath(strDllPath_), strHandlerName(strHandlerName_) - { - } - - CStringPair(CStringA &strDllPath_, CStringA &strHandlerName_) throw(...) - :strDllPath(strDllPath_), strHandlerName(strHandlerName_) - { - } -}; - -class CStringPairElementTraits : - public CElementTraitsBase< CStringPair > -{ -private: - - static ULONG HashStr( ULONG nHash, CStringElementTraits::INARGTYPE str ) - { - ATLENSURE( str != NULL ); - const CStringA::XCHAR* pch = str; - while( *pch != 0 ) - { - nHash = (nHash<<5)+nHash+(*pch); - pch++; - } - - return( nHash ); - } - -public: - static ULONG Hash( INARGTYPE pair ) throw() - { - ULONG nHash = HashStr(0, pair.strDllPath); - return HashStr(nHash, pair.strHandlerName); - } - - static bool CompareElements( INARGTYPE pair1, INARGTYPE pair2 ) throw() - { - return( (pair1.strDllPath == pair2.strDllPath) && (pair1.strHandlerName == pair2.strHandlerName) ); - } - - static int CompareElementsOrdered( INARGTYPE pair1, INARGTYPE pair2 ) throw() - { - return( pair1.strDllPath.Compare( pair2.strDllPath ) ); - } -}; - -class CHtmlStencil : public CStencil -{ -private: - - ATL_NOINLINE HTTP_CODE RenderInclude( - ITagReplacer *pReplacer, - const StencilToken *pToken, - IWriteStream *pWriteStream, - CStencilState *pState) const - { - ATLASSUME(m_spServiceProvider); - CComPtr spServerContext; - CComPtr spLookup; - if (FAILED(pReplacer->GetContext(__uuidof(IHttpServerContext), (VOID**) &spServerContext))) - { - return AtlsHttpError(500, 0); - } - if (FAILED(pReplacer->GetContext(__uuidof(IHttpRequestLookup), (VOID**) &spLookup))) - { - return AtlsHttpError(500, 0); - } - return RenderInclude(m_spServiceProvider, pWriteStream, - (StencilIncludeInfo *)pToken->dwData, spServerContext, spLookup, - pState); - } - - ATL_NOINLINE HTTP_CODE NoCachePage(ITagReplacer *pReplacer) const - { - CComPtr spContext; - HRESULT hr = pReplacer->GetContext(__uuidof(IHttpServerContext), (void **)&spContext); - if (hr == S_OK && spContext) - { - CComQIPtr spControl; - spControl = spContext; - if (spControl) - spControl->Cache(FALSE); - } - return HTTP_SUCCESS; - } - - - // CAllocIncludeAsyncContext is an unsupported implementation detail of RenderInclude - class CAllocIncludeAsyncContext : - public CAllocContextBase - { - public: - CAllocIncludeAsyncContext(CIncludeServerContext *pBase) : - m_pBase(pBase) - { - - } - HTTP_CODE Alloc(IHttpServerContext **ppNewContext) - { - ATLASSUME(m_pBase); - if (!ppNewContext) - return AtlsHttpError(500, ISE_SUBERR_UNEXPECTED); - *ppNewContext = NULL; - CComObjectNoLock* pNewServerContext = NULL; - ATLTRY(pNewServerContext = new CComObjectNoLock); - if (pNewServerContext == NULL) - return AtlsHttpError(500, ISE_SUBERR_OUTOFMEM); - pNewServerContext->Initialize(m_pBase); - pNewServerContext->AddRef(); - *ppNewContext = pNewServerContext; - return HTTP_SUCCESS; - } - - private: - CIncludeServerContext *m_pBase; - }; // CAllocIncludeAsyncContext - - - ATL_NOINLINE HTTP_CODE RenderInclude( - IServiceProvider *pServiceProvider, - IWriteStream *pWriteStream, - const StencilIncludeInfo *pIncludeInfo, - IHttpServerContext *pServerContext, - IHttpRequestLookup *pLookup, - CStencilState* pState = NULL) const throw(...) - { - CComObjectStackEx serverContext; - serverContext.Initialize(pWriteStream, pServerContext, pIncludeInfo); - CAllocIncludeAsyncContext AsyncAllocObj(&serverContext); - return _AtlRenderInclude(static_cast(&serverContext), - pIncludeInfo->m_szFileName, - pIncludeInfo->m_szQueryString, - GetCodePage(), - &AsyncAllocObj, - pServiceProvider, - pLookup, - pState); - - } - -protected: - CAtlMap, CStringPairElementTraits > m_arrExtraHandlers; - CHAR m_szBaseDir[MAX_PATH]; - CComPtr m_spServiceProvider; - CComPtr m_spExtension; - CComPtr m_spStencilCache; - CComPtr m_spDllCache; - -public: - typedef CAtlMap, CStringPairElementTraits > mapType; - typedef CStencil baseType; - - CHtmlStencil(IAtlMemMgr *pMemMgr=NULL) throw() : - CStencil(pMemMgr) - { - - } - - void Initialize(IServiceProvider *pProvider) throw(...) - { - ATLENSURE(pProvider); - if (m_spServiceProvider) - m_spServiceProvider.Release(); - - m_spServiceProvider = pProvider; - if (!m_spDllCache) - pProvider->QueryService(__uuidof(IDllCache), __uuidof(IDllCache), (void **) &m_spDllCache); - - if (!m_spExtension) - pProvider->QueryInterface(__uuidof(IIsapiExtension), (void **) &m_spExtension); - } - - BOOL GetIncludeInfo(LPCSTR szParamBegin, LPCSTR szParamEnd, StencilIncludeInfo *pInfo) const - { - ATLENSURE(szParamBegin != NULL); - ATLENSURE(szParamEnd != NULL); - ATLENSURE(pInfo != NULL); - - LPCSTR szQueryBegin = szParamBegin; - - while (*szQueryBegin && *szQueryBegin != '?' && *szQueryBegin != '}') - { - LPSTR szNext = CharNextExA(GetCodePage(), szQueryBegin, 0); - if (szNext == szQueryBegin) - { - return FALSE; - } - - szQueryBegin = szNext; - } - - CFixedStringT strPath; - - _ATLTRY - { - DWORD dwPrefixLen = 0; - if (*szParamBegin == '"') - { - szParamBegin++; - } - if (!IsFullPathA(szParamBegin)) - { - if (*szParamBegin != '\\') - { - strPath = m_szBaseDir; - } - else - { - LPCSTR szBackslash = strchr(m_szBaseDir, '\\'); - if (szBackslash) - { -#pragma warning(push) -#pragma warning(disable: 6204) - /* prefast noise VSW 492749 */ - strPath.SetString(m_szBaseDir, (int)(szBackslash-m_szBaseDir)); -#pragma warning(pop) - } - else - { - strPath = m_szBaseDir; - } - } - dwPrefixLen = strPath.GetLength(); - } - - if (*szQueryBegin=='?') - { - size_t nMinus = (*(szQueryBegin-1) == '"') ? 1 : 0; - strPath.Append(szParamBegin, (int)(szQueryBegin-szParamBegin-nMinus)); - if ((szParamEnd-szQueryBegin) > ATL_URL_MAX_PATH_LENGTH || ((szParamEnd - szQueryBegin) < 0)) - { - // query string is too long - return FALSE; - } - Checked::memcpy_s(pInfo->m_szQueryString, ATL_URL_MAX_URL_LENGTH+1, szQueryBegin + 1, szParamEnd - szQueryBegin); - pInfo->m_szQueryString[szParamEnd - szQueryBegin] = '\0'; - } - else - { - pInfo->m_szQueryString[0] = '\0'; - size_t nAdd = (*szParamEnd == '"') ? 0 : 1; - strPath.Append(szParamBegin, (int)(szParamEnd - szParamBegin + nAdd)); - } - } - _ATLCATCHALL() - { - // out of memory - return FALSE; - } - - if (strPath.GetLength() > MAX_PATH-1) - { - // path is too long - return FALSE; - } - - // strPath is <= MAX_PATH-1 - return PathCanonicalizeA(pInfo->m_szFileName, strPath); - } - - DWORD ParseInclude(LPCSTR szTokenStart, LPCSTR szTokenEnd) throw(...) - { - ATLENSURE(szTokenStart != NULL); - ATLENSURE(szTokenEnd != NULL); - - LPCSTR szStart = szTokenStart; - LPCSTR szEnd = szTokenEnd; - - FindTagArgs(szStart, szEnd, 7); - - CFixedStringT strFileNameRelative; - CFixedStringT strFileName; - - _ATLTRY - { - strFileNameRelative.SetString(szStart, (int)(szEnd-szStart + 1)); - - if (!IsFullPathA(strFileNameRelative)) - { - CFixedStringT strTemp; - if (*((LPCSTR)strFileNameRelative) != '\\') - { - strTemp = m_szBaseDir; - } - else - { - LPCSTR szBackslash = strchr(m_szBaseDir, '\\'); - if (szBackslash) - { -#pragma warning(push) -#pragma warning(disable: 6204) -#pragma warning(disable: 6535) - /* prefast noise VSW 492749 */ - /* prefast noise VSW 493256 */ - strTemp.SetString(m_szBaseDir, (int)(szBackslash-m_szBaseDir)); -#pragma warning(pop) - } - else - { - strTemp = m_szBaseDir; - } - } - - strTemp.Append(strFileNameRelative, strFileNameRelative.GetLength()); - CFixedStringT strConv = (LPCTSTR) CA2CT(strTemp); - LPTSTR szFileBuf = strFileName.GetBuffer(strConv.GetLength()+1); - if (szFileBuf == NULL) - { - AddError(IDS_STENCIL_OUTOFMEMORY, szTokenStart); - return AddToken(szTokenStart, szTokenEnd, STENCIL_TEXTTAG); - } - - if (!PathCanonicalize(szFileBuf, strConv)) - { - return STENCIL_INVALIDINDEX; - } - - strFileName.ReleaseBuffer(); - } - else - { - strFileName = CA2CTEX(strFileNameRelative); - } - } - _ATLCATCHALL() - { - AddError(IDS_STENCIL_OUTOFMEMORY, szTokenStart); - return AddToken(szTokenStart, szTokenEnd, STENCIL_TEXTTAG); - } - - LPCTSTR szFileName = strFileName; - - LPCTSTR szDot = NULL; - LPCTSTR szExtra = _tcschr(szFileName, '?'); - if (!szExtra) - { - szExtra = _tcschr(szFileName, '#'); - if (!szExtra) - { - szDot = _tcsrchr(szFileName, '.'); - } - } - - if (szExtra != NULL) - { - // there is some extra information - LPCTSTR szDotTmp = szFileName; - do - { - szDot = szDotTmp; - szDotTmp = _tcschr(szDotTmp+1, '.'); - } while (szDotTmp && szDotTmp < szExtra); - } - - if (!szDot || *szDot != '.') - { - AddError(IDS_STENCIL_UNEXPECTED, szTokenStart); - return AddToken(szTokenStart, szTokenEnd, STENCIL_TEXTTAG); - } - - LPCTSTR szExtEnd = szDot; - - while (true) - { - szExtEnd++; - if (!*szExtEnd || *szExtEnd == '/' || *szExtEnd == '\\' || *szExtEnd == '?' || *szExtEnd == '#' || *szExtEnd == '"') - break; - } - - if (szDot && (size_t)(szExtEnd-szDot) == _tcslen(c_tAtlDLLExtension) && - !_tcsnicmp(szDot, c_tAtlDLLExtension, _tcslen(c_tAtlDLLExtension))) - { - // Do .dll stuff - DWORD dwIndex = AddToken(szStart, szEnd, STENCIL_STENCILINCLUDE); - if (dwIndex == STENCIL_INVALIDINDEX) - { - AddError(IDS_STENCIL_OUTOFMEMORY, szTokenStart); - return AddToken(szTokenStart, szTokenEnd, STENCIL_TEXTTAG); - } - StencilIncludeInfo *pInfo = (StencilIncludeInfo *)m_pMemMgr->Allocate(sizeof(StencilIncludeInfo)); - if (!pInfo) - { - return STENCIL_INVALIDINDEX; - } - - if (!GetIncludeInfo(szStart, szEnd, pInfo)) - { - return STENCIL_INVALIDINDEX; - } - - GetToken(dwIndex)->dwData = (DWORD_PTR) pInfo; - return dwIndex; - } - else if (szDot && (size_t)(szExtEnd-szDot) == _tcslen(c_tAtlSRFExtension) && - !_tcsnicmp(szDot, c_tAtlSRFExtension, _tcslen(c_tAtlSRFExtension))) - { - // Do .srf stuff - DWORD dwIndex = AddToken(szStart, szEnd, STENCIL_STENCILINCLUDE); - if (dwIndex == STENCIL_INVALIDINDEX) - { - AddError(IDS_STENCIL_OUTOFMEMORY, szTokenStart); - return AddToken(szTokenStart, szTokenEnd, STENCIL_TEXTTAG); - } - StencilIncludeInfo *pInfo = (StencilIncludeInfo *)m_pMemMgr->Allocate(sizeof(StencilIncludeInfo)); - if (!pInfo) - { - return STENCIL_INVALIDINDEX; - } - - if (!GetIncludeInfo(szStart, szEnd, pInfo)) - { - return STENCIL_INVALIDINDEX; - } - - GetToken(dwIndex)->dwData = (DWORD_PTR) pInfo; - return dwIndex; - } - else - { - // Assume static content - CAtlFile file; - - HRESULT hr = file.Create(szFileName, GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING); - if (FAILED(hr) || GetFileType(file) != FILE_TYPE_DISK) - { - if (FAILED(hr)) - { - AddError(IDS_STENCIL_INCLUDE_ERROR, szTokenStart); - } - else - { - AddError(IDS_STENCIL_INCLUDE_INVALID, szTokenStart); - } - return AddToken(szTokenStart, szTokenEnd, STENCIL_TEXTTAG); - } - - CAutoVectorPtr szBufferStart; - LPSTR szBufferEnd = NULL; - ULONGLONG dwLen = 0; - if (FAILED(file.GetSize(dwLen))) - { - return AddToken(szTokenStart, szTokenEnd, STENCIL_TEXTTAG); - } - - if (!szBufferStart.Allocate((size_t) dwLen)) - { - AddError(IDS_STENCIL_OUTOFMEMORY, szTokenStart); - return AddToken(szTokenStart, szTokenEnd, STENCIL_TEXTTAG); - } - - DWORD dwRead; - if (FAILED(file.Read(szBufferStart, (DWORD) dwLen, dwRead))) - { - return AddToken(szTokenStart, szTokenEnd, STENCIL_TEXTTAG); - } - - szBufferEnd = szBufferStart + dwRead-1; - - DWORD dwIndex = AddToken(szBufferStart, szBufferEnd, STENCIL_STATICINCLUDE); - if (dwIndex != STENCIL_INVALIDINDEX) - { - GetToken(dwIndex)->bDynamicAlloc = TRUE; - szBufferStart.Detach(); - } - - return dwIndex; - } - } - - PARSE_TOKEN_RESULT ParseSubhandler(LPCSTR szTokenStart, LPCSTR szTokenEnd) throw() - { - ATLASSERT(szTokenStart != NULL); - ATLASSERT(szTokenEnd != NULL); - - LPCSTR szStart = szTokenStart; - LPCSTR szEnd = szTokenEnd; - - // move to the start of the arguments - // (the first char past 'subhandler' - FindTagArgs(szStart, szEnd, 10); - - // skip any space to bring us to the start - // of the id for the subhandler. - szStart = SkipSpace(szStart, GetCodePage()); - - // id names cannot contain spaces. Mark the - // beginning and end if the subhandler id - LPCSTR szIdStart = szStart; - while (!isspace(static_cast(*szStart)) && *szStart != '}') - { - if (!isalnum(static_cast(*szStart))) - { - // id names can only contain alphanumeric characters - return INVALID_TOKEN; - } - - LPSTR szNext = CharNextExA(GetCodePage(), szStart, 0); - if (szNext == szStart) - { - // embedded null - AddError(IDS_STENCIL_EMBEDDED_NULL, NULL); - return INVALID_TOKEN; - } - szStart = szNext; - } - LPCSTR szIdEnd = szStart; - - // skip space to bring us to the beginning of the - // the dllpath/handlername - szStart = SkipSpace(szStart, GetCodePage()); - - // everything up to the end if the tag is - // part of the dllpath/handlername - LPCSTR szHandlerStart = szStart; - while (*szStart != '}') - { - LPCSTR szNext = CharNextExA(GetCodePage(), szStart, 0); - if (szNext == szStart) - { - // embedded null - AddError(IDS_STENCIL_EMBEDDED_NULL, NULL); - return INVALID_TOKEN; - } - szStart = szNext; - } - LPCSTR szHandlerEnd = szStart; - - _ATLTRY - { - CStringPair::HdlrNameStrType strName(szIdStart, (int)(szIdEnd-szIdStart)); - CStringPair::PathStrType strPath(szHandlerStart, (int)(szHandlerEnd-szHandlerStart)); - - CStringPair::PathStrType strDllPath; - CStringPair::HdlrNameStrType strHandlerName; - DWORD dwDllPathLen = MAX_PATH; - DWORD dwHandlerNameLen = ATL_MAX_HANDLER_NAME_LEN+1; - - LPSTR szDllPath = strDllPath.GetBuffer(dwDllPathLen); - LPSTR szHandlerName = strHandlerName.GetBuffer(dwHandlerNameLen); - - if (!_AtlCrackHandler(strPath, szDllPath, &dwDllPathLen, szHandlerName, &dwHandlerNameLen)) - { - strDllPath.ReleaseBuffer(); - strHandlerName.ReleaseBuffer(); - AddError(IDS_STENCIL_INVALID_SUBHANDLER, szTokenStart); - return INVALID_TOKEN; - } - - strDllPath.ReleaseBuffer(dwDllPathLen); - strHandlerName.ReleaseBuffer(dwHandlerNameLen); - - m_arrExtraHandlers.SetAt(strName, CStringPair(strDllPath, strHandlerName)); - } - _ATLCATCHALL() - { - AddError(IDS_STENCIL_OUTOFMEMORY, NULL); - return INVALID_TOKEN; - } - return RESERVED_TOKEN; - } - - virtual PARSE_TOKEN_RESULT ParseToken(LPCSTR szTokenStart, LPCSTR szTokenEnd, DWORD *pBlockStack, DWORD *pdwTop) - { - ATLASSERT(szTokenStart != NULL); - ATLASSERT(szTokenEnd != NULL); - - LPCSTR pStart = szTokenStart; - pStart += 2; //skip curlies - pStart = SkipSpace(pStart, GetCodePage()); - DWORD dwLen = (DWORD)(szTokenEnd - szTokenStart); - - DWORD dwIndex = STENCIL_INVALIDINDEX; - - if (CheckTag("include", sizeof("include")-1, pStart, dwLen)) - { - dwIndex = ParseInclude(szTokenStart, szTokenEnd); - } - else if (dwLen > 3 && !memcmp("!--", pStart, 3)) - { - return RESERVED_TOKEN; - } - else if (dwLen > 2 && !memcmp("//", pStart, 2)) - { - return RESERVED_TOKEN; - } - else if (CheckTag("subhandler", sizeof("subhandler")-1, pStart, dwLen)) - { - return ParseSubhandler(szTokenStart, szTokenEnd); - } - else - { - return CStencil::ParseToken(szTokenStart, szTokenEnd, pBlockStack, pdwTop); - } - if (dwIndex == STENCIL_INVALIDINDEX) - { - return INVALID_TOKEN; - } - return RESERVED_TOKEN; - } - - mapType* GetExtraHandlers() throw() - { - return &m_arrExtraHandlers; - } - - BOOL SetBaseDirFromFile(LPCSTR szBaseDir) - { - if (!SafeStringCopy(m_szBaseDir, szBaseDir)) - { - return FALSE; - } - - LPSTR szSlash = strrchr(m_szBaseDir, '\\'); - if (szSlash) - { - szSlash++; - *szSlash = '\0'; - } - else - { - *m_szBaseDir = '\0'; - } - - return TRUE; - } - - LPCSTR GetBaseDir() - { - return m_szBaseDir; - } - - DWORD RenderToken( - DWORD dwIndex, - ITagReplacer* pReplacer, - IWriteStream *pWriteStream, - HTTP_CODE *phcErrorCode, - CStencilState* pState = NULL) const throw(...) - { - DWORD dwNextToken = STENCIL_INVALIDINDEX; - HTTP_CODE hcErrorCode = HTTP_SUCCESS; - const StencilToken* pToken = GetToken(dwIndex); - if (pToken) - { - if (pToken->type == STENCIL_STENCILINCLUDE) - { - hcErrorCode = RenderInclude(pReplacer, pToken, pWriteStream, pState); - if (hcErrorCode == HTTP_SUCCESS || IsAsyncDoneStatus(hcErrorCode)) - { - dwNextToken = dwIndex+1; - } - else if (IsAsyncContinueStatus(hcErrorCode)) - { - dwNextToken = dwIndex; - } - } - else if (pToken->type == STENCIL_STATICINCLUDE) - { - pWriteStream->WriteStream(pToken->pStart, - (int)((pToken->pEnd-pToken->pStart)+1), NULL); - dwNextToken = dwIndex+1; - } - else - { - dwNextToken = baseType::RenderToken(dwIndex, pReplacer, - pWriteStream, &hcErrorCode, pState); - } - } - - if (hcErrorCode == HTTP_SUCCESS_NO_CACHE) - { - hcErrorCode = NoCachePage(pReplacer); - } - - if (phcErrorCode) - { - *phcErrorCode = hcErrorCode; - } - return dwNextToken; - } -}; // class CHtmlStencil - - -__declspec(selectany) CCRTHeap CStencil::m_crtHeap; - -// -// CHtmlTagReplacer -// This class manages CStencil based objects for HTTP requests. This class will retrieve -// CStencil based objects from the stencil cache, store CStencil based objects in the -// stencil cache and allocate and initialize CStencil based objects on a per reqeust -// basis. Typically, one instance of this class is created for each HTTP request. The -// instance is destroyed once the request has been completed. -template -class CHtmlTagReplacer : - public ITagReplacerImpl -{ -protected: - typedef StencilType StencilType; - - CSimpleArray m_hInstHandlers; - typedef CAtlMap > mapType; - mapType m_Handlers; - StencilType *m_pLoadedStencil; - WORD m_nCodePage; - CComPtr m_spStencilCache; - - AtlServerRequest m_RequestInfo; - -public: - // public members - - CHtmlTagReplacer() throw() : - m_pLoadedStencil(NULL) - { - memset(&m_RequestInfo, 0x00, sizeof(m_RequestInfo)); - m_nCodePage = CP_THREAD_ACP; - } - - ~CHtmlTagReplacer() throw() - { - // you should call FreeHandlers before - // the object is destructed - ATLASSUME(m_hInstHandlers.GetSize() == 0); - } - - HTTP_CODE Initialize(AtlServerRequest *pRequestInfo, IHttpServerContext *pSafeSrvCtx=NULL) throw(...) - { - ATLASSERT(pRequestInfo != NULL); - - CComPtr spServiceProvider; - THandler *pT = static_cast(this); - HRESULT hr = pT->GetContext(__uuidof(IServiceProvider), (void **)&spServiceProvider); - if (FAILED(hr)) - return HTTP_FAIL; - - spServiceProvider->QueryService(__uuidof(IStencilCache), __uuidof(IStencilCache), (void **) &m_spStencilCache); - if (!m_spStencilCache) - { - ATLASSERT(FALSE); - return HTTP_FAIL; - } - - // copy the AtlServerRequest into the safe version - Checked::memcpy_s(&m_RequestInfo, sizeof(m_RequestInfo), pRequestInfo, sizeof(m_RequestInfo)); - - // override appropriate fields - m_RequestInfo.cbSize = sizeof(m_RequestInfo); - m_RequestInfo.pServerContext = pSafeSrvCtx; - - return HTTP_SUCCESS; - } - - HTTP_CODE LoadStencilResource( - HINSTANCE hInstResource, - LPCSTR szResourceID, - LPCSTR szResourceType = NULL, LPCSTR szStencilName=NULL) throw(...) - { - if (!szResourceType) - szResourceType = (LPCSTR) (RT_HTML); - // look up stencil in cache - HTTP_CODE hcErr = HTTP_SUCCESS; - - // check the cache first - StencilType *pStencil = FindCacheStencil(szStencilName ? szStencilName : szResourceID); - if (!pStencil) - { - // create a new stencil - pStencil = GetNewCacheStencil(); - if (!pStencil) - { - return AtlsHttpError(500,ISE_SUBERR_OUTOFMEM); - } - - THandler *pT = static_cast(this); - LPCSTR szFileName = pT->m_spServerContext->GetScriptPathTranslated(); - - if (!szFileName) - return HTTP_FAIL; - - if (!pStencil->SetBaseDirFromFile(szFileName)) - { - return HTTP_FAIL; - } - - pStencil->SetErrorResource(GetResourceInstance()); - - // load the stencil and parse its replacements - if (HTTP_SUCCESS == pStencil->LoadFromResource(hInstResource, - szResourceID, szResourceType)) - { - _ATLTRY - { - if (!pStencil->ParseReplacements(this)) - { - return AtlsHttpError(500, ISE_SUBERR_BADSRF); - } - - hcErr = FinishLoadStencil(pStencil, NULL); - if (!hcErr) - { -#ifdef ATL_DEBUG_STENCILS - pStencil->FinishParseReplacements(); -#else - if (!pStencil->FinishParseReplacements()) - { - return AtlsHttpError(500, ISE_SUBERR_BADSRF); - } -#endif // ATL_DEBUG_STENCILS - } - } - _ATLCATCHALL() - { - return HTTP_FAIL; - } - } - else - { - hcErr = HTTP_FAIL; - } - - // if everything went OK, put the stencil in the stencil cache. - if (!hcErr) - { - hcErr = CacheStencil(szStencilName ? szStencilName : szResourceID, pStencil); - } - - if (pStencil && hcErr) // something went wrong, free the stencil data - { - FreeCacheStencil(pStencil); - } - } - else - { - hcErr = FinishLoadStencil(pStencil); - } - - return hcErr; - } - - HTTP_CODE LoadStencilResource(HINSTANCE hInstResource, UINT nID, LPCSTR szResourceType = NULL) throw(...) - { - if (!szResourceType) - szResourceType = (LPCSTR) RT_HTML; - char szName[80]; - int nResult = sprintf_s(szName, sizeof(szName), "%p/%u", hInstResource, nID); - if ((nResult < 0) || (nResult == sizeof(szName))) - { - return HTTP_FAIL; - } - return LoadStencilResource(hInstResource, MAKEINTRESOURCEA(nID), szResourceType, szName); - } - - HTTP_CODE LoadStencil(LPCSTR szFileName, IHttpRequestLookup * pLookup = NULL) throw(...) - { - if (!szFileName) - { - return HTTP_FAIL; - } - - HTTP_CODE hcErr = HTTP_FAIL; - // try to find the stencil in the cache - StencilType *pStencil = FindCacheStencil(szFileName); - - if (!pStencil) - { - // not in cache. Create a new one - pStencil = GetNewCacheStencil(); - if (!pStencil) - { - return AtlsHttpError(500, ISE_SUBERR_OUTOFMEM); // out of memory! - } - - if (!pStencil->SetBaseDirFromFile(szFileName)) - { - return HTTP_FAIL; - } - - pStencil->SetErrorResource(GetResourceInstance()); - - // finish loading - hcErr = pStencil->LoadFromFile(szFileName); - if (!hcErr) - { - _ATLTRY - { - if (!pStencil->ParseReplacements(static_cast(this))) - { - return AtlsHttpError(500, ISE_SUBERR_BADSRF); - } - - hcErr = FinishLoadStencil(pStencil, pLookup); - if (!hcErr) - { -#ifdef ATL_DEBUG_STENCILS - pStencil->FinishParseReplacements(); -#else - if (!pStencil->FinishParseReplacements()) - { - return AtlsHttpError(500, ISE_SUBERR_BADSRF); - } -#endif // ATL_DEBUG_STENCILS - } - } - _ATLCATCHALL() - { - return HTTP_FAIL; - } - } - - // if everything is OK, cache the stencil - if (!hcErr) - { - hcErr = CacheStencil(szFileName, pStencil); - } - - if (pStencil && hcErr) // something went wrong, free stencil data - FreeCacheStencil(pStencil); - } - else - { - hcErr = FinishLoadStencil(pStencil, pLookup); - } - return hcErr; - } - - HTTP_CODE RenderStencil(IWriteStream* pStream, CStencilState* pState = NULL) throw(...) - { - if (!m_pLoadedStencil) - return AtlsHttpError(500, ISE_SUBERR_UNEXPECTED); - - WORD nCodePage = m_pLoadedStencil->GetCodePage(); - if (nCodePage != CP_ACP) - m_nCodePage = nCodePage; - - HTTP_CODE hcErr = HTTP_FAIL; - - hcErr = m_pLoadedStencil->Render(static_cast(this), - pStream, pState); - - if (!IsAsyncStatus(hcErr) && m_pLoadedStencil->GetCacheItem()) - m_spStencilCache->ReleaseStencil(m_pLoadedStencil->GetCacheItem()); - - return hcErr; - } - - -//Implementation - - void FreeHandlers() throw(...) - { - POSITION pos = m_Handlers.GetStartPosition(); - while (pos) - { - m_Handlers.GetValueAt(pos)->UninitializeHandler(); - m_Handlers.GetNextValue(pos)->Release(); - } - m_Handlers.RemoveAll(); - - int nLen = m_hInstHandlers.GetSize(); - if (nLen != 0) - { - THandler *pT = static_cast(this); - CComPtr spDllCache; - pT->m_spServiceProvider->QueryService(__uuidof(IDllCache), __uuidof(IDllCache), - (void **)&spDllCache); - for (int i=0; iFree(m_hInstHandlers[i]); - } - m_hInstHandlers.RemoveAll(); - } - } - - StencilType* GetNewCacheStencil() throw(...) - { - StencilType *pStencil = NULL; - THandler *pT = static_cast(this); - IAtlMemMgr *pMemMgr; - if (FAILED(pT->m_spServiceProvider->QueryService(__uuidof(IAtlMemMgr), __uuidof(IAtlMemMgr), (void **)&pMemMgr))) - pMemMgr = NULL; - - ATLTRY(pStencil = new StencilType(pMemMgr)); - if (pStencil != NULL) - { - pStencil->Initialize(pT->m_spServiceProvider); - } - return pStencil; - } - - HTTP_CODE CacheStencil( - LPCSTR szName, - StencilType* pStencilData) throw() - { - THandler *pT = static_cast(this); - HRESULT hr = E_FAIL; - - HCACHEITEM hCacheItem = NULL; - - hr = m_spStencilCache->CacheStencil(szName, - pStencilData, - sizeof(StencilType*), - &hCacheItem, - pT->m_hInstHandler, - static_cast(pStencilData)); - - if (hr == S_OK && hCacheItem) - { - _ATLTRY - { - pStencilData->SetCacheItem(hCacheItem); - } - _ATLCATCHALL() - { - hr = E_FAIL; - } - } - - return (hr == S_OK) ? HTTP_SUCCESS : HTTP_FAIL; - } - - StencilType *FindCacheStencil(LPCSTR szName) throw() - { - if (!szName || !m_spStencilCache) - return NULL; - - StencilType *pStencilData = NULL; - - HCACHEITEM hStencil; - - if (m_spStencilCache->LookupStencil(szName, &hStencil) != S_OK) - return NULL; - - m_spStencilCache->GetStencil(hStencil, reinterpret_cast(&pStencilData)); - - return pStencilData; - } - - void FreeCacheStencil(StencilType* pStencilData) - { - ATLASSERT( pStencilData != NULL ); - - if(!pStencilData) - { - return; - } - - IMemoryCacheClient *pMemCacheClient = static_cast(pStencilData); - - if(!pMemCacheClient) - { - return; - } - - _ATLTRY - { - pMemCacheClient->Free(pStencilData); - } - _ATLCATCHALL() - { - } - } - - HTTP_CODE GetHandlerOffset(LPCSTR szHandlerName, DWORD* pdwOffset) - { - if (!pdwOffset) - return HTTP_FAIL; - - mapType::CPair *p = m_Handlers.Lookup(szHandlerName); - if (p) - { - DWORD dwIndex = 0; - POSITION pos = m_Handlers.GetStartPosition(); - while (pos) - { - const mapType::CPair *p1 = m_Handlers.GetNext(pos); - if (p1 == p) - { - *pdwOffset = dwIndex; - return HTTP_SUCCESS; - } - dwIndex++; - } - ATLASSERT(FALSE); - } - *pdwOffset = 0; - return HTTP_FAIL; - } - - HTTP_CODE GetReplacementObject(DWORD dwObjOffset, ITagReplacer **ppReplacer) - { - HRESULT hr = E_FAIL; - - POSITION pos = m_Handlers.GetStartPosition(); - for (DWORD dwIndex=0; dwIndex < dwObjOffset; dwIndex++) - m_Handlers.GetNext(pos); - - ATLASSERT(pos != NULL); - - IRequestHandler *pHandler = NULL; - pHandler = m_Handlers.GetValueAt(pos); - - ATLENSURE(pHandler != NULL); - - hr = pHandler->QueryInterface(__uuidof(ITagReplacer), (void**)ppReplacer); - - if (hr != S_OK) - return HTTP_FAIL; - - return HTTP_SUCCESS; - } - - // This is where we would actually load any extra request - // handlers the HTML stencil might have parsed for us. - HTTP_CODE FinishLoadStencil(StencilType *pStencil, IHttpRequestLookup * pLookup = NULL) throw(...) - { - THandler *pT = static_cast(this); - ATLASSERT(pStencil); - if (!pStencil) - return AtlsHttpError(500, ISE_SUBERR_UNEXPECTED); // unexpected condition - m_pLoadedStencil = pStencil; - //load extra handlers if there are any - StencilType::mapType *pExtraHandlersMap = - pStencil->GetExtraHandlers(); - - if (pExtraHandlersMap) - { - POSITION pos = pExtraHandlersMap->GetStartPosition(); - CStringA name; - CStringPair path; - IRequestHandler *pHandler; - HINSTANCE hInstHandler; - while(pos) - { - pExtraHandlersMap->GetNextAssoc(pos, name, path); - pHandler = NULL; - hInstHandler = NULL; - HTTP_CODE hcErr = pT->m_spExtension->LoadRequestHandler(path.strDllPath, path.strHandlerName, - pT->m_spServerContext, - &hInstHandler, - &pHandler); - if (!hcErr) - { - _ATLTRY - { - //map the name to the pointer to request handler - m_Handlers.SetAt(name, pHandler); - //store HINSTANCE of handler - m_hInstHandlers.Add(hInstHandler); - } - _ATLCATCHALL() - { - return HTTP_FAIL; - } - - if (pLookup) - { - hcErr = pHandler->InitializeChild(&m_RequestInfo, pT->m_spServiceProvider, pLookup); - if (hcErr != HTTP_SUCCESS) - return hcErr; - } - - } - else - return hcErr; - } - } - return HTTP_SUCCESS; - } -}; // class CHtmlTagReplacer - - -// CRequestHandlerT -// This is the base class for all user request handlers. This class implements -// the IReplacementHandler interface whose methods will be called to render HTML -// into a stream. The stream will be returned as the HTTP response upon completion -// of the HTTP request. -template < class THandler, - class ThreadModel=CComSingleThreadModel, - class TagReplacerType=CHtmlTagReplacer - > -class CRequestHandlerT : - public TagReplacerType, - public CComObjectRootEx, - public IRequestHandlerImpl -{ -protected: - CStencilState m_state; - CComObjectStackEx m_SafeSrvCtx; - typedef CRequestHandlerT _requestHandler; - -public: - BEGIN_COM_MAP(_requestHandler) - COM_INTERFACE_ENTRY(IRequestHandler) - COM_INTERFACE_ENTRY(ITagReplacer) - END_COM_MAP() - - // public CRequestHandlerT members - CHttpResponse m_HttpResponse; - CHttpRequest m_HttpRequest; - ATLSRV_REQUESTTYPE m_dwRequestType; - AtlServerRequest* m_pRequestInfo; - - CRequestHandlerT() throw() - { - m_hInstHandler = NULL; - m_dwAsyncFlags = 0; - m_pRequestInfo = NULL; - } - - ~CRequestHandlerT() throw() - { - _ATLTRY - { - FreeHandlers(); // free handlers held by CTagReplacer - } - _ATLCATCHALL() - { - } - } - - void ClearResponse() throw() - { - m_HttpResponse.ClearResponse(); - } - // Where user initialization should take place - HTTP_CODE ValidateAndExchange() - { - return HTTP_SUCCESS; // continue processing request - } - - // Where user Uninitialization should take place - HTTP_CODE Uninitialize(HTTP_CODE hcError) - { - return hcError; - } - - HTTP_CODE InitializeInternal(AtlServerRequest *pRequestInfo, IServiceProvider *pProvider) - { - // Initialize our internal references to required services - m_pRequestInfo = pRequestInfo; - m_state.pParentInfo = pRequestInfo; - m_hInstHandler = pRequestInfo->hInstDll; - m_spServerContext = pRequestInfo->pServerContext; - m_spServiceProvider = pProvider; - return HTTP_SUCCESS; - } - - HTTP_CODE InitializeHandler( - AtlServerRequest *pRequestInfo, - IServiceProvider *pProvider) - { - HTTP_CODE hcErr = HTTP_FAIL; - ATLASSERT(pRequestInfo); - ATLASSERT(pProvider); - - THandler* pT = static_cast(this); - hcErr = pT->InitializeInternal(pRequestInfo, pProvider); - if (!hcErr) - { - m_HttpResponse.Initialize(m_spServerContext); - hcErr = pT->CheckValidRequest(); - if (!hcErr) - { - hcErr = HTTP_FAIL; - if (m_HttpRequest.Initialize(m_spServerContext, - pT->MaxFormSize(), - pT->FormFlags())) - { - if (m_SafeSrvCtx.Initialize(&m_HttpResponse, &m_HttpRequest)) - { - hcErr = TagReplacerType::Initialize(pRequestInfo, &m_SafeSrvCtx); - if (!hcErr) - { - hcErr = pT->ValidateAndExchange(); - } - } - } - } - } - return hcErr; - } - - HTTP_CODE InitializeChild( - AtlServerRequest *pRequestInfo, - IServiceProvider *pProvider, - IHttpRequestLookup *pRequestLookup) - { - ATLASSERT(pRequestInfo); - ATLASSERT(pProvider); - - THandler *pT = static_cast(this); - HTTP_CODE hcErr = pT->InitializeInternal(pRequestInfo, pProvider); - if (hcErr) - return hcErr; - - if (pRequestLookup) - { - // initialize with the pRequestLookup - if(!m_HttpResponse.Initialize(pRequestLookup)) - { - return HTTP_FAIL; - } - - // Initialize with the IHttpServerContext if it exists - // the only time this is different than the previous call to - // initialize is if the user passes a different IHttpServerContext - // in pRequestInfo than the one extracted from pRequestLookup. - if (m_spServerContext) - { - if(!m_HttpResponse.Initialize(m_spServerContext)) - { - return HTTP_FAIL; - } - } - hcErr = pT->CheckValidRequest(); - if (hcErr) - { - return hcErr; - } - - // initialize with the pRequestLookup to chain query parameters - m_HttpRequest.Initialize(pRequestLookup); - - // initialize with the m_spServerContext to get additional query params - // if they exist. - if (m_spServerContext) - { - m_HttpRequest.Initialize(m_spServerContext); - } - } - - m_HttpResponse.SetBufferOutput(false); // child cannot buffer - - // initialize the safe server context - if (!m_SafeSrvCtx.Initialize(&m_HttpResponse, &m_HttpRequest)) - { - return HTTP_FAIL; - } - - hcErr = TagReplacerType::Initialize(pRequestInfo, &m_SafeSrvCtx); - if (hcErr) - { - return hcErr; - } - - return pT->ValidateAndExchange(); - } - - // HandleRequest is called to perform default processing of HTTP requests. Users - // can override this function in their derived classes if they need to perform - // specific initialization prior to processing this request or want to change the - // way the request is processed. - HTTP_CODE HandleRequest( - AtlServerRequest *pRequestInfo, - IServiceProvider* /*pServiceProvider*/) - { - ATLENSURE(pRequestInfo); - - THandler *pT = static_cast(this); - HTTP_CODE hcErr = HTTP_SUCCESS; - - if (pRequestInfo->dwRequestState == ATLSRV_STATE_BEGIN) - { - m_dwRequestType = pRequestInfo->dwRequestType; - - if (pRequestInfo->dwRequestType==ATLSRV_REQUEST_STENCIL) - { - LPCSTR szFileName = pRequestInfo->pServerContext->GetScriptPathTranslated(); - hcErr = HTTP_FAIL; - if (szFileName) - hcErr = pT->LoadStencil(szFileName, static_cast(&m_HttpRequest)); - } - } - else if (pRequestInfo->dwRequestState == ATLSRV_STATE_CONTINUE) - m_HttpResponse.ClearContent(); - -#ifdef ATL_DEBUG_STENCILS - if (m_pLoadedStencil && !m_pLoadedStencil->ParseSuccessful()) - { - // An error or series of errors occurred in parsing the stencil - _ATLTRY - { - m_pLoadedStencil->RenderErrors(static_cast(&m_HttpResponse)); - } - _ATLCATCHALL() - { - return HTTP_FAIL; - } - } -#endif - - if (hcErr == HTTP_SUCCESS && m_pLoadedStencil) - { - // if anything other than HTTP_SUCCESS is returned during - // the rendering of replacement tags, we return that value - // here. - hcErr = pT->RenderStencil(static_cast(&m_HttpResponse), &m_state); - - if (hcErr == HTTP_SUCCESS && !m_HttpResponse.Flush(TRUE)) - hcErr = HTTP_FAIL; - } - - if (IsAsyncFlushStatus(hcErr)) - { - pRequestInfo->pszBuffer = LPCSTR(m_HttpResponse.m_strContent); - pRequestInfo->dwBufferLen = m_HttpResponse.m_strContent.GetLength(); - } - - if (pRequestInfo->dwRequestState == ATLSRV_STATE_BEGIN || IsAsyncDoneStatus(hcErr)) - return pT->Uninitialize(hcErr); - - else if (!IsAsyncStatus(hcErr)) - m_HttpResponse.ClearContent(); - - return hcErr; - } - - HTTP_CODE ServerTransferRequest(LPCSTR szRequest, bool bContinueAfterTransfer=false, - WORD nCodePage = 0, CStencilState *pState = NULL) throw(...) - { - return m_spExtension->TransferRequest( - m_pRequestInfo, - m_spServiceProvider, - static_cast(&m_HttpResponse), - static_cast(&m_HttpRequest), - szRequest, - nCodePage == 0 ? m_nCodePage : nCodePage, - bContinueAfterTransfer, - pState); - } - - inline DWORD MaxFormSize() - { - return DEFAULT_MAX_FORM_SIZE; - } - - inline DWORD FormFlags() - { - return ATL_FORM_FLAG_IGNORE_FILES; - } - - // Override this function to check if the request - // is valid. This function is called after m_HttpResponse - // has been initialized, so you can use it if you need - // to return an error to the client. This is also a - // good place to initialize any internal class data needed - // to handle the request. CRequestHandlerT::CheckValidRequest - // is called after CRequestHandlerT::InitializeInternal is - // called, so your override of this method will have access to - // m_pRequestInfo (this request's AtlServerRequest structure), - // m_hInstHandler (the HINSTANCE of this handler dll), - // m_spServerContext (the IHttpServerContext interface for this request), - // m_spServiceProvider (the IServiceProvider interface for this request). - // You should call CRequestHandlerT::CheckValidRequest in your override - // if you override this function. - // - // Note that m_HttpRequest has not been initialized, so - // you cannot use it. This function is intended to - // do simple checking throught IHttpServerContext to avoid - // expensive initialization of m_HttpRequest. - HTTP_CODE CheckValidRequest() - { - LPCSTR szMethod = NULL; - ATLASSUME(m_pRequestInfo); - szMethod = m_pRequestInfo->pServerContext->GetRequestMethod(); - if (strcmp(szMethod, "GET") && strcmp(szMethod, "POST") && strcmp(szMethod, "HEAD")) - return HTTP_NOT_IMPLEMENTED; - - return HTTP_SUCCESS; - } - - HRESULT GetContext(REFIID riid, void** ppv) - { - if (!ppv) - return E_POINTER; - if (InlineIsEqualGUID(riid, __uuidof(IHttpServerContext))) - { - return m_spServerContext.CopyTo((IHttpServerContext **)ppv); - } - if (InlineIsEqualGUID(riid, __uuidof(IHttpRequestLookup))) - { - *ppv = static_cast(&m_HttpRequest); - m_HttpRequest.AddRef(); - return S_OK; - } - if (InlineIsEqualGUID(riid, __uuidof(IServiceProvider))) - { - *ppv = m_spServiceProvider; - m_spServiceProvider.p->AddRef(); - return S_OK; - } - return E_NOINTERFACE; - } - - HINSTANCE GetResourceInstance() - { - if (m_pRequestInfo != NULL) - { - return m_pRequestInfo->hInstDll; - } - - return NULL; - } - - template - HRESULT GetContext(Interface** ppInterface) throw(...) - { - return GetContext(__uuidof(Interface), reinterpret_cast(ppInterface)); - } -}; // class CRequestHandlerT - -} // namespace ATL -#pragma pack(pop) - -#pragma warning( pop ) - -#endif // __ATLSTENCIL_H__ diff --git a/include/atl/l.chs/atlsrv.rc b/include/atl/l.chs/atlsrv.rc deleted file mode 100644 index 281ab2371..000000000 --- a/include/atl/l.chs/atlsrv.rc +++ /dev/null @@ -1,146 +0,0 @@ -// This is a part of the Active Template Library. -// Copyright (C) Microsoft Corporation -// All rights reserved. -// -// This source code is only intended as a supplement to the -// Active Template Library Reference and related -// electronic documentation provided with the library. -// See these sources for detailed information regarding the -// Active Template Library product. - -#include -#include "atlsrvres.h" - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ATLSRV_BAD_REQUEST "´íÎóµÄÇëÇó´íÎóµÄÇëÇó" - IDS_ATLSRV_AUTH_REQUIRED - "ÒªÇóÉí·ÝÑéÖ¤ÒªÇóÉí·ÝÑéÖ¤" - IDS_ATLSRV_FORBIDDEN "½ûÖ¹½ûÖ¹" - IDS_ATLSRV_NOT_FOUND "δÕÒµ½Î´ÕÒµ½" - IDS_ATLSRV_SERVER_ERROR "·þÎñÆ÷´íÎó·þÎñÆ÷´íÎó" - IDS_ATLSRV_NOT_IMPLEMENTED - "δʵÏÖδʵÏÖ" - IDS_ATLSRV_BAD_GATEWAY "´íÎóµÄÍø¹Ø´íÎóµÄÍø¹Ø" - IDS_ATLSRV_SERVICE_NOT_AVAILABLE - "·þÎñ²»¿ÉÓ÷þÎñ²»¿ÉÓÃ" - IDS_ATLSRV_SERVER_ERROR_BADSRF "Server Error

·þÎñÆ÷´íÎó

ÎÞ·¨¼ÓÔØ SRF Îļþ¡£" - IDS_ATLSRV_SERVER_ERROR_HNDLFAIL "·þÎñÆ÷´íÎó

·þÎñÆ÷´íÎó

ËùÇëÇóµÄ SRF ÒѼÓÔØ£¬µ«ÎÞ·¨¶ÔÆä½øÐÐÕýÈ·´¦Àí¡£" - IDS_ATLSRV_SERVER_ERROR_SYSOBJFAIL "·þÎñÆ÷´íÎó

·þÎñÆ÷´íÎó

ÎÞ·¨´´½¨ Windows ϵͳ¶ÔÏó¡£" - IDS_ATLSRV_SERVER_ERROR_READFILEFAIL "·þÎñÆ÷´íÎó

·þÎñÆ÷´íÎó

Îļþ¶Á²Ù×÷ʧ°Ü¡£" - IDS_ATLSRV_SERVER_ERROR_LOADFILEFAIL "·þÎñÆ÷´íÎó

·þÎñÆ÷´íÎó

Ö¸¶¨ÎļþÎÞ·¨´ò¿ª¡£" - IDS_ATLSRV_SERVER_ERROR_LOADLIB "·þÎñÆ÷´íÎó

·þÎñÆ÷´íÎó

LoadLibrary ʧ°Ü¡£" - IDS_ATLSRV_SERVER_ERROR_HANDLERIF "·þÎñÆ÷´íÎó

·þÎñÆ÷´íÎó

¼ìË÷ÇëÇó´¦Àí³ÌÐò½Ó¿Úʧ°Ü¡£" - IDS_ATLSRV_SERVER_ERROR_OUTOFMEM "·þÎñÆ÷´íÎó

·þÎñÆ÷´íÎó

·þÎñÆ÷ÄÚ´æ²»×ã¡£" - IDS_ATLSRV_SERVER_ERROR_UNEXPECTED "·þÎñÆ÷´íÎó

·þÎñÆ÷´íÎó

·þÎñÆ÷Óöµ½ÒâÍâ´íÎó¡£" - IDS_ATLSRV_SERVER_ERROR_STENCILPARSEFAIL "·þÎñÆ÷´íÎó

·þÎñÆ÷´íÎó

·þÎñÆ÷ÔÚÊÔͼ·ÖÎöËùÇëÇóµÄÄ£°åʱÓöµ½ÒâÍâ´íÎó¡£" - IDS_ATLSRV_SERVER_ERROR_STENCILLOADFAIL "·þÎñÆ÷´íÎó

·þÎñÆ÷´íÎó

·þÎñÆ÷δÄܼÓÔØËùÇëÇóµÄÄ£°å¡£¸ÃÄ£°åÎļþ¿ÉÄÜÒÑË𻵻ò²»Ôڸà Web ·þÎñÆ÷ÉÏ¡£" - IDS_ATLSRV_SERVER_ERROR_HANDLERNOTFOUND "·þÎñÆ÷´íÎó

·þÎñÆ÷´íÎó

ÔÚÖ¸¶¨´¦Àí³ÌÐò .dll ÖÐδÕÒµ½ÔÚËùÇëÇóÄ£°åµÄ´¦Àí³ÌÐò±ê¼ÇÖÐÃüÃûµÄij¸ö´¦Àí³ÌÐò¡£" - IDS_ATLSRV_SERVER_ERROR_BADHANDLERTAG "·þÎñÆ÷´íÎó

·þÎñÆ÷´íÎó

¸ÃÄ£°å°üº¬Ò»¸öÎÞ·¨±»Ä£°å´¦ÀíÆ÷ÕýÈ·´¦ÀíµÄ´¦Àí³ÌÐò±ê¼Ç£¬»òÕ߸ÃÄ£°å¸ù±¾Ã»Óаüº¬´¦Àí³ÌÐò±ê¼Ç¡£Çë²é¿´ËùÇëÇóµÄÄ£°å£¬Á˽âÕýÈ·µÄÄ£°åÓï·¨¡£" - IDS_ATLSRV_SERVER_ERROR_NOHANDLERTAG "·þÎñÆ÷´íÎó

·þÎñÆ÷´íÎó

ËùÇëÇóµÄÄ£°åûÓаüº¬Óд¦Àí³ÌÐò±ê¼Ç¡£" - IDS_ATLSRV_SERVER_ERROR_LONGMETHODNAME "·þÎñÆ÷´íÎó

·þÎñÆ÷´íÎó

ÔÚËùÇëÇóµÄÄ£°åÖз¢ÏÖÒ»¸öÌæ»»±ê¼Ç£¬¸ÃÌæ»»±ê¼ÇµÄÌæ»»Ãû³Æ¹ý³¤¡£Ìæ»»Ãû³ÆµÄ×î´ó³¤¶È±ØÐëСÓÚ»òµÈÓÚ atlstencil.h Öж¨ÒåµÄ³£Êý ATL_MAX_METHOD_NAME" - IDS_ATLSRV_SERVER_ERROR_LONGHANDLERNAME "·þÎñÆ÷´íÎó

·þÎñÆ÷´íÎó

ÔÚËùÇëÇóµÄÄ£°åÖз¢ÏÖÒ»¸öʹÓà id.tagname Óï·¨µÄÌæ»»±ê¼Ç¡£´¦Àí³ÌÐòÃû³ÆµÄ×î´ó³¤¶È±ØÐëСÓÚ»òµÈÓÚ atlstencil.h Öж¨ÒåµÄ³£Êý ATL_MAX_METHOD_NAME" - IDS_ATLSRV_SERVER_ERROR_IMPERSONATIONFAILED "·þÎñÆ÷´íÎó

·þÎñÆ÷´íÎó

Ä£Äâ¿Í»§¶ËÌá³öÇëÇóµÄ³¢ÊÔʧ°Ü¡£" - IDS_ATLSRV_SERVER_ERROR_ISAPISTARTUPFAILED "·þÎñÆ÷´íÎó

·þÎñÆ÷´íÎó

ÓÉÓÚ·¢Éúδ֪´íÎó£¬ÓÃÓÚ´¦Àí¸ÃÇëÇóµÄ ISAPI À©Õ¹ÎÞ·¨ÕýÈ·¼ÓÔØ¡£" - IDS_ATLSRV_SERVER_ERROR_SOAPNOSOAPACTION "Server Error

Server Error

SOAP request did not provide SOAPACTION header." - - IDS_ATLSRV_CRITICAL_HEAPCREATEFAILED "ÇëÇó¶Ñ´´½¨Ê§°Ü" - IDS_ATLSRV_CRITICAL_WORKERINITFAILED "¸¨ÖúÏ̳߳õʼ»¯Ê§°Ü" - IDS_ATLSRV_CRITICAL_CRITSECINITFAILED "ÁÙ½çÇø³õʼ»¯Ê§°Ü" - IDS_ATLSRV_CRITICAL_THREADPOOLFAILED "Ï̳߳سõʼ»¯Ê§°Ü" - IDS_ATLSRV_CRITICAL_DLLCACHEFAILED "DLL »º´æ³õʼ»¯Ê§°Ü" - IDS_ATLSRV_CRITICAL_PAGECACHEFAILED "Page »º´æ³õʼ»¯Ê§°Ü" - IDS_ATLSRV_CRITICAL_STENCILCACHEFAILED "Ä£°å»º´æ³õʼ»¯Ê§°Ü" - IDS_ATLSRV_CRITICAL_SESSIONSTATEFAILED "»á»°×´Ì¬·þÎñ³õʼ»¯Ê§°Ü" - IDS_ATLSRV_CRITICAL_BLOBCACHEFAILED "Blob »º´æ³õʼ»¯Ê§°Ü" - IDS_ATLSRV_CRITICAL_FILECACHEFAILED "Îļþ»º´æ³õʼ»¯Ê§°Ü" - - IDS_PERFMON_CACHE "ATL Server:»º´æ" - IDS_PERFMON_CACHE_HELP "ATL Server »º´æµÄÏà¹ØÐÅÏ¢" - IDS_PERFMON_HITCOUNT "»º´æÃüÖÐÊý" - IDS_PERFMON_HITCOUNT_HELP "ÃüÖлº´æµÄÊýÄ¿" - IDS_PERFMON_MISSCOUNT "»º´æδÃüÖÐÊý" - IDS_PERFMON_MISSCOUNT_HELP "δÃüÖлº´æµÄÊýÄ¿" - IDS_PERFMON_CURRENTALLOCATIONS "»º´æµ±Ç°·ÖÅä¶î" - IDS_PERFMON_CURRENTALLOCATIONS_HELP "·ÖÅä¸ø»º´æµÄµ±Ç°ÄÚ´æ´óС" - IDS_PERFMON_MAXALLOCATIONS "»º´æ×î´ó·ÖÅä¶î" - IDS_PERFMON_MAXALLOCATIONS_HELP "·ÖÅä¸ø»º´æµÄ×î´óÄÚ´æ´óС" - IDS_PERFMON_CURRENTENTRIES "µ±Ç°»º´æÏîÊý" - IDS_PERFMON_CURRENTENTRIES_HELP "µ±Ç°»º´æÏîµÄÊýÄ¿" - IDS_PERFMON_MAXENTRIES "»º´æ×î´óÏîÊý" - IDS_PERFMON_MAXENTRIES_HELP "»º´æÏîµÄ×î´óÊýÄ¿" - IDS_PERFMON_HITCOUNTRATE "»º´æÃüÖÐÂÊ" - IDS_PERFMON_HITCOUNTRATE_HELP "ÿÃëÃüÖлº´æµÄ´ÎÊý" - IDS_PERFMON_REQUEST "ATL Server:ÇëÇó" - IDS_PERFMON_REQUEST_HELP "¹ØÓÚ½øÈë¸Ã·þÎñÆ÷µÄÇëÇóµÄͳ¼ÆÐÅÏ¢" - IDS_PERFMON_REQUEST_TOTAL "·þÎñÆ÷ÇëÇó×ÜÊý" - IDS_PERFMON_REQUEST_TOTAL_HELP "ÇëÇóµÄ×ÜÊý" - IDS_PERFMON_REQUEST_FAILED "·þÎñÆ÷ÇëÇóʧ°ÜÊý" - IDS_PERFMON_REQUEST_FAILED_HELP "ʧ°ÜµÄÇëÇóµÄÊýÄ¿" - IDS_PERFMON_REQUEST_RATE "·þÎñÆ÷ÇëÇó/Ãë" - IDS_PERFMON_REQUEST_RATE_HELP "ÿÃëÇëÇóµÄÊýÄ¿" - IDS_PERFMON_REQUEST_AVG_RESPONSE_TIME "ƽ¾ùÏìӦʱ¼ä" - IDS_PERFMON_REQUEST_AVG_RESPONSE_TIME_HELP "´¦ÀíÇëÇóËùÐèµÄƽ¾ùʱ¼ä" - IDS_PERFMON_REQUEST_CURR_WAITING "µ±Ç°¶ÓÁÐÖеÄÇëÇóÊý" - IDS_PERFMON_REQUEST_CURR_WAITING_HELP "µ±Ç°µÈ´ý´¦ÀíµÄÇëÇóÊýÄ¿" - IDS_PERFMON_REQUEST_MAX_WAITING "¶ÓÁÐÖÐÇëÇóµÄ×î´óÊýÄ¿" - IDS_PERFMON_REQUEST_MAX_WAITING_HELP "µÈ´ý´¦ÀíµÄÇëÇóµÄ×î´óÊýÄ¿" - IDS_PERFMON_REQUEST_ACTIVE_THREADS "»î¶¯Ïß³ÌÊý" - IDS_PERFMON_REQUEST_ACTIVE_THREADS_HELP "ÕýÔÚ´¦ÀíÇëÇóµÄ»î¶¯Ïß³ÌÊý" -END - - -#ifndef ATL_NO_DEFAULT_STENCIL_RESOURCE -dllmgr.srf HTML "res\\dllmgr.srf" -stencilmgr.srf HTML "res\\stencilmgr.srf" -threadmgr.srf HTML "res\\threadmgr.srf" -#endif - - -// -// Stencil parse error support -// -#ifdef ATL_DEBUG_STENCILS - -STRINGTABLE DISCARDABLE -BEGIN - IDS_STENCIL_ERROR_STENCIL -"{{codepage 0}}

ÔÚÊÔͼ·ÖÎöÄ£°åÎļþʱ£¬·¢ÉúÈçÏ´íÎó£º

\r\n{{while GetNextError}}\r\n\r\n\r\n\r\n
´íÎóÀàÐÍ{{GetErrorText}}
ÐкÅ{{GetErrorLineNumber}}
´íÎóÎı¾
{{GetErrorLine}}
\r\n{{endwhile}}
Ä£°åÊä³öΪ£º\r\n
" - - IDS_STENCIL_UNCLOSEDBLOCK_IF "{{if}} ȱÉÙ {{endif}}" - IDS_STENCIL_UNCLOSEDBLOCK_ELSE "{{else}} ȱÉÙ {{endif}}" - IDS_STENCIL_UNCLOSEDBLOCK_WHILE "{{while}} ȱÉÙ {{endwhile}}" - IDS_STENCIL_UNOPENEDBLOCK_ENDWHILE "{{endwhile}} ȱÉÙ {{while}}" - IDS_STENCIL_UNOPENEDBLOCK_ELSE "{{else}} ȱÉÙ {{if}}" - IDS_STENCIL_UNOPENEDBLOCK_ENDIF "{{endif}} ȱÉÙ {{if}} or {{else}}" - - IDS_STENCIL_INVALID_HANDLER "ÎÞЧµÄ´¦Àí³ÌÐò±ê¼Ç" - IDS_STENCIL_NULLPARAM "ParseReplacements Ϊ Null ²ÎÊý" - IDS_STENCIL_INVALIDSTRING "´«µÝ¸ø ParseReplacements µÄ×Ö·û´®Îª¿Õ»òÕßΪ¸º" - IDS_STENCIL_EMBEDDED_NULL "ǶÈëÔÚÄ£°åÖеĿÕ×Ö·û" - IDS_STENCIL_UNMATCHED_TAG_START "²»Æ¥Åä {{" - IDS_STENCIL_MISMATCHED_TAG_START "Æ¥Åä´íÎó {{" - IDS_STENCIL_BAD_PARAMETER "´íÎóµÄ²ÎÊý" - IDS_STENCIL_METHODNAME_TOO_LONG "·½·¨Ãû³Æ¹ý³¤" - IDS_STENCIL_HANDLERNAME_TOO_LONG "´¦Àí³ÌÐòÃû³Æ¹ý³¤" - IDS_STENCIL_INVALID_SUBHANDLER "ÎÞЧµÄ×Ó´¦Àí³ÌÐò±ê¼Ç" - IDS_STENCIL_UNRESOLVED_REPLACEMENT "ÎÞ·¨½âÎöµÄÌæ»» : '%s'" - - IDS_STENCIL_INCLUDE_ERROR "ÎÞ·¨´ò¿ª±»°üº¬Îļþ" - IDS_STENCIL_INCLUDE_INVALID "±»°üº¬Îļþ²»ÊÇ´ÅÅÌÎļþ" - - IDS_STENCIL_MLANG_COCREATE "ÎÞ·¨´´½¨ CMultiLanguage" - IDS_STENCIL_MLANG_LCID "»ñÈ¡ lcid ´íÎó" - IDS_STENCIL_MLANG_GETLOCALE "GetLocaleInfo ʧ°Ü" - IDS_STENCIL_MLANG_GETCHARSET "GetCharsetInfo ʧ°Ü" - - IDS_STENCIL_OUTOFMEMORY "ÄÚ´æ²»×ã" - IDS_STENCIL_UNEXPECTED "Òì³£´íÎó" -END - -#endif diff --git a/include/atl/l.cht/atlsrv.rc b/include/atl/l.cht/atlsrv.rc deleted file mode 100644 index 2d9f7340d..000000000 --- a/include/atl/l.cht/atlsrv.rc +++ /dev/null @@ -1,146 +0,0 @@ -// This is a part of the Active Template Library. -// Copyright (C) Microsoft Corporation -// All rights reserved. -// -// This source code is only intended as a supplement to the -// Active Template Library Reference and related -// electronic documentation provided with the library. -// See these sources for detailed information regarding the -// Active Template Library product. - -#include -#include "atlsrvres.h" - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ATLSRV_BAD_REQUEST "¤£¥¿½Tªº­n¨D¤£¥¿½Tªº­n¨D" - IDS_ATLSRV_AUTH_REQUIRED - "»Ý­n±ÂÅv»Ý­n±ÂÅv" - IDS_ATLSRV_FORBIDDEN "¸T¤î¨Ï¥Î¸T¤î¨Ï¥Î" - IDS_ATLSRV_NOT_FOUND "§ä¤£¨ì§ä¤£¨ì" - IDS_ATLSRV_SERVER_ERROR "¦øªA¾¹¿ù»~¦øªA¾¹¿ù»~" - IDS_ATLSRV_NOT_IMPLEMENTED - "¥¼¹ê§@¥¼¹ê§@" - IDS_ATLSRV_BAD_GATEWAY "¤£¥¿½Tªº¹h¹D¤£¥¿½Tªº¹h¹D" - IDS_ATLSRV_SERVICE_NOT_AVAILABLE - "µLªk¨ú±oªA°ÈµLªk¨ú±oªA°È" - IDS_ATLSRV_SERVER_ERROR_BADSRF "¦øªA¾¹¿ù»~

¦øªA¾¹¿ù»~

µLªk¸ü¤J SRF ÀÉ¡C" - IDS_ATLSRV_SERVER_ERROR_HNDLFAIL "¦øªA¾¹¿ù»~

¦øªA¾¹¿ù»~

¤w¸g¸ü¤J­n¨Dªº SRF ÀÉ¡A¦ýµLªk¦¨¥\³B²z¡C" - IDS_ATLSRV_SERVER_ERROR_SYSOBJFAIL "¦øªA¾¹¿ù»~

¦øªA¾¹¿ù»~

µLªk«Ø¥ß Windows ¨t²Îª«¥ó¡C" - IDS_ATLSRV_SERVER_ERROR_READFILEFAIL "¦øªA¾¹¿ù»~

¦øªA¾¹¿ù»~

ÀÉ®×Ū¨ú§@·~¤w¥¢±Ñ¡C" - IDS_ATLSRV_SERVER_ERROR_LOADFILEFAIL "¦øªA¾¹¿ù»~

¦øªA¾¹¿ù»~

µLªk¶}±Ò«ü©wªºÀɮסC" - IDS_ATLSRV_SERVER_ERROR_LOADLIB "¦øªA¾¹¿ù»~

¦øªA¾¹¿ù»~

LoadLibrary ¤w¥¢±Ñ¡C" - IDS_ATLSRV_SERVER_ERROR_HANDLERIF "¦øªA¾¹¿ù»~

¦øªA¾¹¿ù»~

µLªkÂ^¨ú­n¨Dªº³B²z±`¦¡¤¶­±¡C" - IDS_ATLSRV_SERVER_ERROR_OUTOFMEM "¦øªA¾¹¿ù»~

¦øªA¾¹¿ù»~

¦øªA¾¹°O¾ÐÅ餣¨¬¡C" - IDS_ATLSRV_SERVER_ERROR_UNEXPECTED "¦øªA¾¹¿ù»~

¦øªA¾¹¿ù»~

¦øªA¾¹µo¥Í¥¼¹w´Áªº¿ù»~¡C" - IDS_ATLSRV_SERVER_ERROR_STENCILPARSEFAIL "¦øªA¾¹¿ù»~

¦øªA¾¹¿ù»~

¹Á¸Õ­åªR­n¨Dªº¼ÒªO®É¡A¦øªA¾¹µo¥Í¥¼¹w´Áªº¿ù»~¡C" - IDS_ATLSRV_SERVER_ERROR_STENCILLOADFAIL "¦øªA¾¹¿ù»~

¦øªA¾¹¿ù»~

¦øªA¾¹µLªk¸ü¤J­n¨Dªº¼ÒªO¡C¼ÒªOÀÉ¥i¯à¤w·l·´©Î¤£¦b¦¹ Web ¦øªA¾¹¤W¡C" - IDS_ATLSRV_SERVER_ERROR_HANDLERNOTFOUND "¦øªA¾¹¿ù»~

¦øªA¾¹¿ù»~

¦b«ü©wªº handler .dll ¤¤¡A§ä¤£¨ì¦b­n¨D¼ÒªOªº³B²z±`¦¡¼Ð°O¤¤©R¦Wªº¬Y­Ó³B²z±`¦¡¡C" - IDS_ATLSRV_SERVER_ERROR_BADHANDLERTAG "¦øªA¾¹¿ù»~

¦øªA¾¹¿ù»~

¦¹¼ÒªO¥]§t¼ÒªO³B²z¾¹µLªk¾A·í­åªRªº³B²z±`¦¡¼Ð°O¡A©Î¥¼¥]§t¥ô¦ó³B²z±`¦¡¼Ð°O¡C½ÐÀˬd­n¨Dªº¼ÒªO¬O§_¨Ï¥Î¾A¦Xªº¼ÒªO»yªk¡C" - IDS_ATLSRV_SERVER_ERROR_NOHANDLERTAG "¦øªA¾¹¿ù»~

¦øªA¾¹¿ù»~

­n¨Dªº¼ÒªO¥¼¥]§t³B²z±`¦¡¼Ð°O¡C" - IDS_ATLSRV_SERVER_ERROR_LONGMETHODNAME "¦øªA¾¹¿ù»~

¦øªA¾¹¿ù»~

¦b­n¨Dªº¼ÒªO¤¤µo²{¨ú¥N¼Ð°Oªº¨ú¥N¦WºÙ¤Óªø¡C¨ú¥N¦WºÙ³Ìªøªºªø«×¥²¶·¤p©ó©Îµ¥©ó¦b atlstencil.h ¤¤©Ò©w¸qªº ATL_MAX_METHOD_NAME ±`¼Æ¡C" - IDS_ATLSRV_SERVER_ERROR_LONGHANDLERNAME "¦øªA¾¹¿ù»~

¦øªA¾¹¿ù»~

¦b­n¨D¼ÒªO¤¤¨Ï¥Î id.tagname »yªkªº¨ú¥N¼Ð°Oªº³B²z±`¦¡¦WºÙ¤Óªø¡C³B²z±`¦¡¦WºÙ³Ìªøªºªø«×¥²¶·¤p©ó©Îµ¥©ó¦b atlstencil.h ¤¤©Ò©w¸qªº ATL_MAX_METHOD_NAME ±`¼Æ¡C" - IDS_ATLSRV_SERVER_ERROR_IMPERSONATIONFAILED "¦øªA¾¹¿ù»~

¦øªA¾¹¿ù»~

¹Á¸Õ¼ÒÀÀ¥Î¤áºÝ³y¦¨­n¨D¥¢±Ñ¡C" - IDS_ATLSRV_SERVER_ERROR_ISAPISTARTUPFAILED "¦øªA¾¹¿ù»~

¦øªA¾¹¿ù»~

¦]¬°µo¥Í¥¼ª¾ªº¿ù»~¡AµLªk¥¿½T¸ü¤J¥Î¨ÓªA°È¦¹­n¨Dªº ISAPI ÂX¥Rµ{¦¡¡C" - IDS_ATLSRV_SERVER_ERROR_SOAPNOSOAPACTION "Server Error

Server Error

SOAP request did not provide SOAPACTION header." - - IDS_ATLSRV_CRITICAL_HEAPCREATEFAILED "­n¨D°ï¿n«Ø¥ß¥¢±Ñ" - IDS_ATLSRV_CRITICAL_WORKERINITFAILED "­I´º¤u§@°õ¦æºüªì©l¤Æ¥¢±Ñ" - IDS_ATLSRV_CRITICAL_CRITSECINITFAILED "ÃöÁä°Ï¬qªì©l¤Æ¥¢±Ñ" - IDS_ATLSRV_CRITICAL_THREADPOOLFAILED "°õ¦æºü¶°°Ïªì©l¤Æ¥¢±Ñ" - IDS_ATLSRV_CRITICAL_DLLCACHEFAILED "DLL §Ö¨úªì©l¤Æ¥¢±Ñ" - IDS_ATLSRV_CRITICAL_PAGECACHEFAILED "¤À­¶§Ö¨úªì©l¤Æ¥¢±Ñ" - IDS_ATLSRV_CRITICAL_STENCILCACHEFAILED "¼ÒªO§Ö¨úªì©l¤Æ¥¢±Ñ" - IDS_ATLSRV_CRITICAL_SESSIONSTATEFAILED "¤u§@¶¥¬qª¬ºAªA°Èªì©l¤Æ¥¢±Ñ" - IDS_ATLSRV_CRITICAL_BLOBCACHEFAILED "Blob §Ö¨úªì©l¤Æ¥¢±Ñ" - IDS_ATLSRV_CRITICAL_FILECACHEFAILED "Àɮק֨úªì©l¤Æ¥¢±Ñ" - - IDS_PERFMON_CACHE "ATL Server:§Ö¨ú" - IDS_PERFMON_CACHE_HELP "¦³Ãö ATL Server §Ö¨úªº¸ê°T" - IDS_PERFMON_HITCOUNT "§Ö¨ú¥s¥Î¦¸¼Æ" - IDS_PERFMON_HITCOUNT_HELP "§Ö¨ú¥s¥Îªº¦¸¼Æ" - IDS_PERFMON_MISSCOUNT "§Ö¨ú¿òº|¦¸¼Æ" - IDS_PERFMON_MISSCOUNT_HELP "§Ö¨ú¿òº|ªº¦¸¼Æ" - IDS_PERFMON_CURRENTALLOCATIONS "§Ö¨ú¥Ø«e°t¸m" - IDS_PERFMON_CURRENTALLOCATIONS_HELP "§Ö¨ú¥Ø«eªº°O¾ÐÅé°t¸m" - IDS_PERFMON_MAXALLOCATIONS "§Ö¨ú°t¸m¤W­­" - IDS_PERFMON_MAXALLOCATIONS_HELP "§Ö¨úªº³Ì¤j°O¾ÐÅé°t¸m" - IDS_PERFMON_CURRENTENTRIES "§Ö¨ú¥Ø«e¶µ¥Ø" - IDS_PERFMON_CURRENTENTRIES_HELP "¥Ø«eªº§Ö¨ú¶µ¥Ø¼Æ" - IDS_PERFMON_MAXENTRIES "§Ö¨ú¶µ¥Ø¤W­­" - IDS_PERFMON_MAXENTRIES_HELP "§Ö¨ú¶µ¥Øªº³Ì¤j¼Æ" - IDS_PERFMON_HITCOUNTRATE "§Ö¨ú¥s¥Î²v" - IDS_PERFMON_HITCOUNTRATE_HELP "¨C¬í§Ö¨ú¥s¥Îªº¼Æ¥Ø" - IDS_PERFMON_REQUEST "ATL Server:­n¨D" - IDS_PERFMON_REQUEST_HELP "¦³Ãö¶i¤J¦¹¦øªA¾¹­n¨Dªº²Î­p¸ê®Æ" - IDS_PERFMON_REQUEST_TOTAL "¦øªA¾¹­n¨DÁ`¼Æ" - IDS_PERFMON_REQUEST_TOTAL_HELP "­n¨DªºÁ`¼Æ" - IDS_PERFMON_REQUEST_FAILED "¦øªA¾¹¥¢±Ñ­n¨D" - IDS_PERFMON_REQUEST_FAILED_HELP "¥¢±Ñ­n¨Dªº¼Æ¥Ø" - IDS_PERFMON_REQUEST_RATE "¦øªA¾¹­n¨D /¬í" - IDS_PERFMON_REQUEST_RATE_HELP "¨C¬í­n¨D¼Æ¥Ø" - IDS_PERFMON_REQUEST_AVG_RESPONSE_TIME "¥­§¡¦^À³®É¶¡" - IDS_PERFMON_REQUEST_AVG_RESPONSE_TIME_HELP "³B²z­n¨D©Òªá¶Oªº¥­§¡®É¶¡" - IDS_PERFMON_REQUEST_CURR_WAITING "¥Ø«e¤w±Æ¤J¦î¦Cªº­n¨D" - IDS_PERFMON_REQUEST_CURR_WAITING_HELP "¥Ø«eµ¥­Ô³B²zªº­n¨D¼Æ¥Ø" - IDS_PERFMON_REQUEST_MAX_WAITING "¦î¦C­n¨D¤W­­" - IDS_PERFMON_REQUEST_MAX_WAITING_HELP "µ¥­Ô³B²z­n¨Dªº³Ì¤j¼Æ" - IDS_PERFMON_REQUEST_ACTIVE_THREADS "§@¥Î¤¤ªº°õ¦æºü" - IDS_PERFMON_REQUEST_ACTIVE_THREADS_HELP "¥¿¦b³B²z­n¨Dªº°õ¦æºü¼Æ¥Ø" -END - - -#ifndef ATL_NO_DEFAULT_STENCIL_RESOURCE -dllmgr.srf HTML "res\\dllmgr.srf" -stencilmgr.srf HTML "res\\stencilmgr.srf" -threadmgr.srf HTML "res\\threadmgr.srf" -#endif - - -// -// Stencil parse error support -// -#ifdef ATL_DEBUG_STENCILS - -STRINGTABLE DISCARDABLE -BEGIN - IDS_STENCIL_ERROR_STENCIL -"{{codepage 0}}

·í¹Á¸Õ­åªR¼ÒªOÀɮɡAµo¥Í¤U¦C¿ù»~:

\r\n{{while GetNextError}}\r\n\r\n\r\n\r\n
¿ù»~Ãþ«¬{{GetErrorText}}
¦æ¸¹{{GetErrorLineNumber}}
¿ù»~¤å¦r
{{GetErrorLine}}
\r\n{{endwhile}}
¤§«áªº¼ÒªO¿é¥X:\r\n
" - - IDS_STENCIL_UNCLOSEDBLOCK_IF "¦³ {{if}} ¦ý¨S¦³ {{endif}}" - IDS_STENCIL_UNCLOSEDBLOCK_ELSE "¦³ {{else}} ¦ý¨S¦³ {{endif}}" - IDS_STENCIL_UNCLOSEDBLOCK_WHILE "¦³ {{while}} ¦ý¨S¦³ {{endwhile}}" - IDS_STENCIL_UNOPENEDBLOCK_ENDWHILE "¦³ {{endwhile}} ¦ý¨S¦³ {{while}}" - IDS_STENCIL_UNOPENEDBLOCK_ELSE "¦³ {{else}} ¦ý¨S¦³ {{if}}" - IDS_STENCIL_UNOPENEDBLOCK_ENDIF "¦³ {{endif}} ¦ý¨S¦³ {{if}} ©Î {{else}}" - - IDS_STENCIL_INVALID_HANDLER "µL®Äªº³B²z±`¦¡¼Ð°O" - IDS_STENCIL_NULLPARAM "ParseReplacements ªº NULL °Ñ¼Æ" - IDS_STENCIL_INVALIDSTRING "¶Ç»¼¨ì ParseReplacements ªºªÅªº©Î­t­È¦r¦ê" - IDS_STENCIL_EMBEDDED_NULL "¼ÒªO¤¤´O¤Jªº Null ¦r¤¸" - IDS_STENCIL_UNMATCHED_TAG_START "¤£¬Û²Åªº {{" - IDS_STENCIL_MISMATCHED_TAG_START "¤£¬Û²Åªº {{" - IDS_STENCIL_BAD_PARAMETER "¤£¥¿½Tªº°Ñ¼Æ" - IDS_STENCIL_METHODNAME_TOO_LONG "¤èªk¦WºÙ¤Óªø" - IDS_STENCIL_HANDLERNAME_TOO_LONG "³B²z±`¦¡¦WºÙ¤Óªø" - IDS_STENCIL_INVALID_SUBHANDLER "µL®Äªº¤l³B²z±`¦¡¼Ð°O" - IDS_STENCIL_UNRESOLVED_REPLACEMENT "µLªk¸ÑªRªº¨ú¥N : '%s'" - - IDS_STENCIL_INCLUDE_ERROR "µLªk¶}±Ò¥]§tªºÀÉ®×" - IDS_STENCIL_INCLUDE_INVALID "¥]§tªºÀɮפ£¬OºÏºÐÀÉ®×" - - IDS_STENCIL_MLANG_COCREATE "µLªk«Ø¥ß CMultiLanguage" - IDS_STENCIL_MLANG_LCID "¨ú±o lcid µo¥Í¿ù»~" - IDS_STENCIL_MLANG_GETLOCALE "GetLocaleInfo ¥¢±Ñ" - IDS_STENCIL_MLANG_GETCHARSET "GetCharsetInfo ¥¢±Ñ" - - IDS_STENCIL_OUTOFMEMORY "°O¾ÐÅ餣¨¬" - IDS_STENCIL_UNEXPECTED "¥¼¹w´Áªº¿ù»~" -END - -#endif diff --git a/include/atl/l.deu/atlsrv.rc b/include/atl/l.deu/atlsrv.rc deleted file mode 100644 index 2ffca35c6..000000000 --- a/include/atl/l.deu/atlsrv.rc +++ /dev/null @@ -1,146 +0,0 @@ -// This is a part of the Active Template Library. -// Copyright (C) Microsoft Corporation -// All rights reserved. -// -// This source code is only intended as a supplement to the -// Active Template Library Reference and related -// electronic documentation provided with the library. -// See these sources for detailed information regarding the -// Active Template Library product. - -#include -#include "atlsrvres.h" - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ATLSRV_BAD_REQUEST "Ungültige AnforderungUngültige Anforderung" - IDS_ATLSRV_AUTH_REQUIRED - "Authorisierung erforderlichAuthorisierung erforderlich" - IDS_ATLSRV_FORBIDDEN "UnzulässigUnzulässig" - IDS_ATLSRV_NOT_FOUND "Nicht gefundenNicht gefunden" - IDS_ATLSRV_SERVER_ERROR "ServerfehlerServerfehler" - IDS_ATLSRV_NOT_IMPLEMENTED - "Nicht implementiertNicht implementiert" - IDS_ATLSRV_BAD_GATEWAY "Ungültiger GatewayUngültiger Gateway" - IDS_ATLSRV_SERVICE_NOT_AVAILABLE - "Dienst nicht verfügbarDienst nicht verfügbar" - IDS_ATLSRV_SERVER_ERROR_BADSRF "Serverfehler

Serverfehler

SRF-Datei konnte nicht geladen werden." - IDS_ATLSRV_SERVER_ERROR_HNDLFAIL "Serverfehler

Serverfehler

Die angeforderte SRF-Datei wurde geladen, aber konnte nicht verarbeitet werden." - IDS_ATLSRV_SERVER_ERROR_SYSOBJFAIL "Serverfehler

Serverfehler

Ein Windows-Systemobjekt konnte nicht erstellt werden." - IDS_ATLSRV_SERVER_ERROR_READFILEFAIL "Serverfehler

Serverfehler

Ein Dateilesevorgang ist fehlgeschlagen." - IDS_ATLSRV_SERVER_ERROR_LOADFILEFAIL "Serverfehler

Serverfehler

Die angegebene Datei konnte nicht geöffnet werden." - IDS_ATLSRV_SERVER_ERROR_LOADLIB "Serverfehler

Serverfehler

LoadLibrary fehlgeschlagen." - IDS_ATLSRV_SERVER_ERROR_HANDLERIF "Serverfehler

Serverfehler

Die Anforderungshandlerschnittstelle konnte nicht abgerufen werden." - IDS_ATLSRV_SERVER_ERROR_OUTOFMEM "Serverfehler

Serverfehler

Auf dem Server ist nicht genügend Arbeitsspeicher verfügbar." - IDS_ATLSRV_SERVER_ERROR_UNEXPECTED "Serverfehler

Serverfehler

Auf dem Server ist ein unerwarteter Fehler aufgetreten." - IDS_ATLSRV_SERVER_ERROR_STENCILPARSEFAIL "Serverfehler

Serverfehler

Beim Bearbeiten des angeforderten Stencils ist ein unerwarteter Fehler auf dem Server aufgetreten." - IDS_ATLSRV_SERVER_ERROR_STENCILLOADFAIL "Serverfehler

Serverfehler

Der Server konnte den angeforderten Stencil nicht laden. Die Stencildatei ist möglicherweise beschädigt oder nicht auf dem Webserver vorhanden." - IDS_ATLSRV_SERVER_ERROR_HANDLERNOTFOUND "Serverfehler

Serverfehler

Ein in einem Handlertag benannter Handler für den angeforderten Stencil konnte nicht im angegebenen Handler gefunden werden .dll." - IDS_ATLSRV_SERVER_ERROR_BADHANDLERTAG "Serverfehler

Serverfehler

Der Stencil enthält ein Handlertag, das vom Stencilprozessor nicht richtig bearbeitet werden konnte und kein Handlertag enthält. Überprüfen Sie die Stencilsyntax für den angeforderten Stencil." - IDS_ATLSRV_SERVER_ERROR_NOHANDLERTAG "Serverfehler

Serverfehler

Der angeforderte Stencil enthält kein Handlertag." - IDS_ATLSRV_SERVER_ERROR_LONGMETHODNAME "Serverfehler

Serverfehler

Im angeforderten Stencil wurde ein Ersetzungstag mit einem zu langen Namen gefunden. Die maximale Länge des Ersetzungsnamen muss kleiner oder gleich der ATL_MAX_METHOD_NAME-Konstante sein, die in atlstencil.h definiert ist." - IDS_ATLSRV_SERVER_ERROR_LONGHANDLERNAME "Serverfehler

Serverfehler

Im angeforderten Stencil wurde ein Ersetzungstag mit einem zu langen Handlernamen gefunden, der die id.tagname-Syntax verwendet. Die maximale Länge des Handlernamens muss kleiner oder gleich der ATL_MAX_METHOD_NAME-Konstante sein, die in atlstencil.h definiert ist." - IDS_ATLSRV_SERVER_ERROR_IMPERSONATIONFAILED "Serverfehler

Serverfehler

Die Anforderung ist fehlgeschlagen, da versucht wurde, den Client zu imitieren." - IDS_ATLSRV_SERVER_ERROR_ISAPISTARTUPFAILED "Serverfehler

Serverfehler

Die ISAPI-Erweiterung für die Anforderung konnte nicht geladen werden, da ein unbekannter Fehler aufgetreten ist." - IDS_ATLSRV_SERVER_ERROR_SOAPNOSOAPACTION "Server Error

Server Error

SOAP request did not provide SOAPACTION header." - - IDS_ATLSRV_CRITICAL_HEAPCREATEFAILED "Anforderungsheap konnte nicht erstellt werden" - IDS_ATLSRV_CRITICAL_WORKERINITFAILED "Workerthread konnte nicht initialisiert werden" - IDS_ATLSRV_CRITICAL_CRITSECINITFAILED "Kritischer Abschnitt konnte nicht initialisiert werden" - IDS_ATLSRV_CRITICAL_THREADPOOLFAILED "Threadpool konnte nicht initialisiert werden" - IDS_ATLSRV_CRITICAL_DLLCACHEFAILED "DLL-Cache konnte nicht initialisiert werden" - IDS_ATLSRV_CRITICAL_PAGECACHEFAILED "Seitencache konnte nicht initialisiert werden" - IDS_ATLSRV_CRITICAL_STENCILCACHEFAILED "Stencilcache konnte nicht initialisiert werden" - IDS_ATLSRV_CRITICAL_SESSIONSTATEFAILED "Sitzungsstatusdienst konnte nicht initialisiert werden" - IDS_ATLSRV_CRITICAL_BLOBCACHEFAILED "Blobcache konnte nicht initialisiert werden" - IDS_ATLSRV_CRITICAL_FILECACHEFAILED "Dateicache konnte nicht initialisiert werden" - - IDS_PERFMON_CACHE "ATL-Server:Cache" - IDS_PERFMON_CACHE_HELP "Informationen über den ATL-Servercache" - IDS_PERFMON_HITCOUNT "Cachetrefferanzahl" - IDS_PERFMON_HITCOUNT_HELP "Anzahl der Cachetreffer" - IDS_PERFMON_MISSCOUNT "Fehlgeschlagene Cachezugriffe" - IDS_PERFMON_MISSCOUNT_HELP "Anzahl der fehlgeschlagenen Cachezugriffe" - IDS_PERFMON_CURRENTALLOCATIONS "Aktuelle Cachezuordnungen" - IDS_PERFMON_CURRENTALLOCATIONS_HELP "Aktuelle Speicherzuordnung für den Cache" - IDS_PERFMON_MAXALLOCATIONS "Max. Cachezuordnungen" - IDS_PERFMON_MAXALLOCATIONS_HELP "Maximale Speicherzuordnung für den Cache" - IDS_PERFMON_CURRENTENTRIES "Aktuelle Cacheeinträge" - IDS_PERFMON_CURRENTENTRIES_HELP "Aktuelle Anzahl der Cacheeinträge" - IDS_PERFMON_MAXENTRIES "Max. Cacheeinträge" - IDS_PERFMON_MAXENTRIES_HELP "Maximale Anzahl der Cacheeinträge" - IDS_PERFMON_HITCOUNTRATE "Cachetrefferanzahl" - IDS_PERFMON_HITCOUNTRATE_HELP "Anzahl der Treffer pro Sekunde" - IDS_PERFMON_REQUEST "ATL-Server:Request" - IDS_PERFMON_REQUEST_HELP "Statistik über die eingehenden Serveranforderungen" - IDS_PERFMON_REQUEST_TOTAL "Serveranforderungen insgesamt" - IDS_PERFMON_REQUEST_TOTAL_HELP "Gesamtanzahl der Anforderungen" - IDS_PERFMON_REQUEST_FAILED "Fehlgeschlagene Serveranforderungen" - IDS_PERFMON_REQUEST_FAILED_HELP "Anzahl der fehlgeschlagenen Anforderungen" - IDS_PERFMON_REQUEST_RATE "Serveranforderungen /Sek." - IDS_PERFMON_REQUEST_RATE_HELP "Anzahl der Anforderungen pro Sekunde" - IDS_PERFMON_REQUEST_AVG_RESPONSE_TIME "Durchschnittliche Antwortzeit" - IDS_PERFMON_REQUEST_AVG_RESPONSE_TIME_HELP "Durchschnittliche Bearbeitungszeit" - IDS_PERFMON_REQUEST_CURR_WAITING "Aktuelle Anforderungen in der Warteschlange" - IDS_PERFMON_REQUEST_CURR_WAITING_HELP "Die aktuvelle Anzahl der Anforderungen, die auf die Bearbeitung warten" - IDS_PERFMON_REQUEST_MAX_WAITING "Maximale Anforderungen in der Warteschlange" - IDS_PERFMON_REQUEST_MAX_WAITING_HELP "Die maximale Anzahl der Anforderungen, die auf die Bearbeitung warten" - IDS_PERFMON_REQUEST_ACTIVE_THREADS "AKtive Threads" - IDS_PERFMON_REQUEST_ACTIVE_THREADS_HELP "Die Anzahl der Threads, die Anforderungen bearbeiten" -END - - -#ifndef ATL_NO_DEFAULT_STENCIL_RESOURCE -dllmgr.srf HTML "res\\dllmgr.srf" -stencilmgr.srf HTML "res\\stencilmgr.srf" -threadmgr.srf HTML "res\\threadmgr.srf" -#endif - - -// -// Stencil parse error support -// -#ifdef ATL_DEBUG_STENCILS - -STRINGTABLE DISCARDABLE -BEGIN - IDS_STENCIL_ERROR_STENCIL -"{{codepage 0}}

Beim Bearbeiten einer Stencildatei sind folgende Fehler aufgetreten:

\r\n{{while GetNextError}}\r\n\r\n\r\n\r\n
Fehlertyp{{GetErrorText}}
Zeilennummer{{GetErrorLineNumber}}
Fehlertext
{{GetErrorLine}}
\r\n{{endwhile}}
Stencilausgabe:\r\n
" - - IDS_STENCIL_UNCLOSEDBLOCK_IF "{{if}} ohne {{endif}}" - IDS_STENCIL_UNCLOSEDBLOCK_ELSE "{{else}} ohne {{endif}}" - IDS_STENCIL_UNCLOSEDBLOCK_WHILE "{{while}} ohne {{endwhile}}" - IDS_STENCIL_UNOPENEDBLOCK_ENDWHILE "{{endwhile}} ohne {{while}}" - IDS_STENCIL_UNOPENEDBLOCK_ELSE "{{else}} ohne {{if}}" - IDS_STENCIL_UNOPENEDBLOCK_ENDIF "{{endif}} ohne {{if}} oder {{else}}" - - IDS_STENCIL_INVALID_HANDLER "Ungültiges Handlertag" - IDS_STENCIL_NULLPARAM "NULL-Parameter für ParseReplacements" - IDS_STENCIL_INVALIDSTRING "An ParseReplacements wurde eine leere oder negative Zeichenfolge übergeben" - IDS_STENCIL_EMBEDDED_NULL "Eingebettetes Nullzeichen in Stencil" - IDS_STENCIL_UNMATCHED_TAG_START "Unterschiedlich {{" - IDS_STENCIL_MISMATCHED_TAG_START "Nicht übereinstimmend {{" - IDS_STENCIL_BAD_PARAMETER "Ungültiger Parameter" - IDS_STENCIL_METHODNAME_TOO_LONG "Methodenname zu lang" - IDS_STENCIL_HANDLERNAME_TOO_LONG "Handlername zu lang" - IDS_STENCIL_INVALID_SUBHANDLER "Ungültiges Unterhandlertag" - IDS_STENCIL_UNRESOLVED_REPLACEMENT "Nicht aufgelöste Ersetzung : '%s'" - - IDS_STENCIL_INCLUDE_ERROR "Die einbezogene Datei konnte nicht geöffnet werden" - IDS_STENCIL_INCLUDE_INVALID "Die einbezogene Datei ist keine Datenträgerdatei" - - IDS_STENCIL_MLANG_COCREATE "CMultiLanguage konnte nicht erstellt werden" - IDS_STENCIL_MLANG_LCID "Beim Abfragen der lcid ist ein Fehler aufgetreten" - IDS_STENCIL_MLANG_GETLOCALE "GetLocaleInfo fehlgeschlagen" - IDS_STENCIL_MLANG_GETCHARSET "GetCharsetInfo fehlgeschlagen" - - IDS_STENCIL_OUTOFMEMORY "Nicht genügend Speicher verfügbar" - IDS_STENCIL_UNEXPECTED "Unerwarteter Fehler" -END - -#endif diff --git a/include/atl/l.esp/atlsrv.rc b/include/atl/l.esp/atlsrv.rc deleted file mode 100644 index 15bf88daa..000000000 --- a/include/atl/l.esp/atlsrv.rc +++ /dev/null @@ -1,146 +0,0 @@ -// This is a part of the Active Template Library. -// Copyright (C) Microsoft Corporation -// All rights reserved. -// -// This source code is only intended as a supplement to the -// Active Template Library Reference and related -// electronic documentation provided with the library. -// See these sources for detailed information regarding the -// Active Template Library product. - -#include -#include "atlsrvres.h" - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ATLSRV_BAD_REQUEST "Solicitud incorrectaSolicitud incorrecta" - IDS_ATLSRV_AUTH_REQUIRED - "Autorización requeridaSe necesita autorización" - IDS_ATLSRV_FORBIDDEN "ProhibidoProhibido" - IDS_ATLSRV_NOT_FOUND "No se encontróNo se encontró" - IDS_ATLSRV_SERVER_ERROR "Error del servidorError del servidor" - IDS_ATLSRV_NOT_IMPLEMENTED - "No implementadoNo implementado" - IDS_ATLSRV_BAD_GATEWAY "Puerta de enlace no válidaPuerta de enlace no válida" - IDS_ATLSRV_SERVICE_NOT_AVAILABLE - "Servicio no disponibleServicio no disponible" - IDS_ATLSRV_SERVER_ERROR_BADSRF "Error del servidor

Error del servidor

No se puede cargar el archivo SRF." - IDS_ATLSRV_SERVER_ERROR_HNDLFAIL "Error del servidor

Error del servidor

El archivo SRF solicitado se cargó pero no se pudo procesar correctamente." - IDS_ATLSRV_SERVER_ERROR_SYSOBJFAIL "Error del servidor

Error del servidor

No se puede crear un objeto del sistema Windows." - IDS_ATLSRV_SERVER_ERROR_READFILEFAIL "Error del servidor

Error del servidor

Error en la operación de lectura de archivo." - IDS_ATLSRV_SERVER_ERROR_LOADFILEFAIL "Error en el servidor

Error en el servidor

No se puede abrir el archivo especificado." - IDS_ATLSRV_SERVER_ERROR_LOADLIB "Error del servidor

Error del servidor

Error de LoadLibrary." - IDS_ATLSRV_SERVER_ERROR_HANDLERIF "Error del servidor

Error del servidor

Error al recuperar la interfaz del controlador de solicitudes." - IDS_ATLSRV_SERVER_ERROR_OUTOFMEM "Error del servidor

Error del servidor

El servidor no tiene suficiente memoria." - IDS_ATLSRV_SERVER_ERROR_UNEXPECTED "Error del servidor

Error del servidor

El servidor detectó un error inesperado." - IDS_ATLSRV_SERVER_ERROR_STENCILPARSEFAIL "Error del servidor

Error del servidor

El servidor detectó un error inesperado al intentar analizar el cliché solicitado." - IDS_ATLSRV_SERVER_ERROR_STENCILLOADFAIL "Error del servidor

Error del servidor

Error del servidor al cargar el cliché solicitado. Es posible que el archivo de cliché esté dañado o no se encuentre en este servidor Web." - IDS_ATLSRV_SERVER_ERROR_HANDLERNOTFOUND "Error del servidor

Error del servidor

No se encontró uno de los controladores nombrado en una etiqueta de controlador para el cliché solicitado en el archivo DLL del controlador especificado." - IDS_ATLSRV_SERVER_ERROR_BADHANDLERTAG "Error del servidor

Error del servidor

Este cliché contiene una etiqueta de controlador que el procesador de cliché no puede analizar correctamente o bien no contiene ninguna etiqueta de controlador. Compruebe que la sintaxis del cliché solicitado sea correcta." - IDS_ATLSRV_SERVER_ERROR_NOHANDLERTAG "Error del servidor

Error del servidor

El cliché solicitado no contiene una etiqueta de controlador." - IDS_ATLSRV_SERVER_ERROR_LONGMETHODNAME "Error del servidor

Error del servidor

Se encontró una etiqueta de reemplazo en el cliché solicitado con un nombre de reemplazo demasiado largo. La longitud máxima del nombre de reemplazo debe ser inferior o igual a la constante ATL_MAX_METHOD_NAME definida en atlstencil.h" - IDS_ATLSRV_SERVER_ERROR_LONGHANDLERNAME "Error del servidor

Error del servidor

Se encontró una etiqueta de reemplazo que utiliza la sintaxis id.tagname en el cliché seleccionado con un nombre de controlador demasiado largo. La longitud máxima del nombre del controlador debe ser inferior o igual a la constante ATL_MAX_METHOD_NAME definida en atlstencil.h" - IDS_ATLSRV_SERVER_ERROR_IMPERSONATIONFAILED "Error del servidor

Error del servidor

Error al intentar identificar al cliente que realiza la solicitud." - IDS_ATLSRV_SERVER_ERROR_ISAPISTARTUPFAILED "Error del servidor

Error del servidor

Error desconocido de la extensión ISAPI utilizada para dar servicio a esta solicitud al realizar la carga." - IDS_ATLSRV_SERVER_ERROR_SOAPNOSOAPACTION "Server Error

Server Error

SOAP request did not provide SOAPACTION header." - - IDS_ATLSRV_CRITICAL_HEAPCREATEFAILED "Error al crear el montón de solicitudes" - IDS_ATLSRV_CRITICAL_WORKERINITFAILED "Error al inicializar el subproceso de trabajo" - IDS_ATLSRV_CRITICAL_CRITSECINITFAILED "Error al inicializar la sección crítica" - IDS_ATLSRV_CRITICAL_THREADPOOLFAILED "Error al inicializar el grupo de subprocesos" - IDS_ATLSRV_CRITICAL_DLLCACHEFAILED "Error al inicializar la caché de archivos DLL" - IDS_ATLSRV_CRITICAL_PAGECACHEFAILED "Error al inicializar la caché de páginas" - IDS_ATLSRV_CRITICAL_STENCILCACHEFAILED "Error al inicializar la caché de clichés" - IDS_ATLSRV_CRITICAL_SESSIONSTATEFAILED "Error al inicializar el servicio de estado de sesión" - IDS_ATLSRV_CRITICAL_BLOBCACHEFAILED "Error al inicializar la caché de objetos binarios" - IDS_ATLSRV_CRITICAL_FILECACHEFAILED "Error al inicializar la caché de archivos" - - IDS_PERFMON_CACHE "Servidor ATL:caché" - IDS_PERFMON_CACHE_HELP "Información sobre la caché del servidor ATL" - IDS_PERFMON_HITCOUNT "Recuento de visitas de caché" - IDS_PERFMON_HITCOUNT_HELP "Número de visitas de caché" - IDS_PERFMON_MISSCOUNT "Recuento de errores de caché" - IDS_PERFMON_MISSCOUNT_HELP "Número de errores de caché" - IDS_PERFMON_CURRENTALLOCATIONS "Asignaciones actuales de caché" - IDS_PERFMON_CURRENTALLOCATIONS_HELP "Memoria actual asignada a caché" - IDS_PERFMON_MAXALLOCATIONS "Asignaciones máximas de caché" - IDS_PERFMON_MAXALLOCATIONS_HELP "Memoria máxima asignada a caché" - IDS_PERFMON_CURRENTENTRIES "Entradas actuales de caché" - IDS_PERFMON_CURRENTENTRIES_HELP "Número actual de entradas de caché" - IDS_PERFMON_MAXENTRIES "Entradas máximas de caché" - IDS_PERFMON_MAXENTRIES_HELP "Número máximo de entradas de caché" - IDS_PERFMON_HITCOUNTRATE "Velocidad de recuento de visitas de caché" - IDS_PERFMON_HITCOUNTRATE_HELP "Número de recuentos de visitas por segundo" - IDS_PERFMON_REQUEST "Servidor ATL:solicitud" - IDS_PERFMON_REQUEST_HELP "Estadísticas de las solicitudes que entran en el servidor" - IDS_PERFMON_REQUEST_TOTAL "Solicitudes totales del servidor" - IDS_PERFMON_REQUEST_TOTAL_HELP "Número total de solicitudes" - IDS_PERFMON_REQUEST_FAILED "Solicitudes no procesadas del servidor" - IDS_PERFMON_REQUEST_FAILED_HELP "Número de solitudes no procesadas" - IDS_PERFMON_REQUEST_RATE "Solicitudes del servidor /seg" - IDS_PERFMON_REQUEST_RATE_HELP "Número de solicitudes por segundo" - IDS_PERFMON_REQUEST_AVG_RESPONSE_TIME "Tiempo medio de respuesta" - IDS_PERFMON_REQUEST_AVG_RESPONSE_TIME_HELP "Tiempo medio empleado en administrar una solicitud" - IDS_PERFMON_REQUEST_CURR_WAITING "Solicitudes en cola actuales" - IDS_PERFMON_REQUEST_CURR_WAITING_HELP "Número actual de solicitudes en espera de administración" - IDS_PERFMON_REQUEST_MAX_WAITING "Solicitudes máximas en cola" - IDS_PERFMON_REQUEST_MAX_WAITING_HELP "Número máximo de solicitudes en espera de administración" - IDS_PERFMON_REQUEST_ACTIVE_THREADS "Subprocesos activos" - IDS_PERFMON_REQUEST_ACTIVE_THREADS_HELP "Número de subprocesos que administran solicitudes activamente" -END - - -#ifndef ATL_NO_DEFAULT_STENCIL_RESOURCE -dllmgr.srf HTML "res\\dllmgr.srf" -stencilmgr.srf HTML "res\\stencilmgr.srf" -threadmgr.srf HTML "res\\threadmgr.srf" -#endif - - -// -// Stencil parse error support -// -#ifdef ATL_DEBUG_STENCILS - -STRINGTABLE DISCARDABLE -BEGIN - IDS_STENCIL_ERROR_STENCIL -"{{codepage 0}}

Errores al analizar un archivo de clichés:

\r\n{{while GetNextError}}\r\n\r\n\r\n\r\n
Tipo de error{{GetErrorText}}
Número de línea{{GetErrorLineNumber}}
Texto del error
{{GetErrorLine}}
\r\n{{endwhile}}
Resultados de cliché:\r\n
" - - IDS_STENCIL_UNCLOSEDBLOCK_IF "{{if}} sin {{endif}}" - IDS_STENCIL_UNCLOSEDBLOCK_ELSE "{{else}} sin {{endif}}" - IDS_STENCIL_UNCLOSEDBLOCK_WHILE "{{while}} sin {{endwhile}}" - IDS_STENCIL_UNOPENEDBLOCK_ENDWHILE "{{endwhile}} sin {{while}}" - IDS_STENCIL_UNOPENEDBLOCK_ELSE "{{else}} sin {{if}}" - IDS_STENCIL_UNOPENEDBLOCK_ENDIF "{{endif}} sin {{if}} o {{else}}" - - IDS_STENCIL_INVALID_HANDLER "Etiqueta de controlador no válida" - IDS_STENCIL_NULLPARAM "Parámetro NULL para ParseReplacements" - IDS_STENCIL_INVALIDSTRING "Se pasó una cadena vacía o negativa a ParseReplacements" - IDS_STENCIL_EMBEDDED_NULL "Carácter null incrustado en el cliché" - IDS_STENCIL_UNMATCHED_TAG_START "Las llaves {{ no coinciden" - IDS_STENCIL_MISMATCHED_TAG_START "Diferente número de llaves {{" - IDS_STENCIL_BAD_PARAMETER "Parámetro erróneo" - IDS_STENCIL_METHODNAME_TOO_LONG "Nombre de método demasiado largo" - IDS_STENCIL_HANDLERNAME_TOO_LONG "Nombre de controlador demasiado largo" - IDS_STENCIL_INVALID_SUBHANDLER "Etiqueta de controlador secundario no válida" - IDS_STENCIL_UNRESOLVED_REPLACEMENT "Reemplazo no resuelto: '%s'" - - IDS_STENCIL_INCLUDE_ERROR "No se puede abrir el archivo incluido" - IDS_STENCIL_INCLUDE_INVALID "El archivo incluido no es un archivo de disco" - - IDS_STENCIL_MLANG_COCREATE "No se puede crear CMultiLanguage" - IDS_STENCIL_MLANG_LCID "Error al obtener el identificador LCID" - IDS_STENCIL_MLANG_GETLOCALE "Error en GetLocaleInfo" - IDS_STENCIL_MLANG_GETCHARSET "Error en GetCharsetInfo" - - IDS_STENCIL_OUTOFMEMORY "Memoria insuficiente" - IDS_STENCIL_UNEXPECTED "Error inesperado" -END - -#endif diff --git a/include/atl/l.fra/atlsrv.rc b/include/atl/l.fra/atlsrv.rc deleted file mode 100644 index dc26cb83a..000000000 --- a/include/atl/l.fra/atlsrv.rc +++ /dev/null @@ -1,146 +0,0 @@ -// This is a part of the Active Template Library. -// Copyright (C) Microsoft Corporation -// All rights reserved. -// -// This source code is only intended as a supplement to the -// Active Template Library Reference and related -// electronic documentation provided with the library. -// See these sources for detailed information regarding the -// Active Template Library product. - -#include -#include "atlsrvres.h" - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ATLSRV_BAD_REQUEST "Demande incorrecteDemande incorrecte" - IDS_ATLSRV_AUTH_REQUIRED - "Autorisation requiseUne autorisation est requise" - IDS_ATLSRV_FORBIDDEN "InterditInterdit" - IDS_ATLSRV_NOT_FOUND "IntrouvableIntrouvable" - IDS_ATLSRV_SERVER_ERROR "Erreur serveurErreur serveur" - IDS_ATLSRV_NOT_IMPLEMENTED - "Non implémentéNon implémenté" - IDS_ATLSRV_BAD_GATEWAY "Passerelle incorrectePasserelle incorrecte" - IDS_ATLSRV_SERVICE_NOT_AVAILABLE - "Service non disponibleService non disponible" - IDS_ATLSRV_SERVER_ERROR_BADSRF "Erreur serveur

Erreur serveur

Impossible de charger le fichier SRF." - IDS_ATLSRV_SERVER_ERROR_HNDLFAIL "Erreur serveur

Erreur serveur

Le fichier SRF requis a été chargé mais n'a pas pu être traité correctement." - IDS_ATLSRV_SERVER_ERROR_SYSOBJFAIL "Erreur serveur

Erreur serveur

Un objet système Windows n'a pas pu être créé." - IDS_ATLSRV_SERVER_ERROR_READFILEFAIL "Erreur serveur

Erreur serveur

Une opération de lecture de fichier a échoué." - IDS_ATLSRV_SERVER_ERROR_LOADFILEFAIL "Erreur serveur

Erreur serveur

Le fichier spécifié n'a pas pu être ouvert." - IDS_ATLSRV_SERVER_ERROR_LOADLIB "Erreur serveur

Erreur serveur

Échec de LoadLibrary." - IDS_ATLSRV_SERVER_ERROR_HANDLERIF "Erreur serveur

Erreur serveur

Échec de la récupération de l'interface du gestionnaire des demandes." - IDS_ATLSRV_SERVER_ERROR_OUTOFMEM "Erreur serveur

Erreur serveur

La mémoire du serveur est saturée." - IDS_ATLSRV_SERVER_ERROR_UNEXPECTED "Erreur serveur

Erreur serveur

Le serveur a rencontré une erreur inattendue." - IDS_ATLSRV_SERVER_ERROR_STENCILPARSEFAIL "Erreur serveur

Erreur serveur

Le serveur a rencontré une erreur inattendue lors de l'analyse du stencil requis." - IDS_ATLSRV_SERVER_ERROR_STENCILLOADFAIL "Erreur serveur

Erreur serveur

Le serveur n'a pas pu charger le stencil requis. Le fichier stencil est peut-être endommagé ou manquant sur ce serveur Web." - IDS_ATLSRV_SERVER_ERROR_HANDLERNOTFOUND "Erreur serveur

Erreur serveur

Un gestionnaire spécifié dans une balise de gestionnaire pour le stencil requis n'a pas pu être trouvé dans le fichier .dll de gestionnaire spécifié." - IDS_ATLSRV_SERVER_ERROR_BADHANDLERTAG "Erreur serveur

Erreur serveur

Soit ce stencil contient une balise de gestionnaire qui n'a pas pu être analysée correctement par le processeur de stencil, soit il ne contient aucune balise de gestionnaire. Vérifiez la syntaxe correcte à utiliser pour le stencil requis." - IDS_ATLSRV_SERVER_ERROR_NOHANDLERTAG "Erreur serveur

Erreur serveur

Le stencil requis ne contient aucune balise de gestionnaire." - IDS_ATLSRV_SERVER_ERROR_LONGMETHODNAME "Erreur serveur

Erreur serveur

Le stencil requis contient une balise de remplacement dans laquelle un nom de remplacement est trop long. La longueur maximale du nom de remplacement doit être inférieure ou égale à la valeur de la constante ATL_MAX_METHOD_NAME définie dans atlstencil.h" - IDS_ATLSRV_SERVER_ERROR_LONGHANDLERNAME "Erreur serveur

Erreur serveur

Le stencil requis contient une balise de remplacement, utilisant la syntaxe id.nombalise, dans laquelle un nom de gestionnaire est trop long. La longueur maximale du nom d'un gestionnaire doit être inférieure ou égale à la valeur de la constante ATL_MAX_METHOD_NAME définie dans atlstencil.h" - IDS_ATLSRV_SERVER_ERROR_IMPERSONATIONFAILED "Erreur serveur

Erreur serveur

Impossible d'emprunter l'identité du client qui a émis la demande." - IDS_ATLSRV_SERVER_ERROR_ISAPISTARTUPFAILED "Erreur serveur

Erreur serveur

L'extension ISAPI utilisée pour traiter cette demande n'a pas pu être chargée en raison d'une erreur inconnue." - IDS_ATLSRV_SERVER_ERROR_SOAPNOSOAPACTION "Server Error

Server Error

SOAP request did not provide SOAPACTION header." - - IDS_ATLSRV_CRITICAL_HEAPCREATEFAILED "Échec de la création du segment de mémoire demandée" - IDS_ATLSRV_CRITICAL_WORKERINITFAILED "Échec de l'initialisation de la thread de traitement" - IDS_ATLSRV_CRITICAL_CRITSECINITFAILED "Échec de l'initialisation de la section critique" - IDS_ATLSRV_CRITICAL_THREADPOOLFAILED "Échec de l'initialisation du pool de threads" - IDS_ATLSRV_CRITICAL_DLLCACHEFAILED "Échec de l'initialisation du cache de DLL" - IDS_ATLSRV_CRITICAL_PAGECACHEFAILED "Échec de l'initialisation du cache de page" - IDS_ATLSRV_CRITICAL_STENCILCACHEFAILED "Échec de l'initialisation du cache du stencil" - IDS_ATLSRV_CRITICAL_SESSIONSTATEFAILED "Échec de l'initialisation du service d'état de session" - IDS_ATLSRV_CRITICAL_BLOBCACHEFAILED "Échec de l'initialisation du cache BLOB" - IDS_ATLSRV_CRITICAL_FILECACHEFAILED "Échec de l'initialisation du cache du fichier" - - IDS_PERFMON_CACHE "Serveur ATL : Cache" - IDS_PERFMON_CACHE_HELP "Information sur le cache du serveur ATL" - IDS_PERFMON_HITCOUNT "Accès cache avec résultat" - IDS_PERFMON_HITCOUNT_HELP "Nombre des accès cache avec résultat" - IDS_PERFMON_MISSCOUNT "Accès cache sans résultat" - IDS_PERFMON_MISSCOUNT_HELP "Nombre des accès cache sans résultat" - IDS_PERFMON_CURRENTALLOCATIONS "Allocations cache actuelles" - IDS_PERFMON_CURRENTALLOCATIONS_HELP "Mémoire actuellement allouée au cache" - IDS_PERFMON_MAXALLOCATIONS "Allocations cache maximales" - IDS_PERFMON_MAXALLOCATIONS_HELP "Mémoire maximale allouée au cache" - IDS_PERFMON_CURRENTENTRIES "Entrées cache actuelles" - IDS_PERFMON_CURRENTENTRIES_HELP "Nombre actuel d'entrées du cache" - IDS_PERFMON_MAXENTRIES "Entrées cache maximales" - IDS_PERFMON_MAXENTRIES_HELP "Nombre maximal d'entrées du cache" - IDS_PERFMON_HITCOUNTRATE "Taux d'accès au cache" - IDS_PERFMON_HITCOUNTRATE_HELP "Nombre d'accès par seconde" - IDS_PERFMON_REQUEST "Serveur ATL : Demande" - IDS_PERFMON_REQUEST_HELP "Statistiques sur les demandes serveur entrantes" - IDS_PERFMON_REQUEST_TOTAL "Total des demandes serveur" - IDS_PERFMON_REQUEST_TOTAL_HELP "Nombre total des demandes" - IDS_PERFMON_REQUEST_FAILED "Demandes serveur échouées" - IDS_PERFMON_REQUEST_FAILED_HELP "Nombre de demandes ayant échoué" - IDS_PERFMON_REQUEST_RATE "Demandes serveur/s" - IDS_PERFMON_REQUEST_RATE_HELP "Nombre de demandes par seconde" - IDS_PERFMON_REQUEST_AVG_RESPONSE_TIME "Temps de réponse moyen" - IDS_PERFMON_REQUEST_AVG_RESPONSE_TIME_HELP "Durée moyenne du traitement d'une demande" - IDS_PERFMON_REQUEST_CURR_WAITING "Demandes actuelles en attente" - IDS_PERFMON_REQUEST_CURR_WAITING_HELP "Nombre de demandes actuellement en attente d'être traitées" - IDS_PERFMON_REQUEST_MAX_WAITING "Demandes maximales en attente" - IDS_PERFMON_REQUEST_MAX_WAITING_HELP "Nombre maximal de demandes en attente d'être traitées" - IDS_PERFMON_REQUEST_ACTIVE_THREADS "Threads actives" - IDS_PERFMON_REQUEST_ACTIVE_THREADS_HELP "Nombre de threads qui traitent activement des demandes" -END - - -#ifndef ATL_NO_DEFAULT_STENCIL_RESOURCE -dllmgr.srf HTML "res\\dllmgr.srf" -stencilmgr.srf HTML "res\\stencilmgr.srf" -threadmgr.srf HTML "res\\threadmgr.srf" -#endif - - -// -// Stencil parse error support -// -#ifdef ATL_DEBUG_STENCILS - -STRINGTABLE DISCARDABLE -BEGIN - IDS_STENCIL_ERROR_STENCIL -"{{codepage 0}}

Lors de la tentative d'analyse d'un fichier stencil, les erreurs suivantes se sont produites :

\r\n{{while GetNextError}}\r\n\r\n\r\n\r\n
Type d'erreur{{GetErrorText}}
Numéro de ligne{{GetErrorLineNumber}}
Texte de l'erreur
{{GetErrorLine}}
\r\n{{endwhile}}
La sortie du stencil est la suivante :\r\n
" - - IDS_STENCIL_UNCLOSEDBLOCK_IF "{{if}} sans {{endif}}" - IDS_STENCIL_UNCLOSEDBLOCK_ELSE "{{else}} sans {{endif}}" - IDS_STENCIL_UNCLOSEDBLOCK_WHILE "{{while}} sans {{endwhile}}" - IDS_STENCIL_UNOPENEDBLOCK_ENDWHILE "{{endwhile}} sans {{while}}" - IDS_STENCIL_UNOPENEDBLOCK_ELSE "{{else}} sans {{if}}" - IDS_STENCIL_UNOPENEDBLOCK_ENDIF "{{endif}} sans {{if}} ou {{else}}" - - IDS_STENCIL_INVALID_HANDLER "Balise de gestionnaire non valide" - IDS_STENCIL_NULLPARAM "Paramètre NULL à ParseReplacements" - IDS_STENCIL_INVALIDSTRING "Chaîne vide ou négative passée à ParseReplacements" - IDS_STENCIL_EMBEDDED_NULL "Caractère null incorporé dans le stencil" - IDS_STENCIL_UNMATCHED_TAG_START "{{ non apparié" - IDS_STENCIL_MISMATCHED_TAG_START "{{ incompatible" - IDS_STENCIL_BAD_PARAMETER "Paramètre incorrect" - IDS_STENCIL_METHODNAME_TOO_LONG "Nom de méthode trop long" - IDS_STENCIL_HANDLERNAME_TOO_LONG "Nom de gestionnaire trop long" - IDS_STENCIL_INVALID_SUBHANDLER "Balise de sous-gestionnaire non valide" - IDS_STENCIL_UNRESOLVED_REPLACEMENT "Remplacement non résolu : '%s'" - - IDS_STENCIL_INCLUDE_ERROR "Impossible d'ouvrir le fichier inclus" - IDS_STENCIL_INCLUDE_INVALID "Le fichier inclus n'est pas un fichier disque" - - IDS_STENCIL_MLANG_COCREATE "Impossible de créer CMultiLanguage" - IDS_STENCIL_MLANG_LCID "Erreur lors de l'obtention du lcid" - IDS_STENCIL_MLANG_GETLOCALE "Échec de GetLocaleInfo" - IDS_STENCIL_MLANG_GETCHARSET "Échec de GetCharsetInfo" - - IDS_STENCIL_OUTOFMEMORY "Mémoire insuffisante" - IDS_STENCIL_UNEXPECTED "Erreur inattendue" -END - -#endif diff --git a/include/atl/l.ita/atlsrv.rc b/include/atl/l.ita/atlsrv.rc deleted file mode 100644 index 009e0b2db..000000000 --- a/include/atl/l.ita/atlsrv.rc +++ /dev/null @@ -1,146 +0,0 @@ -// This is a part of the Active Template Library. -// Copyright (C) Microsoft Corporation -// All rights reserved. -// -// This source code is only intended as a supplement to the -// Active Template Library Reference and related -// electronic documentation provided with the library. -// See these sources for detailed information regarding the -// Active Template Library product. - -#include -#include "atlsrvres.h" - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ATLSRV_BAD_REQUEST "Richiesta non validaRichiesta non valida" - IDS_ATLSRV_AUTH_REQUIRED - "Autorizzazione richiestaAutorizzazione richiesta" - IDS_ATLSRV_FORBIDDEN "Non consentitoNon consentito" - IDS_ATLSRV_NOT_FOUND "Non trovatoNon trovato" - IDS_ATLSRV_SERVER_ERROR "Errore del serverErrore del server" - IDS_ATLSRV_NOT_IMPLEMENTED - "Non implementatoNon implementato" - IDS_ATLSRV_BAD_GATEWAY "Gateway non validoGateway non valido" - IDS_ATLSRV_SERVICE_NOT_AVAILABLE - "Servizio non disponibileServizio non disponibile" - IDS_ATLSRV_SERVER_ERROR_BADSRF "Errore del server

Errore del server

Impossibile caricare il file SRF." - IDS_ATLSRV_SERVER_ERROR_HNDLFAIL "Errore del server

Errore del server

Il file SRF richiesto è stato caricato ma non elaborato correttamente." - IDS_ATLSRV_SERVER_ERROR_SYSOBJFAIL "Errore del server

Errore del server

Impossibile creare un oggetto di sistema Windows." - IDS_ATLSRV_SERVER_ERROR_READFILEFAIL "Errore del server

Errore del server

Operazione di lettura file non riuscita." - IDS_ATLSRV_SERVER_ERROR_LOADFILEFAIL "Errore del server

Errore del server

Impossibile aprire il file specificato." - IDS_ATLSRV_SERVER_ERROR_LOADLIB "Errore del server

Errore del server

LoadLibrary non riuscito." - IDS_ATLSRV_SERVER_ERROR_HANDLERIF "Errore del server

Errore del server

Impossibile recuperare l'interfaccia del gestore delle richieste." - IDS_ATLSRV_SERVER_ERROR_OUTOFMEM "Errore del server

Errore del server

Memoria del server esaurita." - IDS_ATLSRV_SERVER_ERROR_UNEXPECTED "Errore del server

Errore del server

Errore imprevisto del server." - IDS_ATLSRV_SERVER_ERROR_STENCILPARSEFAIL "Errore del server

Errore del server

Errore imprevisto del server durante il tentativo di analizzare il file SRF richiesto." - IDS_ATLSRV_SERVER_ERROR_STENCILLOADFAIL "Errore del server

Errore del server

Impossibile caricare il file SRF richiesto. Il file potrebbe essere danneggiato o mancante sul server Web." - IDS_ATLSRV_SERVER_ERROR_HANDLERNOTFOUND "Errore del server

Errore del server

Impossibile trovare nella DLL del gestore specificata uno dei gestori denominati in un tag di gestione per il file SRF richiesto." - IDS_ATLSRV_SERVER_ERROR_BADHANDLERTAG "Errore del server

Errore del server

Questo file SRF contiene un tag di gestione che non può essere analizzato correttamente dal processore dei file SRF o non contiene affatto un tag di gestione. Cercare nel file SRF richiesto la sintassi appropriata." - IDS_ATLSRV_SERVER_ERROR_NOHANDLERTAG "Errore del server

Errore del server

Il file SRF richiesto non contiene un tag di gestione." - IDS_ATLSRV_SERVER_ERROR_LONGMETHODNAME "Errore del server

Errore del server

Rilevato un tag di sostituzione nel file SRF richiesto con un nome di sostituzione troppo lungo. Il nome di sostituzione deve contenere un numero di caratteri inferiore o uguale alla costante ATL_MAX_METHOD_NAME definita in atlstencil.h" - IDS_ATLSRV_SERVER_ERROR_LONGHANDLERNAME "Errore del server

Errore del server

Rilevato nel file SRF richiesto un tag di sostituzione che utilizza la sintassi id.tagname con un nome di gestore troppo lungo. Un nome di gestore deve contenere un numero di caratteri inferiore o uguale alla costante ATL_MAX_METHOD_NAME definita in atlstencil.h" - IDS_ATLSRV_SERVER_ERROR_IMPERSONATIONFAILED "Errore del server

Errore del server

Tentativo di rappresentare il client eseguendo la richiesta non riuscito." - IDS_ATLSRV_SERVER_ERROR_ISAPISTARTUPFAILED "Errore del server

Errore del server

L'estensione ISAPI utilizzata per soddisfare questa richiesta non è riuscita a eseguire il caricamento correttamente. Errore sconosciuto." - IDS_ATLSRV_SERVER_ERROR_SOAPNOSOAPACTION "Server Error

Server Error

SOAP request did not provide SOAPACTION header." - - IDS_ATLSRV_CRITICAL_HEAPCREATEFAILED "Creazione heap richiesta non riuscita" - IDS_ATLSRV_CRITICAL_WORKERINITFAILED "Inizializzazione thread di lavoro non riuscita" - IDS_ATLSRV_CRITICAL_CRITSECINITFAILED "Inizializzazione sezione critica non riuscita" - IDS_ATLSRV_CRITICAL_THREADPOOLFAILED "Inizializzazione pool di thread non riuscita" - IDS_ATLSRV_CRITICAL_DLLCACHEFAILED "Inizializzazione cache DLL non riuscita" - IDS_ATLSRV_CRITICAL_PAGECACHEFAILED "Inizializzazione cache pagina non riuscita" - IDS_ATLSRV_CRITICAL_STENCILCACHEFAILED "Inizializzazione cache file SRF non riuscita" - IDS_ATLSRV_CRITICAL_SESSIONSTATEFAILED "Inizializzazione servizio di stato sessione non riuscita" - IDS_ATLSRV_CRITICAL_BLOBCACHEFAILED "Inizializzazione cache dati BLOB non riuscita" - IDS_ATLSRV_CRITICAL_FILECACHEFAILED "Inizializzazione cache file non riuscita" - - IDS_PERFMON_CACHE "Server ATL:Cache" - IDS_PERFMON_CACHE_HELP "Informazioni sulla cache del server ATL" - IDS_PERFMON_HITCOUNT "Passaggi cache" - IDS_PERFMON_HITCOUNT_HELP "Numero di riscontri cache" - IDS_PERFMON_MISSCOUNT "Conteggio mancati riscontri cache" - IDS_PERFMON_MISSCOUNT_HELP "Numero di mancati riscontri cache" - IDS_PERFMON_CURRENTALLOCATIONS "Allocazioni correnti cache" - IDS_PERFMON_CURRENTALLOCATIONS_HELP "Memoria corrente allocata per la cache" - IDS_PERFMON_MAXALLOCATIONS "Numero massimo allocazioni cache" - IDS_PERFMON_MAXALLOCATIONS_HELP "Quantità massima di memoria allocata per la cache" - IDS_PERFMON_CURRENTENTRIES "Voci correnti cache" - IDS_PERFMON_CURRENTENTRIES_HELP "Numero corrente di voci della cache" - IDS_PERFMON_MAXENTRIES "Numero massimo voci cache" - IDS_PERFMON_MAXENTRIES_HELP "Numero massimo di voci della cache" - IDS_PERFMON_HITCOUNTRATE "Frequenza passaggi cache" - IDS_PERFMON_HITCOUNTRATE_HELP "Numero di passaggi al secondo" - IDS_PERFMON_REQUEST "Server ATL:Richiesta" - IDS_PERFMON_REQUEST_HELP "Statistica sulle richieste pervenute al server" - IDS_PERFMON_REQUEST_TOTAL "Richieste totali al server" - IDS_PERFMON_REQUEST_TOTAL_HELP "Numero totale di richieste" - IDS_PERFMON_REQUEST_FAILED "Richieste al server non riuscite" - IDS_PERFMON_REQUEST_FAILED_HELP "Numero di richieste non riuscite" - IDS_PERFMON_REQUEST_RATE "Richieste al server /sec" - IDS_PERFMON_REQUEST_RATE_HELP "Numero di richieste al secondo" - IDS_PERFMON_REQUEST_AVG_RESPONSE_TIME "Tempo medio di risposta" - IDS_PERFMON_REQUEST_AVG_RESPONSE_TIME_HELP "Tempo medio impiegato per la gestione di una richiesta" - IDS_PERFMON_REQUEST_CURR_WAITING "Richieste correnti in coda" - IDS_PERFMON_REQUEST_CURR_WAITING_HELP "Numero corrente di richieste in attesa di essere gestite" - IDS_PERFMON_REQUEST_MAX_WAITING "Numero massimo di richieste in coda" - IDS_PERFMON_REQUEST_MAX_WAITING_HELP "Numero massimo di richieste in attesa di essere gestite" - IDS_PERFMON_REQUEST_ACTIVE_THREADS "Thread attivi" - IDS_PERFMON_REQUEST_ACTIVE_THREADS_HELP "Numero di thread che gestiscono attivamente le richieste" -END - - -#ifndef ATL_NO_DEFAULT_STENCIL_RESOURCE -dllmgr.srf HTML "res\\dllmgr.srf" -stencilmgr.srf HTML "res\\stencilmgr.srf" -threadmgr.srf HTML "res\\threadmgr.srf" -#endif - - -// -// Stencil parse error support -// -#ifdef ATL_DEBUG_STENCILS - -STRINGTABLE DISCARDABLE -BEGIN - IDS_STENCIL_ERROR_STENCIL -"{{codepage 0}}

Durante l'analisi di un file SRF, si è verificato il seguente errore:

\r\n{{while GetNextError}}\r\n\r\n\r\n\r\n
Tipo di errore{{GetErrorText}}
Numero della riga{{GetErrorLineNumber}}
Testo dell'errore
{{GetErrorLine}}
\r\n{{endwhile}}
Output file SRF:\r\n
" - - IDS_STENCIL_UNCLOSEDBLOCK_IF "{{if}} senza {{endif}}" - IDS_STENCIL_UNCLOSEDBLOCK_ELSE "{{else}} senza {{endif}}" - IDS_STENCIL_UNCLOSEDBLOCK_WHILE "{{while}} senza {{endwhile}}" - IDS_STENCIL_UNOPENEDBLOCK_ENDWHILE "{{endwhile}} senza {{while}}" - IDS_STENCIL_UNOPENEDBLOCK_ELSE "{{else}} senza {{if}}" - IDS_STENCIL_UNOPENEDBLOCK_ENDIF "{{endif}} senza {{if}} o {{else}}" - - IDS_STENCIL_INVALID_HANDLER "Tag di gestione non valido" - IDS_STENCIL_NULLPARAM "Parametro NULL in ParseReplacements" - IDS_STENCIL_INVALIDSTRING "Stringa vuota o negativa passata a ParseReplacements" - IDS_STENCIL_EMBEDDED_NULL "Carattere null incorporato in file SRF" - IDS_STENCIL_UNMATCHED_TAG_START "{{ non corrispondenti" - IDS_STENCIL_MISMATCHED_TAG_START "{{ non corrispondenti" - IDS_STENCIL_BAD_PARAMETER "Parametro non valido" - IDS_STENCIL_METHODNAME_TOO_LONG "Nome metodo troppo lungo" - IDS_STENCIL_HANDLERNAME_TOO_LONG "Nome gestore troppo lungo" - IDS_STENCIL_INVALID_SUBHANDLER "Tag di gestione secondaria non valida" - IDS_STENCIL_UNRESOLVED_REPLACEMENT "Sostituzione non risolta: '%s'" - - IDS_STENCIL_INCLUDE_ERROR "Impossibile aprire il file incluso" - IDS_STENCIL_INCLUDE_INVALID "Il file incluso non è un file su disco" - - IDS_STENCIL_MLANG_COCREATE "Impossibile creare CMultiLanguage" - IDS_STENCIL_MLANG_LCID "Errore durante la ricerca di lcid" - IDS_STENCIL_MLANG_GETLOCALE "GetLocaleInfo non riuscito" - IDS_STENCIL_MLANG_GETCHARSET "GetCharsetInfo non riuscito" - - IDS_STENCIL_OUTOFMEMORY "Memoria insufficiente" - IDS_STENCIL_UNEXPECTED "Errore imprevisto" -END - -#endif diff --git a/include/atl/l.jpn/atlsrv.rc b/include/atl/l.jpn/atlsrv.rc deleted file mode 100644 index d908accdc..000000000 --- a/include/atl/l.jpn/atlsrv.rc +++ /dev/null @@ -1,146 +0,0 @@ -// This is a part of the Active Template Library. -// Copyright (C) Microsoft Corporation -// All rights reserved. -// -// This source code is only intended as a supplement to the -// Active Template Library Reference and related -// electronic documentation provided with the library. -// See these sources for detailed information regarding the -// Active Template Library product. - -#include -#include "atlsrvres.h" - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ATLSRV_BAD_REQUEST "•s“KØ‚È—v‹•s“KØ‚È—v‹" - IDS_ATLSRV_AUTH_REQUIRED - "”FØ‚ª•K—v‚Å‚·”FØ‚ª•K—v‚Å‚·" - IDS_ATLSRV_FORBIDDEN "Œ ŒÀ‚È‚µ/title></head><body>Œ ŒÀ‚È‚µ</body></html>" - IDS_ATLSRV_NOT_FOUND "<html><head><title>Œ©‚‚©‚è‚Ü‚¹‚ñŒ©‚‚©‚è‚Ü‚¹‚ñ" - IDS_ATLSRV_SERVER_ERROR "ƒT[ƒo[ ƒGƒ‰[ƒT[ƒo[ ƒGƒ‰[" - IDS_ATLSRV_NOT_IMPLEMENTED - "ŽÀ‘•‚³‚ê‚Ä‚¢‚Ü‚¹‚ñŽÀ‘•‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ" - IDS_ATLSRV_BAD_GATEWAY "•s“K؂ȃQ[ƒgƒEƒFƒC•s“K؂ȃQ[ƒgƒEƒFƒC" - IDS_ATLSRV_SERVICE_NOT_AVAILABLE - "ƒT[ƒrƒX‚ªŽg—p‚Å‚«‚Ü‚¹‚ñƒT[ƒrƒX‚ªŽg—p‚Å‚«‚Ü‚¹‚ñ" - IDS_ATLSRV_SERVER_ERROR_BADSRF "ƒT[ƒo[ ƒGƒ‰[

Server Error

SRF ƒtƒ@ƒCƒ‹‚ð“Ç‚Ýž‚ß‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ATLSRV_SERVER_ERROR_HNDLFAIL "ƒT[ƒo[ ƒGƒ‰[

ƒT[ƒo[ ƒGƒ‰[

—v‹‚³‚ꂽ SRF ƒtƒ@ƒCƒ‹‚Í“Ç‚Ýž‚ß‚Ü‚µ‚½‚ªA³í‚ɃvƒƒZƒX‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ATLSRV_SERVER_ERROR_SYSOBJFAIL "ƒT[ƒo[ ƒGƒ‰[

ƒT[ƒo[ ƒGƒ‰[

Windows ƒVƒXƒeƒ€ ƒIƒuƒWƒFƒNƒg‚ð쬂ł«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ATLSRV_SERVER_ERROR_READFILEFAIL "ƒT[ƒo[ ƒGƒ‰[

ƒT[ƒo[ ƒGƒ‰[

ƒtƒ@ƒCƒ‹‚Ì“Ç‚ÝŽæ‚葀삪‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ATLSRV_SERVER_ERROR_LOADFILEFAIL "ƒT[ƒo[ ƒGƒ‰[

ƒT[ƒo[ ƒGƒ‰[

Žw’肳‚ꂽƒtƒ@ƒCƒ‹‚ðŠJ‚­‚±‚Æ‚ª‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ATLSRV_SERVER_ERROR_LOADLIB "ƒT[ƒo[ ƒGƒ‰[

ƒT[ƒo[ ƒGƒ‰[

LoadLibrary ‚ªŽ¸”s‚µ‚Ü‚µ‚½B" - IDS_ATLSRV_SERVER_ERROR_HANDLERIF "ƒT[ƒo[ ƒGƒ‰[

ƒT[ƒo[ ƒGƒ‰[

ƒnƒ“ƒhƒ‰—v‹ ƒCƒ“ƒ^[ƒtƒFƒCƒX‚ðŽæ“¾‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ATLSRV_SERVER_ERROR_OUTOFMEM "ƒT[ƒo[ ƒGƒ‰[

ƒT[ƒo[ ƒGƒ‰[

ƒT[ƒo[‚̃ƒ‚ƒŠ‚ª•s‘«‚µ‚Ä‚¢‚Ü‚·B" - IDS_ATLSRV_SERVER_ERROR_UNEXPECTED "ƒT[ƒo[ ƒGƒ‰[

ƒT[ƒo[ ƒGƒ‰[

ƒT[ƒo[‚É—\Šú‚µ‚È‚¢ƒGƒ‰[‚ª”­¶‚µ‚Ü‚µ‚½B" - IDS_ATLSRV_SERVER_ERROR_STENCILPARSEFAIL "ƒT[ƒo[ ƒGƒ‰[

ƒT[ƒo[ ƒGƒ‰[

—v‹‚³‚ꂽƒXƒeƒ“ƒVƒ‹‚ð‰ðÍ’†‚ÉAƒT[ƒo[‚É—\Šú‚µ‚È‚¢ƒGƒ‰[‚ª”­¶‚µ‚Ü‚µ‚½B" - IDS_ATLSRV_SERVER_ERROR_STENCILLOADFAIL "ƒT[ƒo[ ƒGƒ‰[

ƒT[ƒo[ ƒGƒ‰[

ƒT[ƒo[ ‚Í—v‹‚³‚ꂽƒXƒeƒ“ƒVƒ‹‚ð“Ç‚Ýž‚ß‚Ü‚¹‚ñ‚Å‚µ‚½BƒXƒeƒ“ƒVƒ‹ ƒtƒ@ƒCƒ‹‚ª‰ó‚ê‚Ä‚¢‚é‚©A‚±‚Ì Web ƒT[ƒo[‚É‚È‚¢‰Â”\«‚ª‚ ‚è‚Ü‚·B" - IDS_ATLSRV_SERVER_ERROR_HANDLERNOTFOUND "ƒT[ƒo[ ƒGƒ‰[

ƒT[ƒo[ ƒGƒ‰[

—v‹‚³‚ꂽƒXƒeƒ“ƒVƒ‹‚̃nƒ“ƒhƒ‰ ƒ^ƒO‚Å–¼‘OŽw’肳‚ꂽƒnƒ“ƒhƒ‰‚Ì 1 ‚‚ªŽw’肳‚ꂽƒnƒ“ƒhƒ‰ .dll ‚ÉŒ©‚‚©‚è‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ATLSRV_SERVER_ERROR_BADHANDLERTAG "ƒT[ƒo[ ƒGƒ‰[

ƒT[ƒo[ ƒGƒ‰[

‚±‚̃Xƒeƒ“ƒVƒ‹‚ÍAƒXƒeƒ“ƒVƒ‹ ƒvƒƒZƒbƒT‚É‚æ‚Á‚Ä“K؂ɉðÍ‚Å‚«‚È‚¢ƒnƒ“ƒhƒ‰ ƒ^ƒO‚ðŠÜ‚ñ‚Å‚¢‚é‚©A‚Ü‚½‚̓nƒ“ƒhƒ‰ ƒ^ƒO‚ð‰½‚àŽ‚Á‚Ä‚¢‚Ü‚¹‚ñB—v‹‚µ‚½ƒXƒeƒ“ƒVƒ‹‚̃Xƒeƒ“ƒVƒ‹\•¶‚ª“KØ‚Å‚ ‚é‚©‚Ç‚¤‚©’m‚ç‚ׂĂ­‚¾‚³‚¢B" - IDS_ATLSRV_SERVER_ERROR_NOHANDLERTAG "ƒT[ƒo[ ƒGƒ‰[

ƒT[ƒo[ ƒGƒ‰[

—v‹‚³‚ꂽƒXƒeƒ“ƒVƒ‹‚̓nƒ“ƒhƒ‰ ƒ^ƒO‚ðŽ‚Á‚Ä‚¢‚Ü‚¹‚ñB" - IDS_ATLSRV_SERVER_ERROR_LONGMETHODNAME "ƒT[ƒo[ ƒGƒ‰[

ƒT[ƒo[ ƒGƒ‰[

—v‹‚³‚ꂽƒXƒeƒ“ƒVƒ‹‚Å’uŠ·ƒ^ƒO‚ªŒ©‚‚©‚è‚Ü‚µ‚½‚ªA’uŠ·–¼‚ª’·‚·‚¬‚Ü‚·B’uŠ·–¼‚ÌÅ‘åŒÀ‚Ì’·‚³‚ÍAatlstencil.h ‚Å’è‹`‚³‚ꂽ ATL_MAX_METHOD_NAME ’è” ‚Æ“¯‚¶‚©‚»‚ê‚æ‚è’Z‚­‚È‚­‚Ä‚Í‚È‚è‚Ü‚¹‚ñB" - IDS_ATLSRV_SERVER_ERROR_LONGHANDLERNAME "ƒT[ƒo[ ƒGƒ‰[

ƒT[ƒo[ ƒGƒ‰[

ID.tagname \•¶‚ðŽg—p‚·‚é’uŠ·ƒ^ƒO‚ªA—v‹‚³‚ꂽƒXƒeƒ“ƒVƒ‹‚ÅŒ©‚‚©‚è‚Ü‚µ‚½‚ªA‚±‚̃^ƒO‚̃nƒ“ƒhƒ‰–¼‚Í’·‚·‚¬‚Ü‚·Bƒnƒ“ƒhƒ‰–¼‚ÌÅ‘åŒÀ‚Ì’·‚³‚ÍAatlstencil.h ‚Å’è‹`‚³‚ꂽ ATL_MAX_METHOD_NAME ’蔂Ɠ¯‚¶‚©‚»‚ê‚æ‚è’Z‚­‚È‚­‚Ä‚Í‚È‚è‚Ü‚¹‚ñB" - IDS_ATLSRV_SERVER_ERROR_IMPERSONATIONFAILED "Server Error

Server Error

An attempt to impersonate the client making the request failed." - IDS_ATLSRV_SERVER_ERROR_ISAPISTARTUPFAILED "ƒT[ƒo[ ƒGƒ‰[

ƒT[ƒo[ ƒGƒ‰[

‚±‚Ì—v‹‚É“š‚¦‚邽‚ß‚ÉŽg—p‚³‚ê‚é ISAPI Šg’£Žq‚ÍA—\Šú‚µ‚È‚¢ƒGƒ‰[‚Ì‚½‚ß³í‚É“Ç‚Ýž‚Ý‚ª‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ATLSRV_SERVER_ERROR_SOAPNOSOAPACTION "Server Error

Server Error

SOAP request did not provide SOAPACTION header." - - IDS_ATLSRV_CRITICAL_HEAPCREATEFAILED "ƒq[ƒv‚Ì쬗v‹‚ª‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ATLSRV_CRITICAL_WORKERINITFAILED "ƒ[ƒJ[ ƒXƒŒƒbƒh‚̉Šú‰»‚ª‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ATLSRV_CRITICAL_CRITSECINITFAILED "ƒNƒŠƒeƒBƒJƒ‹‚ȃZƒNƒVƒ‡ƒ“‚̉Šú‰»‚ª‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ATLSRV_CRITICAL_THREADPOOLFAILED "ƒXƒŒƒbƒh ƒv[ƒ‹‚̉Šú‰»‚ª‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ATLSRV_CRITICAL_DLLCACHEFAILED "DLL ƒLƒƒƒbƒVƒ…‚̉Šú‰»‚ª‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ATLSRV_CRITICAL_PAGECACHEFAILED "ƒy[ƒW ƒLƒƒƒbƒVƒ…‚̉Šú‰»‚ª‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ATLSRV_CRITICAL_STENCILCACHEFAILED "ƒXƒeƒ“ƒVƒ‹ ƒLƒƒƒbƒVƒ…‚̉Šú‰»‚ª‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ATLSRV_CRITICAL_SESSIONSTATEFAILED "ƒZƒbƒVƒ‡ƒ“ó‘ÔƒT[ƒrƒX‚̉Šú‰»‚ª‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ATLSRV_CRITICAL_BLOBCACHEFAILED "Blob ƒLƒƒƒbƒVƒ…‚̉Šú‰»‚ª‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ATLSRV_CRITICAL_FILECACHEFAILED "ƒtƒ@ƒCƒ‹ ƒLƒƒƒbƒVƒ…‚̉Šú‰»‚ª‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" - - IDS_PERFMON_CACHE "ATL ƒT[ƒo[ : ƒLƒƒƒbƒVƒ…" - IDS_PERFMON_CACHE_HELP "ATL ƒT[ƒo[ ƒLƒƒƒbƒVƒ…‚Ìî•ñ" - IDS_PERFMON_HITCOUNT "ƒLƒƒƒbƒVƒ…‚̃qƒbƒg ƒJƒEƒ“ƒg" - IDS_PERFMON_HITCOUNT_HELP "ƒLƒƒƒbƒVƒ… ƒqƒbƒg‚̉ñ”" - IDS_PERFMON_MISSCOUNT "ƒLƒƒƒbƒVƒ…‚̃~ƒX ƒJƒEƒ“ƒg" - IDS_PERFMON_MISSCOUNT_HELP "ƒLƒƒƒbƒVƒ…‚̃~ƒX ƒJƒEƒ“ƒg‚̉ñ”" - IDS_PERFMON_CURRENTALLOCATIONS "ƒLƒƒƒbƒVƒ…‚ÌŒ»Ý‚ÌŠ„‚è“–‚Ä" - IDS_PERFMON_CURRENTALLOCATIONS_HELP "ƒLƒƒƒbƒVƒ…‚ÉŒ»ÝŠ„‚è“–‚Ä‚ç‚ê‚Ä‚¢‚郃‚ƒŠ" - IDS_PERFMON_MAXALLOCATIONS "ƒLƒƒƒbƒVƒ…‚ÌÅ‘å‚ÌŠ„‚è“–‚Ä" - IDS_PERFMON_MAXALLOCATIONS_HELP "ƒLƒƒƒbƒVƒ…‚ÉŠ„‚è“–‚Ä‚ç‚ꂽő僃‚ƒŠ" - IDS_PERFMON_CURRENTENTRIES "Œ»Ý‚̃LƒƒƒbƒVƒ… ƒGƒ“ƒgƒŠ" - IDS_PERFMON_CURRENTENTRIES_HELP "Œ»Ý‚̃LƒƒƒbƒVƒ… ƒGƒ“ƒgƒŠ‚Ì”" - IDS_PERFMON_MAXENTRIES "Å‘å‚̃LƒƒƒbƒVƒ… ƒGƒ“ƒgƒŠ" - IDS_PERFMON_MAXENTRIES_HELP "ƒLƒƒƒbƒVƒ… ƒGƒ“ƒgƒŠ‚ÌÅ‘å”" - IDS_PERFMON_HITCOUNTRATE "ƒLƒƒƒbƒVƒ…‚̃qƒbƒg ƒJƒEƒ“ƒg—¦" - IDS_PERFMON_HITCOUNTRATE_HELP "–ˆ•b‚̃qƒbƒg ƒJƒEƒ“ƒg”" - IDS_PERFMON_REQUEST "ATL ƒT[ƒo[ : —v‹" - IDS_PERFMON_REQUEST_HELP "ƒT[ƒo[‚É“ü‚Á‚Ä‚­‚é—v‹‚Ì“Œv" - IDS_PERFMON_REQUEST_TOTAL "ƒT[ƒo[—v‹‚Ì‘”" - IDS_PERFMON_REQUEST_TOTAL_HELP "—v‹‚Ì‘”" - IDS_PERFMON_REQUEST_FAILED "ƒT[ƒo[‚ª‰ž‚¶‚ç‚ê‚È‚©‚Á‚½—v‹ " - IDS_PERFMON_REQUEST_FAILED_HELP "‰ž‚¶‚ç‚ê‚È‚©‚Á‚½—v‹”" - IDS_PERFMON_REQUEST_RATE "ƒT[ƒo[—v‹ /sec" - IDS_PERFMON_REQUEST_RATE_HELP "–ˆ•b‚Ì—v‹”" - IDS_PERFMON_REQUEST_AVG_RESPONSE_TIME "•½‹Ï‚̉ž‘ÎŽžŠÔ" - IDS_PERFMON_REQUEST_AVG_RESPONSE_TIME_HELP "—v‹‚̈—‚É‚©‚©‚Á‚½•½‹ÏŽžŠÔ" - IDS_PERFMON_REQUEST_CURR_WAITING "Œ»ÝƒLƒ…[‚É‚ ‚é—v‹" - IDS_PERFMON_REQUEST_CURR_WAITING_HELP "Œ»Ý‰ž‘΂ð‘Ò‚Á‚Ä‚¢‚é—v‹”" - IDS_PERFMON_REQUEST_MAX_WAITING "ƒLƒ…[‚É‚ ‚é—v‹‚ÌÅ‘å”" - IDS_PERFMON_REQUEST_MAX_WAITING_HELP "‰ž‘΂ð‘Ò‚Á‚Ä‚¢‚é—v‹‚ÌÅ‘å”" - IDS_PERFMON_REQUEST_ACTIVE_THREADS "ƒAƒNƒeƒBƒu ƒXƒŒƒbƒh" - IDS_PERFMON_REQUEST_ACTIVE_THREADS_HELP "—v‹‚ðŒ»Ýˆ—’†‚̃XƒŒƒbƒh”" -END - - -#ifndef ATL_NO_DEFAULT_STENCIL_RESOURCE -dllmgr.srf HTML "res\\dllmgr.srf" -stencilmgr.srf HTML "res\\stencilmgr.srf" -threadmgr.srf HTML "res\\threadmgr.srf" -#endif - - -// -// Stencil parse error support -// -#ifdef ATL_DEBUG_STENCILS - -STRINGTABLE DISCARDABLE -BEGIN - IDS_STENCIL_ERROR_STENCIL -"{{codepage 0}}

ƒXƒeƒ“ƒVƒ‹ ƒtƒ@ƒCƒ‹‚ð‰ðÍ’†‚ÉŽŸ‚̃Gƒ‰[‚ª”­¶‚µ‚Ü‚µ‚½ :

\r\n{{while GetNextError}}\r\n\r\n\r\n\r\n
ƒGƒ‰[‚ÌŽí—Þ{{GetErrorText}}
sƒiƒ“ƒo{{GetErrorLineNumber}}
ƒGƒ‰[ ƒeƒLƒXƒg
{{GetErrorLine}}
\r\n{{endwhile}}
ƒXƒeƒ“ƒVƒ‹o—Í‚ÍŽŸ‚̂悤‚É‚È‚Á‚Ä‚¢‚Ü‚· :\r\n
" - - IDS_STENCIL_UNCLOSEDBLOCK_IF "{{if}} ‚É {{endif}} ‚ªŒ‡‚¯‚Ä‚¢‚Ü‚·" - IDS_STENCIL_UNCLOSEDBLOCK_ELSE "{{else}} ‚É {{endif}} ‚ªŒ‡‚¯‚Ä‚¢‚Ü‚·" - IDS_STENCIL_UNCLOSEDBLOCK_WHILE "{{while}} ‚É {{endwhile}} ‚ªŒ‡‚¯‚Ä‚¢‚Ü‚·" - IDS_STENCIL_UNOPENEDBLOCK_ENDWHILE "{{endwhile}} ‚É {{while}} ‚ªŒ‡‚¯‚Ä‚¢‚Ü‚·" - IDS_STENCIL_UNOPENEDBLOCK_ELSE "{{else}} ‚É {{if}} ‚ªŒ‡‚¯‚Ä‚¢‚Ü‚·" - IDS_STENCIL_UNOPENEDBLOCK_ENDIF "{{endif}} ‚É {{if}} or {{else}} ‚ªŒ‡‚¯‚Ä‚¢‚Ü‚·" - - IDS_STENCIL_INVALID_HANDLER "–³Œø‚ȃnƒ“ƒhƒ‰ ƒ^ƒO" - IDS_STENCIL_NULLPARAM "ParseReplacements ‚Ö‚Ì NULL ƒpƒ‰ƒ[ƒ^" - IDS_STENCIL_INVALIDSTRING "ParseReplacements ‚É‹óA‚Ü‚½‚Í•‰‚Ì•¶Žš—ñ‚ª“n‚³‚ê‚Ü‚µ‚½" - IDS_STENCIL_EMBEDDED_NULL "ƒXƒeƒ“ƒVƒ‹‚É –„‚ßž‚Ý‚Ì null •¶Žš‚ª‚ ‚è‚Ü‚·" - IDS_STENCIL_UNMATCHED_TAG_START "ˆê’v‚µ‚Ü‚¹‚ñ {{" - IDS_STENCIL_MISMATCHED_TAG_START "ˆê’v‚µ‚Ü‚¹‚ñ {{" - IDS_STENCIL_BAD_PARAMETER "•s“K؂ȃpƒ‰ƒ[ƒ^‚Å‚·" - IDS_STENCIL_METHODNAME_TOO_LONG "ƒƒ\ƒbƒh–¼‚ª’·‚·‚¬‚Ü‚·" - IDS_STENCIL_HANDLERNAME_TOO_LONG "ƒnƒ“ƒhƒ‰–¼‚ª’·‚·‚¬‚Ü‚·" - IDS_STENCIL_INVALID_SUBHANDLER "ƒTƒuƒnƒ“ƒhƒ‰ ƒ^ƒO‚ª–³Œø‚Å‚·" - IDS_STENCIL_UNRESOLVED_REPLACEMENT "’uŠ·‚ð‰ðŒˆ‚Å‚«‚Ü‚¹‚ñ : '%s'" - - IDS_STENCIL_INCLUDE_ERROR "“Y•tƒtƒ@ƒCƒ‹‚ðŠJ‚¯‚Ü‚¹‚ñ" - IDS_STENCIL_INCLUDE_INVALID "“Y•tƒtƒ@ƒCƒ‹‚̓fƒBƒXƒN ƒtƒ@ƒCƒ‹‚Å‚Í‚ ‚è‚Ü‚¹‚ñ" - - IDS_STENCIL_MLANG_COCREATE "CMultiLanguage ‚ð쬂ł«‚Ü‚¹‚ñ‚Å‚µ‚½" - IDS_STENCIL_MLANG_LCID "lcid Žæ“¾‚̃Gƒ‰[‚Å‚·" - IDS_STENCIL_MLANG_GETLOCALE "GetLocaleInfo ‚ª‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½" - IDS_STENCIL_MLANG_GETCHARSET "GetCharsetInfo ‚ª‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½" - - IDS_STENCIL_OUTOFMEMORY "ƒƒ‚ƒŠ‚ª‚ ‚è‚Ü‚¹‚ñ" - IDS_STENCIL_UNEXPECTED "—\Šú‚µ‚È‚¢ƒGƒ‰[‚Å‚·" -END - -#endif diff --git a/include/atl/l.kor/atlsrv.rc b/include/atl/l.kor/atlsrv.rc deleted file mode 100644 index 54208d9ca..000000000 --- a/include/atl/l.kor/atlsrv.rc +++ /dev/null @@ -1,146 +0,0 @@ -// This is a part of the Active Template Library. -// Copyright (C) Microsoft Corporation -// All rights reserved. -// -// This source code is only intended as a supplement to the -// Active Template Library Reference and related -// electronic documentation provided with the library. -// See these sources for detailed information regarding the -// Active Template Library product. - -#include -#include "atlsrvres.h" - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ATLSRV_BAD_REQUEST "À߸øµÈ ¿äûÀ߸øµÈ ¿äûÀÔ´Ï´Ù." - IDS_ATLSRV_AUTH_REQUIRED - "ÀÎÁõ ÇÊ¿äÀÎÁõÀÌ ÇÊ¿äÇÕ´Ï´Ù." - IDS_ATLSRV_FORBIDDEN "±ÝÁöµÊ±ÝÁöµÇ¾ú½À´Ï´Ù." - IDS_ATLSRV_NOT_FOUND "ãÀ» ¼ö ¾øÀ½Ã£À» ¼ö ¾ø½À´Ï´Ù." - IDS_ATLSRV_SERVER_ERROR "¼­¹ö ¿À·ù¼­¹ö ¿À·ù" - IDS_ATLSRV_NOT_IMPLEMENTED - "±¸Çö ¾ÈµÊ±¸ÇöµÇÁö ¾Ê¾Ò½À´Ï´Ù." - IDS_ATLSRV_BAD_GATEWAY "À߸øµÈ °ÔÀÌÆ®¿þÀÌÀ߸øµÈ °ÔÀÌÆ®¿þÀÌÀÔ´Ï´Ù." - IDS_ATLSRV_SERVICE_NOT_AVAILABLE - "¼­ºñ½º¸¦ »ç¿ëÇÒ ¼ö ¾øÀ½¼­ºñ½º¸¦ »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù." - IDS_ATLSRV_SERVER_ERROR_BADSRF "¼­¹ö ¿À·ù

¼­¹ö ¿À·ù

SRF ÆÄÀÏÀ» ·ÎµåÇÒ ¼ö ¾ø½À´Ï´Ù." - IDS_ATLSRV_SERVER_ERROR_HNDLFAIL "¼­¹ö ¿À·ù

¼­¹ö ¿À·ù

¿äûÇÑ SRF ÆÄÀÏÀ» ·ÎµåÇßÁö¸¸ ó¸®ÇÒ ¼ö ¾ø½À´Ï´Ù." - IDS_ATLSRV_SERVER_ERROR_SYSOBJFAIL "¼­¹ö ¿À·ù

¼­¹ö ¿À·ù

Windows ½Ã½ºÅÛ °³Ã¼¸¦ ¸¸µé ¼ö ¾ø½À´Ï´Ù." - IDS_ATLSRV_SERVER_ERROR_READFILEFAIL "¼­¹ö ¿À·ù

¼­¹ö ¿À·ù

ÆÄÀÏ Àбâ ÀÛ¾÷À» ¼öÇàÇÏÁö ¸øÇß½À´Ï´Ù." - IDS_ATLSRV_SERVER_ERROR_LOADFILEFAIL "Server Error

Server Error

ÁöÁ¤ÇÑ ÆÄÀÏÀ» ¿­ ¼ö ¾ø½À´Ï´Ù." - IDS_ATLSRV_SERVER_ERROR_LOADLIB "¼­¹ö ¿À·ù

¼­¹ö ¿À·ù

LoadLibrary È£ÃâÀÌ ½ÇÆÐÇß½À´Ï´Ù." - IDS_ATLSRV_SERVER_ERROR_HANDLERIF "¼­¹ö ¿À·ù

¼­¹ö ¿À·ù

¿äûÇÑ Ã³¸®±â ÀÎÅÍÆäÀ̽º¸¦ °¡Á®¿ÀÁö ¸øÇß½À´Ï´Ù." - IDS_ATLSRV_SERVER_ERROR_OUTOFMEM "¼­¹ö ¿À·ù

¼­¹ö ¿À·ù

¼­¹öÀÇ ¸Þ¸ð¸®°¡ ºÎÁ·ÇÕ´Ï´Ù." - IDS_ATLSRV_SERVER_ERROR_UNEXPECTED "¼­¹ö ¿À·ù

¼­¹ö ¿À·ù

¼­¹ö¿¡¼­ ¿¹±âÄ¡ ¾ÊÀº ¿À·ù°¡ ¹ß»ýÇß½À´Ï´Ù." - IDS_ATLSRV_SERVER_ERROR_STENCILPARSEFAIL "¼­¹ö ¿À·ù

¼­¹ö ¿À·ù

¿äûÇÑ ½ºÅÙ½ÇÀ» ±¸¹® ºÐ¼®ÇÏ´Â µ¿¾È ¼­¹ö¿¡¼­ ¿¹±âÄ¡ ¾ÊÀº ¿À·ù°¡ ¹ß»ýÇß½À´Ï´Ù." - IDS_ATLSRV_SERVER_ERROR_STENCILLOADFAIL "¼­¹ö ¿À·ù

¼­¹ö ¿À·ù

¿äûÇÑ ½ºÅÙ½ÇÀ» ¼­¹ö¿¡¼­ ·ÎµåÇÏÁö ¸øÇß½À´Ï´Ù. ½ºÅÙ½Ç ÆÄÀÏÀÌ ¼Õ»óµÇ¾ú°Å³ª À¥ ¼­¹ö¿¡ ¾ø½À´Ï´Ù." - IDS_ATLSRV_SERVER_ERROR_HANDLERNOTFOUND "¼­¹ö ¿À·ù

¼­¹ö ¿À·ù

ÁöÁ¤ÇÑ Ã³¸®±â .dll¿¡ ¿äûÇÑ ½ºÅÙ½ÇÀÇ Ã³¸®±â ű׿¡ ¸í¸íµÈ 󸮱â Áß Çϳª°¡ ¾ø½À´Ï´Ù." - IDS_ATLSRV_SERVER_ERROR_BADHANDLERTAG "¼­¹ö ¿À·ù

¼­¹ö ¿À·ù

ÀÌ ½ºÅٽǿ¡´Â 󸮱â űװ¡ ¾ø°Å³ª ½ºÅÙ½Ç ÇÁ·Î¼¼¼­¿¡¼­ Á¦´ë·Î ó¸®ÇÒ ¼ö Àִ ó¸®±â űװ¡ ¾ø½À´Ï´Ù. ¿äûÇÑ ½ºÅÙ½ÇÀ» È®ÀÎÇÏ¿© ½ºÅÙ½Ç ±¸¹®ÀÌ ¿Ã¹Ù¸¥Áö °ËÅäÇØ º¸½Ê½Ã¿À." - IDS_ATLSRV_SERVER_ERROR_NOHANDLERTAG "¼­¹ö ¿À·ù

¼­¹ö ¿À·ùServer Error

¿äûÇÑ ½ºÅٽǿ¡ 󸮱â űװ¡ ¾ø½À´Ï´Ù." - IDS_ATLSRV_SERVER_ERROR_LONGMETHODNAME "¼­¹ö ¿À·ù

¼­¹ö ¿À·ù

¿äûÇÑ ½ºÅÙ½ÇÀÇ ´ëü ÅÂ±× À̸§ÀÌ ³Ê¹« ±é´Ï´Ù. ÀÌ °æ¿ì ¹Ù²Ü À̸§ÀÇ ÃÖ´ë ±æÀÌ´Â atlstencil.h¿¡ Á¤ÀÇµÈ ATL_MAX_METHOD_NAME »ó¼öº¸´Ù À۰ųª °°¾Æ¾ß ÇÕ´Ï´Ù." - IDS_ATLSRV_SERVER_ERROR_LONGHANDLERNAME "¼­¹ö ¿À·ù

¼­¹ö ¿À·ù

¿äûÇÑ ½ºÅÙ½ÇÀÇ id.tagnameÀ» »ç¿ëÇÏ´Â ´ëü ű×ÀÇ Ã³¸®±â À̸§ÀÌ ³Ê¹« ±é´Ï´Ù. ÀÌ °æ¿ì 󸮱â À̸§ÀÇ ÃÖ´ë ±æÀÌ´Â atlstencil.h¿¡ Á¤ÀÇµÈ ATL_MAX_METHOD_NAME »ó¼öº¸´Ù À۰ųª °°¾Æ¾ß ÇÕ´Ï´Ù." - IDS_ATLSRV_SERVER_ERROR_IMPERSONATIONFAILED "¼­¹ö ¿À·ù

¼­¹ö ¿À·ù

Ŭ¶óÀ̾ðÆ®¸¦ °¡ÀåÇ߱⠶§¹®¿¡ ¿äûÇÏÁö ¸øÇß½À´Ï´Ù." - IDS_ATLSRV_SERVER_ERROR_ISAPISTARTUPFAILED "¼­¹ö ¿À·ù

¼­¹ö ¿À·ù

¾Ë ¼ö ¾ø´Â ¿À·ù·Î ÀÎÇØ ÀÌ ¿äûÀ» ó¸®ÇÏ´Â µ¥ »ç¿ëµÈ ISAPI ÀͽºÅÙ¼ÇÀ» Á¦´ë·Î ·ÎµåÇÏÁö ¸øÇß½À´Ï´Ù." - IDS_ATLSRV_SERVER_ERROR_SOAPNOSOAPACTION "Server Error

Server Error

SOAP request did not provide SOAPACTION header." - - IDS_ATLSRV_CRITICAL_HEAPCREATEFAILED "¿äû ÈüÀ» ÀÛ¼ºÇÏÁö ¸øÇß½À´Ï´Ù." - IDS_ATLSRV_CRITICAL_WORKERINITFAILED "ÀÛ¾÷ÀÚ ½º·¹µå¸¦ ÃʱâÈ­ÇÏÁö ¸øÇß½À´Ï´Ù." - IDS_ATLSRV_CRITICAL_CRITSECINITFAILED "ÀÓ°è ¼½¼ÇÀ» ÃʱâÈ­ÇÏÁö ¸øÇß½À´Ï´Ù." - IDS_ATLSRV_CRITICAL_THREADPOOLFAILED "½º·¹µå Ç®À» ÃʱâÈ­ÇÏÁö ¸øÇß½À´Ï´Ù." - IDS_ATLSRV_CRITICAL_DLLCACHEFAILED "DLL ij½Ã¸¦ ÃʱâÈ­ÇÏÁö ¸øÇß½À´Ï´Ù." - IDS_ATLSRV_CRITICAL_PAGECACHEFAILED "ÆäÀÌÁö ij½Ã¸¦ ÃʱâÈ­ÇÏÁö ¸øÇß½À´Ï´Ù." - IDS_ATLSRV_CRITICAL_STENCILCACHEFAILED "½ºÅÙ½Ç Ä³½Ã¸¦ ÃʱâÈ­ÇÏÁö ¸øÇß½À´Ï´Ù." - IDS_ATLSRV_CRITICAL_SESSIONSTATEFAILED "¼¼¼Ç »óÅ ¼­ºñ½º¸¦ ÃʱâÈ­ÇÏÁö ¸øÇß½À´Ï´Ù." - IDS_ATLSRV_CRITICAL_BLOBCACHEFAILED "Blob ij½Ã¸¦ ÃʱâÈ­ÇÏÁö ¸øÇß½À´Ï´Ù." - IDS_ATLSRV_CRITICAL_FILECACHEFAILED "ÆÄÀÏ Ä³½Ã¸¦ ÃʱâÈ­ÇÏÁö ¸øÇß½À´Ï´Ù." - - IDS_PERFMON_CACHE "ATL ¼­¹ö:ij½Ã" - IDS_PERFMON_CACHE_HELP "ATL ¼­¹ö ij½Ã¿¡ ´ëÇÑ Á¤º¸" - IDS_PERFMON_HITCOUNT "ij½Ã ÀûÁß È½¼ö" - IDS_PERFMON_HITCOUNT_HELP "ij½Ã ÀûÁß È½¼ö" - IDS_PERFMON_MISSCOUNT "ij½Ã ÀûÁß ½ÇÆРȽ¼ö" - IDS_PERFMON_MISSCOUNT_HELP "ij½Ã ÀûÁß ½ÇÆРȽ¼ö" - IDS_PERFMON_CURRENTALLOCATIONS "ÇöÀç ij½Ã ÇÒ´ç·®" - IDS_PERFMON_CURRENTALLOCATIONS_HELP "ij½Ã·Î ÇÒ´çµÈ ÇöÀç ¸Þ¸ð¸® ¾ç" - IDS_PERFMON_MAXALLOCATIONS "ÃÖ´ë ij½Ã ÇÒ´ç·®" - IDS_PERFMON_MAXALLOCATIONS_HELP "ij½Ã·Î ÇÒ´çµÈ ÃÖ´ë ¸Þ¸ð¸® ¾ç" - IDS_PERFMON_CURRENTENTRIES "ÇöÀç ij½Ã ¿£Æ®¸®" - IDS_PERFMON_CURRENTENTRIES_HELP "ÇöÀç ij½Ã ¿£Æ®¸® ¼ö" - IDS_PERFMON_MAXENTRIES "ÃÖ´ë ij½Ã ¿£Æ®¸®" - IDS_PERFMON_MAXENTRIES_HELP "ÃÖ´ë ij½Ã ¿£Æ®¸® ¼ö" - IDS_PERFMON_HITCOUNTRATE "ij½Ã ÀûÁß·ü" - IDS_PERFMON_HITCOUNTRATE_HELP "ÃÊ ´ç ÀûÁß È½¼ö" - IDS_PERFMON_REQUEST "ATL ¼­¹ö:¿äû" - IDS_PERFMON_REQUEST_HELP "¼­¹ö¿¡ Àü´ÞµÇ´Â ¿äû¿¡ ´ëÇÑ Åë°è" - IDS_PERFMON_REQUEST_TOTAL "¼­¹ö ÃÑ ¿äû ¼ö" - IDS_PERFMON_REQUEST_TOTAL_HELP "ÃÑ ¿äû ¼ö" - IDS_PERFMON_REQUEST_FAILED "¼­¹ö ½ÇÆÐ ¿äû ¼ö" - IDS_PERFMON_REQUEST_FAILED_HELP "½ÇÆÐÇÑ ¿äû ¼ö" - IDS_PERFMON_REQUEST_RATE "¼­¹ö ¿äû ¼ö/ÃÊ" - IDS_PERFMON_REQUEST_RATE_HELP "ÃÊ ´ç ¿äû ¼ö" - IDS_PERFMON_REQUEST_AVG_RESPONSE_TIME "Æò±Õ ÀÀ´ä ½Ã°£" - IDS_PERFMON_REQUEST_AVG_RESPONSE_TIME_HELP "¿äû ó¸® Æò±Õ ¼Ò¿ä ½Ã°£" - IDS_PERFMON_REQUEST_CURR_WAITING "´ë±â¿­¿¡ ÀÖ´Â ÇöÀç ¿äû" - IDS_PERFMON_REQUEST_CURR_WAITING_HELP "ó¸® ´ë±â ÁßÀÎ ÇöÀç ¿äû ¼ö" - IDS_PERFMON_REQUEST_MAX_WAITING "ÃÖ´ë ´ë±â ¿äû ¼ö" - IDS_PERFMON_REQUEST_MAX_WAITING_HELP "ó¸® ´ë±â °¡´ÉÇÑ ÃÖ´ë ¿äû ¼ö" - IDS_PERFMON_REQUEST_ACTIVE_THREADS "È°¼º ½º·¹µå" - IDS_PERFMON_REQUEST_ACTIVE_THREADS_HELP "¿äûÀ» ´ëÈ­ÇüÀ¸·Î ó¸®ÇÏ´Â ½º·¹µå ¼ö" -END - - -#ifndef ATL_NO_DEFAULT_STENCIL_RESOURCE -dllmgr.srf HTML "res\\dllmgr.srf" -stencilmgr.srf HTML "res\\stencilmgr.srf" -threadmgr.srf HTML "res\\threadmgr.srf" -#endif - - -// -// Stencil parse error support -// -#ifdef ATL_DEBUG_STENCILS - -STRINGTABLE DISCARDABLE -BEGIN - IDS_STENCIL_ERROR_STENCIL -"{{ÄÚµå ÆäÀÌÁö 0}}

½ºÅÙ½Ç ÆÄÀÏÀ» ±¸¹® ºÐ¼®ÇÏ´Â µ¿¾È ´ÙÀ½ ¿À·ù°¡ ¹ß»ýÇß½À´Ï´Ù.

\r\n{{while GetNextError}}\r\n\r\n\r\n\r\n
¿À·ù Çü½Ä{{GetErrorText}}
ÁÙ ¹øÈ£{{GetErrorLineNumber}}
¿À·ù ÅؽºÆ®
{{GetErrorLine}}
\r\n{{endwhile}}
½ºÅÙ½Ç Ãâ·ÂÀº ´ÙÀ½°ú °°½À´Ï´Ù.\r\n
" - - IDS_STENCIL_UNCLOSEDBLOCK_IF "{{if}} ¹®¿¡ {{endif}}°¡ ¾ø½À´Ï´Ù." - IDS_STENCIL_UNCLOSEDBLOCK_ELSE "{{else}} ¹®¿¡ {{endif}}°¡ ¾ø½À´Ï´Ù." - IDS_STENCIL_UNCLOSEDBLOCK_WHILE "{{while}} ¹®¿¡ {{endwhile}}ÀÌ ¾ø½À´Ï´Ù." - IDS_STENCIL_UNOPENEDBLOCK_ENDWHILE "{{endwhile}} ¹®¿¡ {{while}}ÀÌ ¾ø½À´Ï´Ù" - IDS_STENCIL_UNOPENEDBLOCK_ELSE "{{else}} ¹®¿¡ {{if}}°¡ ¾ø½À´Ï´Ù." - IDS_STENCIL_UNOPENEDBLOCK_ENDIF "{{endif}} ¹®¿¡ {{if}} ¶Ç´Â {{else}}°¡ ¾ø½À´Ï´Ù." - - IDS_STENCIL_INVALID_HANDLER "󸮱â űװ¡ À߸øµÇ¾ú½À´Ï´Ù." - IDS_STENCIL_NULLPARAM "ParseReplacements¿¡ ´ëÇÑ ¸Å°³ º¯¼ö°¡ NULLÀÔ´Ï´Ù." - IDS_STENCIL_INVALIDSTRING "ºñ¾î Àְųª À½¼öÀÎ ¹®ÀÚ¿­ÀÌ ParseReplacements¿¡ Àü´ÞµÇ¾ú½À´Ï´Ù." - IDS_STENCIL_EMBEDDED_NULL "½ºÅٽǿ¡ Æ÷ÇÔµÈ null ¹®ÀÚ°¡ ÀÖ½À´Ï´Ù." - IDS_STENCIL_UNMATCHED_TAG_START "{{°¡ ÀÏÄ¡ÇÏÁö ¾Ê½À´Ï´Ù." - IDS_STENCIL_MISMATCHED_TAG_START "{{°¡ ÀÏÄ¡ÇÏÁö ¾Ê½À´Ï´Ù." - IDS_STENCIL_BAD_PARAMETER "¸Å°³ º¯¼ö°¡ À߸øµÇ¾ú½À´Ï´Ù." - IDS_STENCIL_METHODNAME_TOO_LONG "¸Þ¼­µå À̸§ÀÌ ³Ê¹« ±é´Ï´Ù." - IDS_STENCIL_HANDLERNAME_TOO_LONG "󸮱â À̸§ÀÌ ³Ê¹« ±é´Ï´Ù." - IDS_STENCIL_INVALID_SUBHANDLER "ÇÏÀ§ 󸮱â űװ¡ À߸øµÇ¾ú½À´Ï´Ù." - IDS_STENCIL_UNRESOLVED_REPLACEMENT "´ëü ¹®À» È®ÀÎÇÒ ¼ö ¾ø½À´Ï´Ù: '%s'" - - IDS_STENCIL_INCLUDE_ERROR "Æ÷ÇÔµÈ ÆÄÀÏÀ» ¿­ ¼ö ¾ø½À´Ï´Ù." - IDS_STENCIL_INCLUDE_INVALID "Æ÷ÇÔµÈ ÆÄÀÏÀÌ µð½ºÅ© ÆÄÀÏÀÌ ¾Æ´Õ´Ï´Ù." - - IDS_STENCIL_MLANG_COCREATE "CMultiLanguage¸¦ ¸¸µé ¼ö ¾ø½À´Ï´Ù." - IDS_STENCIL_MLANG_LCID "lcid¸¦ °¡Á®¿À´Â µ¿¾È ¿À·ù°¡ ¹ß»ýÇß½À´Ï´Ù." - IDS_STENCIL_MLANG_GETLOCALE "GetLocaleInfo°¡ ½ÇÆÐÇß½À´Ï´Ù." - IDS_STENCIL_MLANG_GETCHARSET "GetCharsetInfo°¡ ½ÇÆÐÇß½À´Ï´Ù." - - IDS_STENCIL_OUTOFMEMORY "¸Þ¸ð¸®°¡ ºÎÁ·ÇÕ´Ï´Ù." - IDS_STENCIL_UNEXPECTED "¿¹±âÄ¡ ¾ÊÀº ¿À·ùÀÔ´Ï´Ù." -END - -#endif diff --git a/include/atl/readme.txt b/include/atl/readme.txt deleted file mode 100644 index 4737d2cc1..000000000 --- a/include/atl/readme.txt +++ /dev/null @@ -1,2 +0,0 @@ -ATL Server Library and Tools -http://www.codeplex.com/AtlServer/Release/ProjectReleases.aspx?ReleaseId=3754 \ No newline at end of file diff --git a/include/atl/res/dllmgr.srf b/include/atl/res/dllmgr.srf deleted file mode 100644 index 45f9c7049..000000000 --- a/include/atl/res/dllmgr.srf +++ /dev/null @@ -1,29 +0,0 @@ - - - - -

ATL Server DLL Cache Manager

- -Current DLL Cache Entries: {{GetNumEntries}}

- - - - -{{while EnumEntries}} - -{{endwhile}} - -
DLL PathRef Count
{{GetDllName}}{{GetDllReferences}}
- - - \ No newline at end of file diff --git a/include/atl/res/stencilmgr.srf b/include/atl/res/stencilmgr.srf deleted file mode 100644 index f0ca82fa3..000000000 --- a/include/atl/res/stencilmgr.srf +++ /dev/null @@ -1,69 +0,0 @@ - - - -

- ATL Server Stencil Cache Management -

- - - - {{while GetNextStencilCacheStats}} - - - - - {{endwhile}} -
- ValueQuantity
{{GetCacheValue}}{{GetCacheQuantity}}
-
- - -
- -
- -
- - - diff --git a/include/atl/res/threadmgr.srf b/include/atl/res/threadmgr.srf deleted file mode 100644 index fd322be77..000000000 --- a/include/atl/res/threadmgr.srf +++ /dev/null @@ -1,24 +0,0 @@ - - - -

- ATL Server Thread Pool Management -

- This server's thread pool is currently using {{GetSize}} threads.

-

- - Enter a new thread pool size: - -
- - diff --git a/include/aviutl/filter.h b/include/aviutl/filter.h deleted file mode 100644 index 97e28a41f..000000000 --- a/include/aviutl/filter.h +++ /dev/null @@ -1,476 +0,0 @@ -#pragma once - -typedef struct {short y, cb, cr;} PIXEL_YC; -typedef struct {unsigned char b, g, r;} PIXEL; - -// ƒtƒBƒ‹ƒ^PROC—p\‘¢‘Ì -typedef struct { - int flag; // ƒtƒBƒ‹ƒ^‚̃tƒ‰ƒO - PIXEL_YC *ycp_edit; // ‰æ‘œƒf[ƒ^‚ւ̃|ƒCƒ“ƒ^ - PIXEL_YC *ycp_temp; // ƒeƒ“ƒ|ƒ‰ƒŠ—̈æ‚ւ̃|ƒCƒ“ƒ^ - int w,h; // Œ»Ý‚̉摜‚̃TƒCƒY - int max_w,max_h; // ‰æ‘œ—̈æ‚̃TƒCƒY - int frame; // Œ»Ý‚̃tƒŒ[ƒ€”Ô†(”Ô†‚Í0‚©‚ç) - int frame_n; // ‘ƒtƒŒ[ƒ€” - int org_w,org_h; // Œ³‚̉摜‚̃TƒCƒY - short *audiop; // ƒI[ƒfƒBƒIƒf[ƒ^‚ւ̃|ƒCƒ“ƒ^ ( ƒI[ƒfƒBƒIƒtƒBƒ‹ƒ^‚ÌŽž‚Ì‚Ý ) - // ƒI[ƒfƒBƒIŒ`Ž®‚ÍPCM16bit‚Å‚· ( 1ƒTƒ“ƒvƒ‹‚Í mono = 2byte , stereo = 4byte ) - int audio_n; // ƒI[ƒfƒBƒIƒTƒ“ƒvƒ‹‚Ì‘” - int audio_ch; // ƒI[ƒfƒBƒIƒ`ƒƒƒ“ƒlƒ‹” - PIXEL *pixelp; // DIBŒ`Ž®‚̃f[ƒ^‚ւ̃|ƒCƒ“ƒ^( •\Ž¦ƒtƒBƒ‹ƒ^‚ÌŽž‚Ì‚Ý ) - void *editp; // ƒGƒfƒBƒbƒgƒnƒ“ƒhƒ‹ - int reserve[10]; // Šg’£—p‚É—\–ñ‚³‚ê‚Ä‚Ü‚· -} FILTER_PROC_INFO; - -#define FILTER_PROC_INFO_FLAG_FILL_OVERAREA 1 -#define FILTER_PROC_INFO_FLAG_MASK 0x0fffffff - -// ƒtƒŒ[ƒ€ƒXƒe[ƒ^ƒX\‘¢‘Ì -typedef struct { - int video; // ŽÀۂ̉f‘œƒf[ƒ^”Ô† - int audio; // ŽÀۂ̉¹ºƒf[ƒ^”Ô† - int inter; // ƒtƒŒ[ƒ€‚̃Cƒ“ƒ^[ƒŒ[ƒX - // FRAME_STATUS_INTER_NORMAL : •W€ - // FRAME_STATUS_INTER_REVERSE : ”½“] - // FRAME_STATUS_INTER_ODD : Šï” - // FRAME_STATUS_INTER_EVEN : ‹ô” - // FRAME_STATUS_INTER_MIX : “ñd‰» - // FRAME_STATUS_INTER_AUTO : Ž©“® - int index24fps; // 24fp‚ÌŽüŠú - int config; // ƒtƒŒ[ƒ€‚ÌÝ’èŠÂ‹«‚̔Ԇ - int vcm; // ƒtƒŒ[ƒ€‚̈³kÝ’è‚̔Ԇ - int edit_flag; // •ÒWƒtƒ‰ƒO - // EDIT_FRAME_EDIT_FLAG_KEYFRAME : ƒL[ƒtƒŒ[ƒ€ - // EDIT_FRAME_EDIT_FLAG_MARKFRAME : ƒ}[ƒNƒtƒŒ[ƒ€ - // EDIT_FRAME_EDIT_FLAG_DELFRAME : —DæŠÔˆø‚«ƒtƒŒ[ƒ€ - // EDIT_FRAME_EDIT_FLAG_NULLFRAME : ƒRƒs[ƒtƒŒ[ƒ€ - int reserve[9]; // Šg’£—p‚É—\–ñ‚³‚ê‚Ä‚Ü‚· -} FRAME_STATUS; - -#define FRAME_STATUS_INTER_NORMAL 0 -#define FRAME_STATUS_INTER_REVERSE 1 -#define FRAME_STATUS_INTER_ODD 2 -#define FRAME_STATUS_INTER_EVEN 3 -#define FRAME_STATUS_INTER_MIX 4 -#define FRAME_STATUS_INTER_AUTO 5 -#define EDIT_FRAME_EDIT_FLAG_KEYFRAME 1 -#define EDIT_FRAME_EDIT_FLAG_MARKFRAME 2 -#define EDIT_FRAME_EDIT_FLAG_DELFRAME 4 -#define EDIT_FRAME_EDIT_FLAG_NULLFRAME 8 - -// ƒtƒ@ƒCƒ‹ƒCƒ“ƒtƒHƒ[ƒVƒ‡ƒ“\‘¢‘Ì -typedef struct { - int flag; // ƒtƒ@ƒCƒ‹‚̃tƒ‰ƒO - // FILE_INFO_FLAG_VIDEO : ‰f‘œ‚ª‘¶Ý‚·‚é - // FILE_INFO_FLAG_AUDIO : ‰¹º‚ª‘¶Ý‚·‚é - LPSTR name; // •ÒWƒtƒ@ƒCƒ‹–¼ - int w,h; // Œ³‚̃TƒCƒY - int video_rate,video_scale; // ƒtƒŒ[ƒ€ƒŒ[ƒg - int audio_rate; // ‰¹ºƒTƒ“ƒvƒŠƒ“ƒOƒŒ[ƒg - int audio_ch; // ‰¹ºƒ`ƒƒƒ“ƒlƒ‹” - int reserve[8]; // Šg’£—p‚É—\–ñ‚³‚ê‚Ä‚Ü‚· -} FILE_INFO; - -#define FILE_INFO_FLAG_VIDEO 1 -#define FILE_INFO_FLAG_AUDIO 2 - -// ƒVƒXƒeƒ€ƒCƒ“ƒtƒHƒ[ƒVƒ‡ƒ“\‘¢‘Ì -typedef struct { - int flag; // ƒVƒXƒeƒ€ƒtƒ‰ƒO - // SYS_INFO_FLAG_EDIT : •ÒW’† - // SYS_INFO_FLAG_VFAPI : VFAPI“®ìŽž - LPSTR info; // ƒo[ƒWƒ‡ƒ“î•ñ - int filter_n; // “o˜^‚³‚ê‚Ä‚éƒtƒBƒ‹ƒ^‚Ì” - int min_w,min_h; // •ÒWo—ˆ‚éŬ‰æ‘œƒTƒCƒY - int max_w,max_h; // •ÒWo—ˆ‚éÅ‘å‰æ‘œƒTƒCƒY - int max_frame; // •ÒWo—ˆ‚éÅ‘åƒtƒŒ[ƒ€” - LPSTR edit_name; // •ÒWƒtƒ@ƒCƒ‹–¼ (ƒtƒ@ƒCƒ‹–¼‚ªŒˆ‚Ü‚Á‚Ä‚¢‚È‚¢Žž‚͉½‚à“ü‚Á‚Ä‚¢‚Ü‚¹‚ñ) - LPSTR project_name; // ƒvƒƒWƒFƒNƒgƒtƒ@ƒCƒ‹–¼ (ƒtƒ@ƒCƒ‹–¼‚ªŒˆ‚Ü‚Á‚Ä‚¢‚È‚¢Žž‚͉½‚à“ü‚Á‚Ä‚¢‚Ü‚¹‚ñ) - LPSTR output_name; // o—̓tƒ@ƒCƒ‹–¼ (ƒtƒ@ƒCƒ‹–¼‚ªŒˆ‚Ü‚Á‚Ä‚¢‚È‚¢Žž‚͉½‚à“ü‚Á‚Ä‚¢‚Ü‚¹‚ñ) - int reserve[8]; // Šg’£—p‚É—\–ñ‚³‚ê‚Ä‚Ü‚· -} SYS_INFO; - -#define SYS_INFO_FLAG_EDIT 1 -#define SYS_INFO_FLAG_VFAPI 2 - -// ŠO•”ŠÖ”\‘¢‘Ì -typedef struct { - void *(*get_ycp_ofs)( void *editp,int n,int ofs ); - // Žw’肵‚½ƒtƒŒ[ƒ€‚ÌAVIƒtƒ@ƒCƒ‹ã‚ł̃IƒtƒZƒbƒg•ªˆÚ“®‚µ‚½ - // ƒtƒŒ[ƒ€‚̉摜ƒf[ƒ^‚̃|ƒCƒ“ƒ^‚ðŽæ“¾‚µ‚Ü‚· - // ƒf[ƒ^‚̓tƒBƒ‹ƒ^‘O‚Ì‚à‚Ì‚Å‚· - // editp : ƒGƒfƒBƒbƒgƒnƒ“ƒhƒ‹ - // n : ƒtƒŒ[ƒ€”Ô† - // ofs : ƒtƒŒ[ƒ€‚©‚ç‚̃IƒtƒZƒbƒg - // –ß‚è’l : ‰æ‘œƒf[ƒ^‚ւ̃|ƒCƒ“ƒ^ (NULL‚Ȃ玸”s) - void *(*get_ycp)( void *editp,int n ); - // Žw’肵‚½ƒtƒŒ[ƒ€‚̉摜ƒf[ƒ^‚̃|ƒCƒ“ƒ^‚ðŽæ“¾‚µ‚Ü‚· - // ƒf[ƒ^‚̓tƒBƒ‹ƒ^‘O‚Ì‚à‚Ì‚Å‚· - // editp : ƒGƒfƒBƒbƒgƒnƒ“ƒhƒ‹ - // n : ƒtƒŒ[ƒ€”Ô† - // –ß‚è’l : ‰æ‘œƒf[ƒ^‚ւ̃|ƒCƒ“ƒ^ (NULL‚Ȃ玸”s) - void *(*get_pixelp)( void *editp,int n ); - // Žw’肵‚½ƒtƒŒ[ƒ€‚ÌDIBŒ`Ž®(RGB24bit)‚̉摜ƒf[ƒ^‚̃|ƒCƒ“ƒ^‚ðŽæ“¾‚µ‚Ü‚· - // ƒf[ƒ^‚̓tƒBƒ‹ƒ^‘O‚Ì‚à‚Ì‚Å‚· - // editp : ƒGƒfƒBƒbƒgƒnƒ“ƒhƒ‹ - // n : ƒtƒŒ[ƒ€”Ô† - // –ß‚è’l : DIBŒ`Ž®ƒf[ƒ^‚ւ̃|ƒCƒ“ƒ^ (NULL‚Ȃ玸”s) - int (*get_audio)( void *editp,int n,void *buf ); - // Žw’肵‚½ƒtƒŒ[ƒ€‚̃I[ƒfƒBƒIƒf[ƒ^‚ð“Ç‚Ýž‚Ý‚Ü‚· - // ƒf[ƒ^‚̓tƒBƒ‹ƒ^‘O‚Ì‚à‚Ì‚Å‚· - // editp* : ƒGƒfƒBƒbƒgƒnƒ“ƒhƒ‹ - // n : ƒtƒŒ[ƒ€”Ô† - // buf : Ši”[‚·‚éƒoƒbƒtƒ@ - // –ß‚è’l : “Ç‚Ýž‚ñ‚¾ƒTƒ“ƒvƒ‹” - BOOL (*is_editing)( void *editp ); - // Œ»Ý•ÒW’†‚©’²‚ׂ܂· - // editp : ƒGƒfƒBƒbƒgƒnƒ“ƒhƒ‹ - // –ß‚è’l : TRUE‚È‚ç•ÒW’† - BOOL (*is_saving)( void *editp ); - // Œ»Ý•Û‘¶’†‚©’²‚ׂ܂· - // editp : ƒGƒfƒBƒbƒgƒnƒ“ƒhƒ‹ - // –ß‚è’l : TRUE‚È‚ç•Û‘¶’† - int (*get_frame)( void *editp ); - // Œ»Ý‚Ì•\Ž¦ƒtƒŒ[ƒ€‚ðŽæ“¾‚µ‚Ü‚· - // editp : ƒGƒfƒBƒbƒgƒnƒ“ƒhƒ‹ - // –ß‚è’l : Œ»Ý‚̃tƒŒ[ƒ€”Ô† - int (*get_frame_n)( void *editp ); - // ‘ƒtƒŒ[ƒ€”‚ðŽæ“¾‚µ‚Ü‚· - // editp : ƒGƒfƒBƒbƒgƒnƒ“ƒhƒ‹ - // –ß‚è’l : Œ»Ý‚Ì‘ƒtƒŒ[ƒ€” - BOOL (*get_frame_size)( void *editp,int *w,int *h ); - // ƒtƒBƒ‹ƒ^‘O‚̃tƒŒ[ƒ€‚̃TƒCƒY‚ðŽæ“¾‚µ‚Ü‚· - // editp : ƒGƒfƒBƒbƒgƒnƒ“ƒhƒ‹ - // w,h : ‰æ‘œƒTƒCƒY‚ÌŠi”[ƒ|ƒCƒ“ƒ^ - // –ß‚è’l : TRUE‚Ȃ笌÷ - int (*set_frame)( void *editp,int n ); - // Œ»Ý‚Ì•\Ž¦ƒtƒŒ[ƒ€‚ð•ÏX‚µ‚Ü‚· - // editp : ƒGƒfƒBƒbƒgƒnƒ“ƒhƒ‹ - // n : ƒtƒŒ[ƒ€”Ô† - // –ß‚è’l : ݒ肳‚ꂽƒtƒŒ[ƒ€”Ô† - int (*set_frame_n)( void *editp,int n ); - // ‘ƒtƒŒ[ƒ€”‚ð•ÏX‚µ‚Ü‚· - // editp : ƒGƒfƒBƒbƒgƒnƒ“ƒhƒ‹ - // n : ƒtƒŒ[ƒ€” - // –ß‚è’l : ݒ肳‚ꂽ‘ƒtƒŒ[ƒ€” - BOOL (*copy_frame)( void *editp,int d,int s ); - // ƒtƒŒ[ƒ€‚𑼂̃tƒŒ[ƒ€‚ɃRƒs[‚µ‚Ü‚· - // editp : ƒGƒfƒBƒbƒgƒnƒ“ƒhƒ‹ - // d : ƒRƒs[æƒtƒŒ[ƒ€”Ô† - // s : ƒRƒs[Œ³ƒtƒŒ[ƒ€”Ô† - // –ß‚è’l : TRUE‚Ȃ笌÷ - BOOL (*copy_video)( void *editp,int d,int s ); - // ƒtƒŒ[ƒ€‚̉f‘œ‚¾‚¯‚𑼂̃tƒŒ[ƒ€‚ɃRƒs[‚µ‚Ü‚· - // editp : ƒGƒfƒBƒbƒgƒnƒ“ƒhƒ‹ - // d : ƒRƒs[æƒtƒŒ[ƒ€”Ô† - // s : ƒRƒs[Œ³ƒtƒŒ[ƒ€”Ô† - // –ß‚è’l : TRUE‚Ȃ笌÷ - BOOL (*copy_audio)( void *editp,int d,int s ); - // ƒtƒŒ[ƒ€‚̉¹º‚¾‚¯‚𑼂̃tƒŒ[ƒ€‚ɃRƒs[‚µ‚Ü‚· - // editp : ƒGƒfƒBƒbƒgƒnƒ“ƒhƒ‹ - // d : ƒRƒs[æƒtƒŒ[ƒ€”Ô† - // s : ƒRƒs[Œ³ƒtƒŒ[ƒ€”Ô† - // –ß‚è’l : TRUE‚Ȃ笌÷ - BOOL (*copy_clip)( HWND hwnd,void *pixelp,int w,int h ); - // ƒNƒŠƒbƒvƒ{[ƒh‚ÉDIBŒ`Ž®(RGB24bit)‚̉摜‚ðƒRƒs[‚µ‚Ü‚· - // hwnd : ƒEƒBƒ“ƒhƒEƒnƒ“ƒhƒ‹ - // pixelp : DIBŒ`Ž®ƒf[ƒ^‚ւ̃|ƒCƒ“ƒ^ - // w,h : ‰æ‘œƒTƒCƒY - // –ß‚è’l : TRUE‚Ȃ笌÷ - BOOL (*paste_clip)( HWND hwnd,void *editp,int n ); - // ƒNƒŠƒbƒvƒ{[ƒh‚©‚ç‰æ‘œ‚𒣂è‚‚¯‚Ü‚· - // hwnd : ƒEƒBƒ“ƒhƒEƒnƒ“ƒhƒ‹ - // editp : ƒGƒfƒBƒbƒgƒnƒ“ƒhƒ‹ - // n : ƒtƒŒ[ƒ€”Ô† - // –ß‚è’l : TRUE‚Ȃ笌÷ - BOOL (*get_frame_status)( void *editp,int n,FRAME_STATUS *fsp ); - // ƒtƒŒ[ƒ€‚̃Xƒe[ƒ^ƒX‚ðŽæ“¾‚µ‚Ü‚· - // editp : ƒGƒfƒBƒbƒgƒnƒ“ƒhƒ‹ - // n : ƒtƒŒ[ƒ€”Ô† - // fps : ƒtƒŒ[ƒ€ƒXƒe[ƒ^ƒX‚ւ̃|ƒCƒ“ƒ^ - // –ß‚è’l : TRUE‚Ȃ笌÷ - BOOL (*set_frame_status)( void *editp,int n,FRAME_STATUS *fsp ); - // ƒtƒŒ[ƒ€‚̃Xƒe[ƒ^ƒX‚ð•ÏX‚µ‚Ü‚· - // editp : ƒGƒfƒBƒbƒgƒnƒ“ƒhƒ‹ - // n : ƒtƒŒ[ƒ€”Ô† - // fps : ƒtƒŒ[ƒ€ƒXƒe[ƒ^ƒX‚ւ̃|ƒCƒ“ƒ^ - // –ß‚è’l : TRUE‚Ȃ笌÷ - BOOL (*is_saveframe)( void *editp,int n ); - // ŽÀÛ‚É•Û‘¶‚³‚ê‚éƒtƒŒ[ƒ€‚©’²‚ׂ܂· - // editp : ƒGƒfƒBƒbƒgƒnƒ“ƒhƒ‹ - // n : ƒtƒŒ[ƒ€”Ô† - // –ß‚è’l : TRUE‚È‚ç•Û‘¶‚³‚ê‚Ü‚· - BOOL (*is_keyframe)( void *editp,int n ); - // ƒL[ƒtƒŒ[ƒ€‚©‚Ç‚¤‚©’²‚ׂ܂· - // editp : ƒGƒfƒBƒbƒgƒnƒ“ƒhƒ‹ - // n : ƒtƒŒ[ƒ€”Ô† - // –ß‚è’l : TRUE‚È‚çƒL[ƒtƒŒ[ƒ€ - BOOL (*is_recompress)( void *editp,int n ); - // Ĉ³k‚ª•K—v‚©’²‚ׂ܂· - // editp : ƒGƒfƒBƒbƒgƒnƒ“ƒhƒ‹ - // n : ƒtƒŒ[ƒ€”Ô† - // –ß‚è’l : TRUE‚È‚çĈ³k‚ª•K—v - BOOL (*filter_window_update)( void *fp ); - // Ý’èƒEƒBƒ“ƒhƒE‚̃gƒ‰ƒbƒNƒo[‚ƃ`ƒFƒbƒNƒ{ƒbƒNƒX‚ðÄ•`‰æ‚µ‚Ü‚· - // fp : ƒtƒBƒ‹ƒ^\‘¢‘̂̃|ƒCƒ“ƒ^ - // –ß‚è’l : TRUE‚Ȃ笌÷ - BOOL (*is_filter_window_disp)( void *fp ); - // Ý’èƒEƒBƒ“ƒhƒE‚ª•\Ž¦‚³‚ê‚Ä‚¢‚é‚©’²‚ׂ܂· - // fp : ƒtƒBƒ‹ƒ^\‘¢‘̂̃|ƒCƒ“ƒ^ - // –ß‚è’l : TRUE‚È‚ç•\Ž¦‚³‚ê‚Ä‚¢‚é - BOOL (*get_file_info)( void *editp,FILE_INFO *fip ); - // •ÒWƒtƒ@ƒCƒ‹‚Ìî•ñ‚ðŽæ“¾‚µ‚Ü‚· - // editp : ƒGƒfƒBƒbƒgƒnƒ“ƒhƒ‹ - // fip : ƒtƒ@ƒCƒ‹ƒCƒ“ƒtƒHƒ[ƒVƒ‡ƒ“\‘¢‘̂ւ̃|ƒCƒ“ƒ^ - // –ß‚è’l : TRUE‚Ȃ笌÷ - LPSTR (*get_config_name)( void *editp,int n ); - // Ý’èŠÂ‹«‚Ì–¼‘O‚ðŽæ“¾‚µ‚Ü‚· - // editp : ƒGƒfƒBƒbƒgƒnƒ“ƒhƒ‹ - // n : Ý’èŠÂ‹«‚̔Ԇ - // –ß‚è’l : Ý’èŠÂ‹«‚Ì–¼‘O‚ւ̃|ƒCƒ“ƒ^ - BOOL (*is_filter_active)( void *fp ); - // ƒtƒBƒ‹ƒ^‚ª—LŒø‚É‚È‚Á‚Ä‚¢‚é‚©’²‚ׂ܂· - // fp : ƒtƒBƒ‹ƒ^\‘¢‘̂̃|ƒCƒ“ƒ^ - // –ß‚è’l : TRUE‚È‚çƒtƒBƒ‹ƒ^—LŒø - BOOL (*get_pixel_filtered)( void *editp,int n,void *pixelp,int *w,int *h ); - // Žw’肵‚½ƒtƒŒ[ƒ€‚ÌDIBŒ`Ž®(RGB24bit)‚̉摜ƒf[ƒ^‚ð“Ç‚Ýž‚Ý‚Ü‚· - // ƒf[ƒ^‚̓tƒBƒ‹ƒ^Œã‚Ì‚à‚Ì‚Å‚· - // editp : ƒGƒfƒBƒbƒgƒnƒ“ƒhƒ‹ - // n : ƒtƒŒ[ƒ€”Ô† - // pixelp : DIBŒ`Ž®ƒf[ƒ^‚ðŠi”[‚·‚éƒ|ƒCƒ“ƒ^ (NULL‚È‚ç‰æ‘œƒTƒCƒY‚¾‚¯‚ð•Ô‚µ‚Ü‚·) - // w,h : ‰æ‘œ‚̃TƒCƒY (NULL‚È‚çDIBŒ`Ž®ƒf[ƒ^‚¾‚¯‚ð•Ô‚µ‚Ü‚·) - // –ß‚è’l : TRUE‚Ȃ笌÷ - int (*get_audio_filtered)( void *editp,int n,void *buf ); - // Žw’肵‚½ƒtƒŒ[ƒ€‚̃I[ƒfƒBƒIƒf[ƒ^‚ð“Ç‚Ýž‚Ý‚Ü‚· - // ƒf[ƒ^‚̓tƒBƒ‹ƒ^Œã‚Ì‚à‚Ì‚Å‚· - // editp* : ƒGƒfƒBƒbƒgƒnƒ“ƒhƒ‹ - // n : ƒtƒŒ[ƒ€”Ô† - // buf : Ši”[‚·‚éƒoƒbƒtƒ@ - // –ß‚è’l : “Ç‚Ýž‚ñ‚¾ƒTƒ“ƒvƒ‹” - BOOL (*get_select_frame)( void *editp,int *s,int *e ); - // ‘I‘ðŠJŽnI—¹ƒtƒŒ[ƒ€‚ðŽæ“¾‚µ‚Ü‚· - // editp : ƒGƒfƒBƒbƒgƒnƒ“ƒhƒ‹ - // s : ‘I‘ðŠJŽnƒtƒŒ[ƒ€ - // e : ‘I‘ðI—¹ƒtƒŒ[ƒ€ - // –ß‚è’l : TRUE‚Ȃ笌÷ - BOOL (*set_select_frame)( void *editp,int s,int e ); - // ‘I‘ðŠJŽnI—¹ƒtƒŒ[ƒ€‚ðݒ肵‚Ü‚· - // editp : ƒGƒfƒBƒbƒgƒnƒ“ƒhƒ‹ - // s : ‘I‘ðŠJŽnƒtƒŒ[ƒ€ - // e : ‘I‘ðI—¹ƒtƒŒ[ƒ€ - // –ß‚è’l : TRUE‚Ȃ笌÷ - BOOL (*rgb2yc)( PIXEL_YC *ycp,PIXEL *pixelp,int w ); - // PIXEL‚©‚çPIXEL_YC‚É•ÏŠ·‚µ‚Ü‚· - // ycp : PIXEL_YC\‘¢‘̂ւ̃|ƒCƒ“ƒ^ - // pixelp : PIXEL\‘¢‘̂ւ̃|ƒCƒ“ƒ^ - // w : \‘¢‘Ì‚Ì” - // –ß‚è’l : TRUE‚Ȃ笌÷ - BOOL (*yc2rgb)( PIXEL *pixelp,PIXEL_YC *ycp,int w ); - // PIXEL_YC‚©‚çPIXEL‚É•ÏŠ·‚µ‚Ü‚· - // pixelp : PIXEL\‘¢‘̂ւ̃|ƒCƒ“ƒ^ - // ycp : PIXEL_YC\‘¢‘̂ւ̃|ƒCƒ“ƒ^ - // w : \‘¢‘Ì‚Ì” - // –ß‚è’l : TRUE‚Ȃ笌÷ - BOOL (*dlg_get_load_name)( LPSTR name,LPSTR filter,LPSTR def ); - // ƒtƒ@ƒCƒ‹ƒ_ƒCƒAƒƒO‚ðŽg‚Á‚Ä“Ç‚Ýž‚Þƒtƒ@ƒCƒ‹–¼‚ðŽæ“¾‚µ‚Ü‚· - // name : ƒtƒ@ƒCƒ‹–¼‚ðŠi”[‚·‚éƒ|ƒCƒ“ƒ^ - // filter : ƒtƒ@ƒCƒ‹ƒtƒBƒ‹ƒ^ - // def : ƒfƒtƒHƒ‹ƒg‚̃tƒ@ƒCƒ‹–¼ - // –ß‚è’l : TRUE‚Ȃ笌÷ FALSE‚È‚çƒLƒƒƒ“ƒZƒ‹ - BOOL (*dlg_get_save_name)( LPSTR name,LPSTR filter,LPSTR def ); - // ƒtƒ@ƒCƒ‹ƒ_ƒCƒAƒƒO‚ðŽg‚Á‚Ä‘‚«ž‚Þƒtƒ@ƒCƒ‹–¼‚ðŽæ“¾‚µ‚Ü‚· - // name : ƒtƒ@ƒCƒ‹–¼‚ðŠi”[‚·‚éƒ|ƒCƒ“ƒ^ - // filter : ƒtƒ@ƒCƒ‹ƒtƒBƒ‹ƒ^ - // def : ƒfƒtƒHƒ‹ƒg‚̃tƒ@ƒCƒ‹–¼ - // –ß‚è’l : TRUE‚Ȃ笌÷ FALSE‚È‚çƒLƒƒƒ“ƒZƒ‹ - int (*ini_load_int)( void *fp,LPSTR key,int n ); - // INIƒtƒ@ƒCƒ‹‚©‚ç”’l‚ð“Ç‚Ýž‚Þ - // fp : ƒtƒBƒ‹ƒ^\‘¢‘̂̃|ƒCƒ“ƒ^ - // key : ƒAƒNƒZƒX—p‚̃L[‚Ì–¼‘O - // n : ƒfƒtƒHƒ‹ƒg‚Ì”’l - // –ß‚è’l : “Ç‚Ýž‚ñ‚¾”’l - int (*ini_save_int)( void *fp,LPSTR key,int n ); - // INIƒtƒ@ƒCƒ‹‚É”’l‚ð‘‚«ž‚Þ - // fp : ƒtƒBƒ‹ƒ^\‘¢‘̂̃|ƒCƒ“ƒ^ - // key : ƒAƒNƒZƒX—p‚̃L[‚Ì–¼‘O - // n : ‘‚«ž‚Þ”’l - // –ß‚è’l : ‘‚«ž‚ñ‚¾”’l - BOOL (*ini_load_str)( void *fp,LPSTR key,LPSTR str,LPSTR def ); - // INIƒtƒ@ƒCƒ‹‚©‚當Žš—ñ‚ð“Ç‚Ýž‚Þ - // fp : ƒtƒBƒ‹ƒ^\‘¢‘̂̃|ƒCƒ“ƒ^ - // key : ƒAƒNƒZƒX—p‚̃L[‚Ì–¼‘O - // str : •¶Žš—ñ‚ð“Ç‚Ýž‚Þƒoƒbƒtƒ@ - // def : ƒfƒtƒHƒ‹ƒg‚Ì•¶Žš—ñ - // –ß‚è’l : TRUE‚Ȃ笌÷ - BOOL (*ini_save_str)( void *fp,LPSTR key,LPSTR str ); - // INIƒtƒ@ƒCƒ‹‚É•¶Žš—ñ‚ð‘‚«ž‚Þ - // fp : ƒtƒBƒ‹ƒ^\‘¢‘̂̃|ƒCƒ“ƒ^ - // key : ƒAƒNƒZƒX—p‚̃L[‚Ì–¼‘O - // n : ‘‚«ž‚Þ•¶Žš—ñ - // –ß‚è’l : TRUE‚Ȃ笌÷ - BOOL (*get_source_file_info)( void *editp,FILE_INFO *fip,int source_file_id ); - // Žw’肵‚½ƒtƒ@ƒCƒ‹ID‚̃tƒ@ƒCƒ‹‚Ìî•ñ‚ðŽæ“¾‚µ‚Ü‚· - // editp : ƒGƒfƒBƒbƒgƒnƒ“ƒhƒ‹ - // fip : ƒtƒ@ƒCƒ‹ƒCƒ“ƒtƒHƒ[ƒVƒ‡ƒ“\‘¢‘̂ւ̃|ƒCƒ“ƒ^ - // souce_file_id - // : ƒtƒ@ƒCƒ‹ID - // –ß‚è’l : TRUE‚Ȃ笌÷ - BOOL (*get_source_video_number)( void *editp,int n,int *source_file_id,int *source_video_number ); - // Žw’肵‚½ƒtƒŒ[ƒ€‚̃\[ƒX‚̃tƒ@ƒCƒ‹ID‚ƃtƒŒ[ƒ€”Ô†‚ðŽæ“¾‚µ‚Ü‚· - // editp : ƒGƒfƒBƒbƒgƒnƒ“ƒhƒ‹ - // n : ƒtƒŒ[ƒ€”Ô† - // souce_file_id - // : ƒtƒ@ƒCƒ‹ID‚ðŠi”[‚·‚éƒ|ƒCƒ“ƒ^ - // souce_video_number - // : ƒtƒŒ[ƒ€”Ô†‚ðŠi”[‚·‚éƒ|ƒCƒ“ƒ^ - // –ß‚è’l : TRUE‚Ȃ笌÷ - BOOL (*get_sys_info)( void *editp,SYS_INFO *sip ); - // ƒVƒXƒeƒ€‚Ìî•ñ‚ðŽæ“¾‚µ‚Ü‚· - // editp : ƒGƒfƒBƒbƒgƒnƒ“ƒhƒ‹ - // sip : ƒVƒXƒeƒ€ƒCƒ“ƒtƒHƒ[ƒVƒ‡ƒ“\‘¢‘̂ւ̃|ƒCƒ“ƒ^ - // –ß‚è’l : TRUE‚Ȃ笌÷ - void *(*get_filterp)( int filter_id ); - // Žw’è‚̃tƒBƒ‹ƒ^ID‚̃tƒBƒ‹ƒ^\‘¢‘̂ւ̃|ƒCƒ“ƒ^‚ðŽæ“¾‚µ‚Ü‚· - // filter_id - // : ƒtƒBƒ‹ƒ^ID (0`“o˜^‚³‚ê‚Ä‚éƒtƒBƒ‹ƒ^‚Ì”-1‚Ü‚Å‚Ì’l) - // –ß‚è’l : ƒtƒBƒ‹ƒ^\‘¢‘̂ւ̃|ƒCƒ“ƒ^ (NULL‚Ȃ玸”s) - int reserve[6]; -} EXFUNC; - -// ƒtƒBƒ‹ƒ^\‘¢‘Ì -typedef struct { - int flag; // ƒtƒBƒ‹ƒ^‚̃tƒ‰ƒO - // FILTER_FLAG_ALWAYS_ACTIVE : ƒtƒBƒ‹ƒ^‚ðí‚ɃAƒNƒeƒBƒu‚É‚µ‚Ü‚· - // FILTER_FLAG_CONFIG_POPUP : Ý’è‚ðƒ|ƒbƒvƒAƒbƒvƒƒjƒ…[‚É‚µ‚Ü‚· - // FILTER_FLAG_CONFIG_CHECK : Ý’è‚ðƒ`ƒFƒbƒNƒ{ƒbƒNƒXƒƒjƒ…[‚É‚µ‚Ü‚· - // FILTER_FLAG_CONFIG_RADIO : Ý’è‚ðƒ‰ƒWƒIƒ{ƒ^ƒ“ƒƒjƒ…[‚É‚µ‚Ü‚· - // FILTER_FLAG_EX_DATA : Šg’£ƒf[ƒ^‚ð•Û‘¶o—ˆ‚é‚悤‚É‚µ‚Ü‚· - // FILTER_FLAG_PRIORITY_HIGHEST : ƒtƒBƒ‹ƒ^‚̃vƒ‰ƒCƒIƒŠƒeƒB‚ðí‚ÉÅãˆÊ‚É‚µ‚Ü‚· - // FILTER_FLAG_PRIORITY_LOWEST : ƒtƒBƒ‹ƒ^‚̃vƒ‰ƒCƒIƒŠƒeƒB‚ðí‚ÉʼnºˆÊ‚É‚µ‚Ü‚· - // FILTER_FLAG_WINDOW_THICKFRAME : ƒTƒCƒY•ÏX‰Â”\‚ȃEƒBƒ“ƒhƒE‚ðì‚è‚Ü‚· - // FILTER_FLAG_WINDOW_SIZE : Ý’èƒEƒBƒ“ƒhƒE‚̃TƒCƒY‚ðŽw’èo—ˆ‚é‚悤‚É‚µ‚Ü‚· - // FILTER_FLAG_DISP_FILTER : •\Ž¦ƒtƒBƒ‹ƒ^‚É‚µ‚Ü‚· - // FILTER_FLAG_REDRAW : Ä•`‰æ‚ðplugin‘¤‚ň—‚·‚é‚悤‚É‚µ‚Ü‚· - // FILTER_FLAG_EX_INFORMATION : ƒtƒBƒ‹ƒ^‚ÌŠg’£î•ñ‚ðÝ’è‚Å‚«‚é‚悤‚É‚µ‚Ü‚· - // FILTER_FLAG_INFORMATION : FILTER_FLAG_EX_INFORMATION ‚ðŽg‚¤‚悤‚É‚µ‚ĉº‚³‚¢ - // FILTER_FLAG_NO_CONFIG : Ý’èƒEƒBƒ“ƒhƒE‚ð•\Ž¦‚µ‚È‚¢‚悤‚É‚µ‚Ü‚· - // FILTER_FLAG_AUDIO_FILTER : ƒI[ƒfƒBƒIƒtƒBƒ‹ƒ^‚É‚µ‚Ü‚· - // FILTER_FLAG_RADIO_BUTTON : ƒ`ƒFƒbƒNƒ{ƒbƒNƒX‚ðƒ‰ƒWƒIƒ{ƒ^ƒ“‚É‚µ‚Ü‚· - // FILTER_FLAG_WINDOW_HSCROLL : …•½ƒXƒNƒ[ƒ‹ƒo[‚ðŽ‚ƒEƒBƒ“ƒhƒE‚ðì‚è‚Ü‚· - // FILTER_FLAG_WINDOW_VSCROLL : ‚’¼ƒXƒNƒ[ƒ‹ƒo[‚ðŽ‚ƒEƒBƒ“ƒhƒE‚ðì‚è‚Ü‚· - // FILTER_FLAG_IMPORT : ƒCƒ“ƒ|[ƒgƒƒjƒ…[‚ðì‚è‚Ü‚· - // FILTER_FLAG_EXPORT : ƒGƒNƒXƒ|[ƒgƒƒjƒ…[‚ðì‚è‚Ü‚· - int x,y; // Ý’èƒEƒCƒ“ƒhƒE‚̃TƒCƒY (FILTER_FLAG_WINDOW_SIZE‚ª—§‚Á‚Ä‚¢‚鎞‚É—LŒø) - TCHAR *name; // ƒtƒBƒ‹ƒ^‚Ì–¼‘O - int track_n; // ƒgƒ‰ƒbƒNƒo[‚Ì” - TCHAR **track_name; // ƒgƒ‰ƒbƒNƒo[‚Ì–¼‘OŒS‚ւ̃|ƒCƒ“ƒ^(ƒgƒ‰ƒbƒNƒo[”‚ª0‚È‚çNULL‚Å‚æ‚¢) - int *track_default; // ƒgƒ‰ƒbƒNƒo[‚̉Šú’lŒS‚ւ̃|ƒCƒ“ƒ^(ƒgƒ‰ƒbƒNƒo[”‚ª0‚È‚çNULL‚Å‚æ‚¢) - int *track_s,*track_e; // ƒgƒ‰ƒbƒNƒo[‚Ì”’l‚̉ºŒÀãŒÀ (NULL‚È‚ç‘S‚Ä0`256) - int check_n; // ƒ`ƒFƒbƒNƒ{ƒbƒNƒX‚Ì” - TCHAR **check_name; // ƒ`ƒFƒbƒNƒ{ƒbƒNƒX‚Ì–¼‘OŒS‚ւ̃|ƒCƒ“ƒ^(ƒ`ƒFƒbƒNƒ{ƒbƒNƒX”‚ª0‚È‚çNULL‚Å‚æ‚¢) - int *check_default; // ƒ`ƒFƒbƒNƒ{ƒbƒNƒX‚̉Šú’lŒS‚ւ̃|ƒCƒ“ƒ^(ƒ`ƒFƒbƒNƒ{ƒbƒNƒX”‚ª0‚È‚çNULL‚Å‚æ‚¢) - BOOL (*func_proc)( void *fp,FILTER_PROC_INFO *fpip ); - // ƒtƒBƒ‹ƒ^ˆ—ŠÖ”‚ւ̃|ƒCƒ“ƒ^ (NULL‚È‚çŒÄ‚΂ê‚Ü‚¹‚ñ) - BOOL (*func_init)( void *fp ); - // ŠJŽnŽž‚ɌĂ΂ê‚éŠÖ”‚ւ̃|ƒCƒ“ƒ^ (NULL‚È‚çŒÄ‚΂ê‚Ü‚¹‚ñ) - BOOL (*func_exit)( void *fp ); - // I—¹Žž‚ɌĂ΂ê‚éŠÖ”‚ւ̃|ƒCƒ“ƒ^ (NULL‚È‚çŒÄ‚΂ê‚Ü‚¹‚ñ) - BOOL (*func_update)( void *fp ); - // ݒ肪•ÏX‚³‚ꂽ‚Æ‚«‚ɌĂ΂ê‚éŠÖ”‚ւ̃|ƒCƒ“ƒ^ (NULL‚È‚çŒÄ‚΂ê‚Ü‚¹‚ñ) - BOOL (*func_WndProc)( HWND hwnd,UINT message,WPARAM wparam,LPARAM lparam,void *editp,void *fp ); - // Ý’èƒEƒBƒ“ƒhƒE‚ɃEƒBƒ“ƒhƒEƒƒbƒZ[ƒW‚ª—ˆ‚½Žž‚ɌĂ΂ê‚éŠÖ”‚ւ̃|ƒCƒ“ƒ^ (NULL‚È‚çŒÄ‚΂ê‚Ü‚¹‚ñ) - // ’Êí‚̃ƒbƒZ[ƒWˆÈŠO‚Ɉȉº‚ÌŠg’£ƒƒbƒZ[ƒW‚ª‘—‚ç‚ê‚Ü‚· - // WM_FILTER_UPDATE : ƒtƒBƒ‹ƒ^Ý’è‚â•ÒW“à—e‚ª•ÏX‚³‚ꂽ’¼Œã‚É‘—‚ç‚ê‚Ü‚· - // WM_FILTER_FILE_OPEN : •ÒWƒtƒ@ƒCƒ‹‚ªƒI[ƒvƒ“‚³‚ꂽ’¼Œã‚É‘—‚ç‚ê‚Ü‚· - // WM_FILTER_FILE_CLOSE : •ÒWƒtƒ@ƒCƒ‹‚ªƒNƒ[ƒY‚³‚ê‚é’¼‘O‚É‘—‚ç‚ê‚Ü‚· - // WM_FILTER_INIT : ŠJŽn’¼Œã‚É‘—‚ç‚ê‚Ü‚· - // WM_FILTER_EXIT : I—¹’¼‘O‚É‘—‚ç‚ê‚Ü‚· - // WM_FILTER_SAVE_START : ƒZ[ƒu‚ªŠJŽn‚³‚ê‚é’¼‘O‚É‘—‚ç‚ê‚Ü‚· - // WM_FILTER_SAVE_END : ƒZ[ƒu‚ªI—¹‚³‚ꂽ’¼Œã‚É‘—‚ç‚ê‚Ü‚· - // WM_FILTER_IMPORT : ƒCƒ“ƒ|[ƒg‚ª‘I‘ð‚³‚ê‚½’¼Œã‚É‘—‚ç‚ê‚Ü‚· - // WM_FILTER_EXPORT : ƒGƒNƒXƒ|[ƒg‚ª‘I‘ð‚³‚ê‚½’¼Œã‚É‘—‚ç‚ê‚Ü‚· - // –ß‚è’l‚ðTRUE‚É‚·‚é‚Æ•ÒW“à—e‚ªXV‚³‚ꂽ‚Æ‚µ‚Ä‘S‘Ì‚ªÄ•`‰æ‚³‚ê‚Ü‚· - int *track,*check; // ƒVƒXƒeƒ€‚ÅŽg‚¢‚Ü‚·‚Ì‚ÅŽg—p‚µ‚È‚¢‚Å‚­‚¾‚³‚¢ - void *ex_data_ptr; // Šg’£ƒf[ƒ^—̈æ‚ւ̃|ƒCƒ“ƒ^ (FILTER_FLAG_EX_DATA‚ª—§‚Á‚Ä‚¢‚鎞‚É—LŒø) - int ex_data_size; // Šg’£ƒf[ƒ^ƒTƒCƒY (FILTER_FLAG_EX_DATA‚ª—§‚Á‚Ä‚¢‚鎞‚É—LŒø) - TCHAR *information; // ƒtƒBƒ‹ƒ^î•ñ‚ւ̃|ƒCƒ“ƒ^ (FILTER_FLAG_EX_INFORMATION‚ª—§‚Á‚Ä‚¢‚鎞‚É—LŒø) - BOOL (*func_save_start)( void *fp,int s,int e,void *editp ); - // ƒZ[ƒu‚ªŠJŽn‚³‚ê‚é’¼‘O‚ɌĂ΂ê‚éŠÖ”‚ւ̃|ƒCƒ“ƒ^ (NULL‚È‚çŒÄ‚΂ê‚Ü‚¹‚ñ) - BOOL (*func_save_end)( void *fp,void *editp ); - // ƒZ[ƒu‚ªI—¹‚µ‚½’¼‘O‚ɌĂ΂ê‚éŠÖ”‚ւ̃|ƒCƒ“ƒ^ (NULL‚È‚çŒÄ‚΂ê‚Ü‚¹‚ñ) - EXFUNC *exfunc; // ŠO•”ŠÖ”ƒe[ƒuƒ‹‚ւ̃|ƒCƒ“ƒ^ - HWND hwnd; // ƒEƒBƒ“ƒhƒEƒnƒ“ƒhƒ‹ - HINSTANCE dll_hinst; // DLL‚̃Cƒ“ƒXƒ^ƒ“ƒXƒnƒ“ƒhƒ‹ - int reserve[8]; // Šg’£—p‚É—\–ñ‚³‚ê‚Ä‚Ü‚· -} FILTER; -#define FILTER_FLAG_ACTIVE 1 -#define FILTER_FLAG_ALWAYS_ACTIVE 4 -#define FILTER_FLAG_CONFIG_POPUP 8 -#define FILTER_FLAG_CONFIG_CHECK 16 -#define FILTER_FLAG_CONFIG_RADIO 32 -#define FILTER_FLAG_EX_DATA 1024 -#define FILTER_FLAG_PRIORITY_HIGHEST 2048 -#define FILTER_FLAG_PRIORITY_LOWEST 4096 -#define FILTER_FLAG_WINDOW_THICKFRAME 8192 -#define FILTER_FLAG_WINDOW_SIZE 16384 -#define FILTER_FLAG_DISP_FILTER 32768 -#define FILTER_FLAG_REDRAW 0x20000 -#define FILTER_FLAG_EX_INFORMATION 0x40000 -#define FILTER_FLAG_INFORMATION 0x80000 -#define FILTER_FLAG_NO_CONFIG 0x100000 -#define FILTER_FLAG_AUDIO_FILTER 0x200000 -#define FILTER_FLAG_RADIO_BUTTON 0x400000 -#define FILTER_FLAG_WINDOW_HSCROLL 0x800000 -#define FILTER_FLAG_WINDOW_VSCROLL 0x1000000 -#define FILTER_FLAG_IMPORT 0x10000000 -#define FILTER_FLAG_EXPORT 0x20000000 -#define WM_FILTER_UPDATE (WM_USER+100) -#define WM_FILTER_FILE_OPEN (WM_USER+101) -#define WM_FILTER_FILE_CLOSE (WM_USER+102) -#define WM_FILTER_INIT (WM_USER+103) -#define WM_FILTER_EXIT (WM_USER+104) -#define WM_FILTER_SAVE_START (WM_USER+105) -#define WM_FILTER_SAVE_END (WM_USER+106) -#define WM_FILTER_IMPORT (WM_USER+107) -#define WM_FILTER_EXPORT (WM_USER+108) - -// ƒtƒBƒ‹ƒ^DLL—p\‘¢‘Ì -typedef struct { - int flag; - int x,y; - TCHAR *name; - int track_n; - TCHAR **track_name; - int *track_default; - int *track_s,*track_e; - int check_n; - TCHAR **check_name; - int *check_default; - BOOL (*func_proc)( FILTER *fp,FILTER_PROC_INFO *fpip ); - BOOL (*func_init)( FILTER *fp ); - BOOL (*func_exit)( FILTER *fp ); - BOOL (*func_update)( FILTER *fp ); - BOOL (*func_WndProc)( HWND hwnd,UINT message,WPARAM wparam,LPARAM lparam,void *editp,FILTER *fp ); - int *track,*check; - void *ex_data_ptr; - int ex_data_size; - TCHAR *information; - BOOL (*func_save_start)( void *fp,int s,int e,void *editp ); - BOOL (*func_save_end)( void *fp,void *editp ); - EXFUNC *exfunc; - HWND hwnd; - HINSTANCE dll_hinst; - int reserve[8]; -} FILTER_DLL; - -#define MID_FILTER_BUTTON 12004 - -BOOL func_proc( FILTER *fp,FILTER_PROC_INFO *fpip ); -BOOL func_init( FILTER *fp ); -BOOL func_exit( FILTER *fp ); -BOOL func_update( FILTER *fp ); -BOOL func_WndProc( HWND hwnd,UINT message,WPARAM wparam,LPARAM lparam,void *editp,FILTER *fp ); -BOOL func_save_start( FILTER *fp,int s,int e,void *editp ); -BOOL func_save_end( FILTER *fp,void *editp ); - - diff --git a/include/detours/detours.h b/include/detours/detours.h deleted file mode 100644 index 3c0ce910f..000000000 --- a/include/detours/detours.h +++ /dev/null @@ -1,616 +0,0 @@ -////////////////////////////////////////////////////////////////////////////// -// -// File: detours.h -// Module: detours.lib -// -// Detours for binary functions. Version 1.5 (Build 46) -// -// Copyright 1995-2001, Microsoft Corporation -// - -#pragma once -#ifndef _DETOURS_H_ -#define _DETOURS_H_ - -#pragma comment(lib, "detours") - -////////////////////////////////////////////////////////////////////////////// -// -#ifndef GUID_DEFINED -#define GUID_DEFINED -typedef struct _GUID -{ - DWORD Data1; - WORD Data2; - WORD Data3; - BYTE Data4[ 8 ]; -} GUID; -#endif // !GUID_DEFINED - -#if defined(__cplusplus) -#ifndef _REFGUID_DEFINED -#define _REFGUID_DEFINED -#define REFGUID const GUID & -#endif // !_REFGUID_DEFINED -#else // !__cplusplus -#ifndef _REFGUID_DEFINED -#define _REFGUID_DEFINED -#define REFGUID const GUID * const -#endif // !_REFGUID_DEFINED -#endif // !__cplusplus -// -////////////////////////////////////////////////////////////////////////////// - -#ifdef __cplusplus -extern "C" { -#endif // __cplusplus - -/////////////////////////////////////////////////// Instruction Target Macros. -// -#define DETOUR_INSTRUCTION_TARGET_NONE ((PBYTE)0) -#define DETOUR_INSTRUCTION_TARGET_DYNAMIC ((PBYTE)~0ul) - -/////////////////////////////////////////////////////////// Trampoline Macros. -// -// DETOUR_TRAMPOLINE(trampoline_prototype, target_name) -// -// The naked trampoline must be at least DETOUR_TRAMPOLINE_SIZE bytes. -// -#define DETOUR_TRAMPOLINE_SIZE 32 -#define DETOUR_SECTION_HEADER_SIGNATURE 0x00727444 // "Dtr\0" - -#define DETOUR_TRAMPOLINE(trampoline,target) \ -static PVOID __fastcall _Detours_GetVA_##target(VOID) \ -{ \ - return ⌖ \ -} \ -\ -__declspec(naked) trampoline \ -{ \ - __asm { nop };\ - __asm { nop };\ - __asm { call _Detours_GetVA_##target };\ - __asm { jmp eax };\ - __asm { ret };\ - __asm { nop };\ - __asm { nop };\ - __asm { nop };\ - __asm { nop };\ - __asm { nop };\ - __asm { nop };\ - __asm { nop };\ - __asm { nop };\ - __asm { nop };\ - __asm { nop };\ - __asm { nop };\ - __asm { nop };\ - __asm { nop };\ - __asm { nop };\ - __asm { nop };\ - __asm { nop };\ - __asm { nop };\ - __asm { nop };\ - __asm { nop };\ - __asm { nop };\ - __asm { nop };\ - __asm { nop };\ -} - -#define DETOUR_TRAMPOLINE_EMPTY(trampoline) \ -__declspec(naked) trampoline \ -{ \ - __asm { nop };\ - __asm { nop };\ - __asm { xor eax, eax };\ - __asm { mov eax, [eax] };\ - __asm { ret };\ - __asm { nop };\ - __asm { nop };\ - __asm { nop };\ - __asm { nop };\ - __asm { nop };\ - __asm { nop };\ - __asm { nop };\ - __asm { nop };\ - __asm { nop };\ - __asm { nop };\ - __asm { nop };\ - __asm { nop };\ - __asm { nop };\ - __asm { nop };\ - __asm { nop };\ - __asm { nop };\ - __asm { nop };\ - __asm { nop };\ - __asm { nop };\ - __asm { nop };\ - __asm { nop };\ - __asm { nop };\ - __asm { nop };\ - __asm { nop };\ - __asm { nop };\ -} - -/////////////////////////////////////////////////////////// Binary Structures. -// -#pragma pack(push, 8) -typedef struct _DETOUR_SECTION_HEADER -{ - DWORD cbHeaderSize; - DWORD nSignature; - DWORD nDataOffset; - DWORD cbDataSize; - - DWORD nOriginalImportVirtualAddress; - DWORD nOriginalImportSize; - DWORD nOriginalBoundImportVirtualAddress; - DWORD nOriginalBoundImportSize; - - DWORD nOriginalIatVirtualAddress; - DWORD nOriginalIatSize; - DWORD nOriginalSizeOfImage; - DWORD nReserve; -} DETOUR_SECTION_HEADER, *PDETOUR_SECTION_HEADER; - -typedef struct _DETOUR_SECTION_RECORD -{ - DWORD cbBytes; - DWORD nReserved; - GUID guid; -} DETOUR_SECTION_RECORD, *PDETOUR_SECTION_RECORD; -#pragma pack(pop) - -#define DETOUR_SECTION_HEADER_DECLARE(cbSectionSize) \ -{ \ - sizeof(DETOUR_SECTION_HEADER),\ - DETOUR_SECTION_HEADER_SIGNATURE,\ - sizeof(DETOUR_SECTION_HEADER),\ - (cbSectionSize),\ - \ - 0,\ - 0,\ - 0,\ - 0,\ - \ - 0,\ - 0,\ - 0,\ - 0,\ -} - -///////////////////////////////////////////////////////////// Binary Typedefs. -// -typedef BOOL (CALLBACK *PF_DETOUR_BINARY_BYWAY_CALLBACK)(PVOID pContext, - PCHAR pszFile, - PCHAR *ppszOutFile); -typedef BOOL (CALLBACK *PF_DETOUR_BINARY_FILE_CALLBACK)(PVOID pContext, - PCHAR pszOrigFile, - PCHAR pszFile, - PCHAR *ppszOutFile); -typedef BOOL (CALLBACK *PF_DETOUR_BINARY_SYMBOL_CALLBACK)(PVOID pContext, - DWORD nOrdinal, - PCHAR pszOrigSymbol, - PCHAR pszSymbol, - PCHAR *ppszOutSymbol); -typedef BOOL (CALLBACK *PF_DETOUR_BINARY_FINAL_CALLBACK)(PVOID pContext); -typedef BOOL (CALLBACK *PF_DETOUR_BINARY_EXPORT_CALLBACK)(PVOID pContext, - DWORD nOrdinal, - PCHAR pszName, - PBYTE pbCode); - -typedef VOID * PDETOUR_BINARY; -typedef VOID * PDETOUR_LOADED_BINARY; - -//////////////////////////////////////////////////////// Trampoline Functions. -// -PBYTE WINAPI DetourFunction(PBYTE pbTargetFunction, - PBYTE pbDetourFunction); - -BOOL WINAPI DetourFunctionWithEmptyTrampoline(PBYTE pbTrampoline, - PBYTE pbTarget, - PBYTE pbDetour); - -BOOL WINAPI DetourFunctionWithEmptyTrampolineEx(PBYTE pbTrampoline, - PBYTE pbTarget, - PBYTE pbDetour, - PBYTE *ppbRealTrampoline, - PBYTE *ppbRealTarget, - PBYTE *ppbRealDetour); - -BOOL WINAPI DetourFunctionWithTrampoline(PBYTE pbTrampoline, - PBYTE pbDetour); - -BOOL WINAPI DetourFunctionWithTrampolineEx(PBYTE pbTrampoline, - PBYTE pbDetour, - PBYTE *ppbRealTrampoline, - PBYTE *ppbRealTarget); - -BOOL WINAPI DetourRemove(PBYTE pbTrampoline, PBYTE pbDetour); - -////////////////////////////////////////////////////////////// Code Functions. -// -PBYTE WINAPI DetourFindFunction(PCHAR pszModule, PCHAR pszFunction); -PBYTE WINAPI DetourGetFinalCode(PBYTE pbCode, BOOL fSkipJmp); - -PBYTE WINAPI DetourCopyInstruction(PBYTE pbDst, PBYTE pbSrc, PBYTE *ppbTarget); -PBYTE WINAPI DetourCopyInstructionEx(PBYTE pbDst, - PBYTE pbSrc, - PBYTE *ppbTarget, - LONG *plExtra); - -///////////////////////////////////////////////////// Loaded Binary Functions. -// -HMODULE WINAPI DetourEnumerateModules(HMODULE hModuleLast); -PBYTE WINAPI DetourGetEntryPoint(HMODULE hModule); -BOOL WINAPI DetourEnumerateExports(HMODULE hModule, - PVOID pContext, - PF_DETOUR_BINARY_EXPORT_CALLBACK pfExport); - -PBYTE WINAPI DetourFindPayload(HMODULE hModule, REFGUID rguid, DWORD *pcbData); -DWORD WINAPI DetourGetSizeOfPayloads(HMODULE hModule); - -///////////////////////////////////////////////// Persistent Binary Functions. -// -BOOL WINAPI DetourBinaryBindA(PCHAR pszFile, PCHAR pszDll, PCHAR pszPath); -BOOL WINAPI DetourBinaryBindW(PWCHAR pwzFile, PWCHAR pwzDll, PWCHAR pwzPath); -#ifdef UNICODE -#define DetourBinaryBind DetourBinaryBindW -#else -#define DetourBinaryBind DetourBinaryBindA -#endif // !UNICODE - -PDETOUR_BINARY WINAPI DetourBinaryOpen(HANDLE hFile); -PBYTE WINAPI DetourBinaryEnumeratePayloads(PDETOUR_BINARY pBinary, - GUID *pGuid, - DWORD *pcbData, - DWORD *pnIterator); -PBYTE WINAPI DetourBinaryFindPayload(PDETOUR_BINARY pBinary, - REFGUID rguid, - DWORD *pcbData); -PBYTE WINAPI DetourBinarySetPayload(PDETOUR_BINARY pBinary, - REFGUID rguid, - PBYTE pbData, - DWORD cbData); -BOOL WINAPI DetourBinaryDeletePayload(PDETOUR_BINARY pBinary, REFGUID rguid); -BOOL WINAPI DetourBinaryPurgePayloads(PDETOUR_BINARY pBinary); -BOOL WINAPI DetourBinaryResetImports(PDETOUR_BINARY pBinary); -BOOL WINAPI DetourBinaryEditImports(PDETOUR_BINARY pBinary, - PVOID pContext, - PF_DETOUR_BINARY_BYWAY_CALLBACK pfByway, - PF_DETOUR_BINARY_FILE_CALLBACK pfFile, - PF_DETOUR_BINARY_SYMBOL_CALLBACK pfSymbol, - PF_DETOUR_BINARY_FINAL_CALLBACK pfFinal); -BOOL WINAPI DetourBinaryWrite(PDETOUR_BINARY pBinary, HANDLE hFile); -BOOL WINAPI DetourBinaryClose(PDETOUR_BINARY pBinary); - -/////////////////////////////////////////////// First Chance Exception Filter. -// -LPTOP_LEVEL_EXCEPTION_FILTER WINAPI -DetourFirstChanceExceptionFilter(LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelFilter); - -///////////////////////////////////////////////// Create Process & Inject Dll. -// -typedef BOOL (WINAPI *PDETOUR_CREATE_PROCESS_ROUTINEA) - (LPCSTR lpApplicationName, - LPSTR lpCommandLine, - LPSECURITY_ATTRIBUTES lpProcessAttributes, - LPSECURITY_ATTRIBUTES lpThreadAttributes, - BOOL bInheritHandles, - DWORD dwCreationFlags, - LPVOID lpEnvironment, - LPCSTR lpCurrentDirectory, - LPSTARTUPINFOA lpStartupInfo, - LPPROCESS_INFORMATION lpProcessInformation); - -typedef BOOL (WINAPI *PDETOUR_CREATE_PROCESS_ROUTINEW) - (LPCWSTR lpApplicationName, - LPWSTR lpCommandLine, - LPSECURITY_ATTRIBUTES lpProcessAttributes, - LPSECURITY_ATTRIBUTES lpThreadAttributes, - BOOL bInheritHandles, - DWORD dwCreationFlags, - LPVOID lpEnvironment, - LPCWSTR lpCurrentDirectory, - LPSTARTUPINFOW lpStartupInfo, - LPPROCESS_INFORMATION lpProcessInformation); - -BOOL WINAPI DetourCreateProcessWithDllA(LPCSTR lpApplicationName, - LPSTR lpCommandLine, - LPSECURITY_ATTRIBUTES lpProcessAttributes, - LPSECURITY_ATTRIBUTES lpThreadAttributes, - BOOL bInheritHandles, - DWORD dwCreationFlags, - LPVOID lpEnvironment, - LPCSTR lpCurrentDirectory, - LPSTARTUPINFOA lpStartupInfo, - LPPROCESS_INFORMATION lpProcessInformation, - LPCSTR lpDllName, - PDETOUR_CREATE_PROCESS_ROUTINEA - pfCreateProcessA); - -BOOL WINAPI DetourCreateProcessWithDllW(LPCWSTR lpApplicationName, - LPWSTR lpCommandLine, - LPSECURITY_ATTRIBUTES lpProcessAttributes, - LPSECURITY_ATTRIBUTES lpThreadAttributes, - BOOL bInheritHandles, - DWORD dwCreationFlags, - LPVOID lpEnvironment, - LPCWSTR lpCurrentDirectory, - LPSTARTUPINFOW lpStartupInfo, - LPPROCESS_INFORMATION lpProcessInformation, - LPCWSTR lpDllName, - PDETOUR_CREATE_PROCESS_ROUTINEW - pfCreateProcessW); - -#ifdef UNICODE -#define DetourCreateProcessWithDll DetourCreateProcessWithDllW -#define PDETOUR_CREATE_PROCESS_ROUTINE PDETOUR_CREATE_PROCESS_ROUTINEW -#else -#define DetourCreateProcessWithDll DetourCreateProcessWithDllA -#define PDETOUR_CREATE_PROCESS_ROUTINE PDETOUR_CREATE_PROCESS_ROUTINEA -#endif // !UNICODE - -BOOL WINAPI DetourContinueProcessWithDllA(HANDLE hProcess, LPCSTR lpDllName); -BOOL WINAPI DetourContinueProcessWithDllW(HANDLE hProcess, LPCWSTR lpDllName); - -#ifdef UNICODE -#define DetourContinueProcessWithDll DetourContinueProcessWithDllW -#else -#define DetourContinueProcessWithDll DetourContinueProcessWithDllA -#endif // !UNICODE -// -////////////////////////////////////////////////////////////////////////////// -#ifdef __cplusplus -} -#endif // __cplusplus - -/////////////////////////////////////////////////////////////////// Old Names. -// -#define ContinueProcessWithDll DetourContinueProcessWithDll -#define ContinueProcessWithDllA DetourContinueProcessWithDllA -#define ContinueProcessWithDllW DetourContinueProcessWithDllW -#define CreateProcessWithDll DetourCreateProcessWithDll -#define CreateProcessWithDllA DetourCreateProcessWithDllA -#define CreateProcessWithDllW DetourCreateProcessWithDllW -#define DETOUR_TRAMPOLINE_WO_TARGET DETOUR_TRAMPOLINE_EMPTY -#define DetourBinaryPurgePayload DetourBinaryPurgePayloads -#define DetourEnumerateExportsForInstance DetourEnumerateExports -#define DetourEnumerateInstances DetourEnumerateModules -#define DetourFindEntryPointForInstance DetourGetEntryPoint -#define DetourFindFinalCode DetourGetFinalCode -#define DetourFindPayloadInBinary DetourFindPayload -#define DetourGetSizeOfBinary DetourGetSizeOfPayloads -#define DetourRemoveWithTrampoline DetourRemove -#define PCREATE_PROCESS_ROUTINE PDETOUR_CREATE_PROCESS_ROUTINE -#define PCREATE_PROCESS_ROUTINEA PDETOUR_CREATE_PROCESS_ROUTINEA -#define PCREATE_PROCESS_ROUTINEW PDETOUR_CREATE_PROCESS_ROUTINEW -// - -//////////////////////////////////////////////// Detours Internal Definitions. -// -#ifdef __cplusplus -#ifdef DETOURS_INTERNAL - -////////////////////////////////////////////////////////////////////////////// -// -#ifdef IMAGEAPI // defined by IMAGEHLP.H -typedef LPAPI_VERSION (NTAPI *PF_ImagehlpApiVersionEx)(LPAPI_VERSION AppVersion); - -typedef BOOL (NTAPI *PF_SymInitialize)(IN HANDLE hProcess, - IN LPSTR UserSearchPath, - IN BOOL fInvadeProcess); -typedef DWORD (NTAPI *PF_SymSetOptions)(IN DWORD SymOptions); -typedef DWORD (NTAPI *PF_SymGetOptions)(VOID); -typedef BOOL (NTAPI *PF_SymLoadModule)(IN HANDLE hProcess, - IN HANDLE hFile, - IN PSTR ImageName, - IN PSTR ModuleName, - IN DWORD BaseOfDll, - IN DWORD SizeOfDll); -typedef BOOL (NTAPI *PF_SymGetModuleInfo)(IN HANDLE hProcess, - IN DWORD dwAddr, - OUT PIMAGEHLP_MODULE ModuleInfo); -typedef BOOL (NTAPI *PF_SymGetSymFromName)(IN HANDLE hProcess, - IN LPSTR Name, - OUT PIMAGEHLP_SYMBOL Symbol); -typedef BOOL (NTAPI *PF_BindImage)(IN LPSTR pszImageName, - IN LPSTR pszDllPath, - IN LPSTR pszSymbolPath); - -typedef struct _DETOUR_SYM_INFO -{ - HANDLE hProcess; - HMODULE hImageHlp; - PF_ImagehlpApiVersionEx pfImagehlpApiVersionEx; - PF_SymInitialize pfSymInitialize; - PF_SymSetOptions pfSymSetOptions; - PF_SymGetOptions pfSymGetOptions; - PF_SymLoadModule pfSymLoadModule; - PF_SymGetModuleInfo pfSymGetModuleInfo; - PF_SymGetSymFromName pfSymGetSymFromName; - PF_BindImage pfBindImage; -} DETOUR_SYM_INFO, *PDETOUR_SYM_INFO; - -PDETOUR_SYM_INFO DetourLoadImageHlp(VOID); - -#endif // IMAGEAPI - -////////////////////////////////////////////////////////////////////////////// -// -class CDetourEnableWriteOnCodePage -{ -public: - CDetourEnableWriteOnCodePage(PBYTE pbCode, LONG cbCode = DETOUR_TRAMPOLINE_SIZE) - { - m_pbCode = pbCode; - m_cbCode = cbCode; - m_dwOldPerm = 0; - m_hProcess = GetCurrentProcess(); - - if (m_pbCode && m_cbCode) { - if (!FlushInstructionCache(m_hProcess, pbCode, cbCode)) { - return; - } - if (!VirtualProtect(pbCode, - cbCode, - PAGE_EXECUTE_READWRITE, - &m_dwOldPerm)) { - return; - } - } - } - - ~CDetourEnableWriteOnCodePage() - { - if (m_dwOldPerm && m_pbCode && m_cbCode) { - DWORD dwTemp = 0; - if (!FlushInstructionCache(m_hProcess, m_pbCode, m_cbCode)) { - return; - } - if (!VirtualProtect(m_pbCode, m_cbCode, m_dwOldPerm, &dwTemp)) { - return; - } - } - } - - BOOL SetPermission(DWORD dwPerms) - { - if (m_dwOldPerm && m_pbCode && m_cbCode) { - m_dwOldPerm = dwPerms; - return TRUE; - } - return FALSE; - } - - BOOL IsValid(VOID) - { - return m_pbCode && m_cbCode && m_dwOldPerm; - } - -private: - HANDLE m_hProcess; - PBYTE m_pbCode; - LONG m_cbCode; - DWORD m_dwOldPerm; -}; - -////////////////////////////////////////////////////////////////////////////// -// -inline PBYTE DetourGenMovEax(PBYTE pbCode, UINT32 nValue) -{ - *pbCode++ = 0xB8; - *((UINT32*&)pbCode)++ = nValue; - return pbCode; -} - -inline PBYTE DetourGenMovEbx(PBYTE pbCode, UINT32 nValue) -{ - *pbCode++ = 0xBB; - *((UINT32*&)pbCode)++ = nValue; - return pbCode; -} - -inline PBYTE DetourGenMovEcx(PBYTE pbCode, UINT32 nValue) -{ - *pbCode++ = 0xB9; - *((UINT32*&)pbCode)++ = nValue; - return pbCode; -} - -inline PBYTE DetourGenMovEdx(PBYTE pbCode, UINT32 nValue) -{ - *pbCode++ = 0xBA; - *((UINT32*&)pbCode)++ = nValue; - return pbCode; -} - -inline PBYTE DetourGenMovEsi(PBYTE pbCode, UINT32 nValue) -{ - *pbCode++ = 0xBE; - *((UINT32*&)pbCode)++ = nValue; - return pbCode; -} - -inline PBYTE DetourGenMovEdi(PBYTE pbCode, UINT32 nValue) -{ - *pbCode++ = 0xBF; - *((UINT32*&)pbCode)++ = nValue; - return pbCode; -} - -inline PBYTE DetourGenMovEbp(PBYTE pbCode, UINT32 nValue) -{ - *pbCode++ = 0xBD; - *((UINT32*&)pbCode)++ = nValue; - return pbCode; -} - -inline PBYTE DetourGenMovEsp(PBYTE pbCode, UINT32 nValue) -{ - *pbCode++ = 0xBC; - *((UINT32*&)pbCode)++ = nValue; - return pbCode; -} - -inline PBYTE DetourGenPush(PBYTE pbCode, UINT32 nValue) -{ - *pbCode++ = 0x68; - *((UINT32*&)pbCode)++ = nValue; - return pbCode; -} - -inline PBYTE DetourGenPushad(PBYTE pbCode) -{ - *pbCode++ = 0x60; - return pbCode; -} - -inline PBYTE DetourGenPopad(PBYTE pbCode) -{ - *pbCode++ = 0x61; - return pbCode; -} - -inline PBYTE DetourGenJmp(PBYTE pbCode, PBYTE pbJmpDst, PBYTE pbJmpSrc = 0) -{ - if (pbJmpSrc == 0) { - pbJmpSrc = pbCode; - } - *pbCode++ = 0xE9; - *((INT32*&)pbCode)++ = pbJmpDst - (pbJmpSrc + 5); - return pbCode; -} - -inline PBYTE DetourGenCall(PBYTE pbCode, PBYTE pbJmpDst, PBYTE pbJmpSrc = 0) -{ - if (pbJmpSrc == 0) { - pbJmpSrc = pbCode; - } - *pbCode++ = 0xE8; - *((INT32*&)pbCode)++ = pbJmpDst - (pbJmpSrc + 5); - return pbCode; -} - -inline PBYTE DetourGenBreak(PBYTE pbCode) -{ - *pbCode++ = 0xcc; - return pbCode; -} - -inline PBYTE DetourGenRet(PBYTE pbCode) -{ - *pbCode++ = 0xc3; - return pbCode; -} - -inline PBYTE DetourGenNop(PBYTE pbCode) -{ - *pbCode++ = 0x90; - return pbCode; -} -#endif DETOURS_INTERAL -#endif // __cplusplus - -#endif // _DETOURS_H_ -// -//////////////////////////////////////////////////////////////// End of File. diff --git a/include/dsm/dsm.h b/include/dsm/dsm.h deleted file mode 100644 index 73082a1e0..000000000 --- a/include/dsm/dsm.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#pragma once - -#define DSMF_VERSION 0x01 - -#define DSMSW 0x44534D53ui64 -#define DSMSW_SIZE 4 - -enum dsmp_t -{ - DSMP_FILEINFO = 0, - DSMP_STREAMINFO = 1, - DSMP_MEDIATYPE = 2, - DSMP_CHAPTERS = 3, - DSMP_SAMPLE = 4, - DSMP_SYNCPOINTS = 5, - DSMP_RESOURCE = 6 -}; \ No newline at end of file diff --git a/include/dsm/dsm.txt b/include/dsm/dsm.txt deleted file mode 100644 index ed796278c..000000000 --- a/include/dsm/dsm.txt +++ /dev/null @@ -1,247 +0,0 @@ -/* - * Copyright (C) 2005 Gabest - * http://www.gabest.org - * - * This file format is free to use as long as its specification is not - * modified or extended without the permission of Gabest. Suggestions - * can be sent in email or posted to the forum at sf.net/projects/guliverkli. - * - */ - ------------------------ -The .dsm file structure ------------------------ - -FileInfo + Header Packets + Samples + Footer Packets - -Header & Footer Packets: -- Required: MediaType -- Optional: StreamInfo, Chapters, SyncPoints, Resource - -Notes: -- SyncPoints is optional because seeking can be performed simply by searching for packet syncpoints and their timestamps. -- This layout is fine for streaming. On connection send everything up to Sample packets, build the graph at the other end, then the rest when playing. (TODO: introduce NewSegment packet, to support seeking over network) -- The resolution of timestamp and duration is 100ns. -- Strings are zero terminated utf-8 strings. -- Date format string: "%Y-%m-%d %H:%M:%S". (GMT) -- Byte order is big-endian - -Definitions ------------ - -DSMF_VERSION = 0x01 - -DSMSW = 44534D53 ("DSMS") -DSMSW_SIZE = 4 - -DSMP_FILEINFO = 0 -DSMP_STREAMINFO = 1 -DSMP_MEDIATYPE = 2 -DSMP_CHAPTERS = 3 -DSMP_SAMPLE = 4 -DSMP_SYNCPOINTS = 5 -DSMP_RESOURCE = 6 - -Packet ------- - -DSMSW (DSMSW_SIZE bytes) (DirectShow Media SyncWord) -DSMP_* (5 bits) -data size length (3 bits -> 1-8 bytes) -data size (1-8 bytes) - -[... data ...] - -FileInfo : extends Packet (DSMP_FILEINFO) ------------------------------------------ - -version (1 byte, DSMF_VERSION) - -... repeated n times ... - -id (4 bytes, alphanum) -string - -... repeated n times ... - -Notes: -- Parsers should not open files with higher "version" than they were compiled for. -- Suggested values of "id": - "TITL": Title - "AUTH": Author - "RTNG": Rating - "CPYR": Copyright - "DESC": Description - "APPL": Application - "MUXR": Muxer - "DATE": Encoding date - ... more to be defined ... - -MediaType : extends Packet (DSMP_MEDIATYPE) -------------------------------------------- - -stream id (1 byte) - -majortype (sizeof(GUID)) -subtype (sizeof(GUID)) -bFixedSizeSamples (1 bit) -bTemporalCompression (1 bit) -lSampleSize (30 bit) -formattype (sizeof(GUID)) - -[... format data ...] - -Notes: -- Multiple MediaTypes per stream is NOT allowed -- bFixedSizeSamples, bTemporalCompression, lSampleSize are only there to preserve compatibility with dshow's media type structure, they aren't playing a role in anything really. - -StreamInfo : extends Packet (DSMP_STREAMINFO) ---------------------------------------------- - -stream id (1 byte) - -... repeated n times ... - -id (4 bytes, alphanum) -string - -... repeated n times ... - -Notes: -- Suggested values of "id": - "NAME": Stream name - "SGRP": Stream group (groupped streams can be useful if the splitter is able to group and switch between them, but it's not a strict requirement towards dsm splitters) - "LANG": Language code (ISO 639-2) - "DESC": Description - ... more to be defined ... - -Chapters : extends Packet (DSMP_CHAPTERS) ------------------------------------------ - -... repeated n times ... - -timestamp delta sign (1 bit, <0?) -timestamp delta length (3 bits -> 0-7 bytes) -reserved (4 bits) -timestamp delta (0-7 bytes) -string - -... repeated n times ... - -Notes: -- "timestamp delta" holds the difference to the previous value, starts at 0. - -Sample : extends Packet (DSMP_SAMPLE) -------------------------------------- - -stream id (1 byte) - -syncpoint (1 bit) -timestamp sign (1 bit, <0?) -timestamp length (3 bits -> 0-7 bytes) -duration length (3 bits -> 0-7 bytes) - -timestamp (0-7 bytes) -duration (0-7 bytes) - -[... data ...] - -Notes: -- sign == 1 && timestamp length == 0 -> timestamp and duration is unknown (but for syncpoints it cannot be unknown!) -- sign == 0 && timestamp length == 0 -> simply means the value is stored on zero bytes and its value is zero too. -- timestamps of syncpoints must be strictly in increasing order. -- timestamps can be negative (to allow cutting a file at anywhere, preroll samples may need to be saved) - -SyncPoints : extends Packet (DSMP_SYNCPOINTS) ---------------------------------------------- - -... repeated n times ... - -timestamp delta sign (1 bit, <0?) -timestamp delta length (3 bits -> 0-7 bytes) -file position delta length (3 bits -> 0-7 bytes) -reserved (1 bit) - -timestamp delta (0-7 bytes) -file position delta (0-7 bytes) - -... repeated n times ... - -Notes: -- "timestamp delta" / "file position delta" holds the difference to the previous value, both start at 0. - -The algorithm of SyncPoints generation --------------------------------------- - -First example: - -stream 1: 1,5,8 (video) -stream 2: 2,3,6,7,9 (audio) -stream 3: 4 (subtitle) - -1 ----| 1->2 1 +2 -> 1 (t 1, fp 1) - |---- 2 2->3 1,2 +3 -2 -> 1 - |---- 3 3->4 1,3 +4 -> 1 - +-|-- 4 (start) 4->5 1,3,4 +5 -1 -> 1 -5 --|-| 5->6 3,4,5 +6 -3 -> 3 (t 5, fp 3) - | |---- 6 6->7 4,5,6 +7 -6 -> 4 (t 6, fp 4) - | |---- 7 7->8 4,5,7 +8 -7 -4 -> 4 - +-|-- 4 (stop) - |---- 8 8->9 5,8 +9 -5 -> 5 (t 8, fp 5) -9 ----| 9->10 8,9 +10 -8 -> 8 (t 9, fp 8) - |---- 10 10-> 9,10 -> 9 (t 10, fp 9) - -Notice how it is the values of the first and last elements of the queue are used. - -In the end it represents the following: (timestamp ranges mapped to file positions) - -1->5: [1] -5->6: [3] -6->8: [4] -8->9: [5] -9->10: [8] -10->: [9] - -Example usage: - -Seeking to 7 would mean we need to start decoding at the file position of 4, which -makes sure we hit at least one syncpoint from every stream (4,5,7 and 6 too, but 6 -can be skipped) until we reach 7. - ---- - -Second example: - -This is going to be a bit more complicated case. (I hope you like my ascii art :) - -stream 1: 1,4,5,6,7 (video) -stream 2: 2,3 (subtitle) - -1 -----| 1->2 1 +2 -> 1 (t 1, fp 1) - +-|--- 2 (start) 2->3 1,2 (+3 NOT!) -> 1 - +-|-|- 3 (start) 3->4 1,2 +4 -1 -> 1 -4 -|-|-| 4->5 2,4 +5 -4 -> 2 (t 4, fp 2) -5 -|-|-| 5->6 2,5 +6 -5 -2 -> 2 - +-|-|- 3 (stop) - +-|--- 2 (stop) -6 -----| 6->7 6 +7 -6 -> 6 (t 6, fp 6) -7 -----| 7-> 7 -> 7 (t 7, fp 7) - -The problem with subtitles that they are discontinous, overlapped and can totally hide -other syncpoints, just like 2 hides 4, 5 and even 3 fully (which requires special handling, -see "NOT!"). That means such a subtitle, when it is too long, can influence seeking time -by a lot. It might be wise and worth limiting the duration of samples to a couple of minutes, -possibly sacrificing a bit of correctness by it. Splitters can also choose to ignore the -suggested seek position, when it falls too far from the required, and go on searching the -stream for syncpoints themselves. - -Resource : extends Packet (DSMP_RESOURCE) ------------------------------------------ - -compression type (2 bits, 0: none, 1: gzip, 2-3: reserved) -reserved (6 bits) -name string -desc string -mime string - -[... data ...] diff --git a/include/qedit.h b/include/qedit.h deleted file mode 100644 index 855720a8e..000000000 --- a/include/qedit.h +++ /dev/null @@ -1,6580 +0,0 @@ - - -/* this ALWAYS GENERATED file contains the definitions for the interfaces */ - - - /* File created by MIDL compiler version 7.00.0499 */ -/* Compiler settings for qedit.idl: - Oicf, W1, Zp8, env=Win32 (32b run) - protocol : dce , ms_ext, c_ext, robust - error checks: allocation ref bounds_check enum stub_data - VC __declspec() decoration level: - __declspec(uuid()), __declspec(selectany), __declspec(novtable) - DECLSPEC_UUID(), MIDL_INTERFACE() -*/ -//@@MIDL_FILE_HEADING( ) - -#pragma warning( disable: 4049 ) /* more than 64k source lines */ - - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCNDR_H_VERSION__ -#define __REQUIRED_RPCNDR_H_VERSION__ 500 -#endif - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCSAL_H_VERSION__ -#define __REQUIRED_RPCSAL_H_VERSION__ 100 -#endif - -#include "rpc.h" -#include "rpcndr.h" - -#ifndef __RPCNDR_H_VERSION__ -#error this stub requires an updated version of -#endif // __RPCNDR_H_VERSION__ - -#ifndef COM_NO_WINDOWS_H -#include "windows.h" -#include "ole2.h" -#endif /*COM_NO_WINDOWS_H*/ - -#ifndef __qedit_h__ -#define __qedit_h__ - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -#pragma once -#endif - -/* Forward Declarations */ - -#ifndef __IPropertySetter_FWD_DEFINED__ -#define __IPropertySetter_FWD_DEFINED__ -typedef interface IPropertySetter IPropertySetter; -#endif /* __IPropertySetter_FWD_DEFINED__ */ - - -#ifndef __IDxtCompositor_FWD_DEFINED__ -#define __IDxtCompositor_FWD_DEFINED__ -typedef interface IDxtCompositor IDxtCompositor; -#endif /* __IDxtCompositor_FWD_DEFINED__ */ - - -#ifndef __IDxtAlphaSetter_FWD_DEFINED__ -#define __IDxtAlphaSetter_FWD_DEFINED__ -typedef interface IDxtAlphaSetter IDxtAlphaSetter; -#endif /* __IDxtAlphaSetter_FWD_DEFINED__ */ - - -#ifndef __IDxtJpeg_FWD_DEFINED__ -#define __IDxtJpeg_FWD_DEFINED__ -typedef interface IDxtJpeg IDxtJpeg; -#endif /* __IDxtJpeg_FWD_DEFINED__ */ - - -#ifndef __IDxtKey_FWD_DEFINED__ -#define __IDxtKey_FWD_DEFINED__ -typedef interface IDxtKey IDxtKey; -#endif /* __IDxtKey_FWD_DEFINED__ */ - - -#ifndef __IMediaLocator_FWD_DEFINED__ -#define __IMediaLocator_FWD_DEFINED__ -typedef interface IMediaLocator IMediaLocator; -#endif /* __IMediaLocator_FWD_DEFINED__ */ - - -#ifndef __IMediaDet_FWD_DEFINED__ -#define __IMediaDet_FWD_DEFINED__ -typedef interface IMediaDet IMediaDet; -#endif /* __IMediaDet_FWD_DEFINED__ */ - - -#ifndef __IGrfCache_FWD_DEFINED__ -#define __IGrfCache_FWD_DEFINED__ -typedef interface IGrfCache IGrfCache; -#endif /* __IGrfCache_FWD_DEFINED__ */ - - -#ifndef __IRenderEngine_FWD_DEFINED__ -#define __IRenderEngine_FWD_DEFINED__ -typedef interface IRenderEngine IRenderEngine; -#endif /* __IRenderEngine_FWD_DEFINED__ */ - - -#ifndef __IRenderEngine2_FWD_DEFINED__ -#define __IRenderEngine2_FWD_DEFINED__ -typedef interface IRenderEngine2 IRenderEngine2; -#endif /* __IRenderEngine2_FWD_DEFINED__ */ - - -#ifndef __IFindCompressorCB_FWD_DEFINED__ -#define __IFindCompressorCB_FWD_DEFINED__ -typedef interface IFindCompressorCB IFindCompressorCB; -#endif /* __IFindCompressorCB_FWD_DEFINED__ */ - - -#ifndef __ISmartRenderEngine_FWD_DEFINED__ -#define __ISmartRenderEngine_FWD_DEFINED__ -typedef interface ISmartRenderEngine ISmartRenderEngine; -#endif /* __ISmartRenderEngine_FWD_DEFINED__ */ - - -#ifndef __IAMTimelineObj_FWD_DEFINED__ -#define __IAMTimelineObj_FWD_DEFINED__ -typedef interface IAMTimelineObj IAMTimelineObj; -#endif /* __IAMTimelineObj_FWD_DEFINED__ */ - - -#ifndef __IAMTimelineEffectable_FWD_DEFINED__ -#define __IAMTimelineEffectable_FWD_DEFINED__ -typedef interface IAMTimelineEffectable IAMTimelineEffectable; -#endif /* __IAMTimelineEffectable_FWD_DEFINED__ */ - - -#ifndef __IAMTimelineEffect_FWD_DEFINED__ -#define __IAMTimelineEffect_FWD_DEFINED__ -typedef interface IAMTimelineEffect IAMTimelineEffect; -#endif /* __IAMTimelineEffect_FWD_DEFINED__ */ - - -#ifndef __IAMTimelineTransable_FWD_DEFINED__ -#define __IAMTimelineTransable_FWD_DEFINED__ -typedef interface IAMTimelineTransable IAMTimelineTransable; -#endif /* __IAMTimelineTransable_FWD_DEFINED__ */ - - -#ifndef __IAMTimelineSplittable_FWD_DEFINED__ -#define __IAMTimelineSplittable_FWD_DEFINED__ -typedef interface IAMTimelineSplittable IAMTimelineSplittable; -#endif /* __IAMTimelineSplittable_FWD_DEFINED__ */ - - -#ifndef __IAMTimelineTrans_FWD_DEFINED__ -#define __IAMTimelineTrans_FWD_DEFINED__ -typedef interface IAMTimelineTrans IAMTimelineTrans; -#endif /* __IAMTimelineTrans_FWD_DEFINED__ */ - - -#ifndef __IAMTimelineSrc_FWD_DEFINED__ -#define __IAMTimelineSrc_FWD_DEFINED__ -typedef interface IAMTimelineSrc IAMTimelineSrc; -#endif /* __IAMTimelineSrc_FWD_DEFINED__ */ - - -#ifndef __IAMTimelineTrack_FWD_DEFINED__ -#define __IAMTimelineTrack_FWD_DEFINED__ -typedef interface IAMTimelineTrack IAMTimelineTrack; -#endif /* __IAMTimelineTrack_FWD_DEFINED__ */ - - -#ifndef __IAMTimelineVirtualTrack_FWD_DEFINED__ -#define __IAMTimelineVirtualTrack_FWD_DEFINED__ -typedef interface IAMTimelineVirtualTrack IAMTimelineVirtualTrack; -#endif /* __IAMTimelineVirtualTrack_FWD_DEFINED__ */ - - -#ifndef __IAMTimelineComp_FWD_DEFINED__ -#define __IAMTimelineComp_FWD_DEFINED__ -typedef interface IAMTimelineComp IAMTimelineComp; -#endif /* __IAMTimelineComp_FWD_DEFINED__ */ - - -#ifndef __IAMTimelineGroup_FWD_DEFINED__ -#define __IAMTimelineGroup_FWD_DEFINED__ -typedef interface IAMTimelineGroup IAMTimelineGroup; -#endif /* __IAMTimelineGroup_FWD_DEFINED__ */ - - -#ifndef __IAMTimeline_FWD_DEFINED__ -#define __IAMTimeline_FWD_DEFINED__ -typedef interface IAMTimeline IAMTimeline; -#endif /* __IAMTimeline_FWD_DEFINED__ */ - - -#ifndef __IXml2Dex_FWD_DEFINED__ -#define __IXml2Dex_FWD_DEFINED__ -typedef interface IXml2Dex IXml2Dex; -#endif /* __IXml2Dex_FWD_DEFINED__ */ - - -#ifndef __IAMErrorLog_FWD_DEFINED__ -#define __IAMErrorLog_FWD_DEFINED__ -typedef interface IAMErrorLog IAMErrorLog; -#endif /* __IAMErrorLog_FWD_DEFINED__ */ - - -#ifndef __IAMSetErrorLog_FWD_DEFINED__ -#define __IAMSetErrorLog_FWD_DEFINED__ -typedef interface IAMSetErrorLog IAMSetErrorLog; -#endif /* __IAMSetErrorLog_FWD_DEFINED__ */ - - -#ifndef __ISampleGrabberCB_FWD_DEFINED__ -#define __ISampleGrabberCB_FWD_DEFINED__ -typedef interface ISampleGrabberCB ISampleGrabberCB; -#endif /* __ISampleGrabberCB_FWD_DEFINED__ */ - - -#ifndef __ISampleGrabber_FWD_DEFINED__ -#define __ISampleGrabber_FWD_DEFINED__ -typedef interface ISampleGrabber ISampleGrabber; -#endif /* __ISampleGrabber_FWD_DEFINED__ */ - - -#ifndef __IResize_FWD_DEFINED__ -#define __IResize_FWD_DEFINED__ -typedef interface IResize IResize; -#endif /* __IResize_FWD_DEFINED__ */ - - -#ifndef __AMTimeline_FWD_DEFINED__ -#define __AMTimeline_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class AMTimeline AMTimeline; -#else -typedef struct AMTimeline AMTimeline; -#endif /* __cplusplus */ - -#endif /* __AMTimeline_FWD_DEFINED__ */ - - -#ifndef __AMTimelineObj_FWD_DEFINED__ -#define __AMTimelineObj_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class AMTimelineObj AMTimelineObj; -#else -typedef struct AMTimelineObj AMTimelineObj; -#endif /* __cplusplus */ - -#endif /* __AMTimelineObj_FWD_DEFINED__ */ - - -#ifndef __AMTimelineSrc_FWD_DEFINED__ -#define __AMTimelineSrc_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class AMTimelineSrc AMTimelineSrc; -#else -typedef struct AMTimelineSrc AMTimelineSrc; -#endif /* __cplusplus */ - -#endif /* __AMTimelineSrc_FWD_DEFINED__ */ - - -#ifndef __AMTimelineTrack_FWD_DEFINED__ -#define __AMTimelineTrack_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class AMTimelineTrack AMTimelineTrack; -#else -typedef struct AMTimelineTrack AMTimelineTrack; -#endif /* __cplusplus */ - -#endif /* __AMTimelineTrack_FWD_DEFINED__ */ - - -#ifndef __AMTimelineComp_FWD_DEFINED__ -#define __AMTimelineComp_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class AMTimelineComp AMTimelineComp; -#else -typedef struct AMTimelineComp AMTimelineComp; -#endif /* __cplusplus */ - -#endif /* __AMTimelineComp_FWD_DEFINED__ */ - - -#ifndef __AMTimelineGroup_FWD_DEFINED__ -#define __AMTimelineGroup_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class AMTimelineGroup AMTimelineGroup; -#else -typedef struct AMTimelineGroup AMTimelineGroup; -#endif /* __cplusplus */ - -#endif /* __AMTimelineGroup_FWD_DEFINED__ */ - - -#ifndef __AMTimelineTrans_FWD_DEFINED__ -#define __AMTimelineTrans_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class AMTimelineTrans AMTimelineTrans; -#else -typedef struct AMTimelineTrans AMTimelineTrans; -#endif /* __cplusplus */ - -#endif /* __AMTimelineTrans_FWD_DEFINED__ */ - - -#ifndef __AMTimelineEffect_FWD_DEFINED__ -#define __AMTimelineEffect_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class AMTimelineEffect AMTimelineEffect; -#else -typedef struct AMTimelineEffect AMTimelineEffect; -#endif /* __cplusplus */ - -#endif /* __AMTimelineEffect_FWD_DEFINED__ */ - - -#ifndef __RenderEngine_FWD_DEFINED__ -#define __RenderEngine_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class RenderEngine RenderEngine; -#else -typedef struct RenderEngine RenderEngine; -#endif /* __cplusplus */ - -#endif /* __RenderEngine_FWD_DEFINED__ */ - - -#ifndef __SmartRenderEngine_FWD_DEFINED__ -#define __SmartRenderEngine_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class SmartRenderEngine SmartRenderEngine; -#else -typedef struct SmartRenderEngine SmartRenderEngine; -#endif /* __cplusplus */ - -#endif /* __SmartRenderEngine_FWD_DEFINED__ */ - - -#ifndef __AudMixer_FWD_DEFINED__ -#define __AudMixer_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class AudMixer AudMixer; -#else -typedef struct AudMixer AudMixer; -#endif /* __cplusplus */ - -#endif /* __AudMixer_FWD_DEFINED__ */ - - -#ifndef __Xml2Dex_FWD_DEFINED__ -#define __Xml2Dex_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class Xml2Dex Xml2Dex; -#else -typedef struct Xml2Dex Xml2Dex; -#endif /* __cplusplus */ - -#endif /* __Xml2Dex_FWD_DEFINED__ */ - - -#ifndef __MediaLocator_FWD_DEFINED__ -#define __MediaLocator_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class MediaLocator MediaLocator; -#else -typedef struct MediaLocator MediaLocator; -#endif /* __cplusplus */ - -#endif /* __MediaLocator_FWD_DEFINED__ */ - - -#ifndef __PropertySetter_FWD_DEFINED__ -#define __PropertySetter_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class PropertySetter PropertySetter; -#else -typedef struct PropertySetter PropertySetter; -#endif /* __cplusplus */ - -#endif /* __PropertySetter_FWD_DEFINED__ */ - - -#ifndef __MediaDet_FWD_DEFINED__ -#define __MediaDet_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class MediaDet MediaDet; -#else -typedef struct MediaDet MediaDet; -#endif /* __cplusplus */ - -#endif /* __MediaDet_FWD_DEFINED__ */ - - -#ifndef __SampleGrabber_FWD_DEFINED__ -#define __SampleGrabber_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class SampleGrabber SampleGrabber; -#else -typedef struct SampleGrabber SampleGrabber; -#endif /* __cplusplus */ - -#endif /* __SampleGrabber_FWD_DEFINED__ */ - - -#ifndef __NullRenderer_FWD_DEFINED__ -#define __NullRenderer_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class NullRenderer NullRenderer; -#else -typedef struct NullRenderer NullRenderer; -#endif /* __cplusplus */ - -#endif /* __NullRenderer_FWD_DEFINED__ */ - - -#ifndef __DxtCompositor_FWD_DEFINED__ -#define __DxtCompositor_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class DxtCompositor DxtCompositor; -#else -typedef struct DxtCompositor DxtCompositor; -#endif /* __cplusplus */ - -#endif /* __DxtCompositor_FWD_DEFINED__ */ - - -#ifndef __DxtAlphaSetter_FWD_DEFINED__ -#define __DxtAlphaSetter_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class DxtAlphaSetter DxtAlphaSetter; -#else -typedef struct DxtAlphaSetter DxtAlphaSetter; -#endif /* __cplusplus */ - -#endif /* __DxtAlphaSetter_FWD_DEFINED__ */ - - -#ifndef __DxtJpeg_FWD_DEFINED__ -#define __DxtJpeg_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class DxtJpeg DxtJpeg; -#else -typedef struct DxtJpeg DxtJpeg; -#endif /* __cplusplus */ - -#endif /* __DxtJpeg_FWD_DEFINED__ */ - - -#ifndef __ColorSource_FWD_DEFINED__ -#define __ColorSource_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class ColorSource ColorSource; -#else -typedef struct ColorSource ColorSource; -#endif /* __cplusplus */ - -#endif /* __ColorSource_FWD_DEFINED__ */ - - -#ifndef __DxtKey_FWD_DEFINED__ -#define __DxtKey_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class DxtKey DxtKey; -#else -typedef struct DxtKey DxtKey; -#endif /* __cplusplus */ - -#endif /* __DxtKey_FWD_DEFINED__ */ - - -/* header files for imported files */ -#include "oaidl.h" -#include "ocidl.h" -#include "dxtrans.h" -#include "amstream.h" - -#ifdef __cplusplus -extern "C"{ -#endif - - -/* interface __MIDL_itf_qedit_0000_0000 */ -/* [local] */ - - -typedef /* [public] */ -enum __MIDL___MIDL_itf_qedit_0000_0000_0001 - { DEXTERF_JUMP = 0, - DEXTERF_INTERPOLATE = ( DEXTERF_JUMP + 1 ) - } DEXTERF; - -typedef /* [public][public][public][public] */ struct __MIDL___MIDL_itf_qedit_0000_0000_0002 - { - BSTR Name; - DISPID dispID; - LONG nValues; - } DEXTER_PARAM; - -typedef /* [public][public][public][public] */ struct __MIDL___MIDL_itf_qedit_0000_0000_0003 - { - VARIANT v; - REFERENCE_TIME rt; - DWORD dwInterp; - } DEXTER_VALUE; - - -enum __MIDL___MIDL_itf_qedit_0000_0000_0004 - { DEXTER_AUDIO_JUMP = 0, - DEXTER_AUDIO_INTERPOLATE = ( DEXTER_AUDIO_JUMP + 1 ) - } ; -typedef /* [public] */ struct __MIDL___MIDL_itf_qedit_0000_0000_0005 - { - REFERENCE_TIME rtEnd; - double dLevel; - BOOL bMethod; - } DEXTER_AUDIO_VOLUMEENVELOPE; - - -enum __MIDL___MIDL_itf_qedit_0000_0000_0006 - { TIMELINE_INSERT_MODE_INSERT = 1, - TIMELINE_INSERT_MODE_OVERLAY = 2 - } ; -typedef /* [public][public][public][public][public][public][public][public] */ -enum __MIDL___MIDL_itf_qedit_0000_0000_0007 - { TIMELINE_MAJOR_TYPE_COMPOSITE = 1, - TIMELINE_MAJOR_TYPE_TRACK = 2, - TIMELINE_MAJOR_TYPE_SOURCE = 4, - TIMELINE_MAJOR_TYPE_TRANSITION = 8, - TIMELINE_MAJOR_TYPE_EFFECT = 16, - TIMELINE_MAJOR_TYPE_GROUP = 128 - } TIMELINE_MAJOR_TYPE; - -typedef /* [public] */ -enum __MIDL___MIDL_itf_qedit_0000_0000_0008 - { DEXTERF_BOUNDING = -1, - DEXTERF_EXACTLY_AT = 0, - DEXTERF_FORWARDS = 1 - } DEXTERF_TRACK_SEARCH_FLAGS; - -typedef struct _SCompFmt0 - { - long nFormatId; - AM_MEDIA_TYPE MediaType; - } SCompFmt0; - - -enum __MIDL___MIDL_itf_qedit_0000_0000_0009 - { RESIZEF_STRETCH = 0, - RESIZEF_CROP = ( RESIZEF_STRETCH + 1 ) , - RESIZEF_PRESERVEASPECTRATIO = ( RESIZEF_CROP + 1 ) , - RESIZEF_PRESERVEASPECTRATIO_NOLETTERBOX = ( RESIZEF_PRESERVEASPECTRATIO + 1 ) - } ; - -enum __MIDL___MIDL_itf_qedit_0000_0000_0010 - { CONNECTF_DYNAMIC_NONE = 0, - CONNECTF_DYNAMIC_SOURCES = 0x1, - CONNECTF_DYNAMIC_EFFECTS = 0x2 - } ; - -enum __MIDL___MIDL_itf_qedit_0000_0000_0011 - { SFN_VALIDATEF_CHECK = 0x1, - SFN_VALIDATEF_POPUP = 0x2, - SFN_VALIDATEF_TELLME = 0x4, - SFN_VALIDATEF_REPLACE = 0x8, - SFN_VALIDATEF_USELOCAL = 0x10, - SFN_VALIDATEF_NOFIND = 0x20, - SFN_VALIDATEF_IGNOREMUTED = 0x40, - SFN_VALIDATEF_END = ( SFN_VALIDATEF_IGNOREMUTED + 1 ) - } ; - -enum __MIDL___MIDL_itf_qedit_0000_0000_0012 - { DXTKEY_RGB = 0, - DXTKEY_NONRED = ( DXTKEY_RGB + 1 ) , - DXTKEY_LUMINANCE = ( DXTKEY_NONRED + 1 ) , - DXTKEY_ALPHA = ( DXTKEY_LUMINANCE + 1 ) , - DXTKEY_HUE = ( DXTKEY_ALPHA + 1 ) - } ; - - -extern RPC_IF_HANDLE __MIDL_itf_qedit_0000_0000_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_qedit_0000_0000_v0_0_s_ifspec; - -#ifndef __IPropertySetter_INTERFACE_DEFINED__ -#define __IPropertySetter_INTERFACE_DEFINED__ - -/* interface IPropertySetter */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IPropertySetter; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("AE9472BD-B0C3-11D2-8D24-00A0C9441E20") - IPropertySetter : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE LoadXML( - /* [in] */ __RPC__in_opt IUnknown *pxml) = 0; - - virtual HRESULT STDMETHODCALLTYPE PrintXML( - /* [out] */ __RPC__out char *pszXML, - /* [in] */ int cbXML, - /* [out] */ __RPC__out int *pcbPrinted, - /* [in] */ int indent) = 0; - - virtual HRESULT STDMETHODCALLTYPE CloneProps( - /* [out] */ __RPC__deref_out_opt IPropertySetter **ppSetter, - /* [in] */ REFERENCE_TIME rtStart, - /* [in] */ REFERENCE_TIME rtStop) = 0; - - virtual HRESULT STDMETHODCALLTYPE AddProp( - /* [in] */ DEXTER_PARAM Param, - /* [in] */ __RPC__in DEXTER_VALUE *paValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetProps( - /* [out] */ __RPC__out LONG *pcParams, - /* [out] */ __RPC__deref_out_opt DEXTER_PARAM **paParam, - /* [out] */ __RPC__deref_out_opt DEXTER_VALUE **paValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE FreeProps( - /* [in] */ LONG cParams, - /* [in] */ __RPC__in DEXTER_PARAM *paParam, - /* [in] */ __RPC__in DEXTER_VALUE *paValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE ClearProps( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE SaveToBlob( - /* [out] */ __RPC__out LONG *pcSize, - /* [out] */ __RPC__deref_out_opt BYTE **ppb) = 0; - - virtual HRESULT STDMETHODCALLTYPE LoadFromBlob( - /* [in] */ LONG cSize, - /* [in] */ __RPC__in BYTE *pb) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetProps( - /* [in] */ __RPC__in_opt IUnknown *pTarget, - /* [in] */ REFERENCE_TIME rtNow) = 0; - - virtual HRESULT STDMETHODCALLTYPE PrintXMLW( - /* [out] */ __RPC__out WCHAR *pszXML, - /* [in] */ int cchXML, - /* [out] */ __RPC__out int *pcchPrinted, - /* [in] */ int indent) = 0; - - }; - -#else /* C style interface */ - - typedef struct IPropertySetterVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IPropertySetter * This, - /* [in] */ __RPC__in REFIID riid, - /* [iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IPropertySetter * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IPropertySetter * This); - - HRESULT ( STDMETHODCALLTYPE *LoadXML )( - IPropertySetter * This, - /* [in] */ __RPC__in_opt IUnknown *pxml); - - HRESULT ( STDMETHODCALLTYPE *PrintXML )( - IPropertySetter * This, - /* [out] */ __RPC__out char *pszXML, - /* [in] */ int cbXML, - /* [out] */ __RPC__out int *pcbPrinted, - /* [in] */ int indent); - - HRESULT ( STDMETHODCALLTYPE *CloneProps )( - IPropertySetter * This, - /* [out] */ __RPC__deref_out_opt IPropertySetter **ppSetter, - /* [in] */ REFERENCE_TIME rtStart, - /* [in] */ REFERENCE_TIME rtStop); - - HRESULT ( STDMETHODCALLTYPE *AddProp )( - IPropertySetter * This, - /* [in] */ DEXTER_PARAM Param, - /* [in] */ __RPC__in DEXTER_VALUE *paValue); - - HRESULT ( STDMETHODCALLTYPE *GetProps )( - IPropertySetter * This, - /* [out] */ __RPC__out LONG *pcParams, - /* [out] */ __RPC__deref_out_opt DEXTER_PARAM **paParam, - /* [out] */ __RPC__deref_out_opt DEXTER_VALUE **paValue); - - HRESULT ( STDMETHODCALLTYPE *FreeProps )( - IPropertySetter * This, - /* [in] */ LONG cParams, - /* [in] */ __RPC__in DEXTER_PARAM *paParam, - /* [in] */ __RPC__in DEXTER_VALUE *paValue); - - HRESULT ( STDMETHODCALLTYPE *ClearProps )( - IPropertySetter * This); - - HRESULT ( STDMETHODCALLTYPE *SaveToBlob )( - IPropertySetter * This, - /* [out] */ __RPC__out LONG *pcSize, - /* [out] */ __RPC__deref_out_opt BYTE **ppb); - - HRESULT ( STDMETHODCALLTYPE *LoadFromBlob )( - IPropertySetter * This, - /* [in] */ LONG cSize, - /* [in] */ __RPC__in BYTE *pb); - - HRESULT ( STDMETHODCALLTYPE *SetProps )( - IPropertySetter * This, - /* [in] */ __RPC__in_opt IUnknown *pTarget, - /* [in] */ REFERENCE_TIME rtNow); - - HRESULT ( STDMETHODCALLTYPE *PrintXMLW )( - IPropertySetter * This, - /* [out] */ __RPC__out WCHAR *pszXML, - /* [in] */ int cchXML, - /* [out] */ __RPC__out int *pcchPrinted, - /* [in] */ int indent); - - END_INTERFACE - } IPropertySetterVtbl; - - interface IPropertySetter - { - CONST_VTBL struct IPropertySetterVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IPropertySetter_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IPropertySetter_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IPropertySetter_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IPropertySetter_LoadXML(This,pxml) \ - ( (This)->lpVtbl -> LoadXML(This,pxml) ) - -#define IPropertySetter_PrintXML(This,pszXML,cbXML,pcbPrinted,indent) \ - ( (This)->lpVtbl -> PrintXML(This,pszXML,cbXML,pcbPrinted,indent) ) - -#define IPropertySetter_CloneProps(This,ppSetter,rtStart,rtStop) \ - ( (This)->lpVtbl -> CloneProps(This,ppSetter,rtStart,rtStop) ) - -#define IPropertySetter_AddProp(This,Param,paValue) \ - ( (This)->lpVtbl -> AddProp(This,Param,paValue) ) - -#define IPropertySetter_GetProps(This,pcParams,paParam,paValue) \ - ( (This)->lpVtbl -> GetProps(This,pcParams,paParam,paValue) ) - -#define IPropertySetter_FreeProps(This,cParams,paParam,paValue) \ - ( (This)->lpVtbl -> FreeProps(This,cParams,paParam,paValue) ) - -#define IPropertySetter_ClearProps(This) \ - ( (This)->lpVtbl -> ClearProps(This) ) - -#define IPropertySetter_SaveToBlob(This,pcSize,ppb) \ - ( (This)->lpVtbl -> SaveToBlob(This,pcSize,ppb) ) - -#define IPropertySetter_LoadFromBlob(This,cSize,pb) \ - ( (This)->lpVtbl -> LoadFromBlob(This,cSize,pb) ) - -#define IPropertySetter_SetProps(This,pTarget,rtNow) \ - ( (This)->lpVtbl -> SetProps(This,pTarget,rtNow) ) - -#define IPropertySetter_PrintXMLW(This,pszXML,cchXML,pcchPrinted,indent) \ - ( (This)->lpVtbl -> PrintXMLW(This,pszXML,cchXML,pcchPrinted,indent) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IPropertySetter_INTERFACE_DEFINED__ */ - - -#ifndef __IDxtCompositor_INTERFACE_DEFINED__ -#define __IDxtCompositor_INTERFACE_DEFINED__ - -/* interface IDxtCompositor */ -/* [unique][helpstring][dual][uuid][object] */ - - -EXTERN_C const IID IID_IDxtCompositor; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("BB44391E-6ABD-422f-9E2E-385C9DFF51FC") - IDxtCompositor : public IDXEffect - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_OffsetX( - /* [retval][out] */ __RPC__out long *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_OffsetX( - /* [in] */ long newVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_OffsetY( - /* [retval][out] */ __RPC__out long *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_OffsetY( - /* [in] */ long newVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Width( - /* [retval][out] */ __RPC__out long *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Width( - /* [in] */ long newVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Height( - /* [retval][out] */ __RPC__out long *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Height( - /* [in] */ long newVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_SrcOffsetX( - /* [retval][out] */ __RPC__out long *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_SrcOffsetX( - /* [in] */ long newVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_SrcOffsetY( - /* [retval][out] */ __RPC__out long *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_SrcOffsetY( - /* [in] */ long newVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_SrcWidth( - /* [retval][out] */ __RPC__out long *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_SrcWidth( - /* [in] */ long newVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_SrcHeight( - /* [retval][out] */ __RPC__out long *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_SrcHeight( - /* [in] */ long newVal) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDxtCompositorVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDxtCompositor * This, - /* [in] */ __RPC__in REFIID riid, - /* [iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDxtCompositor * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDxtCompositor * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IDxtCompositor * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IDxtCompositor * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IDxtCompositor * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IDxtCompositor * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Capabilities )( - IDxtCompositor * This, - /* [retval][out] */ __RPC__out long *pVal); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Progress )( - IDxtCompositor * This, - /* [retval][out] */ __RPC__out float *pVal); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Progress )( - IDxtCompositor * This, - /* [in] */ float newVal); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_StepResolution )( - IDxtCompositor * This, - /* [retval][out] */ __RPC__out float *pVal); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Duration )( - IDxtCompositor * This, - /* [retval][out] */ __RPC__out float *pVal); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Duration )( - IDxtCompositor * This, - /* [in] */ float newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_OffsetX )( - IDxtCompositor * This, - /* [retval][out] */ __RPC__out long *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_OffsetX )( - IDxtCompositor * This, - /* [in] */ long newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_OffsetY )( - IDxtCompositor * This, - /* [retval][out] */ __RPC__out long *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_OffsetY )( - IDxtCompositor * This, - /* [in] */ long newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Width )( - IDxtCompositor * This, - /* [retval][out] */ __RPC__out long *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Width )( - IDxtCompositor * This, - /* [in] */ long newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Height )( - IDxtCompositor * This, - /* [retval][out] */ __RPC__out long *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Height )( - IDxtCompositor * This, - /* [in] */ long newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_SrcOffsetX )( - IDxtCompositor * This, - /* [retval][out] */ __RPC__out long *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_SrcOffsetX )( - IDxtCompositor * This, - /* [in] */ long newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_SrcOffsetY )( - IDxtCompositor * This, - /* [retval][out] */ __RPC__out long *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_SrcOffsetY )( - IDxtCompositor * This, - /* [in] */ long newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_SrcWidth )( - IDxtCompositor * This, - /* [retval][out] */ __RPC__out long *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_SrcWidth )( - IDxtCompositor * This, - /* [in] */ long newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_SrcHeight )( - IDxtCompositor * This, - /* [retval][out] */ __RPC__out long *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_SrcHeight )( - IDxtCompositor * This, - /* [in] */ long newVal); - - END_INTERFACE - } IDxtCompositorVtbl; - - interface IDxtCompositor - { - CONST_VTBL struct IDxtCompositorVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDxtCompositor_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IDxtCompositor_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IDxtCompositor_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IDxtCompositor_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define IDxtCompositor_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define IDxtCompositor_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define IDxtCompositor_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define IDxtCompositor_get_Capabilities(This,pVal) \ - ( (This)->lpVtbl -> get_Capabilities(This,pVal) ) - -#define IDxtCompositor_get_Progress(This,pVal) \ - ( (This)->lpVtbl -> get_Progress(This,pVal) ) - -#define IDxtCompositor_put_Progress(This,newVal) \ - ( (This)->lpVtbl -> put_Progress(This,newVal) ) - -#define IDxtCompositor_get_StepResolution(This,pVal) \ - ( (This)->lpVtbl -> get_StepResolution(This,pVal) ) - -#define IDxtCompositor_get_Duration(This,pVal) \ - ( (This)->lpVtbl -> get_Duration(This,pVal) ) - -#define IDxtCompositor_put_Duration(This,newVal) \ - ( (This)->lpVtbl -> put_Duration(This,newVal) ) - - -#define IDxtCompositor_get_OffsetX(This,pVal) \ - ( (This)->lpVtbl -> get_OffsetX(This,pVal) ) - -#define IDxtCompositor_put_OffsetX(This,newVal) \ - ( (This)->lpVtbl -> put_OffsetX(This,newVal) ) - -#define IDxtCompositor_get_OffsetY(This,pVal) \ - ( (This)->lpVtbl -> get_OffsetY(This,pVal) ) - -#define IDxtCompositor_put_OffsetY(This,newVal) \ - ( (This)->lpVtbl -> put_OffsetY(This,newVal) ) - -#define IDxtCompositor_get_Width(This,pVal) \ - ( (This)->lpVtbl -> get_Width(This,pVal) ) - -#define IDxtCompositor_put_Width(This,newVal) \ - ( (This)->lpVtbl -> put_Width(This,newVal) ) - -#define IDxtCompositor_get_Height(This,pVal) \ - ( (This)->lpVtbl -> get_Height(This,pVal) ) - -#define IDxtCompositor_put_Height(This,newVal) \ - ( (This)->lpVtbl -> put_Height(This,newVal) ) - -#define IDxtCompositor_get_SrcOffsetX(This,pVal) \ - ( (This)->lpVtbl -> get_SrcOffsetX(This,pVal) ) - -#define IDxtCompositor_put_SrcOffsetX(This,newVal) \ - ( (This)->lpVtbl -> put_SrcOffsetX(This,newVal) ) - -#define IDxtCompositor_get_SrcOffsetY(This,pVal) \ - ( (This)->lpVtbl -> get_SrcOffsetY(This,pVal) ) - -#define IDxtCompositor_put_SrcOffsetY(This,newVal) \ - ( (This)->lpVtbl -> put_SrcOffsetY(This,newVal) ) - -#define IDxtCompositor_get_SrcWidth(This,pVal) \ - ( (This)->lpVtbl -> get_SrcWidth(This,pVal) ) - -#define IDxtCompositor_put_SrcWidth(This,newVal) \ - ( (This)->lpVtbl -> put_SrcWidth(This,newVal) ) - -#define IDxtCompositor_get_SrcHeight(This,pVal) \ - ( (This)->lpVtbl -> get_SrcHeight(This,pVal) ) - -#define IDxtCompositor_put_SrcHeight(This,newVal) \ - ( (This)->lpVtbl -> put_SrcHeight(This,newVal) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IDxtCompositor_INTERFACE_DEFINED__ */ - - -#ifndef __IDxtAlphaSetter_INTERFACE_DEFINED__ -#define __IDxtAlphaSetter_INTERFACE_DEFINED__ - -/* interface IDxtAlphaSetter */ -/* [unique][helpstring][dual][uuid][object] */ - - -EXTERN_C const IID IID_IDxtAlphaSetter; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("4EE9EAD9-DA4D-43d0-9383-06B90C08B12B") - IDxtAlphaSetter : public IDXEffect - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Alpha( - /* [retval][out] */ __RPC__out long *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Alpha( - /* [in] */ long newVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_AlphaRamp( - /* [retval][out] */ __RPC__out double *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_AlphaRamp( - /* [in] */ double newVal) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDxtAlphaSetterVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDxtAlphaSetter * This, - /* [in] */ __RPC__in REFIID riid, - /* [iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDxtAlphaSetter * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDxtAlphaSetter * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IDxtAlphaSetter * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IDxtAlphaSetter * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IDxtAlphaSetter * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IDxtAlphaSetter * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Capabilities )( - IDxtAlphaSetter * This, - /* [retval][out] */ __RPC__out long *pVal); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Progress )( - IDxtAlphaSetter * This, - /* [retval][out] */ __RPC__out float *pVal); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Progress )( - IDxtAlphaSetter * This, - /* [in] */ float newVal); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_StepResolution )( - IDxtAlphaSetter * This, - /* [retval][out] */ __RPC__out float *pVal); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Duration )( - IDxtAlphaSetter * This, - /* [retval][out] */ __RPC__out float *pVal); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Duration )( - IDxtAlphaSetter * This, - /* [in] */ float newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Alpha )( - IDxtAlphaSetter * This, - /* [retval][out] */ __RPC__out long *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Alpha )( - IDxtAlphaSetter * This, - /* [in] */ long newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_AlphaRamp )( - IDxtAlphaSetter * This, - /* [retval][out] */ __RPC__out double *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_AlphaRamp )( - IDxtAlphaSetter * This, - /* [in] */ double newVal); - - END_INTERFACE - } IDxtAlphaSetterVtbl; - - interface IDxtAlphaSetter - { - CONST_VTBL struct IDxtAlphaSetterVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDxtAlphaSetter_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IDxtAlphaSetter_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IDxtAlphaSetter_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IDxtAlphaSetter_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define IDxtAlphaSetter_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define IDxtAlphaSetter_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define IDxtAlphaSetter_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define IDxtAlphaSetter_get_Capabilities(This,pVal) \ - ( (This)->lpVtbl -> get_Capabilities(This,pVal) ) - -#define IDxtAlphaSetter_get_Progress(This,pVal) \ - ( (This)->lpVtbl -> get_Progress(This,pVal) ) - -#define IDxtAlphaSetter_put_Progress(This,newVal) \ - ( (This)->lpVtbl -> put_Progress(This,newVal) ) - -#define IDxtAlphaSetter_get_StepResolution(This,pVal) \ - ( (This)->lpVtbl -> get_StepResolution(This,pVal) ) - -#define IDxtAlphaSetter_get_Duration(This,pVal) \ - ( (This)->lpVtbl -> get_Duration(This,pVal) ) - -#define IDxtAlphaSetter_put_Duration(This,newVal) \ - ( (This)->lpVtbl -> put_Duration(This,newVal) ) - - -#define IDxtAlphaSetter_get_Alpha(This,pVal) \ - ( (This)->lpVtbl -> get_Alpha(This,pVal) ) - -#define IDxtAlphaSetter_put_Alpha(This,newVal) \ - ( (This)->lpVtbl -> put_Alpha(This,newVal) ) - -#define IDxtAlphaSetter_get_AlphaRamp(This,pVal) \ - ( (This)->lpVtbl -> get_AlphaRamp(This,pVal) ) - -#define IDxtAlphaSetter_put_AlphaRamp(This,newVal) \ - ( (This)->lpVtbl -> put_AlphaRamp(This,newVal) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IDxtAlphaSetter_INTERFACE_DEFINED__ */ - - -#ifndef __IDxtJpeg_INTERFACE_DEFINED__ -#define __IDxtJpeg_INTERFACE_DEFINED__ - -/* interface IDxtJpeg */ -/* [unique][helpstring][dual][uuid][object] */ - - -EXTERN_C const IID IID_IDxtJpeg; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("DE75D011-7A65-11D2-8CEA-00A0C9441E20") - IDxtJpeg : public IDXEffect - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_MaskNum( - /* [retval][out] */ __RPC__out long *__MIDL__IDxtJpeg0000) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_MaskNum( - /* [in] */ long __MIDL__IDxtJpeg0001) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_MaskName( - /* [retval][out] */ __RPC__deref_out_opt BSTR *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_MaskName( - /* [in] */ __RPC__in BSTR newVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ScaleX( - /* [retval][out] */ __RPC__out double *__MIDL__IDxtJpeg0002) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_ScaleX( - /* [in] */ double __MIDL__IDxtJpeg0003) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ScaleY( - /* [retval][out] */ __RPC__out double *__MIDL__IDxtJpeg0004) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_ScaleY( - /* [in] */ double __MIDL__IDxtJpeg0005) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_OffsetX( - /* [retval][out] */ __RPC__out long *__MIDL__IDxtJpeg0006) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_OffsetX( - /* [in] */ long __MIDL__IDxtJpeg0007) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_OffsetY( - /* [retval][out] */ __RPC__out long *__MIDL__IDxtJpeg0008) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_OffsetY( - /* [in] */ long __MIDL__IDxtJpeg0009) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ReplicateX( - /* [retval][out] */ __RPC__out long *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_ReplicateX( - /* [in] */ long newVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ReplicateY( - /* [retval][out] */ __RPC__out long *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_ReplicateY( - /* [in] */ long newVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_BorderColor( - /* [retval][out] */ __RPC__out long *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_BorderColor( - /* [in] */ long newVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_BorderWidth( - /* [retval][out] */ __RPC__out long *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_BorderWidth( - /* [in] */ long newVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_BorderSoftness( - /* [retval][out] */ __RPC__out long *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_BorderSoftness( - /* [in] */ long newVal) = 0; - - virtual HRESULT STDMETHODCALLTYPE ApplyChanges( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE LoadDefSettings( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDxtJpegVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDxtJpeg * This, - /* [in] */ __RPC__in REFIID riid, - /* [iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDxtJpeg * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDxtJpeg * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IDxtJpeg * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IDxtJpeg * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IDxtJpeg * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IDxtJpeg * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Capabilities )( - IDxtJpeg * This, - /* [retval][out] */ __RPC__out long *pVal); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Progress )( - IDxtJpeg * This, - /* [retval][out] */ __RPC__out float *pVal); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Progress )( - IDxtJpeg * This, - /* [in] */ float newVal); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_StepResolution )( - IDxtJpeg * This, - /* [retval][out] */ __RPC__out float *pVal); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Duration )( - IDxtJpeg * This, - /* [retval][out] */ __RPC__out float *pVal); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Duration )( - IDxtJpeg * This, - /* [in] */ float newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MaskNum )( - IDxtJpeg * This, - /* [retval][out] */ __RPC__out long *__MIDL__IDxtJpeg0000); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MaskNum )( - IDxtJpeg * This, - /* [in] */ long __MIDL__IDxtJpeg0001); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MaskName )( - IDxtJpeg * This, - /* [retval][out] */ __RPC__deref_out_opt BSTR *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MaskName )( - IDxtJpeg * This, - /* [in] */ __RPC__in BSTR newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ScaleX )( - IDxtJpeg * This, - /* [retval][out] */ __RPC__out double *__MIDL__IDxtJpeg0002); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_ScaleX )( - IDxtJpeg * This, - /* [in] */ double __MIDL__IDxtJpeg0003); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ScaleY )( - IDxtJpeg * This, - /* [retval][out] */ __RPC__out double *__MIDL__IDxtJpeg0004); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_ScaleY )( - IDxtJpeg * This, - /* [in] */ double __MIDL__IDxtJpeg0005); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_OffsetX )( - IDxtJpeg * This, - /* [retval][out] */ __RPC__out long *__MIDL__IDxtJpeg0006); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_OffsetX )( - IDxtJpeg * This, - /* [in] */ long __MIDL__IDxtJpeg0007); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_OffsetY )( - IDxtJpeg * This, - /* [retval][out] */ __RPC__out long *__MIDL__IDxtJpeg0008); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_OffsetY )( - IDxtJpeg * This, - /* [in] */ long __MIDL__IDxtJpeg0009); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ReplicateX )( - IDxtJpeg * This, - /* [retval][out] */ __RPC__out long *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_ReplicateX )( - IDxtJpeg * This, - /* [in] */ long newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ReplicateY )( - IDxtJpeg * This, - /* [retval][out] */ __RPC__out long *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_ReplicateY )( - IDxtJpeg * This, - /* [in] */ long newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_BorderColor )( - IDxtJpeg * This, - /* [retval][out] */ __RPC__out long *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_BorderColor )( - IDxtJpeg * This, - /* [in] */ long newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_BorderWidth )( - IDxtJpeg * This, - /* [retval][out] */ __RPC__out long *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_BorderWidth )( - IDxtJpeg * This, - /* [in] */ long newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_BorderSoftness )( - IDxtJpeg * This, - /* [retval][out] */ __RPC__out long *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_BorderSoftness )( - IDxtJpeg * This, - /* [in] */ long newVal); - - HRESULT ( STDMETHODCALLTYPE *ApplyChanges )( - IDxtJpeg * This); - - HRESULT ( STDMETHODCALLTYPE *LoadDefSettings )( - IDxtJpeg * This); - - END_INTERFACE - } IDxtJpegVtbl; - - interface IDxtJpeg - { - CONST_VTBL struct IDxtJpegVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDxtJpeg_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IDxtJpeg_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IDxtJpeg_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IDxtJpeg_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define IDxtJpeg_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define IDxtJpeg_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define IDxtJpeg_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define IDxtJpeg_get_Capabilities(This,pVal) \ - ( (This)->lpVtbl -> get_Capabilities(This,pVal) ) - -#define IDxtJpeg_get_Progress(This,pVal) \ - ( (This)->lpVtbl -> get_Progress(This,pVal) ) - -#define IDxtJpeg_put_Progress(This,newVal) \ - ( (This)->lpVtbl -> put_Progress(This,newVal) ) - -#define IDxtJpeg_get_StepResolution(This,pVal) \ - ( (This)->lpVtbl -> get_StepResolution(This,pVal) ) - -#define IDxtJpeg_get_Duration(This,pVal) \ - ( (This)->lpVtbl -> get_Duration(This,pVal) ) - -#define IDxtJpeg_put_Duration(This,newVal) \ - ( (This)->lpVtbl -> put_Duration(This,newVal) ) - - -#define IDxtJpeg_get_MaskNum(This,__MIDL__IDxtJpeg0000) \ - ( (This)->lpVtbl -> get_MaskNum(This,__MIDL__IDxtJpeg0000) ) - -#define IDxtJpeg_put_MaskNum(This,__MIDL__IDxtJpeg0001) \ - ( (This)->lpVtbl -> put_MaskNum(This,__MIDL__IDxtJpeg0001) ) - -#define IDxtJpeg_get_MaskName(This,pVal) \ - ( (This)->lpVtbl -> get_MaskName(This,pVal) ) - -#define IDxtJpeg_put_MaskName(This,newVal) \ - ( (This)->lpVtbl -> put_MaskName(This,newVal) ) - -#define IDxtJpeg_get_ScaleX(This,__MIDL__IDxtJpeg0002) \ - ( (This)->lpVtbl -> get_ScaleX(This,__MIDL__IDxtJpeg0002) ) - -#define IDxtJpeg_put_ScaleX(This,__MIDL__IDxtJpeg0003) \ - ( (This)->lpVtbl -> put_ScaleX(This,__MIDL__IDxtJpeg0003) ) - -#define IDxtJpeg_get_ScaleY(This,__MIDL__IDxtJpeg0004) \ - ( (This)->lpVtbl -> get_ScaleY(This,__MIDL__IDxtJpeg0004) ) - -#define IDxtJpeg_put_ScaleY(This,__MIDL__IDxtJpeg0005) \ - ( (This)->lpVtbl -> put_ScaleY(This,__MIDL__IDxtJpeg0005) ) - -#define IDxtJpeg_get_OffsetX(This,__MIDL__IDxtJpeg0006) \ - ( (This)->lpVtbl -> get_OffsetX(This,__MIDL__IDxtJpeg0006) ) - -#define IDxtJpeg_put_OffsetX(This,__MIDL__IDxtJpeg0007) \ - ( (This)->lpVtbl -> put_OffsetX(This,__MIDL__IDxtJpeg0007) ) - -#define IDxtJpeg_get_OffsetY(This,__MIDL__IDxtJpeg0008) \ - ( (This)->lpVtbl -> get_OffsetY(This,__MIDL__IDxtJpeg0008) ) - -#define IDxtJpeg_put_OffsetY(This,__MIDL__IDxtJpeg0009) \ - ( (This)->lpVtbl -> put_OffsetY(This,__MIDL__IDxtJpeg0009) ) - -#define IDxtJpeg_get_ReplicateX(This,pVal) \ - ( (This)->lpVtbl -> get_ReplicateX(This,pVal) ) - -#define IDxtJpeg_put_ReplicateX(This,newVal) \ - ( (This)->lpVtbl -> put_ReplicateX(This,newVal) ) - -#define IDxtJpeg_get_ReplicateY(This,pVal) \ - ( (This)->lpVtbl -> get_ReplicateY(This,pVal) ) - -#define IDxtJpeg_put_ReplicateY(This,newVal) \ - ( (This)->lpVtbl -> put_ReplicateY(This,newVal) ) - -#define IDxtJpeg_get_BorderColor(This,pVal) \ - ( (This)->lpVtbl -> get_BorderColor(This,pVal) ) - -#define IDxtJpeg_put_BorderColor(This,newVal) \ - ( (This)->lpVtbl -> put_BorderColor(This,newVal) ) - -#define IDxtJpeg_get_BorderWidth(This,pVal) \ - ( (This)->lpVtbl -> get_BorderWidth(This,pVal) ) - -#define IDxtJpeg_put_BorderWidth(This,newVal) \ - ( (This)->lpVtbl -> put_BorderWidth(This,newVal) ) - -#define IDxtJpeg_get_BorderSoftness(This,pVal) \ - ( (This)->lpVtbl -> get_BorderSoftness(This,pVal) ) - -#define IDxtJpeg_put_BorderSoftness(This,newVal) \ - ( (This)->lpVtbl -> put_BorderSoftness(This,newVal) ) - -#define IDxtJpeg_ApplyChanges(This) \ - ( (This)->lpVtbl -> ApplyChanges(This) ) - -#define IDxtJpeg_LoadDefSettings(This) \ - ( (This)->lpVtbl -> LoadDefSettings(This) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IDxtJpeg_INTERFACE_DEFINED__ */ - - -#ifndef __IDxtKey_INTERFACE_DEFINED__ -#define __IDxtKey_INTERFACE_DEFINED__ - -/* interface IDxtKey */ -/* [unique][helpstring][dual][uuid][object] */ - - -EXTERN_C const IID IID_IDxtKey; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("3255de56-38fb-4901-b980-94b438010d7b") - IDxtKey : public IDXEffect - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_KeyType( - /* [retval][out] */ __RPC__out int *__MIDL__IDxtKey0000) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_KeyType( - /* [in] */ int __MIDL__IDxtKey0001) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Hue( - /* [retval][out] */ __RPC__out int *__MIDL__IDxtKey0002) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Hue( - /* [in] */ int __MIDL__IDxtKey0003) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Luminance( - /* [retval][out] */ __RPC__out int *__MIDL__IDxtKey0004) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Luminance( - /* [in] */ int __MIDL__IDxtKey0005) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_RGB( - /* [retval][out] */ __RPC__out DWORD *__MIDL__IDxtKey0006) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_RGB( - /* [in] */ DWORD __MIDL__IDxtKey0007) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Similarity( - /* [retval][out] */ __RPC__out int *__MIDL__IDxtKey0008) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Similarity( - /* [in] */ int __MIDL__IDxtKey0009) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Invert( - /* [retval][out] */ __RPC__out BOOL *__MIDL__IDxtKey0010) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Invert( - /* [in] */ BOOL __MIDL__IDxtKey0011) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDxtKeyVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDxtKey * This, - /* [in] */ __RPC__in REFIID riid, - /* [iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDxtKey * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDxtKey * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IDxtKey * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IDxtKey * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IDxtKey * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IDxtKey * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Capabilities )( - IDxtKey * This, - /* [retval][out] */ __RPC__out long *pVal); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Progress )( - IDxtKey * This, - /* [retval][out] */ __RPC__out float *pVal); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Progress )( - IDxtKey * This, - /* [in] */ float newVal); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_StepResolution )( - IDxtKey * This, - /* [retval][out] */ __RPC__out float *pVal); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Duration )( - IDxtKey * This, - /* [retval][out] */ __RPC__out float *pVal); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Duration )( - IDxtKey * This, - /* [in] */ float newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_KeyType )( - IDxtKey * This, - /* [retval][out] */ __RPC__out int *__MIDL__IDxtKey0000); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_KeyType )( - IDxtKey * This, - /* [in] */ int __MIDL__IDxtKey0001); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Hue )( - IDxtKey * This, - /* [retval][out] */ __RPC__out int *__MIDL__IDxtKey0002); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Hue )( - IDxtKey * This, - /* [in] */ int __MIDL__IDxtKey0003); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Luminance )( - IDxtKey * This, - /* [retval][out] */ __RPC__out int *__MIDL__IDxtKey0004); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Luminance )( - IDxtKey * This, - /* [in] */ int __MIDL__IDxtKey0005); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_RGB )( - IDxtKey * This, - /* [retval][out] */ __RPC__out DWORD *__MIDL__IDxtKey0006); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_RGB )( - IDxtKey * This, - /* [in] */ DWORD __MIDL__IDxtKey0007); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Similarity )( - IDxtKey * This, - /* [retval][out] */ __RPC__out int *__MIDL__IDxtKey0008); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Similarity )( - IDxtKey * This, - /* [in] */ int __MIDL__IDxtKey0009); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Invert )( - IDxtKey * This, - /* [retval][out] */ __RPC__out BOOL *__MIDL__IDxtKey0010); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Invert )( - IDxtKey * This, - /* [in] */ BOOL __MIDL__IDxtKey0011); - - END_INTERFACE - } IDxtKeyVtbl; - - interface IDxtKey - { - CONST_VTBL struct IDxtKeyVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDxtKey_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IDxtKey_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IDxtKey_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IDxtKey_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define IDxtKey_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define IDxtKey_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define IDxtKey_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define IDxtKey_get_Capabilities(This,pVal) \ - ( (This)->lpVtbl -> get_Capabilities(This,pVal) ) - -#define IDxtKey_get_Progress(This,pVal) \ - ( (This)->lpVtbl -> get_Progress(This,pVal) ) - -#define IDxtKey_put_Progress(This,newVal) \ - ( (This)->lpVtbl -> put_Progress(This,newVal) ) - -#define IDxtKey_get_StepResolution(This,pVal) \ - ( (This)->lpVtbl -> get_StepResolution(This,pVal) ) - -#define IDxtKey_get_Duration(This,pVal) \ - ( (This)->lpVtbl -> get_Duration(This,pVal) ) - -#define IDxtKey_put_Duration(This,newVal) \ - ( (This)->lpVtbl -> put_Duration(This,newVal) ) - - -#define IDxtKey_get_KeyType(This,__MIDL__IDxtKey0000) \ - ( (This)->lpVtbl -> get_KeyType(This,__MIDL__IDxtKey0000) ) - -#define IDxtKey_put_KeyType(This,__MIDL__IDxtKey0001) \ - ( (This)->lpVtbl -> put_KeyType(This,__MIDL__IDxtKey0001) ) - -#define IDxtKey_get_Hue(This,__MIDL__IDxtKey0002) \ - ( (This)->lpVtbl -> get_Hue(This,__MIDL__IDxtKey0002) ) - -#define IDxtKey_put_Hue(This,__MIDL__IDxtKey0003) \ - ( (This)->lpVtbl -> put_Hue(This,__MIDL__IDxtKey0003) ) - -#define IDxtKey_get_Luminance(This,__MIDL__IDxtKey0004) \ - ( (This)->lpVtbl -> get_Luminance(This,__MIDL__IDxtKey0004) ) - -#define IDxtKey_put_Luminance(This,__MIDL__IDxtKey0005) \ - ( (This)->lpVtbl -> put_Luminance(This,__MIDL__IDxtKey0005) ) - -#define IDxtKey_get_RGB(This,__MIDL__IDxtKey0006) \ - ( (This)->lpVtbl -> get_RGB(This,__MIDL__IDxtKey0006) ) - -#define IDxtKey_put_RGB(This,__MIDL__IDxtKey0007) \ - ( (This)->lpVtbl -> put_RGB(This,__MIDL__IDxtKey0007) ) - -#define IDxtKey_get_Similarity(This,__MIDL__IDxtKey0008) \ - ( (This)->lpVtbl -> get_Similarity(This,__MIDL__IDxtKey0008) ) - -#define IDxtKey_put_Similarity(This,__MIDL__IDxtKey0009) \ - ( (This)->lpVtbl -> put_Similarity(This,__MIDL__IDxtKey0009) ) - -#define IDxtKey_get_Invert(This,__MIDL__IDxtKey0010) \ - ( (This)->lpVtbl -> get_Invert(This,__MIDL__IDxtKey0010) ) - -#define IDxtKey_put_Invert(This,__MIDL__IDxtKey0011) \ - ( (This)->lpVtbl -> put_Invert(This,__MIDL__IDxtKey0011) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IDxtKey_INTERFACE_DEFINED__ */ - - -#ifndef __IMediaLocator_INTERFACE_DEFINED__ -#define __IMediaLocator_INTERFACE_DEFINED__ - -/* interface IMediaLocator */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IMediaLocator; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("288581E0-66CE-11d2-918F-00C0DF10D434") - IMediaLocator : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE FindMediaFile( - __RPC__in BSTR Input, - __RPC__in BSTR FilterString, - __RPC__deref_in_opt BSTR *pOutput, - long Flags) = 0; - - virtual HRESULT STDMETHODCALLTYPE AddFoundLocation( - __RPC__in BSTR DirectoryName) = 0; - - }; - -#else /* C style interface */ - - typedef struct IMediaLocatorVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IMediaLocator * This, - /* [in] */ __RPC__in REFIID riid, - /* [iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IMediaLocator * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IMediaLocator * This); - - HRESULT ( STDMETHODCALLTYPE *FindMediaFile )( - IMediaLocator * This, - __RPC__in BSTR Input, - __RPC__in BSTR FilterString, - __RPC__deref_in_opt BSTR *pOutput, - long Flags); - - HRESULT ( STDMETHODCALLTYPE *AddFoundLocation )( - IMediaLocator * This, - __RPC__in BSTR DirectoryName); - - END_INTERFACE - } IMediaLocatorVtbl; - - interface IMediaLocator - { - CONST_VTBL struct IMediaLocatorVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IMediaLocator_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IMediaLocator_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IMediaLocator_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IMediaLocator_FindMediaFile(This,Input,FilterString,pOutput,Flags) \ - ( (This)->lpVtbl -> FindMediaFile(This,Input,FilterString,pOutput,Flags) ) - -#define IMediaLocator_AddFoundLocation(This,DirectoryName) \ - ( (This)->lpVtbl -> AddFoundLocation(This,DirectoryName) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IMediaLocator_INTERFACE_DEFINED__ */ - - -#ifndef __IMediaDet_INTERFACE_DEFINED__ -#define __IMediaDet_INTERFACE_DEFINED__ - -/* interface IMediaDet */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IMediaDet; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("65BD0710-24D2-4ff7-9324-ED2E5D3ABAFA") - IMediaDet : public IUnknown - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Filter( - /* [retval][out] */ __RPC__deref_out_opt IUnknown **pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Filter( - /* [in] */ __RPC__in_opt IUnknown *newVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_OutputStreams( - /* [retval][out] */ __RPC__out long *pVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_CurrentStream( - /* [retval][out] */ __RPC__out long *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_CurrentStream( - /* [in] */ long newVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_StreamType( - /* [retval][out] */ __RPC__out GUID *pVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_StreamTypeB( - /* [retval][out] */ __RPC__deref_out_opt BSTR *pVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_StreamLength( - /* [retval][out] */ __RPC__out double *pVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Filename( - /* [retval][out] */ __RPC__deref_out_opt BSTR *pVal) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Filename( - /* [in] */ __RPC__in BSTR newVal) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetBitmapBits( - double StreamTime, - __RPC__in long *pBufferSize, - __RPC__in char *pBuffer, - long Width, - long Height) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE WriteBitmapBits( - double StreamTime, - long Width, - long Height, - __RPC__in BSTR Filename) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_StreamMediaType( - /* [retval][out] */ __RPC__out AM_MEDIA_TYPE *pVal) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetSampleGrabber( - /* [out] */ __RPC__deref_out_opt ISampleGrabber **ppVal) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_FrameRate( - /* [retval][out] */ __RPC__out double *pVal) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE EnterBitmapGrabMode( - double SeekTime) = 0; - - }; - -#else /* C style interface */ - - typedef struct IMediaDetVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IMediaDet * This, - /* [in] */ __RPC__in REFIID riid, - /* [iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IMediaDet * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IMediaDet * This); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Filter )( - IMediaDet * This, - /* [retval][out] */ __RPC__deref_out_opt IUnknown **pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Filter )( - IMediaDet * This, - /* [in] */ __RPC__in_opt IUnknown *newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_OutputStreams )( - IMediaDet * This, - /* [retval][out] */ __RPC__out long *pVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_CurrentStream )( - IMediaDet * This, - /* [retval][out] */ __RPC__out long *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_CurrentStream )( - IMediaDet * This, - /* [in] */ long newVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_StreamType )( - IMediaDet * This, - /* [retval][out] */ __RPC__out GUID *pVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_StreamTypeB )( - IMediaDet * This, - /* [retval][out] */ __RPC__deref_out_opt BSTR *pVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_StreamLength )( - IMediaDet * This, - /* [retval][out] */ __RPC__out double *pVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Filename )( - IMediaDet * This, - /* [retval][out] */ __RPC__deref_out_opt BSTR *pVal); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Filename )( - IMediaDet * This, - /* [in] */ __RPC__in BSTR newVal); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *GetBitmapBits )( - IMediaDet * This, - double StreamTime, - __RPC__in long *pBufferSize, - __RPC__in char *pBuffer, - long Width, - long Height); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *WriteBitmapBits )( - IMediaDet * This, - double StreamTime, - long Width, - long Height, - __RPC__in BSTR Filename); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_StreamMediaType )( - IMediaDet * This, - /* [retval][out] */ __RPC__out AM_MEDIA_TYPE *pVal); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *GetSampleGrabber )( - IMediaDet * This, - /* [out] */ __RPC__deref_out_opt ISampleGrabber **ppVal); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_FrameRate )( - IMediaDet * This, - /* [retval][out] */ __RPC__out double *pVal); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *EnterBitmapGrabMode )( - IMediaDet * This, - double SeekTime); - - END_INTERFACE - } IMediaDetVtbl; - - interface IMediaDet - { - CONST_VTBL struct IMediaDetVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IMediaDet_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IMediaDet_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IMediaDet_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IMediaDet_get_Filter(This,pVal) \ - ( (This)->lpVtbl -> get_Filter(This,pVal) ) - -#define IMediaDet_put_Filter(This,newVal) \ - ( (This)->lpVtbl -> put_Filter(This,newVal) ) - -#define IMediaDet_get_OutputStreams(This,pVal) \ - ( (This)->lpVtbl -> get_OutputStreams(This,pVal) ) - -#define IMediaDet_get_CurrentStream(This,pVal) \ - ( (This)->lpVtbl -> get_CurrentStream(This,pVal) ) - -#define IMediaDet_put_CurrentStream(This,newVal) \ - ( (This)->lpVtbl -> put_CurrentStream(This,newVal) ) - -#define IMediaDet_get_StreamType(This,pVal) \ - ( (This)->lpVtbl -> get_StreamType(This,pVal) ) - -#define IMediaDet_get_StreamTypeB(This,pVal) \ - ( (This)->lpVtbl -> get_StreamTypeB(This,pVal) ) - -#define IMediaDet_get_StreamLength(This,pVal) \ - ( (This)->lpVtbl -> get_StreamLength(This,pVal) ) - -#define IMediaDet_get_Filename(This,pVal) \ - ( (This)->lpVtbl -> get_Filename(This,pVal) ) - -#define IMediaDet_put_Filename(This,newVal) \ - ( (This)->lpVtbl -> put_Filename(This,newVal) ) - -#define IMediaDet_GetBitmapBits(This,StreamTime,pBufferSize,pBuffer,Width,Height) \ - ( (This)->lpVtbl -> GetBitmapBits(This,StreamTime,pBufferSize,pBuffer,Width,Height) ) - -#define IMediaDet_WriteBitmapBits(This,StreamTime,Width,Height,Filename) \ - ( (This)->lpVtbl -> WriteBitmapBits(This,StreamTime,Width,Height,Filename) ) - -#define IMediaDet_get_StreamMediaType(This,pVal) \ - ( (This)->lpVtbl -> get_StreamMediaType(This,pVal) ) - -#define IMediaDet_GetSampleGrabber(This,ppVal) \ - ( (This)->lpVtbl -> GetSampleGrabber(This,ppVal) ) - -#define IMediaDet_get_FrameRate(This,pVal) \ - ( (This)->lpVtbl -> get_FrameRate(This,pVal) ) - -#define IMediaDet_EnterBitmapGrabMode(This,SeekTime) \ - ( (This)->lpVtbl -> EnterBitmapGrabMode(This,SeekTime) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IMediaDet_INTERFACE_DEFINED__ */ - - -#ifndef __IGrfCache_INTERFACE_DEFINED__ -#define __IGrfCache_INTERFACE_DEFINED__ - -/* interface IGrfCache */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IGrfCache; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("AE9472BE-B0C3-11D2-8D24-00A0C9441E20") - IGrfCache : public IDispatch - { - public: - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE AddFilter( - __RPC__in_opt IGrfCache *ChainedCache, - LONGLONG ID, - __RPC__in_opt const IBaseFilter *pFilter, - __RPC__in LPCWSTR pName) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ConnectPins( - __RPC__in_opt IGrfCache *ChainedCache, - LONGLONG PinID1, - __RPC__in_opt const IPin *pPin1, - LONGLONG PinID2, - __RPC__in_opt const IPin *pPin2) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE SetGraph( - __RPC__in_opt const IGraphBuilder *pGraph) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE DoConnectionsNow( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IGrfCacheVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IGrfCache * This, - /* [in] */ __RPC__in REFIID riid, - /* [iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IGrfCache * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IGrfCache * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IGrfCache * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IGrfCache * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IGrfCache * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IGrfCache * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *AddFilter )( - IGrfCache * This, - __RPC__in_opt IGrfCache *ChainedCache, - LONGLONG ID, - __RPC__in_opt const IBaseFilter *pFilter, - __RPC__in LPCWSTR pName); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *ConnectPins )( - IGrfCache * This, - __RPC__in_opt IGrfCache *ChainedCache, - LONGLONG PinID1, - __RPC__in_opt const IPin *pPin1, - LONGLONG PinID2, - __RPC__in_opt const IPin *pPin2); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *SetGraph )( - IGrfCache * This, - __RPC__in_opt const IGraphBuilder *pGraph); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *DoConnectionsNow )( - IGrfCache * This); - - END_INTERFACE - } IGrfCacheVtbl; - - interface IGrfCache - { - CONST_VTBL struct IGrfCacheVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IGrfCache_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IGrfCache_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IGrfCache_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IGrfCache_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define IGrfCache_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define IGrfCache_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define IGrfCache_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define IGrfCache_AddFilter(This,ChainedCache,ID,pFilter,pName) \ - ( (This)->lpVtbl -> AddFilter(This,ChainedCache,ID,pFilter,pName) ) - -#define IGrfCache_ConnectPins(This,ChainedCache,PinID1,pPin1,PinID2,pPin2) \ - ( (This)->lpVtbl -> ConnectPins(This,ChainedCache,PinID1,pPin1,PinID2,pPin2) ) - -#define IGrfCache_SetGraph(This,pGraph) \ - ( (This)->lpVtbl -> SetGraph(This,pGraph) ) - -#define IGrfCache_DoConnectionsNow(This) \ - ( (This)->lpVtbl -> DoConnectionsNow(This) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IGrfCache_INTERFACE_DEFINED__ */ - - -#ifndef __IRenderEngine_INTERFACE_DEFINED__ -#define __IRenderEngine_INTERFACE_DEFINED__ - -/* interface IRenderEngine */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IRenderEngine; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("6BEE3A81-66C9-11d2-918F-00C0DF10D434") - IRenderEngine : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE SetTimelineObject( - __RPC__in_opt IAMTimeline *pTimeline) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetTimelineObject( - /* [out] */ __RPC__deref_out_opt IAMTimeline **ppTimeline) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetFilterGraph( - /* [out] */ __RPC__deref_out_opt IGraphBuilder **ppFG) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetFilterGraph( - __RPC__in_opt IGraphBuilder *pFG) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetInterestRange( - REFERENCE_TIME Start, - REFERENCE_TIME Stop) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetInterestRange2( - double Start, - double Stop) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetRenderRange( - REFERENCE_TIME Start, - REFERENCE_TIME Stop) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetRenderRange2( - double Start, - double Stop) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetGroupOutputPin( - long Group, - /* [out] */ __RPC__deref_out_opt IPin **ppRenderPin) = 0; - - virtual HRESULT STDMETHODCALLTYPE ScrapIt( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE RenderOutputPins( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetVendorString( - /* [retval][out] */ __RPC__deref_out_opt BSTR *pVendorID) = 0; - - virtual HRESULT STDMETHODCALLTYPE ConnectFrontEnd( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetSourceConnectCallback( - __RPC__in_opt IGrfCache *pCallback) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetDynamicReconnectLevel( - long Level) = 0; - - virtual HRESULT STDMETHODCALLTYPE DoSmartRecompression( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE UseInSmartRecompressionGraph( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetSourceNameValidation( - __RPC__in BSTR FilterString, - __RPC__in_opt IMediaLocator *pOverride, - LONG Flags) = 0; - - virtual HRESULT STDMETHODCALLTYPE Commit( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE Decommit( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetCaps( - long Index, - __RPC__in long *pReturn) = 0; - - }; - -#else /* C style interface */ - - typedef struct IRenderEngineVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IRenderEngine * This, - /* [in] */ __RPC__in REFIID riid, - /* [iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IRenderEngine * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IRenderEngine * This); - - HRESULT ( STDMETHODCALLTYPE *SetTimelineObject )( - IRenderEngine * This, - __RPC__in_opt IAMTimeline *pTimeline); - - HRESULT ( STDMETHODCALLTYPE *GetTimelineObject )( - IRenderEngine * This, - /* [out] */ __RPC__deref_out_opt IAMTimeline **ppTimeline); - - HRESULT ( STDMETHODCALLTYPE *GetFilterGraph )( - IRenderEngine * This, - /* [out] */ __RPC__deref_out_opt IGraphBuilder **ppFG); - - HRESULT ( STDMETHODCALLTYPE *SetFilterGraph )( - IRenderEngine * This, - __RPC__in_opt IGraphBuilder *pFG); - - HRESULT ( STDMETHODCALLTYPE *SetInterestRange )( - IRenderEngine * This, - REFERENCE_TIME Start, - REFERENCE_TIME Stop); - - HRESULT ( STDMETHODCALLTYPE *SetInterestRange2 )( - IRenderEngine * This, - double Start, - double Stop); - - HRESULT ( STDMETHODCALLTYPE *SetRenderRange )( - IRenderEngine * This, - REFERENCE_TIME Start, - REFERENCE_TIME Stop); - - HRESULT ( STDMETHODCALLTYPE *SetRenderRange2 )( - IRenderEngine * This, - double Start, - double Stop); - - HRESULT ( STDMETHODCALLTYPE *GetGroupOutputPin )( - IRenderEngine * This, - long Group, - /* [out] */ __RPC__deref_out_opt IPin **ppRenderPin); - - HRESULT ( STDMETHODCALLTYPE *ScrapIt )( - IRenderEngine * This); - - HRESULT ( STDMETHODCALLTYPE *RenderOutputPins )( - IRenderEngine * This); - - HRESULT ( STDMETHODCALLTYPE *GetVendorString )( - IRenderEngine * This, - /* [retval][out] */ __RPC__deref_out_opt BSTR *pVendorID); - - HRESULT ( STDMETHODCALLTYPE *ConnectFrontEnd )( - IRenderEngine * This); - - HRESULT ( STDMETHODCALLTYPE *SetSourceConnectCallback )( - IRenderEngine * This, - __RPC__in_opt IGrfCache *pCallback); - - HRESULT ( STDMETHODCALLTYPE *SetDynamicReconnectLevel )( - IRenderEngine * This, - long Level); - - HRESULT ( STDMETHODCALLTYPE *DoSmartRecompression )( - IRenderEngine * This); - - HRESULT ( STDMETHODCALLTYPE *UseInSmartRecompressionGraph )( - IRenderEngine * This); - - HRESULT ( STDMETHODCALLTYPE *SetSourceNameValidation )( - IRenderEngine * This, - __RPC__in BSTR FilterString, - __RPC__in_opt IMediaLocator *pOverride, - LONG Flags); - - HRESULT ( STDMETHODCALLTYPE *Commit )( - IRenderEngine * This); - - HRESULT ( STDMETHODCALLTYPE *Decommit )( - IRenderEngine * This); - - HRESULT ( STDMETHODCALLTYPE *GetCaps )( - IRenderEngine * This, - long Index, - __RPC__in long *pReturn); - - END_INTERFACE - } IRenderEngineVtbl; - - interface IRenderEngine - { - CONST_VTBL struct IRenderEngineVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IRenderEngine_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IRenderEngine_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IRenderEngine_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IRenderEngine_SetTimelineObject(This,pTimeline) \ - ( (This)->lpVtbl -> SetTimelineObject(This,pTimeline) ) - -#define IRenderEngine_GetTimelineObject(This,ppTimeline) \ - ( (This)->lpVtbl -> GetTimelineObject(This,ppTimeline) ) - -#define IRenderEngine_GetFilterGraph(This,ppFG) \ - ( (This)->lpVtbl -> GetFilterGraph(This,ppFG) ) - -#define IRenderEngine_SetFilterGraph(This,pFG) \ - ( (This)->lpVtbl -> SetFilterGraph(This,pFG) ) - -#define IRenderEngine_SetInterestRange(This,Start,Stop) \ - ( (This)->lpVtbl -> SetInterestRange(This,Start,Stop) ) - -#define IRenderEngine_SetInterestRange2(This,Start,Stop) \ - ( (This)->lpVtbl -> SetInterestRange2(This,Start,Stop) ) - -#define IRenderEngine_SetRenderRange(This,Start,Stop) \ - ( (This)->lpVtbl -> SetRenderRange(This,Start,Stop) ) - -#define IRenderEngine_SetRenderRange2(This,Start,Stop) \ - ( (This)->lpVtbl -> SetRenderRange2(This,Start,Stop) ) - -#define IRenderEngine_GetGroupOutputPin(This,Group,ppRenderPin) \ - ( (This)->lpVtbl -> GetGroupOutputPin(This,Group,ppRenderPin) ) - -#define IRenderEngine_ScrapIt(This) \ - ( (This)->lpVtbl -> ScrapIt(This) ) - -#define IRenderEngine_RenderOutputPins(This) \ - ( (This)->lpVtbl -> RenderOutputPins(This) ) - -#define IRenderEngine_GetVendorString(This,pVendorID) \ - ( (This)->lpVtbl -> GetVendorString(This,pVendorID) ) - -#define IRenderEngine_ConnectFrontEnd(This) \ - ( (This)->lpVtbl -> ConnectFrontEnd(This) ) - -#define IRenderEngine_SetSourceConnectCallback(This,pCallback) \ - ( (This)->lpVtbl -> SetSourceConnectCallback(This,pCallback) ) - -#define IRenderEngine_SetDynamicReconnectLevel(This,Level) \ - ( (This)->lpVtbl -> SetDynamicReconnectLevel(This,Level) ) - -#define IRenderEngine_DoSmartRecompression(This) \ - ( (This)->lpVtbl -> DoSmartRecompression(This) ) - -#define IRenderEngine_UseInSmartRecompressionGraph(This) \ - ( (This)->lpVtbl -> UseInSmartRecompressionGraph(This) ) - -#define IRenderEngine_SetSourceNameValidation(This,FilterString,pOverride,Flags) \ - ( (This)->lpVtbl -> SetSourceNameValidation(This,FilterString,pOverride,Flags) ) - -#define IRenderEngine_Commit(This) \ - ( (This)->lpVtbl -> Commit(This) ) - -#define IRenderEngine_Decommit(This) \ - ( (This)->lpVtbl -> Decommit(This) ) - -#define IRenderEngine_GetCaps(This,Index,pReturn) \ - ( (This)->lpVtbl -> GetCaps(This,Index,pReturn) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IRenderEngine_INTERFACE_DEFINED__ */ - - -#ifndef __IRenderEngine2_INTERFACE_DEFINED__ -#define __IRenderEngine2_INTERFACE_DEFINED__ - -/* interface IRenderEngine2 */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IRenderEngine2; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("6BEE3A82-66C9-11d2-918F-00C0DF10D434") - IRenderEngine2 : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE SetResizerGUID( - GUID ResizerGuid) = 0; - - }; - -#else /* C style interface */ - - typedef struct IRenderEngine2Vtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IRenderEngine2 * This, - /* [in] */ __RPC__in REFIID riid, - /* [iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IRenderEngine2 * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IRenderEngine2 * This); - - HRESULT ( STDMETHODCALLTYPE *SetResizerGUID )( - IRenderEngine2 * This, - GUID ResizerGuid); - - END_INTERFACE - } IRenderEngine2Vtbl; - - interface IRenderEngine2 - { - CONST_VTBL struct IRenderEngine2Vtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IRenderEngine2_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IRenderEngine2_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IRenderEngine2_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IRenderEngine2_SetResizerGUID(This,ResizerGuid) \ - ( (This)->lpVtbl -> SetResizerGUID(This,ResizerGuid) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IRenderEngine2_INTERFACE_DEFINED__ */ - - -#ifndef __IFindCompressorCB_INTERFACE_DEFINED__ -#define __IFindCompressorCB_INTERFACE_DEFINED__ - -/* interface IFindCompressorCB */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IFindCompressorCB; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("F03FA8DE-879A-4d59-9B2C-26BB1CF83461") - IFindCompressorCB : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetCompressor( - __RPC__in AM_MEDIA_TYPE *pType, - __RPC__in AM_MEDIA_TYPE *pCompType, - /* [out] */ __RPC__deref_out_opt IBaseFilter **ppFilter) = 0; - - }; - -#else /* C style interface */ - - typedef struct IFindCompressorCBVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IFindCompressorCB * This, - /* [in] */ __RPC__in REFIID riid, - /* [iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IFindCompressorCB * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IFindCompressorCB * This); - - HRESULT ( STDMETHODCALLTYPE *GetCompressor )( - IFindCompressorCB * This, - __RPC__in AM_MEDIA_TYPE *pType, - __RPC__in AM_MEDIA_TYPE *pCompType, - /* [out] */ __RPC__deref_out_opt IBaseFilter **ppFilter); - - END_INTERFACE - } IFindCompressorCBVtbl; - - interface IFindCompressorCB - { - CONST_VTBL struct IFindCompressorCBVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IFindCompressorCB_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IFindCompressorCB_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IFindCompressorCB_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IFindCompressorCB_GetCompressor(This,pType,pCompType,ppFilter) \ - ( (This)->lpVtbl -> GetCompressor(This,pType,pCompType,ppFilter) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IFindCompressorCB_INTERFACE_DEFINED__ */ - - -#ifndef __ISmartRenderEngine_INTERFACE_DEFINED__ -#define __ISmartRenderEngine_INTERFACE_DEFINED__ - -/* interface ISmartRenderEngine */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_ISmartRenderEngine; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("F03FA8CE-879A-4d59-9B2C-26BB1CF83461") - ISmartRenderEngine : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE SetGroupCompressor( - long Group, - __RPC__in_opt IBaseFilter *pCompressor) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetGroupCompressor( - long Group, - __RPC__deref_in_opt IBaseFilter **pCompressor) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetFindCompressorCB( - __RPC__in_opt IFindCompressorCB *pCallback) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISmartRenderEngineVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ISmartRenderEngine * This, - /* [in] */ __RPC__in REFIID riid, - /* [iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ISmartRenderEngine * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ISmartRenderEngine * This); - - HRESULT ( STDMETHODCALLTYPE *SetGroupCompressor )( - ISmartRenderEngine * This, - long Group, - __RPC__in_opt IBaseFilter *pCompressor); - - HRESULT ( STDMETHODCALLTYPE *GetGroupCompressor )( - ISmartRenderEngine * This, - long Group, - __RPC__deref_in_opt IBaseFilter **pCompressor); - - HRESULT ( STDMETHODCALLTYPE *SetFindCompressorCB )( - ISmartRenderEngine * This, - __RPC__in_opt IFindCompressorCB *pCallback); - - END_INTERFACE - } ISmartRenderEngineVtbl; - - interface ISmartRenderEngine - { - CONST_VTBL struct ISmartRenderEngineVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISmartRenderEngine_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define ISmartRenderEngine_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define ISmartRenderEngine_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define ISmartRenderEngine_SetGroupCompressor(This,Group,pCompressor) \ - ( (This)->lpVtbl -> SetGroupCompressor(This,Group,pCompressor) ) - -#define ISmartRenderEngine_GetGroupCompressor(This,Group,pCompressor) \ - ( (This)->lpVtbl -> GetGroupCompressor(This,Group,pCompressor) ) - -#define ISmartRenderEngine_SetFindCompressorCB(This,pCallback) \ - ( (This)->lpVtbl -> SetFindCompressorCB(This,pCallback) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __ISmartRenderEngine_INTERFACE_DEFINED__ */ - - -#ifndef __IAMTimelineObj_INTERFACE_DEFINED__ -#define __IAMTimelineObj_INTERFACE_DEFINED__ - -/* interface IAMTimelineObj */ -/* [unique][helpstring][uuid][local][object] */ - - -EXTERN_C const IID IID_IAMTimelineObj; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("78530B77-61F9-11D2-8CAD-00A024580902") - IAMTimelineObj : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetStartStop( - REFERENCE_TIME *pStart, - REFERENCE_TIME *pStop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetStartStop2( - REFTIME *pStart, - REFTIME *pStop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE FixTimes( - REFERENCE_TIME *pStart, - REFERENCE_TIME *pStop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE FixTimes2( - REFTIME *pStart, - REFTIME *pStop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetStartStop( - REFERENCE_TIME Start, - REFERENCE_TIME Stop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetStartStop2( - REFTIME Start, - REFTIME Stop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetPropertySetter( - /* [retval][out] */ IPropertySetter **pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetPropertySetter( - IPropertySetter *newVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetSubObject( - /* [retval][out] */ IUnknown **pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetSubObject( - IUnknown *newVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetSubObjectGUID( - GUID newVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetSubObjectGUIDB( - BSTR newVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetSubObjectGUID( - GUID *pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetSubObjectGUIDB( - /* [retval][out] */ BSTR *pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetSubObjectLoaded( - BOOL *pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetTimelineType( - TIMELINE_MAJOR_TYPE *pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetTimelineType( - TIMELINE_MAJOR_TYPE newVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetUserID( - long *pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetUserID( - long newVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetGenID( - long *pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetUserName( - /* [retval][out] */ BSTR *pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetUserName( - BSTR newVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetUserData( - BYTE *pData, - long *pSize) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetUserData( - BYTE *pData, - long Size) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMuted( - BOOL *pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetMuted( - BOOL newVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetLocked( - BOOL *pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetLocked( - BOOL newVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDirtyRange( - REFERENCE_TIME *pStart, - REFERENCE_TIME *pStop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDirtyRange2( - REFTIME *pStart, - REFTIME *pStop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetDirtyRange( - REFERENCE_TIME Start, - REFERENCE_TIME Stop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetDirtyRange2( - REFTIME Start, - REFTIME Stop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE ClearDirty( void) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Remove( void) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE RemoveAll( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetTimelineNoRef( - IAMTimeline **ppResult) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetGroupIBelongTo( - /* [out] */ IAMTimelineGroup **ppGroup) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetEmbedDepth( - long *pVal) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMTimelineObjVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMTimelineObj * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMTimelineObj * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMTimelineObj * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetStartStop )( - IAMTimelineObj * This, - REFERENCE_TIME *pStart, - REFERENCE_TIME *pStop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetStartStop2 )( - IAMTimelineObj * This, - REFTIME *pStart, - REFTIME *pStop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *FixTimes )( - IAMTimelineObj * This, - REFERENCE_TIME *pStart, - REFERENCE_TIME *pStop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *FixTimes2 )( - IAMTimelineObj * This, - REFTIME *pStart, - REFTIME *pStop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetStartStop )( - IAMTimelineObj * This, - REFERENCE_TIME Start, - REFERENCE_TIME Stop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetStartStop2 )( - IAMTimelineObj * This, - REFTIME Start, - REFTIME Stop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetPropertySetter )( - IAMTimelineObj * This, - /* [retval][out] */ IPropertySetter **pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetPropertySetter )( - IAMTimelineObj * This, - IPropertySetter *newVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetSubObject )( - IAMTimelineObj * This, - /* [retval][out] */ IUnknown **pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetSubObject )( - IAMTimelineObj * This, - IUnknown *newVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetSubObjectGUID )( - IAMTimelineObj * This, - GUID newVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetSubObjectGUIDB )( - IAMTimelineObj * This, - BSTR newVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetSubObjectGUID )( - IAMTimelineObj * This, - GUID *pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetSubObjectGUIDB )( - IAMTimelineObj * This, - /* [retval][out] */ BSTR *pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetSubObjectLoaded )( - IAMTimelineObj * This, - BOOL *pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetTimelineType )( - IAMTimelineObj * This, - TIMELINE_MAJOR_TYPE *pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetTimelineType )( - IAMTimelineObj * This, - TIMELINE_MAJOR_TYPE newVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetUserID )( - IAMTimelineObj * This, - long *pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetUserID )( - IAMTimelineObj * This, - long newVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetGenID )( - IAMTimelineObj * This, - long *pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetUserName )( - IAMTimelineObj * This, - /* [retval][out] */ BSTR *pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetUserName )( - IAMTimelineObj * This, - BSTR newVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetUserData )( - IAMTimelineObj * This, - BYTE *pData, - long *pSize); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetUserData )( - IAMTimelineObj * This, - BYTE *pData, - long Size); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMuted )( - IAMTimelineObj * This, - BOOL *pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetMuted )( - IAMTimelineObj * This, - BOOL newVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetLocked )( - IAMTimelineObj * This, - BOOL *pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetLocked )( - IAMTimelineObj * This, - BOOL newVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetDirtyRange )( - IAMTimelineObj * This, - REFERENCE_TIME *pStart, - REFERENCE_TIME *pStop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetDirtyRange2 )( - IAMTimelineObj * This, - REFTIME *pStart, - REFTIME *pStop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetDirtyRange )( - IAMTimelineObj * This, - REFERENCE_TIME Start, - REFERENCE_TIME Stop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetDirtyRange2 )( - IAMTimelineObj * This, - REFTIME Start, - REFTIME Stop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *ClearDirty )( - IAMTimelineObj * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Remove )( - IAMTimelineObj * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *RemoveAll )( - IAMTimelineObj * This); - - HRESULT ( STDMETHODCALLTYPE *GetTimelineNoRef )( - IAMTimelineObj * This, - IAMTimeline **ppResult); - - HRESULT ( STDMETHODCALLTYPE *GetGroupIBelongTo )( - IAMTimelineObj * This, - /* [out] */ IAMTimelineGroup **ppGroup); - - HRESULT ( STDMETHODCALLTYPE *GetEmbedDepth )( - IAMTimelineObj * This, - long *pVal); - - END_INTERFACE - } IAMTimelineObjVtbl; - - interface IAMTimelineObj - { - CONST_VTBL struct IAMTimelineObjVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMTimelineObj_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IAMTimelineObj_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IAMTimelineObj_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IAMTimelineObj_GetStartStop(This,pStart,pStop) \ - ( (This)->lpVtbl -> GetStartStop(This,pStart,pStop) ) - -#define IAMTimelineObj_GetStartStop2(This,pStart,pStop) \ - ( (This)->lpVtbl -> GetStartStop2(This,pStart,pStop) ) - -#define IAMTimelineObj_FixTimes(This,pStart,pStop) \ - ( (This)->lpVtbl -> FixTimes(This,pStart,pStop) ) - -#define IAMTimelineObj_FixTimes2(This,pStart,pStop) \ - ( (This)->lpVtbl -> FixTimes2(This,pStart,pStop) ) - -#define IAMTimelineObj_SetStartStop(This,Start,Stop) \ - ( (This)->lpVtbl -> SetStartStop(This,Start,Stop) ) - -#define IAMTimelineObj_SetStartStop2(This,Start,Stop) \ - ( (This)->lpVtbl -> SetStartStop2(This,Start,Stop) ) - -#define IAMTimelineObj_GetPropertySetter(This,pVal) \ - ( (This)->lpVtbl -> GetPropertySetter(This,pVal) ) - -#define IAMTimelineObj_SetPropertySetter(This,newVal) \ - ( (This)->lpVtbl -> SetPropertySetter(This,newVal) ) - -#define IAMTimelineObj_GetSubObject(This,pVal) \ - ( (This)->lpVtbl -> GetSubObject(This,pVal) ) - -#define IAMTimelineObj_SetSubObject(This,newVal) \ - ( (This)->lpVtbl -> SetSubObject(This,newVal) ) - -#define IAMTimelineObj_SetSubObjectGUID(This,newVal) \ - ( (This)->lpVtbl -> SetSubObjectGUID(This,newVal) ) - -#define IAMTimelineObj_SetSubObjectGUIDB(This,newVal) \ - ( (This)->lpVtbl -> SetSubObjectGUIDB(This,newVal) ) - -#define IAMTimelineObj_GetSubObjectGUID(This,pVal) \ - ( (This)->lpVtbl -> GetSubObjectGUID(This,pVal) ) - -#define IAMTimelineObj_GetSubObjectGUIDB(This,pVal) \ - ( (This)->lpVtbl -> GetSubObjectGUIDB(This,pVal) ) - -#define IAMTimelineObj_GetSubObjectLoaded(This,pVal) \ - ( (This)->lpVtbl -> GetSubObjectLoaded(This,pVal) ) - -#define IAMTimelineObj_GetTimelineType(This,pVal) \ - ( (This)->lpVtbl -> GetTimelineType(This,pVal) ) - -#define IAMTimelineObj_SetTimelineType(This,newVal) \ - ( (This)->lpVtbl -> SetTimelineType(This,newVal) ) - -#define IAMTimelineObj_GetUserID(This,pVal) \ - ( (This)->lpVtbl -> GetUserID(This,pVal) ) - -#define IAMTimelineObj_SetUserID(This,newVal) \ - ( (This)->lpVtbl -> SetUserID(This,newVal) ) - -#define IAMTimelineObj_GetGenID(This,pVal) \ - ( (This)->lpVtbl -> GetGenID(This,pVal) ) - -#define IAMTimelineObj_GetUserName(This,pVal) \ - ( (This)->lpVtbl -> GetUserName(This,pVal) ) - -#define IAMTimelineObj_SetUserName(This,newVal) \ - ( (This)->lpVtbl -> SetUserName(This,newVal) ) - -#define IAMTimelineObj_GetUserData(This,pData,pSize) \ - ( (This)->lpVtbl -> GetUserData(This,pData,pSize) ) - -#define IAMTimelineObj_SetUserData(This,pData,Size) \ - ( (This)->lpVtbl -> SetUserData(This,pData,Size) ) - -#define IAMTimelineObj_GetMuted(This,pVal) \ - ( (This)->lpVtbl -> GetMuted(This,pVal) ) - -#define IAMTimelineObj_SetMuted(This,newVal) \ - ( (This)->lpVtbl -> SetMuted(This,newVal) ) - -#define IAMTimelineObj_GetLocked(This,pVal) \ - ( (This)->lpVtbl -> GetLocked(This,pVal) ) - -#define IAMTimelineObj_SetLocked(This,newVal) \ - ( (This)->lpVtbl -> SetLocked(This,newVal) ) - -#define IAMTimelineObj_GetDirtyRange(This,pStart,pStop) \ - ( (This)->lpVtbl -> GetDirtyRange(This,pStart,pStop) ) - -#define IAMTimelineObj_GetDirtyRange2(This,pStart,pStop) \ - ( (This)->lpVtbl -> GetDirtyRange2(This,pStart,pStop) ) - -#define IAMTimelineObj_SetDirtyRange(This,Start,Stop) \ - ( (This)->lpVtbl -> SetDirtyRange(This,Start,Stop) ) - -#define IAMTimelineObj_SetDirtyRange2(This,Start,Stop) \ - ( (This)->lpVtbl -> SetDirtyRange2(This,Start,Stop) ) - -#define IAMTimelineObj_ClearDirty(This) \ - ( (This)->lpVtbl -> ClearDirty(This) ) - -#define IAMTimelineObj_Remove(This) \ - ( (This)->lpVtbl -> Remove(This) ) - -#define IAMTimelineObj_RemoveAll(This) \ - ( (This)->lpVtbl -> RemoveAll(This) ) - -#define IAMTimelineObj_GetTimelineNoRef(This,ppResult) \ - ( (This)->lpVtbl -> GetTimelineNoRef(This,ppResult) ) - -#define IAMTimelineObj_GetGroupIBelongTo(This,ppGroup) \ - ( (This)->lpVtbl -> GetGroupIBelongTo(This,ppGroup) ) - -#define IAMTimelineObj_GetEmbedDepth(This,pVal) \ - ( (This)->lpVtbl -> GetEmbedDepth(This,pVal) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IAMTimelineObj_INTERFACE_DEFINED__ */ - - -#ifndef __IAMTimelineEffectable_INTERFACE_DEFINED__ -#define __IAMTimelineEffectable_INTERFACE_DEFINED__ - -/* interface IAMTimelineEffectable */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IAMTimelineEffectable; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("EAE58537-622E-11d2-8CAD-00A024580902") - IAMTimelineEffectable : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE EffectInsBefore( - __RPC__in_opt IAMTimelineObj *pFX, - long priority) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE EffectSwapPriorities( - long PriorityA, - long PriorityB) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE EffectGetCount( - __RPC__in long *pCount) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetEffect( - /* [out] */ __RPC__deref_out_opt IAMTimelineObj **ppFx, - long Which) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMTimelineEffectableVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMTimelineEffectable * This, - /* [in] */ __RPC__in REFIID riid, - /* [iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMTimelineEffectable * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMTimelineEffectable * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *EffectInsBefore )( - IAMTimelineEffectable * This, - __RPC__in_opt IAMTimelineObj *pFX, - long priority); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *EffectSwapPriorities )( - IAMTimelineEffectable * This, - long PriorityA, - long PriorityB); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *EffectGetCount )( - IAMTimelineEffectable * This, - __RPC__in long *pCount); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetEffect )( - IAMTimelineEffectable * This, - /* [out] */ __RPC__deref_out_opt IAMTimelineObj **ppFx, - long Which); - - END_INTERFACE - } IAMTimelineEffectableVtbl; - - interface IAMTimelineEffectable - { - CONST_VTBL struct IAMTimelineEffectableVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMTimelineEffectable_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IAMTimelineEffectable_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IAMTimelineEffectable_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IAMTimelineEffectable_EffectInsBefore(This,pFX,priority) \ - ( (This)->lpVtbl -> EffectInsBefore(This,pFX,priority) ) - -#define IAMTimelineEffectable_EffectSwapPriorities(This,PriorityA,PriorityB) \ - ( (This)->lpVtbl -> EffectSwapPriorities(This,PriorityA,PriorityB) ) - -#define IAMTimelineEffectable_EffectGetCount(This,pCount) \ - ( (This)->lpVtbl -> EffectGetCount(This,pCount) ) - -#define IAMTimelineEffectable_GetEffect(This,ppFx,Which) \ - ( (This)->lpVtbl -> GetEffect(This,ppFx,Which) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IAMTimelineEffectable_INTERFACE_DEFINED__ */ - - -#ifndef __IAMTimelineEffect_INTERFACE_DEFINED__ -#define __IAMTimelineEffect_INTERFACE_DEFINED__ - -/* interface IAMTimelineEffect */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IAMTimelineEffect; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("BCE0C264-622D-11d2-8CAD-00A024580902") - IAMTimelineEffect : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE EffectGetPriority( - __RPC__in long *pVal) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMTimelineEffectVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMTimelineEffect * This, - /* [in] */ __RPC__in REFIID riid, - /* [iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMTimelineEffect * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMTimelineEffect * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *EffectGetPriority )( - IAMTimelineEffect * This, - __RPC__in long *pVal); - - END_INTERFACE - } IAMTimelineEffectVtbl; - - interface IAMTimelineEffect - { - CONST_VTBL struct IAMTimelineEffectVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMTimelineEffect_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IAMTimelineEffect_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IAMTimelineEffect_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IAMTimelineEffect_EffectGetPriority(This,pVal) \ - ( (This)->lpVtbl -> EffectGetPriority(This,pVal) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IAMTimelineEffect_INTERFACE_DEFINED__ */ - - -#ifndef __IAMTimelineTransable_INTERFACE_DEFINED__ -#define __IAMTimelineTransable_INTERFACE_DEFINED__ - -/* interface IAMTimelineTransable */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IAMTimelineTransable; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("378FA386-622E-11d2-8CAD-00A024580902") - IAMTimelineTransable : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE TransAdd( - __RPC__in_opt IAMTimelineObj *pTrans) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE TransGetCount( - __RPC__in long *pCount) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetNextTrans( - /* [out] */ __RPC__deref_out_opt IAMTimelineObj **ppTrans, - __RPC__in REFERENCE_TIME *pInOut) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetNextTrans2( - /* [out] */ __RPC__deref_out_opt IAMTimelineObj **ppTrans, - __RPC__in REFTIME *pInOut) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetTransAtTime( - /* [out] */ __RPC__deref_out_opt IAMTimelineObj **ppObj, - REFERENCE_TIME Time, - long SearchDirection) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetTransAtTime2( - /* [out] */ __RPC__deref_out_opt IAMTimelineObj **ppObj, - REFTIME Time, - long SearchDirection) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMTimelineTransableVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMTimelineTransable * This, - /* [in] */ __RPC__in REFIID riid, - /* [iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMTimelineTransable * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMTimelineTransable * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *TransAdd )( - IAMTimelineTransable * This, - __RPC__in_opt IAMTimelineObj *pTrans); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *TransGetCount )( - IAMTimelineTransable * This, - __RPC__in long *pCount); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetNextTrans )( - IAMTimelineTransable * This, - /* [out] */ __RPC__deref_out_opt IAMTimelineObj **ppTrans, - __RPC__in REFERENCE_TIME *pInOut); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetNextTrans2 )( - IAMTimelineTransable * This, - /* [out] */ __RPC__deref_out_opt IAMTimelineObj **ppTrans, - __RPC__in REFTIME *pInOut); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetTransAtTime )( - IAMTimelineTransable * This, - /* [out] */ __RPC__deref_out_opt IAMTimelineObj **ppObj, - REFERENCE_TIME Time, - long SearchDirection); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetTransAtTime2 )( - IAMTimelineTransable * This, - /* [out] */ __RPC__deref_out_opt IAMTimelineObj **ppObj, - REFTIME Time, - long SearchDirection); - - END_INTERFACE - } IAMTimelineTransableVtbl; - - interface IAMTimelineTransable - { - CONST_VTBL struct IAMTimelineTransableVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMTimelineTransable_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IAMTimelineTransable_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IAMTimelineTransable_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IAMTimelineTransable_TransAdd(This,pTrans) \ - ( (This)->lpVtbl -> TransAdd(This,pTrans) ) - -#define IAMTimelineTransable_TransGetCount(This,pCount) \ - ( (This)->lpVtbl -> TransGetCount(This,pCount) ) - -#define IAMTimelineTransable_GetNextTrans(This,ppTrans,pInOut) \ - ( (This)->lpVtbl -> GetNextTrans(This,ppTrans,pInOut) ) - -#define IAMTimelineTransable_GetNextTrans2(This,ppTrans,pInOut) \ - ( (This)->lpVtbl -> GetNextTrans2(This,ppTrans,pInOut) ) - -#define IAMTimelineTransable_GetTransAtTime(This,ppObj,Time,SearchDirection) \ - ( (This)->lpVtbl -> GetTransAtTime(This,ppObj,Time,SearchDirection) ) - -#define IAMTimelineTransable_GetTransAtTime2(This,ppObj,Time,SearchDirection) \ - ( (This)->lpVtbl -> GetTransAtTime2(This,ppObj,Time,SearchDirection) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IAMTimelineTransable_INTERFACE_DEFINED__ */ - - -#ifndef __IAMTimelineSplittable_INTERFACE_DEFINED__ -#define __IAMTimelineSplittable_INTERFACE_DEFINED__ - -/* interface IAMTimelineSplittable */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IAMTimelineSplittable; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("A0F840A0-D590-11d2-8D55-00A0C9441E20") - IAMTimelineSplittable : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE SplitAt( - REFERENCE_TIME Time) = 0; - - virtual HRESULT STDMETHODCALLTYPE SplitAt2( - REFTIME Time) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMTimelineSplittableVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMTimelineSplittable * This, - /* [in] */ __RPC__in REFIID riid, - /* [iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMTimelineSplittable * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMTimelineSplittable * This); - - HRESULT ( STDMETHODCALLTYPE *SplitAt )( - IAMTimelineSplittable * This, - REFERENCE_TIME Time); - - HRESULT ( STDMETHODCALLTYPE *SplitAt2 )( - IAMTimelineSplittable * This, - REFTIME Time); - - END_INTERFACE - } IAMTimelineSplittableVtbl; - - interface IAMTimelineSplittable - { - CONST_VTBL struct IAMTimelineSplittableVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMTimelineSplittable_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IAMTimelineSplittable_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IAMTimelineSplittable_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IAMTimelineSplittable_SplitAt(This,Time) \ - ( (This)->lpVtbl -> SplitAt(This,Time) ) - -#define IAMTimelineSplittable_SplitAt2(This,Time) \ - ( (This)->lpVtbl -> SplitAt2(This,Time) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IAMTimelineSplittable_INTERFACE_DEFINED__ */ - - -#ifndef __IAMTimelineTrans_INTERFACE_DEFINED__ -#define __IAMTimelineTrans_INTERFACE_DEFINED__ - -/* interface IAMTimelineTrans */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IAMTimelineTrans; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("BCE0C265-622D-11d2-8CAD-00A024580902") - IAMTimelineTrans : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetCutPoint( - __RPC__in REFERENCE_TIME *pTLTime) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetCutPoint2( - __RPC__in REFTIME *pTLTime) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetCutPoint( - REFERENCE_TIME TLTime) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetCutPoint2( - REFTIME TLTime) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetSwapInputs( - __RPC__in BOOL *pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetSwapInputs( - BOOL pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetCutsOnly( - __RPC__in BOOL *pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetCutsOnly( - BOOL pVal) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMTimelineTransVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMTimelineTrans * This, - /* [in] */ __RPC__in REFIID riid, - /* [iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMTimelineTrans * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMTimelineTrans * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetCutPoint )( - IAMTimelineTrans * This, - __RPC__in REFERENCE_TIME *pTLTime); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetCutPoint2 )( - IAMTimelineTrans * This, - __RPC__in REFTIME *pTLTime); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetCutPoint )( - IAMTimelineTrans * This, - REFERENCE_TIME TLTime); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetCutPoint2 )( - IAMTimelineTrans * This, - REFTIME TLTime); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetSwapInputs )( - IAMTimelineTrans * This, - __RPC__in BOOL *pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetSwapInputs )( - IAMTimelineTrans * This, - BOOL pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetCutsOnly )( - IAMTimelineTrans * This, - __RPC__in BOOL *pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetCutsOnly )( - IAMTimelineTrans * This, - BOOL pVal); - - END_INTERFACE - } IAMTimelineTransVtbl; - - interface IAMTimelineTrans - { - CONST_VTBL struct IAMTimelineTransVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMTimelineTrans_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IAMTimelineTrans_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IAMTimelineTrans_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IAMTimelineTrans_GetCutPoint(This,pTLTime) \ - ( (This)->lpVtbl -> GetCutPoint(This,pTLTime) ) - -#define IAMTimelineTrans_GetCutPoint2(This,pTLTime) \ - ( (This)->lpVtbl -> GetCutPoint2(This,pTLTime) ) - -#define IAMTimelineTrans_SetCutPoint(This,TLTime) \ - ( (This)->lpVtbl -> SetCutPoint(This,TLTime) ) - -#define IAMTimelineTrans_SetCutPoint2(This,TLTime) \ - ( (This)->lpVtbl -> SetCutPoint2(This,TLTime) ) - -#define IAMTimelineTrans_GetSwapInputs(This,pVal) \ - ( (This)->lpVtbl -> GetSwapInputs(This,pVal) ) - -#define IAMTimelineTrans_SetSwapInputs(This,pVal) \ - ( (This)->lpVtbl -> SetSwapInputs(This,pVal) ) - -#define IAMTimelineTrans_GetCutsOnly(This,pVal) \ - ( (This)->lpVtbl -> GetCutsOnly(This,pVal) ) - -#define IAMTimelineTrans_SetCutsOnly(This,pVal) \ - ( (This)->lpVtbl -> SetCutsOnly(This,pVal) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IAMTimelineTrans_INTERFACE_DEFINED__ */ - - -#ifndef __IAMTimelineSrc_INTERFACE_DEFINED__ -#define __IAMTimelineSrc_INTERFACE_DEFINED__ - -/* interface IAMTimelineSrc */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IAMTimelineSrc; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("78530B79-61F9-11D2-8CAD-00A024580902") - IAMTimelineSrc : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMediaTimes( - __RPC__in REFERENCE_TIME *pStart, - __RPC__in REFERENCE_TIME *pStop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMediaTimes2( - __RPC__in REFTIME *pStart, - __RPC__in REFTIME *pStop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE ModifyStopTime( - REFERENCE_TIME Stop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE ModifyStopTime2( - REFTIME Stop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE FixMediaTimes( - __RPC__in REFERENCE_TIME *pStart, - __RPC__in REFERENCE_TIME *pStop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE FixMediaTimes2( - __RPC__in REFTIME *pStart, - __RPC__in REFTIME *pStop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetMediaTimes( - REFERENCE_TIME Start, - REFERENCE_TIME Stop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetMediaTimes2( - REFTIME Start, - REFTIME Stop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetMediaLength( - REFERENCE_TIME Length) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetMediaLength2( - REFTIME Length) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMediaLength( - __RPC__in REFERENCE_TIME *pLength) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMediaLength2( - __RPC__in REFTIME *pLength) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMediaName( - /* [retval][out] */ __RPC__deref_out_opt BSTR *pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetMediaName( - __RPC__in BSTR newVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SpliceWithNext( - __RPC__in_opt IAMTimelineObj *pNext) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetStreamNumber( - __RPC__in long *pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetStreamNumber( - long Val) = 0; - - virtual HRESULT STDMETHODCALLTYPE IsNormalRate( - __RPC__in BOOL *pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDefaultFPS( - __RPC__in double *pFPS) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetDefaultFPS( - double FPS) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetStretchMode( - __RPC__in int *pnStretchMode) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetStretchMode( - int nStretchMode) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMTimelineSrcVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMTimelineSrc * This, - /* [in] */ __RPC__in REFIID riid, - /* [iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMTimelineSrc * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMTimelineSrc * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMediaTimes )( - IAMTimelineSrc * This, - __RPC__in REFERENCE_TIME *pStart, - __RPC__in REFERENCE_TIME *pStop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMediaTimes2 )( - IAMTimelineSrc * This, - __RPC__in REFTIME *pStart, - __RPC__in REFTIME *pStop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *ModifyStopTime )( - IAMTimelineSrc * This, - REFERENCE_TIME Stop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *ModifyStopTime2 )( - IAMTimelineSrc * This, - REFTIME Stop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *FixMediaTimes )( - IAMTimelineSrc * This, - __RPC__in REFERENCE_TIME *pStart, - __RPC__in REFERENCE_TIME *pStop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *FixMediaTimes2 )( - IAMTimelineSrc * This, - __RPC__in REFTIME *pStart, - __RPC__in REFTIME *pStop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetMediaTimes )( - IAMTimelineSrc * This, - REFERENCE_TIME Start, - REFERENCE_TIME Stop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetMediaTimes2 )( - IAMTimelineSrc * This, - REFTIME Start, - REFTIME Stop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetMediaLength )( - IAMTimelineSrc * This, - REFERENCE_TIME Length); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetMediaLength2 )( - IAMTimelineSrc * This, - REFTIME Length); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMediaLength )( - IAMTimelineSrc * This, - __RPC__in REFERENCE_TIME *pLength); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMediaLength2 )( - IAMTimelineSrc * This, - __RPC__in REFTIME *pLength); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMediaName )( - IAMTimelineSrc * This, - /* [retval][out] */ __RPC__deref_out_opt BSTR *pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetMediaName )( - IAMTimelineSrc * This, - __RPC__in BSTR newVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SpliceWithNext )( - IAMTimelineSrc * This, - __RPC__in_opt IAMTimelineObj *pNext); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetStreamNumber )( - IAMTimelineSrc * This, - __RPC__in long *pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetStreamNumber )( - IAMTimelineSrc * This, - long Val); - - HRESULT ( STDMETHODCALLTYPE *IsNormalRate )( - IAMTimelineSrc * This, - __RPC__in BOOL *pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetDefaultFPS )( - IAMTimelineSrc * This, - __RPC__in double *pFPS); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetDefaultFPS )( - IAMTimelineSrc * This, - double FPS); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetStretchMode )( - IAMTimelineSrc * This, - __RPC__in int *pnStretchMode); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetStretchMode )( - IAMTimelineSrc * This, - int nStretchMode); - - END_INTERFACE - } IAMTimelineSrcVtbl; - - interface IAMTimelineSrc - { - CONST_VTBL struct IAMTimelineSrcVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMTimelineSrc_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IAMTimelineSrc_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IAMTimelineSrc_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IAMTimelineSrc_GetMediaTimes(This,pStart,pStop) \ - ( (This)->lpVtbl -> GetMediaTimes(This,pStart,pStop) ) - -#define IAMTimelineSrc_GetMediaTimes2(This,pStart,pStop) \ - ( (This)->lpVtbl -> GetMediaTimes2(This,pStart,pStop) ) - -#define IAMTimelineSrc_ModifyStopTime(This,Stop) \ - ( (This)->lpVtbl -> ModifyStopTime(This,Stop) ) - -#define IAMTimelineSrc_ModifyStopTime2(This,Stop) \ - ( (This)->lpVtbl -> ModifyStopTime2(This,Stop) ) - -#define IAMTimelineSrc_FixMediaTimes(This,pStart,pStop) \ - ( (This)->lpVtbl -> FixMediaTimes(This,pStart,pStop) ) - -#define IAMTimelineSrc_FixMediaTimes2(This,pStart,pStop) \ - ( (This)->lpVtbl -> FixMediaTimes2(This,pStart,pStop) ) - -#define IAMTimelineSrc_SetMediaTimes(This,Start,Stop) \ - ( (This)->lpVtbl -> SetMediaTimes(This,Start,Stop) ) - -#define IAMTimelineSrc_SetMediaTimes2(This,Start,Stop) \ - ( (This)->lpVtbl -> SetMediaTimes2(This,Start,Stop) ) - -#define IAMTimelineSrc_SetMediaLength(This,Length) \ - ( (This)->lpVtbl -> SetMediaLength(This,Length) ) - -#define IAMTimelineSrc_SetMediaLength2(This,Length) \ - ( (This)->lpVtbl -> SetMediaLength2(This,Length) ) - -#define IAMTimelineSrc_GetMediaLength(This,pLength) \ - ( (This)->lpVtbl -> GetMediaLength(This,pLength) ) - -#define IAMTimelineSrc_GetMediaLength2(This,pLength) \ - ( (This)->lpVtbl -> GetMediaLength2(This,pLength) ) - -#define IAMTimelineSrc_GetMediaName(This,pVal) \ - ( (This)->lpVtbl -> GetMediaName(This,pVal) ) - -#define IAMTimelineSrc_SetMediaName(This,newVal) \ - ( (This)->lpVtbl -> SetMediaName(This,newVal) ) - -#define IAMTimelineSrc_SpliceWithNext(This,pNext) \ - ( (This)->lpVtbl -> SpliceWithNext(This,pNext) ) - -#define IAMTimelineSrc_GetStreamNumber(This,pVal) \ - ( (This)->lpVtbl -> GetStreamNumber(This,pVal) ) - -#define IAMTimelineSrc_SetStreamNumber(This,Val) \ - ( (This)->lpVtbl -> SetStreamNumber(This,Val) ) - -#define IAMTimelineSrc_IsNormalRate(This,pVal) \ - ( (This)->lpVtbl -> IsNormalRate(This,pVal) ) - -#define IAMTimelineSrc_GetDefaultFPS(This,pFPS) \ - ( (This)->lpVtbl -> GetDefaultFPS(This,pFPS) ) - -#define IAMTimelineSrc_SetDefaultFPS(This,FPS) \ - ( (This)->lpVtbl -> SetDefaultFPS(This,FPS) ) - -#define IAMTimelineSrc_GetStretchMode(This,pnStretchMode) \ - ( (This)->lpVtbl -> GetStretchMode(This,pnStretchMode) ) - -#define IAMTimelineSrc_SetStretchMode(This,nStretchMode) \ - ( (This)->lpVtbl -> SetStretchMode(This,nStretchMode) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IAMTimelineSrc_INTERFACE_DEFINED__ */ - - -#ifndef __IAMTimelineTrack_INTERFACE_DEFINED__ -#define __IAMTimelineTrack_INTERFACE_DEFINED__ - -/* interface IAMTimelineTrack */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IAMTimelineTrack; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("EAE58538-622E-11d2-8CAD-00A024580902") - IAMTimelineTrack : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SrcAdd( - __RPC__in_opt IAMTimelineObj *pSource) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetNextSrc( - /* [out] */ __RPC__deref_out_opt IAMTimelineObj **ppSrc, - __RPC__in REFERENCE_TIME *pInOut) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetNextSrc2( - /* [out] */ __RPC__deref_out_opt IAMTimelineObj **ppSrc, - __RPC__in REFTIME *pInOut) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE MoveEverythingBy( - REFERENCE_TIME Start, - REFERENCE_TIME MoveBy) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE MoveEverythingBy2( - REFTIME Start, - REFTIME MoveBy) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetSourcesCount( - __RPC__in long *pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE AreYouBlank( - __RPC__in long *pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetSrcAtTime( - /* [out] */ __RPC__deref_out_opt IAMTimelineObj **ppSrc, - REFERENCE_TIME Time, - long SearchDirection) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetSrcAtTime2( - /* [out] */ __RPC__deref_out_opt IAMTimelineObj **ppSrc, - REFTIME Time, - long SearchDirection) = 0; - - virtual HRESULT STDMETHODCALLTYPE InsertSpace( - REFERENCE_TIME rtStart, - REFERENCE_TIME rtEnd) = 0; - - virtual HRESULT STDMETHODCALLTYPE InsertSpace2( - REFTIME rtStart, - REFTIME rtEnd) = 0; - - virtual HRESULT STDMETHODCALLTYPE ZeroBetween( - REFERENCE_TIME rtStart, - REFERENCE_TIME rtEnd) = 0; - - virtual HRESULT STDMETHODCALLTYPE ZeroBetween2( - REFTIME rtStart, - REFTIME rtEnd) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetNextSrcEx( - __RPC__in_opt IAMTimelineObj *pLast, - /* [out] */ __RPC__deref_out_opt IAMTimelineObj **ppNext) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMTimelineTrackVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMTimelineTrack * This, - /* [in] */ __RPC__in REFIID riid, - /* [iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMTimelineTrack * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMTimelineTrack * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SrcAdd )( - IAMTimelineTrack * This, - __RPC__in_opt IAMTimelineObj *pSource); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetNextSrc )( - IAMTimelineTrack * This, - /* [out] */ __RPC__deref_out_opt IAMTimelineObj **ppSrc, - __RPC__in REFERENCE_TIME *pInOut); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetNextSrc2 )( - IAMTimelineTrack * This, - /* [out] */ __RPC__deref_out_opt IAMTimelineObj **ppSrc, - __RPC__in REFTIME *pInOut); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *MoveEverythingBy )( - IAMTimelineTrack * This, - REFERENCE_TIME Start, - REFERENCE_TIME MoveBy); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *MoveEverythingBy2 )( - IAMTimelineTrack * This, - REFTIME Start, - REFTIME MoveBy); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetSourcesCount )( - IAMTimelineTrack * This, - __RPC__in long *pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *AreYouBlank )( - IAMTimelineTrack * This, - __RPC__in long *pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetSrcAtTime )( - IAMTimelineTrack * This, - /* [out] */ __RPC__deref_out_opt IAMTimelineObj **ppSrc, - REFERENCE_TIME Time, - long SearchDirection); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetSrcAtTime2 )( - IAMTimelineTrack * This, - /* [out] */ __RPC__deref_out_opt IAMTimelineObj **ppSrc, - REFTIME Time, - long SearchDirection); - - HRESULT ( STDMETHODCALLTYPE *InsertSpace )( - IAMTimelineTrack * This, - REFERENCE_TIME rtStart, - REFERENCE_TIME rtEnd); - - HRESULT ( STDMETHODCALLTYPE *InsertSpace2 )( - IAMTimelineTrack * This, - REFTIME rtStart, - REFTIME rtEnd); - - HRESULT ( STDMETHODCALLTYPE *ZeroBetween )( - IAMTimelineTrack * This, - REFERENCE_TIME rtStart, - REFERENCE_TIME rtEnd); - - HRESULT ( STDMETHODCALLTYPE *ZeroBetween2 )( - IAMTimelineTrack * This, - REFTIME rtStart, - REFTIME rtEnd); - - HRESULT ( STDMETHODCALLTYPE *GetNextSrcEx )( - IAMTimelineTrack * This, - __RPC__in_opt IAMTimelineObj *pLast, - /* [out] */ __RPC__deref_out_opt IAMTimelineObj **ppNext); - - END_INTERFACE - } IAMTimelineTrackVtbl; - - interface IAMTimelineTrack - { - CONST_VTBL struct IAMTimelineTrackVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMTimelineTrack_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IAMTimelineTrack_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IAMTimelineTrack_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IAMTimelineTrack_SrcAdd(This,pSource) \ - ( (This)->lpVtbl -> SrcAdd(This,pSource) ) - -#define IAMTimelineTrack_GetNextSrc(This,ppSrc,pInOut) \ - ( (This)->lpVtbl -> GetNextSrc(This,ppSrc,pInOut) ) - -#define IAMTimelineTrack_GetNextSrc2(This,ppSrc,pInOut) \ - ( (This)->lpVtbl -> GetNextSrc2(This,ppSrc,pInOut) ) - -#define IAMTimelineTrack_MoveEverythingBy(This,Start,MoveBy) \ - ( (This)->lpVtbl -> MoveEverythingBy(This,Start,MoveBy) ) - -#define IAMTimelineTrack_MoveEverythingBy2(This,Start,MoveBy) \ - ( (This)->lpVtbl -> MoveEverythingBy2(This,Start,MoveBy) ) - -#define IAMTimelineTrack_GetSourcesCount(This,pVal) \ - ( (This)->lpVtbl -> GetSourcesCount(This,pVal) ) - -#define IAMTimelineTrack_AreYouBlank(This,pVal) \ - ( (This)->lpVtbl -> AreYouBlank(This,pVal) ) - -#define IAMTimelineTrack_GetSrcAtTime(This,ppSrc,Time,SearchDirection) \ - ( (This)->lpVtbl -> GetSrcAtTime(This,ppSrc,Time,SearchDirection) ) - -#define IAMTimelineTrack_GetSrcAtTime2(This,ppSrc,Time,SearchDirection) \ - ( (This)->lpVtbl -> GetSrcAtTime2(This,ppSrc,Time,SearchDirection) ) - -#define IAMTimelineTrack_InsertSpace(This,rtStart,rtEnd) \ - ( (This)->lpVtbl -> InsertSpace(This,rtStart,rtEnd) ) - -#define IAMTimelineTrack_InsertSpace2(This,rtStart,rtEnd) \ - ( (This)->lpVtbl -> InsertSpace2(This,rtStart,rtEnd) ) - -#define IAMTimelineTrack_ZeroBetween(This,rtStart,rtEnd) \ - ( (This)->lpVtbl -> ZeroBetween(This,rtStart,rtEnd) ) - -#define IAMTimelineTrack_ZeroBetween2(This,rtStart,rtEnd) \ - ( (This)->lpVtbl -> ZeroBetween2(This,rtStart,rtEnd) ) - -#define IAMTimelineTrack_GetNextSrcEx(This,pLast,ppNext) \ - ( (This)->lpVtbl -> GetNextSrcEx(This,pLast,ppNext) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IAMTimelineTrack_INTERFACE_DEFINED__ */ - - -#ifndef __IAMTimelineVirtualTrack_INTERFACE_DEFINED__ -#define __IAMTimelineVirtualTrack_INTERFACE_DEFINED__ - -/* interface IAMTimelineVirtualTrack */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IAMTimelineVirtualTrack; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("A8ED5F80-C2C7-11d2-8D39-00A0C9441E20") - IAMTimelineVirtualTrack : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE TrackGetPriority( - __RPC__in long *pPriority) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetTrackDirty( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMTimelineVirtualTrackVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMTimelineVirtualTrack * This, - /* [in] */ __RPC__in REFIID riid, - /* [iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMTimelineVirtualTrack * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMTimelineVirtualTrack * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *TrackGetPriority )( - IAMTimelineVirtualTrack * This, - __RPC__in long *pPriority); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetTrackDirty )( - IAMTimelineVirtualTrack * This); - - END_INTERFACE - } IAMTimelineVirtualTrackVtbl; - - interface IAMTimelineVirtualTrack - { - CONST_VTBL struct IAMTimelineVirtualTrackVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMTimelineVirtualTrack_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IAMTimelineVirtualTrack_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IAMTimelineVirtualTrack_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IAMTimelineVirtualTrack_TrackGetPriority(This,pPriority) \ - ( (This)->lpVtbl -> TrackGetPriority(This,pPriority) ) - -#define IAMTimelineVirtualTrack_SetTrackDirty(This) \ - ( (This)->lpVtbl -> SetTrackDirty(This) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IAMTimelineVirtualTrack_INTERFACE_DEFINED__ */ - - -#ifndef __IAMTimelineComp_INTERFACE_DEFINED__ -#define __IAMTimelineComp_INTERFACE_DEFINED__ - -/* interface IAMTimelineComp */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IAMTimelineComp; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("EAE58536-622E-11d2-8CAD-00A024580902") - IAMTimelineComp : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE VTrackInsBefore( - __RPC__in_opt IAMTimelineObj *pVirtualTrack, - long Priority) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE VTrackSwapPriorities( - long VirtualTrackA, - long VirtualTrackB) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE VTrackGetCount( - __RPC__in long *pVal) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetVTrack( - /* [out] */ __RPC__deref_out_opt IAMTimelineObj **ppVirtualTrack, - long Which) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetCountOfType( - __RPC__in long *pVal, - __RPC__in long *pValWithComps, - TIMELINE_MAJOR_TYPE MajorType) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetRecursiveLayerOfType( - /* [out] */ __RPC__deref_out_opt IAMTimelineObj **ppVirtualTrack, - long WhichLayer, - TIMELINE_MAJOR_TYPE Type) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetRecursiveLayerOfTypeI( - /* [out] */ __RPC__deref_out_opt IAMTimelineObj **ppVirtualTrack, - /* [out][in] */ __RPC__inout long *pWhichLayer, - TIMELINE_MAJOR_TYPE Type) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetNextVTrack( - __RPC__in_opt IAMTimelineObj *pVirtualTrack, - /* [out] */ __RPC__deref_out_opt IAMTimelineObj **ppNextVirtualTrack) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMTimelineCompVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMTimelineComp * This, - /* [in] */ __RPC__in REFIID riid, - /* [iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMTimelineComp * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMTimelineComp * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *VTrackInsBefore )( - IAMTimelineComp * This, - __RPC__in_opt IAMTimelineObj *pVirtualTrack, - long Priority); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *VTrackSwapPriorities )( - IAMTimelineComp * This, - long VirtualTrackA, - long VirtualTrackB); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *VTrackGetCount )( - IAMTimelineComp * This, - __RPC__in long *pVal); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetVTrack )( - IAMTimelineComp * This, - /* [out] */ __RPC__deref_out_opt IAMTimelineObj **ppVirtualTrack, - long Which); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetCountOfType )( - IAMTimelineComp * This, - __RPC__in long *pVal, - __RPC__in long *pValWithComps, - TIMELINE_MAJOR_TYPE MajorType); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetRecursiveLayerOfType )( - IAMTimelineComp * This, - /* [out] */ __RPC__deref_out_opt IAMTimelineObj **ppVirtualTrack, - long WhichLayer, - TIMELINE_MAJOR_TYPE Type); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetRecursiveLayerOfTypeI )( - IAMTimelineComp * This, - /* [out] */ __RPC__deref_out_opt IAMTimelineObj **ppVirtualTrack, - /* [out][in] */ __RPC__inout long *pWhichLayer, - TIMELINE_MAJOR_TYPE Type); - - HRESULT ( STDMETHODCALLTYPE *GetNextVTrack )( - IAMTimelineComp * This, - __RPC__in_opt IAMTimelineObj *pVirtualTrack, - /* [out] */ __RPC__deref_out_opt IAMTimelineObj **ppNextVirtualTrack); - - END_INTERFACE - } IAMTimelineCompVtbl; - - interface IAMTimelineComp - { - CONST_VTBL struct IAMTimelineCompVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMTimelineComp_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IAMTimelineComp_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IAMTimelineComp_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IAMTimelineComp_VTrackInsBefore(This,pVirtualTrack,Priority) \ - ( (This)->lpVtbl -> VTrackInsBefore(This,pVirtualTrack,Priority) ) - -#define IAMTimelineComp_VTrackSwapPriorities(This,VirtualTrackA,VirtualTrackB) \ - ( (This)->lpVtbl -> VTrackSwapPriorities(This,VirtualTrackA,VirtualTrackB) ) - -#define IAMTimelineComp_VTrackGetCount(This,pVal) \ - ( (This)->lpVtbl -> VTrackGetCount(This,pVal) ) - -#define IAMTimelineComp_GetVTrack(This,ppVirtualTrack,Which) \ - ( (This)->lpVtbl -> GetVTrack(This,ppVirtualTrack,Which) ) - -#define IAMTimelineComp_GetCountOfType(This,pVal,pValWithComps,MajorType) \ - ( (This)->lpVtbl -> GetCountOfType(This,pVal,pValWithComps,MajorType) ) - -#define IAMTimelineComp_GetRecursiveLayerOfType(This,ppVirtualTrack,WhichLayer,Type) \ - ( (This)->lpVtbl -> GetRecursiveLayerOfType(This,ppVirtualTrack,WhichLayer,Type) ) - -#define IAMTimelineComp_GetRecursiveLayerOfTypeI(This,ppVirtualTrack,pWhichLayer,Type) \ - ( (This)->lpVtbl -> GetRecursiveLayerOfTypeI(This,ppVirtualTrack,pWhichLayer,Type) ) - -#define IAMTimelineComp_GetNextVTrack(This,pVirtualTrack,ppNextVirtualTrack) \ - ( (This)->lpVtbl -> GetNextVTrack(This,pVirtualTrack,ppNextVirtualTrack) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IAMTimelineComp_INTERFACE_DEFINED__ */ - - -#ifndef __IAMTimelineGroup_INTERFACE_DEFINED__ -#define __IAMTimelineGroup_INTERFACE_DEFINED__ - -/* interface IAMTimelineGroup */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IAMTimelineGroup; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("9EED4F00-B8A6-11d2-8023-00C0DF10D434") - IAMTimelineGroup : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetTimeline( - __RPC__in_opt IAMTimeline *pTimeline) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetTimeline( - /* [out] */ __RPC__deref_out_opt IAMTimeline **ppTimeline) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetPriority( - __RPC__in long *pPriority) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMediaType( - /* [out] */ __RPC__out AM_MEDIA_TYPE *__MIDL__IAMTimelineGroup0000) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetMediaType( - /* [in] */ __RPC__in AM_MEDIA_TYPE *__MIDL__IAMTimelineGroup0001) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetOutputFPS( - double FPS) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetOutputFPS( - __RPC__in double *pFPS) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetGroupName( - __RPC__in BSTR pGroupName) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetGroupName( - /* [retval][out] */ __RPC__deref_out_opt BSTR *pGroupName) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetPreviewMode( - BOOL fPreview) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetPreviewMode( - __RPC__in BOOL *pfPreview) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetMediaTypeForVB( - /* [in] */ long Val) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetOutputBuffering( - /* [out] */ __RPC__out int *pnBuffer) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetOutputBuffering( - /* [in] */ int nBuffer) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetSmartRecompressFormat( - __RPC__in long *pFormat) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetSmartRecompressFormat( - __RPC__deref_in_opt long **ppFormat) = 0; - - virtual HRESULT STDMETHODCALLTYPE IsSmartRecompressFormatSet( - __RPC__in BOOL *pVal) = 0; - - virtual HRESULT STDMETHODCALLTYPE IsRecompressFormatDirty( - __RPC__in BOOL *pVal) = 0; - - virtual HRESULT STDMETHODCALLTYPE ClearRecompressFormatDirty( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetRecompFormatFromSource( - __RPC__in_opt IAMTimelineSrc *pSource) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMTimelineGroupVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMTimelineGroup * This, - /* [in] */ __RPC__in REFIID riid, - /* [iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMTimelineGroup * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMTimelineGroup * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetTimeline )( - IAMTimelineGroup * This, - __RPC__in_opt IAMTimeline *pTimeline); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetTimeline )( - IAMTimelineGroup * This, - /* [out] */ __RPC__deref_out_opt IAMTimeline **ppTimeline); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetPriority )( - IAMTimelineGroup * This, - __RPC__in long *pPriority); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMediaType )( - IAMTimelineGroup * This, - /* [out] */ __RPC__out AM_MEDIA_TYPE *__MIDL__IAMTimelineGroup0000); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetMediaType )( - IAMTimelineGroup * This, - /* [in] */ __RPC__in AM_MEDIA_TYPE *__MIDL__IAMTimelineGroup0001); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetOutputFPS )( - IAMTimelineGroup * This, - double FPS); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetOutputFPS )( - IAMTimelineGroup * This, - __RPC__in double *pFPS); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetGroupName )( - IAMTimelineGroup * This, - __RPC__in BSTR pGroupName); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetGroupName )( - IAMTimelineGroup * This, - /* [retval][out] */ __RPC__deref_out_opt BSTR *pGroupName); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetPreviewMode )( - IAMTimelineGroup * This, - BOOL fPreview); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetPreviewMode )( - IAMTimelineGroup * This, - __RPC__in BOOL *pfPreview); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetMediaTypeForVB )( - IAMTimelineGroup * This, - /* [in] */ long Val); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetOutputBuffering )( - IAMTimelineGroup * This, - /* [out] */ __RPC__out int *pnBuffer); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetOutputBuffering )( - IAMTimelineGroup * This, - /* [in] */ int nBuffer); - - HRESULT ( STDMETHODCALLTYPE *SetSmartRecompressFormat )( - IAMTimelineGroup * This, - __RPC__in long *pFormat); - - HRESULT ( STDMETHODCALLTYPE *GetSmartRecompressFormat )( - IAMTimelineGroup * This, - __RPC__deref_in_opt long **ppFormat); - - HRESULT ( STDMETHODCALLTYPE *IsSmartRecompressFormatSet )( - IAMTimelineGroup * This, - __RPC__in BOOL *pVal); - - HRESULT ( STDMETHODCALLTYPE *IsRecompressFormatDirty )( - IAMTimelineGroup * This, - __RPC__in BOOL *pVal); - - HRESULT ( STDMETHODCALLTYPE *ClearRecompressFormatDirty )( - IAMTimelineGroup * This); - - HRESULT ( STDMETHODCALLTYPE *SetRecompFormatFromSource )( - IAMTimelineGroup * This, - __RPC__in_opt IAMTimelineSrc *pSource); - - END_INTERFACE - } IAMTimelineGroupVtbl; - - interface IAMTimelineGroup - { - CONST_VTBL struct IAMTimelineGroupVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMTimelineGroup_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IAMTimelineGroup_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IAMTimelineGroup_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IAMTimelineGroup_SetTimeline(This,pTimeline) \ - ( (This)->lpVtbl -> SetTimeline(This,pTimeline) ) - -#define IAMTimelineGroup_GetTimeline(This,ppTimeline) \ - ( (This)->lpVtbl -> GetTimeline(This,ppTimeline) ) - -#define IAMTimelineGroup_GetPriority(This,pPriority) \ - ( (This)->lpVtbl -> GetPriority(This,pPriority) ) - -#define IAMTimelineGroup_GetMediaType(This,__MIDL__IAMTimelineGroup0000) \ - ( (This)->lpVtbl -> GetMediaType(This,__MIDL__IAMTimelineGroup0000) ) - -#define IAMTimelineGroup_SetMediaType(This,__MIDL__IAMTimelineGroup0001) \ - ( (This)->lpVtbl -> SetMediaType(This,__MIDL__IAMTimelineGroup0001) ) - -#define IAMTimelineGroup_SetOutputFPS(This,FPS) \ - ( (This)->lpVtbl -> SetOutputFPS(This,FPS) ) - -#define IAMTimelineGroup_GetOutputFPS(This,pFPS) \ - ( (This)->lpVtbl -> GetOutputFPS(This,pFPS) ) - -#define IAMTimelineGroup_SetGroupName(This,pGroupName) \ - ( (This)->lpVtbl -> SetGroupName(This,pGroupName) ) - -#define IAMTimelineGroup_GetGroupName(This,pGroupName) \ - ( (This)->lpVtbl -> GetGroupName(This,pGroupName) ) - -#define IAMTimelineGroup_SetPreviewMode(This,fPreview) \ - ( (This)->lpVtbl -> SetPreviewMode(This,fPreview) ) - -#define IAMTimelineGroup_GetPreviewMode(This,pfPreview) \ - ( (This)->lpVtbl -> GetPreviewMode(This,pfPreview) ) - -#define IAMTimelineGroup_SetMediaTypeForVB(This,Val) \ - ( (This)->lpVtbl -> SetMediaTypeForVB(This,Val) ) - -#define IAMTimelineGroup_GetOutputBuffering(This,pnBuffer) \ - ( (This)->lpVtbl -> GetOutputBuffering(This,pnBuffer) ) - -#define IAMTimelineGroup_SetOutputBuffering(This,nBuffer) \ - ( (This)->lpVtbl -> SetOutputBuffering(This,nBuffer) ) - -#define IAMTimelineGroup_SetSmartRecompressFormat(This,pFormat) \ - ( (This)->lpVtbl -> SetSmartRecompressFormat(This,pFormat) ) - -#define IAMTimelineGroup_GetSmartRecompressFormat(This,ppFormat) \ - ( (This)->lpVtbl -> GetSmartRecompressFormat(This,ppFormat) ) - -#define IAMTimelineGroup_IsSmartRecompressFormatSet(This,pVal) \ - ( (This)->lpVtbl -> IsSmartRecompressFormatSet(This,pVal) ) - -#define IAMTimelineGroup_IsRecompressFormatDirty(This,pVal) \ - ( (This)->lpVtbl -> IsRecompressFormatDirty(This,pVal) ) - -#define IAMTimelineGroup_ClearRecompressFormatDirty(This) \ - ( (This)->lpVtbl -> ClearRecompressFormatDirty(This) ) - -#define IAMTimelineGroup_SetRecompFormatFromSource(This,pSource) \ - ( (This)->lpVtbl -> SetRecompFormatFromSource(This,pSource) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IAMTimelineGroup_INTERFACE_DEFINED__ */ - - -#ifndef __IAMTimeline_INTERFACE_DEFINED__ -#define __IAMTimeline_INTERFACE_DEFINED__ - -/* interface IAMTimeline */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IAMTimeline; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("78530B74-61F9-11D2-8CAD-00A024580902") - IAMTimeline : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CreateEmptyNode( - /* [out] */ __RPC__deref_out_opt IAMTimelineObj **ppObj, - TIMELINE_MAJOR_TYPE Type) = 0; - - virtual HRESULT STDMETHODCALLTYPE AddGroup( - __RPC__in_opt IAMTimelineObj *pGroup) = 0; - - virtual HRESULT STDMETHODCALLTYPE RemGroupFromList( - __RPC__in_opt IAMTimelineObj *pGroup) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetGroup( - /* [out] */ __RPC__deref_out_opt IAMTimelineObj **ppGroup, - long WhichGroup) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetGroupCount( - __RPC__in long *pCount) = 0; - - virtual HRESULT STDMETHODCALLTYPE ClearAllGroups( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetInsertMode( - __RPC__in long *pMode) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetInsertMode( - long Mode) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE EnableTransitions( - BOOL fEnabled) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE TransitionsEnabled( - __RPC__in BOOL *pfEnabled) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE EnableEffects( - BOOL fEnabled) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE EffectsEnabled( - __RPC__in BOOL *pfEnabled) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetInterestRange( - REFERENCE_TIME Start, - REFERENCE_TIME Stop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDuration( - __RPC__in REFERENCE_TIME *pDuration) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDuration2( - __RPC__in double *pDuration) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetDefaultFPS( - double FPS) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDefaultFPS( - __RPC__in double *pFPS) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE IsDirty( - __RPC__in BOOL *pDirty) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDirtyRange( - __RPC__in REFERENCE_TIME *pStart, - __RPC__in REFERENCE_TIME *pStop) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetCountOfType( - long Group, - __RPC__in long *pVal, - __RPC__in long *pValWithComps, - TIMELINE_MAJOR_TYPE MajorType) = 0; - - virtual HRESULT STDMETHODCALLTYPE ValidateSourceNames( - long ValidateFlags, - __RPC__in_opt IMediaLocator *pOverride, - LONG_PTR NotifyEventHandle) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetDefaultTransition( - __RPC__in GUID *pGuid) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetDefaultTransition( - __RPC__in GUID *pGuid) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetDefaultEffect( - __RPC__in GUID *pGuid) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetDefaultEffect( - __RPC__in GUID *pGuid) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetDefaultTransitionB( - __RPC__in BSTR pGuid) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetDefaultTransitionB( - /* [retval][out] */ __RPC__deref_out_opt BSTR *pGuid) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetDefaultEffectB( - __RPC__in BSTR pGuid) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetDefaultEffectB( - /* [retval][out] */ __RPC__deref_out_opt BSTR *pGuid) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMTimelineVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMTimeline * This, - /* [in] */ __RPC__in REFIID riid, - /* [iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMTimeline * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMTimeline * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *CreateEmptyNode )( - IAMTimeline * This, - /* [out] */ __RPC__deref_out_opt IAMTimelineObj **ppObj, - TIMELINE_MAJOR_TYPE Type); - - HRESULT ( STDMETHODCALLTYPE *AddGroup )( - IAMTimeline * This, - __RPC__in_opt IAMTimelineObj *pGroup); - - HRESULT ( STDMETHODCALLTYPE *RemGroupFromList )( - IAMTimeline * This, - __RPC__in_opt IAMTimelineObj *pGroup); - - HRESULT ( STDMETHODCALLTYPE *GetGroup )( - IAMTimeline * This, - /* [out] */ __RPC__deref_out_opt IAMTimelineObj **ppGroup, - long WhichGroup); - - HRESULT ( STDMETHODCALLTYPE *GetGroupCount )( - IAMTimeline * This, - __RPC__in long *pCount); - - HRESULT ( STDMETHODCALLTYPE *ClearAllGroups )( - IAMTimeline * This); - - HRESULT ( STDMETHODCALLTYPE *GetInsertMode )( - IAMTimeline * This, - __RPC__in long *pMode); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetInsertMode )( - IAMTimeline * This, - long Mode); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *EnableTransitions )( - IAMTimeline * This, - BOOL fEnabled); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *TransitionsEnabled )( - IAMTimeline * This, - __RPC__in BOOL *pfEnabled); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *EnableEffects )( - IAMTimeline * This, - BOOL fEnabled); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *EffectsEnabled )( - IAMTimeline * This, - __RPC__in BOOL *pfEnabled); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetInterestRange )( - IAMTimeline * This, - REFERENCE_TIME Start, - REFERENCE_TIME Stop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetDuration )( - IAMTimeline * This, - __RPC__in REFERENCE_TIME *pDuration); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetDuration2 )( - IAMTimeline * This, - __RPC__in double *pDuration); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetDefaultFPS )( - IAMTimeline * This, - double FPS); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetDefaultFPS )( - IAMTimeline * This, - __RPC__in double *pFPS); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *IsDirty )( - IAMTimeline * This, - __RPC__in BOOL *pDirty); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetDirtyRange )( - IAMTimeline * This, - __RPC__in REFERENCE_TIME *pStart, - __RPC__in REFERENCE_TIME *pStop); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetCountOfType )( - IAMTimeline * This, - long Group, - __RPC__in long *pVal, - __RPC__in long *pValWithComps, - TIMELINE_MAJOR_TYPE MajorType); - - HRESULT ( STDMETHODCALLTYPE *ValidateSourceNames )( - IAMTimeline * This, - long ValidateFlags, - __RPC__in_opt IMediaLocator *pOverride, - LONG_PTR NotifyEventHandle); - - HRESULT ( STDMETHODCALLTYPE *SetDefaultTransition )( - IAMTimeline * This, - __RPC__in GUID *pGuid); - - HRESULT ( STDMETHODCALLTYPE *GetDefaultTransition )( - IAMTimeline * This, - __RPC__in GUID *pGuid); - - HRESULT ( STDMETHODCALLTYPE *SetDefaultEffect )( - IAMTimeline * This, - __RPC__in GUID *pGuid); - - HRESULT ( STDMETHODCALLTYPE *GetDefaultEffect )( - IAMTimeline * This, - __RPC__in GUID *pGuid); - - HRESULT ( STDMETHODCALLTYPE *SetDefaultTransitionB )( - IAMTimeline * This, - __RPC__in BSTR pGuid); - - HRESULT ( STDMETHODCALLTYPE *GetDefaultTransitionB )( - IAMTimeline * This, - /* [retval][out] */ __RPC__deref_out_opt BSTR *pGuid); - - HRESULT ( STDMETHODCALLTYPE *SetDefaultEffectB )( - IAMTimeline * This, - __RPC__in BSTR pGuid); - - HRESULT ( STDMETHODCALLTYPE *GetDefaultEffectB )( - IAMTimeline * This, - /* [retval][out] */ __RPC__deref_out_opt BSTR *pGuid); - - END_INTERFACE - } IAMTimelineVtbl; - - interface IAMTimeline - { - CONST_VTBL struct IAMTimelineVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMTimeline_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IAMTimeline_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IAMTimeline_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IAMTimeline_CreateEmptyNode(This,ppObj,Type) \ - ( (This)->lpVtbl -> CreateEmptyNode(This,ppObj,Type) ) - -#define IAMTimeline_AddGroup(This,pGroup) \ - ( (This)->lpVtbl -> AddGroup(This,pGroup) ) - -#define IAMTimeline_RemGroupFromList(This,pGroup) \ - ( (This)->lpVtbl -> RemGroupFromList(This,pGroup) ) - -#define IAMTimeline_GetGroup(This,ppGroup,WhichGroup) \ - ( (This)->lpVtbl -> GetGroup(This,ppGroup,WhichGroup) ) - -#define IAMTimeline_GetGroupCount(This,pCount) \ - ( (This)->lpVtbl -> GetGroupCount(This,pCount) ) - -#define IAMTimeline_ClearAllGroups(This) \ - ( (This)->lpVtbl -> ClearAllGroups(This) ) - -#define IAMTimeline_GetInsertMode(This,pMode) \ - ( (This)->lpVtbl -> GetInsertMode(This,pMode) ) - -#define IAMTimeline_SetInsertMode(This,Mode) \ - ( (This)->lpVtbl -> SetInsertMode(This,Mode) ) - -#define IAMTimeline_EnableTransitions(This,fEnabled) \ - ( (This)->lpVtbl -> EnableTransitions(This,fEnabled) ) - -#define IAMTimeline_TransitionsEnabled(This,pfEnabled) \ - ( (This)->lpVtbl -> TransitionsEnabled(This,pfEnabled) ) - -#define IAMTimeline_EnableEffects(This,fEnabled) \ - ( (This)->lpVtbl -> EnableEffects(This,fEnabled) ) - -#define IAMTimeline_EffectsEnabled(This,pfEnabled) \ - ( (This)->lpVtbl -> EffectsEnabled(This,pfEnabled) ) - -#define IAMTimeline_SetInterestRange(This,Start,Stop) \ - ( (This)->lpVtbl -> SetInterestRange(This,Start,Stop) ) - -#define IAMTimeline_GetDuration(This,pDuration) \ - ( (This)->lpVtbl -> GetDuration(This,pDuration) ) - -#define IAMTimeline_GetDuration2(This,pDuration) \ - ( (This)->lpVtbl -> GetDuration2(This,pDuration) ) - -#define IAMTimeline_SetDefaultFPS(This,FPS) \ - ( (This)->lpVtbl -> SetDefaultFPS(This,FPS) ) - -#define IAMTimeline_GetDefaultFPS(This,pFPS) \ - ( (This)->lpVtbl -> GetDefaultFPS(This,pFPS) ) - -#define IAMTimeline_IsDirty(This,pDirty) \ - ( (This)->lpVtbl -> IsDirty(This,pDirty) ) - -#define IAMTimeline_GetDirtyRange(This,pStart,pStop) \ - ( (This)->lpVtbl -> GetDirtyRange(This,pStart,pStop) ) - -#define IAMTimeline_GetCountOfType(This,Group,pVal,pValWithComps,MajorType) \ - ( (This)->lpVtbl -> GetCountOfType(This,Group,pVal,pValWithComps,MajorType) ) - -#define IAMTimeline_ValidateSourceNames(This,ValidateFlags,pOverride,NotifyEventHandle) \ - ( (This)->lpVtbl -> ValidateSourceNames(This,ValidateFlags,pOverride,NotifyEventHandle) ) - -#define IAMTimeline_SetDefaultTransition(This,pGuid) \ - ( (This)->lpVtbl -> SetDefaultTransition(This,pGuid) ) - -#define IAMTimeline_GetDefaultTransition(This,pGuid) \ - ( (This)->lpVtbl -> GetDefaultTransition(This,pGuid) ) - -#define IAMTimeline_SetDefaultEffect(This,pGuid) \ - ( (This)->lpVtbl -> SetDefaultEffect(This,pGuid) ) - -#define IAMTimeline_GetDefaultEffect(This,pGuid) \ - ( (This)->lpVtbl -> GetDefaultEffect(This,pGuid) ) - -#define IAMTimeline_SetDefaultTransitionB(This,pGuid) \ - ( (This)->lpVtbl -> SetDefaultTransitionB(This,pGuid) ) - -#define IAMTimeline_GetDefaultTransitionB(This,pGuid) \ - ( (This)->lpVtbl -> GetDefaultTransitionB(This,pGuid) ) - -#define IAMTimeline_SetDefaultEffectB(This,pGuid) \ - ( (This)->lpVtbl -> SetDefaultEffectB(This,pGuid) ) - -#define IAMTimeline_GetDefaultEffectB(This,pGuid) \ - ( (This)->lpVtbl -> GetDefaultEffectB(This,pGuid) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IAMTimeline_INTERFACE_DEFINED__ */ - - -#ifndef __IXml2Dex_INTERFACE_DEFINED__ -#define __IXml2Dex_INTERFACE_DEFINED__ - -/* interface IXml2Dex */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IXml2Dex; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("18C628ED-962A-11D2-8D08-00A0C9441E20") - IXml2Dex : public IDispatch - { - public: - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE CreateGraphFromFile( - /* [out] */ __RPC__deref_out_opt IUnknown **ppGraph, - __RPC__in_opt IUnknown *pTimeline, - __RPC__in BSTR Filename) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE WriteGrfFile( - __RPC__in_opt IUnknown *pGraph, - __RPC__in BSTR FileName) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE WriteXMLFile( - __RPC__in_opt IUnknown *pTimeline, - __RPC__in BSTR FileName) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ReadXMLFile( - __RPC__in_opt IUnknown *pTimeline, - __RPC__in BSTR XMLName) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Delete( - __RPC__in_opt IUnknown *pTimeline, - double dStart, - double dEnd) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE WriteXMLPart( - __RPC__in_opt IUnknown *pTimeline, - double dStart, - double dEnd, - __RPC__in BSTR FileName) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE PasteXMLFile( - __RPC__in_opt IUnknown *pTimeline, - double dStart, - __RPC__in BSTR FileName) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE CopyXML( - __RPC__in_opt IUnknown *pTimeline, - double dStart, - double dEnd) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE PasteXML( - __RPC__in_opt IUnknown *pTimeline, - double dStart) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Reset( void) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ReadXML( - __RPC__in_opt IUnknown *pTimeline, - __RPC__in_opt IUnknown *pXML) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE WriteXML( - __RPC__in_opt IUnknown *pTimeline, - __RPC__deref_in_opt BSTR *pbstrXML) = 0; - - }; - -#else /* C style interface */ - - typedef struct IXml2DexVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IXml2Dex * This, - /* [in] */ __RPC__in REFIID riid, - /* [iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IXml2Dex * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IXml2Dex * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IXml2Dex * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IXml2Dex * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IXml2Dex * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IXml2Dex * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *CreateGraphFromFile )( - IXml2Dex * This, - /* [out] */ __RPC__deref_out_opt IUnknown **ppGraph, - __RPC__in_opt IUnknown *pTimeline, - __RPC__in BSTR Filename); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *WriteGrfFile )( - IXml2Dex * This, - __RPC__in_opt IUnknown *pGraph, - __RPC__in BSTR FileName); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *WriteXMLFile )( - IXml2Dex * This, - __RPC__in_opt IUnknown *pTimeline, - __RPC__in BSTR FileName); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *ReadXMLFile )( - IXml2Dex * This, - __RPC__in_opt IUnknown *pTimeline, - __RPC__in BSTR XMLName); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Delete )( - IXml2Dex * This, - __RPC__in_opt IUnknown *pTimeline, - double dStart, - double dEnd); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *WriteXMLPart )( - IXml2Dex * This, - __RPC__in_opt IUnknown *pTimeline, - double dStart, - double dEnd, - __RPC__in BSTR FileName); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *PasteXMLFile )( - IXml2Dex * This, - __RPC__in_opt IUnknown *pTimeline, - double dStart, - __RPC__in BSTR FileName); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *CopyXML )( - IXml2Dex * This, - __RPC__in_opt IUnknown *pTimeline, - double dStart, - double dEnd); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *PasteXML )( - IXml2Dex * This, - __RPC__in_opt IUnknown *pTimeline, - double dStart); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Reset )( - IXml2Dex * This); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *ReadXML )( - IXml2Dex * This, - __RPC__in_opt IUnknown *pTimeline, - __RPC__in_opt IUnknown *pXML); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *WriteXML )( - IXml2Dex * This, - __RPC__in_opt IUnknown *pTimeline, - __RPC__deref_in_opt BSTR *pbstrXML); - - END_INTERFACE - } IXml2DexVtbl; - - interface IXml2Dex - { - CONST_VTBL struct IXml2DexVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IXml2Dex_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IXml2Dex_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IXml2Dex_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IXml2Dex_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define IXml2Dex_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define IXml2Dex_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define IXml2Dex_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define IXml2Dex_CreateGraphFromFile(This,ppGraph,pTimeline,Filename) \ - ( (This)->lpVtbl -> CreateGraphFromFile(This,ppGraph,pTimeline,Filename) ) - -#define IXml2Dex_WriteGrfFile(This,pGraph,FileName) \ - ( (This)->lpVtbl -> WriteGrfFile(This,pGraph,FileName) ) - -#define IXml2Dex_WriteXMLFile(This,pTimeline,FileName) \ - ( (This)->lpVtbl -> WriteXMLFile(This,pTimeline,FileName) ) - -#define IXml2Dex_ReadXMLFile(This,pTimeline,XMLName) \ - ( (This)->lpVtbl -> ReadXMLFile(This,pTimeline,XMLName) ) - -#define IXml2Dex_Delete(This,pTimeline,dStart,dEnd) \ - ( (This)->lpVtbl -> Delete(This,pTimeline,dStart,dEnd) ) - -#define IXml2Dex_WriteXMLPart(This,pTimeline,dStart,dEnd,FileName) \ - ( (This)->lpVtbl -> WriteXMLPart(This,pTimeline,dStart,dEnd,FileName) ) - -#define IXml2Dex_PasteXMLFile(This,pTimeline,dStart,FileName) \ - ( (This)->lpVtbl -> PasteXMLFile(This,pTimeline,dStart,FileName) ) - -#define IXml2Dex_CopyXML(This,pTimeline,dStart,dEnd) \ - ( (This)->lpVtbl -> CopyXML(This,pTimeline,dStart,dEnd) ) - -#define IXml2Dex_PasteXML(This,pTimeline,dStart) \ - ( (This)->lpVtbl -> PasteXML(This,pTimeline,dStart) ) - -#define IXml2Dex_Reset(This) \ - ( (This)->lpVtbl -> Reset(This) ) - -#define IXml2Dex_ReadXML(This,pTimeline,pXML) \ - ( (This)->lpVtbl -> ReadXML(This,pTimeline,pXML) ) - -#define IXml2Dex_WriteXML(This,pTimeline,pbstrXML) \ - ( (This)->lpVtbl -> WriteXML(This,pTimeline,pbstrXML) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IXml2Dex_INTERFACE_DEFINED__ */ - - -#ifndef __IAMErrorLog_INTERFACE_DEFINED__ -#define __IAMErrorLog_INTERFACE_DEFINED__ - -/* interface IAMErrorLog */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IAMErrorLog; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("E43E73A2-0EFA-11d3-9601-00A0C9441E20") - IAMErrorLog : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE LogError( - long Severity, - __RPC__in BSTR pErrorString, - long ErrorCode, - long hresult, - /* [in] */ __RPC__in VARIANT *pExtraInfo) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMErrorLogVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMErrorLog * This, - /* [in] */ __RPC__in REFIID riid, - /* [iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMErrorLog * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMErrorLog * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *LogError )( - IAMErrorLog * This, - long Severity, - __RPC__in BSTR pErrorString, - long ErrorCode, - long hresult, - /* [in] */ __RPC__in VARIANT *pExtraInfo); - - END_INTERFACE - } IAMErrorLogVtbl; - - interface IAMErrorLog - { - CONST_VTBL struct IAMErrorLogVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMErrorLog_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IAMErrorLog_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IAMErrorLog_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IAMErrorLog_LogError(This,Severity,pErrorString,ErrorCode,hresult,pExtraInfo) \ - ( (This)->lpVtbl -> LogError(This,Severity,pErrorString,ErrorCode,hresult,pExtraInfo) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IAMErrorLog_INTERFACE_DEFINED__ */ - - -#ifndef __IAMSetErrorLog_INTERFACE_DEFINED__ -#define __IAMSetErrorLog_INTERFACE_DEFINED__ - -/* interface IAMSetErrorLog */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IAMSetErrorLog; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("963566DA-BE21-4eaf-88E9-35704F8F52A1") - IAMSetErrorLog : public IUnknown - { - public: - virtual /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_ErrorLog( - /* [retval][out] */ __RPC__deref_out_opt IAMErrorLog **pVal) = 0; - - virtual /* [helpstring][propput] */ HRESULT STDMETHODCALLTYPE put_ErrorLog( - /* [in] */ __RPC__in_opt IAMErrorLog *newVal) = 0; - - }; - -#else /* C style interface */ - - typedef struct IAMSetErrorLogVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMSetErrorLog * This, - /* [in] */ __RPC__in REFIID riid, - /* [iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMSetErrorLog * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMSetErrorLog * This); - - /* [helpstring][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ErrorLog )( - IAMSetErrorLog * This, - /* [retval][out] */ __RPC__deref_out_opt IAMErrorLog **pVal); - - /* [helpstring][propput] */ HRESULT ( STDMETHODCALLTYPE *put_ErrorLog )( - IAMSetErrorLog * This, - /* [in] */ __RPC__in_opt IAMErrorLog *newVal); - - END_INTERFACE - } IAMSetErrorLogVtbl; - - interface IAMSetErrorLog - { - CONST_VTBL struct IAMSetErrorLogVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IAMSetErrorLog_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IAMSetErrorLog_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IAMSetErrorLog_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IAMSetErrorLog_get_ErrorLog(This,pVal) \ - ( (This)->lpVtbl -> get_ErrorLog(This,pVal) ) - -#define IAMSetErrorLog_put_ErrorLog(This,newVal) \ - ( (This)->lpVtbl -> put_ErrorLog(This,newVal) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IAMSetErrorLog_INTERFACE_DEFINED__ */ - - -#ifndef __ISampleGrabberCB_INTERFACE_DEFINED__ -#define __ISampleGrabberCB_INTERFACE_DEFINED__ - -/* interface ISampleGrabberCB */ -/* [unique][helpstring][local][uuid][object] */ - - -EXTERN_C const IID IID_ISampleGrabberCB; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("0579154A-2B53-4994-B0D0-E773148EFF85") - ISampleGrabberCB : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE SampleCB( - double SampleTime, - IMediaSample *pSample) = 0; - - virtual HRESULT STDMETHODCALLTYPE BufferCB( - double SampleTime, - BYTE *pBuffer, - long BufferLen) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISampleGrabberCBVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ISampleGrabberCB * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ISampleGrabberCB * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ISampleGrabberCB * This); - - HRESULT ( STDMETHODCALLTYPE *SampleCB )( - ISampleGrabberCB * This, - double SampleTime, - IMediaSample *pSample); - - HRESULT ( STDMETHODCALLTYPE *BufferCB )( - ISampleGrabberCB * This, - double SampleTime, - BYTE *pBuffer, - long BufferLen); - - END_INTERFACE - } ISampleGrabberCBVtbl; - - interface ISampleGrabberCB - { - CONST_VTBL struct ISampleGrabberCBVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISampleGrabberCB_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define ISampleGrabberCB_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define ISampleGrabberCB_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define ISampleGrabberCB_SampleCB(This,SampleTime,pSample) \ - ( (This)->lpVtbl -> SampleCB(This,SampleTime,pSample) ) - -#define ISampleGrabberCB_BufferCB(This,SampleTime,pBuffer,BufferLen) \ - ( (This)->lpVtbl -> BufferCB(This,SampleTime,pBuffer,BufferLen) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __ISampleGrabberCB_INTERFACE_DEFINED__ */ - - -#ifndef __ISampleGrabber_INTERFACE_DEFINED__ -#define __ISampleGrabber_INTERFACE_DEFINED__ - -/* interface ISampleGrabber */ -/* [unique][helpstring][local][uuid][object] */ - - -EXTERN_C const IID IID_ISampleGrabber; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("6B652FFF-11FE-4fce-92AD-0266B5D7C78F") - ISampleGrabber : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE SetOneShot( - BOOL OneShot) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetMediaType( - const AM_MEDIA_TYPE *pType) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetConnectedMediaType( - AM_MEDIA_TYPE *pType) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetBufferSamples( - BOOL BufferThem) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetCurrentBuffer( - /* [out][in] */ long *pBufferSize, - /* [out] */ long *pBuffer) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetCurrentSample( - /* [retval][out] */ IMediaSample **ppSample) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetCallback( - ISampleGrabberCB *pCallback, - long WhichMethodToCallback) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISampleGrabberVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ISampleGrabber * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ISampleGrabber * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ISampleGrabber * This); - - HRESULT ( STDMETHODCALLTYPE *SetOneShot )( - ISampleGrabber * This, - BOOL OneShot); - - HRESULT ( STDMETHODCALLTYPE *SetMediaType )( - ISampleGrabber * This, - const AM_MEDIA_TYPE *pType); - - HRESULT ( STDMETHODCALLTYPE *GetConnectedMediaType )( - ISampleGrabber * This, - AM_MEDIA_TYPE *pType); - - HRESULT ( STDMETHODCALLTYPE *SetBufferSamples )( - ISampleGrabber * This, - BOOL BufferThem); - - HRESULT ( STDMETHODCALLTYPE *GetCurrentBuffer )( - ISampleGrabber * This, - /* [out][in] */ long *pBufferSize, - /* [out] */ long *pBuffer); - - HRESULT ( STDMETHODCALLTYPE *GetCurrentSample )( - ISampleGrabber * This, - /* [retval][out] */ IMediaSample **ppSample); - - HRESULT ( STDMETHODCALLTYPE *SetCallback )( - ISampleGrabber * This, - ISampleGrabberCB *pCallback, - long WhichMethodToCallback); - - END_INTERFACE - } ISampleGrabberVtbl; - - interface ISampleGrabber - { - CONST_VTBL struct ISampleGrabberVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISampleGrabber_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define ISampleGrabber_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define ISampleGrabber_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define ISampleGrabber_SetOneShot(This,OneShot) \ - ( (This)->lpVtbl -> SetOneShot(This,OneShot) ) - -#define ISampleGrabber_SetMediaType(This,pType) \ - ( (This)->lpVtbl -> SetMediaType(This,pType) ) - -#define ISampleGrabber_GetConnectedMediaType(This,pType) \ - ( (This)->lpVtbl -> GetConnectedMediaType(This,pType) ) - -#define ISampleGrabber_SetBufferSamples(This,BufferThem) \ - ( (This)->lpVtbl -> SetBufferSamples(This,BufferThem) ) - -#define ISampleGrabber_GetCurrentBuffer(This,pBufferSize,pBuffer) \ - ( (This)->lpVtbl -> GetCurrentBuffer(This,pBufferSize,pBuffer) ) - -#define ISampleGrabber_GetCurrentSample(This,ppSample) \ - ( (This)->lpVtbl -> GetCurrentSample(This,ppSample) ) - -#define ISampleGrabber_SetCallback(This,pCallback,WhichMethodToCallback) \ - ( (This)->lpVtbl -> SetCallback(This,pCallback,WhichMethodToCallback) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __ISampleGrabber_INTERFACE_DEFINED__ */ - - - -#ifndef __DexterLib_LIBRARY_DEFINED__ -#define __DexterLib_LIBRARY_DEFINED__ - -/* library DexterLib */ -/* [helpstring][version][uuid] */ - - -EXTERN_C const IID LIBID_DexterLib; - -#ifndef __IResize_INTERFACE_DEFINED__ -#define __IResize_INTERFACE_DEFINED__ - -/* interface IResize */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IResize; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("4ada63a0-72d5-11d2-952a-0060081840bc") - IResize : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE get_Size( - /* [out] */ __RPC__out int *piHeight, - /* [out] */ __RPC__out int *piWidth, - /* [out] */ __RPC__out long *pFlag) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_InputSize( - /* [out] */ __RPC__out int *piHeight, - /* [out] */ __RPC__out int *piWidth) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_Size( - /* [in] */ int Height, - /* [in] */ int Width, - /* [in] */ long Flag) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_MediaType( - /* [out] */ __RPC__out AM_MEDIA_TYPE *pmt) = 0; - - virtual HRESULT STDMETHODCALLTYPE put_MediaType( - /* [in] */ __RPC__in const AM_MEDIA_TYPE *pmt) = 0; - - }; - -#else /* C style interface */ - - typedef struct IResizeVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IResize * This, - /* [in] */ __RPC__in REFIID riid, - /* [iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IResize * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IResize * This); - - HRESULT ( STDMETHODCALLTYPE *get_Size )( - IResize * This, - /* [out] */ __RPC__out int *piHeight, - /* [out] */ __RPC__out int *piWidth, - /* [out] */ __RPC__out long *pFlag); - - HRESULT ( STDMETHODCALLTYPE *get_InputSize )( - IResize * This, - /* [out] */ __RPC__out int *piHeight, - /* [out] */ __RPC__out int *piWidth); - - HRESULT ( STDMETHODCALLTYPE *put_Size )( - IResize * This, - /* [in] */ int Height, - /* [in] */ int Width, - /* [in] */ long Flag); - - HRESULT ( STDMETHODCALLTYPE *get_MediaType )( - IResize * This, - /* [out] */ __RPC__out AM_MEDIA_TYPE *pmt); - - HRESULT ( STDMETHODCALLTYPE *put_MediaType )( - IResize * This, - /* [in] */ __RPC__in const AM_MEDIA_TYPE *pmt); - - END_INTERFACE - } IResizeVtbl; - - interface IResize - { - CONST_VTBL struct IResizeVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IResize_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IResize_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IResize_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IResize_get_Size(This,piHeight,piWidth,pFlag) \ - ( (This)->lpVtbl -> get_Size(This,piHeight,piWidth,pFlag) ) - -#define IResize_get_InputSize(This,piHeight,piWidth) \ - ( (This)->lpVtbl -> get_InputSize(This,piHeight,piWidth) ) - -#define IResize_put_Size(This,Height,Width,Flag) \ - ( (This)->lpVtbl -> put_Size(This,Height,Width,Flag) ) - -#define IResize_get_MediaType(This,pmt) \ - ( (This)->lpVtbl -> get_MediaType(This,pmt) ) - -#define IResize_put_MediaType(This,pmt) \ - ( (This)->lpVtbl -> put_MediaType(This,pmt) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IResize_INTERFACE_DEFINED__ */ - - -EXTERN_C const CLSID CLSID_AMTimeline; - -#ifdef __cplusplus - -class DECLSPEC_UUID("78530B75-61F9-11D2-8CAD-00A024580902") -AMTimeline; -#endif - -EXTERN_C const CLSID CLSID_AMTimelineObj; - -#ifdef __cplusplus - -class DECLSPEC_UUID("78530B78-61F9-11D2-8CAD-00A024580902") -AMTimelineObj; -#endif - -EXTERN_C const CLSID CLSID_AMTimelineSrc; - -#ifdef __cplusplus - -class DECLSPEC_UUID("78530B7A-61F9-11D2-8CAD-00A024580902") -AMTimelineSrc; -#endif - -EXTERN_C const CLSID CLSID_AMTimelineTrack; - -#ifdef __cplusplus - -class DECLSPEC_UUID("8F6C3C50-897B-11d2-8CFB-00A0C9441E20") -AMTimelineTrack; -#endif - -EXTERN_C const CLSID CLSID_AMTimelineComp; - -#ifdef __cplusplus - -class DECLSPEC_UUID("74D2EC80-6233-11d2-8CAD-00A024580902") -AMTimelineComp; -#endif - -EXTERN_C const CLSID CLSID_AMTimelineGroup; - -#ifdef __cplusplus - -class DECLSPEC_UUID("F6D371E1-B8A6-11d2-8023-00C0DF10D434") -AMTimelineGroup; -#endif - -EXTERN_C const CLSID CLSID_AMTimelineTrans; - -#ifdef __cplusplus - -class DECLSPEC_UUID("74D2EC81-6233-11d2-8CAD-00A024580902") -AMTimelineTrans; -#endif - -EXTERN_C const CLSID CLSID_AMTimelineEffect; - -#ifdef __cplusplus - -class DECLSPEC_UUID("74D2EC82-6233-11d2-8CAD-00A024580902") -AMTimelineEffect; -#endif - -EXTERN_C const CLSID CLSID_RenderEngine; - -#ifdef __cplusplus - -class DECLSPEC_UUID("64D8A8E0-80A2-11d2-8CF3-00A0C9441E20") -RenderEngine; -#endif - -EXTERN_C const CLSID CLSID_SmartRenderEngine; - -#ifdef __cplusplus - -class DECLSPEC_UUID("498B0949-BBE9-4072-98BE-6CCAEB79DC6F") -SmartRenderEngine; -#endif - -EXTERN_C const CLSID CLSID_AudMixer; - -#ifdef __cplusplus - -class DECLSPEC_UUID("036A9790-C153-11d2-9EF7-006008039E37") -AudMixer; -#endif - -EXTERN_C const CLSID CLSID_Xml2Dex; - -#ifdef __cplusplus - -class DECLSPEC_UUID("18C628EE-962A-11D2-8D08-00A0C9441E20") -Xml2Dex; -#endif - -EXTERN_C const CLSID CLSID_MediaLocator; - -#ifdef __cplusplus - -class DECLSPEC_UUID("CC1101F2-79DC-11D2-8CE6-00A0C9441E20") -MediaLocator; -#endif - -EXTERN_C const CLSID CLSID_PropertySetter; - -#ifdef __cplusplus - -class DECLSPEC_UUID("ADF95821-DED7-11d2-ACBE-0080C75E246E") -PropertySetter; -#endif - -EXTERN_C const CLSID CLSID_MediaDet; - -#ifdef __cplusplus - -class DECLSPEC_UUID("65BD0711-24D2-4ff7-9324-ED2E5D3ABAFA") -MediaDet; -#endif - -EXTERN_C const CLSID CLSID_SampleGrabber; - -#ifdef __cplusplus - -class DECLSPEC_UUID("C1F400A0-3F08-11d3-9F0B-006008039E37") -SampleGrabber; -#endif - -EXTERN_C const CLSID CLSID_NullRenderer; - -#ifdef __cplusplus - -class DECLSPEC_UUID("C1F400A4-3F08-11d3-9F0B-006008039E37") -NullRenderer; -#endif - -EXTERN_C const CLSID CLSID_DxtCompositor; - -#ifdef __cplusplus - -class DECLSPEC_UUID("BB44391D-6ABD-422f-9E2E-385C9DFF51FC") -DxtCompositor; -#endif - -EXTERN_C const CLSID CLSID_DxtAlphaSetter; - -#ifdef __cplusplus - -class DECLSPEC_UUID("506D89AE-909A-44f7-9444-ABD575896E35") -DxtAlphaSetter; -#endif - -EXTERN_C const CLSID CLSID_DxtJpeg; - -#ifdef __cplusplus - -class DECLSPEC_UUID("DE75D012-7A65-11D2-8CEA-00A0C9441E20") -DxtJpeg; -#endif - -EXTERN_C const CLSID CLSID_ColorSource; - -#ifdef __cplusplus - -class DECLSPEC_UUID("0cfdd070-581a-11d2-9ee6-006008039e37") -ColorSource; -#endif - -EXTERN_C const CLSID CLSID_DxtKey; - -#ifdef __cplusplus - -class DECLSPEC_UUID("C5B19592-145E-11d3-9F04-006008039E37") -DxtKey; -#endif -#endif /* __DexterLib_LIBRARY_DEFINED__ */ - -/* interface __MIDL_itf_qedit_0001_0097 */ -/* [local] */ - - -enum __MIDL___MIDL_itf_qedit_0001_0097_0001 - { E_NOTINTREE = 0x80040400, - E_RENDER_ENGINE_IS_BROKEN = 0x80040401, - E_MUST_INIT_RENDERER = 0x80040402, - E_NOTDETERMINED = 0x80040403, - E_NO_TIMELINE = 0x80040404, - S_WARN_OUTPUTRESET = 40404 - } ; -#define DEX_IDS_BAD_SOURCE_NAME 1400 -#define DEX_IDS_BAD_SOURCE_NAME2 1401 -#define DEX_IDS_MISSING_SOURCE_NAME 1402 -#define DEX_IDS_UNKNOWN_SOURCE 1403 -#define DEX_IDS_INSTALL_PROBLEM 1404 -#define DEX_IDS_NO_SOURCE_NAMES 1405 -#define DEX_IDS_BAD_MEDIATYPE 1406 -#define DEX_IDS_STREAM_NUMBER 1407 -#define DEX_IDS_OUTOFMEMORY 1408 -#define DEX_IDS_DIBSEQ_NOTALLSAME 1409 -#define DEX_IDS_CLIPTOOSHORT 1410 -#define DEX_IDS_INVALID_DXT 1411 -#define DEX_IDS_INVALID_DEFAULT_DXT 1412 -#define DEX_IDS_NO_3D 1413 -#define DEX_IDS_BROKEN_DXT 1414 -#define DEX_IDS_NO_SUCH_PROPERTY 1415 -#define DEX_IDS_ILLEGAL_PROPERTY_VAL 1416 -#define DEX_IDS_INVALID_XML 1417 -#define DEX_IDS_CANT_FIND_FILTER 1418 -#define DEX_IDS_DISK_WRITE_ERROR 1419 -#define DEX_IDS_INVALID_AUDIO_FX 1420 -#define DEX_IDS_CANT_FIND_COMPRESSOR 1421 -#define DEX_IDS_TIMELINE_PARSE 1426 -#define DEX_IDS_GRAPH_ERROR 1427 -#define DEX_IDS_GRID_ERROR 1428 -#define DEX_IDS_INTERFACE_ERROR 1429 -EXTERN_GUID(CLSID_VideoEffects1Category, 0xcc7bfb42, 0xf175, 0x11d1, 0xa3, 0x92, 0x0, 0xe0, 0x29, 0x1f, 0x39, 0x59); -EXTERN_GUID(CLSID_VideoEffects2Category, 0xcc7bfb43, 0xf175, 0x11d1, 0xa3, 0x92, 0x0, 0xe0, 0x29, 0x1f, 0x39, 0x59); -EXTERN_GUID(CLSID_AudioEffects1Category, 0xcc7bfb44, 0xf175, 0x11d1, 0xa3, 0x92, 0x0, 0xe0, 0x29, 0x1f, 0x39, 0x59); -EXTERN_GUID(CLSID_AudioEffects2Category, 0xcc7bfb45, 0xf175, 0x11d1, 0xa3, 0x92, 0x0, 0xe0, 0x29, 0x1f, 0x39, 0x59); - - -extern RPC_IF_HANDLE __MIDL_itf_qedit_0001_0097_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_qedit_0001_0097_v0_0_s_ifspec; - -/* Additional Prototypes for ALL interfaces */ - -unsigned long __RPC_USER BSTR_UserSize( unsigned long *, unsigned long , BSTR * ); -unsigned char * __RPC_USER BSTR_UserMarshal( unsigned long *, unsigned char *, BSTR * ); -unsigned char * __RPC_USER BSTR_UserUnmarshal(unsigned long *, unsigned char *, BSTR * ); -void __RPC_USER BSTR_UserFree( unsigned long *, BSTR * ); - -unsigned long __RPC_USER VARIANT_UserSize( unsigned long *, unsigned long , VARIANT * ); -unsigned char * __RPC_USER VARIANT_UserMarshal( unsigned long *, unsigned char *, VARIANT * ); -unsigned char * __RPC_USER VARIANT_UserUnmarshal(unsigned long *, unsigned char *, VARIANT * ); -void __RPC_USER VARIANT_UserFree( unsigned long *, VARIANT * ); - -unsigned long __RPC_USER BSTR_UserSize64( unsigned long *, unsigned long , BSTR * ); -unsigned char * __RPC_USER BSTR_UserMarshal64( unsigned long *, unsigned char *, BSTR * ); -unsigned char * __RPC_USER BSTR_UserUnmarshal64(unsigned long *, unsigned char *, BSTR * ); -void __RPC_USER BSTR_UserFree64( unsigned long *, BSTR * ); - -unsigned long __RPC_USER VARIANT_UserSize64( unsigned long *, unsigned long , VARIANT * ); -unsigned char * __RPC_USER VARIANT_UserMarshal64( unsigned long *, unsigned char *, VARIANT * ); -unsigned char * __RPC_USER VARIANT_UserUnmarshal64(unsigned long *, unsigned char *, VARIANT * ); -void __RPC_USER VARIANT_UserFree64( unsigned long *, VARIANT * ); - -/* end of Additional Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif - - - diff --git a/include/realmedia/pnbastsd.h b/include/realmedia/pnbastsd.h deleted file mode 100644 index b4f02c23d..000000000 --- a/include/realmedia/pnbastsd.h +++ /dev/null @@ -1,163 +0,0 @@ -/**************************************************************************** - * - * $Id: pnbastsd.h 7 2003-05-30 02:18:02Z gabest $ - * - * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved. - * - * http://www.real.com/devzone - * - * This file is a replacement for the basetsd.h file from VC++ 6.0. - * This will automatically be included by pntypes.h when using VC++ - * 6.0 or greater. This file correctly defines the basic sized types - * so they don't conflict with the G2 SDK. - * - */ - -#if !(defined(_MSC_VER) && (_MSC_VER > 1100)) -#error pnbastsd.h is only intended for use with Microsoft VC++ 6.0 or higher -#endif - -#ifndef _BASETSD_H_ -#define _BASETSD_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * The following types were defined in pntypes.h and so are intentionally - * not included in this file. They are left here for documentation purposes. - */ -#if 0 -typedef int LONG32; -typedef int INT32; -typedef unsigned int ULONG32; -typedef unsigned int UINT32; -#endif - -/* - * The following types are 32 bits wide and unsigned. - */ -typedef unsigned int *PULONG32; -typedef unsigned int DWORD32, *PDWORD32; -typedef unsigned int *PUINT32; - -/* - * INT_PTR is the same size as a pointer. Its size changes with pointer - * size (32 bit or 64 bit). HALF_PTR is half the size of a pointer. - */ -#ifdef _WIN64 - -typedef __int64 INT_PTR, *PINT_PTR; -typedef unsigned __int64 UINT_PTR, *PUINT_PTR; - -#define MAXINT_PTR (0x7fffffffffffffffI64) -#define MININT_PTR (0x8000000000000000I64) -#define MAXUINT_PTR (0xffffffffffffffffUI64) - -typedef unsigned int UHALF_PTR, *PUHALF_PTR; -typedef int HALF_PTR, *PHALF_PTR; - -#define MAXUHALF_PTR (0xffffffffUL) -#define MAXHALF_PTR (0x7fffffffL) -#define MINHALF_PTR (0x80000000L) - -#pragma warning(disable:4311) /* type cast truncation */ - -#if !defined(__midl) -__inline -unsigned long -HandleToUlong( - void *h - ) -{ - return((unsigned long) h ); -} - -__inline -unsigned long -PtrToUlong( - void *p - ) -{ - return((unsigned long) p ); -} - -__inline -unsigned short -PtrToUshort( - void *p - ) -{ - return((unsigned short) p ); -} - -__inline -long -PtrToLong( - void *p - ) -{ - return((long) p ); -} - -__inline -short -PtrToShort( - void *p - ) -{ - return((short) p ); -} -#endif -#pragma warning(3:4311) /* type cast truncation */ - -#else - - -typedef long INT_PTR, *PINT_PTR; -typedef unsigned long UINT_PTR, *PUINT_PTR; - -#define MAXINT_PTR (0x7fffffffL) -#define MININT_PTR (0x80000000L) -#define MAXUINT_PTR (0xffffffffUL) - -typedef unsigned short UHALF_PTR, *PUHALF_PTR; -typedef short HALF_PTR, *PHALF_PTR; - -#define MAXUHALF_PTR 0xffff -#define MAXHALF_PTR 0x7fff -#define MINHALF_PTR 0x8000 - -#define HandleToUlong( h ) ((ULONG) (h) ) -#define PtrToUlong( p ) ((ULONG) (p) ) -#define PtrToLong( p ) ((LONG) (p) ) -#define PtrToUshort( p ) ((unsigned short) (p) ) -#define PtrToShort( p ) ((short) (p) ) - -#endif - -/* - * Basic SIZE_T support. - */ -typedef UINT_PTR SIZE_T, *PSIZE_T; -typedef INT_PTR SSIZE_T, *PSSIZE_T; - -/* - * These types are 64 bits wide and signed. - */ -typedef __int64 LONG64, *PLONG64; -typedef __int64 INT64, *PINT64; - -/* - * These types are 64 bits wide and unsigned. - */ -typedef unsigned __int64 ULONG64, *PULONG64; -typedef unsigned __int64 DWORD64, *PDWORD64; -typedef unsigned __int64 UINT64, *PUINT64; - -#ifdef __cplusplus -} -#endif - -#endif /* _BASETSD_H_ */ diff --git a/include/realmedia/pncom.h b/include/realmedia/pncom.h deleted file mode 100644 index 6e89ecc46..000000000 --- a/include/realmedia/pncom.h +++ /dev/null @@ -1,715 +0,0 @@ -/**************************************************************************** - * - * $Id: pncom.h 7 2003-05-30 02:18:02Z gabest $ - * - * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved. - * - * http://www.real.com/devzone - * - * This program contains proprietary - * information of Progressive Networks, Inc, and is licensed - * subject to restrictions on use and distribution. - * - * - * Component Object Model defines, and macros - * - * This file defines items required for COM interfaces in RealMedia and - * Progressive Networks SDKs. - * - * - */ - -#ifndef _PNCOM_H_ -#define _PNCOM_H_ - -#include "pntypes.h" /* Needed for most type definitions */ -#include "string.h" - -// have to use the double expansion to get the prescan level - -#define STATCONCAT1(w,x,y,z) STATCONCAT2(w,x,y,z) -#define STATCONCAT2(w,x,y,z) w##x##y##z - -#ifdef _STATICALLY_LINKED -#ifndef _PLUGINNAME -#define ENTRYPOINT(func) STATCONCAT1(entrypoint_error_symbol_should_not_be_needed,_PLUGINNAME,_,func) -#else /* _PLUGINNAME */ -#define ENTRYPOINT(func) STATCONCAT1(entrypoint_for_,_PLUGINNAME,_,func) -#endif -#else /* _STATICALLY_LINKED */ -#define ENTRYPOINT(func) func -#endif - -/* - * We include objbase.h when building for windows so that pncom.h can - * easily be used in any windows code. - */ -#ifdef _WIN32 -#include -#endif /* _WIN32 */ - -#include "pnresult.h" - -/* - * REF: - * Use this for reference parameters, so that C users can - * use the interface as well. - */ -#if defined(__cplusplus) -#define REF(type) type& -#else -#define REF(type) const type * const -#endif - -/* - * CONSTMETHOD: - * Use this for constant methods in an interface - * Compiles away under C - */ -#if !defined( CONSTMETHOD ) - -#if defined(__cplusplus) -#define CONSTMETHOD const -#else -#define CONSTMETHOD -#endif - -#endif -/* - * CALL: - * - * Used by C users to easily call a function through an interface - * - * EXAMPLE: - * - * pIFooObject->CALL(IFoo,DoSomething)(bar); - * - */ -#if !defined(__cplusplus) || defined(CINTERFACE) -#define CALL(iface, func) iface##Vtbl->func -#endif - - -#define _INTERFACE struct - -/* - * If useing windows.h or the windows implementation of COM - * these defines are not needed. - */ -#if !defined( _OBJBASE_H_ ) - -#ifdef _WIN16 -typedef unsigned int MMRESULT; -#define FAR _far -#else -#define FAR -#endif /* WIN16 */ -#define PASCAL _pascal -#define CDECL _cdecl - -/* - * EXTERN_C - */ -#ifndef EXTERN_C -#ifdef __cplusplus -#define EXTERN_C extern "C" -#else -#define EXTERN_C extern -#endif -#endif - -#ifdef OLDERRORCODES -#ifndef MAKE_HRESULT -#define MAKE_HRESULT(sev,fac,code) ((HRESULT) (((unsigned long)(sev)<<31) | ((unsigned long)(fac)<<16) | ((unsigned long)(code)))) -#endif /*MAKE_HRESULT*/ -#endif /* OLDERRORCODES */ - -/* - * STDMETHODCALLTYPE - */ -#ifndef STDMETHODCALLTYPE -#if defined(_WIN32) || defined(_MPPC_) -#ifdef _MPPC_ -#define STDMETHODCALLTYPE __cdecl -#else -#define STDMETHODCALLTYPE __stdcall -#endif -#elif defined(_WIN16) -#define STDMETHODCALLTYPE __export FAR CDECL -#else -#define STDMETHODCALLTYPE -#endif -#endif - -/* - * STDMETHODVCALLTYPE - */ -#ifndef STDMETHODVCALLTYPE -#if defined(_WINDOWS) || defined(_MPPC_) -#define STDMETHODVCALLTYPE __cdecl -#else -#define STDMETHODVCALLTYPE -#endif -#endif - -/* - * STDAPICALLTYPE - */ -#ifndef STDAPICALLTYPE -#if defined(_WIN32) || defined(_MPPC_) -#define STDAPICALLTYPE __stdcall -#elif defined(_WIN16) -#define STDAPICALLTYPE __export FAR PASCAL -#else -#define STDAPICALLTYPE -#endif -#endif - -/* - * STDAPIVCALLTYPE - */ -#ifndef STDAPIVCALLTYPE -#if defined(_WINDOWS) || defined(_MPPC_) -#define STDAPIVCALLTYPE __cdecl -#else -#define STDAPIVCALLTYPE -#endif -#endif - -/* - * Standard API defines: - * - * NOTE: the 'V' versions allow Variable Argument lists. - * - * STDAPI - * STDAPI_(type) - * STDAPIV - * STDAPIV_(type) - */ -#ifndef STDAPI -#define STDAPI EXTERN_C PN_RESULT STDAPICALLTYPE -#endif -#ifndef STDAPI_ -#define STDAPI_(type) EXTERN_C type STDAPICALLTYPE -#endif -#ifndef STDAPIV -#define STDAPIV EXTERN_C PN_RESULT STDAPIVCALLTYPE -#endif -#ifndef STDAPIV_ -#define STDAPIV_(type) EXTERN_C type STDAPIVCALLTYPE -#endif - - -/* - * Standard Interface Method defines: - * - * NOTE: the 'V' versions allow Variable Argument lists. - * - * STDMETHODIMP - * STDMETHODIMP_(type) - * STDMETHODIMPV - * STDMETHODIMPV_(type) - */ -#ifndef STDMETHODIMP -#define STDMETHODIMP PN_RESULT STDMETHODCALLTYPE -#endif -#ifndef STDMETHODIMP_ -#define STDMETHODIMP_(type) type STDMETHODCALLTYPE -#endif -#ifndef STDMETHODIMPV -#define STDMETHODIMPV PN_RESULT STDMETHODVCALLTYPE -#endif -#ifndef STDMETHODIMPV_ -#define STDMETHODIMPV_(type) type STDMETHODVCALLTYPE -#endif - - -/* - * - * Interface Declaration - * - * These are macros for declaring interfaces. They exist so that - * a single definition of the interface is simulataneously a proper - * declaration of the interface structures (C++ abstract classes) - * for both C and C++. - * - * DECLARE_INTERFACE(iface) is used to declare an interface that does - * not derive from a base interface. - * DECLARE_INTERFACE_(iface, baseiface) is used to declare an interface - * that does derive from a base interface. - * - * By default if the source file has a .c extension the C version of - * the interface declaratations will be expanded; if it has a .cpp - * extension the C++ version will be expanded. if you want to force - * the C version expansion even though the source file has a .cpp - * extension, then define the macro "CINTERFACE". - * eg. cl -DCINTERFACE file.cpp - * - * Example Interface declaration: - * - * #undef INTERFACE - * #define INTERFACE IClassFactory - * - * DECLARE_INTERFACE_(IClassFactory, IUnknown) - * { - * // *** IUnknown methods - * STDMETHOD(QueryInterface) (THIS_ - * REFIID riid, - * LPVOID FAR* ppvObj) PURE; - * STDMETHOD_(ULONG,AddRef) (THIS) PURE; - * STDMETHOD_(ULONG,Release) (THIS) PURE; - * - * // *** IClassFactory methods *** - * STDMETHOD(CreateInstance) (THIS_ - * LPUNKNOWN pUnkOuter, - * REFIID riid, - * LPVOID FAR* ppvObject) PURE; - * }; - * - * Example C++ expansion: - * - * struct FAR IClassFactory : public IUnknown - * { - * virtual PN_RESULT STDMETHODCALLTYPE QueryInterface( - * IID FAR& riid, - * LPVOID FAR* ppvObj) = 0; - * virtual PN_RESULT STDMETHODCALLTYPE AddRef(void) = 0; - * virtual PN_RESULT STDMETHODCALLTYPE Release(void) = 0; - * virtual PN_RESULT STDMETHODCALLTYPE CreateInstance( - * LPUNKNOWN pUnkOuter, - * IID FAR& riid, - * LPVOID FAR* ppvObject) = 0; - * }; - * - * NOTE: Our documentation says '#define interface class' but we use - * 'struct' instead of 'class' to keep a lot of 'public:' lines - * out of the interfaces. The 'FAR' forces the 'this' pointers to - * be far, which is what we need. - * - * Example C expansion: - * - * typedef struct IClassFactory - * { - * const struct IClassFactoryVtbl FAR* lpVtbl; - * } IClassFactory; - * - * typedef struct IClassFactoryVtbl IClassFactoryVtbl; - * - * struct IClassFactoryVtbl - * { - * PN_RESULT (STDMETHODCALLTYPE * QueryInterface) ( - * IClassFactory FAR* This, - * IID FAR* riid, - * LPVOID FAR* ppvObj) ; - * PN_RESULT (STDMETHODCALLTYPE * AddRef) (IClassFactory FAR* This) ; - * PN_RESULT (STDMETHODCALLTYPE * Release) (IClassFactory FAR* This) ; - * PN_RESULT (STDMETHODCALLTYPE * CreateInstance) ( - * IClassFactory FAR* This, - * LPUNKNOWN pUnkOuter, - * IID FAR* riid, - * LPVOID FAR* ppvObject); - * PN_RESULT (STDMETHODCALLTYPE * LockServer) ( - * IClassFactory FAR* This, - * BOOL fLock); - * }; - * - */ - -#if defined(__cplusplus) && !defined(CINTERFACE) -#define _INTERFACE struct -#define STDMETHOD(method) virtual PN_RESULT STDMETHODCALLTYPE method -#define STDMETHOD_(type,method) virtual type STDMETHODCALLTYPE method -#define PURE = 0 -#define THIS_ -#define THIS void - -#if defined(_WINDOWS) && defined(EXPORT_CLASSES) -#define DECLARE_INTERFACE(iface) _INTERFACE PNEXPORT_CLASS iface -#define DECLARE_INTERFACE_(iface, baseiface) _INTERFACE PNEXPORT_CLASS iface : public baseiface -#else -#define DECLARE_INTERFACE(iface) _INTERFACE iface -#define DECLARE_INTERFACE_(iface, baseiface) _INTERFACE iface : public baseiface -#endif // defined(_WINDOWS) && defined(EXPORT_CLASSES) - -#if !defined(BEGIN_INTERFACE) -#if defined(_MPPC_) && \ - ( (defined(_MSC_VER) || defined(__SC__) || defined(__MWERKS__)) && \ - !defined(NO_NULL_VTABLE_ENTRY) ) - #define BEGIN_INTERFACE virtual void a() {} - #define END_INTERFACE -#else - #define BEGIN_INTERFACE - #define END_INTERFACE -#endif -#endif - - -#else - -#define _INTERFACE struct - -#define STDMETHOD(method) PN_RESULT (STDMETHODCALLTYPE * method) -#define STDMETHOD_(type,method) type (STDMETHODCALLTYPE * method) - -#if !defined(BEGIN_INTERFACE) -#if defined(_MPPC_) - #define BEGIN_INTERFACE void *b; - #define END_INTERFACE -#else - #define BEGIN_INTERFACE - #define END_INTERFACE -#endif -#endif - - -#define PURE -#define THIS_ INTERFACE FAR* This, -#define THIS INTERFACE FAR* This -#ifdef CONST_VTABLE -#undef CONST_VTBL -#define CONST_VTBL const -#define DECLARE_INTERFACE(iface) typedef _INTERFACE iface { \ - const struct iface##Vtbl FAR* lpVtbl; \ - } iface; \ - typedef const struct iface##Vtbl iface##Vtbl; \ - const struct iface##Vtbl -#else -#undef CONST_VTBL -#define CONST_VTBL -#define DECLARE_INTERFACE(iface) typedef _INTERFACE iface { \ - struct iface##Vtbl FAR* lpVtbl; \ - } iface; \ - typedef struct iface##Vtbl iface##Vtbl; \ - struct iface##Vtbl -#endif -#define DECLARE_INTERFACE_(iface, baseiface) DECLARE_INTERFACE(iface) - -#endif - -/* - * COMMON TYPES - */ - -#ifndef GUID_DEFINED -#define GUID_DEFINED -typedef struct _GUID - { - ULONG32 Data1; - UINT16 Data2; - UINT16 Data3; - UCHAR Data4[ 8 ]; - } GUID; - -#endif - -#if !defined( __IID_DEFINED__ ) -#define __IID_DEFINED__ -typedef GUID IID; -#define IID_NULL GUID_NULL -typedef GUID CLSID; -#define CLSID_NULL GUID_NULL - -#if defined(__cplusplus) -#ifndef _REFGUID_DEFINED -#define _REFGUID_DEFINED -#define REFGUID const GUID & -#endif - -#ifndef _REFIID_DEFINED -#define _REFIID_DEFINED -#define REFIID const IID & -#endif - -#ifndef _REFCLSID_DEFINED -#define _REFCLSID_DEFINED -#define REFCLSID const CLSID & -#endif - -#else -#ifndef _REFGUID_DEFINED -#define _REFGUID_DEFINED -#define REFGUID const GUID * const -#endif -#ifndef _REFIID_DEFINED -#define _REFIID_DEFINED -#define REFIID const IID * const -#endif -#ifndef _REFCLSID_DEFINED -#define _REFCLSID_DEFINED -#define REFCLSID const CLSID * const -#endif -#endif -#endif - - -/* - * - * macros to define byte pattern for a GUID. - * Example: DEFINE_GUID(GUID_XXX, a, b, c, ...); - * - * Each dll/exe must initialize the GUIDs once. This is done in one of - * two ways. If you are not using precompiled headers for the file(s) which - * initializes the GUIDs, define INITGUID before including objbase.h. This - * is how OLE builds the initialized versions of the GUIDs which are included - * in ole2.lib. The GUIDs in ole2.lib are all defined in the same text - * segment GUID_TEXT. - * - * The alternative (which some versions of the compiler don't handle properly; - * they wind up with the initialized GUIDs in a data, not a text segment), - * is to use a precompiled version of objbase.h and then include initguid.h - * after objbase.h followed by one or more of the guid defintion files. - * - */ - -#if !defined (INITGUID) || (defined (_STATICALLY_LINKED) && !defined(NCIHACK)) -#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ - EXTERN_C const GUID FAR name -#else - -#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ - EXTERN_C const GUID name \ - = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } -#endif - -#ifndef _VXWORKS -#include /* for memcmp */ -#endif - -#ifdef __cplusplus -inline BOOL IsEqualGUID(REFGUID rguid1, REFGUID rguid2) -{ - return !memcmp(&rguid1, &rguid2, sizeof(GUID)); -} - -inline void SetGUID(GUID& rguid1, REFGUID rguid2) -{ - memcpy(&rguid1, &rguid2, sizeof(GUID)); -} -#else -#define IsEqualGUID(rguid1, rguid2) (!memcmp(rguid1, rguid2, sizeof(GUID))) -#define SetGUID(rguid1, rguid2) (memcpy(rguid1, rguid2, sizeof(GUID))) -#endif - -#define IsEqualIID(riid1, riid2) IsEqualGUID(riid1, riid2) -#define IsEqualCLSID(rclsid1, rclsid2) IsEqualGUID(rclsid1, rclsid2) - -#define SetIID(riid1, riid2) SetGUID(riid1, riid2) -#define SetCLSID(rclsid1, rclsid2) SetGUID(rclsid1, rclsid2) - -#ifdef __cplusplus - -/* - * Because GUID is defined elsewhere in WIN32 land, the operator == and != - * are moved outside the class to global scope. - */ - -inline BOOL operator==(const GUID& guidOne, const GUID& guidOther) -{ - return !memcmp(&guidOne,&guidOther,sizeof(GUID)); -} - -inline BOOL operator!=(const GUID& guidOne, const GUID& guidOther) -{ - return !(guidOne == guidOther); -} - -#endif - - -/**************************************************************************** - * - * Interface: - * - * IUnknown - * - * Purpose: - * - * Base class of all interfaces. Defines life time management and - * support for dynamic cast. - * - * IID_IUnknown: - * - * {00000000-0000-0000-C000000000000046} - * - */ -DEFINE_GUID(IID_IUnknown, 0x00000000, 0x0000, 0x0000, 0xC0, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x46); - -#undef INTERFACE -#define INTERFACE IUnknown - -DECLARE_INTERFACE(IUnknown) -{ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IMalloc - * - * Purpose: - * - * Basic memory management interface. - * - * IID_IMalloc: - * - * {00000002-0000-0000-C000000000000046} - * - */ -DEFINE_GUID(IID_IMalloc, 00000002, 0x0000, 0x0000, 0xC0, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x46); - -#undef INTERFACE -#define INTERFACE IMalloc - -DECLARE_INTERFACE_(IMalloc, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IMalloc methods - */ - STDMETHOD_(void*,Alloc) (THIS_ - UINT32 /*IN*/ count) PURE; - - STDMETHOD_(void*,Realloc) (THIS_ - void* /*IN*/ pMem, - UINT32 /*IN*/ count) PURE; - - STDMETHOD_(void,Free) (THIS_ - void* /*IN*/ pMem) PURE; - - STDMETHOD_(UINT32,GetSize) (THIS_ - void* /*IN*/ pMem) PURE; - - STDMETHOD_(BOOL,DidAlloc) (THIS_ - void* /*IN*/ pMem) PURE; - - STDMETHOD_(void,HeapMinimize) (THIS) PURE; -}; - -/* - * - * Synchronization: NOTE: These should be made thread safe or use built - * in synchronization support in an OS that supports it. - * - */ -#define InterlockedIncrement(plong) (++(*(plong))) -#define InterlockedDecrement(plong) (--(*(plong))) - -#else /* else case of !defined( _OBJBASE_H_ ) && !defined( _COMPOBJ_H_ ) */ - - -/* Even in windows we want these GUID's defined... */ - -#if !(defined(INITGUID) && defined(USE_IUNKNOWN_AND_IMALLOC_FROM_UUID_LIB)) -DEFINE_GUID(IID_IUnknown, 0x00000000, 0x0000, 0x0000, 0xC0, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x46); - -DEFINE_GUID(IID_IMalloc, 00000002, 0x0000, 0x0000, 0xC0, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x46); -#endif - -#include /* for memcmp */ - -#ifdef __cplusplus -inline void SetGUID(REFGUID rguid1, REFGUID rguid2) -{ - memcpy((void*)&rguid1, (void*)&rguid2, sizeof(GUID)); -} -#else -#define SetGUID(rguid1, rguid2) (memcpy((void*)rguid1, (void*)rguid2, sizeof(GUID))) -#endif -#define SetIID(riid1, riid2) SetGUID(riid1, riid2) -#define SetCLSID(rclsid1, rclsid2) SetGUID(rclsid1, rclsid2) - -#endif /* !defined( _OBJBASE_H_ ) && !defined( _COMPOBJ_H_ )*/ - -#ifdef IsEqualIID -#undef IsEqualIID -#endif - -#ifdef IsEqualCLSID -#undef IsEqualCLSID -#endif - -#define IsEqualIID(riid1, riid2) RNIsEqualGUID(riid1, riid2) -#define IsEqualCLSID(rclsid1, rclsid2) RNIsEqualGUID(rclsid1, rclsid2) - -#ifdef __cplusplus -inline BOOL RNIsEqualGUID(REFGUID rguid1, REFGUID rguid2) -{ - return (((UINT32*) &rguid1)[0] == ((UINT32*) &rguid2)[0] && - ((UINT32*) &rguid1)[1] == ((UINT32*) &rguid2)[1] && - ((UINT32*) &rguid1)[2] == ((UINT32*) &rguid2)[2] && - ((UINT32*) &rguid1)[3] == ((UINT32*) &rguid2)[3]); -} -#else -#define RNIsEqualGUID(rguid1, rguid2) \ - (((UINT32*) &rguid1)[0] == ((UINT32*) &rguid2)[0] && \ - ((UINT32*) &rguid1)[1] == ((UINT32*) &rguid2)[1] && \ - ((UINT32*) &rguid1)[2] == ((UINT32*) &rguid2)[2] && \ - ((UINT32*) &rguid1)[3] == ((UINT32*) &rguid2)[3]); -#endif - -/**************************************************************************** - * - * Putting the following macro in the definition of your class will overload - * new and delete for that object. New will then take an IMalloc* from - * which to allocate memory from and store it in the begining of the - * memory which it will return. Delete will grab this IMalloc* from - * the beginning of the mem and use this pointer to deallocate the mem. - * - * Example useage: - * class A - * { - * public: - * A(int); - * ~A(); - * - * IMALLOC_MEM - * }; - * - * IMalloc* pMalloc; - * m_pContext->QueryInterface(IID_IMalloc, (void**)&pMalloc); - * A* p = new(pMalloc) A(0); - * pMalloc->Release(); - * delete p; - */ - -#define IMALLOC_MEM\ - void* operator new(size_t size, IMalloc* pMalloc)\ - {\ - void* pMem = pMalloc->Alloc(size + sizeof(IMalloc*));\ - *(IMalloc**)pMem = pMalloc;\ - pMalloc->AddRef();\ - return ((unsigned char*)pMem + sizeof(IMalloc*));\ - }\ -\ - void operator delete(void* pMem)\ - {\ - pMem = (unsigned char*)pMem - sizeof(IMalloc*);\ - IMalloc* pMalloc = *(IMalloc**)pMem;\ - pMalloc->Free(pMem);\ - pMalloc->Release();\ - }\ - -#endif /* _PNCOM_H_ */ diff --git a/include/realmedia/pnresult.h b/include/realmedia/pnresult.h deleted file mode 100644 index d845cecff..000000000 --- a/include/realmedia/pnresult.h +++ /dev/null @@ -1,362 +0,0 @@ -/**************************************************************************** - * - * $Id: pnresult.h 7 2003-05-30 02:18:02Z gabest $ - * - * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved. - * - * http://www.real.com/devzone - * - * This program contains proprietary - * information of Progressive Networks, Inc, and is licensed - * subject to restrictions on use and distribution. - * - * This file contains the PN_RESULT type and it's associated result codes - */ - -#ifndef _PNRESULT_H_ -#define _PNRESULT_H_ - -/* Some files include this before pntypes.h. */ -#include "pntypes.h" - -typedef LONG32 PN_RESULT; - -#ifndef _WIN32 - typedef PN_RESULT HRESULT; -# define NOERROR 0 -# define FACILITY_ITF 4 -# define MAKE_HRESULT(sev,fac,code) \ - ((HRESULT) (((unsigned long)(sev)<<31) | ((unsigned long)(fac)<<16) | \ - ((unsigned long)(code))) ) -# define SUCCEEDED(Status) (((unsigned long)(Status)>>31) == 0) -# define FAILED(Status) (((unsigned long)(Status)>>31) != 0) -#else -# ifndef _HRESULT_DEFINED - typedef LONG32 HRESULT; -# endif /* _HRESULT_DEFINED */ -# include -#endif /* _WIN32 */ - -#define MAKE_PN_RESULT(sev,fac,code) MAKE_HRESULT(sev, FACILITY_ITF, \ - ((fac << 6) | (code))) - -#define SS_GLO 0 /* General errors */ -#define SS_NET 1 /* Networking errors */ -#define SS_FIL 2 /* File errors */ -#define SS_PRT 3 /* Protocol Error */ -#define SS_AUD 4 /* Audio error */ -#define SS_INT 5 /* General internal errors */ -#define SS_USR 6 /* The user is broken. */ -#define SS_MSC 7 /* Miscellaneous */ -#define SS_DEC 8 /* Decoder errors */ -#define SS_ENC 9 /* Encoder errors */ -#define SS_REG 10 /* Registry (not Windows registry ;) errors */ -#define SS_PPV 11 /* Pay Per View errors */ -#define SS_RSC 12 /* Errors for PNXRES */ -#define SS_UPG 13 /* Auto-upgrade & Certificate Errors */ -#define SS_PLY 14 /* RealPlayer/Plus specific errors (USE ONLY IN /rpmisc/pub/rpresult.h) */ -#define SS_RMT 15 /* RMTools Errors */ -#define SS_CFG 16 /* AutoConfig Errors */ -#define SS_RPX 17 /* RealPix-related Errors */ -#define SS_XML 18 /* XML-related Errors */ - -#define SS_DPR 63 /* Deprecated errors */ - -#define PNR_NOTIMPL MAKE_HRESULT(1,0,0x4001) -#define PNR_OUTOFMEMORY MAKE_HRESULT(1,7,0x000e) -#define PNR_INVALID_PARAMETER MAKE_HRESULT(1,7,0x0057) -#define PNR_NOINTERFACE MAKE_HRESULT(1,0,0x4002) -#define PNR_POINTER MAKE_HRESULT(1,0,0x4003) -#define PNR_HANDLE MAKE_HRESULT(1,7,0x0006) -#define PNR_ABORT MAKE_HRESULT(1,0,0x4004) -#define PNR_FAIL MAKE_HRESULT(1,0,0x4005) -#define PNR_ACCESSDENIED MAKE_HRESULT(1,7,0x0005) -#define PNR_IGNORE MAKE_HRESULT(1,0,0x0006) -#define PNR_OK MAKE_HRESULT(0,0,0) - - -#define PNR_INVALID_OPERATION MAKE_PN_RESULT(1,SS_GLO,4) -#define PNR_INVALID_VERSION MAKE_PN_RESULT(1,SS_GLO,5) -#define PNR_INVALID_REVISION MAKE_PN_RESULT(1,SS_GLO,6) -#define PNR_NOT_INITIALIZED MAKE_PN_RESULT(1,SS_GLO,7) -#define PNR_DOC_MISSING MAKE_PN_RESULT(1,SS_GLO,8) -#define PNR_UNEXPECTED MAKE_PN_RESULT(1,SS_GLO,9) -#define PNR_INCOMPLETE MAKE_PN_RESULT(1,SS_GLO,12) -#define PNR_BUFFERTOOSMALL MAKE_PN_RESULT(1,SS_GLO,13) -#define PNR_UNSUPPORTED_VIDEO MAKE_PN_RESULT(1,SS_GLO,14) -#define PNR_UNSUPPORTED_AUDIO MAKE_PN_RESULT(1,SS_GLO,15) -#define PNR_INVALID_BANDWIDTH MAKE_PN_RESULT(1,SS_GLO,16) -/* PNR_NO_RENDERER and PNR_NO_FILEFORMAT old value is being deprecated -#define PNR_NO_FILEFORMAT MAKE_PN_RESULT(1,SS_GLO,10) -#define PNR_NO_RENDERER MAKE_PN_RESULT(1,SS_GLO,11)*/ -#define PNR_NO_RENDERER MAKE_PN_RESULT(1,SS_GLO,17) -#define PNR_NO_FILEFORMAT MAKE_PN_RESULT(1,SS_GLO,17) -#define PNR_MISSING_COMPONENTS MAKE_PN_RESULT(1,SS_GLO,17) -#define PNR_ELEMENT_NOT_FOUND MAKE_PN_RESULT(0,SS_GLO,18) -#define PNR_NOCLASS MAKE_PN_RESULT(0,SS_GLO,19) -#define PNR_CLASS_NOAGGREGATION MAKE_PN_RESULT(0,SS_GLO,20) -#define PNR_NOT_LICENSED MAKE_PN_RESULT(1,SS_GLO,21) -#define PNR_NO_FILESYSTEM MAKE_PN_RESULT(1,SS_GLO,22) -#define PNR_REQUEST_UPGRADE MAKE_PN_RESULT(1,SS_GLO,23) -#define PNR_AWAITING_LICENSE MAKE_PN_RESULT(1,SS_GLO,24) - -#define PNR_BUFFERING MAKE_PN_RESULT(0,SS_NET,0) -#define PNR_PAUSED MAKE_PN_RESULT(0,SS_NET,1) -#define PNR_NO_DATA MAKE_PN_RESULT(0,SS_NET,2) -#define PNR_STREAM_DONE MAKE_PN_RESULT(0,SS_NET,3) -#define PNR_NET_SOCKET_INVALID MAKE_PN_RESULT(1,SS_NET,3) -#define PNR_NET_CONNECT MAKE_PN_RESULT(1,SS_NET,4) -#define PNR_BIND MAKE_PN_RESULT(1,SS_NET,5) -#define PNR_SOCKET_CREATE MAKE_PN_RESULT(1,SS_NET,6) -#define PNR_INVALID_HOST MAKE_PN_RESULT(1,SS_NET,7) -#define PNR_NET_READ MAKE_PN_RESULT(1,SS_NET,8) -#define PNR_NET_WRITE MAKE_PN_RESULT(1,SS_NET,9) -#define PNR_NET_UDP MAKE_PN_RESULT(1,SS_NET,10) -#define PNR_RETRY MAKE_PN_RESULT(1,SS_NET,11) /* XXX */ -#define PNR_SERVER_TIMEOUT MAKE_PN_RESULT(1,SS_NET,12) -#define PNR_SERVER_DISCONNECTED MAKE_PN_RESULT(1,SS_NET,13) -#define PNR_WOULD_BLOCK MAKE_PN_RESULT(1,SS_NET,14) -#define PNR_GENERAL_NONET MAKE_PN_RESULT(1,SS_NET,15) -#define PNR_BLOCK_CANCELED MAKE_PN_RESULT(1,SS_NET,16) /* XXX */ -#define PNR_MULTICAST_JOIN MAKE_PN_RESULT(1,SS_NET,17) -#define PNR_GENERAL_MULTICAST MAKE_PN_RESULT(1,SS_NET,18) -#define PNR_MULTICAST_UDP MAKE_PN_RESULT(1,SS_NET,19) -#define PNR_AT_INTERRUPT MAKE_PN_RESULT(1,SS_NET,20) -#define PNR_MSG_TOOLARGE MAKE_PN_RESULT(1,SS_NET,21) -#define PNR_NET_TCP MAKE_PN_RESULT(1,SS_NET,22) -#define PNR_TRY_AUTOCONFIG MAKE_PN_RESULT(1,SS_NET,23) -#define PNR_NOTENOUGH_BANDWIDTH MAKE_PN_RESULT(1,SS_NET,24) -#define PNR_HTTP_CONNECT MAKE_PN_RESULT(1,SS_NET,25) -#define PNR_PORT_IN_USE MAKE_PN_RESULT(1,SS_NET,26) -#define PNR_LOADTEST_NOT_SUPPORTED MAKE_PN_RESULT(1,SS_NET,27) - -#define PNR_AT_END MAKE_PN_RESULT(0,SS_FIL,0) -#define PNR_INVALID_FILE MAKE_PN_RESULT(1,SS_FIL,1) -#define PNR_INVALID_PATH MAKE_PN_RESULT(1,SS_FIL,2) -#define PNR_RECORD MAKE_PN_RESULT(1,SS_FIL,3) -#define PNR_RECORD_WRITE MAKE_PN_RESULT(1,SS_FIL,4) -#define PNR_TEMP_FILE MAKE_PN_RESULT(1,SS_FIL,5) -#define PNR_ALREADY_OPEN MAKE_PN_RESULT(1,SS_FIL,6) -#define PNR_SEEK_PENDING MAKE_PN_RESULT(1,SS_FIL,7) -#define PNR_CANCELLED MAKE_PN_RESULT(1,SS_FIL,8) -#define PNR_FILE_NOT_FOUND MAKE_PN_RESULT(1,SS_FIL,9) -#define PNR_WRITE_ERROR MAKE_PN_RESULT(1,SS_FIL,10) -#define PNR_FILE_EXISTS MAKE_PN_RESULT(1,SS_FIL,11) -#define PNR_FILE_NOT_OPEN MAKE_PN_RESULT(1,SS_FIL,12) -#define PNR_ADVISE_PREFER_LINEAR MAKE_PN_RESULT(0,SS_FIL,13) -#define PNR_PARSE_ERROR MAKE_PN_RESULT(1,SS_FIL,14) - -#define PNR_BAD_SERVER MAKE_PN_RESULT(1,SS_PRT,0) -#define PNR_ADVANCED_SERVER MAKE_PN_RESULT(1,SS_PRT,1) -#define PNR_OLD_SERVER MAKE_PN_RESULT(1,SS_PRT,2) -#define PNR_REDIRECTION MAKE_PN_RESULT(0,SS_PRT,3) /* XXX */ -#define PNR_SERVER_ALERT MAKE_PN_RESULT(1,SS_PRT,4) -#define PNR_PROXY MAKE_PN_RESULT(1,SS_PRT,5) -#define PNR_PROXY_RESPONSE MAKE_PN_RESULT(1,SS_PRT,6) -#define PNR_ADVANCED_PROXY MAKE_PN_RESULT(1,SS_PRT,7) -#define PNR_OLD_PROXY MAKE_PN_RESULT(1,SS_PRT,8) -#define PNR_INVALID_PROTOCOL MAKE_PN_RESULT(1,SS_PRT,9) -#define PNR_INVALID_URL_OPTION MAKE_PN_RESULT(1,SS_PRT,10) -#define PNR_INVALID_URL_HOST MAKE_PN_RESULT(1,SS_PRT,11) -#define PNR_INVALID_URL_PATH MAKE_PN_RESULT(1,SS_PRT,12) -#define PNR_HTTP_CONTENT_NOT_FOUND MAKE_PN_RESULT(1,SS_PRT,13) -#define PNR_NOT_AUTHORIZED MAKE_PN_RESULT(1,SS_PRT,14) -#define PNR_UNEXPECTED_MSG MAKE_PN_RESULT(1,SS_PRT,15) -#define PNR_BAD_TRANSPORT MAKE_PN_RESULT(1,SS_PRT,16) -#define PNR_NO_SESSION_ID MAKE_PN_RESULT(1,SS_PRT,17) -#define PNR_PROXY_DNR MAKE_PN_RESULT(1,SS_PRT,18) -#define PNR_PROXY_NET_CONNECT MAKE_PN_RESULT(1,SS_PRT,19) - -#define PNR_AUDIO_DRIVER MAKE_PN_RESULT(1,SS_AUD,0) -#define PNR_LATE_PACKET MAKE_PN_RESULT(1,SS_AUD,1) -#define PNR_OVERLAPPED_PACKET MAKE_PN_RESULT(1,SS_AUD,2) -#define PNR_OUTOFORDER_PACKET MAKE_PN_RESULT(1,SS_AUD,3) -#define PNR_NONCONTIGUOUS_PACKET MAKE_PN_RESULT(1,SS_AUD,4) - -#define PNR_OPEN_NOT_PROCESSED MAKE_PN_RESULT(1,SS_INT,0) - -#define PNR_EXPIRED MAKE_PN_RESULT(1,SS_USR,0) - -#define PNR_INVALID_INTERLEAVER MAKE_PN_RESULT(1,SS_DPR,0) -#define PNR_BAD_FORMAT MAKE_PN_RESULT(1,SS_DPR,1) -#define PNR_CHUNK_MISSING MAKE_PN_RESULT(1,SS_DPR,2) -#define PNR_INVALID_STREAM MAKE_PN_RESULT(1,SS_DPR,3) -#define PNR_DNR MAKE_PN_RESULT(1,SS_DPR,4) -#define PNR_OPEN_DRIVER MAKE_PN_RESULT(1,SS_DPR,5) -#define PNR_UPGRADE MAKE_PN_RESULT(1,SS_DPR,6) -#define PNR_NOTIFICATION MAKE_PN_RESULT(1,SS_DPR,7) -#define PNR_NOT_NOTIFIED MAKE_PN_RESULT(1,SS_DPR,8) -#define PNR_STOPPED MAKE_PN_RESULT(1,SS_DPR,9) -#define PNR_CLOSED MAKE_PN_RESULT(1,SS_DPR,10) -#define PNR_INVALID_WAV_FILE MAKE_PN_RESULT(1,SS_DPR,11) -#define PNR_NO_SEEK MAKE_PN_RESULT(1,SS_DPR,12) - -#define PNR_DEC_INITED MAKE_PN_RESULT(1,SS_DEC,0) -#define PNR_DEC_NOT_FOUND MAKE_PN_RESULT(1,SS_DEC,1) -#define PNR_DEC_INVALID MAKE_PN_RESULT(1,SS_DEC,2) -#define PNR_DEC_TYPE_MISMATCH MAKE_PN_RESULT(1,SS_DEC,3) -#define PNR_DEC_INIT_FAILED MAKE_PN_RESULT(1,SS_DEC,4) -#define PNR_DEC_NOT_INITED MAKE_PN_RESULT(1,SS_DEC,5) -#define PNR_DEC_DECOMPRESS MAKE_PN_RESULT(1,SS_DEC,6) -#define PNR_OBSOLETE_VERSION MAKE_PN_RESULT(1,SS_DEC,7) - -#define PNR_ENC_FILE_TOO_SMALL MAKE_PN_RESULT(1,SS_ENC,0) -#define PNR_ENC_UNKNOWN_FILE MAKE_PN_RESULT(1,SS_ENC,1) -#define PNR_ENC_BAD_CHANNELS MAKE_PN_RESULT(1,SS_ENC,2) -#define PNR_ENC_BAD_SAMPSIZE MAKE_PN_RESULT(1,SS_ENC,3) -#define PNR_ENC_BAD_SAMPRATE MAKE_PN_RESULT(1,SS_ENC,4) -#define PNR_ENC_INVALID MAKE_PN_RESULT(1,SS_ENC,5) -#define PNR_ENC_NO_OUTPUT_FILE MAKE_PN_RESULT(1,SS_ENC,6) -#define PNR_ENC_NO_INPUT_FILE MAKE_PN_RESULT(1,SS_ENC,7) -#define PNR_ENC_NO_OUTPUT_PERMISSIONS MAKE_PN_RESULT(1,SS_ENC,8) -#define PNR_ENC_BAD_FILETYPE MAKE_PN_RESULT(1,SS_ENC,9) -#define PNR_ENC_INVALID_VIDEO MAKE_PN_RESULT(1,SS_ENC,10) -#define PNR_ENC_INVALID_AUDIO MAKE_PN_RESULT(1,SS_ENC,11) -#define PNR_ENC_NO_VIDEO_CAPTURE MAKE_PN_RESULT(1,SS_ENC,12) -#define PNR_ENC_INVALID_VIDEO_CAPTURE MAKE_PN_RESULT(1,SS_ENC,13) -#define PNR_ENC_NO_AUDIO_CAPTURE MAKE_PN_RESULT(1,SS_ENC,14) -#define PNR_ENC_INVALID_AUDIO_CAPTURE MAKE_PN_RESULT(1,SS_ENC,15) -#define PNR_ENC_TOO_SLOW_FOR_LIVE MAKE_PN_RESULT(1,SS_ENC,16) -#define PNR_ENC_ENGINE_NOT_INITIALIZED MAKE_PN_RESULT(1,SS_ENC,17) -#define PNR_ENC_CODEC_NOT_FOUND MAKE_PN_RESULT(1,SS_ENC,18) -#define PNR_ENC_CODEC_NOT_INITIALIZED MAKE_PN_RESULT(1,SS_ENC,19) -#define PNR_ENC_INVALID_INPUT_DIMENSIONS MAKE_PN_RESULT(1,SS_ENC,20) -#define PNR_ENC_MESSAGE_IGNORED MAKE_PN_RESULT(1,SS_ENC,21) -#define PNR_ENC_NO_SETTINGS MAKE_PN_RESULT(1,SS_ENC,22) -#define PNR_ENC_NO_OUTPUT_TYPES MAKE_PN_RESULT(1,SS_ENC,23) -#define PNR_ENC_IMPROPER_STATE MAKE_PN_RESULT(1,SS_ENC,24) -#define PNR_ENC_INVALID_SERVER MAKE_PN_RESULT(1,SS_ENC,25) -#define PNR_ENC_INVALID_TEMP_PATH MAKE_PN_RESULT(1,SS_ENC,26) -#define PNR_ENC_MERGE_FAIL MAKE_PN_RESULT(1,SS_ENC,27) -#define PNR_BIN_DATA_NOT_FOUND MAKE_PN_RESULT(0,SS_ENC,28) -#define PNR_BIN_END_OF_DATA MAKE_PN_RESULT(0,SS_ENC,29) -#define PNR_BIN_DATA_PURGED MAKE_PN_RESULT(1,SS_ENC,30) -#define PNR_BIN_FULL MAKE_PN_RESULT(1,SS_ENC,31) -#define PNR_BIN_OFFSET_PAST_END MAKE_PN_RESULT(1,SS_ENC,32) -#define PNR_ENC_NO_ENCODED_DATA MAKE_PN_RESULT(1,SS_ENC,33) -#define PNR_ENC_INVALID_DLL MAKE_PN_RESULT(1,SS_ENC,34) -#define PNR_NOT_INDEXABLE MAKE_PN_RESULT(1,SS_ENC,35) -#define PNR_ENC_NO_BROWSER MAKE_PN_RESULT(1,SS_ENC,36) -#define PNR_ENC_NO_FILE_TO_SERVER MAKE_PN_RESULT(1,SS_ENC,37) -#define PNR_ENC_INSUFFICIENT_DISK_SPACE MAKE_PN_RESULT(1,SS_ENC,38) - -#define PNR_RMT_USAGE_ERROR MAKE_PN_RESULT(1,SS_RMT,1) -#define PNR_RMT_INVALID_ENDTIME MAKE_PN_RESULT(1,SS_RMT,2) -#define PNR_RMT_MISSING_INPUT_FILE MAKE_PN_RESULT(1,SS_RMT,3) -#define PNR_RMT_MISSING_OUTPUT_FILE MAKE_PN_RESULT(1,SS_RMT,4) -#define PNR_RMT_INPUT_EQUALS_OUTPUT_FILE MAKE_PN_RESULT(1,SS_RMT,5) -#define PNR_RMT_UNSUPPORTED_AUDIO_VERSION MAKE_PN_RESULT(1,SS_RMT,6) -#define PNR_RMT_DIFFERENT_AUDIO MAKE_PN_RESULT(1,SS_RMT,7) -#define PNR_RMT_DIFFERENT_VIDEO MAKE_PN_RESULT(1,SS_RMT,8) -#define PNR_RMT_PASTE_MISSING_STREAM MAKE_PN_RESULT(1,SS_RMT,9) -#define PNR_RMT_END_OF_STREAM MAKE_PN_RESULT(1,SS_RMT,10) -#define PNR_RMT_IMAGE_MAP_PARSE_ERROR MAKE_PN_RESULT(1,SS_RMT,11) -#define PNR_RMT_INVALID_IMAGEMAP_FILE MAKE_PN_RESULT(1,SS_RMT,12) -#define PNR_RMT_EVENT_PARSE_ERROR MAKE_PN_RESULT(1,SS_RMT,13) -#define PNR_RMT_INVALID_EVENT_FILE MAKE_PN_RESULT(1,SS_RMT,14) -#define PNR_RMT_INVALID_OUTPUT_FILE MAKE_PN_RESULT(1,SS_RMT,15) -#define PNR_RMT_INVALID_DURATION MAKE_PN_RESULT(1,SS_RMT,16) -#define PNR_RMT_NO_DUMP_FILES MAKE_PN_RESULT(1,SS_RMT,17) -#define PNR_RMT_NO_EVENT_DUMP_FILE MAKE_PN_RESULT(1,SS_RMT,18) -#define PNR_RMT_NO_IMAP_DUMP_FILE MAKE_PN_RESULT(1,SS_RMT,19) -#define PNR_RMT_NO_DATA MAKE_PN_RESULT(1,SS_RMT,20) -#define PNR_RMT_EMPTY_STREAM MAKE_PN_RESULT(1,SS_RMT,21) -#define PNR_RMT_READ_ONLY_FILE MAKE_PN_RESULT(1,SS_RMT,22) -#define PNR_RMT_PASTE_MISSING_AUDIO_STREAM MAKE_PN_RESULT(1,SS_RMT,23) -#define PNR_RMT_PASTE_MISSING_VIDEO_STREAM MAKE_PN_RESULT(1,SS_RMT,24) - - -#define PNR_PROP_NOT_FOUND MAKE_PN_RESULT(1,SS_REG,1) -#define PNR_PROP_NOT_COMPOSITE MAKE_PN_RESULT(1,SS_REG,2) -#define PNR_PROP_DUPLICATE MAKE_PN_RESULT(1,SS_REG,3) -#define PNR_PROP_TYPE_MISMATCH MAKE_PN_RESULT(1,SS_REG,4) -#define PNR_PROP_ACTIVE MAKE_PN_RESULT(1,SS_REG,5) -#define PNR_PROP_INACTIVE MAKE_PN_RESULT(1,SS_REG,6) - -#define PNR_COULDNOTINITCORE MAKE_PN_RESULT(1,SS_MSC,1) -#define PNR_PERFECTPLAY_NOT_SUPPORTED MAKE_PN_RESULT(1,SS_MSC,2) -#define PNR_NO_LIVE_PERFECTPLAY MAKE_PN_RESULT(1,SS_MSC,3) -#define PNR_PERFECTPLAY_NOT_ALLOWED MAKE_PN_RESULT(1,SS_MSC,4) -#define PNR_NO_CODECS MAKE_PN_RESULT(1,SS_MSC,5) -#define PNR_SLOW_MACHINE MAKE_PN_RESULT(1,SS_MSC,6) -#define PNR_FORCE_PERFECTPLAY MAKE_PN_RESULT(1,SS_MSC,7) -#define PNR_INVALID_HTTP_PROXY_HOST MAKE_PN_RESULT(1,SS_MSC,8) -#define PNR_INVALID_METAFILE MAKE_PN_RESULT(1,SS_MSC,9) -#define PNR_BROWSER_LAUNCH MAKE_PN_RESULT(1,SS_MSC,10) -#define PNR_VIEW_SOURCE_NOCLIP MAKE_PN_RESULT(1,SS_MSC,11) -#define PNR_VIEW_SOURCE_DISSABLED MAKE_PN_RESULT(1,SS_MSC,12) - -#define PNR_RESOURCE_NOT_CACHED MAKE_PN_RESULT(1,SS_RSC,1) -#define PNR_RESOURCE_NOT_FOUND MAKE_PN_RESULT(1,SS_RSC,2) -#define PNR_RESOURCE_CLOSE_FILE_FIRST MAKE_PN_RESULT(1,SS_RSC,3) -#define PNR_RESOURCE_NODATA MAKE_PN_RESULT(1,SS_RSC,4) -#define PNR_RESOURCE_BADFILE MAKE_PN_RESULT(1,SS_RSC,5) -#define PNR_RESOURCE_PARTIALCOPY MAKE_PN_RESULT(1,SS_RSC,6) - -#define PNR_PPV_NO_USER MAKE_PN_RESULT(1,SS_PPV,0) -#define PNR_PPV_GUID_READ_ONLY MAKE_PN_RESULT(1,SS_PPV,1) -#define PNR_PPV_GUID_COLLISION MAKE_PN_RESULT(1,SS_PPV,2) -#define PNR_REGISTER_GUID_EXISTS MAKE_PN_RESULT(1,SS_PPV,3) -#define PNR_PPV_AUTHORIZATION_FAILED MAKE_PN_RESULT(1,SS_PPV,4) -#define PNR_PPV_OLD_PLAYER MAKE_PN_RESULT(1,SS_PPV,5) -#define PNR_PPV_ACCOUNT_LOCKED MAKE_PN_RESULT(1,SS_PPV,6) -// #define PNR_PPV_PROTOCOL_IGNORES MAKE_PN_RESULT(1,SS_PPV,7) -#define PNR_PPV_DBACCESS_ERROR MAKE_PN_RESULT(1,SS_PPV,8) -#define PNR_PPV_USER_ALREADY_EXISTS MAKE_PN_RESULT(1,SS_PPV,9) - -// auto-upgrade (RealUpdate) errors -#define PNR_UPG_AUTH_FAILED MAKE_PN_RESULT(1,SS_UPG,0) -#define PNR_UPG_CERT_AUTH_FAILED MAKE_PN_RESULT(1,SS_UPG,1) -#define PNR_UPG_CERT_EXPIRED MAKE_PN_RESULT(1,SS_UPG,2) -#define PNR_UPG_CERT_REVOKED MAKE_PN_RESULT(1,SS_UPG,3) -#define PNR_UPG_RUP_BAD MAKE_PN_RESULT(1,SS_UPG,4) - -// auto-config errors -#define PNR_AUTOCFG_SUCCESS MAKE_PN_RESULT(1,SS_CFG,0) -#define PNR_AUTOCFG_FAILED MAKE_PN_RESULT(1,SS_CFG,1) -#define PNR_AUTOCFG_ABORT MAKE_PN_RESULT(1,SS_CFG,2) - -#define PNR_FAILED PNR_FAIL - -#ifdef _WIN16 -/*typedef UINT MMRESULT;*/ -#else -#ifdef _WIN32 -#define _HRESULT_TYPEDEF_(_sc) ((HRESULT)_sc) -#ifdef _WINCE -#undef E_NOTIMPL -#undef E_OUTOFMEMORY -#undef E_INVALIDARG -#undef E_NOINTERFACE -#undef E_POINTER -#undef E_HANDLE -#undef E_ABORT -#undef E_FAIL -#undef E_ACCESSDENIED -#endif -#define E_NOTIMPL _HRESULT_TYPEDEF_(0x80004001L) -#define E_OUTOFMEMORY _HRESULT_TYPEDEF_(0x8007000EL) -#define E_INVALIDARG _HRESULT_TYPEDEF_(0x80070057L) -#define E_NOINTERFACE _HRESULT_TYPEDEF_(0x80004002L) -#define E_POINTER _HRESULT_TYPEDEF_(0x80004003L) -#define E_HANDLE _HRESULT_TYPEDEF_(0x80070006L) -#define E_ABORT _HRESULT_TYPEDEF_(0x80004004L) -#define E_FAIL _HRESULT_TYPEDEF_(0x80004005L) -#define E_ACCESSDENIED _HRESULT_TYPEDEF_(0x80070005L) -#else -#define S_OK PNR_OK -#define E_NOTIMPL PNR_NOTIMPL -#define E_INVALIDARG PNR_INVALID_PARAMETER -#define E_NOINTERFACE PNR_NOINTERFACE -#define E_POINTER PNR_POINTER -#define E_HANDLE PNR_HANDLE -#define E_ABORT PNR_ABORT -#define E_FAIL PNR_FAIL -#define E_ACCESSDENIES PNR_ACCESSDENIED -#endif /* _WIN32 */ -#endif /* _WIN16 */ - -#define PN_STATUS_OK PNR_OK -#define PN_STATUS_FAILED E_FAIL - -#endif /* _PNRESULT_H_ */ diff --git a/include/realmedia/pntypes.h b/include/realmedia/pntypes.h deleted file mode 100644 index 5021f4e6c..000000000 --- a/include/realmedia/pntypes.h +++ /dev/null @@ -1,492 +0,0 @@ -/**************************************************************************** - * - * $Id: pntypes.h 7 2003-05-30 02:18:02Z gabest $ - * - * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved. - * - * http://www.real.com/devzone - * - * This program contains proprietary - * information of Progressive Networks, Inc, and is licensed - * subject to restrictions on use and distribution. - * - * This file defines data types that are too be used in all cross-platform - * Progressive Networks modules. - * - */ - -#ifndef _PNTYPES_H_ -#define _PNTYPES_H_ - -#if (defined(_MSC_VER) && (_MSC_VER > 1100) && defined(_BASETSD_H_)) -//#error For VC++ 6.0 or higher you must include pntypes.h before other windows header files. -#endif - -#if defined _WINDOWS || defined _OSF1 || defined _ALPHA - -#ifndef RN_LITTLE_ENDIAN -#define RN_LITTLE_ENDIAN 1 -#endif - -#ifndef RN_BIG_ENDIAN -#define RN_BIG_ENDIAN 0 -#endif - -#else - -#ifndef RN_LITTLE_ENDIAN -#define RN_LITTLE_ENDIAN 0 -#endif - -#ifndef RN_BIG_ENDIAN -#define RN_BIG_ENDIAN 1 -#endif - -#endif /* !_WINDOWS || !_OSF1 || !_ALPHA */ - -typedef signed char INT8; /* signed 8 bit value */ -typedef unsigned char UINT8; /* unsigned 8 bit value */ -typedef short int INT16; /* signed 16 bit value */ -typedef unsigned short int UINT16; /* unsigned 16 bit value */ -typedef signed int INT32; /* signed 32 bit value */ -typedef unsigned int UINT32; /* unsigned 32 bit value */ -typedef unsigned int UINT; - -#define __LONG_MAX__ 2147483647 - - -#ifndef TRUE -#define TRUE 1 -#endif - -#ifndef FALSE -#define FALSE 1 -#endif - -#ifndef BOOL -typedef int BOOL; /* signed int value (0 or 1) */ -#endif -#endif /* _VXWORKS */ - -#define ARE_BOOLS_EQUAL(a,b) (((a) && (b)) || (!(a) && !(b))) - -#ifndef PN_BITFIELD -typedef unsigned char PN_BITFIELD; -#endif - -#if defined __alpha__ -typedef long int INT64; -#elif defined _WINDOWS -typedef __int64 INT64; -#else -typedef long long INT64; -#endif /* _WINDOWS */ - -/* - * Added for ease of reading. - * Instead of using __MWERKS__ you can now use _MACINTOSH - */ -#ifdef __MWERKS__ - #if __dest_os==__macos - #ifndef _MACINTOSH - #define _MACINTOSH 1 - - #ifdef powerc - #define _MACPPC - #else - #define _MAC68K - #endif - - #endif - #endif -#endif - -#if defined (_SCO_SV) && !defined (MAXPATHLEN) -#include -#define MAXPATHLEN _POSIX_PATH_MAX -#define PATH_MAX _POSIX_PATH_MAX -#endif - -#ifdef _SCO_UW -#include //for sprintf -#endif - - -#ifdef __cplusplus -extern "C" { /* Assume C declarations for C++ */ -#endif /* __cplusplus */ - -#define LANGUAGE_CODE "EN" - -#ifdef _WIN16 -#define MAX_PATH 260 -#define PRODUCT_ID "play16" -#define PLUS_PRODUCT_ID "plus16" -#else -#define PRODUCT_ID "play32" -#define PLUS_PRODUCT_ID "plus32" -#endif - - -#define MAX_DISPLAY_NAME 256 -#define PN_INVALID_VALUE (ULONG32)0xffffffff - -#define PN_DELETE(x) ((x) ? (delete (x), (x) = 0) : 0) -#define PN_VECTOR_DELETE(x) ((x) ? (delete [] (x), (x) = 0) : 0) -#define PN_RELEASE(x) ((x) ? ((x)->Release(), (x) = 0) : 0) - -#define RA_FILE_MAGIC_NUMBER 0x2E7261FDL /* RealAudio File Identifier */ -#define RM_FILE_MAGIC_NUMBER 0x2E524D46L /* RealMedia File Identifier */ -#define RIFF_FILE_MAGIC_NUMBER 0x52494646L /* RIFF (AVI etc.) File Identifier */ - -typedef INT32 LONG32; /* signed 32 bit value */ -typedef UINT32 ULONG32; /* unsigned 32 bit value */ -#ifndef _VXWORKS -typedef UINT8 UCHAR; /* unsigned 8 bit value */ -#endif -//typedef INT8 CHAR; /* signed 8 bit value */ - -typedef UINT8 BYTE; -typedef INT32 long32; -typedef UINT32 u_long32; - -typedef INT8 Int8; -typedef UINT8 u_Int8; -typedef INT16 Int16; -typedef UINT16 u_Int16; -typedef INT32 Int32; -typedef UINT32 u_Int32; - -typedef ULONG32 UFIXED32; /* FIXED point value */ -#define FLOAT_TO_FIXED(x) ((UFIXED32) ((x) * (1L << 16) + 0.5)) -#define FIXED_TO_FLOAT(x) ((float) ((((float)x)/ (float)(1L <<16)))) - -/* - * UFIXED32 is a 32 value where the upper 16 bits are the unsigned integer - * portion of value, and the lower 16 bits are the fractional part of the - * value - */ - -typedef const char* PCSTR; - -/* - * FOURCC's are 32bit codes used in Tagged File formats like - * the RealMedia file format. - */ - -#ifndef PN_FOURCC -#define PN_FOURCC( ch0, ch1, ch2, ch3 ) \ - ( (UINT32)(UINT8)(ch0) | ( (UINT32)(UINT8)(ch1) << 8 ) | \ - ( (UINT32)(UINT8)(ch2) << 16 ) | ( (UINT32)(UINT8)(ch3) << 24 ) ) -#endif - -typedef UINT16 PrefKey; - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - - -/*-------------------------------------------------------------------------- -| ZeroInit - initializes a block of memory with zeros ---------------------------------------------------------------------------*/ -#define ZeroInit(pb) memset((void *)pb,0,sizeof(*(pb))) - -#ifndef __MACTYPES__ -typedef unsigned char Byte; -#endif - -/* -///////////////////////////////////////////////////////////////////////////// -// PNEXPORT needed for RA.H and RAGUI.H, should be able to be defined -// and used in cross platform code... -///////////////////////////////////////////////////////////////////////////// -*/ -#define PNEXPORT __declspec(dllexport) __stdcall -#define PNEXPORT_PTR __stdcall * - -typedef void (*RANOTIFYPROC)( void* ); - -#if defined(EXPORT_CLASSES) && defined(_WINDOWS) -#ifdef _WIN32 -#define PNEXPORT_CLASS __declspec(dllexport) -#else -#define PNEXPORT_CLASS __export -#endif // _WIN32 -#else -#define PNEXPORT_CLASS -#endif // EXPORT_CLASSES - - -/* - * STDMETHODCALLTYPE - */ -#ifndef STDMETHODCALLTYPE -#if defined(_WIN32) || defined(_MPPC_) -#ifdef _MPPC_ -#define STDMETHODCALLTYPE __cdecl -#else -#define STDMETHODCALLTYPE __stdcall -#endif -#elif defined(_WIN16) -// XXXTW I made the change below on 5/18/98. The __export was causing -// conflicts with duplicate CPNBuffer methods in being linked into -// rpupgrd and rpdestpn. Also, the warning was "export imported". -// This was fixed by removing the __export. The __export is also -// causing the same problem in pndebug methods. -//#define STDMETHODCALLTYPE __export far _cdecl -#define STDMETHODCALLTYPE far _cdecl -#else -#define STDMETHODCALLTYPE -#endif -#endif - -/* - * STDMETHODVCALLTYPE (V is for variable number of arguments) - */ -#ifndef STDMETHODVCALLTYPE -#if defined(_WINDOWS) || defined(_MPPC_) -#define STDMETHODVCALLTYPE __cdecl -#else -#define STDMETHODVCALLTYPE -#endif -#endif - -/* - * STDAPICALLTYPE - */ -#ifndef STDAPICALLTYPE -#if defined(_WIN32) || defined(_MPPC_) -#define STDAPICALLTYPE __stdcall -#elif defined(_WIN16) -#define STDAPICALLTYPE __export FAR PASCAL -#else -#define STDAPICALLTYPE -#endif -#endif - -/* - * STDAPIVCALLTYPE (V is for variable number of arguments) - */ -#ifndef STDAPIVCALLTYPE -#if defined(_WINDOWS) || defined(_MPPC_) -#define STDAPIVCALLTYPE __cdecl -#else -#define STDAPIVCALLTYPE -#endif -#endif - -/* -///////////////////////////////////////////////////////////////////////////// -// -// Macro: -// -// PN_GET_MAJOR_VERSION() -// -// Purpose: -// -// Returns the Major version portion of the encoded product version -// of the RealAudio application interface DLL previously returned from -// a call to RaGetProductVersion(). -// -// Parameters: -// -// prodVer -// The encoded product version of the RealAudio application interface -// DLL previously returned from a call to RaGetProductVersion(). -// -// Return: -// -// The major version number of the RealAudio application interface DLL -// -// -*/ -#define PN_GET_MAJOR_VERSION(prodVer) ((prodVer >> 28) & 0xF) - -/* -///////////////////////////////////////////////////////////////////////////// -// -// Macro: -// -// PN_GET_MINOR_VERSION() -// -// Purpose: -// -// Returns the minor version portion of the encoded product version -// of the RealAudio application interface DLL previously returned from -// a call to RaGetProductVersion(). -// -// Parameters: -// -// prodVer -// The encoded product version of the RealAudio application interface -// DLL previously returned from a call to RaGetProductVersion(). -// -// Return: -// -// The minor version number of the RealAudio application interface DLL -// -// -*/ -#define PN_GET_MINOR_VERSION(prodVer) ((prodVer >> 20) & 0xFF) - -/* -///////////////////////////////////////////////////////////////////////////// -// -// Macro: -// -// PN_GET_RELEASE_NUMBER() -// -// Purpose: -// -// Returns the release number portion of the encoded product version -// of the RealAudio application interface DLL previously returned from -// a call to RaGetProductVersion(). -// -// Parameters: -// -// prodVer -// The encoded product version of the RealAudio application interface -// DLL previously returned from a call to RaGetProductVersion(). -// -// Return: -// -// The release number of the RealAudio application interface DLL -// -// -*/ -#define PN_GET_RELEASE_NUMBER(prodVer) ((prodVer >> 12) & 0xFF) - -/* -///////////////////////////////////////////////////////////////////////////// -// -// Macro: -// -// PN_GET_BUILD_NUMBER() -// -// Purpose: -// -// Returns the build number portion of the encoded product version -// of the RealAudio application interface DLL previously returned from -// a call to RaGetProductVersion(). -// -// Parameters: -// -// prodVer -// The encoded product version of the RealAudio application interface -// DLL previously returned from a call to RaGetProductVersion(). -// -// Return: -// -// The build number of the RealAudio application interface DLL -// -// -*/ -#define PN_GET_BUILD_NUMBER(prodVer) (prodVer & 0xFFF) - -/* -///////////////////////////////////////////////////////////////////////////// -// -// Macro: -// -// PN_ENCODE_PROD_VERSION() -// -// Purpose: -// -// Encodes a major version, minor version, release number, and build -// number into a product version for testing against the product version -// of the RealAudio application interface DLL returned from a call to -// RaGetProductVersion(). -// -// Parameters: -// -// major -// The major version number to encode. -// -// mimor -// The minor version number to encode. -// -// release -// The release number to encode. -// -// build -// The build number to encode. -// -// Return: -// -// The encoded product version. -// -// NOTES: -// -// Macintosh DEVELOPERS especially, make sure when using the PN_ENCODE_PROD_VERSION -// that you are passing a ULONG32 or equivalent for each of the parameters. -// By default a number passed in as a constant is a short unless it requires more room, -// so designate the constant as a long by appending a L to the end of it. -// Example: -// WORKS: -// PN_ENCODE_VERSION(2L,1L,1L,0L); -// -// DOES NOT WORK: -// PN_ENCODE_VERSION(2,1,1,0); -// -*/ - -#define PN_ENCODE_PROD_VERSION(major,minor,release,build) \ - ((ULONG32)((ULONG32)major << 28) | ((ULONG32)minor << 20) | \ - ((ULONG32)release << 12) | (ULONG32)build) - -#define PN_ENCODE_ADD_PRIVATE_FIELD(ulversion,ulprivate) \ - ((ULONG32)((ULONG32)(ulversion) & (UINT32)0xFFFFFF00) | (ULONG32)(ulprivate) ) - -#define PN_EXTRACT_PRIVATE_FIELD(ulversion)(ulversion & (UINT32)0xFF) - -#define PN_EXTRACT_MAJOR_VERSION(ulversion) ((ulversion)>>28) -#define PN_EXTRACT_MINOR_VERSION(ulversion) (((ulversion)>>20) & (UINT32)0xFF) - -#ifdef _AIX - typedef int tv_sec_t; - typedef int tv_usec_t; -#elif (defined _HPUX) - typedef UINT32 tv_sec_t; - typedef INT32 tv_usec_t; -#else - typedef INT32 tv_sec_t; - typedef INT32 tv_usec_t; -#endif /* _AIX */ - -#ifndef VOLATILE -#define VOLATILE volatile -#endif - -#ifdef __GNUC__ -#define PRIVATE_DESTRUCTORS_ARE_NOT_A_CRIME friend class SilenceGCCWarnings; -#else -#define PRIVATE_DESTRUCTORS_ARE_NOT_A_CRIME -#endif - -typedef ULONG32 PNXRESOURCE; -typedef ULONG32 PNXHANDLE; -typedef ULONG32 PNXIMAGE; - -// Macro which indicates that a particular variable is unused. Use this to -// avoid compiler warnings. -//#define UNUSED(x) - -/* - * For VC++ 6.0 and higher we need to include this substitute header file - * in place of the standard header file basetsd.h, since this standard - * header file conflicts with our definitions. - */ -#if defined(_MSC_VER) && (_MSC_VER > 1100) -#include "pnbastsd.h" -#ifdef _WINCE -#define _TYPES_H_ -#endif -#endif - -#ifdef _VXWORKS -/* throw in some defines for VXWORKS */ -#define MAXPATHLEN 255 - - -#endif /* _PNTYPES_H_ */ diff --git a/include/realmedia/pnwintyp.h b/include/realmedia/pnwintyp.h deleted file mode 100644 index 5c9c6f426..000000000 --- a/include/realmedia/pnwintyp.h +++ /dev/null @@ -1,278 +0,0 @@ -/**************************************************************************** - * - * $Id: pnwintyp.h 7 2003-05-30 02:18:02Z gabest $ - * - * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved. - * - * http://www.real.com/devzone - * - * This program contains proprietary - * information of Progressive Networks, Inc, and is licensed - * subject to restrictions on use and distribution. - * - * - * Defines the public classes for cross platform windows used in various - * Progressive Networks modules. - * - */ - -#ifndef _PNWINTYP_H_ -#define _PNWINTYP_H_ - -#include "pntypes.h" /* Needed at least for various defines and types. */ - -#ifdef _WIN16 -#define BI_BITFIELDS 3L -#endif - -/**************************************************************************** - * - * Structure: - * - * PNxSize - * - * Purpose: - * - * Cross Platform definition of a size. - * - */ -typedef struct PNEXPORT_CLASS _PNxSize -{ - INT32 cx; - INT32 cy; -} PNxSize; - -/**************************************************************************** - * - * Structure: - * - * PNxPoint - * - * Purpose: - * - * Cross Platform definition of a point. - * - */ -typedef struct PNEXPORT_CLASS _PNxPoint -{ - INT32 x; - INT32 y; -} PNxPoint; - -/**************************************************************************** - * - * Structure: - * - * PNxRect - * - * Purpose: - * - * Cross Platform definition of a rectangle. - * - */ -typedef struct PNEXPORT_CLASS _PNxRect -{ - INT32 left; - INT32 top; - INT32 right; - INT32 bottom; -} PNxRect; - -#define PNxRECT_WIDTH(r) ((r).right - (r).left) -#define PNxRECT_HEIGHT(r) ((r).bottom - (r).top) - -/**************************************************************************** - * - * Structure: - * - * PNxWindow - * - * Purpose: - * - * Cross Platform definition of a window. This struct is sufficiently - * wide to describe parent or child windows in Windows, MacOS, and - * various flavours of X-Windows. - * - * Data Members: - * - * void* window - * platform specific window handle - * - * ULONG32 x, y - * position of top left corner relative to a client page - * - * ULONG32 width, height - * maximum window size - * - * PNxRect clipRect; - * clipping rectangle in port coordinates - * - */ -typedef struct PNEXPORT_CLASS _PNxWindow -{ - /* NOTE: The window parameter is NOT guaranteed to be unique for every - corresponding CPNWindow. Use PNxWindowID if this is desired. */ - void* window; - ULONG32 x; - ULONG32 y; - ULONG32 width; - ULONG32 height; - PNxRect clipRect; - #ifdef _UNIX - void * display; - #endif -} PNxWindow; - -typedef void* PNxWindowID; - -/**************************************************************************** - * - * Structure: - * - * PNxEvent - * - * Purpose: - * - * Cross Platform definition of a event. This struct is sufficiently - * wide to describe an event in Windows, MacOS, and various flavours of - * X-Windows. - * - * Data Members: - * - * void* event - * platform specific event ID, can also be one of the several PNxMSG_* - * event IDs which map onto existing platform specific event IDs - * UNIX: X Event Type - * - * void* window - * platform specific window handle - * UNIX: X Window ID - * - * void* param1 - * message specific parameter - * UNIX: Display* - * - * void* param2 - * Mac: for UpdateEvt, either NULL or RgnHandle to be filled with updated area - * UNIX: Native XEvent* - * RMA_SURFACE_UPDATE PNxWindow* - * - */ -typedef struct PNEXPORT_CLASS _PNxEvent -{ - ULONG32 event; /* IN */ - void* window; /* IN */ - void* param1; /* IN */ - void* param2; /* IN */ - - UINT32 result; /* OUT */ - BOOL handled; /* OUT */ -} PNxEvent; - - -/**************************************************************************** - * - * typedef: - * - * PNxRegion - * - * Purpose: - * - * Cross Platform definition of a region. This typedef is redefined as - * appropriate to describe a region in Windows, MacOS, and various - * flavours of X-Windows. - * - */ -typedef void* PNxRegion; - -/**************************************************************************** - * - * typedef: - * - * PNxDC - * - * Purpose: - * - * Cross Platform definition of a device context. This typedef is redefined as - * appropriate to describe a device context in Windows, MacOS, and various - * flavours of X-Windows. - * - */ -typedef void* PNxDC; - -/**************************************************************************** - * - * typedef: - * - * PNxFont - * - * Purpose: - * - * Cross Platform definition of a font. This typedef is redefined as - * appropriate to describe a font in Windows, MacOS, and various - * flavours of X-Windows. - * - */ -typedef void* PNxFont; - -/**************************************************************************** - * - * typedef: - * - * PNxColor - * - * Purpose: - * - * Cross Platform definition of a color. This typedef is redefined as - * appropriate to describe a font in Windows, MacOS, and various - * flavours of X-Windows. - * - */ -typedef ULONG32 PNxColor; - -/**************************************************************************** - * - * typedef: - * - * PNxIcon - * - * Purpose: - * - * Cross Platform definition of a icon. This typedef is redefined as - * appropriate to describe a font in Windows, MacOS, and various - * flavours of X-Windows. - * - */ -typedef void* PNxIcon; - -/**************************************************************************** - * - * typedef: - * - * PNxMenu - * - * Purpose: - * - * Cross Platform definition of a menu. This typedef is redefined as - * appropriate to describe a font in Windows, MacOS, and various - * flavours of X-Windows. - * - */ -typedef void* PNxMenu; - -/**************************************************************************** - * - * typedef: - * - * PNxCursor - * - * Purpose: - * - * Cross Platform definition of a cursor. This typedef is redefined as - * appropriate to describe a cursor in Windows, MacOS, and various - * flavours of X-Windows. - * - */ -typedef void* PNxCursor; - -#endif /* _PNWINTYP_H_ */ diff --git a/include/realmedia/pxresult.h b/include/realmedia/pxresult.h deleted file mode 100644 index 9bbf61695..000000000 --- a/include/realmedia/pxresult.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _PXRESULT_H -#define _PXRESULT_H - -#define PNR_UNKNOWN_IMAGE MAKE_PN_RESULT(1,SS_RPX,0) -#define PNR_UNKNOWN_EFFECT MAKE_PN_RESULT(1,SS_RPX,1) -#define PNR_SENDIMAGE_ABORTED MAKE_PN_RESULT(0,SS_RPX,2) -#define PNR_SENDEFFECT_ABORTED MAKE_PN_RESULT(0,SS_RPX,3) - -#endif diff --git a/include/realmedia/rmaaconf.h b/include/realmedia/rmaaconf.h deleted file mode 100644 index 4d9188960..000000000 --- a/include/realmedia/rmaaconf.h +++ /dev/null @@ -1,181 +0,0 @@ -/**************************************************************************** - * - * - * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved. - * - * http://www.real.com/devzone - * - * This program contains proprietary - * information of Progressive Networks, Inc, and is licensed - * subject to restrictions on use and distribution. - * - * - * RealMedia Architecture AutoConfiguration interfaces - * - */ - -#ifndef _RMAACONF_H_ -#define _RMAACONF_H_ - -/* - * Forward declarations of some interfaces defined here-in. - */ -typedef _INTERFACE IRMAAutoConfig IRMAAutoConfig; -typedef _INTERFACE IRMAAutoConfigResponse IRMAAutoConfigResponse; - -#define RMA_TRANSPORT_MULTICAST 0 -#define RMA_TRANSPORT_UDP 1 -#define RMA_TRANSPORT_TCP 2 -#define RMA_TRANSPORT_HTTP 3 - -/**************************************************************************** - * - * Interface: - * - * IRMAAutoConfig - * - * Purpose: - * This interface allows the auto-configuration of the protocol used by - * the client core. - * - * IID_IRMAAutoConfig: - * - * {00002700-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAAutoConfig, 0x00002700, 0x901, 0x11d1, 0x8b, 0x6, - 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAAutoConfig - -DECLARE_INTERFACE_(IRMAAutoConfig, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAAutoConfig methods - */ - /************************************************************************ - * Method: - * IRMAAutoConfig::Init - * Purpose: - * Shutdown the configuration process. - * - */ - STDMETHOD(Init) (THIS_ - IRMAAutoConfigResponse* pResponse, - const char* pPNAURL, - const char* pRTSPURL) PURE; - - /************************************************************************ - * Method: - * IRMAAutoConfig::Close - * Purpose: - * Shutdown the configuration process. - * - */ - STDMETHOD(Close) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAAutoConfig::Abort - * Purpose: - * Abort the configuration process. - * - */ - STDMETHOD(Abort) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAAutoConfig::DoAutoConfig - * Purpose: - * Start the auto-configuration Process. - * - */ - STDMETHOD(DoAutoConfig) (THIS) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAAutoConfigResponse - * - * Purpose: - * Response interface for IRMAAutoConfig. - * - * IID_IRMAAutoConfig: - * - * {00002701-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAAutoConfigResponse, 0x00002701, 0x901, 0x11d1, 0x8b, - 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAAutoConfigResponse - -DECLARE_INTERFACE_(IRMAAutoConfigResponse, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAAutoConfigResponse methods - */ - /************************************************************************ - * Method: - * IRMAAutoConfigResponse::OnBegin - * Purpose: - * Notification for start of auto-configure process - * - */ - STDMETHOD(OnBegin) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAAutoConfigResponse::OnProgress - * Purpose: - * Notification for progress of auto-configure process - * - */ - STDMETHOD(OnProgress) (THIS_ - UINT32 ulProgress, - UINT32 ulProtocolID, - const char* pProtocolDescription) PURE; - - /************************************************************************ - * Method: - * IRMAAutoConfigResponse::OnComplete - * Purpose: - * Notification for completion of auto-configure process - * - */ - STDMETHOD(OnComplete) (THIS_ - PN_RESULT PNAResult, - UINT32 ulPNAProtocolID, - PN_RESULT RTSPResult, - UINT32 ulRTSPProtocolID) PURE; -}; - - -#endif /* _RMAACONF_H_ */ diff --git a/include/realmedia/rmaallow.h b/include/realmedia/rmaallow.h deleted file mode 100644 index cdb550215..000000000 --- a/include/realmedia/rmaallow.h +++ /dev/null @@ -1,272 +0,0 @@ -/**************************************************************************** - * - * $Id: rmaallow.h 7 2003-05-30 02:18:02Z gabest $ - * - * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved. - * - * http://www.real.com/devzone - * - * This program contains proprietary - * information of Progressive Networks, Inc, and is licensed - * subject to restrictions on use and distribution. - * - * Interfaces related to allowance plugins. - * - */ - -#ifndef _RMAALLOW_H_ -#define _RMAALLOW_H_ - -/* - * Forward declarations of some interfaces defined or used here-in. - */ -typedef _INTERFACE IRMAValues IRMAValues; -typedef _INTERFACE IRMABuffer IRMABuffer; -typedef _INTERFACE IRMARequest IRMARequest; -typedef _INTERFACE IRMAPlayerConnectionAdviseSinkManager IRMAPlayerConnectionAdviseSinkManager; -typedef _INTERFACE IRMAPlayerConnectionAdviseSink IRMAPlayerConnectionAdviseSink; -typedef _INTERFACE IRMAPlayerConnectionResponse IRMAPlayerConnectionResponse; -typedef _INTERFACE IRMAPlayerController IRMAPlayerController; -typedef _INTERFACE IRMAPlayerControllerProxyRedirect IRMAPlayerControllerProxyRedirect; - -/**************************************************************************** - * - * Interface: - * - * IRMAPlayerConnectionAdviseSink - * - * Purpose: - * - * Advise Sink which receives notification whenever a new player - * connects to the server. - * - * IID_IRMAPlayerConnectionAdviseSink: - * - * {00002600-0901-11d1-8B06-00A024406D59} - * - */ - -DEFINE_GUID(IID_IRMAPlayerConnectionAdviseSink, 0x00002600, 0x901, 0x11d1, - 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAPlayerConnectionAdviseSink - -DECLARE_INTERFACE_(IRMAPlayerConnectionAdviseSink, IUnknown) -{ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* OnConnection is called when a new player has connected to the - * server. If the result is PNR_OK, then the plugin will be notified - * when certain events occur in the player's life cycle. - */ - STDMETHOD(OnConnection) (THIS_ - IRMAPlayerConnectionResponse* pResponse) PURE; - - /* SetPlayerController is called by the server core to provide us with - * an interface which can stop, alert, redirect or otherwise control - * the player we are receiving notifications about. - */ - STDMETHOD(SetPlayerController) (THIS_ - IRMAPlayerController* pPlayerController) PURE; - - /* SetRegistryID is called by the server core to provide us with the - * ID for this Player in the server registry. The plugin can use this - * registry ID to find out various information about the connected player. - */ - STDMETHOD(SetRegistryID) (THIS_ UINT32 ulPlayerRegistryID) PURE; - - STDMETHOD(OnURL) (THIS_ IRMARequest* pRequest) PURE; - STDMETHOD(OnBegin) (THIS) PURE; - STDMETHOD(OnStop) (THIS) PURE; - STDMETHOD(OnPause) (THIS) PURE; - STDMETHOD(OnDone) (THIS) PURE; -}; - -/**************************************************************************** - * - * Interface: - * - * IRMAPlayerConnectionResponse - * - * Purpose: - * - * Response object for the PlayerConnectionAdviseSink. - * - * IID_IRMAPlayerConnectionResponse: - * - * {00002601-0901-11d1-8B06-00A024406D59} - * - */ - -DEFINE_GUID(IID_IRMAPlayerConnectionResponse, 0x00002601, 0x901, 0x11d1, - 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAPlayerConnectionResponse - -DECLARE_INTERFACE_(IRMAPlayerConnectionResponse, IUnknown) -{ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - STDMETHOD(OnConnectionDone) (THIS_ PN_RESULT status) PURE; - STDMETHOD(OnURLDone) (THIS_ PN_RESULT status) PURE; - STDMETHOD(OnBeginDone) (THIS_ PN_RESULT status) PURE; - STDMETHOD(OnStopDone) (THIS_ PN_RESULT status) PURE; - STDMETHOD(OnPauseDone) (THIS_ PN_RESULT status) PURE; -}; - -/**************************************************************************** - * - * Interface: - * - * IRMAPlayerController - * - * Purpose: - * - * Object created by the server core and given to the - * IRMAPlayerConnectionResponse object so that the response object - * can control the connected player. - * - * IID_IRMAPlayerController: - * - * {00002602-0901-11d1-8B06-00A024406D59} - * - */ - -DEFINE_GUID(IID_IRMAPlayerController, 0x00002602, 0x901, 0x11d1, - 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAPlayerController - -DECLARE_INTERFACE_(IRMAPlayerController, IUnknown) -{ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - STDMETHOD(Pause) (THIS) PURE; - STDMETHOD(Resume) (THIS) PURE; - STDMETHOD(Disconnect) (THIS) PURE; - STDMETHOD(AlertAndDisconnect) (THIS_ IRMABuffer* pAlert) PURE; - - /* HostRedirect is called by a PlayerConnectionAdviseSink to redirect - * this player to another host and/or port, for the same URL. This - * method works with both RTSP and PNA protocols. - */ - STDMETHOD(HostRedirect) (THIS_ IRMABuffer* pHost, - UINT16 nPort) PURE; - - /* NetworkRedirect is called by a PlayerConnectionAdviseSink to redirect - * this player to another URL. Note: This method is only available for - * redirecting an RTSP player connection to another RTSP URL. - */ - STDMETHOD(NetworkRedirect) (THIS_ IRMABuffer* pURL, - UINT32 ulSecsFromNow) PURE; - - /* Redirect is called by a PlayerConnectionAdviseSink to redirect - * this player to another URL on the same server. For example, if - * pPartialURL were set to "welcome.rm", the player would be redirected - * to "current_protocol://current_host:current_port/welcome.rm". This - * method works with both RTSP and PNA protocols. - */ - STDMETHOD(Redirect) (THIS_ IRMABuffer* pPartialURL) PURE; -}; - -/**************************************************************************** - * - * Interface: - * - * IRMAPlayerConnectionAdviseSinkManager - * - * Purpose: - * - * Manages the creation of IRMAPlayerConnectionAdviseSink objects - * - * IID_IRMAPlayerConnectionAdviseSinkManager: - * - * {00002603-0901-11d1-8B06-00A024406D59} - * - */ - -DEFINE_GUID(IID_IRMAPlayerConnectionAdviseSinkManager, 0x00002603, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAPlayerConnectionAdviseSinkManager - -DECLARE_INTERFACE_(IRMAPlayerConnectionAdviseSinkManager, IUnknown) -{ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - STDMETHOD(CreatePlayerConnectionAdviseSink) - (THIS_ - REF(IRMAPlayerConnectionAdviseSink*) pPCAdviseSink) PURE; -}; - -/**************************************************************************** - * - * Interface: - * - * IRMAPlayerControllerProxyRedirect - * - * Purpose: - * - * QueryInterfaced from IRMAPlayerController. Allows 305 proxy redirect - * to be issued (as per RTSP spec). - * - * IID_IRMAPlayerControllerProxyRedirect: - * - * {00002607-0901-11d1-8B06-00A024406D59} - * - */ - -DEFINE_GUID(IID_IRMAPlayerControllerProxyRedirect, 0x00002607, 0x901, 0x11d1, - 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAPlayerControllerProxyRedirect - -DECLARE_INTERFACE_(IRMAPlayerControllerProxyRedirect, IUnknown) -{ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * This URL is just a hostname / port. It must be formatted like this: - * "rtsp://audio.real.com:554/". - * - * NOTE: You can *only* call this method between OnURL() and OnURLDone(). - * NOTE: This method only works on RTSP connections. - */ - STDMETHOD(NetworkProxyRedirect) (THIS_ IRMABuffer* pURL) PURE; -}; - -#endif /* _RMAALLOW_H_ */ diff --git a/include/realmedia/rmaasm.h b/include/realmedia/rmaasm.h deleted file mode 100644 index cba8844de..000000000 --- a/include/realmedia/rmaasm.h +++ /dev/null @@ -1,285 +0,0 @@ -/**************************************************************************** - * - * $Id: rmaasm.h 7 2003-05-30 02:18:02Z gabest $ - * - * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved. - * - * http://www.real.com/devzone - * - * This program contains proprietary - * information of Progressive Networks, Inc, and is licensed - * subject to restrictions on use and distribution. - * - * - * RealMedia Architecture Interfaces for Adaptive Stream Management and - * Backchannel Support. - * - */ - -#ifndef _RMAASM_H_ -#define _RMAASM_H_ - -/* - * Forward declarations of some interfaces defined here-in. - */ -typedef _INTERFACE IRMAPacket IRMAPacket; -typedef _INTERFACE IRMABackChannel IRMABackChannel; -typedef _INTERFACE IRMAASMSource IRMAASMSource; -typedef _INTERFACE IRMAASMStreamSink IRMAASMStreamSink; -typedef _INTERFACE IRMAASMStream IRMAASMStream; - - -/**************************************************************************** - * - * Interface: - * - * IRMABackChannel - * - * Purpose: - * - * Backchannel interface to be used by renderers and implemented by - * FileFormat Plugins - * - * IID_IRMABackChannel: - * - * {00001500-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMABackChannel, 0x00001500, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); -#undef INTERFACE -#define INTERFACE IRMABackChannel - -DECLARE_INTERFACE_(IRMABackChannel, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMABackChannel method - */ - - /************************************************************************ - * Method: - * IRMABackChannel::PacketReady - * Purpose: - * A back channel packet sent from Renderer to FileFormat plugin. - */ - STDMETHOD(PacketReady) (THIS_ - IRMAPacket* pPacket) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAASMSource - * - * Purpose: - * - * This interface is implemented by file formats so that they can - * act on ASM Subscribe and Unsubscribe actions. - * - * IID_IRMAASMSource: - * - * {00001501-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAASMSource, 0x00001501, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAASMSource - -DECLARE_INTERFACE_(IRMAASMSource, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAASMSource methods - */ - - /************************************************************************ - * Method: - * IRMAASMSource::Subscribe - * Purpose: - * Called to inform a file format that a subscription has occurred, - * to rule number uRuleNumber, for stream uStreamNumber. - */ - STDMETHOD(Subscribe) (THIS_ - UINT16 uStreamNumber, - UINT16 uRuleNumber) PURE; - - /************************************************************************ - * Method: - * IRMAASMSource::Unsubscribe - * Purpose: - * Called to inform a file format that a unsubscription has occurred, - * to rule number uRuleNumber, for stream uStreamNumber. - */ - STDMETHOD(Unsubscribe) (THIS_ - UINT16 uStreamNumber, - UINT16 uRuleNumber) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAASMStream - * - * Purpose: - * This interface is implemented by the client core. Top level clients - * renderers, etc can query for this interface off of IRMAStream. This - * interface allows you to subscribe and unsubscribe to certain rules, - * and it also allows you to add a advise sink for these events. - * - * IID_IRMAASMStream: - * - * {00001502-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAASMStream, 0x00001502, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAASMStream - -DECLARE_INTERFACE_(IRMAASMStream, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAASMStream methods - */ - - /************************************************************************ - * Method: - * IRMAASMStream::AddASMStreamSink - * Purpose: - * Add an advise sink for getting subscribe and unsubscribe - * notifications. - */ - STDMETHOD(AddStreamSink) (THIS_ - IRMAASMStreamSink* pASMStreamSink) PURE; - - /************************************************************************ - * Method: - * IRMAASMStream::RemoveStreamSink - * Purpose: - * Remove an advise sink for getting subscribe and unsubscribe - * notifications. - */ - STDMETHOD(RemoveStreamSink) (THIS_ - IRMAASMStreamSink* pASMStreamSink) PURE; - - /************************************************************************ - * Method: - * IRMAASMStream::Subscribe - * Purpose: - * Called by renderers and possibly even top level clients to - * inform the core to subscribe to a particular rule number for - * this stream. - */ - STDMETHOD(Subscribe) (THIS_ - UINT16 uRuleNumber) PURE; - - /************************************************************************ - * Method: - * IRMAASMStream::Unsubscribe - * Purpose: - * Called by renderers and possibly even top level clients to - * inform the core to unsubscribe to a particular rule number for - * this stream. - */ - STDMETHOD (Unsubscribe) (THIS_ - UINT16 uRuleNumber) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAASMStreamSink - * - * Purpose: - * This is a advise sink for getting notification about subscriptions - * and unsubscriptions for a stream. - * - * IID_IRMAASMStream: - * - * {00001503-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAASMStreamSink, 0x00001503, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAASMStreamSink - -DECLARE_INTERFACE_(IRMAASMStreamSink, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAASMStreamSink methods - */ - - /************************************************************************ - * Method: - * IRMAASMStreamSink::OnSubscribe - * Purpose: - * Called to inform you that a subscribe has occurred. - */ - STDMETHOD (OnSubscribe) (THIS_ - UINT16 uRuleNumber) PURE; - - /************************************************************************ - * Method: - * IRMAASMStreamSink::OnUnsubscribe - * Purpose: - * Called to inform you that a unsubscribe has occurred. - */ - STDMETHOD (OnUnsubscribe) (THIS_ - UINT16 uRuleNumber) PURE; -}; - -#endif /*_RMAASM_H_*/ diff --git a/include/realmedia/rmaausvc.h b/include/realmedia/rmaausvc.h deleted file mode 100644 index ce8542116..000000000 --- a/include/realmedia/rmaausvc.h +++ /dev/null @@ -1,1261 +0,0 @@ -/**************************************************************************** - * - * $Id: rmaausvc.h 7 2003-05-30 02:18:02Z gabest $ - * - * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved. - * - * http://www.real.com/devzone - * - * This program contains proprietary - * information of Progressive Networks, Inc, and is licensed - * subject to restrictions on use and distribution. - * - * - * RealMedia Architecture Audio Services Interfaces. - * - */ - -#ifndef _RMAAUSVC_H_ -#define _RMAAUSVC_H_ - -/**************************************************************************** - * - * Forward declarations of some interfaces defined here-in. - */ -typedef _INTERFACE IRMAAudioPlayer IRMAAudioPlayer; -typedef _INTERFACE IRMAAudioPlayerResponse IRMAAudioPlayerResponse; -typedef _INTERFACE IRMAAudioStream IRMAAudioStream; -typedef _INTERFACE IRMAAudioStream2 IRMAAudioStream2; -typedef _INTERFACE IRMAAudioDevice IRMAAudioDevice; -typedef _INTERFACE IRMAAudioDeviceResponse IRMAAudioDeviceResponse; -typedef _INTERFACE IRMAAudioHook IRMAAudioHook; -typedef _INTERFACE IRMAAudioStreamInfoResponse IRMAAudioStreamInfoResponse; -typedef _INTERFACE IRMAVolume IRMAVolume; -typedef _INTERFACE IRMAVolumeAdviseSink IRMAVolumeAdviseSink; -typedef _INTERFACE IRMADryNotification IRMADryNotification; -typedef _INTERFACE IRMABuffer IRMABuffer; -typedef _INTERFACE IRMAValues IRMAValues; - -/**************************************************************************** - * - * Audio Services Data Structures - */ -typedef struct _RMAAudioFormat -{ - UINT16 uChannels; /* Num. of Channels (1=Mono, 2=Stereo, etc. */ - UINT16 uBitsPerSample; /* 8 or 16 */ - ULONG32 ulSamplesPerSec;/* Sampling Rate */ - UINT16 uMaxBlockSize; /* Max Blocksize */ -} RMAAudioFormat; - -typedef enum _AudioStreamType -{ - STREAMING_AUDIO = 0, - INSTANTANEOUS_AUDIO = 1, - TIMED_AUDIO = 2 -} AudioStreamType; - -typedef struct _RMAAudioData -{ - IRMABuffer* pData; /* Audio data */ - ULONG32 ulAudioTime; /* Start time in milliseconds */ - AudioStreamType uAudioStreamType; -} RMAAudioData; - -/**************************************************************************** - * - * Interface: - * - * IRMAAudioPlayer - * - * Purpose: - * - * This interface provides access to the Audio Player services. Use this - * interface to create audio streams, "hook" post-mixed audio data, and to - * control volume levels. - * - * IID_IRMAAudioPlayer: - * - * {00000700-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAAudioPlayer, 0x00000700, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - - -#undef INTERFACE -#define INTERFACE IRMAAudioPlayer - -DECLARE_INTERFACE_(IRMAAudioPlayer, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAAudioPlayer methods - */ - /************************************************************************ - * Method: - * IRMAAudioPlayer::CreateAudioStream - * Purpose: - * Call this to create an audio stream. - */ - STDMETHOD(CreateAudioStream) (THIS_ - IRMAAudioStream** /*OUT*/ pAudioStream - ) PURE; - - /************************************************************************ - * Method: - * IRMAAudioPlayer::AddPostMixHook - * Purpose: - * Call this to hook audio data after all audio streams in this - * have been mixed. - */ - STDMETHOD(AddPostMixHook) (THIS_ - IRMAAudioHook* /*IN*/ pHook, - const BOOL /*IN*/ bDisableWrite, - const BOOL /*IN*/ bFinal - ) PURE; - - /************************************************************************ - * Method: - * IRMAAudioPlayer::RemovePostMixHook - * Purpose: - * Call this to remove an already added post hook. - */ - STDMETHOD(RemovePostMixHook) (THIS_ - IRMAAudioHook* /*IN*/ pHook - ) PURE; - - /************************************************************************ - * Method: - * IRMAAudioPlayer::GetAudioStreamCount - * Purpose: - * Get the number of audio streams currently active in the - * audio player. Since streams can be added mid-presentation - * this function may return different values on different calls. - * If the user needs to know about all the streams as they get - * get added to the player, IRMAAudioStreamInfoResponse should - * be implemented and passed in SetStreamInfoResponse. - */ - STDMETHOD_(UINT16,GetAudioStreamCount) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAAudioPlayer::GetAudioStream - * Purpose: - * Get an audio stream at position given. - */ - STDMETHOD_(IRMAAudioStream*,GetAudioStream) (THIS_ - UINT16 /*IN*/ uIndex - ) PURE; - - /************************************************************************ - * Method: - * IRMAAudioPlayer::SetStreamInfoResponse - * Purpose: - * Set a stream info response interface. A client must implement - * an IRMAAudioStreamInfoResponse and then call this method with - * the IRMAAudioStreamInfoResponse as the parameter. The audio - * player will call IRMAAudioStreamInfoResponse::OnStreamsReady - * with the total number of audio streams associated with this - * audio player. - */ - STDMETHOD(SetStreamInfoResponse) (THIS_ - IRMAAudioStreamInfoResponse* /*IN*/ pResponse - ) PURE; - - /************************************************************************ - * Method: - * IRMAAudioPlayer::RemoveStreamInfoResponse - * Purpose: - * Remove stream info response that was added earlier - */ - STDMETHOD(RemoveStreamInfoResponse) (THIS_ - IRMAAudioStreamInfoResponse* /*IN*/ pResponse - ) PURE; - - /************************************************************************ - * Method: - * IRMAAudioPlayer::GetAudioVolume - * Purpose: - * Get the audio player's volume interface. This volume controls - * the volume level of all the mixed audio streams for this - * audio player. - */ - STDMETHOD_(IRMAVolume*,GetAudioVolume) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAAudioPlayer::GetDeviceVolume - * Purpose: - * Get the audio device volume interface. This volume controls - * the audio device volume levels. - */ - STDMETHOD_(IRMAVolume*,GetDeviceVolume) (THIS) PURE; - -}; - -/**************************************************************************** - * - * Interface: - * - * IRMAAudioPlayerResponse - * - * Purpose: - * - * This interface provides access to the Audio Player Response. Use this - * to receive audio player playback notifications. Your implementation of - * OnTimeSync() is called with the current audio playback time (millisecs). - * This interface is currently to be used ONLY by the RMA engine internally. - * - * IID_IRMAAudioPlayerResponse: - * - * {00000701-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAAudioPlayerResponse, 0x00000701, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - - -#undef INTERFACE -#define INTERFACE IRMAAudioPlayerResponse - -DECLARE_INTERFACE_(IRMAAudioPlayerResponse, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAAudioPlayerResponse methods - */ - - /************************************************************************ - * Method: - * IRMAAudioPlayerResponse::OnTimeSync - * Purpose: - * This method is called with the current audio playback time. - */ - STDMETHOD(OnTimeSync) (THIS_ - ULONG32 /*IN*/ ulTimeEnd - ) PURE; - -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAAudioStream - * - * Purpose: - * - * This interface provides access to an Audio Stream. Use this to play - * audio, "hook" audio stream data, and to get audio stream information. - * - * IID_IRMAAudioStream: - * - * {00000702-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAAudioStream, 0x00000702, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); -#undef INTERFACE -#define INTERFACE IRMAAudioStream - -DECLARE_INTERFACE_(IRMAAudioStream, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAAudioStream methods - */ - - /************************************************************************ - * Method: - * IRMAAudioStream::Init - * Purpose: - * Initialize an audio stream with the given audio format. The - * IRMAValues contains stream identification information. - */ - STDMETHOD(Init) (THIS_ - const RMAAudioFormat* /*IN*/ pAudioFormat, - IRMAValues* /*IN*/ pValues - ) PURE; - - /************************************************************************ - * Method: - * IRMAAudioStream::Write - * Purpose: - * Write audio data to Audio Services. - * - * NOTE: If the renderer loses packets and there is no loss - * correction, then the renderer should write the next packet - * using a meaningful start time. Audio Services will play - * silence where packets are missing. - */ - STDMETHOD(Write) (THIS_ - RMAAudioData* /*IN*/ pAudioData - ) PURE; - - /************************************************************************ - * Method: - * IRMAAudioStream::AddPreMixHook - * Purpose: - * Use this to "hook" audio stream data prior to the mixing. - * Set bDisableWrite to TRUE to prevent this audio stream data - * from being mixed with other audio stream data associated - * with this audio player. - */ - STDMETHOD(AddPreMixHook) (THIS_ - IRMAAudioHook* /*IN*/ pHook, - const BOOL /*IN*/ bDisableWrite - ) PURE; - - /************************************************************************ - * Method: - * IRMAAudioStream::RemovePreMixHook - * Purpose: - * Use this to remove an already added "hook". - */ - STDMETHOD(RemovePreMixHook) (THIS_ - IRMAAudioHook* /*IN*/ pHook - ) PURE; - - /************************************************************************ - * Method: - * IRMAAudioStream::AddDryNotification - * Purpose: - * Use this to add a notification response object to get - * notifications when audio stream is running dry. - */ - STDMETHOD(AddDryNotification) (THIS_ - IRMADryNotification* /*IN*/ pNotification - ) PURE; - - /************************************************************************ - * Method: - * IRMAAudioStream::GetStreamInfo - * Purpose: - * Use this to get information specific to this audio stream. - */ - STDMETHOD_(IRMAValues*,GetStreamInfo) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAAudioStream::GetAudioVolume - * Purpose: - * Get the audio stream's volume interface. This volume controls - * the volume level for this audio stream. - */ - STDMETHOD_(IRMAVolume*,GetAudioVolume) (THIS) PURE; -}; - -/**************************************************************************** - * - * Interface: - * - * IRMAAudioDevice - * - * Purpose: - * - * Object that exports audio device API - * This interface is currently to be used ONLY by the RMA engine - * internally. - * - * IID_IRMAAudioDevice: - * - * {00000703-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAAudioDevice, 0x00000703, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAAudioDevice - -DECLARE_INTERFACE_(IRMAAudioDevice, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAAudioDevice methods - */ - - /************************************************************************ - * Method: - * IRMAAudioDevice::Open - * Purpose: - * The caller calls this to open the audio device using the audio - * format given. - */ - STDMETHOD(Open) (THIS_ - const RMAAudioFormat* /*IN*/ pAudioFormat, - IRMAAudioDeviceResponse* /*IN*/ pStreamResponse) PURE; - - /************************************************************************ - * Method: - * IRMAAudioDevice::Close - * Purpose: - * The caller calls this to close the audio device. - */ - STDMETHOD(Close) (THIS_ - const BOOL /*IN*/ bFlush ) PURE; - - /************************************************************************ - * Method: - * IRMAAudioDevice::Resume - * Purpose: - * The caller calls this to start or resume audio playback. - */ - STDMETHOD(Resume) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAAudioDevice::Pause - * Purpose: - * The caller calls this to pause the audio device. If bFlush is - * TRUE, any buffers in the audio device will be flushed; otherwise, - * the buffers are played. - */ - STDMETHOD(Pause) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAAudioDevice::Write - * Purpose: - * The caller calls this to write an audio buffer. - */ - STDMETHOD(Write) (THIS_ - const RMAAudioData* /*IN*/ pAudioData) PURE; - - /************************************************************************ - * Method: - * IRMAAudioDevice::InitVolume - * Purpose: - * The caller calls this to inform the audio stream of the client's - * volume range. The audio stream maps the client's volume range - * into the audio device volume range. - * NOTE: This function returns TRUE if volume is supported by this - * audio device. - */ - STDMETHOD_(BOOL,InitVolume) (THIS_ - const UINT16 /*IN*/ uMinVolume, - const UINT16 /*IN*/ uMaxVolume) PURE; - - /************************************************************************ - * Method: - * IRMAAudioDevice::SetVolume - * Purpose: - * The caller calls this to set the audio device volume level. - */ - STDMETHOD(SetVolume) (THIS_ - const UINT16 /*IN*/ uVolume) PURE; - - /************************************************************************ - * Method: - * IRMAAudioDevice::GetVolume - * Purpose: - * The caller calls this to get the audio device volume level. - */ - STDMETHOD_(UINT16,GetVolume) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAAudioDevice::Reset - * Purpose: - * The caller calls this to reset the audio device. - */ - STDMETHOD(Reset) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAAudioDevice::Drain - * Purpose: - * The caller calls this to drain the audio device. - */ - STDMETHOD(Drain) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAAudioDevice::CheckFormat - * Purpose: - * The caller calls this to check the input format with the - * audio device format. - */ - STDMETHOD(CheckFormat) (THIS_ - const RMAAudioFormat* /*IN*/ pAudioFormat ) PURE; - - /************************************************************************ - * Method: - * IRMAAudioDevice::GetCurrentAudioTime - * Purpose: - * The caller calls this to get current system audio time. - */ - STDMETHOD(GetCurrentAudioTime) (THIS_ - REF(ULONG32) /*OUT*/ ulCurrentTime) PURE; -}; - -/**************************************************************************** - * - * Interface: - * IRMAAudioDeviceResponse - * - * Purpose: - * - * Object that exports audio device Response API - * This interface is currently to be used ONLY by the RMA engine - * internally. - * - * IID_IRMAAudioDeviceResponse: - * - * {00000704-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAAudioDeviceResponse, 0x00000704, 0x901, 0x11d1, 0x8b, 0x6, - 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAAudioDeviceResponse - -DECLARE_INTERFACE_(IRMAAudioDeviceResponse, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAAudioDeviceResponse methods - */ - - /************************************************************************ - * Method: - * IRMAAudioDeviceResponse::OnTimeSync - * Purpose: - * Notification interface provided by users of the IRMAAudioDevice - * interface. This method is called by the IRMAAudioDevice when - * audio playback occurs. - */ - STDMETHOD(OnTimeSync) (THIS_ - ULONG32 /*IN*/ ulTimeEnd) PURE; -}; - -/**************************************************************************** - * - * Interface: - * - * IRMAAudioHook - * - * Purpose: - * - * Clients must implement this interface to access pre- or post-mixed - * audio data. Use this interface to get post processed audio buffers and - * their associated audio format. - * - * IID_IRMAAudioHook: - * - * {00000705-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAAudioHook, 0x00000705, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAAudioHook - -DECLARE_INTERFACE_(IRMAAudioHook, IUnknown) -{ - /* - * IUnknown methods! - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAAudioHook methods - */ - /************************************************************************ - * Method: - * IRMAAudioHook::OnInit - * Purpose: - * Audio Services calls OnInit() with the audio data format of the - * audio data that will be provided in the OnBuffer() method. - */ - STDMETHOD(OnInit) (THIS_ - RMAAudioFormat* /*IN*/ pFormat) PURE; - - /************************************************************************ - * Method: - * IRMAAudioHook::OnBuffer - * Purpose: - * Audio Services calls OnBuffer() with audio data packets. The - * renderer should not modify the data in the IRMABuffer part of - * pAudioInData. If the renderer wants to write a modified - * version of the data back to Audio Services, then it should - * create its own IRMABuffer, modify the data and then associate - * this buffer with the pAudioOutData->pData member. - */ - STDMETHOD(OnBuffer) (THIS_ - RMAAudioData* /*IN*/ pAudioInData, - RMAAudioData* /*OUT*/ pAudioOutData) PURE; -}; - -/**************************************************************************** - * - * Interface: - * - * IRMAAudioStreamInfoResponse - * - * Purpose: - * - * Clients must implement this interface when interested in receiving - * notification of the total number of streams associated with this - * audio player. - * - * IID_IRMAAudioStreamInfoResponse: - * - * {00000706-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAAudioStreamInfoResponse, 0x00000706, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAAudioStreamInfoResponse - -DECLARE_INTERFACE_(IRMAAudioStreamInfoResponse, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAAudioStreamInfoResponse methods - */ - - /************************************************************************ - * Method: - * IRMAAudioStreamInfoResponse::OnStream - * Purpose: - * The client implements this to get notification of streams - * associated with this player. Use - * AudioPlayer::SetStreamInfoResponse() to register your - * implementation with the AudioPlayer. Once player has been - * initialized, it will call OnStream() multiple times to pass all - * the streams. Since a stream can be added mid-presentation, - * IRMAAudioStreamInfoResponse object should be written to handle - * OnStream() in the midst of the presentation as well. - */ - STDMETHOD(OnStream) (THIS_ - IRMAAudioStream* /*IN*/ pAudioStream) PURE; -}; - -/**************************************************************************** - * - * Interface: - * - * IRMAVolume - * - * Purpose: - * - * This interface provides access to Audio Services volume control. Use this - * interface to get, set, or receive notifications of volume changes. Audio - * Services implements IRMAVolume for IRMAAudioPlayer, IRMAAudioStream and - * for the audio device. Clients can use the IRMAVolume interface to get/set - * volume levels of each audio stream, to get/set volume levels for the - * audio player's mixed data, or to get/set the volume levels of the audio - * device. See AudioStream::GetStreamVolume() (TBD), AudioPlayer:: - * GetAudioVolume() and AudioPlayer::GetDeviceVolume(). - * - * IID_IRMAVolume: - * - * {00000707-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAVolume, 0x00000707, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAVolume - -DECLARE_INTERFACE_(IRMAVolume, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAVolume methods - */ - /************************************************************************ - * Method: - * IRMAVolume::SetVolume - * Purpose: - * Call this to set the volume level. - */ - STDMETHOD(SetVolume) (THIS_ - const UINT16 /*IN*/ uVolume ) PURE; - - /************************************************************************ - * Method: - * IRMAVolume::GetVolume - * Purpose: - * Call this to get the current volume level. - */ - STDMETHOD_(UINT16,GetVolume) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAVolume::SetMute - * Purpose: - * Call this to mute the volume. - */ - STDMETHOD(SetMute) (THIS_ - const BOOL /*IN*/ bMute ) PURE; - - /************************************************************************ - * Method: - * IRMAVolume::GetMute - * Purpose: - * Call this to determine if the volume is muted. - * - */ - STDMETHOD_(BOOL,GetMute) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAVolume::AddAdviseSink - * Purpose: - * Call this to register an IRMAVolumeAdviseSink. The advise sink - * methods: OnVolumeChange() and OnMuteChange() are called when - * ever IRMAVolume::SetVolume() and IRMAVolume::SetMute() are - * called. - */ - STDMETHOD(AddAdviseSink) (THIS_ - IRMAVolumeAdviseSink* /*IN*/ pSink - ) PURE; - - /************************************************************************ - * Method: - * IRMAVolume::RemoveAdviseSink - * Purpose: - * Call this to unregister an IRMAVolumeAdviseSink. Use this when - * you are no longer interested in receiving volume or mute change - * notifications. - */ - STDMETHOD(RemoveAdviseSink) (THIS_ - IRMAVolumeAdviseSink* /*IN*/ pSink - ) PURE; -}; - -/**************************************************************************** - * - * Interface: - * - * IRMAVolumeAdviseSink - * - * Purpose: - * - * This interface provides access to notifications of volume changes. A - * client must implement this interface if they are interested in receiving - * notifications of volume level changes or mute state changes. A client must - * register their volume advise sink using IRMAVolume::AddAdviseSink(). - * See the IRMAVolume interface. - * - * IID_IRMAVolumeAdviseSink: - * - * {00000708-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAVolumeAdviseSink, 0x00000708, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAVolumeAdviseSink - -DECLARE_INTERFACE_(IRMAVolumeAdviseSink, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAVolumeAdviseSink methods - */ - - /************************************************************************ - * Method: - * IRMAVolumeAdviseSink::OnVolumeChange - * Purpose: - * This interface is called whenever the associated IRMAVolume - * SetVolume() is called. - */ - STDMETHOD(OnVolumeChange) (THIS_ - const UINT16 uVolume - ) PURE; - - /************************************************************************ - * Method: - * IRMAVolumeAdviseSink::OnMuteChange - * Purpose: - * This interface is called whenever the associated IRMAVolume - * SetMute() is called. - * - */ - STDMETHOD(OnMuteChange) (THIS_ - const BOOL bMute - ) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMADryNotification - * - * Purpose: - * - * Audio Renderer should implement this if it needs notification when the - * audio stream is running dry. - * - * IID_IRMADryNotification: - * - * {00000709-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMADryNotification, 0x00000709, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMADryNotification - -DECLARE_INTERFACE_(IRMADryNotification, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMADryNotification methods - */ - - /************************************************************************ - * Method: - * IRMADryNotification::OnDryNotification - * Purpose: - * This function is called when it is time to write to audio device - * and there is not enough data in the audio stream. The renderer can - * then decide to add more data to the audio stream. This should be - * done synchronously within the call to this function. - * It is OK to not write any data. Silence will be played instead. - */ - STDMETHOD(OnDryNotification) (THIS_ - UINT32 /*IN*/ ulCurrentStreamTime, - UINT32 /*IN*/ ulMinimumDurationRequired - ) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAAudioDeviceManager - * - * Purpose: - * - * Allows the default audio device to be replaced. - * - * IID_IRMAAudioDeviceManager: - * - * {0000070A-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAAudioDeviceManager, 0x0000070A, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAAudioDeviceManager - -DECLARE_INTERFACE_(IRMAAudioDeviceManager, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAAudioDeviceManager methods - */ - - /********************************************************************** - * Method: - * IRMAAudioDeviceManager::Replace - * Purpose: - * This is used to replace the default implementation of the audio - * device by the given audio device interface. - */ - STDMETHOD(Replace) (THIS_ - IRMAAudioDevice* /*IN*/ pAudioDevice) PURE; - - /********************************************************************** - * Method: - * IRMAAudioDeviceManager::Remove - * Purpose: - * This is used to remove the audio device given to the manager in - * the earlier call to Replace. - */ - STDMETHOD(Remove) (THIS_ - IRMAAudioDevice* /*IN*/ pAudioDevice) PURE; - - /************************************************************************ - * Method: - * IRMAAudioDeviceManager::AddFinalHook - * Purpose: - * One last chance to modify data being written to the audio device. - * This hook allows the user to change the audio format that - * is to be written to the audio device. This can be done in call - * to OnInit() in IRMAAudioHook. - */ - STDMETHOD(SetFinalHook) (THIS_ - IRMAAudioHook* /*IN*/ pHook - ) PURE; - - /************************************************************************ - * Method: - * IRMAAudioDeviceManager::RemoveFinalHook - * Purpose: - * Remove final hook - */ - STDMETHOD(RemoveFinalHook) (THIS_ - IRMAAudioHook* /*IN*/ pHook - ) PURE; - - /************************************************************************ - * Method: - * IRMAAudioDeviceManager::GetAudioFormat - * Purpose: - * Returns the audio format in which the audio device is opened. - * This function will fill in the pre-allocated RMAAudioFormat - * structure passed in. - */ - STDMETHOD(GetAudioFormat) (THIS_ - RMAAudioFormat* /*IN/OUT*/pAudioFormat) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAAudioCrossFade - * - * Purpose: - * - * This interface can be used to cross-fade two audio streams. It is exposed - * by IRMAAudioPlayer - * - * IID_IRMAAudioCrossFade: - * - * {0000070B-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAAudioCrossFade, 0x0000070B, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAAudioCrossFade - -DECLARE_INTERFACE_(IRMAAudioCrossFade, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAAudioCrossFade methods - */ - - /************************************************************************ - * Method: - * IRMAAudioCrossFade::CrossFade - * Purpose: - * Cross-fade two audio streams. - * pStreamFrom - Stream to be cross faded from - * pStreamTo - Stream to be cross faded to - * ulFromCrossFadeStartTime- "From" Stream time when cross fade is - * to be started - * ulToCrossFadeStartTime - "To" Stream time when cross fade is to - * be started - * ulCrossFadeDuration - Duration over which cross-fade needs - * to be done - * - */ - STDMETHOD(CrossFade) (THIS_ - IRMAAudioStream* pStreamFrom, - IRMAAudioStream* pStreamTo, - UINT32 ulFromCrossFadeStartTime, - UINT32 ulToCrossFadeStartTime, - UINT32 ulCrossFadeDuration) PURE; -}; - -/**************************************************************************** - * - * Interface: - * - * IRMAAudioStream2 - * - * Purpose: - * - * This interface contains some last-minute added audio stream functions - * - * IID_IRMAAudioStream2: - * - * {0000070C-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAAudioStream2, 0x0000070C, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAAudioStream2 - -DECLARE_INTERFACE_(IRMAAudioStream2, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAAudioStream2 methods - */ - /************************************************************************ - * Method: - * IRMAAudioStream2::RemoveDryNotification - * Purpose: - * Use this to remove itself from the notification response object - * during the stream switching. - */ - STDMETHOD(RemoveDryNotification) (THIS_ - IRMADryNotification* /*IN*/ pNotification - ) PURE; - - /************************************************************************ - * Method: - * IRMAAudioStream2::GetAudioFormat - * Purpose: - * Returns the input audio format of the data written by the - * renderer. This function will fill in the pre-allocated - * RMAAudioFormat structure passed in. - */ - STDMETHOD(GetAudioFormat) (THIS_ - RMAAudioFormat* /*IN/OUT*/pAudioFormat) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAAudioPushdown - * - * Purpose: - * - * This interface can be used to setup the audio pushdown time. - * - * IID_IRMAAudioPushdown: - * - * {0000070D-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAAudioPushdown, 0x0000070D, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAAudioPushdown - -DECLARE_INTERFACE_(IRMAAudioPushdown, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAAudioPushdown methods - */ - /************************************************************************ - * Method: - * IRMAAudioPushdown::SetAudioPushdown - * Purpose: - * Use this to set the minimum audio pushdown value in ms. - * This is the amount of audio data that is being written - * to the audio device before starting playback. - */ - STDMETHOD(SetAudioPushdown) (THIS_ - UINT32 /*IN*/ ulAudioPushdown - ) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAAudioHookManager - * - * Purpose: - * - * This interface can be used to add a hook at the audio device layer. - * - * IID_IRMAAudioHookManager: - * - * {0000070E-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAAudioHookManager, 0x0000070E, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAAudioHookManager - -DECLARE_INTERFACE_(IRMAAudioHookManager, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAAudioHookManager methods - */ - /************************************************************************ - * Method: - * IRMAAudioHookManager::AddHook - * Purpose: - * Use this to add a hook - */ - STDMETHOD(AddHook) (THIS_ - IRMAAudioHook* /*IN*/ pHook - ) PURE; - - /************************************************************************ - * Method: - * IRMAAudioHookManager::RemoveHook - * Purpose: - * Use this to remove a hook - */ - STDMETHOD(RemoveHook) (THIS_ - IRMAAudioHook* /*IN*/ pHook - ) PURE; -}; - -#endif /* _RMAAUSVC_H_ */ diff --git a/include/realmedia/rmaauth.h b/include/realmedia/rmaauth.h deleted file mode 100644 index 866bf87bf..000000000 --- a/include/realmedia/rmaauth.h +++ /dev/null @@ -1,342 +0,0 @@ -/**************************************************************************** - * - * $Id: rmaauth.h 7 2003-05-30 02:18:02Z gabest $ - * - * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved. - * - * http://www.real.com/devzone - * - * This program contains proprietary - * information of Progressive Networks, Inc, and is licensed - * subject to restrictions on use and distribution. - * - * Authentication and password interfaces. - * - */ - -#ifndef _RMAAUTH_H_ -#define _RMAAUTH_H_ - -/* - * Forward declarations of some interfaces defined or used here-in. - */ -typedef _INTERFACE IRMAAuthenticator IRMAAuthenticator; -typedef _INTERFACE IRMAAuthenticatorResponse IRMAAuthenticatorResponse; -typedef _INTERFACE IRMAAuthenticatorRequest IRMAAuthenticatorRequest; -typedef _INTERFACE IRMAPassword IRMAPassword; -typedef _INTERFACE IRMAAuthenticationManagerResponse IRMAAuthenticationManagerResponse; -typedef _INTERFACE IRMAValues IRMAValues; -typedef _INTERFACE IRMABuffer IRMABuffer; - -/**************************************************************************** - * - * Interface: - * - * IRMAAuthenticator - * - * Purpose: - * - * Provide a means of authenticating users. - * - * IID_IRMAAuthenticator: - * - * {00001800-0901-11d1-8B06-00A024406D59} - * - */ - -DEFINE_GUID(IID_IRMAAuthenticator, 0x00001800, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#define CLSID_IRMAAuthenticator IID_IRMAAuthenticator - -#undef INTERFACE -#define INTERFACE IRMAAuthenticator - -DECLARE_INTERFACE_(IRMAAuthenticator, IUnknown) -{ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * InitAuthenticator is called by the creator of the Authenticator - * object in order to pass it an IRMAAuthenticatorRequest object, - * usually implemented by the creator itself. - */ - STDMETHOD(InitAuthenticator) (THIS_ - IRMAAuthenticatorRequest* pRequest) PURE; - /* - * Authenticate is called by a file object (and others??) - * when it wants to ask the creator, presumably an FS Manager, - * for authorization to open it's file. - * - * Authenticate will call IRMAAuthenticateResponse::AuthenticateDone - * when done with PNR_OK or an error. - * - * File objects will presumably perform the Authenticate response as - * part of their Init() call, and not call InitDone until they receive - * a response one way or the other. - */ - STDMETHOD(Authenticate) (THIS_ - IRMAValues* pValues, - IRMAAuthenticatorResponse* pResponse) PURE; - - /* GenerateAuthRequest is called by the creator of this object - * when they want to send an authentication request to someone. - */ - STDMETHOD(GenerateAuthRequest) (THIS_ - UINT32 authType, - REF(IRMAValues*) pValues) PURE; - /* - * AuthValuesReady is called by IRMAAuthenticatorRequest when it - * is ready to respond to a GetAuthValues request. - */ - STDMETHOD(AuthValuesReady) (THIS_ - PN_RESULT result, - IRMAValues* pValues) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAAuthenticatorResponse - * - * Purpose: - * - * Response object for the Authenticator class. - * - * IID_IRMAAuthenticatorResponse: - * - * {00001801-0901-11d1-8B06-00A024406D59} - * - */ - -DEFINE_GUID(IID_IRMAAuthenticatorResponse, 0x00001801, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAAuthenticatorResponse - -DECLARE_INTERFACE_(IRMAAuthenticatorResponse, IUnknown) -{ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* AuthenticateDone is called by an IRMAAuthenticator when it has - * finished it's authorization steps. If the result is PNR_OK, - * then the values contain authorization information as generated by - * IRMAPassword. - */ - STDMETHOD(AuthenticateDone) (THIS_ PN_RESULT result, - IRMAValues* pAuthResponseValues) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAAuthenticatorRequest - * - * Purpose: - * - * Request object for the Authenticator class. - * - * IID_IRMAAuthenticatorRequest: - * - * {00001802-0901-11d1-8B06-00A024406D59} - * - */ - -DEFINE_GUID(IID_IRMAAuthenticatorRequest, 0x00001802, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAAuthenticatorRequest - -DECLARE_INTERFACE_(IRMAAuthenticatorRequest, IUnknown) -{ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* GetAuthValues is called by the Authenticator object when it - * needs to know the authorization info for this transaction. - * - * This object should call AuthValuesReady when ready. - */ - STDMETHOD(GetAuthValues) (THIS_ IRMAValues* pOrigValues) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAPassword - * - * Purpose: - * - * Provides a general password facility for storing of passwords in - * an encrypted form and a facility for verifying passwords securely - * over the network. - * - * IID_IRMAPassword: - * - * {00001700-0901-11d1-8B06-00A024406D59} - * - */ - -#define PN_AUTH_BASIC 1 -#define PN_AUTH_DIGEST 2 -#define PN_AUTH_RN5 3 -#define PN_AUTH_NTLM 4 - -DEFINE_GUID(IID_IRMAPassword, 0x00001700, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAPassword - -DECLARE_INTERFACE_(IRMAPassword, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAPassword methods - */ - - STDMETHOD(Crypt) (THIS_ IRMAValues* pAuthentication) PURE; - STDMETHOD(Verify) (THIS_ IRMAValues* pAuth1, IRMAValues* pAuth2) PURE; - - STDMETHOD(AsString) (THIS_ IRMAValues* pAuth, REF(IRMABuffer*) pBuffer) PURE; - STDMETHOD(AsValues) (THIS_ const char* str, IRMAValues* pValues) PURE; - - /* - * CreateBuffer is provided for the convenince of external users, - * who would otherwise have to get a context and common class factory - * just to create IRMABuffers. This method can be used instead, but - * is not advisable if other means are available. - */ - STDMETHOD(CreateBuffer) (THIS_ REF(IRMABuffer*) pBuffer) PURE; - - /* - * Ditto for CreateValues - */ - STDMETHOD(CreateValues) (THIS_ REF(IRMAValues*) pValues) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAAuthenticationManager - * - * Purpose: - * - * Provide a means of authenticating users. - * - * IID_IRMAAuthenticator: - * - * {00001a00-0901-11d1-8B06-00A024406D59} - * - */ - -DEFINE_GUID(IID_IRMAAuthenticationManager, 0x00001a00, 0x901, 0x11d1, - 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAAuthenticationManager - -DECLARE_INTERFACE_(IRMAAuthenticationManager, IUnknown) -{ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* HandleAuthenticationRequest is called when the core wants us to get - * a username and password. - */ - STDMETHOD(HandleAuthenticationRequest) ( - THIS_ IRMAAuthenticationManagerResponse* pResponse) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAAuthenticationManagerResponse - * - * Purpose: - * - * Response object for IRMAAuthenticationManager. - * - * IID_IRMAAuthenticator: - * - * {00001a01-0901-11d1-8B06-00A024406D59} - * - */ - -DEFINE_GUID(IID_IRMAAuthenticationManagerResponse, 0x00001a01, 0x901, 0x11d1, - 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - - -#undef INTERFACE -#define INTERFACE IRMAAuthenticationManagerResponse - -DECLARE_INTERFACE_(IRMAAuthenticationManagerResponse, IUnknown) -{ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* HandleAuthenticationRequest is called when the core wants us to get - * a username and password. - */ - STDMETHOD(AuthenticationRequestDone) (THIS_ - PN_RESULT result, - const char* pUserName, - const char* pPassword) PURE; -}; - -#ifdef _MACINTOSH -#pragma export on -#endif - -STDAPI CreatePassword(IUnknown** /* OUT */ ppIUnknown); - -#ifdef _MACINTOSH -#pragma export off -#endif - -#endif /* _RMAAUTH_H_ */ diff --git a/include/realmedia/rmaauthn.h b/include/realmedia/rmaauthn.h deleted file mode 100644 index 4f2e39b7f..000000000 --- a/include/realmedia/rmaauthn.h +++ /dev/null @@ -1,716 +0,0 @@ -/**************************************************************************** - * - * $Id: rmaauthn.h 7 2003-05-30 02:18:02Z gabest $ - * - * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved. - * - * http://www.real.com/devzone - * - * This program contains proprietary - * information of Progressive Networks, Inc, and is licensed - * subject to restrictions on use and distribution. - * - * - * RealMedia Architecture Interface. - * - */ - -#ifndef _RMAAUTHN_H_ -#define _RMAAUTHN_H_ - -/* - * Forward declarations of some interfaces defined or used here-in. - */ -typedef _INTERFACE IUnknown IUnknown; -typedef _INTERFACE IRMACredRequest IRMACredRequest; -typedef _INTERFACE IRMACredRequestResponse IRMACredRequestResponse; -typedef _INTERFACE IRMAClientAuthConversation IRMAClientAuthConversation; -typedef _INTERFACE IRMAClientAuthResponse IRMAClientAuthResponse; -typedef _INTERFACE IRMAServerAuthConversation IRMAServerAuthConversation; -typedef _INTERFACE IRMAServerAuthResponse IRMAServerAuthResponse; -typedef _INTERFACE IRMAUserContext IRMAUserContext; -typedef _INTERFACE IRMAUserProperties IRMAUserProperties; -typedef _INTERFACE IRMAUserImpersonation IRMAUserImpersonation; -typedef _INTERFACE IRMAChallenge IRMAChallenge; -typedef _INTERFACE IRMAChallengeResponse IRMAChallengeResponse; -typedef _INTERFACE IRMARequest IRMARequest; -typedef _INTERFACE IRMABuffer IRMABuffer; -typedef _INTERFACE IRMAValues IRMAValues; - - -/**************************************************************************** - * - * Interface: - * - * IRMACredRequest - * - * Purpose: - * - * This is queried from the response interface passed into - * IRMAClientAuthConversation::MakeResponse. MakeResponse - * uses it to request the current user to enter their credentials. - * - * IRMACredRequest: - * - * {00002801-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMACredRequest, 0x00002801, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMACredRequest - -DECLARE_INTERFACE_(IRMACredRequest, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMACredRequest::GetCredentials - * Purpose: - * - * Call this to request the credentials. Usually presents UI to - * the user asking for username and password. - * - * While ignored at this time, pValuesCredentialRequest should - * contain CString properties that describe the reason for the - * request. (like the URL, the Realm, the Auth protocol, and how - * secure it is, etc..) In the future this data will be displayed - * to the user. - * - */ - STDMETHOD(GetCredentials) - ( - THIS_ - IRMACredRequestResponse* pCredRequestResponseRequester, - IRMAValues* pValuesCredentialRequest - ) PURE; - -}; - -/**************************************************************************** - * - * Interface: - * - * IRMACredRequestResponse - * - * Purpose: - * - * This is implemented by a client authenticator in order to receive - * the credentials requested in IRMACredRequest::GetCredentials - * - * IRMACredRequestResponse: - * - * {00002800-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMACredRequestResponse, 0x00002800, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMACredRequestResponse - -DECLARE_INTERFACE_(IRMACredRequestResponse, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMACredRequestResponse::CredentialsReady - * Purpose: - * - * Reports the success or failure of - * IRMACredRequest::GetCredentials - * - * If successful pValuesCredentials contains the requested - * credentials. (usually CString:Username and CString:Password) - * - */ - STDMETHOD(CredentialsReady) - ( - THIS_ - PN_RESULT ResultStatus, - IRMAValues* pValuesCredentials - ) PURE; - -}; - -/**************************************************************************** - * - * Interface: - * - * IRMAClientAuthConversation - * - * Purpose: - * - * This is implemented by a client authenticator in order to perform - * the client side of an authentication protocol. - * - * IRMAClientAuthConversation: - * - * {00002803-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAClientAuthConversation, 0x00002803, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -/* - * The IRMACommonClassFactory supports creating an instance - * of this object. - */ -#define CLSID_CRMAClientAuthenticator IID_IRMAClientAuthConversation - -#undef INTERFACE -#define INTERFACE IRMAClientAuthConversation - -DECLARE_INTERFACE_(IRMAClientAuthConversation, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAClientAuthConversation::MakeResponse - * Purpose: - * - * Call this when a challenge is received from the server. - * - * pRequestChallengeHeaders should contain the server challenge. - * - */ - STDMETHOD(MakeResponse) - ( - THIS_ - IRMAClientAuthResponse* pClientAuthResponseRequester, - IRMARequest* pRequestChallengeHeaders - ) PURE; - - /************************************************************************ - * Method: - * IRMAClientAuthConversation::IsDone - * Purpose: - * - * Call this to determine whether the conversation is complete. - * (some protocols have more then one message exchange.) - * - */ - STDMETHOD_(BOOL,IsDone)(THIS) PURE; - - /************************************************************************ - * Method: - * IRMAClientAuthConversation::Authenticated - * Purpose: - * - * Call this to signal the authenticator that the conversation - * just completed succeeded or failed. - * - */ - STDMETHOD(Authenticated)(THIS_ BOOL bAuthenticated) PURE; -}; - -/**************************************************************************** - * - * Interface: - * - * IRMAClientAuthResponse - * - * Purpose: - * - * This is implemented by the client core in order to receive the - * response generated by IRMAClientAuthConversation::MakeResponse - * - * IRMAClientAuthResponse: - * - * {00002802-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAClientAuthResponse, 0x00002802, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAClientAuthResponse - -DECLARE_INTERFACE_(IRMAClientAuthResponse, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAClientAuthResponse::ResponseReady - * Purpose: - * - * Reports the success or failure of - * IRMAClientAuthConversation::MakeResponse - * - * pRequestResponseHeaders should be the same Request object - * that was passed into MakeResponse, it should contain - * CString values for each MimeHeader it wishes to send to - * the Server. - * - */ - STDMETHOD(ResponseReady) - ( - THIS_ - PN_RESULT ResultStatus, - IRMARequest* pRequestResponseHeaders - ) PURE; - -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAServerAuthConversation - * - * Purpose: - * - * This is implemented by a server authenticator in order to perform - * the server side of an authentication protocol. - * - * IRMAServerAuthConversation: - * - * {00002805-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAServerAuthConversation, 0x00002805, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -/* - * The IRMACommonClassFactory supports creating an instance - * of this object. - */ -#define CLSID_CRMAServerAuthenticator IID_IRMAServerAuthResponse - -#undef INTERFACE -#define INTERFACE IRMAServerAuthConversation - -DECLARE_INTERFACE_(IRMAServerAuthConversation, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAServerAuthConversation::MakeChallenge - * Purpose: - * - * Call this to create a challenge for a client. If the request - * passed in does not contain a respose from the client, then it - * will generate the initial challenge. - * - * pRequestResponseHeaders is the request for a secured URL. If - * this is the initial request for the URL it probably does not - * have any credentials from the client. - * - */ - STDMETHOD(MakeChallenge) - ( - THIS_ - IRMAServerAuthResponse* pServerAuthResponseRequester, - IRMARequest* pRequestResponseHeaders - ) PURE; - - /************************************************************************ - * Method: - * IRMAServerAuthConversation::IsAuthenticated - * Purpose: - * - * Call this to determine whether the last response from the - * client completed the authentication successfully. - * - */ - STDMETHOD_(BOOL,IsAuthenticated)(THIS) PURE; - - /************************************************************************ - * Method: - * IRMAServerAuthConversation::GetUserContext - * Purpose: - * - * Call this to retrieve the Context of the user that completed - * authentication successfully. - * - * If successful pUnknownUser is a valid context - * - */ - STDMETHOD(GetUserContext)(THIS_ REF(IUnknown*) pUnknownUser) PURE; - -}; - -/**************************************************************************** - * - * Interface: - * - * IRMAServerAuthResponse - * - * Purpose: - * - * This is implemented by various server plugins in order to receive the - * challenge generated by IRMAServerAuthConversation::MakeChallenge - * - * IRMAServerAuthResponse: - * - * {00002804-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAServerAuthResponse, 0x00002804, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAServerAuthResponse - -DECLARE_INTERFACE_(IRMAServerAuthResponse, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAServerAuthResponse::ChallengeReady - * Purpose: - * - * Reports the success or failure of - * IRMAServerAuthConversation::MakeChallenge - * - * pRequestChallengeHeaders should be the same Request object - * that was passed into MakeChallenge, it should contain - * CString values for each MimeHeader it wishes to send to - * the client. - * - */ - STDMETHOD(ChallengeReady) - ( - THIS_ - PN_RESULT ResultStatus, - IRMARequest* pRequestChallengeHeaders - ) PURE; - -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAUserContext - * - * Purpose: - * - * This is implemented by a user context in order to provide - * access to information about the currently authenticated user. - * - * IRMAUserContext: - * - * {00002806-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAUserContext, 0x00002806, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAUserContext - -DECLARE_INTERFACE_(IRMAUserContext, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAUserContext::IsMemberOf - * Purpose: - * - * Call this to determine whether the authenticated user - * is a member of the specified group. - * - */ - STDMETHOD(IsMemberOf)(THIS_ IRMABuffer* pBufferGroupID) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAUserProperties - * - * Purpose: - * - * This is implemented by a user context in order to provide - * access to properties of the currently authenticated user. - * - * IRMAUserProperties: - * - * {00002807-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAUserProperties, 0x00002807, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAUserProperties - -DECLARE_INTERFACE_(IRMAUserProperties, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - - /************************************************************************ - * Method: - * IRMAUserProperties::GetPrincipalID - * Purpose: - * - * Call this to determine the principalID of the authenticated user. - * - */ - STDMETHOD(GetPrincipalID)(THIS_ REF(IRMABuffer*) pBufferPrincipalID) PURE; - - /************************************************************************ - * Method: - * IRMAUserProperties::GetAuthorityName - * Purpose: - * - * Call this to determine the authority name that authorized the - * authenticated user. (realm or domain name) - * - */ - STDMETHOD(GetAuthorityName)(THIS_ REF(IRMABuffer*) pBufferAuthorityName) PURE; - -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAUserImpersonation - * - * Purpose: - * - * This can be implemented by a user context in order to provide - * the ability to have the server impersonate the currently authenticated - * user. - * - * IRMAUserImpersonation: - * - * {00002808-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAUserImpersonation, 0x00002808, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAUserImpersonation - -DECLARE_INTERFACE_(IRMAUserImpersonation, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAUserImpersonation::Start - * Purpose: - * - * Call this to impersonate the authenticated user. - * - */ - STDMETHOD(Start)(THIS) PURE; - - /************************************************************************ - * Method: - * IRMAUserImpersonation::Stop - * Purpose: - * - * Call this to stop impersonating the authenticated user. - * - */ - STDMETHOD(Stop)(THIS) PURE; - -}; - -/**************************************************************************** - * - * Interface: - * - * IRMAChallenge - * - * Purpose: - * - * This is implemented by the server core in order to allow - * additional exchanges of information with the client without - * creating a new request. (It is stored in the IRMARequest object - * and can be retrieved by calling IRMARequestContext::GetRequester() - * if it is absent then the protocol that this request was made on - * does not support multi-message authentication (PNA doesn't) ) - * - * IRMAChallenge: - * - * {0000280A-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAChallenge, 0x0000280A, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAChallenge - -DECLARE_INTERFACE_(IRMAChallenge, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAChallenge::SendChallenge - * Purpose: - * - * Call this to request additional information from the client. - * - * pRequestChallenge should be the same Request object - * that was passed into MakeChallenge, it should contain - * CString values for each MimeHeader it wishes to send to - * the client. - * - */ - STDMETHOD(SendChallenge) - ( - THIS_ - IRMAChallengeResponse* pChallengeResponseSender, - IRMARequest* pRequestChallenge - ) PURE; - -}; - -/**************************************************************************** - * - * Interface: - * - * IRMAChallengeResponse - * - * Purpose: - * - * This is implemented by a server authenticator in order to - * receive the Response returned by the client in response to - * IRMAChallenge::SendChallenge. - * - * IRMAChallengeResponse: - * - * {00002809-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAChallengeResponse, 0x00002809, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAChallengeResponse - -DECLARE_INTERFACE_(IRMAChallengeResponse, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAChallengeResponse::ResponseReady - * Purpose: - * - * Called this to return the additional information requested - * from IRMAChallenge::SendChallenge. - * - * pRequestResponse should be the same Request object - * that was passed into MakeChallenge and SendChallenge. - * - */ - STDMETHOD(ResponseReady) - ( - THIS_ - IRMARequest* pRequestResponse - ) PURE; - -}; - -#endif //!_RMAAUTHN_H_ diff --git a/include/realmedia/rmacfg.h b/include/realmedia/rmacfg.h deleted file mode 100644 index d2fdde3ee..000000000 --- a/include/realmedia/rmacfg.h +++ /dev/null @@ -1,166 +0,0 @@ -/**************************************************************************** - * - * $Id: rmacfg.h 7 2003-05-30 02:18:02Z gabest $ - * - * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved. - * - * http://www.real.com/devzone - * - * This program contains proprietary - * information of Progressive Networks, Inc, and is licensed - * subject to restrictions on use and distribution. - * - * Server Configuration File Interface - * - */ - -#ifndef _RMACFG_H_ -#define _RMACFG_H_ - -typedef _INTERFACE IRMABuffer IRMABuffer; - -/**************************************************************************** - * - * Interface: - * - * IRMAConfigFile - * - * Purpose: - * - * IID_IRMAConfigFile: - * - * {00001c00-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAConfigFile, 0x00001c00, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAConfigFile - -DECLARE_INTERFACE_(IRMAConfigFile, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAConfigFile methods - */ - /************************************************************************ - * Method: - * IRMAConfigFile::LoadFrom - * Purpose: - * - * LoadFrom tells the server to load the config file specified, - * and sets that file as the default for future Reloads and Saves - */ - STDMETHOD(LoadFrom) (THIS_ - IRMABuffer* filename) PURE; - - /************************************************************************ - * Method: - * IRMAConfigFile::Reload - * Purpose: - * - * Reload causes the current default config file to be reloaded. - */ - STDMETHOD(Reload) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAConfigFile::Save - * Purpose: - * - * Save causes the current configuration to be written to the - * current default file. - */ - STDMETHOD(Save) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAConfigFile::SaveAs - * Purpose: - * - * SaveAs writes the configuration to the named file, and sets that - * file as the default. - */ - STDMETHOD(SaveAs) (THIS_ - IRMABuffer* pFilename) PURE; - - /************************************************************************ - * Method: - * IRMAConfigFile::GetFilename - * Purpose: - * - * GetFilename returns the current default file - */ - STDMETHOD(GetFilename) (THIS_ - REF(IRMABuffer*) pFilename) PURE; - - /************************************************************************ - * Method: - * IRMAConfigFile::SetFilename - * Purpose: - * - * SetFilename sets the current default file, but does not read it - * or change its contents. - */ - STDMETHOD(SetFilename) (THIS_ - IRMABuffer* pFilename) PURE; -}; - -/**************************************************************************** - * - * Interface: - * - * IRMARegConfig - * - * Purpose: - * - * IID_IRMARegConfig: - * - * {00001c01-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMARegConfig, 0x00001c01, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMARegConfig - -DECLARE_INTERFACE_(IRMARegConfig, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMARegConfig::WriteKey - * Purpose: - * - * Write out the registry from the passed in keyname to the - * currently active permanent config storage area (ex. config file, - * registry). - */ - STDMETHOD(WriteKey) (THIS_ - const char* pKeyName) PURE; - -}; - -#endif /* _RMACFG_H_ */ diff --git a/include/realmedia/rmaclsnk.h b/include/realmedia/rmaclsnk.h deleted file mode 100644 index ac66fe0b4..000000000 --- a/include/realmedia/rmaclsnk.h +++ /dev/null @@ -1,191 +0,0 @@ -/**************************************************************************** - * - * $Id: rmaclsnk.h 7 2003-05-30 02:18:02Z gabest $ - * - * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved. - * - * http://www.real.com/devzone - * - * This program contains proprietary - * information of Progressive Networks, Inc, and is licensed - * subject to restrictions on use and distribution. - * - * - * Client Advise Sink Interfaces - * - */ - -#ifndef _RMACLSNK_H_ -#define _RMACLSNK_H_ - -/* - * Forward declarations of some interfaces defined or used here-in. - */ -typedef _INTERFACE IRMAClientAdviseSink IRMAClientAdviseSink; - -/**************************************************************************** - * - * Interface: - * - * IRMAClientAdviseSink - * - * Purpose: - * - * Interface supplied by client to core to receive notifications of - * status changes. - * - * IID_IRMAClientAdviseSink: - * - * {00000B00-0901-11d1-8B06-00A024406D59} - * - */ - -DEFINE_GUID(IID_IRMAClientAdviseSink, 0x00000B00, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAClientAdviseSink - -DECLARE_INTERFACE_(IRMAClientAdviseSink, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAClientAdviseSink methods - */ - - /************************************************************************ - * Method: - * IRMAClientAdviseSink::OnPosLength - * Purpose: - * Called to advise the client that the position or length of the - * current playback context has changed. - */ - STDMETHOD(OnPosLength) (THIS_ - UINT32 ulPosition, - UINT32 ulLength) PURE; - - /************************************************************************ - * Method: - * IRMAClientAdviseSink::OnPresentationOpened - * Purpose: - * Called to advise the client a presentation has been opened. - */ - STDMETHOD(OnPresentationOpened) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAClientAdviseSink::OnPresentationClosed - * Purpose: - * Called to advise the client a presentation has been closed. - */ - STDMETHOD(OnPresentationClosed) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAClientAdviseSink::OnStatisticsChanged - * Purpose: - * Called to advise the client that the presentation statistics - * have changed. - */ - STDMETHOD(OnStatisticsChanged) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAClientAdviseSink::OnPreSeek - * Purpose: - * Called by client engine to inform the client that a seek is - * about to occur. The render is informed the last time for the - * stream's time line before the seek, as well as the first new - * time for the stream's time line after the seek will be completed. - * - */ - STDMETHOD(OnPreSeek) (THIS_ - ULONG32 ulOldTime, - ULONG32 ulNewTime) PURE; - - /************************************************************************ - * Method: - * IRMAClientAdviseSink::OnPostSeek - * Purpose: - * Called by client engine to inform the client that a seek has - * just occurred. The render is informed the last time for the - * stream's time line before the seek, as well as the first new - * time for the stream's time line after the seek. - * - */ - STDMETHOD(OnPostSeek) (THIS_ - ULONG32 ulOldTime, - ULONG32 ulNewTime) PURE; - - /************************************************************************ - * Method: - * IRMAClientAdviseSink::OnStop - * Purpose: - * Called by client engine to inform the client that a stop has - * just occurred. - * - */ - STDMETHOD(OnStop) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAClientAdviseSink::OnPause - * Purpose: - * Called by client engine to inform the client that a pause has - * just occurred. The render is informed the last time for the - * stream's time line before the pause. - * - */ - STDMETHOD(OnPause) (THIS_ - ULONG32 ulTime) PURE; - - /************************************************************************ - * Method: - * IRMAClientAdviseSink::OnBegin - * Purpose: - * Called by client engine to inform the client that a begin or - * resume has just occurred. The render is informed the first time - * for the stream's time line after the resume. - * - */ - STDMETHOD(OnBegin) (THIS_ - ULONG32 ulTime) PURE; - - /************************************************************************ - * Method: - * IRMAClientAdviseSink::OnBuffering - * Purpose: - * Called by client engine to inform the client that buffering - * of data is occuring. The render is informed of the reason for - * the buffering (start-up of stream, seek has occurred, network - * congestion, etc.), as well as percentage complete of the - * buffering process. - * - */ - STDMETHOD(OnBuffering) (THIS_ - ULONG32 ulFlags, - UINT16 unPercentComplete) PURE; - - /************************************************************************ - * Method: - * IRMAClientAdviseSink::OnContacting - * Purpose: - * Called by client engine to inform the client is contacting - * hosts(s). - * - */ - STDMETHOD(OnContacting) (THIS_ - const char* pHostName) PURE; -}; - -#endif /* _RMACLSNK_H_ */ diff --git a/include/realmedia/rmacmenu.h b/include/realmedia/rmacmenu.h deleted file mode 100644 index 4491282cd..000000000 --- a/include/realmedia/rmacmenu.h +++ /dev/null @@ -1,215 +0,0 @@ -/**************************************************************************** - * - * $Id: rmacmenu.h 7 2003-05-30 02:18:02Z gabest $ - * - * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved. - * - * http://www.real.com/devzone - * - * This program contains proprietary information of RealNetworks, Inc, - * and is licensed subject to restrictions on use and distribution. - * - * - * RealMedia Architecture Context Menu Interfaces. - * - */ - -#ifndef _RMACMENU_H_ -#define _RMACMENU_H_ - -/* - * Forward declarations of some interfaces defined or used here-in. - */ -typedef _INTERFACE IRMAContextMenu IRMAContextMenu; -typedef _INTERFACE IRMAContextMenuResponse IRMAContextMenuResponse; - - -/**************************************************************************** - * - * Interface: - * - * IRMAContextMenu - * - * Purpose: - * - * Interface implemented by top level clients and provided to renderers. - * Allows the renderer to show a context menu and the top level client - * to add client specitic commands unknown to the renderer to that menu. - * - * IID_IRMAContextMenu: - * - * {00001f00-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAContextMenu, 0x00001f00, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAContextMenu - -DECLARE_INTERFACE_(IRMAContextMenu, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAContextMenu methods - */ - - /************************************************************************ - * Method: - * IRMAContextMenu::InitContextMenu - * Purpose: - * Initializes the context menu to a blank menu, and sets the name - * of the "sub menu" for the renderer if appropriate. This will - * clear any previously added menu items and sub menus. - */ - STDMETHOD(InitContextMenu) (THIS_ - const char* pMenuText - ) PURE; - - /************************************************************************ - * Method: - * IRMAContextMenu::AddMenuItem - * Purpose: - * Returns information vital to the instantiation of rendering - * plugins. - */ - STDMETHOD(AddMenuItem) (THIS_ - UINT16 commandID, - const char* pMenuItemText, - BOOL bChecked, - BOOL bRadioOn, - BOOL bDisabled - ) PURE; - - /************************************************************************ - * Method: - * IRMAContextMenu::AddMenuItem - * Purpose: - * Returns information vital to the instantiation of rendering - * plugins. - */ - STDMETHOD(AddSeparator) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAContextMenu::AddChildMenu - * Purpose: - * Returns information vital to the instantiation of rendering - * plugins. - */ - STDMETHOD(AddChildMenu) (THIS_ - const char* pMenuText - ) PURE; - - /************************************************************************ - * Method: - * IRMAContextMenu::EndChildMenu - * Purpose: - * Returns information vital to the instantiation of rendering - * plugins. - */ - STDMETHOD(EndChildMenu) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAContextMenu::ChangeMenuItem - * Purpose: - * Returns information vital to the instantiation of rendering - * plugins. - */ - STDMETHOD(ChangeMenuItem) (THIS_ - UINT16 commandID, - const char* pMenuItemText, - BOOL bChecked, - BOOL bRadioOn, - BOOL bDisabled - ) PURE; - - /************************************************************************ - * Method: - * IRMAContextMenu::ShowMenu - * Purpose: - * Shows the setup context menu at the specified point. - */ - STDMETHOD(ShowMenu) (THIS_ - IRMAContextMenuResponse* pResonse, - PNxPoint ptPopup - ) PURE; - -}; - -/**************************************************************************** - * - * Interface: - * - * IRMAContextMenuResponse - * - * Purpose: - * - * Interface implemented by renderers that use the context menut. - * Is called to inform the renderer that a particular menu item was - * chosen. - * - * IRMAContextMenuResponse: - * - * {00001f01-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAContextMenuResponse, 0x00001f01, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - - -#undef INTERFACE -#define INTERFACE IRMAContextMenuResponse - -DECLARE_INTERFACE_(IRMAContextMenuResponse, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAContextMenuResponse methods - */ - - /************************************************************************ - * Method: - * IRMAContextMenuResponse::OnCommand - * Purpose: - * Called to inform the renderer that a command was chosen from - * the context menu. - */ - STDMETHOD(OnCommand) (THIS_ - UINT16 commandID - ) PURE; - - - /************************************************************************ - * Method: - * IRMAContextMenuResponse::OnCanceled - * Purpose: - * Called to inform the renderer that the context menu was closed - * without a command being chosen from the renders set of commands. - */ - STDMETHOD(OnCanceled) (THIS) PURE; - -}; - -#endif /* _RMACMENU_H_ */ diff --git a/include/realmedia/rmacomm.h b/include/realmedia/rmacomm.h deleted file mode 100644 index c9f2ed120..000000000 --- a/include/realmedia/rmacomm.h +++ /dev/null @@ -1,568 +0,0 @@ -/**************************************************************************** - * - * $Id: rmacomm.h 7 2003-05-30 02:18:02Z gabest $ - * - * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved. - * - * http://www.real.com/devzone - * - * This program contains proprietary - * information of Progressive Networks, Inc, and is licensed - * subject to restrictions on use and distribution. - * - * - * RealMedia Architecture Common Utility interfaces - * - */ - -#ifndef _RMACOMM_H_ -#define _RMACOMM_H_ - -#include "rmaengin.h" // For RMATimeval - -/* - * Forward declarations of some interfaces defined here-in. - */ - -typedef _INTERFACE IRMACommonClassFactory IRMACommonClassFactory; -typedef _INTERFACE IRMAStatistics IRMAStatistics; -typedef _INTERFACE IRMARegistryID IRMARegistryID; -typedef _INTERFACE IRMAServerFork IRMAServerFork; -typedef _INTERFACE IRMAServerControl IRMAServerControl; -typedef _INTERFACE IRMAReconfigServerResponse IRMAReconfigServerResponse; -typedef _INTERFACE IRMABuffer IRMABuffer; -typedef _INTERFACE IRMAWantServerReconfigNotification - IRMAWantServerReconfigNotification; -typedef _INTERFACE IRMAFastAlloc IRMAFastAlloc; - - - -/**************************************************************************** - * - * Interface: - * - * IRMACommonClassFactory - * - * Purpose: - * - * RMA interface that manages the creation of common RMA classes. - * - * IID_IRMACommonClassFactory: - * - * {00000000-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMACommonClassFactory, 0x00000000, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMACommonClassFactory - -DECLARE_INTERFACE_(IRMACommonClassFactory, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMACommonClassFactory methods - */ - - /************************************************************************ - * Method: - * IRMACommonClassFactory::CreateInstance - * Purpose: - * Creates instances of common objects supported by the system, - * like IRMABuffer, IRMAPacket, IRMAValues, etc. - * - * This method is similar to Window's CoCreateInstance() in its - * purpose, except that it only creates objects of a well known - * types. - * - * NOTE: Aggregation is never used. Therefore and outer unknown is - * not passed to this function, and you do not need to code for this - * situation. - */ - STDMETHOD(CreateInstance) (THIS_ - REFCLSID /*IN*/ rclsid, - void** /*OUT*/ ppUnknown) PURE; - - /************************************************************************ - * Method: - * IRMAController::CreateInstanceAggregatable - * Purpose: - * Creates instances of common objects that can be aggregated - * supported by the system, like IRMASiteWindowed - * - * This method is similar to Window's CoCreateInstance() in its - * purpose, except that it only creates objects of a well known - * types. - * - * NOTE 1: Unlike CreateInstance, this method will create internal - * objects that support Aggregation. - * - * NOTE 2: The output interface is always the non-delegating - * IUnknown. - */ - STDMETHOD(CreateInstanceAggregatable) - (THIS_ - REFCLSID /*IN*/ rclsid, - REF(IUnknown*) /*OUT*/ ppUnknown, - IUnknown* /*IN*/ pUnkOuter) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAStatistics - * - * Purpose: - * - * This interface allows update of the client statistics. - * - * IID_IRMAStatistics: - * - * {00000001-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAStatistics, 0x00000001, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAStatistics - -DECLARE_INTERFACE_(IRMAStatistics, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAStatistics methods - */ - - /************************************************************************ - * Method: - * IRMAStatistics::Init - * Purpose: - * Pass registry ID to the caller - * - */ - STDMETHOD(InitializeStatistics) (THIS_ - UINT32 /*IN*/ ulRegistryID) PURE; - - /************************************************************************ - * Method: - * IRMAStatistics::Update - * Purpose: - * Notify the client to update its statistics stored in the registry - * - */ - STDMETHOD(UpdateStatistics) (THIS) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMARegistryID - * - * Purpose: - * - * This interface is implemented by IRMAPlayer, IRMAStreamSource, - * and IRMAStream. It allows the user to get the registry Base ID, - * for an object that you have a pointer to. - * - * IID_IRMARegistryID: - * - * {00000002-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMARegistryID, 0x00000002, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMARegistryID - -DECLARE_INTERFACE_(IRMARegistryID, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMARegistryID methods - */ - - /************************************************************************ - * Method: - * IRMARegistryID::GetID - * Purpose: - * Get the registry ID of the object. - * - */ - STDMETHOD(GetID) (THIS_ - REF(UINT32) /*OUT*/ ulRegistryID) PURE; -}; - -/**************************************************************************** - * - * Interface: - * - * IRMAServerFork - * - * Purpose: - * - * This interface is implemented by the server context on Unix - * platforms. This interface allows your plugin to fork off a - * process. Note that the process that is forked off cannot use - * any RMA APIs. The fork() system call is prohibited from within - * a RMA plugin. - * - * IID_IRMAServerFork: - * - * {00000003-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAServerFork, 0x00000003, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAServerFork - -DECLARE_INTERFACE_(IRMAServerFork, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAServerFork methods - */ - - /************************************************************************ - * Method: - * IRMAServerFork::Fork - * Purpose: - * Fork off a child process. The child process cannot use any RMA - * APIs. Upon successful completion, Fork returns 0 to the child - * process and the PID of the child to the parent. A return value - * of -1 indicates an error. - * - * Note: The child process should *NOT* Release any interfaces. - * The cleanup of the IRMAServerFork() interface and other - * RMA interfaces is done by the parent. - * - */ - STDMETHOD_(INT32, Fork) (THIS) PURE; -}; - -/* - * - * Interface: - * - * IRMAServerControl - * - * Purpose: - * - * This inteface provides access to the RealMedia server's controls - * for shutting down (for now). - * - * Note: This registry is not related to the Windows system registry. - * - * IID_IRMAServerControl: - * - * {00000004-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAServerControl, 0x00000004, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#define CLSID_IRMAServerControl IID_IRMAServerControl - -#undef INTERFACE -#define INTERFACE IRMAServerControl - -DECLARE_INTERFACE_(IRMAServerControl, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAServerControl methods - */ - - /************************************************************************ - * Method: - * IRMAServerControl::ShutdownServer - * Purpose: - * Shutdown the server. - */ - STDMETHOD(ShutdownServer) (THIS_ - UINT32 status) PURE; -}; - -/* - * - * Interface: - * - * IRMAServerControl2 - * - * Purpose: - * - * Interface for extended server control methods. - * - * - * IID_IRMAServerControl2: - * - * {00000005-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAServerControl2, 0x00000005, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - - -#undef INTERFACE -#define INTERFACE IRMAServerControl2 - -DECLARE_INTERFACE_(IRMAServerControl2, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAServerControl2 methods - */ - - /************************************************************************ - * IRMAServerControl2::RestartServer - * - * Purpose: - * - * Completely shutdown the server, then restart. Mainly used to - * cause not hot setting config var changes to take effect. - */ - STDMETHOD(RestartServer) (THIS) PURE; - - /************************************************************************ - * IRMAServerControl2::ReconfigServer - * - * Purpose: - * - * Used to cause the server to re-read in config from file or registry - * (however it was started) and attempt to use the values. - */ - STDMETHOD(ReconfigServer) (THIS_ IRMAReconfigServerResponse* pResp) PURE; - -}; - -/* - * - * Interface: - * - * IRMAReconfigServerResponse - * - * Purpose: - * - * Response interface for IRMAServerControl2::ReconfigServer - * - * - * IID_IRMAReconfigServerResponse: - * - * {00000006-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAReconfigServerResponse, 0x00000006, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - - -#undef INTERFACE -#define INTERFACE IRMAReconfigServerResponse - -DECLARE_INTERFACE_(IRMAReconfigServerResponse, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /************************************************************************ - * IRMAReconfigServerResponse::ReconfigServerDone - * - * Purpose: - * - * Notification that reconfiguring the server is done. - */ - STDMETHOD(ReconfigServerDone) (THIS_ - PN_RESULT res, - IRMABuffer** pInfo, - UINT32 ulNumInfo) PURE; -}; - -/* - * - * Interface: - * - * IRMAServerReconfigNotification - * - * Purpose: - * - * Register with the server that you want notification when a reconfig - * request comes in and want/need to take part in the reconfiguration. This - * is used when you have configuration info outside the server config file - * which needs to be re-initialized. - * - * - * IID_IRMAServerReconfigNotification: - * - * {00000007-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAServerReconfigNotification, 0x00000007, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - - -#undef INTERFACE -#define INTERFACE IRMAServerReconfigNotification - -DECLARE_INTERFACE_(IRMAServerReconfigNotification, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /************************************************************************ - * IRMAServerReconfigNotification::WantReconfigNotification - * - * Purpose: - * - * Tell the server that you want reconfig notification. - */ - STDMETHOD(WantReconfigNotification) (THIS_ - IRMAWantServerReconfigNotification* pResponse) PURE; - - /************************************************************************ - * IRMAServerReconfigNotification::CancelReconfigNotification - * - * Purpose: - * - * Tell the server that you no longer want reconfig notification. - */ - STDMETHOD(CancelReconfigNotification) (THIS_ - IRMAWantServerReconfigNotification* pResponse) PURE; - -}; - -/* - * - * Interface: - * - * IRMAWantServerReconfigNotification - * - * Purpose: - * - * Tell user that the server got a reconfig request and it is time to - * do your reconfiguration. NOTE: You should not need this if all of your - * configuration is stored in the config file; that is taken care of through - * IRMAActiveRegistry. - * - * IID_IRMAWantServerReconfigNotification: - * - * {00000008-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAWantServerReconfigNotification, 0x00000008, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - - -#undef INTERFACE -#define INTERFACE IRMAWantServerReconfigNotification - -DECLARE_INTERFACE_(IRMAWantServerReconfigNotification, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /************************************************************************ - * IRMAWantServerReconfigNotification::ServerReconfig - * - * Purpose: - * - * Notify user that a server reconfig request had come in and it - * is now your turn to do external (not server config) reconfiguration.* - */ - STDMETHOD(ServerReconfig) (THIS_ - IRMAReconfigServerResponse* pResponse) PURE; - -}; - - -#endif /*_RMACOMM_H_*/ diff --git a/include/realmedia/rmacore.h b/include/realmedia/rmacore.h deleted file mode 100644 index 8461dafba..000000000 --- a/include/realmedia/rmacore.h +++ /dev/null @@ -1,844 +0,0 @@ -/**************************************************************************** - * - * $Id: rmacore.h 74 2003-07-02 02:42:47Z gabest $ - * - * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved. - * - * http://www.real.com/devzone - * - * This program contains proprietary - * information of Progressive Networks, Inc, and is licensed - * subject to restrictions on use and distribution. - * - * - * Client Core interfaces - * - */ - -#ifndef _RMACORE_H_ -#define _RMACORE_H_ - - -/* - * Forward declarations of some interfaces defined or used here-in. - */ -typedef _INTERFACE IUnknown IUnknown; -typedef _INTERFACE IRMAStream IRMAStream; -typedef _INTERFACE IRMAStreamSource IRMAStreamSource; -typedef _INTERFACE IRMAPlayer IRMAPlayer; -typedef _INTERFACE IRMAClientEngine IRMAClientEngine; -typedef _INTERFACE IRMAScheduler IRMAScheduler; -typedef _INTERFACE IRMAClientAdviseSink IRMAClientAdviseSink; -typedef _INTERFACE IRMAValues IRMAValues; -typedef _INTERFACE IRMABuffer IRMABuffer; -typedef _INTERFACE IRMAPacket IRMAPacket; -typedef _INTERFACE IRMARenderer IRMARenderer; -typedef _INTERFACE IRMAPlayer2 IRMAPlayer2; -typedef _INTERFACE IRMARequest IRMArequest; - -typedef struct _PNxEvent PNxEvent; - - -#ifdef _MACINTOSH -#pragma export on -#endif - -#if defined _UNIX && !(defined _VXWORKS) -/* Includes needed for select() stuff */ -#include -#include -#include -#endif - -#ifdef _BEOS // fd_set stuff -#include -#endif - -/* Used in renderer and advise sink interface */ -enum BUFFERING_REASON -{ - BUFFERING_START_UP = 0, - BUFFERING_SEEK, - BUFFERING_CONGESTION, - BUFFERING_LIVE_PAUSE -}; - -/**************************************************************************** - * - * Function: - * - * CreateEngine() - * - * Purpose: - * - * Function implemented by the RMA core to return a pointer to the - * client engine. This function would be run by top level clients. - */ -STDAPI CreateEngine - ( - IRMAClientEngine** /*OUT*/ ppEngine - ); - -/**************************************************************************** - * - * Function: - * - * CloseEngine() - * - * Purpose: - * - * Function implemented by the RMA core to close the engine which - * was returned in CreateEngine(). - */ -STDAPI CloseEngine - ( - IRMAClientEngine* /*IN*/ pEngine - ); - -#ifdef _MACINTOSH -#pragma export off -#endif - -/* - * Definitions of Function Pointers to CreateEngine() and Close Engine(). - * These types are provided as a convenince to authors of top level clients. - */ -typedef PN_RESULT (PNEXPORT_PTR FPRMCREATEENGINE)(IRMAClientEngine** ppEngine); -typedef PN_RESULT (PNEXPORT_PTR FPRMCLOSEENGINE) (IRMAClientEngine* pEngine); -typedef PN_RESULT (PNEXPORT_PTR FPRMSETDLLACCESSPATH) (const char*); - -/**************************************************************************** - * - * Interface: - * - * IRMAStream - * - * Purpose: - * - * Interface provided by the client engine to the renderers. This - * interface allows access to stream related information and properties. - * - * IID_IRMAStream: - * - * {00000400-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAStream, 0x00000400, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAStream - -DECLARE_INTERFACE_(IRMAStream, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAStream methods - */ - - /************************************************************************ - * Method: - * IRMAStream::GetSource - * Purpose: - * Get the interface to the source object of which the stream is - * a part of. - * - */ - STDMETHOD(GetSource) (THIS_ - REF(IRMAStreamSource*) pSource) PURE; - - /************************************************************************ - * Method: - * IRMAStream::GetStreamNumber - * Purpose: - * Get the stream number for this stream relative to the source - * object of which the stream is a part of. - * - */ - STDMETHOD_(UINT16,GetStreamNumber) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAStream::GetStreamType - * Purpose: - * Get the MIME type for this stream. NOTE: The returned string is - * assumed to be valid for the life of the IRMAStream from which it - * was returned. - * - */ - STDMETHOD_(const char*,GetStreamType) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAStream::GetHeader - * Purpose: - * Get the header for this stream. - * - */ - STDMETHOD_(IRMAValues*,GetHeader) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAStream::ReportQualityOfService - * Purpose: - * Call this method to report to the playback context that the - * quality of service for this stream has changed. The unQuality - * should be on a scale of 0 to 100, where 100 is the best possible - * quality for this stream. Although the transport engine can - * determine lost packets and report these through the user - * interface, only the renderer of this stream can determine the - * "real" perceived damage associated with this loss. - * - * NOTE: The playback context may use this value to indicate loss - * in quality to the user interface. When the effects of a lost - * packet are eliminated the renderer should call this method with - * a unQuality of 100. - * - */ - STDMETHOD(ReportQualityOfService) (THIS_ - UINT8 unQuality) PURE; - - /************************************************************************ - * Method: - * IRMAStream::ReportRebufferStatus - * Purpose: - * Call this method to report to the playback context that the - * available data has dropped to a critically low level, and that - * rebuffering should occur. The renderer should call back into this - * interface as it receives additional data packets to indicate the - * status of its rebuffering effort. - * - * NOTE: The values of unNeeded and unAvailable are used to indicate - * the general status of the rebuffering effort. For example, if a - * renderer has "run dry" and needs 5 data packets to play smoothly - * again, it should call ReportRebufferStatus() with 5,0 then as - * packet arrive it should call again with 5,1; 5,2... and eventually - * 5,5. - * - */ - STDMETHOD(ReportRebufferStatus) (THIS_ - UINT8 unNeeded, - UINT8 unAvailable) PURE; - - /************************************************************************ - * Method: - * IRMAStream::SetGranularity - * Purpose: - * Sets the desired Granularity for this stream. The actual - * granularity will be the lowest granularity of all streams. - * Valid to call before stream actually begins. Best to call during - * IRMARenderer::OnHeader(). - */ - STDMETHOD(SetGranularity) (THIS_ - ULONG32 ulGranularity) PURE; - - /************************************************************************ - * Method: - * IRMAStream::GetRendererCount - * Purpose: - * Returns the current number of renderer instances supported by - * this stream instance. - */ - STDMETHOD_(UINT16, GetRendererCount)(THIS) PURE; - - /************************************************************************ - * Method: - * IRMAStream::GetRenderer - * Purpose: - * Returns the Nth renderer instance supported by this stream. - */ - STDMETHOD(GetRenderer) (THIS_ - UINT16 nIndex, - REF(IUnknown*) pUnknown) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAStreamSource - * - * Purpose: - * - * Interface provided by the client engine to the renderers. This - * interface allows access to source related information and properties. - * - * IID_IRMAStreamSource: - * - * {00000401-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAStreamSource, 0x00000401, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAStreamSource - -DECLARE_INTERFACE_(IRMAStreamSource, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAStreamSource methods - */ - - /************************************************************************ - * Method: - * IRMAStreamSource::IsLive - * Purpose: - * Ask the source whether it is live - * - */ - STDMETHOD_ (BOOL,IsLive) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAStreamSource::GetPlayer - * Purpose: - * Get the interface to the player object of which the source is - * a part of. - * - */ - STDMETHOD(GetPlayer) (THIS_ - REF(IRMAPlayer*) pPlayer) PURE; - - /************************************************************************ - * Method: - * IRMAStreamSource::GetURL - * Purpose: - * Get the URL for this source. NOTE: The returned string is - * assumed to be valid for the life of the IRMAStreamSource from which - * it was returned. - * - */ - STDMETHOD_(const char*,GetURL) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAStreamSource::GetStreamCount - * Purpose: - * Returns the current number of stream instances supported by - * this source instance. - */ - STDMETHOD_(UINT16, GetStreamCount)(THIS) PURE; - - /************************************************************************ - * Method: - * IRMAStreamSource::GetStream - * Purpose: - * Returns the Nth stream instance supported by this source. - */ - STDMETHOD(GetStream) (THIS_ - UINT16 nIndex, - REF(IUnknown*) pUnknown) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAPlayer - * - * Purpose: - * - * Interface provided by the client engine to the renderers. This - * interface allows access to player related information, properties, - * and operations. - * - * IID_IRMAPlayer: - * - * {00000402-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAPlayer, 0x00000402, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAPlayer - -DECLARE_INTERFACE_(IRMAPlayer, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAPlayer methods - */ - - /************************************************************************ - * Method: - * IRMAPlayer::GetClientEngine - * Purpose: - * Get the interface to the client engine object of which the - * player is a part of. - * - */ - STDMETHOD(GetClientEngine) (THIS_ - REF(IRMAClientEngine*) pEngine) PURE; - - /************************************************************************ - * Method: - * IRMAPlayer::IsDone - * Purpose: - * Ask the player if it is done with the current presentation - * - */ - STDMETHOD_(BOOL,IsDone) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAPlayer::IsLive - * Purpose: - * Ask the player whether it contains the live source - * - */ - STDMETHOD_(BOOL,IsLive) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAPlayer::GetCurrentPlayTime - * Purpose: - * Get the current time on the Player timeline - * - */ - STDMETHOD_(ULONG32,GetCurrentPlayTime) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAPlayer::OpenURL - * Purpose: - * Tell the player to begin playback of all its sources. - * - */ - STDMETHOD(OpenURL) (THIS_ - const char* pURL) PURE; - - /************************************************************************ - * Method: - * IRMAPlayer::Begin - * Purpose: - * Tell the player to begin playback of all its sources. - * - */ - STDMETHOD(Begin) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAPlayer::Stop - * Purpose: - * Tell the player to stop playback of all its sources. - * - */ - STDMETHOD(Stop) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAPlayer::Pause - * Purpose: - * Tell the player to pause playback of all its sources. - * - */ - STDMETHOD(Pause) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAPlayer::Seek - * Purpose: - * Tell the player to seek in the playback timeline of all its - * sources. - * - */ - STDMETHOD(Seek) (THIS_ - ULONG32 ulTime) PURE; - - /************************************************************************ - * Method: - * IRMAPlayer::GetSourceCount - * Purpose: - * Returns the current number of source instances supported by - * this player instance. - */ - STDMETHOD_(UINT16, GetSourceCount)(THIS) PURE; - - /************************************************************************ - * Method: - * IRMAPlayer::GetSource - * Purpose: - * Returns the Nth source instance supported by this player. - */ - STDMETHOD(GetSource) (THIS_ - UINT16 nIndex, - REF(IUnknown*) pUnknown) PURE; - - /************************************************************************ - * Method: - * IRMAPlayer::SetClientContext - * Purpose: - * Called by the client to install itself as the provider of client - * services to the core. This is traditionally called by the top - * level client application. - */ - STDMETHOD(SetClientContext) (THIS_ - IUnknown* pUnknown) PURE; - - /************************************************************************ - * Method: - * IRMAPlayer::GetClientContext - * Purpose: - * Called to get the client context for this player. This is - * set by the top level client application. - */ - STDMETHOD(GetClientContext) (THIS_ - REF(IUnknown*) pUnknown) PURE; - - /************************************************************************ - * Method: - * IRMAPlayer::AddAdviseSink - * Purpose: - * Call this method to add a client advise sink. - * - */ - STDMETHOD(AddAdviseSink) (THIS_ - IRMAClientAdviseSink* pAdviseSink) PURE; - - /************************************************************************ - * Method: - * IRMAPlayer::RemoveAdviseSink - * Purpose: - * Call this method to remove a client advise sink. - */ - STDMETHOD(RemoveAdviseSink) (THIS_ - IRMAClientAdviseSink* pAdviseSink) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAClientEngine - * - * Purpose: - * - * Interface to the basic client engine. Provided to the renderers and - * other client side components. - * - * IID_IRMAClientEngine: - * - * {00000403-0901-11d1-8B06-00A024406D59} - */ -DEFINE_GUID(IID_IRMAClientEngine, 0x00000403, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAClientEngine - -DECLARE_INTERFACE_(IRMAClientEngine, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAClientEngine methods - */ - - /************************************************************************ - * Method: - * IRMAClientEngine::CreatePlayer - * Purpose: - * Creates a new IRMAPlayer instance. - * - */ - STDMETHOD(CreatePlayer) (THIS_ - REF(IRMAPlayer*) pPlayer) PURE; - - /************************************************************************ - * Method: - * IRMAClientEngine::ClosePlayer - * Purpose: - * Called by the client when it is done using the player... - * - */ - STDMETHOD(ClosePlayer) (THIS_ - IRMAPlayer* pPlayer) PURE; - - /************************************************************************ - * Method: - * IRMAClientEngine::GetPlayerCount - * Purpose: - * Returns the current number of IRMAPlayer instances supported by - * this client engine instance. - */ - STDMETHOD_(UINT16, GetPlayerCount)(THIS) PURE; - - /************************************************************************ - * Method: - * IRMAClientEngine::GetPlayer - * Purpose: - * Returns the Nth IRMAPlayer instances supported by this client - * engine instance. - */ - STDMETHOD(GetPlayer) (THIS_ - UINT16 nPlayerNumber, - REF(IUnknown*) pUnknown) PURE; - - /************************************************************************ - * Method: - * IRMAClientEngine::EventOccurred - * Purpose: - * Clients call this to pass OS events to all players. PNxEvent - * defines a cross-platform event. - */ - STDMETHOD(EventOccurred) (THIS_ - PNxEvent* /*IN*/ pEvent) PURE; -}; - -#if defined _UNIX && !defined (_VXWORKS) -DEFINE_GUID(IID_IRMAClientEngineSelector, 0x00000404, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAClientEngineSelector - -DECLARE_INTERFACE_(IRMAClientEngineSelector, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAClientEngine::Select - * Purpose: - * Top level clients under Unix should use this instead of - * select() to select for events. - */ - STDMETHOD_(INT32, Select) (THIS_ - INT32 n, - fd_set *readfds, - fd_set *writefds, - fd_set *exceptfds, - struct timeval* timeout) PURE; -}; -#endif /* _UNIX */ - -/**************************************************************************** - * - * Interface: - * - * IRMAClientEngineSetup - * - * Purpose: - * - * Interface to the basic client engine. Provided to the renderers and - * other client side components. - * - * IID_IRMAClientEngineSetup: - * - * {00000405-0901-11d1-8B06-00A024406D59} - */ -DEFINE_GUID(IID_IRMAClientEngineSetup, 0x00000405, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAClientEngineSetup - -DECLARE_INTERFACE_(IRMAClientEngineSetup, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAClientEngineSetup methods - */ - - /************************************************************************ - * Method: - * IRMAClientEngineSetup::Setup - * Purpose: - * Top level clients use this interface to over-ride certain basic - * interfaces implemented by the core. Current over-ridable - * interfaces are: IRMAPreferences, IRMAHyperNavigate - */ - STDMETHOD(Setup) (THIS_ - IUnknown* pContext) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAInfoLogger - * - * Purpose: - * - * Interface to send any logging information back to the server. - * This information will appear in the server's access log. - * - * IID_IRMAInfoLogger: - * - * {00000409-0901-11d1-8B06-00A024406D59} - */ -DEFINE_GUID(IID_IRMAInfoLogger, 0x00000409, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAInfoLogger - -DECLARE_INTERFACE_(IRMAInfoLogger, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAInfoLogger methods - */ - - /************************************************************************ - * Method: - * IRMAInfoLogger::LogInformation - * Purpose: - * Logs any user defined information in form of action and - * associated data. - */ - STDMETHOD(LogInformation) (THIS_ - const char* /*IN*/ pAction, - const char* /*IN*/ pData) PURE; -}; - - - -/**************************************************************************** - * - * Interface: - * - * IRMAPlayer2 - * - * Purpose: - * - * Extra methods in addition to IRMAPlayer - * - * IID_IRMAPlayer2: - * - * {00000411-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAPlayer2, 0x00000411, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAPlayer2 - -DECLARE_INTERFACE_(IRMAPlayer2, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /************************************************************************ - * Method: - * IID_IRMAPlayer2::SetMinimumPreroll - * Purpose: - * Call this method to set the minimum preroll of this clip - */ - STDMETHOD(SetMinimumPreroll) (THIS_ - UINT32 ulMinPreroll) PURE; - - /************************************************************************ - * Method: - * IID_IRMAPlayer2::GetMinimumPreroll - * Purpose: - * Call this method to get the minimum preroll of this clip - */ - STDMETHOD(GetMinimumPreroll) (THIS_ - REF(UINT32) ulMinPreroll) PURE; - - /************************************************************************ - * Method: - * IID_IRMAPlayer2::OpenRequest - * Purpose: - * Call this method to open the IRMARequest - */ - STDMETHOD(OpenRequest) (THIS_ - IRMARequest* pRequest) PURE; - - /************************************************************************ - * Method: - * IID_IRMAPlayer2::GetRequest - * Purpose: - * Call this method to get the IRMARequest - */ - STDMETHOD(GetRequest) (THIS_ - REF(IRMARequest*) pRequest) PURE; -}; - -#endif /* _RMACORE_H_ */ - diff --git a/include/realmedia/rmadb.h b/include/realmedia/rmadb.h deleted file mode 100644 index bc1c090a5..000000000 --- a/include/realmedia/rmadb.h +++ /dev/null @@ -1,1304 +0,0 @@ -/**************************************************************************** - * - * $Id: rmadb.h 7 2003-05-30 02:18:02Z gabest $ - * - * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved. - * - * http://www.real.com/devzone - * - * This program contains proprietary - * information of Progressive Networks, Inc, and is licensed - * subject to restrictions on use and distribution. - * - * - * RealMedia Architecture Interface. - * - */ - -#ifndef _RMADB_H_ -#define _RMADB_H_ - -/* - * Forward declarations of some interfaces defined or used here-in. - */ -typedef _INTERFACE IRMABuffer IRMABuffer; -typedef _INTERFACE IRMAValues IRMAValues; -typedef _INTERFACE IRMADatabaseManager IRMADatabaseManager; -typedef _INTERFACE IRMAAuthenticationDBManager IRMAAuthenticationDBManager; -typedef _INTERFACE IRMAAuthenticationDBManagerResponse IRMAAuthenticationDBManagerResponse; -typedef _INTERFACE IRMAAsyncEnumAuthenticationDB IRMAAsyncEnumAuthenticationDB; -typedef _INTERFACE IRMAAsyncEnumAuthenticationDBResponse IRMAAsyncEnumAuthenticationDBResponse; -typedef _INTERFACE IRMAAuthenticationDBAccess IRMAAuthenticationDBAccess; -typedef _INTERFACE IRMAAuthenticationDBAccessResponse IRMAAuthenticationDBAccessResponse; -typedef _INTERFACE IRMAGUIDDBManager IRMAGUIDDBManager; -typedef _INTERFACE IRMAGUIDDBManagerResponse IRMAGUIDDBManagerResponse; -typedef _INTERFACE IRMAPPVDBManager IRMAPPVDBManager; -typedef _INTERFACE IRMAPPVDBManagerResponse IRMAPPVDBManagerResponse; -typedef _INTERFACE IRMARedirectDBManager IRMARedirectDBManager; -typedef _INTERFACE IRMARedirectDBManagerResponse IRMARedirectDBManagerResponse; -typedef _INTERFACE IRMARegistrationLogger IRMARegistrationLogger; - -/**************************************************************************** - * - * Interface: - * - * IRMADatabaseManager - * - * Purpose: - * - * This is implemented by the database manager in order to provide - * access to the databases it manages. - * - * IRMADatabaseManager: - * - * {00002A00-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMADatabaseManager, 0x00002A00, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#define CLSID_CRMADatabaseManager IID_IRMADatabaseManager - -#undef INTERFACE -#define INTERFACE IRMADatabaseManager - -DECLARE_INTERFACE_(IRMADatabaseManager, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) - ( - THIS_ - REFIID IIDOfInterfaceDesired, - void** ppVoidRequestedInterface - ) PURE; - - STDMETHOD_(ULONG,AddRef) - ( - THIS - ) PURE; - - STDMETHOD_(ULONG,Release) - ( - THIS - ) PURE; - - /************************************************************************ - * Method: - * IRMADatabaseManager::GetInstanceFromID - * Purpose: - * - * Returns a database object configured as defined for the specifed - * DatabaseID in the server config file. - * - */ - STDMETHOD(GetInstanceFromID) - ( - THIS_ - IRMABuffer* pBufferID, - REF(IUnknown*) pUnknownDatabase - ) PURE; - -}; - -/**************************************************************************** - * - * Interface: - * - * IRMAAuthenticationDBManager - * - * Purpose: - * - * A database plugin will implement this when it desires to provide - * storage for authentication data. - * - * IRMAAuthenticationDBManager: - * - * {00002A02-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAAuthenticationDBManager, 0x00002A02, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAAuthenticationDBManager - -DECLARE_INTERFACE_(IRMAAuthenticationDBManager, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) - ( - THIS_ - REFIID IIDOfInterfaceDesired, - void** ppVoidRequestedInterface - ) PURE; - - STDMETHOD_(ULONG,AddRef) - ( - THIS - ) PURE; - - STDMETHOD_(ULONG,Release) - ( - THIS - ) PURE; - - /************************************************************************ - * Method: - * IRMAAuthenticationDBManager::AddPrincipal - * Purpose: - * - * Adds the specified user to the database, if it is not already - * there. - * - */ - STDMETHOD(AddPrincipal) - ( - THIS_ - IRMAAuthenticationDBManagerResponse* pAuthenticationDBManagerResponseNew, - IRMABuffer* pBufferPrincipalID - ) PURE; - - /************************************************************************ - * Method: - * IRMAAuthenticationDBManager::RemovePrincipal - * Purpose: - * - * Removes the specified user from the database, if it is there. - * - * - */ - STDMETHOD(RemovePrincipal) - ( - THIS_ - IRMAAuthenticationDBManagerResponse* pAuthenticationDBManagerResponseNew, - IRMABuffer* pBufferPrincipalID - ) PURE; - - /************************************************************************ - * Method: - * IRMAAuthenticationDBManager::SetCredentials - * Purpose: - * - * Replaces the credentials for the specified user. - * Usually the credentials are a password. - * It is not the databases job to protect this data - * Authentication plugins will protect this data - * before storing it when neccesary. - * - */ - STDMETHOD(SetCredentials) - ( - THIS_ - IRMAAuthenticationDBManagerResponse* pAuthenticationDBManagerResponseNew, - IRMABuffer* pBufferPrincipalID, - IRMABuffer* pBufferCredentials - ) PURE; -}; - -/**************************************************************************** - * - * Interface: - * - * IRMAAuthenticationDBManagerResponse - * - * Purpose: - * - * A database user will implement this when it desires to manage - * storage for authentication data. - * This interface receives the results of IRMAAuthenticationDBManager - * methods - * - * IRMAAuthenticationDBManagerResponse: - * - * {00002A01-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAAuthenticationDBManagerResponse, 0x00002A01, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAAuthenticationDBManagerResponse - -DECLARE_INTERFACE_(IRMAAuthenticationDBManagerResponse, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) - ( - THIS_ - REFIID IIDOfInterfaceDesired, - void** ppVoidRequestedInterface - ) PURE; - - STDMETHOD_(ULONG,AddRef) - ( - THIS - ) PURE; - - STDMETHOD_(ULONG,Release) - ( - THIS - ) PURE; - - /************************************************************************ - * Method: - * IRMAAuthenticationDBManagerResponse::AddPrincipalDone - * Purpose: - * - * Reports the success or failure of - * IRMAAuthenticationDBManager::AddPrincipal - * - */ - STDMETHOD(AddPrincipalDone) - ( - THIS_ - PN_RESULT ResultStatus, - IRMABuffer* pBufferPrincipalID - ) PURE; - - /************************************************************************ - * Method: - * IRMAAuthenticationDBManagerResponse::RemovePrincipalDone - * Purpose: - * - * Reports the success or failure of - * IRMAAuthenticationDBManager::RemovePrincipal - * - */ - STDMETHOD(RemovePrincipalDone) - ( - THIS_ - PN_RESULT ResultStatus, - IRMABuffer* pBufferPrincipalID - ) PURE; - - /************************************************************************ - * Method: - * IRMAAuthenticationDBManagerResponse::SetCredentialsDone - * Purpose: - * - * Reports the success or failure of - * IRMAAuthenticationDBManager::SetCredentials - * - */ - STDMETHOD(SetCredentialsDone) - ( - THIS_ - PN_RESULT ResultStatus, - IRMABuffer* pBufferPrincipalID - ) PURE; -}; - -/**************************************************************************** - * - * Interface: - * - * IRMAAsyncEnumAuthenticationDB - * - * Purpose: - * - * A database plugin will implement this when it desires to provide - * enumeration of authentication data. - * - * IRMAAsyncEnumAuthenticationDB: - * - * {00002A04-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAAsyncEnumAuthenticationDB, 0x00002A04, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAAsyncEnumAuthenticationDB - -DECLARE_INTERFACE_(IRMAAsyncEnumAuthenticationDB, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) - ( - THIS_ - REFIID IIDOfInterfaceDesired, - void** ppVoidRequestedInterface - ) PURE; - - STDMETHOD_(ULONG,AddRef) - ( - THIS - ) PURE; - - STDMETHOD_(ULONG,Release) - ( - THIS - ) PURE; - - /************************************************************************ - * Method: - * IRMAAsyncEnumAuthenticationDB::Reset - * Purpose: - * - * Call this to reset this enumerator to the beginning of the - * collection. - * - */ - STDMETHOD(Reset) - ( - THIS_ - IRMAAsyncEnumAuthenticationDBResponse* pAsyncEnumAuthenticationDBResponseNew - ) PURE; - - /************************************************************************ - * Method: - * IRMAAsyncEnumAuthenticationDB::Next - * Purpose: - * - * Call this to retrieve the next item in the collection. - * - */ - STDMETHOD(Next) - ( - THIS_ - IRMAAsyncEnumAuthenticationDBResponse* pAsyncEnumAuthenticationDBResponseNew - ) PURE; - - /************************************************************************ - * Method: - * IRMAAsyncEnumAuthenticationDB::Skip - * Purpose: - * - * Call this to skip the next n items in the collection and - * retrieve the n+1 item. - * - */ - STDMETHOD(Skip) - ( - THIS_ - IRMAAsyncEnumAuthenticationDBResponse* pAsyncEnumAuthenticationDBResponseNew, - UINT32 ulNumToSkip - ) PURE; - - /************************************************************************ - * Method: - * IRMAAsyncEnumAuthenticationDB::Clone - * Purpose: - * - * Call this to make a new enumerator of this collection. - * - */ - STDMETHOD(Clone) - ( - THIS_ - REF(IRMAAsyncEnumAuthenticationDB*) pAsyncEnumAuthenticationDBNew - ) PURE; -}; - -/**************************************************************************** - * - * Interface: - * - * IRMAAsyncEnumAuthenticationDBResponse - * - * Purpose: - * - * A database user will implement this when it desires to - * enumerate authentication data. - * This interface receives the results of IRMAAsyncEnumAuthenticationDB - * methods - * - * IRMAAsyncEnumAuthenticationDBResponse: - * - * {00002A03-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAAsyncEnumAuthenticationDBResponse, 0x00002A03, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAAsyncEnumAuthenticationDBResponse - -DECLARE_INTERFACE_(IRMAAsyncEnumAuthenticationDBResponse, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) - ( - THIS_ - REFIID IIDOfInterfaceDesired, - void** ppVoidRequestedInterface - ) PURE; - - STDMETHOD_(ULONG,AddRef) - ( - THIS - ) PURE; - - STDMETHOD_(ULONG,Release) - ( - THIS - ) PURE; - - /************************************************************************ - * Method: - * IRMAAsyncEnumAuthenticationDBResponse::ResetDone - * Purpose: - * - * Reports the success or failure of - * IRMAAsyncEnumAuthenticationDB::Reset - * - */ - STDMETHOD(ResetDone) - ( - THIS_ - PN_RESULT ResultStatus - ) PURE; - - /************************************************************************ - * Method: - * IRMAAsyncEnumAuthenticationDBResponse::NextDone - * Purpose: - * - * Reports the success or failure of - * IRMAAsyncEnumAuthenticationDB::Next - * If successful the PrincipalID is valid. - * - */ - STDMETHOD(NextDone) - ( - THIS_ - PN_RESULT ResultStatus, - IRMABuffer* pBufferNextPrincipalID - ) PURE; - - /************************************************************************ - * Method: - * IRMAAsyncEnumAuthenticationDBResponse::SkipDone - * Purpose: - * - * Reports the success or failure of - * IRMAAsyncEnumAuthenticationDB::Skip - * If successful the PrincipalID is valid. - * - */ - STDMETHOD(SkipDone) - ( - THIS_ - PN_RESULT ResultStatus, - IRMABuffer* pBufferNextPrincipalID - ) PURE; -}; - -/**************************************************************************** - * - * Interface: - * - * IRMAAuthenticationDBAccess - * - * Purpose: - * - * A database plugin will implement this when it desires to provide - * access to authentication data. - * - * IRMAAuthenticationDBAccess: - * - * {00002A06-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAAuthenticationDBAccess, 0x00002A06, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAAuthenticationDBAccess - -DECLARE_INTERFACE_(IRMAAuthenticationDBAccess, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) - ( - THIS_ - REFIID IIDOfInterfaceDesired, - void** ppVoidRequestedInterface - ) PURE; - - STDMETHOD_(ULONG,AddRef) - ( - THIS - ) PURE; - - STDMETHOD_(ULONG,Release) - ( - THIS - ) PURE; - - /************************************************************************ - * Method: - * IRMAAuthenticationDBAccess::_NewEnum - * Purpose: - * - * Call this to make a new enumerator of this collection. - * - */ - STDMETHOD(_NewEnum) - ( - THIS_ - REF(IRMAAsyncEnumAuthenticationDB*) pAsyncEnumAuthenticationDBNew - ) PURE; - - /************************************************************************ - * Method: - * IRMAAuthenticationDBAccess::CheckExistence - * Purpose: - * - * Call this to verify the existance of a principal. - * - */ - STDMETHOD(CheckExistence) - ( - THIS_ - IRMAAuthenticationDBAccessResponse* pAuthenticationDBAccessResponseNew, - IRMABuffer* pBufferPrincipalID - ) PURE; - - /************************************************************************ - * Method: - * IRMAAuthenticationDBAccess::GetCredentials - * Purpose: - * - * Call this to access the credentials for the specified principal. - * - */ - STDMETHOD(GetCredentials) - ( - THIS_ - IRMAAuthenticationDBAccessResponse* pAuthenticationDBAccessResponseNew, - IRMABuffer* pBufferPrincipalID - ) PURE; -}; - -/**************************************************************************** - * - * Interface: - * - * IRMAAuthenticationDBAccessResponse - * - * Purpose: - * - * A database user will implement this when it desires to - * access authentication data. - * This interface receives the results of IRMAAuthenticationDBAccess - * methods - * - * IRMAAuthenticationDBAccessResponse: - * - * {00002A05-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAAuthenticationDBAccessResponse, 0x00002A05, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAAuthenticationDBAccessResponse - -DECLARE_INTERFACE_(IRMAAuthenticationDBAccessResponse, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) - ( - THIS_ - REFIID IIDOfInterfaceDesired, - void** ppVoidRequestedInterface - ) PURE; - - STDMETHOD_(ULONG,AddRef) - ( - THIS - ) PURE; - - STDMETHOD_(ULONG,Release) - ( - THIS - ) PURE; - - /************************************************************************ - * Method: - * IRMAAuthenticationDBAccessResponse::ExistenceCheckDone - * Purpose: - * - * Reports the success or failure of - * IRMAAuthenticationDBAccess::ExistenceCheck - * - */ - STDMETHOD(ExistenceCheckDone) - ( - THIS_ - PN_RESULT ResultStatus, - IRMABuffer* pBufferPrincipalID - ) PURE; - - /************************************************************************ - * Method: - * IRMAAuthenticationDBAccessResponse::GetCredentialsDone - * Purpose: - * - * Reports the success or failure of - * IRMAAuthenticationDBAccess::GetCredentials - * If successful the Credentials var is valid. - * - */ - STDMETHOD(GetCredentialsDone) - ( - THIS_ - PN_RESULT ResultStatus, - IRMABuffer* pBufferPrincipalID, - IRMABuffer* pBufferCredentials - ) PURE; -}; - -/**************************************************************************** - * - * Interface: - * - * IRMAGUIDDBManager - * - * Purpose: - * - * A database plugin will implement this when it desires to provide - * storage of player GUID data (for Player Authentication). - * - * IRMAGUIDDBManager: - * - * {00002A08-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAGUIDDBManager, 0x00002A08, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAGUIDDBManager - -DECLARE_INTERFACE_(IRMAGUIDDBManager, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) - ( - THIS_ - REFIID IIDOfInterfaceDesired, - void** ppVoidRequestedInterface - ) PURE; - - STDMETHOD_(ULONG,AddRef) - ( - THIS - ) PURE; - - STDMETHOD_(ULONG,Release) - ( - THIS - ) PURE; - - /************************************************************************ - * Method: - * IRMAGUIDDBManager::SetGUIDForPrincipalID - * Purpose: - * - * Call this to associate a player GUID with a user. - * - */ - STDMETHOD(SetGUIDForPrincipalID) - ( - THIS_ - IRMAGUIDDBManagerResponse* pGUIDDBManagerResponseNew, - IRMABuffer* pBufferPrincipalID, - IRMABuffer* pBufferGUID - ) PURE; - - /************************************************************************ - * Method: - * IRMAGUIDDBManager::GetPrincipalIDFromGUID - * Purpose: - * - * Call this to get the associated player GUID from a user. - * - */ - STDMETHOD(GetPrincipalIDFromGUID) - ( - THIS_ - IRMAGUIDDBManagerResponse* pGUIDDBManagerResponseNew, - IRMABuffer* pBufferGUID - ) PURE; -}; - -/**************************************************************************** - * - * Interface: - * - * IRMAGUIDDBManagerResponse - * - * Purpose: - * - * A database user will implement this when it desires to - * manage player GUID data. - * This interface receives the results of IRMAGUIDDBManager - * methods - * - * IRMAGUIDDBManagerResponse: - * - * {00002A07-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAGUIDDBManagerResponse, 0x00002A07, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAGUIDDBManagerResponse - -DECLARE_INTERFACE_(IRMAGUIDDBManagerResponse, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) - ( - THIS_ - REFIID IIDOfInterfaceDesired, - void** ppVoidRequestedInterface - ) PURE; - - STDMETHOD_(ULONG,AddRef) - ( - THIS - ) PURE; - - STDMETHOD_(ULONG,Release) - ( - THIS - ) PURE; - - /************************************************************************ - * Method: - * IRMAGUIDDBManagerResponse::SetGUIDForPrincipalIDDone - * Purpose: - * - * Reports the success or failure of - * IRMAGUIDDBManager::SetGUIDForPrincipalID - * - */ - STDMETHOD(SetGUIDForPrincipalIDDone) - ( - THIS_ - PN_RESULT ResultStatus, - IRMABuffer* pBufferPrincipalID - ) PURE; - - /************************************************************************ - * Method: - * IRMAGUIDDBManagerResponse::GetPrincipalIDFromGUIDDone - * Purpose: - * - * Reports the success or failure of - * IRMAGUIDDBManager::GetGUIDForPrincipalID - * - */ - STDMETHOD(GetPrincipalIDFromGUIDDone) - ( - THIS_ - PN_RESULT ResultStatus, - IRMABuffer* pBufferGUID, - IRMABuffer* pBufferPrincipalID - ) PURE; -}; - -/**************************************************************************** - * - * Interface: - * - * IRMAPPVDBManager - * - * Purpose: - * - * A database plugin will implement this when it desires to provide - * storage of Pay-Per-View permission data. - * - * IRMAPPVDBManager: - * - * {00002A0A-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAPPVDBManager, 0x00002A0A, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAPPVDBManager - -DECLARE_INTERFACE_(IRMAPPVDBManager, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) - ( - THIS_ - REFIID IIDOfInterfaceDesired, - void** ppVoidRequestedInterface - ) PURE; - - STDMETHOD_(ULONG,AddRef) - ( - THIS - ) PURE; - - STDMETHOD_(ULONG,Release) - ( - THIS - ) PURE; - - /************************************************************************ - * Method: - * IRMAPPVDBManager::GetPermissions - * Purpose: - * - * Call this to find the PPV permissions for the specified URL - * and user. - * - */ - STDMETHOD(GetPermissions) - ( - THIS_ - IRMAPPVDBManagerResponse* pPPVDBManagerResponseNew, - IRMABuffer* pBufferPrincipalID, - IRMABuffer* pBufferURL - ) PURE; - - /************************************************************************ - * Method: - * IRMAPPVDBManager::SetPermissions - * Purpose: - * - * Call this to set the PPV permissions for the specified URL - * and user. - * - */ - STDMETHOD(SetPermissions) - ( - THIS_ - IRMAPPVDBManagerResponse* pPPVDBManagerResponseNew, - IRMABuffer* pBufferPrincipalID, - IRMABuffer* pBufferURL, - IRMAValues* pValuesPermissions - ) PURE; - - /************************************************************************ - * Method: - * IRMAPPVDBManager::RevokePermissions - * Purpose: - * - * Call this to remove the PPV permissions for the specified URL - * and user. - * - */ - STDMETHOD(RevokePermissions) - ( - THIS_ - IRMAPPVDBManagerResponse* pPPVDBManagerResponseNew, - IRMABuffer* pBufferPrincipalID, - IRMABuffer* pBufferURL - ) PURE; - - /************************************************************************ - * Method: - * IRMAPPVDBManager::RevokeAllPermissions - * Purpose: - * - * Call this to remove the PPV permissions for all URL's - * that this user has access too. - * - */ - STDMETHOD(RevokeAllPermissions) - ( - THIS_ - IRMAPPVDBManagerResponse* pPPVDBManagerResponseNew, - IRMABuffer* pBufferPrincipalID - ) PURE; - - /************************************************************************ - * Method: - * IRMAPPVDBManager::LogAccessAttempt - * Purpose: - * - * Call this to record the results of an attempt to access - * protected content. - * - */ - STDMETHOD(LogAccessAttempt) - ( - THIS_ - IRMAValues* pValuesAccess - ) PURE; - -}; - -/**************************************************************************** - * - * Interface: - * - * IRMAPPVDBManagerResponse - * - * Purpose: - * - * A database user will implement this when it desires to - * manage Pay-Per-View permission data. - * This interface receives the results of IRMAPPVDBManager - * methods - * - * IRMAPPVDBManagerResponse: - * - * {00002A09-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAPPVDBManagerResponse, 0x00002A09, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAPPVDBManagerResponse - -DECLARE_INTERFACE_(IRMAPPVDBManagerResponse, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) - ( - THIS_ - REFIID IIDOfInterfaceDesired, - void** ppVoidRequestedInterface - ) PURE; - - STDMETHOD_(ULONG,AddRef) - ( - THIS - ) PURE; - - STDMETHOD_(ULONG,Release) - ( - THIS - ) PURE; - - /************************************************************************ - * Method: - * IRMAPPVDBManagerResponse::GetPermissionsDone - * Purpose: - * - * Reports the success or failure of - * IRMAPPVDBManager::GetPermissions - * If successful then the Permissions are valid - * - */ - STDMETHOD(GetPermissionsDone) - ( - THIS_ - PN_RESULT ResultStatus, - IRMABuffer* pBufferPrincipalID, - IRMAValues* pValuesPermissions - ) PURE; - - /************************************************************************ - * Method: - * IRMAPPVDBManagerResponse::SetPermissionsDone - * Purpose: - * - * Reports the success or failure of - * IRMAPPVDBManager::SetPermissions - * - */ - STDMETHOD(SetPermissionsDone) - ( - THIS_ - PN_RESULT ResultStatus, - IRMABuffer* pBufferPrincipalID - ) PURE; - - /************************************************************************ - * Method: - * IRMAPPVDBManagerResponse::RevokePermissionsDone - * Purpose: - * - * Reports the success or failure of - * IRMAPPVDBManager::RevokePermissions - * - */ - STDMETHOD(RevokePermissionsDone) - ( - THIS_ - PN_RESULT ResultStatus, - IRMABuffer* pBufferPrincipalID - ) PURE; - - /************************************************************************ - * Method: - * IRMAPPVDBManagerResponse::RevokeAllPermissionsDone - * Purpose: - * - * Reports the success or failure of - * IRMAPPVDBManager::RevokeAllPermissions - * - */ - STDMETHOD(RevokeAllPermissionsDone) - ( - THIS_ - PN_RESULT ResultStatus, - IRMABuffer* pBufferPrincipalID - ) PURE; -}; - -/**************************************************************************** - * - * Interface: - * - * IRMARedirectDBManager - * - * Purpose: - * - * A database plugin will implement this when it desires to provide - * storage of URL's to redirect. - * - * IRMARedirectDBManager: - * - * {00002A0C-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMARedirectDBManager, 0x00002A0C, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMARedirectDBManager - -DECLARE_INTERFACE_(IRMARedirectDBManager, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) - ( - THIS_ - REFIID IIDOfInterfaceDesired, - void** ppVoidRequestedInterface - ) PURE; - - STDMETHOD_(ULONG,AddRef) - ( - THIS - ) PURE; - - STDMETHOD_(ULONG,Release) - ( - THIS - ) PURE; - - /************************************************************************ - * Method: - * IRMARedirectDBManager::GetRedirect - * Purpose: - * - * Call this to retrieve the URL that the specified URL should - * be redirected to. - * - */ - STDMETHOD(GetRedirect) - ( - THIS_ - IRMARedirectDBManagerResponse* pRedirectDBManagerResponseNew, - IRMABuffer* pBufferURL - ) PURE; - - /************************************************************************ - * Method: - * IRMARedirectDBManager::AddRedirect - * Purpose: - * - * Call this to set the new URL that the specified URL should - * be redirected to. - * - */ - STDMETHOD(AddRedirect) - ( - THIS_ - IRMARedirectDBManagerResponse* pRedirectDBManagerResponseNew, - IRMABuffer* pBufferURL, - IRMABuffer* pBufferNewURL - ) PURE; - - /************************************************************************ - * Method: - * IRMARedirectDBManager::RemoveRedirect - * Purpose: - * - * Call this to stop redirecting the specified URL. - * - */ - STDMETHOD(RemoveRedirect) - ( - THIS_ - IRMARedirectDBManagerResponse* pRedirectDBManagerResponseNew, - IRMABuffer* pBufferURL - ) PURE; - -}; - -/**************************************************************************** - * - * Interface: - * - * IRMARedirectDBManagerResponse - * - * Purpose: - * - * A database user will implement this when it desires to - * manage the URL's to redirect. - * This interface receives the results of IRMARedirectDBManager - * methods - * - * IRMARedirectDBManagerResponse: - * - * {00002A0B-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMARedirectDBManagerResponse, 0x00002A0B, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMARedirectDBManagerResponse - -DECLARE_INTERFACE_(IRMARedirectDBManagerResponse, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) - ( - THIS_ - REFIID IIDOfInterfaceDesired, - void** ppVoidRequestedInterface - ) PURE; - - STDMETHOD_(ULONG,AddRef) - ( - THIS - ) PURE; - - STDMETHOD_(ULONG,Release) - ( - THIS - ) PURE; - - /************************************************************************ - * Method: - * IRMARedirectDBManagerResponse::GetRedirectDone - * Purpose: - * - * Reports the success or failure of - * IRMARedirectDBManager::GetRedirect - * If successful then the new URL is valid - * - */ - STDMETHOD(GetRedirectDone) - ( - THIS_ - PN_RESULT ResultStatus, - IRMABuffer* pBufferURL, - IRMABuffer* pBufferNewURL - ) PURE; - - /************************************************************************ - * Method: - * IRMARedirectDBManagerResponse::AddRedirectDone - * Purpose: - * - * Reports the success or failure of - * IRMARedirectDBManager::AddRedirect - * - */ - STDMETHOD(AddRedirectDone) - ( - THIS_ - PN_RESULT ResultStatus, - IRMABuffer* pBufferURL - ) PURE; - - /************************************************************************ - * Method: - * IRMARedirectDBManagerResponse::RemoveRedirectDone - * Purpose: - * - * Reports the success or failure of - * IRMARedirectDBManager::RemoveRedirect - * - */ - STDMETHOD(RemoveRedirectDone) - ( - THIS_ - PN_RESULT ResultStatus, - IRMABuffer* pBufferURL - ) PURE; - -}; - -/**************************************************************************** - * - * Interface: - * - * IRMARegistrationLogger - * - * Purpose: - * - * A database plugin will implement this when it desires to provide - * storage of player registration attempts. - * - * IRMARegistrationLogger: - * - * {00002A0E-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMARegistrationLogger, 0x00002A0E, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMARegistrationLogger - -DECLARE_INTERFACE_(IRMARegistrationLogger, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) - ( - THIS_ - REFIID IIDOfInterfaceDesired, - void** ppVoidRequestedInterface - ) PURE; - - STDMETHOD_(ULONG,AddRef) - ( - THIS - ) PURE; - - STDMETHOD_(ULONG,Release) - ( - THIS - ) PURE; - - /************************************************************************ - * Method: - * IRMARegistrationLogger::LogRegistrationAttempt - * Purpose: - * - * Call this to record the results of an attempt to register - * a player's GUID. - * - */ - STDMETHOD(LogRegistrationAttempt) - ( - THIS_ - IRMAValues* pValuesRegistration - ) PURE; -}; - - -#endif /* !_RMADB_H_ */ diff --git a/include/realmedia/rmadtcvt.h b/include/realmedia/rmadtcvt.h deleted file mode 100644 index 042436151..000000000 --- a/include/realmedia/rmadtcvt.h +++ /dev/null @@ -1,533 +0,0 @@ -/**************************************************************************** - * - * $Id: rmadtcvt.h 7 2003-05-30 02:18:02Z gabest $ - * - * Copyright (C) 1995-2000 RealNetworks, Inc. All rights reserved.. - * - * http://www.real.com/devzone - * - * This program contains proprietary - * information of Progressive Networks, Inc, and is licensed - * subject to restrictions on use and distribution. - * - * - * RealMedia Architecture Stream Data Conversion Interfaces. - * - */ - - -#ifndef _RMADTCVT_H -#define _RMADTCVT_H - -typedef _INTERFACE IRMADataConvertSystemObject - IRMADataConvertSystemObject; -typedef _INTERFACE IRMADataConvert IRMADataConvert; -typedef _INTERFACE IRMADataConvertResponse IRMADataConvertResponse; -typedef _INTERFACE IRMADataRevert IRMADataRevert; -typedef _INTERFACE IRMADataRevertResponse IRMADataRevertResponse; - -/**************************************************************************** - * - * Interface: - * - * IRMADataConvertSystemObject - * - * Purpose: - * - * Object that allows Controller to communicate with a specific - * Data Convert plugin session (similar to IRMAFileSystemObject) - * - * Implemented by: - * - * Server side plugin. - * - * IID_IMADataConvertSystemObject: - * - * {00003900-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMADataConvertSystemObject, - 0x00003900, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMADataConvertSystemObject - -DECLARE_INTERFACE_(IRMADataConvertSystemObject, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMADataConvertSystemObject - */ - - /*********************************************************************** - * Method: GetDataConvertInfo - * - * Purpose: - * Returns information needed for proper instantiation of data - * convert plugin. pShortName should be a short, human readable - * name in the form of "company-dcname". For example: - * pShortName = "rn-dataconvert" - */ - STDMETHOD(GetDataConvertInfo) (THIS_ REF(const char*) pShortName) PURE; - - /*********************************************************************** - * Method: InitDataConvertSystem - * - * Purpose: - * Pass in options from config file from under DataConvertMount - * for this specific plugin. - */ - STDMETHOD(InitDataConvertSystem) (THIS_ IRMAValues* pOptions) PURE; - - /*********************************************************************** - * Method: CreateDataConvert - * - * Purpose: - * Purpose: - * System is requesting an IRMADataConvert object for this mount - * point. - */ - STDMETHOD(CreateDataConvert) (THIS_ IUnknown** /*OUT*/ ppConvObj) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMADataConvert - * - * Purpose: - * - * Per connection object to handle the actual data and header - * conversions. - * - * Implemented by: - * - * Server side plugin. - * - * IID_IMADataConvert: - * - * {00003901-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMADataConvert, - 0x00003901, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMADataConvert - -DECLARE_INTERFACE_(IRMADataConvert, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMADataConvert - */ - - /* - * NOTE: for each of ConvertFileHeader, ConvertStreamHeader, - * ConvertData, you can call the appropriate done method on - * the response object with a result of PNR_OK and a NULL buffer - * and the system will use the original header/packet. Do this - * if you aren't going to change things in the header/packet. - */ - /************************************************************************ - * Method: DataConvertInit - * - *Purpose: - * Basic initialization, mainly just to pass in response object. - */ - STDMETHOD(DataConvertInit) (THIS_ IRMADataConvertResponse* pResponse) PURE; - - /************************************************************************ - * Method: ConvertFileHeader - * - * Purpose: - * Pass in file headers for data conversion. - */ - STDMETHOD(ConvertFileHeader) (THIS_ IRMAValues* pFileHeader) PURE; - - /************************************************************************ - * Method: ConvertStreamHeader - * - * Purpose: - * Pass in stream headers for data conversion. - */ - STDMETHOD(ConvertStreamHeader) (THIS_ IRMAValues* pStreamHeader) PURE; - - /************************************************************************ - * Method: GetConversionMimeType - * - * Purpose: - * Tell the server what converstion type you are using for the - * session. - */ - STDMETHOD(GetConversionMimeType) - (THIS_ REF(const char*) pConversionType) PURE; - - /************************************************************************ - * Method: ConvertData - * - * Purpose: - * Pass in data to be converted. - */ - STDMETHOD(ConvertData) (THIS_ IRMAPacket* pPacket) PURE; - - /************************************************************************ - * Method: ControlBufferReady - * - * Purpose: - * Pass in a control channel buffer sent from the IRMADataRevert - * on the other side (player). - */ - STDMETHOD(ControlBufferReady) (THIS_ IRMABuffer* pBuffer) PURE; - - /************************************************************************ - * Method: SetMulticastTransportConverter - * - * Purpose: - * In this case the IRMADataConvert is only handling the header - * conversions per player and this call is handing you the data - * converter which is doing the data. This will a different - * instance of the same object. - */ - STDMETHOD(SetMulticastTransportConverter) (THIS_ - IRMADataConvert* pConverter) PURE; - - - /************************************************************************ - * Method: AddMulticastControlConverter - * - * Purpose: - * In this case the IRMADataConvert is only handling the data - * conversions for all of the players (but only once because it's - * multicast). This call is handing you one of a possible many - * IRMADataConvert objects which will be handling the header - * conversions. - */ - STDMETHOD(AddMulticastControlConverter) (THIS_ - IRMADataConvert* pConverter) PURE; - - /************************************************************************ - * Method: Done - * - * Purpose: - * Let IRMADataConvert know that it is done. This is mainly to clear - * circular refs between multicast transport and controllers. - */ - STDMETHOD(Done) (THIS) PURE; - -}; - -/**************************************************************************** - * - * Interface: - * - * IRMADataConvertResponse - * - * Purpose: - * - * Response object for IRMADataConvert. - * - * Implemented by: - * - * Server Core. - * - * IID_IMADataConvertResponse: - * - * {00003902-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMADataConvertResponse, - 0x00003902, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMADataConvertResponse - -DECLARE_INTERFACE_(IRMADataConvertResponse, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMADataConvertResponse - */ - - /* - * NOTE: for each of ConvertFileHeader, ConvertStreamHeader, - * ConvertData, you can call the appropriate done method on - * the response object with a result of PNR_OK and a NULL buffer - * and the system will use the original header/packet. Do this - * if you aren't going to change things in the header/packet. - */ - /************************************************************************ - * Method: DataConvertInitDone - * - * Purpose: - * Async notification that the IRMADataConvert is done with - * intialization. - */ - STDMETHOD(DataConvertInitDone) (THIS_ PN_RESULT status) PURE; - - /************************************************************************ - * Method: ConvertedFileHeaderReady - * - * Purpose: - * Async notification that the IRMADataCovert is done converting the - * file header. - */ - STDMETHOD(ConvertedFileHeaderReady) (THIS_ - PN_RESULT status, IRMAValues* pFileHeader) PURE; - - /************************************************************************ - * Method: ConvertedStreamHeaderReady - * - * Purpose: - * Async notification that the IRMADataConvert is done converting the - * stream header. - */ - STDMETHOD(ConvertedStreamHeaderReady) (THIS_ - PN_RESULT status, IRMAValues* pStreamHeader) PURE; - - /************************************************************************ - * Method: ConvertedDataReady - * - * Purpose: - * Async notification that the IRMADataConvert is done converting - * the stream data packet. - */ - STDMETHOD(ConvertedDataReady) (THIS_ PN_RESULT status, - IRMAPacket* pPacket) PURE; - - /************************************************************************ - * Method: SendControlBuffer - * - * Purpose: - * Provided to allow IRMADataConvert to send an arbitrary buffer - * to the IRMADataRevert on the other side (player). - */ - STDMETHOD(SendControlBuffer) (THIS_ IRMABuffer* pBuffer) PURE; - -}; - -/**************************************************************************** - * - * Interface: - * - * IRMADataRevert - * - * Purpose: - * - * Revert data coming from coresponding IRMADataConvert on server. - * - * Implemented by: - * - * Player side plugin. - * - * IID_IMADataRevert: - * - * {00003903-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMADataRevert, - 0x00003903, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMADataRevert - -DECLARE_INTERFACE_(IRMADataRevert, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMADataRevert - */ - - /************************************************************************ - * Method: DataRevertInit - * - * Purpose: - * Basic inialization of IRMADataRevert. Mainly just to pass in - * response object. - */ - STDMETHOD(DataRevertInit) (THIS_ IRMADataRevertResponse* pResponse) PURE; - - /************************************************************************ - * Method: GetDataRevertInfo - * - * Purpose: - * Allow IRMADataRevert to notify player core about which data - * conversion mime types it is willing to handle. - */ - STDMETHOD(GetDataRevertInfo) (THIS_ REF(const char**) - ppConversionMimeTypes) PURE; - - /************************************************************************ - * Method: RevertFileHeader - * - * Purpose: - * Pass in converted FileHeader to allow IRMADataRevert to revert - * the header. - */ - STDMETHOD(RevertFileHeader) (THIS_ IRMAValues* pFileHeader) PURE; - - /************************************************************************ - * Method: RevertStreamHeader - * - * Purpose: - * Pass in converted StreamHeader to allow IRMADataRevert to revert - * the header. - */ - STDMETHOD(RevertStreamHeader)(THIS_ IRMAValues* pStreamHeader) PURE; - - /************************************************************************ - * Method: RevertData - * - * Purpose: - * Pass in converted stream data to allow IRMADataRevert to - * revert the data. - */ - STDMETHOD(RevertData) (THIS_ IRMAPacket* pPacket) PURE; - - /************************************************************************ - * Method: ControlBufferReady - * - * Purpose: - * Pass in control channel buffer received from corresponding - * IRMADataConvert on server side. - */ - STDMETHOD(ControlBufferReady) (THIS_ IRMABuffer* pBuffer) PURE; - -}; - -/**************************************************************************** - * - * Interface: - * - * IRMADataRevertResponse - * - * Purpose: - * - * Response ojbect for IRMADataRevert. - * - * Implemented by: - * - * Player core. - * - * IID_IMADataRevertResponse: - * - * {00003904-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMADataRevertResponse, - 0x00003904, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMADataRevertResponse - -DECLARE_INTERFACE_(IRMADataRevertResponse, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMADataRevertResponse - */ - - /************************************************************************ - * Method: DataRevertInitDone - * - * Purpose: - * Async notification that the IRMADataRevert is done intializing - * and can begin processing headers. - */ - STDMETHOD(DataRevertInitDone) (THIS_ PN_RESULT status) PURE; - - /************************************************************************ - * Method: RevertedFileHeaderReady - * - * Purpose: - * Async notification that the IRMADataRevert is done reverting the - * file headers. - */ - STDMETHOD(RevertedFileHeaderReady) (THIS_ - PN_RESULT status, IRMAValues* pHeader) PURE; - - /************************************************************************ - * Method: RevertedStreamHeaderReady - * - * Purpose: - * Async notification that the IRMADataRevert is done reverting the - * stream headers. - */ - STDMETHOD(RevertedStreamHeaderReady) (THIS_ - PN_RESULT status, IRMAValues* pHeader) PURE; - - /************************************************************************ - * Method: RevertedDataReady - * - * Purpose: - * Async notification that the IRMADataRevert is done reverting the - * stream data. - */ - STDMETHOD(RevertedDataReady) (THIS_ PN_RESULT status, - IRMAPacket* pPacket) PURE; - - /************************************************************************ - * Method: SendControlBuffer - * - * Purpose: - * Provided to allow IRMADataRevert to send an arbitrary control - * buffer to the IRMADataConvert on the other side (server). - */ - STDMETHOD(SendControlBuffer) (THIS_ IRMABuffer* pBuffer) PURE; - -}; - - -#endif diff --git a/include/realmedia/rmaencod.h b/include/realmedia/rmaencod.h deleted file mode 100644 index f03c224c7..000000000 --- a/include/realmedia/rmaencod.h +++ /dev/null @@ -1,240 +0,0 @@ -/**************************************************************************** - * - * $Id: rmaencod.h 7 2003-05-30 02:18:02Z gabest $ - * - * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved. - * - * http://www.real.com/devzone - * - * This program contains proprietary - * information of Progressive Networks, Inc, and is licensed - * subject to restrictions on use and distribution. - * - * - * RealMedia Architecture Encoder Interfaces. - * - */ - -#ifndef _RMAENCOD_H_ -#define _RMAENCOD_H_ - -typedef _INTERFACE IUnknown IUnknown; -typedef _INTERFACE IRMAValues IRMAValues; -typedef _INTERFACE IRMAPacket IRMAPacket; -typedef _INTERFACE IRMARequest IRMARequest; -typedef _INTERFACE IRMAEncoder IRMAEncoder; -typedef _INTERFACE IRMAEncoderResponse IRMAEncoderResponse; -typedef _INTERFACE IRMAEncoderCompletion IRMAEncoderCompletion; -typedef _INTERFACE IRMAEncoderResponseCompletion IRMAEncoderResponseCompletion; -typedef _INTERFACE IRMAConnectionlessControl IRMAConnectionlessControl; -typedef _INTERFACE IRMATransportControl IRMATransportControl; - -#ifndef _MACINTOSH -STDAPI_(IUnknown*) CreateContext(); -#else -#pragma export on -STDAPI_(IUnknown*) CreateContext(); -#pragma export off -#endif - - -DEFINE_GUID(IID_IRMAEncoderResponse, 0x00001600, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAEncoderResponse - -DECLARE_INTERFACE_(IRMAEncoderResponse, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAEncoderResponse methods - */ - STDMETHOD(InitEncoderResponse) (THIS_ - const char* pHost, - UINT16 unPort, - IRMARequest* pRequest, - const char* pUsername, - const char* pPassword, - IRMAEncoder* pEncoder) PURE; - - STDMETHOD(FileHeaderReady) (THIS_ - PN_RESULT result, - IRMAValues* pHeader) PURE; - - STDMETHOD(StreamHeaderReady) (THIS_ - PN_RESULT result, - IRMAValues* pHeader) PURE; - - STDMETHOD(PacketReady) (THIS_ - PN_RESULT result, - IRMAPacket* pPacket) PURE; - - STDMETHOD(StreamDone) (THIS_ - UINT16 unStream) PURE; - - STDMETHOD(Process) (THIS) PURE; - - STDMETHOD_(UINT32,GetTime) (THIS) PURE; -}; - -DEFINE_GUID(IID_IRMAEncoder, 0x00001601, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAEncoder - -DECLARE_INTERFACE_(IRMAEncoder, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAEncoder methods - */ - STDMETHOD(InitEncoderResponseDone) (THIS_ - PN_RESULT result) PURE; - - STDMETHOD(GetFileHeader) (THIS) PURE; - - STDMETHOD(GetStreamHeader) (THIS_ - UINT16 unStream) PURE; - - STDMETHOD(StartPackets) (THIS_ - UINT16 unStream) PURE; - - STDMETHOD(StopPackets) (THIS_ - UINT16 unStream) PURE; -}; - -DEFINE_GUID(IID_IRMAEncoderCompletion, 0x00001602, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAEncoderCompletion - -DECLARE_INTERFACE_(IRMAEncoderCompletion, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAEncoderCompletion methods - */ - - STDMETHOD(EncoderDone) (THIS_ - PN_RESULT result) PURE; -}; - -DEFINE_GUID(IID_IRMAConnectionlessControl, 0x00001603, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAConnectionlessControl - -DECLARE_INTERFACE_(IRMAConnectionlessControl, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAConnectionlessControl methods - */ - - STDMETHOD(EnableConnectionlessControl) - (THIS) PURE; - - STDMETHOD(ConnectionCheckFailed) (THIS_ - PN_RESULT status) PURE; - - STDMETHOD(SetConnectionTimeout) (THIS_ - UINT32 uSeconds) PURE; -}; - -DEFINE_GUID(IID_IRMAEncoderResponseCompletion, 0x00001604, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAEncoderResponseCompletion - -DECLARE_INTERFACE_(IRMAEncoderResponseCompletion, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAEncoderResponseCompletion methods - */ - - STDMETHOD(EncoderResponseDone) (THIS) PURE; -}; - -/* - * The only 2 encoder transport types supported are: - * "x-pn-tng/udp" - * "x-pn-tng/tcp" - */ - -DEFINE_GUID(IID_IRMATransportControl, 0x00001605, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMATransportControl - -DECLARE_INTERFACE_(IRMATransportControl, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMATransportControl methods - */ - - STDMETHOD(SetTransportType) (const char* pTransportType) PURE; -}; - -#endif /* _RMAENCOD_H_ */ diff --git a/include/realmedia/rmaengin.h b/include/realmedia/rmaengin.h deleted file mode 100644 index abcf8a542..000000000 --- a/include/realmedia/rmaengin.h +++ /dev/null @@ -1,1500 +0,0 @@ -/**************************************************************************** - * - * $Id: rmaengin.h 7 2003-05-30 02:18:02Z gabest $ - * - * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved. - * - * http://www.real.com/devzone - * - * This program contains proprietary - * information of Progressive Networks, Inc, and is licensed - * subject to restrictions on use and distribution. - * - * - * RealMedia Architecture Callback, Networking, and Scheduling interfaces. - * - */ - -#ifndef _RMAENGIN_H_ -#define _RMAENGIN_H_ - -/* - * Forward declarations of some interfaces used here-in. - */ - -typedef _INTERFACE IRMABuffer IRMABuffer; -typedef _INTERFACE IRMACallback IRMACallback; -typedef _INTERFACE IRMAScheduler IRMAScheduler; -typedef _INTERFACE IRMATCPResponse IRMATCPResponse; -typedef _INTERFACE IRMALBoundTCPSocket IRMALBoundTCPSocket; -typedef _INTERFACE IRMATCPSocket IRMATCPSocket; -typedef _INTERFACE IRMAListenResponse IRMAListenResponse; -typedef _INTERFACE IRMAListenSocket IRMAListenSocket; -typedef _INTERFACE IRMANetworkServices IRMANetworkServices; -typedef _INTERFACE IRMANetworkServices2 IRMANetworkServices2; -typedef _INTERFACE IRMAUDPResponse IRMAUDPResponse; -typedef _INTERFACE IRMAUDPSocket IRMAUDPSocket; -typedef _INTERFACE IRMAResolver IRMAResolver; -typedef _INTERFACE IRMAResolverResponse IRMAResolverResponse; -typedef _INTERFACE IRMAInterruptSafe IRMAInterruptSafe; -typedef _INTERFACE IRMAAsyncIOSelection IRMAAsyncIOSelection; -typedef _INTERFACE IRMAUDPMulticastInit IRMAUDPMulticastInit; -typedef _INTERFACE IRMAInterruptState IRMAInterruptState; -typedef _INTERFACE IRMAOptimizedScheduler IRMAOptimizedScheduler; - - -/* - * Address flags starting with PNR are depricated. - */ -#define PNR_INADDR_ANY (UINT32)0x00000000 //THIS FLAG IS DEPRICATED -#define PN_INADDR_ANY (UINT32)0x00000000 - -/* - * 255.255.255.254 - * - * Bind to all ports in IPBindings list from - * server config. - */ -#define PNR_INADDR_IPBINDINGS (UINT32)0xfffffffe //THIS FLAG IS DEPRICATED -#define PN_INADDR_IPBINDINGS (UINT32)0xfffffffe - - -/* Async IO Selection Type (Unix Only) */ - -#define PNAIO_READ 1 -#define PNAIO_WRITE 2 -#define PNAIO_EXCEPTION 4 - -/**************************************************************************** - * - * Interface: - * - * IRMACallback - * - * Purpose: - * - * This interface defines a simple callback which will be used in - * various interfaces such as IRMAScheduler. - * - * IID_IRMACallback: - * - * {00000100-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMACallback, 0x00000100, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMACallback - -DECLARE_INTERFACE_(IRMACallback, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMACallback methods - */ - - /************************************************************************ - * Method: - * IRMACallback::Func - * Purpose: - * This is the function that will be called when a callback is - * to be executed. - */ - STDMETHOD(Func) (THIS) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAScheduler - * - * Purpose: - * - * This interface provides the user with a way of scheduling callbacks - * that will be executed at some time in the future. - * - * IID_IRMAScheduler: - * - * {00000101-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAScheduler, 0x00000101, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAScheduler - -typedef ULONG32 CallbackHandle; - -typedef struct _RMATimeval -{ - UINT32 tv_sec; - UINT32 tv_usec; -} RMATimeval; - -DECLARE_INTERFACE_(IRMAScheduler, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAScheduler methods - */ - - /************************************************************************ - * Method: - * IRMAScheduler::RelativeEnter - * Purpose: - * Schedule a callback to be executed "ms" milliseconds from now - * This function is less percise then AbsoluteEnter and should only - * be used when accurate timing is not critical. - */ - STDMETHOD_(CallbackHandle,RelativeEnter) (THIS_ - IRMACallback* pCallback, - UINT32 ms) PURE; - - /************************************************************************ - * Method: - * IRMAScheduler::AbsoluteEnter - * Purpose: - * Schedule a callback to be executed at time "tVal". - */ - STDMETHOD_(CallbackHandle,AbsoluteEnter) (THIS_ - IRMACallback* pCallback, - RMATimeval tVal) PURE; - - /************************************************************************ - * Method: - * IRMAScheduler::Remove - * Purpose: - * Remove a callback from the scheduler. - */ - STDMETHOD(Remove) (THIS_ - CallbackHandle Handle) PURE; - - /************************************************************************ - * Method: - * IRMAScheduler::GetCurrentSchedulerTime - * Purpose: - * Gives the current time (in the timeline of the scheduler). - */ - STDMETHOD_(RMATimeval,GetCurrentSchedulerTime) (THIS) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMATCPResponse - * - * Purpose: - * - * This is the response interface for the asynchronous TCP networking - * interface. - * - * IID_IRMATCPResponse: - * - * {00000102-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMATCPResponse, 0x00000102, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMATCPResponse - -DECLARE_INTERFACE_(IRMATCPResponse, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMATCPResponse methods - */ - - /************************************************************************ - * Method: - * IRMATCPResponse::ConnectDone - * Purpose: - * A Connect operation has been completed or an error has occurred. - */ - STDMETHOD(ConnectDone) (THIS_ - PN_RESULT status) PURE; - - /************************************************************************ - * Method: - * IRMATCPResponse::ReadDone - * Purpose: - * A Read operation has been completed or an error has occurred. - * The data is returned in the IRMABuffer. - */ - STDMETHOD(ReadDone) (THIS_ - PN_RESULT status, - IRMABuffer* pBuffer) PURE; - - /************************************************************************ - * Method: - * IRMATCPResponse::WriteReady - * Purpose: - * This is the response method for WantWrite. - * If PN_RESULT is ok, then the TCP channel is ok to Write to. - */ - STDMETHOD(WriteReady) (THIS_ - PN_RESULT status) PURE; - - /************************************************************************ - * Method: - * IRMATCPResponse::Closed - * Purpose: - * This method is called to inform you that the TCP channel has - * been closed by the peer or closed due to error. - */ - STDMETHOD(Closed) (THIS_ - PN_RESULT status) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMATCPSocket - * - * Purpose: - * - * Provides the user with an asynchronous TCP networking interface. - * - * IID_IRMATCPSocket: - * - * {00000103-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMATCPSocket, 0x00000103, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMATCPSocket - -DECLARE_INTERFACE_(IRMATCPSocket, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMATCPSocket methods - * - * Network addresses and ports are in native byte order - * - */ - - STDMETHOD(Init) (THIS_ - IRMATCPResponse* /*IN*/ pTCPResponse) PURE; - - STDMETHOD(SetResponse) (THIS_ - IRMATCPResponse* pTCPResponse) PURE; - - STDMETHOD(Bind) (THIS_ - UINT32 ulLocalAddr, - UINT16 nPort) PURE; - - /* - * pDestination is a string containing host name or dotted-ip notation - */ - STDMETHOD(Connect) (THIS_ - const char* pDestination, - UINT16 nPort) PURE; - - STDMETHOD(Read) (THIS_ - UINT16 Size) PURE; - - STDMETHOD(Write) (THIS_ - IRMABuffer* pBuffer) PURE; - - /************************************************************************ - * Method: - * IRMATCPSocket::WantWrite - * Purpose: - * This method is called when you wish to write a large amount of - * data. If you are only writing small amounts of data, you can - * just call Write (all data not ready to be transmitted will be - * buffered on your behalf). When the TCP channel is ready to be - * written to, the response interfaces WriteReady method will be - * called. - */ - STDMETHOD(WantWrite) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMATCPSocket::GetForeignAddress - * Purpose: - * Returns the address of the other end of the TCP socket as a - * ULONG32 in local host order - */ - STDMETHOD(GetForeignAddress) (THIS_ - REF(ULONG32) lAddress) PURE; - - STDMETHOD(GetLocalAddress) (THIS_ - REF(ULONG32) lAddress) PURE; - - /************************************************************************ - * Method: - * IRMATCPSocket::GetForeignPort - * Purpose: - * Returns the port of the other end of the TCP socket in local - * host order. - */ - STDMETHOD(GetForeignPort) (THIS_ - REF(UINT16) port) PURE; - - STDMETHOD(GetLocalPort) (THIS_ - REF(UINT16) port) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAListenResponse - * - * Purpose: - * - * This is the response interface for the asynchronous TCP listening - * socket interface. - * - * IID_IRMAListenResponse: - * - * {00000104-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAListenResponse, 0x00000104, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAListenResponse - -DECLARE_INTERFACE_(IRMAListenResponse, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAListenResponse methods - */ - - STDMETHOD(NewConnection) (THIS_ - PN_RESULT status, - IRMATCPSocket* pTCPSocket) PURE; -}; - -/**************************************************************************** - * - * Interface: - * - * IRMAListenSocket - * - * Purpose: - * - * This interfaces allows you to asynchronously listen on a port for - * TCP connections. - * - * IID_IRMAListenSocket: - * - * {00000105-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAListenSocket, 0x00000105, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAListenSocket - -DECLARE_INTERFACE_(IRMAListenSocket, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAListenSocket methods - */ - - STDMETHOD(Init) (THIS_ - UINT32 ulLocalAddr, - UINT16 port, - IRMAListenResponse* /*IN*/ pListenResponse - ) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMANetworkServices - * - * Purpose: - * - * This is a factory interface for the various types of networking - * interfaces described above. - * - * IID_IRMANetworkServices: - * - * {00000106-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMANetworkServices, 0x00000106, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMANetworkServices - -DECLARE_INTERFACE_(IRMANetworkServices, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMANetworkServices methods - */ - - /************************************************************************ - * Method: - * IRMANetworkServices::CreateTCPSocket - * Purpose: - * Create a new TCP socket. - */ - STDMETHOD(CreateTCPSocket) (THIS_ - IRMATCPSocket** /*OUT*/ ppTCPSocket) PURE; - - /************************************************************************ - * Method: - * IRMANetworkServices::CreateUDPSocket - * Purpose: - * Create a new UDP socket. - */ - STDMETHOD(CreateUDPSocket) (THIS_ - IRMAUDPSocket** /*OUT*/ ppUDPSocket) PURE; - - /************************************************************************ - * Method: - * IRMANetworkServices::CreateListenSocket - * Purpose: - * Create a new TCP socket that will listen for connections on a - * particular port. - */ - STDMETHOD(CreateListenSocket) (THIS_ - IRMAListenSocket** /*OUT*/ ppListenSocket - ) PURE; - - /************************************************************************ - * Method: - * IRMANetworkServices::CreateResolver - * Purpose: - * Create a new resolver that can lookup host names - */ - STDMETHOD(CreateResolver) (THIS_ - IRMAResolver** /*OUT*/ ppResolver) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMANetworkServices2 - * - * Purpose: - * - * This is a factory interface for the various types of networking - * interfaces described above. - * - * IID_IRMANetworkServices: - * - * {17951551-5683-11d3-B6BA-00C0F031C237} - * - */ - -// {17951551-5683-11d3-B6BA-00C0F031C237} -DEFINE_GUID(IID_IRMANetworkServices2, 0x17951551, 0x5683, 0x11d3, 0xb6, 0xba, 0x0, 0xc0, 0xf0, 0x31, 0xc2, 0x37); - -#undef INTERFACE -#define INTERFACE IRMANetworkServices2 - -DECLARE_INTERFACE_(IRMANetworkServices2, IRMANetworkServices) -{ - /************************************************************************ - * Method: - * IRMANetworkServices2::CreateLBoundTCPSocket - * Purpose: - * Create a new local bound TCP socket. - */ - STDMETHOD(CreateLBoundTCPSocket) (THIS_ - IRMATCPSocket** /*OUT*/ ppTCPSocket) PURE; -}; - - - -/**************************************************************************** - * - * Interface: - * - * IRMAUDPResponse - * - * Purpose: - * - * This is the response interface for the asynchronous UDP networking - * interface. - * - * IID_IRMAUDPResponse: - * - * {00000107-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAUDPResponse, 0x00000107, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAUDPResponse - -DECLARE_INTERFACE_(IRMAUDPResponse, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAUDPResponse methods - */ - - STDMETHOD(ReadDone) (THIS_ - PN_RESULT status, - IRMABuffer* pBuffer, - ULONG32 ulAddr, - UINT16 nPort) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAUDPSocket - * - * Purpose: - * - * Provides the user with an asynchronous UDP networking interface. - * - * IID_IRMAUDPSocket: - * - * {00000108-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAUDPSocket, 0x00000108, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAUDPSocket - -DECLARE_INTERFACE_(IRMAUDPSocket, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAUDPSocket methods - * - * Network addresses and ports are in native byte order - */ - - STDMETHOD(Init) (THIS_ - ULONG32 ulAddr, - UINT16 nPort, - IRMAUDPResponse* pUDPResponse) PURE; - - STDMETHOD(Bind) (THIS_ - UINT32 ulLocalAddr, - UINT16 nPort) PURE; - - STDMETHOD(Read) (THIS_ - UINT16 Size) PURE; - - STDMETHOD(Write) (THIS_ - IRMABuffer* pBuffer) PURE; - - STDMETHOD(WriteTo) (THIS_ - ULONG32 ulAddr, - UINT16 nPort, - IRMABuffer* pBuffer) PURE; - - STDMETHOD(GetLocalPort) (THIS_ - REF(UINT16) port) PURE; - - STDMETHOD(JoinMulticastGroup) (THIS_ - ULONG32 ulMulticastAddr, - ULONG32 ulInterfaceAddr) PURE; - - STDMETHOD(LeaveMulticastGroup) (THIS_ - ULONG32 ulMulticastAddr, - ULONG32 ulInterfaceAddr) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAResolver - * - * Purpose: - * - * This interface allows you to asynchronously resolve hostnames. - * - * IID_IRMAResolver: - * - * {00000109-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAResolver, 0x00000109, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAResolver - -DECLARE_INTERFACE_(IRMAResolver, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAResolver methods - */ - - STDMETHOD(Init) (THIS_ - IRMAResolverResponse* pResponse) PURE; - - STDMETHOD(GetHostByName) (THIS_ - const char* pHostName) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAResolverResponse - * - * Purpose: - * - * This is the response interface for the asynchronous DNS hostname - * resolver. - * - * IID_IRMAResolverResponse: - * - * {0000010A-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAResolverResponse, 0x0000010A, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAResolverResponse - -DECLARE_INTERFACE_(IRMAResolverResponse, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAResolverResponse methods - */ - - STDMETHOD(GetHostByNameDone) (THIS_ - PN_RESULT status, - ULONG32 ulAddr) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAInterruptSafe - * - * Purpose: - * - * This interface is used in Macintosh implementations of callback - * functions, renderers, etc... to determine if interrupt time execution - * is supported. If this interface is not implemented then it is assumed - * that interrupt time execution is NOT supported. There are restrictions - * on what may be executed at interrupt time; please consult the Macintosh - * Deferred Task Manager tech notes from Apple. - * - * IID_IRMAInterruptSafe: - * - * {0000010B-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAInterruptSafe, 0x0000010B, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAInterruptSafe - -DECLARE_INTERFACE_(IRMAInterruptSafe, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAInterruptSafe methods - */ - - /************************************************************************ - * Method: - * IRMAInterruptSafe::IsInterruptSafe - * Purpose: - * This is the function that will be called to determine if - * interrupt time execution is supported. - */ - STDMETHOD_(BOOL,IsInterruptSafe) (THIS) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAAsyncIOSelection - * - * Purpose: - * - * This interface is implemented by the server/player context on Unix - * platforms. This interface allows your plugin to get callbacks based - * I/O events that are normally handled by select(). This interface - * allows you to setup callbacks which will be executed when a file - * descriptor is ready for reading, writing, or has an exception. - * - * IID_IRMAAsyncIOSelection: - * - * {0000010C-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAAsyncIOSelection, 0x0000010C, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAAsyncIOSelection - -DECLARE_INTERFACE_(IRMAAsyncIOSelection, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAAsyncIOSelection methods - */ - - /************************************************************************ - * Method: - * IRMAAsyncIOSelection::Add - * Purpose: - * This function will allow you to receive a callback when the - * given descriptor is ready for read, write, or has an - * exception. This function is only available on Unix, and is - * intended to replace the functionality of select(). - */ - STDMETHOD(Add) (THIS_ - IRMACallback* pCallback, - INT32 lFileDescriptor, - UINT32 ulType) PURE; - - /************************************************************************ - * Method: - * IRMAAsyncIOSelection::Remove - * Purpose: - * This function will allow you remove the callback associated - * with the given descriptor from the event handler. - * This function is only available on Unix, and is intended to - * replace the functionality of select(). - */ - STDMETHOD(Remove) (THIS_ - INT32 lFileDescriptor, - UINT32 ulType) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAUDPMulticastInit - * - * Purpose: - * - * Provides the user with a way to set the TTL for outgoing multicast - * UDP packets. Usually shared with IRMAUDPSocket. - * - * IID_IRMAUDPMulticastInit: - * - * {0000010D-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAUDPMulticastInit, 0x0000010D, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAUDPMulticastInit - -DECLARE_INTERFACE_(IRMAUDPMulticastInit, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAUDPMulticastInit methods - * - */ - - /************************************************************************ - * Method: - * IRMAUDPMulticastInit::InitMulticast - * Purpose: - * This function will set the TTL (time to live) for the UDP socket - * so it can be used as a multicast socket, sending packets across - * the number of routers specified in the ulTTL parameter. - */ - - STDMETHOD(InitMulticast) (THIS_ - UINT8 chTTL) PURE; -}; - -/**************************************************************************** - * - * Interface: - * - * IRMAInterruptState - * - * Purpose: - * - * This interface is used in Macintosh implementations to inform the - * the client engine when entering & leaving an interupt task. It is - * also used to determine if it is currently at interrupt time. - * Please consult the Macintosh Deferred Task Manager tech notes from Apple - * for information on interrupt tasks. - * - * IID_IRMAInterruptState: - * - * {0000010E-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAInterruptState, 0x0000010E, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAInterruptState - -DECLARE_INTERFACE_(IRMAInterruptState, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAInterruptState methods - */ - - /************************************************************************ - * Method: - * IRMAInterruptState::AtInterruptTime - * Purpose: - * This function is called to determine if we are currently at - * interrupt task time. - */ - STDMETHOD_(BOOL,AtInterruptTime) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAInterruptState::EnterInterruptState - * Purpose: - * This function is called when starting a deferred/interrupt task - */ - STDMETHOD(EnterInterruptState) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAInterruptState::LeaveInterruptState - * Purpose: - * This function is called when leaving a deferred/interrupt task - */ - STDMETHOD(LeaveInterruptState) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAInterruptState::EnableInterrupt - * Purpose: - * This function can be called to enable/disable interrupt time - * processsing - */ - STDMETHOD(EnableInterrupt) (THIS_ - BOOL bEnable) PURE; - - /************************************************************************ - * Method: - * IRMAInterruptState::IsInterruptEnabled - * Purpose: - * This function can be called to find if the core is currently - * interrupt enabled. - */ - STDMETHOD_(BOOL, IsInterruptEnabled) (THIS) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAOptimizedScheduler - * - * Purpose: - * - * This interface provides the user with a way of scheduling callbacks - * that will be executed at some time in the future. - * - * This interface should ONLY be used if you need accurately timed - * callbacks. These callbacks should be efficient and should not consume - * much time/CPU. This is not a thread safe interface. The user has to - * take care of synchronization in their callbacks. - * - * IID_IRMAOptimizedScheduler: - * - * {0000010F-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAOptimizedScheduler, 0x0000010F, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAOptimizedScheduler - -DECLARE_INTERFACE_(IRMAOptimizedScheduler, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAOptimizedScheduler methods - */ - - /************************************************************************ - * Method: - * IRMAOptimizedScheduler::RelativeEnter - * Purpose: - * Schedule a callback to be executed "ms" milliseconds from now - * This function is less percise then AbsoluteEnter and should only - * be used when accurate timing is not critical. - */ - STDMETHOD_(CallbackHandle,RelativeEnter) (THIS_ - IRMACallback* pCallback, - UINT32 ms) PURE; - - /************************************************************************ - * Method: - * IRMAOptimizedScheduler::AbsoluteEnter - * Purpose: - * Schedule a callback to be executed at time "tVal". - */ - STDMETHOD_(CallbackHandle,AbsoluteEnter) (THIS_ - IRMACallback* pCallback, - RMATimeval tVal) PURE; - - /************************************************************************ - * Method: - * IRMAOptimizedScheduler::Remove - * Purpose: - * Remove a callback from the scheduler. - */ - STDMETHOD(Remove) (THIS_ - CallbackHandle Handle) PURE; - - /************************************************************************ - * Method: - * IRMAOptimizedScheduler::GetCurrentSchedulerTime - * Purpose: - * Gives the current time (in the timeline of the scheduler). - */ - STDMETHOD_(RMATimeval,GetCurrentSchedulerTime) (THIS) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMALoadBalancedListen - * - * Purpose: - * - * This interface is queried off of IRMAListenSocket. It allows - * a plugin to specify that it wants the server to load balance - * multiple instances of itself. The server will instantiate multiple - * instances of the plugin as needed based on socket / descriptor limits. - * Each plugin instance should attempt to listen on the same port as - * other instances (they will share the port). - * - * IID_IRMALoadBalancedListen: - * - * {00000110-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMALoadBalancedListen, 0x00000110, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMALoadBalancedListen - -DECLARE_INTERFACE_(IRMALoadBalancedListen, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMALoadBalancedListen methods - */ - - /************************************************************************ - * Method: - * IRMALoadBalancedListen::SetID - * Purpose: - * This function set's the unique ID for this listen socket. This - * ID is used to determine whether or not different instances of - * a plugin trying to listen on a single port are actually the - * same plugin. Without this function, it would be possible for - * two completely different plugins to listen on the same port using - * the load balanced listener. - */ - STDMETHOD(SetID) (THIS_ - REFIID ID) PURE; - - /************************************************************************ - * Method: - * IRMALoadBalancedListen::SetReserveLimit - * Purpose: - * Sets the reserve limit for descriptors / sockets. If less - * than reserve limit descriptors / sockets are left then a new - * instance of the plugin will be created. - */ - STDMETHOD(SetReserveLimit) (THIS_ - UINT32 ulDescriptors, - UINT32 ulSockets) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAOverrideDefaultServices - * - * Purpose: - * - * This interface is queried off of the context. It allows - * a plugin to override any default services provided by the G2 system. - * Currently, it is supported only on the client side. - * You may currently override IRMANetworkServices using this interface - * You can use the same interface to later restore back the overriden services. - * This is done by calling the same OverrideServices() function with the - * original service QIed before the initial override. - * - * IID_IRMAOverrideDefaultServices: - * - * {00000111-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAOverrideDefaultServices, 0x00000111, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAOverrideDefaultServices - -DECLARE_INTERFACE_(IRMAOverrideDefaultServices, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAOverrideDefaultServices methods - */ - - /************************************************************************ - * Method: - * IRMAOverrideDefaultServices::OverrideServices - * Purpose: - * Override default services provided by the G2 system. - * - */ - STDMETHOD(OverrideServices) (THIS_ - IUnknown* pContext) PURE; -}; - -enum PN_SOCKET_OPTION -{ - PN_SOCKOPT_REUSE_ADDR, - PN_SOCKOPT_REUSE_PORT, - PN_SOCKOPT_BROADCAST, - PN_SOCKOPT_SET_RECVBUF_SIZE, - PN_SOCKOPT_SET_SENDBUF_SIZE -}; - -/**************************************************************************** - * - * Interface: - * - * IRMASetSocketOption - * - * Purpose: - * - * Set sockt option - * - * IID_IRMASetSocketOption: - * - * IID_IRMASetSocketOption: {00000114-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMASetSocketOption, - 0x00000114, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMASetSocketOption -DECLARE_INTERFACE_(IRMASetSocketOption, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAListenSocket methods - */ - - STDMETHOD(SetOption) (THIS_ - PN_SOCKET_OPTION option, - UINT32 ulValue) PURE; -}; - -#define RMA_THREADSAFE_METHOD_FF_GETPACKET 0x00000001 -/* - * FileFormat::GetPacket() only calls: - * CCF->CI(Buffer), CCF->CI(Packet), CCF->CI(Values), *Alloc, *Free, - * FS->Read(), FS->Close(), FS->Seek(), - * FFR->PacketReady(), FFR->StreamDone() - * Context->Scheduler->*, - * CCF->CI(Mutex), Mutex->* - * Context->ErrorMessages - * - * XXXSMPNOW - */ - -#define RMA_THREADSAFE_METHOD_FS_READ 0x00000002 -/* - * FileSystem::Read()/Seek()/Close() only calls: - * CCF->CI(Buffer), CCF->CI(Packet), CCF->CI(Values), *Alloc, *Free, - * FS->Read(), FS->Close(), FS->Seek(), - * Context->Scheduler->*, - * CCF->CI(Mutex), Mutex->* - * Context->ErrorMessages - * - * XXXSMPNOW - */ -#define RMA_THREADSAFE_METHOD_FSR_READDONE 0x00000004 -/* - * FileFormat::ReadDone()/SeekDone()/CloseDone() only calls: - * CCF->CI(Buffer), CCF->CI(Packet), CCF->CI(Values), *Alloc, *Free, - * FS->Read(), FS->Close(), FS->Seek(), - * FFR->PacketReady(), FFR->StreamDone() - * Context->Scheduler->*, - * CCF->CI(Mutex), Mutex->* - * Context->ErrorMessages - * - * XXXSMPNOW - */ -#define RMA_THREADSAFE_METHOD_CACHE_FILE 0x00000008 -/* - * FileSystem::Read()/Seek()/Close() only calls: - * CCF->CI(Buffer), CCF->CI(Packet), CCF->CI(Values), *Alloc, *Free, - * FS->Read(), FS->Close(), FS->Seek(), - * IRMACacheFile->*, IRMACacheFileResponse->*, - * Context->Scheduler->*, - * CCF->CI(Mutex), Mutex->* - * Context->ErrorMessages - * - * XXXSMPNOW - */ -#define RMA_THREADSAFE_METHOD_CACHE_FILE_RESPONSE 0x00000010 -/* - * FileSystem::Read()/Seek()/Close() only calls: - * CCF->CI(Buffer), CCF->CI(Packet), CCF->CI(Values), *Alloc, *Free, - * FS->Read(), FS->Close(), FS->Seek(), - * IRMACacheFile->*, IRMACacheFileResponse->*, - * Context->Scheduler->*, - * CCF->CI(Mutex), Mutex->* - * Context->ErrorMessages - * - * XXXSMPNOW - */ - -/**************************************************************************** - * - * Interface: - * - * IRMAThreadSafeMethods - * - * Purpose: - * - * XXXSMPNOW - * - * IID_IRMAThreadSafeMethods: - * - * {00000115-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAThreadSafeMethods, 0x00000115, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAThreadSafeMethods - -DECLARE_INTERFACE_(IRMAThreadSafeMethods, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAThreadSafeMethods methods - */ - - /************************************************************************ - * Method: - * IRMAThreadSafeMethods::IsThreadSafe - * Purpose: - * XXXSMPNOW - */ - STDMETHOD_(UINT32,IsThreadSafe) (THIS) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAMutex - * - * Purpose: - * - * XXXSMPNOW - * - * IID_IRMAMutex: - * - * {00000116-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAMutex, 0x00000116, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAMutex - -/* - * The IRMACommonClassFactory supports creating an instance - * of this object. - */ -#define CLSID_IRMAMutex IID_IRMAMutex - -DECLARE_INTERFACE_(IRMAMutex, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAMutex methods - */ - - /* XXXSMPNOW Comments */ - STDMETHOD(Lock) (THIS) PURE; - - STDMETHOD(TryLock) (THIS) PURE; - - STDMETHOD(Unlock) (THIS) PURE; -}; - - -#endif /* _RMAENGIN_H_ */ diff --git a/include/realmedia/rmaerror.h b/include/realmedia/rmaerror.h deleted file mode 100644 index c923c5a33..000000000 --- a/include/realmedia/rmaerror.h +++ /dev/null @@ -1,276 +0,0 @@ -/**************************************************************************** - * - * $Id: rmaerror.h 7 2003-05-30 02:18:02Z gabest $ - * - * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved. - * - * http://www.real.com/devzone - * - * This program contains proprietary - * information of Progressive Networks, Inc, and is licensed - * subject to restrictions on use and distribution. - * - * - * RealMedia Architecture error reporting interfaces. - * - */ - -#ifndef _RMAERROR_H_ -#define _RMAERROR_H_ - -/* - * Forward declarations of some interfaces defined here-in. - */ -typedef _INTERFACE IRMABuffer IRMABuffer; -typedef _INTERFACE IRMAErrorSinkControl IRMAErrorSinkControl; - - -/* Message Severity values */ - -enum { - PNLOG_EMERG = 0, /* A panic condition. Server / Player will halt or - restart. */ - - PNLOG_ALERT = 1, /* A condition that should be corrected immediately. - Needs user intervention to prevent problems. */ - - PNLOG_CRIT = 2, /* Critical conditions. */ - - PNLOG_ERR = 3, /* Errors. */ - - PNLOG_WARNING = 4, /* Warning messages. */ - - PNLOG_NOTICE = 5, /* Conditions that are not error conditions, but - should possibly be handled specially. */ - - PNLOG_INFO = 6, /* Informational messages. */ - - PNLOG_DEBUG = 7 /* Messages that contain information normally of use - only when debugging a program. */ -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAErrorMessages - * - * Purpose: - * - * Error, event, and status message reporting interface - * - * IID_IRMAErrorMessages: - * - * {00000800-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAErrorMessages, 0x00000800, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAErrorMessages - -DECLARE_INTERFACE_(IRMAErrorMessages, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAErrorMessages methods - */ - - /************************************************************************ - * Method: - * IRMAErrorMessages::Report - * Purpose: - * Call this method to report an error, event, or status message. - * Parameters: - * - * const UINT8 unSeverity - * Type of report. This value will impact how the player, tool, or - * server will react to the report. Possible values are described - * above. Depending on the error type, an error message with the - * RMA code, anda string translation of that code will be displayed. - * The error dialog includes a "more info" section that displays the - * user code and string, and a link to the more info URL. In the - * server these messages are logged to the log file. - * - * const ULONG32 ulRMACode - * Well known RMA error code. This will be translated to a text - * representation for display in an error dialog box or log file. - * - * const ULONG32 ulUserCode - * User specific error code. This will NOT be translated to a text - * representation. This can be any value the caller wants, it will - * be logged or displayed but not interpretted. - * - * const char* pUserString - * User specific error string. This will NOT be translated or - * modified. This can be any value the caller wants, it will - * be logged or displayed but not interpretted. - * - * const char* pMoreInfoURL - * User specific more info URL string. - * - */ - STDMETHOD(Report) (THIS_ - const UINT8 unSeverity, - PN_RESULT ulRMACode, - const ULONG32 ulUserCode, - const char* pUserString, - const char* pMoreInfoURL) PURE; - - /************************************************************************ - * Method: - * IRMAErrorMessages::GetErrorText - * Purpose: - * Call this method to get the text description of a RMA error code. - * Parameters: - * PN_RESULT ulRMACode (A RMA error code) - * Return Value: - * IRMABuffer* containing error text. - */ - STDMETHOD_(IRMABuffer*, GetErrorText) (THIS_ - PN_RESULT ulRMACode) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAErrorSink - * - * Purpose: - * - * Error Sink Interface - * - * IID_IRMAErrorSink: - * - * {00000801-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAErrorSink, 0x00000801, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAErrorSink - -DECLARE_INTERFACE_(IRMAErrorSink, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAErrorSink methods - */ - - /************************************************************************ - * Method: - * IRMAErrorSink::ErrorOccurred - * Purpose: - * After you have registered your error sink with an - * IRMAErrorSinkControl (either in the server or player core) this - * method will be called to report an error, event, or status message. - * - * The meaning of the arguments is exactly as described in - * rmaerror.h - */ - STDMETHOD(ErrorOccurred) (THIS_ - const UINT8 unSeverity, - const ULONG32 ulRMACode, - const ULONG32 ulUserCode, - const char* pUserString, - const char* pMoreInfoURL - ) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAErrorSinkControl - * - * Purpose: - * - * Error Sink Control Interface - * - * IID_IRMAErrorSinkControl: - * - * {00000802-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAErrorSinkControl, 0x00000802, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAErrorSinkControl - - -DECLARE_INTERFACE_(IRMAErrorSinkControl, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAErrorSinkControl methods - */ - - /************************************************************************ - * Method: - * IRMAErrorSinkControl::AddErrorSink - * Purpose: - * Call this method to tell the sink controller to handle an error - * sink. - * - * This method also allows you to set a range of severity levels which - * you will receive reports for. - * - * Note: You should specify an invalid range (Low = 1, High = 0 for - * example) if you don't want to receive any errors. - * - * The default severity range is PNLOG_EMERG to PNLOG_INFO (0-6). - */ - STDMETHOD(AddErrorSink) (THIS_ - IRMAErrorSink* pErrorSink, - const UINT8 unLowSeverity, - const UINT8 unHighSeverity) PURE; - - /************************************************************************ - * Method: - * IRMAErrorSinkControl::AddErrorSink - * Purpose: - * Call this method to remove an error sink. - */ - STDMETHOD(RemoveErrorSink) (THIS_ - IRMAErrorSink* pErrorSink) PURE; - -}; - -#endif /* _RMAERROR_H_ */ diff --git a/include/realmedia/rmaevent.h b/include/realmedia/rmaevent.h deleted file mode 100644 index 6a0ee2fc3..000000000 --- a/include/realmedia/rmaevent.h +++ /dev/null @@ -1,90 +0,0 @@ -/**************************************************************************** - * - * $Id: rmaevent.h 7 2003-05-30 02:18:02Z gabest $ - * - * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved. - * - * This program contains proprietary information of RealNetworks, Inc., - * and is licensed subject to restrictions on use and distribution. - * - * rmaevent.h - * - */ - -#ifndef _RMAEVENT_H_ -#define _RMAEVENT_H_ - -#define RMA_BASE_EVENT 0x00001000UL - -// This class of events are events sent to site users of windowless -// sites to notify them of events on the site with platform independent -// messages. -#define RMA_SURFACE_EVENTS RMA_BASE_EVENT + 0x00001000 - -// RMA_SURFACE_UPDATE is sent by the site to the renderer when the -// surface has damage and needs to be updated. The event struct is -// filled out as follows: -// -// ULONG32 event; RMA_SURFACE_UPDATE -// void* window; Native Window - may be null if no window is associated with the site -// void* param1; IRMAVideoSurface* -// void* param2; UNIX - PNxWindow, Mac/Win - UNUSED -// -// void* result; HRESULT result code of message handling -// BOOL handled; TRUE if handled, FALSE if not handled -// -#define RMA_SURFACE_UPDATE RMA_SURFACE_EVENTS + 1 - -// Each event should document the values of PNxEvent struct expected -// on input and output. -// The next surface event should use this ID: -#define RMA_SURFACE_NEXT_EVENT RMA_SURFACE_EVENTS + 2 - -// This class of events are sent to site users to -// notify them of mouse events. -// All mouse events have the event structure filled out as follows: -// -// UINT32 event; -// void* window; -// void* param1; PNxPoint struct with mouse position local to the renderer -// void* param2; UINT32 of flags for modifier keys -// void* result; HRESULT result code of message handling -// BOOL handled; TRUE if handled, FALSE if not handled -// -#define RMA_MOUSE_EVENTS (RMA_BASE_EVENT + 0x00002000) - -#define RMA_SHIFT_KEY 0x00000001 -#define RMA_CTRL_KEY 0x00000002 -#define RMA_ALT_COMMAND_KEY 0x00000004 // Apple/Splat key - -#define RMA_PRIMARY_BUTTON_DOWN (RMA_MOUSE_EVENTS + 1) -#define RMA_PRIMARY_BUTTON_UP (RMA_MOUSE_EVENTS + 2) -#define RMA_CONTEXT_BUTTON_DOWN (RMA_MOUSE_EVENTS + 3) -#define RMA_CONTEXT_BUTTON_UP (RMA_MOUSE_EVENTS + 4) -#define RMA_MOUSE_MOVE (RMA_MOUSE_EVENTS + 5) -#define RMA_MOUSE_ENTER (RMA_MOUSE_EVENTS + 6) -#define RMA_MOUSE_LEAVE (RMA_MOUSE_EVENTS + 7) - -// This class of events are sent to renderers to -// notify them of the validation of the window -// All window events have the event structure filled out as follows: -// -// UINT32 event; -// void* window; -// void* UNUSED; -// void* UNUSED; -// void* result; HRESULT result code of message handling -// BOOL handled; TRUE if handled, FALSE if not handled -// -#define RMA_WINDOW_EVENTS RMA_BASE_EVENT + 0x00003000 - -#define RMA_ATTACH_WINDOW RMA_WINDOW_EVENTS + 1 -#define RMA_DETACH_WINDOW RMA_WINDOW_EVENTS + 2 - -// Each event class should have a comment describing the kinds -// of events that belong to this class -// The next event class should use this base: -#define RMA_NEXT_EVENT_CLASS RMA_BASE_EVENT + 0x00004000 - - -#endif // _RMAEVENT_H_ diff --git a/include/realmedia/rmafiles.h b/include/realmedia/rmafiles.h deleted file mode 100644 index 33e8b5a32..000000000 --- a/include/realmedia/rmafiles.h +++ /dev/null @@ -1,1583 +0,0 @@ -/**************************************************************************** - * - * $Id: rmafiles.h 7 2003-05-30 02:18:02Z gabest $ - * - * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved.. - * - * http://www.real.com/devzone - * - * This program contains proprietary - * information of Progressive Networks, Inc, and is licensed - * subject to restrictions on use and distribution. - * - * - * RealMedia Architecture File Format and File System Plug-in Interfaces. - * - */ - -#ifndef _RMAFILES_H_ -#define _RMAFILES_H_ - -/* - * Forward declarations of some interfaces defined here-in. - */ -typedef _INTERFACE IRMAFileObject IRMAFileObject; -typedef _INTERFACE IRMAFileResponse IRMAFileResponse; -typedef _INTERFACE IRMAFileSystemObject IRMAFileSystemObject; -typedef _INTERFACE IRMAFileStat IRMAFileStat; -typedef _INTERFACE IRMAFileStatResponse IRMAFileStatResponse; - -typedef _INTERFACE IRMAFileSystemManager IRMAFileSystemManager; -typedef _INTERFACE IRMAFileSystemManagerResponse IRMAFileSystemManagerResponse; -typedef _INTERFACE IRMAFileExists IRMAFileExists; -typedef _INTERFACE IRMAFileExistsResponse IRMAFileExistsResponse; -typedef _INTERFACE IRMAFileMimeMapper IRMAFileMimeMapper; -typedef _INTERFACE IRMAFileMimeMapperResponse IRMAFileMimeMapperResponse; -typedef _INTERFACE IRMABroadcastMapper IRMABroadcastMapper; -typedef _INTERFACE IRMABroadcastMapperResponse IRMABroadcastMapperResponse; -typedef _INTERFACE IRMAGetFileFromSamePoolResponse IRMAGetFileFromSamePoolResponse; -typedef _INTERFACE IRMABuffer IRMABuffer; -typedef _INTERFACE IRMAPacket IRMAPacket; -typedef _INTERFACE IRMAValues IRMAValues; -typedef _INTERFACE IRMAMetaCreation IRMAMetaCreation; - -typedef _INTERFACE IRMAAuthenticator IRMAAuthenticator; -typedef _INTERFACE IRMARequest IRMARequest; -typedef _INTERFACE IRMAFileRename IRMAFileRename; -typedef _INTERFACE IRMADirHandler IRMADirHandler; -typedef _INTERFACE IRMADirHandlerResponse IRMADirHandlerResponse; -typedef _INTERFACE IRMAFileRemove IRMAFileRemove; - - - -/**************************************************************************** - * Defines: - * PN_FILE_XXXX - * Purpose: - * Flags for opening file objects - */ -#define PN_FILE_READ 1 -#define PN_FILE_WRITE 2 -#define PN_FILE_BINARY 4 -#define PN_FILE_NOTRUNC 8 - - -/**************************************************************************** - * Defines: - * RMA_FILEADVISE_XXXX - * Purpose: - * Flags for file object Advise method - */ -#define RMA_FILEADVISE_RANDOMACCESS 1 - - -#if defined(_UNIX) || defined(_WINDOWS) -#include -/* - * This is a subset of standard stat()/fstat() values that both Unix and - * Windows support (or at least define). - * - * These flags are returned from IRMAFileStatResponse::StatDone() in the - * ulMode argument. - */ -#define PN_S_IFMT S_IFMT -#define PN_S_IFDIR S_IFDIR -#define PN_S_IFCHR S_IFCHR -#define PN_S_IFIFO S_IFIFO -#define PN_S_IFREG S_IFREG -#else -/* Macintosh */ -#define PN_S_IFMT 0170000 -#define PN_S_IFDIR 0040000 -#define PN_S_IFCHR 0020000 -#define PN_S_IFIFO 0010000 -#define PN_S_IFREG 0100000 -#endif - - -/**************************************************************************** - * - * Interface: - * - * IRMAFileObject - * - * Purpose: - * - * Object that exports file control API - * - * IID_IRMAFileObject: - * - * {00000200-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAFileObject, 0x00000200, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAFileObject - -DECLARE_INTERFACE_(IRMAFileObject, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAFileObject methods - */ - - /************************************************************************ - * Method: - * IRMAFileObject::Init - * Purpose: - * Associates a file object with the file response object it should - * notify of operation completness. This method should also check - * for validity of the object (for example by opening it if it is - * a local file). - */ - STDMETHOD(Init) (THIS_ - ULONG32 /*IN*/ ulFlags, - IRMAFileResponse* /*IN*/ pFileResponse) PURE; - - /************************************************************************ - * Method: - * IRMAFileObject::GetFilename - * Purpose: - * Returns the filename (without any path information) associated - * with a file object. - * - * Note: The returned pointer's lifetime expires as soon as the - * caller returns from a function which was called from the RMA - * core (i.e. when you return control to the RMA core) - * - */ - STDMETHOD(GetFilename) (THIS_ - REF(const char*) /*OUT*/ pFilename) PURE; - - /************************************************************************ - * Method: - * IRMAFileObject::Close - * Purpose: - * Closes the file resource and releases all resources associated - * with the object. - */ - STDMETHOD(Close) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAFileObject::Read - * Purpose: - * Reads a buffer of data of the specified length from the file - * and asynchronously returns it to the caller via the - * IRMAFileResponse interface passed in to Init. - */ - STDMETHOD(Read) (THIS_ - ULONG32 ulCount) PURE; - - /************************************************************************ - * Method: - * IRMAFileObject::Write - * Purpose: - * Writes a buffer of data to the file and asynchronously notifies - * the caller via the IRMAFileResponse interface passed in to Init, - * of the completeness of the operation. - */ - STDMETHOD(Write) (THIS_ - IRMABuffer* pBuffer) PURE; - - /************************************************************************ - * Method: - * IRMAFileObject::Seek - * Purpose: - * Seeks to an offset in the file and asynchronously notifies - * the caller via the IRMAFileResponse interface passed in to Init, - * of the completeness of the operation. - * If the bRelative flag is TRUE, it is a relative seek; else - * an absolute seek. - */ - STDMETHOD(Seek) (THIS_ - ULONG32 ulOffset, - BOOL bRelative) PURE; - - /************************************************************************ - * Method: - * IRMAFileObject::Advise - * Purpose: - * To pass information to the File Object advising it about usage - * heuristics. - */ - STDMETHOD(Advise) (THIS_ - ULONG32 ulInfo) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAFileResponse - * - * Purpose: - * - * Object that exports file response API - * - * IID_IRMAFileResponse: - * - * {00000201-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAFileResponse, 0x00000201, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAFileResponse - -DECLARE_INTERFACE_(IRMAFileResponse, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAFileResponse methods - */ - - /************************************************************************ - * Method: - * IRMAFileResponse::InitDone - * Purpose: - * Notification interface provided by users of the IRMAFileObject - * interface. This method is called by the IRMAFileObject when the - * initialization of the file is complete. If the file is not valid - * for the file system, the status PNR_FAILED should be - * returned. - */ - STDMETHOD(InitDone) (THIS_ - PN_RESULT status) PURE; - - /************************************************************************ - * Method: - * IRMAFileResponse::CloseDone - * Purpose: - * Notification interface provided by users of the IRMAFileObject - * interface. This method is called by the IRMAFileObject when the - * close of the file is complete. - */ - STDMETHOD(CloseDone) (THIS_ - PN_RESULT status) PURE; - - /************************************************************************ - * Method: - * IRMAFileResponse::ReadDone - * Purpose: - * Notification interface provided by users of the IRMAFileObject - * interface. This method is called by the IRMAFileObject when the - * last read from the file is complete and a buffer is available. - */ - STDMETHOD(ReadDone) (THIS_ - PN_RESULT status, - IRMABuffer* pBuffer) PURE; - - /************************************************************************ - * Method: - * IRMAFileResponse::WriteDone - * Purpose: - * Notification interface provided by users of the IRMAFileObject - * interface. This method is called by the IRMAFileObject when the - * last write to the file is complete. - */ - STDMETHOD(WriteDone) (THIS_ - PN_RESULT status) PURE; - - /************************************************************************ - * Method: - * IRMAFileResponse::SeekDone - * Purpose: - * Notification interface provided by users of the IRMAFileObject - * interface. This method is called by the IRMAFileObject when the - * last seek in the file is complete. - */ - STDMETHOD(SeekDone) (THIS_ - PN_RESULT status) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAFileSystemObject - * - * Purpose: - * - * Object that allows a Controller to communicate with a specific - * File System plug-in session - * - * IID_IRMAFileSystemObject: - * - * {00000202-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAFileSystemObject, 0x00000202, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAFileSystemObject - -DECLARE_INTERFACE_(IRMAFileSystemObject, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAFileSystemObject methods - */ - - /************************************************************************ - * Method: - * IRMAFileSystemObject::GetFileSystemInfo - * Purpose: - * Returns information vital to the instantiation of file system - * plugin. - * - * pShortName should be a short, human readable name in the form - * of "company-fsname". For example: pShortName = "pn-local". - */ - STDMETHOD(GetFileSystemInfo) (THIS_ - REF(const char*) /*OUT*/ pShortName, - REF(const char*) /*OUT*/ pProtocol) PURE; - - STDMETHOD(InitFileSystem) (THIS_ - IRMAValues* pOptions) PURE; - - STDMETHOD(CreateFile) (THIS_ - IUnknown** /*OUT*/ ppFileObject) PURE; - - /* - * The following method is deprecated and should return PNR_NOTIMPL - */ - - STDMETHOD(CreateDir) (THIS_ - IUnknown** /*OUT*/ ppDirObject) PURE; - -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAFileStat - * - * Purpose: - * - * Gets information about a specific File object - * - * IID_IRMAFileStat: - * - * {00000205-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAFileStat, 0x00000205, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAFileStat - -DECLARE_INTERFACE_(IRMAFileStat, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAFileStat methods - */ - - STDMETHOD(Stat) (THIS_ - IRMAFileStatResponse* pFileStatResponse - ) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAFileStatResponse - * - * Purpose: - * - * Returns information about a specific File object - * - * IID_IRMAFileStatResponse: - * - * {00000206-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAFileStatResponse, 0x00000206, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAFileStatResponse - -DECLARE_INTERFACE_(IRMAFileStatResponse, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAFileStat methods - */ - - STDMETHOD(StatDone) (THIS_ - PN_RESULT status, - UINT32 ulSize, - UINT32 ulCreationTime, - UINT32 ulAccessTime, - UINT32 ulModificationTime, - UINT32 ulMode) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAFileSystemManager - * - * Purpose: - * - * Gives out File Objects based on URLs - * - * IID_IRMAFileSystemManager: - * - * {00000207-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAFileSystemManager, 0x00000207, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAFileSystemManager - -#define CLSID_IRMAFileSystemManager IID_IRMAFileSystemManager - -DECLARE_INTERFACE_(IRMAFileSystemManager, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAFileSystemManager methods - */ - - STDMETHOD(Init) (THIS_ - IRMAFileSystemManagerResponse* /*IN*/ pFileManagerResponse - ) PURE; - - /* GetFileObject attempts to locate an existing file via the DoesExist - * method in each file system's objects, and returns that object through - * FSManagerResponse->FileObjectReady - */ - STDMETHOD(GetFileObject) (THIS_ - IRMARequest* pRequest, - IRMAAuthenticator* pAuthenticator) PURE; - - /* GetNewFileObject is similar to GetFileObject except that no DoesExist - * checks are done. The first file system that matches the mount point - * or protocol for the path in the request object creates the file - * which is then returned through FileObjectReady. This is especially - * useful for those who wish to open a brand new file for writing. - */ - STDMETHOD(GetNewFileObject) (THIS_ - IRMARequest* pRequest, - IRMAAuthenticator* pAuthenticator) PURE; - - STDMETHOD(GetRelativeFileObject) (THIS_ - IUnknown* pOriginalObject, - const char* pPath) PURE; - - /* - * The following method is deprecated and should return PNR_NOTIMPL - */ - - STDMETHOD(GetDirObjectFromURL) (THIS_ - const char* pURL) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAFileSystemManagerResponse - * - * Purpose: - * - * Gives out File System objects based on URLs - * - * IID_IRMAFileSystemManagerResponse: - * - * {00000208-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAFileSystemManagerResponse, 0x00000208, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAFileSystemManagerResponse - -DECLARE_INTERFACE_(IRMAFileSystemManagerResponse, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAFileSystemManagerResponse methods - */ - - /************************************************************************ - * Method: - * IRMAFileSystemManagerResponse::InitDone - * Purpose: - */ - STDMETHOD(InitDone) (THIS_ - PN_RESULT status) PURE; - - STDMETHOD(FileObjectReady) (THIS_ - PN_RESULT status, - IUnknown* pObject) PURE; - - /* - * The following method is deprecated and should return PNR_NOTIMPL - */ - - STDMETHOD(DirObjectReady) (THIS_ - PN_RESULT status, - IUnknown* pDirObject) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAFileExists - * - * Purpose: - * - * Checks for the existense of a file. Must be implemented. - * - * IID_IRMAFileExists: - * - * {00000209-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAFileExists, 0x00000209, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAFileExists - -DECLARE_INTERFACE_(IRMAFileExists, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAFileExists methods - */ - - /************************************************************************ - * Method: - * IRMAFileExists::DoesExist - * Purpose: - */ - STDMETHOD(DoesExist) (THIS_ - const char* /*IN*/ pPath, - IRMAFileExistsResponse* /*IN*/ pFileResponse) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAFileExistsResponse - * - * Purpose: - * - * Response interface for IRMAFileExists. Must be implemented. - * - * IID_IRMAFileExistsResponse: - * - * {0000020A-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAFileExistsResponse, 0x0000020a, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAFileExists - -DECLARE_INTERFACE_(IRMAFileExistsResponse, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAFileExistsResponse methods - */ - - STDMETHOD(DoesExistDone) (THIS_ - BOOL bExist) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAFileMimeMapper - * - * Purpose: - * - * Allows you to specify a mime type for a specific file. - * Optional interface. - * - * IID_IRMAFileMimeMapper: - * - * {0000020B-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAFileMimeMapper, 0x0000020b, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAFileMimeMapper - -DECLARE_INTERFACE_(IRMAFileMimeMapper, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAFileMimeMapper methods - */ - - /************************************************************************ - * Method: - * IRMAFileMimeMapper::FindMimeType - * Purpose: - */ - STDMETHOD(FindMimeType) (THIS_ - const char* /*IN*/ pURL, - IRMAFileMimeMapperResponse* /*IN*/ pMimeMapperResponse - ) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAFileMimeMapperResponse - * - * Purpose: - * - * Response interface for IRMAFileMimeMapper. - * Optional interface. - * - * IID_IRMAFileMimeMapperResponse: - * - * {0000020C-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAFileMimeMapperResponse, 0x0000020c, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAFileMimeMapperResponse - -DECLARE_INTERFACE_(IRMAFileMimeMapperResponse, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAFileMimeMapperResponse methods - */ - - /************************************************************************ - * Method: - * IRMAFileMimeMapperResponse::MimeTypeFound - * Purpose: - * Notification interface provided by users of the IRMAFileMimeMapper - * interface. This method is called by the IRMAFileObject when the - * initialization of the file is complete, and the Mime type is - * available for the request file. If the file is not valid for the - * file system, the status PNR_FAILED should be returned, - * with a mime type of NULL. If the file is valid but the mime type - * is unknown, then the status PNR_OK should be returned with - * a mime type of NULL. - * - */ - STDMETHOD(MimeTypeFound) (THIS_ - PN_RESULT status, - const char* pMimeType) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMABroadcastMapper - * - * Purpose: - * - * Associates a file with a broadcast format plugin. - * Implementation only required by broadcast plugin file systems. - * - * IID_IRMABroadcastMapper: - * - * {0000020D-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMABroadcastMapper, 0x0000020d, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMABroadcastMapper - -DECLARE_INTERFACE_(IRMABroadcastMapper, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMABroadcastMapper methods - */ - - /************************************************************************ - * Method: - * IRMABroadcastMapper::FindBroadcastType - * Purpose: - */ - STDMETHOD(FindBroadcastType) (THIS_ - const char* /*IN*/ pURL, - IRMABroadcastMapperResponse* /*IN*/ pBroadcastMapperResponse) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMABroadcastMapperResponse - * - * Purpose: - * - * Response interface for IRMABroadcastMapper. - * Implementation only required by broadcast plugin file systems. - * - * IID_IRMABroadcastMapperResponse: - * - * {0000020E-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMABroadcastMapperResponse, 0x0000020e, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMABroadcastMapperResponse - -DECLARE_INTERFACE_(IRMABroadcastMapperResponse, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMABroadcastMapperResponse methods - */ - - /************************************************************************ - * Method: - * IRMABroadcastMapperResponse::BroadcastTypeFound - * Purpose: - * Notification interface provided by users of the IRMABroadcastMapper - * interface. This method is called by the File Object when the - * initialization of the file is complete, and the broadcast type is - * available for the request file. If the file is not valid for the - * file system, the status PNR_FAILED should be returned, - * with the broadcast type set to NULL. - * - */ - STDMETHOD(BroadcastTypeFound) (THIS_ - PN_RESULT status, - const char* pBroadcastType) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAGetFileFromSamePool - * - * Purpose: - * - * Gives out File Objects based on filenames and relative "paths" - * - * IID_IRMAGetFileFromSamePool: - * - * {0000020f-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAGetFileFromSamePool, 0x0000020f, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); -#undef INTERFACE -#define INTERFACE IRMAGetFileFromSamePool - -#define CLSID_IRMAGetFileFromSamePool IID_IRMAGetFileFromSamePool - -DECLARE_INTERFACE_(IRMAGetFileFromSamePool, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - - /* - * IRMAGetFileFromSamePool method - */ - /************************************************************************ - * Method: - * IRMAGetFileFromSamePool::GetFileObjectFromPool - * Purpose: - * To get another FileObject from the same pool. - */ - STDMETHOD(GetFileObjectFromPool) (THIS_ - IRMAGetFileFromSamePoolResponse*) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAGetFileFromSamePoolResponse - * - * Purpose: - * - * Gives out File Objects based on filenames and relative "paths" - * - * IID_IRMAGetFileFromSamePoolResponse: - * - * {00000210-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAGetFileFromSamePoolResponse, 0x00000210, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); -#undef INTERFACE -#define INTERFACE IRMAGetFileFromSamePoolResponse - -#define CLSID_IRMAGetFileFromSamePoolResponse IID_IRMAGetFileFromSamePoolResponse - -DECLARE_INTERFACE_(IRMAGetFileFromSamePoolResponse, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAGetFileFromSamePoolResponse method - */ - /************************************************************************ - * Method: - * IRMAGetFileFromSamePoolResponse::FileObjectReady - * Purpose: - * To return another FileObject from the same pool. - */ - STDMETHOD(FileObjectReady) (THIS_ - PN_RESULT status, - IUnknown* ppUnknown) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAFileAuthenticator - * - * Purpose: - * - * Set and Get a file object's authenticator object. - * - * IID_IRMAFileAuthenticator: - * - * {00000211-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAFileAuthenticator, 0x00000211, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); -#undef INTERFACE -#define INTERFACE IRMAFileAuthenticator - -#define CLSID_IRMAFileAuthenticator IID_IRMAFileAuthenticator - -DECLARE_INTERFACE_(IRMAFileAuthenticator, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAFileAuthenticator methods - */ - STDMETHOD(SetAuthenticator) (THIS_ - IRMAAuthenticator* pAuthenticator) PURE; - - STDMETHOD(GetAuthenticator) (THIS_ - REF(IRMAAuthenticator*) pAuthenticator) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMARequestHandler - * - * Purpose: - * - * Object to manage IRMARequest objects - * - * IID_IRMARequestHandler: - * - * {00000212-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMARequestHandler, 0x00000212, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); -#undef INTERFACE -#define INTERFACE IRMARequestHandler - -#define CLSID_IRMARequestHandler IID_IRMARequestHandler - -DECLARE_INTERFACE_(IRMARequestHandler, IUnknown) -{ - /* - * IUnknown methods - */ - - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMARequestHandler::SetRequest - * Purpose: - * Associates an IRMARequest with an object - */ - STDMETHOD(SetRequest) (THIS_ - IRMARequest* /*IN*/ pRequest) PURE; - - /************************************************************************ - * Method: - * IRMARequestHandler::GetRequest - * Purpose: - * Gets the IRMARequest object associated with an object - */ - STDMETHOD(GetRequest) (THIS_ - REF(IRMARequest*) /*OUT*/ pRequest) PURE; - -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMARequestContext - * - * Purpose: - * - * Object to manage the context of the Request - * - * IID_IRMARequestContext: - * - * {00000217-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMARequestContext, 0x00000217, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); -#undef INTERFACE -#define INTERFACE IRMARequestContext - -#define CLSID_IRMARequestContext IID_IRMARequestContext - -DECLARE_INTERFACE_(IRMARequestContext, IUnknown) -{ - /* - * IUnknown methods - */ - - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMARequestContext methods - */ - - /************************************************************************ - * Method: - * IRMARequestContext::SetUserContext - * Purpose: - * Sets the Authenticated users Context. - */ - STDMETHOD(SetUserContext) - ( - THIS_ - IUnknown* pIUnknownNewContext - ) PURE; - - /************************************************************************ - * Method: - * IRMARequestContext::GetUserContext - * Purpose: - * Gets the Authenticated users Context. - */ - STDMETHOD(GetUserContext) - ( - THIS_ - REF(IUnknown*) pIUnknownCurrentContext - ) PURE; - - /************************************************************************ - * Method: - * IRMARequestContext::SetRequester - * Purpose: - * Sets the Object that made the request. - */ - STDMETHOD(SetRequester) - ( - THIS_ - IUnknown* pIUnknownNewRequester - ) PURE; - - /************************************************************************ - * Method: - * IRMARequestContext::GetRequester - * Purpose: - * Gets the Object that made the request. - */ - STDMETHOD(GetRequester) - ( - THIS_ - REF(IUnknown*) pIUnknownCurrentRequester - ) PURE; -}; - -/**************************************************************************** - * - * Interface: - * - * IRMARequest - * - * Purpose: - * - * Object to manage the RFC822 headers sent by the client - * - * IID_IRMARequest: - * - * {00000213-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMARequest, 0x00000213, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); -#undef INTERFACE -#define INTERFACE IRMARequest - -#define CLSID_IRMARequest IID_IRMARequest - -DECLARE_INTERFACE_(IRMARequest, IUnknown) -{ - /* - * IUnknown methods - */ - - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMARequest methods - */ - - /************************************************************************ - * Method: - * IRMARequest::SetRequestHeaders - * Purpose: - * Sets the headers that will be sent in the RFC822 header section - * of the request message - */ - STDMETHOD(SetRequestHeaders) (THIS_ - IRMAValues* pRequestHeaders) PURE; - - /************************************************************************ - * Method: - * IRMARequest::GetRequestHeaders - * Purpose: - * Gets the headers that were sent in the RFC822 header section - * of the request message - */ - STDMETHOD(GetRequestHeaders) (THIS_ - REF(IRMAValues*) pRequestHeaders) PURE; - - /************************************************************************ - * Method: - * IRMARequest::SetResponseHeaders - * Purpose: - * Sets the headers that will be returned in the RFC822 header - * section of the response message - */ - STDMETHOD(SetResponseHeaders) (THIS_ - IRMAValues* pResponseHeaders) PURE; - - /************************************************************************ - * Method: - * IRMARequest::GetResponseHeaders - * Purpose: - * Gets the headers that were returned in the RFC822 header section - * of the response message - */ - STDMETHOD(GetResponseHeaders) (THIS_ - REF(IRMAValues*) pResponseHeaders) PURE; - - /************************************************************************ - * Method: - * IRMARequest::SetURL - * Purpose: - * Sets the fully qualified path associated with a file object. - * Note: On the server, this path does not include the file system - * mount point. - */ - STDMETHOD(SetURL) (THIS_ - const char* pURL) PURE; - - /************************************************************************ - * Method: - * IRMARequest::GetURL - * Purpose: - * Returns the fully qualified path associated with a file object. - * Note: On the server, this path does not include the file system - * mount point. - * - * Note: The returned pointer's lifetime expires as soon as the - * caller returns from a function which was called from the RMA - * core (i.e. when you return control to the RMA core) - */ - STDMETHOD(GetURL) (THIS_ - REF(const char*) pURL) PURE; -}; - -/**************************************************************************** - * - * Interface: - * - * IRMAFileRename - * - * Purpose: - * - * Interface to allow renaming of files. Query off of the File Object. - * Not all filesystem plugins implement this feature. - * - * IID_IRMAFileRename: - * - * {00000214-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAFileRename, 0x00000214, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); -#undef INTERFACE -#define INTERFACE IRMAFileRename - -DECLARE_INTERFACE_(IRMAFileRename, IUnknown) -{ - /* - * IUnknown methods - */ - - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAFileRename methods - */ - - /************************************************************************ - * Method: - * IRMAFileRename::Rename - * Purpose: - * Renames a file to a new name. - */ - STDMETHOD(Rename) (THIS_ - const char* pNewFileName) PURE; -}; - -/**************************************************************************** - * - * Interface: - * - * IRMADirHandler - * - * Purpose: - * - * Object that exports directory handler API - * - * IID_IRMADirHandler: - * - * {00000215-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMADirHandler, 0x00000215, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMADirHandler - -DECLARE_INTERFACE_(IRMADirHandler, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMADirHandler methods - */ - - /************************************************************************ - * Method: - * IRMADirHandler::InitDirHandler - * Purpose: - * Associates a directory handler with the directory handler - * response, it should notify of operation completness. - */ - STDMETHOD(InitDirHandler) (THIS_ - IRMADirHandlerResponse* /*IN*/ pDirResponse) PURE; - - /************************************************************************ - * Method: - * IRMADirHandler::CloseDirHandler - * Purpose: - * Closes the directory handler resource and releases all resources - * associated with the object. - */ - STDMETHOD(CloseDirHandler) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMADirHandler::MakeDir - * Purpose: - * Create the directory - */ - STDMETHOD(MakeDir) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMADirHandler::ReadDir - * Purpose: - * Get a dump of the directory - */ - STDMETHOD(ReadDir) (THIS) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMADirHandlerResponse - * - * Purpose: - * - * Object that exports the directory handler response API - * - * IID_IRMADirHandlerResponse: - * - * {00000216-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMADirHandlerResponse, 0x00000216, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMADirHandlerResponse - -DECLARE_INTERFACE_(IRMADirHandlerResponse, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMADirHandlerResponse methods - */ - - /************************************************************************ - * Method: - * IRMADirHandlerResponse::InitDirHandlerDone - * Purpose: - * Notification interface provided by users of the IRMADirHandler - * interface. This method is called by the IRMADirHandler when the - * initialization of the object is complete. - */ - STDMETHOD(InitDirHandlerDone) (THIS_ - PN_RESULT status) PURE; - - /************************************************************************ - * Method: - * IRMADirHandlerResponse::CloseDirHandlerDone - * Purpose: - * Notification interface provided by users of the IRMADirHandler - * interface. This method is called by the IRMADirHandler when the - * close of the directory is complete. - */ - STDMETHOD(CloseDirHandlerDone) (THIS_ - PN_RESULT status) PURE; - - /************************************************************************ - * Method: - * IRMADirHandler::MakeDirDone - * Purpose: - * Notification interface provided by users of the IRMADirHandler - * interface. This method is called by the IRMADirHandler when the - * attempt to create the directory is complete. - */ - STDMETHOD(MakeDirDone) (THIS_ - PN_RESULT status) PURE; - - /************************************************************************ - * Method: - * IRMADirHandler::ReadDirDone - * Purpose: - * Notification interface provided by users of the IRMADirHandler - * interface. This method is called by the IRMADirHandler when the - * read from the directory is complete and a buffer is available. - */ - STDMETHOD(ReadDirDone) (THIS_ - PN_RESULT status, - IRMABuffer* pBuffer) PURE; -}; - - - -/**************************************************************************** - * - * Interface: - * - * IRMAFileRemove - * - * Purpose: - * - * Interface to allow removing of files. Query off of the File Object. - * Not all filesystem plugins implement this feature. - * - * IID_IRMAFileRemove: - * - * {0000021A-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAFileRemove, 0x0000021A, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); -#undef INTERFACE -#define INTERFACE IRMAFileRemove - -DECLARE_INTERFACE_(IRMAFileRemove, IUnknown) -{ - /* - * IUnknown methods - */ - - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAFileRemove methods - */ - - /************************************************************************ - * Method: - * IRMAFileRemove::Remove - * Purpose: - * Removes a file from the file system. - */ - STDMETHOD(Remove) (THIS) PURE; -}; - - - - - -#endif /* _RMAFILES_H_ */ diff --git a/include/realmedia/rmaformt.h b/include/realmedia/rmaformt.h deleted file mode 100644 index 57a922521..000000000 --- a/include/realmedia/rmaformt.h +++ /dev/null @@ -1,518 +0,0 @@ -/**************************************************************************** - * - * $Id: rmaformt.h 7 2003-05-30 02:18:02Z gabest $ - * - * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved. - * - * http://www.real.com/devzone - * - * This program contains proprietary - * information of Progressive Networks, Inc, and is licensed - * subject to restrictions on use and distribution. - * - * - * RealMedia Architecture Broadcast Format Plug-in Interfaces. - * - */ - -#ifndef _RMAFORMT_H_ -#define _RMAFORMT_H_ - -#include "rmafiles.h" - -/* - * Forward declarations of some interfaces defined here-in. - */ -typedef _INTERFACE IRMAFileFormatObject IRMAFileFormatObject; -typedef _INTERFACE IRMABroadcastFormatObject IRMABroadcastFormatObject; -typedef _INTERFACE IRMAFormatResponse IRMAFormatResponse; -typedef _INTERFACE IRMAFileObject IRMAFileObject; -typedef _INTERFACE IRMANetworkServices IRMANetworkServices; -typedef _INTERFACE IRMAPacket IRMAPacket; -typedef _INTERFACE IRMAValues IRMAValues; -typedef _INTERFACE IRMAPacketTimeOffsetHandler IRMAPacketTimeOffsetHandler; -typedef _INTERFACE IRMAPacketTimeOffsetHandlerResponse - IRMAPacketTimeOffsetHandlerResponse; -typedef _INTERFACE IRMALiveFileFormatInfo IRMALiveFileFormatInfo; - - -/**************************************************************************** - * - * Interface: - * - * IRMAFileFormatObject - * - * Purpose: - * - * Object that allows a Controller to communicate with a specific - * File Format plug-in session - * - * IID_IRMAFileFormatObject: - * - * {00000F00-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAFileFormatObject, 0x00000F00, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAFileFormatObject - -DECLARE_INTERFACE_(IRMAFileFormatObject, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAFileFormatObject methods - */ - - /************************************************************************ - * Method: - * IRMAFileFormatObject::GetFileFormatInfo - * Purpose: - * Returns information vital to the instantiation of file format - * plugins. - */ - STDMETHOD(GetFileFormatInfo)(THIS_ - REF(const char**) /*OUT*/ pFileMimeTypes, - REF(const char**) /*OUT*/ pFileExtensions, - REF(const char**) /*OUT*/ pFileOpenNames - ) PURE; - - STDMETHOD(InitFileFormat) - (THIS_ - IRMARequest* /*IN*/ pRequest, - IRMAFormatResponse* /*IN*/ pFormatResponse, - IRMAFileObject* /*IN*/ pFileObject) PURE; - - STDMETHOD(GetFileHeader) (THIS) PURE; - - STDMETHOD(GetStreamHeader) (THIS_ - UINT16 unStreamNumber) PURE; - - STDMETHOD(GetPacket) (THIS_ - UINT16 unStreamNumber) PURE; - - STDMETHOD(Seek) (THIS_ - ULONG32 ulOffset) PURE; - - STDMETHOD(Close) (THIS) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMABroadcastFormatObject - * - * Purpose: - * - * Object that allows a Controller to communicate with a specific - * Broadcast Format plug-in session - * - * IID_IRMABroadcastFormatObject: - * - * {00000F01-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMABroadcastFormatObject, 0x00000F01, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMABroadcastFormatObject - -DECLARE_INTERFACE_(IRMABroadcastFormatObject, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMABroadcastFormatObject methods - */ - - /************************************************************************ - * Method: - * IRMABroadcastFormatObject::GetBroadcastFormatInfo - * Purpose: - * Returns information vital to the instantiation of broadcast format - * plugins. - */ - STDMETHOD(GetBroadcastFormatInfo)(THIS_ - REF(const char*) /*OUT*/ pToken) PURE; - - STDMETHOD(InitBroadcastFormat) (THIS_ - const char* /*IN*/ pURL, - IRMAFormatResponse* /*IN*/ pFormatResponse - ) PURE; - - STDMETHOD(GetFileHeader) (THIS) PURE; - - STDMETHOD(GetStreamHeader) (THIS_ - UINT16 unStreamNumber) PURE; - - STDMETHOD(StartPackets) (THIS_ - UINT16 unStreamNumber) PURE; - - STDMETHOD(StopPackets) (THIS_ - UINT16 unStreamNumber) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAFormatResponse - * - * Purpose: - * - * Object that allows a specific File Format Object to communicate - * with its user - * - * IID_IRMAFormatResponse: - * - * {00000F02-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAFormatResponse, 0x00000F02, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAFormatResponse - -DECLARE_INTERFACE_(IRMAFormatResponse, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAFormatResponse methods - */ - STDMETHOD(InitDone) (THIS_ - PN_RESULT status) PURE; - - STDMETHOD(PacketReady) (THIS_ - PN_RESULT status, - IRMAPacket* pPacket) PURE; - - STDMETHOD(SeekDone) (THIS_ - PN_RESULT status) PURE; - - STDMETHOD(FileHeaderReady) (THIS_ - PN_RESULT status, - IRMAValues* pHeader) PURE; - - STDMETHOD(StreamHeaderReady) (THIS_ - PN_RESULT status, - IRMAValues* pHeader) PURE; - - STDMETHOD(StreamDone) (THIS_ - UINT16 unStreamNumber) PURE; -}; - -/**************************************************************************** - * - * Interface: - * - * IRMAPacketFormat - * - * Purpose: - * - * Interface that modifies the behavior of an IRMAFileFormat by defining - * the packet format it will be creating. - * - * IID_IRMAPacketFormat: - * - * {00000F03-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAPacketFormat, 0x00000F03, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAPacketFormat - -DECLARE_INTERFACE_(IRMAPacketFormat, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAPacketFormat methods - */ - STDMETHOD(GetSupportedPacketFormats) - (THIS_ - REF(const char**) pFormats) PURE; - - STDMETHOD(SetPacketFormat) (THIS_ - const char* pFormat) PURE; -}; - -/**************************************************************************** - * - * Interface: - * - * IRMAPacketTimeOffsetHandler - * - * Purpose: - * - * Provides methods for handling the changing of a packets timestamp. - * - * IID_IRMAPacketTimeOffsetHandler: - * - * {00000F04-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAPacketTimeOffsetHandler, 0x00000F04, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - - -DECLARE_INTERFACE_(IRMAPacketTimeOffsetHandler, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAPacketTimeOffsetHandler methods - */ - - /************************************************************************ - * Method: - * IRMAPacketTimeOffsetHandler::Init - * Purpose: - * Initialize the IRMAPacketTimeOffsetHandler and set the response. - * Implementors should look up the MimeType. - */ - STDMETHOD(Init) (THIS_ - IRMAPacketTimeOffsetHandlerResponse* pResponse, - IRMAValues* pHeader, - IUnknown* pContext) PURE; - - /************************************************************************ - * Method: - * IRMAPacketTimeOffsetHandler::SetTimeOffset - * Purpose: - * Called to set the time offset. Uses a bool and a UINT32 instead - * of and INT32 so that the time offset wraps around after 47 days - * instead of 24. bPlus says whether to add or subtract. - */ - STDMETHOD(SetTimeOffset) (THIS_ - UINT32 ulTimeOffset, - BOOL bPlus) PURE; - - /************************************************************************ - * Method: - * IRMAPacketTimeOffsetHandler::HandlePacket - * Purpose: - * give the IRMAPacketTimeOffsetHandler a packet to modify for the - * time offset. - */ - STDMETHOD(HandlePacket) (THIS_ - IRMAPacket* pPacket) PURE; - -}; - -/**************************************************************************** - * - * Interface: - * - * IRMAPacketTimeOffsetHandlerResponse - * - * Purpose: - * - * Provides methods for the IRMAPacketTimeOffsetHandler to respond to. - * - * IID_IRMAPacketTimeOffsetHandlerResponse: - * - * {00000F05-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAPacketTimeOffsetHandlerResponse, 0x00000F05, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - - -DECLARE_INTERFACE_(IRMAPacketTimeOffsetHandlerResponse, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAPacketTimeOffsetHandler methods - */ - - /************************************************************************ - * Method: - * IRMAPacketTimeOffsetHandler::PacketReady - * Purpose: - * Called by IRMAPacketTimeOffsetHandler to pass back the packet - * when it is done with it. - */ - STDMETHOD(TimeOffsetPacketReady) (THIS_ - IRMAPacket* pPacket) PURE; - -}; - -/**************************************************************************** - * - * Interface: - * - * IRMALiveFileFormatInfo - * - * Purpose: - * - * Provides miscellaneous information needed to transmit a live stream. - * Optionally implemented by the file format object. - * - * IID_IRMALiveFileFormatInfo: - * - * {00000F06-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMALiveFileFormatInfo, 0x00000F06, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMALiveFileFormatInfo - -DECLARE_INTERFACE_(IRMALiveFileFormatInfo, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMALiveFileFormatInfo methods - */ - - /************************************************************************ - * Method: - * IRMALiveFileFormatInfo::VerifyFileCompatibility - * Purpose: - * Compares two file headers and returns PNR_OK if these two - * files can be transmitted sequentially in a single live - * presentation. - */ - STDMETHOD(VerifyFileCompatibility) (THIS_ - IRMAValues* pFileHeader1, - IRMAValues* pFileHeader2) PURE; - - /************************************************************************ - * Method: - * IRMALiveFileFormatInfo::VerifyStreamCompatibility - * Purpose: - * Compares two stream headers and returns PNR_OK if these two - * streams can be transmitted sequentially in a single live - * presentation. - */ - STDMETHOD(VerifyStreamCompatibility) (THIS_ - IRMAValues* pStreamHeader1, - IRMAValues* pStreamHeader2) PURE; - - /************************************************************************ - * Method: - * IRMALiveFileFormatInfo::IsLiveResendRequired - * Purpose: - * Returns TRUE if this stream requires the latest packet to be - * resent periodically in a live presentation. - */ - STDMETHOD_(BOOL,IsLiveResendRequired) (THIS_ - UINT16 unStreamNumber) PURE; - - /************************************************************************ - * Method: - * IRMALiveFileFormatInfo::GetResendBitrate - * Purpose: - * If periodic live resends are required for this stream, this - * method returns the rate at which we should resend packets. The - * resend rate is measured in bits per second. - */ - STDMETHOD(GetResendBitrate) (THIS_ - UINT16 unStreamNumber, - REF(UINT32) ulBitrate) PURE; - - /************************************************************************ - * Method: - * IRMALiveFileFormatInfo::GetResendDuration - * Purpose: - * If periodic live resends are required for this stream, this - * method returns the number of milliseconds for which this packet - * should be resent. - */ - STDMETHOD(GetResendDuration) (THIS_ - IRMAPacket* pPacket, - REF(UINT32) ulDuration) PURE; - - /************************************************************************ - * Method: - * IRMALiveFileFormatInfo::FormResendPacket - * Purpose: - * Forms a live resend packet based upon the original packet passed - * as the first parameter. This allows the file format plugin to - * make resend packets distinguishable from original packets. - */ - STDMETHOD(FormResendPacket) (THIS_ - IRMAPacket* pOriginalPacket, - REF(IRMAPacket*) pResendPacket) PURE; -}; - - - - -#endif /* _RMAFORMT_H_ */ diff --git a/include/realmedia/rmagroup.h b/include/realmedia/rmagroup.h deleted file mode 100644 index 14ad71b25..000000000 --- a/include/realmedia/rmagroup.h +++ /dev/null @@ -1,391 +0,0 @@ -/**************************************************************************** - * - * $Id: rmagroup.h 7 2003-05-30 02:18:02Z gabest $ - * - * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved. - * - * http://www.real.com/devzone - * - * This program contains proprietary - * information of Progressive Networks, Inc, and is licensed - * subject to restrictions on use and distribution. - * - * - * Group Interface. - * - */ - -#ifndef _IRMAGROUP_H_ -#define _IRMAGROUP_H_ - -/**************************************************************************** - * - * Forward declarations of some interfaces defined/used here-in. - */ -typedef _INTERFACE IRMAGroup IRMAGroup; -typedef _INTERFACE IRMAGroupManager IRMAGroupManager; -typedef _INTERFACE IRMAGroupSink IRMAGroupSink; -typedef _INTERFACE IRMAValues IRMAValues; - - -/**************************************************************************** - * - * Interface: - * - * IRMAGroup - * - * Purpose: - * - * - * IID_IRMAGroup: - * - * {0x00002400-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAGroup, 0x00002400, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - - -#undef INTERFACE -#define INTERFACE IRMAGroup - -DECLARE_INTERFACE_(IRMAGroup, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAGroup methods - */ - /************************************************************************ - * Method: - * IRMAGroup::SetGroupProperties - * Purpose: - * Set any group specific information like Title Author - * Copyright etc. - */ - STDMETHOD(SetGroupProperties) (THIS_ - IRMAValues* /*IN*/ pProperties) PURE; - - /************************************************************************ - * Method: - * IRMAGroup::GetGroupProperties - * Purpose: - * Get any group specific information. May return NULL. - */ - STDMETHOD_(IRMAValues*, GetGroupProperties) (THIS) PURE; - /************************************************************************ - * Method: - * IRMAGroup::GetTrackCount - * Purpose: - * Get the number of tracks within this group. - */ - STDMETHOD_(UINT16,GetTrackCount) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAGroup::GetTrack - * Purpose: - * Get ith track in this group - */ - STDMETHOD(GetTrack) (THIS_ - UINT16 /*IN*/ uTrackIndex, - REF(IRMAValues*) /*OUT*/ pTrack) PURE; - - /************************************************************************ - * Method: - * IRMAGroup::AddTrack - * Purpose: - * Add Tracks to the group. - */ - STDMETHOD(AddTrack) (THIS_ - IRMAValues* /*IN*/ pTrack) PURE; - - /************************************************************************ - * Method: - * IRMAGroup::RemoveTrack - * Purpose: - * Remove an already added track - */ - STDMETHOD(RemoveTrack) (THIS_ - UINT16 /*IN*/ uTrackIndex) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAGroupManager - * - * Purpose: - * - * - * IID_IRMAGroupManager: - * - * {0x00002401-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAGroupManager, 0x00002401, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - - -#undef INTERFACE -#define INTERFACE IRMAGroupManager - -DECLARE_INTERFACE_(IRMAGroupManager, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAGroupManager methods - */ - - /************************************************************************ - * Method: - * IRMAGroupManager::CreateGroup - * Purpose: - * Create a group - */ - STDMETHOD(CreateGroup) (REF(IRMAGroup*) pGroup) PURE; - - /************************************************************************ - * Method: - * IRMAGroupManager::GetGroupCount - * Purpose: - * Get the number of groups within the presentation. - */ - STDMETHOD_(UINT16,GetGroupCount) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAGroupManager::GetGroup - * Purpose: - * Get ith group in the presentation - */ - STDMETHOD(GetGroup) (THIS_ - UINT16 /*IN*/ uGroupIndex, - REF(IRMAGroup*) /*OUT*/ pGroup) PURE; - - /************************************************************************ - * Method: - * IRMAGroupManager::SetCurrentGroup - * Purpose: - * Play this group in the presentation. - */ - STDMETHOD(SetCurrentGroup) (THIS_ - UINT16 /*IN*/ uGroupIndex) PURE; - - /************************************************************************ - * Method: - * IRMAGroupMgr::GetCurrentGroup - * Purpose: - * Get the current group index - */ - STDMETHOD(GetCurrentGroup) (THIS_ - REF(UINT16) /*OUT*/ uGroupIndex) PURE; - - /************************************************************************ - * Method: - * IRMAGroupManager::AddGroup - * Purpose: - * Add a group to the presentation. - */ - STDMETHOD(AddGroup) (THIS_ - IRMAGroup* /*IN*/ pGroup) PURE; - - /************************************************************************ - * Method: - * IRMAGroupManager::RemoveGroup - * Purpose: - * Remove an already added group - */ - STDMETHOD(RemoveGroup) (THIS_ - UINT16 /*IN*/ uGroupIndex) PURE; - - - /************************************************************************ - * Method: - * IRMAGroupManager::AddSink - * Purpose: - * Add a sink to get notifications about any tracks or groups - * being added to the presentation. - */ - STDMETHOD(AddSink) (THIS_ - IRMAGroupSink* /*IN*/ pGroupSink) PURE; - - - /************************************************************************ - * Method: - * IRMAGroupManager::RemoveSink - * Purpose: - * Remove Sink - */ - STDMETHOD(RemoveSink) (THIS_ - IRMAGroupSink* /*IN*/ pGroupSink) PURE; - - /************************************************************************ - * Method: - * IRMAGroup::GetPresentationProperties - * Purpose: - * Get any presentation information. May return NULL. - */ - STDMETHOD_(IRMAValues*, GetPresentationProperties) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAGroup::SetPresentationProperties - * Purpose: - * Set any presentation information like Title Author - * Copyright etc. - */ - STDMETHOD(SetPresentationProperties) (THIS_ - IRMAValues* /*IN*/ pProperties) PURE; - -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAGroupSink - * - * Purpose: - * - * - * IID_IRMAGroupSink: - * - * {0x00002402-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAGroupSink, 0x00002402, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - - -#undef INTERFACE -#define INTERFACE IRMAGroupSink - -DECLARE_INTERFACE_(IRMAGroupSink, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAGroupSink methods - */ - /************************************************************************ - * Method: - * IRMAGroupSink::GroupAdded - * Purpose: - * Notification of a new group being added to the presentation. - */ - STDMETHOD(GroupAdded) (THIS_ - UINT16 /*IN*/ uGroupIndex, - IRMAGroup* /*IN*/ pGroup) PURE; - - /************************************************************************ - * Method: - * IRMAGroupSink::GroupRemoved - * Purpose: - * Notification of a group being removed from the presentation. - */ - STDMETHOD(GroupRemoved) (THIS_ - UINT16 /*IN*/ uGroupIndex, - IRMAGroup* /*IN*/ pGroup) PURE; - - /************************************************************************ - * Method: - * IRMAGroupSink::AllGroupsRemoved - * Purpose: - * Notification that all groups have been removed from the - * current presentation. - */ - STDMETHOD(AllGroupsRemoved) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAGroupSink::TrackAdded - * Purpose: - * Notification of a new track being added to a group. - */ - STDMETHOD(TrackAdded) (THIS_ - UINT16 /*IN*/ uGroupIndex, - UINT16 /*IN*/ uTrackIndex, - IRMAValues* /*IN*/ pTrack) PURE; - - /************************************************************************ - * Method: - * IRMAGroupSink::TrackRemoved - * Purpose: - * Notification of a track being removed from a group. - */ - STDMETHOD(TrackRemoved) (THIS_ - UINT16 /*IN*/ uGroupIndex, - UINT16 /*IN*/ uTrackIndex, - IRMAValues* /*IN*/ pTrack) PURE; - - /************************************************************************ - * Method: - * IRMAGroupSink::TrackStarted - * Purpose: - * Notification of a track being started (to get duration, for - * instance...) - */ - STDMETHOD(TrackStarted) (THIS_ - UINT16 /*IN*/ uGroupIndex, - UINT16 /*IN*/ uTrackIndex, - IRMAValues* /*IN*/ pTrack) PURE; - - /************************************************************************ - * Method: - * IRMAGroupSink::TrackStopped - * Purpose: - * Notification of a track being stopped - * - */ - STDMETHOD(TrackStopped) (THIS_ - UINT16 /*IN*/ uGroupIndex, - UINT16 /*IN*/ uTrackIndex, - IRMAValues* /*IN*/ pTrack) PURE; - - /************************************************************************ - * Method: - * IRMAGroupSink::CurrentGroupSet - * Purpose: - * This group is being currently played in the presentation. - */ - STDMETHOD(CurrentGroupSet) (THIS_ - UINT16 /*IN*/ uGroupIndex, - IRMAGroup* /*IN*/ pGroup) PURE; -}; - - - - -#endif /*_IRMAGROUP_H_*/ diff --git a/include/realmedia/rmahyper.h b/include/realmedia/rmahyper.h deleted file mode 100644 index a19afbeda..000000000 --- a/include/realmedia/rmahyper.h +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** - * - * $Id: rmahyper.h 7 2003-05-30 02:18:02Z gabest $ - * - * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved. - * - * http://www.real.com/devzone - * - * This program contains proprietary - * information of Progressive Networks, Inc, and is licensed - * subject to restrictions on use and distribution. - * - * - * Simple Hyper Navigation Interfaces - * - */ - -#ifndef _RMAHYPER_H_ -#define _RMAHYPER_H_ - -/* - * Forward declarations of some interfaces defined or used here-in. - */ -typedef _INTERFACE IUnknown IUnknown; -typedef _INTERFACE IRMAValues IRMAValues; -typedef _INTERFACE IRMAHyperNavigate IRMAHyperNavigate; - - -/**************************************************************************** - * - * Interface: - * - * IRMAHyperNavigate - * - * Purpose: - * - * Allows you to perform simple "Go to URL" operations. - * - * IID_IRMAHyperNavigate: - * - * {00000900-0901-11d1-8B06-00A024406D59} - * - */ - -DEFINE_GUID(IID_IRMAHyperNavigate, 0x00000900, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAHyperNavigate - -DECLARE_INTERFACE_(IRMAHyperNavigate, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAHyperNavigate methods - */ - - /************************************************************************ - * Method: - * IRMAHyperNavigate::GoToURL - * Purpose: - * Performs a simple Go To URL operation. - * Parameters: - * pURL: fully qualified URL such as http://www.real.com - * pTarget: target frame. To not use a frame, set this to NULL - */ - STDMETHOD(GoToURL) (THIS_ - const char* pURL, - const char* pTarget) PURE; - -}; - - - -#endif /* _RMAHYPER_H_ */ diff --git a/include/realmedia/rmaiids.h b/include/realmedia/rmaiids.h deleted file mode 100644 index 2d9a657cc..000000000 --- a/include/realmedia/rmaiids.h +++ /dev/null @@ -1,1094 +0,0 @@ -/**************************************************************************** - * - * $Id: rmaiids.h 7 2003-05-30 02:18:02Z gabest $ - * - * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved. - * - * http://www.real.com/devzone - * - * This program contains proprietary - * information of Progressive Networks, Inc, and is licensed - * subject to restrictions on use and distribution. - * - * - * Exhaustive list of IID's used in IRMA interfaces - * - * Note: These IIDs generally are duplicated in the headers that are specific - * to each interface, so if you change this file, change the other file(s) as - * well. Having all these IIDS in one files is convenient to some folks, but - * not everyone includes this file, hence the need to keep them in individual - * files as well. - */ - -#ifndef _RMAIIDS_H_ -#define _RMAIIDS_H_ - -/* - * File: - * pncom.h - * Description: - * Interfaces defined by COM. - * Interfaces: - * IID_IUnknown: {00000000-0000-0000-C000000000000046} - * IID_IMalloc: {00000002-0000-0000-C000000000000046} - */ - -/* - * These GUIDs are defined in pncom.h: - * - * DEFINE_GUID(IID_IUnknown, 0x00000000, 0x0000, 0x0000, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46); - * DEFINE_GUID(IID_IMalloc, 0x00000002, 0x0000, 0x0000, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46); - * - */ - -/* - * File: - * rmacomm.h - * Description: - * RealMedia Common Utility interfaces - * Interfaces: - * IID_IRMACommonClassFactory: {00000000-0901-11d1-8B06-00A024406D59} - * IID_IRMAStatistics: {00000001-0901-11d1-8B06-00A024406D59} - * IID_IRMARegistryID: {00000002-0901-11d1-8B06-00A024406D59} - * IID_IRMAServerFork: {00000003-0901-11d1-8B06-00A024406D59} - * IID_IRMAServerControl: {00000004-0901-11d1-8B06-00A024406D59} - * IID_IRMAServerControl2: {00000005-0901-11d1-8B06-00A024406D59} - * IID_IRMAReconfigServerResponse: {00000006-0901-11d1-8B06-00A024406D59} - */ -#ifndef _RMACOMM_H_ -DEFINE_GUID(IID_IRMACommonClassFactory, 0x00000000, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAStatistics, 0x00000001, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMARegistryID, 0x00000002, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAServerFork, 0x00000003, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAServerControl, 0x00000004, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAServerControl2, 0x00000005, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAReconfigServerResponse, 0x00000006, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAServerReconfigNotification, 0x00000007, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAWantServerReconfigNotification, 0x00000008, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -#endif - -/* - * File: - * rmaengin.h - * Description: - * Interfaces related to callbacks, networking, and scheduling. - * Interfaces: - * IID_IRMACallback: {00000100-0901-11d1-8B06-00A024406D59} - * IID_IRMAScheduler: {00000101-0901-11d1-8B06-00A024406D59} - * IID_IRMATCPResponse: {00000102-0901-11d1-8B06-00A024406D59} - * IID_IRMATCPSocket: {00000103-0901-11d1-8B06-00A024406D59} - * IID_IRMAListenResponse: {00000104-0901-11d1-8B06-00A024406D59} - * IID_IRMAListenSocket: {00000105-0901-11d1-8B06-00A024406D59} - * IID_IRMANetworkServices: {00000106-0901-11d1-8B06-00A024406D59} - * IID_IRMAUDPResponse: {00000107-0901-11d1-8B06-00A024406D59} - * IID_IRMAUDPSocket: {00000108-0901-11d1-8B06-00A024406D59} - * IID_IRMAResolver: {00000109-0901-11d1-8B06-00A024406D59} - * IID_IRMAResolverResponse: {0000010A-0901-11d1-8B06-00A024406D59} - * IID_IRMAInterruptSafe: {0000010B-0901-11d1-8B06-00A024406D59} - * IID_IRMAAsyncIOSelection: {0000010C-0901-11d1-8B06-00A024406D59} - * IID_IRMAUDPMulticastInit: {0000010D-0901-11d1-8B06-00A024406D59} - * IID_IRMAInterruptState: {0000010E-0901-11d1-8B06-00A024406D59} - * IID_IRMAOptimizedScheduler: {0000010F-0901-11d1-8B06-00A024406D59} - * IID_IRMALoadBalancedListen: {00000110-0901-11d1-8B06-00A024406D59} - * IID_IRMAOverrideDefaultServices: {00000111-0901-11d1-8B06-00A024406D59} - * IID_IRMAHTTPPostObject: {00000112-0901-11d1-8B06-00A024406D59} - * IID_IRMAHTTPPostResponse: {00000113-0901-11d1-8B06-00A024406D59} - * IID_IRMASetSocketOption: {00000114-0901-11d1-8B06-00A024406D59} - * IID_IRMAThreadSafeMethods: {00000115-0901-11d1-8B06-00A024406D59} - * IID_IRMAMutex: {00000116-0901-11d1-8B06-00A024406D59} - * - */ -#ifndef _RMAENGIN_H_ -DEFINE_GUID(IID_IRMACallback, 0x00000100, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAScheduler, 0x00000101, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMATCPResponse, 0x00000102, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMATCPSocket, 0x00000103, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAListenResponse, 0x00000104, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAListenSocket, 0x00000105, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMANetworkServices, 0x00000106, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMANetworkServices2, 0x17951551, 0x5683, 0x11d3, 0xb6, 0xba, 0x0, 0xc0, 0xf0, 0x31, 0xc2, 0x37); -DEFINE_GUID(IID_IRMAUDPResponse, 0x00000107, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAUDPSocket, 0x00000108, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAResolver, 0x00000109, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAResolverResponse, 0x0000010A, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAInterruptSafe, 0x0000010B, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAAsyncIOSelection, 0x0000010C, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAUDPMulticastInit, 0x0000010D, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAInterruptState, 0x0000010E, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAOptimizedScheduler, 0x0000010F, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMALoadBalancedListen, 0x00000110, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAOverrideDefaultServices, 0x00000111, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMASetSocketOption, 0x00000114, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAThreadSafeMethods, 0x00000115, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAMutex, 0x00000116, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -#endif - - -/* - * File: - * rmafiles.h - * Description: - * Interfaces related to file systems. - * Interfaces: - * IID_IRMAFileObject: {00000200-0901-11d1-8B06-00A024406D59} - * IID_IRMAFileResponse: {00000201-0901-11d1-8B06-00A024406D59} - * IID_IRMAFileSystemObject: {00000202-0901-11d1-8B06-00A024406D59} - * IID_IRMADirObject: {00000203-0901-11d1-8B06-00A024406D59} - * IID_IRMADirResponse: {00000204-0901-11d1-8B06-00A024406D59} - * IID_IRMAFileStat: {00000205-0901-11d1-8B06-00A024406D59} - * IID_IRMAFileStatResponse: {00000206-0901-11d1-8B06-00A024406D59} - * IID_IRMAFileSystemManager: {00000207-0901-11d1-8B06-00A024406D59} - * IID_IRMAFileSystemManagerResponse: - * {00000208-0901-11d1-8B06-00A024406D59} - * IID_IRMAFileExists: {00000209-0901-11d1-8B06-00A024406D59} - * IID_IRMAFileExistsResponse: {0000020A-0901-11d1-8B06-00A024406D59} - * IID_IRMAFileMimeMapper: {0000020B-0901-11d1-8B06-00A024406D59} - * IID_IRMAFileMimeMapperResponse: {0000020C-0901-11d1-8B06-00A024406D59} - * IID_IRMABroadcastMapper: {0000020D-0901-11d1-8B06-00A024406D59} - * IID_BroadcastMimeMapperResponse:{0000020E-0901-11d1-8B06-00A024406D59} - * IID_IRMAGetFileFromSamePool: {0000020F-0901-11d1-8B06-00A024406D59} - * IID_GetFileFromSamePoolResponse:{00000210-0901-11d1-8B06-00A024406D59} - * IID_IRMAFileAuthenticator: {00000211-0901-11d1-8B06-00A024406D59} - * IID_IRMARequestHandler: {00000212-0901-11d1-8B06-00A024406D59} - * IID_IRMARequest: {00000213-0901-11d1-8B06-00A024406D59} - * IID_IRMAFileRename: {00000214-0901-11d1-8B06-00A024406D59} - * IID_IRMADirHandler: {00000215-0901-11d1-8B06-00A024406D59} - * IID_IRMADirHandlerResponse: {00000216-0901-11d1-8B06-00A024406D59} - * IID_IRMARequestContext {00000217-0901-11d1-8B06-00A024406D59} - * IID_IRMAFileRemove: {0000021A-0901-11d1-8B06-00A024406D59} - * DEPRECATED DEPRECATED {0000021B-0901-11d1-8B06-00A024406D59} - * - */ -#ifndef _RMAFILES_H_ -DEFINE_GUID(IID_IRMAHTTPPostObject, 0x00000112, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAHTTPPostResponse, 0x00000113, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAFileObject, 0x00000200, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAFileResponse, 0x00000201, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAFileSystemObject, 0x00000202, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMADirObject, 0x00000203, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); //NOTE, use is deprecated -DEFINE_GUID(IID_IRMADirResponse, 0x00000204, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); //NOTE, use is deprecated -DEFINE_GUID(IID_IRMAFileStat, 0x00000205, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAFileStatResponse, 0x00000206, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAFileSystemManager, 0x00000207, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAFileSystemManagerResponse, 0x00000208, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAFileExists, 0x00000209, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAFileExistsResponse, 0x0000020a, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAFileMimeMapper, 0x0000020b, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAFileMimeMapperResponse, 0x0000020c, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMABroadcastMapper, 0x0000020d, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMABroadcastMapperResponse, 0x0000020e, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAGetFileFromSamePool, 0x0000020f, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAGetFileFromSamePoolResponse,0x00000210, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAFileAuthenticator, 0x00000211, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMARequestHandler, 0x00000212, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMARequest, 0x00000213, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAFileRename, 0x00000214, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMADirHandler, 0x00000215, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMADirHandlerResponse, 0x00000216, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMARequestContext, 0x00000217, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAFileRemove, 0x0000021a, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -#endif -/* - * File: - * rmarendr.h - * Description: - * Interfaces related to renderers. - * Interfaces: - * IID_IRMARenderer: {00000300-0901-11d1-8B06-00A024406D59} - */ -DEFINE_GUID(IID_IRMARenderer, 0x00000300, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -/* - * File: - * rmacore.h - * Description: - * Interfaces related to the client core services. - * Interfaces: - * IID_IRMAStream: {00000400-0901-11d1-8B06-00A024406D59} - * IID_IRMAStreamSource {00000401-0901-11d1-8B06-00A024406D59} - * IID_IRMAPlayer: {00000402-0901-11d1-8B06-00A024406D59} - * IID_IRMAClientEngine: {00000403-0901-11d1-8B06-00A024406D59} - * IID_IRMAClientEngineSelector{00000404-0901-11d1-8B06-00A024406D59} - * IID_IRMAClientEngineSetup: {00000405-0901-11d1-8B06-00A024406D59} - * : {00000406-0901-11d1-8B06-00A024406D59} -- Deprecated - * IID_IRMAInfoLogger: {00000409-0901-11d1-8B06-00A024406D59} - * {0000040F-0901-11d1-8B06-00A024406D59} -- Deprecated - * IID_IRMAPlayer2: {00000411-0901-11d1-8B06-00A024406D59} - */ -#ifndef _RMACORE_H_ -DEFINE_GUID(IID_IRMAStream, 0x00000400, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAStreamSource, 0x00000401, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAPlayer, 0x00000402, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAClientEngine, 0x00000403, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -#ifdef _UNIX -DEFINE_GUID(IID_IRMAClientEngineSelector, 0x00000404, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -#endif -DEFINE_GUID(IID_IRMAClientEngineSetup, 0x00000405, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAInfoLogger, 0x00000409, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAPlayer2, 0x00000411, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -#endif -/* - * File: - * rmaprefs.h - * Description: - * Interfaces related to persistent preferences services. - * Interfaces: - * IID_IRMAPreferences: {00000500-0901-11d1-8B06-00A024406D59} - */ -#ifndef _RMAPREFS_H_ -DEFINE_GUID(IID_IRMAPreferences, 0x00000500, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAPreferences2, 0x00000503, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAPreferenceEnumerator, 0x00000504, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); -#endif - -/* - * File: - * rmamon.h - * Description: - * Interfaces related to Monitor plugins. - * Interfaces: - * IID_IRMAPNRegistry: {00000600-0901-11d1-8B06-00A024406D59} - * IID_IRMAPropWatch: {00000601-0901-11d1-8B06-00A024406D59} - * IID_IRMAPropWatchResponse: {00000602-0901-11d1-8B06-00A024406D59} - * IID_IRMAActiveRegistry: {00000603-0901-11d1-8B06-00A024406D59} - * IID_IRMAActivePropUser: {00000604-0901-11d1-8B06-00A024406D59} - * IID_IRMAActivePropUserResponse: {00000605-0901-11d1-8B06-00A024406D59} - * IID_IRMACopyRegistry: {00000606-0901-11d1-8B06-00A024406D59} - * IID_IRMAPNRegistryAltStringHandling: {00000607-0901-11d1-8B06-00A024406D59} - */ -#ifndef _RMAMON_H_ -DEFINE_GUID(IID_IRMAPNRegistry, 0x00000600, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAPropWatch, 0x00000601, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAPropWatchResponse, 0x00000602, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAActiveRegistry, 0x00000603, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAActivePropUser, 0x00000604, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAActivePropUserResponse, 0x00000605, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMACopyRegistry, 0x00000606, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAPNRegistryAltStringHandling, 0x00000607, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -#endif -/* - * File: - * rmaausvc.h - * Description: - * Interfaces related to audio services. - * Interfaces: - * IID_IRMAAudioPlayer: {00000700-0901-11d1-8B06-00A024406D59} - * IID_IRMAAudioPlayerResponse: {00000701-0901-11d1-8B06-00A024406D59} - * IID_IRMAAudioStream: {00000702-0901-11d1-8B06-00A024406D59} - * IID_IRMAAudioDevice: {00000703-0901-11d1-8B06-00A024406D59} - * IID_IRMAAudioDeviceResponse: {00000704-0901-11d1-8B06-00A024406D59} - * IID_IRMAAudioHook: {00000705-0901-11d1-8B06-00A024406D59} - * IID_IRMAAudioStreamInfoResponse: {00000706-0901-11d1-8B06-00A024406D59} - * IID_IRMAVolume: {00000707-0901-11d1-8B06-00A024406D59} - * IID_IRMAVolumeAdviseSink: {00000708-0901-11d1-8B06-00A024406D59} - * IID_IRMADryNotification: {00000709-0901-11d1-8B06-00A024406D59} - * IID_IRMAAudioDeviceManager: {0000070A-0901-11d1-8B06-00A024406D59} - * IID_IRMAAudioCrossFade: {0000070B-0901-11d1-8B06-00A024406D59} - * IID_IRMAAudioStream2: {0000070C-0901-11d1-8B06-00A024406D59} - * IID_IRMAAudioPushdown: {0000070D-0901-11d1-8B06-00A024406D59} - * IID_IRMAAudioHookManager: {0000070E-0901-11d1-8B06-00A024406D59} - */ -DEFINE_GUID(IID_IRMAAudioPlayer, 0x00000700, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAAudioPlayerResponse, 0x00000701, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAAudioStream, 0x00000702, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAAudioDevice, 0x00000703, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAAudioDeviceResponse, 0x00000704, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAAudioHook, 0x00000705, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAAudioStreamInfoResponse, 0x00000706, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAVolume, 0x00000707, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAVolumeAdviseSink, 0x00000708, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMADryNotification, 0x00000709, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAAudioDeviceManager, 0x0000070A, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAAudioCrossFade, 0x0000070B, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAAudioStream2, 0x0000070C, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAAudioPushdown, 0x0000070D, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAAudioHookManager, 0x0000070E, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -/* - * File: - * rmaerror.h - * Description: - * Interfaces related to error reporting and receiving notification of errors. - * Interfaces: - * IID_IRMAErrorMessages: {00000800-0901-11d1-8B06-00A024406D59} - * IID_IRMAErrorSink: {00000801-0901-11d1-8B06-00A024406D59} - * IID_IRMAErrorSinkControl: {00000802-0901-11d1-8B06-00A024406D59} - */ -#ifndef _RMAERROR_H_ -DEFINE_GUID(IID_IRMAErrorMessages, 0x00000800, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAErrorSink, 0x00000801, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAErrorSinkControl, 0x00000802, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -#endif -/* - * File: - * rmahyper.h - * Description: - * Simple Hyper Navigation Interfaces - * Interfaces: - * IID_IRMAHyperNavigate: {00000900-0901-11d1-8B06-00A024406D59} - * IID_IRMAHyperNavigate2: {00000901-0901-11d1-8B06-00A024406D59} - * IID_IRMAHyperNavigateWithContext: {00000902-0901-11d1-8B06-00A024406D59} - */ -DEFINE_GUID(IID_IRMAHyperNavigate, 0x00000900, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -/* - * File: - * rmaclsnk.h - * Description: - * Client Advise Sink Interfaces - * Interfaces: - * IID_IRMAClientAdviseSink: {00000B00-0901-11d1-8B06-00A024406D59} - */ -DEFINE_GUID(IID_IRMAClientAdviseSink, 0x00000B00, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -/* - * File: - * rmaplugn.h - * Description: - * Plugin inspector interface - * Interfaces: - * IID_IRMAPlugin: {00000C00-0901-11d1-8B06-00A024406D59} - * IID_IRMAPluginEnumerator {00000C01-0901-11d1-8B06-00A024406D59} - * IID_IRMAPluginGroupEnumerator {00000C02-0901-11d1-8B06-00A024406D59} - * IID_IRMAPluginReloader {00000C03-0901-11d1-8B06-00A024406D59} - * IID_IRMAPluginFactory {00000C04-0901-11d1-8B06-00A024406D59} - */ -#ifndef _RMAPLUGN_H_ -DEFINE_GUID(IID_IRMAPlugin, 0x00000C00, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAPluginEnumerator, 0x00000C01, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAPluginGroupEnumerator, 0x00000C02, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAPluginReloader, 0x00000C03, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAPluginFactory, 0x00000C04, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -#endif -/* - * File: - * rmawin.h - * Description: - * Site interfaces - * Interfaces: - * IID_IRMASiteWindowed: {00000D01-0901-11d1-8B06-00A024406D59} - * IID_IRMASiteWindowless: {00000D02-0901-11d1-8B-6-00A024406D59} - * IID_IRMASite: {00000D03-0901-11d1-8B-6-00A024406D59} - * IID_IRMASiteUser: {00000D04-0901-11d1-8B-6-00A024406D59} - * IID_IRMASiteWatcher: {00000D05-0901-11d1-8B-6-00A024406D59} - * IID_IRMASiteUserSupplier: {00000D06-0901-11d1-8B-6-00A024406D59} - * IID_IRMASiteSupplier: {00000D07-0901-11d1-8B-6-00A024406D59} - * IID_IRMASiteManager: {00000D08-0901-11d1-8B-6-00A024406D59} - * IID_IRMAMultiInstanceSiteUserSupplier: {00000D09-0901-11d1-8B-6-00A024406D59} - * IID_IRMASite2: {00000D0A-0901-11d1-8B-6-00A024406D59} - * IID_IRMASiteFullScreen {00000D0B-0901-11d1-8B-6-00A024406D59} - * IID_IRMAEventHookMgr {00000D0D-0901-11d1-8B-6-00A024406D59} - * IID_IRMAEventHook {00000D0E-0901-11d1-8B-6-00A024406D59} - * IID_IRMAPassiveSiteWatcher {00000D0F-0901-11d1-8B-6-00A024406D59} - * IID_IRMAStatusMessage {00000D10-0901-11d1-8B-6-00A024406D59} - */ -#ifndef _RMAWIN_H_ -DEFINE_GUID(IID_IRMASiteWindowed, 0x00000D01, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMASiteWindowless, 0x00000D02, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMASite, 0x00000D03, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMASiteUser, 0x00000D04, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMASiteWatcher, 0x00000D05, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMASiteUserSupplier, 0x00000D06, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMASiteSupplier, 0x00000D07, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMASiteManager, 0x00000D08, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAMultiInstanceSiteUserSupplier, 0x00000D09, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMASite2, 0x00000D0A, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMASiteFullScreen, 0x00000D0B, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAEventHookMgr, 0x00000D0D, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAEventHook, 0x00000D0E, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAPassiveSiteWatcher, 0x00000D0F, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAStatusMessage, 0x00000D10, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -#endif -/* - * File: - * rmaformt.h - * Description: - * Interfaces related to file and broadcast format plugins. - * Interfaces: - * - * IID_IRMAFileFormatObject: {00000F00-0901-11d1-8B06-00A024406D59} - * IID_IRMABroadcastFormatObject: {00000F01-0901-11d1-8B06-00A024406D59} - * IID_IRMAFormatResponse: {00000F02-0901-11d1-8B06-00A024406D59} - * IID_IRMAPacketFormat: {00000F03-0901-11d1-8B06-00A024406D59} - * IID_IRMAPacketTimeOffsetHandler {00000F04-0901-11d1-8B06-00A024406D59} - * IID_IRMAPacketTimeOffsetHandlerResponse {00000F05-0901-11d1-8B06-00A024406D59} - * IID_IRMALiveFileFormatInfo {00000F06-0901-11d1-8B06-00A024406D59} - */ -#ifndef _RMAFORMT_H_ -DEFINE_GUID(IID_IRMAFileFormatObject, 0x00000F00, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMABroadcastFormatObject, 0x00000F01, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAFormatResponse, 0x00000F02, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAPacketFormat, 0x00000F03, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAPacketTimeOffsetHandler, 0x00000F04, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAPacketTimeOffsetHandlerResponse, 0x00000F05, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMALiveFileFormatInfo, 0x00000F06, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -#endif - -/* - * File: - * rmapends.h - * Description: - * Interfaces related to get pending status from objects - * Interfaces: - * IRMAPendingStatus: {00001100-0901-11d1-8B06-00A024406D59} - */ -#ifndef _RMAPENDS_H_ -DEFINE_GUID(IID_IRMAPendingStatus, 0x00001100, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -#endif -/* - * File: - * rmapckts.h - * Description: - * Interfaces related to buffers, packets, streams, etc. - * Interfaces: - * IID_IRMABuffer: {00001300-0901-11d1-8B06-00A024406D59} - * IID_IRMAPacket: {00001301-0901-11d1-8B06-00A024406D59} - * IID_IRMARTPPacket {0169A731-1ED0-11d4-952B-00902742C923} - * IID_IRMAValues: {00001302-0901-11d1-8B06-00A024406D59} - * IID_IRMAValuesRemove: {00001303-0901-11d1-8B06-00A024406D59} - */ -#ifndef _RMAPCKTS_H_ -DEFINE_GUID(IID_IRMABuffer, 0x00001300, 0x0901, 0x11d1, 0x8b, 0x06, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAPacket, 0x00001301, 0x0901, 0x11d1, 0x8b, 0x06, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMARTPPacket, 0x0169a731, 0x1ed0, 0x11d4, 0x95, 0x2b, 0x0, 0x90, 0x27, 0x42, 0xc9, 0x23); -DEFINE_GUID(IID_IRMAValues, 0x00001302, 0x0901, 0x11d1, 0x8b, 0x06, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAValuesRemove, 0x00001303, 0x0901, 0x11d1, 0x8b, 0x06, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -#endif -/* - * File: - * rmaasm.h - * Description: - * Interfaces related to abm and back channel support. - * - * Interfaces: - * IID_IRMABackChannel: {00001500-0901-11d1-8B06-00A024406D59} - * IID_IRMAASMSource: {00001501-0901-11d1-8B06-00A024406D59} - * IID_IRMAASMStream: {00001502-0901-11d1-8B06-00A024406D59} - * IID_IRMAASMStreamSink: {00001503-0901-11d1-8B06-00A024406D59} - */ -#ifndef _RMAASM_H_ -DEFINE_GUID(IID_IRMABackChannel, 0x00001500, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAASMSource, 0x00001501, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAASMStream, 0x00001502, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAASMStreamSink, 0x00001503, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -#endif -/* - * File: - * rmaencod.h - * Description: - * Interfaces related to superencoders. - * - * Interaces: - * IID_IRMAEncoderResponse {00001600-0901-11d1-8B06-00A024406D59} - * IID_IRMAEncoder {00001601-0901-11d1-8B06-00A024406D59} - * IID_IRMAEncoderCompletion {00001602-0901-11d1-8B06-00A024406D59} - * IID_IRMAConnectionlessControl - {00001603-0901-11d1-8B06-00A024406D59} - * IID_IRMAEncoderResponseCompletion - {00001604-0901-11d1-8B06-00A024406D59} - * IID_IRMATransportControl {00001605-0901-11d1-8B06-00A024406D59} - */ -#ifndef _RMAENCOD_H_ -DEFINE_GUID(IID_IRMAEncoderResponse, 0x00001600, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAEncoder, 0x00001601, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAEncoderCompletion, 0x00001602, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAConnectionlessControl, - 0x00001603, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAEncoderResponseCompletion, - 0x00001604, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMATransportControl, 0x00001605, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -#endif -/* - * File: - * rmaauth.h - * Description: - * Password handling API - * Interfaces: - * IID_IRMAPassword {00001700-0901-11d1-8B06-00A024406D59} - */ - -/* - * 000017**-0901-11d1-8B06-00A024406D59 is reserved for interfaces in rmaauth.h (below) - */ - -/* - * File: - * rmaauth.h - * Description: - * Authentication API - * Interfaces: - * IID_IRMAAuthenticator {00001800-0901-11d1-8B06-00A024406D59} - * IID_IRMAAuthenticatorResponse {00001801-0901-11d1-8B06-00A024406D59} - * IID_IRMAAuthenticatorRequest {00001802-0901-11d1-8B06-00A024406D59} - * IID_IRMAPassword {00001700-0901-11d1-8B06-00A024406D59} - * IID_IRMAAuthenticationManager {00001A00-0901-11d1-8B06-00A024406D59} - * IID_IRMAAuthenticationManagerResponse - * {00001A01-0901-11d1-8B06-00A024406D59} - */ -#ifndef _RMAAUTH_H_ -DEFINE_GUID(IID_IRMAAuthenticator, 0x00001800, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAAuthenticatorResponse, 0x00001801, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAAuthenticatorRequest, 0x00001802, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAPassword, 0x00001700, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAAuthenticationManager, 0x00001a00, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAAuthenticationManagerResponse, 0x00001a01, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -#endif -/* - * File: - * rmasdesc.h - * Description: - * Stream description API - * Interfaces: - * IID_IRMAStreamDescription {00001900-0901-11d1-8B06-00A024406D59} - * IID_IRMARTPPacketInfo {00001901-0901-11d1-8B06-00A024406D59} - */ -#ifndef _RMASDESC_ -DEFINE_GUID(IID_IRMAStreamDescription, 0x00001900, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMARTPPacketInfo, 0x00001901, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -#endif -/* - * 00001A**-0901-11d1-8B06-00A024406D59 is reserved for interfaces in rmaauth.h (above) - */ - -/* - * File: - * rmalvtxt.h - * Description: - * Interfaces related to live text superencoder. - * - * Interaces: - * IID_IRMALiveText {00001b00-0901-11d1-8B06-00A024406D59} - * IID_IRMALiveText2 {00001b01-0901-11d1-8B06-00A024406D59} - */ -#ifndef _RMALVTXT_H_ -DEFINE_GUID(IID_IRMALiveText, 0x00001b00, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMALiveText2, 0x00001b01, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -#endif -/* - * File: - * rmacfg.h - * Description: - * Interfaces used by server configuration tools. - * - * Interfaces: - * IID_IRMAConfigFile {00001c00-0901-11d1-8B06-00A024406D59} - * IID_IRMARegConfig {00001c01-0901-11d1-8B06-00A024406D59} - * - */ -#ifndef _RMACFG_H_ -DEFINE_GUID(IID_IRMAConfigFile, 0x00001c00, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMARegConfig, 0x00001c01, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); -#endif - -/* - * File: - * rmappv.h - * Description: - * Interfaces related to Pay Per View Database Plugins - * Interfaces: - * IID_IRMAPPVDatabase {00001d00-0901-11d1-8B06-00A024406D59} - */ -DEFINE_GUID(IID_IRMAPPVDatabase, - 0x00001d00, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - - -/* - * 00001e**-0901-11d1-8B06-00A024406D59 is reserved for an interface which - * has been deprecated. - */ - -/* - * File: - * rmacmenu.h - * Description: - * Interfaces used by renderers for context menus. - * - * Interfaces: - * IID_IRMAContextMenu {00001f00-0901-11d1-8B06-00A024406D59} - * IID_IRMAContextMenuResponse {00001f01-0901-11d1-8B06-00A024406D59} - */ -#ifndef _RMACMENU_H_ -DEFINE_GUID(IID_IRMAContextMenu, 0x00001f00, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAContextMenuResponse, 0x00001f01, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#endif -/* - * File: - * rmaphook.h - * Description: - * Interfaces used by the top level client. client core and renderer to - * support Selective Record. - * - * Interfaces: - * IID_IRMAPacketHook {00002000-0901-11d1-8B06-00A024406D59} - * IID_IRMAPacketHookManager {00002001-0901-11d1-8B06-00A024406D59} - * IID_IRMAPacketHookHelper {00002002-0901-11d1-8B06-00A024406D59} - * IID_IRMAPacketHookHelperResponse {00002003-0901-11d1-8B06-00A024406D59} - */ - -DEFINE_GUID(IID_IRMAPacketHook, 0x00002000, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAPacketHookManager, 0x00002001, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAPacketHookHelper, 0x00002002, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAPacketHookHelperResponse, 0x00002003, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -/* - * File: - * rmapsink.h - * Description: - * Interfaces used by the top level client or renderers to determine - * that a player has been created or closed. - * - * Interfaces: - * IID_IRMAPlayerCreationSink {00002100-0901-11d1-8B06-00A024406D59} - * IID_IRMAPlayerSinkControl {00002101-0901-11d1-8B06-00A024406D59} - */ -DEFINE_GUID(IID_IRMAPlayerCreationSink, 0x00002100, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAPlayerSinkControl, 0x00002101, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -/* - * File: - * rmavsurf.h - * Description: - * Interface used by renderers to blt data to the screen (when in - * full screen mode). - * - * Interfaces: - * IID_IRMAVideoSurface {00002200-0901-11d1-8B06-00A024406D59} - */ -DEFINE_GUID(IID_IRMAVideoSurface, 0x00002200, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - - -/* - * File: - * rmagroup.h - * Description: - * Client side Group related interfaces - * - * Interfaces: - * IID_IRMAGroup {00002400-0901-11d1-8B06-00A024406D59} - * IID_IRMAGroupManager {00002401-0901-11d1-8B06-00A024406D59} - * IID_IRMAGroupSink {00002402-0901-11d1-8B06-00A024406D59} - */ -DEFINE_GUID(IID_IRMAGroup, 0x00002400, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAGroupManager, 0x00002401, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAGroupSink, 0x00002402, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -/* - * File: - * rmaupgrd.h - * Description: - * Interfaces used by player for auto-upgrade. - * - * Interfaces: - * IID_IRMAUpgradeCollection {00002500-0901-11d1-8B06-00A024406D59} - * IID_IRMAUpgradeHandler {00002501-0901-11d1-8B06-00A024406D59} - */ -DEFINE_GUID(IID_IRMAUpgradeCollection, - 0x00002500, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAUpgradeHandler, - 0x00002501, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -/* - * File: - * rmaallow.h - * Description: - * Interfaces related to Allowance plugins - * Interfaces: - * IID_IRMAPlayerConnectionAdviseSink {00002600-0901-11d1-8B06-00A024406D59} - * IID_IRMAPlayerConnectionResponse {00002601-0901-11d1-8B06-00A024406D59} - * IID_IRMAPlayerController {00002602-0901-11d1-8B06-00A024406D59} - * IID_IRMAPlayerConnectionAdviseSinkManager - {00002603-0901-11d1-8B06-00A024406D59} - * IID_IRMAProxyConnectionAdviseSink {00002604-0901-11d1-8B06-00A024406D59} - * IID_IRMAProxyConnectionResponse {00002605-0901-11d1-8B06-00A024406D59} - * IID_IRMAProxyController {00002605-0901-11d1-8B06-00A024406D59} - * IID_IRMAPlayerControllerProxyRedirect {00002607-0901-11d1-8B06-00A024406D59} - */ -DEFINE_GUID(IID_IRMAPlayerConnectionAdviseSink, - 0x00002600, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAPlayerConnectionResponse, - 0x00002601, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAPlayerController, - 0x00002602, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAPlayerConnectionAdviseSinkManager, - 0x00002603, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -DEFINE_GUID(IID_IRMAProxyConnectionAdviseSink, - 0x00002604, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAProxyConnectionResponse, - 0x00002605, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAProxyController, - 0x00002606, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAPlayerControllerProxyRedirect, 0x00002607, 0x901, 0x11d1, - 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -/* - * File: - * rmaaconf.h - * Description: - * Interfaces used by the top level client. client core to - * support Auto. Transport Configuration - * - * Interfaces: - * IID_IRMAAutoConfig {00002700-0901-11d1-8B06-00A024406D59} - * IID_IRMAAutoConfigResponse {00002701-0901-11d1-8B06-00A024406D59} - */ - -DEFINE_GUID(IID_IRMAAutoConfig, 0x00002700, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAAutoConfigResponse, 0x00002701, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -/* - * File: - * rmaauthn.h - * Description: - * Interfaces used to validate a users access to content. - * - * Interfaces: - * IID_IRMACredRequestResponse, {00002800-0901-11d1-8B06-00A024406D59} - * IID_IRMACredRequest, {00002801-0901-11d1-8B06-00A024406D59} - * IID_IRMAClientAuthResponse, {00002802-0901-11d1-8B06-00A024406D59} - * IID_IRMAClientAuthConversation, {00002803-0901-11d1-8B06-00A024406D59} - * IID_IRMAServerAuthResponse, {00002804-0901-11d1-8B06-00A024406D59} - * IID_IRMAServerAuthConversation, {00002805-0901-11d1-8B06-00A024406D59} - * IID_IRMAUserContext, {00002806-0901-11d1-8B06-00A024406D59} - * IID_IRMAUserProperties, {00002807-0901-11d1-8B06-00A024406D59} - * IID_IRMAUserImpersonation, {00002808-0901-11d1-8B06-00A024406D59} - * IID_IRMAUserDB, {00002809-0901-11d1-8B06-00A024406D59} - * IID_IRMAChallengeResponse, {0000280A-0901-11d1-8B06-00A024406D59} - * IID_IRMAChallenge, {0000280B-0901-11d1-8B06-00A024406D59} - */ - -DEFINE_GUID(IID_IRMACredRequestResponse, 0x00002800, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMACredRequest, 0x00002801, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAClientAuthResponse, 0x00002802, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAClientAuthConversation, 0x00002803, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAServerAuthResponse, 0x00002804, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAServerAuthConversation, 0x00002805, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAUserContext, 0x00002806, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAUserProperties, 0x00002807, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAUserImpersonation, 0x00002808, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAChallengeResponse, 0x00002809, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAChallenge, 0x0000280A, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - - -/* - * File: - * rmaplgns.h - * - * Description: - * Interfaces for Plugins: - * IRMAObjectConfiguration - Consistant configuration. - * IRMAPluginProperties - Consistant property retrival. - * - * Interfaces: - * IID_IRMAObjectConfiguration: {00002900-0901-11d1-8B06-00A024406D59} - * IID_IRMAPluginProperties: {00002901-0901-11d1-8B06-00A024406D59} - */ -DEFINE_GUID(IID_IRMAObjectConfiguration, 0x00002900, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAPluginProperties, 0x00002901, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -/* - * File: - * rmadb.h - * - * Description: - * Interfaces for Plugins: - * IRMADatabaseManager - Creates Configured Database Instances - * IRMAAuthenticationDBManagerResponse - Provides Callbacks for IRMAAuthenticationDBManager - * IRMAAuthenticationDBManager - Functions to add and remove users from a database - * IRMAAsyncEnumAuthenticationDBResponse - Provides Callbacks for IRMAAsyncEnumAuthenticationDB - * IRMAAsyncEnumAuthenticationDB - Functions to enumerate the list of users in a database - * IRMAAuthenticationDBAccessResponse - Provides Callbacks for IRMAAuthenticationDBAccess - * IRMAAuthenticationDBAccess - Functions to access a users info in the database - * IRMAGUIDDBManagerResponse - Provides Callbacks for IRMAGUIDDBManager - * IRMAGUIDDBManager - Functions to add and remove GUID's from a database - * IRMAPPVDBManagerResponse - Provides Callbacks for IRMAPPVDBManager - * IRMAPPVDBManager - Functions to add, remove, and adjust a user's permissions from a database - * IRMARedirectDBManagerResponse - Provides Callbacks for IRMARedirectDBManager - * IRMARedirectDBManager - Functions to add and remove URL Redirects from a database - * IRMARegistrationLoggerResponse - Provides Callbacks for IRMARegistrationLogger - * IRMARegistrationLogger - Functions to Log registration Activity. - * - * Interfaces: - * IID_IRMADatabaseManager: {00002A00-0901-11d1-8B06-00A024406D59} - * IID_IRMAAuthenticationDBManagerResponse: {00002A01-0901-11d1-8B06-00A024406D59} - * IID_IRMAAuthenticationDBManager: {00002A02-0901-11d1-8B06-00A024406D59} - * IID_IRMAAsyncEnumAuthenticationDBResponse:{00002A03-0901-11d1-8B06-00A024406D59} - * IID_IRMAAsyncEnumAuthenticationDB: {00002A04-0901-11d1-8B06-00A024406D59} - * IID_IRMAAuthenticationDBAccessResponse: {00002A05-0901-11d1-8B06-00A024406D59} - * IID_IRMAAuthenticationDBAccess: {00002A06-0901-11d1-8B06-00A024406D59} - * IID_IRMAGUIDDBManagerResponse: {00002A07-0901-11d1-8B06-00A024406D59} - * IID_IRMAGUIDDBManager: {00002A08-0901-11d1-8B06-00A024406D59} - * IID_IRMAPPVDBManagerResponse: {00002A09-0901-11d1-8B06-00A024406D59} - * IID_IRMAPPVDBManager: {00002A0A-0901-11d1-8B06-00A024406D59} - * IID_IRMARedirectDBManagerResponse: {00002A0B-0901-11d1-8B06-00A024406D59} - * IID_IRMARedirectDBManager: {00002A0C-0901-11d1-8B06-00A024406D59} - * IID_IRMARegistrationLoggerResponse: {00002A0D-0901-11d1-8B06-00A024406D59} - * IID_IRMARegistrationLogger: {00002A0E-0901-11d1-8B06-00A024406D59} - */ -DEFINE_GUID(IID_IRMADatabaseManager, 0x00002A00, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAAuthenticationDBManagerResponse, 0x00002A01, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAAuthenticationDBManager, 0x00002A02, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAAsyncEnumAuthenticationDBResponse, 0x00002A03, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAAsyncEnumAuthenticationDB, 0x00002A04, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAAuthenticationDBAccessResponse, 0x00002A05, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAAuthenticationDBAccess, 0x00002A06, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAGUIDDBManagerResponse, 0x00002A07, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAGUIDDBManager, 0x00002A08, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAPPVDBManagerResponse, 0x00002A09, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAPPVDBManager, 0x00002A0A, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMARedirectDBManagerResponse, 0x00002A0B, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMARedirectDBManager, 0x00002A0C, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMARegistrationLoggerResponse, 0x00002A0D, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMARegistrationLogger, 0x00002A0E, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - - -/* - * File: - * rmaxmltg.h - * - * Description: - * Interfaces for Plugins: - * IRMAXMLTagHandler: Interface for registering for a specific tag - * and providing an IRMAXMLTagObject to tagfsys. - * (Works like IRMAFileSystemObject) - * - * IRMAXMLTagObject: Interface for receiving the contents of a tag - * for which the creating IRMAXMLTagHandler has registerd. - * - * IRMAXMLTagObjectResponse: Interface for IRMAXMLTagObject to return - * the replacement for the tag. This is implemented by tagfsys. - * - * - * Interfaces: - * IID_IRMAXMLTagObjectResponse: {00002C02-0901-11d1-8B06-00A024406D59} - * IID_IRMAXMLTagHandler: {00002C03-0901-11d1-8B06-00A024406D59} - * IID_IRMAXMLTagObject: {00002C04-0901-11d1-8B06-00A024406D59} - */ -#ifndef _RMAXMLTG_H -DEFINE_GUID(IID_IRMAXMLTagObjectResponse, 0x00002C02, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAXMLTagHandler, 0x00002C03, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAXMLTagObject, 0x00002C04, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -#endif - - -/* - * File: - * rmacache.h - * - * Description: - * Interfaces for caching services: - * IRMACache - Creates IRMACacheFiles - * IRMACacheResponse - Response object for IRMACache - * IRMACacheFile - Persistant store object for caching - * IRMACacheFileResponse - Response object for IRMACacheFile - * - * Interfaces: - * IID_IRMACache: {00002E00-0901-11d1-8B06-00A024406D59} - * IID_IRMACacheResponse: {00002E01-0901-11d1-8B06-00A024406D59} - * IID_IRMACacheFile: {00002E02-0901-11d1-8B06-00A024406D59} - * IID_IRMACacheFileResponse: {00002E03-0901-11d1-8B06-00A024406D59} - * IID_IRMAMIIFetch: {00002E04-0901-11d1-8B06-00A024406D59} - */ - -DEFINE_GUID(IID_IRMACache, 0x00002E00, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMACacheResponse, 0x00002E01, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMACacheFile, 0x00002E02, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMACacheFileResponse, 0x00002E03, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAMIIFetch, 0x00002E04, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - - -/* - * File: intrpm.h - * - * IID_IRMAInterPluginMessenger: {00003000-0901-11d1-8B06-00A024406D59} - */ -DEFINE_GUID(IID_IRMAInterPluginMessenger, 0x00003000, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -/* - * File: rmavalue.h - * - * DEPRECATED: {00003100-0901-11d1-8B06-00A024406D59} - * DEPRECATED: {00003101-0901-11d1-8B06-00A024406D59} - * DEPRECATED: {00003102-0901-11d1-8B06-00A024406D59} - * DEPRECATED: {00003103-0901-11d1-8B06-00A024406D59} - * DEPRECATED: {00003104-0901-11d1-8B06-00A024406D59} - * DEPRECATED: {00003105-0901-11d1-8B06-00A024406D59} - * DEPRECATED: {00003106-0901-11d1-8B06-00A024406D59} - * DEPRECATED: {00003107-0901-11d1-8B06-00A024406D59} - * - * IID_IRMAKeyValueList: {00003108-0901-11d1-8B06-00A024406D59} - * IID_IRMAKeyValueListIter: {00003109-0901-11d1-8B06-00A024406D59} - * IID_IRMAKeyValueListIterOneKey: {00003110-0901-11d1-8B06-00A024406D59} - * IID_IRMAOptions: {00003111-0901-11d1-8B06-00A024406D59} - */ -#ifndef _RMAVALUE_H_ -/* DEPRECATED 3100 - 3107 */ -DEFINE_GUID(IID_IRMAKeyValueList, 0x00003108, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAKeyValueListIter, 0x00003109, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAKeyValueListIterOneKey, 0x00003110, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAOptions, 0x00003111, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -#endif - -/* - * File: - * rmcookie.h - * - * Description: - * Interfaces for Plugins: - * IRMACookies - Cookie database management APIs - * IRMACookiesHelper - Cookie output helper APIs - * - * Interfaces: - * IID_IRMACookies: {00003200-0901-11d1-8B06-00A024406D59} - * IID_IRMACookiesHelper: {00003201-0901-11d1-8B06-00A024406D59} - */ -DEFINE_GUID(IID_IRMACookies, 0x00003200, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMACookiesHelper, 0x00003201, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -/* - * File: addrpool.h - * - * IID_IRMAMulticastAddressPool: {00003300-0901-11d1-8B06-00A024406D59} - */ -DEFINE_GUID(IID_IRMAMulticastAddressPool, 0x00003300, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -/* - * File: sapmgr.h - * - * IID_IRMASapManager: {00003400-0901-11d1-8B06-00A024406D59} - */ -DEFINE_GUID(IID_IRMASapManager, 0x00003400, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -/* - * File: - * rmavsrc.h - * - * Description: - * Interfaces for Plugins: - * IRMAFileViewSource - Interface so file formats can support view source. - * IRMAFileViewSourceResponse - Response interface. - * - * Interfaces: - * IID_IRMAFileViewSource: {00003500-0901-11d1-8B06-00A024406D59} - * IID_IRMAFileViewSourceResponse: {00003501-0901-11d1-8B06-00A024406D59} - * IID_IRMAViewSourceCommand: {00003504-0901-11d1-8B06-00A024406D59} - * IID_IRMAViewSourceURLResponse {00003505-0901-11d1-8B06-00A024406D59} - */ -#ifndef _RMAVSRC_H_ -DEFINE_GUID(IID_IRMAFileViewSource, 0x00003500, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAFileViewSourceResponse, 0x00003501, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAViewSourceCommand, 0x00003504, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMAViewSourceURLResponse, 0x00003505, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -#endif - - - - - -/* File: - * embdengn.h - * - * Description: - * - * IRCAEmbeddedPlayerEngine - RCA embedded player engine - */ - -DEFINE_GUID(IID_IRCAEmbeddedEngine, - 0x00003800, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -/* File: - * embdctxt.h - * - * Description: - * - * IRCAEmbeddedContext - RCA embedded player engine context - */ - -DEFINE_GUID(IID_IRCAEmbeddedContext, - 0x00003801, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -/* File: - * embdplay.h - * - * Description: - * - * IRCAEmbeddedPlayer - RCA embedded player interface - */ - -DEFINE_GUID(IID_IRCAEmbeddedPlayer, - 0x00003802, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -/* File: - * embdsink.h - * - * Description: - * - * IRCAEmbeddedSink - RCA embedded player event sink - * IRCAEmbeddedSinkResponse - RCA embedded player event sink response object - */ - -DEFINE_GUID(IID_IRCAEmbeddedSink, - 0x00003803, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRCAEmbeddedSinkResponse, - 0x00003804, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -/* File: - * embdstrm.h - * - * Description: - * - * IRCAEmbeddedStreamManager - RCA embedded player stream manager - * IRCAEmbeddedStream - RCA embedded player stream - */ - -DEFINE_GUID(IID_IRCAEmbeddedStreamManager, - 0x00003805, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRCAEmbeddedStream, - 0x00003806, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -/* File: - * rmadtcvt.h - * - * Description - * IRMADataConvertSystemObject - RMA Stream data conversion creator - * IRMADataConvert - RMA Stream data conversion - * IRMADataConvertResponse - response for above - * IRMADataRevert - RMA Stream data reversion - * IRMADataRevertResponse - response for above - */ -DEFINE_GUID(IID_IRMADataConvertSystemObject, - 0x00003900, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMADataConvert, - 0x00003901, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMADataConvertResponse, - 0x00003902, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMADataRevert, - 0x00003903, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -DEFINE_GUID(IID_IRMADataRevertResponse, - 0x00003904, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -/* - * File: - * rmaslta.h - * - * Description: - * - * IRMASLTA - RMA version of slta. Simulates a live stream from file format. - * - * IRMASltaEvent - Allows events to be sent in an SLTA stream - */ -DEFINE_GUID(IID_IRMASLTA, - 0x00000D00, 0xb4c8, 0x11d0, 0x99, 0x95, 0x0, 0xa0, 0x24, 0x8d, 0xa5, 0xf0); - -DEFINE_GUID(IID_IRMASltaEvent, - 0x00000D01, 0xb4c8, 0x11d0, 0x99, 0x95, 0x0, 0xa0, 0x24, 0x8d, 0xa5, 0xf0); - -#endif /* _RMAIIDS_H_ */ - diff --git a/include/realmedia/rmalvpix.h b/include/realmedia/rmalvpix.h deleted file mode 100644 index 5ad3f8b92..000000000 --- a/include/realmedia/rmalvpix.h +++ /dev/null @@ -1,385 +0,0 @@ -/**************************************************************************** - * - * rmalvpix.h - * - * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved. - * - * http://www.real.com/devzone - * - * This program contains proprietary - * information of Progressive Networks, Inc, and is licensed - * subject to restrictions on use and distribution. - * - * - * RealPix live encoder interfaces - * - */ - -#ifndef _RMALVPIX_H -#define _RMALVPIX_H - -/* - * PixInitInfo - * - * This struct contains initialization information - * and is passed in in the IRMALiveRealPix::StartEncoder() - * method. All of the members of this struct are input variables. - */ -typedef struct PNEXPORT_CLASS _PixInitInfo -{ - UINT32 m_ulStructLength; /* length in bytes of this structure */ - char *m_pServerAddress; /* name or ip address of server */ - UINT32 m_ulServerPort; /* pn-encoder port on server */ - char *m_pUsername; /* username for authentication on server */ - char *m_pPassword; /* password for authentication on server */ - char *m_pFilename; /* filename which clients should open */ - char *m_pTitle; /* title of live presentation */ - char *m_pAuthor; /* author of live presentation */ - char *m_pCopyright; /* copyright on live presentation */ - UINT32 m_ulBitrate; /* bitrate of realpix stream */ - UINT32 m_ulMaxFps; /* max frames per second of effects */ - UINT32 m_ulDisplayWidth; /* display width in pixels */ - UINT32 m_ulDisplayHeight; /* display height in pixels */ - BOOL m_bPreserveAspect; /* preserve aspect ratio by default? */ - char *m_pDefaultURL; /* default URL to send browser to when clicked */ - UINT32 m_ulNumImageCodecs; /* number of image codecs used in this stream */ - char **m_ppImageCodec; /* string names of codecs */ - UINT32 m_ulNumEffectPackages; /* number of external effect packages used */ - char **m_ppEffectPackage; /* string names of effect packages*/ -} -PixInitInfo; - -/* - * PixImageInfo - * - * This struct contains all the information for images which - * should be sent down the stream. This struct is used in the - * IRMALiveRealPix::InitImage() method. - */ -typedef struct PNEXPORT_CLASS _PixImageInfo -{ - UINT32 m_ulStructLength; /* Input: size of struct */ - BYTE *m_pImageBuffer; /* Input: buffer holding image data */ - UINT32 m_ulImageBufferSize; /* Input: size of image buffer */ - char *m_pImageCodec; /* Input: image codec to be used */ - UINT32 m_ulHandle; /* Output: image handle */ - UINT32 m_ulNumPackets; /* Output: number of packets image will be sent */ - UINT32 m_ulTimeToSend; /* Output: milliseconds required to send image */ -} -PixImageInfo; - -#define EFFECT_FILL 0 -#define EFFECT_FADEIN 1 -#define EFFECT_FADEOUT 2 -#define EFFECT_CROSSFADE 3 -#define EFFECT_WIPE 4 -#define EFFECT_VIEWCHANGE 5 -#define EFFECT_EXTERNAL 6 -#define EFFECT_ANIMATE 7 - -#define WIPE_DIRECTION_UP 0 -#define WIPE_DIRECTION_DOWN 1 -#define WIPE_DIRECTION_LEFT 2 -#define WIPE_DIRECTION_RIGHT 3 - -#define WIPE_TYPE_NORMAL 0 -#define WIPE_TYPE_PUSH 1 - -/* - * PixEffectInfo - * - * This struct contains all the information about the effect which - * the RealPix renderer should perform. This struct is used in the - * IRMALiveRealPix::SendEffect() method. - */ -typedef struct PNEXPORT_CLASS _PixEffectInfo -{ - UINT32 m_ulStructLength; /* Input: Length in bytes of this struct */ - BYTE m_ucEffectType; /* Input: Effect Type: EFFECT_FILL, EFFECT_FADEIN, etc. */ - UINT32 m_ulStart; /* Input: Start time in milliseconds of effect */ - UINT32 m_ulDuration; /* Input: Duration in milliseconds of effect */ - UINT32 m_ulTarget; /* Input: Handle of image to perform effect on */ - UINT32 m_ulSrcX; /* Input: Horizontal offset of source rectangle */ - UINT32 m_ulSrcY; /* Input: Vertical offset of source rectangle */ - UINT32 m_ulSrcW; /* Input: Width of source rectangle */ - UINT32 m_ulSrcH; /* Input: Height of source rectangle */ - UINT32 m_ulDstX; /* Input: Horizontal offset of destination rectangle */ - UINT32 m_ulDstY; /* Input: Vertical offset of destination rectangle */ - UINT32 m_ulDstW; /* Input: Width of destination rectangle */ - UINT32 m_ulDstH; /* Input: Height of destination rectangle */ - UINT32 m_ulMaxFps; /* Input: Max frames per second for this effect */ - BOOL m_bAspectFlag; /* Input: TRUE: preserve aspect on this effect; FALSE: don't preserve */ - BYTE m_ucRed; /* Input: Red component of fill or fadeout color */ - BYTE m_ucGreen; /* Input: Green component of fill or fadeout color */ - BYTE m_ucBlue; /* Input: Blue component of fill or fadeout color */ - BYTE m_ucWipeDirection; /* Input: WIPE_DIRECTION_xxx, where xxx is UP, DOWN, LEFT, or RIGHT */ - BYTE m_ucWipeType; /* Input: WIPE_TYPE_NORMAL or WIPE_TYPE_PUSH */ - char *m_pURL; /* Input: URL for this effect */ - char *m_pExtPackage; /* Input: Name of external effect package */ - char *m_pExtName; /* Input: Name of external effect within the package */ - char *m_pExtData; /* Input Opaque string data for external effect */ - char *m_pExtFile; /* Input: File contents of external effect data */ - BOOL m_bDiscardImage; /* Input: TRUE: discard image after doing effect; FALSE: don't discard */ - BOOL m_bDisplayImmediately; /* Input: FALSE: obey start time; TRUE: do effect immediately */ - UINT32 m_ulHandle; /* Output: Handle by which effect will be referred to */ -} -PixEffectInfo; - -/* - * Forward declarations of some interfaces defined here. - */ -typedef _INTERFACE IRMALiveRealPix IRMALiveRealPix; -typedef _INTERFACE IRMALiveRealPixResponse IRMALiveRealPixResponse; -typedef _INTERFACE IRMALiveRealPixResend IRMALiveRealPixResend; - -/* - * Forward declarations of interfaces used here - */ -typedef _INTERFACE IRMAValues IRMAValues; - -/* - * Declaration of the DLL entry point - */ -STDAPI CreateLiveRealPix(IRMALiveRealPix **); - -typedef PN_RESULT (PNEXPORT_PTR FPRMCREATELIVEREALPIX)(IRMALiveRealPix **ppLiveRealPix); - -/**************************************************************************** - * - * Interface: - * - * IRMALivePix - * - * Purpose: - * - * Asynchronous interface that allows an application to encode live RealPix - * - * IID_IRMALiveRealPix: - * - * {E7ADF466-477D-11d2-AA0C-0060972D23A7} - * - */ -DEFINE_GUID(IID_IRMALiveRealPix, 0xe7adf466, 0x477d, 0x11d2, 0xaa, 0xc, 0x0, - 0x60, 0x97, 0x2d, 0x23, 0xa7); - -#undef INTERFACE -#define INTERFACE IRMALiveRealPix - -DECLARE_INTERFACE_(IRMALiveRealPix, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMALiveRealPix methods - */ - - /* - * StartEncoder() must be called before anything else and a pointer to - * an IRMALiveRealPixResponse interface must be passed in. The encoder will - * respond to this call asynchronously with IRMALiveRealPixResponse::EncoderStarted(). - */ - STDMETHOD(StartEncoder) (THIS_ PixInitInfo *pInitInfo, - IRMALiveRealPixResponse *pResponse) PURE; - - /* - * InitImage() is called to prep an image for being sent. It returns several useful - * pieces of information which the caller can make use of: the handle to refer to - * the image in SendImage(), the number of packets this image will be broken up into, - * and the time required to send this image in milliseconds. Note that InitImage() - * simply breaks the image up into packets - nothing has been sent to the server yet. - * This is not an asynchronous call - all processing has finished by the time this - * call returns. - */ - STDMETHOD(InitImage) (THIS_ PixImageInfo *pImageInfo) PURE; - - /* - * SendImage() tranfers the all the packets for the image referred to by ulImageHandle - * into the packet send queue. Further calls to Process() will result in these - * packets being sent to the RealServer. When all the packets for this image have - * been sent, the encoder will respond with IRMALiveRealPixResponse::ImageSent(). - */ - STDMETHOD(SendImage) (THIS_ UINT32 ulImageHandle) PURE; - - /* - * SendEffect() creates an effect packet with the information contained in - * the PixEffectInfo struct and immediately adds this packet to the packet - * send queue. Further calls to Process() will result in this packet being - * sent to the server. A handle is returned in the PixEffectInfo struct by - * which this effect can later be identified. When the effect has been - * sent to the server, the encoder will respond with - * IRMALiveRealPixResponse::EffectSent(). - */ - STDMETHOD(SendEffect) (THIS_ PixEffectInfo *pEffectInfo) PURE; - - /* - * StopEncoder() may be called at any time after calling StartEncoder(). - * This tells the encoder that no more images of effects are going to - * be sent to the encoder. The encoder shuts down the connection to - * the server and responds with IRMALiveRealPixResponse::EncoderStopped(). - */ - STDMETHOD(StopEncoder) (THIS) PURE; - - /* - * GetTime() returns the time in milliseconds since the encoder library was initialized. - */ - STDMETHOD_(UINT32, GetTime) (THIS) PURE; - - /* - * Process() must be called in order to give the library time to send - * packets to the server. It should be called very often in between SendImage() - * and ImageSent(), as well as between SendEffect() and EffectSent(). Other - * that these times, it should be called every 3-5 seconds. - */ - STDMETHOD(Process) (THIS) PURE; -}; - -/**************************************************************************** - * - * Interface: - * - * IRMALiveRealPixResponse - * - * Purpose: - * - * Asynchronous response interface that allows an application to - * encode live RealPix - * - * IID_IRMALiveRealPixResponse: - * - * {E7ADF46C-477D-11d2-AA0C-0060972D23A7} - * - */ -DEFINE_GUID(IID_IRMALiveRealPixResponse, 0xe7adf46c, 0x477d, 0x11d2, 0xaa, 0xc, 0x0, - 0x60, 0x97, 0x2d, 0x23, 0xa7); - - -#undef INTERFACE -#define INTERFACE IRMALiveRealPixResponse - -DECLARE_INTERFACE_(IRMALiveRealPixResponse, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMALiveRealPixResponse methods - */ - - /* - * EncoderStarted() is the asynchronous response to StartEncoder(). The status - * argument tells whether initializing the server was successful or not, and the pszHeaderString - * argument returns the text string returned by the RealServer. - */ - STDMETHOD(EncoderStarted) (THIS_ PN_RESULT status, const char *pszHeaderString) PURE; - - /* - * ImageSent() is the asynchronous response to SendImage(). The ulImageHandle argument - * identifies which image has just completed sending to the server, and the status - * argument tells whether or not the send was successful or not. - */ - STDMETHOD(ImageSent) (THIS_ PN_RESULT status, UINT32 ulImageHandle) PURE; - - /* - * EffectSent() is the asynchronous response to SendEffect(). The ulEffectHandle argument - * identifies which effect has just completed sending to the server, and the status - * argument tells whether or not the send was successful or not. - */ - STDMETHOD(EffectSent) (THIS_ PN_RESULT status, UINT32 ulEffectHandle) PURE; - - /* - * EncoderStopped() is the asynchronous response to StopEncoder(). The status - * argument tells whether or not the stopping of the encoder was successful. - * If the status is PNR_OK, then the application can then shut down or turn - * around and call StartEncoder() again. - */ - STDMETHOD(EncoderStopped) (THIS_ PN_RESULT status) PURE; - - /* - * ErrorOccurred() is called when the encoder receives an error from the RealServer. - * Depending upon the severity of the error, the RealServer may then shut down - * the encoder and an EncoderStopped() call would be made. Therefore, the - * application should be ready to handle an EncoderStopped() call at any time. - * If an error occurs, it's probably a good idea to call StopEncoder() and shut - * down the encoder from the application side anyway. - */ - STDMETHOD(ErrorOccurred) (THIS_ const UINT8 unSeverity, - const ULONG32 ulRMACode, - const ULONG32 ulUserCode, - const char *pszUserString, - const char *pszMoreInfoURL) PURE; -}; - -/**************************************************************************** - * - * Interface: - * - * IRMALiveRealPixResend - * - * Purpose: - * - * Allows re-sending and releasing of images with IRMALiveRealPix - * - * IID_IRMALiveRealPixResend: - * - * {D814DA11-8B02-11D3-8AF3-00C0F030B4E5} - */ -DEFINE_GUID(IID_IRMALiveRealPixResend, 0xd814da11, 0x8b02, 0x11d3, 0x8a, 0xfe, 0x0, - 0xc0, 0xf0, 0x30, 0xb4, 0xe5); - - -#undef INTERFACE -#define INTERFACE IRMALiveRealPixResend - -DECLARE_INTERFACE_(IRMALiveRealPixResend, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMALiveRealPixResend methods - */ - - /* - * InitResend() informs the encoder that from now on, after an - * image is sent with SendImage() it should not be discarded - * but held in the encoder until ReleaseImage() is called(). - */ - STDMETHOD(InitResend) (THIS_ IRMAValues* pOptions) PURE; - - /* - * ReleaseImage() informs the encoder that the application no longer - * intends to call SendImage() on the image referenced by ulImageHandle - * and that it can discard the image. Further calls to SendImage(x) will - * return PNR_UNKNOWN_IMAGE after ReleaseImage(x) has been called. - * ReleaseImage(x) will return PNR_UNKNOWN_IMAGE if x is an unknown handle. - */ - STDMETHOD(ReleaseImage) (THIS_ UINT32 ulImageHandle) PURE; - - /* - * DumpAllQueuedPackets() clears any packets currently waiting to be - * sent to the server. These packets were put on the send queue by - * either IRMALiveRealPix::SendImage() or IRMALiveRealPix::SendEffect(). - */ - STDMETHOD(DumpAllQueuedPackets) (THIS) PURE; -}; - -#endif diff --git a/include/realmedia/rmalvtxt.h b/include/realmedia/rmalvtxt.h deleted file mode 100644 index 98f58fb05..000000000 --- a/include/realmedia/rmalvtxt.h +++ /dev/null @@ -1,324 +0,0 @@ -/**************************************************************************** - * - * $Id: rmalvtxt.h 7 2003-05-30 02:18:02Z gabest $ - * - * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved. - * - * http://www.real.com/devzone - * - * This program contains proprietary - * information of Progressive Networks, Inc, and is licensed - * subject to restrictions on use and distribution. - * - * - * RealText encoder class using the SuperEncoder library. - * - */ - -#ifndef _RMALVTXT_H_ -#define _RMALVTXT_H_ - -/* These need to be visible to rtlive and to exlvtext: */ -/* For live, duration is max allowed val, or max ulong: - */ -#if !defined(MAX_ULONG32) -# define MAX_ULONG32 0xFFFFFFFF -#endif -#if !defined(MIN_LONG32) -# define MIN_LONG32 0xFFFFFFFF -#endif - -/* These, too, need to be visible to rtlive and to exlvtext: */ -#define MAX_PACKET_SIZE 500 -#define USE_DEFAULT_TYPE NULL -#define USE_DEFAULT_HEIGHT MAX_ULONG32 -#define USE_DEFAULT_WIDTH MAX_ULONG32 -#define USE_DEFAULT_SCROLLRATE MIN_LONG32 -#define USE_DEFAULT_CRAWLRATE MIN_LONG32 -#define USE_DEFAULT_BGCOLOR NULL -#define USE_DEFAULT_LINKCOLOR NULL -#define USE_DEFAULT_LINKUNDERLINING 0x2 -#define USE_DEFAULT_WORDWRAP 0x2 -#define USE_DEFAULT_DOLOOPING 0L - -#define USE_DEFAULT_IGNOREEXTRASPACES FALSE - - -typedef _INTERFACE IUnknown IUnknown; -typedef _INTERFACE IRMAValues IRMAValues; -typedef _INTERFACE IRMAPacket IRMAPacket; -typedef _INTERFACE IRMALiveText IRMALiveText; -typedef _INTERFACE IRMALiveText2 IRMALiveText2; - -STDAPI -CreateLiveText(IRMALiveText**); - -typedef PN_RESULT (PNEXPORT_PTR FPRMCREATELIVETEXT)(IRMALiveText** ppLiveText); - - -DEFINE_GUID(IID_IRMALiveText, 0x00001b00, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMALiveText - -DECLARE_INTERFACE_(IRMALiveText, IUnknown) -{ - /***********************************************************************/ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - - /***********************************************************************/ - /* - * IRMALiveText methods - */ - - /* - * InitLiveText() must be called before any of the other IRMALiveText - * methods: - */ - STDMETHOD(InitLiveText) (THIS_ - /* - * This is the computer where the - * RMServer is running: - */ - char* pAddress, - /* - * This is the port number defined in - * the config file where the FSMount - * option has the following entry: - * { /encoder/, pn-encoder, Port=#### } - * where #### is the port number that - * encoders will use: - */ - UINT16 port, - char* pUsername, - char* pPassword, - /* - * This is the "file" name that - * RMPlayers can use to view the - * stream. For example, if your - * server was called "srv1" and the - * rtsp port in the config file was - * 8080, and the filename from the - * encoder was "foo.rtx", then a - * player could view the stream by - * opening the following location: - * "rtsp://srv1:8080/encoder/foo.rtx" - */ - char* pFilename) PURE; - - - /* ******************************************************************* */ - /* The following methods are to be called prior to sending any data - * and exist as overrides to the default attributes of a RealText - * presentation. Please see the section on the header tag - * in the realtext.htm in the SDK's doc directory for more information. - * Note: with live text, you do not need a tag; you must use - * the following methods to set the stream type (e.g., "tickertape"), - * window width, height, background color, ...etc. - */ - - STDMETHOD(SetType) (THIS_ - char* szType) PURE; - - STDMETHOD(SetWindowDimensions) (THIS_ - ULONG32 width, - ULONG32 height) PURE; - - STDMETHOD(SetTextMotion) (THIS_ - LONG32 scrollrate, - LONG32 crawlrate) PURE; - - STDMETHOD(SetBackgroundColor) (THIS_ - char* szBackgroundColor) PURE; - - STDMETHOD(SetHyperlinkInfo) (THIS_ - BOOL underlineHyperlinks, - char* szLinkColor) PURE; - - STDMETHOD(UseWordwrap) (THIS_ - BOOL useWordwrap) PURE; - /* - * This is for "TickerTape"-type windows only; it is ignored by all - * other types: - */ - STDMETHOD(SetDoLooping) (THIS_ - BOOL bDoLooping) PURE; - - - /* ******************************************************************* */ - - /* - * AddData() lets you add text to the stream. The second - * parameter, bSendImmediately, can be used to force the encoder to - * send all text that's been added (and not yet sent) immediately. - * Note: if bSendImmediately is FALSE, the encoder will decide when - * to send the text it has buffered based on the length of the text in - * the buffer and the time since the last packet was sent: - */ - STDMETHOD(AddData) (THIS_ - char* szMoreData, - BOOL bSendImmediately) PURE; - /* - * AddTickerItem() lets you add "tickertape" text to the stream. - * This method prepends "" to szTickerUpperData, and - * "" to szTickerLowerData. Calling: - * AddTickerItem("ABCD", "5 1/2", TRUE) - * is the same as calling - * AddData("ABCD", FALSE); - * AddData("5 1/2", TRUE); - * except that the former guarantees that the "upper" and "lower" - * items will be sent in the same packet. - * (Please see the comments above for AddData() for details on use of - * the second parameter, bSendImmediately. - */ - STDMETHOD(AddTickerItem) (THIS_ - char* szTickerUpperData, - char* szTickerLowerData, - BOOL bSendImmediately) PURE; - - - /* ******************************************************************* */ - /* - * flush() tells the encoder to send everything that's in the buffer and - * clear it: - */ - STDMETHOD(flush) (THIS) PURE; - - - /* ******************************************************************* */ - /* - * GetTime returns the current system time in milliseconds. The return - * value is a UINT32 (32-bit unsigned int): - */ - STDMETHOD_(UINT32,GetTime) (THIS) PURE; - - - /* ******************************************************************* */ - /* - * This must be called on a regular basis: - */ - STDMETHOD(Process) (THIS) PURE; - - - /* ******************************************************************* */ - /* - * These methods keep track of the encoder's state and must be called - * as they are in main.cpp in the exlvtext directory: - */ - STDMETHOD_(BOOL,EncoderIsInitialized) (THIS) PURE; - STDMETHOD_(BOOL,PacketsHaveStarted) (THIS) PURE; - STDMETHOD_(BOOL,EncoderIsDone) (THIS) PURE; - STDMETHOD(SetEncoderDone) (THIS) PURE; -}; - - -DEFINE_GUID(IID_IRMALiveText2, 0x00001b01, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMALiveText2 - -DECLARE_INTERFACE_(IRMALiveText2, IUnknown) -{ - /***********************************************************************/ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - - /***********************************************************************/ - /* - * IRMALiveText2 methods - */ - - /* ******************************************************************* */ - /* The following methods are to be called prior to sending any data - * and exist as overrides to the default attributes of a RealText - * presentation. Please see the section on the header tag - * in the realtext.htm in the SDK's doc directory for more information. - * Note: these are additional to the IRMALiveText methods, listed - * above. - */ - - /* This allows you to give an estimate of the bit rate needed by a live - * text stream so that the server can determine whether or not a player - * can view the stream based on its available bandwidth This method - * should be called before sending any data:: - */ - STDMETHOD(DeclareAverageBitrate) (THIS_ - ULONG32 ulAvgBitsPerSecond) PURE; - - /* As above, for DeclareAverageBitrate, this method should be called - * before sending any data:: - */ - STDMETHOD(DeclareMaximumBitrate) (THIS_ - ULONG32 ulMaxBitsPerSecond) PURE; - - /*This determines how multiple contiguous space characters are presented; - * Defaults to FALSE which means that multiple spaces in non-tag text - * would all be renderered. If this value is TRUE, multiple contiguous - * spaces will be treated as a single space. This method should be - * called before sending any data. - */ - STDMETHOD(IgnoreExtraSpaces) (THIS_ - BOOL bIgnoreExtraSpaces) PURE; - - /* This is for internal testing use only and does not affect the - * presentation of a live text stream: - */ - STDMETHOD(SetFlags) (THIS_ - ULONG32 ulFlags) PURE; - - - - /* ******************************************************************* */ - /* The following methods can be called at any time while the encoder is - * running. - */ - - /* This method tells you when the last-sent text will end. This - * allows you to determine when it's ok to send more text. For example, - * if you're streaming a presentation that's scrolling at a rate of 20 - * pixels per second in a window that's 200 pixels high and you call - * IRMALiveText's AddData() with 100 lines of 20-point text, it will take - * 100 seconds for all that text to scroll up and out of the window. The - * following method would return the current time plus 100 if you called - * it right after calling AddData(): - */ - STDMETHOD(GetLastSentTextEndTime) (THIS_ - ULONG32& ulLastEndTime) PURE; - - /* This method allows you to adjust the time, since the last data was - * sent, that the encoder waits before resending "heartbeat" packets that - * let the server know the encoder still alive and to let newly-connected - * players know what's currently visible in the window (in case they - * connected during a "dry" period in the stream, after the last new - * text was sent). Time is in milliseconds. NOTE: this defaults to - * 3000 milliseconds; any number higher than this will result in longer - * connect times for players coming in during a "dry" spell in the - * stream, and a sufficiently high value may cause the server to - * disconnect since it assumes the encoder has stopped if it does not - * periodically send data. This value's minimum is 500 milliseconds. - */ - STDMETHOD(SetTimeBetweenDryStreamResends) (THIS_ - ULONG32 ulMillisecBetweenResends) PURE; -}; - - -#endif /* _RMALVTXT_H_ */ diff --git a/include/realmedia/rmamon.h b/include/realmedia/rmamon.h deleted file mode 100644 index 4f9c177fe..000000000 --- a/include/realmedia/rmamon.h +++ /dev/null @@ -1,1105 +0,0 @@ -/**************************************************************************** - * - * $Id: rmamon.h 7 2003-05-30 02:18:02Z gabest $ - * - * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved. - * - * http://www.real.com/devzone - * - * This program contains proprietary - * information of Progressive Networks, Inc, and is licensed - * subject to restrictions on use and distribution. - * - * - * RealMedia Architecture Registry Interfaces. - * - */ - -#ifndef _RMAMON_H_ -#define _RMAMON_H_ - -typedef _INTERFACE IUnknown IUnknown; -typedef _INTERFACE IRMAPlugin IRMAPlugin; -typedef _INTERFACE IRMABuffer IRMABuffer; -typedef _INTERFACE IRMAValues IRMAValues; -typedef _INTERFACE IRMAPropWatch IRMAPropWatch; -typedef _INTERFACE IRMAPropWatchResponse IRMAPropWatchResponse; -typedef _INTERFACE IRMAActiveRegistry IRMAActiveRegistry; -typedef _INTERFACE IRMAActivePropUser IRMAActivePropUser; -typedef _INTERFACE IRMAActivePropUserResponse IRMAActivePropUserResponse; -typedef _INTERFACE IRMAPNRegistryAltStringHandling IRMAPNRegistryAltStringHandling; - -/* - * Types of the values stored in the registry. - */ -typedef enum _RMAPropType -{ - PT_UNKNOWN, - PT_COMPOSITE, /* Contains other values (elements) */ - PT_INTEGER, /* 32-bit signed value */ - PT_INTREF, /* Integer reference object -- 32-bit signed integer */ - PT_STRING, /* Signed char* value */ - PT_BUFFER /* IRMABuffer object */ -} RMAPropType; - - -/* - * - * Interface: - * - * IRMAPNRegistry - * - * Purpose: - * - * This inteface provides access to the "Registry" in the server and - * client. The "Registry" is a hierarchical structure of Name/Value - * pairs (properties) which is capable of storing many different types - * of data including strings, buffers, and integers. The registry - * provides various types of information including statistics, - * configuration information, and system status. - * - * Note: This registry is not related to the Windows system registry. - * - * IID_IRMAPNRegistry: - * - * {00000600-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAPNRegistry, 0x00000600, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#define CLSID_IRMAPNRegistry IID_IRMAPNRegistry - -#undef INTERFACE -#define INTERFACE IRMAPNRegistry - -DECLARE_INTERFACE_(IRMAPNRegistry, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAPNRegistry methods - */ - - /************************************************************************ - * Method: - * IRMAPNRegistry::CreatePropWatch - * Purpose: - * Create a new IRMAPropWatch object which can then be queried for - * the right kind of IRMAPropWatch object. - * - * pPropWatch - OUT - returns a new addref'ed IRMAPropWatch object - */ - STDMETHOD(CreatePropWatch) (THIS_ - REF(IRMAPropWatch*) pPropWatch) PURE; - - /************************************************************************ - * Method: - * IRMAPNRegistry::AddComp - * Purpose: - * Add a COMPOSITE property to the registry and return its ID - * if successful. It returns ZERO (0) if an error occurred - * during the operation. - * - * pName - IN - name of the Property that is going to be added to - * the registry - */ - STDMETHOD_(UINT32, AddComp) (THIS_ - const char* pName) PURE; - - /************************************************************************ - * Method: - * IRMAPNRegistry::AddInt - * Purpose: - * Add an INTEGER property with name in "pName" and value in - * "iValue" to the registry. The return value is the id to - * the newly added Property or ZERO if there was an error. - * - * pName - IN - name of the Property that is going to be added to - * the registry - * nValue - IN - integer value of the Property that is going to be - * added to the registry - */ - STDMETHOD_(UINT32, AddInt) (THIS_ - const char* pName, - const INT32 nValue) PURE; - - /************************************************************************ - * Method: - * IRMAPNRegistry::GetIntByName - * Purpose: - * Retreive an INTEGER value from the registry given its Property - * name "pName". If the Property is found, it will return PNR_OK, - * otherwise it returns PNR_FAIL. - * - * pName - IN - name of the Property whose value is to be retreived - * nValue - OUT - parameter into which the value of the Property is - * going to be returned - */ - STDMETHOD(GetIntByName) (THIS_ - const char* pName, - REF(INT32) nValue) const PURE; - - /************************************************************************ - * Method: - * IRMAPNRegistry::GetIntById - * Purpose: - * Retreive an INTEGER value from the registry given its id "ulId". - * If the Property is found, it will return PNR_OK, otherwise it - * returns PNR_FAIL. - * - * ulId - IN - unique id of the Property whose value is to be retreived - * nValue - OUT - parameter into which the value of the Property is - * going to be returned - */ - STDMETHOD(GetIntById) (THIS_ - const UINT32 ulId, - REF(INT32) nValue) const PURE; - - /************************************************************************ - * Method: - * IRMAPNRegistry::SetIntByName - * Purpose: - * Modify a Property's INTEGER value in the registry given the - * Property's name "pName". If the value was set, it will return PNR_OK, - * otherwise it returns PNR_FAIL. - * - * pName - IN - name of the Property whose value is to be set - * nValue - IN - the new value of the Property which is going to be set - */ - STDMETHOD(SetIntByName) (THIS_ - const char* pName, - const INT32 nValue) PURE; - - /************************************************************************ - * Method: - * IRMAPNRegistry::SetIntById - * Purpose: - * Modify a Property's INTEGER value in the registry given the - * its id "id". If the value was set, it will return PNR_OK, otherwise - * it returns PNR_FAIL. - * - * ulId - IN - unique id of the Property whose value is to be set - * nValue - IN - the new value of the Property which is going to be set - */ - STDMETHOD(SetIntById) (THIS_ - const UINT32 id, - const INT32 nValue) PURE; - - /************************************************************************ - * Method: - * IRMAPNRegistry::AddStr - * Purpose: - * Add an STRING property with name in "pName" and value in - * "pValue" to the registry. - * - * pName - IN - name of the Property that is going to be added to - * the registry - * pValue - IN - buffer value of the Property that is going to be - * added to the registry - */ - STDMETHOD_(UINT32, AddStr) (THIS_ - const char* pName, - IRMABuffer* pValue) PURE; - - /************************************************************************ - * Method: - * IRMAPNRegistry::GetStrByName - * Purpose: - * Retreive an STRING value from the registry given its Property - * name "pName". If the Property is found, it will return PNR_OK, - * otherwise it returns PNR_FAIL. - * - * pName - IN - name of the Property whose value is to be retreived - * pValue - OUT - parameter into which the value of the Property is - * going to be returned - */ - STDMETHOD(GetStrByName) (THIS_ - const char* pName, - REF(IRMABuffer*) pValue) const PURE; - - /************************************************************************ - * Method: - * IRMAPNRegistry::GetStrById - * Purpose: - * Retreive an STRING value from the registry given its id "ulId". - * If the Property is found, it will return PNR_OK, otherwise it - * returns PNR_FAIL. - * - * ulId - IN - unique id of the Property whose value is to be retreived - * pValue - OUT - parameter into which the value of the Property is - * going to be returned - */ - STDMETHOD(GetStrById) (THIS_ - const UINT32 ulId, - REF(IRMABuffer*) pValue) const PURE; - - /************************************************************************ - * Method: - * IRMAPNRegistry::SetStrByName - * Purpose: - * Modify a Property's STRING value in the registry given the - * Property's name "pName". If the value was set, it will return - * PNR_OK, otherwise it returns PNR_FAIL. - * - * pName - IN - name of the Property whose value is to be set - * pValue - IN - the new value of the Property which is going to be set - */ - STDMETHOD(SetStrByName) (THIS_ - const char* pName, - IRMABuffer* pValue) PURE; - - /************************************************************************ - * Method: - * IRMAPNRegistry::SetStrById - * Purpose: - * Modify a Property's STRING value in the registry given the - * its id "ulId". If the value was set, it will return PNR_OK, - * otherwise it returns PNR_FAIL. - * - * ulId - IN - unique id of the Property whose value is to be set - * pValue - IN - the new value of the Property which is going to be set - */ - STDMETHOD(SetStrById) (THIS_ - const UINT32 ulId, - IRMABuffer* pValue) PURE; - - /************************************************************************ - * Method: - * IRMAPNRegistry::AddBuf - * Purpose: - * Add an BUFFER property with name in "pName" and value in - * "pValue" to the registry. - * - * pName - IN - name of the Property that is going to be added to - * the registry - * pValue - IN - buffer value of the Property that is going to be - * added to the registry - */ - STDMETHOD_(UINT32, AddBuf) (THIS_ - const char* pName, - IRMABuffer* pValue) PURE; - - /************************************************************************ - * Method: - * IRMAPNRegistry::GetBufByName - * Purpose: - * Retreive the BUFFER from the registry given its Property name - * "pName". If the Property is found, it will return PNR_OK, otherwise - * it returns PNR_FAIL. - * - * pName - IN - name of the Property whose value is to be retreived - * pValue - OUT - parameter into which the value of the Property is - * going to be returned - */ - STDMETHOD(GetBufByName) (THIS_ - const char* pName, - REF(IRMABuffer*) pValue) const PURE; - - /************************************************************************ - * Method: - * IRMAPNRegistry::GetBufById - * Purpose: - * Retreive the BUFFER from the registry given its id "ulId". If the - * Property is found, it will return PNR_OK, otherwise it returns - * PNR_FAIL. - * - * ulId - IN - unique id of the Property whose value is to be retreived - * pValue - OUT - parameter into which the value of the Property is - * going to be returned - */ - STDMETHOD(GetBufById) (THIS_ - const UINT32 ulId, - REF(IRMABuffer*) pValue) const PURE; - - /************************************************************************ - * Method: - * IRMAPNRegistry::SetBufByName - * Purpose: - * Modify a Property's BUFFER in the registry given the - * Property's name "pName". If the value was set, it will return - * PNR_OK, otherwise it returns PNR_FAIL. - * - * pName - IN - name of the Property whose value is to be set - * pValue - IN - the new value of the Property which is going to be set - */ - STDMETHOD(SetBufByName) (THIS_ - const char* pName, - IRMABuffer* pValue) PURE; - - /************************************************************************ - * Method: - * IRMAPNRegistry::SetBufById - * Purpose: - * Modify a Property's BUFFER in the registry given its id "ulId". - * If the value was set, it will return PNR_OK, otherwise it returns - * PNR_FAIL. - * - * ulId - IN - unique id of the Property whose value is to be set - * pValue - IN - the new value of the Property which is going to be set - */ - STDMETHOD(SetBufById) (THIS_ - const UINT32 ulId, - IRMABuffer* pValue) PURE; - - /************************************************************************ - * Method: - * IRMAPNRegistry::AddIntRef - * Purpose: - * Add an INTEGER REFERENCE property with name in "pName" and - * value in "iValue" to the registry. This property allows the user - * to modify its contents directly, without having to go through the - * registry. - * - * pName - IN - name of the Property that is going to be added to - * the registry - * pValue - IN - the pointer of the integer value is what gets stored - * in the registry as the Interger Reference Property's - * value - */ - STDMETHOD_(UINT32, AddIntRef) (THIS_ - const char* pName, - INT32* pValue) PURE; - - /************************************************************************ - * Method: - * IRMAPNRegistry::DeleteByName - * Purpose: - * Delete a Property from the registry using its name "pName". - * - * pName - IN - name of the Property that is going to be deleted - */ - STDMETHOD_(UINT32, DeleteByName) (THIS_ - const char* pName) PURE; - - /************************************************************************ - * Method: - * IRMAPNRegistry::DeleteById - * Purpose: - * Delete a Property from the registry using its id "ulId". - * - * ulId - IN - unique id of the Property that is going to be deleted - */ - STDMETHOD_(UINT32, DeleteById) (THIS_ - const UINT32 ulId) PURE; - - /************************************************************************ - * Method: - * IRMAPNRegistry::GetTypeByName - * Purpose: - * Returns the datatype of the Property given its name "pName". - * - * pName - IN - name of the Property whose type is to be retreived - */ - STDMETHOD_(RMAPropType, GetTypeByName) (THIS_ - const char* pName) const PURE; - - /************************************************************************ - * Method: - * IRMAPNRegistry::GetTypeById - * Purpose: - * Returns the datatype of the Property given its its id "ulId". - * - * ulId - IN - unique id of the Property whose type is to be retreived - */ - STDMETHOD_(RMAPropType, GetTypeById) (THIS_ - const UINT32 ulId) const PURE; - - /************************************************************************ - * Method: - * IRMAPNRegistry::FindParentIdByName - * Purpose: - * Returns the id value of the parent node of the Property whose - * name "pName" has been passed in. If it fails, a ZERO value is - * returned. - * - * pName - IN - name of the Property whose parent's unique id is to be - * retreived - */ - STDMETHOD_(UINT32, FindParentIdByName) (THIS_ - const char* pName) const PURE; - - /************************************************************************ - * Method: - * IRMAPNRegistry::FindParentIdById - * Purpose: - * Returns the id value of the parent node of the Property whose - * id "ulId" has been passed in. If it fails, a ZERO value is returned. - * - * ulId - IN - unique id of the Property whose parent's id is to be - * retreived - */ - STDMETHOD_(UINT32, FindParentIdById) (THIS_ - const UINT32 ulId) const PURE; - - /************************************************************************ - * Method: - * PNRegistry::GetPropName - * Purpose: - * Returns the Property name in the pName char buffer passed - * as a parameter, given the Property's id "ulId". - * - * ulId - IN - unique id of the Property whose name is to be retreived - * pName - OUT - parameter into which the Property name is going to be - * returned - */ - STDMETHOD(GetPropName) (THIS_ - const UINT32 ulId, - REF(IRMABuffer*) pName) const PURE; - - /************************************************************************ - * Method: - * PNRegistry::GetId - * Purpose: - * Returns the Property's id given the Property name. - * - * pName - IN - name of the Property whose unique id is to be - * retreived - */ - STDMETHOD_(UINT32, GetId) (THIS_ - const char* pName) const PURE; - - /************************************************************************ - * Method: - * IRMAPNRegistry::GetPropListOfRoot - * Purpose: - * Returns an array of a Properties under the root level of the - * registry's hierarchy. - * - * pValues - OUT - list of property name and unique id at the - * highest level (root) in the registry - */ - STDMETHOD(GetPropListOfRoot) (THIS_ - REF(IRMAValues*) pValues) const PURE; - - /************************************************************************ - * Method: - * IRMAPNRegistry::GetPropListByName - * Purpose: - * Returns an array of Properties immediately under the one whose - * name is passed in "pName". - * - * pName - IN - name of the Property whose child property list is to be - * retreived - * pValues - OUT - list of property name and unique id under the - * Property whose name is in "pName" - */ - STDMETHOD(GetPropListByName) (THIS_ - const char* pName, - REF(IRMAValues*) pValues) const PURE; - - /************************************************************************ - * Method: - * IRMAPNRegistry::GetPropListById - * Purpose: - * Returns an array of Properties immediately under the one whose - * id is passed in "ulId". - * - * ulId - IN - unique id of the Property whose child property list is - * to be retreived - * pValues - OUT - list of property name and unique id under the - * Property whose is is in "ulId" - */ - STDMETHOD(GetPropListById) (THIS_ - const UINT32 ulId, - REF(IRMAValues*) pValues) const PURE; - - /************************************************************************ - * Method: - * IRMAPNRegistry::GetNumPropsAtRoot - * Purpose: - * Returns the number of Properties at the root of the registry. - */ - STDMETHOD_(INT32, GetNumPropsAtRoot) (THIS) const PURE; - - /************************************************************************ - * Method: - * IRMAPNRegistry::GetNumPropsByName - * Purpose: - * Returns the count of the number of Properties under the one - * whose name is specified in "pName". - * - * pName - IN - name of the Property whose number of children is to be - * retreived - */ - STDMETHOD_(INT32, GetNumPropsByName) (THIS_ - const char* pName) const PURE; - - /************************************************************************ - * Method: - * IRMAPNRegistry::GetNumPropsById - * Purpose: - * Returns the count of the number of Properties under the one - * whose unique id is specified in "ulId". - * - * ulId - IN - unique id of the Property whose number of children is - * to be retreived - */ - STDMETHOD_(INT32, GetNumPropsById) (THIS_ - const UINT32 ulId) const PURE; -}; - - -/* - * - * Interface: - * - * IRMAPropWatch - * - * Purpose: - * - * This interface allows the user to watch properties so that when - * changes happen to the properties the plugins receive notification via - * the IRMAPropWatchResponse API. - * - * IID_IRMAPropWatch: - * - * {00000601-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAPropWatch, 0x00000601, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAPropWatch - -DECLARE_INTERFACE_(IRMAPropWatch, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAPropWatch methods - */ - - /************************************************************************ - * Method: - * IRMAPropWatch::Init - * Purpose: - * Initialize with the response object so that the Watch - * notifications can be sent back to the respective plugins. - * - * pResponse - IN - pointer to the response object which gets used to - * initialize the IRMAPropWatch object. the response - * object gets AddRef'd in the Init method. - */ - STDMETHOD(Init) (THIS_ - IRMAPropWatchResponse* pResponse) PURE; - - /************************************************************************ - * Method: - * IRMAPropWatch::SetWatchOnRoot - * Purpose: - * The SetWatch method puts a watch at the highest level of - * the registry hierarchy. It notifies ONLY IF properties at THIS LEVEL - * get added/modified/deleted. - */ - STDMETHOD_(UINT32, SetWatchOnRoot) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAPropWatch::SetWatchByName - * Purpose: - * Sets a watch-point on the Property whose name is passed in. - * In case the mentioned Property gets modified or deleted a - * notification of that will be sent to the object which set the - * watch-point. - * - * pName - IN - name of Property on which a watch point is to be added - */ - STDMETHOD_(UINT32, SetWatchByName) (THIS_ - const char* pName) PURE; - - /************************************************************************ - * Method: - * IRMAPropWatch::SetWatchById - * Purpose: - * Sets a watch-point on the Property whose name is passed in. - * In case the mentioned Property gets modified or deleted a - * notification of that will be sent to the object which set the - * watch-point. - * - * ulId - IN - unique id of Property on which a watch point is to be - * added - */ - STDMETHOD_(UINT32, SetWatchById) (THIS_ - const UINT32 ulId) PURE; - - /************************************************************************ - * Method: - * IRMAPropWatch::ClearWatchOnRoot - * Purpose: - * It clears the watch on the root of the registry. - */ - STDMETHOD(ClearWatchOnRoot) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAPropWatch::ClearWatchByName - * Purpose: - * Clears a watch-point based on the Property's name. - * - * pName - IN - name of Property whose watch point is to be cleared - */ - STDMETHOD(ClearWatchByName) (THIS_ - const char* pName) PURE; - - /************************************************************************ - * Method: - * IRMAPropWatch::ClearWatchById - * Purpose: - * Clears a watch-point based on the Property's id. - * - * ulId - IN - unique id of Property whose watch point is to be cleared - */ - STDMETHOD(ClearWatchById) (THIS_ - const UINT32 ulId) PURE; -}; - - -/* - * - * Interface: - * - * IRMAPropWatchResponse - * - * Purpose: - * - * Interface for notification of additions/modifications/deletions of - * properties in the registry which are being watched. - * - * IID_IRMAPropWatchResponse: - * - * {00000602-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAPropWatchResponse, 0x00000602, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAPropWatchResponse - -DECLARE_INTERFACE_(IRMAPropWatchResponse, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAPropWatchResponse methods - */ - - /************************************************************************ - * Method: - * IRMAPropWatchResponse::AddedProp - * Purpose: - * Gets called when a new Property gets added under the Property - * on which the Watch was set. It passes the id of the Property just - * added, its datatype and the id of its immediate parent COMPOSITE - * property. - */ - STDMETHOD(AddedProp) (THIS_ - const UINT32 ulId, - const RMAPropType propType, - const UINT32 ulParentID) PURE; - - /************************************************************************ - * Method: - * IRMAPropWatchResponse::ModifiedProp - * Purpose: - * Gets called when a watched Property gets modified. It passes - * the id of the Property just modified, its datatype and the - * id of its immediate parent COMPOSITE property. - */ - STDMETHOD(ModifiedProp) (THIS_ - const UINT32 ulId, - const RMAPropType propType, - const UINT32 ulParentID) PURE; - - /************************************************************************ - * Method: - * IRMAPropWatchResponse::DeletedProp - * Purpose: - * Gets called when a watched Property gets deleted. As can be - * seen, it returns the id of the Property just deleted and - * its immediate parent COMPOSITE property. - */ - STDMETHOD(DeletedProp) (THIS_ - const UINT32 ulId, - const UINT32 ulParentID) PURE; -}; - -/* - * - * Interface: - * - * IRMAActiveRegistry - * - * Purpose: - * - * Interface to get IRMAActiveUser responsible for a particular property - * from the registry. - * - * IID_IRMAActiveRegistry: - * - * {00000603-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAActiveRegistry, 0x00000603, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAActiveRegistry - -DECLARE_INTERFACE_(IRMAActiveRegistry, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /************************************************************************ - * IRMAActiveRegistry::SetAsActive - * - * Method to set prop pName to active and register pUser as - * the active prop user. - */ - STDMETHOD(SetAsActive) (THIS_ - const char* pName, - IRMAActivePropUser* pUser) PURE; - - /************************************************************************ - * IRMAActiveRegistry::SetAsInactive - * - * Method to remove an IRMAActiveUser from Prop activation. - */ - STDMETHOD(SetAsInactive) (THIS_ - const char* pName, - IRMAActivePropUser* pUser) PURE; - - /************************************************************************ - * IRMAActiveRegistry::IsActive - * - * Tells if prop pName has an active user that must be queried to - * change the value, or if it can just be set. - */ - STDMETHOD_(BOOL, IsActive) (THIS_ - const char* pName) PURE; - - /************************************************************************ - * IRMAActiveRegistry::SetActiveInt - * - * Async request to set int pName to ul. - */ - STDMETHOD(SetActiveInt) (THIS_ - const char* pName, - UINT32 ul, - IRMAActivePropUserResponse* pResponse) PURE; - - /************************************************************************ - * IRMAActiveRegistry::SetActiveStr - * - * Async request to set string pName to string in pBuffer. - */ - STDMETHOD(SetActiveStr) (THIS_ - const char* pName, - IRMABuffer* pBuffer, - IRMAActivePropUserResponse* pResponse) PURE; - - /************************************************************************ - * IRMAActiveRegistry::SetActiveBuf - * - * Async request to set buffer pName to buffer in pBuffer. - */ - STDMETHOD(SetActiveBuf) (THIS_ - const char* pName, - IRMABuffer* pBuffer, - IRMAActivePropUserResponse* pResponse) PURE; - - /************************************************************************ - * IRMAActiveRegistry::DeleteActiveProp - * - * Async request to delete the active property. - */ - STDMETHOD(DeleteActiveProp) (THIS_ - const char* pName, - IRMAActivePropUserResponse* pResponse) PURE; - - -}; - - -/* - * - * Interface: - * - * IRMAActivePropUser - * - * Purpose: - * - * An IRMAActivePropUser can be set as the active user of a property in - * an IRMAActiveRegistry. This causes the IRMAActivePropUser to be consulted - * everytime someone wants to change a property. The difference between this - * and a prop watch is that this is async, and can call a done method with - * failure to cause the prop to not be set, and this get called instead of - * calling into the IRMAPNReg. - * - * IID_IRMAActivePropUser: - * - * {00000604-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAActivePropUser, 0x00000604, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAActivePropUser - -DECLARE_INTERFACE_(IRMAActivePropUser, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /************************************************************************ - * IRMAActivePropUser::SetActiveInt - * - * Async request to set int pName to ul. - */ - STDMETHOD(SetActiveInt) (THIS_ - const char* pName, - UINT32 ul, - IRMAActivePropUserResponse* pResponse) PURE; - - /************************************************************************ - * IRMAActivePropUser::SetActiveStr - * - * Async request to set string pName to string in pBuffer. - */ - STDMETHOD(SetActiveStr) (THIS_ - const char* pName, - IRMABuffer* pBuffer, - IRMAActivePropUserResponse* pResponse) PURE; - - /************************************************************************ - * IRMAActivePropUser::SetActiveBuf - * - * Async request to set buffer pName to buffer in pBuffer. - */ - STDMETHOD(SetActiveBuf) (THIS_ - const char* pName, - IRMABuffer* pBuffer, - IRMAActivePropUserResponse* pResponse) PURE; - - /************************************************************************ - * IRMAActivePropUser::DeleteActiveProp - * - * Async request to delete the active property. - */ - STDMETHOD(DeleteActiveProp) (THIS_ - const char* pName, - IRMAActivePropUserResponse* pResponse) PURE; - -}; - -/* - * - * Interface: - * - * IRMAActivePropUserResponse - * - * Purpose: - * - * Gets responses from IRMAActivePropUser for queries to set properties - * in the IRMAActiveRegistry. - * - * - * IID_IRMAActivePropUserResponse: - * - * {00000605-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAActivePropUserResponse, 0x00000605, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAActivePropUserResponse - -DECLARE_INTERFACE_(IRMAActivePropUserResponse, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /************************************************************************ - * Called with status result on completion of set request. - */ - STDMETHOD(SetActiveIntDone) (THIS_ - PN_RESULT res, - const char* pName, - UINT32 ul, - IRMABuffer* pInfo[], - UINT32 ulNumInfo) PURE; - - STDMETHOD(SetActiveStrDone) (THIS_ - PN_RESULT res, - const char* pName, - IRMABuffer* pBuffer, - IRMABuffer* pInfo[], - UINT32 ulNumInfo) PURE; - - STDMETHOD(SetActiveBufDone) (THIS_ - PN_RESULT res, - const char* pName, - IRMABuffer* pBuffer, - IRMABuffer* pInfo[], - UINT32 ulNumInfo) PURE; - - STDMETHOD(DeleteActivePropDone) (THIS_ - PN_RESULT res, - const char* pName, - IRMABuffer* pInfo[], - UINT32 ulNumInfo) PURE; - -}; - -/* - * - * Interface: - * - * IRMACopyRegistry - * - * Purpose: - * - * Allows copying from one registry key to another. - * - * - * IID_IRMACopyRegistry - * - * {00000606-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMACopyRegistry, 0x00000606, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMACopyRegistry - -DECLARE_INTERFACE_(IRMACopyRegistry, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /************************************************************************ - * IRMACopyRegistry::Copy - * - * Here it is! The "Copy" method! - */ - STDMETHOD (CopyByName) (THIS_ - const char* pFrom, - const char* pTo) PURE; -}; - - -/* - * - * Interface: - * - * IRMAPNRegistryAltStringHandling - * - * Purpose: - * - * Tells the registry about alternate handling of PT_STRING types. - * - * - * IID_IRMAPNRegistryAltStringHandling - * - * {00000607-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAPNRegistryAltStringHandling, 0x00000607, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAPNRegistryAltStringHandling - -DECLARE_INTERFACE_(IRMAPNRegistryAltStringHandling, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /************************************************************************ - * IRMAPNRegistryAltStringHandling::SetStringAccessAsBufferById - * - * For those times when you added a property as a buffer, but wish it - * were a string (and of course, people now rely on the fact that it's - * a buffer)... Create the property as a string and then pass this - * method it's ID. The property will now be accessible/setable as a, - * but it will still be a string! - */ - STDMETHOD (SetStringAccessAsBufferById) (THIS_ - UINT32 ulId) PURE; -}; - - -#endif /* _RMAMON_H_ */ diff --git a/include/realmedia/rmapckts.h b/include/realmedia/rmapckts.h deleted file mode 100644 index 42cbf57ff..000000000 --- a/include/realmedia/rmapckts.h +++ /dev/null @@ -1,449 +0,0 @@ -/**************************************************************************** - * - * $Id: rmapckts.h 7 2003-05-30 02:18:02Z gabest $ - * - * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved. - * - * http://www.real.com/devzone - * - * This program contains proprietary - * information of Progressive Networks, Inc, and is licensed - * subject to restrictions on use and distribution. - * - * - * RealMedia Architecture Packet and Header Interface. - * - */ - -#ifndef _RMAPCKTS_H_ -#define _RMAPCKTS_H_ - -// Define IRMAUtilities - -/* ASMFlags in IRMAPacket */ -#define RMA_ASM_SWITCH_ON 0x01 -#define RMA_ASM_SWITCH_OFF 0x02 - - -/**************************************************************************** - * - * Interface: - * - * IRMABuffer - * - * Purpose: - * - * Basic opaque data storage buffer. Used in interfaces where - * object ownership is best managed through COM style reference - * counting. - * - * IID_IRMABuffer: - * - * {00001300-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMABuffer, 0x00001300, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -/* - * The IRMACommonClassFactory supports creating an instance - * of this object. - */ -#define CLSID_IRMABuffer IID_IRMABuffer - -#undef INTERFACE -#define INTERFACE IRMABuffer - -DECLARE_INTERFACE_(IRMABuffer, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMABuffer methods - */ - STDMETHOD(Get) (THIS_ - REF(UCHAR*) pData, - REF(ULONG32) ulLength) PURE; - - STDMETHOD(Set) (THIS_ - const UCHAR* pData, - ULONG32 ulLength) PURE; - - STDMETHOD(SetSize) (THIS_ - ULONG32 ulLength) PURE; - - STDMETHOD_(ULONG32,GetSize) (THIS) PURE; - - STDMETHOD_(UCHAR*,GetBuffer)(THIS) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAPacket - * - * Purpose: - * - * Basic data packet in the RealMedia system. - * - * IID_IRMAPacket: - * - * {00001301-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAPacket, 0x00001301, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -/* - * The IRMACommonClassFactory supports creating an instance - * of this object. - */ -#define CLSID_IRMAPacket IID_IRMAPacket - -#undef INTERFACE -#define INTERFACE IRMAPacket - -DECLARE_INTERFACE_(IRMAPacket, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAPacket methods - */ - STDMETHOD(Get) (THIS_ - REF(IRMABuffer*) pBuffer, - REF(UINT32) ulTime, - REF(UINT16) unStreamNumber, - REF(UINT8) unASMFlags, - REF(UINT16) unASMRuleNumber - ) PURE; - - STDMETHOD_(IRMABuffer*,GetBuffer) (THIS) PURE; - - STDMETHOD_(ULONG32,GetTime) (THIS) PURE; - - STDMETHOD_(UINT16,GetStreamNumber) (THIS) PURE; - - STDMETHOD_(UINT8,GetASMFlags) (THIS) PURE; - - STDMETHOD_(UINT16,GetASMRuleNumber) (THIS) PURE; - - STDMETHOD_(BOOL,IsLost) (THIS) PURE; - - STDMETHOD(SetAsLost) (THIS) PURE; - - STDMETHOD(Set) (THIS_ - IRMABuffer* pBuffer, - UINT32 ulTime, - UINT16 uStreamNumber, - UINT8 unASMFlags, - UINT16 unASMRuleNumber - ) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAPacket - * - * Purpose: - * - * RTP data packet in the RealMedia system. - * - * IID_IRMARTPPacket: - * - * {0169A731-1ED0-11d4-952B-00902742C923} - * - */ -DEFINE_GUID(IID_IRMARTPPacket, 0x169a731, 0x1ed0, 0x11d4, 0x95, 0x2b, 0x0, - 0x90, 0x27, 0x42, 0xc9, 0x23); - -/* - * The IRMACommonClassFactory supports creating an instance - * of this object. - */ -#define CLSID_IRMARTPPacket IID_IRMARTPPacket - -#undef INTERFACE -#define INTERFACE IRMARTPPacket - -DECLARE_INTERFACE_(IRMARTPPacket, IRMAPacket) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAPacket methods - */ - STDMETHOD(Get) (THIS_ - REF(IRMABuffer*) pBuffer, - REF(UINT32) ulTime, - REF(UINT16) unStreamNumber, - REF(UINT8) unASMFlags, - REF(UINT16) unASMRuleNumber - ) PURE; - - STDMETHOD_(IRMABuffer*,GetBuffer) (THIS) PURE; - - STDMETHOD_(ULONG32,GetTime) (THIS) PURE; - - STDMETHOD_(UINT16,GetStreamNumber) (THIS) PURE; - - STDMETHOD_(UINT8,GetASMFlags) (THIS) PURE; - - STDMETHOD_(UINT16,GetASMRuleNumber) (THIS) PURE; - - STDMETHOD_(BOOL,IsLost) (THIS) PURE; - - STDMETHOD(SetAsLost) (THIS) PURE; - - STDMETHOD(Set) (THIS_ - IRMABuffer* pBuffer, - UINT32 ulTime, - UINT16 uStreamNumber, - UINT8 unASMFlags, - UINT16 unASMRuleNumber - ) PURE; - - /* - * IRMARTPPacket methods - */ - STDMETHOD_(ULONG32,GetRTPTime) (THIS) PURE; - - STDMETHOD(GetRTP) (THIS_ - REF(IRMABuffer*) pBuffer, - REF(UINT32) ulTime, - REF(UINT32) ulRTPTime, - REF(UINT16) unStreamNumber, - REF(UINT8) unASMFlags, - REF(UINT16) unASMRuleNumber - ) PURE; - - STDMETHOD(SetRTP) (THIS_ - IRMABuffer* pBuffer, - UINT32 ulTime, - UINT32 ulRTPTime, - UINT16 uStreamNumber, - UINT8 unASMFlags, - UINT16 unASMRuleNumber - ) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAValues - * - * Purpose: - * - * This is an interface to a generic name-value pair facility. This - * is used in various places (such as stream headers). - * - * IID_IRMAValues: - * - * {00001302-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAValues, 0x00001302, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -/* - * The IRMACommonClassFactory supports creating an instance - * of this object. - */ -#define CLSID_IRMAValues IID_IRMAValues - -#undef INTERFACE -#define INTERFACE IRMAValues - -DECLARE_INTERFACE_(IRMAValues, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAValues methods - */ - - /* - * Note: That strings returned as references should be copied or - * used immediately because their lifetime is only as long as the - * IRMAValues's objects lifetime. - * - * Note: Your iterator will be reset once you give up control to the - * RMA core (i.e. you exit whatever function gave you a time slice). - */ - - STDMETHOD(SetPropertyULONG32) (THIS_ - const char* pPropertyName, - ULONG32 uPropertyValue) PURE; - - STDMETHOD(GetPropertyULONG32) (THIS_ - const char* pPropertyName, - REF(ULONG32) uPropertyName) PURE; - - STDMETHOD(GetFirstPropertyULONG32) (THIS_ - REF(const char*) pPropertyName, - REF(ULONG32) uPropertyValue) PURE; - - STDMETHOD(GetNextPropertyULONG32) (THIS_ - REF(const char*) pPropertyName, - REF(ULONG32) uPropertyValue) PURE; - - STDMETHOD(SetPropertyBuffer) (THIS_ - const char* pPropertyName, - IRMABuffer* pPropertyValue) PURE; - - STDMETHOD(GetPropertyBuffer) (THIS_ - const char* pPropertyName, - REF(IRMABuffer*) pPropertyValue) PURE; - - STDMETHOD(GetFirstPropertyBuffer) (THIS_ - REF(const char*) pPropertyName, - REF(IRMABuffer*) pPropertyValue) PURE; - - STDMETHOD(GetNextPropertyBuffer) (THIS_ - REF(const char*) pPropertyName, - REF(IRMABuffer*) pPropertyValue) PURE; - - STDMETHOD(SetPropertyCString) (THIS_ - const char* pPropertyName, - IRMABuffer* pPropertyValue) PURE; - - STDMETHOD(GetPropertyCString) (THIS_ - const char* pPropertyName, - REF(IRMABuffer*) pPropertyValue) PURE; - - STDMETHOD(GetFirstPropertyCString) (THIS_ - REF(const char*) pPropertyName, - REF(IRMABuffer*) pPropertyValue) PURE; - - STDMETHOD(GetNextPropertyCString) (THIS_ - REF(const char*) pPropertyName, - REF(IRMABuffer*) pPropertyValue) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAValuesRemove - * - * Purpose: - * - * This interface is to add Remove methods to a class that supports - * IRMAValues. All classes that support this interface will also - * support IRMAValues. - * - * - * - * IID_IRMAValuesRemove: - * - * {00001303-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAValuesRemove, 0x00001303, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -/* - * The IRMACommonClassFactory does not support creating an instance - * of this object. - */ - -#undef INTERFACE -#define INTERFACE IRMAValuesRemove - -DECLARE_INTERFACE_(IRMAValuesRemove, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAValuesRemove methods - */ - - /************************************************************************ - * Method: - * IRMAKeyValuesRemove::Remove - * Purpose: - * Remove all items matching pKey. (If you know what datatype you saved - * the key as, use the specific method.) - */ - STDMETHOD(Remove) (const char* pKey) PURE; - - /************************************************************************ - * Method: - * IRMAKeyValuesRemove::RemoveULONG32 - * Purpose: - * Remove all ULONG32 items matching pKey. - */ - STDMETHOD(RemoveULONG32) (const char* pKey) PURE; - - /************************************************************************ - * Method: - * IRMAKeyValuesRemove::RemoveBuffer - * Purpose: - * Remove all Buffer items matching pKey. - */ - STDMETHOD(RemoveBuffer) (const char* pKey) PURE; - - /************************************************************************ - * Method: - * IRMAKeyValuesRemove::RemoveCString - * Purpose: - * Remove all CString items matching pKey. - */ - STDMETHOD(RemoveCString) (const char* pKey) PURE; -}; - -#endif /* _RMAPCKTS_H_ */ - diff --git a/include/realmedia/rmapends.h b/include/realmedia/rmapends.h deleted file mode 100644 index 1cc22856b..000000000 --- a/include/realmedia/rmapends.h +++ /dev/null @@ -1,83 +0,0 @@ -/**************************************************************************** - * - * $Id: rmapends.h 7 2003-05-30 02:18:02Z gabest $ - * - * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved. - * - * http://www.real.com/devzone - * - * This program contains proprietary - * information of Progressive Networks, Inc, and is licensed - * subject to restrictions on use and distribution. - * - * - * Pending Status interfaces - * - */ - -#ifndef _RMAPENDS_H_ -#define _RMAPENDS_H_ - -/* - * Forward declarations of some interfaces defined or used here-in. - */ -typedef _INTERFACE IUnknown IUnknown; -typedef _INTERFACE IRMAPendingStatus IRMAPendingStatus; - - -/**************************************************************************** - * - * Interface: - * - * IRMAPendingStatus - * - * Purpose: - * - * Interface to get the current pending status from an object - * - * IRMAPendingStatus: - * - * {00001100-0901-11d1-8B06-00A024406D59} - */ - -DEFINE_GUID(IID_IRMAPendingStatus, 0x00001100, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAPendingStatus - -#define RMA_STATUS_INITIALIZING 0x01 -#define RMA_STATUS_BUFFERING 0x02 -#define RMA_STATUS_CONTACTING 0x03 -#define RMA_STATUS_READY 0x04 - -DECLARE_INTERFACE_(IRMAPendingStatus, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAPendingStatus methods - */ - - /************************************************************************ - * Method: - * IRMAPendingStatus::GetStatus - * Purpose: - * Called by the user to get the current pending status from an object - */ - STDMETHOD(GetStatus) (THIS_ - REF(UINT16) uStatusCode, - REF(IRMABuffer*) pStatusDesc, - REF(UINT16) ulPercentDone) PURE; -}; - -#endif /* _RMAPENDS_H_ */ diff --git a/include/realmedia/rmaphook.h b/include/realmedia/rmaphook.h deleted file mode 100644 index 99722db01..000000000 --- a/include/realmedia/rmaphook.h +++ /dev/null @@ -1,302 +0,0 @@ -/**************************************************************************** - * - * $Id: rmaphook.h 7 2003-05-30 02:18:02Z gabest $ - * - * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved. - * - * http://www.real.com/devzone - * - * This program contains proprietary - * information of Progressive Networks, Inc, and is licensed - * subject to restrictions on use and distribution. - * - * - * RealMedia Architecture Selective Record interface - * - */ - -#ifndef _RMAPHOOK_H_ -#define _RMAPHOOK_H_ - -/* - * Forward declarations of some interfaces defined or used here-in. - */ -typedef _INTERFACE IRMAPacket IRMAPacket; -typedef _INTERFACE IRMAPacketHook IRMAPacketHook; -typedef _INTERFACE IRMAPacketHookManager IRMAPacketHookManager; -typedef _INTERFACE IRMAPacketHookHelper IRMAPacketHookHelper; -typedef _INTERFACE IRMAPacketHookHelperResponse IRMAPacketHookHelperResponse; - -/**************************************************************************** - * - * Interface: - * - * IRMAPacketHook - * - * Purpose: - * - * Interface implemented by the top level client to support selective - * record - * - * IID_IRMAPacketHook: - * - * {00002000-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAPacketHook, 0x00002000, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -DECLARE_INTERFACE_(IRMAPacketHook, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAPacketHook methods - */ - - /************************************************************************ - * Method: - * IRMAPacketHook::OnStart - * Purpose: - * Called by the core to notify the start of this packet hook session - */ - STDMETHOD(OnStart) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAPacketHook::OnEnd - * Purpose: - * Called by the core to notify the end of this packet hook session - */ - STDMETHOD(OnEnd) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAPacketHook::OnFileHeader - * Purpose: - * Called by the core to send file header information - * - */ - STDMETHOD(OnFileHeader) (THIS_ - IRMAValues* pValues) PURE; - - /************************************************************************ - * Method: - * IRMAPacketHook::OnStreamHeader - * Purpose: - * Called by the core to send stream header information - * - */ - STDMETHOD(OnStreamHeader) (THIS_ - IRMAValues* pValues) PURE; - - /************************************************************************ - * Method: - * IRMAPacketHook:OnPacket - * Purpose: - * Called by the core to send packet information. - * - */ - STDMETHOD(OnPacket) (THIS_ - IRMAPacket* pPacket) PURE; -}; - -/**************************************************************************** - * - * Interface: - * - * IRMAPacketHookManager - * - * Purpose: - * - * Interface to the selective record - * - * IID_IRMAPacketHookManager - * - * {00002001-0901-11d1-8B06-00A024406D59} - */ -DEFINE_GUID(IID_IRMAPacketHookManager, 0x00002001, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAPacketHookManager - -DECLARE_INTERFACE_(IRMAPacketHookManager, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAPacketHookManager methods - */ - - /************************************************************************ - * Method: - * IRMAPacketHookManager::InitHook - * Purpose: - * called by the top level client to pass the IRMAPacketHook object - */ - STDMETHOD(InitHook) (THIS_ - IRMAPacketHook* pPacketHook) PURE; - - /************************************************************************ - * Method: - * IRMAPacketHookManager::CloseHook - * Purpose: - * called by the top level client to close the hook connection - */ - STDMETHOD(CloseHook) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAPacketHookManager::StartHook - * Purpose: - * called by the top level client to start recording - */ - STDMETHOD(StartHook) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAPacketHookManager::StopHook - * Purpose: - * called by the top level client to stop recording - */ - STDMETHOD(StopHook) (THIS) PURE; -}; - -/**************************************************************************** - * - * Interface: - * - * IRMAPacketHookHelper - * - * Purpose: - * - * provide methods to prepare the packet for recording and send back the core - * - * IID_IRMAPacketHookHelper: - * - * {00002002-0901-11d1-8B06-00A024406D59} - * - */ - -DEFINE_GUID(IID_IRMAPacketHookHelper, 0x00002002, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAPacketHookHelper - -DECLARE_INTERFACE_(IRMAPacketHookHelper, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAPacketHookHelper methods - */ - - /****************************************************************** - * Method: - * IRMAPacketHookHelper::StartHook - * - * Purpose: - * tell the renderer to start sending the record packets - * - */ - STDMETHOD(StartHook) (THIS_ - ULONG32 ulStreamNumber, - ULONG32 ulTimeOffset, - IRMAPacketHookHelperResponse* pPacketHookHelperResponse) PURE; - - - /****************************************************************** - * Method: - * IRMAPacketHookHelper::StopHook - * - * Purpose: - * tell the renderer to stop sending the record packets - */ - STDMETHOD(StopHook) (THIS) PURE; -}; - -/**************************************************************************** - * - * Interface: - * - * IRMAPacketHookHelperResponse - * - * Purpose: - * - * Response interface to the IRMAPacketHookHelper at renderer - * - * IID_IRMAPacketHookHelperResponse - * - * {00002003-0901-11d1-8B06-00A024406D59} - */ -DEFINE_GUID(IID_IRMAPacketHookHelperResponse, 0x00002003, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAPacketHookHelperResponse - -DECLARE_INTERFACE_(IRMAPacketHookHelperResponse, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAPacketHookHelperResponse methods - */ - - /************************************************************************ - * Method: - * IRMAPacketHookHelperResponse::OnPacket - * Purpose: - * called by the renderer to pass the packet for recording - */ - STDMETHOD(OnPacket) (THIS_ - IRMAPacket* pPacket) PURE; - - /************************************************************************ - * Method: - * IRMAPacketHookManager::OnEndOfPackets - * Purpose: - * called by the renderer to notify the end of this stream - */ - STDMETHOD(OnEndOfPackets) (THIS) PURE; -}; - -#endif /* _RMAPHOOK_H_ */ diff --git a/include/realmedia/rmaplgns.h b/include/realmedia/rmaplgns.h deleted file mode 100644 index ec6e794c4..000000000 --- a/include/realmedia/rmaplgns.h +++ /dev/null @@ -1,152 +0,0 @@ -/**************************************************************************** - * - * $Id: rmaplgns.h 7 2003-05-30 02:18:02Z gabest $ - * - * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved. - * - * http://www.real.com/devzone - * - * This program contains proprietary - * information of Progressive Networks, Inc, and is licensed - * subject to restrictions on use and distribution. - * - * - * RealMedia Architecture Plug-in Interfaces. - * - */ - -#ifndef _RMAPLGNS_H_ -#define _RMAPLGNS_H_ - -/* - * Forward declarations of some interfaces defined or used here-in. - */ -typedef _INTERFACE IUnknown IUnknown; -typedef _INTERFACE IRMAObjectConfiguration IRMAObjectConfiguration; -typedef _INTERFACE IRMAPluginProperties IRMAPluginProperties; -typedef _INTERFACE IRMABuffer IRMABuffer; -typedef _INTERFACE IRMAValues IRMAValues; - -/**************************************************************************** - * - * Interface: - * - * IRMAObjectConfiguration - * - * Purpose: - * - * Interface for setting context and generic means of plugin - * Configuration. - * - * IRMAObjectConfiguration: - * - * {0x00002900-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAObjectConfiguration, 0x00002900, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAObjectConfiguration - -DECLARE_INTERFACE_(IRMAObjectConfiguration, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAObjectConfiguration::SetContext - * Purpose: - * This function is called to set the context for the plugin. - * Either IRMAPlugin::InitPlugin or this function must be called - * before calling any other function on the plugin. - * this is intended to be used as a shortcut for the plugin user. - * If one needs to use SetConfiguration they only need to query - * IRMAObjectConfiguration saving them from also querying for - * IRMAPlugin. - * - */ - STDMETHOD(SetContext) - ( - THIS_ - IUnknown* pIUnknownContext - ) PURE; - - /************************************************************************ - * Method: - * IRMAObjectConfiguration::SetConfiguration - * Purpose: - * This allows the user of a plugin to supply configuration - * information. This is often a set of CString properties - * extracted from a list in the config file. This allows - * each plugin within a class (auth plugin, database plugin, etc..) - * to require a different set of parameters. - * - */ - STDMETHOD(SetConfiguration) - ( - THIS_ - IRMAValues* pIRMAValuesConfiguration - ) PURE; - -}; - -/**************************************************************************** - * - * Interface: - * - * IRMAPluginProperties - * - * Purpose: - * - * This allows plugins to return whatever properties they want. - * - * IRMAPluginProperties: - * - * {0x00002901-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAPluginProperties, 0x00002901, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAPluginProperties - -DECLARE_INTERFACE_(IRMAPluginProperties, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAPluginProperties::GetProperties - * Purpose: - * A plugin will implement this in order to return plugin properties - * that will allow it to be identified uniquely. (PluginID, - * AuthenticationProtocol, etc..) - * - */ - STDMETHOD(GetProperties) - ( - THIS_ - REF(IRMAValues*) pIRMAValuesProperties - ) PURE; - -}; - -#endif /* !_RMAPLGNS_H_ */ diff --git a/include/realmedia/rmaplugn.h b/include/realmedia/rmaplugn.h deleted file mode 100644 index cac1c90c2..000000000 --- a/include/realmedia/rmaplugn.h +++ /dev/null @@ -1,696 +0,0 @@ -/**************************************************************************** - * - * $Id: rmaplugn.h 7 2003-05-30 02:18:02Z gabest $ - * - * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved. - * - * http://www.real.com/devzone - * - * This program contains proprietary - * information of Progressive Networks, Inc, and is licensed - * subject to restrictions on use and distribution. - * - * - * Plugin init / inspector interfaces - * - */ - -#ifndef _RMAPLUGN_H_ -#define _RMAPLUGN_H_ - -/* - * Forward declarations of some interfaces defined or used here-in. - */ -typedef _INTERFACE IUnknown IUnknown; -typedef _INTERFACE IRMAPlugin IRMAPlugin; -typedef _INTERFACE IRMAPluginEnumerator IRMAPluginEnumerator; -typedef _INTERFACE IRMAPluginChallenger IRMAPluginChallenger; -typedef _INTERFACE IRMABuffer IRMABuffer; -typedef _INTERFACE IRMAValues IRMAValues; - -/**************************************************************************** - * - * Function: - * - * RMACreateInstance() - * - * Purpose: - * - * Function implemented by all plugin DLL's to create an instance of - * any of the objects supported by the DLL. This method is similar to - * Window's CoCreateInstance() in its purpose, except that it only - * creates objects from this plugin DLL. - * - * NOTE: Aggregation is never used. Therefore an outer unknown is - * not passed to this function, and you do not need to code for this - * situation. - * - */ -#ifdef _MACINTOSH -#pragma export on -#endif - -STDAPI RMACreateInstance - ( - IUnknown** /*OUT*/ ppIUnknown - ); - -#ifdef _MACINTOSH -#pragma export off -#endif - - -/**************************************************************************** - * - * Function: - * - * RMAShutdown() - * - * Purpose: - * - * Function implemented by all plugin DLL's to free any *global* - * resources. This method is called just before the DLL is unloaded. - * - */ -#ifdef _MACINTOSH -#pragma export on -#endif - -STDAPI RMAShutdown(void); - -#ifdef _MACINTOSH -#pragma export off -#endif - - -/**************************************************************************** - * - * Interface: - * - * IRMAPlugin - * - * Purpose: - * - * Interface exposed by a plugin DLL to allow inspection of objects - * supported by the plugin DLL. - * - * IID_IRMAPlugin: - * - * {00000C00-0901-11d1-8B06-00A024406D59} - * - */ - -DEFINE_GUID(IID_IRMAPlugin, 0x00000C00, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAPlugin - -DECLARE_INTERFACE_(IRMAPlugin, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAPlugin methods - */ - - /************************************************************************ - * Method: - * IRMAPlugin::GetPluginInfo - * Purpose: - * Returns the basic information about this plugin. Including: - * - * bMultipleLoad Whether or not this plugin can be instantiated - * multiple times. All File Formats must set - * this value to TRUE. The only other type of - * plugin that can specify bMultipleLoad=TRUE is - * a filesystem plugin. Any plugin that sets - * this flag to TRUE must not use global variables - * of any type. - * - * Setting this flag to TRUE implies that you - * accept that your plugin may be instantiated - * multiple times (possibly in different - * address spaces). Plugins are instantiated - * multiple times only in the server (for - * performance reasons). - * - * An example of a plugin, that must set this - * flag to FALSE is a filesystem plugin that - * uses a single TCP connection to communicate - * with a database. - * - * pDescription which is used in about UIs (can be NULL) - * pCopyright which is used in about UIs (can be NULL) - * pMoreInfoURL which is used in about UIs (can be NULL) - * ulVersionNumber The version of this plugin. - */ - STDMETHOD(GetPluginInfo) (THIS_ - REF(BOOL) /*OUT*/ bMultipleLoad, - REF(const char*) /*OUT*/ pDescription, - REF(const char*) /*OUT*/ pCopyright, - REF(const char*) /*OUT*/ pMoreInfoURL, - REF(ULONG32) /*OUT*/ ulVersionNumber) PURE; - - /************************************************************************ - * Method: - * IRMAPlugin::InitPlugin - * Purpose: - * Initializes the plugin for use. This interface must always be - * called before any other method is called. This is primarily needed - * so that the plugin can have access to the context for creation of - * IRMABuffers and IMalloc. - */ - STDMETHOD(InitPlugin) (THIS_ - IUnknown* /*IN*/ pContext) PURE; - -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAPluginEnumerator - * - * Purpose: - * - * provide methods to enumerate through all the plugins installed - * - * IID_IRMAPluginEnumerator: - * - * {00000C01-0901-11d1-8B06-00A024406D59} - * - */ - -DEFINE_GUID(IID_IRMAPluginEnumerator, 0x00000C01, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAPluginEnumerator - -DECLARE_INTERFACE_(IRMAPluginEnumerator, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAPluginEnumerator methods - */ - - /************************************************************************ - * Method: - * IRMAPluginEnumerator::GetNumOfPlugins - * - * Purpose: - * return the number of plugins available - * - */ - STDMETHOD_(ULONG32,GetNumOfPlugins) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAPluginEnumerator::GetPlugin - * Purpose: - * Return an instance (IUnknown) of the plugin - * - */ - STDMETHOD(GetPlugin) (THIS_ - ULONG32 /*IN*/ ulIndex, - REF(IUnknown*) /*OUT*/ pPlugin) PURE; - -}; - -/**************************************************************************** - * - * Interface: - * - * IRMAPluginGroupEnumerator - * - * Purpose: - * - * Provide a way to enumerate through all of the plugins which - * implement a specific interface. - * - * IID_IRMAPluginGroupEnumerator: - * - * {00000C02-0901-11d1-8B06-00A024406D59} - * - */ - -DEFINE_GUID(IID_IRMAPluginGroupEnumerator, 0x00000C02, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAPluginGroupEnumerator - -#define CLSID_IRMAPluginGroupEnumerator IID_IRMAPluginGroupEnumerator - -DECLARE_INTERFACE_(IRMAPluginGroupEnumerator, IUnknown) -{ - /* - * IUnknown methods - */ - - /* - * IRMAPluginGroupEnumerator methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /****************************************************************** - * Method: - * IRMAPluginGroupEnumerator::Init - * - * Purpose: - * tell the group enumerator which interface to group the plugins - * into, this method must be called before the other methods can - * be called. - * - */ - STDMETHOD(Init) (THIS_ - REFIID iid) PURE; - - - /****************************************************************** - * Method: - * IRMAPluginGroupEnumerator::GetNumOfPlugins - * - * Purpose: - * return the number of plugins available that support a -particular - * interface. - * - */ - STDMETHOD_(ULONG32,GetNumOfPlugins) (THIS) PURE; - - - /****************************************************************** - * Method: - * IRMAPluginGroupEnumerator::GetPlugin - * Purpose: - * Return an instance (IUnknown) of the plugin - * - */ - STDMETHOD(GetPlugin) (THIS_ - UINT32 /*IN*/ ulIndex, - REF(IUnknown*) /*OUT*/ pPlugin) PURE; - -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAPluginReloader - * - * Purpose: - * - * Tells the client core to reload all plugins. - * - * IID_IRMAPluginReloader: - * - * {00000C03-0901-11d1-8B06-00A024406D59} - * - */ - -DEFINE_GUID(IID_IRMAPluginReloader, 0x00000C03, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAPluginReloader - -DECLARE_INTERFACE_(IRMAPluginReloader, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAPluginReloader methods - */ - - /************************************************************************ - * Method: - * IRMAPluginReloader::ReloadPlugins - * Purpose: - * Causes the client core to reload all plugins. - * - */ - STDMETHOD(ReloadPlugins) (THIS) PURE; -}; - - - -/**************************************************************************** - * - * Interface: - * - * IRMAPluginFactory - * - * Purpose: - * - * This interface is implemented by a plugin in order to have more then - * one "RMA plugin" in a single DLL. I.e., a plugin author could - * use this interface to have 3 different file format plugins in - * a single DLL. - * - * IID_IRMAPluginFactory: - * - * {00000C04-0901-11d1-8B06-00A024406D59} - * - */ - -DEFINE_GUID(IID_IRMAPluginFactory, 0x00000C04, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAPluginFactory - -DECLARE_INTERFACE_(IRMAPluginFactory, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAPluginFactory methods - */ - - /***************************************************************** - * Method: - * IRMAPluginFactory::GetNumPlugins - * Purpose: - * Report the number of Plugins within the DLL. - * - * Parameters: - */ - STDMETHOD_(UINT16, GetNumPlugins) (THIS) PURE; - - /***************************************************************** - * Method: - * IRMAPluginFactory::GetPlugin - * Purpose: - * Returns an IUnknown interface to the requested plugin. - * - * Parameters: - */ - - STDMETHOD(GetPlugin) (THIS_ - UINT16 uIndex, - IUnknown** pPlugin) PURE; -}; - - - -/**************************************************************************** - * - * Interface: - * - * IRMAGenericPlugin - * - * Purpose: - * - * Interface exposed by a plugin DLL to inform the client / server core - * that your plugin wishes to have InitPlugin called immediately. - * - * IID_IRMAGenericPlugin: - * - * {00000C09-0901-11d1-8B06-00A024406D59} - * - */ - -DEFINE_GUID(IID_IRMAGenericPlugin, 0x00000C09, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAGenericPlugin - -DECLARE_INTERFACE_(IRMAGenericPlugin, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAGenericPlugin methods - */ - - STDMETHOD(IsGeneric) (THIS_ - REF(BOOL) /*OUT*/ bIsGeneric) PURE; -}; - - -DEFINE_GUID(IID_IRMAPluginHandler, 0x00000200, 0xb4c8, 0x11d0, 0x99, 0x95, 0x0, 0xa0, 0x24, 0x8d, 0xa5, 0xf0); - -DEFINE_GUID(IID_IRMAPlugin2Handler, 0x00000201, 0xb4c8, 0x11d0, 0x99, 0x95, 0x0, 0xa0, 0x24, 0x8d, 0xa5, 0xf0); - -#undef INTERFACE -#define INTERFACE IRMAPlugin2Handler - -DECLARE_INTERFACE_(IRMAPlugin2Handler, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAPlugin2Handler Methods - */ - - /************************************************************************ - * Method: - * IRMAPlugin2Handler::Init - * - * Purpose: - * Specifies the context and sets the pluginhandler in motion. - * - */ - STDMETHOD(Init) (THIS_ IUnknown* pContext) PURE; - - /************************************************************************ - * Method: - * IRMAPlugin2Handler::GetNumPlugins2 - * - * Purpose: - * Gets the info of a particular plugin. - * - */ - STDMETHOD_(ULONG32,GetNumOfPlugins2) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAPlugin2Handler::GetPluginInfo - * - * Purpose: - * Gets the info of a particular plugin. - * - */ - STDMETHOD(GetPluginInfo) (THIS_ - UINT32 unIndex, - REF(IRMAValues*) /*OUT*/ Values) PURE; - - /************************************************************************ - * Method: - * IRMAPlugin2Handler::FlushCache() - * - * Purpose: - * Flushes the LRU cache -- Unloads all DLLs from memory - * which currenltly have a refcount of 0. - */ - - STDMETHOD(FlushCache) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAPlugin2Handler::SetCacheSize - * - * Purpose: - * This function sets the size of the Cache. The cache is - * initally set to 1000KB. To disable the cache simply set - * the size to 0.If the cache is disabled a DLL will be - * unloaded whenever it's refcount becomes zero. Which MAY - * cause performance problems. - */ - - STDMETHOD(SetCacheSize) (THIS_ ULONG32 nSizeKB) PURE; - - /************************************************************************ - * Method: - * IRMAPlugin2Handler::GetInstance - * - * Purpose: - * - * This function will return a plugin instance given a plugin index. - * - */ - - STDMETHOD(GetInstance) (THIS_ UINT32 index, REF(IUnknown*) pUnknown) PURE; - - /************************************************************************ - * Method: - * IRMAPlugin2Handler::FindIndexUsingValues - * - * Purpose: - * Finds a plugin which matches the set of values given. An index - * is returned which can be used to either get the values (using - * GetPluginInfo) or an instance can be created using GetPluing(). - * - */ - - STDMETHOD(FindIndexUsingValues) (THIS_ IRMAValues*, - REF(UINT32) unIndex) PURE; - - /************************************************************************ - * Method: - * IRMAPlugin2Handler::FindPluginUsingValues - * - * Purpose: - * Finds a plugin which matches the set of values given. A Plugin - * instance is returned. - * - */ - - STDMETHOD(FindPluginUsingValues) (THIS_ IRMAValues*, - REF(IUnknown*) pUnk) PURE; - - /************************************************************************ - * Method: - * IRMAPlugin2Handler::FindIndexUsingStrings - * - * Purpose: - * Finds a plugin which matches the set of values given. An index - * is returned which can be used to either get the values (using - * GetPluginInfo) or an instance can be created using GetPluing(). - * NOTE: that a max of two values may be given. - */ - - STDMETHOD(FindIndexUsingStrings) (THIS_ char* PropName1, - char* PropVal1, - char* PropName2, - char* PropVal2, - char* PropName3, - char* PropVal3, - REF(UINT32) unIndex) PURE; - - /************************************************************************ - * Method: - * IRMAPlugin2Handler::FindPluginUsingStrings - * - * Purpose: - * Finds a plugin which matches the set of values given. A Plugin - * instance is returned. - * NOTE: that a max of two values may be given. - */ - - STDMETHOD(FindPluginUsingStrings) (THIS_ char* PropName1, - char* PropVal1, - char* PropName2, - char* PropVal2, - char* PropName3, - char* PropVal3, - REF(IUnknown*) pUnk) PURE; - - /************************************************************************ - * Method: - * IRMAPlugin2Handler::FindImplementationFromClassID - * - * Purpose: - * Finds a CommonClassFactory plugin which supports the - * ClassID given. An instance of the Class is returned. - */ - - STDMETHOD(FindImplementationFromClassID) - ( - THIS_ - REFGUID GUIDClassID, - REF(IUnknown*) pIUnknownInstance - ) PURE; - - /************************************************************************ - * Method: - * IRMAPlugin2Handler::Close - * - * Purpose: - * A function which performs all of the functions of delete. - * - * - */ - - STDMETHOD(Close) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAPlugin2Handler::SetRequiredPlugins - * - * Purpose: - * This function sets the required plugin list - * - * - */ - - STDMETHOD(SetRequiredPlugins) (THIS_ const char** ppszRequiredPlugins) PURE; - - -}; - - - - - - - - - -#endif /* _RMAPLUGN_H_ */ diff --git a/include/realmedia/rmappv.h b/include/realmedia/rmappv.h deleted file mode 100644 index 28c5744c4..000000000 --- a/include/realmedia/rmappv.h +++ /dev/null @@ -1,394 +0,0 @@ -/**************************************************************************** - * - * $Id: rmappv.h 7 2003-05-30 02:18:02Z gabest $ - * - * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved. - * - * http://www.real.com/devzone - * - * This program contains proprietary information of RealNetworks, Inc., - * and is licensed subject to restrictions on use and distribution. - * - * RealMedia Architecture Interfaces for pay-per-view database plugins - * - */ - -#ifndef _RMAPPV_H_ -#define _RMAPPV_H_ - -#ifdef _MACINTOSH // Unsure whether this should be included on other platforms? -#include // Get definition of time_t. -#endif - -/* - * Structures and definitions for PPVPermission - */ - -#define PPV_MAX_URL_LEN 2048 - -typedef enum _PPVURLType { - PPV_URL_TYPE_FILE = 0, - PPV_URL_TYPE_DIRECTORY -} PPVURLType; - -typedef enum _PPVPermissionType { - PPV_PERMISSION_GENERAL = 0, - PPV_PERMISSION_EXPIRES, - PPV_PERMISSION_DEBIT, - PPV_PERMISSION_CREDIT, - PPV_PERMISSION_NONE -} PPVPermissionType; - -typedef struct _PPVPermission -{ - char pURL[PPV_MAX_URL_LEN]; - PPVURLType nURLType; - PPVPermissionType nPermissionType; - time_t tExpires; - UINT32 ulDebitTime; -} PPVPermission; - - -/* - * Structures and definitions for PPVAccessLog - */ - -typedef enum _PPVAccessPermissionOn { - PPV_PERMISSION_ON_FILE = 0, - PPV_PERMISSION_ON_DIRECTORY, - PPV_PERMISSION_ON_NONE -} PPVAccessPermissionOn; - -typedef enum _PPVAccessDisconnectType { - PPV_DISCONNECT_CLIENT = 0, - PPV_DISCONNECT_TIME_EXPIRED -} PPVAccessDisconnectType; - -typedef struct _PPVAccessLog -{ - BOOL bAccessGranted; - char* pUserid; - char* pGUID; - char* pIPAddress; - char* pURL; - PPVPermissionType nPermissionType; - PPVAccessPermissionOn nPermOn; - time_t tStartTime; - time_t tStopTime; - UINT32 lTotalTime; - PPVAccessDisconnectType nWhyDisconnect; -} PPVAccessLog; - - -/* - * Structures and definitions for PPVRegLog - */ - -typedef enum _PPVRegStatus -{ - PPV_GUID_REG_SUCCESS = 0, - PPV_GUID_REG_FAILED_LOCKED, - PPV_GUID_REG_FAILED_COLLISION, - PPV_GUID_REG_FAILED_OLD_PLAYER, - PPV_GUID_REG_FAILED_NO_USER, - PPV_GUID_REG_FAILED -} PPVRegStatus; - -typedef struct _PPVRegLog -{ - PPVRegStatus nStatus; - char* pUserid; - char* pGUID; - char* pIPAddress; - time_t tRequestTime; - char* pURLRedirect; -} PPVRegLog; - - -/**************************************************************************** - * - * Interface: - * - * IRMAPPVDatabase - * - * Purpose: - * This interface provides access to a backend database used to store - * information related to the server's pay-per-view feature. - * - * IID_IRMAPPVDatabase: - * - * {00001d00-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAPPVDatabase, 0x00001d00, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAPPVDatabase - -DECLARE_INTERFACE_(IRMAPPVDatabase, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAPPVDatabase methods - */ - - /************************************************************************ - * Method: - * IRMAPPVDatabase::InitPPVDB - * Purpose: - * Open & Initialize the PPV Database. - * This function will called once per instance before any other - * methods are called. - * - * pDBName Name of the database (if supported) - * pUserID User ID to access database (if supported) - * pPassword Password to access database (if supported) - */ - STDMETHOD(InitPPVDB) (THIS_ - const char* pDBName, - const char* pUserID, - const char* pPassword) PURE; - - /************************************************************************ - * Method: - * IRMAPPVDatabase::GetPPVDBInfo - * Purpose: - * Get this databases short name. - * This unique identifier is used to identify this database plugin. - * It should be unique enough that no other plugin will ever have - * the same plugin name. - */ - STDMETHOD(GetPPVDBInfo) (THIS_ - REF(const char*) /*OUT*/ pShortName) PURE; - - /************************************************************************ - * Method: - * IRMAPPVDatabase::InsertUser - * Purpose: - * Inserts a user into the database (the user should not already - * exist). - * - * pUserid Userid key of the record to insert - * pPasswordCipher Optional Password to associate with this user; - * The password being passed in is already - * encrypted. - */ - STDMETHOD(InsertUser) (THIS_ - const char* pUserid, - const char* pPasswordCipher) PURE; - - /************************************************************************ - * Method: - * IRMAPPVDatabase::RemoveUser - * Purpose: - * Removes a user from the database. - * - * pUserid Userid key of the record - */ - STDMETHOD(RemoveUser) (THIS_ - const char* pUserid) PURE; - - /************************************************************************ - * Method: - * IRMAPPVDatabase::RegisterGUID - * Purpose: - * Registers a GUID to be associated with the pUserid - * - * pUserid Userid key of the record - * pGUID GUID to associate with user record - * bForce Forces registration of guid, even if - * the uuid_writeable flag is set to read only - */ - STDMETHOD(RegisterGUID) (THIS_ - const char* pUserid, - const char* pGUID, - BOOL bForce) PURE; - - /************************************************************************ - * Method: - * IRMAPPVDatabase::SetPassword - * Purpose: - * Sets the password for the user associated with pUserid - * - * pUserid Userid key of the record - * pCipherPassword User's Password - */ - STDMETHOD(SetPassword) (THIS_ - const char* pUserid, - const char* pCipherPassword) PURE; - - /************************************************************************ - * Method: - * IRMAPPVDatabase::ValidateUser - * Purpose: - * Sets the password for the user associated with pUserid - * - * pUserid Userid key of the record - * pPPVPermission Permission structure with URL to validate on - */ - STDMETHOD(ValidateUser) (THIS_ - const char* pUserid, - PPVPermission* pPPVPermission) PURE; - - /************************************************************************ - * Method: - * IRMAPPVDatabase::GrantPermission - * Purpose: - * Adds a permission record. - * - * pUserid Userid key of the record - * pPPVPermission Permission structure with URL - */ - STDMETHOD(GrantPermission) (THIS_ - const char* pUserid, - const PPVPermission* pPPVPermission) PURE; - - /************************************************************************ - * Method: - * IRMAPPVDatabase::RevokePermission - * Purpose: - * Removes a permission record. - * - * pUserid Userid key of the record - * pPPVPermission Permission structure with URL - */ - STDMETHOD(RevokePermission) (THIS_ - const char* pUserid, - const PPVPermission* pPPVPermission) PURE; - - /************************************************************************ - * Method: - * IRMAPPVDatabase::RevokeAllPermissions - * Purpose: - * Removes all permission records for a user. - * - * pUserid Userid key of the record - */ - STDMETHOD(RevokeAllPermissions) (THIS_ - const char* pUserid) PURE; - - /************************************************************************ - * Method: - * IRMAPPVDatabase::GetRedirect - * Purpose: - * Gets the redirection Url corresponding to the requested Url - * from the database. - * - * pURL Url key of redirect record (In) - * pURLRedirect Url to redirect to (Out) - * ulURLRedirectLen Maximum length of pURLRedirect (In) - */ - STDMETHOD(GetRedirect) (THIS_ - const char* pURL, - char* pURLRedirect, - UINT32 ulURLRedirectLen) PURE; - - /************************************************************************ - * Method: - * IRMAPPVDatabase::PutRedirect - * Purpose: - * Adds a redirection Url to the database to correspond with - * the Url key. - * - * - * pURL Url key of redirect record (In) - * pURLRedirect Url to redirect to (In) - */ - STDMETHOD(PutRedirect) (THIS_ - const char* pURL, - const char* pURLRedirect) PURE; - - /************************************************************************ - * Method: - * IRMAPPVDatabase::GrantTime - * Purpose: - * Grants a user time to view (specified by pPPVPermission). - * - * pUserid Userid key of the record - * pPPVPermission Permission structure with URL - * ulGrant Amount of time to grant - */ - STDMETHOD(GrantTime) (THIS_ - const char* pUserid, - const PPVPermission* pPPVPermission, - UINT32 ulGrant) PURE; - - /************************************************************************ - * Method: - * IRMAPPVDatabase::DeductTime - * Purpose: - * Deducts a user time to view (specified by pPPVPermission). - * - * pUserid Userid key of the record - * pPPVPermission Permission structure with URL - * ulDeduct Amount of time to deduct - */ - STDMETHOD(DeductTime) (THIS_ - const char* pUserid, - const PPVPermission* pPPVPermission, - UINT32 ulDeduct) PURE; - - /************************************************************************ - * Method: - * IRMAPPVDatabase::GetPasswordFromUserid - * Purpose: - * Get's a users password - * - * pUserid Userid key of the record (In) - * pCipherPassword Password to get (Out) - * ulCipherPasswordLen Maximum length of pCipherPassword - */ - STDMETHOD(GetPasswordFromUserid) (THIS_ - const char* pUserid, - char* pCipherPassword, - UINT32 ulCipherPasswordLen) PURE; - - /************************************************************************ - * Method: - * IRMAPPVDatabase::GetUseridFromGUID - * Purpose: - * Get's a users id - * - * pGUID GUID of existing user (In) - * pUserid Userid key of the record (Out) - * ulUseridLen Maximum length of pUserid (In) - */ - STDMETHOD(GetUseridFromGUID) (THIS_ - const char* pGUID, - char* pUserid, - UINT32 ulUseridLen) PURE; - - /************************************************************************ - * Method: - * IRMAPPVDatabase::LogReg - * Purpose: - * This function inserts a new record into the data with the logging - * information contained in pPPVRegLog - */ - STDMETHOD(LogReg) (THIS_ - PPVRegLog* pPPVRegLog) PURE; - - /************************************************************************ - * Method: - * IRMAPPVDatabase::LogAccess - * Purpose: - * This function inserts a new record into the data with the logging - * information contained in pPPVAccessLog - */ - STDMETHOD(LogAccess) (THIS_ - PPVAccessLog* pPPVAccessLog) PURE; - -}; - -#endif /*_RMAPPV_H_*/ diff --git a/include/realmedia/rmaprefs.h b/include/realmedia/rmaprefs.h deleted file mode 100644 index 024e67049..000000000 --- a/include/realmedia/rmaprefs.h +++ /dev/null @@ -1,284 +0,0 @@ -/**************************************************************************** - * - * $Id: rmaprefs.h 7 2003-05-30 02:18:02Z gabest $ - * - * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved. - * - * http://www.real.com/devzone - * - * This program contains proprietary - * information of Progressive Networks, Inc, and is licensed - * subject to restrictions on use and distribution. - * - * - * Persistent Preferences Interfaces - * - * Here are the preference entries set by the client core and renderers: - * KEY DEFAULT VALUES - * ================= ==================== - * AttemptMulticast 1 - * AttemptTCP 1 - * AttemptUDP 1 - * AudioQuality 0 - * AutoTransport 1 - * Bandwidth 28800 - * BitsPerSample 16 - * BroadcastPluginInfo {dllpath;description;copyright;moreinfo;loadmultiple;type}{ ... } - * ClientLicenseKey 7FF7FF00 - * EndScan 10000 - * FactoryPluginInfo - * FileFormatPluginInfo {dllpath;description;copyright;moreinfo;loadmultiple;mimetype1|mimetype2;extension1|extension2}{ ... } - * FileSystemPluginInfo {dllpath;description;copyright;moreinfo;loadmultiple;protocol;shortname}{ ... } - * GeneralPluginInfo {dllpath;description;copyright;moreinfo;loadmultiple}{ ... } - * PNAProxyHost - * PNAProxyPort 1090 - * RTSPProxyHost - * RTSPProxyPort 554 - * HTTPProxyHost - * HTTPProxyPort 1092 - * HurledURL 0 - * InfoandVolume 1 - * LastURL - * MaxClipCount 4 - * MetaFormatPluginInfo {dllpath;description;copyright;moreinfo;loadmultiple;mimetype1|mimetype2;extension1|extension2}{ ... } - * MiscPluginInfo {dllpath;description;copyright;moreinfo;loadmultiple}{ ... } - * MulticastTimeout 2000 - * NotProxy - * OnTop 0 - * PerfectPlayMode 0 - * PerfectPlayTime 60 - * PerfPlayEntireClip 1 - * PluginDirectory - * Presets# - * ProxySupport 0 - * RendererPluginInfo {dllpath;description;copyright;moreinfo;loadmultiple;mimetype1|mimetype2}{ ... } - * SamplingRate 8000 - * SeekPage 40 - * SendStatistics 1 - * ServerTimeOut 90 - * ShowPresets 0 - * StatusBar 1 - * StreamDescriptionPluginInfo {dllpath;description;copyright;moreinfo;loadmultiple;mimetype}{ ... } - * SyncMultimedia 1 - * UDPPort 7070 - * UDPTimeout 10000 - * UpgradeAvailable 0 - * UseUDPPort 0 - * Volume 50 - * x:Pref_windowPositionX - * y:Pref_WindowPositionY - */ - -#ifndef _RMAPREFS_H_ -#define _RMAPREFS_H_ - -#define RMAPNREGISTRY_PREFPROPNAME "ApplicationData" -/* - * Forward declarations of some interfaces defined or used here-in. - */ -typedef _INTERFACE IRMABuffer IRMABuffer; - -/**************************************************************************** - * - * Interface: - * - * IRMAPreferences - * - * Purpose: - * - * This interface allows you to store persistant preferences in the - * server or player's config / registry. - * - * IID_IRMAPreferences: - * - * {00000500-0901-11d1-8B06-00A024406D59} - * - */ - -DEFINE_GUID(IID_IRMAPreferences, 0x00000500, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAPreferences - -DECLARE_INTERFACE_(IRMAPreferences, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAPreferences methods - */ - - /************************************************************************ - * Method: - * IRMAPreferences::ReadPref - * Purpose: - * Read a preference from the registry or configuration. - */ - STDMETHOD(ReadPref) (THIS_ - const char* pPrekKey, REF(IRMABuffer*) pBuffer) PURE; - - /************************************************************************ - * Method: - * IRMAPreferences::WritePref - * Purpose: - * TBD - */ - STDMETHOD(WritePref) (THIS_ - const char* pPrekKey, IRMABuffer* pBuffer) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAPreferenceEnumerator - * - * Purpose: - * - * Allows preference Enumeration - * - * - * IRMAPreferenceEnumerator: - * - * {00000504-0901-11d1-8B06-00A024406D59} - * - */ - -DEFINE_GUID(IID_IRMAPreferenceEnumerator, 0x00000504, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAPreferenceEnumerator - -DECLARE_INTERFACE_(IRMAPreferenceEnumerator, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAPreferenceEnumerator methods - */ - - /************************************************************************ - * Method: - * IRMAPreferenceEnumerator::EndSubPref - * Purpose: - * TBD - */ - - STDMETHOD(BeginSubPref) (THIS_ const char* szSubPref) PURE; - - - /************************************************************************ - * Method: - * IRMAPreferenceEnumerator::EndSubPref - * Purpose: - * TBD - */ - - STDMETHOD(EndSubPref) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAPreferenceEnumerator::GetPrefKey - * Purpose: - * TBD - */ - - STDMETHOD(GetPrefKey) (THIS_ UINT32 nIndex, REF(IRMABuffer*) pBuffer) PURE; - - /************************************************************************ - * Method: - * IRMAPreferenceEnumerator::ReadPref - * Purpose: - * TBD - */ - STDMETHOD(ReadPref) (THIS_ - const char* pPrefKey, IRMABuffer*& pBuffer) PURE; - -}; - - - -/**************************************************************************** - * - * Interface: - * - * IRMAPreferences2 - * - * Purpose: - * - * New interface which gives sub-preference options abilities. - * - * - * IID_IRMAPreferences2: - * - * {00000503-0901-11d1-8B06-00A024406D59} - * - */ - -DEFINE_GUID(IID_IRMAPreferences2, 0x00000503, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAPreferences2 - -DECLARE_INTERFACE_(IRMAPreferences2, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAPreferences2 methods - */ - - /************************************************************************ - * Method: - * IRMAPreferences2::GetPreferenceEnumerator - * Purpose: - * Read a preference from the registry or configuration. - */ - - STDMETHOD(GetPreferenceEnumerator)(THIS_ REF(IRMAPreferenceEnumerator*) /*OUT*/ pEnum) PURE; - - /************************************************************************ - * Method: - * IRMAPreferences2::ResetRoot - * Purpose: - * Reset the root of the preferences - */ - - STDMETHOD(ResetRoot)(THIS_ const char* pCompanyName, const char* pProductName, - int nProdMajorVer, int nProdMinorVer) PURE; -}; - - - -#endif /* _RMAPREFS_H_ */ diff --git a/include/realmedia/rmapsink.h b/include/realmedia/rmapsink.h deleted file mode 100644 index d22ae0c40..000000000 --- a/include/realmedia/rmapsink.h +++ /dev/null @@ -1,147 +0,0 @@ -/**************************************************************************** - * - * $Id: rmapsink.h 7 2003-05-30 02:18:02Z gabest $ - * - * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved. - * - * http://www.real.com/devzone - * - * This program contains proprietary - * information of Progressive Networks, Inc, and is licensed - * subject to restrictions on use and distribution. - * - * - * RealMedia Architecture player creation interfaces. - * - */ - -#ifndef _RMAPSINK_H_ -#define _RMAPSINK_H_ - -/* - * Forward declarations of some interfaces defined here-in. - */ -typedef _INTERFACE IRMAPlayer IRMAPlayer; -typedef _INTERFACE IRMAPlayerSinkControl IRMAPlayerSinkControl; -typedef _INTERFACE IRMAPlayerSinkControl IRMAPlayerSinkControl; - - -/**************************************************************************** - * - * Interface: - * - * IRMAPlayerCreationSink - * - * Purpose: - * - * PlayerCreation Sink Interface - * - * IID_IRMAPlayerCreationSink: - * - * {00002100-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAPlayerCreationSink, 0x00002100, 0x901, 0x11d1, 0x8b, - 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -#undef INTERFACE -#define INTERFACE IRMAPlayerCreationSink - -DECLARE_INTERFACE_(IRMAPlayerCreationSink, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAPlayerCreationSink Methods - */ - - /************************************************************************ - * Method: - * IRMAPlayerCreationSink::PlayerCreated - * Purpose: - * Notification when a new player is created - * - */ - STDMETHOD(PlayerCreated) (THIS_ - IRMAPlayer* pPlayer) PURE; - - /************************************************************************ - * Method: - * IRMAPlayerCreationSink::PlayerClosed - * Purpose: - * Notification when an exisitng player is closed - * - */ - STDMETHOD(PlayerClosed) (THIS_ - IRMAPlayer* pPlayer) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAPlayerSinkControl - * - * Purpose: - * - * Player SinkControl Interface - * - * IID_IRMAPlayerSinkControl: - * - * {00002101-0901-11d1-8B06-00A024406D59} - * - */ - -DEFINE_GUID(IID_IRMAPlayerSinkControl, 0x00002101, 0x901, 0x11d1, 0x8b, - 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -#undef INTERFACE -#define INTERFACE IRMAPlayerSinkControl - -DECLARE_INTERFACE_(IRMAPlayerSinkControl, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAPlayerSinkControl Methods - */ - - /************************************************************************ - * Method: - * IRMAPlayerSinkControl::AddSink - * Purpose: - * Add a new sink - * - */ - STDMETHOD(AddSink) (THIS_ - IRMAPlayerCreationSink* pSink) PURE; - - /************************************************************************ - * Method: - * IRMAPlayerSinkControl::RemoveSink - * Purpose: - * Remove an exisitng sink - * - */ - STDMETHOD(RemoveSink) (THIS_ - IRMAPlayerCreationSink* pSink) PURE; -}; - -#endif /* _RMAPSINK_H_ */ diff --git a/include/realmedia/rmarendr.h b/include/realmedia/rmarendr.h deleted file mode 100644 index 17784cd1b..000000000 --- a/include/realmedia/rmarendr.h +++ /dev/null @@ -1,247 +0,0 @@ -/**************************************************************************** - * - * $Id: rmarendr.h 7 2003-05-30 02:18:02Z gabest $ - * - * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved. - * - * http://www.real.com/devzone - * - * This program contains proprietary - * information of Progressive Networks, Inc, and is licensed - * subject to restrictions on use and distribution. - * - * - * RealMedia Architecture Rendering Interfaces. - * - */ - -#ifndef _RMARENDR_H_ -#define _RMARENDR_H_ - -/* - * Forward declarations of some interfaces defined or used here-in. - */ -typedef _INTERFACE IRMARenderer IRMARenderer; -typedef _INTERFACE IRMAStream IRMAStream; -typedef _INTERFACE IRMAStreamSource IRMAStreamSource; -typedef _INTERFACE IRMAPlayer IRMAPlayer; -typedef _INTERFACE IRMAClientEngine IRMAClientEngine; - - -/**************************************************************************** - * - * Interface: - * - * IRMARenderer - * - * Purpose: - * - * Interface implemented by all renderers. Parts of this interface are - * called by the client engine to provide data packets to the - * individual renderers. - * - * IID_IRMARenderer: - * - * {00000300-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMARenderer, 0x00000300, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMARenderer - -typedef ULONG32 RMA_DISPLAY_TYPE; - -#define RMA_DISPLAY_NONE 0x00000000 -#define RMA_DISPLAY_WINDOW 0x00000001 -#define RMA_DISPLAY_SUPPORTS_RESIZE 0x00000002 -#define RMA_DISPLAY_SUPPORTS_FULLSCREEN 0x00000004 -#define RMA_DISPLAY_SUPPORTS_VIDCONTROLS 0x00000008 - - -DECLARE_INTERFACE_(IRMARenderer, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMARenderer methods - */ - - /************************************************************************ - * Method: - * IRMARenderer::GetRendererInfo - * Purpose: - * Returns information vital to the instantiation of rendering - * plugins. - */ - STDMETHOD(GetRendererInfo) (THIS_ - REF(const char**)/*OUT*/ pStreamMimeTypes, - REF(UINT32) /*OUT*/ unInitialGranularity - ) PURE; - - /************************************************************************ - * Method: - * IRMARenderer::StartStream - * Purpose: - * Called by client engine to inform the renderer of the stream it - * will be rendering. The stream interface can provide access to - * its source or player. This method also provides access to the - * primary client controller interface. - * - */ - STDMETHOD(StartStream) (THIS_ - IRMAStream* pStream, - IRMAPlayer* pPlayer) PURE; - - /************************************************************************ - * Method: - * IRMARenderer::EndStream - * Purpose: - * Called by client engine to inform the renderer that the stream - * is was rendering is closed. - * - */ - STDMETHOD(EndStream) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMARenderer::OnHeader - * Purpose: - * Called by client engine when a header for this renderer is - * available. The header will arrive before any packets. - * - */ - STDMETHOD(OnHeader) (THIS_ - IRMAValues* pHeader) PURE; - - /************************************************************************ - * Method: - * IRMARenderer::OnPacket - * Purpose: - * Called by client engine when a packet for this renderer is - * due. - * - */ - STDMETHOD(OnPacket) (THIS_ - IRMAPacket* pPacket, - LONG32 lTimeOffset) PURE; - - /************************************************************************ - * Method: - * IRMARenderer::OnTimeSync - * Purpose: - * Called by client engine to inform the renderer of the current - * time relative to the streams synchronized time-line. The - * renderer should use this time value to update its display or - * render it's stream data accordingly. - * - */ - STDMETHOD(OnTimeSync) (THIS_ - ULONG32 ulTime) PURE; - - /************************************************************************ - * Method: - * IRMARenderer::OnPreSeek - * Purpose: - * Called by client engine to inform the renderer that a seek is - * about to occur. The render is informed the last time for the - * stream's time line before the seek, as well as the first new - * time for the stream's time line after the seek will be completed. - * - */ - STDMETHOD(OnPreSeek) (THIS_ - ULONG32 ulOldTime, - ULONG32 ulNewTime) PURE; - - /************************************************************************ - * Method: - * IRMARenderer::OnPostSeek - * Purpose: - * Called by client engine to inform the renderer that a seek has - * just occurred. The render is informed the last time for the - * stream's time line before the seek, as well as the first new - * time for the stream's time line after the seek. - * - */ - STDMETHOD(OnPostSeek) (THIS_ - ULONG32 ulOldTime, - ULONG32 ulNewTime) PURE; - - /************************************************************************ - * Method: - * IRMARenderer::OnPause - * Purpose: - * Called by client engine to inform the renderer that a pause has - * just occurred. The render is informed the last time for the - * stream's time line before the pause. - * - */ - STDMETHOD(OnPause) (THIS_ - ULONG32 ulTime) PURE; - - /************************************************************************ - * Method: - * IRMARenderer::OnBegin - * Purpose: - * Called by client engine to inform the renderer that a begin or - * resume has just occurred. The render is informed the first time - * for the stream's time line after the resume. - * - */ - STDMETHOD(OnBegin) (THIS_ - ULONG32 ulTime) PURE; - - /************************************************************************ - * Method: - * IRMARenderer::OnBuffering - * Purpose: - * Called by client engine to inform the renderer that buffering - * of data is occuring. The render is informed of the reason for - * the buffering (start-up of stream, seek has occurred, network - * congestion, etc.), as well as percentage complete of the - * buffering process. - * - */ - STDMETHOD(OnBuffering) (THIS_ - ULONG32 ulFlags, - UINT16 unPercentComplete) PURE; - - /************************************************************************ - * Method: - * IRMARenderer::GetDisplayType - * Purpose: - * Called by client engine to ask the renderer for it's preferred - * display type. When layout information is not present, the - * renderer will be asked for it's prefered display type. Depending - * on the display type a buffer of additional information may be - * needed. This buffer could contain information about preferred - * window size. - * - */ - STDMETHOD(GetDisplayType) (THIS_ - REF(RMA_DISPLAY_TYPE) ulFlags, - REF(IRMABuffer*) pBuffer) PURE; - - /************************************************************************ - * Method: - * IRMARenderer::OnEndofPackets - * Purpose: - * Called by client engine to inform the renderer that all the - * packets have been delivered. However, if the user seeks before - * EndStream() is called, renderer may start getting packets again - * and the client engine will eventually call this function again. - */ - STDMETHOD(OnEndofPackets) (THIS) PURE; -}; - -#endif /* _RMARENDR_H_ */ diff --git a/include/realmedia/rmasite2.h b/include/realmedia/rmasite2.h deleted file mode 100644 index 00161108a..000000000 --- a/include/realmedia/rmasite2.h +++ /dev/null @@ -1,185 +0,0 @@ -/**************************************************************************** - * - * $Id: rmasite2.h 7 2003-05-30 02:18:02Z gabest $ - * - * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved. - * - * http://www.real.com/devzone - * - * This program contains proprietary - * information of Progressive Networks, Inc, and is licensed - * subject to restrictions on use and distribution. - * - * - * RealMedia Architecture Simple Window Interfaces. - * - */ - -#ifndef _RMASITE2_H_ -#define _RMASITE2_H_ - -/* - * Forward declarations of some interfaces defined or used here-in. - */ - -//typedef _INTERFACE IRMASite2 IRMASite2; -typedef _INTERFACE IRMAVideoSurface IRMAVideoSurface; -typedef _INTERFACE IRMAPassiveSiteWatcher IRMAPassiveSiteWatcher; - -/**************************************************************************** - * - * Interface: - * - * IRMASite2 - * - * Purpose: - * - * Interface for IRMASite2 objects. - * - * IID_IRMASite: - * - * {0x00000D0A-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMASite2, 0x00000D0A, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMASite - -DECLARE_INTERFACE_(IRMASite2, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMASite2 method usually called by the "context" - * when window attributes (like the window handle) have changed. - */ - STDMETHOD(UpdateSiteWindow) (THIS_ - PNxWindow* /*IN*/ pWindow) PURE; - - /* - * IRMASite2 method usually called by the "context" to - * to hide/show a site. - */ - STDMETHOD(ShowSite) (THIS_ - BOOL bShow) PURE; - - STDMETHOD_(BOOL, IsSiteVisible) (THIS) PURE; - - /* - * IRMASite2 method usually called by the "context" to - * set the site's Z-order - */ - STDMETHOD(SetZOrder) (THIS_ - INT32 lZOrder - ) PURE; - - /* - * IRMASite2 method called to get the site's Z-order - */ - STDMETHOD(GetZOrder) (THIS_ - REF(INT32) lZOrder - ) PURE; - - /* - * IRMASite2 method called to set the site at the top - * of the Z-order - */ - STDMETHOD(MoveSiteToTop) (THIS) PURE; - - /* - * IRMASite2 method called to get the site's video surface - */ - STDMETHOD(GetVideoSurface) (THIS_ - REF(IRMAVideoSurface*) pSurface - ) PURE; - - /* - * IRMASite2 method called to get the number of child sites. - */ - STDMETHOD_(UINT32,GetNumberOfChildSites) (THIS) PURE; - - /* - * IRMASite2 method to add a watcher that does not affect the site - */ - STDMETHOD(AddPassiveSiteWatcher) (THIS_ - IRMAPassiveSiteWatcher* pWatcher - ) PURE; - - /* - * IRMASite2 method to remove a watcher that does not affect the site - */ - STDMETHOD(RemovePassiveSiteWatcher) (THIS_ - IRMAPassiveSiteWatcher* pWatcher - ) PURE; - - /* - * IRMASite2 method used to do cursor management - */ - STDMETHOD(SetCursor) (THIS_ - PNxCursor ulCursor, - REF(PNxCursor) ulOldCursor - ) PURE; -}; - -/**************************************************************************** - * - * Interface: - * - * IRMAPassiveSiteWatcher - * - * Purpose: - * - * Interface for IRMAPassiveSiteWatcher objects. - * - * IID_IRMAPassiveSiteWatcher: - * - * {0x00000D0F-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAPassiveSiteWatcher, 0x00000D0F, 0x901, 0x11d1, 0x8b, 0x6, - 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAPassiveSiteWatcher - -DECLARE_INTERFACE_(IRMAPassiveSiteWatcher, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAPassiveSiteWatcher method used to notify - * about position updates - */ - STDMETHOD(PositionChanged) (THIS_ - PNxPoint* /*IN*/ pPoint) PURE; - - /* - * IRMAPassiveSiteWatcher method used to notify - * about size updates - */ - STDMETHOD(SizeChanged) (THIS_ - PNxSize* /*IN*/ pSize) PURE; - -}; - -#endif //_RMASITE2_H_ diff --git a/include/realmedia/rmaslta.h b/include/realmedia/rmaslta.h deleted file mode 100644 index ab412f37b..000000000 --- a/include/realmedia/rmaslta.h +++ /dev/null @@ -1,191 +0,0 @@ -/**************************************************************************** - * - * $Id: rmaslta.h 7 2003-05-30 02:18:02Z gabest $ - * - * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved. - * - * http://www.real.com/devzone - * - * This program contains proprietary nformation of RealNetworks, Inc, - * and is licensed subject to restrictions on use and distribution. - * - * - * RealMedia Architecture Interfaces for Simulated Live Transfer Agent. - * - */ - -#ifndef _RMASLTA_H -#define _RMASLTA_H - -/**************************************************************************** - * - * Interface: - * - * IRMASLTA - * - * Purpose: - * - * Slta that works with RMA. Simulates a live stream from a file. - * - * IID_IRMASLTA - * - * {00000D00-b4c8-11d0-9995-00a0248da5f0} - * - */ -DEFINE_GUID(IID_IRMASLTA, 0x00000D00, 0xb4c8, 0x11d0, 0x99, - 0x95, 0x0, 0xa0, 0x24, 0x8d, 0xa5, 0xf0); - -DECLARE_INTERFACE_(IRMASLTA, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMASLTA methods - */ - - /************************************************************************ - * Method: - * IRMASLTA::Connect - * Purpose: - * Connects the slta to a server. - */ - STDMETHOD(Connect) (THIS_ - const char* host, - UINT16 uPort, - const char* username, - const char* passwd, - const char* livefile - ) PURE; - - /************************************************************************ - * Method: - * IRMASLTA::SetTAC - * Purpose: - * Set the TAC info for the stream. This method MUST be called - * before Encode to have any effect. - */ - STDMETHOD(SetTAC) (THIS_ - const char* Title, - const char* Author, - const char* Copyright) PURE; - - /************************************************************************ - * Method: - * IRMASLTA:Encode - * Purpose: - * Start encoding the file to the server. - */ - STDMETHOD(Encode) - (THIS_ - const char* filename - ) PURE; - - /************************************************************************ - * Method: - * IRMASLTA:Disconnect - * Purpose: - * Disconnect the slta from the server. - */ - STDMETHOD(Disconnect) (THIS) PURE; - - - /************************************************************************ - * Method: - * IRMASLTA::SetTargetBandwidth - * Purpose: - * Sets the target bw for rule subscription. - */ - STDMETHOD(SetTargetBandwidth) (THIS_ - UINT32 ulTargetBW) PURE; - - -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMASltaEvent - * - * Purpose: - * - * Allows events to be sent through an SLTA stream - * - * IID_IRMASltaEvent - * - * {00000D01-b4c8-11d0-9995-00a0248da5f0} - * - */ -DEFINE_GUID(IID_IRMASltaEvent, 0x00000D01, 0xb4c8, 0x11d0, 0x99, - 0x95, 0x0, 0xa0, 0x24, 0x8d, 0xa5, 0xf0); - -/* - * Valid RMA event IDs. - */ - -#define RMA_EVENT_TITLE 0x0000 -#define RMA_EVENT_AUTHOR 0x0001 -#define RMA_EVENT_COPYRIGHT 0x0002 -#define RMA_EVENT_SERVER_ALERT 0x0003 -#define RMA_EVENT_PROGRESS_MESSAGE 0x0004 -#define RMA_EVENT_TEXT_SIZE 0x0010 -#define RMA_EVENT_TEXT 0x0011 -#define RMA_EVENT_TEXT_ANCHOR 0x0012 -#define RMA_EVENT_BROWSER_OPEN_URL 0x0020 -#define RMA_EVENT_TOPIC 0x0030 -#define RMA_EVENT_EMPTY 0x0200 -#define RMA_EVENT_CUSTOM_BEGIN 0x0400 - -DECLARE_INTERFACE_(IRMASltaEvent, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMASltaEvent methods - */ - - /************************************************************************ - * Method: - * IRMASltaEvent::SetEvent - * Purpose: - * Sends an event to the slta stream. - * nEventID must be one of the valid event IDs defined above. - */ - STDMETHOD(SetEvent) (THIS_ - UINT16 nEventID, - const char* szEventText) PURE; - - /************************************************************************ - * Method: - * IRMASltaEvent::SetRepeatedEvent - * Purpose: - * Sets an event to be repeated every ulFrequency milliseconds. - * nEventID must be one of the valid event IDs defined above. - */ - - STDMETHOD(SetRepeatedEvent) (THIS_ - UINT16 nEventID, - const char* szEventText, - UINT32 ulFrequency) PURE; -}; - -#endif diff --git a/include/realmedia/rmasrc.h b/include/realmedia/rmasrc.h deleted file mode 100644 index 27256af94..000000000 --- a/include/realmedia/rmasrc.h +++ /dev/null @@ -1,254 +0,0 @@ -/**************************************************************************** - * - * $Id: rmasrc.h 7 2003-05-30 02:18:02Z gabest $ - * - * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved. - * - * http://www.real.com/devzone - * - * This program contains proprietary information of RealNetworks, Inc, - * and is licensed subject to restrictions on use and distribution. - * - * - * RealMedia Architecture Packet Source Interfaces. - * - */ - -#ifndef _RMASRC_H_ -#define _RMASRC_H_ - -/* - * Forward declarations of some interfaces defined or used here-in. - */ -typedef _INTERFACE IRMARawSourceObject IRMARawSourceObject; -typedef _INTERFACE IRMARawSinkObject IRMARawSinkObject; -typedef _INTERFACE IRMASourceFinderObject IRMASourceFinderObject; -typedef _INTERFACE IRMASourceFinderResponse IRMASourceFinderResponse; -typedef _INTERFACE IRMARequest IRMARequest; - -/**************************************************************************** - * - * Interface: - * - * IRMARawSourceObject - * - * Purpose: - * - * Object that serves packets to sinks - * - * IID_IRMARawSourceObject: - * - * {00001000-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMARawSourceObject, 0x00001000, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMARawSourceObject - -DECLARE_INTERFACE_(IRMARawSourceObject, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMARawSourceObject methods - */ - - /************************************************************************ - * Method: - * IRMARawSourceObject::Init - * Purpose: - * Initializes the connection between the source and the sink - */ - STDMETHOD(Init) (THIS_ - IUnknown* pUnknown) PURE; - - STDMETHOD(Done) (THIS) PURE; - - STDMETHOD(GetFileHeader) (THIS) PURE; - - STDMETHOD(GetStreamHeader) (THIS_ - UINT16 unStreamNumber) PURE; - - STDMETHOD(StartPackets) (THIS_ - UINT16 unStreamNumber) PURE; - - STDMETHOD(StopPackets) (THIS_ - UINT16 unStreamNumber) PURE; -}; - -/**************************************************************************** - * - * Interface: - * - * IRMARawSinkObject - * - * Purpose: - * - * Object that receives raw packets from a source - * - * IID_IRMARawSinkObject: - * - * {00001001-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMARawSinkObject, 0x00001001, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMARawSinkObject - -DECLARE_INTERFACE_(IRMARawSinkObject, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMARawSinkObject methods - */ - - /************************************************************************ - * Method: - * IRMARawSinkObject::InitDone - * Purpose: - * Callback after source object has initialized the connection - */ - STDMETHOD(InitDone) (THIS_ - PN_RESULT status) PURE; - - STDMETHOD(FileHeaderReady) (THIS_ - PN_RESULT status, - IRMAValues* pHeader) PURE; - - STDMETHOD(StreamHeaderReady) (THIS_ - PN_RESULT status, - IRMAValues* pHeader) PURE; - - STDMETHOD(PacketReady) (THIS_ - PN_RESULT status, - IRMAPacket* pPacket) PURE; - - STDMETHOD(StreamDone) (THIS_ - UINT16 unStreamNumber) PURE; - -}; - -/**************************************************************************** - * - * Interface: - * - * IRMASourceFinderObject - * - * Purpose: - * - * Object that allows a sink to search for a raw packet source - * - * IID_IRMASourceFinderObject: - * - * {00001002-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMASourceFinderObject, 0x00001002, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#define CLSID_IRMASourceFinderObject IID_IRMASourceFinderObject - -#undef INTERFACE -#define INTERFACE IRMASourceFinderObject - -#define CLSID_IRMASourceFinderObject IID_IRMASourceFinderObject - -DECLARE_INTERFACE_(IRMASourceFinderObject, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMASourceFinderObject methods - */ - - STDMETHOD(Init) (THIS_ - IUnknown* pUnknown) PURE; - - STDMETHOD(Find) (THIS_ - IRMARequest* pRequest) PURE; - - STDMETHOD(Done) (THIS) PURE; - -}; - -/**************************************************************************** - * - * Interface: - * - * IRMASourceFinderResponse - * - * Purpose: - * - * Object that returns a raw packet source to a sink - * - * IID_IRMASourceFinderResponse: - * - * {00001003-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMASourceFinderResponse, 0x00001003, 0x901, 0x11d1, - 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - - -#undef INTERFACE -#define INTERFACE IRMASourceFinderResponse - -DECLARE_INTERFACE_(IRMASourceFinderResponse, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMASourceFinderResponse methods - */ - - STDMETHOD(InitDone) (THIS_ - PN_RESULT status) PURE; - - STDMETHOD(FindDone) (THIS_ - PN_RESULT status, - IUnknown* pUnknown) PURE; - -}; - -#endif /* _RMASRC_H_ */ diff --git a/include/realmedia/rmaupgrd.h b/include/realmedia/rmaupgrd.h deleted file mode 100644 index 8240112a5..000000000 --- a/include/realmedia/rmaupgrd.h +++ /dev/null @@ -1,178 +0,0 @@ -/**************************************************************************** - * - * $Id: rmaupgrd.h 7 2003-05-30 02:18:02Z gabest $ - * - * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved. - * - * http://www.real.com/devzone - * - * This program contains proprietary - * information of Progressive Networks, Inc, and is licensed - * subject to restrictions on use and distribution. - * - * Auto Upgrade Interfaces - * - */ - -#ifndef _RMAUPGRD_H -#define _RMAUPGRD_H - - -typedef _INTERFACE IRMABuffer IRMABuffer; - - -/* Enumeration for the upgrade types */ -typedef enum _RMAUpgradeType -{ - eUT_Required, - eUT_Recommended, - eUT_Optional -} RMAUpgradeType; - - -/**************************************************************************** - * - * Interface: - * - * IRMAUpgradeCollection - * - * Purpose: - * - * Interface provided by the Context. This interface allows collection - * of upgrade components by the client core and it's delegates - * (i.e. renderer plugins etc.) - * - * IID_IRMAUpgradeCollection - * - * {00002500-0901-11d1-8B06-00A024406D59} - * - */ - -DEFINE_GUID(IID_IRMAUpgradeCollection, - 0x00002500, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAUpgradeCollection - -DECLARE_INTERFACE_(IRMAUpgradeCollection, IUnknown) -{ - /* - * IRMAUpgradeCollection methods - */ - - /************************************************************************ - * Method: - * IRMAUpgradeCollection::Add - * Purpose: - * Adds the specified upgrade information to the collection - * - */ - STDMETHOD_(UINT32, Add) (THIS_ - RMAUpgradeType upgradeType, - IRMABuffer* pPluginId, - UINT32 majorVersion, - UINT32 minorVersion) PURE; - - /************************************************************************ - * Method: - * IRMAUpgradeCollection::Remove - * Purpose: - * Remove the specified item from the collection - * - */ - STDMETHOD(Remove) (THIS_ - UINT32 index) PURE; - - /************************************************************************ - * Method: - * IRMAUpgradeCollection::RemoveAll - * Purpose: - * Remove all items from the collection - * - */ - STDMETHOD(RemoveAll) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAUpgradeCollection::GetCount - * Purpose: - * get the count of the collection - * - */ - STDMETHOD_(UINT32, GetCount)(THIS) PURE; - - /************************************************************************ - * Method: - * IRMAUpgradeCollection::GetAt - * Purpose: - * get the specified items upgrade information - * - */ - STDMETHOD(GetAt) (THIS_ - UINT32 index, - REF(RMAUpgradeType) upgradeType, - IRMABuffer* pPluginId, - REF(UINT32) majorVersion, - REF(UINT32) minorVersion) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAUpgradeHandler - * - * Purpose: - * - * Interface provided by the top-level client application. This - * interface allows the client core to request an upgrade. - * - * IID_IRMAUpgradeHandler: - * - * {00002501-0901-11d1-8B06-00A024406D59} - * - */ - -DEFINE_GUID(IID_IRMAUpgradeHandler, - 0x00002501, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAUpgradeHandler - -DECLARE_INTERFACE_(IRMAUpgradeHandler, IUnknown) -{ - /* - * IRMAUpgradeHandler methods - */ - - /************************************************************************ - * Method: - * IRMAUpgradeHandler::RequestUpgrade - * Purpose: - * Ask if user wants to do an upgrade and start an upgrade - * - */ - STDMETHOD(RequestUpgrade) (THIS_ IRMAUpgradeCollection* pComponents, - BOOL bBlocking) PURE; - - /************************************************************************ - * Method: - * IRMAUpgradeHandler::HasComponents - * Purpose: - * Check if required components are present on the system. - * Returns: - * PNR_OK - components are here, no upgrade required; - * all components are removed from pComponents. - * PNR_FAIL - some components are missing; - * pComponents contains only those components - * that need upgrade. - * - */ - STDMETHOD(HasComponents) (THIS_ IRMAUpgradeCollection* pComponents) PURE; -}; - - - -#endif /* _RMAUPGRD_H */ - diff --git a/include/realmedia/rmavalue.h b/include/realmedia/rmavalue.h deleted file mode 100644 index 764e133cc..000000000 --- a/include/realmedia/rmavalue.h +++ /dev/null @@ -1,381 +0,0 @@ -/**************************************************************************** - * - * $Id: rmavalue.h 7 2003-05-30 02:18:02Z gabest $ - * - * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved. - * - * http://www.real.com/devzone - * - * This program contains proprietary - * information of Progressive Networks, Inc, and is licensed - * subject to restrictions on use and distribution. - * - * - * RealMedia Architecture Plug-in Interfaces. - * - */ - -#ifndef _RMAVALUE_H_ -#define _RMAVALUE_H_ - -/* - * Forward declarations of some interfaces defined or used here-in. - */ -typedef _INTERFACE IUnknown IUnknown; -typedef _INTERFACE IRMABuffer IRMABuffer; -typedef _INTERFACE IRMAKeyValueList IRMAKeyValueList; -typedef _INTERFACE IRMAKeyValueListIter IRMAKeyValueListIter; -typedef _INTERFACE IRMAKeyValueListIterOneKey IRMAKeyValueListIterOneKey; -typedef _INTERFACE IRMAValues IRMAValues; -typedef _INTERFACE IRMAOptions IRMAOptions; - -/* Note : GUIDS 3101 - 3107 are deprecated. */ - -/**************************************************************************** - * - * Interface: - * - * IRMAKeyValueList - * - * Purpose: - * - * Stores a list of strings, where strings are keyed by not necessarily - * unique keys. - * - * - * IRMAKeyValueList: - * - * {0x00003108-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAKeyValueList, 0x00003108, 0x901, 0x11d1, - 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); -#define CLSID_IRMAKeyValueList IID_IRMAKeyValueList - -#undef INTERFACE -#define INTERFACE IRMAKeyValueList - -DECLARE_INTERFACE_(IRMAKeyValueList, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * Regular methods - */ - - /************************************************************************ - * Method: - * IRMAKeyValueList::AddKeyValue - * Purpose: - * Add a new key/value tuple to our list of strings. You can have - * multiple strings for the same key. - */ - STDMETHOD(AddKeyValue) (THIS_ - const char* pKey, - IRMABuffer* pStr) PURE; - - /************************************************************************ - * Method: - * IRMAKeyValueList::GetIter - * Purpose: - * Return an iterator that allows you to iterate through all the - * key/value tuples in our list of strings. - */ - STDMETHOD(GetIter) (THIS_ - REF(IRMAKeyValueListIter*) pIter) PURE; - - - /************************************************************************ - * Method: - * IRMAKeyValueList::GetIterOneKey - * Purpose: - * Return an iterator that allows you to iterate through all the - * strings for a particular key. - */ - STDMETHOD(GetIterOneKey) (THIS_ - const char* pKey, - REF(IRMAKeyValueListIterOneKey*) pIter) PURE; - - /************************************************************************ - * Method: - * IRMAKeyValueList::AppendAllListItems - * Purpose: - * Append all the key/string tuples from another list to this list. - * (You can have duplicate keys.) - */ - STDMETHOD(AppendAllListItems) (THIS_ - IRMAKeyValueList* pList) PURE; - /************************************************************************ - * Method: - * IRMAKeyValueList::KeyExists - * Purpose: - * See whether any strings exist for a particular key. - */ - STDMETHOD_(BOOL,KeyExists) (THIS_ - const char* pKey) PURE; - - /************************************************************************ - * Method: - * IRMAKeyValueList::CreateObject - * Purpose: - * Create an empty object that is the same class as the current object. - */ - STDMETHOD(CreateObject) (THIS_ - REF(IRMAKeyValueList*) pNewList) PURE; - - /************************************************************************ - * Method: - * IRMAKeyValueList::ImportValues. - * Purpose: - * Import all the strings from an IRMAValues object into this object. - * If this object also supports IRMAValues, it should also import the - * ULONGs and Buffers. You can have duplicate keys, and old data is - * left untouched. - */ - STDMETHOD(ImportValues) (THIS_ - IRMAValues* pValues) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAKeyValueListIter - * - * Purpose: - * - * Iterate over all the items in a CKeyValueList. - * Call IRMAKeyValueList::GetIter to create an iterator. - * - * - * IRMAKeyValueListIter: - * - * {0x00003109-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAKeyValueListIter, 0x00003109, 0x901, 0x11d1, - 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#define CLSID_IRMAKeyValueListIter IID_IRMAKeyValueListIter - -#undef INTERFACE -#define INTERFACE IRMAKeyValueListIter - -DECLARE_INTERFACE_(IRMAKeyValueListIter, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - - /* - * Regular methods - */ - - /************************************************************************ - * Method: - * IRMAKeyValueListIter::GetNextPair - * Purpose: - * Each call to this method returns one key/value tuple from your - * list of strings. Strings are returned in same order that they - * were inserted. - */ - STDMETHOD(GetNextPair) (THIS_ - REF(const char*) pKey, - REF(IRMABuffer*) pStr) PURE; - - /************************************************************************ - * Method: - * IRMAKeyValueListIter::ReplaceCurr - * Purpose: - * Replaces the value in the key/value tuple that was returned - * in the last call to GetNextPair with a new string. - */ - STDMETHOD(ReplaceCurr) (THIS_ - IRMABuffer* pStr) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAKeyValueListIterOneKey - * - * Purpose: - * - * Iterate over all the items in a CKeyValueList that match a particular key. - * Call IRMAKeyValueList::GetIterOneKey to create an iterator. - * - * - * IRMAKeyValueListIterOneKey: - * - * {0x00003110-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAKeyValueListIterOneKey, 0x00003110, 0x901, 0x11d1, - 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#define CLSID_IRMAKeyValueListIterOneKey IID_IRMAKeyValueListIterOneKey - -#undef INTERFACE -#define INTERFACE IRMAKeyValueListIterOneKey - -DECLARE_INTERFACE_(IRMAKeyValueListIterOneKey, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - - /* - * Regular methods - */ - - /************************************************************************ - * Method: - * IRMAKeyValueListIterOneKey::GetNextString - * Purpose: - * Each call to this method returns one string that matches the - * key for this iterator. Strings are returned in same order that they - * were inserted. - * - */ - STDMETHOD(GetNextString) (THIS_ - REF(IRMABuffer*) pStr) PURE; - - /************************************************************************ - * Method: - * IRMAKeyValueListIterOneKey::ReplaceCurr - * Purpose: - * Replaces the value in the key/value tuple that was referenced - * in the last call to GetNextString with a new string. - * - */ - STDMETHOD(ReplaceCurr) (THIS_ - IRMABuffer* pStr) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAOptions - * - * Purpose: - * - * This is a generic options interface, implemented by any object to - * allow its options to be read and set by another component of the - * system. - * - * - * IRMAOptions: - * - * {0x00003111-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAOptions, 0x00003111, 0x901, 0x11d1, - 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#define CLSID_IRMAOptions IID_IRMAOptions - -#undef INTERFACE -#define INTERFACE IRMAOptions - -DECLARE_INTERFACE_(IRMAOptions, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - - /* - * Regular methods - */ - - /************************************************************************ - * Method: - * IRMAOptions::GetOptions - * Purpose: - * This method returns a list of the options supported by this - * particular object, along with the value currently set for each - * option. Enumerate the members of the returned IRMAValues object - * to discover what options a component supports and the type of - * each of those options. The value for each name-value pair is - * the current setting for that option. - * - */ - STDMETHOD(GetOptions) (THIS_ - REF(IRMAValues*) pOptions) PURE; - - /************************************************************************ - * Method: - * IRMAOptions::SetOptionULONG32 - * Purpose: - * Sets the value of a ULONG32 option. The return value indicates - * whether or not the SetOptionULONG32 call succeeded. - * - */ - STDMETHOD(SetOptionULONG32) (THIS_ - const char* pName, - ULONG32 ulValue) PURE; - - /************************************************************************ - * Method: - * IRMAOptions::SetOptionCString - * Purpose: - * Sets the value of a CString option. The return value indicates - * whether or not the SetOptionCString call succeeded. - * - */ - STDMETHOD(SetOptionCString) (THIS_ - const char* pName, - IRMABuffer* pValue) PURE; - - /************************************************************************ - * Method: - * IRMAOptions::SetOptionBuffer - * Purpose: - * Sets the value of a Buffer option. The return value indicates - * whether or not the SetOptionBuffer call succeeded. - * - */ - STDMETHOD(SetOptionBuffer) (THIS_ - const char* pName, - IRMABuffer* pValue) PURE; -}; - - -#endif /* !_RMAVALUE_H_ */ diff --git a/include/realmedia/rmavsrc.h b/include/realmedia/rmavsrc.h deleted file mode 100644 index b96ab6486..000000000 --- a/include/realmedia/rmavsrc.h +++ /dev/null @@ -1,185 +0,0 @@ -#ifndef _RMAVSRC_H -#define _RMAVSRC_H -/**************************************************************************** - * - * $Id: rmavsrc.h 7 2003-05-30 02:18:02Z gabest $ - * - * Copyright (C) 1999 RealNetworks, Inc. All rights reserved.. - * - * http://www.real.com/devzone - * - * This program contains proprietary - * information of RealNetworks, Inc, and is licensed - * subject to restrictions on use and distribution. - * - * RealMedia Architecture FileViewSource Interfaces. - * - */ - - -typedef _INTERFACE IRMAStreamSource IRMAStreamSource; -typedef _INTERFACE IRMAFileObject IRMAFileObject; - -// Interfaces definded in this file -typedef _INTERFACE IRMAFileViewSource IRMAFileViewSource; -typedef _INTERFACE IRMAFileViewSourceResponse IRMAFileViewSourceResponse; -typedef _INTERFACE IRMAViewSourceCommand IRMAViewSourceCommand; -typedef _INTERFACE IRMAViewSourceURLResponse IRMAViewSourceURLResponse; - - - - -/**************************************************************************** - * - * Interface: - * - * IRMAFileViewSource - * - * IID_IRMAFileViewSource: - * - * {00003500-0901-11d1-8B06-00A024406D59} - * - */ - -enum SOURCE_TYPE -{ - RAW_SOURCE, - HTML_SOURCE -}; - -DEFINE_GUID(IID_IRMAFileViewSource, 0x00003500, 0x901, 0x11d1, 0x8b, 0x6, - 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAFileViewSource - -DECLARE_INTERFACE_(IRMAFileViewSource, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /************************************************************************ - * IRMAFileViewSource - */ - STDMETHOD(InitViewSource) (THIS_ - IRMAFileObject* /*IN*/ pFileObject, - IRMAFileViewSourceResponse* /*IN*/ pResp, - SOURCE_TYPE /*IN*/ sourceType, - IRMAValues* /*IN*/ pOptions) PURE; - STDMETHOD(GetSource) (THIS) PURE; - STDMETHOD(Close) (THIS) PURE; -}; - -/**************************************************************************** - * - * Interface: - * - * IRMAFileViewSourceResponse - * - * IID_IRMAFileViewSourceResponse: - * - * {00003501-0901-11d1-8B06-00A024406D59} - * - */ - -DEFINE_GUID(IID_IRMAFileViewSourceResponse, 0x00003501, 0x901, 0x11d1, 0x8b, - 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAFileViewSourceResponse - -DECLARE_INTERFACE_(IRMAFileViewSourceResponse, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /************************************************************************ - * IRMAFileViewSourceResoponse - */ - STDMETHOD(InitDone) (THIS_ PN_RESULT status ) PURE; - STDMETHOD(SourceReady) (THIS_ PN_RESULT status, - IRMABuffer* pSource ) PURE; - STDMETHOD(CloseDone) (THIS_ PN_RESULT) PURE; -}; - -/**************************************************************************** - * - * Interface: - * - * IRMAViewSourceCommand - * - * IID_IRMAViewSourceCommand: - * - * {00003504-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAViewSourceCommand, 0x00003504, 0x901, 0x11d1, 0x8b, 0x6, - 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAViewSourceCommand - -DECLARE_INTERFACE_(IRMAViewSourceCommand, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /************************************************************************ - * IRMAViewSourceCommand - */ - STDMETHOD_(BOOL, CanViewSource) (THIS_ - IRMAStreamSource* pStream) PURE; - STDMETHOD(DoViewSource) (THIS_ - IRMAStreamSource* pStream) PURE; - STDMETHOD(GetViewSourceURL) (THIS_ - IRMAStreamSource* pSource, - IRMAViewSourceURLResponse* pResp) PURE; -}; - -/**************************************************************************** - * - * Interface: - * - * IRMAViewSourceURLResponse - * - * IID_IRMAViewSourceURLResponse: - * - * {00003505-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAViewSourceURLResponse, 0x00003505, 0x901, 0x11d1, 0x8b, 0x6, - 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAViewSourceURLResponse - -DECLARE_INTERFACE_(IRMAViewSourceURLResponse, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /************************************************************************ - * IRMAViewSourceURLResponse - */ - STDMETHOD(ViewSourceURLReady) (THIS_ - const char* /*out*/ pUrl) PURE; -}; - - -#endif diff --git a/include/realmedia/rmavsurf.h b/include/realmedia/rmavsurf.h deleted file mode 100644 index e3460126a..000000000 --- a/include/realmedia/rmavsurf.h +++ /dev/null @@ -1,216 +0,0 @@ -/**************************************************************************** - * - * $Id: rmavsurf.h 7 2003-05-30 02:18:02Z gabest $ - * - * Copyright (C) 1995,1996,1997 Progressive Networks. - * All rights reserved. - * - * http://www.real.com/devzone - * - * This program contains proprietary - * information of Progressive Networks, Inc, and is licensed - * subject to restrictions on use and distribution. - * - * - * RealMedia Architecture Video Surface Interfaces. - * - */ - -#ifndef _RMAVSURF_H_ -#define _RMAVSURF_H_ - -/**************************************************************************** - * - * Video Surface Data Structures and Constants - */ -typedef struct _RMABitmapInfoHeader -{ - UINT32 biSize; - INT32 biWidth; - INT32 biHeight; - UINT16 biPlanes; - UINT16 biBitCount; - UINT32 biCompression; - UINT32 biSizeImage; - INT32 biXPelsPerMeter; - INT32 biYPelsPerMeter; - UINT32 biClrUsed; - UINT32 biClrImportant; - UINT32 rcolor; - UINT32 gcolor; - UINT32 bcolor; - -} RMABitmapInfoHeader; - -/* - * RMABitmapInfo structure. - */ -typedef struct _RMABitmapInfo -{ - struct - { - UINT32 biSize; /* use OFFSETOF(dwBitMask) here */ - INT32 biWidth; /* image width (in pixels) */ - INT32 biHeight; /* image height */ - UINT16 biPlanes; /* # of bitplanes; always use 1 */ - UINT16 biBitCount; /* average # bits/pixel */ - UINT32 biCompression; /* one of the RMA_... FOURCC codes */ - UINT32 biSizeImage; /* = width * height * bitCount / 8 */ - INT32 biXPelsPerMeter;/* always 0 */ - INT32 biYPelsPerMeter;/* always 0 */ - UINT32 biClrUsed; /* !0, if 8-bit RGB; 0, otherwise */ - UINT32 biClrImportant; /* !0, if 8-bit RGB; 0, otherwise */ - - } bmiHeader; - - union - { - UINT32 dwBitMask[3]; /* color masks (for BI_BITFIELDS) */ - UINT32 dwPalette[256]; /* palette (for 8-bit RGB image) */ - } un; - -} RMABitmapInfo; - -typedef UINT32 RMA_COMPRESSION_TYPE; - -/* - * Windows DIB formats & MKFOURCC() macro: - */ -#ifndef BI_RGB -#define BI_RGB 0L /* RGB-8, 16, 24, or 32 */ -#define BI_RLE8 1L /* 8-bit RLE compressed image */ -#define BI_RLE4 2L /* 4-bit RLE compressed image */ -#define BI_BITFIELDS 3L /* RGB 555, 565, etc. */ -#endif -#ifndef MKFOURCC -#define MKFOURCC(c0,c1,c2,c3) \ - ((UINT32)(BYTE)(c0) | ((UINT32)(BYTE)(c1) << 8) | \ - ((UINT32)(BYTE)(c2) << 16) | ((UINT32)(BYTE)(c3) << 24)) -#endif - -/* - * RMA image formats: - */ -#define RMA_RGB BI_RGB /* Windows-compatible RGB formats: */ -#define RMA_RLE8 BI_RLE8 -#define RMA_RLE4 BI_RLE4 -#define RMA_BITFIELDS BI_BITFIELDS -#define RMA_I420 MKFOURCC('I','4','2','0') /* planar YCrCb */ -#define RMA_YV12 MKFOURCC('Y','V','1','2') /* planar YVU420 */ -#define RMA_YUY2 MKFOURCC('Y','U','Y','2') /* packed YUV422 */ -#define RMA_UYVY MKFOURCC('U','Y','V','Y') /* packed YUV422 */ -#define RMA_YVU9 MKFOURCC('Y','V','U','9') /* Intel YVU9 */ - -/* - * Non-standard FOURCC formats (these are just few aliases to what can be - * represented by the standard formats, and they are left for backward - * compatibility only). - */ -#define RMA_RGB3_ID MKFOURCC('3','B','G','R') /* RGB-32 ?? */ -#define RMA_RGB24_ID MKFOURCC('B','G','R',' ') /* top-down RGB-24*/ -#define RMA_RGB565_ID MKFOURCC('6','B','G','R') /* RGB-16 565 */ -#define RMA_RGB555_ID MKFOURCC('5','B','G','R') /* RGB-16 555 */ -#define RMA_8BIT_ID MKFOURCC('T','I','B','8') /* RGB-8 w. pal-e */ -#define RMA_YUV420_ID MKFOURCC('2','V','U','Y') /* planar YCrCb */ -#define RMA_YUV411_ID MKFOURCC('1','V','U','Y') /* ??? */ -#define RMA_YUVRAW_ID MKFOURCC('R','V','U','Y') /* ??? */ - - -/**************************************************************************** - * - * Interface: - * - * IRMAVideoSurface - * - * Purpose: - * - * Interface for IRMAVideoSurface objects. - * - * IID_IRMAVideoSurface: - * - * {00002200-0901-11d1-8B06-00A024406D59} - * - */ - -DEFINE_GUID(IID_IRMAVideoSurface, 0x00002200, 0x901, 0x11d1, 0x8b, - 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAVideoSurface - -DECLARE_INTERFACE_(IRMAVideoSurface, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAVideoSurface methods usually called by renderers to - * Draw on the surface - */ - STDMETHOD(Blt) (THIS_ - UCHAR* /*IN*/ pImageBits, - RMABitmapInfoHeader* /*IN*/ pBitmapInfo, - REF(PNxRect) /*IN*/ rDestRect, - REF(PNxRect) /*IN*/ rSrcRect) PURE; - - /************************************************************************ - * Method: - * IRMAVideoSurface::BeginOptimizedBlt - * Purpose: - * Called by renderer to commit to a bitmap format for all future - * OptimizedBlt calls. - */ - STDMETHOD(BeginOptimizedBlt)(THIS_ - RMABitmapInfoHeader* /*IN*/ pBitmapInfo) PURE; - - /************************************************************************ - * Method: - * IRMAVideoSurface::OptimizedBlt - * Purpose: - * Called by renderer to draw to the video surface, in the format - * previously specified by calling BeginOptimizedBlt. - */ - STDMETHOD(OptimizedBlt) (THIS_ - UCHAR* /*IN*/ pImageBits, - REF(PNxRect) /*IN*/ rDestRect, - REF(PNxRect) /*IN*/ rSrcRect) PURE; - - /************************************************************************ - * Method: - * IRMAVideoSurface::EndOptimizedBlt - * Purpose: - * Called by renderer allow the video surface to cleanup after all - * OptimizedBlt calls have been made. - */ - STDMETHOD(EndOptimizedBlt) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMAVideoSurface::GetOptimizedFormat - * Purpose: - * Called by the client to find out what compression type the - * renderer committed to when it called BeginOptimizedBlt. - */ - STDMETHOD(GetOptimizedFormat)(THIS_ - REF(RMA_COMPRESSION_TYPE) /*OUT*/ ulType) PURE; - - /************************************************************************ - * Method: - * IRMAVideoSurface::GetPreferredFormat - * Purpose: - * Called by renderer to find out what compression type the video - * surface would prefer to be given in BeginOptimizedBlt. - */ - STDMETHOD(GetPreferredFormat)(THIS_ - REF(RMA_COMPRESSION_TYPE) /*OUT*/ ulType) PURE; -}; - -#endif /* _RMAVSURF_H_ */ diff --git a/include/realmedia/rmawin.h b/include/realmedia/rmawin.h deleted file mode 100644 index 6bbcfb940..000000000 --- a/include/realmedia/rmawin.h +++ /dev/null @@ -1,811 +0,0 @@ -/**************************************************************************** - * - * $Id: rmawin.h 7 2003-05-30 02:18:02Z gabest $ - * - * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved. - * - * http://www.real.com/devzone - * - * This program contains proprietary - * information of Progressive Networks, Inc, and is licensed - * subject to restrictions on use and distribution. - * - * - * RealMedia Architecture Simple Window Interfaces. - * - */ - -#ifndef _RMAWIN_H_ -#define _RMAWIN_H_ - -/* - * Forward declarations of some interfaces defined or used here-in. - */ -typedef _INTERFACE IRMASite IRMASite; -typedef _INTERFACE IRMASiteUser IRMASiteUser; -typedef _INTERFACE IRMASiteWindowed IRMASiteWindowed; -typedef _INTERFACE IRMASiteEventHandler IRMASiteEventHandler; -typedef _INTERFACE IRMASiteWindowless IRMASiteWindowless; -typedef _INTERFACE IRMASiteWatcher IRMASiteWatcher; -typedef _INTERFACE IRMAValues IRMAValues; -typedef _INTERFACE IRMASiteFullScreen IRMASiteFullScreen; -typedef _INTERFACE IRMALayoutSiteGroupManager IRMALayoutSiteGroupManager; -typedef _INTERFACE IRMAEventHook IRMAEventHook; - -typedef struct _PNxWindow PNxWindow; -typedef struct _PNxSize PNxSize; -typedef struct _PNxPoint PNxPoint; -typedef struct _PNxRect PNxRect; -typedef void* PNxRegion; - - -/**************************************************************************** - * - * Interface: - * - * IRMASiteWindowed - * - * Purpose: - * - * Interface for IRMASite objects which are associated with platform - * specific window objects on Microsoft Windows and X-Windows. - * - * IID_IRMASiteWindowed: - * - * {00000D01-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMASiteWindowed, 0x00000D01, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#define CLSID_IRMASiteWindowed IID_IRMASiteWindowed - - -#undef INTERFACE -#define INTERFACE IRMASiteWindowed - -DECLARE_INTERFACE_(IRMASiteWindowed, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMASiteWindowed methods called by site suppliers - * when they want the site associated with a - * previously created (and externally managed) window. - * This method will "sub-class" that window (Win32). - * On Unix, the site supplier must pass events from - * the externally managed window to the core via - * IRMAClientEngine::EventOccurred(). Please note that - * The PNxWindow ptr must remain in scope for the life - * of Site. - * - */ - STDMETHOD(AttachWindow) (THIS_ - PNxWindow* /*IN*/ pWindow) PURE; - - STDMETHOD(DetachWindow) (THIS) PURE; - - /* - * IRMASiteWindowed methods called by Owners of the site - * in the event that want a default top level window created - * for the site. - */ - STDMETHOD(Create) (THIS_ - void* ParentWindow, - UINT32 style) PURE; - - STDMETHOD(Destroy) (THIS) PURE; - - /* - * IRMASiteWindowed method. Returns actual window of the site. - */ - STDMETHOD_(PNxWindow*,GetWindow)(THIS) PURE; -}; - - - -/**************************************************************************** - * - * Interface: - * - * IRMASiteWindowless - * - * Purpose: - * - * Interface for IRMASite objects which are "windowless" or not - * associated with platform specific window objects. - * - * IID_IRMASiteWindowless: - * - * {00000D02-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMASiteWindowless, 0x00000D02, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMASiteWindowless - -#define CLSID_IRMASiteWindowless IID_IRMASiteWindowless - -DECLARE_INTERFACE_(IRMASiteWindowless, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMASiteWindowless methods called by owners of the site. - */ - STDMETHOD(EventOccurred) (THIS_ - PNxEvent* /*IN*/ pEvent) PURE; - - /* - * IRMASiteWindowless method. Returns some parent window that - * owns the windowless site. Useful for right-click menus and - * dialog box calls. - */ - STDMETHOD_(PNxWindow*,GetParentWindow)(THIS) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMASite - * - * Purpose: - * - * Interface for IRMASite objects. - * - * IID_IRMASite: - * - * {00000D03-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMASite, 0x00000D03, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMASite - -DECLARE_INTERFACE_(IRMASite, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMASite methods usually called by the "context" to - * associate users with the site, and to create child sites - * as appropriate. - */ - STDMETHOD(AttachUser) (THIS_ - IRMASiteUser* /*IN*/ pUser) PURE; - - STDMETHOD(DetachUser) (THIS) PURE; - - - STDMETHOD(GetUser) (THIS_ - REF(IRMASiteUser*) /*OUT*/ pUser) PURE; - - STDMETHOD(CreateChild) (THIS_ - REF(IRMASite*) /*OUT*/ pChildSite) PURE; - - STDMETHOD(DestroyChild) (THIS_ - IRMASite* /*IN*/ pChildSite) PURE; - - /* - * IRMASite methods called by the the "context" in which the site - * is displayed in order to manage its position. Site users should - * not generally call these methods. - */ - STDMETHOD(AttachWatcher) (THIS_ - IRMASiteWatcher* /*IN*/ pWatcher) PURE; - - STDMETHOD(DetachWatcher) (THIS) PURE; - - STDMETHOD(SetPosition) (THIS_ - PNxPoint position) PURE; - - STDMETHOD(GetPosition) (THIS_ - REF(PNxPoint) position) PURE; - - /* - * IRMASite methods called by the user of the site to get - * information about the site, and to manipulate the site. - */ - STDMETHOD(SetSize) (THIS_ - PNxSize size) PURE; - - STDMETHOD(GetSize) (THIS_ - REF(PNxSize) size) PURE; - - STDMETHOD(DamageRect) (THIS_ - PNxRect rect) PURE; - - STDMETHOD(DamageRegion) (THIS_ - PNxRegion region) PURE; - - STDMETHOD(ForceRedraw) (THIS) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMASiteUser - * - * Purpose: - * - * Interface for the user of the IRMASite objects. - * - * IID_IRMASiteUser: - * - * {00000D04-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMASiteUser, 0x00000D04, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMASiteUser - -DECLARE_INTERFACE_(IRMASiteUser, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMASiteUser methods usually called by the "context" to - * associate users with the site. - */ - STDMETHOD(AttachSite) (THIS_ - IRMASite* /*IN*/ pSite) PURE; - - STDMETHOD(DetachSite) (THIS) PURE; - - /* - * IRMASiteUser methods called to inform user of an event. - */ - STDMETHOD(HandleEvent) (THIS_ - PNxEvent* /*IN*/ pEvent) PURE; - - STDMETHOD_(BOOL,NeedsWindowedSites) (THIS) PURE; -}; - -/**************************************************************************** - * - * Interface: - * - * IRMASiteWatcher - * - * Purpose: - * - * Interface for IRMASiteWatcher objects. - * - * IID_IRMASite: - * - * {00000D05-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMASiteWatcher, 0x00000D05, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMASiteWatcher - -DECLARE_INTERFACE_(IRMASiteWatcher, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMASiteWatcher methods called by the site when a watcher - * is attached to or detached from it. - */ - STDMETHOD(AttachSite) (THIS_ - IRMASite* /*IN*/ pSite) PURE; - - STDMETHOD(DetachSite) (THIS) PURE; - - /* - * IRMASiteWatcher methods called by the site an attempt is - * made to change it's position or size. The site watcher must - * return PNR_OK for the change to occur. If the site watcher - * returns any value other than PNR_OK then the size or position - * will not change. The site watcher can also modify the new - * size of position. - */ - STDMETHOD(ChangingPosition) (THIS_ - PNxPoint posOld, - REF(PNxPoint)/*IN-OUT*/ posNew) PURE; - - STDMETHOD(ChangingSize) (THIS_ - PNxSize sizeOld, - REF(PNxSize) /*IN-OUT*/ sizeNew) PURE; -}; - -/**************************************************************************** - * - * Interface: - * - * IRMASiteUserSupplier - * - * Purpose: - * - * Interface implemented by renderers and objects with provide layouts to - * the client core. This interface is called by the core when it needs a - * new IRMASiteUser, or when it is done using an IRMASiteUser. - * - * IID_IRMASiteUserSupplier: - * - * {00000D06-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMASiteUserSupplier, 0x00000D06, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMASiteUserSupplier - -DECLARE_INTERFACE_(IRMASiteUserSupplier, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMASiteUserSupplier methods usually called by the - * "context" to ask for additional or to release previously - * created site users. - */ - STDMETHOD(CreateSiteUser) (THIS_ - REF(IRMASiteUser*)/*OUT*/ pSiteUser) PURE; - - STDMETHOD(DestroySiteUser) (THIS_ - IRMASiteUser* /*IN*/ pSiteUser) PURE; - - STDMETHOD_(BOOL,NeedsWindowedSites) (THIS) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMASiteSupplier - * - * Purpose: - * - * Interface implemented by users of the client core. This interface is - * called by the core when it needs a new IRMASite, or when it is done - * using an IRMASite. - * - * IID_IRMASiteSupplier: - * - * {00000D07-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMASiteSupplier, 0x00000D07, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMASiteSupplier - -DECLARE_INTERFACE_(IRMASiteSupplier, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMASiteSupplier methods - */ - - /************************************************************************ - * Method: - * IRMASiteSupplier::SitesNeeded - * Purpose: - * Called to inform the site supplier that a site with a particular - * set of characteristics is needed. If the site supplier can - * fulfill the request it should call the site manager and add one - * or more new sites. - * Note that the request for sites is associated with a Request ID - * the client core will inform the site supplier when this requested - * site is no longer needed. - */ - STDMETHOD(SitesNeeded) (THIS_ - UINT32 uReqestID, - IRMAValues* pSiteProps) PURE; - - /************************************************************************ - * Method: - * IRMASiteSupplier::SitesNotNeeded - * Purpose: - * Called to inform the site supplier that all sites from a previos - * site request are no longer needed. If the site supplier had - * previously created non-persistant sites (like popup windows) - * to fulfill a request for sites it should call the site manager - * and remove those sites. - */ - STDMETHOD(SitesNotNeeded) (THIS_ - UINT32 uReqestID) PURE; - - - /************************************************************************ - * Method: - * IRMASiteSupplier::BeginChangeLayout - * Purpose: - * Called to inform the site supplier a layout change has beginning - * it can expect to recieve SitesNeeded() and SitesNotNeeded() calls - * while a layout change is in progress, - */ - STDMETHOD(BeginChangeLayout) (THIS) PURE; - - /************************************************************************ - * Method: - * IRMASiteSupplier::DoneChangeLayout - * Purpose: - * Called to inform the site supplier the layout change has been - * completed. - */ - STDMETHOD(DoneChangeLayout) (THIS) PURE; - -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMASiteManager - * - * Purpose: - * - * Interface implemented by the client core. This interface is called - * by users of the client core to inform it of IRMASite's which are - * available for layout of renderers - * - * IID_IRMASiteManager: - * - * {00000D08-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMASiteManager, 0x00000D08, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMASiteManager - -DECLARE_INTERFACE_(IRMASiteManager, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMASiteManager methods - */ - - /************************************************************************ - * Method: - * IRMASiteManager::AddSite - * Purpose: - * Called to inform the site manager of the existance of a site. - */ - STDMETHOD(AddSite) (THIS_ - IRMASite* pSite) PURE; - - /************************************************************************ - * Method: - * IRMASiteManager::RemoveSite - * Purpose: - * Called to inform the site manager that a site is no longer - * available. - */ - STDMETHOD(RemoveSite) (THIS_ - IRMASite* pSite) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * - * IRMAMultiInstanceSiteUserSupplier - * - * Purpose: - * - * This is the interface for a special default object which is available - * from the common class factory. This object will act as a site user - * supplier for any renderer (or other site user object) that wants - * default support for multiple instances. The site user must work as - * a windowless site for this default implementation to work. The - * default object also implements the IRMASite interfave to allow - * the site user object to control all the sites through a single - * interface instance. - * - * IID_IRMAMultiInstanceSiteUserSupplier: - * - * {00000D09-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAMultiInstanceSiteUserSupplier, 0x00000D09, 0x901, - 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#define CLSID_IRMAMultiInstanceSiteUserSupplier \ - IID_IRMAMultiInstanceSiteUserSupplier - -#undef INTERFACE -#define INTERFACE IRMAMultiInstanceSiteUserSupplier - -DECLARE_INTERFACE_(IRMAMultiInstanceSiteUserSupplier, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAMultiInstanceSiteUserSupplier methods called by site users. - */ - STDMETHOD(SetSingleSiteUser) (THIS_ - IUnknown* pUnknown) PURE; - - STDMETHOD(ReleaseSingleSiteUser) (THIS) PURE; - -}; - -/**************************************************************************** - * - * Interface: - * IRMASiteFullScreen - * - * Purpose: - * - * This is the interface for turning on/off the full screen mode - * - * IID_IRMASiteFullScreen: - * - * {00000D0B-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMASiteFullScreen, 0x00000D0B, 0x901, - 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMASiteFullScreen - -DECLARE_INTERFACE_(IRMASiteFullScreen, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMASiteFullScreen methods - */ - STDMETHOD(EnterFullScreen) (THIS) PURE; - - STDMETHOD(ExitFullScreen) (THIS) PURE; - - STDMETHOD(TestFullScreen) (THIS_ - void* hTestBitmap,const char* pszStatusText) PURE; - - STDMETHOD_(BOOL, IsFullScreen) (THIS) PURE; -}; - - - - -/**************************************************************************** - * - * Interface: - * IRMAEventHookMgr - * - * Purpose: - * - * Add ability to hook events from a named region - * - * IID_IRMAEventHookMgr: - * - * {00000D0D-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAEventHookMgr, 0x00000D0D, 0x901, - 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAEventHookMgr - -DECLARE_INTERFACE_(IRMAEventHookMgr, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAEventHookMgr methods - */ - STDMETHOD(AddHook) (THIS_ - IRMAEventHook* pHook, - const char* pRegionName, - UINT16 uLayer) PURE; - - STDMETHOD(RemoveHook) (THIS_ - IRMAEventHook* pHook, - const char* pRegionName, - UINT16 uLayer) PURE; -}; - -/**************************************************************************** - * - * Interface: - * IRMAEventHook - * - * Purpose: - * - * Object that gets hooked events sent by IRMAEventHookMgr - * - * IID_IRMAEventHookMgr: - * - * {00000D0E-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAEventHook, 0x00000D0E, 0x901, - 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAEventHook - -DECLARE_INTERFACE_(IRMAEventHook, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAEventHook methods - */ - STDMETHOD(SiteAdded) (THIS_ - IRMASite* pSite) PURE; - STDMETHOD(HandleEvent) (THIS_ - IRMASite* pSite, - PNxEvent* pEvent) PURE; - STDMETHOD(SiteRemoved) (THIS_ - IRMASite* pSite) PURE; -}; - - -/**************************************************************************** - * - * Interface: - * IRMAStatusMessage - * - * Purpose: - * - * This is the interface for setting the status text. - * - * IID_IRMAStatusMessage: - * - * {00000D10-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAStatusMessage, 0x00000D10, 0x901, - 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAStatusMessage - -DECLARE_INTERFACE_(IRMAStatusMessage, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* - * IRMAStatusMessage methods - */ - - STDMETHOD(SetStatus) (THIS_ const char* pText) PURE; -}; - - -#endif /* _RMAWIN_H_ */ diff --git a/include/realmedia/rmaxmltg.h b/include/realmedia/rmaxmltg.h deleted file mode 100644 index 00579c548..000000000 --- a/include/realmedia/rmaxmltg.h +++ /dev/null @@ -1,146 +0,0 @@ -/**************************************************************************** - * - * $Id: rmaxmltg.h 7 2003-05-30 02:18:02Z gabest $ - * - * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved.. - * - * http://www.real.com/devzone - * - * This program contains proprietary - * information of Progressive Networks, Inc, and is licensed - * subject to restrictions on use and distribution. - * - * - * RealMedia Architecture XMLTag Object Interfaces. - * - */ - - -#ifndef _RMAXMLTG_H -#define _RMAXMLTG_H - - -typedef _INTERFACE IRMAXMLTagObject IRMAXMLTagObject; -typedef _INTERFACE IRMAXMLTagObjectResponse IRMAXMLTagObjectResponse; - -/**************************************************************************** - * - * Interface: - * - * IRMAXMLTagObjectResponse - * - * IID_IRMAXMLTagObjectResponse: - * - * {00002C02-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAXMLTagObjectResponse, 0x00002C02, 0x901, 0x11d1, 0x8b, 0x6, - 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAXMLTagObjectResponse - -DECLARE_INTERFACE_(IRMAXMLTagObjectResponse, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /************************************************************************ - * IRMAXMLTagObjectResponse - */ - STDMETHOD(OnTagDone) (THIS_ UINT32 ulInstance, IRMABuffer* pTag) PURE; - -}; - -/**************************************************************************** - * - * Interface: - * - * IRMAXMLTagHandler - * - * IID_IRMAXMLTagHandler: - * - * {00002C00-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAXMLTagHandler, 0x00002C03, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAXMLTagHandler - -DECLARE_INTERFACE_(IRMAXMLTagHandler, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /************************************************************************ - * IRMAXMLTagHandler - */ - STDMETHOD(InitTagHandler) (THIS_ IRMAValues* pOptions) PURE; - STDMETHOD(CreateTagObject) (THIS_ IRMAXMLTagObject** ppObj) PURE; - STDMETHOD(GetTagHandlerInfo) (THIS_ - REF(const char*) /*OUT*/ pShortName, - REF(const char**) /*OUT*/ pTag, - REF(BOOL) /*OUT*/ bCanHandleAsync) PURE; - -}; - -/**************************************************************************** - * - * Interface: - * - * IRMAXMLTagObject - * - * IID_IRMAXMLTagObject: - * - * {00002C01-0901-11d1-8B06-00A024406D59} - * - */ -DEFINE_GUID(IID_IRMAXMLTagObject, 0x00002C04, 0x901, 0x11d1, 0x8b, 0x6, 0x0, - 0xa0, 0x24, 0x40, 0x6d, 0x59); - -#undef INTERFACE -#define INTERFACE IRMAXMLTagObject - -DECLARE_INTERFACE_(IRMAXMLTagObject, IUnknown) -{ - /* - * IUnknown methods - */ - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - void** ppvObj) PURE; - - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /************************************************************************ - * IRMAXMLTagObject - */ - STDMETHOD(InitTagObject) (IRMAXMLTagObjectResponse* pResp) PURE; - STDMETHOD(OnTag) (THIS_ UINT32 ulInstance, IRMABuffer* pTag) PURE; - STDMETHOD(Close) (THIS) PURE; - -}; - - - -#endif diff --git a/lib/detours/detours.lib b/lib/detours/detours.lib deleted file mode 100644 index 56c6a8df6139dd9cfa43acc13b3bff2063dd53ec..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 178870 zcmeFa3w+#Fl?Q$&&uNl2Nt?c)l(dv*p`;HAEstiBOq!vYWSV69KyaESX_JyBA(@oc z6>S-!3_}#O)v72UAflooCKvQ=etamQ^ggcv;2b)Zp?8^ZTNT ziiO&{p+G714@#Z&jlcZ8?toIxcc@CK{~x}d`)bvH$D39DA@x^$SJZSwdk6bhcJx%Y zc6V1+uJ?s}e*CYfsJu!gBd^@rmoYBbyUpLaJsBNHNy*raj>ImpW2S8zGq$~JtbE(Y zOgk`U+JTH^4h;@;rsf*aOswwhiFWl2c7*zS+d2jY)^q zqtY))B5;XcTZ#A;1ChQ}UEzU_e*gBij=pGDZ%<9vKwoRLt+S)QvT|`~>B@B>UpV4l zSM3kA1R5J6P5$b}rkcu1hE_K=wD{MxR904A&)7D`VRNK`Z1u;w1iWL>rfvv5ZJ1RBbD=Sy~{FUn>vOkLaGv}y58d|qz25IRW?78*?O0_T( zaVBC^afNadIaX0qK-`NO@$1ap$qD(^N%LJ1Svk6lqaxGGISRnNtVyuC%Jr1mb%DCj zQs|_0P)Sm4k$^M83ifq(ZSG+mNxo_23;6tXz`*3b?(W_;w6aPKGD=iJz8d_uWaPx4 zjX+LT8Qhvq70N7Klm!da3oZECuAWg`(C|szj-rGH z`=LbAM8)C>%i7#wk?JfcvUj4>x*~>~z7Hq{*-}FyP?N6oN0)_^?IL{p($5jAvNU$x`^nI_vPUY*VyfGxdlHD!aW?eB7LriK$&b@U4(q+l-j7&=XdUe(pp+P?#C zyRUNLBFi93hOQkIsuk9fR8ZZ@LajTxdr?icU8M0io7JMU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?p9FKV(??6F-6?}}|Dig|oA5o_*@VgFu1x!8FN3u+ z+^?VuZE~IMn;i)}Ec#2|A+ZdxCI5@CJP6%>p+%IP&d*4?W6+#-pv%P7a}K|PX17$> zynLOcTMkW=1Knz9wmZ;03(Zjny3e6Wqk_V9SKhG*EQ!%M?b~)zwZg3T;A9|wWS01v&3#09pK-?FmITdH~J_RzH{Jyan#v|ep6$YG5>Ac?6WfF z0>LD*n63Gtfin29cLs(H`B=VRMMjJ9+}pq&-*`;)ONu=_a>(|1WUC6`TM7 diff --git a/lib/wm7/wmstub.lib b/lib/wm7/wmstub.lib deleted file mode 100644 index a542f8ee68467e07096b7ba60fd2d6d6a80f4511..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 926774 zcmeFa4V>InbvOQ76Os)C2oixRYQTt5F>I1e2!dwbcV}nkB|H0)ATZ3%%x;G4&Mfn? z$)fP65o%nqR+M7v8;G{P)mmFh#UcVltv_=43UR%-s=bMEi{?)|;Y z?wuw5_j&p-o0&A;=WxM_wDR=2XE@L z-}`rL-z}c6KH0KXy~pa=`;GtqzVnY*J@mb9*VEspW$@H=;K?mk&;LW;XFTv7>;H!D zs);vPEB@ZuYpwb}=)3xsw^^$ni#+{3figJhW1q5~{yr^(r*&ZEIv#_k77(bMG_6_p@)e*3kFK*0SHVXYI32=yzwowYJlDfO50 z>fQNa|MwNcR_{{Zp@`M1e@C9QdgXWDd#v6o@qVJd@A!AC*YtbGW~=wpmx=G+e%b1! z@1x+w{;u1dvDP&oRNw12TI=Zh>DQ?5lV7*i+24~JKe3kmK6t-%GQOvrGU@-0Y_d+# zzi-=MokHKg``UlXcm3s{Yd_x{FmeeZ2pr@Fs;_Vh(3()miM-Kazl6l=B0 zOenNB91rcg+}g8e+Y)hwi~W(iA|Y!}xLh8oOojZhW8r}mksYYi!nJa~Lf=xO(h2}g zhX;mo;aoV5f2mw}JQ^EG=Tgze!d$B!3gyCMNgvZ8rre5F8bJh+_7DhxoCX)Iw`-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mtG;B3cd+`B OCGN@UOP18Bss9f#iUQyO diff --git a/mpc_vs2005.sln b/mpc_vs2005.sln deleted file mode 100644 index b56eabe1f..000000000 --- a/mpc_vs2005.sln +++ /dev/null @@ -1,849 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "asyncreader", "src\filters\reader\asyncreader\asyncreader_vs2005.vcproj", "{9F31D122-E84D-485A-A58D-09DAD01A56CE}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cddareader", "src\filters\reader\cddareader\cddareader_vs2005.vcproj", "{543D40E9-8CA6-4E4B-9936-90CBA562B268}" - ProjectSection(ProjectDependencies) = postProject - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - {9F31D122-E84D-485A-A58D-09DAD01A56CE} = {9F31D122-E84D-485A-A58D-09DAD01A56CE} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cdxareader", "src\filters\reader\cdxareader\cdxareader_vs2005.vcproj", "{4D3B4FF4-535A-4201-AB7D-9AEC1E737A95}" - ProjectSection(ProjectDependencies) = postProject - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - {9F31D122-E84D-485A-A58D-09DAD01A56CE} = {9F31D122-E84D-485A-A58D-09DAD01A56CE} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "d2vsource", "src\filters\source\d2vsource\d2vsource_vs2005.vcproj", "{83CC6B88-A112-4192-BD5A-F2A249AF2277}" - ProjectSection(ProjectDependencies) = postProject - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "flicsource", "src\filters\source\flicsource\flicsource_vs2005.vcproj", "{431DD5B6-3F2F-47EE-A23F-514BC044B704}" - ProjectSection(ProjectDependencies) = postProject - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "audioswitcher", "src\filters\switcher\audioswitcher\audioswitcher_vs2005.vcproj", "{D8DB3E7E-D50E-4EC3-A9B9-DAD18F5FE466}" - ProjectSection(ProjectDependencies) = postProject - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "avi2ac3filter", "src\filters\transform\avi2ac3filter\avi2ac3filter_vs2005.vcproj", "{339A4575-E25B-45D6-94A1-D835891740B8}" - ProjectSection(ProjectDependencies) = postProject - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bufferfilter", "src\filters\transform\bufferfilter\bufferfilter_vs2005.vcproj", "{9DCFD02A-16A0-4766-BC18-66163E21929D}" - ProjectSection(ProjectDependencies) = postProject - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "decssfilter", "src\filters\transform\decssfilter\decssfilter_vs2005.vcproj", "{F6B06383-3FFD-403B-9867-4AA82A20AA83}" - ProjectSection(ProjectDependencies) = postProject - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "basesource", "src\filters\source\basesource\basesource_vs2005.vcproj", "{F50E74C2-5BE7-4C9B-B1E7-6CA19CFAD34E}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wavdest", "src\filters\muxer\wavdest\wavdest_vs2005.vcproj", "{EB202B68-8029-4985-B914-E94B44D2E230}" - ProjectSection(ProjectDependencies) = postProject - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vtsreader", "src\filters\reader\vtsreader\vtsreader_vs2005.vcproj", "{664E726B-EEEE-403A-AC15-345D9C9E1375}" - ProjectSection(ProjectDependencies) = postProject - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - {9F31D122-E84D-485A-A58D-09DAD01A56CE} = {9F31D122-E84D-485A-A58D-09DAD01A56CE} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "streamdrivethru", "src\filters\parser\streamdrivethru\streamdrivethru_vs2005.vcproj", "{AE399B7E-2B2C-4A96-9016-C5C74B0A2FA0}" - ProjectSection(ProjectDependencies) = postProject - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dtsac3source", "src\filters\source\dtsac3source\dtsac3source_vs2005.vcproj", "{30D48874-899F-41C6-9B26-A40C96C91102}" - ProjectSection(ProjectDependencies) = postProject - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shoutcastsource", "src\filters\source\shoutcastsource\shoutcastsource_vs2005.vcproj", "{42B599D7-BB84-481F-A42A-2DBE0E2E2D7E}" - ProjectSection(ProjectDependencies) = postProject - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MatroskaSplitter", "src\filters\parser\matroskasplitter\MatroskaSplitter_vs2005.vcproj", "{3F5EA225-F4B7-4413-AEB3-4E4E5751E438}" - ProjectSection(ProjectDependencies) = postProject - {2FCD4B66-9CF9-4C8F-BC70-37CD20002D49} = {2FCD4B66-9CF9-4C8F-BC70-37CD20002D49} - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} = {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MatroskaMuxer", "src\filters\muxer\matroskamuxer\MatroskaMuxer_vs2005.vcproj", "{67827491-8162-4039-9132-F934ABC836A0}" - ProjectSection(ProjectDependencies) = postProject - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RealMediaSplitter", "src\filters\parser\realmediasplitter\RealMediaSplitter_vs2005.vcproj", "{53CF9195-19DB-457D-8F55-8DB1706DFA84}" - ProjectSection(ProjectDependencies) = postProject - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} = {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} - {54DDA60F-E528-4D07-A152-960A1E818680} = {54DDA60F-E528-4D07-A152-960A1E818680} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "basesplitter", "src\filters\parser\basesplitter\basesplitter_vs2005.vcproj", "{37768B3F-89BC-4C16-B2A8-767C5DA84C3F}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AviSplitter", "src\filters\parser\avisplitter\AviSplitter_vs2005.vcproj", "{9738B023-FC46-48A2-953A-0035FD897678}" - ProjectSection(ProjectDependencies) = postProject - {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} = {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Mpeg2DecFilter", "src\filters\transform\mpeg2decfilter\Mpeg2DecFilter_vs2005.vcproj", "{305BAB2D-0D75-4FBC-8BCD-A2917392B48C}" - ProjectSection(ProjectDependencies) = postProject - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - {54DDA60F-E528-4D07-A152-960A1E818680} = {54DDA60F-E528-4D07-A152-960A1E818680} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MpaDecFilter", "src\filters\transform\mpadecfilter\MpaDecFilter_vs2005.vcproj", "{4421516D-10A6-41C1-ADF3-099573BBB0C6}" - ProjectSection(ProjectDependencies) = postProject - {54F609FD-A8CE-43CF-94AD-23E877B97C13} = {54F609FD-A8CE-43CF-94AD-23E877B97C13} - {5EFCFACB-1835-422C-ACDA-E3B3A2F51387} = {5EFCFACB-1835-422C-ACDA-E3B3A2F51387} - {62FE6D94-E17C-4A8E-8D3C-7A589A70D865} = {62FE6D94-E17C-4A8E-8D3C-7A589A70D865} - {A7134255-DFF3-42F7-9BC2-FAC6E71CFFAE} = {A7134255-DFF3-42F7-9BC2-FAC6E71CFFAE} - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - {D8365C15-2166-4DB6-8A2D-1C8F0239EB18} = {D8365C15-2166-4DB6-8A2D-1C8F0239EB18} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmad", "src\filters\transform\mpadecfilter\libmad-0.15.0b\msvc++\libmad_vs2005.vcproj", "{D8365C15-2166-4DB6-8A2D-1C8F0239EB18}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RoQSplitter", "src\filters\parser\roqsplitter\RoQSplitter_vs2005.vcproj", "{23E1898F-8262-435C-8848-D4D8824E6D71}" - ProjectSection(ProjectDependencies) = postProject - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} = {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib", "src\zlib\zlib_vs2005.vcproj", "{2FCD4B66-9CF9-4C8F-BC70-37CD20002D49}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OggSplitter", "src\filters\parser\oggsplitter\OggSplitter_vs2005.vcproj", "{7FE0A205-3F39-4AC3-BC3C-C2D9E4D02475}" - ProjectSection(ProjectDependencies) = postProject - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} = {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "liba52", "src\filters\transform\mpadecfilter\a52dec-0.7.4\vc++\liba52_vs2005.vcproj", "{62FE6D94-E17C-4A8E-8D3C-7A589A70D865}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NutSplitter", "src\filters\parser\nutsplitter\NutSplitter_vs2005.vcproj", "{E776D3C2-5BFA-41B9-B998-A35B549AF737}" - ProjectSection(ProjectDependencies) = postProject - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} = {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libdts", "src\filters\transform\mpadecfilter\dtsdec-0.0.1\vc++\libdts_vs2005.vcproj", "{54F609FD-A8CE-43CF-94AD-23E877B97C13}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MpegSplitter", "src\filters\parser\mpegsplitter\MpegSplitter_vs2005.vcproj", "{4628C665-EDE4-40D2-B525-32BE8B8551C8}" - ProjectSection(ProjectDependencies) = postProject - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} = {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libfaad", "src\filters\transform\mpadecfilter\faad2\libfaad\libfaad_vs2005.vcproj", "{5EFCFACB-1835-422C-ACDA-E3B3A2F51387}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DiracSplitter", "src\filters\parser\diracsplitter\DiracSplitter_vs2005.vcproj", "{ECB1B3B7-196D-4809-A5E2-6F65CDBB6CCA}" - ProjectSection(ProjectDependencies) = postProject - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - {12BE3440-A1F3-4C48-A229-30CB619EA276} = {12BE3440-A1F3-4C48-A229-30CB619EA276} - {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} = {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libdirac", "src\filters\parser\diracsplitter\libdirac\libdirac_vs2005.vcproj", "{12BE3440-A1F3-4C48-A229-30CB619EA276}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MpaSplitter", "src\filters\parser\mpasplitter\MpaSplitter_vs2005.vcproj", "{C0F7A036-FC2D-40DF-9852-C37518DB6B3E}" - ProjectSection(ProjectDependencies) = postProject - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} = {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "basevideofilter", "src\filters\transform\basevideofilter\basevideofilter_vs2005.vcproj", "{54DDA60F-E528-4D07-A152-960A1E818680}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DSMSplitter", "src\filters\parser\dsmsplitter\DSMSplitter_vs2005.vcproj", "{1E91F58C-0BAE-4021-8087-D1864D8EC066}" - ProjectSection(ProjectDependencies) = postProject - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BaseMuxer", "src\filters\muxer\basemuxer\BaseMuxer_vs2005.vcproj", "{DB5F93B2-54D0-4474-A588-D259BE36C832}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DSMMuxer", "src\filters\muxer\dsmmuxer\DSMMuxer_vs2005.vcproj", "{65361C7C-83D6-42E4-870C-4DC85AE641FE}" - ProjectSection(ProjectDependencies) = postProject - {DB5F93B2-54D0-4474-A588-D259BE36C832} = {DB5F93B2-54D0-4474-A588-D259BE36C832} - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "subtitlesource", "src\filters\source\subtitlesource\subtitlesource_vs2005.vcproj", "{8F998497-9C51-4FAA-83E4-1D85B22CBA13}" - ProjectSection(ProjectDependencies) = postProject - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MP4Splitter", "src\filters\parser\mp4splitter\MP4Splitter_vs2005.vcproj", "{9ED4B036-7399-4128-868D-6E71188E0277}" - ProjectSection(ProjectDependencies) = postProject - {2FCD4B66-9CF9-4C8F-BC70-37CD20002D49} = {2FCD4B66-9CF9-4C8F-BC70-37CD20002D49} - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} = {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "udpreader", "src\filters\reader\udpreader\udpreader_vs2005.vcproj", "{3020FF9B-8202-488D-B137-11DECC510E6E}" - ProjectSection(ProjectDependencies) = postProject - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - {9F31D122-E84D-485A-A58D-09DAD01A56CE} = {9F31D122-E84D-485A-A58D-09DAD01A56CE} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "filters", "src\filters\filters_vs2005.vcproj", "{273B3149-3192-4B75-A791-470320B90812}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FLVSplitter", "src\filters\parser\flvsplitter\FLVSplitter_vs2005.vcproj", "{E62223EF-8263-41EB-8174-CD78BBEEF368}" - ProjectSection(ProjectDependencies) = postProject - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} = {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} - {54DDA60F-E528-4D07-A152-960A1E818680} = {54DDA60F-E528-4D07-A152-960A1E818680} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libvorbisidec", "src\filters\transform\mpadecfilter\libvorbisidec\libvorbisidec_vs2005.vcproj", "{A7134255-DFF3-42F7-9BC2-FAC6E71CFFAE}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SSFSplitter", "src\filters\parser\ssfsplitter\SSFSplitter_vs2005.vcproj", "{CC07B80F-D44F-41A9-9E37-5F2B47B46EDC}" - ProjectSection(ProjectDependencies) = postProject - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} = {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Filters", "Filters", "{F127F305-5EF5-4B69-B35F-8B30021B175D}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Muxer", "Muxer", "{49B5BAE3-749C-414C-80CC-A756DD548CE3}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Parser", "Parser", "{D626CC4F-BFB1-4030-8DD8-1A3A1D41248E}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Libraries", "Libraries", "{69C0E434-3B73-400A-A1B7-A887C10BECCA}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Reader", "Reader", "{4909B0ED-CC22-4509-ACD0-FB60C4FC73ED}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Transform", "Transform", "{F9F42BF2-3F13-4654-82C5-E27B8879EC4E}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Source", "Source", "{02DAA1A6-31C8-4002-89FE-50BF53752244}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Switcher", "Switcher", "{683639C3-F209-4EF8-B6CC-8741C61EDECF}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Apps", "Apps", "{A21F07E6-A891-479C-98EA-EDB58CE4EFAB}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Libraries", "Libraries", "{D9A0529B-9EC4-4D30-9E05-A5D533739D95}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "UI", "UI", "{2913B7E4-7A8B-43D5-A60B-345A0782816A}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CmdUI", "src\ui\CmdUI\CmdUI_vs2005.vcproj", "{03208025-D5C2-426A-B0FA-251D4338F30C}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ResizableLib", "src\ui\ResizableLib\ResizableLib_vs2005.vcproj", "{4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sizecbar", "src\ui\sizecbar\sizecbar_vs2005.vcproj", "{61E6EB4D-2F1A-443B-94B0-E8200B26E99F}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TreePropSheet", "src\ui\TreePropSheet\TreePropSheet_vs2005.vcproj", "{AB494732-EF6D-44D0-BCF8-80FF04858D10}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpng", "src\libpng\libpng_vs2005.vcproj", "{FC8080D1-603C-45EC-BCFA-7172E2F3D989}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libssf", "src\subtitles\libssf\libssf_vs2005.vcproj", "{DD9D2D92-2241-408A-859E-B85D444B7E3C}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "subtitles", "src\subtitles\subtitles_vs2005.vcproj", "{5E56335F-0FB1-4EEA-B240-D8DC5E0608E4}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "decss", "src\decss\decss_vs2005.vcproj", "{1A2DFD1A-3C6C-44D1-909D-294AF646B575}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dsutil", "src\dsutil\dsutil_vs2005.vcproj", "{FC70988B-1AE5-4381-866D-4F405E28AC42}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mplayerc", "src\apps\mplayerc\mplayerc_vs2005.vcproj", "{8CE7E5D0-C821-47AC-A247-28EC95B34670}" - ProjectSection(ProjectDependencies) = postProject - {54F609FD-A8CE-43CF-94AD-23E877B97C13} = {54F609FD-A8CE-43CF-94AD-23E877B97C13} - {4D3B4FF4-535A-4201-AB7D-9AEC1E737A95} = {4D3B4FF4-535A-4201-AB7D-9AEC1E737A95} - {E62223EF-8263-41EB-8174-CD78BBEEF368} = {E62223EF-8263-41EB-8174-CD78BBEEF368} - {543D40E9-8CA6-4E4B-9936-90CBA562B268} = {543D40E9-8CA6-4E4B-9936-90CBA562B268} - {42B599D7-BB84-481F-A42A-2DBE0E2E2D7E} = {42B599D7-BB84-481F-A42A-2DBE0E2E2D7E} - {FC8080D1-603C-45EC-BCFA-7172E2F3D989} = {FC8080D1-603C-45EC-BCFA-7172E2F3D989} - {5EFCFACB-1835-422C-ACDA-E3B3A2F51387} = {5EFCFACB-1835-422C-ACDA-E3B3A2F51387} - {E776D3C2-5BFA-41B9-B998-A35B549AF737} = {E776D3C2-5BFA-41B9-B998-A35B549AF737} - {F50E74C2-5BE7-4C9B-B1E7-6CA19CFAD34E} = {F50E74C2-5BE7-4C9B-B1E7-6CA19CFAD34E} - {ECB1B3B7-196D-4809-A5E2-6F65CDBB6CCA} = {ECB1B3B7-196D-4809-A5E2-6F65CDBB6CCA} - {431DD5B6-3F2F-47EE-A23F-514BC044B704} = {431DD5B6-3F2F-47EE-A23F-514BC044B704} - {DB5F93B2-54D0-4474-A588-D259BE36C832} = {DB5F93B2-54D0-4474-A588-D259BE36C832} - {3020FF9B-8202-488D-B137-11DECC510E6E} = {3020FF9B-8202-488D-B137-11DECC510E6E} - {8F998497-9C51-4FAA-83E4-1D85B22CBA13} = {8F998497-9C51-4FAA-83E4-1D85B22CBA13} - {53CF9195-19DB-457D-8F55-8DB1706DFA84} = {53CF9195-19DB-457D-8F55-8DB1706DFA84} - {62FE6D94-E17C-4A8E-8D3C-7A589A70D865} = {62FE6D94-E17C-4A8E-8D3C-7A589A70D865} - {DD9D2D92-2241-408A-859E-B85D444B7E3C} = {DD9D2D92-2241-408A-859E-B85D444B7E3C} - {67827491-8162-4039-9132-F934ABC836A0} = {67827491-8162-4039-9132-F934ABC836A0} - {23E1898F-8262-435C-8848-D4D8824E6D71} = {23E1898F-8262-435C-8848-D4D8824E6D71} - {1E91F58C-0BAE-4021-8087-D1864D8EC066} = {1E91F58C-0BAE-4021-8087-D1864D8EC066} - {FC70988B-1AE5-4381-866D-4F405E28AC42} = {FC70988B-1AE5-4381-866D-4F405E28AC42} - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0} = {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0} - {F6B06383-3FFD-403B-9867-4AA82A20AA83} = {F6B06383-3FFD-403B-9867-4AA82A20AA83} - {AE399B7E-2B2C-4A96-9016-C5C74B0A2FA0} = {AE399B7E-2B2C-4A96-9016-C5C74B0A2FA0} - {D8DB3E7E-D50E-4EC3-A9B9-DAD18F5FE466} = {D8DB3E7E-D50E-4EC3-A9B9-DAD18F5FE466} - {65361C7C-83D6-42E4-870C-4DC85AE641FE} = {65361C7C-83D6-42E4-870C-4DC85AE641FE} - {339A4575-E25B-45D6-94A1-D835891740B8} = {339A4575-E25B-45D6-94A1-D835891740B8} - {30D48874-899F-41C6-9B26-A40C96C91102} = {30D48874-899F-41C6-9B26-A40C96C91102} - {4421516D-10A6-41C1-ADF3-099573BBB0C6} = {4421516D-10A6-41C1-ADF3-099573BBB0C6} - {664E726B-EEEE-403A-AC15-345D9C9E1375} = {664E726B-EEEE-403A-AC15-345D9C9E1375} - {EB202B68-8029-4985-B914-E94B44D2E230} = {EB202B68-8029-4985-B914-E94B44D2E230} - {2FCD4B66-9CF9-4C8F-BC70-37CD20002D49} = {2FCD4B66-9CF9-4C8F-BC70-37CD20002D49} - {4628C665-EDE4-40D2-B525-32BE8B8551C8} = {4628C665-EDE4-40D2-B525-32BE8B8551C8} - {5E56335F-0FB1-4EEA-B240-D8DC5E0608E4} = {5E56335F-0FB1-4EEA-B240-D8DC5E0608E4} - {A7134255-DFF3-42F7-9BC2-FAC6E71CFFAE} = {A7134255-DFF3-42F7-9BC2-FAC6E71CFFAE} - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F} = {61E6EB4D-2F1A-443B-94B0-E8200B26E99F} - {D514EA4D-EAFB-47A9-A437-A582CA571251} = {D514EA4D-EAFB-47A9-A437-A582CA571251} - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - {12BE3440-A1F3-4C48-A229-30CB619EA276} = {12BE3440-A1F3-4C48-A229-30CB619EA276} - {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} = {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} - {9ED4B036-7399-4128-868D-6E71188E0277} = {9ED4B036-7399-4128-868D-6E71188E0277} - {C0F7A036-FC2D-40DF-9852-C37518DB6B3E} = {C0F7A036-FC2D-40DF-9852-C37518DB6B3E} - {AB494732-EF6D-44D0-BCF8-80FF04858D10} = {AB494732-EF6D-44D0-BCF8-80FF04858D10} - {9DCFD02A-16A0-4766-BC18-66163E21929D} = {9DCFD02A-16A0-4766-BC18-66163E21929D} - {3F5EA225-F4B7-4413-AEB3-4E4E5751E438} = {3F5EA225-F4B7-4413-AEB3-4E4E5751E438} - {03208025-D5C2-426A-B0FA-251D4338F30C} = {03208025-D5C2-426A-B0FA-251D4338F30C} - {9738B023-FC46-48A2-953A-0035FD897678} = {9738B023-FC46-48A2-953A-0035FD897678} - {9F31D122-E84D-485A-A58D-09DAD01A56CE} = {9F31D122-E84D-485A-A58D-09DAD01A56CE} - {1A2DFD1A-3C6C-44D1-909D-294AF646B575} = {1A2DFD1A-3C6C-44D1-909D-294AF646B575} - {D8365C15-2166-4DB6-8A2D-1C8F0239EB18} = {D8365C15-2166-4DB6-8A2D-1C8F0239EB18} - {CC07B80F-D44F-41A9-9E37-5F2B47B46EDC} = {CC07B80F-D44F-41A9-9E37-5F2B47B46EDC} - {54DDA60F-E528-4D07-A152-960A1E818680} = {54DDA60F-E528-4D07-A152-960A1E818680} - {7FE0A205-3F39-4AC3-BC3C-C2D9E4D02475} = {7FE0A205-3F39-4AC3-BC3C-C2D9E4D02475} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "subpic", "src\subpic\subpic_vs2005.vcproj", "{D514EA4D-EAFB-47A9-A437-A582CA571251}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BaseClasses", "src\filters\BaseClasses\baseclasses_vs2005.vcproj", "{E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug Unicode|Win32 = Debug Unicode|Win32 - Debug Unicode|x64 = Debug Unicode|x64 - Release Unicode|Win32 = Release Unicode|Win32 - Release Unicode|x64 = Release Unicode|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {9F31D122-E84D-485A-A58D-09DAD01A56CE}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32 - {9F31D122-E84D-485A-A58D-09DAD01A56CE}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32 - {9F31D122-E84D-485A-A58D-09DAD01A56CE}.Debug Unicode|x64.ActiveCfg = Debug Unicode|x64 - {9F31D122-E84D-485A-A58D-09DAD01A56CE}.Debug Unicode|x64.Build.0 = Debug Unicode|x64 - {9F31D122-E84D-485A-A58D-09DAD01A56CE}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32 - {9F31D122-E84D-485A-A58D-09DAD01A56CE}.Release Unicode|Win32.Build.0 = Release Unicode|Win32 - {9F31D122-E84D-485A-A58D-09DAD01A56CE}.Release Unicode|x64.ActiveCfg = Release Unicode|x64 - {9F31D122-E84D-485A-A58D-09DAD01A56CE}.Release Unicode|x64.Build.0 = Release Unicode|x64 - {543D40E9-8CA6-4E4B-9936-90CBA562B268}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {543D40E9-8CA6-4E4B-9936-90CBA562B268}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {543D40E9-8CA6-4E4B-9936-90CBA562B268}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {543D40E9-8CA6-4E4B-9936-90CBA562B268}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {543D40E9-8CA6-4E4B-9936-90CBA562B268}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {543D40E9-8CA6-4E4B-9936-90CBA562B268}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {543D40E9-8CA6-4E4B-9936-90CBA562B268}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {543D40E9-8CA6-4E4B-9936-90CBA562B268}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {4D3B4FF4-535A-4201-AB7D-9AEC1E737A95}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {4D3B4FF4-535A-4201-AB7D-9AEC1E737A95}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {4D3B4FF4-535A-4201-AB7D-9AEC1E737A95}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {4D3B4FF4-535A-4201-AB7D-9AEC1E737A95}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {4D3B4FF4-535A-4201-AB7D-9AEC1E737A95}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {4D3B4FF4-535A-4201-AB7D-9AEC1E737A95}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {4D3B4FF4-535A-4201-AB7D-9AEC1E737A95}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {4D3B4FF4-535A-4201-AB7D-9AEC1E737A95}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {83CC6B88-A112-4192-BD5A-F2A249AF2277}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {83CC6B88-A112-4192-BD5A-F2A249AF2277}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {83CC6B88-A112-4192-BD5A-F2A249AF2277}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {83CC6B88-A112-4192-BD5A-F2A249AF2277}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {83CC6B88-A112-4192-BD5A-F2A249AF2277}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {83CC6B88-A112-4192-BD5A-F2A249AF2277}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {83CC6B88-A112-4192-BD5A-F2A249AF2277}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {431DD5B6-3F2F-47EE-A23F-514BC044B704}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {431DD5B6-3F2F-47EE-A23F-514BC044B704}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {431DD5B6-3F2F-47EE-A23F-514BC044B704}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {431DD5B6-3F2F-47EE-A23F-514BC044B704}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {431DD5B6-3F2F-47EE-A23F-514BC044B704}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {431DD5B6-3F2F-47EE-A23F-514BC044B704}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {431DD5B6-3F2F-47EE-A23F-514BC044B704}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {431DD5B6-3F2F-47EE-A23F-514BC044B704}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {D8DB3E7E-D50E-4EC3-A9B9-DAD18F5FE466}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {D8DB3E7E-D50E-4EC3-A9B9-DAD18F5FE466}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {D8DB3E7E-D50E-4EC3-A9B9-DAD18F5FE466}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {D8DB3E7E-D50E-4EC3-A9B9-DAD18F5FE466}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {D8DB3E7E-D50E-4EC3-A9B9-DAD18F5FE466}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {D8DB3E7E-D50E-4EC3-A9B9-DAD18F5FE466}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {D8DB3E7E-D50E-4EC3-A9B9-DAD18F5FE466}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {D8DB3E7E-D50E-4EC3-A9B9-DAD18F5FE466}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {339A4575-E25B-45D6-94A1-D835891740B8}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {339A4575-E25B-45D6-94A1-D835891740B8}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {339A4575-E25B-45D6-94A1-D835891740B8}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {339A4575-E25B-45D6-94A1-D835891740B8}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {339A4575-E25B-45D6-94A1-D835891740B8}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {339A4575-E25B-45D6-94A1-D835891740B8}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {339A4575-E25B-45D6-94A1-D835891740B8}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {339A4575-E25B-45D6-94A1-D835891740B8}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {9DCFD02A-16A0-4766-BC18-66163E21929D}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {9DCFD02A-16A0-4766-BC18-66163E21929D}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {9DCFD02A-16A0-4766-BC18-66163E21929D}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {9DCFD02A-16A0-4766-BC18-66163E21929D}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {9DCFD02A-16A0-4766-BC18-66163E21929D}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {9DCFD02A-16A0-4766-BC18-66163E21929D}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {9DCFD02A-16A0-4766-BC18-66163E21929D}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {9DCFD02A-16A0-4766-BC18-66163E21929D}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {F6B06383-3FFD-403B-9867-4AA82A20AA83}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {F6B06383-3FFD-403B-9867-4AA82A20AA83}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {F6B06383-3FFD-403B-9867-4AA82A20AA83}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {F6B06383-3FFD-403B-9867-4AA82A20AA83}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {F6B06383-3FFD-403B-9867-4AA82A20AA83}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {F6B06383-3FFD-403B-9867-4AA82A20AA83}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {F6B06383-3FFD-403B-9867-4AA82A20AA83}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {F6B06383-3FFD-403B-9867-4AA82A20AA83}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {F50E74C2-5BE7-4C9B-B1E7-6CA19CFAD34E}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {F50E74C2-5BE7-4C9B-B1E7-6CA19CFAD34E}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {F50E74C2-5BE7-4C9B-B1E7-6CA19CFAD34E}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {F50E74C2-5BE7-4C9B-B1E7-6CA19CFAD34E}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {F50E74C2-5BE7-4C9B-B1E7-6CA19CFAD34E}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {F50E74C2-5BE7-4C9B-B1E7-6CA19CFAD34E}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {F50E74C2-5BE7-4C9B-B1E7-6CA19CFAD34E}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {F50E74C2-5BE7-4C9B-B1E7-6CA19CFAD34E}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {EB202B68-8029-4985-B914-E94B44D2E230}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {EB202B68-8029-4985-B914-E94B44D2E230}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {EB202B68-8029-4985-B914-E94B44D2E230}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {EB202B68-8029-4985-B914-E94B44D2E230}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {EB202B68-8029-4985-B914-E94B44D2E230}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {EB202B68-8029-4985-B914-E94B44D2E230}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {EB202B68-8029-4985-B914-E94B44D2E230}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {EB202B68-8029-4985-B914-E94B44D2E230}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {664E726B-EEEE-403A-AC15-345D9C9E1375}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {664E726B-EEEE-403A-AC15-345D9C9E1375}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {664E726B-EEEE-403A-AC15-345D9C9E1375}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {664E726B-EEEE-403A-AC15-345D9C9E1375}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {664E726B-EEEE-403A-AC15-345D9C9E1375}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {664E726B-EEEE-403A-AC15-345D9C9E1375}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {664E726B-EEEE-403A-AC15-345D9C9E1375}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {664E726B-EEEE-403A-AC15-345D9C9E1375}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {AE399B7E-2B2C-4A96-9016-C5C74B0A2FA0}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {AE399B7E-2B2C-4A96-9016-C5C74B0A2FA0}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {AE399B7E-2B2C-4A96-9016-C5C74B0A2FA0}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {AE399B7E-2B2C-4A96-9016-C5C74B0A2FA0}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {AE399B7E-2B2C-4A96-9016-C5C74B0A2FA0}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {AE399B7E-2B2C-4A96-9016-C5C74B0A2FA0}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {AE399B7E-2B2C-4A96-9016-C5C74B0A2FA0}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {AE399B7E-2B2C-4A96-9016-C5C74B0A2FA0}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {30D48874-899F-41C6-9B26-A40C96C91102}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {30D48874-899F-41C6-9B26-A40C96C91102}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {30D48874-899F-41C6-9B26-A40C96C91102}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {30D48874-899F-41C6-9B26-A40C96C91102}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {30D48874-899F-41C6-9B26-A40C96C91102}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {30D48874-899F-41C6-9B26-A40C96C91102}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {30D48874-899F-41C6-9B26-A40C96C91102}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {30D48874-899F-41C6-9B26-A40C96C91102}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {42B599D7-BB84-481F-A42A-2DBE0E2E2D7E}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {42B599D7-BB84-481F-A42A-2DBE0E2E2D7E}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {42B599D7-BB84-481F-A42A-2DBE0E2E2D7E}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {42B599D7-BB84-481F-A42A-2DBE0E2E2D7E}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {42B599D7-BB84-481F-A42A-2DBE0E2E2D7E}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {42B599D7-BB84-481F-A42A-2DBE0E2E2D7E}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {42B599D7-BB84-481F-A42A-2DBE0E2E2D7E}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {42B599D7-BB84-481F-A42A-2DBE0E2E2D7E}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {3F5EA225-F4B7-4413-AEB3-4E4E5751E438}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {3F5EA225-F4B7-4413-AEB3-4E4E5751E438}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {3F5EA225-F4B7-4413-AEB3-4E4E5751E438}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {3F5EA225-F4B7-4413-AEB3-4E4E5751E438}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {3F5EA225-F4B7-4413-AEB3-4E4E5751E438}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {3F5EA225-F4B7-4413-AEB3-4E4E5751E438}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {3F5EA225-F4B7-4413-AEB3-4E4E5751E438}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {3F5EA225-F4B7-4413-AEB3-4E4E5751E438}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {67827491-8162-4039-9132-F934ABC836A0}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {67827491-8162-4039-9132-F934ABC836A0}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {67827491-8162-4039-9132-F934ABC836A0}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {67827491-8162-4039-9132-F934ABC836A0}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {67827491-8162-4039-9132-F934ABC836A0}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {67827491-8162-4039-9132-F934ABC836A0}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {67827491-8162-4039-9132-F934ABC836A0}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {67827491-8162-4039-9132-F934ABC836A0}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {53CF9195-19DB-457D-8F55-8DB1706DFA84}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {53CF9195-19DB-457D-8F55-8DB1706DFA84}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {53CF9195-19DB-457D-8F55-8DB1706DFA84}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {53CF9195-19DB-457D-8F55-8DB1706DFA84}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {53CF9195-19DB-457D-8F55-8DB1706DFA84}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {53CF9195-19DB-457D-8F55-8DB1706DFA84}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {53CF9195-19DB-457D-8F55-8DB1706DFA84}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {53CF9195-19DB-457D-8F55-8DB1706DFA84}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {37768B3F-89BC-4C16-B2A8-767C5DA84C3F}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {37768B3F-89BC-4C16-B2A8-767C5DA84C3F}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {37768B3F-89BC-4C16-B2A8-767C5DA84C3F}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {37768B3F-89BC-4C16-B2A8-767C5DA84C3F}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {37768B3F-89BC-4C16-B2A8-767C5DA84C3F}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {37768B3F-89BC-4C16-B2A8-767C5DA84C3F}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {37768B3F-89BC-4C16-B2A8-767C5DA84C3F}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {37768B3F-89BC-4C16-B2A8-767C5DA84C3F}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {9738B023-FC46-48A2-953A-0035FD897678}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {9738B023-FC46-48A2-953A-0035FD897678}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {9738B023-FC46-48A2-953A-0035FD897678}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {9738B023-FC46-48A2-953A-0035FD897678}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {9738B023-FC46-48A2-953A-0035FD897678}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {9738B023-FC46-48A2-953A-0035FD897678}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {9738B023-FC46-48A2-953A-0035FD897678}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {9738B023-FC46-48A2-953A-0035FD897678}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {305BAB2D-0D75-4FBC-8BCD-A2917392B48C}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {305BAB2D-0D75-4FBC-8BCD-A2917392B48C}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {305BAB2D-0D75-4FBC-8BCD-A2917392B48C}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {305BAB2D-0D75-4FBC-8BCD-A2917392B48C}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {305BAB2D-0D75-4FBC-8BCD-A2917392B48C}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {305BAB2D-0D75-4FBC-8BCD-A2917392B48C}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {305BAB2D-0D75-4FBC-8BCD-A2917392B48C}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {4421516D-10A6-41C1-ADF3-099573BBB0C6}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {4421516D-10A6-41C1-ADF3-099573BBB0C6}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {4421516D-10A6-41C1-ADF3-099573BBB0C6}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {4421516D-10A6-41C1-ADF3-099573BBB0C6}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {4421516D-10A6-41C1-ADF3-099573BBB0C6}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {4421516D-10A6-41C1-ADF3-099573BBB0C6}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {4421516D-10A6-41C1-ADF3-099573BBB0C6}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {4421516D-10A6-41C1-ADF3-099573BBB0C6}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {D8365C15-2166-4DB6-8A2D-1C8F0239EB18}.Debug Unicode|Win32.ActiveCfg = Debug|Win32 - {D8365C15-2166-4DB6-8A2D-1C8F0239EB18}.Debug Unicode|Win32.Build.0 = Debug|Win32 - {D8365C15-2166-4DB6-8A2D-1C8F0239EB18}.Debug Unicode|x64.ActiveCfg = Debug|x64 - {D8365C15-2166-4DB6-8A2D-1C8F0239EB18}.Debug Unicode|x64.Build.0 = Debug|x64 - {D8365C15-2166-4DB6-8A2D-1C8F0239EB18}.Release Unicode|Win32.ActiveCfg = Release|Win32 - {D8365C15-2166-4DB6-8A2D-1C8F0239EB18}.Release Unicode|Win32.Build.0 = Release|Win32 - {D8365C15-2166-4DB6-8A2D-1C8F0239EB18}.Release Unicode|x64.ActiveCfg = Release|x64 - {D8365C15-2166-4DB6-8A2D-1C8F0239EB18}.Release Unicode|x64.Build.0 = Release|x64 - {23E1898F-8262-435C-8848-D4D8824E6D71}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {23E1898F-8262-435C-8848-D4D8824E6D71}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {23E1898F-8262-435C-8848-D4D8824E6D71}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {23E1898F-8262-435C-8848-D4D8824E6D71}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {23E1898F-8262-435C-8848-D4D8824E6D71}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {23E1898F-8262-435C-8848-D4D8824E6D71}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {23E1898F-8262-435C-8848-D4D8824E6D71}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {23E1898F-8262-435C-8848-D4D8824E6D71}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {2FCD4B66-9CF9-4C8F-BC70-37CD20002D49}.Debug Unicode|Win32.ActiveCfg = Debug|Win32 - {2FCD4B66-9CF9-4C8F-BC70-37CD20002D49}.Debug Unicode|Win32.Build.0 = Debug|Win32 - {2FCD4B66-9CF9-4C8F-BC70-37CD20002D49}.Debug Unicode|x64.ActiveCfg = Debug|x64 - {2FCD4B66-9CF9-4C8F-BC70-37CD20002D49}.Debug Unicode|x64.Build.0 = Debug|x64 - {2FCD4B66-9CF9-4C8F-BC70-37CD20002D49}.Release Unicode|Win32.ActiveCfg = Release|Win32 - {2FCD4B66-9CF9-4C8F-BC70-37CD20002D49}.Release Unicode|Win32.Build.0 = Release|Win32 - {2FCD4B66-9CF9-4C8F-BC70-37CD20002D49}.Release Unicode|x64.ActiveCfg = Release|x64 - {2FCD4B66-9CF9-4C8F-BC70-37CD20002D49}.Release Unicode|x64.Build.0 = Release|x64 - {7FE0A205-3F39-4AC3-BC3C-C2D9E4D02475}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {7FE0A205-3F39-4AC3-BC3C-C2D9E4D02475}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {7FE0A205-3F39-4AC3-BC3C-C2D9E4D02475}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {7FE0A205-3F39-4AC3-BC3C-C2D9E4D02475}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {7FE0A205-3F39-4AC3-BC3C-C2D9E4D02475}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {7FE0A205-3F39-4AC3-BC3C-C2D9E4D02475}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {7FE0A205-3F39-4AC3-BC3C-C2D9E4D02475}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {7FE0A205-3F39-4AC3-BC3C-C2D9E4D02475}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {62FE6D94-E17C-4A8E-8D3C-7A589A70D865}.Debug Unicode|Win32.ActiveCfg = Debug|Win32 - {62FE6D94-E17C-4A8E-8D3C-7A589A70D865}.Debug Unicode|Win32.Build.0 = Debug|Win32 - {62FE6D94-E17C-4A8E-8D3C-7A589A70D865}.Debug Unicode|x64.ActiveCfg = Debug|x64 - {62FE6D94-E17C-4A8E-8D3C-7A589A70D865}.Debug Unicode|x64.Build.0 = Debug|x64 - {62FE6D94-E17C-4A8E-8D3C-7A589A70D865}.Release Unicode|Win32.ActiveCfg = Release|Win32 - {62FE6D94-E17C-4A8E-8D3C-7A589A70D865}.Release Unicode|Win32.Build.0 = Release|Win32 - {62FE6D94-E17C-4A8E-8D3C-7A589A70D865}.Release Unicode|x64.ActiveCfg = Release|x64 - {62FE6D94-E17C-4A8E-8D3C-7A589A70D865}.Release Unicode|x64.Build.0 = Release|x64 - {E776D3C2-5BFA-41B9-B998-A35B549AF737}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {E776D3C2-5BFA-41B9-B998-A35B549AF737}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {E776D3C2-5BFA-41B9-B998-A35B549AF737}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {E776D3C2-5BFA-41B9-B998-A35B549AF737}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {E776D3C2-5BFA-41B9-B998-A35B549AF737}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {E776D3C2-5BFA-41B9-B998-A35B549AF737}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {E776D3C2-5BFA-41B9-B998-A35B549AF737}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {E776D3C2-5BFA-41B9-B998-A35B549AF737}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {54F609FD-A8CE-43CF-94AD-23E877B97C13}.Debug Unicode|Win32.ActiveCfg = Debug|Win32 - {54F609FD-A8CE-43CF-94AD-23E877B97C13}.Debug Unicode|Win32.Build.0 = Debug|Win32 - {54F609FD-A8CE-43CF-94AD-23E877B97C13}.Debug Unicode|x64.ActiveCfg = Debug|x64 - {54F609FD-A8CE-43CF-94AD-23E877B97C13}.Debug Unicode|x64.Build.0 = Debug|x64 - {54F609FD-A8CE-43CF-94AD-23E877B97C13}.Release Unicode|Win32.ActiveCfg = Release|Win32 - {54F609FD-A8CE-43CF-94AD-23E877B97C13}.Release Unicode|Win32.Build.0 = Release|Win32 - {54F609FD-A8CE-43CF-94AD-23E877B97C13}.Release Unicode|x64.ActiveCfg = Release|x64 - {54F609FD-A8CE-43CF-94AD-23E877B97C13}.Release Unicode|x64.Build.0 = Release|x64 - {4628C665-EDE4-40D2-B525-32BE8B8551C8}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {4628C665-EDE4-40D2-B525-32BE8B8551C8}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {4628C665-EDE4-40D2-B525-32BE8B8551C8}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {4628C665-EDE4-40D2-B525-32BE8B8551C8}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {4628C665-EDE4-40D2-B525-32BE8B8551C8}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {4628C665-EDE4-40D2-B525-32BE8B8551C8}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {4628C665-EDE4-40D2-B525-32BE8B8551C8}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {4628C665-EDE4-40D2-B525-32BE8B8551C8}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {5EFCFACB-1835-422C-ACDA-E3B3A2F51387}.Debug Unicode|Win32.ActiveCfg = Debug|Win32 - {5EFCFACB-1835-422C-ACDA-E3B3A2F51387}.Debug Unicode|Win32.Build.0 = Debug|Win32 - {5EFCFACB-1835-422C-ACDA-E3B3A2F51387}.Debug Unicode|x64.ActiveCfg = Debug|x64 - {5EFCFACB-1835-422C-ACDA-E3B3A2F51387}.Debug Unicode|x64.Build.0 = Debug|x64 - {5EFCFACB-1835-422C-ACDA-E3B3A2F51387}.Release Unicode|Win32.ActiveCfg = Release|Win32 - {5EFCFACB-1835-422C-ACDA-E3B3A2F51387}.Release Unicode|Win32.Build.0 = Release|Win32 - {5EFCFACB-1835-422C-ACDA-E3B3A2F51387}.Release Unicode|x64.ActiveCfg = Release|x64 - {5EFCFACB-1835-422C-ACDA-E3B3A2F51387}.Release Unicode|x64.Build.0 = Release|x64 - {ECB1B3B7-196D-4809-A5E2-6F65CDBB6CCA}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {ECB1B3B7-196D-4809-A5E2-6F65CDBB6CCA}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {ECB1B3B7-196D-4809-A5E2-6F65CDBB6CCA}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {ECB1B3B7-196D-4809-A5E2-6F65CDBB6CCA}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {ECB1B3B7-196D-4809-A5E2-6F65CDBB6CCA}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {ECB1B3B7-196D-4809-A5E2-6F65CDBB6CCA}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {ECB1B3B7-196D-4809-A5E2-6F65CDBB6CCA}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {ECB1B3B7-196D-4809-A5E2-6F65CDBB6CCA}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {12BE3440-A1F3-4C48-A229-30CB619EA276}.Debug Unicode|Win32.ActiveCfg = Debug|Win32 - {12BE3440-A1F3-4C48-A229-30CB619EA276}.Debug Unicode|Win32.Build.0 = Debug|Win32 - {12BE3440-A1F3-4C48-A229-30CB619EA276}.Debug Unicode|x64.ActiveCfg = Debug|x64 - {12BE3440-A1F3-4C48-A229-30CB619EA276}.Debug Unicode|x64.Build.0 = Debug|x64 - {12BE3440-A1F3-4C48-A229-30CB619EA276}.Release Unicode|Win32.ActiveCfg = Release|Win32 - {12BE3440-A1F3-4C48-A229-30CB619EA276}.Release Unicode|Win32.Build.0 = Release|Win32 - {12BE3440-A1F3-4C48-A229-30CB619EA276}.Release Unicode|x64.ActiveCfg = Release|x64 - {12BE3440-A1F3-4C48-A229-30CB619EA276}.Release Unicode|x64.Build.0 = Release|x64 - {C0F7A036-FC2D-40DF-9852-C37518DB6B3E}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {C0F7A036-FC2D-40DF-9852-C37518DB6B3E}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {C0F7A036-FC2D-40DF-9852-C37518DB6B3E}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {C0F7A036-FC2D-40DF-9852-C37518DB6B3E}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {C0F7A036-FC2D-40DF-9852-C37518DB6B3E}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {C0F7A036-FC2D-40DF-9852-C37518DB6B3E}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {C0F7A036-FC2D-40DF-9852-C37518DB6B3E}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {C0F7A036-FC2D-40DF-9852-C37518DB6B3E}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {54DDA60F-E528-4D07-A152-960A1E818680}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {54DDA60F-E528-4D07-A152-960A1E818680}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {54DDA60F-E528-4D07-A152-960A1E818680}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {54DDA60F-E528-4D07-A152-960A1E818680}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {54DDA60F-E528-4D07-A152-960A1E818680}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {54DDA60F-E528-4D07-A152-960A1E818680}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {54DDA60F-E528-4D07-A152-960A1E818680}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {54DDA60F-E528-4D07-A152-960A1E818680}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {1E91F58C-0BAE-4021-8087-D1864D8EC066}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {1E91F58C-0BAE-4021-8087-D1864D8EC066}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {1E91F58C-0BAE-4021-8087-D1864D8EC066}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {1E91F58C-0BAE-4021-8087-D1864D8EC066}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {1E91F58C-0BAE-4021-8087-D1864D8EC066}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {1E91F58C-0BAE-4021-8087-D1864D8EC066}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {1E91F58C-0BAE-4021-8087-D1864D8EC066}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {1E91F58C-0BAE-4021-8087-D1864D8EC066}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {DB5F93B2-54D0-4474-A588-D259BE36C832}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {DB5F93B2-54D0-4474-A588-D259BE36C832}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {DB5F93B2-54D0-4474-A588-D259BE36C832}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {DB5F93B2-54D0-4474-A588-D259BE36C832}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {DB5F93B2-54D0-4474-A588-D259BE36C832}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {DB5F93B2-54D0-4474-A588-D259BE36C832}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {DB5F93B2-54D0-4474-A588-D259BE36C832}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {DB5F93B2-54D0-4474-A588-D259BE36C832}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {65361C7C-83D6-42E4-870C-4DC85AE641FE}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {65361C7C-83D6-42E4-870C-4DC85AE641FE}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {65361C7C-83D6-42E4-870C-4DC85AE641FE}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {65361C7C-83D6-42E4-870C-4DC85AE641FE}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {65361C7C-83D6-42E4-870C-4DC85AE641FE}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {65361C7C-83D6-42E4-870C-4DC85AE641FE}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {65361C7C-83D6-42E4-870C-4DC85AE641FE}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {65361C7C-83D6-42E4-870C-4DC85AE641FE}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {8F998497-9C51-4FAA-83E4-1D85B22CBA13}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {8F998497-9C51-4FAA-83E4-1D85B22CBA13}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {8F998497-9C51-4FAA-83E4-1D85B22CBA13}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {8F998497-9C51-4FAA-83E4-1D85B22CBA13}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {8F998497-9C51-4FAA-83E4-1D85B22CBA13}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {8F998497-9C51-4FAA-83E4-1D85B22CBA13}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {8F998497-9C51-4FAA-83E4-1D85B22CBA13}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {8F998497-9C51-4FAA-83E4-1D85B22CBA13}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {9ED4B036-7399-4128-868D-6E71188E0277}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {9ED4B036-7399-4128-868D-6E71188E0277}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {9ED4B036-7399-4128-868D-6E71188E0277}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {9ED4B036-7399-4128-868D-6E71188E0277}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {9ED4B036-7399-4128-868D-6E71188E0277}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {9ED4B036-7399-4128-868D-6E71188E0277}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {9ED4B036-7399-4128-868D-6E71188E0277}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {9ED4B036-7399-4128-868D-6E71188E0277}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {3020FF9B-8202-488D-B137-11DECC510E6E}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {3020FF9B-8202-488D-B137-11DECC510E6E}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {3020FF9B-8202-488D-B137-11DECC510E6E}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {3020FF9B-8202-488D-B137-11DECC510E6E}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {3020FF9B-8202-488D-B137-11DECC510E6E}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {3020FF9B-8202-488D-B137-11DECC510E6E}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {3020FF9B-8202-488D-B137-11DECC510E6E}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {3020FF9B-8202-488D-B137-11DECC510E6E}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {273B3149-3192-4B75-A791-470320B90812}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {273B3149-3192-4B75-A791-470320B90812}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {273B3149-3192-4B75-A791-470320B90812}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {273B3149-3192-4B75-A791-470320B90812}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {273B3149-3192-4B75-A791-470320B90812}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {273B3149-3192-4B75-A791-470320B90812}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {273B3149-3192-4B75-A791-470320B90812}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {273B3149-3192-4B75-A791-470320B90812}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {E62223EF-8263-41EB-8174-CD78BBEEF368}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {E62223EF-8263-41EB-8174-CD78BBEEF368}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {E62223EF-8263-41EB-8174-CD78BBEEF368}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {E62223EF-8263-41EB-8174-CD78BBEEF368}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {E62223EF-8263-41EB-8174-CD78BBEEF368}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {E62223EF-8263-41EB-8174-CD78BBEEF368}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {E62223EF-8263-41EB-8174-CD78BBEEF368}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {E62223EF-8263-41EB-8174-CD78BBEEF368}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {A7134255-DFF3-42F7-9BC2-FAC6E71CFFAE}.Debug Unicode|Win32.ActiveCfg = Debug|Win32 - {A7134255-DFF3-42F7-9BC2-FAC6E71CFFAE}.Debug Unicode|Win32.Build.0 = Debug|Win32 - {A7134255-DFF3-42F7-9BC2-FAC6E71CFFAE}.Debug Unicode|x64.ActiveCfg = Debug|x64 - {A7134255-DFF3-42F7-9BC2-FAC6E71CFFAE}.Debug Unicode|x64.Build.0 = Debug|x64 - {A7134255-DFF3-42F7-9BC2-FAC6E71CFFAE}.Release Unicode|Win32.ActiveCfg = Release|Win32 - {A7134255-DFF3-42F7-9BC2-FAC6E71CFFAE}.Release Unicode|Win32.Build.0 = Release|Win32 - {A7134255-DFF3-42F7-9BC2-FAC6E71CFFAE}.Release Unicode|x64.ActiveCfg = Release|x64 - {A7134255-DFF3-42F7-9BC2-FAC6E71CFFAE}.Release Unicode|x64.Build.0 = Release|x64 - {CC07B80F-D44F-41A9-9E37-5F2B47B46EDC}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {CC07B80F-D44F-41A9-9E37-5F2B47B46EDC}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {CC07B80F-D44F-41A9-9E37-5F2B47B46EDC}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {CC07B80F-D44F-41A9-9E37-5F2B47B46EDC}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {CC07B80F-D44F-41A9-9E37-5F2B47B46EDC}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {CC07B80F-D44F-41A9-9E37-5F2B47B46EDC}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {CC07B80F-D44F-41A9-9E37-5F2B47B46EDC}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {CC07B80F-D44F-41A9-9E37-5F2B47B46EDC}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Debug Unicode|x64.ActiveCfg = Debug Unicode|x64 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Debug Unicode|x64.Build.0 = Debug Unicode|x64 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Release Unicode|Win32.Build.0 = Release Unicode|Win32 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Release Unicode|x64.ActiveCfg = Release Unicode|x64 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Release Unicode|x64.Build.0 = Release Unicode|x64 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Debug Unicode|x64.ActiveCfg = Debug Unicode|x64 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Debug Unicode|x64.Build.0 = Debug Unicode|x64 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Release Unicode|Win32.Build.0 = Release Unicode|Win32 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Release Unicode|x64.ActiveCfg = Release Unicode|x64 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Release Unicode|x64.Build.0 = Release Unicode|x64 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Debug Unicode|x64.ActiveCfg = Debug Unicode|x64 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Debug Unicode|x64.Build.0 = Debug Unicode|x64 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Release Unicode|Win32.Build.0 = Release Unicode|Win32 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Release Unicode|x64.ActiveCfg = Release Unicode|x64 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Release Unicode|x64.Build.0 = Release Unicode|x64 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Debug Unicode|x64.ActiveCfg = Debug Unicode|x64 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Debug Unicode|x64.Build.0 = Debug Unicode|x64 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Release Unicode|Win32.Build.0 = Release Unicode|Win32 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Release Unicode|x64.ActiveCfg = Release Unicode|x64 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Release Unicode|x64.Build.0 = Release Unicode|x64 - {FC8080D1-603C-45EC-BCFA-7172E2F3D989}.Debug Unicode|Win32.ActiveCfg = Debug|Win32 - {FC8080D1-603C-45EC-BCFA-7172E2F3D989}.Debug Unicode|Win32.Build.0 = Debug|Win32 - {FC8080D1-603C-45EC-BCFA-7172E2F3D989}.Debug Unicode|x64.ActiveCfg = Debug|x64 - {FC8080D1-603C-45EC-BCFA-7172E2F3D989}.Debug Unicode|x64.Build.0 = Debug|x64 - {FC8080D1-603C-45EC-BCFA-7172E2F3D989}.Release Unicode|Win32.ActiveCfg = Release|Win32 - {FC8080D1-603C-45EC-BCFA-7172E2F3D989}.Release Unicode|Win32.Build.0 = Release|Win32 - {FC8080D1-603C-45EC-BCFA-7172E2F3D989}.Release Unicode|x64.ActiveCfg = Release|x64 - {FC8080D1-603C-45EC-BCFA-7172E2F3D989}.Release Unicode|x64.Build.0 = Release|x64 - {DD9D2D92-2241-408A-859E-B85D444B7E3C}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32 - {DD9D2D92-2241-408A-859E-B85D444B7E3C}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32 - {DD9D2D92-2241-408A-859E-B85D444B7E3C}.Debug Unicode|x64.ActiveCfg = Debug Unicode|x64 - {DD9D2D92-2241-408A-859E-B85D444B7E3C}.Debug Unicode|x64.Build.0 = Debug Unicode|x64 - {DD9D2D92-2241-408A-859E-B85D444B7E3C}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32 - {DD9D2D92-2241-408A-859E-B85D444B7E3C}.Release Unicode|Win32.Build.0 = Release Unicode|Win32 - {DD9D2D92-2241-408A-859E-B85D444B7E3C}.Release Unicode|x64.ActiveCfg = Release Unicode|x64 - {DD9D2D92-2241-408A-859E-B85D444B7E3C}.Release Unicode|x64.Build.0 = Release Unicode|x64 - {5E56335F-0FB1-4EEA-B240-D8DC5E0608E4}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32 - {5E56335F-0FB1-4EEA-B240-D8DC5E0608E4}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32 - {5E56335F-0FB1-4EEA-B240-D8DC5E0608E4}.Debug Unicode|x64.ActiveCfg = Debug Unicode|x64 - {5E56335F-0FB1-4EEA-B240-D8DC5E0608E4}.Debug Unicode|x64.Build.0 = Debug Unicode|x64 - {5E56335F-0FB1-4EEA-B240-D8DC5E0608E4}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32 - {5E56335F-0FB1-4EEA-B240-D8DC5E0608E4}.Release Unicode|Win32.Build.0 = Release Unicode|Win32 - {5E56335F-0FB1-4EEA-B240-D8DC5E0608E4}.Release Unicode|x64.ActiveCfg = Release Unicode|x64 - {5E56335F-0FB1-4EEA-B240-D8DC5E0608E4}.Release Unicode|x64.Build.0 = Release Unicode|x64 - {1A2DFD1A-3C6C-44D1-909D-294AF646B575}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32 - {1A2DFD1A-3C6C-44D1-909D-294AF646B575}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32 - {1A2DFD1A-3C6C-44D1-909D-294AF646B575}.Debug Unicode|x64.ActiveCfg = Debug Unicode|x64 - {1A2DFD1A-3C6C-44D1-909D-294AF646B575}.Debug Unicode|x64.Build.0 = Debug Unicode|x64 - {1A2DFD1A-3C6C-44D1-909D-294AF646B575}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32 - {1A2DFD1A-3C6C-44D1-909D-294AF646B575}.Release Unicode|Win32.Build.0 = Release Unicode|Win32 - {1A2DFD1A-3C6C-44D1-909D-294AF646B575}.Release Unicode|x64.ActiveCfg = Release Unicode|x64 - {1A2DFD1A-3C6C-44D1-909D-294AF646B575}.Release Unicode|x64.Build.0 = Release Unicode|x64 - {FC70988B-1AE5-4381-866D-4F405E28AC42}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32 - {FC70988B-1AE5-4381-866D-4F405E28AC42}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32 - {FC70988B-1AE5-4381-866D-4F405E28AC42}.Debug Unicode|x64.ActiveCfg = Debug Unicode|x64 - {FC70988B-1AE5-4381-866D-4F405E28AC42}.Debug Unicode|x64.Build.0 = Debug Unicode|x64 - {FC70988B-1AE5-4381-866D-4F405E28AC42}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32 - {FC70988B-1AE5-4381-866D-4F405E28AC42}.Release Unicode|Win32.Build.0 = Release Unicode|Win32 - {FC70988B-1AE5-4381-866D-4F405E28AC42}.Release Unicode|x64.ActiveCfg = Release Unicode|x64 - {FC70988B-1AE5-4381-866D-4F405E28AC42}.Release Unicode|x64.Build.0 = Release Unicode|x64 - {8CE7E5D0-C821-47AC-A247-28EC95B34670}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32 - {8CE7E5D0-C821-47AC-A247-28EC95B34670}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32 - {8CE7E5D0-C821-47AC-A247-28EC95B34670}.Debug Unicode|x64.ActiveCfg = Debug Unicode|x64 - {8CE7E5D0-C821-47AC-A247-28EC95B34670}.Debug Unicode|x64.Build.0 = Debug Unicode|x64 - {8CE7E5D0-C821-47AC-A247-28EC95B34670}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32 - {8CE7E5D0-C821-47AC-A247-28EC95B34670}.Release Unicode|Win32.Build.0 = Release Unicode|Win32 - {8CE7E5D0-C821-47AC-A247-28EC95B34670}.Release Unicode|x64.ActiveCfg = Release Unicode|x64 - {8CE7E5D0-C821-47AC-A247-28EC95B34670}.Release Unicode|x64.Build.0 = Release Unicode|x64 - {D514EA4D-EAFB-47A9-A437-A582CA571251}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32 - {D514EA4D-EAFB-47A9-A437-A582CA571251}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32 - {D514EA4D-EAFB-47A9-A437-A582CA571251}.Debug Unicode|x64.ActiveCfg = Debug Unicode|x64 - {D514EA4D-EAFB-47A9-A437-A582CA571251}.Debug Unicode|x64.Build.0 = Debug Unicode|x64 - {D514EA4D-EAFB-47A9-A437-A582CA571251}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32 - {D514EA4D-EAFB-47A9-A437-A582CA571251}.Release Unicode|Win32.Build.0 = Release Unicode|Win32 - {D514EA4D-EAFB-47A9-A437-A582CA571251}.Release Unicode|x64.ActiveCfg = Release Unicode|x64 - {D514EA4D-EAFB-47A9-A437-A582CA571251}.Release Unicode|x64.Build.0 = Release Unicode|x64 - {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {4909B0ED-CC22-4509-ACD0-FB60C4FC73ED} = {F127F305-5EF5-4B69-B35F-8B30021B175D} - {02DAA1A6-31C8-4002-89FE-50BF53752244} = {F127F305-5EF5-4B69-B35F-8B30021B175D} - {683639C3-F209-4EF8-B6CC-8741C61EDECF} = {F127F305-5EF5-4B69-B35F-8B30021B175D} - {F9F42BF2-3F13-4654-82C5-E27B8879EC4E} = {F127F305-5EF5-4B69-B35F-8B30021B175D} - {49B5BAE3-749C-414C-80CC-A756DD548CE3} = {F127F305-5EF5-4B69-B35F-8B30021B175D} - {D626CC4F-BFB1-4030-8DD8-1A3A1D41248E} = {F127F305-5EF5-4B69-B35F-8B30021B175D} - {69C0E434-3B73-400A-A1B7-A887C10BECCA} = {F127F305-5EF5-4B69-B35F-8B30021B175D} - {4D3B4FF4-535A-4201-AB7D-9AEC1E737A95} = {4909B0ED-CC22-4509-ACD0-FB60C4FC73ED} - {664E726B-EEEE-403A-AC15-345D9C9E1375} = {4909B0ED-CC22-4509-ACD0-FB60C4FC73ED} - {3020FF9B-8202-488D-B137-11DECC510E6E} = {4909B0ED-CC22-4509-ACD0-FB60C4FC73ED} - {9F31D122-E84D-485A-A58D-09DAD01A56CE} = {4909B0ED-CC22-4509-ACD0-FB60C4FC73ED} - {543D40E9-8CA6-4E4B-9936-90CBA562B268} = {4909B0ED-CC22-4509-ACD0-FB60C4FC73ED} - {431DD5B6-3F2F-47EE-A23F-514BC044B704} = {02DAA1A6-31C8-4002-89FE-50BF53752244} - {F50E74C2-5BE7-4C9B-B1E7-6CA19CFAD34E} = {02DAA1A6-31C8-4002-89FE-50BF53752244} - {30D48874-899F-41C6-9B26-A40C96C91102} = {02DAA1A6-31C8-4002-89FE-50BF53752244} - {42B599D7-BB84-481F-A42A-2DBE0E2E2D7E} = {02DAA1A6-31C8-4002-89FE-50BF53752244} - {8F998497-9C51-4FAA-83E4-1D85B22CBA13} = {02DAA1A6-31C8-4002-89FE-50BF53752244} - {83CC6B88-A112-4192-BD5A-F2A249AF2277} = {02DAA1A6-31C8-4002-89FE-50BF53752244} - {D8DB3E7E-D50E-4EC3-A9B9-DAD18F5FE466} = {683639C3-F209-4EF8-B6CC-8741C61EDECF} - {9DCFD02A-16A0-4766-BC18-66163E21929D} = {F9F42BF2-3F13-4654-82C5-E27B8879EC4E} - {F6B06383-3FFD-403B-9867-4AA82A20AA83} = {F9F42BF2-3F13-4654-82C5-E27B8879EC4E} - {305BAB2D-0D75-4FBC-8BCD-A2917392B48C} = {F9F42BF2-3F13-4654-82C5-E27B8879EC4E} - {4421516D-10A6-41C1-ADF3-099573BBB0C6} = {F9F42BF2-3F13-4654-82C5-E27B8879EC4E} - {54DDA60F-E528-4D07-A152-960A1E818680} = {F9F42BF2-3F13-4654-82C5-E27B8879EC4E} - {339A4575-E25B-45D6-94A1-D835891740B8} = {F9F42BF2-3F13-4654-82C5-E27B8879EC4E} - {67827491-8162-4039-9132-F934ABC836A0} = {49B5BAE3-749C-414C-80CC-A756DD548CE3} - {DB5F93B2-54D0-4474-A588-D259BE36C832} = {49B5BAE3-749C-414C-80CC-A756DD548CE3} - {65361C7C-83D6-42E4-870C-4DC85AE641FE} = {49B5BAE3-749C-414C-80CC-A756DD548CE3} - {EB202B68-8029-4985-B914-E94B44D2E230} = {49B5BAE3-749C-414C-80CC-A756DD548CE3} - {3F5EA225-F4B7-4413-AEB3-4E4E5751E438} = {D626CC4F-BFB1-4030-8DD8-1A3A1D41248E} - {53CF9195-19DB-457D-8F55-8DB1706DFA84} = {D626CC4F-BFB1-4030-8DD8-1A3A1D41248E} - {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} = {D626CC4F-BFB1-4030-8DD8-1A3A1D41248E} - {9738B023-FC46-48A2-953A-0035FD897678} = {D626CC4F-BFB1-4030-8DD8-1A3A1D41248E} - {23E1898F-8262-435C-8848-D4D8824E6D71} = {D626CC4F-BFB1-4030-8DD8-1A3A1D41248E} - {7FE0A205-3F39-4AC3-BC3C-C2D9E4D02475} = {D626CC4F-BFB1-4030-8DD8-1A3A1D41248E} - {E776D3C2-5BFA-41B9-B998-A35B549AF737} = {D626CC4F-BFB1-4030-8DD8-1A3A1D41248E} - {4628C665-EDE4-40D2-B525-32BE8B8551C8} = {D626CC4F-BFB1-4030-8DD8-1A3A1D41248E} - {ECB1B3B7-196D-4809-A5E2-6F65CDBB6CCA} = {D626CC4F-BFB1-4030-8DD8-1A3A1D41248E} - {C0F7A036-FC2D-40DF-9852-C37518DB6B3E} = {D626CC4F-BFB1-4030-8DD8-1A3A1D41248E} - {1E91F58C-0BAE-4021-8087-D1864D8EC066} = {D626CC4F-BFB1-4030-8DD8-1A3A1D41248E} - {9ED4B036-7399-4128-868D-6E71188E0277} = {D626CC4F-BFB1-4030-8DD8-1A3A1D41248E} - {E62223EF-8263-41EB-8174-CD78BBEEF368} = {D626CC4F-BFB1-4030-8DD8-1A3A1D41248E} - {CC07B80F-D44F-41A9-9E37-5F2B47B46EDC} = {D626CC4F-BFB1-4030-8DD8-1A3A1D41248E} - {AE399B7E-2B2C-4A96-9016-C5C74B0A2FA0} = {D626CC4F-BFB1-4030-8DD8-1A3A1D41248E} - {2FCD4B66-9CF9-4C8F-BC70-37CD20002D49} = {69C0E434-3B73-400A-A1B7-A887C10BECCA} - {62FE6D94-E17C-4A8E-8D3C-7A589A70D865} = {69C0E434-3B73-400A-A1B7-A887C10BECCA} - {54F609FD-A8CE-43CF-94AD-23E877B97C13} = {69C0E434-3B73-400A-A1B7-A887C10BECCA} - {5EFCFACB-1835-422C-ACDA-E3B3A2F51387} = {69C0E434-3B73-400A-A1B7-A887C10BECCA} - {12BE3440-A1F3-4C48-A229-30CB619EA276} = {69C0E434-3B73-400A-A1B7-A887C10BECCA} - {273B3149-3192-4B75-A791-470320B90812} = {69C0E434-3B73-400A-A1B7-A887C10BECCA} - {A7134255-DFF3-42F7-9BC2-FAC6E71CFFAE} = {69C0E434-3B73-400A-A1B7-A887C10BECCA} - {D8365C15-2166-4DB6-8A2D-1C8F0239EB18} = {69C0E434-3B73-400A-A1B7-A887C10BECCA} - {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA} = {69C0E434-3B73-400A-A1B7-A887C10BECCA} - {D9A0529B-9EC4-4D30-9E05-A5D533739D95} = {A21F07E6-A891-479C-98EA-EDB58CE4EFAB} - {2913B7E4-7A8B-43D5-A60B-345A0782816A} = {A21F07E6-A891-479C-98EA-EDB58CE4EFAB} - {8CE7E5D0-C821-47AC-A247-28EC95B34670} = {A21F07E6-A891-479C-98EA-EDB58CE4EFAB} - {FC8080D1-603C-45EC-BCFA-7172E2F3D989} = {D9A0529B-9EC4-4D30-9E05-A5D533739D95} - {DD9D2D92-2241-408A-859E-B85D444B7E3C} = {D9A0529B-9EC4-4D30-9E05-A5D533739D95} - {5E56335F-0FB1-4EEA-B240-D8DC5E0608E4} = {D9A0529B-9EC4-4D30-9E05-A5D533739D95} - {1A2DFD1A-3C6C-44D1-909D-294AF646B575} = {D9A0529B-9EC4-4D30-9E05-A5D533739D95} - {FC70988B-1AE5-4381-866D-4F405E28AC42} = {D9A0529B-9EC4-4D30-9E05-A5D533739D95} - {D514EA4D-EAFB-47A9-A437-A582CA571251} = {D9A0529B-9EC4-4D30-9E05-A5D533739D95} - {03208025-D5C2-426A-B0FA-251D4338F30C} = {2913B7E4-7A8B-43D5-A60B-345A0782816A} - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0} = {2913B7E4-7A8B-43D5-A60B-345A0782816A} - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F} = {2913B7E4-7A8B-43D5-A60B-345A0782816A} - {AB494732-EF6D-44D0-BCF8-80FF04858D10} = {2913B7E4-7A8B-43D5-A60B-345A0782816A} - EndGlobalSection -EndGlobal diff --git a/mpc_vs2008.sln b/mpc_vs2008.sln deleted file mode 100644 index cd28649fe..000000000 --- a/mpc_vs2008.sln +++ /dev/null @@ -1,849 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Apps", "Apps", "{A21F07E6-A891-479C-98EA-EDB58CE4EFAB}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mplayerc", "src\apps\mplayerc\mplayerc_vs2008.vcproj", "{8CE7E5D0-C821-47AC-A247-28EC95B34670}" - ProjectSection(ProjectDependencies) = postProject - {7FE0A205-3F39-4AC3-BC3C-C2D9E4D02475} = {7FE0A205-3F39-4AC3-BC3C-C2D9E4D02475} - {54DDA60F-E528-4D07-A152-960A1E818680} = {54DDA60F-E528-4D07-A152-960A1E818680} - {CC07B80F-D44F-41A9-9E37-5F2B47B46EDC} = {CC07B80F-D44F-41A9-9E37-5F2B47B46EDC} - {D8365C15-2166-4DB6-8A2D-1C8F0239EB18} = {D8365C15-2166-4DB6-8A2D-1C8F0239EB18} - {1A2DFD1A-3C6C-44D1-909D-294AF646B575} = {1A2DFD1A-3C6C-44D1-909D-294AF646B575} - {9F31D122-E84D-485A-A58D-09DAD01A56CE} = {9F31D122-E84D-485A-A58D-09DAD01A56CE} - {9738B023-FC46-48A2-953A-0035FD897678} = {9738B023-FC46-48A2-953A-0035FD897678} - {03208025-D5C2-426A-B0FA-251D4338F30C} = {03208025-D5C2-426A-B0FA-251D4338F30C} - {3F5EA225-F4B7-4413-AEB3-4E4E5751E438} = {3F5EA225-F4B7-4413-AEB3-4E4E5751E438} - {9DCFD02A-16A0-4766-BC18-66163E21929D} = {9DCFD02A-16A0-4766-BC18-66163E21929D} - {AB494732-EF6D-44D0-BCF8-80FF04858D10} = {AB494732-EF6D-44D0-BCF8-80FF04858D10} - {C0F7A036-FC2D-40DF-9852-C37518DB6B3E} = {C0F7A036-FC2D-40DF-9852-C37518DB6B3E} - {9ED4B036-7399-4128-868D-6E71188E0277} = {9ED4B036-7399-4128-868D-6E71188E0277} - {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} = {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} - {12BE3440-A1F3-4C48-A229-30CB619EA276} = {12BE3440-A1F3-4C48-A229-30CB619EA276} - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - {D514EA4D-EAFB-47A9-A437-A582CA571251} = {D514EA4D-EAFB-47A9-A437-A582CA571251} - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F} = {61E6EB4D-2F1A-443B-94B0-E8200B26E99F} - {A7134255-DFF3-42F7-9BC2-FAC6E71CFFAE} = {A7134255-DFF3-42F7-9BC2-FAC6E71CFFAE} - {5E56335F-0FB1-4EEA-B240-D8DC5E0608E4} = {5E56335F-0FB1-4EEA-B240-D8DC5E0608E4} - {4628C665-EDE4-40D2-B525-32BE8B8551C8} = {4628C665-EDE4-40D2-B525-32BE8B8551C8} - {2FCD4B66-9CF9-4C8F-BC70-37CD20002D49} = {2FCD4B66-9CF9-4C8F-BC70-37CD20002D49} - {EB202B68-8029-4985-B914-E94B44D2E230} = {EB202B68-8029-4985-B914-E94B44D2E230} - {664E726B-EEEE-403A-AC15-345D9C9E1375} = {664E726B-EEEE-403A-AC15-345D9C9E1375} - {4421516D-10A6-41C1-ADF3-099573BBB0C6} = {4421516D-10A6-41C1-ADF3-099573BBB0C6} - {30D48874-899F-41C6-9B26-A40C96C91102} = {30D48874-899F-41C6-9B26-A40C96C91102} - {339A4575-E25B-45D6-94A1-D835891740B8} = {339A4575-E25B-45D6-94A1-D835891740B8} - {65361C7C-83D6-42E4-870C-4DC85AE641FE} = {65361C7C-83D6-42E4-870C-4DC85AE641FE} - {D8DB3E7E-D50E-4EC3-A9B9-DAD18F5FE466} = {D8DB3E7E-D50E-4EC3-A9B9-DAD18F5FE466} - {AE399B7E-2B2C-4A96-9016-C5C74B0A2FA0} = {AE399B7E-2B2C-4A96-9016-C5C74B0A2FA0} - {F6B06383-3FFD-403B-9867-4AA82A20AA83} = {F6B06383-3FFD-403B-9867-4AA82A20AA83} - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0} = {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0} - {FC70988B-1AE5-4381-866D-4F405E28AC42} = {FC70988B-1AE5-4381-866D-4F405E28AC42} - {1E91F58C-0BAE-4021-8087-D1864D8EC066} = {1E91F58C-0BAE-4021-8087-D1864D8EC066} - {23E1898F-8262-435C-8848-D4D8824E6D71} = {23E1898F-8262-435C-8848-D4D8824E6D71} - {67827491-8162-4039-9132-F934ABC836A0} = {67827491-8162-4039-9132-F934ABC836A0} - {DD9D2D92-2241-408A-859E-B85D444B7E3C} = {DD9D2D92-2241-408A-859E-B85D444B7E3C} - {62FE6D94-E17C-4A8E-8D3C-7A589A70D865} = {62FE6D94-E17C-4A8E-8D3C-7A589A70D865} - {53CF9195-19DB-457D-8F55-8DB1706DFA84} = {53CF9195-19DB-457D-8F55-8DB1706DFA84} - {8F998497-9C51-4FAA-83E4-1D85B22CBA13} = {8F998497-9C51-4FAA-83E4-1D85B22CBA13} - {DB5F93B2-54D0-4474-A588-D259BE36C832} = {DB5F93B2-54D0-4474-A588-D259BE36C832} - {431DD5B6-3F2F-47EE-A23F-514BC044B704} = {431DD5B6-3F2F-47EE-A23F-514BC044B704} - {ECB1B3B7-196D-4809-A5E2-6F65CDBB6CCA} = {ECB1B3B7-196D-4809-A5E2-6F65CDBB6CCA} - {F50E74C2-5BE7-4C9B-B1E7-6CA19CFAD34E} = {F50E74C2-5BE7-4C9B-B1E7-6CA19CFAD34E} - {E776D3C2-5BFA-41B9-B998-A35B549AF737} = {E776D3C2-5BFA-41B9-B998-A35B549AF737} - {5EFCFACB-1835-422C-ACDA-E3B3A2F51387} = {5EFCFACB-1835-422C-ACDA-E3B3A2F51387} - {FC8080D1-603C-45EC-BCFA-7172E2F3D989} = {FC8080D1-603C-45EC-BCFA-7172E2F3D989} - {42B599D7-BB84-481F-A42A-2DBE0E2E2D7E} = {42B599D7-BB84-481F-A42A-2DBE0E2E2D7E} - {543D40E9-8CA6-4E4B-9936-90CBA562B268} = {543D40E9-8CA6-4E4B-9936-90CBA562B268} - {E62223EF-8263-41EB-8174-CD78BBEEF368} = {E62223EF-8263-41EB-8174-CD78BBEEF368} - {4D3B4FF4-535A-4201-AB7D-9AEC1E737A95} = {4D3B4FF4-535A-4201-AB7D-9AEC1E737A95} - {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA} = {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA} - {54F609FD-A8CE-43CF-94AD-23E877B97C13} = {54F609FD-A8CE-43CF-94AD-23E877B97C13} - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Libraries", "Libraries", "{D9A0529B-9EC4-4D30-9E05-A5D533739D95}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "decss", "src\decss\decss_vs2008.vcproj", "{1A2DFD1A-3C6C-44D1-909D-294AF646B575}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dsutil", "src\dsutil\dsutil_vs2008.vcproj", "{FC70988B-1AE5-4381-866D-4F405E28AC42}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpng", "src\libpng\libpng_vs2008.vcproj", "{FC8080D1-603C-45EC-BCFA-7172E2F3D989}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libssf", "src\subtitles\libssf\libssf_vs2008.vcproj", "{DD9D2D92-2241-408A-859E-B85D444B7E3C}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "subpic", "src\subpic\subpic_vs2008.vcproj", "{D514EA4D-EAFB-47A9-A437-A582CA571251}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "subtitles", "src\subtitles\subtitles_vs2008.vcproj", "{5E56335F-0FB1-4EEA-B240-D8DC5E0608E4}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "UI", "UI", "{2913B7E4-7A8B-43D5-A60B-345A0782816A}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CmdUI", "src\ui\CmdUI\CmdUI_vs2008.vcproj", "{03208025-D5C2-426A-B0FA-251D4338F30C}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ResizableLib", "src\ui\ResizableLib\ResizableLib_vs2008.vcproj", "{4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sizecbar", "src\ui\sizecbar\sizecbar_vs2008.vcproj", "{61E6EB4D-2F1A-443B-94B0-E8200B26E99F}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TreePropSheet", "src\ui\TreePropSheet\TreePropSheet_vs2008.vcproj", "{AB494732-EF6D-44D0-BCF8-80FF04858D10}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Filters", "Filters", "{F127F305-5EF5-4B69-B35F-8B30021B175D}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Libraries", "Libraries", "{69C0E434-3B73-400A-A1B7-A887C10BECCA}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BaseClasses", "src\filters\BaseClasses\baseclasses_vs2008.vcproj", "{E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "filters", "src\filters\filters_vs2008.vcproj", "{273B3149-3192-4B75-A791-470320B90812}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "liba52", "src\filters\transform\mpadecfilter\a52dec-0.7.4\vc++\liba52_vs2008.vcproj", "{62FE6D94-E17C-4A8E-8D3C-7A589A70D865}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libdirac", "src\filters\parser\diracsplitter\libdirac\libdirac_vs2008.vcproj", "{12BE3440-A1F3-4C48-A229-30CB619EA276}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libdts", "src\filters\transform\mpadecfilter\dtsdec-0.0.1\vc++\libdts_vs2008.vcproj", "{54F609FD-A8CE-43CF-94AD-23E877B97C13}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libfaad", "src\filters\transform\mpadecfilter\faad2\libfaad\libfaad_vs2008.vcproj", "{5EFCFACB-1835-422C-ACDA-E3B3A2F51387}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmad", "src\filters\transform\mpadecfilter\libmad-0.15.0b\msvc++\libmad_vs2008.vcproj", "{D8365C15-2166-4DB6-8A2D-1C8F0239EB18}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libvorbisidec", "src\filters\transform\mpadecfilter\libvorbisidec\libvorbisidec_vs2008.vcproj", "{A7134255-DFF3-42F7-9BC2-FAC6E71CFFAE}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib", "src\zlib\zlib_vs2008.vcproj", "{2FCD4B66-9CF9-4C8F-BC70-37CD20002D49}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Muxer", "Muxer", "{49B5BAE3-749C-414C-80CC-A756DD548CE3}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BaseMuxer", "src\filters\muxer\basemuxer\BaseMuxer_vs2008.vcproj", "{DB5F93B2-54D0-4474-A588-D259BE36C832}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DSMMuxer", "src\filters\muxer\dsmmuxer\DSMMuxer_vs2008.vcproj", "{65361C7C-83D6-42E4-870C-4DC85AE641FE}" - ProjectSection(ProjectDependencies) = postProject - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - {DB5F93B2-54D0-4474-A588-D259BE36C832} = {DB5F93B2-54D0-4474-A588-D259BE36C832} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MatroskaMuxer", "src\filters\muxer\matroskamuxer\MatroskaMuxer_vs2008.vcproj", "{67827491-8162-4039-9132-F934ABC836A0}" - ProjectSection(ProjectDependencies) = postProject - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wavdest", "src\filters\muxer\wavdest\wavdest_vs2008.vcproj", "{EB202B68-8029-4985-B914-E94B44D2E230}" - ProjectSection(ProjectDependencies) = postProject - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Parser", "Parser", "{D626CC4F-BFB1-4030-8DD8-1A3A1D41248E}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AviSplitter", "src\filters\parser\avisplitter\AviSplitter_vs2008.vcproj", "{9738B023-FC46-48A2-953A-0035FD897678}" - ProjectSection(ProjectDependencies) = postProject - {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} = {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "basesplitter", "src\filters\parser\basesplitter\basesplitter_vs2008.vcproj", "{37768B3F-89BC-4C16-B2A8-767C5DA84C3F}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DiracSplitter", "src\filters\parser\diracsplitter\DiracSplitter_vs2008.vcproj", "{ECB1B3B7-196D-4809-A5E2-6F65CDBB6CCA}" - ProjectSection(ProjectDependencies) = postProject - {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} = {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} - {12BE3440-A1F3-4C48-A229-30CB619EA276} = {12BE3440-A1F3-4C48-A229-30CB619EA276} - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DSMSplitter", "src\filters\parser\dsmsplitter\DSMSplitter_vs2008.vcproj", "{1E91F58C-0BAE-4021-8087-D1864D8EC066}" - ProjectSection(ProjectDependencies) = postProject - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FLVSplitter", "src\filters\parser\flvsplitter\FLVSplitter_vs2008.vcproj", "{E62223EF-8263-41EB-8174-CD78BBEEF368}" - ProjectSection(ProjectDependencies) = postProject - {54DDA60F-E528-4D07-A152-960A1E818680} = {54DDA60F-E528-4D07-A152-960A1E818680} - {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} = {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MatroskaSplitter", "src\filters\parser\matroskasplitter\MatroskaSplitter_vs2008.vcproj", "{3F5EA225-F4B7-4413-AEB3-4E4E5751E438}" - ProjectSection(ProjectDependencies) = postProject - {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} = {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - {2FCD4B66-9CF9-4C8F-BC70-37CD20002D49} = {2FCD4B66-9CF9-4C8F-BC70-37CD20002D49} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MP4Splitter", "src\filters\parser\mp4splitter\MP4Splitter_vs2008.vcproj", "{9ED4B036-7399-4128-868D-6E71188E0277}" - ProjectSection(ProjectDependencies) = postProject - {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} = {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - {2FCD4B66-9CF9-4C8F-BC70-37CD20002D49} = {2FCD4B66-9CF9-4C8F-BC70-37CD20002D49} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MpaSplitter", "src\filters\parser\mpasplitter\MpaSplitter_vs2008.vcproj", "{C0F7A036-FC2D-40DF-9852-C37518DB6B3E}" - ProjectSection(ProjectDependencies) = postProject - {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} = {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MpegSplitter", "src\filters\parser\mpegsplitter\MpegSplitter_vs2008.vcproj", "{4628C665-EDE4-40D2-B525-32BE8B8551C8}" - ProjectSection(ProjectDependencies) = postProject - {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} = {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NutSplitter", "src\filters\parser\nutsplitter\NutSplitter_vs2008.vcproj", "{E776D3C2-5BFA-41B9-B998-A35B549AF737}" - ProjectSection(ProjectDependencies) = postProject - {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} = {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OggSplitter", "src\filters\parser\oggsplitter\OggSplitter_vs2008.vcproj", "{7FE0A205-3F39-4AC3-BC3C-C2D9E4D02475}" - ProjectSection(ProjectDependencies) = postProject - {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} = {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RealMediaSplitter", "src\filters\parser\realmediasplitter\RealMediaSplitter_vs2008.vcproj", "{53CF9195-19DB-457D-8F55-8DB1706DFA84}" - ProjectSection(ProjectDependencies) = postProject - {54DDA60F-E528-4D07-A152-960A1E818680} = {54DDA60F-E528-4D07-A152-960A1E818680} - {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} = {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RoQSplitter", "src\filters\parser\roqsplitter\RoQSplitter_vs2008.vcproj", "{23E1898F-8262-435C-8848-D4D8824E6D71}" - ProjectSection(ProjectDependencies) = postProject - {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} = {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SSFSplitter", "src\filters\parser\ssfsplitter\SSFSplitter_vs2008.vcproj", "{CC07B80F-D44F-41A9-9E37-5F2B47B46EDC}" - ProjectSection(ProjectDependencies) = postProject - {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} = {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "streamdrivethru", "src\filters\parser\streamdrivethru\streamdrivethru_vs2008.vcproj", "{AE399B7E-2B2C-4A96-9016-C5C74B0A2FA0}" - ProjectSection(ProjectDependencies) = postProject - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Reader", "Reader", "{4909B0ED-CC22-4509-ACD0-FB60C4FC73ED}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "asyncreader", "src\filters\reader\asyncreader\asyncreader_vs2008.vcproj", "{9F31D122-E84D-485A-A58D-09DAD01A56CE}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cddareader", "src\filters\reader\cddareader\cddareader_vs2008.vcproj", "{543D40E9-8CA6-4E4B-9936-90CBA562B268}" - ProjectSection(ProjectDependencies) = postProject - {9F31D122-E84D-485A-A58D-09DAD01A56CE} = {9F31D122-E84D-485A-A58D-09DAD01A56CE} - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cdxareader", "src\filters\reader\cdxareader\cdxareader_vs2008.vcproj", "{4D3B4FF4-535A-4201-AB7D-9AEC1E737A95}" - ProjectSection(ProjectDependencies) = postProject - {9F31D122-E84D-485A-A58D-09DAD01A56CE} = {9F31D122-E84D-485A-A58D-09DAD01A56CE} - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "udpreader", "src\filters\reader\udpreader\udpreader_vs2008.vcproj", "{3020FF9B-8202-488D-B137-11DECC510E6E}" - ProjectSection(ProjectDependencies) = postProject - {9F31D122-E84D-485A-A58D-09DAD01A56CE} = {9F31D122-E84D-485A-A58D-09DAD01A56CE} - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vtsreader", "src\filters\reader\vtsreader\vtsreader_vs2008.vcproj", "{664E726B-EEEE-403A-AC15-345D9C9E1375}" - ProjectSection(ProjectDependencies) = postProject - {9F31D122-E84D-485A-A58D-09DAD01A56CE} = {9F31D122-E84D-485A-A58D-09DAD01A56CE} - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Source", "Source", "{02DAA1A6-31C8-4002-89FE-50BF53752244}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "basesource", "src\filters\source\basesource\basesource_vs2008.vcproj", "{F50E74C2-5BE7-4C9B-B1E7-6CA19CFAD34E}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "d2vsource", "src\filters\source\d2vsource\d2vsource_vs2008.vcproj", "{83CC6B88-A112-4192-BD5A-F2A249AF2277}" - ProjectSection(ProjectDependencies) = postProject - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dtsac3source", "src\filters\source\dtsac3source\dtsac3source_vs2008.vcproj", "{30D48874-899F-41C6-9B26-A40C96C91102}" - ProjectSection(ProjectDependencies) = postProject - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "flicsource", "src\filters\source\flicsource\flicsource_vs2008.vcproj", "{431DD5B6-3F2F-47EE-A23F-514BC044B704}" - ProjectSection(ProjectDependencies) = postProject - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shoutcastsource", "src\filters\source\shoutcastsource\shoutcastsource_vs2008.vcproj", "{42B599D7-BB84-481F-A42A-2DBE0E2E2D7E}" - ProjectSection(ProjectDependencies) = postProject - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "subtitlesource", "src\filters\source\subtitlesource\subtitlesource_vs2008.vcproj", "{8F998497-9C51-4FAA-83E4-1D85B22CBA13}" - ProjectSection(ProjectDependencies) = postProject - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Switcher", "Switcher", "{683639C3-F209-4EF8-B6CC-8741C61EDECF}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "audioswitcher", "src\filters\switcher\audioswitcher\audioswitcher_vs2008.vcproj", "{D8DB3E7E-D50E-4EC3-A9B9-DAD18F5FE466}" - ProjectSection(ProjectDependencies) = postProject - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Transform", "Transform", "{F9F42BF2-3F13-4654-82C5-E27B8879EC4E}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "avi2ac3filter", "src\filters\transform\avi2ac3filter\avi2ac3filter_vs2008.vcproj", "{339A4575-E25B-45D6-94A1-D835891740B8}" - ProjectSection(ProjectDependencies) = postProject - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "basevideofilter", "src\filters\transform\basevideofilter\basevideofilter_vs2008.vcproj", "{54DDA60F-E528-4D07-A152-960A1E818680}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bufferfilter", "src\filters\transform\bufferfilter\bufferfilter_vs2008.vcproj", "{9DCFD02A-16A0-4766-BC18-66163E21929D}" - ProjectSection(ProjectDependencies) = postProject - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "decssfilter", "src\filters\transform\decssfilter\decssfilter_vs2008.vcproj", "{F6B06383-3FFD-403B-9867-4AA82A20AA83}" - ProjectSection(ProjectDependencies) = postProject - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MpaDecFilter", "src\filters\transform\mpadecfilter\MpaDecFilter_vs2008.vcproj", "{4421516D-10A6-41C1-ADF3-099573BBB0C6}" - ProjectSection(ProjectDependencies) = postProject - {D8365C15-2166-4DB6-8A2D-1C8F0239EB18} = {D8365C15-2166-4DB6-8A2D-1C8F0239EB18} - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - {A7134255-DFF3-42F7-9BC2-FAC6E71CFFAE} = {A7134255-DFF3-42F7-9BC2-FAC6E71CFFAE} - {62FE6D94-E17C-4A8E-8D3C-7A589A70D865} = {62FE6D94-E17C-4A8E-8D3C-7A589A70D865} - {5EFCFACB-1835-422C-ACDA-E3B3A2F51387} = {5EFCFACB-1835-422C-ACDA-E3B3A2F51387} - {54F609FD-A8CE-43CF-94AD-23E877B97C13} = {54F609FD-A8CE-43CF-94AD-23E877B97C13} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Mpeg2DecFilter", "src\filters\transform\mpeg2decfilter\Mpeg2DecFilter_vs2008.vcproj", "{305BAB2D-0D75-4FBC-8BCD-A2917392B48C}" - ProjectSection(ProjectDependencies) = postProject - {54DDA60F-E528-4D07-A152-960A1E818680} = {54DDA60F-E528-4D07-A152-960A1E818680} - {273B3149-3192-4B75-A791-470320B90812} = {273B3149-3192-4B75-A791-470320B90812} - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug Unicode|Win32 = Debug Unicode|Win32 - Debug Unicode|x64 = Debug Unicode|x64 - Release Unicode|Win32 = Release Unicode|Win32 - Release Unicode|x64 = Release Unicode|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {8CE7E5D0-C821-47AC-A247-28EC95B34670}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32 - {8CE7E5D0-C821-47AC-A247-28EC95B34670}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32 - {8CE7E5D0-C821-47AC-A247-28EC95B34670}.Debug Unicode|x64.ActiveCfg = Debug Unicode|x64 - {8CE7E5D0-C821-47AC-A247-28EC95B34670}.Debug Unicode|x64.Build.0 = Debug Unicode|x64 - {8CE7E5D0-C821-47AC-A247-28EC95B34670}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32 - {8CE7E5D0-C821-47AC-A247-28EC95B34670}.Release Unicode|Win32.Build.0 = Release Unicode|Win32 - {8CE7E5D0-C821-47AC-A247-28EC95B34670}.Release Unicode|x64.ActiveCfg = Release Unicode|x64 - {8CE7E5D0-C821-47AC-A247-28EC95B34670}.Release Unicode|x64.Build.0 = Release Unicode|x64 - {1A2DFD1A-3C6C-44D1-909D-294AF646B575}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32 - {1A2DFD1A-3C6C-44D1-909D-294AF646B575}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32 - {1A2DFD1A-3C6C-44D1-909D-294AF646B575}.Debug Unicode|x64.ActiveCfg = Debug Unicode|x64 - {1A2DFD1A-3C6C-44D1-909D-294AF646B575}.Debug Unicode|x64.Build.0 = Debug Unicode|x64 - {1A2DFD1A-3C6C-44D1-909D-294AF646B575}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32 - {1A2DFD1A-3C6C-44D1-909D-294AF646B575}.Release Unicode|Win32.Build.0 = Release Unicode|Win32 - {1A2DFD1A-3C6C-44D1-909D-294AF646B575}.Release Unicode|x64.ActiveCfg = Release Unicode|x64 - {1A2DFD1A-3C6C-44D1-909D-294AF646B575}.Release Unicode|x64.Build.0 = Release Unicode|x64 - {FC70988B-1AE5-4381-866D-4F405E28AC42}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32 - {FC70988B-1AE5-4381-866D-4F405E28AC42}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32 - {FC70988B-1AE5-4381-866D-4F405E28AC42}.Debug Unicode|x64.ActiveCfg = Debug Unicode|x64 - {FC70988B-1AE5-4381-866D-4F405E28AC42}.Debug Unicode|x64.Build.0 = Debug Unicode|x64 - {FC70988B-1AE5-4381-866D-4F405E28AC42}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32 - {FC70988B-1AE5-4381-866D-4F405E28AC42}.Release Unicode|Win32.Build.0 = Release Unicode|Win32 - {FC70988B-1AE5-4381-866D-4F405E28AC42}.Release Unicode|x64.ActiveCfg = Release Unicode|x64 - {FC70988B-1AE5-4381-866D-4F405E28AC42}.Release Unicode|x64.Build.0 = Release Unicode|x64 - {FC8080D1-603C-45EC-BCFA-7172E2F3D989}.Debug Unicode|Win32.ActiveCfg = Debug|Win32 - {FC8080D1-603C-45EC-BCFA-7172E2F3D989}.Debug Unicode|Win32.Build.0 = Debug|Win32 - {FC8080D1-603C-45EC-BCFA-7172E2F3D989}.Debug Unicode|x64.ActiveCfg = Debug|x64 - {FC8080D1-603C-45EC-BCFA-7172E2F3D989}.Debug Unicode|x64.Build.0 = Debug|x64 - {FC8080D1-603C-45EC-BCFA-7172E2F3D989}.Release Unicode|Win32.ActiveCfg = Release|Win32 - {FC8080D1-603C-45EC-BCFA-7172E2F3D989}.Release Unicode|Win32.Build.0 = Release|Win32 - {FC8080D1-603C-45EC-BCFA-7172E2F3D989}.Release Unicode|x64.ActiveCfg = Release|x64 - {FC8080D1-603C-45EC-BCFA-7172E2F3D989}.Release Unicode|x64.Build.0 = Release|x64 - {DD9D2D92-2241-408A-859E-B85D444B7E3C}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32 - {DD9D2D92-2241-408A-859E-B85D444B7E3C}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32 - {DD9D2D92-2241-408A-859E-B85D444B7E3C}.Debug Unicode|x64.ActiveCfg = Debug Unicode|x64 - {DD9D2D92-2241-408A-859E-B85D444B7E3C}.Debug Unicode|x64.Build.0 = Debug Unicode|x64 - {DD9D2D92-2241-408A-859E-B85D444B7E3C}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32 - {DD9D2D92-2241-408A-859E-B85D444B7E3C}.Release Unicode|Win32.Build.0 = Release Unicode|Win32 - {DD9D2D92-2241-408A-859E-B85D444B7E3C}.Release Unicode|x64.ActiveCfg = Release Unicode|x64 - {DD9D2D92-2241-408A-859E-B85D444B7E3C}.Release Unicode|x64.Build.0 = Release Unicode|x64 - {D514EA4D-EAFB-47A9-A437-A582CA571251}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32 - {D514EA4D-EAFB-47A9-A437-A582CA571251}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32 - {D514EA4D-EAFB-47A9-A437-A582CA571251}.Debug Unicode|x64.ActiveCfg = Debug Unicode|x64 - {D514EA4D-EAFB-47A9-A437-A582CA571251}.Debug Unicode|x64.Build.0 = Debug Unicode|x64 - {D514EA4D-EAFB-47A9-A437-A582CA571251}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32 - {D514EA4D-EAFB-47A9-A437-A582CA571251}.Release Unicode|Win32.Build.0 = Release Unicode|Win32 - {D514EA4D-EAFB-47A9-A437-A582CA571251}.Release Unicode|x64.ActiveCfg = Release Unicode|x64 - {D514EA4D-EAFB-47A9-A437-A582CA571251}.Release Unicode|x64.Build.0 = Release Unicode|x64 - {5E56335F-0FB1-4EEA-B240-D8DC5E0608E4}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32 - {5E56335F-0FB1-4EEA-B240-D8DC5E0608E4}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32 - {5E56335F-0FB1-4EEA-B240-D8DC5E0608E4}.Debug Unicode|x64.ActiveCfg = Debug Unicode|x64 - {5E56335F-0FB1-4EEA-B240-D8DC5E0608E4}.Debug Unicode|x64.Build.0 = Debug Unicode|x64 - {5E56335F-0FB1-4EEA-B240-D8DC5E0608E4}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32 - {5E56335F-0FB1-4EEA-B240-D8DC5E0608E4}.Release Unicode|Win32.Build.0 = Release Unicode|Win32 - {5E56335F-0FB1-4EEA-B240-D8DC5E0608E4}.Release Unicode|x64.ActiveCfg = Release Unicode|x64 - {5E56335F-0FB1-4EEA-B240-D8DC5E0608E4}.Release Unicode|x64.Build.0 = Release Unicode|x64 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Debug Unicode|x64.ActiveCfg = Debug Unicode|x64 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Debug Unicode|x64.Build.0 = Debug Unicode|x64 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Release Unicode|Win32.Build.0 = Release Unicode|Win32 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Release Unicode|x64.ActiveCfg = Release Unicode|x64 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Release Unicode|x64.Build.0 = Release Unicode|x64 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Debug Unicode|x64.ActiveCfg = Debug Unicode|x64 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Debug Unicode|x64.Build.0 = Debug Unicode|x64 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Release Unicode|Win32.Build.0 = Release Unicode|Win32 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Release Unicode|x64.ActiveCfg = Release Unicode|x64 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Release Unicode|x64.Build.0 = Release Unicode|x64 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Debug Unicode|x64.ActiveCfg = Debug Unicode|x64 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Debug Unicode|x64.Build.0 = Debug Unicode|x64 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Release Unicode|Win32.Build.0 = Release Unicode|Win32 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Release Unicode|x64.ActiveCfg = Release Unicode|x64 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Release Unicode|x64.Build.0 = Release Unicode|x64 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Debug Unicode|x64.ActiveCfg = Debug Unicode|x64 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Debug Unicode|x64.Build.0 = Debug Unicode|x64 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Release Unicode|Win32.Build.0 = Release Unicode|Win32 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Release Unicode|x64.ActiveCfg = Release Unicode|x64 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Release Unicode|x64.Build.0 = Release Unicode|x64 - {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {273B3149-3192-4B75-A791-470320B90812}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {273B3149-3192-4B75-A791-470320B90812}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {273B3149-3192-4B75-A791-470320B90812}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {273B3149-3192-4B75-A791-470320B90812}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {273B3149-3192-4B75-A791-470320B90812}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {273B3149-3192-4B75-A791-470320B90812}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {273B3149-3192-4B75-A791-470320B90812}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {273B3149-3192-4B75-A791-470320B90812}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {62FE6D94-E17C-4A8E-8D3C-7A589A70D865}.Debug Unicode|Win32.ActiveCfg = Debug|Win32 - {62FE6D94-E17C-4A8E-8D3C-7A589A70D865}.Debug Unicode|Win32.Build.0 = Debug|Win32 - {62FE6D94-E17C-4A8E-8D3C-7A589A70D865}.Debug Unicode|x64.ActiveCfg = Debug|x64 - {62FE6D94-E17C-4A8E-8D3C-7A589A70D865}.Debug Unicode|x64.Build.0 = Debug|x64 - {62FE6D94-E17C-4A8E-8D3C-7A589A70D865}.Release Unicode|Win32.ActiveCfg = Release|Win32 - {62FE6D94-E17C-4A8E-8D3C-7A589A70D865}.Release Unicode|Win32.Build.0 = Release|Win32 - {62FE6D94-E17C-4A8E-8D3C-7A589A70D865}.Release Unicode|x64.ActiveCfg = Release|x64 - {62FE6D94-E17C-4A8E-8D3C-7A589A70D865}.Release Unicode|x64.Build.0 = Release|x64 - {12BE3440-A1F3-4C48-A229-30CB619EA276}.Debug Unicode|Win32.ActiveCfg = Debug|Win32 - {12BE3440-A1F3-4C48-A229-30CB619EA276}.Debug Unicode|Win32.Build.0 = Debug|Win32 - {12BE3440-A1F3-4C48-A229-30CB619EA276}.Debug Unicode|x64.ActiveCfg = Debug|x64 - {12BE3440-A1F3-4C48-A229-30CB619EA276}.Debug Unicode|x64.Build.0 = Debug|x64 - {12BE3440-A1F3-4C48-A229-30CB619EA276}.Release Unicode|Win32.ActiveCfg = Release|Win32 - {12BE3440-A1F3-4C48-A229-30CB619EA276}.Release Unicode|Win32.Build.0 = Release|Win32 - {12BE3440-A1F3-4C48-A229-30CB619EA276}.Release Unicode|x64.ActiveCfg = Release|x64 - {12BE3440-A1F3-4C48-A229-30CB619EA276}.Release Unicode|x64.Build.0 = Release|x64 - {54F609FD-A8CE-43CF-94AD-23E877B97C13}.Debug Unicode|Win32.ActiveCfg = Debug|Win32 - {54F609FD-A8CE-43CF-94AD-23E877B97C13}.Debug Unicode|Win32.Build.0 = Debug|Win32 - {54F609FD-A8CE-43CF-94AD-23E877B97C13}.Debug Unicode|x64.ActiveCfg = Debug|x64 - {54F609FD-A8CE-43CF-94AD-23E877B97C13}.Debug Unicode|x64.Build.0 = Debug|x64 - {54F609FD-A8CE-43CF-94AD-23E877B97C13}.Release Unicode|Win32.ActiveCfg = Release|Win32 - {54F609FD-A8CE-43CF-94AD-23E877B97C13}.Release Unicode|Win32.Build.0 = Release|Win32 - {54F609FD-A8CE-43CF-94AD-23E877B97C13}.Release Unicode|x64.ActiveCfg = Release|x64 - {54F609FD-A8CE-43CF-94AD-23E877B97C13}.Release Unicode|x64.Build.0 = Release|x64 - {5EFCFACB-1835-422C-ACDA-E3B3A2F51387}.Debug Unicode|Win32.ActiveCfg = Debug|Win32 - {5EFCFACB-1835-422C-ACDA-E3B3A2F51387}.Debug Unicode|Win32.Build.0 = Debug|Win32 - {5EFCFACB-1835-422C-ACDA-E3B3A2F51387}.Debug Unicode|x64.ActiveCfg = Debug|x64 - {5EFCFACB-1835-422C-ACDA-E3B3A2F51387}.Debug Unicode|x64.Build.0 = Debug|x64 - {5EFCFACB-1835-422C-ACDA-E3B3A2F51387}.Release Unicode|Win32.ActiveCfg = Release|Win32 - {5EFCFACB-1835-422C-ACDA-E3B3A2F51387}.Release Unicode|Win32.Build.0 = Release|Win32 - {5EFCFACB-1835-422C-ACDA-E3B3A2F51387}.Release Unicode|x64.ActiveCfg = Release|x64 - {5EFCFACB-1835-422C-ACDA-E3B3A2F51387}.Release Unicode|x64.Build.0 = Release|x64 - {D8365C15-2166-4DB6-8A2D-1C8F0239EB18}.Debug Unicode|Win32.ActiveCfg = Debug|Win32 - {D8365C15-2166-4DB6-8A2D-1C8F0239EB18}.Debug Unicode|Win32.Build.0 = Debug|Win32 - {D8365C15-2166-4DB6-8A2D-1C8F0239EB18}.Debug Unicode|x64.ActiveCfg = Debug|x64 - {D8365C15-2166-4DB6-8A2D-1C8F0239EB18}.Debug Unicode|x64.Build.0 = Debug|x64 - {D8365C15-2166-4DB6-8A2D-1C8F0239EB18}.Release Unicode|Win32.ActiveCfg = Release|Win32 - {D8365C15-2166-4DB6-8A2D-1C8F0239EB18}.Release Unicode|Win32.Build.0 = Release|Win32 - {D8365C15-2166-4DB6-8A2D-1C8F0239EB18}.Release Unicode|x64.ActiveCfg = Release|x64 - {D8365C15-2166-4DB6-8A2D-1C8F0239EB18}.Release Unicode|x64.Build.0 = Release|x64 - {A7134255-DFF3-42F7-9BC2-FAC6E71CFFAE}.Debug Unicode|Win32.ActiveCfg = Debug|Win32 - {A7134255-DFF3-42F7-9BC2-FAC6E71CFFAE}.Debug Unicode|Win32.Build.0 = Debug|Win32 - {A7134255-DFF3-42F7-9BC2-FAC6E71CFFAE}.Debug Unicode|x64.ActiveCfg = Debug|x64 - {A7134255-DFF3-42F7-9BC2-FAC6E71CFFAE}.Debug Unicode|x64.Build.0 = Debug|x64 - {A7134255-DFF3-42F7-9BC2-FAC6E71CFFAE}.Release Unicode|Win32.ActiveCfg = Release|Win32 - {A7134255-DFF3-42F7-9BC2-FAC6E71CFFAE}.Release Unicode|Win32.Build.0 = Release|Win32 - {A7134255-DFF3-42F7-9BC2-FAC6E71CFFAE}.Release Unicode|x64.ActiveCfg = Release|x64 - {A7134255-DFF3-42F7-9BC2-FAC6E71CFFAE}.Release Unicode|x64.Build.0 = Release|x64 - {2FCD4B66-9CF9-4C8F-BC70-37CD20002D49}.Debug Unicode|Win32.ActiveCfg = Debug|Win32 - {2FCD4B66-9CF9-4C8F-BC70-37CD20002D49}.Debug Unicode|Win32.Build.0 = Debug|Win32 - {2FCD4B66-9CF9-4C8F-BC70-37CD20002D49}.Debug Unicode|x64.ActiveCfg = Debug|x64 - {2FCD4B66-9CF9-4C8F-BC70-37CD20002D49}.Debug Unicode|x64.Build.0 = Debug|x64 - {2FCD4B66-9CF9-4C8F-BC70-37CD20002D49}.Release Unicode|Win32.ActiveCfg = Release|Win32 - {2FCD4B66-9CF9-4C8F-BC70-37CD20002D49}.Release Unicode|Win32.Build.0 = Release|Win32 - {2FCD4B66-9CF9-4C8F-BC70-37CD20002D49}.Release Unicode|x64.ActiveCfg = Release|x64 - {2FCD4B66-9CF9-4C8F-BC70-37CD20002D49}.Release Unicode|x64.Build.0 = Release|x64 - {DB5F93B2-54D0-4474-A588-D259BE36C832}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {DB5F93B2-54D0-4474-A588-D259BE36C832}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {DB5F93B2-54D0-4474-A588-D259BE36C832}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {DB5F93B2-54D0-4474-A588-D259BE36C832}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {DB5F93B2-54D0-4474-A588-D259BE36C832}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {DB5F93B2-54D0-4474-A588-D259BE36C832}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {DB5F93B2-54D0-4474-A588-D259BE36C832}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {DB5F93B2-54D0-4474-A588-D259BE36C832}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {65361C7C-83D6-42E4-870C-4DC85AE641FE}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {65361C7C-83D6-42E4-870C-4DC85AE641FE}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {65361C7C-83D6-42E4-870C-4DC85AE641FE}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {65361C7C-83D6-42E4-870C-4DC85AE641FE}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {65361C7C-83D6-42E4-870C-4DC85AE641FE}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {65361C7C-83D6-42E4-870C-4DC85AE641FE}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {65361C7C-83D6-42E4-870C-4DC85AE641FE}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {65361C7C-83D6-42E4-870C-4DC85AE641FE}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {67827491-8162-4039-9132-F934ABC836A0}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {67827491-8162-4039-9132-F934ABC836A0}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {67827491-8162-4039-9132-F934ABC836A0}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {67827491-8162-4039-9132-F934ABC836A0}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {67827491-8162-4039-9132-F934ABC836A0}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {67827491-8162-4039-9132-F934ABC836A0}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {67827491-8162-4039-9132-F934ABC836A0}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {67827491-8162-4039-9132-F934ABC836A0}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {EB202B68-8029-4985-B914-E94B44D2E230}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {EB202B68-8029-4985-B914-E94B44D2E230}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {EB202B68-8029-4985-B914-E94B44D2E230}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {EB202B68-8029-4985-B914-E94B44D2E230}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {EB202B68-8029-4985-B914-E94B44D2E230}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {EB202B68-8029-4985-B914-E94B44D2E230}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {EB202B68-8029-4985-B914-E94B44D2E230}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {EB202B68-8029-4985-B914-E94B44D2E230}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {9738B023-FC46-48A2-953A-0035FD897678}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {9738B023-FC46-48A2-953A-0035FD897678}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {9738B023-FC46-48A2-953A-0035FD897678}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {9738B023-FC46-48A2-953A-0035FD897678}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {9738B023-FC46-48A2-953A-0035FD897678}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {9738B023-FC46-48A2-953A-0035FD897678}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {9738B023-FC46-48A2-953A-0035FD897678}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {9738B023-FC46-48A2-953A-0035FD897678}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {37768B3F-89BC-4C16-B2A8-767C5DA84C3F}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {37768B3F-89BC-4C16-B2A8-767C5DA84C3F}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {37768B3F-89BC-4C16-B2A8-767C5DA84C3F}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {37768B3F-89BC-4C16-B2A8-767C5DA84C3F}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {37768B3F-89BC-4C16-B2A8-767C5DA84C3F}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {37768B3F-89BC-4C16-B2A8-767C5DA84C3F}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {37768B3F-89BC-4C16-B2A8-767C5DA84C3F}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {37768B3F-89BC-4C16-B2A8-767C5DA84C3F}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {ECB1B3B7-196D-4809-A5E2-6F65CDBB6CCA}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {ECB1B3B7-196D-4809-A5E2-6F65CDBB6CCA}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {ECB1B3B7-196D-4809-A5E2-6F65CDBB6CCA}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {ECB1B3B7-196D-4809-A5E2-6F65CDBB6CCA}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {ECB1B3B7-196D-4809-A5E2-6F65CDBB6CCA}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {ECB1B3B7-196D-4809-A5E2-6F65CDBB6CCA}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {ECB1B3B7-196D-4809-A5E2-6F65CDBB6CCA}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {ECB1B3B7-196D-4809-A5E2-6F65CDBB6CCA}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {1E91F58C-0BAE-4021-8087-D1864D8EC066}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {1E91F58C-0BAE-4021-8087-D1864D8EC066}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {1E91F58C-0BAE-4021-8087-D1864D8EC066}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {1E91F58C-0BAE-4021-8087-D1864D8EC066}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {1E91F58C-0BAE-4021-8087-D1864D8EC066}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {1E91F58C-0BAE-4021-8087-D1864D8EC066}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {1E91F58C-0BAE-4021-8087-D1864D8EC066}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {1E91F58C-0BAE-4021-8087-D1864D8EC066}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {E62223EF-8263-41EB-8174-CD78BBEEF368}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {E62223EF-8263-41EB-8174-CD78BBEEF368}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {E62223EF-8263-41EB-8174-CD78BBEEF368}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {E62223EF-8263-41EB-8174-CD78BBEEF368}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {E62223EF-8263-41EB-8174-CD78BBEEF368}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {E62223EF-8263-41EB-8174-CD78BBEEF368}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {E62223EF-8263-41EB-8174-CD78BBEEF368}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {E62223EF-8263-41EB-8174-CD78BBEEF368}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {3F5EA225-F4B7-4413-AEB3-4E4E5751E438}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {3F5EA225-F4B7-4413-AEB3-4E4E5751E438}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {3F5EA225-F4B7-4413-AEB3-4E4E5751E438}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {3F5EA225-F4B7-4413-AEB3-4E4E5751E438}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {3F5EA225-F4B7-4413-AEB3-4E4E5751E438}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {3F5EA225-F4B7-4413-AEB3-4E4E5751E438}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {3F5EA225-F4B7-4413-AEB3-4E4E5751E438}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {3F5EA225-F4B7-4413-AEB3-4E4E5751E438}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {9ED4B036-7399-4128-868D-6E71188E0277}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {9ED4B036-7399-4128-868D-6E71188E0277}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {9ED4B036-7399-4128-868D-6E71188E0277}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {9ED4B036-7399-4128-868D-6E71188E0277}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {9ED4B036-7399-4128-868D-6E71188E0277}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {9ED4B036-7399-4128-868D-6E71188E0277}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {9ED4B036-7399-4128-868D-6E71188E0277}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {9ED4B036-7399-4128-868D-6E71188E0277}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {C0F7A036-FC2D-40DF-9852-C37518DB6B3E}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {C0F7A036-FC2D-40DF-9852-C37518DB6B3E}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {C0F7A036-FC2D-40DF-9852-C37518DB6B3E}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {C0F7A036-FC2D-40DF-9852-C37518DB6B3E}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {C0F7A036-FC2D-40DF-9852-C37518DB6B3E}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {C0F7A036-FC2D-40DF-9852-C37518DB6B3E}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {C0F7A036-FC2D-40DF-9852-C37518DB6B3E}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {C0F7A036-FC2D-40DF-9852-C37518DB6B3E}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {4628C665-EDE4-40D2-B525-32BE8B8551C8}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {4628C665-EDE4-40D2-B525-32BE8B8551C8}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {4628C665-EDE4-40D2-B525-32BE8B8551C8}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {4628C665-EDE4-40D2-B525-32BE8B8551C8}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {4628C665-EDE4-40D2-B525-32BE8B8551C8}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {4628C665-EDE4-40D2-B525-32BE8B8551C8}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {4628C665-EDE4-40D2-B525-32BE8B8551C8}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {4628C665-EDE4-40D2-B525-32BE8B8551C8}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {E776D3C2-5BFA-41B9-B998-A35B549AF737}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {E776D3C2-5BFA-41B9-B998-A35B549AF737}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {E776D3C2-5BFA-41B9-B998-A35B549AF737}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {E776D3C2-5BFA-41B9-B998-A35B549AF737}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {E776D3C2-5BFA-41B9-B998-A35B549AF737}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {E776D3C2-5BFA-41B9-B998-A35B549AF737}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {E776D3C2-5BFA-41B9-B998-A35B549AF737}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {E776D3C2-5BFA-41B9-B998-A35B549AF737}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {7FE0A205-3F39-4AC3-BC3C-C2D9E4D02475}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {7FE0A205-3F39-4AC3-BC3C-C2D9E4D02475}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {7FE0A205-3F39-4AC3-BC3C-C2D9E4D02475}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {7FE0A205-3F39-4AC3-BC3C-C2D9E4D02475}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {7FE0A205-3F39-4AC3-BC3C-C2D9E4D02475}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {7FE0A205-3F39-4AC3-BC3C-C2D9E4D02475}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {7FE0A205-3F39-4AC3-BC3C-C2D9E4D02475}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {7FE0A205-3F39-4AC3-BC3C-C2D9E4D02475}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {53CF9195-19DB-457D-8F55-8DB1706DFA84}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {53CF9195-19DB-457D-8F55-8DB1706DFA84}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {53CF9195-19DB-457D-8F55-8DB1706DFA84}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {53CF9195-19DB-457D-8F55-8DB1706DFA84}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {53CF9195-19DB-457D-8F55-8DB1706DFA84}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {53CF9195-19DB-457D-8F55-8DB1706DFA84}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {53CF9195-19DB-457D-8F55-8DB1706DFA84}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {53CF9195-19DB-457D-8F55-8DB1706DFA84}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {23E1898F-8262-435C-8848-D4D8824E6D71}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {23E1898F-8262-435C-8848-D4D8824E6D71}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {23E1898F-8262-435C-8848-D4D8824E6D71}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {23E1898F-8262-435C-8848-D4D8824E6D71}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {23E1898F-8262-435C-8848-D4D8824E6D71}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {23E1898F-8262-435C-8848-D4D8824E6D71}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {23E1898F-8262-435C-8848-D4D8824E6D71}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {23E1898F-8262-435C-8848-D4D8824E6D71}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {CC07B80F-D44F-41A9-9E37-5F2B47B46EDC}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {CC07B80F-D44F-41A9-9E37-5F2B47B46EDC}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {CC07B80F-D44F-41A9-9E37-5F2B47B46EDC}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {CC07B80F-D44F-41A9-9E37-5F2B47B46EDC}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {CC07B80F-D44F-41A9-9E37-5F2B47B46EDC}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {CC07B80F-D44F-41A9-9E37-5F2B47B46EDC}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {CC07B80F-D44F-41A9-9E37-5F2B47B46EDC}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {CC07B80F-D44F-41A9-9E37-5F2B47B46EDC}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {AE399B7E-2B2C-4A96-9016-C5C74B0A2FA0}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {AE399B7E-2B2C-4A96-9016-C5C74B0A2FA0}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {AE399B7E-2B2C-4A96-9016-C5C74B0A2FA0}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {AE399B7E-2B2C-4A96-9016-C5C74B0A2FA0}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {AE399B7E-2B2C-4A96-9016-C5C74B0A2FA0}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {AE399B7E-2B2C-4A96-9016-C5C74B0A2FA0}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {AE399B7E-2B2C-4A96-9016-C5C74B0A2FA0}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {AE399B7E-2B2C-4A96-9016-C5C74B0A2FA0}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {9F31D122-E84D-485A-A58D-09DAD01A56CE}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32 - {9F31D122-E84D-485A-A58D-09DAD01A56CE}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32 - {9F31D122-E84D-485A-A58D-09DAD01A56CE}.Debug Unicode|x64.ActiveCfg = Debug Unicode|x64 - {9F31D122-E84D-485A-A58D-09DAD01A56CE}.Debug Unicode|x64.Build.0 = Debug Unicode|x64 - {9F31D122-E84D-485A-A58D-09DAD01A56CE}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32 - {9F31D122-E84D-485A-A58D-09DAD01A56CE}.Release Unicode|Win32.Build.0 = Release Unicode|Win32 - {9F31D122-E84D-485A-A58D-09DAD01A56CE}.Release Unicode|x64.ActiveCfg = Release Unicode|x64 - {9F31D122-E84D-485A-A58D-09DAD01A56CE}.Release Unicode|x64.Build.0 = Release Unicode|x64 - {543D40E9-8CA6-4E4B-9936-90CBA562B268}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {543D40E9-8CA6-4E4B-9936-90CBA562B268}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {543D40E9-8CA6-4E4B-9936-90CBA562B268}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {543D40E9-8CA6-4E4B-9936-90CBA562B268}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {543D40E9-8CA6-4E4B-9936-90CBA562B268}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {543D40E9-8CA6-4E4B-9936-90CBA562B268}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {543D40E9-8CA6-4E4B-9936-90CBA562B268}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {543D40E9-8CA6-4E4B-9936-90CBA562B268}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {4D3B4FF4-535A-4201-AB7D-9AEC1E737A95}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {4D3B4FF4-535A-4201-AB7D-9AEC1E737A95}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {4D3B4FF4-535A-4201-AB7D-9AEC1E737A95}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {4D3B4FF4-535A-4201-AB7D-9AEC1E737A95}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {4D3B4FF4-535A-4201-AB7D-9AEC1E737A95}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {4D3B4FF4-535A-4201-AB7D-9AEC1E737A95}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {4D3B4FF4-535A-4201-AB7D-9AEC1E737A95}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {4D3B4FF4-535A-4201-AB7D-9AEC1E737A95}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {3020FF9B-8202-488D-B137-11DECC510E6E}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {3020FF9B-8202-488D-B137-11DECC510E6E}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {3020FF9B-8202-488D-B137-11DECC510E6E}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {3020FF9B-8202-488D-B137-11DECC510E6E}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {3020FF9B-8202-488D-B137-11DECC510E6E}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {3020FF9B-8202-488D-B137-11DECC510E6E}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {664E726B-EEEE-403A-AC15-345D9C9E1375}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {664E726B-EEEE-403A-AC15-345D9C9E1375}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {664E726B-EEEE-403A-AC15-345D9C9E1375}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {664E726B-EEEE-403A-AC15-345D9C9E1375}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {664E726B-EEEE-403A-AC15-345D9C9E1375}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {664E726B-EEEE-403A-AC15-345D9C9E1375}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {664E726B-EEEE-403A-AC15-345D9C9E1375}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {664E726B-EEEE-403A-AC15-345D9C9E1375}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {F50E74C2-5BE7-4C9B-B1E7-6CA19CFAD34E}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {F50E74C2-5BE7-4C9B-B1E7-6CA19CFAD34E}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {F50E74C2-5BE7-4C9B-B1E7-6CA19CFAD34E}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {F50E74C2-5BE7-4C9B-B1E7-6CA19CFAD34E}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {F50E74C2-5BE7-4C9B-B1E7-6CA19CFAD34E}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {F50E74C2-5BE7-4C9B-B1E7-6CA19CFAD34E}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {F50E74C2-5BE7-4C9B-B1E7-6CA19CFAD34E}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {F50E74C2-5BE7-4C9B-B1E7-6CA19CFAD34E}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {83CC6B88-A112-4192-BD5A-F2A249AF2277}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {83CC6B88-A112-4192-BD5A-F2A249AF2277}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {83CC6B88-A112-4192-BD5A-F2A249AF2277}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {83CC6B88-A112-4192-BD5A-F2A249AF2277}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {83CC6B88-A112-4192-BD5A-F2A249AF2277}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {83CC6B88-A112-4192-BD5A-F2A249AF2277}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {83CC6B88-A112-4192-BD5A-F2A249AF2277}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {30D48874-899F-41C6-9B26-A40C96C91102}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {30D48874-899F-41C6-9B26-A40C96C91102}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {30D48874-899F-41C6-9B26-A40C96C91102}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {30D48874-899F-41C6-9B26-A40C96C91102}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {30D48874-899F-41C6-9B26-A40C96C91102}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {30D48874-899F-41C6-9B26-A40C96C91102}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {30D48874-899F-41C6-9B26-A40C96C91102}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {30D48874-899F-41C6-9B26-A40C96C91102}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {431DD5B6-3F2F-47EE-A23F-514BC044B704}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {431DD5B6-3F2F-47EE-A23F-514BC044B704}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {431DD5B6-3F2F-47EE-A23F-514BC044B704}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {431DD5B6-3F2F-47EE-A23F-514BC044B704}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {431DD5B6-3F2F-47EE-A23F-514BC044B704}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {431DD5B6-3F2F-47EE-A23F-514BC044B704}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {431DD5B6-3F2F-47EE-A23F-514BC044B704}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {431DD5B6-3F2F-47EE-A23F-514BC044B704}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {42B599D7-BB84-481F-A42A-2DBE0E2E2D7E}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {42B599D7-BB84-481F-A42A-2DBE0E2E2D7E}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {42B599D7-BB84-481F-A42A-2DBE0E2E2D7E}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {42B599D7-BB84-481F-A42A-2DBE0E2E2D7E}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {42B599D7-BB84-481F-A42A-2DBE0E2E2D7E}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {42B599D7-BB84-481F-A42A-2DBE0E2E2D7E}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {42B599D7-BB84-481F-A42A-2DBE0E2E2D7E}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {42B599D7-BB84-481F-A42A-2DBE0E2E2D7E}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {8F998497-9C51-4FAA-83E4-1D85B22CBA13}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {8F998497-9C51-4FAA-83E4-1D85B22CBA13}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {8F998497-9C51-4FAA-83E4-1D85B22CBA13}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {8F998497-9C51-4FAA-83E4-1D85B22CBA13}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {8F998497-9C51-4FAA-83E4-1D85B22CBA13}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {8F998497-9C51-4FAA-83E4-1D85B22CBA13}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {8F998497-9C51-4FAA-83E4-1D85B22CBA13}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {8F998497-9C51-4FAA-83E4-1D85B22CBA13}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {D8DB3E7E-D50E-4EC3-A9B9-DAD18F5FE466}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {D8DB3E7E-D50E-4EC3-A9B9-DAD18F5FE466}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {D8DB3E7E-D50E-4EC3-A9B9-DAD18F5FE466}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {D8DB3E7E-D50E-4EC3-A9B9-DAD18F5FE466}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {D8DB3E7E-D50E-4EC3-A9B9-DAD18F5FE466}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {D8DB3E7E-D50E-4EC3-A9B9-DAD18F5FE466}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {D8DB3E7E-D50E-4EC3-A9B9-DAD18F5FE466}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {D8DB3E7E-D50E-4EC3-A9B9-DAD18F5FE466}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {339A4575-E25B-45D6-94A1-D835891740B8}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {339A4575-E25B-45D6-94A1-D835891740B8}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {339A4575-E25B-45D6-94A1-D835891740B8}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {339A4575-E25B-45D6-94A1-D835891740B8}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {339A4575-E25B-45D6-94A1-D835891740B8}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {339A4575-E25B-45D6-94A1-D835891740B8}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {339A4575-E25B-45D6-94A1-D835891740B8}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {339A4575-E25B-45D6-94A1-D835891740B8}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {54DDA60F-E528-4D07-A152-960A1E818680}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {54DDA60F-E528-4D07-A152-960A1E818680}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {54DDA60F-E528-4D07-A152-960A1E818680}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {54DDA60F-E528-4D07-A152-960A1E818680}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {54DDA60F-E528-4D07-A152-960A1E818680}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {54DDA60F-E528-4D07-A152-960A1E818680}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {54DDA60F-E528-4D07-A152-960A1E818680}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {54DDA60F-E528-4D07-A152-960A1E818680}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {9DCFD02A-16A0-4766-BC18-66163E21929D}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {9DCFD02A-16A0-4766-BC18-66163E21929D}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {9DCFD02A-16A0-4766-BC18-66163E21929D}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {9DCFD02A-16A0-4766-BC18-66163E21929D}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {9DCFD02A-16A0-4766-BC18-66163E21929D}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {9DCFD02A-16A0-4766-BC18-66163E21929D}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {9DCFD02A-16A0-4766-BC18-66163E21929D}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {9DCFD02A-16A0-4766-BC18-66163E21929D}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {F6B06383-3FFD-403B-9867-4AA82A20AA83}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {F6B06383-3FFD-403B-9867-4AA82A20AA83}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {F6B06383-3FFD-403B-9867-4AA82A20AA83}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {F6B06383-3FFD-403B-9867-4AA82A20AA83}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {F6B06383-3FFD-403B-9867-4AA82A20AA83}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {F6B06383-3FFD-403B-9867-4AA82A20AA83}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {F6B06383-3FFD-403B-9867-4AA82A20AA83}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {F6B06383-3FFD-403B-9867-4AA82A20AA83}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {4421516D-10A6-41C1-ADF3-099573BBB0C6}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {4421516D-10A6-41C1-ADF3-099573BBB0C6}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {4421516D-10A6-41C1-ADF3-099573BBB0C6}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {4421516D-10A6-41C1-ADF3-099573BBB0C6}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {4421516D-10A6-41C1-ADF3-099573BBB0C6}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {4421516D-10A6-41C1-ADF3-099573BBB0C6}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {4421516D-10A6-41C1-ADF3-099573BBB0C6}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - {4421516D-10A6-41C1-ADF3-099573BBB0C6}.Release Unicode|x64.Build.0 = Release Unicode lib|x64 - {305BAB2D-0D75-4FBC-8BCD-A2917392B48C}.Debug Unicode|Win32.ActiveCfg = Debug Unicode lib|Win32 - {305BAB2D-0D75-4FBC-8BCD-A2917392B48C}.Debug Unicode|Win32.Build.0 = Debug Unicode lib|Win32 - {305BAB2D-0D75-4FBC-8BCD-A2917392B48C}.Debug Unicode|x64.ActiveCfg = Debug Unicode lib|x64 - {305BAB2D-0D75-4FBC-8BCD-A2917392B48C}.Debug Unicode|x64.Build.0 = Debug Unicode lib|x64 - {305BAB2D-0D75-4FBC-8BCD-A2917392B48C}.Release Unicode|Win32.ActiveCfg = Release Unicode lib|Win32 - {305BAB2D-0D75-4FBC-8BCD-A2917392B48C}.Release Unicode|Win32.Build.0 = Release Unicode lib|Win32 - {305BAB2D-0D75-4FBC-8BCD-A2917392B48C}.Release Unicode|x64.ActiveCfg = Release Unicode lib|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {8CE7E5D0-C821-47AC-A247-28EC95B34670} = {A21F07E6-A891-479C-98EA-EDB58CE4EFAB} - {D9A0529B-9EC4-4D30-9E05-A5D533739D95} = {A21F07E6-A891-479C-98EA-EDB58CE4EFAB} - {2913B7E4-7A8B-43D5-A60B-345A0782816A} = {A21F07E6-A891-479C-98EA-EDB58CE4EFAB} - {1A2DFD1A-3C6C-44D1-909D-294AF646B575} = {D9A0529B-9EC4-4D30-9E05-A5D533739D95} - {FC70988B-1AE5-4381-866D-4F405E28AC42} = {D9A0529B-9EC4-4D30-9E05-A5D533739D95} - {FC8080D1-603C-45EC-BCFA-7172E2F3D989} = {D9A0529B-9EC4-4D30-9E05-A5D533739D95} - {DD9D2D92-2241-408A-859E-B85D444B7E3C} = {D9A0529B-9EC4-4D30-9E05-A5D533739D95} - {D514EA4D-EAFB-47A9-A437-A582CA571251} = {D9A0529B-9EC4-4D30-9E05-A5D533739D95} - {5E56335F-0FB1-4EEA-B240-D8DC5E0608E4} = {D9A0529B-9EC4-4D30-9E05-A5D533739D95} - {03208025-D5C2-426A-B0FA-251D4338F30C} = {2913B7E4-7A8B-43D5-A60B-345A0782816A} - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0} = {2913B7E4-7A8B-43D5-A60B-345A0782816A} - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F} = {2913B7E4-7A8B-43D5-A60B-345A0782816A} - {AB494732-EF6D-44D0-BCF8-80FF04858D10} = {2913B7E4-7A8B-43D5-A60B-345A0782816A} - {69C0E434-3B73-400A-A1B7-A887C10BECCA} = {F127F305-5EF5-4B69-B35F-8B30021B175D} - {49B5BAE3-749C-414C-80CC-A756DD548CE3} = {F127F305-5EF5-4B69-B35F-8B30021B175D} - {D626CC4F-BFB1-4030-8DD8-1A3A1D41248E} = {F127F305-5EF5-4B69-B35F-8B30021B175D} - {4909B0ED-CC22-4509-ACD0-FB60C4FC73ED} = {F127F305-5EF5-4B69-B35F-8B30021B175D} - {02DAA1A6-31C8-4002-89FE-50BF53752244} = {F127F305-5EF5-4B69-B35F-8B30021B175D} - {683639C3-F209-4EF8-B6CC-8741C61EDECF} = {F127F305-5EF5-4B69-B35F-8B30021B175D} - {F9F42BF2-3F13-4654-82C5-E27B8879EC4E} = {F127F305-5EF5-4B69-B35F-8B30021B175D} - {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA} = {69C0E434-3B73-400A-A1B7-A887C10BECCA} - {273B3149-3192-4B75-A791-470320B90812} = {69C0E434-3B73-400A-A1B7-A887C10BECCA} - {62FE6D94-E17C-4A8E-8D3C-7A589A70D865} = {69C0E434-3B73-400A-A1B7-A887C10BECCA} - {12BE3440-A1F3-4C48-A229-30CB619EA276} = {69C0E434-3B73-400A-A1B7-A887C10BECCA} - {54F609FD-A8CE-43CF-94AD-23E877B97C13} = {69C0E434-3B73-400A-A1B7-A887C10BECCA} - {5EFCFACB-1835-422C-ACDA-E3B3A2F51387} = {69C0E434-3B73-400A-A1B7-A887C10BECCA} - {D8365C15-2166-4DB6-8A2D-1C8F0239EB18} = {69C0E434-3B73-400A-A1B7-A887C10BECCA} - {A7134255-DFF3-42F7-9BC2-FAC6E71CFFAE} = {69C0E434-3B73-400A-A1B7-A887C10BECCA} - {2FCD4B66-9CF9-4C8F-BC70-37CD20002D49} = {69C0E434-3B73-400A-A1B7-A887C10BECCA} - {DB5F93B2-54D0-4474-A588-D259BE36C832} = {49B5BAE3-749C-414C-80CC-A756DD548CE3} - {65361C7C-83D6-42E4-870C-4DC85AE641FE} = {49B5BAE3-749C-414C-80CC-A756DD548CE3} - {67827491-8162-4039-9132-F934ABC836A0} = {49B5BAE3-749C-414C-80CC-A756DD548CE3} - {EB202B68-8029-4985-B914-E94B44D2E230} = {49B5BAE3-749C-414C-80CC-A756DD548CE3} - {9738B023-FC46-48A2-953A-0035FD897678} = {D626CC4F-BFB1-4030-8DD8-1A3A1D41248E} - {37768B3F-89BC-4C16-B2A8-767C5DA84C3F} = {D626CC4F-BFB1-4030-8DD8-1A3A1D41248E} - {ECB1B3B7-196D-4809-A5E2-6F65CDBB6CCA} = {D626CC4F-BFB1-4030-8DD8-1A3A1D41248E} - {1E91F58C-0BAE-4021-8087-D1864D8EC066} = {D626CC4F-BFB1-4030-8DD8-1A3A1D41248E} - {E62223EF-8263-41EB-8174-CD78BBEEF368} = {D626CC4F-BFB1-4030-8DD8-1A3A1D41248E} - {3F5EA225-F4B7-4413-AEB3-4E4E5751E438} = {D626CC4F-BFB1-4030-8DD8-1A3A1D41248E} - {9ED4B036-7399-4128-868D-6E71188E0277} = {D626CC4F-BFB1-4030-8DD8-1A3A1D41248E} - {C0F7A036-FC2D-40DF-9852-C37518DB6B3E} = {D626CC4F-BFB1-4030-8DD8-1A3A1D41248E} - {4628C665-EDE4-40D2-B525-32BE8B8551C8} = {D626CC4F-BFB1-4030-8DD8-1A3A1D41248E} - {E776D3C2-5BFA-41B9-B998-A35B549AF737} = {D626CC4F-BFB1-4030-8DD8-1A3A1D41248E} - {7FE0A205-3F39-4AC3-BC3C-C2D9E4D02475} = {D626CC4F-BFB1-4030-8DD8-1A3A1D41248E} - {53CF9195-19DB-457D-8F55-8DB1706DFA84} = {D626CC4F-BFB1-4030-8DD8-1A3A1D41248E} - {23E1898F-8262-435C-8848-D4D8824E6D71} = {D626CC4F-BFB1-4030-8DD8-1A3A1D41248E} - {CC07B80F-D44F-41A9-9E37-5F2B47B46EDC} = {D626CC4F-BFB1-4030-8DD8-1A3A1D41248E} - {AE399B7E-2B2C-4A96-9016-C5C74B0A2FA0} = {D626CC4F-BFB1-4030-8DD8-1A3A1D41248E} - {9F31D122-E84D-485A-A58D-09DAD01A56CE} = {4909B0ED-CC22-4509-ACD0-FB60C4FC73ED} - {543D40E9-8CA6-4E4B-9936-90CBA562B268} = {4909B0ED-CC22-4509-ACD0-FB60C4FC73ED} - {4D3B4FF4-535A-4201-AB7D-9AEC1E737A95} = {4909B0ED-CC22-4509-ACD0-FB60C4FC73ED} - {3020FF9B-8202-488D-B137-11DECC510E6E} = {4909B0ED-CC22-4509-ACD0-FB60C4FC73ED} - {664E726B-EEEE-403A-AC15-345D9C9E1375} = {4909B0ED-CC22-4509-ACD0-FB60C4FC73ED} - {F50E74C2-5BE7-4C9B-B1E7-6CA19CFAD34E} = {02DAA1A6-31C8-4002-89FE-50BF53752244} - {83CC6B88-A112-4192-BD5A-F2A249AF2277} = {02DAA1A6-31C8-4002-89FE-50BF53752244} - {30D48874-899F-41C6-9B26-A40C96C91102} = {02DAA1A6-31C8-4002-89FE-50BF53752244} - {431DD5B6-3F2F-47EE-A23F-514BC044B704} = {02DAA1A6-31C8-4002-89FE-50BF53752244} - {42B599D7-BB84-481F-A42A-2DBE0E2E2D7E} = {02DAA1A6-31C8-4002-89FE-50BF53752244} - {8F998497-9C51-4FAA-83E4-1D85B22CBA13} = {02DAA1A6-31C8-4002-89FE-50BF53752244} - {D8DB3E7E-D50E-4EC3-A9B9-DAD18F5FE466} = {683639C3-F209-4EF8-B6CC-8741C61EDECF} - {339A4575-E25B-45D6-94A1-D835891740B8} = {F9F42BF2-3F13-4654-82C5-E27B8879EC4E} - {54DDA60F-E528-4D07-A152-960A1E818680} = {F9F42BF2-3F13-4654-82C5-E27B8879EC4E} - {9DCFD02A-16A0-4766-BC18-66163E21929D} = {F9F42BF2-3F13-4654-82C5-E27B8879EC4E} - {F6B06383-3FFD-403B-9867-4AA82A20AA83} = {F9F42BF2-3F13-4654-82C5-E27B8879EC4E} - {4421516D-10A6-41C1-ADF3-099573BBB0C6} = {F9F42BF2-3F13-4654-82C5-E27B8879EC4E} - {305BAB2D-0D75-4FBC-8BCD-A2917392B48C} = {F9F42BF2-3F13-4654-82C5-E27B8879EC4E} - EndGlobalSection -EndGlobal diff --git a/src/apps/mplayerc/AuthDlg.cpp b/src/apps/mplayerc/AuthDlg.cpp deleted file mode 100644 index 204d67816..000000000 --- a/src/apps/mplayerc/AuthDlg.cpp +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - - -// AuthDlg.cpp : implementation file -// - -#include "stdafx.h" -#include "mplayerc.h" -#include "AuthDlg.h" - -// CAuthDlg dialog - -IMPLEMENT_DYNAMIC(CAuthDlg, CDialog) -CAuthDlg::CAuthDlg(CWnd* pParent /*=NULL*/) - : CDialog(CAuthDlg::IDD, pParent) - , m_username(_T("")) - , m_password(_T("")) - , m_remember(FALSE) -{ -} - -CAuthDlg::~CAuthDlg() -{ -} - -void CAuthDlg::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - DDX_Control(pDX, IDC_COMBO1, m_usernamectrl); - DDX_Text(pDX, IDC_COMBO1, m_username); - DDX_Text(pDX, IDC_EDIT3, m_password); - DDX_Check(pDX, IDC_CHECK1, m_remember); -} - -CString CAuthDlg::DEncrypt(CString str) -{ - for(int i = 0; i < str.GetLength(); i++) - str.SetAt(i, str[i]^5); - return str; -} - - -BEGIN_MESSAGE_MAP(CAuthDlg, CDialog) - ON_BN_CLICKED(IDOK, OnBnClickedOk) - ON_CBN_SELCHANGE(IDC_COMBO1, OnCbnSelchangeCombo1) - ON_EN_SETFOCUS(IDC_EDIT3, OnEnSetfocusEdit3) -END_MESSAGE_MAP() - - -// CAuthDlg message handlers - -BOOL CAuthDlg::OnInitDialog() -{ - CDialog::OnInitDialog(); - - CWinApp* pApp = AfxGetApp(); - - if(pApp->m_pszRegistryKey) - { - CRegKey hSecKey(pApp->GetSectionKey(ResStr(IDS_R_LOGINS))); - if(hSecKey) - { - int i = 0; - TCHAR username[256], password[256]; - while(1) - { - DWORD unlen = countof(username); - DWORD pwlen = sizeof(password); - DWORD type = REG_SZ; - if(ERROR_SUCCESS == RegEnumValue( - hSecKey, i++, username, &unlen, 0, &type, (BYTE*)password, &pwlen)) - { - m_logins[username] = DEncrypt(password); - m_usernamectrl.AddString(username); - } - else - { - break; - } - } - } - } - else - { - CAutoVectorPtr buff; - buff.Allocate(32767/sizeof(TCHAR)); - - DWORD len = GetPrivateProfileSection( - ResStr(IDS_R_LOGINS), buff, 32767/sizeof(TCHAR), pApp->m_pszProfileName); - - TCHAR* p = buff; - while(*p && len > 0) - { - CString str = p; - p += str.GetLength()+1; - len -= str.GetLength()+1; - CAtlList sl; - Explode(str, sl, '=', 2); - if(sl.GetCount() == 2) - { - m_logins[sl.GetHead()] = DEncrypt(sl.GetTail()); - m_usernamectrl.AddString(sl.GetHead()); - } - } - } - - m_usernamectrl.SetFocus(); - - return TRUE; // return TRUE unless you set the focus to a control - // EXCEPTION: OCX Property Pages should return FALSE -} - -void CAuthDlg::OnBnClickedOk() -{ - UpdateData(); - - if(!m_username.IsEmpty()) - { - CWinApp* pApp = AfxGetApp(); - pApp->WriteProfileString(ResStr(IDS_R_LOGINS), m_username, m_remember ? DEncrypt(m_password) : _T("")); - } - - OnOK(); -} - - -void CAuthDlg::OnCbnSelchangeCombo1() -{ - CString username; - m_usernamectrl.GetLBText(m_usernamectrl.GetCurSel(), username); - - CString password; - if(m_logins.Lookup(username, password)) - { - m_password = password; - m_remember = TRUE; - UpdateData(FALSE); - } -} - -void CAuthDlg::OnEnSetfocusEdit3() -{ - UpdateData(); - - CString password; - if(m_logins.Lookup(m_username, password)) - { - m_password = password; - m_remember = TRUE; - UpdateData(FALSE); - } -} diff --git a/src/apps/mplayerc/AuthDlg.h b/src/apps/mplayerc/AuthDlg.h deleted file mode 100644 index 86e9b496c..000000000 --- a/src/apps/mplayerc/AuthDlg.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#pragma once -#include "afxwin.h" - - -// CAuthDlg dialog - -class CAuthDlg : public CDialog -{ - DECLARE_DYNAMIC(CAuthDlg) - -private: - CString DEncrypt(CString pw); - CMapStringToString m_logins; - -public: - CAuthDlg(CWnd* pParent = NULL); // standard constructor - virtual ~CAuthDlg(); - -// Dialog Data - enum { IDD = IDD_AUTH_DLG }; - CComboBox m_usernamectrl; - CString m_username; - CString m_password; - BOOL m_remember; - -protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - virtual BOOL OnInitDialog(); - - DECLARE_MESSAGE_MAP() - -public: - afx_msg void OnBnClickedOk(); - afx_msg void OnCbnSelchangeCombo1(); - afx_msg void OnEnSetfocusEdit3(); -}; diff --git a/src/apps/mplayerc/BaseGraph.cpp b/src/apps/mplayerc/BaseGraph.cpp deleted file mode 100644 index 87a63200a..000000000 --- a/src/apps/mplayerc/BaseGraph.cpp +++ /dev/null @@ -1,354 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include "stdafx.h" -#include "basegraph.h" -#include "..\..\DSUtil\DSUtil.h" - -// -// CPlayerWindow -// - -BOOL CPlayerWindow::PreCreateWindow(CREATESTRUCT& cs) -{ - if(!CWnd::PreCreateWindow(cs)) - return FALSE; - - cs.style &= ~WS_BORDER; - cs.lpszClass = AfxRegisterWndClass(CS_HREDRAW|CS_VREDRAW|CS_DBLCLKS, - ::LoadCursor(NULL, IDC_HAND), NULL, NULL); - - return TRUE; -} - -BEGIN_MESSAGE_MAP(CPlayerWindow, CWnd) - ON_WM_ERASEBKGND() -END_MESSAGE_MAP() - -BOOL CPlayerWindow::OnEraseBkgnd(CDC* pDC) -{ - for(CWnd* pChild = GetWindow(GW_CHILD); pChild; pChild = pChild->GetNextWindow()) - { - if(!pChild->IsWindowVisible()) continue; - - CRect r; - pChild->GetClientRect(&r); - pChild->MapWindowPoints(this, &r); - pDC->ExcludeClipRect(&r); - } - - CRect r; - GetClientRect(&r); - pDC->FillSolidRect(&r, 0); - - return TRUE; -} - -// -// CBaseGraph -// - -CBaseGraph::CBaseGraph() - : CUnknown(NAME("CBaseGraph"), NULL) - , m_hNotifyWnd(NULL) -{ -} - -CBaseGraph::~CBaseGraph() -{ -} - -STDMETHODIMP CBaseGraph::NonDelegatingQueryInterface(REFIID riid, void** ppv) -{ - CheckPointer(ppv, E_POINTER); - - return - QI(IFilterGraph) - QI(IGraphBuilder) - QI(IFilterGraph2) - QI(IGraphBuilder2) - QI(IMediaControl) - QI(IMediaSeeking) - QI(IMediaEventEx) - QI(IVideoWindow) - QI(IBasicVideo) - QI(IBasicAudio) - QI(IAMOpenProgress) - QI(IGraphEngine) - __super::NonDelegatingQueryInterface(riid, ppv); -} - -void CBaseGraph::ClearMessageQueue() -{ - while(!m_msgqueue.IsEmpty()) - { - GMSG msg = m_msgqueue.RemoveHead(); - FreeEventParams(msg.m_lEventCode, msg.m_lParam1, msg.m_lParam2); - } -} - - -void CBaseGraph::NotifyEvent(long lEventCode, LONG_PTR lParam1, LONG_PTR lParam2) -{ - if(!m_hNotifyWnd) return; - - GMSG msg; - msg.m_lEventCode = lEventCode; - msg.m_lParam1 = lParam1; - msg.m_lParam2 = lParam2; - m_msgqueue.AddTail(msg); - - PostMessage((HWND)m_hNotifyWnd, m_lNotifyMsg, 0, m_lNotifyInstData); -} - -// IDispatch -STDMETHODIMP CBaseGraph::GetTypeInfoCount(UINT* pctinfo) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo** ppTInfo) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::GetIDsOfNames(REFIID riid, LPOLESTR* rgszNames, UINT cNames, LCID lcid, DISPID* rgDispId) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pVarResult, EXCEPINFO* pExcepInfo, UINT* puArgErr) {return E_NOTIMPL;} - -// IFilterGraph -STDMETHODIMP CBaseGraph::AddFilter(IBaseFilter* pFilter, LPCWSTR pName) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::RemoveFilter(IBaseFilter* pFilter) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::EnumFilters(IEnumFilters** ppEnum) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::FindFilterByName(LPCWSTR pName, IBaseFilter** ppFilter) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::ConnectDirect(IPin* ppinOut, IPin* ppinIn, const AM_MEDIA_TYPE* pmt) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::Reconnect(IPin* ppin) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::Disconnect(IPin* ppin) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::SetDefaultSyncSource() {return E_NOTIMPL;} - -// IGraphBuilder -STDMETHODIMP CBaseGraph::Connect(IPin* ppinOut, IPin* ppinIn) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::Render(IPin* ppinOut) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::RenderFile(LPCWSTR lpcwstrFile, LPCWSTR lpcwstrPlayList) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::AddSourceFilter(LPCWSTR lpcwstrFileName, LPCWSTR lpcwstrFilterName, IBaseFilter** ppFilter) {*ppFilter = NULL; return RenderFile(lpcwstrFileName, NULL);}//E_NOTIMPL;} -STDMETHODIMP CBaseGraph::SetLogFile(DWORD_PTR hFile) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::Abort() {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::ShouldOperationContinue() {return E_NOTIMPL;} - -// IFilterGraph2 -STDMETHODIMP CBaseGraph::AddSourceFilterForMoniker(IMoniker* pMoniker, IBindCtx* pCtx, LPCWSTR lpcwstrFilterName, IBaseFilter** ppFilter) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::ReconnectEx(IPin* ppin, const AM_MEDIA_TYPE* pmt) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::RenderEx(IPin* pPinOut, DWORD dwFlags, DWORD* pvContext) {return E_NOTIMPL;} - -// IGraphBuilder2 -STDMETHODIMP CBaseGraph::IsPinDirection(IPin* pPin, PIN_DIRECTION dir) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::IsPinConnected(IPin* pPin) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::ConnectFilter(IBaseFilter* pBF, IPin* pPinIn) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::ConnectFilter(IPin* pPinOut, IBaseFilter* pBF) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::ConnectFilterDirect(IPin* pPinOut, IBaseFilter* pBF, const AM_MEDIA_TYPE* pmt) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::NukeDownstream(IUnknown* pUnk) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::FindInterface(REFIID iid, void** ppv, BOOL bRemove) {return QueryInterface(iid, ppv);} -STDMETHODIMP CBaseGraph::AddToROT() {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::RemoveFromROT() {return E_NOTIMPL;} - -// IMediaControl -STDMETHODIMP CBaseGraph::Run() {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::Pause() {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::Stop() {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::GetState(LONG msTimeout, OAFilterState* pfs) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::RenderFile(BSTR strFilename) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::AddSourceFilter(BSTR strFilename, IDispatch** ppUnk) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::get_FilterCollection(IDispatch** ppUnk) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::get_RegFilterCollection(IDispatch** ppUnk) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::StopWhenReady() {return Stop();} - -// IMediaEvent -STDMETHODIMP CBaseGraph::GetEventHandle(OAEVENT* hEvent) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::GetEvent(long* lEventCode, LONG_PTR* lParam1, LONG_PTR* lParam2, long msTimeout) -{ - if(m_msgqueue.IsEmpty()) return E_FAIL; - - GMSG msg = m_msgqueue.RemoveHead(); - if(lEventCode) *lEventCode = msg.m_lEventCode; - if(lParam1) *lParam1 = msg.m_lParam1; - if(lParam2) *lParam2 = msg.m_lParam2; - - return S_OK; -} -STDMETHODIMP CBaseGraph::WaitForCompletion(long msTimeout, long* pEvCode) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::CancelDefaultHandling(long lEvCode) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::RestoreDefaultHandling(long lEvCode) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::FreeEventParams(long lEvCode, LONG_PTR lParam1, LONG_PTR lParam2) -{ - if(EC_BG_ERROR == lEvCode) - { - if(lParam1) CoTaskMemFree((void*)lParam1); - } - - return S_OK; -} - -// IMediaEventEx -STDMETHODIMP CBaseGraph::SetNotifyWindow(OAHWND hwnd, long lMsg, LONG_PTR lInstanceData) -{ - m_hNotifyWnd = hwnd; - m_lNotifyMsg = lMsg; - m_lNotifyInstData = lInstanceData; - - if(!IsWindow((HWND)m_hNotifyWnd)) - { - m_hNotifyWnd = NULL; - return E_FAIL; - } - - return S_OK; -} -STDMETHODIMP CBaseGraph::SetNotifyFlags(long lNoNotifyFlags) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::GetNotifyFlags(long* lplNoNotifyFlags) {return E_NOTIMPL;} - -// IMediaSeeking -STDMETHODIMP CBaseGraph::GetCapabilities(DWORD* pCapabilities) -{ - return pCapabilities ? *pCapabilities = AM_SEEKING_CanSeekAbsolute|AM_SEEKING_CanGetCurrentPos|AM_SEEKING_CanGetDuration, S_OK : E_POINTER; -} -STDMETHODIMP CBaseGraph::CheckCapabilities(DWORD* pCapabilities) -{ - CheckPointer(pCapabilities, E_POINTER); - - if(*pCapabilities == 0) return S_OK; - - DWORD caps; - GetCapabilities(&caps); - - DWORD caps2 = caps & *pCapabilities; - - return caps2 == 0 ? E_FAIL : caps2 == *pCapabilities ? S_OK : S_FALSE; -} -STDMETHODIMP CBaseGraph::IsFormatSupported(const GUID* pFormat) -{ - return !pFormat ? E_POINTER : *pFormat == TIME_FORMAT_MEDIA_TIME ? S_OK : S_FALSE; -} -STDMETHODIMP CBaseGraph::QueryPreferredFormat(GUID* pFormat) -{ - return GetTimeFormat(pFormat); -} -STDMETHODIMP CBaseGraph::GetTimeFormat(GUID* pFormat) -{ - return pFormat ? *pFormat = TIME_FORMAT_MEDIA_TIME, S_OK : E_POINTER; -} -STDMETHODIMP CBaseGraph::IsUsingTimeFormat(const GUID* pFormat) -{ - return IsFormatSupported(pFormat); -} -STDMETHODIMP CBaseGraph::SetTimeFormat(const GUID* pFormat) -{ - return S_OK == IsFormatSupported(pFormat) ? S_OK : E_INVALIDARG; -} -STDMETHODIMP CBaseGraph::GetDuration(LONGLONG* pDuration) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::GetStopPosition(LONGLONG* pStop) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::GetCurrentPosition(LONGLONG* pCurrent) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::ConvertTimeFormat(LONGLONG* pTarget, const GUID* pTargetFormat, LONGLONG Source, const GUID* pSourceFormat) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::SetPositions(LONGLONG* pCurrent, DWORD dwCurrentFlags, LONGLONG* pStop, DWORD dwStopFlags) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::GetPositions(LONGLONG* pCurrent, LONGLONG* pStop) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::GetAvailable(LONGLONG* pEarliest, LONGLONG* pLatest) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::SetRate(double dRate) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::GetRate(double* pdRate) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::GetPreroll(LONGLONG* pllPreroll) {return E_NOTIMPL;} - -// IVideoWindow -STDMETHODIMP CBaseGraph::put_Caption(BSTR strCaption) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::get_Caption(BSTR* strCaption) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::put_WindowStyle(long WindowStyle) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::get_WindowStyle(long* WindowStyle) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::put_WindowStyleEx(long WindowStyleEx) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::get_WindowStyleEx(long* WindowStyleEx) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::put_AutoShow(long AutoShow) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::get_AutoShow(long* AutoShow) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::put_WindowState(long WindowState) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::get_WindowState(long* WindowState) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::put_BackgroundPalette(long BackgroundPalette) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::get_BackgroundPalette(long* pBackgroundPalette) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::put_Visible(long Visible) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::get_Visible(long* pVisible) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::put_Left(long Left) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::get_Left(long* pLeft) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::put_Width(long Width) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::get_Width(long* pWidth) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::put_Top(long Top) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::get_Top(long* pTop) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::put_Height(long Height) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::get_Height(long* pHeight) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::put_Owner(OAHWND Owner) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::get_Owner(OAHWND* Owner) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::put_MessageDrain(OAHWND Drain) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::get_MessageDrain(OAHWND* Drain) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::get_BorderColor(long* Color) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::put_BorderColor(long Color) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::get_FullScreenMode(long* FullScreenMode) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::put_FullScreenMode(long FullScreenMode) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::SetWindowForeground(long Focus) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::NotifyOwnerMessage(OAHWND hwnd, long uMsg, LONG_PTR wParam, LONG_PTR lParam) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::SetWindowPosition(long Left, long Top, long Width, long Height) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::GetWindowPosition(long* pLeft, long* pTop, long* pWidth, long* pHeight) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::GetMinIdealImageSize(long* pWidth, long* pHeight) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::GetMaxIdealImageSize(long* pWidth, long* pHeight) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::GetRestorePosition(long* pLeft, long* pTop, long* pWidth, long* pHeight) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::HideCursor(long HideCursor) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::IsCursorHidden(long* CursorHidden) {return E_NOTIMPL;} - -// IBasicVideo -STDMETHODIMP CBaseGraph::get_AvgTimePerFrame(REFTIME* pAvgTimePerFrame) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::get_BitRate(long* pBitRate) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::get_BitErrorRate(long* pBitErrorRate) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::get_VideoWidth(long* pVideoWidth) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::get_VideoHeight(long* pVideoHeight) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::put_SourceLeft(long SourceLeft) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::get_SourceLeft(long* pSourceLeft) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::put_SourceWidth(long SourceWidth) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::get_SourceWidth(long* pSourceWidth) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::put_SourceTop(long SourceTop) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::get_SourceTop(long* pSourceTop) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::put_SourceHeight(long SourceHeight) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::get_SourceHeight(long* pSourceHeight) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::put_DestinationLeft(long DestinationLeft) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::get_DestinationLeft(long* pDestinationLeft) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::put_DestinationWidth(long DestinationWidth) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::get_DestinationWidth(long* pDestinationWidth) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::put_DestinationTop(long DestinationTop) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::get_DestinationTop(long* pDestinationTop) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::put_DestinationHeight(long DestinationHeight) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::get_DestinationHeight(long* pDestinationHeight) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::SetSourcePosition(long Left, long Top, long Width, long Height) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::GetSourcePosition(long* pLeft, long* pTop, long* pWidth, long* pHeight) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::SetDefaultSourcePosition() {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::SetDestinationPosition(long Left, long Top, long Width, long Height) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::GetDestinationPosition(long* pLeft, long* pTop, long* pWidth, long* pHeight) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::SetDefaultDestinationPosition() {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::GetVideoSize(long* pWidth, long* pHeight) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::GetVideoPaletteEntries(long StartIndex, long Entries, long* pRetrieved, long* pPalette) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::GetCurrentImage(long* pBufferSize, long* pDIBImage) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::IsUsingDefaultSource() {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::IsUsingDefaultDestination() {return E_NOTIMPL;} - -// IBasicAudio -STDMETHODIMP CBaseGraph::put_Volume(long lVolume) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::get_Volume(long* plVolume) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::put_Balance(long lBalance) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::get_Balance(long* plBalance) {return E_NOTIMPL;} - -// IAMOpenProgress -STDMETHODIMP CBaseGraph::QueryProgress(LONGLONG* pllTotal, LONGLONG* pllCurrent) {return E_NOTIMPL;} -STDMETHODIMP CBaseGraph::AbortOperation() {return E_NOTIMPL;} - -// IGraphEngine -STDMETHODIMP_(engine_t) CBaseGraph::GetEngine() {return DirectShow;} - diff --git a/src/apps/mplayerc/BaseGraph.h b/src/apps/mplayerc/BaseGraph.h deleted file mode 100644 index fd56597be..000000000 --- a/src/apps/mplayerc/BaseGraph.h +++ /dev/null @@ -1,255 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#pragma once - -#include "IGraphBuilder2.h" - -class CPlayerWindow : public CWnd -{ -public: - CPlayerWindow() {} - -protected: - virtual BOOL PreCreateWindow(CREATESTRUCT& cs); - afx_msg BOOL OnEraseBkgnd(CDC* pDC); - DECLARE_MESSAGE_MAP() -}; - -typedef enum {DirectShow = 0, RealMedia, QuickTime, ShockWave} engine_t; - -[uuid("B110CDE5-6331-4118-8AAF-A870D6F7E2E4")] -interface IGraphEngine : public IUnknown -{ - STDMETHOD_(engine_t, GetEngine) () = 0; -}; - -enum -{ - EC_BG_AUDIO_CHANGED = EC_USER+1, - EC_BG_ERROR -}; - -class CBaseGraph - : public CUnknown - , public IGraphBuilder2 - , public IMediaControl - , public IMediaEventEx - , public IMediaSeeking - , public IVideoWindow - , public IBasicVideo - , public IBasicAudio - , public IAMOpenProgress - , public IGraphEngine -{ - OAHWND m_hNotifyWnd; - long m_lNotifyMsg; - LONG_PTR m_lNotifyInstData; - - typedef struct {long m_lEventCode; LONG_PTR m_lParam1, m_lParam2;} GMSG; - CList m_msgqueue; - -protected: - void ClearMessageQueue(); - -public: - CBaseGraph(); - virtual ~CBaseGraph(); - - DECLARE_IUNKNOWN; - STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv); - - void NotifyEvent(long lEventCode, LONG_PTR lParam1 = 0, LONG_PTR lParam2 = 0); - -protected: - // IDispatch - STDMETHODIMP GetTypeInfoCount(UINT* pctinfo); - STDMETHODIMP GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo** ppTInfo); - STDMETHODIMP GetIDsOfNames(REFIID riid, LPOLESTR* rgszNames, UINT cNames, LCID lcid, DISPID* rgDispId); - STDMETHODIMP Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pVarResult, EXCEPINFO* pExcepInfo, UINT* puArgErr); - - // IFilterGraph - STDMETHODIMP AddFilter(IBaseFilter* pFilter, LPCWSTR pName); - STDMETHODIMP RemoveFilter(IBaseFilter* pFilter); - STDMETHODIMP EnumFilters(IEnumFilters** ppEnum); - STDMETHODIMP FindFilterByName(LPCWSTR pName, IBaseFilter** ppFilter); - STDMETHODIMP ConnectDirect(IPin* ppinOut, IPin* ppinIn, const AM_MEDIA_TYPE* pmt); - STDMETHODIMP Reconnect(IPin* ppin); - STDMETHODIMP Disconnect(IPin* ppin); - STDMETHODIMP SetDefaultSyncSource(); - - // IGraphBuilder - STDMETHODIMP Connect(IPin* ppinOut, IPin* ppinIn); - STDMETHODIMP Render(IPin* ppinOut); - STDMETHODIMP RenderFile(LPCWSTR lpcwstrFile, LPCWSTR lpcwstrPlayList); - STDMETHODIMP AddSourceFilter(LPCWSTR lpcwstrFileName, LPCWSTR lpcwstrFilterName, IBaseFilter** ppFilter); - STDMETHODIMP SetLogFile(DWORD_PTR hFile); - STDMETHODIMP Abort(); - STDMETHODIMP ShouldOperationContinue(); - - // IFilterGraph2 - STDMETHODIMP AddSourceFilterForMoniker(IMoniker* pMoniker, IBindCtx* pCtx, LPCWSTR lpcwstrFilterName, IBaseFilter** ppFilter); - STDMETHODIMP ReconnectEx(IPin* ppin, const AM_MEDIA_TYPE* pmt); - STDMETHODIMP RenderEx(IPin* pPinOut, DWORD dwFlags, DWORD* pvContext); - - // IGraphBuilder2 - STDMETHODIMP IsPinDirection(IPin* pPin, PIN_DIRECTION dir); - STDMETHODIMP IsPinConnected(IPin* pPin); - STDMETHODIMP ConnectFilter(IBaseFilter* pBF, IPin* pPinIn); - STDMETHODIMP ConnectFilter(IPin* pPinOut, IBaseFilter* pBF); - STDMETHODIMP ConnectFilterDirect(IPin* pPinOut, IBaseFilter* pBF, const AM_MEDIA_TYPE* pmt); - STDMETHODIMP NukeDownstream(IUnknown* pUnk); - STDMETHODIMP FindInterface(REFIID iid, void** ppv, BOOL bRemove); - STDMETHODIMP AddToROT(); - STDMETHODIMP RemoveFromROT(); - - // IMediaControl - STDMETHODIMP Run(); - STDMETHODIMP Pause(); - STDMETHODIMP Stop(); - STDMETHODIMP GetState(LONG msTimeout, OAFilterState* pfs); - STDMETHODIMP RenderFile(BSTR strFilename); - STDMETHODIMP AddSourceFilter(BSTR strFilename, IDispatch** ppUnk); - STDMETHODIMP get_FilterCollection(IDispatch** ppUnk); - STDMETHODIMP get_RegFilterCollection(IDispatch** ppUnk); - STDMETHODIMP StopWhenReady(); - - // IMediaEvent - STDMETHODIMP GetEventHandle(OAEVENT* hEvent); - STDMETHODIMP GetEvent(long* lEventCode, LONG_PTR* lParam1, LONG_PTR* lParam2, long msTimeout); - STDMETHODIMP WaitForCompletion(long msTimeout, long* pEvCode); - STDMETHODIMP CancelDefaultHandling(long lEvCode); - STDMETHODIMP RestoreDefaultHandling(long lEvCode); - STDMETHODIMP FreeEventParams(long lEvCode, LONG_PTR lParam1, LONG_PTR lParam2); - - // IMediaEventEx - STDMETHODIMP SetNotifyWindow(OAHWND hwnd, long lMsg, LONG_PTR lInstanceData); - STDMETHODIMP SetNotifyFlags(long lNoNotifyFlags); - STDMETHODIMP GetNotifyFlags(long* lplNoNotifyFlags); - - // IMediaSeeking - STDMETHODIMP GetCapabilities(DWORD* pCapabilities); - STDMETHODIMP CheckCapabilities(DWORD* pCapabilities); - STDMETHODIMP IsFormatSupported(const GUID* pFormat); - STDMETHODIMP QueryPreferredFormat(GUID* pFormat); - STDMETHODIMP GetTimeFormat(GUID* pFormat); - STDMETHODIMP IsUsingTimeFormat(const GUID* pFormat); - STDMETHODIMP SetTimeFormat(const GUID* pFormat); - STDMETHODIMP GetDuration(LONGLONG* pDuration); - STDMETHODIMP GetStopPosition(LONGLONG* pStop); - STDMETHODIMP GetCurrentPosition(LONGLONG* pCurrent); - STDMETHODIMP ConvertTimeFormat(LONGLONG* pTarget, const GUID* pTargetFormat, LONGLONG Source, const GUID* pSourceFormat); - STDMETHODIMP SetPositions(LONGLONG* pCurrent, DWORD dwCurrentFlags, LONGLONG* pStop, DWORD dwStopFlags); - STDMETHODIMP GetPositions(LONGLONG* pCurrent, LONGLONG* pStop); - STDMETHODIMP GetAvailable(LONGLONG* pEarliest, LONGLONG* pLatest); - STDMETHODIMP SetRate(double dRate); - STDMETHODIMP GetRate(double* pdRate); - STDMETHODIMP GetPreroll(LONGLONG* pllPreroll); - - // IVideoWindow - STDMETHODIMP put_Caption(BSTR strCaption); - STDMETHODIMP get_Caption(BSTR* strCaption); - STDMETHODIMP put_WindowStyle(long WindowStyle); - STDMETHODIMP get_WindowStyle(long* WindowStyle); - STDMETHODIMP put_WindowStyleEx(long WindowStyleEx); - STDMETHODIMP get_WindowStyleEx(long* WindowStyleEx); - STDMETHODIMP put_AutoShow(long AutoShow); - STDMETHODIMP get_AutoShow(long* AutoShow); - STDMETHODIMP put_WindowState(long WindowState); - STDMETHODIMP get_WindowState(long* WindowState); - STDMETHODIMP put_BackgroundPalette(long BackgroundPalette); - STDMETHODIMP get_BackgroundPalette(long* pBackgroundPalette); - STDMETHODIMP put_Visible(long Visible); - STDMETHODIMP get_Visible(long* pVisible); - STDMETHODIMP put_Left(long Left); - STDMETHODIMP get_Left(long* pLeft); - STDMETHODIMP put_Width(long Width); - STDMETHODIMP get_Width(long* pWidth); - STDMETHODIMP put_Top(long Top); - STDMETHODIMP get_Top(long* pTop); - STDMETHODIMP put_Height(long Height); - STDMETHODIMP get_Height(long* pHeight); - STDMETHODIMP put_Owner(OAHWND Owner); - STDMETHODIMP get_Owner(OAHWND* Owner); - STDMETHODIMP put_MessageDrain(OAHWND Drain); - STDMETHODIMP get_MessageDrain(OAHWND* Drain); - STDMETHODIMP get_BorderColor(long* Color); - STDMETHODIMP put_BorderColor(long Color); - STDMETHODIMP get_FullScreenMode(long* FullScreenMode); - STDMETHODIMP put_FullScreenMode(long FullScreenMode); - STDMETHODIMP SetWindowForeground(long Focus); - STDMETHODIMP NotifyOwnerMessage(OAHWND hwnd, long uMsg, LONG_PTR wParam, LONG_PTR lParam); - STDMETHODIMP SetWindowPosition(long Left, long Top, long Width, long Height); - STDMETHODIMP GetWindowPosition(long* pLeft, long* pTop, long* pWidth, long* pHeight); - STDMETHODIMP GetMinIdealImageSize(long* pWidth, long* pHeight); - STDMETHODIMP GetMaxIdealImageSize(long* pWidth, long* pHeight); - STDMETHODIMP GetRestorePosition(long* pLeft, long* pTop, long* pWidth, long* pHeight); - STDMETHODIMP HideCursor(long HideCursor); - STDMETHODIMP IsCursorHidden(long* CursorHidden); - - // IBasicVideo - STDMETHODIMP get_AvgTimePerFrame(REFTIME* pAvgTimePerFrame); - STDMETHODIMP get_BitRate(long* pBitRate); - STDMETHODIMP get_BitErrorRate(long* pBitErrorRate); - STDMETHODIMP get_VideoWidth(long* pVideoWidth); - STDMETHODIMP get_VideoHeight(long* pVideoHeight); - STDMETHODIMP put_SourceLeft(long SourceLeft); - STDMETHODIMP get_SourceLeft(long* pSourceLeft); - STDMETHODIMP put_SourceWidth(long SourceWidth); - STDMETHODIMP get_SourceWidth(long* pSourceWidth); - STDMETHODIMP put_SourceTop(long SourceTop); - STDMETHODIMP get_SourceTop(long* pSourceTop); - STDMETHODIMP put_SourceHeight(long SourceHeight); - STDMETHODIMP get_SourceHeight(long* pSourceHeight); - STDMETHODIMP put_DestinationLeft(long DestinationLeft); - STDMETHODIMP get_DestinationLeft(long* pDestinationLeft); - STDMETHODIMP put_DestinationWidth(long DestinationWidth); - STDMETHODIMP get_DestinationWidth(long* pDestinationWidth); - STDMETHODIMP put_DestinationTop(long DestinationTop); - STDMETHODIMP get_DestinationTop(long* pDestinationTop); - STDMETHODIMP put_DestinationHeight(long DestinationHeight); - STDMETHODIMP get_DestinationHeight(long* pDestinationHeight); - STDMETHODIMP SetSourcePosition(long Left, long Top, long Width, long Height); - STDMETHODIMP GetSourcePosition(long* pLeft, long* pTop, long* pWidth, long* pHeight); - STDMETHODIMP SetDefaultSourcePosition(); - STDMETHODIMP SetDestinationPosition(long Left, long Top, long Width, long Height); - STDMETHODIMP GetDestinationPosition(long* pLeft, long* pTop, long* pWidth, long* pHeight); - STDMETHODIMP SetDefaultDestinationPosition(); - STDMETHODIMP GetVideoSize(long* pWidth, long* pHeight); - STDMETHODIMP GetVideoPaletteEntries(long StartIndex, long Entries, long* pRetrieved, long* pPalette); - STDMETHODIMP GetCurrentImage(long* pBufferSize, long* pDIBImage); - STDMETHODIMP IsUsingDefaultSource(); - STDMETHODIMP IsUsingDefaultDestination(); - - // IBasicAudio - STDMETHODIMP put_Volume(long lVolume); - STDMETHODIMP get_Volume(long* plVolume); - STDMETHODIMP put_Balance(long lBalance); - STDMETHODIMP get_Balance(long* plBalance); - - // IAMOpenProgress - STDMETHODIMP QueryProgress(LONGLONG* pllTotal, LONGLONG* pllCurrent); - STDMETHODIMP AbortOperation(); - - // IGraphEngine - STDMETHODIMP_(engine_t) GetEngine(); -}; - diff --git a/src/apps/mplayerc/CShockwaveFlash.cpp b/src/apps/mplayerc/CShockwaveFlash.cpp deleted file mode 100644 index 002a1249e..000000000 --- a/src/apps/mplayerc/CShockwaveFlash.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -// CShockwaveFlash.cpp : Definition of ActiveX Control wrapper class(es) created by Microsoft Visual C++ - - -#include "stdafx.h" -#include "CShockwaveFlash.h" - -///////////////////////////////////////////////////////////////////////////// -// CShockwaveFlash - -IMPLEMENT_DYNCREATE(CShockwaveFlash, CWnd) - -// CShockwaveFlash properties - -// CShockwaveFlash operations diff --git a/src/apps/mplayerc/CShockwaveFlash.h b/src/apps/mplayerc/CShockwaveFlash.h deleted file mode 100644 index da084cffe..000000000 --- a/src/apps/mplayerc/CShockwaveFlash.h +++ /dev/null @@ -1,462 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -// CShockwaveFlash.h : Declaration of ActiveX Control wrapper class(es) created by Microsoft Visual C++ - -#pragma once - -///////////////////////////////////////////////////////////////////////////// -// CShockwaveFlash - -class CShockwaveFlash : public CWnd -{ -protected: - DECLARE_DYNCREATE(CShockwaveFlash) -public: - CLSID const& GetClsid() - { - static CLSID const clsid - = { 0xD27CDB6E, 0xAE6D, 0x11CF, { 0x96, 0xB8, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0 } }; - return clsid; - } - virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, - const RECT& rect, CWnd* pParentWnd, UINT nID, - CCreateContext* pContext = NULL) - { - return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, nID); - } - - BOOL Create(LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, - UINT nID, CFile* pPersist = NULL, BOOL bStorage = FALSE, - BSTR bstrLicKey = NULL) - { - return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, nID, - pPersist, bStorage, bstrLicKey); - } - -// Attributes -public: - -// Operations -public: - - long get_ReadyState() - { - long result; - InvokeHelper(DISPID_READYSTATE, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL); - return result; - } - long get_TotalFrames() - { - long result; - InvokeHelper(0x7c, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL); - return result; - } - BOOL get_Playing() - { - BOOL result; - InvokeHelper(0x7d, DISPATCH_PROPERTYGET, VT_BOOL, (void*)&result, NULL); - return result; - } - void put_Playing(BOOL newValue) - { - static BYTE parms[] = VTS_BOOL ; - InvokeHelper(0x7d, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue); - } - long get_Quality() - { - long result; - InvokeHelper(0x69, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL); - return result; - } - void put_Quality(long newValue) - { - static BYTE parms[] = VTS_I4 ; - InvokeHelper(0x69, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue); - } - long get_ScaleMode() - { - long result; - InvokeHelper(0x78, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL); - return result; - } - void put_ScaleMode(long newValue) - { - static BYTE parms[] = VTS_I4 ; - InvokeHelper(0x78, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue); - } - long get_AlignMode() - { - long result; - InvokeHelper(0x79, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL); - return result; - } - void put_AlignMode(long newValue) - { - static BYTE parms[] = VTS_I4 ; - InvokeHelper(0x79, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue); - } - long get_BackgroundColor() - { - long result; - InvokeHelper(0x7b, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL); - return result; - } - void put_BackgroundColor(long newValue) - { - static BYTE parms[] = VTS_I4 ; - InvokeHelper(0x7b, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue); - } - BOOL get_Loop() - { - BOOL result; - InvokeHelper(0x6a, DISPATCH_PROPERTYGET, VT_BOOL, (void*)&result, NULL); - return result; - } - void put_Loop(BOOL newValue) - { - static BYTE parms[] = VTS_BOOL ; - InvokeHelper(0x6a, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue); - } - CString get_Movie() - { - CString result; - InvokeHelper(0x66, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL); - return result; - } - void put_Movie(LPCTSTR newValue) - { - static BYTE parms[] = VTS_BSTR ; - InvokeHelper(0x66, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue); - } - long get_FrameNum() - { - long result; - InvokeHelper(0x6b, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL); - return result; - } - void put_FrameNum(long newValue) - { - static BYTE parms[] = VTS_I4 ; - InvokeHelper(0x6b, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue); - } - void SetZoomRect(long left, long top, long right, long bottom) - { - static BYTE parms[] = VTS_I4 VTS_I4 VTS_I4 VTS_I4 ; - InvokeHelper(0x6d, DISPATCH_METHOD, VT_EMPTY, NULL, parms, left, top, right, bottom); - } - void Zoom(long factor) - { - static BYTE parms[] = VTS_I4 ; - InvokeHelper(0x76, DISPATCH_METHOD, VT_EMPTY, NULL, parms, factor); - } - void Pan(long x, long y, long mode) - { - static BYTE parms[] = VTS_I4 VTS_I4 VTS_I4 ; - InvokeHelper(0x77, DISPATCH_METHOD, VT_EMPTY, NULL, parms, x, y, mode); - } - void Play() - { - InvokeHelper(0x70, DISPATCH_METHOD, VT_EMPTY, NULL, NULL); - } - void Stop() - { - InvokeHelper(0x71, DISPATCH_METHOD, VT_EMPTY, NULL, NULL); - } - void Back() - { - InvokeHelper(0x72, DISPATCH_METHOD, VT_EMPTY, NULL, NULL); - } - void Forward() - { - InvokeHelper(0x73, DISPATCH_METHOD, VT_EMPTY, NULL, NULL); - } - void Rewind() - { - InvokeHelper(0x74, DISPATCH_METHOD, VT_EMPTY, NULL, NULL); - } - void StopPlay() - { - InvokeHelper(0x7e, DISPATCH_METHOD, VT_EMPTY, NULL, NULL); - } - void GotoFrame(long FrameNum) - { - static BYTE parms[] = VTS_I4 ; - InvokeHelper(0x7f, DISPATCH_METHOD, VT_EMPTY, NULL, parms, FrameNum); - } - long CurrentFrame() - { - long result; - InvokeHelper(0x80, DISPATCH_METHOD, VT_I4, (void*)&result, NULL); - return result; - } - BOOL IsPlaying() - { - BOOL result; - InvokeHelper(0x81, DISPATCH_METHOD, VT_BOOL, (void*)&result, NULL); - return result; - } - long PercentLoaded() - { - long result; - InvokeHelper(0x82, DISPATCH_METHOD, VT_I4, (void*)&result, NULL); - return result; - } - BOOL FrameLoaded(long FrameNum) - { - BOOL result; - static BYTE parms[] = VTS_I4 ; - InvokeHelper(0x83, DISPATCH_METHOD, VT_BOOL, (void*)&result, parms, FrameNum); - return result; - } - long FlashVersion() - { - long result; - InvokeHelper(0x84, DISPATCH_METHOD, VT_I4, (void*)&result, NULL); - return result; - } - CString get_WMode() - { - CString result; - InvokeHelper(0x85, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL); - return result; - } - void put_WMode(LPCTSTR newValue) - { - static BYTE parms[] = VTS_BSTR ; - InvokeHelper(0x85, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue); - } - CString get_SAlign() - { - CString result; - InvokeHelper(0x86, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL); - return result; - } - void put_SAlign(LPCTSTR newValue) - { - static BYTE parms[] = VTS_BSTR ; - InvokeHelper(0x86, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue); - } - BOOL get_Menu() - { - BOOL result; - InvokeHelper(0x87, DISPATCH_PROPERTYGET, VT_BOOL, (void*)&result, NULL); - return result; - } - void put_Menu(BOOL newValue) - { - static BYTE parms[] = VTS_BOOL ; - InvokeHelper(0x87, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue); - } - CString get_Base() - { - CString result; - InvokeHelper(0x88, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL); - return result; - } - void put_Base(LPCTSTR newValue) - { - static BYTE parms[] = VTS_BSTR ; - InvokeHelper(0x88, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue); - } - CString get_Scale() - { - CString result; - InvokeHelper(0x89, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL); - return result; - } - void put_Scale(LPCTSTR newValue) - { - static BYTE parms[] = VTS_BSTR ; - InvokeHelper(0x89, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue); - } - BOOL get_DeviceFont() - { - BOOL result; - InvokeHelper(0x8a, DISPATCH_PROPERTYGET, VT_BOOL, (void*)&result, NULL); - return result; - } - void put_DeviceFont(BOOL newValue) - { - static BYTE parms[] = VTS_BOOL ; - InvokeHelper(0x8a, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue); - } - BOOL get_EmbedMovie() - { - BOOL result; - InvokeHelper(0x8b, DISPATCH_PROPERTYGET, VT_BOOL, (void*)&result, NULL); - return result; - } - void put_EmbedMovie(BOOL newValue) - { - static BYTE parms[] = VTS_BOOL ; - InvokeHelper(0x8b, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue); - } - CString get_BGColor() - { - CString result; - InvokeHelper(0x8c, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL); - return result; - } - void put_BGColor(LPCTSTR newValue) - { - static BYTE parms[] = VTS_BSTR ; - InvokeHelper(0x8c, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue); - } - CString get_Quality2() - { - CString result; - InvokeHelper(0x8d, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL); - return result; - } - void put_Quality2(LPCTSTR newValue) - { - static BYTE parms[] = VTS_BSTR ; - InvokeHelper(0x8d, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue); - } - void LoadMovie(long layer, LPCTSTR url) - { - static BYTE parms[] = VTS_I4 VTS_BSTR ; - InvokeHelper(0x8e, DISPATCH_METHOD, VT_EMPTY, NULL, parms, layer, url); - } - void TGotoFrame(LPCTSTR target, long FrameNum) - { - static BYTE parms[] = VTS_BSTR VTS_I4 ; - InvokeHelper(0x8f, DISPATCH_METHOD, VT_EMPTY, NULL, parms, target, FrameNum); - } - void TGotoLabel(LPCTSTR target, LPCTSTR label) - { - static BYTE parms[] = VTS_BSTR VTS_BSTR ; - InvokeHelper(0x90, DISPATCH_METHOD, VT_EMPTY, NULL, parms, target, label); - } - long TCurrentFrame(LPCTSTR target) - { - long result; - static BYTE parms[] = VTS_BSTR ; - InvokeHelper(0x91, DISPATCH_METHOD, VT_I4, (void*)&result, parms, target); - return result; - } - CString TCurrentLabel(LPCTSTR target) - { - CString result; - static BYTE parms[] = VTS_BSTR ; - InvokeHelper(0x92, DISPATCH_METHOD, VT_BSTR, (void*)&result, parms, target); - return result; - } - void TPlay(LPCTSTR target) - { - static BYTE parms[] = VTS_BSTR ; - InvokeHelper(0x93, DISPATCH_METHOD, VT_EMPTY, NULL, parms, target); - } - void TStopPlay(LPCTSTR target) - { - static BYTE parms[] = VTS_BSTR ; - InvokeHelper(0x94, DISPATCH_METHOD, VT_EMPTY, NULL, parms, target); - } - void SetVariable(LPCTSTR name, LPCTSTR value) - { - static BYTE parms[] = VTS_BSTR VTS_BSTR ; - InvokeHelper(0x97, DISPATCH_METHOD, VT_EMPTY, NULL, parms, name, value); - } - CString GetVariable(LPCTSTR name) - { - CString result; - static BYTE parms[] = VTS_BSTR ; - InvokeHelper(0x98, DISPATCH_METHOD, VT_BSTR, (void*)&result, parms, name); - return result; - } - void TSetProperty(LPCTSTR target, long property, LPCTSTR value) - { - static BYTE parms[] = VTS_BSTR VTS_I4 VTS_BSTR ; - InvokeHelper(0x99, DISPATCH_METHOD, VT_EMPTY, NULL, parms, target, property, value); - } - CString TGetProperty(LPCTSTR target, long property) - { - CString result; - static BYTE parms[] = VTS_BSTR VTS_I4 ; - InvokeHelper(0x9a, DISPATCH_METHOD, VT_BSTR, (void*)&result, parms, target, property); - return result; - } - void TCallFrame(LPCTSTR target, long FrameNum) - { - static BYTE parms[] = VTS_BSTR VTS_I4 ; - InvokeHelper(0x9b, DISPATCH_METHOD, VT_EMPTY, NULL, parms, target, FrameNum); - } - void TCallLabel(LPCTSTR target, LPCTSTR label) - { - static BYTE parms[] = VTS_BSTR VTS_BSTR ; - InvokeHelper(0x9c, DISPATCH_METHOD, VT_EMPTY, NULL, parms, target, label); - } - void TSetPropertyNum(LPCTSTR target, long property, double value) - { - static BYTE parms[] = VTS_BSTR VTS_I4 VTS_R8 ; - InvokeHelper(0x9d, DISPATCH_METHOD, VT_EMPTY, NULL, parms, target, property, value); - } - double TGetPropertyNum(LPCTSTR target, long property) - { - double result; - static BYTE parms[] = VTS_BSTR VTS_I4 ; - InvokeHelper(0x9e, DISPATCH_METHOD, VT_R8, (void*)&result, parms, target, property); - return result; - } - double TGetPropertyAsNumber(LPCTSTR target, long property) - { - double result; - static BYTE parms[] = VTS_BSTR VTS_I4 ; - InvokeHelper(0xac, DISPATCH_METHOD, VT_R8, (void*)&result, parms, target, property); - return result; - } - CString get_SWRemote() - { - CString result; - InvokeHelper(0x9f, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL); - return result; - } - void put_SWRemote(LPCTSTR newValue) - { - static BYTE parms[] = VTS_BSTR ; - InvokeHelper(0x9f, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue); - } - CString get_FlashVars() - { - CString result; - InvokeHelper(0xaa, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL); - return result; - } - void put_FlashVars(LPCTSTR newValue) - { - static BYTE parms[] = VTS_BSTR ; - InvokeHelper(0xaa, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue); - } - CString get_AllowScriptAccess() - { - CString result; - InvokeHelper(0xab, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL); - return result; - } - void put_AllowScriptAccess(LPCTSTR newValue) - { - static BYTE parms[] = VTS_BSTR ; - InvokeHelper(0xab, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue); - } - - -}; diff --git a/src/apps/mplayerc/ChildView.cpp b/src/apps/mplayerc/ChildView.cpp deleted file mode 100644 index bec015bd6..000000000 --- a/src/apps/mplayerc/ChildView.cpp +++ /dev/null @@ -1,286 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -// ChildView.cpp : implementation of the CChildView class -// - -#include "stdafx.h" -#include "mplayerc.h" -#include "ChildView.h" -#include "MainFrm.h" -#include "libpng.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CChildView - -CChildView::CChildView() : m_vrect(0,0,0,0) -{ - m_lastlmdowntime = 0; - m_lastlmdownpoint.SetPoint(0, 0); - - LoadLogo(); -} - -CChildView::~CChildView() -{ -} - -BOOL CChildView::PreCreateWindow(CREATESTRUCT& cs) -{ - if(!CWnd::PreCreateWindow(cs)) - return FALSE; - - cs.style &= ~WS_BORDER; - cs.lpszClass = AfxRegisterWndClass(CS_HREDRAW|CS_VREDRAW|CS_DBLCLKS, - ::LoadCursor(NULL, IDC_HAND), HBRUSH(COLOR_WINDOW+1), NULL); - - return TRUE; -} - -BOOL CChildView::PreTranslateMessage(MSG* pMsg) -{ - if(pMsg->message >= WM_MOUSEFIRST && pMsg->message <= WM_MYMOUSELAST) - { - CWnd* pParent = GetParent(); - CPoint p(pMsg->lParam); - ::MapWindowPoints(pMsg->hwnd, pParent->m_hWnd, &p, 1); - - bool fDblClick = false; - - bool fInteractiveVideo = ((CMainFrame*)AfxGetMainWnd())->IsInteractiveVideo(); -/* - if(fInteractiveVideo) - { - if(pMsg->message == WM_LBUTTONDOWN) - { - if((pMsg->time - m_lastlmdowntime) <= GetDoubleClickTime() - && abs(pMsg->pt.x - m_lastlmdownpoint.x) <= GetSystemMetrics(SM_CXDOUBLECLK) - && abs(pMsg->pt.y - m_lastlmdownpoint.y) <= GetSystemMetrics(SM_CYDOUBLECLK)) - { - fDblClick = true; - m_lastlmdowntime = 0; - m_lastlmdownpoint.SetPoint(0, 0); - } - else - { - m_lastlmdowntime = pMsg->time; - m_lastlmdownpoint = pMsg->pt; - } - } - else if(pMsg->message == WM_LBUTTONDBLCLK) - { - m_lastlmdowntime = pMsg->time; - m_lastlmdownpoint = pMsg->pt; - } - } -*/ - if((pMsg->message == WM_LBUTTONDOWN || pMsg->message == WM_LBUTTONUP || pMsg->message == WM_MOUSEMOVE) - && fInteractiveVideo) - { - if(pMsg->message == WM_MOUSEMOVE) - { - pParent->PostMessage(pMsg->message, pMsg->wParam, MAKELPARAM(p.x, p.y)); - } - - if(fDblClick) - { - pParent->PostMessage(WM_LBUTTONDOWN, pMsg->wParam, MAKELPARAM(p.x, p.y)); - pParent->PostMessage(WM_LBUTTONDBLCLK, pMsg->wParam, MAKELPARAM(p.x, p.y)); - } - } - else - { - pParent->PostMessage(pMsg->message, pMsg->wParam, MAKELPARAM(p.x, p.y)); - return TRUE; - } - } - - return CWnd::PreTranslateMessage(pMsg); -} - -void CChildView::SetVideoRect(CRect r) -{ - m_vrect = r; - - Invalidate(); -} - -void CChildView::LoadLogo() -{ - AppSettings& s = AfxGetAppSettings(); - - CAutoLock cAutoLock(&m_csLogo); - - m_logo.Destroy(); - - if(s.logoext) - { - if(AfxGetAppSettings().fXpOrBetter) - m_logo.Load(s.logofn); - else if(HANDLE h = LoadImage(NULL, s.logofn, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE)) - m_logo.Attach((HBITMAP)h); // win9x bug: Inside Attach GetObject() will return all zeros in DIBSECTION and silly CImage uses that to init width, height, bpp, ... so we can't use CImage::Draw later - } - - if(m_logo.IsNull()) - { - m_logo.LoadFromResource(s.logoid); - // m_logo.LoadFromResource(AfxGetInstanceHandle(), s.logoid); - } - - if(m_hWnd) Invalidate(); -} - -CSize CChildView::GetLogoSize() -{ - CSize ret(0,0); - if(!m_logo.IsNull()) - ret.SetSize(m_logo.GetWidth(), m_logo.GetHeight()); - return ret; -} - -IMPLEMENT_DYNAMIC(CChildView, CWnd) - -BEGIN_MESSAGE_MAP(CChildView, CWnd) - //{{AFX_MSG_MAP(CChildView) - ON_WM_PAINT() - ON_WM_ERASEBKGND() - ON_WM_SIZE() - ON_WM_WINDOWPOSCHANGED() - ON_COMMAND_EX(ID_PLAY_PLAYPAUSE, OnPlayPlayPauseStop) - ON_COMMAND_EX(ID_PLAY_PLAY, OnPlayPlayPauseStop) - ON_COMMAND_EX(ID_PLAY_PAUSE, OnPlayPlayPauseStop) - ON_COMMAND_EX(ID_PLAY_STOP, OnPlayPlayPauseStop) - ON_WM_SETCURSOR() - ON_WM_NCCALCSIZE() - ON_WM_NCPAINT() - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - - -///////////////////////////////////////////////////////////////////////////// -// CChildView message handlers - -void CChildView::OnPaint() -{ - CPaintDC dc(this); // device context for painting - - ((CMainFrame*)GetParentFrame())->RepaintVideo(); - - // Do not call CWnd::OnPaint() for painting messages -} - -BOOL CChildView::OnEraseBkgnd(CDC* pDC) -{ - CRect r; - - CAutoLock cAutoLock(&m_csLogo); - - if(((CMainFrame*)GetParentFrame())->IsSomethingLoaded()) - { - pDC->ExcludeClipRect(m_vrect); - } - else if(!m_logo.IsNull() /*&& ((CMainFrame*)GetParentFrame())->IsPlaylistEmpty()*/) - { - BITMAP bm; - GetObject(m_logo, sizeof(bm), &bm); - - GetClientRect(r); - int w = min(bm.bmWidth, r.Width()); - int h = min(abs(bm.bmHeight), r.Height()); -// int w = min(m_logo.GetWidth(), r.Width()); -// int h = min(m_logo.GetHeight(), r.Height()); - int x = (r.Width() - w) / 2; - int y = (r.Height() - h) / 2; - r = CRect(CPoint(x, y), CSize(w, h)); - - int oldmode = pDC->SetStretchBltMode(STRETCH_HALFTONE); - m_logo.StretchBlt(*pDC, r, CRect(0,0,bm.bmWidth,abs(bm.bmHeight))); -// m_logo.Draw(*pDC, r); - pDC->SetStretchBltMode(oldmode); - - pDC->ExcludeClipRect(r); - } - - GetClientRect(r); - pDC->FillSolidRect(r, 0); - - return TRUE; -} - -void CChildView::OnSize(UINT nType, int cx, int cy) -{ - CWnd::OnSize(nType, cx, cy); - - ((CMainFrame*)GetParentFrame())->MoveVideoWindow(); -} - -void CChildView::OnWindowPosChanged(WINDOWPOS* lpwndpos) -{ - CWnd::OnWindowPosChanged(lpwndpos); - - ((CMainFrame*)GetParentFrame())->MoveVideoWindow(); -} - -BOOL CChildView::OnPlayPlayPauseStop(UINT nID) -{ - if(nID == ID_PLAY_STOP) SetVideoRect(); - return FALSE; -} - -BOOL CChildView::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message) -{ - if(((CMainFrame*)GetParentFrame())->m_fHideCursor) - { - SetCursor(NULL); - return TRUE; - } - - return CWnd::OnSetCursor(pWnd, nHitTest, message); -} - -void CChildView::OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS* lpncsp) -{ - if(!((CMainFrame*)GetParentFrame())->IsFrameLessWindow()) - { - InflateRect(&lpncsp->rgrc[0], -1, -1); - } - - CWnd::OnNcCalcSize(bCalcValidRects, lpncsp); -} - -void CChildView::OnNcPaint() -{ - if(!((CMainFrame*)GetParentFrame())->IsFrameLessWindow()) - { - CRect r; - GetWindowRect(r); - r.OffsetRect(-r.left, -r.top); - - CWindowDC(this).Draw3dRect(&r, GetSysColor(COLOR_3DSHADOW), GetSysColor(COLOR_3DHILIGHT)); - } -} - diff --git a/src/apps/mplayerc/ChildView.h b/src/apps/mplayerc/ChildView.h deleted file mode 100644 index 303747673..000000000 --- a/src/apps/mplayerc/ChildView.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#pragma once - -#include "libpng.h" - -class CChildView : public CWnd -{ - CRect m_vrect; - - DWORD m_lastlmdowntime; - CPoint m_lastlmdownpoint; - - CCritSec m_csLogo; - CPngImage m_logo; - -public: - CChildView(); - virtual ~CChildView(); - - DECLARE_DYNAMIC(CChildView) - -public: - void SetVideoRect(CRect r = CRect(0,0,0,0)); - CRect GetVideoRect() {return(m_vrect);} - - void LoadLogo(); - CSize GetLogoSize(); - -protected: - virtual BOOL PreCreateWindow(CREATESTRUCT& cs); - virtual BOOL PreTranslateMessage(MSG* pMsg); - - afx_msg void OnPaint(); - afx_msg BOOL OnEraseBkgnd(CDC* pDC); - afx_msg void OnSize(UINT nType, int cx, int cy); - afx_msg void OnWindowPosChanged(WINDOWPOS* lpwndpos); - afx_msg BOOL OnPlayPlayPauseStop(UINT nID); - afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message); - afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS* lpncsp); - afx_msg void OnNcPaint(); - - DECLARE_MESSAGE_MAP() -public: - afx_msg void OnSetFocus(CWnd* pOldWnd); -}; diff --git a/src/apps/mplayerc/ComPropertyPage.cpp b/src/apps/mplayerc/ComPropertyPage.cpp deleted file mode 100644 index 23df655a2..000000000 --- a/src/apps/mplayerc/ComPropertyPage.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -// ComPropertyPage.cpp : implementation file -// - -#include "stdafx.h" -#include "mplayerc.h" -#include "ComPropertyPage.h" -#include "ComPropertySheet.h" - - -// CComPropertyPage dialog - -IMPLEMENT_DYNAMIC(CComPropertyPage, CPropertyPage) -CComPropertyPage::CComPropertyPage(IPropertyPage* pPage) - : CPropertyPage(CComPropertyPage::IDD), m_pPage(pPage) -{ - PROPPAGEINFO ppi; - m_pPage->GetPageInfo(&ppi); - m_pPSP->pszTitle = (m_strCaption = ppi.pszTitle); - m_psp.dwFlags |= PSP_USETITLE; -} - -CComPropertyPage::~CComPropertyPage() -{ -} - -void CComPropertyPage::DoDataExchange(CDataExchange* pDX) -{ - CPropertyPage::DoDataExchange(pDX); -} - -BOOL CComPropertyPage::OnInitDialog() -{ - CPropertyPage::OnInitDialog(); - - CRect r; - PROPPAGEINFO ppi; - m_pPage->GetPageInfo(&ppi); - r = CRect(CPoint(0,0), ppi.size); - m_pPage->Activate(m_hWnd, r, FALSE); - m_pPage->Show(SW_SHOW); - - return TRUE; // return TRUE unless you set the focus to a control - // EXCEPTION: OCX Property Pages should return FALSE -} - -void CComPropertyPage::OnDestroy() -{ - CPropertyPage::OnDestroy(); - - m_pPage->Deactivate(); -} - -BOOL CComPropertyPage::OnSetActive() -{ - SetModified(S_OK == m_pPage->IsPageDirty()); - - CWnd* pParent = GetParent(); - if(pParent->IsKindOf(RUNTIME_CLASS(CComPropertySheet))) - { - CComPropertySheet* pSheet = (CComPropertySheet*)pParent; - pSheet->OnActivated(this); - } - - return CPropertyPage::OnSetActive(); -} - -BOOL CComPropertyPage::OnKillActive() -{ - SetModified(FALSE); - - return CPropertyPage::OnKillActive(); -} - - -BEGIN_MESSAGE_MAP(CComPropertyPage, CPropertyPage) - ON_WM_DESTROY() -END_MESSAGE_MAP() - - -// CComPropertyPage message handlers - -void CComPropertyPage::OnOK() -{ - if(S_OK == m_pPage->IsPageDirty()) m_pPage->Apply(); - SetModified(FALSE); - - CPropertyPage::OnOK(); -} diff --git a/src/apps/mplayerc/ComPropertyPage.h b/src/apps/mplayerc/ComPropertyPage.h deleted file mode 100644 index e36ea6801..000000000 --- a/src/apps/mplayerc/ComPropertyPage.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#pragma once - - -// CComPropertyPage dialog - -class CComPropertyPage : public CPropertyPage -{ - DECLARE_DYNAMIC(CComPropertyPage) - - CComPtr m_pPage; - -public: - CComPropertyPage(IPropertyPage* pPage); - virtual ~CComPropertyPage(); - -// Dialog Data - enum { IDD = IDD_COMPROPERTYPAGE }; - -protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - virtual BOOL OnSetActive(); - virtual BOOL OnKillActive(); - - DECLARE_MESSAGE_MAP() - -public: - virtual BOOL OnInitDialog(); - afx_msg void OnDestroy(); - virtual void OnOK(); -}; - diff --git a/src/apps/mplayerc/ComPropertySheet.cpp b/src/apps/mplayerc/ComPropertySheet.cpp deleted file mode 100644 index 49cc664ed..000000000 --- a/src/apps/mplayerc/ComPropertySheet.cpp +++ /dev/null @@ -1,246 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -// ComPropertySheet.cpp : implementation file -// - -#include "stdafx.h" -#include "mplayerc.h" -#include "ComPropertySheet.h" -#include "..\..\DSUtil\DSUtil.h" -#include "..\..\filters\InternalPropertyPage.h" - -// CComPropertyPageSite - -class CComPropertyPageSite : public CUnknown, public IPropertyPageSite -{ - IComPropertyPageDirty* m_pPPD; - -public: - CComPropertyPageSite(IComPropertyPageDirty* pPPD) : CUnknown(NAME("CComPropertyPageSite"), NULL), m_pPPD(pPPD) {} - - DECLARE_IUNKNOWN - STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv) - { - return - QI(IPropertyPageSite) - __super::NonDelegatingQueryInterface(riid, ppv); - } - - // IPropertyPageSite - STDMETHODIMP OnStatusChange(DWORD flags) - { - if(m_pPPD) - { - if(flags&PROPPAGESTATUS_DIRTY) m_pPPD->OnSetDirty(true); - if(flags&PROPPAGESTATUS_CLEAN) m_pPPD->OnSetDirty(false); - } - return S_OK; - } - STDMETHODIMP GetLocaleID(LCID* pLocaleID) - { - CheckPointer(pLocaleID, E_POINTER); - *pLocaleID = ::GetUserDefaultLCID(); - return S_OK; - } - STDMETHODIMP GetPageContainer(IUnknown** ppUnk) {return E_NOTIMPL;} - STDMETHODIMP TranslateAccelerator(LPMSG pMsg) {return E_NOTIMPL;} -}; - -// CComPropertySheet - -IMPLEMENT_DYNAMIC(CComPropertySheet, CPropertySheet) -CComPropertySheet::CComPropertySheet(UINT nIDCaption, CWnd* pParentWnd, UINT iSelectPage) - : CPropertySheet(nIDCaption, pParentWnd, iSelectPage) -{ - m_pSite = new CComPropertyPageSite(this); - m_size.SetSize(0, 0); -} - -CComPropertySheet::CComPropertySheet(LPCTSTR pszCaption, CWnd* pParentWnd, UINT iSelectPage) - : CPropertySheet(pszCaption, pParentWnd, iSelectPage) -{ - m_pSite = new CComPropertyPageSite(this); - m_size.SetSize(0, 0); -} - -CComPropertySheet::~CComPropertySheet() -{ -} - -int CComPropertySheet::AddPages(CComPtr pSPP) -{ - if(!pSPP) return(0); - - CAUUID caGUID; - caGUID.pElems = NULL; - if(FAILED(pSPP->GetPages(&caGUID))) - return(0); - - IUnknown* lpUnk = NULL; - if(FAILED(pSPP.QueryInterface(&lpUnk))) - return(0); - - m_spp.AddTail(pSPP); - - CComQIPtr pSPP2 = pSPP; - CComQIPtr pPersist = pSPP; - - ULONG nPages = 0; - for(ULONG i = 0; i < caGUID.cElems; i++) - { - CComPtr pPage; - - HRESULT hr = E_FAIL; - - if(FAILED(hr) && !pPage && pSPP2) - { - hr = pSPP2->CreatePage(caGUID.pElems[i], &pPage); - } - - if(FAILED(hr) && !pPage) - { - hr = pPage.CoCreateInstance(caGUID.pElems[i]); - } - - if(FAILED(hr) && !pPage && pPersist) - { - hr = LoadExternalPropertyPage(pPersist, caGUID.pElems[i], &pPage); - } - - if(SUCCEEDED(hr)) - { - if(AddPage(pPage, lpUnk)) - nPages++; - } - } - - if(caGUID.pElems) CoTaskMemFree(caGUID.pElems); - lpUnk->Release(); - - return(nPages); -} - -bool CComPropertySheet::AddPage(IPropertyPage* pPage, IUnknown* pUnk) -{ - if(!pPage || !pUnk) return false; - - HRESULT hr; - hr = pPage->SetPageSite(m_pSite); - hr = pPage->SetObjects(1, &pUnk); - PROPPAGEINFO ppi; - hr = pPage->GetPageInfo(&ppi); - m_size.cx = max(m_size.cx, ppi.size.cx); - m_size.cy = max(m_size.cy, ppi.size.cy); - CAutoPtr p(new CComPropertyPage(pPage)); - __super::AddPage(p); - m_pages.AddTail(p); - - return true; -} - -void CComPropertySheet::OnActivated(CPropertyPage* pPage) -{ - if(!pPage) return; - - CRect bounds(30000,30000,-30000,-30000); - - CRect wr, cr; - GetWindowRect(wr); - GetClientRect(cr); - CSize ws = wr.Size(), cs = cr.Size(); - - CRect twr, tcr; - CTabCtrl* pTC = (CTabCtrl*)GetDlgItem(AFX_IDC_TAB_CONTROL); - pTC->GetWindowRect(twr); - pTC->GetClientRect(tcr); - CSize tws = twr.Size(), tcs = tcr.Size(); - - if(CWnd* pChild = pPage->GetWindow(GW_CHILD)) - { - pChild->ModifyStyle(WS_CAPTION|WS_THICKFRAME, 0); - pChild->ModifyStyleEx(WS_EX_DLGMODALFRAME, WS_EX_CONTROLPARENT); - - for(CWnd* pGrandChild = pChild->GetWindow(GW_CHILD); pGrandChild; pGrandChild = pGrandChild->GetNextWindow()) - { - if(!(pGrandChild->GetStyle()&WS_VISIBLE)) continue; - - CRect r; - pGrandChild->GetWindowRect(&r); - pChild->ScreenToClient(r); - bounds |= r; - } - } - - bounds |= CRect(0,0,0,0); - bounds.SetRect(0, 0, bounds.right + max(bounds.left, 4), bounds.bottom + max(bounds.top, 4)); - - CRect r = CRect(CPoint(0,0), bounds.Size()); - pTC->AdjustRect(TRUE, r); - r.SetRect(twr.TopLeft(), twr.TopLeft() + r.Size()); - ScreenToClient(r); - pTC->MoveWindow(r); - pTC->ModifyStyle(TCS_MULTILINE, TCS_SINGLELINE); - - CSize diff = r.Size() - tws; - - if(!bounds.IsRectEmpty()) - { - if(CWnd* pChild = pPage->GetWindow(GW_CHILD)) - pChild->MoveWindow(bounds); - CRect r = twr; - pTC->AdjustRect(FALSE, r); - ScreenToClient(r); - pPage->MoveWindow(CRect(r.TopLeft(), bounds.Size())); - } - - int _afxPropSheetButtons[] = { IDOK, IDCANCEL, ID_APPLY_NOW, IDHELP }; - for(int i = 0; i < countof(_afxPropSheetButtons); i++) - { - if(CWnd* pWnd = GetDlgItem(_afxPropSheetButtons[i])) - { - pWnd->GetWindowRect(r); - ScreenToClient(r); - pWnd->MoveWindow(CRect(r.TopLeft() + diff, r.Size())); - } - } - - MoveWindow(CRect(wr.TopLeft(), ws + diff)); - - Invalidate(); -} - - -BEGIN_MESSAGE_MAP(CComPropertySheet, CPropertySheet) -END_MESSAGE_MAP() - - -// CComPropertySheet message handlers - -BOOL CComPropertySheet::OnInitDialog() -{ - BOOL bResult = (BOOL)Default();//CPropertySheet::OnInitDialog(); - - if (!(GetStyle() & WS_CHILD)) - CenterWindow(); - - return bResult; -} diff --git a/src/apps/mplayerc/ComPropertySheet.h b/src/apps/mplayerc/ComPropertySheet.h deleted file mode 100644 index faef4c89f..000000000 --- a/src/apps/mplayerc/ComPropertySheet.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#pragma once - -#include "ComPropertyPage.h" - -interface IComPropertyPageDirty -{ - virtual void OnSetDirty(bool fDirty) = 0; -}; - -// CComPropertySheet - -class CComPropertySheet : public CPropertySheet, public IComPropertyPageDirty -{ - DECLARE_DYNAMIC(CComPropertySheet) - - CComPtr m_pSite; - CInterfaceList m_spp; - CAutoPtrList m_pages; - CSize m_size; - -public: - CComPropertySheet(UINT nIDCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0); - CComPropertySheet(LPCTSTR pszCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0); - virtual ~CComPropertySheet(); - - int AddPages(CComPtr pSPP); - bool AddPage(IPropertyPage* pPage, IUnknown* pUnk); - - void OnActivated(CPropertyPage* pPage); - - // IComPropertyPageDirty - void OnSetDirty(bool fDirty) {if(CPropertyPage* p = GetActivePage()) p->SetModified(fDirty);} - - virtual BOOL OnInitDialog(); - -protected: - DECLARE_MESSAGE_MAP() -}; - - diff --git a/src/apps/mplayerc/ConvertChapDlg.cpp b/src/apps/mplayerc/ConvertChapDlg.cpp deleted file mode 100644 index b77c35bed..000000000 --- a/src/apps/mplayerc/ConvertChapDlg.cpp +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -// ConvertChapDlg.cpp : implementation file -// - -#include "stdafx.h" -#include "mplayerc.h" -#include "ConvertChapDlg.h" - -// CConvertChapDlg dialog - -CConvertChapDlg::CConvertChapDlg(CWnd* pParent /*=NULL*/) - : CResizableDialog(CConvertChapDlg::IDD, pParent) - , m_time(_T("")) - , m_name(_T("")) -{ -} - -CConvertChapDlg::~CConvertChapDlg() -{ -} - -void CConvertChapDlg::DoDataExchange(CDataExchange* pDX) -{ - __super::DoDataExchange(pDX); - DDX_Text(pDX, IDC_EDIT1, m_time); - DDX_Text(pDX, IDC_EDIT2, m_name); -} - -BEGIN_MESSAGE_MAP(CConvertChapDlg, CResizableDialog) - ON_UPDATE_COMMAND_UI(IDOK, OnUpdateOK) -END_MESSAGE_MAP() - - -// CConvertChapDlg message handlers - -BOOL CConvertChapDlg::OnInitDialog() -{ - __super::OnInitDialog(); - - AddAnchor(IDC_EDIT1, TOP_LEFT); - AddAnchor(IDC_EDIT2, TOP_LEFT, TOP_RIGHT); - AddAnchor(IDOK, BOTTOM_CENTER); - AddAnchor(IDCANCEL, BOTTOM_CENTER); - - CRect r; - GetWindowRect(r); - CSize s = r.Size(); - SetMinTrackSize(s); - s.cx = 1000; - SetMaxTrackSize(s); - - UpdateData(FALSE); - - return TRUE; // return TRUE unless you set the focus to a control - // EXCEPTION: OCX Property Pages should return FALSE -} - -void CConvertChapDlg::OnOK() -{ - UpdateData(); - - __super::OnOK(); -} - -void CConvertChapDlg::OnUpdateOK(CCmdUI* pCmdUI) -{ - CString str; - GetDlgItem(IDC_EDIT1)->GetWindowText(str); - int i; - pCmdUI->Enable(3 == _stscanf(str, _T("%d:%d:%d"), &i, &i, &i) - && GetDlgItem(IDC_EDIT2)->GetWindowTextLength() > 0); -} diff --git a/src/apps/mplayerc/ConvertChapDlg.h b/src/apps/mplayerc/ConvertChapDlg.h deleted file mode 100644 index 71c989e89..000000000 --- a/src/apps/mplayerc/ConvertChapDlg.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#pragma once - -// CConvertChapDlg dialog - -class CConvertChapDlg : public CResizableDialog -{ -public: - CConvertChapDlg(CWnd* pParent = NULL); // standard constructor - virtual ~CConvertChapDlg(); - -// Dialog Data - enum { IDD = IDD_CONVERTCHAP_DLG }; - CString m_time; - CString m_name; - -protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - virtual BOOL OnInitDialog(); - virtual void OnOK(); - - DECLARE_MESSAGE_MAP() -public: - afx_msg void OnUpdateOK(CCmdUI* pCmdUI); -}; diff --git a/src/apps/mplayerc/ConvertDlg.cpp b/src/apps/mplayerc/ConvertDlg.cpp deleted file mode 100644 index 258854500..000000000 --- a/src/apps/mplayerc/ConvertDlg.cpp +++ /dev/null @@ -1,1366 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -// ConvertDlg.cpp : implementation file -// - -#include "stdafx.h" -#include -#include "mplayerc.h" -#include "..\..\filters\filters.h" -#include "..\..\..\include\moreuuids.h" -#include "FGManager.h" -#include "ConvertPropsDlg.h" -#include "ConvertResDlg.h" -#include "ConvertChapDlg.h" -#include "ConvertDlg.h" - -// TODO: subtitle source filter for vobsub - -// CConvertDlg dialog - -CConvertDlg::CConvertDlg(CWnd* pParent /*=NULL*/) - : CResizableDialog(CConvertDlg::IDD, pParent) - , m_fn(_T("")) -{ -} - -CConvertDlg::~CConvertDlg() -{ -} - -void CConvertDlg::AddFile(CString fn) -{ - CString protocol; - - int i = fn.Find(_T("://")); - if(i > 0) - { - CString url = fn.Mid(i); - CPath path(fn.Left(i)); - path.StripPath(); - protocol = (LPCTSTR)path; - fn = (LPCTSTR)path + url; - } - - CComPtr pBF; - if(FAILED(m_pGB->AddSourceFilter(CStringW(fn), CStringW(fn), &pBF))) - return; - - int nConnected = 0; - BeginEnumPins(pBF, pEP, pPin) - if(S_OK == m_pGB->ConnectFilter(pPin, m_pMux)) nConnected++; - EndEnumPins - if(!nConnected) {MessageBeep(-1); DeleteFilter(pBF); return;} - - if(m_tree.GetCount() == 0) - { - if(CComQIPtr pPB = m_pMux) - pPB->DelAllProperties(); - - CString ext(_T(".dsm")); - - if(!protocol.IsEmpty()) - { - m_fn = protocol + ext; - } - else - { - CPath p(fn); - if(ext.CompareNoCase(p.GetExtension()) == 0) - ext = _T(" (remuxed)") + ext; - p.RemoveExtension(); - m_fn = (LPCTSTR)p + ext; - } - - UpdateData(FALSE); - } - - CTreeItemFile* t = new CTreeItemFile(fn, pBF, m_tree, NULL); - - AddFilter(*t, pBF); - - m_tree.Expand(*t, TVE_EXPAND); - m_tree.EnsureVisible(*t); -} - -bool CConvertDlg::ConvertFile(LPCTSTR fn, IPin* pPin) -{ - OAFilterState fs; - if(!m_pMC || FAILED(m_pMC->GetState(0, &fs)) || fs != State_Stopped) - return false; - - m_pGB->NukeDownstream(m_pMux); - - CComPtr pFW; - pFW.CoCreateInstance(CLSID_FileWriter); - CComQIPtr pFSF = pFW; - - if(pPin) - { - CComQIPtr pRP = pPin; - if(!pRP) return false; - - pPin = pRP->GetRelatedPin(); - } - else - { - pPin = GetFirstPin(m_pMux, PINDIR_OUTPUT); - } - - if(!pPin || !pFSF - || FAILED(m_pGB->AddFilter(pFW, NULL)) - || FAILED(pFSF->SetFileName(CStringW(fn), NULL)) - || FAILED(pFSF->SetMode(AM_FILE_OVERWRITE)) - || FAILED(m_pGB->ConnectDirect(pPin, GetFirstPin(pFW), NULL))) - { - m_pGB->RemoveFilter(pFW); - return false; - } - - if(m_pMS) - { - LONGLONG pos = 0; - m_pMS->SetPositions(&pos, AM_SEEKING_AbsolutePositioning, NULL, AM_SEEKING_NoPositioning); - } - - if(CComQIPtr pPB = m_pMux) - { - pPB->SetProperty(L"APPL", L"Media Player Classic"); - } - - if(CComQIPtr pRB = m_pMux) - { - pRB->ResRemoveAll(0); - POSITION pos = m_pTIs.GetHeadPosition(); - while(pos) - { - if(CTreeItemResource* t2 = dynamic_cast((CTreeItem*)m_pTIs.GetNext(pos))) - pRB->ResAppend( - t2->m_res.name, t2->m_res.desc, t2->m_res.mime, - t2->m_res.data.GetData(), t2->m_res.data.GetCount(), - NULL); - } - } - - if(CComQIPtr pCB = m_pMux) - { - pCB->ChapRemoveAll(); - POSITION pos = m_pTIs.GetHeadPosition(); - while(pos) - { - if(CTreeItemChapter* t2 = dynamic_cast((CTreeItem*)m_pTIs.GetNext(pos))) - pCB->ChapAppend(t2->m_chap.rt, t2->m_chap.name); - } - } - - if(FAILED(m_pMC->Run())) - return false; - - m_tree.EnableWindow(FALSE); - - return true; -} - -void CConvertDlg::AddFilter(HTREEITEM hTIParent, IBaseFilter* pBFParent) -{ - BeginEnumPins(pBFParent, pEP, pPin) - { - CComPtr pPinTo; - CComPtr pBF; - if(S_OK != m_pGB->IsPinDirection(pPin, PINDIR_OUTPUT) - || FAILED(pPin->ConnectedTo(&pPinTo)) || !pPinTo - || !(pBF = GetFilterFromPin(pPinTo))) - continue; - - CTreeItem* t = NULL; - - if(pBF == m_pMux) - { - t = new CTreeItemPin(pPin, m_tree, hTIParent); - } - else - { - t = new CTreeItemFilter(pBF, m_tree, hTIParent); - AddFilter(*t, pBF); - } - } - EndEnumPins - - if(CComQIPtr pPB = pBFParent) - { - ULONG props; - if(FAILED(pPB->CountProperties(&props))) - props = 0; - - for(ULONG i = 0; i < props; i++) - { - PROPBAG2 PropBag; - memset(&PropBag, 0, sizeof(PropBag)); - ULONG cPropertiesReturned = 0; - if(FAILED(pPB->GetPropertyInfo(i, 1, &PropBag, &cPropertiesReturned))) - continue; - - HRESULT hr; - CComVariant var; - if(SUCCEEDED(pPB->Read(1, &PropBag, NULL, &var, &hr)) && SUCCEEDED(hr)) - { - CComQIPtr pPBMux = m_pMux; - CComBSTR value; - if(pPBMux && FAILED(pPBMux->GetProperty(PropBag.pstrName, &value))) - pPBMux->SetProperty(PropBag.pstrName, var.bstrVal); - } - - CoTaskMemFree(PropBag.pstrName); - } - } - - CTreeItem* t2 = new CTreeItemResourceFolder(m_tree, hTIParent); - if(CComQIPtr pRB = pBFParent) - { - for(DWORD i = 0, cnt = pRB->ResGetCount(); i < cnt; i++) - { - CComBSTR name, mime, desc; - BYTE* pData = NULL; - DWORD len = 0; - if(FAILED(pRB->ResGet(i, &name, &desc, &mime, &pData, &len, NULL))) - continue; - - if(len > 0) - { - m_pTIs.AddTail(new CTreeItemResource(CDSMResource(name, desc, mime, pData, len), m_tree, *t2)); - } - - CoTaskMemFree(pData); - } - } - m_tree.Expand(*t2, TVE_EXPAND); - - CTreeItem* t3 = new CTreeItemChapterFolder(m_tree, hTIParent); - if(CComQIPtr pCB = pBFParent) - { - for(DWORD i = 0, cnt = pCB->ChapGetCount(); i < cnt; i++) - { - REFERENCE_TIME rt; - CComBSTR name; - if(FAILED(pCB->ChapGet(i, &rt, &name))) - continue; - - m_pTIs.AddTail(new CTreeItemChapter(CDSMChapter(rt, name), m_tree, *t3)); - } - } - m_tree.Expand(*t3, TVE_EXPAND); - - m_tree.Expand(hTIParent, TVE_EXPAND); -} - -void CConvertDlg::DeleteFilter(IBaseFilter* pBF) -{ - BeginEnumPins(pBF, pEP, pPin) - { - CComPtr pPinTo; - CComPtr pBF; - if(S_OK != m_pGB->IsPinDirection(pPin, PINDIR_OUTPUT) - || FAILED(pPin->ConnectedTo(&pPinTo)) || !pPinTo - || !(pBF = GetFilterFromPin(pPinTo))) - continue; - - if(pBF != m_pMux) DeleteFilter(pBF); - } - EndEnumPins - - m_pGB->RemoveFilter(pBF); -} - -void CConvertDlg::DeleteItem(HTREEITEM hTI) -{ - if(!hTI) return; - - DeleteChildren(hTI); - - CTreeItem* t = (CTreeItem*)m_tree.GetItemData(hTI); - if(POSITION pos = m_pTIs.Find(t)) m_pTIs.RemoveAt(pos); - delete t; - m_tree.DeleteItem(hTI); -} - -void CConvertDlg::DeleteChildren(HTREEITEM hTI) -{ - if(!hTI) return; - - if(m_tree.ItemHasChildren(hTI)) - { - HTREEITEM hChildItem = m_tree.GetChildItem(hTI); - - while(hChildItem != NULL) - { - HTREEITEM hNextItem = m_tree.GetNextItem(hChildItem, TVGN_NEXT); - DeleteItem(hChildItem); - hChildItem = hNextItem; - } - } -} - -HTREEITEM CConvertDlg::HitTest(CPoint& sp, CPoint& cp) -{ - sp = CPoint((LPARAM)GetMessagePos()); - cp = sp; - m_tree.ScreenToClient(&cp); - UINT flags = 0; - HTREEITEM hTI = m_tree.HitTest(cp, &flags); - return hTI && (flags&TVHT_ONITEM) ? hTI : NULL; -} - -void CConvertDlg::ShowPopup(CPoint p) -{ - CMenu m; - m.CreatePopupMenu(); - - int i = 1; - m.AppendMenu(MF_STRING, i++, ResStr(IDS_CONVERT_ADDFILE)); - m.AppendMenu(MF_SEPARATOR); - m.AppendMenu(MF_STRING, i++, ResStr(IDS_CONVERT_PROPERTIES)); - - switch((int)m.TrackPopupMenu(TPM_LEFTBUTTON|TPM_RETURNCMD, p.x, p.y, this)) - { - case 1: - { - CFileDialog fd(TRUE, NULL, m_fn, - OFN_EXPLORER|OFN_ENABLESIZING|OFN_HIDEREADONLY|OFN_NOVALIDATE, - _T("Media files|*.*||"), this, 0); - if(fd.DoModal() == IDOK) AddFile(fd.GetPathName()); - } - break; - case 2: - EditProperties(CComQIPtr(m_pMux)); - break; - } -} - -void CConvertDlg::ShowFilePopup(HTREEITEM hTI, CPoint p) -{ - CTreeItemFile* t = dynamic_cast((CTreeItem*)m_tree.GetItemData(hTI)); - ASSERT(t); - - CMenu m; - m.CreatePopupMenu(); - - int i = 1; - m.AppendMenu(MF_STRING, i++, ResStr(IDS_CONVERT_REMOVE)); - - switch((int)m.TrackPopupMenu(TPM_LEFTBUTTON|TPM_RETURNCMD, p.x, p.y, this)) - { - case 1: - DeleteFilter(t->m_pBF); - DeleteItem(hTI); - break; - } -} - -void CConvertDlg::ShowPinPopup(HTREEITEM hTI, CPoint p) -{ - CTreeItemPin* t = dynamic_cast((CTreeItem*)m_tree.GetItemData(hTI)); - ASSERT(t); - - if(!t->m_pPin) return; - - CComPtr pPinTo; - t->m_pPin->ConnectedTo(&pPinTo); - - CMediaType mt; - if(pPinTo) t->m_pPin->ConnectionMediaType(&mt); - - CAtlArray mts; - BeginEnumMediaTypes(t->m_pPin, pEMT, pmt) - mts.Add(*pmt); - EndEnumMediaTypes(pmt) - - CMenu m; - m.CreatePopupMenu(); - - int i = 1, mtbase = 1000, mti = mtbase; - - m.AppendMenu(MF_STRING, i++, !pPinTo ? ResStr(IDS_CONVERT_ENABLESTREAM) : ResStr(IDS_CONVERT_DISABLESTREAM)); - m.AppendMenu(MF_STRING | (!pPinTo ? MF_GRAYED : 0), i++, ResStr(IDS_CONVERT_DEMUXSTREAM)); - - if(mts.GetCount() > 1) - { - m.AppendMenu(MF_SEPARATOR); - for(int i = 0; i < mts.GetCount(); i++) - m.AppendMenu(MF_STRING | (mts[i] == mt ? MF_CHECKED : 0), mti++, CMediaTypeEx(mts[i]).ToString()); - } - - m.AppendMenu(MF_SEPARATOR); - m.AppendMenu(MF_STRING | (!pPinTo ? MF_GRAYED : 0), i++, ResStr(IDS_CONVERT_PINPROPERTIES)); - - switch(i = (int)m.TrackPopupMenu(TPM_LEFTBUTTON|TPM_RETURNCMD, p.x, p.y, this)) - { - case 1: - if(pPinTo) {m_pGB->Disconnect(pPinTo); m_pGB->Disconnect(t->m_pPin);} - else if(pPinTo = GetFirstDisconnectedPin(m_pMux, PINDIR_INPUT)) m_pGB->ConnectDirect(t->m_pPin, pPinTo, NULL); - t->Update(); - break; - case 2: - { - UpdateData(); - - CString ext = _T("raw"); - - if(mt.subtype == MEDIASUBTYPE_AAC) ext = _T("aac"); - else if(mt.subtype == MEDIASUBTYPE_MP3) ext = _T("mp3"); - else if(mt.subtype == FOURCCMap(WAVE_FORMAT_MPEG)) ext = _T("m1a"); - else if(mt.subtype == MEDIASUBTYPE_MPEG2_AUDIO) ext = _T("m2a"); - else if(mt.subtype == MEDIASUBTYPE_WAVE_DOLBY_AC3 || mt.subtype == MEDIASUBTYPE_DOLBY_AC3) ext = _T("ac3"); - else if(mt.subtype == MEDIASUBTYPE_WAVE_DTS || mt.subtype == MEDIASUBTYPE_DTS) ext = _T("dts"); - else if((mt.subtype == FOURCCMap('1CVA') || mt.subtype == FOURCCMap('1cva')) && mt.formattype == FORMAT_MPEG2_VIDEO) ext = _T("h264"); - else if(mt.subtype == FOURCCMap('GEPJ') || mt.subtype == FOURCCMap('gepj')) ext = _T("jpg"); - else if(mt.majortype == MEDIATYPE_Video && mt.subtype == MEDIASUBTYPE_MPEG2_VIDEO) ext = _T("m2v"); - else if(mt.majortype == MEDIATYPE_Video && mt.subtype == MEDIASUBTYPE_MPEG1Payload) ext = _T("m1v"); - else if(mt.subtype == MEDIASUBTYPE_UTF8 || mt.majortype == MEDIATYPE_Text) ext = _T("srt"); - else if(mt.subtype == MEDIASUBTYPE_SSA) ext = _T("ssa"); - else if(mt.subtype == MEDIASUBTYPE_ASS || mt.subtype == MEDIASUBTYPE_ASS2) ext = _T("ass"); - else if(mt.subtype == MEDIASUBTYPE_SSF) ext = _T("ssf"); - else if(mt.subtype == MEDIASUBTYPE_VOBSUB) ext = _T("sub"); - else if(mt.subtype == MEDIASUBTYPE_PCM || mt.subtype == MEDIASUBTYPE_DVD_LPCM_AUDIO || mt.subtype == FOURCCMap(WAVE_FORMAT_EXTENSIBLE) || mt.subtype == FOURCCMap(WAVE_FORMAT_IEEE_FLOAT)) ext = _T("wav"); - // TODO: else if... - - CPath path(m_fn); - path.RenameExtension('.' + ext); - - CFileDialog fd(FALSE, NULL, (LPCTSTR)path, - OFN_EXPLORER|OFN_ENABLESIZING|OFN_HIDEREADONLY, - _T("Media files|*.*||"), this, 0); - if(fd.DoModal() == IDOK) - { - if(!ConvertFile(fd.GetPathName(), pPinTo)) - { - AfxMessageBox(_T("Failed to start conversion")); - } - } - } - break; - case 3: - EditProperties(CComQIPtr(pPinTo)); - break; - default: - i -= mtbase; - if(i >= 0 && i < mts.GetCount()) - { - if(pPinTo) {m_pGB->Disconnect(pPinTo); m_pGB->Disconnect(t->m_pPin);} - else {pPinTo = GetFirstDisconnectedPin(m_pMux, PINDIR_INPUT);} - HRESULT hr = m_pGB->ConnectDirect(t->m_pPin, pPinTo, &mts[i]); - if(FAILED(hr)) - { - AfxMessageBox(_T("Reconnection attempt failed!")); - if(mt.majortype != GUID_NULL) - hr = m_pGB->ConnectDirect(t->m_pPin, pPinTo, &mt); - } - t->Update(); - } - break; - } -} - -void CConvertDlg::ShowResourceFolderPopup(HTREEITEM hTI, CPoint p) -{ - CTreeItemResourceFolder* t = dynamic_cast((CTreeItem*)m_tree.GetItemData(hTI)); - ASSERT(t); - - CMenu m; - m.CreatePopupMenu(); - - int i = 1; - m.AppendMenu(MF_STRING, i++, ResStr(IDS_CONVERT_ADDRESOURCE)); - if(m_tree.ItemHasChildren(*t)) - { - m.AppendMenu(MF_SEPARATOR); - m.AppendMenu(MF_STRING, i++, ResStr(IDS_CONVERT_REMOVEALL)); - } - - switch((int)m.TrackPopupMenu(TPM_LEFTBUTTON|TPM_RETURNCMD, p.x, p.y, this)) - { - case 1: - { - CFileDialog fd(TRUE, NULL, NULL, - OFN_EXPLORER|OFN_ENABLESIZING|OFN_HIDEREADONLY, - _T("All files|*.*||"), this, 0); - if(fd.DoModal() == IDOK) - { - CString fn = fd.GetPathName(); - if(FILE* f = _tfopen(fn, _T("rb"))) - { - CDSMResource res; - - CPath path(fn); - path.StripPath(); - res.name = (LPCTSTR)path; - - CRegKey key; - TCHAR mime[256]; - ULONG len = countof(mime); - if(ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, path.GetExtension().MakeLower(), KEY_READ) - && ERROR_SUCCESS == key.QueryStringValue(_T("Content Type"), mime, &len)) - res.mime = mime; - - CTreeItemResource* t = new CTreeItemResource(res, m_tree, hTI); - m_pTIs.AddTail(t); - - if(EditResource(t)) - { - fseek(f, 0, 2); - long size = ftell(f); - fseek(f, 0, 0); - t->m_res.data.SetCount(size); - for(BYTE* ptr = t->m_res.data.GetData(),* end = ptr + size; - size > 0 && end - ptr >= size && fread(ptr, min(size, 1024), 1, f) > 0; - ptr += 1024, size -= 1024); - fclose(f); - } - else - { - DeleteItem(*t); - } - } - else - { - AfxMessageBox(_T("Cannot open file!")); - } - } - } - break; - case 2: - DeleteChildren(hTI); - break; - } -} - -void CConvertDlg::ShowResourcePopup(HTREEITEM hTI, CPoint p) -{ - CTreeItemResource* t = dynamic_cast((CTreeItem*)m_tree.GetItemData(hTI)); - ASSERT(t); - - CMenu m; - m.CreatePopupMenu(); - - int i = 1; - m.AppendMenu(MF_STRING, i++, ResStr(IDS_CONVERT_REMOVE)); - m.AppendMenu(MF_STRING, i++, ResStr(IDS_CONVERT_SAVEAS)); - if(AfxGetAppSettings().fEnableWebServer) m.AppendMenu(MF_STRING, 1000, ResStr(IDS_CONVERT_LAUNCHINBROWSER)); - m.AppendMenu(MF_SEPARATOR); - m.AppendMenu(MF_STRING, i++, ResStr(IDS_CONVERT_RESOURCEPROPERTIES)); - - switch((int)m.TrackPopupMenu(TPM_LEFTBUTTON|TPM_RETURNCMD, p.x, p.y, this)) - { - case 1: - DeleteItem(*t); - break; - case 2: - { - CFileDialog fd(FALSE, NULL, CString(t->m_res.name), - OFN_EXPLORER|OFN_ENABLESIZING|OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, - _T("All files|*.*||"), this, 0); - if(fd.DoModal() == IDOK) - { - if(FILE* f = _tfopen(fd.GetPathName(), _T("wb"))) - { - fwrite(t->m_res.data.GetData(), 1, t->m_res.data.GetCount(), f); - fclose(f); - } - } - } - break; - case 3: - EditResource(t); - break; - case 1000: - { - CString url; - url.Format(_T("http://localhost:%d/convres.html?id=%x"), AfxGetAppSettings().nWebServerPort, (DWORD)&t->m_res); - ShellExecute(NULL, _T("open"), url, NULL, NULL, SW_SHOWDEFAULT); - } - break; - } -} - -bool CConvertDlg::EditProperties(IDSMPropertyBag* pPB) -{ - CConvertPropsDlg dlg(!!CComQIPtr(pPB), this); - - ULONG props; - if(FAILED(pPB->CountProperties(&props))) - props = 0; - - for(ULONG i = 0; i < props; i++) - { - PROPBAG2 PropBag; - memset(&PropBag, 0, sizeof(PropBag)); - ULONG cPropertiesReturned = 0; - if(FAILED(pPB->GetPropertyInfo(i, 1, &PropBag, &cPropertiesReturned))) - continue; - - HRESULT hr; - CComVariant var; - if(SUCCEEDED(pPB->Read(1, &PropBag, NULL, &var, &hr)) && SUCCEEDED(hr)) - dlg.m_props[CString(PropBag.pstrName)] = CString(var); - - CoTaskMemFree(PropBag.pstrName); - } - - if(IDOK != dlg.DoModal()) - return false; - - pPB->DelAllProperties(); - - POSITION pos = dlg.m_props.GetStartPosition(); - while(pos) - { - CString key, value; - dlg.m_props.GetNextAssoc(pos, key, value); - pPB->SetProperty(CStringW(key), CStringW(value)); - } - - return true; -} - -bool CConvertDlg::EditResource(CTreeItemResource* t) -{ - CConvertResDlg dlg(this); - - dlg.m_name = t->m_res.name; - dlg.m_mime = t->m_res.mime; - dlg.m_desc = t->m_res.desc; - - if(IDOK != dlg.DoModal()) - return false; - - t->m_res.name = dlg.m_name; - t->m_res.mime = dlg.m_mime; - t->m_res.desc = dlg.m_desc; - - t->Update(); - - return true; -} - -void CConvertDlg::ShowChapterFolderPopup(HTREEITEM hTI, CPoint p) -{ - CTreeItemChapterFolder* t = dynamic_cast((CTreeItem*)m_tree.GetItemData(hTI)); - ASSERT(t); - - CMenu m; - m.CreatePopupMenu(); - - int i = 1; - m.AppendMenu(MF_STRING, i++, ResStr(IDS_CONVERT_ADDCHAPTER)); - if(m_tree.ItemHasChildren(*t)) - { - m.AppendMenu(MF_SEPARATOR); - m.AppendMenu(MF_STRING, i++, ResStr(IDS_CONVERT_REMOVEALL)); - } - - switch((int)m.TrackPopupMenu(TPM_LEFTBUTTON|TPM_RETURNCMD, p.x, p.y, this)) - { - case 1: - { - CDSMChapter chap; - CTreeItemChapter* t = new CTreeItemChapter(CDSMChapter(0, L""), m_tree, hTI); - m_pTIs.AddTail(t); - if(!EditChapter(t)) - DeleteItem(*t); - } - break; - case 2: - DeleteChildren(hTI); - break; - } -} - -void CConvertDlg::ShowChapterPopup(HTREEITEM hTI, CPoint p) -{ - CTreeItemChapter* t = dynamic_cast((CTreeItem*)m_tree.GetItemData(hTI)); - ASSERT(t); - - CMenu m; - m.CreatePopupMenu(); - - int i = 1; - m.AppendMenu(MF_STRING, i++, ResStr(IDS_CONVERT_REMOVE)); - m.AppendMenu(MF_SEPARATOR); - m.AppendMenu(MF_STRING, i++, ResStr(IDS_CONVERT_CHAPTERPROPERTIES)); - - switch((int)m.TrackPopupMenu(TPM_LEFTBUTTON|TPM_RETURNCMD, p.x, p.y, this)) - { - case 1: - DeleteItem(hTI); - break; - case 2: - EditChapter(t); - break; - } -} - -bool CConvertDlg::EditChapter(CTreeItemChapter* t) -{ - CConvertChapDlg dlg(this); - - int h = (int)(t->m_chap.rt/10000000/60/60); - int m = (int)(t->m_chap.rt/10000000/60%60); - int s = (int)(t->m_chap.rt/10000000%60); - int ms = (int)(t->m_chap.rt/10000%1000); - - dlg.m_name = t->m_chap.name; - dlg.m_time.Format(_T("%02d:%02d:%02d.%03d"), h, m, s, ms); - - if(IDOK != dlg.DoModal()) - return false; - - TCHAR c; - if(_stscanf(dlg.m_time, _T("%d%c%d%c%d%c%d"), &h, &c, &m, &c, &s, &c, &ms) != 7) - return false; - - t->m_chap.name = dlg.m_name; - t->m_chap.rt = ((((__int64)h*60+m)*60+s)*1000+ms)*10000; - - t->Update(); - - return true; -} - -void CConvertDlg::DoDataExchange(CDataExchange* pDX) -{ - __super::DoDataExchange(pDX); - DDX_Control(pDX, IDC_TREE1, m_tree); - DDX_Text(pDX, IDC_EDIT1, m_fn); -} - -BOOL CConvertDlg::PreTranslateMessage(MSG* pMsg) -{ - if(pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_ESCAPE) - return TRUE; - - return __super::PreTranslateMessage(pMsg); -} - -BOOL CConvertDlg::OnInitDialog() -{ - __super::OnInitDialog(); - - SetIcon(AfxGetApp()->LoadIcon(IDR_MAINFRAME), TRUE); - SetIcon(AfxGetApp()->LoadIcon(IDR_MAINFRAME), FALSE); - - AddAnchor(IDC_TREE1, TOP_LEFT, BOTTOM_RIGHT); - AddAnchor(IDC_EDIT1, BOTTOM_LEFT, BOTTOM_RIGHT); - AddAnchor(IDC_BUTTON1, BOTTOM_RIGHT); - AddAnchor(IDC_HLINE, BOTTOM_LEFT, BOTTOM_RIGHT); - AddAnchor(IDC_BUTTON2, BOTTOM_CENTER); - AddAnchor(IDC_BUTTON3, BOTTOM_CENTER); - AddAnchor(IDC_BUTTON4, BOTTOM_CENTER); - - CSize s(400, 200); - SetMinTrackSize(s); - - m_streamtypesbm.LoadBitmap(IDB_STREAMTYPES); - m_streamtypes.Create(16, 18, ILC_MASK|ILC_COLOR32, 0, 4); - m_streamtypes.Add(&m_streamtypesbm, 0xffffff); - m_tree.SetImageList(&m_streamtypes, TVSIL_NORMAL); - - GetWindowText(m_title); - m_nIDEventStatus = SetTimer(1, 1000, NULL); - - HRESULT hr; - m_pMux = new CDSMMuxerFilter(NULL, &hr, false, false); - - m_pGB = new CFGManagerMuxer(_T("CFGManagerMuxer"), NULL); - m_pGB->AddToROT(); - - if(FAILED(m_pGB->AddFilter(m_pMux, L"Mux")) - || !(m_pMC = m_pGB) || !(m_pME = m_pGB) || !(m_pMS = m_pMux) - || FAILED(m_pME->SetNotifyWindow((OAHWND)m_hWnd, WM_GRAPHNOTIFY, 0))) - { - MessageBeep(-1); - SendMessage(WM_CLOSE); - return TRUE; - } - - return TRUE; // return TRUE unless you set the focus to a control - // EXCEPTION: OCX Property Pages should return FALSE -} - -void CConvertDlg::OnOK() -{ -} - -BEGIN_MESSAGE_MAP(CConvertDlg, CResizableDialog) - ON_MESSAGE(WM_GRAPHNOTIFY, OnGraphNotify) - ON_WM_DROPFILES() - ON_WM_CLOSE() - ON_NOTIFY(NM_CLICK, IDC_TREE1, OnNMClickTree1) - ON_NOTIFY(NM_RCLICK, IDC_TREE1, OnNMRclickTree1) - ON_NOTIFY(NM_DBLCLK, IDC_TREE1, OnNMDblclkTree1) - ON_BN_CLICKED(IDC_BUTTON1, OnBnClickedButton1) - ON_UPDATE_COMMAND_UI(IDC_BUTTON1, OnUpdateButton1) - ON_WM_TIMER() - ON_BN_CLICKED(IDC_BUTTON2, OnBnClickedButton2) - ON_UPDATE_COMMAND_UI(IDC_BUTTON2, OnUpdateButton2) - ON_BN_CLICKED(IDC_BUTTON3, OnBnClickedButton3) - ON_UPDATE_COMMAND_UI(IDC_BUTTON3, OnUpdateButton3) - ON_BN_CLICKED(IDC_BUTTON4, OnBnClickedButton4) - ON_UPDATE_COMMAND_UI(IDC_BUTTON4, OnUpdateButton4) -END_MESSAGE_MAP() - -// CConvertDlg message handlers - -LRESULT CConvertDlg::OnGraphNotify(WPARAM wParam, LPARAM lParam) -{ - HRESULT hr = S_OK; - - LONG evCode, evParam1, evParam2; - while(m_pME && SUCCEEDED(m_pME->GetEvent(&evCode, (LONG_PTR*)&evParam1, (LONG_PTR*)&evParam2, 0))) - { - hr = m_pME->FreeEventParams(evCode, evParam1, evParam2); - - bool fStop = false; - - if(EC_COMPLETE == evCode) - { - fStop = true; - } - else if(EC_ERRORABORT == evCode) - { - fStop = true; - - CString errmsg; - LPVOID lpMsgBuf; - if(FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, hr, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&lpMsgBuf, 0, NULL)) - { - errmsg = (LPCTSTR)lpMsgBuf; - LocalFree(lpMsgBuf); - } - - CString str; - str.Format(_T("Could not complete conversion, the output file is most likely unusable.\n\nError code: 0x%08x"), evParam1); - if(!errmsg.IsEmpty()) str += _T(" (") + errmsg + _T(")"); - AfxMessageBox(str, MB_OK); - } - - if(fStop && m_pMC) - { - m_pMC->Stop(); - m_tree.EnableWindow(TRUE); - } - } - - return hr; -} - -void CConvertDlg::OnDropFiles(HDROP hDropInfo) -{ - for(int i = 0, j = DragQueryFile(hDropInfo, 0xffffffff, 0, 0); i < j; i++) - { - CString fn; - fn.ReleaseBufferSetLength(DragQueryFile(hDropInfo, i, fn.GetBuffer(MAX_PATH), MAX_PATH)); - - AddFile(fn); - } - - __super::OnDropFiles(hDropInfo); -} - -void CConvertDlg::OnClose() -{ - HTREEITEM hTI = m_tree.GetRootItem(); - while(hTI) - { - HTREEITEM hTINext = m_tree.GetNextSiblingItem(hTI); - DeleteItem(hTI); - hTI = hTINext; - } - - m_pGB->RemoveFromROT(); - m_pGB = NULL; - - __super::OnClose(); -} - -void CConvertDlg::OnNMClickTree1(NMHDR* pNMHDR, LRESULT* pResult) -{ - CPoint sp, cp; - HTREEITEM hTI = HitTest(sp, cp); - if(!hTI) return; - m_tree.SelectItem(hTI); - - *pResult = 0; -} - -void CConvertDlg::OnNMRclickTree1(NMHDR* pNMHDR, LRESULT* pResult) -{ - CPoint sp, cp; - HTREEITEM hTI = HitTest(sp, cp); - - if(hTI) - { - m_tree.SelectItem(hTI); - - CTreeItem* t = (CTreeItem*)m_tree.GetItemData(hTI); - - if(dynamic_cast(t)) - ShowPinPopup(hTI, sp); - else if(dynamic_cast(t)) - ShowFilePopup(hTI, sp); - else if(dynamic_cast(t)) - ShowResourceFolderPopup(hTI, sp); - else if(dynamic_cast(t)) - ShowResourcePopup(hTI, sp); - else if(dynamic_cast(t)) - ShowChapterFolderPopup(hTI, sp); - else if(dynamic_cast(t)) - ShowChapterPopup(hTI, sp); - } - else - { - ShowPopup(sp); - } - - *pResult = 0; -} - -void CConvertDlg::OnNMDblclkTree1(NMHDR *pNMHDR, LRESULT *pResult) -{ - CPoint sp, cp; - HTREEITEM hTI = HitTest(sp, cp); - - if(hTI) - { - CTreeItem* t = (CTreeItem*)m_tree.GetItemData(hTI); - - if(CTreeItemPin* t2 = dynamic_cast(t)) - { - CComPtr pPinTo; - t2->m_pPin->ConnectedTo(&pPinTo); - - if(CComQIPtr pPB = pPinTo) - EditProperties(pPB); - } - else if(CTreeItemResource* t2 = dynamic_cast(t)) - { - EditResource(t2); - } - else if(CTreeItemChapter* t2 = dynamic_cast(t)) - { - EditChapter(t2); - } - } - - *pResult = 0; -} - -void CConvertDlg::OnBnClickedButton1() -{ - UpdateData(); - - CFileDialog fd(FALSE, _T(".dsm"), m_fn, - OFN_EXPLORER|OFN_ENABLESIZING|OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, - _T("DirectShow Media file|*.dsm|All files|*.*|"), this, 0); - - if(fd.DoModal() == IDOK) - { - m_fn = fd.GetPathName(); - UpdateData(FALSE); - } -} - -void CConvertDlg::OnUpdateButton1(CCmdUI* pCmdUI) -{ - OAFilterState fs; - pCmdUI->Enable(m_pMC && SUCCEEDED(m_pMC->GetState(0, &fs)) && fs == State_Stopped); -} - -void CConvertDlg::OnTimer(UINT nIDEvent) -{ - if(nIDEvent == m_nIDEventStatus && m_pMS && m_pMC) - { - OAFilterState fs; - if(SUCCEEDED(m_pMC->GetState(0, &fs)) && fs != State_Stopped) - { - GUID tf; - m_pMS->GetTimeFormat(&tf); - - REFERENCE_TIME rtCur, rtDur; - HRESULT hr = m_pMS->GetDuration(&rtDur); - m_pMS->GetCurrentPosition(&rtCur); - - CString str; - if(hr == S_OK && rtDur != 0) str.Format(_T("%.2f%%"), 1.0 * (rtCur * 100) / rtDur); - else if(hr == S_OK && rtDur == 0) str = _T("Live"); - else if(tf == TIME_FORMAT_BYTE) str.Format(_T("%.2fKB"), 1.0 * rtCur / 1024); - else if(tf == TIME_FORMAT_MEDIA_TIME) str.Format(_T("%02d:%02d:%02d"), int(rtCur/3600000000)%60, int(rtCur/60000000)%60, int(rtCur/1000000)%60); - else str = _T("Please Wait"); - - SetWindowText(_T("Converting - ") + str); - } - else - { - SetWindowText(m_title); - } - } - - __super::OnTimer(nIDEvent); -} - -void CConvertDlg::OnBnClickedButton2() -{ - OAFilterState fs; - if(FAILED(m_pMC->GetState(0, &fs))) - return; - - if(fs != State_Stopped) - { - m_pMC->Run(); - return; - } - - UpdateData(); - - if(!ConvertFile(m_fn)) - { - AfxMessageBox(_T("Failed to start conversion")); - } -} - -void CConvertDlg::OnUpdateButton2(CCmdUI* pCmdUI) -{ - int nIn, nOut, nInC, nOutC; - CountPins(m_pMux, nIn, nOut, nInC, nOutC); - - OAFilterState fs; - pCmdUI->Enable(nInC > 0 && GetDlgItem(IDC_EDIT1)->GetWindowTextLength() > 0 - && m_pMS && m_pMC && SUCCEEDED(m_pMC->GetState(0, &fs)) && fs != State_Running); -} - -void CConvertDlg::OnBnClickedButton3() -{ - if(m_pMC) m_pMC->Pause(); -} - -void CConvertDlg::OnUpdateButton3(CCmdUI* pCmdUI) -{ - OAFilterState fs; - pCmdUI->Enable(m_pMC && SUCCEEDED(m_pMC->GetState(0, &fs)) && fs == State_Running); -} - -void CConvertDlg::OnBnClickedButton4() -{ - if(m_pMC) m_pMC->Stop(); - m_tree.EnableWindow(TRUE); -} - -void CConvertDlg::OnUpdateButton4(CCmdUI* pCmdUI) -{ - OAFilterState fs; - pCmdUI->Enable(m_pMC && SUCCEEDED(m_pMC->GetState(0, &fs)) && fs != State_Stopped); -} - -// -// CFilterTreeCtrl -// - -CFilterTreeCtrl::CFilterTreeCtrl() -{ -} - -void CFilterTreeCtrl::PreSubclassWindow() -{ - EnableToolTips(TRUE); - - __super::PreSubclassWindow(); -} - -INT_PTR CFilterTreeCtrl::OnToolHitTest(CPoint p, TOOLINFO* pTI) const -{ - UINT nFlags; - HTREEITEM hTI = HitTest(p, &nFlags); - if(nFlags & TVHT_ONITEM) - { - CRect r; - GetItemRect(hTI, r, TRUE); - pTI->hwnd = m_hWnd; - pTI->uId = (UINT)hTI; - pTI->lpszText = LPSTR_TEXTCALLBACK; - pTI->rect = r; - return pTI->uId; - } - - return -1; -} - -BEGIN_MESSAGE_MAP(CFilterTreeCtrl, CTreeCtrl) - ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTW, 0, 0xFFFF, OnToolTipText) - ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTA, 0, 0xFFFF, OnToolTipText) -END_MESSAGE_MAP() - -BOOL CFilterTreeCtrl::OnToolTipText(UINT id, NMHDR* pNMHDR, LRESULT* pResult) -{ - TOOLTIPTEXTA* pTTTA = (TOOLTIPTEXTA*)pNMHDR; - TOOLTIPTEXTW* pTTTW = (TOOLTIPTEXTW*)pNMHDR; - - UINT nID = pNMHDR->idFrom; - - if(nID == (UINT)m_hWnd - && (pNMHDR->code == TTN_NEEDTEXTA && (pTTTA->uFlags & TTF_IDISHWND) - || pNMHDR->code == TTN_NEEDTEXTW && (pTTTW->uFlags & TTF_IDISHWND))) - return FALSE; - - ::SendMessage(pNMHDR->hwndFrom, TTM_SETMAXTIPWIDTH, 0, (LPARAM)(INT)1000); - - HTREEITEM hTI = (HTREEITEM)nID; - - CString str; - static CStringA m_strTipTextA; - static CStringW m_strTipTextW; - - CConvertDlg::CTreeItem* t = (CConvertDlg::CTreeItem*)GetItemData(hTI); - if(!t || !t->ToolTip(str)) return FALSE; - - m_strTipTextA = str; - m_strTipTextW = str; - - if(pNMHDR->code == TTN_NEEDTEXTA) pTTTA->lpszText = (LPSTR)(LPCSTR)m_strTipTextA; - else pTTTW->lpszText = (LPWSTR)(LPCWSTR)m_strTipTextW; - - *pResult = 0; - - return TRUE; // message was handled -} - -// -// CConvertDlg::CTreeItem* -// - -CConvertDlg::CTreeItem::CTreeItem(CTreeCtrl& tree, HTREEITEM hTIParent) - : m_tree(tree) -{ - m_hTI = m_tree.InsertItem(_T(""), hTIParent); - m_tree.SetItemData(m_hTI, (DWORD_PTR)this); - Update(); -} - -CConvertDlg::CTreeItem::~CTreeItem() -{ -} - -void CConvertDlg::CTreeItem::SetLabel(LPCTSTR label) -{ - m_tree.SetItemText(m_hTI, label); -} - -void CConvertDlg::CTreeItem::SetImage(int nImage, int nSelectedImage) -{ - m_tree.SetItemImage(m_hTI, nImage, nSelectedImage); -} - -// - -CConvertDlg::CTreeItemFilter::CTreeItemFilter(IBaseFilter* pBF, CTreeCtrl& tree, HTREEITEM hTIParent) - : CTreeItem(tree, hTIParent) - , m_pBF(pBF) -{ - Update(); -} - -void CConvertDlg::CTreeItemFilter::Update() -{ - SetLabel(CString(GetFilterName(m_pBF))); -} - -// - -CConvertDlg::CTreeItemFile::CTreeItemFile(CString fn, IBaseFilter* pBF, CTreeCtrl& tree, HTREEITEM hTIParent) - : CTreeItemFilter(pBF, tree, hTIParent) - , m_fn(fn) -{ - Update(); -} - -void CConvertDlg::CTreeItemFile::Update() -{ - CPath path = m_fn; - path.StripPath(); - SetLabel(path); -} - -bool CConvertDlg::CTreeItemFile::ToolTip(CString& str) -{ - str = m_fn; - return true; -} - -// - -CConvertDlg::CTreeItemPin::CTreeItemPin(IPin* pPin, CTreeCtrl& tree, HTREEITEM hTIParent) - : CTreeItem(tree, hTIParent) - , m_pPin(pPin) -{ - Update(); -} - -void CConvertDlg::CTreeItemPin::Update() -{ - if(!m_pPin) {ASSERT(0); return;} - - CString label = GetPinName(m_pPin); - if(!IsConnected()) label = _T("[D] ") + label; - SetLabel(label); - - CMediaType mt; - if(S_OK == m_pPin->ConnectionMediaType(&mt)) - { - if(mt.majortype == MEDIATYPE_Video) SetImage(1, 1); - else if(mt.majortype == MEDIATYPE_Audio) SetImage(2, 2); - else if(mt.majortype == MEDIATYPE_Text || mt.majortype == MEDIATYPE_Subtitle) SetImage(3, 3); - } -} - -bool CConvertDlg::CTreeItemPin::ToolTip(CString& str) -{ - CMediaTypeEx mt; - if(FAILED(m_pPin->ConnectionMediaType(&mt))) return false; - str = mt.ToString(m_pPin); - return true; -} - -bool CConvertDlg::CTreeItemPin::IsConnected() -{ - CComPtr pPinTo; - return m_pPin && SUCCEEDED(m_pPin->ConnectedTo(&pPinTo)) && pPinTo; -} - -// - -CConvertDlg::CTreeItemResourceFolder::CTreeItemResourceFolder(CTreeCtrl& tree, HTREEITEM hTIParent) - : CTreeItem(tree, hTIParent) -{ - Update(); -} - -void CConvertDlg::CTreeItemResourceFolder::Update() -{ - SetLabel(_T("Resources")); -} - -bool CConvertDlg::CTreeItemResourceFolder::ToolTip(CString& str) -{ - if(!m_tree.ItemHasChildren(m_hTI)) - return false; - - int files = 0; - float size = 0; - - HTREEITEM hChildItem = m_tree.GetChildItem(m_hTI); - - while(hChildItem != NULL) - { - HTREEITEM hNextItem = m_tree.GetNextItem(hChildItem, TVGN_NEXT); - if(CTreeItemResource* t = dynamic_cast((CTreeItem*)m_tree.GetItemData(hChildItem))) - size += t->m_res.data.GetCount(), files++; - hChildItem = hNextItem; - } - - size /= 1024; - if(size < 1024) str.Format(_T("%d file(s), %.2f KB"), files, size); - else str.Format(_T("%d file(s), %.2f MB"), files, size/1024); - - return true; -} - -// - -CConvertDlg::CTreeItemResource::CTreeItemResource(const CDSMResource& res, CTreeCtrl& tree, HTREEITEM hTIParent) - : CTreeItem(tree, hTIParent) -{ - m_res = res; - Update(); -} - -CConvertDlg::CTreeItemResource::~CTreeItemResource() -{ -} - -void CConvertDlg::CTreeItemResource::Update() -{ - SetLabel(CString(m_res.name)); - - CStringW mime = m_res.mime; - mime.Trim(); - mime.MakeLower(); - if(mime == L"application/x-truetype-font") SetImage(4, 4); - else if(mime.Find(L"text/") == 0) SetImage(5, 5); - else SetImage(6, 6); -} - -bool CConvertDlg::CTreeItemResource::ToolTip(CString& str) -{ - if(!m_res.mime.IsEmpty()) str = CString(m_res.mime) + _T("\r\n\r\n"); - if(!m_res.desc.IsEmpty()) str += CString(m_res.desc); - str.Trim(); - return true; -} - -// - -CConvertDlg::CTreeItemChapterFolder::CTreeItemChapterFolder(CTreeCtrl& tree, HTREEITEM hTIParent) - : CTreeItem(tree, hTIParent) -{ - Update(); -} - -void CConvertDlg::CTreeItemChapterFolder::Update() -{ - SetLabel(_T("Chapters")); -} - -// - -CConvertDlg::CTreeItemChapter::CTreeItemChapter(const CDSMChapter& chap, CTreeCtrl& tree, HTREEITEM hTIParent) - : CTreeItem(tree, hTIParent) -{ - m_chap = chap; - Update(); -} - -void CConvertDlg::CTreeItemChapter::Update() -{ - REFERENCE_TIME rt = m_chap.rt; - rt /= 10000; - int ms = (int)(rt%1000); - rt /= 1000; - int s = (int)(rt%60); - rt /= 60; - int m = (int)(rt%60); - rt /= 60; - int h = (int)(rt); - - CString label; - label.Format(_T("%02d:%02d:%02d.%03d - %s"), h, m, s, ms, CString(m_chap.name)); - SetLabel(label); - - SetImage(7, 7); -} diff --git a/src/apps/mplayerc/ConvertDlg.h b/src/apps/mplayerc/ConvertDlg.h deleted file mode 100644 index 72bf7a271..000000000 --- a/src/apps/mplayerc/ConvertDlg.h +++ /dev/null @@ -1,190 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#pragma once -#include "IGraphBuilder2.h" -#include "..\..\DSUtil\DSMPropertyBag.h" - -class CFilterTreeCtrl : public CTreeCtrl -{ -public: - CFilterTreeCtrl(); - -protected: - virtual INT_PTR OnToolHitTest(CPoint point, TOOLINFO* pTI) const; - virtual void PreSubclassWindow(); - -public: - DECLARE_MESSAGE_MAP() - afx_msg BOOL OnToolTipText(UINT nID, NMHDR* pNMHDR, LRESULT* pResult); -}; - -// CConvertDlg dialog - -class CConvertDlg : public CResizableDialog -{ -public: - class CTreeItem - { - protected: - CTreeCtrl& m_tree; - HTREEITEM m_hTI; - - public: - CTreeItem(CTreeCtrl& tree, HTREEITEM hTIParent); - virtual ~CTreeItem(); - virtual void Update() {} - virtual bool ToolTip(CString& str) {return false;} - void SetLabel(LPCTSTR label); - void SetImage(int nImage, int nSelectedImage); - operator HTREEITEM() {return m_hTI;} - }; - - class CTreeItemFilter : public CTreeItem - { - public: - CComPtr m_pBF; - CTreeItemFilter(IBaseFilter* pBF, CTreeCtrl& tree, HTREEITEM hTIParent); - void Update(); - }; - - class CTreeItemFile : public CTreeItemFilter - { - public: - CString m_fn; - CTreeItemFile(CString fn, IBaseFilter* pBF, CTreeCtrl& tree, HTREEITEM hTIParent); - void Update(); - bool ToolTip(CString& str); - }; - - class CTreeItemPin : public CTreeItem - { - public: - CComPtr m_pPin; - CTreeItemPin(IPin* pPin, CTreeCtrl& tree, HTREEITEM hTIParent); - void Update(); - bool ToolTip(CString& str); - bool IsConnected(); - }; - - class CTreeItemResourceFolder : public CTreeItem - { - public: - CTreeItemResourceFolder(CTreeCtrl& tree, HTREEITEM hTIParent); - void Update(); - bool ToolTip(CString& str); - }; - - class CTreeItemResource : public CTreeItem - { - public: - CDSMResource m_res; - CTreeItemResource(const CDSMResource& res, CTreeCtrl& tree, HTREEITEM hTIParent); - ~CTreeItemResource(); - void Update(); - bool ToolTip(CString& str); - }; - - class CTreeItemChapterFolder : public CTreeItem - { - public: - CTreeItemChapterFolder(CTreeCtrl& tree, HTREEITEM hTIParent); - void Update(); - }; - - class CTreeItemChapter : public CTreeItem - { - public: - CDSMChapter m_chap; - CTreeItemChapter(const CDSMChapter& chap, CTreeCtrl& tree, HTREEITEM hTIParent); - void Update(); - }; - -private: - CComPtr m_pGB; - CComPtr m_pMux; - CComQIPtr m_pMC; - CComQIPtr m_pME; - CComQIPtr m_pMS; - - CString m_title; - UINT m_nIDEventStatus; - - CBitmap m_streamtypesbm; - CImageList m_streamtypes; - - CList m_pTIs; - - void AddFile(CString fn); - bool ConvertFile(LPCTSTR fn, IPin* pPin = NULL); - void AddFilter(HTREEITEM hTI, IBaseFilter* pBF); - void DeleteFilter(IBaseFilter* pBF); - void DeleteItem(HTREEITEM hTI); - void DeleteChildren(HTREEITEM hTI); - - HTREEITEM HitTest(CPoint& sp, CPoint& cp); - - void ShowPopup(CPoint p); - void ShowFilePopup(HTREEITEM hTI, CPoint p); - void ShowPinPopup(HTREEITEM hTI, CPoint p); - void ShowResourceFolderPopup(HTREEITEM hTI, CPoint p); - void ShowResourcePopup(HTREEITEM hTI, CPoint p); - void ShowChapterFolderPopup(HTREEITEM hTI, CPoint p); - void ShowChapterPopup(HTREEITEM hTI, CPoint p); - - bool EditProperties(IDSMPropertyBag* pPB); - bool EditResource(CTreeItemResource* t); - bool EditChapter(CTreeItemChapter* t); - -public: - CConvertDlg(CWnd* pParent = NULL); // standard constructor - virtual ~CConvertDlg(); - -// Dialog Data - enum { IDD = IDD_CONVERT_DLG }; - CFilterTreeCtrl m_tree; - CString m_fn; - -protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - virtual BOOL PreTranslateMessage(MSG* pMsg); - virtual BOOL OnInitDialog(); - virtual void OnOK(); - - DECLARE_MESSAGE_MAP() - -public: - afx_msg LRESULT OnGraphNotify(WPARAM wParam, LPARAM lParam); - afx_msg void OnDropFiles(HDROP hDropInfo); - afx_msg void OnClose(); - afx_msg void OnNMClickTree1(NMHDR *pNMHDR, LRESULT *pResult); - afx_msg void OnNMRclickTree1(NMHDR *pNMHDR, LRESULT *pResult); - afx_msg void OnNMDblclkTree1(NMHDR *pNMHDR, LRESULT *pResult); - afx_msg void OnBnClickedButton1(); - afx_msg void OnUpdateButton1(CCmdUI* pCmdUI); - afx_msg void OnTimer(UINT nIDEvent); - afx_msg void OnBnClickedButton2(); - afx_msg void OnBnClickedButton3(); - afx_msg void OnBnClickedButton4(); - afx_msg void OnUpdateButton2(CCmdUI* pCmdUI); - afx_msg void OnUpdateButton3(CCmdUI* pCmdUI); - afx_msg void OnUpdateButton4(CCmdUI* pCmdUI); -}; diff --git a/src/apps/mplayerc/ConvertPropsDlg.cpp b/src/apps/mplayerc/ConvertPropsDlg.cpp deleted file mode 100644 index da420438f..000000000 --- a/src/apps/mplayerc/ConvertPropsDlg.cpp +++ /dev/null @@ -1,202 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -// ConvertPropsDlg.cpp : implementation file -// - -#include "stdafx.h" -#include "mplayerc.h" -#include "ConvertPropsDlg.h" - - -// CConvertPropsDlg dialog - -CConvertPropsDlg::CConvertPropsDlg(bool fPin, CWnd* pParent /*=NULL*/) - : CResizableDialog(CConvertPropsDlg::IDD, pParent) - , m_fPin(fPin) -{ -} - -CConvertPropsDlg::~CConvertPropsDlg() -{ -} - -void CConvertPropsDlg::DoDataExchange(CDataExchange* pDX) -{ - __super::DoDataExchange(pDX); - DDX_Control(pDX, IDC_COMBO1, m_fcc); - DDX_Control(pDX, IDC_EDIT1, m_text); - DDX_Control(pDX, IDC_LIST1, m_list); -} - - -BEGIN_MESSAGE_MAP(CConvertPropsDlg, CResizableDialog) - ON_NOTIFY(NM_CLICK, IDC_LIST1, OnNMClickList1) - ON_BN_CLICKED(IDC_BUTTON1, OnBnClickedButton1) - ON_UPDATE_COMMAND_UI(IDC_BUTTON1, OnUpdateButton1) - ON_CBN_EDITCHANGE(IDC_COMBO1, OnCbnEditchangeCombo1) - ON_CBN_SELCHANGE(IDC_COMBO1, OnCbnSelchangeCombo1) - ON_NOTIFY(LVN_KEYDOWN, IDC_LIST1, OnLvnKeydownList1) -END_MESSAGE_MAP() - - -// CConvertPropsDlg message handlers - -BOOL CConvertPropsDlg::OnInitDialog() -{ - __super::OnInitDialog(); - - AddAnchor(IDC_COMBO1, TOP_LEFT); - AddAnchor(IDC_EDIT1, TOP_LEFT, TOP_RIGHT); - AddAnchor(IDC_BUTTON1, TOP_RIGHT); - AddAnchor(IDC_LIST1, TOP_LEFT, BOTTOM_RIGHT); - AddAnchor(IDOK, BOTTOM_CENTER); - AddAnchor(IDCANCEL, BOTTOM_CENTER); - - if(m_fPin) - { - m_fcc.AddString(_T("NAME")); - m_fcc.AddString(_T("LANG")); - m_fcc.AddString(_T("DESC")); - m_fcc.AddString(_T("SGRP")); - } - else - { - m_fcc.AddString(_T("TITL")); - m_fcc.AddString(_T("AUTH")); - m_fcc.AddString(_T("RTNG")); - m_fcc.AddString(_T("CPYR")); - m_fcc.AddString(_T("DESC")); - } - - m_list.InsertColumn(0, _T("ID"), LVCFMT_LEFT, 75); - m_list.InsertColumn(1, _T("Text"), LVCFMT_LEFT, 280); - - m_list.SetExtendedStyle(m_list.GetExtendedStyle()|LVS_EX_FULLROWSELECT); - - POSITION pos = m_props.GetStartPosition(); - while(pos) - { - CString key, value; - m_props.GetNextAssoc(pos, key, value); - SetItem(key, value); - } - - return TRUE; // return TRUE unless you set the focus to a control - // EXCEPTION: OCX Property Pages should return FALSE -} - -void CConvertPropsDlg::SetItem(CString key, CString value) -{ - LVFINDINFO fi; - fi.flags = LVFI_STRING; - fi.psz = key; - - int i = m_list.FindItem(&fi); - if(i < 0) i = m_list.InsertItem(m_list.GetItemCount(), _T("")); - - key.Trim(); - value.Trim(); - - if(value.IsEmpty()) - { - m_list.DeleteItem(i); - return; - } - - if(key == _T("LANG") && value.GetLength() != 3) - { - m_list.DeleteItem(i); - AfxMessageBox(_T("LANG has to be a three letter ISO 639-2 language code."), MB_OK); - return; - } - - m_list.SetItemText(i, 0, key); - m_list.SetItemText(i, 1, value); -} - -void CConvertPropsDlg::OnOK() -{ - m_props.RemoveAll(); - - for(int i = 0; i < m_list.GetItemCount(); i++) - m_props[m_list.GetItemText(i, 0)] = m_list.GetItemText(i, 1); - - __super::OnOK(); -} - -void CConvertPropsDlg::OnNMClickList1(NMHDR *pNMHDR, LRESULT *pResult) -{ - LPNMLISTVIEW lpnmlv = (LPNMLISTVIEW)pNMHDR; - - if(lpnmlv->iItem >= 0) - { - m_fcc.SetWindowText(m_list.GetItemText(lpnmlv->iItem, 0)); - m_text.SetWindowText(m_list.GetItemText(lpnmlv->iItem, 1)); - } - - *pResult = 0; -} - -void CConvertPropsDlg::OnBnClickedButton1() -{ - CString key, value; - m_fcc.GetWindowText(key); - m_text.GetWindowText(value); - if(key.GetLength() != 4) {AfxMessageBox(_T("ID must be 4 characters long!"), MB_OK); return;} - SetItem(key, value); -} - -void CConvertPropsDlg::OnUpdateButton1(CCmdUI* pCmdUI) -{ - pCmdUI->Enable(GetDlgItem(IDC_EDIT1)->GetWindowTextLength() > 0); -} - -void CConvertPropsDlg::OnCbnEditchangeCombo1() -{ - int i = m_fcc.GetCurSel(); - if(i < 0) return; - - CString key; - m_fcc.GetLBText(i, key); - - LVFINDINFO fi; - fi.flags = LVFI_STRING; - fi.psz = key; - - i = m_list.FindItem(&fi); - if(i > 0) m_text.SetWindowText(m_list.GetItemText(i, 1)); -} - -void CConvertPropsDlg::OnCbnSelchangeCombo1() -{ - OnCbnEditchangeCombo1(); -} - -void CConvertPropsDlg::OnLvnKeydownList1(NMHDR *pNMHDR, LRESULT *pResult) -{ - LPNMLVKEYDOWN pLVKeyDow = reinterpret_cast(pNMHDR); - - int i = m_fcc.GetCurSel(); - if(i >= 0) m_list.DeleteItem(i); - - *pResult = 0; -} diff --git a/src/apps/mplayerc/ConvertPropsDlg.h b/src/apps/mplayerc/ConvertPropsDlg.h deleted file mode 100644 index 53824eed6..000000000 --- a/src/apps/mplayerc/ConvertPropsDlg.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#pragma once -#include "..\..\DSUtil\DSMPropertyBag.h" -#include "afxwin.h" -#include "afxcmn.h" - -// CConvertPropsDlg dialog - -class CConvertPropsDlg : public CResizableDialog -{ -private: - bool m_fPin; - void SetItem(CString key, CString value); - -public: - CConvertPropsDlg(bool fPin, CWnd* pParent = NULL); // standard constructor - virtual ~CConvertPropsDlg(); - - CAtlStringMap<> m_props; - -// Dialog Data - enum { IDD = IDD_CONVERTPROPS_DLG }; - CComboBox m_fcc; - CEdit m_text; - CListCtrl m_list; - -protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - virtual BOOL OnInitDialog(); - virtual void OnOK(); - - DECLARE_MESSAGE_MAP() -public: - afx_msg void OnNMClickList1(NMHDR *pNMHDR, LRESULT *pResult); - afx_msg void OnBnClickedButton1(); - afx_msg void OnUpdateButton1(CCmdUI* pCmdUI); - afx_msg void OnCbnEditchangeCombo1(); - afx_msg void OnCbnSelchangeCombo1(); - afx_msg void OnLvnKeydownList1(NMHDR *pNMHDR, LRESULT *pResult); -}; diff --git a/src/apps/mplayerc/ConvertResDlg.cpp b/src/apps/mplayerc/ConvertResDlg.cpp deleted file mode 100644 index 37d632801..000000000 --- a/src/apps/mplayerc/ConvertResDlg.cpp +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -// ConvertResDlg.cpp : implementation file -// - -#include "stdafx.h" -#include "mplayerc.h" -#include "ConvertResDlg.h" - -// CConvertResDlg dialog - -CConvertResDlg::CConvertResDlg(CWnd* pParent /*=NULL*/) - : CResizableDialog(CConvertResDlg::IDD, pParent) - , m_name(_T("")) - , m_desc(_T("")) -{ -} - -CConvertResDlg::~CConvertResDlg() -{ -} - -void CConvertResDlg::DoDataExchange(CDataExchange* pDX) -{ - __super::DoDataExchange(pDX); - DDX_Text(pDX, IDC_EDIT3, m_name); - DDX_Text(pDX, IDC_COMBO1, m_mime); - DDX_Control(pDX, IDC_COMBO1, m_mimectrl); - DDX_Text(pDX, IDC_EDIT2, m_desc); -} - -BOOL CConvertResDlg::OnInitDialog() -{ - __super::OnInitDialog(); - - AddAnchor(IDC_EDIT3, TOP_LEFT, TOP_RIGHT); - AddAnchor(IDC_COMBO1, TOP_LEFT, TOP_RIGHT); - AddAnchor(IDC_EDIT2, TOP_LEFT, BOTTOM_RIGHT); - AddAnchor(IDOK, BOTTOM_CENTER); - AddAnchor(IDCANCEL, BOTTOM_CENTER); - - CRegKey key; - CString str(_T("MIME\\Database\\Content Type")); - if(ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, str, KEY_READ)) - { - CAtlStringMap mimes; - - TCHAR buff[256]; - DWORD len = countof(buff); - for(int i = 0; ERROR_SUCCESS == key.EnumKey(i, buff, &len); i++, len = countof(buff)) - { - CRegKey mime; - TCHAR ext[64]; - ULONG len = countof(ext); - if(ERROR_SUCCESS == mime.Open(HKEY_CLASSES_ROOT, str + _T("\\") + buff, KEY_READ) - && ERROR_SUCCESS == mime.QueryStringValue(_T("Extension"), ext, &len)) - { - CString mime = CString(buff).MakeLower(); - mimes[mime] = true; - m_mimectrl.AddString(mime); - } - } - - static TCHAR* moremimes[] = - { - _T("application/octet-stream"), - _T("application/zip"), - _T("application/rar"), - _T("application/x-truetype-font"), - }; - - for(int i = 0; i < countof(moremimes); i++) - if(!mimes.Lookup(moremimes[i])) - m_mimectrl.AddString(moremimes[i]); - } - - m_desc.Replace(_T("\n"), _T("\r\n")); - - UpdateData(FALSE); - - return TRUE; // return TRUE unless you set the focus to a control - // EXCEPTION: OCX Property Pages should return FALSE -} - -void CConvertResDlg::OnOK() -{ - UpdateData(); - - m_name.Trim(); - m_mime.Trim(); - m_desc.Replace(_T("\r\n"), _T("\r")); - m_desc.Trim(); - - __super::OnOK(); -} - -BEGIN_MESSAGE_MAP(CConvertResDlg, CResizableDialog) - ON_UPDATE_COMMAND_UI(IDOK, OnUpdateOK) -END_MESSAGE_MAP() - -// CConvertResDlg message handlers - -void CConvertResDlg::OnUpdateOK(CCmdUI* pCmdUI) -{ - pCmdUI->Enable(GetDlgItem(IDC_EDIT3)->GetWindowTextLength() > 0 && GetDlgItem(IDC_COMBO1)->GetWindowTextLength() > 0); -} diff --git a/src/apps/mplayerc/ConvertResDlg.h b/src/apps/mplayerc/ConvertResDlg.h deleted file mode 100644 index 45d54b946..000000000 --- a/src/apps/mplayerc/ConvertResDlg.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#pragma once -#include "afxwin.h" - - -// CConvertResDlg dialog - -class CConvertResDlg : public CResizableDialog -{ -public: - CConvertResDlg(CWnd* pParent = NULL); // standard constructor - virtual ~CConvertResDlg(); - -// Dialog Data - enum { IDD = IDD_CONVERTRES_DLG }; - CString m_name; - CString m_mime; - CComboBox m_mimectrl; - CString m_desc; - -protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - virtual BOOL OnInitDialog(); - virtual void OnOK(); - - DECLARE_MESSAGE_MAP() -public: - afx_msg void OnUpdateOK(CCmdUI* pCmdUI); -}; diff --git a/src/apps/mplayerc/DX7AllocatorPresenter.cpp b/src/apps/mplayerc/DX7AllocatorPresenter.cpp deleted file mode 100644 index 9b57feee0..000000000 --- a/src/apps/mplayerc/DX7AllocatorPresenter.cpp +++ /dev/null @@ -1,1321 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include "stdafx.h" -#include "mplayerc.h" -#include -#include -#include "..\..\DSUtil\DSUtil.h" - -#include -#include "DX7AllocatorPresenter.h" -#include -#include -#include "..\..\SubPic\DX7SubPic.h" -#include "..\..\..\include\RealMedia\pntypes.h" -#include "..\..\..\include\RealMedia\pnwintyp.h" -#include "..\..\..\include\RealMedia\pncom.h" -#include "..\..\..\include\RealMedia\rmavsurf.h" -#include "IQTVideoSurface.h" - -#include "IPinHook.h" - -bool IsVMR7InGraph(IFilterGraph* pFG) -{ - BeginEnumFilters(pFG, pEF, pBF) - if(CComQIPtr(pBF)) return(true); - EndEnumFilters - return(false); -} - -namespace DSObjects -{ - -class CDX7AllocatorPresenter - : public ISubPicAllocatorPresenterImpl -{ -protected: - CSize m_ScreenSize; - - CComPtr m_pDD; - CComQIPtr m_pD3D; - CComPtr m_pD3DDev; - - CComPtr m_pPrimary, m_pBackBuffer; - CComPtr m_pVideoTexture, m_pVideoSurface; - - virtual HRESULT CreateDevice(); - virtual HRESULT AllocSurfaces(); - virtual void DeleteSurfaces(); - -public: - CDX7AllocatorPresenter(HWND hWnd, HRESULT& hr); - - // ISubPicAllocatorPresenter - STDMETHODIMP CreateRenderer(IUnknown** ppRenderer); - STDMETHODIMP_(bool) Paint(bool fAll); - STDMETHODIMP GetDIB(BYTE* lpDib, DWORD* size); -}; - -class CVMR7AllocatorPresenter - : public CDX7AllocatorPresenter - , public IVMRSurfaceAllocator - , public IVMRImagePresenter - , public IVMRWindowlessControl -{ - CComPtr m_pIVMRSurfAllocNotify; - CComPtr m_pSA; - - HRESULT CreateDevice(); - void DeleteSurfaces(); - - bool m_fUseInternalTimer; - -public: - CVMR7AllocatorPresenter(HWND hWnd, HRESULT& hr); - - DECLARE_IUNKNOWN - STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv); - - // ISubPicAllocatorPresenter - STDMETHODIMP CreateRenderer(IUnknown** ppRenderer); - STDMETHODIMP_(void) SetTime(REFERENCE_TIME rtNow); - - // IVMRSurfaceAllocator - STDMETHODIMP AllocateSurface(DWORD_PTR dwUserID, VMRALLOCATIONINFO* lpAllocInfo, DWORD* lpdwBuffer, LPDIRECTDRAWSURFACE7* lplpSurface); - STDMETHODIMP FreeSurface(DWORD_PTR dwUserID); - STDMETHODIMP PrepareSurface(DWORD_PTR dwUserID, IDirectDrawSurface7* lpSurface, DWORD dwSurfaceFlags); - STDMETHODIMP AdviseNotify(IVMRSurfaceAllocatorNotify* lpIVMRSurfAllocNotify); - - // IVMRImagePresenter - STDMETHODIMP StartPresenting(DWORD_PTR dwUserID); - STDMETHODIMP StopPresenting(DWORD_PTR dwUserID); - STDMETHODIMP PresentImage(DWORD_PTR dwUserID, VMRPRESENTATIONINFO* lpPresInfo); - - // IVMRWindowlessControl - STDMETHODIMP GetNativeVideoSize(LONG* lpWidth, LONG* lpHeight, LONG* lpARWidth, LONG* lpARHeight); - STDMETHODIMP GetMinIdealVideoSize(LONG* lpWidth, LONG* lpHeight); - STDMETHODIMP GetMaxIdealVideoSize(LONG* lpWidth, LONG* lpHeight); - STDMETHODIMP SetVideoPosition(const LPRECT lpSRCRect, const LPRECT lpDSTRect); - STDMETHODIMP GetVideoPosition(LPRECT lpSRCRect, LPRECT lpDSTRect); - STDMETHODIMP GetAspectRatioMode(DWORD* lpAspectRatioMode); - STDMETHODIMP SetAspectRatioMode(DWORD AspectRatioMode); - STDMETHODIMP SetVideoClippingWindow(HWND hwnd); - STDMETHODIMP RepaintVideo(HWND hwnd, HDC hdc); - STDMETHODIMP DisplayModeChanged(); - STDMETHODIMP GetCurrentImage(BYTE** lpDib); - STDMETHODIMP SetBorderColor(COLORREF Clr); - STDMETHODIMP GetBorderColor(COLORREF* lpClr); - STDMETHODIMP SetColorKey(COLORREF Clr); - STDMETHODIMP GetColorKey(COLORREF* lpClr); -}; - -class CRM7AllocatorPresenter - : public CDX7AllocatorPresenter - , public IRMAVideoSurface -{ - CComPtr m_pVideoSurfaceOff; - CComPtr m_pVideoSurfaceYUY2; - - RMABitmapInfoHeader m_bitmapInfo; - RMABitmapInfoHeader m_lastBitmapInfo; - -protected: - HRESULT AllocSurfaces(); - void DeleteSurfaces(); - -public: - CRM7AllocatorPresenter(HWND hWnd, HRESULT& hr); - - DECLARE_IUNKNOWN - STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv); - - // IRMAVideoSurface - STDMETHODIMP Blt(UCHAR* pImageData, RMABitmapInfoHeader* pBitmapInfo, REF(PNxRect) inDestRect, REF(PNxRect) inSrcRect); - STDMETHODIMP BeginOptimizedBlt(RMABitmapInfoHeader* pBitmapInfo); - STDMETHODIMP OptimizedBlt(UCHAR* pImageBits, REF(PNxRect) rDestRect, REF(PNxRect) rSrcRect); - STDMETHODIMP EndOptimizedBlt(); - STDMETHODIMP GetOptimizedFormat(REF(RMA_COMPRESSION_TYPE) ulType); - STDMETHODIMP GetPreferredFormat(REF(RMA_COMPRESSION_TYPE) ulType); -}; - -class CQT7AllocatorPresenter - : public CDX7AllocatorPresenter - , public IQTVideoSurface -{ - CComPtr m_pVideoSurfaceOff; - -protected: - HRESULT AllocSurfaces(); - void DeleteSurfaces(); - -public: - CQT7AllocatorPresenter(HWND hWnd, HRESULT& hr); - - DECLARE_IUNKNOWN - STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv); - - // IQTVideoSurface - STDMETHODIMP BeginBlt(const BITMAP& bm); - STDMETHODIMP DoBlt(const BITMAP& bm); -}; - -} -using namespace DSObjects; - -// - -HRESULT CreateAP7(const CLSID& clsid, HWND hWnd, ISubPicAllocatorPresenter** ppAP) -{ - CheckPointer(ppAP, E_POINTER); - - *ppAP = NULL; - - HRESULT hr; - if(clsid == CLSID_VMR7AllocatorPresenter && !(*ppAP = new CVMR7AllocatorPresenter(hWnd, hr)) - || clsid == CLSID_RM7AllocatorPresenter && !(*ppAP = new CRM7AllocatorPresenter(hWnd, hr)) - || clsid == CLSID_QT7AllocatorPresenter && !(*ppAP = new CQT7AllocatorPresenter(hWnd, hr))) - return E_OUTOFMEMORY; - - if(*ppAP == NULL) - return E_FAIL; - - (*ppAP)->AddRef(); - - if(FAILED(hr)) - { - (*ppAP)->Release(); - *ppAP = NULL; - } - - return hr; -} - -// - -static HRESULT TextureBlt(CComPtr pD3DDev, CComPtr pTexture, Vector dst[4], CRect src) -{ - if(!pTexture) - return E_POINTER; - - HRESULT hr; - - do - { - DDSURFACEDESC2 ddsd; - INITDDSTRUCT(ddsd); - if(FAILED(hr = pTexture->GetSurfaceDesc(&ddsd))) - break; - - float w = (float)ddsd.dwWidth; - float h = (float)ddsd.dwHeight; - - struct - { - float x, y, z, rhw; - float tu, tv; - } - pVertices[] = - { - {(float)dst[0].x, (float)dst[0].y, (float)dst[0].z, 1.0f/(float)dst[0].z, (float)src.left / w, (float)src.top / h}, - {(float)dst[1].x, (float)dst[1].y, (float)dst[1].z, 1.0f/(float)dst[1].z, (float)src.right / w, (float)src.top / h}, - {(float)dst[2].x, (float)dst[2].y, (float)dst[2].z, 1.0f/(float)dst[2].z, (float)src.left / w, (float)src.bottom / h}, - {(float)dst[3].x, (float)dst[3].y, (float)dst[3].z, 1.0f/(float)dst[3].z, (float)src.right / w, (float)src.bottom / h}, - }; - - for(int i = 0; i < countof(pVertices); i++) - { - pVertices[i].x -= 0.5; - pVertices[i].y -= 0.5; - } - - hr = pD3DDev->SetTexture(0, pTexture); - - pD3DDev->SetRenderState(D3DRENDERSTATE_CULLMODE, D3DCULL_NONE); - pD3DDev->SetRenderState(D3DRENDERSTATE_LIGHTING, FALSE); - pD3DDev->SetRenderState(D3DRENDERSTATE_BLENDENABLE, FALSE); - pD3DDev->SetRenderState(D3DRENDERSTATE_ALPHATESTENABLE, FALSE); - - pD3DDev->SetTextureStageState(0, D3DTSS_MAGFILTER, D3DTFG_LINEAR); - pD3DDev->SetTextureStageState(0, D3DTSS_MINFILTER, D3DTFN_LINEAR); - pD3DDev->SetTextureStageState(0, D3DTSS_MIPFILTER, D3DTFP_LINEAR); - - pD3DDev->SetTextureStageState(0, D3DTSS_ADDRESS, D3DTADDRESS_CLAMP); - - // - - if(FAILED(hr = pD3DDev->BeginScene())) - break; - - hr = pD3DDev->DrawPrimitive(D3DPT_TRIANGLESTRIP, - D3DFVF_XYZRHW | D3DFVF_TEX1, - pVertices, 4, D3DDP_WAIT); - pD3DDev->EndScene(); - - // - - pD3DDev->SetTexture(0, NULL); - - return S_OK; - } - while(0); - - return E_FAIL; -} - -// -// CDX7AllocatorPresenter -// - -CDX7AllocatorPresenter::CDX7AllocatorPresenter(HWND hWnd, HRESULT& hr) - : ISubPicAllocatorPresenterImpl(hWnd, hr) - , m_ScreenSize(0, 0) -{ - if(FAILED(hr)) return; - - if(FAILED(hr = DirectDrawCreateEx(NULL, (VOID**)&m_pDD, IID_IDirectDraw7, NULL)) - || FAILED(hr = m_pDD->SetCooperativeLevel(AfxGetMainWnd()->GetSafeHwnd(), DDSCL_NORMAL))) - return; - - if(!(m_pD3D = m_pDD)) {hr = E_NOINTERFACE; return;} - - hr = CreateDevice(); -} - -HRESULT CDX7AllocatorPresenter::CreateDevice() -{ - m_pD3DDev = NULL; - - m_pPrimary = NULL; - m_pBackBuffer = NULL; - - DDSURFACEDESC2 ddsd; - INITDDSTRUCT(ddsd); - if(FAILED(m_pDD->GetDisplayMode(&ddsd)) - || ddsd.ddpfPixelFormat.dwRGBBitCount <= 8) - return DDERR_INVALIDMODE; - - m_ScreenSize.SetSize(ddsd.dwWidth, ddsd.dwHeight); - - HRESULT hr; - - // m_pPrimary - - INITDDSTRUCT(ddsd); - ddsd.dwFlags = DDSD_CAPS; - ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; - if(FAILED(hr = m_pDD->CreateSurface(&ddsd, &m_pPrimary, NULL))) - return hr; - - CComPtr pcClipper; - if(FAILED(hr = m_pDD->CreateClipper(0, &pcClipper, NULL))) - return hr; - pcClipper->SetHWnd(0, m_hWnd); - m_pPrimary->SetClipper(pcClipper); - - // m_pBackBuffer - - INITDDSTRUCT(ddsd); - ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; - ddsd.ddsCaps.dwCaps = /*DDSCAPS_OFFSCREENPLAIN |*/ DDSCAPS_VIDEOMEMORY | DDSCAPS_3DDEVICE; - ddsd.dwWidth = m_ScreenSize.cx; - ddsd.dwHeight = m_ScreenSize.cy; - if(FAILED(hr = m_pDD->CreateSurface(&ddsd, &m_pBackBuffer, NULL))) - return hr; - - pcClipper = NULL; - if(FAILED(hr = m_pDD->CreateClipper(0, &pcClipper, NULL))) - return hr; - BYTE rgnDataBuffer[1024]; - HRGN hrgn = CreateRectRgn(0, 0, ddsd.dwWidth, ddsd.dwHeight); - GetRegionData(hrgn, sizeof(rgnDataBuffer), (RGNDATA*)rgnDataBuffer); - DeleteObject(hrgn); - pcClipper->SetClipList((RGNDATA*)rgnDataBuffer, 0); - m_pBackBuffer->SetClipper(pcClipper); - - // m_pD3DDev - - if(FAILED(hr = m_pD3D->CreateDevice(IID_IDirect3DHALDevice, m_pBackBuffer, &m_pD3DDev))) // this seems to fail if the desktop size is too large (width or height >2048) - return hr; - - // - - CComPtr pSubPicProvider; - if(m_pSubPicQueue) m_pSubPicQueue->GetSubPicProvider(&pSubPicProvider); - - CSize size; - switch(AfxGetAppSettings().nSPCMaxRes) - { - case 0: default: size = m_ScreenSize; break; - case 1: size.SetSize(1024, 768); break; - case 2: size.SetSize(800, 600); break; - case 3: size.SetSize(640, 480); break; - case 4: size.SetSize(512, 384); break; - case 5: size.SetSize(384, 288); break; - } - - if(m_pAllocator) - { - m_pAllocator->ChangeDevice(m_pD3DDev); - } - else - { - m_pAllocator = new CDX7SubPicAllocator(m_pD3DDev, size, AfxGetAppSettings().fSPCPow2Tex); - if(!m_pAllocator || FAILED(hr)) - return E_FAIL; - } - - hr = S_OK; - m_pSubPicQueue = AfxGetAppSettings().nSPCSize > 0 - ? (ISubPicQueue*)new CSubPicQueue(AfxGetAppSettings().nSPCSize, m_pAllocator, &hr) - : (ISubPicQueue*)new CSubPicQueueNoThread(m_pAllocator, &hr); - if(!m_pSubPicQueue || FAILED(hr)) - return E_FAIL; - - if(pSubPicProvider) m_pSubPicQueue->SetSubPicProvider(pSubPicProvider); - - return S_OK; -} - -HRESULT CDX7AllocatorPresenter::AllocSurfaces() -{ - CAutoLock cAutoLock(this); - - AppSettings& s = AfxGetAppSettings(); - - m_pVideoTexture = NULL; - m_pVideoSurface = NULL; - - DDSURFACEDESC2 ddsd; - INITDDSTRUCT(ddsd); - ddsd.dwFlags = DDSD_CAPS|DDSD_WIDTH|DDSD_HEIGHT|DDSD_PIXELFORMAT; - ddsd.ddsCaps.dwCaps = DDSCAPS_VIDEOMEMORY; - ddsd.dwWidth = m_NativeVideoSize.cx; - ddsd.dwHeight = m_NativeVideoSize.cy; - ddsd.ddpfPixelFormat.dwSize = sizeof(DDPIXELFORMAT); - ddsd.ddpfPixelFormat.dwFlags = DDPF_RGB; - ddsd.ddpfPixelFormat.dwRGBBitCount = 32; - ddsd.ddpfPixelFormat.dwRBitMask = 0x00FF0000; - ddsd.ddpfPixelFormat.dwGBitMask = 0x0000FF00; - ddsd.ddpfPixelFormat.dwBBitMask = 0x000000FF; - - if(s.iAPSurfaceUsage == VIDRNDT_AP_TEXTURE2D || s.iAPSurfaceUsage == VIDRNDT_AP_TEXTURE3D) - { - ddsd.ddsCaps.dwCaps |= DDSCAPS_TEXTURE; -// ddsd.ddpfPixelFormat.dwFlags |= DDPF_ALPHAPIXELS; -// ddsd.ddpfPixelFormat.dwRGBAlphaBitMask = 0xFF000000; - } - - HRESULT hr = m_pDD->CreateSurface(&ddsd, &m_pVideoSurface, NULL); - if(FAILED(hr)) - { - // FIXME: eh, dx9 has no problem creating a 32bpp surface under a 16bpp desktop, but dx7 fails here (textures are ok) - DDSURFACEDESC2 ddsd2; - INITDDSTRUCT(ddsd2); - if(!(s.iAPSurfaceUsage == VIDRNDT_AP_TEXTURE2D || s.iAPSurfaceUsage == VIDRNDT_AP_TEXTURE3D) - && SUCCEEDED(m_pDD->GetDisplayMode(&ddsd2)) - && ddsd2.ddpfPixelFormat.dwRGBBitCount == 16) - { - ddsd.ddpfPixelFormat.dwRGBBitCount = 16; - ddsd.ddpfPixelFormat.dwRBitMask = 0x0000F800; - ddsd.ddpfPixelFormat.dwGBitMask = 0x000007E0; - ddsd.ddpfPixelFormat.dwBBitMask = 0x0000001F; - hr = m_pDD->CreateSurface(&ddsd, &m_pVideoSurface, NULL); - } - - if(FAILED(hr)) - return hr; - } - - if(s.iAPSurfaceUsage == VIDRNDT_AP_TEXTURE3D) - m_pVideoTexture = m_pVideoSurface; - - DDBLTFX fx; - INITDDSTRUCT(fx); - fx.dwFillColor = 0; - hr = m_pVideoSurface->Blt(NULL, NULL, NULL, DDBLT_WAIT|DDBLT_COLORFILL, &fx); - - return S_OK; -} - -void CDX7AllocatorPresenter::DeleteSurfaces() -{ - CAutoLock cAutoLock(this); - - m_pVideoTexture = NULL; - m_pVideoSurface = NULL; -} - -// ISubPicAllocatorPresenter - -STDMETHODIMP CDX7AllocatorPresenter::CreateRenderer(IUnknown** ppRenderer) -{ - return E_NOTIMPL; -} - -STDMETHODIMP_(bool) CDX7AllocatorPresenter::Paint(bool fAll) -{ - CAutoLock cAutoLock(this); - - if(m_WindowRect.right <= m_WindowRect.left || m_WindowRect.bottom <= m_WindowRect.top - || m_NativeVideoSize.cx <= 0 || m_NativeVideoSize.cy <= 0 - || !m_pPrimary || !m_pBackBuffer || !m_pVideoSurface) - return(false); - - HRESULT hr; - - CRect rSrcVid(CPoint(0, 0), m_NativeVideoSize); - CRect rDstVid(m_VideoRect); - - CRect rSrcPri(CPoint(0, 0), m_WindowRect.Size()); - CRect rDstPri(m_WindowRect); - MapWindowRect(m_hWnd, HWND_DESKTOP, &rDstPri); - - if(fAll) - { - // clear the backbuffer - - CRect rl(0, 0, rDstVid.left, rSrcPri.bottom); - CRect rr(rDstVid.right, 0, rSrcPri.right, rSrcPri.bottom); - CRect rt(0, 0, rSrcPri.right, rDstVid.top); - CRect rb(0, rDstVid.bottom, rSrcPri.right, rSrcPri.bottom); - - DDBLTFX fx; - INITDDSTRUCT(fx); - fx.dwFillColor = 0; - hr = m_pBackBuffer->Blt(NULL, NULL, NULL, DDBLT_WAIT|DDBLT_COLORFILL, &fx); - - // paint the video on the backbuffer - - if(!rDstVid.IsRectEmpty()) - { - if(m_pVideoTexture) - { - Vector v[4]; - Transform(rDstVid, v); - hr = TextureBlt(m_pD3DDev, m_pVideoTexture, v, rSrcVid); - } - else - { - hr = m_pBackBuffer->Blt(rDstVid, m_pVideoSurface, rSrcVid, DDBLT_WAIT, NULL); - } - } - - // paint the text on the backbuffer - - AlphaBltSubPic(rSrcPri.Size()); - } - - // wait vsync - - m_pDD->WaitForVerticalBlank(DDWAITVB_BLOCKBEGIN, NULL); - - // blt to the primary surface - - hr = m_pPrimary->Blt(rDstPri, m_pBackBuffer, rSrcPri, DDBLT_WAIT, NULL); - - if(hr == DDERR_SURFACELOST) - { - HRESULT hr = DDERR_WRONGMODE; // m_pDD->TestCooperativeLevel(); - - if(hr == DDERR_WRONGMODE) - { - DeleteSurfaces(); - if(SUCCEEDED(CreateDevice()) || FAILED(hr = AllocSurfaces())) - return(true); - } - - hr = S_OK; - } - - return(true); -} - -STDMETHODIMP CDX7AllocatorPresenter::GetDIB(BYTE* lpDib, DWORD* size) -{ - CheckPointer(size, E_POINTER); - - HRESULT hr; - - DDSURFACEDESC2 ddsd; - INITDDSTRUCT(ddsd); - if(FAILED(m_pVideoSurface->GetSurfaceDesc(&ddsd))) - return E_FAIL; - - if(ddsd.ddpfPixelFormat.dwRGBBitCount != 16 && ddsd.ddpfPixelFormat.dwRGBBitCount != 32) - return E_FAIL; - - DWORD required = sizeof(BITMAPINFOHEADER) + (ddsd.dwWidth*ddsd.dwHeight*32>>3); - if(!lpDib) {*size = required; return S_OK;} - if(*size < required) return E_OUTOFMEMORY; - *size = required; - - INITDDSTRUCT(ddsd); - if(FAILED(hr = m_pVideoSurface->Lock(NULL, &ddsd, DDLOCK_WAIT|DDLOCK_SURFACEMEMORYPTR|DDLOCK_READONLY|DDLOCK_NOSYSLOCK, NULL))) - { - // TODO - return hr; - } - - BITMAPINFOHEADER* bih = (BITMAPINFOHEADER*)lpDib; - memset(bih, 0, sizeof(BITMAPINFOHEADER)); - bih->biSize = sizeof(BITMAPINFOHEADER); - bih->biWidth = ddsd.dwWidth; - bih->biHeight = ddsd.dwHeight; - bih->biBitCount = 32; - bih->biPlanes = 1; - bih->biSizeImage = bih->biWidth*bih->biHeight*bih->biBitCount>>3; - - BitBltFromRGBToRGB( - bih->biWidth, bih->biHeight, - (BYTE*)(bih + 1), bih->biWidth*bih->biBitCount>>3, bih->biBitCount, - (BYTE*)ddsd.lpSurface + ddsd.lPitch*(ddsd.dwHeight-1), -(int)ddsd.lPitch, ddsd.ddpfPixelFormat.dwRGBBitCount); - - m_pVideoSurface->Unlock(NULL); - -/* - BitBltFromRGBToRGB( - w, h, - (BYTE*)ddsd.lpSurface, ddsd.lPitch, ddsd.ddpfPixelFormat.dwRGBBitCount, - (BYTE*)bm.bmBits, bm.bmWidthBytes, bm.bmBitsPixel); - m_pVideoSurfaceOff->Unlock(NULL); - fOk = true; - } -*/ - - return S_OK; -} - -// -// CVMR7AllocatorPresenter -// - -#define MY_USER_ID 0x6ABE51 - -CVMR7AllocatorPresenter::CVMR7AllocatorPresenter(HWND hWnd, HRESULT& hr) - : CDX7AllocatorPresenter(hWnd, hr) - , m_fUseInternalTimer(false) -{ - if(FAILED(hr)) - return; - - if(FAILED(hr = m_pSA.CoCreateInstance(CLSID_AllocPresenter))) - { - hr = E_FAIL; - return; - } -} - -STDMETHODIMP CVMR7AllocatorPresenter::NonDelegatingQueryInterface(REFIID riid, void** ppv) -{ - CheckPointer(ppv, E_POINTER); - - return - QI(IVMRSurfaceAllocator) - QI(IVMRImagePresenter) - QI(IVMRWindowlessControl) - __super::NonDelegatingQueryInterface(riid, ppv); -} - -HRESULT CVMR7AllocatorPresenter::CreateDevice() -{ - HRESULT hr = __super::CreateDevice(); - if(FAILED(hr)) return hr; - - if(m_pIVMRSurfAllocNotify) - { - HMONITOR hMonitor = MonitorFromWindow(m_hWnd, MONITOR_DEFAULTTONEAREST); - if(FAILED(hr = m_pIVMRSurfAllocNotify->ChangeDDrawDevice(m_pDD, hMonitor))) - return(false); - } - - return hr; -} - -void CVMR7AllocatorPresenter::DeleteSurfaces() -{ - CAutoLock cAutoLock(this); - - m_pSA->FreeSurface(MY_USER_ID); - - __super::DeleteSurfaces(); -} - -// ISubPicAllocatorPresenter - -STDMETHODIMP CVMR7AllocatorPresenter::CreateRenderer(IUnknown** ppRenderer) -{ - CheckPointer(ppRenderer, E_POINTER); - - *ppRenderer = NULL; - - HRESULT hr; - - do - { - CComPtr pBF; - - if(FAILED(hr = pBF.CoCreateInstance(CLSID_VideoMixingRenderer))) - break; - - CComQIPtr pConfig = pBF; - if(!pConfig) - break; - - if(FAILED(hr = pConfig->SetRenderingMode(VMRMode_Renderless))) - break; - - CComQIPtr pSAN = pBF; - if(!pSAN) - break; - - if(FAILED(hr = pSAN->AdviseSurfaceAllocator(MY_USER_ID, static_cast(this))) - || FAILED(hr = AdviseNotify(pSAN))) - break; - - CComPtr pPin = GetFirstPin(pBF); - CComQIPtr pMemInputPin = pPin; - m_fUseInternalTimer = HookNewSegmentAndReceive((IPinC*)(IPin*)pPin, (IMemInputPinC*)(IMemInputPin*)pMemInputPin); - - *ppRenderer = (IUnknown*)pBF.Detach(); - - return S_OK; - } - while(0); - - return E_FAIL; -} - -STDMETHODIMP_(void) CVMR7AllocatorPresenter::SetTime(REFERENCE_TIME rtNow) -{ - __super::SetTime(rtNow); - m_fUseInternalTimer = false; -} - -// IVMRSurfaceAllocator - -STDMETHODIMP CVMR7AllocatorPresenter::AllocateSurface(DWORD_PTR dwUserID, VMRALLOCATIONINFO* lpAllocInfo, DWORD* lpdwBuffer, LPDIRECTDRAWSURFACE7* lplpSurface) -{ - if(!lpAllocInfo || !lpdwBuffer || !lplpSurface) - return E_POINTER; - - if(!m_pIVMRSurfAllocNotify) - return E_FAIL; - - HRESULT hr; - - DeleteSurfaces(); - - // HACK: yv12 will fail to blt onto the backbuffer anyway, but if we first - // allocate it and then let our FreeSurface callback call m_pSA->FreeSurface, - // then that might stall for about 30 seconds because of some unknown buggy code - // behind ->Release() - - if(lpAllocInfo->lpHdr->biBitCount < 16) - return E_FAIL; - - hr = m_pSA->AllocateSurface(dwUserID, lpAllocInfo, lpdwBuffer, lplpSurface); - if(FAILED(hr)) - return hr; - - m_NativeVideoSize = CSize(abs(lpAllocInfo->lpHdr->biWidth), abs(lpAllocInfo->lpHdr->biHeight)); - m_AspectRatio = m_NativeVideoSize; - int arx = lpAllocInfo->szAspectRatio.cx, ary = lpAllocInfo->szAspectRatio.cy; - if(arx > 0 && ary > 0) m_AspectRatio.SetSize(arx, ary); - - if(FAILED(hr = AllocSurfaces())) - return hr; - - // test if the colorspace is acceptable - if(FAILED(hr = m_pVideoSurface->Blt(NULL, *lplpSurface, NULL, DDBLT_WAIT, NULL))) - { - DeleteSurfaces(); - return hr; - } - - DDBLTFX fx; - INITDDSTRUCT(fx); - fx.dwFillColor = 0; - m_pVideoSurface->Blt(NULL, NULL, NULL, DDBLT_WAIT|DDBLT_COLORFILL, &fx); - - return hr; -} - -STDMETHODIMP CVMR7AllocatorPresenter::FreeSurface(DWORD_PTR dwUserID) -{ - DeleteSurfaces(); - return S_OK; -} - -STDMETHODIMP CVMR7AllocatorPresenter::PrepareSurface(DWORD_PTR dwUserID, IDirectDrawSurface7* lpSurface, DWORD dwSurfaceFlags) -{ - if(!lpSurface) - return E_POINTER; - - // FIXME: sometimes the msmpeg4/divx3/wmv decoder wants to reuse our - // surface (expects it to point to the same mem every time), and to avoid - // problems we can't call m_pSA->PrepareSurface (flips? clears?). - return S_OK; -/* - return m_pSA->PrepareSurface(dwUserID, lpSurface, dwSurfaceFlags); -*/ -} - -STDMETHODIMP CVMR7AllocatorPresenter::AdviseNotify(IVMRSurfaceAllocatorNotify* lpIVMRSurfAllocNotify) -{ - CAutoLock cAutoLock(this); - - m_pIVMRSurfAllocNotify = lpIVMRSurfAllocNotify; - - HRESULT hr; - HMONITOR hMonitor = MonitorFromWindow(m_hWnd, MONITOR_DEFAULTTONEAREST); - if(FAILED(hr = m_pIVMRSurfAllocNotify->SetDDrawDevice(m_pDD, hMonitor))) - return hr; - - return m_pSA->AdviseNotify(lpIVMRSurfAllocNotify); -} - -// IVMRImagePresenter - -STDMETHODIMP CVMR7AllocatorPresenter::StartPresenting(DWORD_PTR dwUserID) -{ - CAutoLock cAutoLock(this); - - ASSERT(m_pD3DDev); - - return m_pD3DDev ? S_OK : E_FAIL; -} - -STDMETHODIMP CVMR7AllocatorPresenter::StopPresenting(DWORD_PTR dwUserID) -{ - return S_OK; -} - -STDMETHODIMP CVMR7AllocatorPresenter::PresentImage(DWORD_PTR dwUserID, VMRPRESENTATIONINFO* lpPresInfo) -{ - HRESULT hr; - - { - if(!lpPresInfo || !lpPresInfo->lpSurf) - return E_POINTER; - - CAutoLock cAutoLock(this); - - hr = m_pVideoSurface->Blt(NULL, lpPresInfo->lpSurf, NULL, DDBLT_WAIT, NULL); - - if(lpPresInfo->rtEnd > lpPresInfo->rtStart) - { - REFERENCE_TIME rtTimePerFrame = lpPresInfo->rtEnd - lpPresInfo->rtStart; - m_fps = 10000000.0 / rtTimePerFrame; - - if(m_pSubPicQueue) - { - m_pSubPicQueue->SetFPS(m_fps); - - if(m_fUseInternalTimer) - { - __super::SetTime(g_tSegmentStart + g_tSampleStart); - } - } - } - - CSize VideoSize = m_NativeVideoSize; - int arx = lpPresInfo->szAspectRatio.cx, ary = lpPresInfo->szAspectRatio.cy; - if(arx > 0 && ary > 0) VideoSize.cx = VideoSize.cy*arx/ary; - if(VideoSize != GetVideoSize()) - { - m_AspectRatio.SetSize(arx, ary); - AfxGetApp()->m_pMainWnd->PostMessage(WM_REARRANGERENDERLESS); - } - - Paint(true); - - hr = S_OK; - } - - return S_OK; -} - -// IVMRWindowlessControl -// -// It is only implemented (partially) for the dvd navigator's -// menu handling, which needs to know a few things about the -// location of our window. - -STDMETHODIMP CVMR7AllocatorPresenter::GetNativeVideoSize(LONG* lpWidth, LONG* lpHeight, LONG* lpARWidth, LONG* lpARHeight) -{ - CSize vs = m_NativeVideoSize, ar = m_AspectRatio; - // DVD Nav. bug workaround fix - vs.cx = vs.cy * ar.cx / ar.cy; - if(lpWidth) *lpWidth = vs.cx; - if(lpHeight) *lpHeight = vs.cy; - if(lpARWidth) *lpARWidth = ar.cx; - if(lpARHeight) *lpARHeight = ar.cy; - return S_OK; -} - -STDMETHODIMP CVMR7AllocatorPresenter::GetMinIdealVideoSize(LONG* lpWidth, LONG* lpHeight) {return E_NOTIMPL;} -STDMETHODIMP CVMR7AllocatorPresenter::GetMaxIdealVideoSize(LONG* lpWidth, LONG* lpHeight) {return E_NOTIMPL;} -STDMETHODIMP CVMR7AllocatorPresenter::SetVideoPosition(const LPRECT lpSRCRect, const LPRECT lpDSTRect) {return E_NOTIMPL;} // we have our own method for this - -STDMETHODIMP CVMR7AllocatorPresenter::GetVideoPosition(LPRECT lpSRCRect, LPRECT lpDSTRect) -{ - CopyRect(lpSRCRect, CRect(CPoint(0, 0), m_NativeVideoSize)); - CopyRect(lpDSTRect, &m_VideoRect); - // DVD Nav. bug workaround fix - GetNativeVideoSize(&lpSRCRect->right, &lpSRCRect->bottom, NULL, NULL); - return S_OK; -} - -STDMETHODIMP CVMR7AllocatorPresenter::GetAspectRatioMode(DWORD* lpAspectRatioMode) -{ - if(lpAspectRatioMode) *lpAspectRatioMode = AM_ARMODE_STRETCHED; - return S_OK; -} - -STDMETHODIMP CVMR7AllocatorPresenter::SetAspectRatioMode(DWORD AspectRatioMode) {return E_NOTIMPL;} -STDMETHODIMP CVMR7AllocatorPresenter::SetVideoClippingWindow(HWND hwnd) {return E_NOTIMPL;} -STDMETHODIMP CVMR7AllocatorPresenter::RepaintVideo(HWND hwnd, HDC hdc) {return E_NOTIMPL;} -STDMETHODIMP CVMR7AllocatorPresenter::DisplayModeChanged() {return E_NOTIMPL;} -STDMETHODIMP CVMR7AllocatorPresenter::GetCurrentImage(BYTE** lpDib) {return E_NOTIMPL;} -STDMETHODIMP CVMR7AllocatorPresenter::SetBorderColor(COLORREF Clr) {return E_NOTIMPL;} - -STDMETHODIMP CVMR7AllocatorPresenter::GetBorderColor(COLORREF* lpClr) -{ - if(lpClr) *lpClr = 0; - return S_OK; -} - -STDMETHODIMP CVMR7AllocatorPresenter::SetColorKey(COLORREF Clr) {return E_NOTIMPL;} -STDMETHODIMP CVMR7AllocatorPresenter::GetColorKey(COLORREF* lpClr) {return E_NOTIMPL;} - -// - -static HRESULT AllocDX7Surface(IDirectDraw7* pDD, CSize size, DWORD compression, int bpp, IDirectDrawSurface7** pSurface) -{ - if(!pDD || !pSurface || size.cx <= 0 || size.cy <= 0) - return E_POINTER; - - *pSurface = NULL; - - DDSURFACEDESC2 ddsd; - INITDDSTRUCT(ddsd); - ddsd.dwFlags = DDSD_CAPS|DDSD_WIDTH|DDSD_HEIGHT|DDSD_PIXELFORMAT; - ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN|DDSCAPS_VIDEOMEMORY; - ddsd.dwWidth = size.cx; - ddsd.dwHeight = size.cy; - ddsd.ddpfPixelFormat.dwSize = sizeof(DDPIXELFORMAT); - - if(compression >= 0x1000) - { - ddsd.ddpfPixelFormat.dwFlags = DDPF_FOURCC; - ddsd.ddpfPixelFormat.dwFourCC = compression; - } - else if((compression == 0 || compression == 3) && (bpp == 15 || bpp == 16 || bpp == 24 || bpp == 32)) - { - ddsd.ddpfPixelFormat.dwFlags = DDPF_RGB; - ddsd.ddpfPixelFormat.dwRGBBitCount = max(bpp, 16); - ddsd.ddpfPixelFormat.dwRGBAlphaBitMask = (bpp == 16) ? 0x0000 : (bpp == 15) ? 0x8000 : 0xFF000000; - ddsd.ddpfPixelFormat.dwRBitMask = (bpp == 16) ? 0xf800 : (bpp == 15) ? 0x7c00 : 0x00FF0000; - ddsd.ddpfPixelFormat.dwGBitMask = (bpp == 16) ? 0x07e0 : (bpp == 15) ? 0x03e0 : 0x0000FF00; - ddsd.ddpfPixelFormat.dwBBitMask = (bpp == 16) ? 0x001F : (bpp == 15) ? 0x001F : 0x000000FF; - } - - return pDD->CreateSurface(&ddsd, pSurface, NULL); -} - -// -// CRM7AllocatorPresenter -// - -CRM7AllocatorPresenter::CRM7AllocatorPresenter(HWND hWnd, HRESULT& hr) - : CDX7AllocatorPresenter(hWnd, hr) -{ -} - -STDMETHODIMP CRM7AllocatorPresenter::NonDelegatingQueryInterface(REFIID riid, void** ppv) -{ - CheckPointer(ppv, E_POINTER); - - return - QI2(IRMAVideoSurface) - __super::NonDelegatingQueryInterface(riid, ppv); -} - -HRESULT CRM7AllocatorPresenter::AllocSurfaces() -{ - CAutoLock cAutoLock(this); - - m_pVideoSurfaceOff = NULL; - m_pVideoSurfaceYUY2 = NULL; - - DDSURFACEDESC2 ddsd; - DDBLTFX fx; - - INITDDSTRUCT(ddsd); - ddsd.dwFlags = DDSD_CAPS|DDSD_WIDTH|DDSD_HEIGHT|DDSD_PIXELFORMAT; - ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; - ddsd.dwWidth = m_NativeVideoSize.cx; - ddsd.dwHeight = m_NativeVideoSize.cy; - ddsd.ddpfPixelFormat.dwSize = sizeof(DDPIXELFORMAT); - ddsd.ddpfPixelFormat.dwFlags = DDPF_RGB; - ddsd.ddpfPixelFormat.dwRGBBitCount = 32; - ddsd.ddpfPixelFormat.dwRGBAlphaBitMask = 0xFF000000; - ddsd.ddpfPixelFormat.dwRBitMask = 0x00FF0000; - ddsd.ddpfPixelFormat.dwGBitMask = 0x0000FF00; - ddsd.ddpfPixelFormat.dwBBitMask = 0x000000FF; - - HRESULT hr = m_pDD->CreateSurface(&ddsd, &m_pVideoSurfaceOff, NULL); - if(FAILED(hr)) return E_FAIL; - - INITDDSTRUCT(fx); - fx.dwFillColor = 0; - m_pVideoSurfaceOff->Blt(NULL, NULL, NULL, DDBLT_WAIT|DDBLT_COLORFILL, &fx); - - INITDDSTRUCT(ddsd); - ddsd.dwFlags = DDSD_CAPS|DDSD_WIDTH|DDSD_HEIGHT|DDSD_PIXELFORMAT; - ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; - ddsd.dwWidth = m_NativeVideoSize.cx; - ddsd.dwHeight = m_NativeVideoSize.cy; - ddsd.ddpfPixelFormat.dwSize = sizeof(DDPIXELFORMAT); - ddsd.ddpfPixelFormat.dwFlags = DDPF_FOURCC; - ddsd.ddpfPixelFormat.dwYUVBitCount = 16; - ddsd.ddpfPixelFormat.dwFourCC = '2YUY'; - - hr = m_pDD->CreateSurface(&ddsd, &m_pVideoSurfaceYUY2, NULL); - - if(FAILED(m_pVideoSurfaceOff->Blt(NULL, m_pVideoSurfaceYUY2, NULL, DDBLT_WAIT, NULL))) - m_pVideoSurfaceYUY2 = NULL; - - if(m_pVideoSurfaceYUY2) - { - INITDDSTRUCT(fx); - fx.dwFillColor = 0x80108010; - m_pVideoSurfaceYUY2->Blt(NULL, NULL, NULL, DDBLT_WAIT|DDBLT_COLORFILL, &fx); - } - - return __super::AllocSurfaces(); -} - -void CRM7AllocatorPresenter::DeleteSurfaces() -{ - CAutoLock cAutoLock(this); - - m_pVideoSurfaceOff = NULL; - m_pVideoSurfaceYUY2 = NULL; - - __super::DeleteSurfaces(); -} - -// IRMAVideoSurface - -STDMETHODIMP CRM7AllocatorPresenter::Blt(UCHAR* pImageData, RMABitmapInfoHeader* pBitmapInfo, REF(PNxRect) inDestRect, REF(PNxRect) inSrcRect) -{ - if(!m_pVideoSurface || !m_pVideoSurfaceOff) - return E_FAIL; - - bool fRGB = false; - bool fYUY2 = false; - - CRect src((RECT*)&inSrcRect), dst((RECT*)&inDestRect), src2(CPoint(0,0), src.Size()); - if(src.Width() > dst.Width() || src.Height() > dst.Height()) - return E_FAIL; - - DDSURFACEDESC2 ddsd; - - if(pBitmapInfo->biCompression == '024I') - { - DWORD pitch = pBitmapInfo->biWidth; - DWORD size = pitch*abs(pBitmapInfo->biHeight); - - BYTE* y = pImageData + src.top*pitch + src.left; - BYTE* u = pImageData + size + src.top*(pitch/2) + src.left/2; - BYTE* v = pImageData + size + size/4 + src.top*(pitch/2) + src.left/2; - - if(m_pVideoSurfaceYUY2) - { - INITDDSTRUCT(ddsd); - if(SUCCEEDED(m_pVideoSurfaceYUY2->Lock(src2, &ddsd, DDLOCK_WAIT|DDLOCK_SURFACEMEMORYPTR|DDLOCK_WRITEONLY, NULL))) - { - BitBltFromI420ToYUY2(src.Width(), src.Height(), (BYTE*)ddsd.lpSurface, ddsd.lPitch, y, u, v, pitch); - m_pVideoSurfaceYUY2->Unlock(src2); - fYUY2 = true; - } - } - else - { - INITDDSTRUCT(ddsd); - if(SUCCEEDED(m_pVideoSurfaceOff->Lock(src2, &ddsd, DDLOCK_WAIT|DDLOCK_SURFACEMEMORYPTR|DDLOCK_WRITEONLY, NULL))) - { - BitBltFromI420ToRGB(src.Width(), src.Height(), (BYTE*)ddsd.lpSurface, ddsd.lPitch, ddsd.ddpfPixelFormat.dwRGBBitCount, y, u, v, pitch); - m_pVideoSurfaceOff->Unlock(src2); - fRGB = true; - } - } - } - else if(pBitmapInfo->biCompression == '2YUY') - { - DWORD w = pBitmapInfo->biWidth; - DWORD h = abs(pBitmapInfo->biHeight); - DWORD pitch = pBitmapInfo->biWidth*2; - - BYTE* yvyu = pImageData + src.top*pitch + src.left*2; - - if(m_pVideoSurfaceYUY2) - { - INITDDSTRUCT(ddsd); - if(SUCCEEDED(m_pVideoSurfaceYUY2->Lock(src2, &ddsd, DDLOCK_WAIT|DDLOCK_SURFACEMEMORYPTR|DDLOCK_WRITEONLY, NULL))) - { - BitBltFromYUY2ToYUY2(src.Width(), src.Height(), (BYTE*)ddsd.lpSurface, ddsd.lPitch, yvyu, pitch); - m_pVideoSurfaceYUY2->Unlock(src2); - fYUY2 = true; - } - } - else - { - INITDDSTRUCT(ddsd); - if(SUCCEEDED(m_pVideoSurfaceOff->Lock(src2, &ddsd, DDLOCK_WAIT|DDLOCK_SURFACEMEMORYPTR|DDLOCK_WRITEONLY, NULL))) - { - BitBltFromYUY2ToRGB(src.Width(), src.Height(), (BYTE*)ddsd.lpSurface, ddsd.lPitch, ddsd.ddpfPixelFormat.dwRGBBitCount, yvyu, pitch); - m_pVideoSurfaceOff->Unlock(src2); - fRGB = true; - } - } - } - else if(pBitmapInfo->biCompression == 0 || pBitmapInfo->biCompression == 3 - || pBitmapInfo->biCompression == 'BGRA') - { - DWORD w = pBitmapInfo->biWidth; - DWORD h = abs(pBitmapInfo->biHeight); - DWORD pitch = pBitmapInfo->biWidth*pBitmapInfo->biBitCount>>3; - - BYTE* rgb = pImageData + src.top*pitch + src.left*(pBitmapInfo->biBitCount>>3); - - INITDDSTRUCT(ddsd); - if(SUCCEEDED(m_pVideoSurfaceOff->Lock(src2, &ddsd, DDLOCK_WAIT|DDLOCK_SURFACEMEMORYPTR|DDLOCK_WRITEONLY, NULL))) - { - BYTE* lpSurface = (BYTE*)ddsd.lpSurface; - if(pBitmapInfo->biHeight > 0) {lpSurface += ddsd.lPitch*(src.Height()-1); ddsd.lPitch = -ddsd.lPitch;} - BitBltFromRGBToRGB(src.Width(), src.Height(), lpSurface, ddsd.lPitch, ddsd.ddpfPixelFormat.dwRGBBitCount, rgb, pitch, pBitmapInfo->biBitCount); - fRGB = true; - m_pVideoSurfaceOff->Unlock(src2); - } - } - - if(!fRGB && !fYUY2) - { - DDBLTFX fx; - INITDDSTRUCT(fx); - fx.dwFillColor = 0; - m_pVideoSurfaceOff->Blt(NULL, NULL, NULL, DDBLT_WAIT|DDBLT_COLORFILL, &fx); - - HDC hDC; - if(SUCCEEDED(m_pVideoSurfaceOff->GetDC(&hDC))) - { - CString str; - str.Format(_T("Sorry, this format is not supported")); - - SetBkColor(hDC, 0); - SetTextColor(hDC, 0x404040); - TextOut(hDC, 10, 10, str, str.GetLength()); - - m_pVideoSurfaceOff->ReleaseDC(hDC); - - fRGB = true; - } - } - - - HRESULT hr; - - if(fRGB) - hr = m_pVideoSurface->Blt(dst, m_pVideoSurfaceOff, src2, DDBLT_WAIT, NULL); - if(fYUY2) - hr = m_pVideoSurface->Blt(dst, m_pVideoSurfaceYUY2, src2, DDBLT_WAIT, NULL); - - Paint(true); - - return PNR_OK; -} - -STDMETHODIMP CRM7AllocatorPresenter::BeginOptimizedBlt(RMABitmapInfoHeader* pBitmapInfo) -{ - CAutoLock cAutoLock(this); - DeleteSurfaces(); - m_NativeVideoSize = m_AspectRatio = CSize(pBitmapInfo->biWidth, abs(pBitmapInfo->biHeight)); - if(FAILED(AllocSurfaces())) return E_FAIL; - return PNR_NOTIMPL; -} - -STDMETHODIMP CRM7AllocatorPresenter::OptimizedBlt(UCHAR* pImageBits, REF(PNxRect) rDestRect, REF(PNxRect) rSrcRect) -{ - return PNR_NOTIMPL; -} - -STDMETHODIMP CRM7AllocatorPresenter::EndOptimizedBlt() -{ - return PNR_NOTIMPL; -} - -STDMETHODIMP CRM7AllocatorPresenter::GetOptimizedFormat(REF(RMA_COMPRESSION_TYPE) ulType) -{ - return PNR_NOTIMPL; -} - -STDMETHODIMP CRM7AllocatorPresenter::GetPreferredFormat(REF(RMA_COMPRESSION_TYPE) ulType) -{ - ulType = RMA_I420; - return PNR_OK; -} - -// -// CQT7AllocatorPresenter -// - -CQT7AllocatorPresenter::CQT7AllocatorPresenter(HWND hWnd, HRESULT& hr) - : CDX7AllocatorPresenter(hWnd, hr) -{ -} - -STDMETHODIMP CQT7AllocatorPresenter::NonDelegatingQueryInterface(REFIID riid, void** ppv) -{ - CheckPointer(ppv, E_POINTER); - - return - QI(IQTVideoSurface) - __super::NonDelegatingQueryInterface(riid, ppv); -} - -HRESULT CQT7AllocatorPresenter::AllocSurfaces() -{ - CAutoLock cAutoLock(this); - - m_pVideoSurfaceOff = NULL; - - DDSURFACEDESC2 ddsd; - INITDDSTRUCT(ddsd); - ddsd.dwFlags = DDSD_CAPS|DDSD_WIDTH|DDSD_HEIGHT|DDSD_PIXELFORMAT; - ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; - ddsd.dwWidth = m_NativeVideoSize.cx; - ddsd.dwHeight = m_NativeVideoSize.cy; - ddsd.ddpfPixelFormat.dwSize = sizeof(DDPIXELFORMAT); - ddsd.ddpfPixelFormat.dwFlags = DDPF_RGB; - ddsd.ddpfPixelFormat.dwRGBBitCount = 32; - ddsd.ddpfPixelFormat.dwRGBAlphaBitMask = 0xFF000000; - ddsd.ddpfPixelFormat.dwRBitMask = 0x00FF0000; - ddsd.ddpfPixelFormat.dwGBitMask = 0x0000FF00; - ddsd.ddpfPixelFormat.dwBBitMask = 0x000000FF; - - HRESULT hr = m_pDD->CreateSurface(&ddsd, &m_pVideoSurfaceOff, NULL); - if(FAILED(hr)) return E_FAIL; - - DDBLTFX fx; - INITDDSTRUCT(fx); - fx.dwFillColor = 0; - m_pVideoSurfaceOff->Blt(NULL, NULL, NULL, DDBLT_WAIT|DDBLT_COLORFILL, &fx); - - return __super::AllocSurfaces(); -} - -void CQT7AllocatorPresenter::DeleteSurfaces() -{ - CAutoLock cAutoLock(this); - - m_pVideoSurfaceOff = NULL; - - __super::DeleteSurfaces(); -} - -// IQTVideoSurface - -STDMETHODIMP CQT7AllocatorPresenter::BeginBlt(const BITMAP& bm) -{ - CAutoLock cAutoLock(this); - - DeleteSurfaces(); - - m_NativeVideoSize = m_AspectRatio = CSize(bm.bmWidth, abs(bm.bmHeight)); - - HRESULT hr; - if(FAILED(hr = AllocSurfaces())) - return hr; - - return S_OK; -} - -STDMETHODIMP CQT7AllocatorPresenter::DoBlt(const BITMAP& bm) -{ - if(!m_pVideoSurface || !m_pVideoSurfaceOff) - return E_FAIL; - - bool fOk = false; - - DDSURFACEDESC2 ddsd; - INITDDSTRUCT(ddsd); - if(FAILED(m_pVideoSurfaceOff->GetSurfaceDesc(&ddsd))) - return E_FAIL; - - int w = bm.bmWidth; - int h = abs(bm.bmHeight); - int bpp = bm.bmBitsPixel; - - if((bpp == 16 || bpp == 24 || bpp == 32) && w == ddsd.dwWidth && h == ddsd.dwHeight) - { - INITDDSTRUCT(ddsd); - if(SUCCEEDED(m_pVideoSurfaceOff->Lock(NULL, &ddsd, DDLOCK_WAIT|DDLOCK_SURFACEMEMORYPTR|DDLOCK_WRITEONLY, NULL))) - { - BitBltFromRGBToRGB( - w, h, - (BYTE*)ddsd.lpSurface, ddsd.lPitch, ddsd.ddpfPixelFormat.dwRGBBitCount, - (BYTE*)bm.bmBits, bm.bmWidthBytes, bm.bmBitsPixel); - m_pVideoSurfaceOff->Unlock(NULL); - fOk = true; - } - } - - if(!fOk) - { - DDBLTFX fx; - INITDDSTRUCT(fx); - fx.dwFillColor = 0; - m_pVideoSurfaceOff->Blt(NULL, NULL, NULL, DDBLT_WAIT|DDBLT_COLORFILL, &fx); - - HDC hDC; - if(SUCCEEDED(m_pVideoSurfaceOff->GetDC(&hDC))) - { - CString str; - str.Format(_T("Sorry, this format is not supported")); - - SetBkColor(hDC, 0); - SetTextColor(hDC, 0x404040); - TextOut(hDC, 10, 10, str, str.GetLength()); - - m_pVideoSurfaceOff->ReleaseDC(hDC); - - } - } - - m_pVideoSurface->Blt(NULL, m_pVideoSurfaceOff, NULL, DDBLT_WAIT, NULL); - - Paint(true); - - return S_OK; -} diff --git a/src/apps/mplayerc/DX7AllocatorPresenter.h b/src/apps/mplayerc/DX7AllocatorPresenter.h deleted file mode 100644 index f209a257d..000000000 --- a/src/apps/mplayerc/DX7AllocatorPresenter.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#pragma once - -#include "..\..\SubPic\ISubPic.h" - -// {495CF191-810D-44c7-92C5-E7D46AE00F44} -DEFINE_GUID(CLSID_VMR7AllocatorPresenter, -0x495cf191, 0x810d, 0x44c7, 0x92, 0xc5, 0xe7, 0xd4, 0x6a, 0xe0, 0xf, 0x44); - -// {97B3462E-1752-4dfb-A038-271060BC7A94} -DEFINE_GUID(CLSID_RM7AllocatorPresenter, -0x97b3462e, 0x1752, 0x4dfb, 0xa0, 0x38, 0x27, 0x10, 0x60, 0xbc, 0x7a, 0x94); - -// {36CC5A71-441C-462a-9D10-48A19485938D} -DEFINE_GUID(CLSID_QT7AllocatorPresenter, -0x36cc5a71, 0x441c, 0x462a, 0x9d, 0x10, 0x48, 0xa1, 0x94, 0x85, 0x93, 0x8d); - -extern HRESULT CreateAP7(const CLSID& clsid, HWND hWnd, ISubPicAllocatorPresenter** ppAP); - -extern bool IsVMR7InGraph(IFilterGraph* pFG); diff --git a/src/apps/mplayerc/DX9AllocatorPresenter.cpp b/src/apps/mplayerc/DX9AllocatorPresenter.cpp deleted file mode 100644 index 79726b7c3..000000000 --- a/src/apps/mplayerc/DX9AllocatorPresenter.cpp +++ /dev/null @@ -1,2221 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include "stdafx.h" -#include "mplayerc.h" -#include -#include -#include "..\..\DSUtil\DSUtil.h" - -#include - -#include -#include "DX9AllocatorPresenter.h" -#include -#include -#include -#include "..\..\SubPic\DX9SubPic.h" -#include "..\..\..\include\RealMedia\pntypes.h" -#include "..\..\..\include\RealMedia\pnwintyp.h" -#include "..\..\..\include\RealMedia\pncom.h" -#include "..\..\..\include\RealMedia\rmavsurf.h" -#include "IQTVideoSurface.h" -#include "..\..\..\include\moreuuids.h" - -#include "MacrovisionKicker.h" -#include "IPinHook.h" - -#include "PixelShaderCompiler.h" - -CCritSec g_ffdshowReceive; -bool queueu_ffdshow_support = false; - -bool IsVMR9InGraph(IFilterGraph* pFG) -{ - BeginEnumFilters(pFG, pEF, pBF) - if(CComQIPtr(pBF)) return(true); - EndEnumFilters - return(false); -} - -namespace DSObjects -{ - -class CDX9AllocatorPresenter - : public ISubPicAllocatorPresenterImpl -{ -protected: - CSize m_ScreenSize; - bool m_fVMRSyncFix; - - CComPtr m_pD3D; - CComPtr m_pD3DDev; - CComPtr m_pVideoTexture[3]; - CComPtr m_pVideoSurface[3]; - CInterfaceList m_pPixelShaders; - CComPtr m_pResizerPixelShader[3]; // bl, bc1, bc2 - CComPtr m_pResizerBicubic1stPass; - D3DTEXTUREFILTERTYPE m_filter; - D3DCAPS9 m_caps; - - CAutoPtr m_pPSC; - - virtual HRESULT CreateDevice(); - virtual HRESULT AllocSurfaces(); - virtual void DeleteSurfaces(); - - UINT GetAdapter(IDirect3D9 *pD3D); - - float m_bicubicA; - HRESULT InitResizers(float bicubicA); - - HRESULT TextureCopy(CComPtr pTexture); - HRESULT TextureResize(CComPtr pTexture, Vector dst[4], D3DTEXTUREFILTERTYPE filter); - HRESULT TextureResizeBilinear(CComPtr pTexture, Vector dst[4]); - HRESULT TextureResizeBicubic1pass(CComPtr pTexture, Vector dst[4]); - HRESULT TextureResizeBicubic2pass(CComPtr pTexture, Vector dst[4]); - -public: - CDX9AllocatorPresenter(HWND hWnd, HRESULT& hr); - - // ISubPicAllocatorPresenter - STDMETHODIMP CreateRenderer(IUnknown** ppRenderer); - STDMETHODIMP_(bool) Paint(bool fAll); - STDMETHODIMP GetDIB(BYTE* lpDib, DWORD* size); - STDMETHODIMP SetPixelShader(LPCSTR pSrcData, LPCSTR pTarget); -}; - -class CVMR9AllocatorPresenter - : public CDX9AllocatorPresenter - , public IVMRSurfaceAllocator9 - , public IVMRImagePresenter9 - , public IVMRWindowlessControl9 -{ -protected: - CComPtr m_pIVMRSurfAllocNotify; - CInterfaceArray m_pSurfaces; - - HRESULT CreateDevice(); - void DeleteSurfaces(); - - bool m_fUseInternalTimer; - REFERENCE_TIME m_rtPrevStart; - -public: - CVMR9AllocatorPresenter(HWND hWnd, HRESULT& hr); - - DECLARE_IUNKNOWN - STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv); - - // ISubPicAllocatorPresenter - STDMETHODIMP CreateRenderer(IUnknown** ppRenderer); - STDMETHODIMP_(void) SetTime(REFERENCE_TIME rtNow); - - // IVMRSurfaceAllocator9 - STDMETHODIMP InitializeDevice(DWORD_PTR dwUserID, VMR9AllocationInfo* lpAllocInfo, DWORD* lpNumBuffers); - STDMETHODIMP TerminateDevice(DWORD_PTR dwID); - STDMETHODIMP GetSurface(DWORD_PTR dwUserID, DWORD SurfaceIndex, DWORD SurfaceFlags, IDirect3DSurface9** lplpSurface); - STDMETHODIMP AdviseNotify(IVMRSurfaceAllocatorNotify9* lpIVMRSurfAllocNotify); - - // IVMRImagePresenter9 - STDMETHODIMP StartPresenting(DWORD_PTR dwUserID); - STDMETHODIMP StopPresenting(DWORD_PTR dwUserID); - STDMETHODIMP PresentImage(DWORD_PTR dwUserID, VMR9PresentationInfo* lpPresInfo); - - // IVMRWindowlessControl9 - STDMETHODIMP GetNativeVideoSize(LONG* lpWidth, LONG* lpHeight, LONG* lpARWidth, LONG* lpARHeight); - STDMETHODIMP GetMinIdealVideoSize(LONG* lpWidth, LONG* lpHeight); - STDMETHODIMP GetMaxIdealVideoSize(LONG* lpWidth, LONG* lpHeight); - STDMETHODIMP SetVideoPosition(const LPRECT lpSRCRect, const LPRECT lpDSTRect); - STDMETHODIMP GetVideoPosition(LPRECT lpSRCRect, LPRECT lpDSTRect); - STDMETHODIMP GetAspectRatioMode(DWORD* lpAspectRatioMode); - STDMETHODIMP SetAspectRatioMode(DWORD AspectRatioMode); - STDMETHODIMP SetVideoClippingWindow(HWND hwnd); - STDMETHODIMP RepaintVideo(HWND hwnd, HDC hdc); - STDMETHODIMP DisplayModeChanged(); - STDMETHODIMP GetCurrentImage(BYTE** lpDib); - STDMETHODIMP SetBorderColor(COLORREF Clr); - STDMETHODIMP GetBorderColor(COLORREF* lpClr); -}; - -class CRM9AllocatorPresenter - : public CDX9AllocatorPresenter - , public IRMAVideoSurface -{ - CComPtr m_pVideoSurfaceOff; - CComPtr m_pVideoSurfaceYUY2; - - RMABitmapInfoHeader m_bitmapInfo; - RMABitmapInfoHeader m_lastBitmapInfo; - -protected: - HRESULT AllocSurfaces(); - void DeleteSurfaces(); - -public: - CRM9AllocatorPresenter(HWND hWnd, HRESULT& hr); - - DECLARE_IUNKNOWN - STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv); - - // IRMAVideoSurface - STDMETHODIMP Blt(UCHAR* pImageData, RMABitmapInfoHeader* pBitmapInfo, REF(PNxRect) inDestRect, REF(PNxRect) inSrcRect); - STDMETHODIMP BeginOptimizedBlt(RMABitmapInfoHeader* pBitmapInfo); - STDMETHODIMP OptimizedBlt(UCHAR* pImageBits, REF(PNxRect) rDestRect, REF(PNxRect) rSrcRect); - STDMETHODIMP EndOptimizedBlt(); - STDMETHODIMP GetOptimizedFormat(REF(RMA_COMPRESSION_TYPE) ulType); - STDMETHODIMP GetPreferredFormat(REF(RMA_COMPRESSION_TYPE) ulType); -}; - -class CQT9AllocatorPresenter - : public CDX9AllocatorPresenter - , public IQTVideoSurface -{ - CComPtr m_pVideoSurfaceOff; - -protected: - HRESULT AllocSurfaces(); - void DeleteSurfaces(); - -public: - CQT9AllocatorPresenter(HWND hWnd, HRESULT& hr); - - DECLARE_IUNKNOWN - STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv); - - // IQTVideoSurface - STDMETHODIMP BeginBlt(const BITMAP& bm); - STDMETHODIMP DoBlt(const BITMAP& bm); -}; - -class CDXRAllocatorPresenter - : public ISubPicAllocatorPresenterImpl -{ - class CSubRenderCallback : public CUnknown, public ISubRenderCallback, public CCritSec - { - CDXRAllocatorPresenter* m_pDXRAP; - - public: - CSubRenderCallback(CDXRAllocatorPresenter* pDXRAP) - : CUnknown(_T("CSubRender"), NULL) - , m_pDXRAP(pDXRAP) - { - } - - DECLARE_IUNKNOWN - STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv) - { - return - QI(ISubRenderCallback) - __super::NonDelegatingQueryInterface(riid, ppv); - } - - void SetDXRAP(CDXRAllocatorPresenter* pDXRAP) - { - CAutoLock cAutoLock(this); - m_pDXRAP = pDXRAP; - } - - // ISubRenderCallback - - STDMETHODIMP SetDevice(IDirect3DDevice9* pD3DDev) - { - CAutoLock cAutoLock(this); - return m_pDXRAP ? m_pDXRAP->SetDevice(pD3DDev) : E_UNEXPECTED; - } - - STDMETHODIMP Render(REFERENCE_TIME rtStart, int left, int top, int right, int bottom, int width, int height) - { - CAutoLock cAutoLock(this); - return m_pDXRAP ? m_pDXRAP->Render(rtStart, 0, 0, left, top, right, bottom, width, height) : E_UNEXPECTED; - } - - // ISubRendererCallback2 - - STDMETHODIMP RenderEx(REFERENCE_TIME rtStart, REFERENCE_TIME rtStop, REFERENCE_TIME AvgTimePerFrame, int left, int top, int right, int bottom, int width, int height) - { - CAutoLock cAutoLock(this); - return m_pDXRAP ? m_pDXRAP->Render(rtStart, rtStop, AvgTimePerFrame, left, top, right, bottom, width, height) : E_UNEXPECTED; - } - }; - - CComPtr m_pDXR; - CComPtr m_pSRCB; - -public: - CDXRAllocatorPresenter(HWND hWnd, HRESULT& hr); - virtual ~CDXRAllocatorPresenter(); - - DECLARE_IUNKNOWN - STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv); - - HRESULT SetDevice(IDirect3DDevice9* pD3DDev); - HRESULT Render( - REFERENCE_TIME rtStart, REFERENCE_TIME rtStop, REFERENCE_TIME atpf, - int left, int top, int bottom, int right, int width, int height); - - // ISubPicAllocatorPresenter - STDMETHODIMP CreateRenderer(IUnknown** ppRenderer); - STDMETHODIMP_(void) SetPosition(RECT w, RECT v); - STDMETHODIMP_(SIZE) GetVideoSize(bool fCorrectAR); - STDMETHODIMP_(bool) Paint(bool fAll); - STDMETHODIMP GetDIB(BYTE* lpDib, DWORD* size); - STDMETHODIMP SetPixelShader(LPCSTR pSrcData, LPCSTR pTarget); -}; - -} -using namespace DSObjects; - -// - -HRESULT CreateAP9(const CLSID& clsid, HWND hWnd, ISubPicAllocatorPresenter** ppAP) -{ - CheckPointer(ppAP, E_POINTER); - - *ppAP = NULL; - - HRESULT hr = E_FAIL; - if(clsid == CLSID_VMR9AllocatorPresenter && !(*ppAP = new CVMR9AllocatorPresenter(hWnd, hr)) - || clsid == CLSID_RM9AllocatorPresenter && !(*ppAP = new CRM9AllocatorPresenter(hWnd, hr)) - || clsid == CLSID_QT9AllocatorPresenter && !(*ppAP = new CQT9AllocatorPresenter(hWnd, hr)) - || clsid == CLSID_DXRAllocatorPresenter && !(*ppAP = new CDXRAllocatorPresenter(hWnd, hr))) - return E_OUTOFMEMORY; - - if(*ppAP == NULL) - return E_FAIL; - - (*ppAP)->AddRef(); - - if(FAILED(hr)) - { - (*ppAP)->Release(); - *ppAP = NULL; - } - - return hr; -} - -// - -#pragma pack(push, 1) -template -struct MYD3DVERTEX {float x, y, z, rhw; struct {float u, v;} t[texcoords];}; -#pragma pack(pop) - -template -static void AdjustQuad(MYD3DVERTEX* v, float dx, float dy) -{ - float offset = 0.5f; - - for(int i = 0; i < 4; i++) - { - v[i].x -= offset; - v[i].y -= offset; - - for(int j = 0; j < texcoords-1; j++) - { - v[i].t[j].u -= offset*dx; - v[i].t[j].v -= offset*dy; - } - - if(texcoords > 1) - { - v[i].t[texcoords-1].u -= offset; - v[i].t[texcoords-1].v -= offset; - } - } -} - -template -static HRESULT TextureBlt(CComPtr pD3DDev, MYD3DVERTEX v[4], D3DTEXTUREFILTERTYPE filter = D3DTEXF_LINEAR) -{ - if(!pD3DDev) - return E_POINTER; - - DWORD FVF = 0; - - switch(texcoords) - { - case 1: FVF = D3DFVF_TEX1; break; - case 2: FVF = D3DFVF_TEX2; break; - case 3: FVF = D3DFVF_TEX3; break; - case 4: FVF = D3DFVF_TEX4; break; - case 5: FVF = D3DFVF_TEX5; break; - case 6: FVF = D3DFVF_TEX6; break; - case 7: FVF = D3DFVF_TEX7; break; - case 8: FVF = D3DFVF_TEX8; break; - default: return E_FAIL; - } - - HRESULT hr; - - do - { - hr = pD3DDev->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE); - hr = pD3DDev->SetRenderState(D3DRS_LIGHTING, FALSE); - hr = pD3DDev->SetRenderState(D3DRS_ZENABLE, FALSE); - hr = pD3DDev->SetRenderState(D3DRS_STENCILENABLE, FALSE); - hr = pD3DDev->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE); - hr = pD3DDev->SetRenderState(D3DRS_ALPHATESTENABLE, FALSE); - hr = pD3DDev->SetRenderState(D3DRS_SCISSORTESTENABLE, FALSE); - hr = pD3DDev->SetRenderState(D3DRS_COLORWRITEENABLE, D3DCOLORWRITEENABLE_ALPHA|D3DCOLORWRITEENABLE_BLUE|D3DCOLORWRITEENABLE_GREEN|D3DCOLORWRITEENABLE_RED); - - for(int i = 0; i < texcoords; i++) - { - hr = pD3DDev->SetSamplerState(i, D3DSAMP_MAGFILTER, filter); - hr = pD3DDev->SetSamplerState(i, D3DSAMP_MINFILTER, filter); - hr = pD3DDev->SetSamplerState(i, D3DSAMP_MIPFILTER, filter); - - hr = pD3DDev->SetSamplerState(i, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP); - hr = pD3DDev->SetSamplerState(i, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP); - } - - // - - if(FAILED(hr = pD3DDev->BeginScene())) - break; - - hr = pD3DDev->SetFVF(D3DFVF_XYZRHW | FVF); - // hr = pD3DDev->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, v, sizeof(v[0])); - - MYD3DVERTEX tmp = v[2]; v[2] = v[3]; v[3] = tmp; - hr = pD3DDev->DrawPrimitiveUP(D3DPT_TRIANGLEFAN, 2, v, sizeof(v[0])); - - hr = pD3DDev->EndScene(); - - // - - for(int i = 0; i < texcoords; i++) - { - pD3DDev->SetTexture(i, NULL); - } - - return S_OK; - } - while(0); - - return E_FAIL; -} - -// CDX9AllocatorPresenter - -CDX9AllocatorPresenter::CDX9AllocatorPresenter(HWND hWnd, HRESULT& hr) - : ISubPicAllocatorPresenterImpl(hWnd, hr) - , m_ScreenSize(0, 0) - , m_bicubicA(0) -{ - if(FAILED(hr)) return; - m_pD3D.Attach(Direct3DCreate9(D3D_SDK_VERSION)); - if(!m_pD3D) m_pD3D.Attach(Direct3DCreate9(D3D9b_SDK_VERSION)); - if(!m_pD3D) {hr = E_FAIL; return;} - hr = CreateDevice(); -} - -HRESULT CDX9AllocatorPresenter::CreateDevice() -{ - m_pPSC.Free(); - m_pD3DDev = NULL; - - D3DDISPLAYMODE d3ddm; - ZeroMemory(&d3ddm, sizeof(d3ddm)); - if(FAILED(m_pD3D->GetAdapterDisplayMode(GetAdapter(m_pD3D), &d3ddm))) - return E_UNEXPECTED; - - m_ScreenSize.SetSize(d3ddm.Width, d3ddm.Height); - - D3DPRESENT_PARAMETERS pp; - ZeroMemory(&pp, sizeof(pp)); - pp.Windowed = TRUE; - pp.hDeviceWindow = m_hWnd; - pp.SwapEffect = D3DSWAPEFFECT_COPY; - pp.Flags = D3DPRESENTFLAG_VIDEO; - pp.BackBufferWidth = d3ddm.Width; - pp.BackBufferHeight = d3ddm.Height; - pp.PresentationInterval = D3DPRESENT_INTERVAL_ONE; - - if(m_fVMRSyncFix = AfxGetMyApp()->m_s.fVMRSyncFix) - pp.Flags = D3DPRESENTFLAG_LOCKABLE_BACKBUFFER; - - HRESULT hr = m_pD3D->CreateDevice( - GetAdapter(m_pD3D), D3DDEVTYPE_HAL, m_hWnd, - D3DCREATE_SOFTWARE_VERTEXPROCESSING|D3DCREATE_MULTITHREADED, //D3DCREATE_MANAGED - &pp, &m_pD3DDev); -/* - HRESULT hr = m_pD3D->CreateDevice( - m_pD3D->GetAdapterCount()-1, D3DDEVTYPE_REF, m_hWnd, - D3DCREATE_SOFTWARE_VERTEXPROCESSING|D3DCREATE_MULTITHREADED, //D3DCREATE_MANAGED - &pp, &m_pD3DDev); -*/ - if(FAILED(hr)) - return hr; - - m_pPSC.Attach(new CPixelShaderCompiler(m_pD3DDev, true)); - - // - - m_filter = D3DTEXF_NONE; - - ZeroMemory(&m_caps, sizeof(m_caps)); - m_pD3DDev->GetDeviceCaps(&m_caps); - - if((m_caps.StretchRectFilterCaps&D3DPTFILTERCAPS_MINFLINEAR) - && (m_caps.StretchRectFilterCaps&D3DPTFILTERCAPS_MAGFLINEAR)) - m_filter = D3DTEXF_LINEAR; - - // - - m_bicubicA = 0; - - // - - CComPtr pSubPicProvider; - if(m_pSubPicQueue) m_pSubPicQueue->GetSubPicProvider(&pSubPicProvider); - - CSize size; - switch(AfxGetAppSettings().nSPCMaxRes) - { - case 0: default: size = m_ScreenSize; break; - case 1: size.SetSize(1024, 768); break; - case 2: size.SetSize(800, 600); break; - case 3: size.SetSize(640, 480); break; - case 4: size.SetSize(512, 384); break; - case 5: size.SetSize(384, 288); break; - } - - if(m_pAllocator) - { - m_pAllocator->ChangeDevice(m_pD3DDev); - } - else - { - m_pAllocator = new CDX9SubPicAllocator(m_pD3DDev, size, AfxGetAppSettings().fSPCPow2Tex); - if(!m_pAllocator) - return E_FAIL; - } - - hr = S_OK; - m_pSubPicQueue = AfxGetAppSettings().nSPCSize > 0 - ? (ISubPicQueue*)new CSubPicQueue(AfxGetAppSettings().nSPCSize, m_pAllocator, &hr) - : (ISubPicQueue*)new CSubPicQueueNoThread(m_pAllocator, &hr); - if(!m_pSubPicQueue || FAILED(hr)) - return E_FAIL; - - if(pSubPicProvider) m_pSubPicQueue->SetSubPicProvider(pSubPicProvider); - - return S_OK; -} - -HRESULT CDX9AllocatorPresenter::AllocSurfaces() -{ - CAutoLock cAutoLock(this); - - AppSettings& s = AfxGetAppSettings(); - - for(int i = 0; i < countof(m_pVideoTexture); i++) - { - m_pVideoTexture[i] = NULL; - m_pVideoSurface[i] = NULL; - } - - m_pResizerBicubic1stPass = NULL; - - HRESULT hr; - - if(s.iAPSurfaceUsage == VIDRNDT_AP_TEXTURE2D || s.iAPSurfaceUsage == VIDRNDT_AP_TEXTURE3D) - { - int nTexturesNeeded = s.iAPSurfaceUsage == VIDRNDT_AP_TEXTURE3D ? countof(m_pVideoTexture) : 1; - - for(int i = 0; i < nTexturesNeeded; i++) - { - if(FAILED(hr = m_pD3DDev->CreateTexture( - m_NativeVideoSize.cx, m_NativeVideoSize.cy, 1, - D3DUSAGE_RENDERTARGET, /*D3DFMT_X8R8G8B8*/D3DFMT_A8R8G8B8, - D3DPOOL_DEFAULT, &m_pVideoTexture[i], NULL))) - return hr; - - if(FAILED(hr = m_pVideoTexture[i]->GetSurfaceLevel(0, &m_pVideoSurface[i]))) - return hr; - } - - if(s.iAPSurfaceUsage == VIDRNDT_AP_TEXTURE2D) - { - for(int i = 0; i < countof(m_pVideoTexture); i++) - { - m_pVideoTexture[i] = NULL; - } - } - } - else - { - if(FAILED(hr = m_pD3DDev->CreateOffscreenPlainSurface( - m_NativeVideoSize.cx, m_NativeVideoSize.cy, - D3DFMT_X8R8G8B8/*D3DFMT_A8R8G8B8*/, - D3DPOOL_DEFAULT, &m_pVideoSurface[0], NULL))) - return hr; - } - - hr = m_pD3DDev->ColorFill(m_pVideoSurface[0], NULL, 0); - - return S_OK; -} - -void CDX9AllocatorPresenter::DeleteSurfaces() -{ - CAutoLock cAutoLock(this); - - for(int i = 0; i < countof(m_pVideoTexture); i++) - { - m_pVideoTexture[i] = NULL; - m_pVideoSurface[i] = NULL; - } -} - -UINT CDX9AllocatorPresenter::GetAdapter(IDirect3D9* pD3D) -{ - if(m_hWnd == NULL || pD3D == NULL) - return D3DADAPTER_DEFAULT; - - HMONITOR hMonitor = MonitorFromWindow(m_hWnd, MONITOR_DEFAULTTONEAREST); - if(hMonitor == NULL) return D3DADAPTER_DEFAULT; - - for(UINT adp = 0, num_adp = pD3D->GetAdapterCount(); adp < num_adp; ++adp) - { - HMONITOR hAdpMon = pD3D->GetAdapterMonitor(adp); - if(hAdpMon == hMonitor) return adp; - } - - return D3DADAPTER_DEFAULT; -} - -// ISubPicAllocatorPresenter - -STDMETHODIMP CDX9AllocatorPresenter::CreateRenderer(IUnknown** ppRenderer) -{ - return E_NOTIMPL; -} - -static bool ClipToSurface(IDirect3DSurface9* pSurface, CRect& s, CRect& d) -{ - D3DSURFACE_DESC d3dsd; - ZeroMemory(&d3dsd, sizeof(d3dsd)); - if(FAILED(pSurface->GetDesc(&d3dsd))) - return(false); - - int w = d3dsd.Width, h = d3dsd.Height; - int sw = s.Width(), sh = s.Height(); - int dw = d.Width(), dh = d.Height(); - - if(d.left >= w || d.right < 0 || d.top >= h || d.bottom < 0 - || sw <= 0 || sh <= 0 || dw <= 0 || dh <= 0) - { - s.SetRectEmpty(); - d.SetRectEmpty(); - return(true); - } - - if(d.right > w) {s.right -= (d.right-w)*sw/dw; d.right = w;} - if(d.bottom > h) {s.bottom -= (d.bottom-h)*sh/dh; d.bottom = h;} - if(d.left < 0) {s.left += (0-d.left)*sw/dw; d.left = 0;} - if(d.top < 0) {s.top += (0-d.top)*sh/dh; d.top = 0;} - - return(true); -} - -HRESULT CDX9AllocatorPresenter::InitResizers(float bicubicA) -{ - HRESULT hr; - - if(m_pResizerPixelShader[0] && m_bicubicA == 0 && bicubicA == 0 - || m_pResizerPixelShader[1] && m_pResizerPixelShader[2] && m_bicubicA == bicubicA && m_pResizerBicubic1stPass) - return S_OK; - - m_bicubicA = bicubicA; - m_pResizerBicubic1stPass = NULL; - - for(int i = 0; i < countof(m_pResizerPixelShader); i++) - m_pResizerPixelShader[i] = NULL; - - if(m_caps.PixelShaderVersion < D3DPS_VERSION(2, 0)) - return E_FAIL; - - LPCSTR pProfile = m_caps.PixelShaderVersion >= D3DPS_VERSION(3, 0) ? "ps_3_0" : "ps_2_0"; - - CStringA str; - if(!LoadResource(IDF_SHADER_RESIZER, str, _T("FILE"))) - return E_FAIL; - - CStringA A; - A.Format("(%f)", bicubicA); - str.Replace("_The_Value_Of_A_Is_Set_Here_", A); - - LPCSTR pEntries[] = {"main_bilinear", "main_bicubic1pass", "main_bicubic2pass"}; - - ASSERT(countof(pEntries) == countof(m_pResizerPixelShader)); - - for(int i = 0; i < countof(pEntries); i++) - { - hr = m_pPSC->CompileShader(str, pEntries[i], pProfile, 0, &m_pResizerPixelShader[i]); - if(FAILED(hr)) return hr; - } - - if(m_bicubicA) - { - if(FAILED(m_pD3DDev->CreateTexture( - min(max(2048, m_ScreenSize.cx), m_caps.MaxTextureWidth), m_NativeVideoSize.cy, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, - D3DPOOL_DEFAULT, &m_pResizerBicubic1stPass, NULL))) - { - ASSERT(0); - m_pResizerBicubic1stPass = NULL; // will do 1 pass then - } - } - - return S_OK; -} - -HRESULT CDX9AllocatorPresenter::TextureCopy(CComPtr pTexture) -{ - HRESULT hr; - - D3DSURFACE_DESC desc; - if(!pTexture || FAILED(pTexture->GetLevelDesc(0, &desc))) - return E_FAIL; - - float w = (float)desc.Width; - float h = (float)desc.Height; - - MYD3DVERTEX<1> v[] = - { - {0, 0, 0.5f, 2.0f, 0, 0}, - {w, 0, 0.5f, 2.0f, 1, 0}, - {0, h, 0.5f, 2.0f, 0, 1}, - {w, h, 0.5f, 2.0f, 1, 1}, - }; - - for(int i = 0; i < countof(v); i++) - { - v[i].x -= 0.5; - v[i].y -= 0.5; - } - - hr = m_pD3DDev->SetTexture(0, pTexture); - - return TextureBlt(m_pD3DDev, v, D3DTEXF_LINEAR); -} - -HRESULT CDX9AllocatorPresenter::TextureResize(CComPtr pTexture, Vector dst[4], D3DTEXTUREFILTERTYPE filter) -{ - HRESULT hr; - - D3DSURFACE_DESC desc; - if(!pTexture || FAILED(pTexture->GetLevelDesc(0, &desc))) - return E_FAIL; - - float w = (float)desc.Width; - float h = (float)desc.Height; - - float dx = 0.98f/w; - float dy = 0.98f/h; - - MYD3DVERTEX<1> v[] = - { - {dst[0].x, dst[0].y, dst[0].z, 1.0f/dst[0].z, 0, 0}, - {dst[1].x, dst[1].y, dst[1].z, 1.0f/dst[1].z, 1, 0}, - {dst[2].x, dst[2].y, dst[2].z, 1.0f/dst[2].z, 0, 1}, - {dst[3].x, dst[3].y, dst[3].z, 1.0f/dst[3].z, 1, 1}, - }; - - AdjustQuad(v, dx, dy); - - hr = m_pD3DDev->SetTexture(0, pTexture); - - hr = m_pD3DDev->SetPixelShader(NULL); - - hr = TextureBlt(m_pD3DDev, v, filter); - - return hr; -} - -HRESULT CDX9AllocatorPresenter::TextureResizeBilinear(CComPtr pTexture, Vector dst[4]) -{ - HRESULT hr; - - D3DSURFACE_DESC desc; - if(!pTexture || FAILED(pTexture->GetLevelDesc(0, &desc))) - return E_FAIL; - - float w = (float)desc.Width; - float h = (float)desc.Height; - - float dx = 0.98f/w; - float dy = 0.98f/h; - - MYD3DVERTEX<5> v[] = - { - {dst[0].x, dst[0].y, dst[0].z, 1.0f/dst[0].z, 0, 0, 0+dx, 0, 0, 0+dy, 0+dx, 0+dy, 0, 0}, - {dst[1].x, dst[1].y, dst[1].z, 1.0f/dst[1].z, 1, 0, 1+dx, 0, 1, 0+dy, 1+dx, 0+dy, w, 0}, - {dst[2].x, dst[2].y, dst[2].z, 1.0f/dst[2].z, 0, 1, 0+dx, 1, 0, 1+dy, 0+dx, 1+dy, 0, h}, - {dst[3].x, dst[3].y, dst[3].z, 1.0f/dst[3].z, 1, 1, 1+dx, 1, 1, 1+dy, 1+dx, 1+dy, w, h}, - }; - - AdjustQuad(v, dx, dy); - - hr = m_pD3DDev->SetTexture(0, pTexture); - hr = m_pD3DDev->SetTexture(1, pTexture); - hr = m_pD3DDev->SetTexture(2, pTexture); - hr = m_pD3DDev->SetTexture(3, pTexture); - - hr = m_pD3DDev->SetPixelShader(m_pResizerPixelShader[0]); - - hr = TextureBlt(m_pD3DDev, v, D3DTEXF_POINT); - - // - - m_pD3DDev->SetPixelShader(NULL); - - return hr; -} - -HRESULT CDX9AllocatorPresenter::TextureResizeBicubic1pass(CComPtr pTexture, Vector dst[4]) -{ - HRESULT hr; - - D3DSURFACE_DESC desc; - if(!pTexture || FAILED(pTexture->GetLevelDesc(0, &desc))) - return E_FAIL; - - float w = (float)desc.Width; - float h = (float)desc.Height; - - float dx = 0.98f/w; - float dy = 0.98f/h; - - MYD3DVERTEX<2> v[] = - { - {dst[0].x, dst[0].y, dst[0].z, 1.0f/dst[0].z, 0, 0, 0, 0}, - {dst[1].x, dst[1].y, dst[1].z, 1.0f/dst[1].z, 1, 0, w, 0}, - {dst[2].x, dst[2].y, dst[2].z, 1.0f/dst[2].z, 0, 1, 0, h}, - {dst[3].x, dst[3].y, dst[3].z, 1.0f/dst[3].z, 1, 1, w, h}, - }; - - AdjustQuad(v, dx, dy); - - hr = m_pD3DDev->SetTexture(0, pTexture); - - float fConstData[][4] = {{w, h, 0, 0}, {1.0f / w, 1.0f / h, 0, 0}, {1.0f / w, 0, 0, 0}, {0, 1.0f / h, 0, 0}}; - hr = m_pD3DDev->SetPixelShaderConstantF(0, (float*)fConstData, countof(fConstData)); - - hr = m_pD3DDev->SetPixelShader(m_pResizerPixelShader[1]); - - hr = TextureBlt(m_pD3DDev, v, D3DTEXF_POINT); - - m_pD3DDev->SetPixelShader(NULL); - - return hr; -} - -HRESULT CDX9AllocatorPresenter::TextureResizeBicubic2pass(CComPtr pTexture, Vector dst[4]) -{ - // return TextureResizeBicubic1pass(pTexture, dst); - - HRESULT hr; - - // rotated? - if(dst[0].z != dst[1].z || dst[2].z != dst[3].z || dst[0].z != dst[3].z - || dst[0].y != dst[1].y || dst[0].x != dst[2].x || dst[2].y != dst[3].y || dst[1].x != dst[3].x) - return TextureResizeBicubic1pass(pTexture, dst); - - D3DSURFACE_DESC desc; - if(!pTexture || FAILED(pTexture->GetLevelDesc(0, &desc))) - return E_FAIL; - - float dx = 0.98f/desc.Width; - - float w = (float)desc.Width; - float h = (float)desc.Height; - - CRect dst1(0, 0, (int)(dst[3].x - dst[0].x), (int)h); - - if(!m_pResizerBicubic1stPass || FAILED(m_pResizerBicubic1stPass->GetLevelDesc(0, &desc))) - return TextureResizeBicubic1pass(pTexture, dst); - - float dy = 0.98f/desc.Height; - - float dw = (float)dst1.Width() / desc.Width; - float dh = (float)dst1.Height() / desc.Height; - - ASSERT(dst1.Height() == desc.Height); - - if(dst1.Width() > desc.Width || dst1.Height() > desc.Height) - // if(dst1.Width() != desc.Width || dst1.Height() != desc.Height) - return TextureResizeBicubic1pass(pTexture, dst); - - MYD3DVERTEX<5> vx[] = - { - {(float)dst1.left, (float)dst1.top, 0.5f, 2.0f, 0-dx, 0, 0, 0, 0+dx, 0, 0+dx*2, 0, 0, 0}, - {(float)dst1.right, (float)dst1.top, 0.5f, 2.0f, 1-dx, 0, 1, 0, 1+dx, 0, 1+dx*2, 0, w, 0}, - {(float)dst1.left, (float)dst1.bottom, 0.5f, 2.0f, 0-dx, 1, 0, 1, 0+dx, 1, 0+dx*2, 1, 0, 0}, - {(float)dst1.right, (float)dst1.bottom, 0.5f, 2.0f, 1-dx, 1, 1, 1, 1+dx, 1, 1+dx*2, 1, w, 0}, - }; - - AdjustQuad(vx, dx, 0); - - MYD3DVERTEX<5> vy[] = - { - {dst[0].x, dst[0].y, dst[0].z, 1.0f/dst[0].z, 0, 0-dy, 0, 0, 0, 0+dy, 0, 0+dy*2, 0, 0}, - {dst[1].x, dst[1].y, dst[1].z, 1.0f/dst[1].z, dw, 0-dy, dw, 0, dw, 0+dy, dw, 0+dy*2, 0, 0}, - {dst[2].x, dst[2].y, dst[2].z, 1.0f/dst[2].z, 0, dh-dy, 0, dh, 0, dh+dy, 0, dh+dy*2, h, 0}, - {dst[3].x, dst[3].y, dst[3].z, 1.0f/dst[3].z, dw, dh-dy, dw, dh, dw, dh+dy, dw, dh+dy*2, h, 0}, - }; - - AdjustQuad(vy, 0, dy); - - hr = m_pD3DDev->SetPixelShader(m_pResizerPixelShader[2]); - - hr = m_pD3DDev->SetTexture(0, pTexture); - hr = m_pD3DDev->SetTexture(1, pTexture); - hr = m_pD3DDev->SetTexture(2, pTexture); - hr = m_pD3DDev->SetTexture(3, pTexture); - - CComPtr pRTOld; - hr = m_pD3DDev->GetRenderTarget(0, &pRTOld); - - CComPtr pRT; - hr = m_pResizerBicubic1stPass->GetSurfaceLevel(0, &pRT); - hr = m_pD3DDev->SetRenderTarget(0, pRT); - - hr = TextureBlt(m_pD3DDev, vx, D3DTEXF_POINT); - - hr = m_pD3DDev->SetTexture(0, m_pResizerBicubic1stPass); - hr = m_pD3DDev->SetTexture(1, m_pResizerBicubic1stPass); - hr = m_pD3DDev->SetTexture(2, m_pResizerBicubic1stPass); - hr = m_pD3DDev->SetTexture(3, m_pResizerBicubic1stPass); - - hr = m_pD3DDev->SetRenderTarget(0, pRTOld); - - hr = TextureBlt(m_pD3DDev, vy, D3DTEXF_POINT); - - m_pD3DDev->SetPixelShader(NULL); - - return hr; -} - -STDMETHODIMP_(bool) CDX9AllocatorPresenter::Paint(bool fAll) -{ - CAutoLock cAutoLock(this); - - if(m_WindowRect.right <= m_WindowRect.left || m_WindowRect.bottom <= m_WindowRect.top - || m_NativeVideoSize.cx <= 0 || m_NativeVideoSize.cy <= 0 - || !m_pVideoSurface) - return(false); - - HRESULT hr; - - CRect rSrcVid(CPoint(0, 0), m_NativeVideoSize); - CRect rDstVid(m_VideoRect); - - CRect rSrcPri(CPoint(0, 0), m_WindowRect.Size()); - CRect rDstPri(m_WindowRect); - - CComPtr pBackBuffer; - m_pD3DDev->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, &pBackBuffer); - - m_pD3DDev->SetRenderTarget(0, pBackBuffer); - - if(fAll) - { - // clear the backbuffer - - hr = m_pD3DDev->Clear(0, NULL, D3DCLEAR_TARGET, 0, 1.0f, 0); - - // paint the video on the backbuffer - - if(!rDstVid.IsRectEmpty()) - { - if(m_pVideoTexture[0]) - { - CComPtr pVideoTexture = m_pVideoTexture[0]; - - if(m_pVideoTexture[1] && m_pVideoTexture[2] && !m_pPixelShaders.IsEmpty()) - { - static __int64 counter = 0; - static long start = clock(); - - long stop = clock(); - long diff = stop - start; - - if(diff >= 10*60*CLOCKS_PER_SEC) start = stop; // reset after 10 min (ps float has its limits in both range and accuracy) - - float fConstData[][4] = - { - {(float)m_NativeVideoSize.cx, (float)m_NativeVideoSize.cy, (float)(counter++), (float)diff / CLOCKS_PER_SEC}, - {1.0f / m_NativeVideoSize.cx, 1.0f / m_NativeVideoSize.cy, 0, 0}, - }; - - hr = m_pD3DDev->SetPixelShaderConstantF(0, (float*)fConstData, countof(fConstData)); - - CComPtr pRT; - hr = m_pD3DDev->GetRenderTarget(0, &pRT); - - int src = 0, dst = 1; - - POSITION pos = m_pPixelShaders.GetHeadPosition(); - while(pos) - { - pVideoTexture = m_pVideoTexture[dst]; - - hr = m_pD3DDev->SetRenderTarget(0, m_pVideoSurface[dst]); - hr = m_pD3DDev->SetPixelShader(m_pPixelShaders.GetNext(pos)); - TextureCopy(m_pVideoTexture[src]); - - if(++src > 2) src = 1; - if(++dst > 2) dst = 1; - } - - hr = m_pD3DDev->SetRenderTarget(0, pRT); - hr = m_pD3DDev->SetPixelShader(NULL); - } - - Vector dst[4]; - Transform(rDstVid, dst); - - DWORD iDX9Resizer = AfxGetAppSettings().iDX9Resizer; - - float A = 0; - - switch(iDX9Resizer) - { - case 3: A = -0.60f; break; - case 4: A = -0.751f; break; // FIXME : 0.75 crashes recent D3D, or eat CPU - case 5: A = -1.00f; break; - } - - hr = InitResizers(A); - - if(iDX9Resizer == 0 || iDX9Resizer == 1 || rSrcVid.Size() == rDstVid.Size() || FAILED(hr)) - { - hr = TextureResize(pVideoTexture, dst, iDX9Resizer == 0 ? D3DTEXF_POINT : D3DTEXF_LINEAR); - } - else if(iDX9Resizer == 2) - { - hr = TextureResizeBilinear(pVideoTexture, dst); - } - else if(iDX9Resizer >= 3) - { - hr = TextureResizeBicubic2pass(pVideoTexture, dst); - } - - } - else - { - if(pBackBuffer) - { - ClipToSurface(pBackBuffer, rSrcVid, rDstVid); // grrr - // IMPORTANT: rSrcVid has to be aligned on mod2 for yuy2->rgb conversion with StretchRect!!! - rSrcVid.left &= ~1; rSrcVid.right &= ~1; - rSrcVid.top &= ~1; rSrcVid.bottom &= ~1; - hr = m_pD3DDev->StretchRect(m_pVideoSurface[0], rSrcVid, pBackBuffer, rDstVid, m_filter); - - // Support ffdshow queueing - // m_pD3DDev->StretchRect may fail if ffdshow is using queue output samples. - // Here we don't want to show the black buffer. - if(FAILED(hr)) return false; - } - } - } - - // paint the text on the backbuffer - - AlphaBltSubPic(rSrcPri.Size()); - } - - if(m_fVMRSyncFix) - { - D3DLOCKED_RECT lr; - if(SUCCEEDED(pBackBuffer->LockRect(&lr, NULL, 0))) - pBackBuffer->UnlockRect(); - } - - hr = m_pD3DDev->Present(rSrcPri, rDstPri, NULL, NULL); - - bool fResetDevice = false; - - if(hr == D3DERR_DEVICELOST && m_pD3DDev->TestCooperativeLevel() == D3DERR_DEVICENOTRESET) - { - fResetDevice = true; - } - - D3DDEVICE_CREATION_PARAMETERS Parameters; - if(SUCCEEDED(m_pD3DDev->GetCreationParameters(&Parameters)) - && m_pD3D->GetAdapterMonitor(Parameters.AdapterOrdinal) != m_pD3D->GetAdapterMonitor(GetAdapter(m_pD3D))) - { - fResetDevice = true; - } - - if(fResetDevice) - { - DeleteSurfaces(); - if(FAILED(hr = CreateDevice()) || FAILED(hr = AllocSurfaces())) - return false; - } - - return true; -} - -STDMETHODIMP CDX9AllocatorPresenter::GetDIB(BYTE* lpDib, DWORD* size) -{ - CheckPointer(size, E_POINTER); - - HRESULT hr; - - D3DSURFACE_DESC desc; - memset(&desc, 0, sizeof(desc)); - m_pVideoSurface[0]->GetDesc(&desc); - - DWORD required = sizeof(BITMAPINFOHEADER) + (desc.Width * desc.Height * 32 >> 3); - if(!lpDib) {*size = required; return S_OK;} - if(*size < required) return E_OUTOFMEMORY; - *size = required; - - CComPtr pSurface = m_pVideoSurface[0]; - D3DLOCKED_RECT r; - if(FAILED(hr = pSurface->LockRect(&r, NULL, D3DLOCK_READONLY))) - { - pSurface = NULL; - if(FAILED(hr = m_pD3DDev->CreateOffscreenPlainSurface(desc.Width, desc.Height, desc.Format, D3DPOOL_SYSTEMMEM, &pSurface, NULL)) - || FAILED(hr = m_pD3DDev->GetRenderTargetData(m_pVideoSurface[0], pSurface)) - || FAILED(hr = pSurface->LockRect(&r, NULL, D3DLOCK_READONLY))) - return hr; - } - - BITMAPINFOHEADER* bih = (BITMAPINFOHEADER*)lpDib; - memset(bih, 0, sizeof(BITMAPINFOHEADER)); - bih->biSize = sizeof(BITMAPINFOHEADER); - bih->biWidth = desc.Width; - bih->biHeight = desc.Height; - bih->biBitCount = 32; - bih->biPlanes = 1; - bih->biSizeImage = bih->biWidth * bih->biHeight * bih->biBitCount >> 3; - - BitBltFromRGBToRGB( - bih->biWidth, bih->biHeight, - (BYTE*)(bih + 1), bih->biWidth*bih->biBitCount>>3, bih->biBitCount, - (BYTE*)r.pBits + r.Pitch*(desc.Height-1), -(int)r.Pitch, 32); - - pSurface->UnlockRect(); - - return S_OK; -} - -STDMETHODIMP CDX9AllocatorPresenter::SetPixelShader(LPCSTR pSrcData, LPCSTR pTarget) -{ - CAutoLock cAutoLock(this); - - if(!pSrcData && !pTarget) - { - m_pPixelShaders.RemoveAll(); - m_pD3DDev->SetPixelShader(NULL); - return S_OK; - } - - if(!pSrcData || !pTarget) - return E_INVALIDARG; - - CComPtr pPixelShader; - - HRESULT hr = m_pPSC->CompileShader(pSrcData, "main", pTarget, 0, &pPixelShader); - if(FAILED(hr)) return hr; - - m_pPixelShaders.AddTail(pPixelShader); - - Paint(true); - - return S_OK; -} - -// -// CVMR9AllocatorPresenter -// - -#define MY_USER_ID 0x6ABE51 - -CVMR9AllocatorPresenter::CVMR9AllocatorPresenter(HWND hWnd, HRESULT& hr) - : CDX9AllocatorPresenter(hWnd, hr) - , m_fUseInternalTimer(false) - , m_rtPrevStart(-1) -{ -} - -STDMETHODIMP CVMR9AllocatorPresenter::NonDelegatingQueryInterface(REFIID riid, void** ppv) -{ - CheckPointer(ppv, E_POINTER); - - return - QI(IVMRSurfaceAllocator9) - QI(IVMRImagePresenter9) - QI(IVMRWindowlessControl9) - __super::NonDelegatingQueryInterface(riid, ppv); -} - -HRESULT CVMR9AllocatorPresenter::CreateDevice() -{ - HRESULT hr = __super::CreateDevice(); - if(FAILED(hr)) return hr; - - if(m_pIVMRSurfAllocNotify) - { - HMONITOR hMonitor = m_pD3D->GetAdapterMonitor(GetAdapter(m_pD3D)); - if(FAILED(hr = m_pIVMRSurfAllocNotify->ChangeD3DDevice(m_pD3DDev, hMonitor))) - return(false); - } - - return hr; -} - -void CVMR9AllocatorPresenter::DeleteSurfaces() -{ - CAutoLock cAutoLock(this); - - m_pSurfaces.RemoveAll(); - - return __super::DeleteSurfaces(); -} - -// ISubPicAllocatorPresenter - -class COuterVMR9 - : public CUnknown - , public IVideoWindow - , public IBasicVideo2 - , public IVMRWindowlessControl - , public IVMRffdshow9 -{ - CComPtr m_pVMR; - -public: - - COuterVMR9(const TCHAR* pName, LPUNKNOWN pUnk) : CUnknown(pName, pUnk) - { - m_pVMR.CoCreateInstance(CLSID_VideoMixingRenderer9, GetOwner()); - } - - DECLARE_IUNKNOWN; - STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv) - { - HRESULT hr = m_pVMR ? m_pVMR->QueryInterface(riid, ppv) : E_NOINTERFACE; - - if(m_pVMR && FAILED(hr)) - { - if(riid == __uuidof(IVideoWindow)) - return GetInterface((IVideoWindow*)this, ppv); - if(riid == __uuidof(IBasicVideo)) - return GetInterface((IBasicVideo*)this, ppv); - if(riid == __uuidof(IBasicVideo2)) - return GetInterface((IBasicVideo2*)this, ppv); - if(riid == __uuidof(IVMRffdshow9)) // Support ffdshow queueing. We show ffdshow that this is patched Media Player Classic. - return GetInterface((IVMRffdshow9*)this, ppv); -/* if(riid == __uuidof(IVMRWindowlessControl)) - return GetInterface((IVMRWindowlessControl*)this, ppv); -*/ } - - return SUCCEEDED(hr) ? hr : __super::NonDelegatingQueryInterface(riid, ppv); - } - - // IVMRWindowlessControl - - STDMETHODIMP GetNativeVideoSize(LONG* lpWidth, LONG* lpHeight, LONG* lpARWidth, LONG* lpARHeight) - { - if(CComQIPtr pWC9 = m_pVMR) - { - return pWC9->GetNativeVideoSize(lpWidth, lpHeight, lpARWidth, lpARHeight); - } - - return E_NOTIMPL; - } - STDMETHODIMP GetMinIdealVideoSize(LONG* lpWidth, LONG* lpHeight) {return E_NOTIMPL;} - STDMETHODIMP GetMaxIdealVideoSize(LONG* lpWidth, LONG* lpHeight) {return E_NOTIMPL;} - STDMETHODIMP SetVideoPosition(const LPRECT lpSRCRect, const LPRECT lpDSTRect) {return E_NOTIMPL;} - STDMETHODIMP GetVideoPosition(LPRECT lpSRCRect, LPRECT lpDSTRect) - { - if(CComQIPtr pWC9 = m_pVMR) - { - return pWC9->GetVideoPosition(lpSRCRect, lpDSTRect); - } - - return E_NOTIMPL; - } - STDMETHODIMP GetAspectRatioMode(DWORD* lpAspectRatioMode) - { - if(CComQIPtr pWC9 = m_pVMR) - { - *lpAspectRatioMode = VMR_ARMODE_NONE; - return S_OK; - } - - return E_NOTIMPL; - } - STDMETHODIMP SetAspectRatioMode(DWORD AspectRatioMode) {return E_NOTIMPL;} - STDMETHODIMP SetVideoClippingWindow(HWND hwnd) {return E_NOTIMPL;} - STDMETHODIMP RepaintVideo(HWND hwnd, HDC hdc) {return E_NOTIMPL;} - STDMETHODIMP DisplayModeChanged() {return E_NOTIMPL;} - STDMETHODIMP GetCurrentImage(BYTE** lpDib) {return E_NOTIMPL;} - STDMETHODIMP SetBorderColor(COLORREF Clr) {return E_NOTIMPL;} - STDMETHODIMP GetBorderColor(COLORREF* lpClr) {return E_NOTIMPL;} - STDMETHODIMP SetColorKey(COLORREF Clr) {return E_NOTIMPL;} - STDMETHODIMP GetColorKey(COLORREF* lpClr) {return E_NOTIMPL;} - - // IVideoWindow - STDMETHODIMP GetTypeInfoCount(UINT* pctinfo) {return E_NOTIMPL;} - STDMETHODIMP GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo** ppTInfo) {return E_NOTIMPL;} - STDMETHODIMP GetIDsOfNames(REFIID riid, LPOLESTR* rgszNames, UINT cNames, LCID lcid, DISPID* rgDispId) {return E_NOTIMPL;} - STDMETHODIMP Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pVarResult, EXCEPINFO* pExcepInfo, UINT* puArgErr) {return E_NOTIMPL;} - STDMETHODIMP put_Caption(BSTR strCaption) {return E_NOTIMPL;} - STDMETHODIMP get_Caption(BSTR* strCaption) {return E_NOTIMPL;} - STDMETHODIMP put_WindowStyle(long WindowStyle) {return E_NOTIMPL;} - STDMETHODIMP get_WindowStyle(long* WindowStyle) {return E_NOTIMPL;} - STDMETHODIMP put_WindowStyleEx(long WindowStyleEx) {return E_NOTIMPL;} - STDMETHODIMP get_WindowStyleEx(long* WindowStyleEx) {return E_NOTIMPL;} - STDMETHODIMP put_AutoShow(long AutoShow) {return E_NOTIMPL;} - STDMETHODIMP get_AutoShow(long* AutoShow) {return E_NOTIMPL;} - STDMETHODIMP put_WindowState(long WindowState) {return E_NOTIMPL;} - STDMETHODIMP get_WindowState(long* WindowState) {return E_NOTIMPL;} - STDMETHODIMP put_BackgroundPalette(long BackgroundPalette) {return E_NOTIMPL;} - STDMETHODIMP get_BackgroundPalette(long* pBackgroundPalette) {return E_NOTIMPL;} - STDMETHODIMP put_Visible(long Visible) {return E_NOTIMPL;} - STDMETHODIMP get_Visible(long* pVisible) {return E_NOTIMPL;} - STDMETHODIMP put_Left(long Left) {return E_NOTIMPL;} - STDMETHODIMP get_Left(long* pLeft) {return E_NOTIMPL;} - STDMETHODIMP put_Width(long Width) {return E_NOTIMPL;} - STDMETHODIMP get_Width(long* pWidth) - { - if(CComQIPtr pWC9 = m_pVMR) - { - CRect s, d; - HRESULT hr = pWC9->GetVideoPosition(&s, &d); - *pWidth = d.Width(); - return hr; - } - - return E_NOTIMPL; - } - STDMETHODIMP put_Top(long Top) {return E_NOTIMPL;} - STDMETHODIMP get_Top(long* pTop) {return E_NOTIMPL;} - STDMETHODIMP put_Height(long Height) {return E_NOTIMPL;} - STDMETHODIMP get_Height(long* pHeight) - { - if(CComQIPtr pWC9 = m_pVMR) - { - CRect s, d; - HRESULT hr = pWC9->GetVideoPosition(&s, &d); - *pHeight = d.Height(); - return hr; - } - - return E_NOTIMPL; - } - STDMETHODIMP put_Owner(OAHWND Owner) {return E_NOTIMPL;} - STDMETHODIMP get_Owner(OAHWND* Owner) {return E_NOTIMPL;} - STDMETHODIMP put_MessageDrain(OAHWND Drain) {return E_NOTIMPL;} - STDMETHODIMP get_MessageDrain(OAHWND* Drain) {return E_NOTIMPL;} - STDMETHODIMP get_BorderColor(long* Color) {return E_NOTIMPL;} - STDMETHODIMP put_BorderColor(long Color) {return E_NOTIMPL;} - STDMETHODIMP get_FullScreenMode(long* FullScreenMode) {return E_NOTIMPL;} - STDMETHODIMP put_FullScreenMode(long FullScreenMode) {return E_NOTIMPL;} - STDMETHODIMP SetWindowForeground(long Focus) {return E_NOTIMPL;} - STDMETHODIMP NotifyOwnerMessage(OAHWND hwnd, long uMsg, LONG_PTR wParam, LONG_PTR lParam) {return E_NOTIMPL;} - STDMETHODIMP SetWindowPosition(long Left, long Top, long Width, long Height) {return E_NOTIMPL;} - STDMETHODIMP GetWindowPosition(long* pLeft, long* pTop, long* pWidth, long* pHeight) {return E_NOTIMPL;} - STDMETHODIMP GetMinIdealImageSize(long* pWidth, long* pHeight) {return E_NOTIMPL;} - STDMETHODIMP GetMaxIdealImageSize(long* pWidth, long* pHeight) {return E_NOTIMPL;} - STDMETHODIMP GetRestorePosition(long* pLeft, long* pTop, long* pWidth, long* pHeight) {return E_NOTIMPL;} - STDMETHODIMP HideCursor(long HideCursor) {return E_NOTIMPL;} - STDMETHODIMP IsCursorHidden(long* CursorHidden) {return E_NOTIMPL;} - - // IBasicVideo2 - STDMETHODIMP get_AvgTimePerFrame(REFTIME* pAvgTimePerFrame) {return E_NOTIMPL;} - STDMETHODIMP get_BitRate(long* pBitRate) {return E_NOTIMPL;} - STDMETHODIMP get_BitErrorRate(long* pBitErrorRate) {return E_NOTIMPL;} - STDMETHODIMP get_VideoWidth(long* pVideoWidth) {return E_NOTIMPL;} - STDMETHODIMP get_VideoHeight(long* pVideoHeight) {return E_NOTIMPL;} - STDMETHODIMP put_SourceLeft(long SourceLeft) {return E_NOTIMPL;} - STDMETHODIMP get_SourceLeft(long* pSourceLeft) {return E_NOTIMPL;} - STDMETHODIMP put_SourceWidth(long SourceWidth) {return E_NOTIMPL;} - STDMETHODIMP get_SourceWidth(long* pSourceWidth) {return E_NOTIMPL;} - STDMETHODIMP put_SourceTop(long SourceTop) {return E_NOTIMPL;} - STDMETHODIMP get_SourceTop(long* pSourceTop) {return E_NOTIMPL;} - STDMETHODIMP put_SourceHeight(long SourceHeight) {return E_NOTIMPL;} - STDMETHODIMP get_SourceHeight(long* pSourceHeight) {return E_NOTIMPL;} - STDMETHODIMP put_DestinationLeft(long DestinationLeft) {return E_NOTIMPL;} - STDMETHODIMP get_DestinationLeft(long* pDestinationLeft) {return E_NOTIMPL;} - STDMETHODIMP put_DestinationWidth(long DestinationWidth) {return E_NOTIMPL;} - STDMETHODIMP get_DestinationWidth(long* pDestinationWidth) {return E_NOTIMPL;} - STDMETHODIMP put_DestinationTop(long DestinationTop) {return E_NOTIMPL;} - STDMETHODIMP get_DestinationTop(long* pDestinationTop) {return E_NOTIMPL;} - STDMETHODIMP put_DestinationHeight(long DestinationHeight) {return E_NOTIMPL;} - STDMETHODIMP get_DestinationHeight(long* pDestinationHeight) {return E_NOTIMPL;} - STDMETHODIMP SetSourcePosition(long Left, long Top, long Width, long Height) {return E_NOTIMPL;} - STDMETHODIMP GetSourcePosition(long* pLeft, long* pTop, long* pWidth, long* pHeight) - { - // DVD Nav. bug workaround fix - { - *pLeft = *pTop = 0; - return GetVideoSize(pWidth, pHeight); - } -/* - if(CComQIPtr pWC9 = m_pVMR) - { - CRect s, d; - HRESULT hr = pWC9->GetVideoPosition(&s, &d); - *pLeft = s.left; - *pTop = s.top; - *pWidth = s.Width(); - *pHeight = s.Height(); - return hr; - } -*/ - return E_NOTIMPL; - } - STDMETHODIMP SetDefaultSourcePosition() {return E_NOTIMPL;} - STDMETHODIMP SetDestinationPosition(long Left, long Top, long Width, long Height) {return E_NOTIMPL;} - STDMETHODIMP GetDestinationPosition(long* pLeft, long* pTop, long* pWidth, long* pHeight) - { - if(CComQIPtr pWC9 = m_pVMR) - { - CRect s, d; - HRESULT hr = pWC9->GetVideoPosition(&s, &d); - *pLeft = d.left; - *pTop = d.top; - *pWidth = d.Width(); - *pHeight = d.Height(); - return hr; - } - - return E_NOTIMPL; - } - STDMETHODIMP SetDefaultDestinationPosition() {return E_NOTIMPL;} - STDMETHODIMP GetVideoSize(long* pWidth, long* pHeight) - { - if(CComQIPtr pWC9 = m_pVMR) - { - LONG aw, ah; -// return pWC9->GetNativeVideoSize(pWidth, pHeight, &aw, &ah); - // DVD Nav. bug workaround fix - HRESULT hr = pWC9->GetNativeVideoSize(pWidth, pHeight, &aw, &ah); - *pWidth = *pHeight * aw / ah; - return hr; - } - - return E_NOTIMPL; - } - STDMETHODIMP GetVideoPaletteEntries(long StartIndex, long Entries, long* pRetrieved, long* pPalette) {return E_NOTIMPL;} - STDMETHODIMP GetCurrentImage(long* pBufferSize, long* pDIBImage) {return E_NOTIMPL;} - STDMETHODIMP IsUsingDefaultSource() {return E_NOTIMPL;} - STDMETHODIMP IsUsingDefaultDestination() {return E_NOTIMPL;} - - STDMETHODIMP GetPreferredAspectRatio(long* plAspectX, long* plAspectY) - { - if(CComQIPtr pWC9 = m_pVMR) - { - LONG w, h; - return pWC9->GetNativeVideoSize(&w, &h, plAspectX, plAspectY); - } - - return E_NOTIMPL; - } - - // IVMRffdshow9 - STDMETHODIMP support_ffdshow() - { - queueu_ffdshow_support = true; - return S_OK; - } -}; - -STDMETHODIMP CVMR9AllocatorPresenter::CreateRenderer(IUnknown** ppRenderer) -{ - CheckPointer(ppRenderer, E_POINTER); - - *ppRenderer = NULL; - - HRESULT hr; - - do - { - CMacrovisionKicker* pMK = new CMacrovisionKicker(NAME("CMacrovisionKicker"), NULL); - CComPtr pUnk = (IUnknown*)(INonDelegatingUnknown*)pMK; - pMK->SetInner((IUnknown*)(INonDelegatingUnknown*)new COuterVMR9(NAME("COuterVMR9"), pUnk)); - CComQIPtr pBF = pUnk; -/* - CComQIPtr pBF = (IUnknown*)(INonDelegatingUnknown*)new COuterVMR9(NAME("COuterVMR9"), NULL); - if(!pBF) pBF.CoCreateInstance(CLSID_VideoMixingRenderer9); -*/ - - CComPtr pPin = GetFirstPin(pBF); - CComQIPtr pMemInputPin = pPin; - m_fUseInternalTimer = HookNewSegmentAndReceive((IPinC*)(IPin*)pPin, (IMemInputPinC*)(IMemInputPin*)pMemInputPin); -/* -if(CComQIPtr pAMVA = pPin) - HookAMVideoAccelerator((IAMVideoAcceleratorC*)(IAMVideoAccelerator*)pAMVA); -*/ - CComQIPtr pConfig = pBF; - if(!pConfig) - break; - - AppSettings& s = AfxGetAppSettings(); - - if(s.fVMR9MixerMode) - { - if(FAILED(hr = pConfig->SetNumberOfStreams(1))) - break; - - if(s.fVMR9MixerYUV && !AfxGetMyApp()->IsVistaOrAbove()) - { - if(CComQIPtr pMC = pBF) - { - DWORD dwPrefs; - pMC->GetMixingPrefs(&dwPrefs); - dwPrefs &= ~MixerPref9_RenderTargetMask; - dwPrefs |= MixerPref9_RenderTargetYUV; - pMC->SetMixingPrefs(dwPrefs); - } - } - } - - if(FAILED(hr = pConfig->SetRenderingMode(VMR9Mode_Renderless))) - break; - - CComQIPtr pSAN = pBF; - if(!pSAN) - break; - - if(FAILED(hr = pSAN->AdviseSurfaceAllocator(MY_USER_ID, static_cast(this))) - || FAILED(hr = AdviseNotify(pSAN))) - break; - - *ppRenderer = (IUnknown*)pBF.Detach(); - - return S_OK; - } - while(0); - - return E_FAIL; -} - -STDMETHODIMP_(void) CVMR9AllocatorPresenter::SetTime(REFERENCE_TIME rtNow) -{ - __super::SetTime(rtNow); - m_fUseInternalTimer = false; -} - -// IVMRSurfaceAllocator9 - -STDMETHODIMP CVMR9AllocatorPresenter::InitializeDevice(DWORD_PTR dwUserID, VMR9AllocationInfo* lpAllocInfo, DWORD* lpNumBuffers) -{ - if(!lpAllocInfo || !lpNumBuffers) - return E_POINTER; - - if(!m_pIVMRSurfAllocNotify) - return E_FAIL; - - if((GetAsyncKeyState(VK_CONTROL)&0x80000000)) - if(lpAllocInfo->Format == '21VY' || lpAllocInfo->Format == '024I') - return E_FAIL; - - DeleteSurfaces(); - - m_pSurfaces.SetCount(*lpNumBuffers); - - int w = lpAllocInfo->dwWidth; - int h = abs((int)lpAllocInfo->dwHeight); - - HRESULT hr; - - if(lpAllocInfo->dwFlags & VMR9AllocFlag_3DRenderTarget) - lpAllocInfo->dwFlags |= VMR9AllocFlag_TextureSurface; - - hr = m_pIVMRSurfAllocNotify->AllocateSurfaceHelper(lpAllocInfo, lpNumBuffers, &m_pSurfaces[0]); - if(FAILED(hr)) return hr; - - m_NativeVideoSize = m_AspectRatio = CSize(w, h); - int arx = lpAllocInfo->szAspectRatio.cx, ary = lpAllocInfo->szAspectRatio.cy; - if(arx > 0 && ary > 0) m_AspectRatio.SetSize(arx, ary); - - if(FAILED(hr = AllocSurfaces())) - return hr; - - if(!(lpAllocInfo->dwFlags & VMR9AllocFlag_TextureSurface)) - { - // test if the colorspace is acceptable - if(FAILED(hr = m_pD3DDev->StretchRect(m_pSurfaces[0], NULL, m_pVideoSurface[0], NULL, D3DTEXF_NONE))) - { - DeleteSurfaces(); - return E_FAIL; - } - } - - hr = m_pD3DDev->ColorFill(m_pVideoSurface[0], NULL, 0); - - return hr; -} - -STDMETHODIMP CVMR9AllocatorPresenter::TerminateDevice(DWORD_PTR dwUserID) -{ - DeleteSurfaces(); - return S_OK; -} - -STDMETHODIMP CVMR9AllocatorPresenter::GetSurface(DWORD_PTR dwUserID, DWORD SurfaceIndex, DWORD SurfaceFlags, IDirect3DSurface9** lplpSurface) -{ - if(!lplpSurface) - return E_POINTER; - - if(SurfaceIndex >= m_pSurfaces.GetCount()) - return E_FAIL; - - CAutoLock cAutoLock(this); - - (*lplpSurface = m_pSurfaces[SurfaceIndex])->AddRef(); - - return S_OK; -} - -STDMETHODIMP CVMR9AllocatorPresenter::AdviseNotify(IVMRSurfaceAllocatorNotify9* lpIVMRSurfAllocNotify) -{ - CAutoLock cAutoLock(this); - - m_pIVMRSurfAllocNotify = lpIVMRSurfAllocNotify; - - HRESULT hr; - HMONITOR hMonitor = m_pD3D->GetAdapterMonitor(GetAdapter(m_pD3D)); - if(FAILED(hr = m_pIVMRSurfAllocNotify->SetD3DDevice(m_pD3DDev, hMonitor))) - return hr; - - return S_OK; -} - -// IVMRImagePresenter9 - -STDMETHODIMP CVMR9AllocatorPresenter::StartPresenting(DWORD_PTR dwUserID) -{ - CAutoLock cAutoLock(this); - - ASSERT(m_pD3DDev); - - return m_pD3DDev ? S_OK : E_FAIL; -} - -STDMETHODIMP CVMR9AllocatorPresenter::StopPresenting(DWORD_PTR dwUserID) -{ - return S_OK; -} - -STDMETHODIMP CVMR9AllocatorPresenter::PresentImage(DWORD_PTR dwUserID, VMR9PresentationInfo* lpPresInfo) -{ - CheckPointer(m_pIVMRSurfAllocNotify, E_UNEXPECTED); - - HRESULT hr; - - if(!lpPresInfo || !lpPresInfo->lpSurf) - return E_POINTER; - - CAutoLock cAutoLock(this); - - CComPtr pTexture; - lpPresInfo->lpSurf->GetContainer(IID_IDirect3DTexture9, (void**)&pTexture); - - if(pTexture) - { - m_pVideoSurface[0] = lpPresInfo->lpSurf; - if(m_pVideoTexture[0]) m_pVideoTexture[0] = pTexture; - } - else - { - hr = m_pD3DDev->StretchRect(lpPresInfo->lpSurf, NULL, m_pVideoSurface[0], NULL, D3DTEXF_NONE); - } - - if(lpPresInfo->rtEnd > lpPresInfo->rtStart) - { - REFERENCE_TIME rtTimePerFrame = lpPresInfo->rtEnd - lpPresInfo->rtStart; - m_fps = 10000000.0 / rtTimePerFrame; - - if(m_pSubPicQueue) - { - m_pSubPicQueue->SetFPS(m_fps); - - if(m_fUseInternalTimer) - { - __super::SetTime(g_tSegmentStart + g_tSampleStart); - } - } - } - - CSize VideoSize = m_NativeVideoSize; - int arx = lpPresInfo->szAspectRatio.cx, ary = lpPresInfo->szAspectRatio.cy; - if(arx > 0 && ary > 0) VideoSize.cx = VideoSize.cy*arx/ary; - if(VideoSize != GetVideoSize()) - { - m_AspectRatio.SetSize(arx, ary); - AfxGetApp()->m_pMainWnd->PostMessage(WM_REARRANGERENDERLESS); - } - - Paint(true); - - return S_OK; -} - -// IVMRWindowlessControl9 -// -// It is only implemented (partially) for the dvd navigator's -// menu handling, which needs to know a few things about the -// location of our window. - -STDMETHODIMP CVMR9AllocatorPresenter::GetNativeVideoSize(LONG* lpWidth, LONG* lpHeight, LONG* lpARWidth, LONG* lpARHeight) -{ - if(lpWidth) *lpWidth = m_NativeVideoSize.cx; - if(lpHeight) *lpHeight = m_NativeVideoSize.cy; - if(lpARWidth) *lpARWidth = m_AspectRatio.cx; - if(lpARHeight) *lpARHeight = m_AspectRatio.cy; - return S_OK; -} -STDMETHODIMP CVMR9AllocatorPresenter::GetMinIdealVideoSize(LONG* lpWidth, LONG* lpHeight) {return E_NOTIMPL;} -STDMETHODIMP CVMR9AllocatorPresenter::GetMaxIdealVideoSize(LONG* lpWidth, LONG* lpHeight) {return E_NOTIMPL;} -STDMETHODIMP CVMR9AllocatorPresenter::SetVideoPosition(const LPRECT lpSRCRect, const LPRECT lpDSTRect) {return E_NOTIMPL;} // we have our own method for this -STDMETHODIMP CVMR9AllocatorPresenter::GetVideoPosition(LPRECT lpSRCRect, LPRECT lpDSTRect) -{ - CopyRect(lpSRCRect, CRect(CPoint(0, 0), m_NativeVideoSize)); - CopyRect(lpDSTRect, &m_VideoRect); - return S_OK; -} -STDMETHODIMP CVMR9AllocatorPresenter::GetAspectRatioMode(DWORD* lpAspectRatioMode) -{ - if(lpAspectRatioMode) *lpAspectRatioMode = AM_ARMODE_STRETCHED; - return S_OK; -} -STDMETHODIMP CVMR9AllocatorPresenter::SetAspectRatioMode(DWORD AspectRatioMode) {return E_NOTIMPL;} -STDMETHODIMP CVMR9AllocatorPresenter::SetVideoClippingWindow(HWND hwnd) {return E_NOTIMPL;} -STDMETHODIMP CVMR9AllocatorPresenter::RepaintVideo(HWND hwnd, HDC hdc) {return E_NOTIMPL;} -STDMETHODIMP CVMR9AllocatorPresenter::DisplayModeChanged() {return E_NOTIMPL;} -STDMETHODIMP CVMR9AllocatorPresenter::GetCurrentImage(BYTE** lpDib) {return E_NOTIMPL;} -STDMETHODIMP CVMR9AllocatorPresenter::SetBorderColor(COLORREF Clr) {return E_NOTIMPL;} -STDMETHODIMP CVMR9AllocatorPresenter::GetBorderColor(COLORREF* lpClr) -{ - if(lpClr) *lpClr = 0; - return S_OK; -} - -// -// CRM9AllocatorPresenter -// - -CRM9AllocatorPresenter::CRM9AllocatorPresenter(HWND hWnd, HRESULT& hr) - : CDX9AllocatorPresenter(hWnd, hr) -{ -} - -STDMETHODIMP CRM9AllocatorPresenter::NonDelegatingQueryInterface(REFIID riid, void** ppv) -{ - CheckPointer(ppv, E_POINTER); - - return - QI2(IRMAVideoSurface) - __super::NonDelegatingQueryInterface(riid, ppv); -} - -HRESULT CRM9AllocatorPresenter::AllocSurfaces() -{ - CAutoLock cAutoLock(this); - - m_pVideoSurfaceOff = NULL; - m_pVideoSurfaceYUY2 = NULL; - - HRESULT hr; - - if(FAILED(hr = m_pD3DDev->CreateOffscreenPlainSurface( - m_NativeVideoSize.cx, m_NativeVideoSize.cy, D3DFMT_X8R8G8B8, - D3DPOOL_DEFAULT, &m_pVideoSurfaceOff, NULL))) - return hr; - - m_pD3DDev->ColorFill(m_pVideoSurfaceOff, NULL, 0); - - if(FAILED(hr = m_pD3DDev->CreateOffscreenPlainSurface( - m_NativeVideoSize.cx, m_NativeVideoSize.cy, D3DFMT_YUY2, - D3DPOOL_DEFAULT, &m_pVideoSurfaceYUY2, NULL))) - m_pVideoSurfaceYUY2 = NULL; - - if(m_pVideoSurfaceYUY2) - { - m_pD3DDev->ColorFill(m_pVideoSurfaceOff, NULL, 0x80108010); - } - - return __super::AllocSurfaces(); -} - -void CRM9AllocatorPresenter::DeleteSurfaces() -{ - CAutoLock cAutoLock(this); - m_pVideoSurfaceOff = NULL; - m_pVideoSurfaceYUY2 = NULL; - __super::DeleteSurfaces(); -} - -// IRMAVideoSurface - -STDMETHODIMP CRM9AllocatorPresenter::Blt(UCHAR* pImageData, RMABitmapInfoHeader* pBitmapInfo, REF(PNxRect) inDestRect, REF(PNxRect) inSrcRect) -{ - if(!m_pVideoSurface || !m_pVideoSurfaceOff) - return E_FAIL; - - bool fRGB = false; - bool fYUY2 = false; - - CRect src((RECT*)&inSrcRect), dst((RECT*)&inDestRect), src2(CPoint(0,0), src.Size()); - if(src.Width() > dst.Width() || src.Height() > dst.Height()) - return E_FAIL; - - D3DSURFACE_DESC d3dsd; - ZeroMemory(&d3dsd, sizeof(d3dsd)); - if(FAILED(m_pVideoSurfaceOff->GetDesc(&d3dsd))) - return E_FAIL; - - int dbpp = - d3dsd.Format == D3DFMT_R8G8B8 || d3dsd.Format == D3DFMT_X8R8G8B8 || d3dsd.Format == D3DFMT_A8R8G8B8 ? 32 : - d3dsd.Format == D3DFMT_R5G6B5 ? 16 : 0; - - if(pBitmapInfo->biCompression == '024I') - { - DWORD pitch = pBitmapInfo->biWidth; - DWORD size = pitch*abs(pBitmapInfo->biHeight); - - BYTE* y = pImageData + src.top*pitch + src.left; - BYTE* u = pImageData + size + src.top*(pitch/2) + src.left/2; - BYTE* v = pImageData + size + size/4 + src.top*(pitch/2) + src.left/2; - - if(m_pVideoSurfaceYUY2) - { - D3DLOCKED_RECT r; - if(SUCCEEDED(m_pVideoSurfaceYUY2->LockRect(&r, src2, 0))) - { - BitBltFromI420ToYUY2(src.Width(), src.Height(), (BYTE*)r.pBits, r.Pitch, y, u, v, pitch); - m_pVideoSurfaceYUY2->UnlockRect(); - fYUY2 = true; - } - } - else - { - D3DLOCKED_RECT r; - if(SUCCEEDED(m_pVideoSurfaceOff->LockRect(&r, src2, 0))) - { - BitBltFromI420ToRGB(src.Width(), src.Height(), (BYTE*)r.pBits, r.Pitch, dbpp, y, u, v, pitch); - m_pVideoSurfaceOff->UnlockRect(); - fRGB = true; - } - } - } - else if(pBitmapInfo->biCompression == '2YUY') - { - DWORD w = pBitmapInfo->biWidth; - DWORD h = abs(pBitmapInfo->biHeight); - DWORD pitch = pBitmapInfo->biWidth*2; - - BYTE* yvyu = pImageData + src.top*pitch + src.left*2; - - if(m_pVideoSurfaceYUY2) - { - D3DLOCKED_RECT r; - if(SUCCEEDED(m_pVideoSurfaceYUY2->LockRect(&r, src2, 0))) - { - BitBltFromYUY2ToYUY2(src.Width(), src.Height(), (BYTE*)r.pBits, r.Pitch, yvyu, pitch); - m_pVideoSurfaceYUY2->UnlockRect(); - fYUY2 = true; - } - } - else - { - D3DLOCKED_RECT r; - if(SUCCEEDED(m_pVideoSurfaceOff->LockRect(&r, src2, 0))) - { - BitBltFromYUY2ToRGB(src.Width(), src.Height(), (BYTE*)r.pBits, r.Pitch, dbpp, yvyu, pitch); - m_pVideoSurfaceOff->UnlockRect(); - fRGB = true; - } - } - } - else if(pBitmapInfo->biCompression == 0 || pBitmapInfo->biCompression == 3 - || pBitmapInfo->biCompression == 'BGRA') - { - DWORD w = pBitmapInfo->biWidth; - DWORD h = abs(pBitmapInfo->biHeight); - DWORD pitch = pBitmapInfo->biWidth*pBitmapInfo->biBitCount>>3; - - BYTE* rgb = pImageData + src.top*pitch + src.left*(pBitmapInfo->biBitCount>>3); - - D3DLOCKED_RECT r; - if(SUCCEEDED(m_pVideoSurfaceOff->LockRect(&r, src2, 0))) - { - BYTE* pBits = (BYTE*)r.pBits; - if(pBitmapInfo->biHeight > 0) {pBits += r.Pitch*(src.Height()-1); r.Pitch = -r.Pitch;} - BitBltFromRGBToRGB(src.Width(), src.Height(), pBits, r.Pitch, dbpp, rgb, pitch, pBitmapInfo->biBitCount); - m_pVideoSurfaceOff->UnlockRect(); - fRGB = true; - } - } - - if(!fRGB && !fYUY2) - { - m_pD3DDev->ColorFill(m_pVideoSurfaceOff, NULL, 0); - - HDC hDC; - if(SUCCEEDED(m_pVideoSurfaceOff->GetDC(&hDC))) - { - CString str; - str.Format(_T("Sorry, this format is not supported")); - - SetBkColor(hDC, 0); - SetTextColor(hDC, 0x404040); - TextOut(hDC, 10, 10, str, str.GetLength()); - - m_pVideoSurfaceOff->ReleaseDC(hDC); - - fRGB = true; - } - } - - HRESULT hr; - - if(fRGB) - hr = m_pD3DDev->StretchRect(m_pVideoSurfaceOff, src2, m_pVideoSurface[0], dst, D3DTEXF_NONE); - if(fYUY2) - hr = m_pD3DDev->StretchRect(m_pVideoSurfaceYUY2, src2, m_pVideoSurface[0], dst, D3DTEXF_NONE); - - Paint(true); - - return PNR_OK; -} - -STDMETHODIMP CRM9AllocatorPresenter::BeginOptimizedBlt(RMABitmapInfoHeader* pBitmapInfo) -{ - CAutoLock cAutoLock(this); - DeleteSurfaces(); - m_NativeVideoSize = m_AspectRatio = CSize(pBitmapInfo->biWidth, abs(pBitmapInfo->biHeight)); - if(FAILED(AllocSurfaces())) return E_FAIL; - return PNR_NOTIMPL; -} - -STDMETHODIMP CRM9AllocatorPresenter::OptimizedBlt(UCHAR* pImageBits, REF(PNxRect) rDestRect, REF(PNxRect) rSrcRect) -{ - return PNR_NOTIMPL; -} - -STDMETHODIMP CRM9AllocatorPresenter::EndOptimizedBlt() -{ - return PNR_NOTIMPL; -} - -STDMETHODIMP CRM9AllocatorPresenter::GetOptimizedFormat(REF(RMA_COMPRESSION_TYPE) ulType) -{ - return PNR_NOTIMPL; -} - -STDMETHODIMP CRM9AllocatorPresenter::GetPreferredFormat(REF(RMA_COMPRESSION_TYPE) ulType) -{ - ulType = RMA_I420; - return PNR_OK; -} - -// -// CQT9AllocatorPresenter -// - -CQT9AllocatorPresenter::CQT9AllocatorPresenter(HWND hWnd, HRESULT& hr) - : CDX9AllocatorPresenter(hWnd, hr) -{ -} - -STDMETHODIMP CQT9AllocatorPresenter::NonDelegatingQueryInterface(REFIID riid, void** ppv) -{ - CheckPointer(ppv, E_POINTER); - - return - QI(IQTVideoSurface) - __super::NonDelegatingQueryInterface(riid, ppv); -} - -HRESULT CQT9AllocatorPresenter::AllocSurfaces() -{ - HRESULT hr; - - m_pVideoSurfaceOff = NULL; - - if(FAILED(hr = m_pD3DDev->CreateOffscreenPlainSurface( - m_NativeVideoSize.cx, m_NativeVideoSize.cy, D3DFMT_X8R8G8B8, - D3DPOOL_DEFAULT, &m_pVideoSurfaceOff, NULL))) - return hr; - - return __super::AllocSurfaces(); -} - -void CQT9AllocatorPresenter::DeleteSurfaces() -{ - m_pVideoSurfaceOff = NULL; - - __super::DeleteSurfaces(); -} - -// IQTVideoSurface - -STDMETHODIMP CQT9AllocatorPresenter::BeginBlt(const BITMAP& bm) -{ - CAutoLock cAutoLock(this); - DeleteSurfaces(); - m_NativeVideoSize = m_AspectRatio = CSize(bm.bmWidth, abs(bm.bmHeight)); - if(FAILED(AllocSurfaces())) return E_FAIL; - return S_OK; -} - -STDMETHODIMP CQT9AllocatorPresenter::DoBlt(const BITMAP& bm) -{ - if(!m_pVideoSurface || !m_pVideoSurfaceOff) - return E_FAIL; - - bool fOk = false; - - D3DSURFACE_DESC d3dsd; - ZeroMemory(&d3dsd, sizeof(d3dsd)); - if(FAILED(m_pVideoSurfaceOff->GetDesc(&d3dsd))) - return E_FAIL; - - int w = bm.bmWidth; - int h = abs(bm.bmHeight); - int bpp = bm.bmBitsPixel; - int dbpp = - d3dsd.Format == D3DFMT_R8G8B8 || d3dsd.Format == D3DFMT_X8R8G8B8 || d3dsd.Format == D3DFMT_A8R8G8B8 ? 32 : - d3dsd.Format == D3DFMT_R5G6B5 ? 16 : 0; - - if((bpp == 16 || bpp == 24 || bpp == 32) && w == d3dsd.Width && h == d3dsd.Height) - { - D3DLOCKED_RECT r; - if(SUCCEEDED(m_pVideoSurfaceOff->LockRect(&r, NULL, 0))) - { - BitBltFromRGBToRGB( - w, h, - (BYTE*)r.pBits, r.Pitch, dbpp, - (BYTE*)bm.bmBits, bm.bmWidthBytes, bm.bmBitsPixel); - m_pVideoSurfaceOff->UnlockRect(); - fOk = true; - } - } - - if(!fOk) - { - m_pD3DDev->ColorFill(m_pVideoSurfaceOff, NULL, 0); - - HDC hDC; - if(SUCCEEDED(m_pVideoSurfaceOff->GetDC(&hDC))) - { - CString str; - str.Format(_T("Sorry, this color format is not supported")); - - SetBkColor(hDC, 0); - SetTextColor(hDC, 0x404040); - TextOut(hDC, 10, 10, str, str.GetLength()); - - m_pVideoSurfaceOff->ReleaseDC(hDC); - } - } - - m_pD3DDev->StretchRect(m_pVideoSurfaceOff, NULL, m_pVideoSurface[0], NULL, D3DTEXF_NONE); - - Paint(true); - - return S_OK; -} - -// -// CDXRAllocatorPresenter -// - -CDXRAllocatorPresenter::CDXRAllocatorPresenter(HWND hWnd, HRESULT& hr) - : ISubPicAllocatorPresenterImpl(hWnd, hr) -{ - if(FAILED(hr)) return; - - hr = S_OK; -} - -CDXRAllocatorPresenter::~CDXRAllocatorPresenter() -{ - if(m_pSRCB) - { - // nasty, but we have to let it know about our death somehow - ((CSubRenderCallback*)(ISubRenderCallback*)m_pSRCB)->SetDXRAP(NULL); - } - - // the order is important here - m_pSubPicQueue = NULL; - m_pAllocator = NULL; - m_pDXR = NULL; -} - -STDMETHODIMP CDXRAllocatorPresenter::NonDelegatingQueryInterface(REFIID riid, void** ppv) -{ -/* - if(riid == __uuidof(IVideoWindow)) - return GetInterface((IVideoWindow*)this, ppv); - if(riid == __uuidof(IBasicVideo)) - return GetInterface((IBasicVideo*)this, ppv); - if(riid == __uuidof(IBasicVideo2)) - return GetInterface((IBasicVideo2*)this, ppv); -*/ -/* - if(riid == __uuidof(IVMRWindowlessControl)) - return GetInterface((IVMRWindowlessControl*)this, ppv); -*/ - - if(riid != IID_IUnknown && m_pDXR) - { - if(SUCCEEDED(m_pDXR->QueryInterface(riid, ppv))) - return S_OK; - } - - return __super::NonDelegatingQueryInterface(riid, ppv); -} - -HRESULT CDXRAllocatorPresenter::SetDevice(IDirect3DDevice9* pD3DDev) -{ - CheckPointer(pD3DDev, E_POINTER); - - CSize size; - switch(AfxGetAppSettings().nSPCMaxRes) - { - // TODO: m_ScreenSize ? - // case 0: default: size = m_ScreenSize; break; - default: - case 1: size.SetSize(1024, 768); break; - case 2: size.SetSize(800, 600); break; - case 3: size.SetSize(640, 480); break; - case 4: size.SetSize(512, 384); break; - case 5: size.SetSize(384, 288); break; - } - - if(m_pAllocator) - { - m_pAllocator->ChangeDevice(pD3DDev); - } - else - { - m_pAllocator = new CDX9SubPicAllocator(pD3DDev, size, AfxGetAppSettings().fSPCPow2Tex); - if(!m_pAllocator) - return E_FAIL; - } - - HRESULT hr = S_OK; - - m_pSubPicQueue = AfxGetAppSettings().nSPCSize > 0 - ? (ISubPicQueue*)new CSubPicQueue(AfxGetAppSettings().nSPCSize, m_pAllocator, &hr) - : (ISubPicQueue*)new CSubPicQueueNoThread(m_pAllocator, &hr); - if(!m_pSubPicQueue || FAILED(hr)) - return E_FAIL; - - if(m_SubPicProvider) m_pSubPicQueue->SetSubPicProvider(m_SubPicProvider); - - return S_OK; -} - -HRESULT CDXRAllocatorPresenter::Render( - REFERENCE_TIME rtStart, REFERENCE_TIME rtStop, REFERENCE_TIME atpf, - int left, int top, int right, int bottom, int width, int height) -{ - __super::SetPosition(CRect(0, 0, width, height), CRect(left, top, right, bottom)); // needed? should be already set by the player - SetTime(rtStart); - if(atpf > 0 && m_pSubPicQueue) m_pSubPicQueue->SetFPS(10000000.0 / atpf); - AlphaBltSubPic(CSize(width, height)); - return S_OK; -} - -// ISubPicAllocatorPresenter - -STDMETHODIMP CDXRAllocatorPresenter::CreateRenderer(IUnknown** ppRenderer) -{ - CheckPointer(ppRenderer, E_POINTER); - - if(m_pDXR) return E_UNEXPECTED; - m_pDXR.CoCreateInstance(CLSID_DXR, GetOwner()); - if(!m_pDXR) return E_FAIL; - - CComQIPtr pSR = m_pDXR; - if(!pSR) {m_pDXR = NULL; return E_FAIL;} - - m_pSRCB = new CSubRenderCallback(this); - if(FAILED(pSR->SetCallback(m_pSRCB))) {m_pDXR = NULL; return E_FAIL;} - - (*ppRenderer = this)->AddRef(); - - return S_OK; -} - -STDMETHODIMP_(void) CDXRAllocatorPresenter::SetPosition(RECT w, RECT v) -{ - if(CComQIPtr pBV = m_pDXR) - { - pBV->SetDefaultSourcePosition(); - pBV->SetDestinationPosition(v.left, v.top, v.right - v.left, v.bottom - v.top); - } - - if(CComQIPtr pVW = m_pDXR) - { - pVW->SetWindowPosition(w.left, w.top, w.right - w.left, w.bottom - w.top); - } -} - -STDMETHODIMP_(SIZE) CDXRAllocatorPresenter::GetVideoSize(bool fCorrectAR) -{ - SIZE size = {0, 0}; - - if(!fCorrectAR) - { - if(CComQIPtr pBV = m_pDXR) - pBV->GetVideoSize(&size.cx, &size.cy); - } - else - { - if(CComQIPtr pBV2 = m_pDXR) - pBV2->GetPreferredAspectRatio(&size.cx, &size.cy); - } - - return size; -} - -STDMETHODIMP_(bool) CDXRAllocatorPresenter::Paint(bool fAll) -{ - return false; // TODO -} - -STDMETHODIMP CDXRAllocatorPresenter::GetDIB(BYTE* lpDib, DWORD* size) -{ - HRESULT hr = E_NOTIMPL; - if(CComQIPtr pBV = m_pDXR) - hr = pBV->GetCurrentImage((long*)size, (long*)lpDib); - return hr; -} - -STDMETHODIMP CDXRAllocatorPresenter::SetPixelShader(LPCSTR pSrcData, LPCSTR pTarget) -{ - return E_NOTIMPL; // TODO -} diff --git a/src/apps/mplayerc/DX9AllocatorPresenter.h b/src/apps/mplayerc/DX9AllocatorPresenter.h deleted file mode 100644 index 2ac4b1022..000000000 --- a/src/apps/mplayerc/DX9AllocatorPresenter.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#pragma once - -#include "..\..\SubPic\ISubPic.h" - -// {4E4834FA-22C2-40e2-9446-F77DD05D245E} -DEFINE_GUID(CLSID_VMR9AllocatorPresenter, -0x4e4834fa, 0x22c2, 0x40e2, 0x94, 0x46, 0xf7, 0x7d, 0xd0, 0x5d, 0x24, 0x5e); - -// {A1542F93-EB53-4e11-8D34-05C57ABA9207} -DEFINE_GUID(CLSID_RM9AllocatorPresenter, -0xa1542f93, 0xeb53, 0x4e11, 0x8d, 0x34, 0x5, 0xc5, 0x7a, 0xba, 0x92, 0x7); - -// {622A4032-70CE-4040-8231-0F24F2886618} -DEFINE_GUID(CLSID_QT9AllocatorPresenter, -0x622a4032, 0x70ce, 0x4040, 0x82, 0x31, 0xf, 0x24, 0xf2, 0x88, 0x66, 0x18); - -// {B72EBDD4-831D-440f-A656-B48F5486CD82} -DEFINE_GUID(CLSID_DXRAllocatorPresenter, -0xb72ebdd4, 0x831d, 0x440f, 0xa6, 0x56, 0xb4, 0x8f, 0x54, 0x86, 0xcd, 0x82); - -extern HRESULT CreateAP9(const CLSID& clsid, HWND hWnd, ISubPicAllocatorPresenter** ppAP); - -extern bool IsVMR9InGraph(IFilterGraph* pFG); - -// Support ffdshow queueing. -// This interface is used to check version of Media Player Classic. -// {A273C7F6-25D4-46b0-B2C8-4F7FADC44E37} -DEFINE_GUID(IID_IVMRffdshow9, -0xa273c7f6, 0x25d4, 0x46b0, 0xb2, 0xc8, 0x4f, 0x7f, 0xad, 0xc4, 0x4e, 0x37); - -MIDL_INTERFACE("A273C7F6-25D4-46b0-B2C8-4F7FADC44E37") -IVMRffdshow9 : public IUnknown -{ -public: - virtual STDMETHODIMP support_ffdshow(void) = 0; -}; - -extern CCritSec g_ffdshowReceive; -extern bool queueu_ffdshow_support; diff --git a/src/apps/mplayerc/DeinterlacerFilter.cpp b/src/apps/mplayerc/DeinterlacerFilter.cpp deleted file mode 100644 index 972b071aa..000000000 --- a/src/apps/mplayerc/DeinterlacerFilter.cpp +++ /dev/null @@ -1,123 +0,0 @@ -#include "stdafx.h" -#include ".\deinterlacerfilter.h" -#include "..\..\DSUtil\MediaTypes.h" -#include "..\..\..\include\moreuuids.h" - -CDeinterlacerFilter::CDeinterlacerFilter(LPUNKNOWN punk, HRESULT* phr) - : CTransformFilter(NAME("CDeinterlacerFilter"), punk, __uuidof(CDeinterlacerFilter)) -{ - if(phr) *phr = S_OK; -} - -HRESULT CDeinterlacerFilter::CheckConnect(PIN_DIRECTION dir, IPin* pPin) -{ - return GetCLSID(pPin) == __uuidof(*this) ? E_FAIL : S_OK; -} - -HRESULT CDeinterlacerFilter::CheckInputType(const CMediaType* mtIn) -{ - BITMAPINFOHEADER bih; - if(!ExtractBIH(mtIn, &bih) /*|| bih.biHeight <= 0*/ || bih.biHeight <= 288) - return E_FAIL; - - return mtIn->subtype == MEDIASUBTYPE_YUY2 || mtIn->subtype == MEDIASUBTYPE_UYVY - || mtIn->subtype == MEDIASUBTYPE_I420 || mtIn->subtype == MEDIASUBTYPE_YV12 || mtIn->subtype == MEDIASUBTYPE_IYUV - ? S_OK - : E_FAIL; -} - -HRESULT CDeinterlacerFilter::CheckTransform(const CMediaType* mtIn, const CMediaType* mtOut) -{ - return mtIn->subtype == mtOut->subtype ? S_OK : E_FAIL; -} - -HRESULT CDeinterlacerFilter::Transform(IMediaSample* pIn, IMediaSample* pOut) -{ - HRESULT hr; - - AM_MEDIA_TYPE* pmt = NULL; - if(SUCCEEDED(pOut->GetMediaType(&pmt)) && pmt) - { - CMediaType mt = *pmt; - m_pOutput->SetMediaType(&mt); - DeleteMediaType(pmt); - } - - BYTE* pDataIn = NULL; - if(FAILED(pIn->GetPointer(&pDataIn)) || !pDataIn) - return S_FALSE; - - BYTE* pDataOut = NULL; - if(FAILED(hr = pOut->GetPointer(&pDataOut)) || !pDataOut) - return hr; - - const CMediaType& mtIn = m_pInput->CurrentMediaType(); - const CMediaType& mtOut = m_pOutput->CurrentMediaType(); - - BITMAPINFOHEADER bihIn, bihOut; - ExtractBIH(&mtIn, &bihIn); - ExtractBIH(&mtOut, &bihOut); - - bool fInputFlipped = bihIn.biHeight >= 0 && bihIn.biCompression <= 3; - bool fOutputFlipped = bihOut.biHeight >= 0 && bihOut.biCompression <= 3; - bool fFlip = fInputFlipped != fOutputFlipped; - - int bppIn = !(bihIn.biBitCount&7) ? bihIn.biBitCount : 8; - int bppOut = !(bihOut.biBitCount&7) ? bihOut.biBitCount : 8; - int pitchIn = bihIn.biWidth*bppIn>>3; - int pitchOut = bihOut.biWidth*bppOut>>3; - BYTE* pDataOut2 = pDataOut; - if(fFlip) {pDataOut2 += pitchOut*(bihIn.biHeight-1); pitchOut = -pitchOut;} - - if(mtIn.subtype == MEDIASUBTYPE_YUY2 || mtIn.subtype == MEDIASUBTYPE_UYVY) - { - DeinterlaceBlend(pDataOut, pDataIn, pitchIn, bihIn.biHeight, pitchOut, pitchIn); - } - else if(mtIn.subtype == MEDIASUBTYPE_I420 || mtIn.subtype == MEDIASUBTYPE_YV12 || mtIn.subtype == MEDIASUBTYPE_IYUV) - { - DeinterlaceBlend(pDataOut, pDataIn, pitchIn, bihIn.biHeight, pitchOut, pitchIn); - - int sizeIn = bihIn.biHeight*pitchIn, sizeOut = abs(bihOut.biHeight)*pitchOut; - pitchIn /= 2; pitchOut /= 2; - bihIn.biHeight /= 2; - pDataIn += sizeIn; pDataOut += sizeOut; - DeinterlaceBlend(pDataOut, pDataIn, pitchIn, bihIn.biHeight, pitchOut, pitchIn); - - pDataIn += sizeIn/4; pDataOut += sizeOut/4; - DeinterlaceBlend(pDataOut, pDataIn, pitchIn, bihIn.biHeight, pitchOut, pitchIn); - } - - return S_OK; -} - -HRESULT CDeinterlacerFilter::DecideBufferSize(IMemAllocator* pAllocator, ALLOCATOR_PROPERTIES* pProperties) -{ - if(m_pInput->IsConnected() == FALSE) return E_UNEXPECTED; - - BITMAPINFOHEADER bih; - ExtractBIH(&m_pOutput->CurrentMediaType(), &bih); - - pProperties->cBuffers = 1; - pProperties->cbBuffer = bih.biSizeImage; - pProperties->cbAlign = 1; - pProperties->cbPrefix = 0; - - HRESULT hr; - ALLOCATOR_PROPERTIES Actual; - if(FAILED(hr = pAllocator->SetProperties(pProperties, &Actual))) - return hr; - - return pProperties->cBuffers > Actual.cBuffers || pProperties->cbBuffer > Actual.cbBuffer - ? E_FAIL - : NOERROR; -} - -HRESULT CDeinterlacerFilter::GetMediaType(int iPosition, CMediaType* pmt) -{ - if(m_pInput->IsConnected() == FALSE) return E_UNEXPECTED; - if(iPosition < 0) return E_INVALIDARG; - if(iPosition > 0) return VFW_S_NO_MORE_ITEMS; - *pmt = m_pInput->CurrentMediaType(); - CorrectMediaType(pmt); - return S_OK; -} \ No newline at end of file diff --git a/src/apps/mplayerc/DeinterlacerFilter.h b/src/apps/mplayerc/DeinterlacerFilter.h deleted file mode 100644 index d1c441ec6..000000000 --- a/src/apps/mplayerc/DeinterlacerFilter.h +++ /dev/null @@ -1,16 +0,0 @@ -#pragma once - -[uuid("96F3E0BE-1BA4-4E79-973D-191FE425C86B")] -class CDeinterlacerFilter : public CTransformFilter -{ -protected: - HRESULT CDeinterlacerFilter::CheckConnect(PIN_DIRECTION dir, IPin* pPin); - HRESULT CheckInputType(const CMediaType* mtIn); - HRESULT CheckTransform(const CMediaType* mtIn, const CMediaType* mtOut); - HRESULT Transform(IMediaSample* pIn, IMediaSample* pOut); - HRESULT DecideBufferSize(IMemAllocator* pAllocator, ALLOCATOR_PROPERTIES* pProperties); - HRESULT GetMediaType(int iPosition, CMediaType* pmt); - -public: - CDeinterlacerFilter(LPUNKNOWN punk, HRESULT* phr); -}; diff --git a/src/apps/mplayerc/FGFilter.cpp b/src/apps/mplayerc/FGFilter.cpp deleted file mode 100644 index 1ebae6cdc..000000000 --- a/src/apps/mplayerc/FGFilter.cpp +++ /dev/null @@ -1,621 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include "stdafx.h" -#include "FGFilter.h" -#include "..\..\DSUtil\DSUtil.h" -#include "DX7AllocatorPresenter.h" -#include "DX9AllocatorPresenter.h" -#include "..\..\..\include\moreuuids.h" - -// -// CFGFilter -// - -CFGFilter::CFGFilter(const CLSID& clsid, CStringW name, UINT64 merit) - : m_clsid(clsid) - , m_name(name) -{ - m_merit.val = merit; -} - -const CAtlList& CFGFilter::GetTypes() const -{ - return m_types; -} - -void CFGFilter::SetTypes(const CAtlList& types) -{ - m_types.RemoveAll(); - m_types.AddTailList(&types); -} - -void CFGFilter::AddType(const GUID& majortype, const GUID& subtype) -{ - m_types.AddTail(majortype); - m_types.AddTail(subtype); -} - -bool CFGFilter::CheckTypes(const CAtlArray& types, bool fExactMatch) -{ - POSITION pos = m_types.GetHeadPosition(); - while(pos) - { - const GUID& majortype = m_types.GetNext(pos); - if(!pos) {ASSERT(0); break;} - const GUID& subtype = m_types.GetNext(pos); - - for(int i = 0, len = types.GetCount() & ~1; i < len; i += 2) - { - if(fExactMatch) - { - if(majortype == types[i] && majortype != GUID_NULL - && subtype == types[i+1] && subtype != GUID_NULL) - return true; - } - else - { - if((majortype == GUID_NULL || types[i] == GUID_NULL || majortype == types[i]) - && (subtype == GUID_NULL || types[i+1] == GUID_NULL || subtype == types[i+1])) - return true; - } - } - } - - return false; -} - -// -// CFGFilterRegistry -// - -CFGFilterRegistry::CFGFilterRegistry(IMoniker* pMoniker, UINT64 merit) - : CFGFilter(GUID_NULL, L"", merit) - , m_pMoniker(pMoniker) -{ - if(!m_pMoniker) return; - - LPOLESTR str = NULL; - if(FAILED(m_pMoniker->GetDisplayName(0, 0, &str))) return; - m_DisplayName = m_name = str; - CoTaskMemFree(str), str = NULL; - - CComPtr pPB; - if(SUCCEEDED(m_pMoniker->BindToStorage(0, 0, IID_IPropertyBag, (void**)&pPB))) - { - CComVariant var; - if(SUCCEEDED(pPB->Read(CComBSTR(_T("FriendlyName")), &var, NULL))) - { - m_name = var.bstrVal; - var.Clear(); - } - - if(SUCCEEDED(pPB->Read(CComBSTR(_T("CLSID")), &var, NULL))) - { - CLSIDFromString(var.bstrVal, &m_clsid); - var.Clear(); - } - - if(SUCCEEDED(pPB->Read(CComBSTR(_T("FilterData")), &var, NULL))) - { - BSTR* pstr; - if(SUCCEEDED(SafeArrayAccessData(var.parray, (void**)&pstr))) - { - ExtractFilterData((BYTE*)pstr, var.parray->cbElements*(var.parray->rgsabound[0].cElements)); - SafeArrayUnaccessData(var.parray); - } - - var.Clear(); - } - } - - if(merit != MERIT64_DO_USE) m_merit.val = merit; -} - -CFGFilterRegistry::CFGFilterRegistry(CStringW DisplayName, UINT64 merit) - : CFGFilter(GUID_NULL, L"", merit) - , m_DisplayName(DisplayName) -{ - if(m_DisplayName.IsEmpty()) return; - - CComPtr pBC; - CreateBindCtx(0, &pBC); - - ULONG chEaten; - if(S_OK != MkParseDisplayName(pBC, CComBSTR(m_DisplayName), &chEaten, &m_pMoniker)) - return; - - CComPtr pPB; - if(SUCCEEDED(m_pMoniker->BindToStorage(0, 0, IID_IPropertyBag, (void**)&pPB))) - { - CComVariant var; - if(SUCCEEDED(pPB->Read(CComBSTR(_T("FriendlyName")), &var, NULL))) - { - m_name = var.bstrVal; - var.Clear(); - } - - if(SUCCEEDED(pPB->Read(CComBSTR(_T("CLSID")), &var, NULL))) - { - CLSIDFromString(var.bstrVal, &m_clsid); - var.Clear(); - } - - if(SUCCEEDED(pPB->Read(CComBSTR(_T("FilterData")), &var, NULL))) - { - BSTR* pstr; - if(SUCCEEDED(SafeArrayAccessData(var.parray, (void**)&pstr))) - { - ExtractFilterData((BYTE*)pstr, var.parray->cbElements*(var.parray->rgsabound[0].cElements)); - SafeArrayUnaccessData(var.parray); - } - - var.Clear(); - } - } - - if(merit != MERIT64_DO_USE) m_merit.val = merit; -} - -CFGFilterRegistry::CFGFilterRegistry(const CLSID& clsid, UINT64 merit) - : CFGFilter(clsid, L"", merit) -{ - if(m_clsid == GUID_NULL) return; - - CString guid = CStringFromGUID(m_clsid); - - CRegKey key; - - if(ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, _T("CLSID\\") + guid, KEY_READ)) - { - ULONG nChars = 0; - if(ERROR_SUCCESS == key.QueryStringValue(NULL, NULL, &nChars)) - { - CString name; - if(ERROR_SUCCESS == key.QueryStringValue(NULL, name.GetBuffer(nChars), &nChars)) - { - name.ReleaseBuffer(nChars); - m_name = name; - } - } - - key.Close(); - } - - CRegKey catkey; - - if(ERROR_SUCCESS == catkey.Open(HKEY_CLASSES_ROOT, _T("CLSID\\{083863F1-70DE-11d0-BD40-00A0C911CE86}\\Instance"), KEY_READ)) - { - if(ERROR_SUCCESS != key.Open(catkey, guid, KEY_READ)) - { - // illiminable pack uses the name of the filter and not the clsid, have to enum all keys to find it... - - FILETIME ft; - TCHAR buff[256]; - DWORD len = countof(buff); - for(DWORD i = 0; ERROR_SUCCESS == catkey.EnumKey(i, buff, &len, &ft); i++, len = countof(buff)) - { - if(ERROR_SUCCESS == key.Open(catkey, buff, KEY_READ)) - { - TCHAR clsid[256]; - len = countof(clsid); - if(ERROR_SUCCESS == key.QueryStringValue(_T("CLSID"), clsid, &len) && GUIDFromCString(clsid) == m_clsid) - break; - - key.Close(); - } - } - } - - if(key) - { - ULONG nChars = 0; - if(ERROR_SUCCESS == key.QueryStringValue(_T("FriendlyName"), NULL, &nChars)) - { - CString name; - if(ERROR_SUCCESS == key.QueryStringValue(_T("FriendlyName"), name.GetBuffer(nChars), &nChars)) - { - name.ReleaseBuffer(nChars); - m_name = name; - } - } - - ULONG nBytes = 0; - if(ERROR_SUCCESS == key.QueryBinaryValue(_T("FilterData"), NULL, &nBytes)) - { - CAutoVectorPtr buff; - if(buff.Allocate(nBytes) && ERROR_SUCCESS == key.QueryBinaryValue(_T("FilterData"), buff, &nBytes)) - { - ExtractFilterData(buff, nBytes); - } - } - - key.Close(); - } - } - - if(merit != MERIT64_DO_USE) m_merit.val = merit; -} - -HRESULT CFGFilterRegistry::Create(IBaseFilter** ppBF, CInterfaceList& pUnks) -{ - CheckPointer(ppBF, E_POINTER); - - HRESULT hr = E_FAIL; - - if(m_pMoniker) - { - if(SUCCEEDED(hr = m_pMoniker->BindToObject(0, 0, IID_IBaseFilter, (void**)ppBF))) - { - m_clsid = ::GetCLSID(*ppBF); - } - } - else if(m_clsid != GUID_NULL) - { - CComQIPtr pBF; - - if(FAILED(pBF.CoCreateInstance(m_clsid))) - return E_FAIL; - - *ppBF = pBF.Detach(); - - hr = S_OK; - } - - return hr; -}; - -[uuid("97f7c4d4-547b-4a5f-8332-536430ad2e4d")] -interface IAMFilterData : public IUnknown -{ - STDMETHOD (ParseFilterData) (BYTE* rgbFilterData, ULONG cb, BYTE** prgbRegFilter2) PURE; - STDMETHOD (CreateFilterData) (REGFILTER2* prf2, BYTE** prgbFilterData, ULONG* pcb) PURE; -}; - -void CFGFilterRegistry::ExtractFilterData(BYTE* p, UINT len) -{ - CComPtr pFD; - BYTE* ptr = NULL; - - if(SUCCEEDED(pFD.CoCreateInstance(CLSID_FilterMapper2)) - && SUCCEEDED(pFD->ParseFilterData(p, len, (BYTE**)&ptr))) - { - REGFILTER2* prf = (REGFILTER2*)*(DWORD*)ptr; // this is f*cked up - - m_merit.mid = prf->dwMerit; - - if(prf->dwVersion == 1) - { - for(UINT i = 0; i < prf->cPins; i++) - { - if(prf->rgPins[i].bOutput) - continue; - - for(UINT j = 0; j < prf->rgPins[i].nMediaTypes; j++) - { - if(!prf->rgPins[i].lpMediaType[j].clsMajorType || !prf->rgPins[i].lpMediaType[j].clsMinorType) - break; - - const REGPINTYPES& rpt = prf->rgPins[i].lpMediaType[j]; - AddType(*rpt.clsMajorType, *rpt.clsMinorType); - } - } - } - else if(prf->dwVersion == 2) - { - for(UINT i = 0; i < prf->cPins2; i++) - { - if(prf->rgPins2[i].dwFlags®_PINFLAG_B_OUTPUT) - continue; - - for(UINT j = 0; j < prf->rgPins2[i].nMediaTypes; j++) - { - if(!prf->rgPins2[i].lpMediaType[j].clsMajorType || !prf->rgPins2[i].lpMediaType[j].clsMinorType) - break; - - const REGPINTYPES& rpt = prf->rgPins2[i].lpMediaType[j]; - AddType(*rpt.clsMajorType, *rpt.clsMinorType); - } - } - } - - CoTaskMemFree(prf); - } - else - { - BYTE* base = p; - - #define ChkLen(size) if(p - base + size > (int)len) return; - - ChkLen(4) - if(*(DWORD*)p != 0x00000002) return; // only version 2 supported, no samples found for 1 - p += 4; - - ChkLen(4) - m_merit.mid = *(DWORD*)p; p += 4; - - m_types.RemoveAll(); - - ChkLen(8) - DWORD nPins = *(DWORD*)p; p += 8; - while(nPins-- > 0) - { - ChkLen(1) - BYTE n = *p-0x30; p++; - - ChkLen(2) - WORD pi = *(WORD*)p; p += 2; - ASSERT(pi == 'ip'); - - ChkLen(1) - BYTE x33 = *p; p++; - ASSERT(x33 == 0x33); - - ChkLen(8) - bool fOutput = !!(*p®_PINFLAG_B_OUTPUT); - p += 8; - - ChkLen(12) - DWORD nTypes = *(DWORD*)p; p += 12; - while(nTypes-- > 0) - { - ChkLen(1) - BYTE n = *p-0x30; p++; - - ChkLen(2) - WORD ty = *(WORD*)p; p += 2; - ASSERT(ty == 'yt'); - - ChkLen(5) - BYTE x33 = *p; p++; - ASSERT(x33 == 0x33); - p += 4; - - ChkLen(8) - if(*(DWORD*)p < (p-base+8) || *(DWORD*)p >= len - || *(DWORD*)(p+4) < (p-base+8) || *(DWORD*)(p+4) >= len) - { - p += 8; - continue; - } - - GUID majortype, subtype; - memcpy(&majortype, &base[*(DWORD*)p], sizeof(GUID)); p += 4; - if(!fOutput) AddType(majortype, subtype); - } - } - - #undef ChkLen - } -} - -// -// CFGFilterFile -// - -CFGFilterFile::CFGFilterFile(const CLSID& clsid, CString path, CStringW name, UINT64 merit) - : CFGFilter(clsid, name, merit) - , m_path(path) - , m_hInst(NULL) -{ -} - -HRESULT CFGFilterFile::Create(IBaseFilter** ppBF, CInterfaceList& pUnks) -{ - CheckPointer(ppBF, E_POINTER); - - return LoadExternalFilter(m_path, m_clsid, ppBF); -} - -// -// CFGFilterVideoRenderer -// - -CFGFilterVideoRenderer::CFGFilterVideoRenderer(HWND hWnd, const CLSID& clsid, CStringW name, UINT64 merit) - : CFGFilter(clsid, name, merit) - , m_hWnd(hWnd) -{ - AddType(MEDIATYPE_Video, MEDIASUBTYPE_NULL); -} - -HRESULT CFGFilterVideoRenderer::Create(IBaseFilter** ppBF, CInterfaceList& pUnks) -{ - CheckPointer(ppBF, E_POINTER); - - HRESULT hr = S_OK; - - CComPtr pCAP; - - if(m_clsid == CLSID_VMR7AllocatorPresenter - || m_clsid == CLSID_VMR9AllocatorPresenter - || m_clsid == CLSID_DXRAllocatorPresenter) - { - if(SUCCEEDED(CreateAP7(m_clsid, m_hWnd, &pCAP)) - || SUCCEEDED(CreateAP9(m_clsid, m_hWnd, &pCAP))) - { - CComPtr pRenderer; - if(SUCCEEDED(hr = pCAP->CreateRenderer(&pRenderer))) - { - *ppBF = CComQIPtr(pRenderer).Detach(); - pUnks.AddTail(pCAP); - } - } - } - else - { - CComPtr pBF; - if(SUCCEEDED(pBF.CoCreateInstance(m_clsid))) - { - BeginEnumPins(pBF, pEP, pPin) - { - if(CComQIPtr pMPC = pPin) - { - pUnks.AddTail(pMPC); - break; - } - } - EndEnumPins - - *ppBF = pBF.Detach(); - } - } - - if(!*ppBF) hr = E_FAIL; - - return hr; -} - -// -// CFGFilterList -// - -CFGFilterList::CFGFilterList() -{ -} - -CFGFilterList::~CFGFilterList() -{ - RemoveAll(); -} - -void CFGFilterList::RemoveAll() -{ - while(!m_filters.IsEmpty()) - { - const filter_t& f = m_filters.RemoveHead(); - if(f.autodelete) delete f.pFGF; - } - - m_sortedfilters.RemoveAll(); -} - -void CFGFilterList::Insert(CFGFilter* pFGF, int group, bool exactmatch, bool autodelete) -{ - if(CFGFilterRegistry* f1r = dynamic_cast(pFGF)) - { - POSITION pos = m_filters.GetHeadPosition(); - while(pos) - { - filter_t& f2 = m_filters.GetNext(pos); - - if(group != f2.group) continue; - - if(CFGFilterRegistry* f2r = dynamic_cast(f2.pFGF)) - { - if(f1r->GetMoniker() && f2r->GetMoniker() && S_OK == f1r->GetMoniker()->IsEqual(f2r->GetMoniker()) - || f1r->GetCLSID() != GUID_NULL && f1r->GetCLSID() == f2r->GetCLSID()) - { - TRACE(_T("FGM: Inserting %d %d %016I64x '%s' NOT!\n"), - group, exactmatch, pFGF->GetMerit(), - pFGF->GetName().IsEmpty() ? CStringFromGUID(pFGF->GetCLSID()) : CString(pFGF->GetName())); - - if(autodelete) delete pFGF; - return; - } - } - } - } - - POSITION pos = m_filters.GetHeadPosition(); - while(pos) - { - if(m_filters.GetNext(pos).pFGF == pFGF) - { - TRACE(_T("FGM: Inserting %d %d %016I64x '%s' DUP!\n"), - group, exactmatch, pFGF->GetMerit(), - pFGF->GetName().IsEmpty() ? CStringFromGUID(pFGF->GetCLSID()) : CString(pFGF->GetName())); - - if(autodelete) delete pFGF; - return; - } - } - - TRACE(_T("FGM: Inserting %d %d %016I64x '%s'\n"), - group, exactmatch, pFGF->GetMerit(), - pFGF->GetName().IsEmpty() ? CStringFromGUID(pFGF->GetCLSID()) : CString(pFGF->GetName())); - - filter_t f = {m_filters.GetCount(), pFGF, group, exactmatch, autodelete}; - m_filters.AddTail(f); - - m_sortedfilters.RemoveAll(); -} - -POSITION CFGFilterList::GetHeadPosition() -{ - if(m_sortedfilters.IsEmpty()) - { - CAtlArray sort; - sort.SetCount(m_filters.GetCount()); - POSITION pos = m_filters.GetHeadPosition(); - for(int i = 0; pos; i++) sort[i] = m_filters.GetNext(pos); - qsort(&sort[0], sort.GetCount(), sizeof(sort[0]), filter_cmp); - for(size_t i = 0; i < sort.GetCount(); i++) - if(sort[i].pFGF->GetMerit() >= MERIT64_DO_USE) - m_sortedfilters.AddTail(sort[i].pFGF); - } - - TRACE(_T("FGM: Sorting filters\n")); - - POSITION pos = m_sortedfilters.GetHeadPosition(); - while(pos) - { - CFGFilter* pFGF = m_sortedfilters.GetNext(pos); - TRACE(_T("FGM: - %016I64x '%s'\n"), pFGF->GetMerit(), pFGF->GetName().IsEmpty() ? CStringFromGUID(pFGF->GetCLSID()) : CString(pFGF->GetName())); - } - - return m_sortedfilters.GetHeadPosition(); -} - -CFGFilter* CFGFilterList::GetNext(POSITION& pos) -{ - return m_sortedfilters.GetNext(pos); -} - -int CFGFilterList::filter_cmp(const void* a, const void* b) -{ - filter_t* fa = (filter_t*)a; - filter_t* fb = (filter_t*)b; - - if(fa->group < fb->group) return -1; - if(fa->group > fb->group) return +1; - - if(fa->pFGF->GetCLSID() == fb->pFGF->GetCLSID()) - { - CFGFilterFile* fgfa = dynamic_cast(fa->pFGF); - CFGFilterFile* fgfb = dynamic_cast(fb->pFGF); - - if(fgfa && !fgfb) return -1; - if(!fgfa && fgfb) return +1; - } - - if(fa->pFGF->GetMerit() > fb->pFGF->GetMerit()) return -1; - if(fa->pFGF->GetMerit() < fb->pFGF->GetMerit()) return +1; - - if(fa->exactmatch && !fb->exactmatch) return -1; - if(!fa->exactmatch && fb->exactmatch) return +1; - - if(fa->index < fb->index) return -1; - if(fa->index > fb->index) return +1; - - return 0; -} - - diff --git a/src/apps/mplayerc/FGFilter.h b/src/apps/mplayerc/FGFilter.h deleted file mode 100644 index 0a8d025ef..000000000 --- a/src/apps/mplayerc/FGFilter.h +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#pragma once - -#define MERIT64(merit) (((UINT64)(merit))<<16) -#define MERIT64_DO_NOT_USE MERIT64(MERIT_DO_NOT_USE) -#define MERIT64_DO_USE MERIT64(MERIT_DO_NOT_USE+1) -#define MERIT64_UNLIKELY (MERIT64(MERIT_UNLIKELY)) -#define MERIT64_NORMAL (MERIT64(MERIT_NORMAL)) -#define MERIT64_PREFERRED (MERIT64(MERIT_PREFERRED)) -#define MERIT64_ABOVE_DSHOW (MERIT64(1)<<32) - -class CFGFilter -{ -protected: - CLSID m_clsid; - CStringW m_name; - struct {union {UINT64 val; struct {UINT64 low:16, mid:32, high:16;};};} m_merit; - CAtlList m_types; - -public: - CFGFilter(const CLSID& clsid, CStringW name = L"", UINT64 merit = MERIT64_DO_USE); - virtual ~CFGFilter() {} - - CLSID GetCLSID() {return m_clsid;} - CStringW GetName() {return m_name;} - UINT64 GetMerit() {return m_merit.val;} - DWORD GetMeritForDirectShow() {return m_merit.mid;} - const CAtlList& GetTypes() const; - void SetTypes(const CAtlList& types); - void AddType(const GUID& majortype, const GUID& subtype); - bool CheckTypes(const CAtlArray& types, bool fExactMatch); - - CAtlList m_protocols, m_extensions, m_chkbytes; // TODO: subtype? - - virtual HRESULT Create(IBaseFilter** ppBF, CInterfaceList& pUnks) = 0; -}; - -class CFGFilterRegistry : public CFGFilter -{ -protected: - CStringW m_DisplayName; - CComPtr m_pMoniker; - - void ExtractFilterData(BYTE* p, UINT len); - -public: - CFGFilterRegistry(IMoniker* pMoniker, UINT64 merit = MERIT64_DO_USE); - CFGFilterRegistry(CStringW DisplayName, UINT64 merit = MERIT64_DO_USE); - CFGFilterRegistry(const CLSID& clsid, UINT64 merit = MERIT64_DO_USE); - - CStringW GetDisplayName() {return m_DisplayName;} - IMoniker* GetMoniker() {return m_pMoniker;} - - HRESULT Create(IBaseFilter** ppBF, CInterfaceList& pUnks); -}; - -template -class CFGFilterInternal : public CFGFilter -{ -public: - CFGFilterInternal(CStringW name = L"", UINT64 merit = MERIT64_DO_USE) : CFGFilter(__uuidof(T), name, merit) {} - - HRESULT Create(IBaseFilter** ppBF, CInterfaceList& pUnks) - { - CheckPointer(ppBF, E_POINTER); - - HRESULT hr = S_OK; - CComPtr pBF = new T(NULL, &hr); - if(FAILED(hr)) return hr; - - *ppBF = pBF.Detach(); - - return hr; - } -}; - -class CFGFilterFile : public CFGFilter -{ -protected: - CString m_path; - HINSTANCE m_hInst; - -public: - CFGFilterFile(const CLSID& clsid, CString path, CStringW name = L"", UINT64 merit = MERIT64_DO_USE); - - HRESULT Create(IBaseFilter** ppBF, CInterfaceList& pUnks); -}; - -class CFGFilterVideoRenderer : public CFGFilter -{ -protected: - HWND m_hWnd; - -public: - CFGFilterVideoRenderer(HWND hWnd, const CLSID& clsid, CStringW name = L"", UINT64 merit = MERIT64_DO_USE); - - HRESULT Create(IBaseFilter** ppBF, CInterfaceList& pUnks); -}; - -class CFGFilterList -{ - struct filter_t {int index; CFGFilter* pFGF; int group; bool exactmatch, autodelete;}; - static int filter_cmp(const void* a, const void* b); - CAtlList m_filters; - CAtlList m_sortedfilters; - -public: - CFGFilterList(); - virtual ~CFGFilterList(); - - bool IsEmpty() {return m_filters.IsEmpty();} - void RemoveAll(); - void Insert(CFGFilter* pFGF, int group, bool exactmatch = false, bool autodelete = true); - - POSITION GetHeadPosition(); - CFGFilter* GetNext(POSITION& pos); -}; diff --git a/src/apps/mplayerc/FGManager.cpp b/src/apps/mplayerc/FGManager.cpp deleted file mode 100644 index a589ae337..000000000 --- a/src/apps/mplayerc/FGManager.cpp +++ /dev/null @@ -1,2067 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include "stdafx.h" -#include "mplayerc.h" -#include "FGManager.h" -#include "..\..\DSUtil\DSUtil.h" -#include "..\..\Filters\Filters.h" -#include "DX7AllocatorPresenter.h" -#include "DX9AllocatorPresenter.h" -#include "DeinterlacerFilter.h" -#include -#include "..\..\..\include\moreuuids.h" -#include -#include -#include - -// -// CFGManager -// - -CFGManager::CFGManager(LPCTSTR pName, LPUNKNOWN pUnk) - : CUnknown(pName, pUnk) - , m_dwRegister(0) -{ - m_pUnkInner.CoCreateInstance(CLSID_FilterGraph, GetOwner()); - m_pFM.CoCreateInstance(CLSID_FilterMapper2); -} - -CFGManager::~CFGManager() -{ - CAutoLock cAutoLock(this); - while(!m_source.IsEmpty()) delete m_source.RemoveHead(); - while(!m_transform.IsEmpty()) delete m_transform.RemoveHead(); - while(!m_override.IsEmpty()) delete m_override.RemoveHead(); - m_pUnks.RemoveAll(); - m_pUnkInner.Release(); -} - -STDMETHODIMP CFGManager::NonDelegatingQueryInterface(REFIID riid, void** ppv) -{ - CheckPointer(ppv, E_POINTER); - - return - QI(IFilterGraph) - QI(IGraphBuilder) - QI(IFilterGraph2) - QI(IGraphBuilder2) - QI(IGraphBuilderDeadEnd) - m_pUnkInner && (riid != IID_IUnknown && SUCCEEDED(m_pUnkInner->QueryInterface(riid, ppv))) ? S_OK : - __super::NonDelegatingQueryInterface(riid, ppv); -} - -// - -void CFGManager::CStreamPath::Append(IBaseFilter* pBF, IPin* pPin) -{ - path_t p; - p.clsid = GetCLSID(pBF); - p.filter = GetFilterName(pBF); - p.pin = GetPinName(pPin); - AddTail(p); -} - -bool CFGManager::CStreamPath::Compare(const CStreamPath& path) -{ - POSITION pos1 = GetHeadPosition(); - POSITION pos2 = path.GetHeadPosition(); - - while(pos1 && pos2) - { - const path_t& p1 = GetNext(pos1); - const path_t& p2 = path.GetNext(pos2); - - if(p1.filter != p2.filter) return true; - else if(p1.pin != p2.pin) return false; - } - - return true; -} - -// - -bool CFGManager::CheckBytes(HANDLE hFile, CString chkbytes) -{ - CAtlList sl; - Explode(chkbytes, sl, ','); - - if(sl.GetCount() < 4) - return false; - - ASSERT(!(sl.GetCount()&3)); - - LARGE_INTEGER size = {0, 0}; - size.LowPart = GetFileSize(hFile, (DWORD*)&size.HighPart); - - POSITION pos = sl.GetHeadPosition(); - while(sl.GetCount() >= 4) - { - CString offsetstr = sl.RemoveHead(); - CString cbstr = sl.RemoveHead(); - CString maskstr = sl.RemoveHead(); - CString valstr = sl.RemoveHead(); - - long cb = _ttol(cbstr); - - if(offsetstr.IsEmpty() || cbstr.IsEmpty() - || valstr.IsEmpty() || (valstr.GetLength() & 1) - || cb*2 != valstr.GetLength()) - return false; - - LARGE_INTEGER offset; - offset.QuadPart = _ttoi64(offsetstr); - if(offset.QuadPart < 0) offset.QuadPart = size.QuadPart - offset.QuadPart; - SetFilePointer(hFile, offset.LowPart, &offset.HighPart, FILE_BEGIN); - - // LAME - while(maskstr.GetLength() < valstr.GetLength()) - maskstr += 'F'; - - CAtlArray mask, val; - CStringToBin(maskstr, mask); - CStringToBin(valstr, val); - - for(size_t i = 0; i < val.GetCount(); i++) - { - BYTE b; - DWORD r; - if(!ReadFile(hFile, &b, 1, &r, NULL) || (b & mask[i]) != val[i]) - return false; - } - } - - return sl.IsEmpty(); -} - -HRESULT CFGManager::EnumSourceFilters(LPCWSTR lpcwstrFileName, CFGFilterList& fl) -{ - // TODO: use overrides - - CheckPointer(lpcwstrFileName, E_POINTER); - - fl.RemoveAll(); - - CStringW fn = CStringW(lpcwstrFileName).TrimLeft(); - CStringW protocol = fn.Left(fn.Find(':')+1).TrimRight(':').MakeLower(); - CStringW ext = CPathW(fn).GetExtension().MakeLower(); - - HANDLE hFile = INVALID_HANDLE_VALUE; - - if(protocol.GetLength() <= 1 || protocol == L"file") - { - hFile = CreateFile(CString(fn), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, (HANDLE)NULL); - - if(hFile == INVALID_HANDLE_VALUE) - { - return VFW_E_NOT_FOUND; - } - } - - // exceptions first - - if(ext == _T(".dvr-ms")) // doh, this is stupid - { - fl.Insert(new CFGFilterRegistry(CLSID_StreamBufferSource, MERIT64_PREFERRED), 0); - } - - TCHAR buff[256], buff2[256]; - ULONG len, len2; - - if(hFile == INVALID_HANDLE_VALUE) - { - // internal / protocol - - POSITION pos = m_source.GetHeadPosition(); - while(pos) - { - CFGFilter* pFGF = m_source.GetNext(pos); - if(pFGF->m_protocols.Find(CString(protocol))) - fl.Insert(pFGF, 0, false, false); - } - } - else - { - // internal / check bytes - - POSITION pos = m_source.GetHeadPosition(); - while(pos) - { - CFGFilter* pFGF = m_source.GetNext(pos); - - POSITION pos2 = pFGF->m_chkbytes.GetHeadPosition(); - while(pos2) - { - if(CheckBytes(hFile, pFGF->m_chkbytes.GetNext(pos2))) - { - fl.Insert(pFGF, 1, false, false); - break; - } - } - } - } - - if(!ext.IsEmpty()) - { - // internal / file extension - - POSITION pos = m_source.GetHeadPosition(); - while(pos) - { - CFGFilter* pFGF = m_source.GetNext(pos); - if(pFGF->m_extensions.Find(CString(ext))) - fl.Insert(pFGF, 2, false, false); - } - } - - { - // internal / the rest - - POSITION pos = m_source.GetHeadPosition(); - while(pos) - { - CFGFilter* pFGF = m_source.GetNext(pos); - if(pFGF->m_protocols.IsEmpty() && pFGF->m_chkbytes.IsEmpty() && pFGF->m_extensions.IsEmpty()) - fl.Insert(pFGF, 3, false, false); - } - } - - if(hFile == INVALID_HANDLE_VALUE) - { - // protocol - - CRegKey key; - if(ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, CString(protocol), KEY_READ)) - { - CRegKey exts; - if(ERROR_SUCCESS == exts.Open(key, _T("Extensions"), KEY_READ)) - { - len = countof(buff); - if(ERROR_SUCCESS == exts.QueryStringValue(CString(ext), buff, &len)) - fl.Insert(new CFGFilterRegistry(GUIDFromCString(buff)), 4); - } - - len = countof(buff); - if(ERROR_SUCCESS == key.QueryStringValue(_T("Source Filter"), buff, &len)) - fl.Insert(new CFGFilterRegistry(GUIDFromCString(buff)), 5); - } - - fl.Insert(new CFGFilterRegistry(CLSID_URLReader), 6); - } - else - { - // check bytes - - CRegKey key; - if(ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, _T("Media Type"), KEY_READ)) - { - FILETIME ft; - len = countof(buff); - for(DWORD i = 0; ERROR_SUCCESS == key.EnumKey(i, buff, &len, &ft); i++, len = countof(buff)) - { - GUID majortype; - if(FAILED(GUIDFromCString(buff, majortype))) - continue; - - CRegKey majorkey; - if(ERROR_SUCCESS == majorkey.Open(key, buff, KEY_READ)) - { - len = countof(buff); - for(DWORD j = 0; ERROR_SUCCESS == majorkey.EnumKey(j, buff, &len, &ft); j++, len = countof(buff)) - { - GUID subtype; - if(FAILED(GUIDFromCString(buff, subtype))) - continue; - - CRegKey subkey; - if(ERROR_SUCCESS == subkey.Open(majorkey, buff, KEY_READ)) - { - len = countof(buff); - if(ERROR_SUCCESS != subkey.QueryStringValue(_T("Source Filter"), buff, &len)) - continue; - - GUID clsid = GUIDFromCString(buff); - - len = countof(buff); - len2 = sizeof(buff2); - for(DWORD k = 0, type; - clsid != GUID_NULL && ERROR_SUCCESS == RegEnumValue(subkey, k, buff2, &len2, 0, &type, (BYTE*)buff, &len); - k++, len = countof(buff), len2 = sizeof(buff2)) - { - if(CheckBytes(hFile, CString(buff))) - { - CFGFilter* pFGF = new CFGFilterRegistry(clsid); - pFGF->AddType(majortype, subtype); - fl.Insert(pFGF, 9); - break; - } - } - } - } - } - } - } - } - - if(!ext.IsEmpty()) - { - // file extension - - CRegKey key; - if(ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, _T("Media Type\\Extensions\\") + CString(ext), KEY_READ)) - { - ULONG len = countof(buff); - memset(buff, 0, sizeof(buff)); - LONG ret = key.QueryStringValue(_T("Source Filter"), buff, &len); // QueryStringValue can return ERROR_INVALID_DATA on bogus strings (radlight mpc v1003, fixed in v1004) - if(ERROR_SUCCESS == ret || ERROR_INVALID_DATA == ret && GUIDFromCString(buff) != GUID_NULL) - { - GUID clsid = GUIDFromCString(buff); - GUID majortype = GUID_NULL; - GUID subtype = GUID_NULL; - - len = countof(buff); - if(ERROR_SUCCESS == key.QueryStringValue(_T("Media Type"), buff, &len)) - majortype = GUIDFromCString(buff); - - len = countof(buff); - if(ERROR_SUCCESS == key.QueryStringValue(_T("Subtype"), buff, &len)) - subtype = GUIDFromCString(buff); - - CFGFilter* pFGF = new CFGFilterRegistry(clsid); - pFGF->AddType(majortype, subtype); - fl.Insert(pFGF, 7); - } - } - } - - if(hFile != INVALID_HANDLE_VALUE) - { - CloseHandle(hFile); - } - - CFGFilter* pFGF = new CFGFilterRegistry(CLSID_AsyncReader); - pFGF->AddType(MEDIATYPE_Stream, MEDIASUBTYPE_NULL); - fl.Insert(pFGF, 9); - - return S_OK; -} - -HRESULT CFGManager::AddSourceFilter(CFGFilter* pFGF, LPCWSTR lpcwstrFileName, LPCWSTR lpcwstrFilterName, IBaseFilter** ppBF) -{ - TRACE(_T("FGM: AddSourceFilter trying '%s'\n"), CStringFromGUID(pFGF->GetCLSID())); - - CheckPointer(lpcwstrFileName, E_POINTER); - CheckPointer(ppBF, E_POINTER); - - ASSERT(*ppBF == NULL); - - HRESULT hr; - - CComPtr pBF; - CInterfaceList pUnks; - if(FAILED(hr = pFGF->Create(&pBF, pUnks))) - return hr; - - CComQIPtr pFSF = pBF; - if(!pFSF) return E_NOINTERFACE; - - if(FAILED(hr = AddFilter(pBF, lpcwstrFilterName))) - return hr; - - const AM_MEDIA_TYPE* pmt = NULL; - - CMediaType mt; - const CAtlList& types = pFGF->GetTypes(); - if(types.GetCount() == 2 && (types.GetHead() != GUID_NULL || types.GetTail() != GUID_NULL)) - { - mt.majortype = types.GetHead(); - mt.subtype = types.GetTail(); - pmt = &mt; - } - - if(FAILED(hr = pFSF->Load(lpcwstrFileName, pmt))) - { - RemoveFilter(pBF); - return hr; - } - - // doh :P - BeginEnumMediaTypes(GetFirstPin(pBF, PINDIR_OUTPUT), pEMT, pmt) - { - if(pmt->subtype == GUIDFromCString(_T("{640999A0-A946-11D0-A520-000000000000}")) - || pmt->subtype == GUIDFromCString(_T("{640999A1-A946-11D0-A520-000000000000}")) - || pmt->subtype == GUIDFromCString(_T("{D51BD5AE-7548-11CF-A520-0080C77EF58A}"))) - { - RemoveFilter(pBF); - pFGF = new CFGFilterRegistry(CLSID_NetShowSource); - hr = AddSourceFilter(pFGF, lpcwstrFileName, lpcwstrFilterName, ppBF); - delete pFGF; - return hr; - } - } - EndEnumMediaTypes(pmt) - - *ppBF = pBF.Detach(); - - m_pUnks.AddTailList(&pUnks); - - return S_OK; -} - -// IFilterGraph - -STDMETHODIMP CFGManager::AddFilter(IBaseFilter* pFilter, LPCWSTR pName) -{ - if(!m_pUnkInner) return E_UNEXPECTED; - - CAutoLock cAutoLock(this); - - HRESULT hr; - - if(FAILED(hr = CComQIPtr(m_pUnkInner)->AddFilter(pFilter, pName))) - return hr; - - // TODO - hr = pFilter->JoinFilterGraph(NULL, NULL); - hr = pFilter->JoinFilterGraph(this, pName); - - return hr; -} - -STDMETHODIMP CFGManager::RemoveFilter(IBaseFilter* pFilter) -{ - if(!m_pUnkInner) return E_UNEXPECTED; - - CAutoLock cAutoLock(this); - - return CComQIPtr(m_pUnkInner)->RemoveFilter(pFilter); -} - -STDMETHODIMP CFGManager::EnumFilters(IEnumFilters** ppEnum) -{ - if(!m_pUnkInner) return E_UNEXPECTED; - - CAutoLock cAutoLock(this); - - return CComQIPtr(m_pUnkInner)->EnumFilters(ppEnum); -} - -STDMETHODIMP CFGManager::FindFilterByName(LPCWSTR pName, IBaseFilter** ppFilter) -{ - if(!m_pUnkInner) return E_UNEXPECTED; - - CAutoLock cAutoLock(this); - - return CComQIPtr(m_pUnkInner)->FindFilterByName(pName, ppFilter); -} - -STDMETHODIMP CFGManager::ConnectDirect(IPin* pPinOut, IPin* pPinIn, const AM_MEDIA_TYPE* pmt) -{ - if(!m_pUnkInner) return E_UNEXPECTED; - - CAutoLock cAutoLock(this); - - CComPtr pBF = GetFilterFromPin(pPinIn); - CLSID clsid = GetCLSID(pBF); - - // TODO: GetUpStreamFilter goes up on the first input pin only - for(CComPtr pBFUS = GetFilterFromPin(pPinOut); pBFUS; pBFUS = GetUpStreamFilter(pBFUS)) - { - if(pBFUS == pBF) return VFW_E_CIRCULAR_GRAPH; - if(GetCLSID(pBFUS) == clsid) return VFW_E_CANNOT_CONNECT; - } - - return CComQIPtr(m_pUnkInner)->ConnectDirect(pPinOut, pPinIn, pmt); -} - -STDMETHODIMP CFGManager::Reconnect(IPin* ppin) -{ - if(!m_pUnkInner) return E_UNEXPECTED; - - CAutoLock cAutoLock(this); - - return CComQIPtr(m_pUnkInner)->Reconnect(ppin); -} - -STDMETHODIMP CFGManager::Disconnect(IPin* ppin) -{ - if(!m_pUnkInner) return E_UNEXPECTED; - - CAutoLock cAutoLock(this); - - return CComQIPtr(m_pUnkInner)->Disconnect(ppin); -} - -STDMETHODIMP CFGManager::SetDefaultSyncSource() -{ - if(!m_pUnkInner) return E_UNEXPECTED; - - CAutoLock cAutoLock(this); - - return CComQIPtr(m_pUnkInner)->SetDefaultSyncSource(); -} - -// IGraphBuilder - -STDMETHODIMP CFGManager::Connect(IPin* pPinOut, IPin* pPinIn) -{ - CAutoLock cAutoLock(this); - - CheckPointer(pPinOut, E_POINTER); - - HRESULT hr; - - if(S_OK != IsPinDirection(pPinOut, PINDIR_OUTPUT) - || pPinIn && S_OK != IsPinDirection(pPinIn, PINDIR_INPUT)) - return VFW_E_INVALID_DIRECTION; - - if(S_OK == IsPinConnected(pPinOut) - || pPinIn && S_OK == IsPinConnected(pPinIn)) - return VFW_E_ALREADY_CONNECTED; - - bool fDeadEnd = true; - - if(pPinIn) - { - // 1. Try a direct connection between the filters, with no intermediate filters - - if(SUCCEEDED(hr = ConnectDirect(pPinOut, pPinIn, NULL))) - return hr; - } - else - { - // 1. Use IStreamBuilder - - if(CComQIPtr pSB = pPinOut) - { - if(SUCCEEDED(hr = pSB->Render(pPinOut, this))) - return hr; - - pSB->Backout(pPinOut, this); - } - } - - // 2. Try cached filters - - if(CComQIPtr pGC = (IGraphBuilder2*)this) - { - BeginEnumCachedFilters(pGC, pEF, pBF) - { - if(pPinIn && GetFilterFromPin(pPinIn) == pBF) - continue; - - hr = pGC->RemoveFilterFromCache(pBF); - - // does RemoveFilterFromCache call AddFilter like AddFilterToCache calls RemoveFilter ? - - if(SUCCEEDED(hr = ConnectFilterDirect(pPinOut, pBF, NULL))) - { - if(!IsStreamEnd(pBF)) fDeadEnd = false; - - if(SUCCEEDED(hr = ConnectFilter(pBF, pPinIn))) - return hr; - } - - hr = pGC->AddFilterToCache(pBF); - } - EndEnumCachedFilters - } - - // 3. Try filters in the graph - - { - CInterfaceList pBFs; - - BeginEnumFilters(this, pEF, pBF) - { - if(pPinIn && GetFilterFromPin(pPinIn) == pBF - || GetFilterFromPin(pPinOut) == pBF) - continue; - - // HACK: ffdshow - audio capture filter - if(GetCLSID(pPinOut) == GUIDFromCString(_T("{04FE9017-F873-410E-871E-AB91661A4EF7}")) - && GetCLSID(pBF) == GUIDFromCString(_T("{E30629D2-27E5-11CE-875D-00608CB78066}"))) - continue; - - pBFs.AddTail(pBF); - } - EndEnumFilters - - POSITION pos = pBFs.GetHeadPosition(); - while(pos) - { - IBaseFilter* pBF = pBFs.GetNext(pos); - - if(SUCCEEDED(hr = ConnectFilterDirect(pPinOut, pBF, NULL))) - { - if(!IsStreamEnd(pBF)) fDeadEnd = false; - - if(SUCCEEDED(hr = ConnectFilter(pBF, pPinIn))) - return hr; - } - - EXECUTE_ASSERT(Disconnect(pPinOut)); - } - } - - // 4. Look up filters in the registry - - { - CFGFilterList fl; - - CAtlArray types; - ExtractMediaTypes(pPinOut, types); - - POSITION pos = m_transform.GetHeadPosition(); - while(pos) - { - CFGFilter* pFGF = m_transform.GetNext(pos); - if(pFGF->GetMerit() < MERIT64_DO_USE || pFGF->CheckTypes(types, false)) - fl.Insert(pFGF, 0, pFGF->CheckTypes(types, true), false); - } - - pos = m_override.GetHeadPosition(); - while(pos) - { - CFGFilter* pFGF = m_override.GetNext(pos); - if(pFGF->GetMerit() < MERIT64_DO_USE || pFGF->CheckTypes(types, false)) - fl.Insert(pFGF, 0, pFGF->CheckTypes(types, true), false); - } - - CComPtr pEM; - if(types.GetCount() > 0 - && SUCCEEDED(m_pFM->EnumMatchingFilters( - &pEM, 0, FALSE, MERIT_DO_NOT_USE+1, - TRUE, types.GetCount()/2, types.GetData(), NULL, NULL, FALSE, - !!pPinIn, 0, NULL, NULL, NULL))) - { - for(CComPtr pMoniker; S_OK == pEM->Next(1, &pMoniker, NULL); pMoniker = NULL) - { - CFGFilterRegistry* pFGF = new CFGFilterRegistry(pMoniker); - fl.Insert(pFGF, 0, pFGF->CheckTypes(types, true)); - } - } - - pos = fl.GetHeadPosition(); - while(pos) - { - CFGFilter* pFGF = fl.GetNext(pos); - - TRACE(_T("FGM: Connecting '%s'\n"), pFGF->GetName()); - - CComPtr pBF; - CInterfaceList pUnks; - if(FAILED(pFGF->Create(&pBF, pUnks))) - continue; - - if(FAILED(hr = AddFilter(pBF, pFGF->GetName()))) - continue; - - hr = E_FAIL; - - if(FAILED(hr)) - { - hr = ConnectFilterDirect(pPinOut, pBF, NULL); - } -/* - if(FAILED(hr)) - { - if(types.GetCount() >= 2 && types[0] == MEDIATYPE_Stream && types[1] != GUID_NULL) - { - CMediaType mt; - - mt.majortype = types[0]; - mt.subtype = types[1]; - mt.formattype = FORMAT_None; - if(FAILED(hr)) hr = ConnectFilterDirect(pPinOut, pBF, &mt); - - mt.formattype = GUID_NULL; - if(FAILED(hr)) hr = ConnectFilterDirect(pPinOut, pBF, &mt); - } - } -*/ - if(SUCCEEDED(hr)) - { - if(!IsStreamEnd(pBF)) fDeadEnd = false; - - hr = ConnectFilter(pBF, pPinIn); - - if(SUCCEEDED(hr)) - { - m_pUnks.AddTailList(&pUnks); - - // maybe the application should do this... - - POSITION pos = pUnks.GetHeadPosition(); - while(pos) - { - if(CComQIPtr pMPC = pUnks.GetNext(pos)) - pMPC->SetAspectRatioMode(AM_ARMODE_STRETCHED); - } - - if(CComQIPtr pARC = pBF) - pARC->SetAspectRatioMode(VMR_ARMODE_NONE); - - if(CComQIPtr pARC = pBF) - pARC->SetAspectRatioMode(VMR_ARMODE_NONE); - - return hr; - } - } - - EXECUTE_ASSERT(SUCCEEDED(RemoveFilter(pBF))); - - TRACE(_T("FGM: Connecting '%s' FAILED!\n"), pFGF->GetName()); - } - } - - if(fDeadEnd) - { - CAutoPtr psde(new CStreamDeadEnd()); - psde->AddTailList(&m_streampath); - int skip = 0; - BeginEnumMediaTypes(pPinOut, pEM, pmt) - { - if(pmt->majortype == MEDIATYPE_Stream && pmt->subtype == MEDIASUBTYPE_NULL) skip++; - psde->mts.AddTail(CMediaType(*pmt)); - } - EndEnumMediaTypes(pmt) - if(skip < psde->mts.GetCount()) - m_deadends.Add(psde); - } - - return pPinIn ? VFW_E_CANNOT_CONNECT : VFW_E_CANNOT_RENDER; -} - -STDMETHODIMP CFGManager::Render(IPin* pPinOut) -{ - CAutoLock cAutoLock(this); - - return RenderEx(pPinOut, 0, NULL); -} - -STDMETHODIMP CFGManager::RenderFile(LPCWSTR lpcwstrFileName, LPCWSTR lpcwstrPlayList) -{ - CAutoLock cAutoLock(this); - - m_streampath.RemoveAll(); - m_deadends.RemoveAll(); - - HRESULT hr; - -/* - CComPtr pBF; - if(FAILED(hr = AddSourceFilter(lpcwstrFile, lpcwstrFile, &pBF))) - return hr; - - return ConnectFilter(pBF, NULL); -*/ - - CFGFilterList fl; - if(FAILED(hr = EnumSourceFilters(lpcwstrFileName, fl))) - return hr; - - CAutoPtrArray deadends; - - hr = VFW_E_CANNOT_RENDER; - - POSITION pos = fl.GetHeadPosition(); - while(pos) - { - CComPtr pBF; - - if(SUCCEEDED(hr = AddSourceFilter(fl.GetNext(pos), lpcwstrFileName, lpcwstrFileName, &pBF))) - { - m_streampath.RemoveAll(); - m_deadends.RemoveAll(); - - if(SUCCEEDED(hr = ConnectFilter(pBF, NULL))) - return hr; - - NukeDownstream(pBF); - RemoveFilter(pBF); - - deadends.Append(m_deadends); - } - } - - m_deadends.Copy(deadends); - - return hr; -} - -STDMETHODIMP CFGManager::AddSourceFilter(LPCWSTR lpcwstrFileName, LPCWSTR lpcwstrFilterName, IBaseFilter** ppFilter) -{ - CAutoLock cAutoLock(this); - - HRESULT hr; - - CFGFilterList fl; - if(FAILED(hr = EnumSourceFilters(lpcwstrFileName, fl))) - return hr; - - POSITION pos = fl.GetHeadPosition(); - while(pos) - { - if(SUCCEEDED(hr = AddSourceFilter(fl.GetNext(pos), lpcwstrFileName, lpcwstrFilterName, ppFilter))) - return hr; - } - - return VFW_E_CANNOT_LOAD_SOURCE_FILTER; -} - -STDMETHODIMP CFGManager::SetLogFile(DWORD_PTR hFile) -{ - if(!m_pUnkInner) return E_UNEXPECTED; - - CAutoLock cAutoLock(this); - - return CComQIPtr(m_pUnkInner)->SetLogFile(hFile); -} - -STDMETHODIMP CFGManager::Abort() -{ - if(!m_pUnkInner) return E_UNEXPECTED; - - CAutoLock cAutoLock(this); - - return CComQIPtr(m_pUnkInner)->Abort(); -} - -STDMETHODIMP CFGManager::ShouldOperationContinue() -{ - if(!m_pUnkInner) return E_UNEXPECTED; - - CAutoLock cAutoLock(this); - - return CComQIPtr(m_pUnkInner)->ShouldOperationContinue(); -} - -// IFilterGraph2 - -STDMETHODIMP CFGManager::AddSourceFilterForMoniker(IMoniker* pMoniker, IBindCtx* pCtx, LPCWSTR lpcwstrFilterName, IBaseFilter** ppFilter) -{ - if(!m_pUnkInner) return E_UNEXPECTED; - - CAutoLock cAutoLock(this); - - return CComQIPtr(m_pUnkInner)->AddSourceFilterForMoniker(pMoniker, pCtx, lpcwstrFilterName, ppFilter); -} - -STDMETHODIMP CFGManager::ReconnectEx(IPin* ppin, const AM_MEDIA_TYPE* pmt) -{ - if(!m_pUnkInner) return E_UNEXPECTED; - - CAutoLock cAutoLock(this); - - return CComQIPtr(m_pUnkInner)->ReconnectEx(ppin, pmt); -} - -STDMETHODIMP CFGManager::RenderEx(IPin* pPinOut, DWORD dwFlags, DWORD* pvContext) -{ - CAutoLock cAutoLock(this); - - m_streampath.RemoveAll(); - m_deadends.RemoveAll(); - - if(!pPinOut || dwFlags > AM_RENDEREX_RENDERTOEXISTINGRENDERERS || pvContext) - return E_INVALIDARG; - - HRESULT hr; - - if(dwFlags & AM_RENDEREX_RENDERTOEXISTINGRENDERERS) - { - CInterfaceList pBFs; - - BeginEnumFilters(this, pEF, pBF) - { - if(CComQIPtr pAMMF = pBF) - { - if(pAMMF->GetMiscFlags() & AM_FILTER_MISC_FLAGS_IS_RENDERER) - { - pBFs.AddTail(pBF); - } - } - else - { - BeginEnumPins(pBF, pEP, pPin) - { - CComPtr pPinIn; - DWORD size = 1; - if(SUCCEEDED(pPin->QueryInternalConnections(&pPinIn, &size)) && size == 0) - { - pBFs.AddTail(pBF); - break; - } - } - EndEnumPins - } - } - EndEnumFilters - - while(!pBFs.IsEmpty()) - { - if(SUCCEEDED(hr = ConnectFilter(pPinOut, pBFs.RemoveHead()))) - return hr; - } - - return VFW_E_CANNOT_RENDER; - } - - return Connect(pPinOut, (IPin*)NULL); -} - -// IGraphBuilder2 - -STDMETHODIMP CFGManager::IsPinDirection(IPin* pPin, PIN_DIRECTION dir1) -{ - CAutoLock cAutoLock(this); - - CheckPointer(pPin, E_POINTER); - - PIN_DIRECTION dir2; - if(FAILED(pPin->QueryDirection(&dir2))) - return E_FAIL; - - return dir1 == dir2 ? S_OK : S_FALSE; -} - -STDMETHODIMP CFGManager::IsPinConnected(IPin* pPin) -{ - CAutoLock cAutoLock(this); - - CheckPointer(pPin, E_POINTER); - - CComPtr pPinTo; - return SUCCEEDED(pPin->ConnectedTo(&pPinTo)) && pPinTo ? S_OK : S_FALSE; -} - -STDMETHODIMP CFGManager::ConnectFilter(IBaseFilter* pBF, IPin* pPinIn) -{ - CAutoLock cAutoLock(this); - - CheckPointer(pBF, E_POINTER); - - if(pPinIn && S_OK != IsPinDirection(pPinIn, PINDIR_INPUT)) - return VFW_E_INVALID_DIRECTION; - - int nTotal = 0, nRendered = 0; - - BeginEnumPins(pBF, pEP, pPin) - { - if(GetPinName(pPin)[0] != '~' - && S_OK == IsPinDirection(pPin, PINDIR_OUTPUT) - && S_OK != IsPinConnected(pPin)) - { - m_streampath.Append(pBF, pPin); - - HRESULT hr = Connect(pPin, pPinIn); - - if(SUCCEEDED(hr)) - { - for(int i = m_deadends.GetCount()-1; i >= 0; i--) - if(m_deadends[i]->Compare(m_streampath)) - m_deadends.RemoveAt(i); - - nRendered++; - } - - nTotal++; - - m_streampath.RemoveTail(); - - if(SUCCEEDED(hr) && pPinIn) - return S_OK; - } - } - EndEnumPins - - return - nRendered == nTotal ? (nRendered > 0 ? S_OK : S_FALSE) : - nRendered > 0 ? VFW_S_PARTIAL_RENDER : - VFW_E_CANNOT_RENDER; -} - -STDMETHODIMP CFGManager::ConnectFilter(IPin* pPinOut, IBaseFilter* pBF) -{ - CAutoLock cAutoLock(this); - - CheckPointer(pPinOut, E_POINTER); - CheckPointer(pBF, E_POINTER); - - if(S_OK != IsPinDirection(pPinOut, PINDIR_OUTPUT)) - return VFW_E_INVALID_DIRECTION; - - HRESULT hr; - - BeginEnumPins(pBF, pEP, pPin) - { - if(GetPinName(pPin)[0] != '~' - && S_OK == IsPinDirection(pPin, PINDIR_INPUT) - && S_OK != IsPinConnected(pPin) - && SUCCEEDED(hr = Connect(pPinOut, pPin))) - return hr; - } - EndEnumPins - - return VFW_E_CANNOT_CONNECT; -} - -STDMETHODIMP CFGManager::ConnectFilterDirect(IPin* pPinOut, IBaseFilter* pBF, const AM_MEDIA_TYPE* pmt) -{ - CAutoLock cAutoLock(this); - - CheckPointer(pPinOut, E_POINTER); - CheckPointer(pBF, E_POINTER); - - if(S_OK != IsPinDirection(pPinOut, PINDIR_OUTPUT)) - return VFW_E_INVALID_DIRECTION; - - HRESULT hr; - - BeginEnumPins(pBF, pEP, pPin) - { - if(GetPinName(pPin)[0] != '~' - && S_OK == IsPinDirection(pPin, PINDIR_INPUT) - && S_OK != IsPinConnected(pPin) - && SUCCEEDED(hr = ConnectDirect(pPinOut, pPin, pmt))) - return hr; - } - EndEnumPins - - return VFW_E_CANNOT_CONNECT; -} - -STDMETHODIMP CFGManager::NukeDownstream(IUnknown* pUnk) -{ - CAutoLock cAutoLock(this); - - if(CComQIPtr pBF = pUnk) - { - BeginEnumPins(pBF, pEP, pPin) - { - NukeDownstream(pPin); - } - EndEnumPins - } - else if(CComQIPtr pPin = pUnk) - { - CComPtr pPinTo; - if(S_OK == IsPinDirection(pPin, PINDIR_OUTPUT) - && SUCCEEDED(pPin->ConnectedTo(&pPinTo)) && pPinTo) - { - if(CComPtr pBF = GetFilterFromPin(pPinTo)) - { - NukeDownstream(pBF); - Disconnect(pPinTo); - Disconnect(pPin); - RemoveFilter(pBF); - } - } - } - else - { - return E_INVALIDARG; - } - - return S_OK; -} - -STDMETHODIMP CFGManager::FindInterface(REFIID iid, void** ppv, BOOL bRemove) -{ - CAutoLock cAutoLock(this); - - CheckPointer(ppv, E_POINTER); - - for(POSITION pos = m_pUnks.GetHeadPosition(); pos; m_pUnks.GetNext(pos)) - { - if(SUCCEEDED(m_pUnks.GetAt(pos)->QueryInterface(iid, ppv))) - { - if(bRemove) m_pUnks.RemoveAt(pos); - return S_OK; - } - } - - return E_NOINTERFACE; -} - -STDMETHODIMP CFGManager::AddToROT() -{ - CAutoLock cAutoLock(this); - - HRESULT hr; - - if(m_dwRegister) return S_FALSE; - - CComPtr pROT; - CComPtr pMoniker; - WCHAR wsz[256]; - swprintf(wsz, L"FilterGraph %08p pid %08x (MPC)", (DWORD_PTR)this, GetCurrentProcessId()); - if(SUCCEEDED(hr = GetRunningObjectTable(0, &pROT)) - && SUCCEEDED(hr = CreateItemMoniker(L"!", wsz, &pMoniker))) - hr = pROT->Register(ROTFLAGS_REGISTRATIONKEEPSALIVE, (IGraphBuilder2*)this, pMoniker, &m_dwRegister); - - return hr; -} - -STDMETHODIMP CFGManager::RemoveFromROT() -{ - CAutoLock cAutoLock(this); - - HRESULT hr; - - if(!m_dwRegister) return S_FALSE; - - CComPtr pROT; - if(SUCCEEDED(hr = GetRunningObjectTable(0, &pROT)) - && SUCCEEDED(hr = pROT->Revoke(m_dwRegister))) - m_dwRegister = 0; - - return hr; -} - -// IGraphBuilderDeadEnd - -STDMETHODIMP_(size_t) CFGManager::GetCount() -{ - CAutoLock cAutoLock(this); - - return m_deadends.GetCount(); -} - -STDMETHODIMP CFGManager::GetDeadEnd(int iIndex, CAtlList& path, CAtlList& mts) -{ - CAutoLock cAutoLock(this); - - if(iIndex < 0 || iIndex >= m_deadends.GetCount()) return E_FAIL; - - path.RemoveAll(); - mts.RemoveAll(); - - POSITION pos = m_deadends[iIndex]->GetHeadPosition(); - while(pos) - { - const path_t& p = m_deadends[iIndex]->GetNext(pos); - - CStringW str; - str.Format(L"%s::%s", p.filter, p.pin); - path.AddTail(str); - } - - mts.AddTailList(&m_deadends[iIndex]->mts); - - return S_OK; -} - -// -// CFGManagerCustom -// - -CFGManagerCustom::CFGManagerCustom(LPCTSTR pName, LPUNKNOWN pUnk, UINT src, UINT tra) - : CFGManager(pName, pUnk) -{ - AppSettings& s = AfxGetAppSettings(); - - CFGFilter* pFGF; - - // Source filters - - if(src & SRC_SHOUTCAST) - { - pFGF = new CFGFilterInternal(); - pFGF->m_protocols.AddTail(_T("http")); - m_source.AddTail(pFGF); - } - -#if (_MSC_VER < 1500) - // if(src & SRC_UDP) - { - pFGF = new CFGFilterInternal(); - pFGF->m_protocols.AddTail(_T("udp")); - m_source.AddTail(pFGF); - } -#endif - - if(src & SRC_AVI) - { - pFGF = new CFGFilterInternal(); - pFGF->m_chkbytes.AddTail(_T("0,4,,52494646,8,4,,41564920")); - pFGF->m_chkbytes.AddTail(_T("0,4,,52494646,8,4,,41564958")); - m_source.AddTail(pFGF); - } - - if(src & SRC_MP4) - { - pFGF = new CFGFilterInternal(); - pFGF->m_chkbytes.AddTail(_T("4,4,,66747970")); // ftyp - pFGF->m_chkbytes.AddTail(_T("4,4,,6d6f6f76")); // moov - pFGF->m_chkbytes.AddTail(_T("4,4,,6d646174")); // mdat - pFGF->m_chkbytes.AddTail(_T("4,4,,736b6970")); // skip - pFGF->m_chkbytes.AddTail(_T("4,12,ffffffff00000000ffffffff,77696465027fe3706d646174")); // wide ? mdat - pFGF->m_chkbytes.AddTail(_T("3,3,,000001")); // raw mpeg4 video - pFGF->m_extensions.AddTail(_T(".mov")); - m_source.AddTail(pFGF); - } - - if(src & SRC_FLV) - { - pFGF = new CFGFilterInternal(); - pFGF->m_chkbytes.AddTail(_T("0,4,,464C5601")); // FLV (v1) - m_source.AddTail(pFGF); - } - - if(src & SRC_MATROSKA) - { - pFGF = new CFGFilterInternal(); - pFGF->m_chkbytes.AddTail(_T("0,4,,1A45DFA3")); - m_source.AddTail(pFGF); - } - - if(src & SRC_REALMEDIA) - { - pFGF = new CFGFilterInternal(); - pFGF->m_chkbytes.AddTail(_T("0,4,,2E524D46")); - m_source.AddTail(pFGF); - } - - if(src & SRC_DSM) - { - pFGF = new CFGFilterInternal(); - pFGF->m_chkbytes.AddTail(_T("0,4,,44534D53")); - m_source.AddTail(pFGF); - } - - if(src & SRC_FLIC) - { - pFGF = new CFGFilterInternal(); - pFGF->m_chkbytes.AddTail(_T("4,2,,11AF")); - pFGF->m_chkbytes.AddTail(_T("4,2,,12AF")); - pFGF->m_extensions.AddTail(_T(".fli")); - pFGF->m_extensions.AddTail(_T(".flc")); - m_source.AddTail(pFGF); - } - - if(src & SRC_CDDA) - { - pFGF = new CFGFilterInternal(); - pFGF->m_extensions.AddTail(_T(".cda")); - m_source.AddTail(pFGF); - } - - if(src & SRC_CDXA) - { - pFGF = new CFGFilterInternal(); - pFGF->m_chkbytes.AddTail(_T("0,4,,52494646,8,4,,43445841")); - m_source.AddTail(pFGF); - } - - if(src & SRC_VTS) - { - pFGF = new CFGFilterInternal(); - pFGF->m_chkbytes.AddTail(_T("0,12,,445644564944454F2D565453")); - m_source.AddTail(pFGF); - } - - __if_exists(CD2VSource) - { - if(src & SRC_D2V) - { - pFGF = new CFGFilterInternal(); - pFGF->m_chkbytes.AddTail(_T("0,18,,4456443241564950726F6A65637446696C65")); - pFGF->m_extensions.AddTail(_T(".d2v")); - m_source.AddTail(pFGF); - } - } - - __if_exists(CRadGtSourceFilter) - { - if(src & SRC_RADGT) - { - pFGF = new CFGFilterInternal(); - pFGF->m_chkbytes.AddTail(_T("0,3,,534D4B")); - pFGF->m_chkbytes.AddTail(_T("0,3,,42494B")); - pFGF->m_extensions.AddTail(_T(".smk")); - pFGF->m_extensions.AddTail(_T(".bik")); - m_source.AddTail(pFGF); - } - } - - if(src & SRC_ROQ) - { - pFGF = new CFGFilterInternal(); - pFGF->m_chkbytes.AddTail(_T("0,8,,8410FFFFFFFF1E00")); - m_source.AddTail(pFGF); - } - - if(src & SRC_OGG) - { - pFGF = new CFGFilterInternal(); - pFGF->m_chkbytes.AddTail(_T("0,4,,4F676753")); - m_source.AddTail(pFGF); - } - - __if_exists(CNutSourceFilter) - { - if(src & SRC_NUT) - { - pFGF = new CFGFilterInternal(); - pFGF->m_chkbytes.AddTail(_T("0,8,,F9526A624E55544D")); - m_source.AddTail(pFGF); - } - } - - __if_exists(CDiracSourceFilter) - { - if(src & SRC_DIRAC) - { - pFGF = new CFGFilterInternal(); - pFGF->m_chkbytes.AddTail(_T("0,8,,4B572D4449524143")); - m_source.AddTail(pFGF); - } - } - - if(src & SRC_MPEG) - { - pFGF = new CFGFilterInternal(); - pFGF->m_chkbytes.AddTail(_T("0,16,FFFFFFFFF100010001800001FFFFFFFF,000001BA2100010001800001000001BB")); - pFGF->m_chkbytes.AddTail(_T("0,5,FFFFFFFFC0,000001BA40")); - pFGF->m_chkbytes.AddTail(_T("0,1,,47,188,1,,47,376,1,,47")); - pFGF->m_chkbytes.AddTail(_T("4,1,,47,196,1,,47,388,1,,47")); - pFGF->m_chkbytes.AddTail(_T("0,4,,54467263,1660,1,,47")); - pFGF->m_chkbytes.AddTail(_T("0,8,fffffc00ffe00000,4156000055000000")); - m_source.AddTail(pFGF); - } - - if(src & SRC_DTSAC3) - { - pFGF = new CFGFilterInternal(); - pFGF->m_chkbytes.AddTail(_T("0,4,,7FFE8001")); - pFGF->m_chkbytes.AddTail(_T("0,2,,0B77")); - pFGF->m_chkbytes.AddTail(_T("0,2,,770B")); - pFGF->m_extensions.AddTail(_T(".ac3")); - pFGF->m_extensions.AddTail(_T(".dts")); - m_source.AddTail(pFGF); - } - - if(src & SRC_MPA) - { - pFGF = new CFGFilterInternal(); - pFGF->m_chkbytes.AddTail(_T("0,2,FFE0,FFE0")); - pFGF->m_chkbytes.AddTail(_T("0,10,FFFFFF00000080808080,49443300000000000000")); - m_source.AddTail(pFGF); - } - - if(AfxGetAppSettings().fUseWMASFReader) - { - pFGF = new CFGFilterRegistry(CLSID_WMAsfReader); - pFGF->m_chkbytes.AddTail(_T("0,4,,3026B275")); - pFGF->m_chkbytes.AddTail(_T("0,4,,D129E2D6")); - m_source.AddTail(pFGF); - } - - // Transform filters - - pFGF = new CFGFilterInternal(L"AVI<->AC3/DTS", MERIT64(0x00680000)+1); - pFGF->AddType(MEDIATYPE_Audio, MEDIASUBTYPE_WAVE_DOLBY_AC3); - pFGF->AddType(MEDIATYPE_Audio, MEDIASUBTYPE_WAVE_DTS); - m_transform.AddTail(pFGF); - - if(src & SRC_MATROSKA) { - pFGF = new CFGFilterInternal(L"Matroska Splitter", MERIT64_ABOVE_DSHOW); - } else { - pFGF = new CFGFilterInternal(L"Matroska Splitter (low merit)", MERIT64_DO_USE); - } - pFGF->AddType(MEDIATYPE_Stream, MEDIASUBTYPE_Matroska); - pFGF->AddType(MEDIATYPE_Stream, GUID_NULL); - m_transform.AddTail(pFGF); - - if(src & SRC_REALMEDIA) { - pFGF = new CFGFilterInternal(L"RealMedia Splitter", MERIT64_ABOVE_DSHOW); - } else { - pFGF = new CFGFilterInternal(L"RealMedia Splitter (low merit)", MERIT64_DO_USE); - } - pFGF->AddType(MEDIATYPE_Stream, MEDIASUBTYPE_RealMedia); - pFGF->AddType(MEDIATYPE_Stream, GUID_NULL); - m_transform.AddTail(pFGF); - - if(src & SRC_AVI) { - pFGF = new CFGFilterInternal(L"Avi Splitter", MERIT64_ABOVE_DSHOW); - } else { - pFGF = new CFGFilterInternal(L"Avi Splitter (low merit)", MERIT64_DO_USE); - } - pFGF->AddType(MEDIATYPE_Stream, MEDIASUBTYPE_Avi); - pFGF->AddType(MEDIATYPE_Stream, GUID_NULL); - m_transform.AddTail(pFGF); - - __if_exists(CRadGtSplitterFilter) - { - if(src & SRC_RADGT) { - pFGF = new CFGFilterInternal(L"RadGt Splitter", MERIT64_ABOVE_DSHOW); - } else { - pFGF = new CFGFilterInternal(L"RadGt Splitter (low merit)", MERIT64_DO_USE); - } - pFGF->AddType(MEDIATYPE_Stream, MEDIASUBTYPE_Bink); - pFGF->AddType(MEDIATYPE_Stream, MEDIASUBTYPE_Smacker); - pFGF->AddType(MEDIATYPE_Stream, GUID_NULL); - m_transform.AddTail(pFGF); - } - - if(src & SRC_ROQ) { - pFGF = new CFGFilterInternal(L"RoQ Splitter", MERIT64_ABOVE_DSHOW); - } else { - pFGF = new CFGFilterInternal(L"RoQ Splitter (low merit)", MERIT64_DO_USE); - } - pFGF->AddType(MEDIATYPE_Stream, MEDIASUBTYPE_RoQ); - pFGF->AddType(MEDIATYPE_Stream, GUID_NULL); - m_transform.AddTail(pFGF); - - if(src & SRC_OGG) { - pFGF = new CFGFilterInternal(L"Ogg Splitter", MERIT64_ABOVE_DSHOW); - } else { - pFGF = new CFGFilterInternal(L"Ogg Splitter (low merit)", MERIT64_DO_USE); - } - pFGF->AddType(MEDIATYPE_Stream, MEDIASUBTYPE_Ogg); - pFGF->AddType(MEDIATYPE_Stream, GUID_NULL); - m_transform.AddTail(pFGF); - - __if_exists(CNutSplitterFilter) - { - if(src & SRC_NUT) { - pFGF = new CFGFilterInternal(L"Nut Splitter", MERIT64_ABOVE_DSHOW); - } else { - pFGF = new CFGFilterInternal(L"Nut Splitter (low merit)", MERIT64_DO_USE); - } - pFGF->AddType(MEDIATYPE_Stream, MEDIASUBTYPE_Nut); - pFGF->AddType(MEDIATYPE_Stream, GUID_NULL); - m_transform.AddTail(pFGF); - } - - if(src & SRC_MPEG) { - pFGF = new CFGFilterInternal(L"Mpeg Splitter", MERIT64_ABOVE_DSHOW); - } else { - pFGF = new CFGFilterInternal(L"Mpeg Splitter (low merit)", MERIT64_DO_USE); - } - pFGF->AddType(MEDIATYPE_Stream, MEDIASUBTYPE_MPEG1System); - pFGF->AddType(MEDIATYPE_Stream, MEDIASUBTYPE_MPEG2_PROGRAM); - pFGF->AddType(MEDIATYPE_Stream, MEDIASUBTYPE_MPEG2_TRANSPORT); - pFGF->AddType(MEDIATYPE_Stream, MEDIASUBTYPE_MPEG2_PVA); - pFGF->AddType(MEDIATYPE_Stream, GUID_NULL); - m_transform.AddTail(pFGF); - - __if_exists(CDiracSplitterFilter) - { - if(src & SRC_DIRAC) { - pFGF = new CFGFilterInternal(L"Dirac Splitter", MERIT64_ABOVE_DSHOW); - } else { - pFGF = new CFGFilterInternal(L"Dirac Splitter (low merit)", MERIT64_DO_USE); - } - pFGF->AddType(MEDIATYPE_Stream, MEDIASUBTYPE_Dirac); - pFGF->AddType(MEDIATYPE_Stream, GUID_NULL); - m_transform.AddTail(pFGF); - } - - if(src & SRC_MPA) { - pFGF = new CFGFilterInternal(L"Mpa Splitter", MERIT64_ABOVE_DSHOW); - } else { - pFGF = new CFGFilterInternal(L"Mpa Splitter (low merit)", MERIT64_DO_USE); - } - pFGF->AddType(MEDIATYPE_Stream, MEDIASUBTYPE_MPEG1Audio); - pFGF->AddType(MEDIATYPE_Stream, GUID_NULL); - m_transform.AddTail(pFGF); - - if(src & SRC_DSM) { - pFGF = new CFGFilterInternal(L"DSM Splitter", MERIT64_ABOVE_DSHOW); - } else { - pFGF = new CFGFilterInternal(L"DSM Splitter (low merit)", MERIT64_DO_USE); - } - pFGF->AddType(MEDIATYPE_Stream, MEDIASUBTYPE_DirectShowMedia); - pFGF->AddType(MEDIATYPE_Stream, GUID_NULL); - m_transform.AddTail(pFGF); - - if(src & SRC_MP4) { - pFGF = new CFGFilterInternal(L"MP4 Splitter", MERIT64_ABOVE_DSHOW); - } else { - pFGF = new CFGFilterInternal(L"MP4 Splitter (low merit)", MERIT64_DO_USE); - } - pFGF->AddType(MEDIATYPE_Stream, MEDIASUBTYPE_MP4); - pFGF->AddType(MEDIATYPE_Stream, GUID_NULL); - m_transform.AddTail(pFGF); - - if(src & SRC_FLV) { - pFGF = new CFGFilterInternal(L"FLV Splitter", MERIT64_ABOVE_DSHOW); - } else { - pFGF = new CFGFilterInternal(L"FLV Splitter (low merit)", MERIT64_DO_USE); - } - pFGF->AddType(MEDIATYPE_Stream, MEDIASUBTYPE_FLV); - pFGF->AddType(MEDIATYPE_Stream, GUID_NULL); - m_transform.AddTail(pFGF); - - pFGF = new CFGFilterInternal( - (tra & TRA_MPEG1) ? L"MPEG-1 Video Decoder" : L"MPEG-1 Video Decoder (low merit)", - (tra & TRA_MPEG1) ? MERIT64_ABOVE_DSHOW : MERIT64_DO_USE); - pFGF->AddType(MEDIATYPE_Video, MEDIASUBTYPE_MPEG1Packet); - pFGF->AddType(MEDIATYPE_Video, MEDIASUBTYPE_MPEG1Payload); - m_transform.AddTail(pFGF); - - pFGF = new CFGFilterInternal( - (tra & TRA_MPEG2) ? L"MPEG-2 Video Decoder" : L"MPEG-2 Video Decoder (low merit)", - (tra & TRA_MPEG2) ? MERIT64_ABOVE_DSHOW : MERIT64_DO_USE); - pFGF->AddType(MEDIATYPE_DVD_ENCRYPTED_PACK, MEDIASUBTYPE_MPEG2_VIDEO); - pFGF->AddType(MEDIATYPE_MPEG2_PACK, MEDIASUBTYPE_MPEG2_VIDEO); - pFGF->AddType(MEDIATYPE_MPEG2_PES, MEDIASUBTYPE_MPEG2_VIDEO); - pFGF->AddType(MEDIATYPE_Video, MEDIASUBTYPE_MPEG2_VIDEO); - m_transform.AddTail(pFGF); - - pFGF = new CFGFilterInternal( - (tra & TRA_MPA) ? L"MPEG-1 Audio Decoder" : L"MPEG-1 Audio Decoder (low merit)", - (tra & TRA_MPA) ? MERIT64_ABOVE_DSHOW : MERIT64_DO_USE); - pFGF->AddType(MEDIATYPE_Audio, MEDIASUBTYPE_MP3); - pFGF->AddType(MEDIATYPE_Audio, MEDIASUBTYPE_MPEG1AudioPayload); - pFGF->AddType(MEDIATYPE_Audio, MEDIASUBTYPE_MPEG1Payload); - pFGF->AddType(MEDIATYPE_Audio, MEDIASUBTYPE_MPEG1Packet); - m_transform.AddTail(pFGF); - - pFGF = new CFGFilterInternal( - (tra & TRA_MPA) ? L"MPEG-2 Audio Decoder" : L"MPEG-2 Audio Decoder (low merit)", - (tra & TRA_MPA) ? MERIT64_ABOVE_DSHOW : MERIT64_DO_USE); - pFGF->AddType(MEDIATYPE_DVD_ENCRYPTED_PACK, MEDIASUBTYPE_MPEG2_AUDIO); - pFGF->AddType(MEDIATYPE_MPEG2_PACK, MEDIASUBTYPE_MPEG2_AUDIO); - pFGF->AddType(MEDIATYPE_MPEG2_PES, MEDIASUBTYPE_MPEG2_AUDIO); - pFGF->AddType(MEDIATYPE_Audio, MEDIASUBTYPE_MPEG2_AUDIO); - m_transform.AddTail(pFGF); - - pFGF = new CFGFilterInternal( - (tra & TRA_LPCM) ? L"LPCM Audio Decoder" : L"LPCM Audio Decoder (low merit)", - (tra & TRA_LPCM) ? MERIT64_ABOVE_DSHOW : MERIT64_DO_USE); - pFGF->AddType(MEDIATYPE_DVD_ENCRYPTED_PACK, MEDIASUBTYPE_DVD_LPCM_AUDIO); - pFGF->AddType(MEDIATYPE_MPEG2_PACK, MEDIASUBTYPE_DVD_LPCM_AUDIO); - pFGF->AddType(MEDIATYPE_MPEG2_PES, MEDIASUBTYPE_DVD_LPCM_AUDIO); - pFGF->AddType(MEDIATYPE_Audio, MEDIASUBTYPE_DVD_LPCM_AUDIO); - m_transform.AddTail(pFGF); - - pFGF = new CFGFilterInternal( - (tra & TRA_AC3) ? L"AC3 Audio Decoder" : L"AC3 Audio Decoder (low merit)", - (tra & TRA_AC3) ? MERIT64_ABOVE_DSHOW : MERIT64_DO_USE); - pFGF->AddType(MEDIATYPE_DVD_ENCRYPTED_PACK, MEDIASUBTYPE_DOLBY_AC3); - pFGF->AddType(MEDIATYPE_MPEG2_PACK, MEDIASUBTYPE_DOLBY_AC3); - pFGF->AddType(MEDIATYPE_MPEG2_PES, MEDIASUBTYPE_DOLBY_AC3); - pFGF->AddType(MEDIATYPE_Audio, MEDIASUBTYPE_DOLBY_AC3); - pFGF->AddType(MEDIATYPE_Audio, MEDIASUBTYPE_WAVE_DOLBY_AC3); - m_transform.AddTail(pFGF); - - pFGF = new CFGFilterInternal( - (tra & TRA_DTS) ? L"DTS Decoder" : L"DTS Decoder (low merit)", - (tra & TRA_DTS) ? MERIT64_ABOVE_DSHOW : MERIT64_DO_USE); - pFGF->AddType(MEDIATYPE_DVD_ENCRYPTED_PACK, MEDIASUBTYPE_DTS); - pFGF->AddType(MEDIATYPE_MPEG2_PACK, MEDIASUBTYPE_DTS); - pFGF->AddType(MEDIATYPE_MPEG2_PES, MEDIASUBTYPE_DTS); - pFGF->AddType(MEDIATYPE_Audio, MEDIASUBTYPE_DTS); - pFGF->AddType(MEDIATYPE_Audio, MEDIASUBTYPE_WAVE_DTS); - m_transform.AddTail(pFGF); - - pFGF = new CFGFilterInternal( - (tra & TRA_AAC) ? L"AAC Decoder" : L"AAC Decoder (low merit)", - (tra & TRA_AAC) ? MERIT64_ABOVE_DSHOW+1 : MERIT64_DO_USE); - pFGF->AddType(MEDIATYPE_DVD_ENCRYPTED_PACK, MEDIASUBTYPE_AAC); - pFGF->AddType(MEDIATYPE_MPEG2_PACK, MEDIASUBTYPE_AAC); - pFGF->AddType(MEDIATYPE_MPEG2_PES, MEDIASUBTYPE_AAC); - pFGF->AddType(MEDIATYPE_Audio, MEDIASUBTYPE_AAC); - pFGF->AddType(MEDIATYPE_DVD_ENCRYPTED_PACK, MEDIASUBTYPE_MP4A); - pFGF->AddType(MEDIATYPE_MPEG2_PACK, MEDIASUBTYPE_MP4A); - pFGF->AddType(MEDIATYPE_MPEG2_PES, MEDIASUBTYPE_MP4A); - pFGF->AddType(MEDIATYPE_Audio, MEDIASUBTYPE_MP4A); - pFGF->AddType(MEDIATYPE_DVD_ENCRYPTED_PACK, MEDIASUBTYPE_mp4a); - pFGF->AddType(MEDIATYPE_MPEG2_PACK, MEDIASUBTYPE_mp4a); - pFGF->AddType(MEDIATYPE_MPEG2_PES, MEDIASUBTYPE_mp4a); - pFGF->AddType(MEDIATYPE_Audio, MEDIASUBTYPE_mp4a); - m_transform.AddTail(pFGF); - - pFGF = new CFGFilterInternal( - (tra & TRA_PS2AUD) ? L"PS2 Audio Decoder" : L"PS2 Audio Decoder (low merit)", - (tra & TRA_PS2AUD) ? MERIT64_ABOVE_DSHOW : MERIT64_DO_USE); - pFGF->AddType(MEDIATYPE_DVD_ENCRYPTED_PACK, MEDIASUBTYPE_PS2_PCM); - pFGF->AddType(MEDIATYPE_MPEG2_PACK, MEDIASUBTYPE_PS2_PCM); - pFGF->AddType(MEDIATYPE_MPEG2_PES, MEDIASUBTYPE_PS2_PCM); - pFGF->AddType(MEDIATYPE_Audio, MEDIASUBTYPE_PS2_PCM); - m_transform.AddTail(pFGF); - - pFGF = new CFGFilterInternal( - (tra & TRA_RV) ? L"RealVideo Decoder" : L"RealVideo Decoder (low merit)", - (tra & TRA_RV) ? MERIT64_ABOVE_DSHOW : MERIT64_DO_USE); - pFGF->AddType(MEDIATYPE_Video, MEDIASUBTYPE_RV10); - pFGF->AddType(MEDIATYPE_Video, MEDIASUBTYPE_RV20); - pFGF->AddType(MEDIATYPE_Video, MEDIASUBTYPE_RV30); - pFGF->AddType(MEDIATYPE_Video, MEDIASUBTYPE_RV40); - m_transform.AddTail(pFGF); - - pFGF = new CFGFilterInternal( - (tra & TRA_RA) ? L"RealAudio Decoder" : L"RealAudio Decoder (low merit)", - (tra & TRA_RA) ? MERIT64_ABOVE_DSHOW : MERIT64_DO_USE); - pFGF->AddType(MEDIATYPE_Audio, MEDIASUBTYPE_14_4); - pFGF->AddType(MEDIATYPE_Audio, MEDIASUBTYPE_28_8); - pFGF->AddType(MEDIATYPE_Audio, MEDIASUBTYPE_ATRC); - pFGF->AddType(MEDIATYPE_Audio, MEDIASUBTYPE_COOK); - pFGF->AddType(MEDIATYPE_Audio, MEDIASUBTYPE_DNET); - pFGF->AddType(MEDIATYPE_Audio, MEDIASUBTYPE_SIPR); - pFGF->AddType(MEDIATYPE_Audio, MEDIASUBTYPE_RAAC); - m_transform.AddTail(pFGF); - - pFGF = new CFGFilterInternal( - (tra & TRA_VORBIS) ? L"Vorbis Audio Decoder" : L"Vorbis Audio Decoder (low merit)", - (tra & TRA_VORBIS) ? MERIT64_ABOVE_DSHOW : MERIT64_DO_USE); - pFGF->AddType(MEDIATYPE_Audio, MEDIASUBTYPE_Vorbis2); - m_transform.AddTail(pFGF); - - pFGF = new CFGFilterInternal( - (tra & TRA_RV) ? L"RoQ Video Decoder" : L"RoQ Video Decoder (low merit)", - (tra & TRA_RV) ? MERIT64_ABOVE_DSHOW : MERIT64_DO_USE); - pFGF->AddType(MEDIATYPE_Video, MEDIASUBTYPE_RoQV); - m_transform.AddTail(pFGF); - - pFGF = new CFGFilterInternal( - (tra & TRA_RA) ? L"RoQ Audio Decoder" : L"RoQ Audio Decoder (low merit)", - (tra & TRA_RA) ? MERIT64_ABOVE_DSHOW : MERIT64_DO_USE); - pFGF->AddType(MEDIATYPE_Audio, MEDIASUBTYPE_RoQA); - m_transform.AddTail(pFGF); - - __if_exists(CDiracVideoDecoder) - { - pFGF = new CFGFilterInternal( - (tra & TRA_DIRAC) ? L"Dirac Video Decoder" : L"Dirac Video Decoder (low merit)", - (tra & TRA_DIRAC) ? MERIT64_ABOVE_DSHOW : MERIT64_DO_USE); - pFGF->AddType(MEDIATYPE_Video, MEDIASUBTYPE_DiracVideo); - m_transform.AddTail(pFGF); - } - - pFGF = new CFGFilterInternal(L"NullTextRenderer", MERIT64_DO_USE); - pFGF->AddType(MEDIATYPE_Text, MEDIASUBTYPE_NULL); - pFGF->AddType(MEDIATYPE_ScriptCommand, MEDIASUBTYPE_NULL); - pFGF->AddType(MEDIATYPE_Subtitle, MEDIASUBTYPE_NULL); - pFGF->AddType(MEDIATYPE_Text, MEDIASUBTYPE_NULL); - pFGF->AddType(MEDIATYPE_NULL, MEDIASUBTYPE_DVD_SUBPICTURE); - pFGF->AddType(MEDIATYPE_NULL, MEDIASUBTYPE_CVD_SUBPICTURE); - pFGF->AddType(MEDIATYPE_NULL, MEDIASUBTYPE_SVCD_SUBPICTURE); - m_transform.AddTail(pFGF); - - __if_exists(CFLVVideoDecoder) - { - pFGF = new CFGFilterInternal(L"FLV4 Video Decoder (low merit)",MERIT64_DO_USE); - pFGF->AddType(MEDIATYPE_Video, MEDIASUBTYPE_FLV4); - m_transform.AddTail(pFGF); - } - - // Blocked filters - - // "Subtitle Mixer" makes an access violation around the - // 11-12th media type when enumerating them on its output. - m_transform.AddTail(new CFGFilterRegistry(GUIDFromCString(_T("{00A95963-3BE5-48C0-AD9F-3356D67EA09D}")), MERIT64_DO_NOT_USE)); - - // ISCR suxx - m_transform.AddTail(new CFGFilterRegistry(GUIDFromCString(_T("{48025243-2D39-11CE-875D-00608CB78066}")), MERIT64_DO_NOT_USE)); - - // Samsung's "mpeg-4 demultiplexor" can even open matroska files, amazing... - m_transform.AddTail(new CFGFilterRegistry(GUIDFromCString(_T("{99EC0C72-4D1B-411B-AB1F-D561EE049D94}")), MERIT64_DO_NOT_USE)); - - // LG Video Renderer (lgvid.ax) just crashes when trying to connect it - m_transform.AddTail(new CFGFilterRegistry(GUIDFromCString(_T("{9F711C60-0668-11D0-94D4-0000C02BA972}")), MERIT64_DO_NOT_USE)); - - // palm demuxer crashes (even crashes graphedit when dropping an .ac3 onto it) - m_transform.AddTail(new CFGFilterRegistry(GUIDFromCString(_T("{BE2CF8A7-08CE-4A2C-9A25-FD726A999196}")), MERIT64_DO_NOT_USE)); - - // DCDSPFilter (early versions crash mpc) - { - CRegKey key; - - TCHAR buff[256]; - ULONG len = sizeof(buff); - memset(buff, 0, len); - - CString clsid = _T("{B38C58A0-1809-11D6-A458-EDAE78F1DF12}"); - - if(ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, _T("CLSID\\") + clsid + _T("\\InprocServer32"), KEY_READ) - && ERROR_SUCCESS == key.QueryStringValue(NULL, buff, &len) - && GetFileVersion(buff) < 0x0001000000030000ui64) - { - m_transform.AddTail(new CFGFilterRegistry(GUIDFromCString(clsid), MERIT64_DO_NOT_USE)); - } - } -/* - // NVIDIA Transport Demux crashed for someone, I could not reproduce it - m_transform.AddTail(new CFGFilterRegistry(GUIDFromCString(_T("{735823C1-ACC4-11D3-85AC-006008376FB8}")), MERIT64_DO_NOT_USE)); -*/ - // mainconcept color space converter - m_transform.AddTail(new CFGFilterRegistry(GUIDFromCString(_T("{272D77A0-A852-4851-ADA4-9091FEAD4C86}")), MERIT64_DO_NOT_USE)); - - - // Block VSFilter when internal subtitle renderer will get used - if(s.fAutoloadSubtitles && s.fBlockVSFilter) { - if(s.iDSVideoRendererType == VIDRNDT_DS_VMR7RENDERLESS || s.iDSVideoRendererType == VIDRNDT_DS_VMR9RENDERLESS || s.iDSVideoRendererType == VIDRNDT_DS_DXR) { - m_transform.AddTail(new CFGFilterRegistry(GUIDFromCString(_T("{9852A670-F845-491B-9BE6-EBD841B8A613}")), MERIT64_DO_NOT_USE)); - } - } - - - // Overrides - - WORD merit_low = 1; - - POSITION pos = s.filters.GetTailPosition(); - while(pos) - { - FilterOverride* fo = s.filters.GetPrev(pos); - - if(fo->fDisabled || fo->type == FilterOverride::EXTERNAL && !CPath(MakeFullPath(fo->path)).FileExists()) - continue; - - ULONGLONG merit = - fo->iLoadType == FilterOverride::PREFERRED ? MERIT64_ABOVE_DSHOW : - fo->iLoadType == FilterOverride::MERIT ? MERIT64(fo->dwMerit) : - MERIT64_DO_NOT_USE; // fo->iLoadType == FilterOverride::BLOCKED - - merit += merit_low++; - - CFGFilter* pFGF = NULL; - - if(fo->type == FilterOverride::REGISTERED) - { - pFGF = new CFGFilterRegistry(fo->dispname, merit); - } - else if(fo->type == FilterOverride::EXTERNAL) - { - pFGF = new CFGFilterFile(fo->clsid, fo->path, CStringW(fo->name), merit); - } - - if(pFGF) - { - pFGF->SetTypes(fo->guids); - m_override.AddTail(pFGF); - } - } -} - -STDMETHODIMP CFGManagerCustom::AddFilter(IBaseFilter* pBF, LPCWSTR pName) -{ - CAutoLock cAutoLock(this); - - HRESULT hr; - - if(FAILED(hr = __super::AddFilter(pBF, pName))) - return hr; - - AppSettings& s = AfxGetAppSettings(); - - if(GetCLSID(pBF) == CLSID_DMOWrapperFilter) - { - if(CComQIPtr pPB = pBF) - { - CComVariant var(true); - pPB->Write(CComBSTR(L"_HIRESOUTPUT"), &var); - } - } - - if(CComQIPtr pASF = pBF) - { - pASF->EnableDownSamplingTo441(s.fDownSampleTo441); - pASF->SetSpeakerConfig(s.fCustomChannelMapping, s.pSpeakerToChannelMap); - pASF->SetAudioTimeShift(s.fAudioTimeShift ? 10000i64*s.tAudioTimeShift : 0); - pASF->SetNormalizeBoost(s.fAudioNormalize, s.fAudioNormalizeRecover, s.AudioBoost); - } - - return hr; -} - -// -// CFGManagerPlayer -// - -CFGManagerPlayer::CFGManagerPlayer(LPCTSTR pName, LPUNKNOWN pUnk, UINT src, UINT tra, HWND hWnd) - : CFGManagerCustom(pName, pUnk, src, tra) - , m_hWnd(hWnd) - , m_vrmerit(MERIT64(MERIT_PREFERRED)) - , m_armerit(MERIT64(MERIT_PREFERRED)) -{ - CFGFilter* pFGF; - - AppSettings& s = AfxGetAppSettings(); - - if(m_pFM) - { - CComPtr pEM; - - GUID guids[] = {MEDIATYPE_Video, MEDIASUBTYPE_NULL}; - - if(SUCCEEDED(m_pFM->EnumMatchingFilters(&pEM, 0, FALSE, MERIT_DO_NOT_USE+1, - TRUE, 1, guids, NULL, NULL, TRUE, FALSE, 0, NULL, NULL, NULL))) - { - for(CComPtr pMoniker; S_OK == pEM->Next(1, &pMoniker, NULL); pMoniker = NULL) - { - CFGFilterRegistry f(pMoniker); - m_vrmerit = max(m_vrmerit, f.GetMerit()); - } - } - - m_vrmerit += 0x100; - } - - if(m_pFM) - { - CComPtr pEM; - - GUID guids[] = {MEDIATYPE_Audio, MEDIASUBTYPE_NULL}; - - if(SUCCEEDED(m_pFM->EnumMatchingFilters(&pEM, 0, FALSE, MERIT_DO_NOT_USE+1, - TRUE, 1, guids, NULL, NULL, TRUE, FALSE, 0, NULL, NULL, NULL))) - { - for(CComPtr pMoniker; S_OK == pEM->Next(1, &pMoniker, NULL); pMoniker = NULL) - { - CFGFilterRegistry f(pMoniker); - m_armerit = max(m_armerit, f.GetMerit()); - } - } - - BeginEnumSysDev(CLSID_AudioRendererCategory, pMoniker) - { - CFGFilterRegistry f(pMoniker); - m_armerit = max(m_armerit, f.GetMerit()); - } - EndEnumSysDev - - m_armerit += 0x100; - } - - // Switchers - - if(s.fEnableAudioSwitcher) - { - pFGF = new CFGFilterInternal(L"Audio Switcher", m_armerit + 0x100); - pFGF->AddType(MEDIATYPE_Audio, MEDIASUBTYPE_NULL); - m_transform.AddTail(pFGF); - - // morgan stream switcher - m_transform.AddTail(new CFGFilterRegistry(GUIDFromCString(_T("{D3CD7858-971A-4838-ACEC-40CA5D529DC8}")), MERIT64_DO_NOT_USE)); - } - - // Renderers - - if(s.iDSVideoRendererType == VIDRNDT_DS_OLDRENDERER) - m_transform.AddTail(new CFGFilterRegistry(CLSID_VideoRenderer, m_vrmerit)); - else if(s.iDSVideoRendererType == VIDRNDT_DS_OVERLAYMIXER) - m_transform.AddTail(new CFGFilterVideoRenderer(m_hWnd, CLSID_OverlayMixer, L"Overlay Mixer", m_vrmerit)); - else if(s.iDSVideoRendererType == VIDRNDT_DS_VMR7WINDOWED) - m_transform.AddTail(new CFGFilterVideoRenderer(m_hWnd, CLSID_VideoMixingRenderer, L"Video Mixing Render 7 (Windowed)", m_vrmerit)); - else if(s.iDSVideoRendererType == VIDRNDT_DS_VMR9WINDOWED) - m_transform.AddTail(new CFGFilterVideoRenderer(m_hWnd, CLSID_VideoMixingRenderer9, L"Video Mixing Render 9 (Windowed)", m_vrmerit)); - else if(s.iDSVideoRendererType == VIDRNDT_DS_VMR7RENDERLESS) - m_transform.AddTail(new CFGFilterVideoRenderer(m_hWnd, CLSID_VMR7AllocatorPresenter, L"Video Mixing Render 7 (Renderless)", m_vrmerit)); - else if(s.iDSVideoRendererType == VIDRNDT_DS_VMR9RENDERLESS) - m_transform.AddTail(new CFGFilterVideoRenderer(m_hWnd, CLSID_VMR9AllocatorPresenter, L"Video Mixing Render 9 (Renderless)", m_vrmerit)); - else if(s.iDSVideoRendererType == VIDRNDT_DS_DXR) - m_transform.AddTail(new CFGFilterVideoRenderer(m_hWnd, CLSID_DXRAllocatorPresenter, L"Haali's Video Renderer", m_vrmerit)); - else if(s.iDSVideoRendererType == VIDRNDT_DS_NULL_COMP) - { - pFGF = new CFGFilterInternal(L"Null Video Renderer (Any)", MERIT64_ABOVE_DSHOW+2); - pFGF->AddType(MEDIATYPE_Video, MEDIASUBTYPE_NULL); - m_transform.AddTail(pFGF); - } - else if(s.iDSVideoRendererType == VIDRNDT_DS_NULL_UNCOMP) - { - pFGF = new CFGFilterInternal(L"Null Video Renderer (Uncompressed)", MERIT64_ABOVE_DSHOW+2); - pFGF->AddType(MEDIATYPE_Video, MEDIASUBTYPE_NULL); - m_transform.AddTail(pFGF); - } - - if(s.AudioRendererDisplayName == AUDRNDT_NULL_COMP) - { - pFGF = new CFGFilterInternal(AUDRNDT_NULL_COMP, MERIT64_ABOVE_DSHOW+2); - pFGF->AddType(MEDIATYPE_Audio, MEDIASUBTYPE_NULL); - m_transform.AddTail(pFGF); - } - else if(s.AudioRendererDisplayName == AUDRNDT_NULL_UNCOMP) - { - pFGF = new CFGFilterInternal(AUDRNDT_NULL_UNCOMP, MERIT64_ABOVE_DSHOW+2); - pFGF->AddType(MEDIATYPE_Audio, MEDIASUBTYPE_NULL); - m_transform.AddTail(pFGF); - } - else if(!s.AudioRendererDisplayName.IsEmpty()) - { - pFGF = new CFGFilterRegistry(s.AudioRendererDisplayName, m_armerit); - pFGF->AddType(MEDIATYPE_Audio, MEDIASUBTYPE_NULL); - m_transform.AddTail(pFGF); - } -} - -STDMETHODIMP CFGManagerPlayer::ConnectDirect(IPin* pPinOut, IPin* pPinIn, const AM_MEDIA_TYPE* pmt) -{ - CAutoLock cAutoLock(this); - - if(GetCLSID(pPinOut) == CLSID_MPEG2Demultiplexer) - { - CComQIPtr pMS = pPinOut; - REFERENCE_TIME rtDur = 0; - if(!pMS || FAILED(pMS->GetDuration(&rtDur)) || rtDur <= 0) - return E_FAIL; - } - - return __super::ConnectDirect(pPinOut, pPinIn, pmt); -} - -// -// CFGManagerDVD -// - -CFGManagerDVD::CFGManagerDVD(LPCTSTR pName, LPUNKNOWN pUnk, UINT src, UINT tra, HWND hWnd) - : CFGManagerPlayer(pName, pUnk, src, tra, hWnd) -{ - AppSettings& s = AfxGetAppSettings(); - - // have to avoid the old video renderer - if(!s.fXpOrBetter && s.iDSVideoRendererType != VIDRNDT_DS_OVERLAYMIXER || s.iDSVideoRendererType == VIDRNDT_DS_OLDRENDERER) - m_transform.AddTail(new CFGFilterVideoRenderer(m_hWnd, CLSID_OverlayMixer, L"Overlay Mixer", m_vrmerit-1)); - - // elecard's decoder isn't suited for dvd playback (atm) - m_transform.AddTail(new CFGFilterRegistry(GUIDFromCString(_T("{F50B3F13-19C4-11CF-AA9A-02608C9BABA2}")), MERIT64_DO_NOT_USE)); -} - -#include "..\..\decss\VobFile.h" - -class CResetDVD : public CDVDSession -{ -public: - CResetDVD(LPCTSTR path) - { - if(Open(path)) - { - if(BeginSession()) {Authenticate(); /*GetDiscKey();*/ EndSession();} - Close(); - } - } -}; - -STDMETHODIMP CFGManagerDVD::RenderFile(LPCWSTR lpcwstrFile, LPCWSTR lpcwstrPlayList) -{ - CAutoLock cAutoLock(this); - - HRESULT hr; - - CComPtr pBF; - if(FAILED(hr = AddSourceFilter(lpcwstrFile, lpcwstrFile, &pBF))) - return hr; - - return ConnectFilter(pBF, NULL); -} - -STDMETHODIMP CFGManagerDVD::AddSourceFilter(LPCWSTR lpcwstrFileName, LPCWSTR lpcwstrFilterName, IBaseFilter** ppFilter) -{ - CAutoLock cAutoLock(this); - - CheckPointer(lpcwstrFileName, E_POINTER); - CheckPointer(ppFilter, E_POINTER); - - HRESULT hr; - - CStringW fn = CStringW(lpcwstrFileName).TrimLeft(); - CStringW protocol = fn.Left(fn.Find(':')+1).TrimRight(':').MakeLower(); - CStringW ext = CPathW(fn).GetExtension().MakeLower(); - - GUID clsid = ext == L".ratdvd" ? GUIDFromCString(_T("{482d10b6-376e-4411-8a17-833800A065DB}")) : CLSID_DVDNavigator; - - CComPtr pBF; - if(FAILED(hr = pBF.CoCreateInstance(clsid)) - || FAILED(hr = AddFilter(pBF, L"DVD Navigator"))) - return VFW_E_CANNOT_LOAD_SOURCE_FILTER; - - CComQIPtr pDVDC; - CComQIPtr pDVDI; - - if(!((pDVDC = pBF) && (pDVDI = pBF))) - return E_NOINTERFACE; - - WCHAR buff[MAX_PATH]; - ULONG len; - if((!fn.IsEmpty() - && FAILED(hr = pDVDC->SetDVDDirectory(fn)) - && FAILED(hr = pDVDC->SetDVDDirectory(fn + L"VIDEO_TS")) - && FAILED(hr = pDVDC->SetDVDDirectory(fn + L"\\VIDEO_TS"))) - || FAILED(hr = pDVDI->GetDVDDirectory(buff, countof(buff), &len)) || len == 0) - return E_INVALIDARG; - - pDVDC->SetOption(DVD_ResetOnStop, FALSE); - pDVDC->SetOption(DVD_HMSF_TimeCodeEvents, TRUE); - - if(clsid == CLSID_DVDNavigator) - CResetDVD(CString(buff)); - - *ppFilter = pBF.Detach(); - - return S_OK; -} - -// -// CFGManagerCapture -// - -CFGManagerCapture::CFGManagerCapture(LPCTSTR pName, LPUNKNOWN pUnk, UINT src, UINT tra, HWND hWnd) - : CFGManagerPlayer(pName, pUnk, src, tra, hWnd) -{ - AppSettings& s = AfxGetAppSettings(); - - CFGFilter* pFGF = new CFGFilterInternal(L"Deinterlacer", m_vrmerit + 0x100); - pFGF->AddType(MEDIATYPE_Video, MEDIASUBTYPE_NULL); - m_transform.AddTail(pFGF); - - // morgan stream switcher - m_transform.AddTail(new CFGFilterRegistry(GUIDFromCString(_T("{D3CD7858-971A-4838-ACEC-40CA5D529DC8}")), MERIT64_DO_NOT_USE)); -} - -// -// CFGManagerMuxer -// - -CFGManagerMuxer::CFGManagerMuxer(LPCTSTR pName, LPUNKNOWN pUnk) - : CFGManagerCustom(pName, pUnk, ~0, ~0) -{ - m_source.AddTail(new CFGFilterInternal()); - m_source.AddTail(new CFGFilterInternal()); -} - -// -// CFGAggregator -// - -CFGAggregator::CFGAggregator(const CLSID& clsid, LPCTSTR pName, LPUNKNOWN pUnk, HRESULT& hr) - : CUnknown(pName, pUnk) -{ - hr = m_pUnkInner.CoCreateInstance(clsid, GetOwner()); -} - -CFGAggregator::~CFGAggregator() -{ - m_pUnkInner.Release(); -} - -STDMETHODIMP CFGAggregator::NonDelegatingQueryInterface(REFIID riid, void** ppv) -{ - CheckPointer(ppv, E_POINTER); - - return - m_pUnkInner && (riid != IID_IUnknown && SUCCEEDED(m_pUnkInner->QueryInterface(riid, ppv))) ? S_OK : - __super::NonDelegatingQueryInterface(riid, ppv); -} diff --git a/src/apps/mplayerc/FGManager.h b/src/apps/mplayerc/FGManager.h deleted file mode 100644 index 49579f6b3..000000000 --- a/src/apps/mplayerc/FGManager.h +++ /dev/null @@ -1,180 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#pragma once - -#include "FGFilter.h" -#include "IGraphBuilder2.h" - -class CFGManager - : public CUnknown - , public IGraphBuilder2 - , public IGraphBuilderDeadEnd - , public CCritSec -{ -public: - struct path_t {CLSID clsid; CString filter, pin;}; - - class CStreamPath : public CAtlList - { - public: - void Append(IBaseFilter* pBF, IPin* pPin); - bool Compare(const CStreamPath& path); - }; - - class CStreamDeadEnd : public CStreamPath - { - public: - CAtlList mts; - }; - -private: - CComPtr m_pUnkInner; - DWORD m_dwRegister; - - CStreamPath m_streampath; - CAutoPtrArray m_deadends; - -protected: - CComPtr m_pFM; - CInterfaceList m_pUnks; - CAtlList m_source, m_transform, m_override; - - static bool CheckBytes(HANDLE hFile, CString chkbytes); - - HRESULT EnumSourceFilters(LPCWSTR lpcwstrFileName, CFGFilterList& fl); - HRESULT AddSourceFilter(CFGFilter* pFGF, LPCWSTR lpcwstrFileName, LPCWSTR lpcwstrFilterName, IBaseFilter** ppBF); - - // IFilterGraph - - STDMETHODIMP AddFilter(IBaseFilter* pFilter, LPCWSTR pName); - STDMETHODIMP RemoveFilter(IBaseFilter* pFilter); - STDMETHODIMP EnumFilters(IEnumFilters** ppEnum); - STDMETHODIMP FindFilterByName(LPCWSTR pName, IBaseFilter** ppFilter); - STDMETHODIMP ConnectDirect(IPin* pPinOut, IPin* pPinIn, const AM_MEDIA_TYPE* pmt); - STDMETHODIMP Reconnect(IPin* ppin); - STDMETHODIMP Disconnect(IPin* ppin); - STDMETHODIMP SetDefaultSyncSource(); - - // IGraphBuilder - - STDMETHODIMP Connect(IPin* pPinOut, IPin* pPinIn); - STDMETHODIMP Render(IPin* pPinOut); - STDMETHODIMP RenderFile(LPCWSTR lpcwstrFile, LPCWSTR lpcwstrPlayList); - STDMETHODIMP AddSourceFilter(LPCWSTR lpcwstrFileName, LPCWSTR lpcwstrFilterName, IBaseFilter** ppFilter); - STDMETHODIMP SetLogFile(DWORD_PTR hFile); - STDMETHODIMP Abort(); - STDMETHODIMP ShouldOperationContinue(); - - // IFilterGraph2 - - STDMETHODIMP AddSourceFilterForMoniker(IMoniker* pMoniker, IBindCtx* pCtx, LPCWSTR lpcwstrFilterName, IBaseFilter** ppFilter); - STDMETHODIMP ReconnectEx(IPin* ppin, const AM_MEDIA_TYPE* pmt); - STDMETHODIMP RenderEx(IPin* pPinOut, DWORD dwFlags, DWORD* pvContext); - - // IGraphBuilder2 - - STDMETHODIMP IsPinDirection(IPin* pPin, PIN_DIRECTION dir); - STDMETHODIMP IsPinConnected(IPin* pPin); - STDMETHODIMP ConnectFilter(IBaseFilter* pBF, IPin* pPinIn); - STDMETHODIMP ConnectFilter(IPin* pPinOut, IBaseFilter* pBF); - STDMETHODIMP ConnectFilterDirect(IPin* pPinOut, IBaseFilter* pBF, const AM_MEDIA_TYPE* pmt); - STDMETHODIMP NukeDownstream(IUnknown* pUnk); - STDMETHODIMP FindInterface(REFIID iid, void** ppv, BOOL bRemove); - STDMETHODIMP AddToROT(); - STDMETHODIMP RemoveFromROT(); - - // IGraphBuilderDeadEnd - - STDMETHODIMP_(size_t) GetCount(); - STDMETHODIMP GetDeadEnd(int iIndex, CAtlList& path, CAtlList& mts); - -public: - CFGManager(LPCTSTR pName, LPUNKNOWN pUnk); - virtual ~CFGManager(); - - DECLARE_IUNKNOWN; - STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv); -}; - -class CFGManagerCustom : public CFGManager -{ -public: - // IFilterGraph - - STDMETHODIMP AddFilter(IBaseFilter* pFilter, LPCWSTR pName); - -public: - CFGManagerCustom(LPCTSTR pName, LPUNKNOWN pUnk, UINT src, UINT tra); -}; - -class CFGManagerPlayer : public CFGManagerCustom -{ -protected: - HWND m_hWnd; - UINT64 m_vrmerit, m_armerit; - - // IFilterGraph - - STDMETHODIMP ConnectDirect(IPin* pPinOut, IPin* pPinIn, const AM_MEDIA_TYPE* pmt); - -public: - CFGManagerPlayer(LPCTSTR pName, LPUNKNOWN pUnk, UINT src, UINT tra, HWND hWnd); -}; - -class CFGManagerDVD : public CFGManagerPlayer -{ -protected: - // IGraphBuilder - - STDMETHODIMP RenderFile(LPCWSTR lpcwstrFile, LPCWSTR lpcwstrPlayList); - STDMETHODIMP AddSourceFilter(LPCWSTR lpcwstrFileName, LPCWSTR lpcwstrFilterName, IBaseFilter** ppFilter); - -public: - CFGManagerDVD(LPCTSTR pName, LPUNKNOWN pUnk, UINT src, UINT tra, HWND hWnd); -}; - -class CFGManagerCapture : public CFGManagerPlayer -{ -public: - CFGManagerCapture(LPCTSTR pName, LPUNKNOWN pUnk, UINT src, UINT tra, HWND hWnd); -}; - -class CFGManagerMuxer : public CFGManagerCustom -{ -public: - CFGManagerMuxer(LPCTSTR pName, LPUNKNOWN pUnk); -}; - -// - -class CFGAggregator : public CUnknown -{ -protected: - CComPtr m_pUnkInner; - -public: - CFGAggregator(const CLSID& clsid, LPCTSTR pName, LPUNKNOWN pUnk, HRESULT& hr); - virtual ~CFGAggregator(); - - DECLARE_IUNKNOWN; - STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv); -}; diff --git a/src/apps/mplayerc/FakeFilterMapper2.cpp b/src/apps/mplayerc/FakeFilterMapper2.cpp deleted file mode 100644 index 216c9b2d5..000000000 --- a/src/apps/mplayerc/FakeFilterMapper2.cpp +++ /dev/null @@ -1,474 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include "stdafx.h" -#include "fakefiltermapper2.h" -#include "MacrovisionKicker.h" -#include "..\..\..\include\detours\detours.h" -#include "..\..\DSUtil\DSUtil.h" - -#include -#include - -DETOUR_TRAMPOLINE(HRESULT WINAPI Real_CoCreateInstance(IN REFCLSID rclsid, IN LPUNKNOWN pUnkOuter, IN DWORD dwClsContext, IN REFIID riid, OUT LPVOID FAR* ppv), CoCreateInstance); -DETOUR_TRAMPOLINE(LONG WINAPI Real_RegCloseKey(HKEY a0), RegCloseKey); -DETOUR_TRAMPOLINE(LONG WINAPI Real_RegFlushKey(HKEY a0), RegFlushKey); -DETOUR_TRAMPOLINE(LONG WINAPI Real_RegCreateKeyA(HKEY a0, LPCSTR a1, PHKEY a2), RegCreateKeyA); -DETOUR_TRAMPOLINE(LONG WINAPI Real_RegCreateKeyW(HKEY a0, LPCWSTR a1, PHKEY a2), RegCreateKeyW); -DETOUR_TRAMPOLINE(LONG WINAPI Real_RegCreateKeyExA(HKEY a0, LPCSTR a1, DWORD a2, LPSTR a3, DWORD a4, REGSAM a5, LPSECURITY_ATTRIBUTES a6, PHKEY a7, LPDWORD a8), RegCreateKeyExA); -DETOUR_TRAMPOLINE(LONG WINAPI Real_RegCreateKeyExW(HKEY a0, LPCWSTR a1, DWORD a2, LPWSTR a3, DWORD a4, REGSAM a5, LPSECURITY_ATTRIBUTES a6, PHKEY a7, LPDWORD a8), RegCreateKeyExW); -DETOUR_TRAMPOLINE(LONG WINAPI Real_RegDeleteKeyA(HKEY a0, LPCSTR a1), RegDeleteKeyA); -DETOUR_TRAMPOLINE(LONG WINAPI Real_RegDeleteKeyW(HKEY a0, LPCWSTR a1), RegDeleteKeyW); -DETOUR_TRAMPOLINE(LONG WINAPI Real_RegDeleteValueA(HKEY a0, LPCSTR a1), RegDeleteValueA); -DETOUR_TRAMPOLINE(LONG WINAPI Real_RegDeleteValueW(HKEY a0, LPCWSTR a1), RegDeleteValueW); -DETOUR_TRAMPOLINE(LONG WINAPI Real_RegEnumKeyExA(HKEY a0, DWORD a1, LPSTR a2, LPDWORD a3, LPDWORD a4, LPSTR a5, LPDWORD a6, struct _FILETIME* a7), RegEnumKeyExA); -DETOUR_TRAMPOLINE(LONG WINAPI Real_RegEnumKeyExW(HKEY a0, DWORD a1, LPWSTR a2, LPDWORD a3, LPDWORD a4, LPWSTR a5, LPDWORD a6, struct _FILETIME* a7), RegEnumKeyExW); -DETOUR_TRAMPOLINE(LONG WINAPI Real_RegEnumValueA(HKEY a0, DWORD a1, LPSTR a2, LPDWORD a3, LPDWORD a4, LPDWORD a5, LPBYTE a6, LPDWORD a7), RegEnumValueA); -DETOUR_TRAMPOLINE(LONG WINAPI Real_RegEnumValueW(HKEY a0, DWORD a1, LPWSTR a2, LPDWORD a3, LPDWORD a4, LPDWORD a5, LPBYTE a6, LPDWORD a7), RegEnumValueW); -DETOUR_TRAMPOLINE(LONG WINAPI Real_RegOpenKeyA(HKEY a0, LPCSTR a1, PHKEY a2), RegOpenKeyA); -DETOUR_TRAMPOLINE(LONG WINAPI Real_RegOpenKeyW(HKEY a0, LPCWSTR a1, PHKEY a2), RegOpenKeyW); -DETOUR_TRAMPOLINE(LONG WINAPI Real_RegOpenKeyExA(HKEY a0, LPCSTR a1, DWORD a2, REGSAM a3, PHKEY a4), RegOpenKeyExA); -DETOUR_TRAMPOLINE(LONG WINAPI Real_RegOpenKeyExW(HKEY a0, LPCWSTR a1, DWORD a2, REGSAM a3, PHKEY a4), RegOpenKeyExW); -DETOUR_TRAMPOLINE(LONG WINAPI Real_RegQueryInfoKeyA(HKEY a0, LPSTR a1, LPDWORD a2, LPDWORD a3, LPDWORD a4, LPDWORD a5, LPDWORD a6, LPDWORD a7, LPDWORD a8, LPDWORD a9, LPDWORD a10, struct _FILETIME* a11), RegQueryInfoKeyA); -DETOUR_TRAMPOLINE(LONG WINAPI Real_RegQueryInfoKeyW(HKEY a0, LPWSTR a1, LPDWORD a2, LPDWORD a3, LPDWORD a4, LPDWORD a5, LPDWORD a6, LPDWORD a7, LPDWORD a8, LPDWORD a9, LPDWORD a10, struct _FILETIME* a11), RegQueryInfoKeyW); -DETOUR_TRAMPOLINE(LONG WINAPI Real_RegQueryValueA(HKEY a0, LPCSTR a1, LPSTR a2, PLONG a3), RegQueryValueA); -DETOUR_TRAMPOLINE(LONG WINAPI Real_RegQueryValueW(HKEY a0, LPCWSTR a1, LPWSTR a2, PLONG a3), RegQueryValueW); -DETOUR_TRAMPOLINE(LONG WINAPI Real_RegQueryValueExA(HKEY a0, LPCSTR a1, LPDWORD a2, LPDWORD a3, LPBYTE a4, LPDWORD a5), RegQueryValueExA); -DETOUR_TRAMPOLINE(LONG WINAPI Real_RegQueryValueExW(HKEY a0, LPCWSTR a1, LPDWORD a2, LPDWORD a3, LPBYTE a4, LPDWORD a5), RegQueryValueExW); -DETOUR_TRAMPOLINE(LONG WINAPI Real_RegSetValueA(HKEY a0, LPCSTR a1, DWORD a2, LPCSTR a3, DWORD a4), RegSetValueA); -DETOUR_TRAMPOLINE(LONG WINAPI Real_RegSetValueW(HKEY a0, LPCWSTR a1, DWORD a2, LPCWSTR a3, DWORD a4), RegSetValueW); -DETOUR_TRAMPOLINE(LONG WINAPI Real_RegSetValueExA(HKEY a0, LPCSTR a1, DWORD a2, DWORD a3, BYTE* a4, DWORD a5), RegSetValueExA); -DETOUR_TRAMPOLINE(LONG WINAPI Real_RegSetValueExW(HKEY a0, LPCWSTR a1, DWORD a2, DWORD a3, BYTE* a4, DWORD a5), RegSetValueExW); - -HRESULT WINAPI Mine_CoCreateInstance(IN REFCLSID rclsid, IN LPUNKNOWN pUnkOuter, - IN DWORD dwClsContext, IN REFIID riid, OUT LPVOID FAR* ppv) -{ - if(CFilterMapper2::m_pFilterMapper2) - { - CheckPointer(ppv, E_POINTER); - - if(rclsid == CLSID_FilterMapper) - { - ASSERT(0); - return REGDB_E_CLASSNOTREG; // sorry... - } - - if(rclsid == CLSID_FilterMapper2) - { - if(pUnkOuter) return CLASS_E_NOAGGREGATION; - - if(riid == __uuidof(IUnknown)) - { - CFilterMapper2::m_pFilterMapper2->AddRef(); - *ppv = (IUnknown*)CFilterMapper2::m_pFilterMapper2; - return S_OK; - } - else if(riid == __uuidof(IFilterMapper2)) - { - CFilterMapper2::m_pFilterMapper2->AddRef(); - *ppv = (IFilterMapper2*)CFilterMapper2::m_pFilterMapper2; - return S_OK; - } - else - { - return E_NOINTERFACE; - } - } - } -/* else - { - if(rclsid == CLSID_FilterMapper2) - { - CFilterMapper2* pFM2 = new CFilterMapper2(true, false, pUnkOuter); - CComPtr pUnk = (IUnknown*)pFM2; - return pUnk->QueryInterface(riid, ppv); - } - } -*/ - if(!pUnkOuter) - if(rclsid == CLSID_VideoMixingRenderer || rclsid == CLSID_VideoMixingRenderer9 - || rclsid == CLSID_VideoRenderer || rclsid == CLSID_VideoRendererDefault - || rclsid == CLSID_OverlayMixer)// || rclsid == CLSID_OverlayMixer2 - where is this declared?) - { - CMacrovisionKicker* pMK = new CMacrovisionKicker(NAME("CMacrovisionKicker"), NULL); - CComPtr pUnk = (IUnknown*)(INonDelegatingUnknown*)pMK; - CComPtr pInner; - HRESULT hr; - if(SUCCEEDED(hr = Real_CoCreateInstance(rclsid, pUnk, dwClsContext, __uuidof(IUnknown), (void**)&pInner))) - { - pMK->SetInner(pInner); - return pUnk->QueryInterface(riid, ppv); - } - } - - return Real_CoCreateInstance(rclsid, pUnkOuter, dwClsContext, riid, ppv); -} - -#define FAKEHKEY (HKEY)0x12345678 - -LONG WINAPI Mine_RegCloseKey(HKEY a0) -{ - if(CFilterMapper2::m_pFilterMapper2 && a0 == FAKEHKEY) {return ERROR_SUCCESS;} - return Real_RegCloseKey(a0); -} -LONG WINAPI Mine_RegFlushKey(HKEY a0) -{ - if(CFilterMapper2::m_pFilterMapper2 && a0 == FAKEHKEY) {return ERROR_SUCCESS;} - return Real_RegFlushKey(a0); -} -LONG WINAPI Mine_RegCreateKeyA(HKEY a0, LPCSTR a1, PHKEY a2) -{ - if(CFilterMapper2::m_pFilterMapper2) {*a2 = FAKEHKEY; return ERROR_SUCCESS;} - return Real_RegCreateKeyA(a0, a1, a2); -} -LONG WINAPI Mine_RegCreateKeyW(HKEY a0, LPCWSTR a1, PHKEY a2) -{ - if(CFilterMapper2::m_pFilterMapper2) {*a2 = FAKEHKEY; return ERROR_SUCCESS;} - return Real_RegCreateKeyW(a0, a1, a2); -} -LONG WINAPI Mine_RegCreateKeyExA(HKEY a0, LPCSTR a1, DWORD a2, LPSTR a3, DWORD a4, REGSAM a5, LPSECURITY_ATTRIBUTES a6, PHKEY a7, LPDWORD a8) -{ - if(CFilterMapper2::m_pFilterMapper2) {*a7 = FAKEHKEY; return ERROR_SUCCESS;} - return Real_RegCreateKeyExA(a0, a1, a2, a3, a4, a5, a6, a7, a8); -} -LONG WINAPI Mine_RegCreateKeyExW(HKEY a0, LPCWSTR a1, DWORD a2, LPWSTR a3, DWORD a4, REGSAM a5, LPSECURITY_ATTRIBUTES a6, PHKEY a7, LPDWORD a8) -{ - if(CFilterMapper2::m_pFilterMapper2) {*a7 = FAKEHKEY; return ERROR_SUCCESS;} - return Real_RegCreateKeyExW(a0, a1, a2, a3, a4, a5, a6, a7, a8); -} -LONG WINAPI Mine_RegDeleteKeyA(HKEY a0, LPCSTR a1) -{ - if(CFilterMapper2::m_pFilterMapper2 && (a0 == FAKEHKEY || (int)a0 < 0)) {return ERROR_SUCCESS;} - return Real_RegDeleteKeyA(a0, a1); -} -LONG WINAPI Mine_RegDeleteKeyW(HKEY a0, LPCWSTR a1) -{ - if(CFilterMapper2::m_pFilterMapper2 && (a0 == FAKEHKEY || (int)a0 < 0)) {return ERROR_SUCCESS;} - return Real_RegDeleteKeyW(a0, a1); -} -LONG WINAPI Mine_RegDeleteValueA(HKEY a0, LPCSTR a1) -{ - if(CFilterMapper2::m_pFilterMapper2 && (a0 == FAKEHKEY || (int)a0 < 0)) {return ERROR_SUCCESS;} - return Real_RegDeleteValueA(a0, a1); -} -LONG WINAPI Mine_RegDeleteValueW(HKEY a0, LPCWSTR a1) -{ - if(CFilterMapper2::m_pFilterMapper2 && (a0 == FAKEHKEY || (int)a0 < 0)) {return ERROR_SUCCESS;} - return Real_RegDeleteValueW(a0, a1); -} -LONG WINAPI Mine_RegEnumKeyExA(HKEY a0, DWORD a1, LPSTR a2, LPDWORD a3, LPDWORD a4, LPSTR a5, LPDWORD a6, struct _FILETIME* a7) -{ - if(CFilterMapper2::m_pFilterMapper2 && a0 == FAKEHKEY) {return ERROR_NO_MORE_ITEMS;} - return Real_RegEnumKeyExA(a0, a1, a2, a3, a4, a5, a6, a7); -} -LONG WINAPI Mine_RegEnumKeyExW(HKEY a0, DWORD a1, LPWSTR a2, LPDWORD a3, LPDWORD a4, LPWSTR a5, LPDWORD a6, struct _FILETIME* a7) -{ - if(CFilterMapper2::m_pFilterMapper2 && a0 == FAKEHKEY) {return ERROR_NO_MORE_ITEMS;} - return Real_RegEnumKeyExW(a0, a1, a2, a3, a4, a5, a6, a7); -} -LONG WINAPI Mine_RegEnumValueA(HKEY a0, DWORD a1, LPSTR a2, LPDWORD a3, LPDWORD a4, LPDWORD a5, LPBYTE a6, LPDWORD a7) -{ - if(CFilterMapper2::m_pFilterMapper2 && a0 == FAKEHKEY) {return ERROR_NO_MORE_ITEMS;} - return Real_RegEnumValueA(a0, a1, a2, a3, a4, a5, a6, a7); -} -LONG WINAPI Mine_RegEnumValueW(HKEY a0, DWORD a1, LPWSTR a2, LPDWORD a3, LPDWORD a4, LPDWORD a5, LPBYTE a6, LPDWORD a7) -{ - if(CFilterMapper2::m_pFilterMapper2 && a0 == FAKEHKEY) {return ERROR_NO_MORE_ITEMS;} - return Real_RegEnumValueW(a0, a1, a2, a3, a4, a5, a6, a7); -} -LONG WINAPI Mine_RegOpenKeyA(HKEY a0, LPCSTR a1, PHKEY a2) -{ - if(CFilterMapper2::m_pFilterMapper2) {*a2 = FAKEHKEY; return ERROR_SUCCESS;} - return Real_RegOpenKeyA(a0, a1, a2); -} -LONG WINAPI Mine_RegOpenKeyW(HKEY a0, LPCWSTR a1, PHKEY a2) -{ - if(CFilterMapper2::m_pFilterMapper2) {*a2 = FAKEHKEY; return ERROR_SUCCESS;} - return Real_RegOpenKeyW(a0, a1, a2); -} -LONG WINAPI Mine_RegOpenKeyExA(HKEY a0, LPCSTR a1, DWORD a2, REGSAM a3, PHKEY a4) -{ - if(CFilterMapper2::m_pFilterMapper2 && (a3&(KEY_SET_VALUE|KEY_CREATE_SUB_KEY))) {*a4 = FAKEHKEY; return ERROR_SUCCESS;} - return Real_RegOpenKeyExA(a0, a1, a2, a3, a4); -} -LONG WINAPI Mine_RegOpenKeyExW(HKEY a0, LPCWSTR a1, DWORD a2, REGSAM a3, PHKEY a4) -{ - if(CFilterMapper2::m_pFilterMapper2 && (a3&(KEY_SET_VALUE|KEY_CREATE_SUB_KEY))) {*a4 = FAKEHKEY; return ERROR_SUCCESS;} - return Real_RegOpenKeyExW(a0, a1, a2, a3, a4); -} -LONG WINAPI Mine_RegQueryInfoKeyA(HKEY a0, LPSTR a1, LPDWORD a2, LPDWORD a3, LPDWORD a4, LPDWORD a5, LPDWORD a6, LPDWORD a7, LPDWORD a8, LPDWORD a9, LPDWORD a10, struct _FILETIME* a11) -{ - if(CFilterMapper2::m_pFilterMapper2 && a0 == FAKEHKEY) {return ERROR_INVALID_HANDLE;} - return Real_RegQueryInfoKeyA(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); -} -LONG WINAPI Mine_RegQueryInfoKeyW(HKEY a0, LPWSTR a1, LPDWORD a2, LPDWORD a3, LPDWORD a4, LPDWORD a5, LPDWORD a6, LPDWORD a7, LPDWORD a8, LPDWORD a9, LPDWORD a10, struct _FILETIME* a11) -{ - if(CFilterMapper2::m_pFilterMapper2 && a0 == FAKEHKEY) {return ERROR_INVALID_HANDLE;} - return Real_RegQueryInfoKeyW(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); -} -LONG WINAPI Mine_RegQueryValueA(HKEY a0, LPCSTR a1, LPSTR a2, PLONG a3) -{ - if(CFilterMapper2::m_pFilterMapper2 && a0 == FAKEHKEY) {*a3 = 0; return ERROR_SUCCESS;} - return Real_RegQueryValueA(a0, a1, a2, a3); -} -LONG WINAPI Mine_RegQueryValueW(HKEY a0, LPCWSTR a1, LPWSTR a2, PLONG a3) -{ - if(CFilterMapper2::m_pFilterMapper2 && a0 == FAKEHKEY) {*a3 = 0; return ERROR_SUCCESS;} - return Real_RegQueryValueW(a0, a1, a2, a3); -} -LONG WINAPI Mine_RegQueryValueExA(HKEY a0, LPCSTR a1, LPDWORD a2, LPDWORD a3, LPBYTE a4, LPDWORD a5) -{ - if(CFilterMapper2::m_pFilterMapper2 && a0 == FAKEHKEY) {*a5 = 0; return ERROR_SUCCESS;} - return Real_RegQueryValueExA(a0, a1, a2, a3, a4, a5); -} -LONG WINAPI Mine_RegQueryValueExW(HKEY a0, LPCWSTR a1, LPDWORD a2, LPDWORD a3, LPBYTE a4, LPDWORD a5) -{ - if(CFilterMapper2::m_pFilterMapper2 && a0 == FAKEHKEY) {*a5 = 0; return ERROR_SUCCESS;} - return Real_RegQueryValueExW(a0, a1, a2, a3, a4, a5); -} -LONG WINAPI Mine_RegSetValueA(HKEY a0, LPCSTR a1, DWORD a2, LPCSTR a3, DWORD a4) -{ - if(CFilterMapper2::m_pFilterMapper2 && (a0 == FAKEHKEY || (int)a0 < 0)) {return ERROR_SUCCESS;} - return Real_RegSetValueA(a0, a1, a2, a3, a4); -} -LONG WINAPI Mine_RegSetValueW(HKEY a0, LPCWSTR a1, DWORD a2, LPCWSTR a3, DWORD a4) -{ - if(CFilterMapper2::m_pFilterMapper2 && (a0 == FAKEHKEY || (int)a0 < 0)) {return ERROR_SUCCESS;} - return Real_RegSetValueW(a0, a1, a2, a3, a4); -} -LONG WINAPI Mine_RegSetValueExA(HKEY a0, LPCSTR a1, DWORD a2, DWORD a3, BYTE* a4, DWORD a5) -{ - if(CFilterMapper2::m_pFilterMapper2 && (a0 == FAKEHKEY || (int)a0 < 0)) {return ERROR_SUCCESS;} - return Real_RegSetValueExA(a0, a1, a2, a3, a4, a5); -} -LONG WINAPI Mine_RegSetValueExW(HKEY a0, LPCWSTR a1, DWORD a2, DWORD a3, BYTE* a4, DWORD a5) -{ - if(CFilterMapper2::m_pFilterMapper2 && (a0 == FAKEHKEY || (int)a0 < 0)) {return ERROR_SUCCESS;} - return Real_RegSetValueExW(a0, a1, a2, a3, a4, a5); -} - -// -// CFilterMapper2 -// - -IFilterMapper2* CFilterMapper2::m_pFilterMapper2 = NULL; - -bool CFilterMapper2::fInitialized = false; - -void CFilterMapper2::Init() -{ - if(!fInitialized) - { - DetourFunctionWithTrampoline((PBYTE)Real_CoCreateInstance, (PBYTE)Mine_CoCreateInstance); - DetourFunctionWithTrampoline((PBYTE)Real_RegCloseKey, (PBYTE)Mine_RegCloseKey); - DetourFunctionWithTrampoline((PBYTE)Real_RegFlushKey, (PBYTE)Mine_RegFlushKey); - DetourFunctionWithTrampoline((PBYTE)Real_RegCreateKeyA, (PBYTE)Mine_RegCreateKeyA); - DetourFunctionWithTrampoline((PBYTE)Real_RegCreateKeyW, (PBYTE)Mine_RegCreateKeyW); - DetourFunctionWithTrampoline((PBYTE)Real_RegCreateKeyExA, (PBYTE)Mine_RegCreateKeyExA); - DetourFunctionWithTrampoline((PBYTE)Real_RegCreateKeyExW, (PBYTE)Mine_RegCreateKeyExW); - DetourFunctionWithTrampoline((PBYTE)Real_RegDeleteKeyA, (PBYTE)Mine_RegDeleteKeyA); - DetourFunctionWithTrampoline((PBYTE)Real_RegDeleteKeyW, (PBYTE)Mine_RegDeleteKeyW); - DetourFunctionWithTrampoline((PBYTE)Real_RegDeleteValueA, (PBYTE)Mine_RegDeleteValueA); - DetourFunctionWithTrampoline((PBYTE)Real_RegDeleteValueW, (PBYTE)Mine_RegDeleteValueW); - DetourFunctionWithTrampoline((PBYTE)Real_RegEnumKeyExA, (PBYTE)Mine_RegEnumKeyExA); - DetourFunctionWithTrampoline((PBYTE)Real_RegEnumKeyExW, (PBYTE)Mine_RegEnumKeyExW); - DetourFunctionWithTrampoline((PBYTE)Real_RegEnumValueA, (PBYTE)Mine_RegEnumValueA); - DetourFunctionWithTrampoline((PBYTE)Real_RegEnumValueW, (PBYTE)Mine_RegEnumValueW); - DetourFunctionWithTrampoline((PBYTE)Real_RegOpenKeyA, (PBYTE)Mine_RegOpenKeyA); - DetourFunctionWithTrampoline((PBYTE)Real_RegOpenKeyW, (PBYTE)Mine_RegOpenKeyW); - DetourFunctionWithTrampoline((PBYTE)Real_RegOpenKeyExA, (PBYTE)Mine_RegOpenKeyExA); - DetourFunctionWithTrampoline((PBYTE)Real_RegOpenKeyExW, (PBYTE)Mine_RegOpenKeyExW); - DetourFunctionWithTrampoline((PBYTE)Real_RegQueryInfoKeyA, (PBYTE)Mine_RegQueryInfoKeyA); - DetourFunctionWithTrampoline((PBYTE)Real_RegQueryInfoKeyW, (PBYTE)Mine_RegQueryInfoKeyW); - DetourFunctionWithTrampoline((PBYTE)Real_RegQueryValueA, (PBYTE)Mine_RegQueryValueA); - DetourFunctionWithTrampoline((PBYTE)Real_RegQueryValueW, (PBYTE)Mine_RegQueryValueW); - DetourFunctionWithTrampoline((PBYTE)Real_RegQueryValueExA, (PBYTE)Mine_RegQueryValueExA); - DetourFunctionWithTrampoline((PBYTE)Real_RegQueryValueExW, (PBYTE)Mine_RegQueryValueExW); - DetourFunctionWithTrampoline((PBYTE)Real_RegSetValueA, (PBYTE)Mine_RegSetValueA); - DetourFunctionWithTrampoline((PBYTE)Real_RegSetValueW, (PBYTE)Mine_RegSetValueW); - DetourFunctionWithTrampoline((PBYTE)Real_RegSetValueExA, (PBYTE)Mine_RegSetValueExA); - DetourFunctionWithTrampoline((PBYTE)Real_RegSetValueExW, (PBYTE)Mine_RegSetValueExW); - - fInitialized = true; - } -} - -CFilterMapper2::CFilterMapper2(bool fRefCounted, bool fAllowUnreg, LPUNKNOWN pUnkOuter) - : CUnknown(NAME("CFilterMapper2"), pUnkOuter) - , m_fRefCounted(fRefCounted), m_fAllowUnreg(fAllowUnreg) -{ - m_cRef = fRefCounted ? 0 : 1; - - Init(); - - HRESULT hr = Real_CoCreateInstance( - CLSID_FilterMapper2, (IUnknown*)(INonDelegatingUnknown*)this, CLSCTX_ALL, - __uuidof(IUnknown), (void**)&m_pFM2); - if(FAILED(hr) || !m_pFM2) - { - ASSERT(0); - return; - } -} - -CFilterMapper2::~CFilterMapper2() -{ - POSITION pos = m_filters.GetHeadPosition(); - while(pos) delete m_filters.GetNext(pos); -} - -STDMETHODIMP CFilterMapper2::NonDelegatingQueryInterface(REFIID riid, void** ppv) -{ - if(riid == __uuidof(IFilterMapper2)) - return GetInterface((IFilterMapper2*)this, ppv); - - HRESULT hr = m_pFM2 ? m_pFM2->QueryInterface(riid, ppv) : E_NOINTERFACE; - - return - SUCCEEDED(hr) ? hr : - __super::NonDelegatingQueryInterface(riid, ppv); -} - -void CFilterMapper2::Register(CString path) -{ - if(HMODULE h = LoadLibrary(path)) - { - typedef HRESULT (__stdcall * PDllRegisterServer)(); - if(PDllRegisterServer p = (PDllRegisterServer)GetProcAddress(h, "DllRegisterServer")) - { - ASSERT(CFilterMapper2::m_pFilterMapper2 == NULL); - - CFilterMapper2::m_pFilterMapper2 = this; - m_path = path; - p(); - m_path.Empty(); - CFilterMapper2::m_pFilterMapper2 = NULL; - } - - FreeLibrary(h); - } -} - -// IFilterMapper2 - -STDMETHODIMP CFilterMapper2::CreateCategory(REFCLSID clsidCategory, DWORD dwCategoryMerit, LPCWSTR Description) -{ - if(!m_path.IsEmpty()) - { - return S_OK; - } - else if(CComQIPtr pFM2 = m_pFM2) - { - return pFM2->CreateCategory(clsidCategory, dwCategoryMerit, Description); - } - - return E_NOTIMPL; -} - -STDMETHODIMP CFilterMapper2::UnregisterFilter(const CLSID* pclsidCategory, const OLECHAR* szInstance, REFCLSID Filter) -{ - if(!m_path.IsEmpty()) - { - return S_OK; - } - else if(CComQIPtr pFM2 = m_pFM2) - { - return m_fAllowUnreg - ? pFM2->UnregisterFilter(pclsidCategory, szInstance, Filter) - : S_OK; - } - - return E_NOTIMPL; -} - -STDMETHODIMP CFilterMapper2::RegisterFilter(REFCLSID clsidFilter, LPCWSTR Name, IMoniker** ppMoniker, const CLSID* pclsidCategory, const OLECHAR* szInstance, const REGFILTER2* prf2) -{ - if(!m_path.IsEmpty()) - { - if(FilterOverride* f = new FilterOverride) - { - f->fDisabled = false; - f->type = FilterOverride::EXTERNAL; - f->path = m_path; - f->name = CStringW(Name); - f->clsid = clsidFilter; - f->iLoadType = FilterOverride::MERIT; - f->dwMerit = prf2->dwMerit; - - if(prf2->dwVersion == 1) - { - for(ULONG i = 0; i < prf2->cPins; i++) - { - const REGFILTERPINS& rgPin = prf2->rgPins[i]; - if(rgPin.bOutput) continue; - - for(UINT i = 0; i < rgPin.nMediaTypes; i++) - { - if(!rgPin.lpMediaType[i].clsMajorType || !rgPin.lpMediaType[i].clsMinorType) break; - f->guids.AddTail(*rgPin.lpMediaType[i].clsMajorType); - f->guids.AddTail(*rgPin.lpMediaType[i].clsMinorType); - } - } - } - else if(prf2->dwVersion == 2) - { - for(ULONG i = 0; i < prf2->cPins2; i++) - { - const REGFILTERPINS2& rgPin = prf2->rgPins2[i]; - if(rgPin.dwFlags®_PINFLAG_B_OUTPUT) continue; - - for(UINT i = 0; i < rgPin.nMediaTypes; i++) - { - if(!rgPin.lpMediaType[i].clsMajorType || !rgPin.lpMediaType[i].clsMinorType) break; - f->guids.AddTail(*rgPin.lpMediaType[i].clsMajorType); - f->guids.AddTail(*rgPin.lpMediaType[i].clsMinorType); - } - } - } - - f->backup.AddTailList(&f->guids); - - m_filters.AddTail(f); - } - - return S_OK; - } - else if(CComQIPtr pFM2 = m_pFM2) - { - return pFM2->RegisterFilter(clsidFilter, Name, ppMoniker, pclsidCategory, szInstance, prf2); - } - - return E_NOTIMPL; -} - -STDMETHODIMP CFilterMapper2::EnumMatchingFilters(IEnumMoniker** ppEnum, DWORD dwFlags, BOOL bExactMatch, DWORD dwMerit, - BOOL bInputNeeded, DWORD cInputTypes, const GUID* pInputTypes, const REGPINMEDIUM* pMedIn, const CLSID* pPinCategoryIn, BOOL bRender, - BOOL bOutputNeeded, DWORD cOutputTypes, const GUID* pOutputTypes, const REGPINMEDIUM* pMedOut, const CLSID* pPinCategoryOut) -{ - if(CComQIPtr pFM2 = m_pFM2) - { - pFM2->EnumMatchingFilters(ppEnum, dwFlags, bExactMatch, dwMerit, - bInputNeeded, cInputTypes, pInputTypes, pMedIn, pPinCategoryIn, bRender, - bOutputNeeded, cOutputTypes, pOutputTypes, pMedOut, pPinCategoryOut); - } - - return E_NOTIMPL; -} diff --git a/src/apps/mplayerc/FakeFilterMapper2.h b/src/apps/mplayerc/FakeFilterMapper2.h deleted file mode 100644 index 88f071cb3..000000000 --- a/src/apps/mplayerc/FakeFilterMapper2.h +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#pragma once - -#include - -class FilterOverride -{ -public: - bool fDisabled, fTemporary; - enum {REGISTERED, EXTERNAL} type; - // REGISTERED - CStringW dispname; - // EXTERNAL - CString path, name; - CLSID clsid; - // props - CAtlList guids, backup; - enum {PREFERRED, BLOCK, MERIT}; - int iLoadType; - DWORD dwMerit; - - FilterOverride() {fTemporary = false;} - FilterOverride(FilterOverride* f) - { - fDisabled = f->fDisabled; - fTemporary = f->fTemporary; - type = f->type; - dispname = f->dispname; - path = f->path; - name = f->name; - clsid = f->clsid; - guids.AddTailList(&f->guids); - backup.AddTailList(&f->backup); - iLoadType = f->iLoadType; - dwMerit = f->dwMerit; - } -}; -/* -class CFilterMapper2 : protected CUnknown, protected IFilterMapper2 -{ - static bool fInitialized; - - CComPtr m_pFM2; - CString m_path; - -protected: - DECLARE_IUNKNOWN; - STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv); - - // IFilterMapper2 - - STDMETHODIMP CreateCategory(REFCLSID clsidCategory, DWORD dwCategoryMerit, LPCWSTR Description); - STDMETHODIMP UnregisterFilter(const CLSID* pclsidCategory, const OLECHAR* szInstance, REFCLSID Filter); - STDMETHODIMP RegisterFilter(REFCLSID clsidFilter, LPCWSTR Name, IMoniker** ppMoniker, const CLSID* pclsidCategory, const OLECHAR* szInstance, const REGFILTER2* prf2); - STDMETHODIMP EnumMatchingFilters(IEnumMoniker** ppEnum, DWORD dwFlags, BOOL bExactMatch, DWORD dwMerit, - BOOL bInputNeeded, DWORD cInputTypes, const GUID* pInputTypes, const REGPINMEDIUM* pMedIn, const CLSID* pPinCategoryIn, BOOL bRender, - BOOL bOutputNeeded, DWORD cOutputTypes, const GUID* pOutputTypes, const REGPINMEDIUM* pMedOut, const CLSID* pPinCategoryOut); - -public: - CFilterMapper2(); - virtual ~CFilterMapper2(); - - static void Init(); - - static IFilterMapper2* m_pFilterMapper2; - CList m_filters; - void Register(CString path); -}; -*/ - -class CFilterMapper2 : protected CUnknown, public IFilterMapper2 -{ - static bool fInitialized; - - CComPtr m_pFM2; - CString m_path; - - bool m_fRefCounted, m_fAllowUnreg; - -protected: - DECLARE_IUNKNOWN; - STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv); - - // IFilterMapper2 - - STDMETHODIMP CreateCategory(REFCLSID clsidCategory, DWORD dwCategoryMerit, LPCWSTR Description); - STDMETHODIMP UnregisterFilter(const CLSID* pclsidCategory, const OLECHAR* szInstance, REFCLSID Filter); - STDMETHODIMP RegisterFilter(REFCLSID clsidFilter, LPCWSTR Name, IMoniker** ppMoniker, const CLSID* pclsidCategory, const OLECHAR* szInstance, const REGFILTER2* prf2); - STDMETHODIMP EnumMatchingFilters(IEnumMoniker** ppEnum, DWORD dwFlags, BOOL bExactMatch, DWORD dwMerit, - BOOL bInputNeeded, DWORD cInputTypes, const GUID* pInputTypes, const REGPINMEDIUM* pMedIn, const CLSID* pPinCategoryIn, BOOL bRender, - BOOL bOutputNeeded, DWORD cOutputTypes, const GUID* pOutputTypes, const REGPINMEDIUM* pMedOut, const CLSID* pPinCategoryOut); - -public: - CFilterMapper2(bool fRefCounted, bool fAllowUnreg = false, LPUNKNOWN pUnkOuter = NULL); - virtual ~CFilterMapper2(); - - void SetInner(IUnknown* pUnk) {m_pFM2 = pUnk;} - - static void Init(); - - static IFilterMapper2* m_pFilterMapper2; - CList m_filters; - void Register(CString path); -}; diff --git a/src/apps/mplayerc/FavoriteAddDlg.cpp b/src/apps/mplayerc/FavoriteAddDlg.cpp deleted file mode 100644 index 9ecee1fac..000000000 --- a/src/apps/mplayerc/FavoriteAddDlg.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -// FavoritAddDlg.cpp : implementation file -// - -#include "stdafx.h" -#include "mplayerc.h" -#include "FavoriteAddDlg.h" - - -// CFavoriteAddDlg dialog - -IMPLEMENT_DYNAMIC(CFavoriteAddDlg, CCmdUIDialog) -CFavoriteAddDlg::CFavoriteAddDlg(CString shortname, CString fullname, CWnd* pParent /*=NULL*/) - : CCmdUIDialog(CFavoriteAddDlg::IDD, pParent) - , m_shortname(shortname) - , m_fullname(fullname) - , m_fRememberPos(TRUE) -{ -} - -CFavoriteAddDlg::~CFavoriteAddDlg() -{ -} - -void CFavoriteAddDlg::DoDataExchange(CDataExchange* pDX) -{ - __super::DoDataExchange(pDX); - DDX_Control(pDX, IDC_COMBO1, m_namectrl); - DDX_CBString(pDX, IDC_COMBO1, m_name); - DDX_Check(pDX, IDC_CHECK1, m_fRememberPos); -} - -BOOL CFavoriteAddDlg::OnInitDialog() -{ - __super::OnInitDialog(); - - if(!m_shortname.IsEmpty()) m_namectrl.AddString(m_shortname); - if(!m_fullname.IsEmpty()) m_namectrl.AddString(m_fullname); - m_namectrl.SetCurSel(0); - - ::CorrectComboListWidth(m_namectrl, GetFont()); - - return TRUE; // return TRUE unless you set the focus to a control - // EXCEPTION: OCX Property Pages should return FALSE -} - - -BEGIN_MESSAGE_MAP(CFavoriteAddDlg, CCmdUIDialog) - ON_UPDATE_COMMAND_UI(IDOK, OnUpdateOk) -END_MESSAGE_MAP() - - -// CFavoriteAddDlg message handlers - -void CFavoriteAddDlg::OnUpdateOk(CCmdUI* pCmdUI) -{ - UpdateData(); - pCmdUI->Enable(!m_name.IsEmpty()); -} diff --git a/src/apps/mplayerc/FavoriteAddDlg.h b/src/apps/mplayerc/FavoriteAddDlg.h deleted file mode 100644 index 20c1e953e..000000000 --- a/src/apps/mplayerc/FavoriteAddDlg.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#pragma once - -// CFavoriteAddDlg dialog - -class CFavoriteAddDlg : public CCmdUIDialog -{ - DECLARE_DYNAMIC(CFavoriteAddDlg) - -private: - CString m_shortname, m_fullname; - -public: - CFavoriteAddDlg(CString shortname, CString fullname, CWnd* pParent = NULL); // standard constructor - virtual ~CFavoriteAddDlg(); - -// Dialog Data - enum { IDD = IDD_FAVADD }; - - CComboBox m_namectrl; - CString m_name; - BOOL m_fRememberPos; - -protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - virtual BOOL OnInitDialog(); - - DECLARE_MESSAGE_MAP() - -public: - afx_msg void OnUpdateOk(CCmdUI* pCmdUI); -}; diff --git a/src/apps/mplayerc/FavoriteOrganizeDlg.cpp b/src/apps/mplayerc/FavoriteOrganizeDlg.cpp deleted file mode 100644 index 01345f080..000000000 --- a/src/apps/mplayerc/FavoriteOrganizeDlg.cpp +++ /dev/null @@ -1,284 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -// FavoriteOrganizeDlg.cpp : implementation file -// - -#include "stdafx.h" -#include "mplayerc.h" -#include "FavoriteOrganizeDlg.h" - - -// CFavoriteOrganizeDlg dialog - -//IMPLEMENT_DYNAMIC(CFavoriteOrganizeDlg, CResizableDialog) -CFavoriteOrganizeDlg::CFavoriteOrganizeDlg(CWnd* pParent /*=NULL*/) - : CResizableDialog(CFavoriteOrganizeDlg::IDD, pParent) -{ -} - -CFavoriteOrganizeDlg::~CFavoriteOrganizeDlg() -{ -} - -void CFavoriteOrganizeDlg::SetupList(bool fSave) -{ - int i = m_tab.GetCurSel(); - - if(fSave) - { - CAtlList sl; - - for(int j = 0; j < m_list.GetItemCount(); j++) - { - CString desc = m_list.GetItemText(j, 0); - desc.Remove(';'); - CString str = m_sl[i].GetAt((POSITION)m_list.GetItemData(j)); - sl.AddTail(desc + str.Mid(str.Find(';'))); - } - - m_sl[i].RemoveAll(); - m_sl[i].AddTailList(&sl); - } - else - { - m_list.DeleteAllItems(); - - POSITION pos = m_sl[i].GetHeadPosition(), tmp; - while(pos) - { - tmp = pos; - CString s = m_sl[i].GetNext(pos); - int i = s.Find(';'); - if(i >= 0) s = s.Left(i); - m_list.SetItemData(m_list.InsertItem(m_list.GetItemCount(), s), (DWORD_PTR)tmp); - } - - m_list.SetRedraw(FALSE); - - CRect r; - m_list.GetClientRect(r); - m_list.SetColumnWidth(0, -1); - m_list.SetColumnWidth(0, max(m_list.GetColumnWidth(0), r.Size().cx)); - - m_list.SetRedraw(TRUE); - } -} - -void CFavoriteOrganizeDlg::DoDataExchange(CDataExchange* pDX) -{ - __super::DoDataExchange(pDX); - DDX_Control(pDX, IDC_TAB1, m_tab); - DDX_Control(pDX, IDC_LIST2, m_list); -} - - -BEGIN_MESSAGE_MAP(CFavoriteOrganizeDlg, CResizableDialog) - ON_NOTIFY(TCN_SELCHANGE, IDC_TAB1, OnTcnSelchangeTab1) - ON_WM_DRAWITEM() - ON_BN_CLICKED(IDC_BUTTON1, OnBnClickedButton1) - ON_BN_CLICKED(IDC_BUTTON2, OnBnClickedButton2) - ON_BN_CLICKED(IDC_BUTTON3, OnBnClickedButton3) - ON_BN_CLICKED(IDC_BUTTON4, OnBnClickedButton7) - ON_NOTIFY(TCN_SELCHANGING, IDC_TAB1, OnTcnSelchangingTab1) - ON_BN_CLICKED(IDOK, OnBnClickedOk) - ON_WM_ACTIVATE() - ON_NOTIFY(LVN_ENDLABELEDIT, IDC_LIST2, OnLvnEndlabeleditList2) - ON_WM_SIZE() -END_MESSAGE_MAP() - - -// CFavoriteOrganizeDlg message handlers - -BOOL CFavoriteOrganizeDlg::OnInitDialog() -{ - __super::OnInitDialog(); - - m_tab.InsertItem(0, ResStr(IDS_FAVFILES)); - m_tab.InsertItem(1, ResStr(IDS_FAVDVDS)); -// m_tab.InsertItem(2, ResStr(IDS_FAVDEVICES)); - m_tab.SetCurSel(0); - - m_list.InsertColumn(0, _T("")); - m_list.SetExtendedStyle(m_list.GetExtendedStyle()|LVS_EX_FULLROWSELECT); - - AfxGetAppSettings().GetFav(FAV_FILE, m_sl[0]); - AfxGetAppSettings().GetFav(FAV_DVD, m_sl[1]); - AfxGetAppSettings().GetFav(FAV_DEVICE, m_sl[2]); - - SetupList(false); - - AddAnchor(IDC_TAB1, TOP_LEFT, BOTTOM_RIGHT); - AddAnchor(IDC_LIST2, TOP_LEFT, BOTTOM_RIGHT); - AddAnchor(IDC_BUTTON1, TOP_RIGHT); - AddAnchor(IDC_BUTTON2, TOP_RIGHT); - AddAnchor(IDC_BUTTON3, TOP_RIGHT); - AddAnchor(IDC_BUTTON4, TOP_RIGHT); - AddAnchor(IDOK, BOTTOM_RIGHT); - - return TRUE; // return TRUE unless you set the focus to a control - // EXCEPTION: OCX Property Pages should return FALSE -} - -void CFavoriteOrganizeDlg::OnTcnSelchangeTab1(NMHDR* pNMHDR, LRESULT* pResult) -{ - SetupList(false); - - m_list.SetWindowPos(&wndTop, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE); - - *pResult = 0; -} - -void CFavoriteOrganizeDlg::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct) -{ - if(nIDCtl != IDC_LIST2) return; - - int nItem = lpDrawItemStruct->itemID; - CRect rcItem = lpDrawItemStruct->rcItem; - - CDC* pDC = CDC::FromHandle(lpDrawItemStruct->hDC); - - if(!!m_list.GetItemState(nItem, LVIS_SELECTED)) - { - FillRect(pDC->m_hDC, rcItem, CBrush(0xf1dacc)); - FrameRect(pDC->m_hDC, rcItem, CBrush(0xc56a31)); - } - else - { - CBrush b; - b.CreateSysColorBrush(COLOR_WINDOW); - FillRect(pDC->m_hDC, rcItem, b); - } - - CString str = m_list.GetItemText(nItem, 0); - - pDC->SetTextColor(0); - pDC->TextOut(rcItem.left+3, (rcItem.top+rcItem.bottom - pDC->GetTextExtent(str).cy)/2, str); -} - -void CFavoriteOrganizeDlg::OnBnClickedButton1() -{ - if(POSITION pos = m_list.GetFirstSelectedItemPosition()) - { - m_list.SetFocus(); - m_list.EditLabel(m_list.GetNextSelectedItem(pos)); - } -} - -void CFavoriteOrganizeDlg::OnLvnEndlabeleditList2(NMHDR* pNMHDR, LRESULT* pResult) -{ - NMLVDISPINFO* pDispInfo = reinterpret_cast(pNMHDR); - if(pDispInfo->item.iItem >= 0 && pDispInfo->item.pszText) - m_list.SetItemText(pDispInfo->item.iItem, 0, pDispInfo->item.pszText); - *pResult = 0; -} - -void CFavoriteOrganizeDlg::OnBnClickedButton2() -{ - if(POSITION pos = m_list.GetFirstSelectedItemPosition()) - { - int nItem = m_list.GetNextSelectedItem(pos); - if(nItem < 0 || nItem >= m_list.GetItemCount()) return; - - m_list.DeleteItem(nItem); - - nItem = min(nItem, m_list.GetItemCount()-1); - - m_list.SetSelectionMark(nItem); - m_list.SetItemState(nItem, LVIS_SELECTED, LVIS_SELECTED); - } -} - -void CFavoriteOrganizeDlg::OnBnClickedButton3() -{ - if(POSITION pos = m_list.GetFirstSelectedItemPosition()) - { - int nItem = m_list.GetNextSelectedItem(pos); - if(nItem <= 0) return; - - DWORD_PTR data = m_list.GetItemData(nItem); - CString str = m_list.GetItemText(nItem, 0); - - m_list.DeleteItem(nItem); - - nItem--; - - m_list.InsertItem(nItem, str); - m_list.SetItemData(nItem, data); - m_list.SetSelectionMark(nItem); - m_list.SetItemState(nItem, LVIS_SELECTED, LVIS_SELECTED); - } -} - -void CFavoriteOrganizeDlg::OnBnClickedButton7() -{ - if(POSITION pos = m_list.GetFirstSelectedItemPosition()) - { - int nItem = m_list.GetNextSelectedItem(pos); - if(nItem < 0 || nItem >= m_list.GetItemCount()-1) return; - - DWORD_PTR data = m_list.GetItemData(nItem); - CString str = m_list.GetItemText(nItem, 0); - - m_list.DeleteItem(nItem); - - nItem++; - - m_list.InsertItem(nItem, str); - m_list.SetItemData(nItem, data); - m_list.SetSelectionMark(nItem); - m_list.SetItemState(nItem, LVIS_SELECTED, LVIS_SELECTED); - } -} - -void CFavoriteOrganizeDlg::OnTcnSelchangingTab1(NMHDR *pNMHDR, LRESULT *pResult) -{ - SetupList(true); - - *pResult = 0; -} - -void CFavoriteOrganizeDlg::OnBnClickedOk() -{ - SetupList(true); - - AfxGetAppSettings().SetFav(FAV_FILE, m_sl[0]); - AfxGetAppSettings().SetFav(FAV_DVD, m_sl[1]); - AfxGetAppSettings().SetFav(FAV_DEVICE, m_sl[2]); - - OnOK(); -} - -void CFavoriteOrganizeDlg::OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized) -{ - __super::OnActivate(nState, pWndOther, bMinimized); - - if(nState == WA_ACTIVE) - m_list.SetWindowPos(&wndTop, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE); -} - -void CFavoriteOrganizeDlg::OnSize(UINT nType, int cx, int cy) -{ - __super::OnSize(nType, cx, cy); - - if(IsWindow(m_list)) - m_list.SetColumnWidth(0, LVSCW_AUTOSIZE_USEHEADER); -} diff --git a/src/apps/mplayerc/FavoriteOrganizeDlg.h b/src/apps/mplayerc/FavoriteOrganizeDlg.h deleted file mode 100644 index 59c1be17f..000000000 --- a/src/apps/mplayerc/FavoriteOrganizeDlg.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#pragma once -#include "afxcmn.h" -#include "afxwin.h" -#include "..\..\ui\ResizableLib\ResizableDialog.h" - - -// CFavoriteOrganizeDlg dialog - -class CFavoriteOrganizeDlg : public CResizableDialog -{ -// DECLARE_DYNAMIC(CFavoriteOrganizeDlg) - -private: - CAtlList m_sl[3]; - void SetupList(bool fSave); - -public: - CFavoriteOrganizeDlg(CWnd* pParent = NULL); // standard constructor - virtual ~CFavoriteOrganizeDlg(); - -// Dialog Data - enum { IDD = IDD_FAVORGANIZE }; - - CTabCtrl m_tab; - CListCtrl m_list; - -protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - virtual BOOL OnInitDialog(); - - DECLARE_MESSAGE_MAP() -public: - afx_msg void OnTcnSelchangeTab1(NMHDR *pNMHDR, LRESULT *pResult); - afx_msg void OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct); - afx_msg void OnBnClickedButton1(); - afx_msg void OnBnClickedButton2(); - afx_msg void OnBnClickedButton3(); - afx_msg void OnBnClickedButton7(); - afx_msg void OnTcnSelchangingTab1(NMHDR *pNMHDR, LRESULT *pResult); - afx_msg void OnBnClickedOk(); - afx_msg void OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized); - afx_msg void OnLvnEndlabeleditList2(NMHDR *pNMHDR, LRESULT *pResult); - afx_msg void OnSize(UINT nType, int cx, int cy); -}; diff --git a/src/apps/mplayerc/FileDropTarget.cpp b/src/apps/mplayerc/FileDropTarget.cpp deleted file mode 100644 index 4243d82eb..000000000 --- a/src/apps/mplayerc/FileDropTarget.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -// FileDropTarget.cpp : implementation file -// - -#include "stdafx.h" -#include "mplayerc.h" -#include "FileDropTarget.h" - - -// CFileDropTarget - -//IMPLEMENT_DYNAMIC(CFileDropTarget, COleDropTarget) -CFileDropTarget::CFileDropTarget(CDropTarget* pDropTarget) - : m_pDropTarget(pDropTarget) -{ - ASSERT(m_pDropTarget); -} - -CFileDropTarget::~CFileDropTarget() -{ -} - -DROPEFFECT CFileDropTarget::OnDragEnter(CWnd* pWnd, COleDataObject* pDataObject, DWORD dwKeyState, CPoint point) -{ - return m_pDropTarget ? m_pDropTarget->OnDragEnter(pDataObject, dwKeyState, point) : DROPEFFECT_NONE; -} - -DROPEFFECT CFileDropTarget::OnDragOver(CWnd* pWnd, COleDataObject* pDataObject, DWORD dwKeyState, CPoint point) -{ - return m_pDropTarget ? m_pDropTarget->OnDragOver(pDataObject, dwKeyState, point) : DROPEFFECT_NONE; -} - -BOOL CFileDropTarget::OnDrop(CWnd* pWnd, COleDataObject* pDataObject, DROPEFFECT dropEffect, CPoint point) -{ - return m_pDropTarget ? m_pDropTarget->OnDrop(pDataObject, dropEffect, point) : DROPEFFECT_NONE; -} - -DROPEFFECT CFileDropTarget::OnDropEx(CWnd* pWnd, COleDataObject* pDataObject, DROPEFFECT dropDefault, DROPEFFECT dropList, CPoint point) -{ - return m_pDropTarget ? m_pDropTarget->OnDropEx(pDataObject, dropDefault, dropList, point) : DROPEFFECT_NONE; -} - -void CFileDropTarget::OnDragLeave(CWnd* pWnd) -{ - if(m_pDropTarget) m_pDropTarget->OnDragLeave(); -} - -DROPEFFECT CFileDropTarget::OnDragScroll(CWnd* pWnd, DWORD dwKeyState, CPoint point) -{ - return m_pDropTarget ? m_pDropTarget->OnDragScroll(dwKeyState, point) : DROPEFFECT_NONE; -} - -BEGIN_MESSAGE_MAP(CFileDropTarget, COleDropTarget) -END_MESSAGE_MAP() - - - -// CFileDropTarget message handlers diff --git a/src/apps/mplayerc/FileDropTarget.h b/src/apps/mplayerc/FileDropTarget.h deleted file mode 100644 index 79db45449..000000000 --- a/src/apps/mplayerc/FileDropTarget.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#pragma once - -#include - -class CDropTarget -{ -public: - CDropTarget() {} - - virtual DROPEFFECT OnDragEnter(COleDataObject* pDataObject, DWORD dwKeyState, CPoint point) {return DROPEFFECT_NONE;} - virtual DROPEFFECT OnDragOver(COleDataObject* pDataObject, DWORD dwKeyState, CPoint point) {return DROPEFFECT_NONE;} - virtual BOOL OnDrop(COleDataObject* pDataObject, DROPEFFECT dropEffect, CPoint point) {return FALSE;} - virtual DROPEFFECT OnDropEx(COleDataObject* pDataObject, DROPEFFECT dropDefault, DROPEFFECT dropList, CPoint point) {return (DROPEFFECT)-1;} - virtual void OnDragLeave() {} - virtual DROPEFFECT OnDragScroll(DWORD dwKeyState, CPoint point) {return DROPEFFECT_NONE;} -}; - -// CFileDropTarget command target - -class CFileDropTarget : public COleDropTarget -{ -// DECLARE_DYNAMIC(CFileDropTarget) - -private: - CDropTarget* m_pDropTarget; - -public: - CFileDropTarget(CDropTarget* pDropTarget); - virtual ~CFileDropTarget(); - -protected: - DECLARE_MESSAGE_MAP() - - DROPEFFECT OnDragEnter(CWnd* pWnd, COleDataObject* pDataObject, DWORD dwKeyState, CPoint point); - DROPEFFECT OnDragOver(CWnd* pWnd, COleDataObject* pDataObject, DWORD dwKeyState, CPoint point); - BOOL OnDrop(CWnd* pWnd, COleDataObject* pDataObject, DROPEFFECT dropEffect, CPoint point); - DROPEFFECT OnDropEx(CWnd* pWnd, COleDataObject* pDataObject, DROPEFFECT dropDefault, DROPEFFECT dropList, CPoint point); - void OnDragLeave(CWnd* pWnd); - DROPEFFECT OnDragScroll(CWnd* pWnd, DWORD dwKeyState, CPoint point); -}; - - diff --git a/src/apps/mplayerc/FloatEdit.cpp b/src/apps/mplayerc/FloatEdit.cpp deleted file mode 100644 index f437d89ea..000000000 --- a/src/apps/mplayerc/FloatEdit.cpp +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include "stdafx.h" -#include "floatedit.h" - -// CFloatEdit - -IMPLEMENT_DYNAMIC(CFloatEdit, CEdit) - -bool CFloatEdit::GetFloat(float& f) -{ - CString s; - GetWindowText(s); - return(_stscanf(s, _T("%f"), &f) == 1); -} - -double CFloatEdit::operator = (double d) -{ - CString s; - s.Format(_T("%.4f"), d); - SetWindowText(s); - return(d); -} - -CFloatEdit::operator double() -{ - CString s; - GetWindowText(s); - float f; - return(_stscanf(s, _T("%f"), &f) == 1 ? f : 0); -} - -BEGIN_MESSAGE_MAP(CFloatEdit, CEdit) - ON_WM_CHAR() -END_MESSAGE_MAP() - -void CFloatEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags) -{ - if(!(nChar >= '0' && nChar <= '9' || nChar == '.' || nChar == '\b')) - return; - - CString str; - GetWindowText(str); - - if(nChar == '.' && (str.Find('.') >= 0 || str.IsEmpty())) - return; - - int nStartChar, nEndChar; - GetSel(nStartChar, nEndChar); - - if(nChar == '\b' && nStartChar <= 0) - return; - - CEdit::OnChar(nChar, nRepCnt, nFlags); -} - -// CIntEdit - -IMPLEMENT_DYNAMIC(CIntEdit, CEdit) - -BEGIN_MESSAGE_MAP(CIntEdit, CEdit) - ON_WM_CHAR() -END_MESSAGE_MAP() - -void CIntEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags) -{ - if(!(nChar >= '0' && nChar <= '9' || nChar == '-' || nChar == '\b')) - return; - - CString str; - GetWindowText(str); - - if(nChar == '-' && !str.IsEmpty() && str[0] == '-') - return; - - int nStartChar, nEndChar; - GetSel(nStartChar, nEndChar); - - if(nChar == '\b' && nStartChar <= 0) - return; - - if(nChar == '-' && (nStartChar != 0 || nEndChar != 0)) - return; - - CEdit::OnChar(nChar, nRepCnt, nFlags); -} - -// CHexEdit - -IMPLEMENT_DYNAMIC(CHexEdit, CEdit) - -bool CHexEdit::GetDWORD(DWORD& dw) -{ - CString s; - GetWindowText(s); - return(_stscanf(s, _T("%x"), &dw) == 1); -} - -DWORD CHexEdit::operator = (DWORD dw) -{ - CString s; - s.Format(_T("%08x"), dw); - SetWindowText(s); - return(dw); -} - -CHexEdit::operator DWORD() -{ - CString s; - GetWindowText(s); - DWORD dw; - return(_stscanf(s, _T("%x"), &dw) == 1 ? dw : 0); -} - -BEGIN_MESSAGE_MAP(CHexEdit, CEdit) - ON_WM_CHAR() -END_MESSAGE_MAP() - -void CHexEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags) -{ - if(!(nChar >= 'A' && nChar <= 'F' || nChar >= 'a' && nChar <= 'f' - || nChar >= '0' && nChar <= '9' || nChar == '\b')) - return; - - CString str; - GetWindowText(str); - - int nStartChar, nEndChar; - GetSel(nStartChar, nEndChar); - - if(nChar == '\b' && nStartChar <= 0) - return; - - if(nChar != '\b' && nEndChar - nStartChar == 0 && str.GetLength() >= 8) - return; - - CEdit::OnChar(nChar, nRepCnt, nFlags); -} diff --git a/src/apps/mplayerc/FloatEdit.h b/src/apps/mplayerc/FloatEdit.h deleted file mode 100644 index 8abb97582..000000000 --- a/src/apps/mplayerc/FloatEdit.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#pragma once - -// CFloatEdit - -class CFloatEdit : public CEdit -{ -public: - bool GetFloat(float& f); - double operator = (double d); - operator double(); - - DECLARE_DYNAMIC(CFloatEdit) - DECLARE_MESSAGE_MAP() - -public: - afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags); -}; - -// CIntEdit - -class CIntEdit : public CEdit -{ -public: - DECLARE_DYNAMIC(CIntEdit) - DECLARE_MESSAGE_MAP() - -public: - afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags); -}; - -// CHexEdit - -class CHexEdit : public CEdit -{ -public: - bool GetDWORD(DWORD& dw); - DWORD operator = (DWORD dw); - operator DWORD(); - - DECLARE_DYNAMIC(CHexEdit) - DECLARE_MESSAGE_MAP() - -public: - afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags); -}; diff --git a/src/apps/mplayerc/GoToDlg.cpp b/src/apps/mplayerc/GoToDlg.cpp deleted file mode 100644 index aebe09d46..000000000 --- a/src/apps/mplayerc/GoToDlg.cpp +++ /dev/null @@ -1,204 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -// GoToDlg.cpp : implementation file -// - -#include "stdafx.h" -#include "mplayerc.h" -#include "GoToDlg.h" - -#include - - -// CGoToDlg dialog - -IMPLEMENT_DYNAMIC(CGoToDlg, CDialog) -CGoToDlg::CGoToDlg(int time, float fps, CWnd* pParent /*=NULL*/) - : CDialog(CGoToDlg::IDD, pParent) - , m_timestr(_T("")) - , m_framestr(_T("")) - , m_time(time) - , m_fps(fps) -{ - if(m_fps == 0) - { - CString str = AfxGetApp()->GetProfileString(ResStr(IDS_R_SETTINGS), _T("fps"), _T("0")); - if(_stscanf(str, _T("%f"), &m_fps) != 1) m_fps = 0; - } -} - -CGoToDlg::~CGoToDlg() -{ -} - -void CGoToDlg::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - DDX_Text(pDX, IDC_EDIT1, m_timestr); - DDX_Text(pDX, IDC_EDIT2, m_framestr); - DDX_Control(pDX, IDC_EDIT1, m_timeedit); - DDX_Control(pDX, IDC_EDIT2, m_frameedit); -} - -BOOL CGoToDlg::OnInitDialog() -{ - CDialog::OnInitDialog(); - - if(m_time >= 0) - { - m_timestr.Format(_T("%02d:%02d:%02d.%03d"), - (m_time/(1000*60*60))%60, (m_time/(1000*60))%60, (m_time/1000)%60, m_time%1000); - - if(m_fps > 0) - { - m_framestr.Format(_T("%d, %.3f"), (int)(m_fps*m_time/1000), m_fps); - } - - UpdateData(FALSE); - - switch(AfxGetApp()->GetProfileInt(ResStr(IDS_R_SETTINGS), _T("gotoluf"), 0)) - { - default: - case 0: m_timeedit.SetFocus(); m_timeedit.SetSel(0, 0); break; - case 1: m_frameedit.SetFocus(); m_frameedit.SetSel(0, m_framestr.Find(',')); break; - } - - } - - return FALSE; - -// return TRUE; // return TRUE unless you set the focus to a control - // EXCEPTION: OCX Property Pages should return FALSE -} - - -BEGIN_MESSAGE_MAP(CGoToDlg, CDialog) - ON_BN_CLICKED(IDC_OK1, OnBnClickedOk1) - ON_BN_CLICKED(IDC_OK2, OnBnClickedOk2) -END_MESSAGE_MAP() - - -// CGoToDlg message handlers - -void CGoToDlg::OnBnClickedOk1() -{ - UpdateData(); - - int hh, mm, ss, ms; - hh = mm = ss = ms = 0; - - CAtlRegExp<> re; - - REParseError status = re.Parse(_T("{\\z}"), FALSE); - if(REPARSE_ERROR_OK == status) - { - CAtlREMatchContext<> mc; - const CAtlREMatchContext<>::RECHAR* s = m_timestr.GetBuffer(); - const CAtlREMatchContext<>::RECHAR* e = NULL; - while(s && re.Match(s, &mc, &e)) - { - const CAtlREMatchContext<>::RECHAR* szStart = 0; - const CAtlREMatchContext<>::RECHAR* szEnd = 0; - mc.GetMatch(0, &szStart, &szEnd); - - if(hh != 0 || hh > 59 || mm > 59 || ss > 59) - { - AfxMessageBox(_T("Error parsing entered time!")); - return; - } - - hh = mm; - mm = ss; - ss = ms; - ms = _tcstol(szStart, (TCHAR**)&szStart, 10); - - s = e; - } - - m_time = ((hh*60+mm)*60+ss)*1000+ms; - - AfxGetApp()->WriteProfileInt(ResStr(IDS_R_SETTINGS), _T("gotoluf"), 0); - - OnOK(); - } -} - - -void CGoToDlg::OnBnClickedOk2() -{ - UpdateData(); - - int frame = 0; - float fps = 0; - - CAtlRegExp<> re; - - REParseError status = re.Parse(_T("{\\z}[^0-9\\.]+{[0-9\\.]+}"), FALSE); - if(REPARSE_ERROR_OK == status) - { - CAtlREMatchContext<> mc; - const CAtlREMatchContext<>::RECHAR* s = m_framestr.GetBuffer(); - const CAtlREMatchContext<>::RECHAR* e = NULL; - if(re.Match(s, &mc, &e)) - { - const CAtlREMatchContext<>::RECHAR* szStart = 0; - const CAtlREMatchContext<>::RECHAR* szEnd = 0; - - mc.GetMatch(0, &szStart, &szEnd); - frame = _tcstol(szStart, (TCHAR**)&szStart, 10); - - mc.GetMatch(1, &szStart, &szEnd); - if(_stscanf(szStart, _T("%f"), &fps) != 1) fps = 0; - else AfxGetApp()->WriteProfileString(ResStr(IDS_R_SETTINGS), _T("fps"), szStart); - } - else - { - AfxMessageBox(_T("Error parsing entered text!")); - return; - } - - if(fps == 0) - { - AfxMessageBox(_T("Error parsing entered frame-rate!")); - return; - } - - m_time = (int)(1000.0*frame/fps) + 1; - - AfxGetApp()->WriteProfileInt(ResStr(IDS_R_SETTINGS), _T("gotoluf"), 1); - - OnOK(); - } -} - -BOOL CGoToDlg::PreTranslateMessage(MSG* pMsg) -{ - if(pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_RETURN) - { - if(*GetFocus() == m_timeedit) OnBnClickedOk1(); - else if(*GetFocus() == m_frameedit) OnBnClickedOk2(); - - return TRUE; - } - - return __super::PreTranslateMessage(pMsg); -} diff --git a/src/apps/mplayerc/GoToDlg.h b/src/apps/mplayerc/GoToDlg.h deleted file mode 100644 index c0a653344..000000000 --- a/src/apps/mplayerc/GoToDlg.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#pragma once -#include "afxwin.h" - -// CGoToDlg dialog - -class CGoToDlg : public CDialog -{ - DECLARE_DYNAMIC(CGoToDlg) - -public: - CGoToDlg(int time = -1, float fps = 0, CWnd* pParent = NULL); // standard constructor - virtual ~CGoToDlg(); - - CString m_timestr; - CString m_framestr; - CEdit m_timeedit; - CEdit m_frameedit; - - int m_time; - float m_fps; - -// Dialog Data - enum { IDD = IDD_GOTO_DLG }; - -protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - virtual BOOL OnInitDialog(); - virtual BOOL PreTranslateMessage(MSG* pMsg); - - DECLARE_MESSAGE_MAP() - -public: - afx_msg void OnBnClickedOk1(); - afx_msg void OnBnClickedOk2(); -}; diff --git a/src/apps/mplayerc/IGraphBuilder2.h b/src/apps/mplayerc/IGraphBuilder2.h deleted file mode 100644 index 5da815ef2..000000000 --- a/src/apps/mplayerc/IGraphBuilder2.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#pragma once - -[uuid("165BE9D6-0929-4363-9BA3-580D735AA0F6")] -interface IGraphBuilder2 : public IFilterGraph2 -{ - STDMETHOD(IsPinDirection) (IPin* pPin, PIN_DIRECTION dir) = 0; - STDMETHOD(IsPinConnected) (IPin* pPin) = 0; - STDMETHOD(ConnectFilter) (IBaseFilter* pBF, IPin* pPinIn) = 0; - STDMETHOD(ConnectFilter) (IPin* pPinOut, IBaseFilter* pBF) = 0; - STDMETHOD(ConnectFilterDirect) (IPin* pPinOut, IBaseFilter* pBF, const AM_MEDIA_TYPE* pmt) = 0; - STDMETHOD(NukeDownstream) (IUnknown* pUnk) = 0; - STDMETHOD(FindInterface) (REFIID iid, void** ppv, BOOL bRemove) = 0; - STDMETHOD(AddToROT) () = 0; - STDMETHOD(RemoveFromROT) () = 0; -}; - -// private use only -[uuid("43CDA93D-6A4E-4A07-BD3E-49D161073EE7")] -interface IGraphBuilderDeadEnd : public IUnknown -{ - STDMETHOD_(size_t, GetCount)() = 0; - STDMETHOD(GetDeadEnd) (int iIndex, CAtlList& path, CAtlList& mts) = 0; -}; \ No newline at end of file diff --git a/src/apps/mplayerc/IPinHook.cpp b/src/apps/mplayerc/IPinHook.cpp deleted file mode 100644 index bde5d8e2a..000000000 --- a/src/apps/mplayerc/IPinHook.cpp +++ /dev/null @@ -1,493 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include "stdafx.h" -#include "IPinHook.h" -#include "DX9AllocatorPresenter.h" - -REFERENCE_TIME g_tSegmentStart = 0; -REFERENCE_TIME g_tSampleStart = 0; - -static HRESULT (STDMETHODCALLTYPE * NewSegmentOrg)(IPinC * This, /* [in] */ REFERENCE_TIME tStart, /* [in] */ REFERENCE_TIME tStop, /* [in] */ double dRate) = NULL; - -static HRESULT STDMETHODCALLTYPE NewSegmentMine(IPinC * This, /* [in] */ REFERENCE_TIME tStart, /* [in] */ REFERENCE_TIME tStop, /* [in] */ double dRate) -{ - g_tSegmentStart = tStart; - return NewSegmentOrg(This, tStart, tStop, dRate); -} - -static HRESULT ( STDMETHODCALLTYPE *ReceiveOrg )( IMemInputPinC * This, IMediaSample *pSample) = NULL; - -static HRESULT STDMETHODCALLTYPE ReceiveMineI(IMemInputPinC * This, IMediaSample *pSample) -{ - REFERENCE_TIME rtStart, rtStop; - if(pSample && SUCCEEDED(pSample->GetTime(&rtStart, &rtStop))) - g_tSampleStart = rtStart; - return ReceiveOrg(This, pSample); -} - -static HRESULT STDMETHODCALLTYPE ReceiveMine(IMemInputPinC * This, IMediaSample *pSample) -{ - // Support ffdshow queueing. - // To avoid black out on pause, we have to lock g_ffdshowReceive to synchronize with CMainFrame::OnPlayPause. - if(queueu_ffdshow_support) - { - CAutoLock lck(&g_ffdshowReceive); - return ReceiveMineI(This,pSample); - } - return ReceiveMineI(This,pSample); -} - -bool HookNewSegmentAndReceive(IPinC* pPinC, IMemInputPinC* pMemInputPinC) -{ - if(!pPinC || !pMemInputPinC || (GetVersion()&0x80000000)) - return false; - - g_tSegmentStart = 0; - g_tSampleStart = 0; - - BOOL res; - DWORD flOldProtect = 0; - DWORD flSetProtect = 0; - - res = VirtualProtect(pPinC->lpVtbl, sizeof(IPinCVtbl /*IPinC*/), PAGE_WRITECOPY, &flOldProtect); - flSetProtect = flOldProtect; - if(NewSegmentOrg == NULL) NewSegmentOrg = pPinC->lpVtbl->NewSegment; - pPinC->lpVtbl->NewSegment = NewSegmentMine; - res = VirtualProtect(pPinC->lpVtbl, sizeof(IPinCVtbl /*IPinC*/), flSetProtect /* PAGE_EXECUTE */, &flOldProtect); - - flOldProtect = 0; - res = VirtualProtect(pMemInputPinC->lpVtbl, sizeof(IMemInputPinCVtbl /*IMemInputPinC*/), PAGE_WRITECOPY, &flOldProtect); - flSetProtect = flOldProtect; - - if(ReceiveOrg == NULL) ReceiveOrg = pMemInputPinC->lpVtbl->Receive; - pMemInputPinC->lpVtbl->Receive = ReceiveMine; - res = VirtualProtect(pMemInputPinC->lpVtbl, sizeof(IMemInputPinCVtbl /*IMemInputPinC*/), flSetProtect /*PAGE_EXECUTE*/, &flOldProtect); - - return true; -} - -static HRESULT ( STDMETHODCALLTYPE *GetVideoAcceleratorGUIDsOrg )( IAMVideoAcceleratorC * This,/* [out][in] */ LPDWORD pdwNumGuidsSupported,/* [out][in] */ LPGUID pGuidsSupported) = NULL; -static HRESULT ( STDMETHODCALLTYPE *GetUncompFormatsSupportedOrg )( IAMVideoAcceleratorC * This,/* [in] */ const GUID *pGuid,/* [out][in] */ LPDWORD pdwNumFormatsSupported,/* [out][in] */ LPDDPIXELFORMAT pFormatsSupported) = NULL; -static HRESULT ( STDMETHODCALLTYPE *GetInternalMemInfoOrg )( IAMVideoAcceleratorC * This,/* [in] */ const GUID *pGuid,/* [in] */ const AMVAUncompDataInfo *pamvaUncompDataInfo,/* [out][in] */ LPAMVAInternalMemInfo pamvaInternalMemInfo) = NULL; -static HRESULT ( STDMETHODCALLTYPE *GetCompBufferInfoOrg )( IAMVideoAcceleratorC * This,/* [in] */ const GUID *pGuid,/* [in] */ const AMVAUncompDataInfo *pamvaUncompDataInfo,/* [out][in] */ LPDWORD pdwNumTypesCompBuffers,/* [out] */ LPAMVACompBufferInfo pamvaCompBufferInfo) = NULL; -static HRESULT ( STDMETHODCALLTYPE *GetInternalCompBufferInfoOrg )( IAMVideoAcceleratorC * This,/* [out][in] */ LPDWORD pdwNumTypesCompBuffers,/* [out] */ LPAMVACompBufferInfo pamvaCompBufferInfo) = NULL; -static HRESULT ( STDMETHODCALLTYPE *BeginFrameOrg )( IAMVideoAcceleratorC * This,/* [in] */ const AMVABeginFrameInfo *amvaBeginFrameInfo) = NULL; -static HRESULT ( STDMETHODCALLTYPE *EndFrameOrg )( IAMVideoAcceleratorC * This,/* [in] */ const AMVAEndFrameInfo *pEndFrameInfo) = NULL; -static HRESULT ( STDMETHODCALLTYPE *GetBufferOrg )( IAMVideoAcceleratorC * This,/* [in] */ DWORD dwTypeIndex,/* [in] */ DWORD dwBufferIndex,/* [in] */ BOOL bReadOnly,/* [out] */ LPVOID *ppBuffer,/* [out] */ LONG *lpStride) = NULL; -static HRESULT ( STDMETHODCALLTYPE *ReleaseBufferOrg )( IAMVideoAcceleratorC * This,/* [in] */ DWORD dwTypeIndex,/* [in] */ DWORD dwBufferIndex) = NULL; -static HRESULT ( STDMETHODCALLTYPE *ExecuteOrg )( IAMVideoAcceleratorC * This,/* [in] */ DWORD dwFunction,/* [in] */ LPVOID lpPrivateInputData,/* [in] */ DWORD cbPrivateInputData,/* [in] */ LPVOID lpPrivateOutputDat,/* [in] */ DWORD cbPrivateOutputData,/* [in] */ DWORD dwNumBuffers,/* [in] */ const AMVABUFFERINFO *pamvaBufferInfo) = NULL; -static HRESULT ( STDMETHODCALLTYPE *QueryRenderStatusOrg )( IAMVideoAcceleratorC * This,/* [in] */ DWORD dwTypeIndex,/* [in] */ DWORD dwBufferIndex,/* [in] */ DWORD dwFlags) = NULL; -static HRESULT ( STDMETHODCALLTYPE *DisplayFrameOrg )( IAMVideoAcceleratorC * This,/* [in] */ DWORD dwFlipToIndex,/* [in] */ IMediaSample *pMediaSample) = NULL; - -static void LOG(LPCTSTR fmt, ...) -{ - va_list args; - va_start(args, fmt); - if(TCHAR* buff = new TCHAR[_vsctprintf(fmt, args) + 1]) - { - _vstprintf(buff, fmt, args); - if(FILE* f = _tfopen(_T("c:\\dxva.log"), _T("at"))) - { - fseek(f, 0, 2); - _ftprintf(f, _T("%s\n"), buff); - fclose(f); - } - delete [] buff; - } - va_end(args); -} - -static void LOGPF(LPCTSTR prefix, const DDPIXELFORMAT* p, int n) -{ - for(int i = 0; i < n; i++) - { - LOG(_T("%s[%d].dwSize = %d"), prefix, i, p[i].dwSize); - LOG(_T("%s[%d].dwFlags = %08x"), prefix, i, p[i].dwFlags); - LOG(_T("%s[%d].dwFourCC = %4.4hs"), prefix, i, &p[i].dwFourCC); - LOG(_T("%s[%d].dwRGBBitCount = %08x"), prefix, i, &p[i].dwRGBBitCount); - LOG(_T("%s[%d].dwRBitMask = %08x"), prefix, i, &p[i].dwRBitMask); - LOG(_T("%s[%d].dwGBitMask = %08x"), prefix, i, &p[i].dwGBitMask); - LOG(_T("%s[%d].dwBBitMask = %08x"), prefix, i, &p[i].dwBBitMask); - LOG(_T("%s[%d].dwRGBAlphaBitMask = %08x"), prefix, i, &p[i].dwRGBAlphaBitMask); - } -} - -static void LOGUDI(LPCTSTR prefix, const AMVAUncompDataInfo* p, int n) -{ - for(int i = 0; i < n; i++) - { - LOG(_T("%s[%d].dwUncompWidth = %d"), prefix, i, p[i].dwUncompWidth); - LOG(_T("%s[%d].dwUncompHeight = %d"), prefix, i, p[i].dwUncompHeight); - - CString prefix2; - prefix2.Format(_T("%s[%d]"), prefix, i); - LOGPF(prefix2, &p[i].ddUncompPixelFormat, 1); - } -} - -static HRESULT STDMETHODCALLTYPE GetVideoAcceleratorGUIDsMine( - IAMVideoAcceleratorC * This, - /* [out][in] */ LPDWORD pdwNumGuidsSupported, - /* [out][in] */ LPGUID pGuidsSupported) -{ - LOG(_T("\nGetVideoAcceleratorGUIDs")); - - if(pdwNumGuidsSupported) - { - LOG(_T("[in] *pdwNumGuidsSupported = %d"), *pdwNumGuidsSupported); - } - - HRESULT hr = GetVideoAcceleratorGUIDsOrg(This, pdwNumGuidsSupported, pGuidsSupported); - - LOG(_T("hr = %08x"), hr); - - if(pdwNumGuidsSupported) - { - LOG(_T("[out] *pdwNumGuidsSupported = %d"), *pdwNumGuidsSupported); - - if(pGuidsSupported) - { - for(int i = 0; i < *pdwNumGuidsSupported; i++) - { - LOG(_T("[out] pGuidsSupported[%d] = %s"), i, CStringFromGUID(pGuidsSupported[i])); - } - } - } - - return hr; -} - -static HRESULT STDMETHODCALLTYPE GetUncompFormatsSupportedMine( - IAMVideoAcceleratorC * This, - /* [in] */ const GUID *pGuid, - /* [out][in] */ LPDWORD pdwNumFormatsSupported, - /* [out][in] */ LPDDPIXELFORMAT pFormatsSupported) -{ - LOG(_T("\nGetUncompFormatsSupported")); - - if(pGuid) - { - LOG(_T("[in] *pGuid = %s"), CStringFromGUID(*pGuid)); - } - - if(pdwNumFormatsSupported) - { - LOG(_T("[in] *pdwNumFormatsSupported = %d"), *pdwNumFormatsSupported); - } - - HRESULT hr = GetUncompFormatsSupportedOrg(This, pGuid, pdwNumFormatsSupported, pFormatsSupported); - - LOG(_T("hr = %08x"), hr); - - if(pdwNumFormatsSupported) - { - LOG(_T("[out] *pdwNumFormatsSupported = %d"), *pdwNumFormatsSupported); - - if(pFormatsSupported) - { - LOGPF(_T("[out] pFormatsSupported"), pFormatsSupported, *pdwNumFormatsSupported); - } - } - - return hr; -} - -static HRESULT STDMETHODCALLTYPE GetInternalMemInfoMine( - IAMVideoAcceleratorC * This, - /* [in] */ const GUID *pGuid, - /* [in] */ const AMVAUncompDataInfo *pamvaUncompDataInfo, - /* [out][in] */ LPAMVAInternalMemInfo pamvaInternalMemInfo) -{ - LOG(_T("\nGetInternalMemInfo")); - - HRESULT hr = GetInternalMemInfoOrg(This, pGuid, pamvaUncompDataInfo, pamvaInternalMemInfo); - - LOG(_T("hr = %08x"), hr); - - return hr; -} - -static HRESULT STDMETHODCALLTYPE GetCompBufferInfoMine( - IAMVideoAcceleratorC * This, - /* [in] */ const GUID *pGuid, - /* [in] */ const AMVAUncompDataInfo *pamvaUncompDataInfo, - /* [out][in] */ LPDWORD pdwNumTypesCompBuffers, - /* [out] */ LPAMVACompBufferInfo pamvaCompBufferInfo) -{ - LOG(_T("\nGetCompBufferInfo")); - - if(pGuid) - { - LOG(_T("[in] *pGuid = %s"), CStringFromGUID(*pGuid)); - - if(pdwNumTypesCompBuffers) - { - LOG(_T("[in] *pdwNumTypesCompBuffers = %d"), *pdwNumTypesCompBuffers); - } - } - - HRESULT hr = GetCompBufferInfoOrg(This, pGuid, pamvaUncompDataInfo, pdwNumTypesCompBuffers, pamvaCompBufferInfo); - - LOG(_T("hr = %08x"), hr); - - if(pdwNumTypesCompBuffers) - { - LOG(_T("[out] *pdwNumTypesCompBuffers = %d"), *pdwNumTypesCompBuffers); - - if(pamvaUncompDataInfo) - { - LOGUDI(_T("[out] pamvaUncompDataInfo"), pamvaUncompDataInfo, *pdwNumTypesCompBuffers); - } - } - - return hr; -} - -static HRESULT STDMETHODCALLTYPE GetInternalCompBufferInfoMine( - IAMVideoAcceleratorC * This, - /* [out][in] */ LPDWORD pdwNumTypesCompBuffers, - /* [out] */ LPAMVACompBufferInfo pamvaCompBufferInfo) -{ - LOG(_T("\nGetInternalCompBufferInfo")); - - HRESULT hr = GetInternalCompBufferInfoOrg(This, pdwNumTypesCompBuffers, pamvaCompBufferInfo); - - LOG(_T("hr = %08x"), hr); - - return hr; -} - -static HRESULT STDMETHODCALLTYPE BeginFrameMine( - IAMVideoAcceleratorC * This, - /* [in] */ const AMVABeginFrameInfo *amvaBeginFrameInfo) -{ - LOG(_T("\nBeginFrame")); - - if(amvaBeginFrameInfo) - { - LOG(_T("[in] amvaBeginFrameInfo->dwDestSurfaceIndex = %08x"), amvaBeginFrameInfo->dwDestSurfaceIndex); - LOG(_T("[in] amvaBeginFrameInfo->pInputData = %08x"), amvaBeginFrameInfo->pInputData); - LOG(_T("[in] amvaBeginFrameInfo->dwSizeInputData = %08x"), amvaBeginFrameInfo->dwSizeInputData); - LOG(_T("[in] amvaBeginFrameInfo->pOutputData = %08x"), amvaBeginFrameInfo->pOutputData); - LOG(_T("[in] amvaBeginFrameInfo->dwSizeOutputData = %08x"), amvaBeginFrameInfo->dwSizeOutputData); - } - - HRESULT hr = BeginFrameOrg(This, amvaBeginFrameInfo); - - LOG(_T("hr = %08x"), hr); - - if(amvaBeginFrameInfo && amvaBeginFrameInfo->pOutputData) - { - LOG(_T("[out] amvaBeginFrameInfo->pOutputData = %02x %02x %02x %02x..."), - ((BYTE*)amvaBeginFrameInfo->pOutputData)[0], - ((BYTE*)amvaBeginFrameInfo->pOutputData)[1], - ((BYTE*)amvaBeginFrameInfo->pOutputData)[2], - ((BYTE*)amvaBeginFrameInfo->pOutputData)[3]); - } - - return hr; -} - -static HRESULT STDMETHODCALLTYPE EndFrameMine( - IAMVideoAcceleratorC * This, - /* [in] */ const AMVAEndFrameInfo *pEndFrameInfo) -{ - LOG(_T("\nEndFrame")); - - if(pEndFrameInfo) - { - LOG(_T("[in] pEndFrameInfo->dwSizeMiscData = %08x"), pEndFrameInfo->dwSizeMiscData); - LOG(_T("[in] pEndFrameInfo->pMiscData = %08x"), pEndFrameInfo->pMiscData); - } - - HRESULT hr = EndFrameOrg(This, pEndFrameInfo); - - LOG(_T("hr = %08x"), hr); - - return hr; -} - -static HRESULT STDMETHODCALLTYPE GetBufferMine( - IAMVideoAcceleratorC * This, - /* [in] */ DWORD dwTypeIndex, - /* [in] */ DWORD dwBufferIndex, - /* [in] */ BOOL bReadOnly, - /* [out] */ LPVOID *ppBuffer, - /* [out] */ LONG *lpStride) -{ - LOG(_T("\nGetBuffer")); - - LOG(_T("[in] dwTypeIndex = %08x"), dwTypeIndex); - LOG(_T("[in] dwBufferIndex = %08x"), dwBufferIndex); - LOG(_T("[in] bReadOnly = %08x"), bReadOnly); - LOG(_T("[in] ppBuffer = %08x"), ppBuffer); - LOG(_T("[in] lpStride = %08x"), lpStride); - - HRESULT hr = GetBufferOrg(This, dwTypeIndex, dwBufferIndex, bReadOnly, ppBuffer, lpStride); - - LOG(_T("hr = %08x"), hr); - - LOG(_T("[out] *ppBuffer = %02x %02x %02x %02x ..."), ((BYTE*)*ppBuffer)[0], ((BYTE*)*ppBuffer)[1], ((BYTE*)*ppBuffer)[2], ((BYTE*)*ppBuffer)[3]); - LOG(_T("[out] *lpStride = %08x"), *lpStride); - - return hr; -} - -static HRESULT STDMETHODCALLTYPE ReleaseBufferMine( - IAMVideoAcceleratorC * This, - /* [in] */ DWORD dwTypeIndex, - /* [in] */ DWORD dwBufferIndex) -{ - LOG(_T("\nReleaseBuffer")); - - LOG(_T("[in] dwTypeIndex = %08x"), dwTypeIndex); - LOG(_T("[in] dwBufferIndex = %08x"), dwBufferIndex); - - HRESULT hr = ReleaseBufferOrg(This, dwTypeIndex, dwBufferIndex); - - LOG(_T("hr = %08x"), hr); - - return hr; -} - -static HRESULT STDMETHODCALLTYPE ExecuteMine( - IAMVideoAcceleratorC * This, - /* [in] */ DWORD dwFunction, - /* [in] */ LPVOID lpPrivateInputData, - /* [in] */ DWORD cbPrivateInputData, - /* [in] */ LPVOID lpPrivateOutputData, - /* [in] */ DWORD cbPrivateOutputData, - /* [in] */ DWORD dwNumBuffers, - /* [in] */ const AMVABUFFERINFO *pamvaBufferInfo) -{ - LOG(_T("\nExecute")); - - LOG(_T("[in] dwFunction = %08x"), dwFunction); - if(lpPrivateInputData) - { - LOG(_T("[in] lpPrivateInputData = %02x %02x %02x %02x ..."), - ((BYTE*)lpPrivateInputData)[0], - ((BYTE*)lpPrivateInputData)[1], - ((BYTE*)lpPrivateInputData)[2], - ((BYTE*)lpPrivateInputData)[3]); - } - LOG(_T("[in] cbPrivateInputData = %08x"), cbPrivateInputData); - LOG(_T("[in] lpPrivateOutputData = %08"), lpPrivateOutputData); - LOG(_T("[in] cbPrivateOutputData = %08x"), cbPrivateOutputData); - LOG(_T("[in] dwNumBuffers = %08x"), dwNumBuffers); - if(pamvaBufferInfo) - { - LOG(_T("[in] pamvaBufferInfo->dwTypeIndex = %08x"), pamvaBufferInfo->dwTypeIndex); - LOG(_T("[in] pamvaBufferInfo->dwBufferIndex = %08x"), pamvaBufferInfo->dwBufferIndex); - LOG(_T("[in] pamvaBufferInfo->dwDataOffset = %08x"), pamvaBufferInfo->dwDataOffset); - LOG(_T("[in] pamvaBufferInfo->dwDataSize = %08x"), pamvaBufferInfo->dwDataSize); - } - - HRESULT hr = ExecuteOrg(This, dwFunction, lpPrivateInputData, cbPrivateInputData, lpPrivateOutputData, cbPrivateOutputData, dwNumBuffers, pamvaBufferInfo); - - LOG(_T("hr = %08x"), hr); - - if(lpPrivateOutputData) - { - LOG(_T("[out] *lpPrivateOutputData = %08"), lpPrivateOutputData); - - if(cbPrivateOutputData) - { - LOG(_T("[out] cbPrivateOutputData = %02x %02x %02x %02x ..."), - ((BYTE*)lpPrivateOutputData)[0], - ((BYTE*)lpPrivateOutputData)[1], - ((BYTE*)lpPrivateOutputData)[2], - ((BYTE*)lpPrivateOutputData)[3]); - } - } - - return hr; -} - -static HRESULT STDMETHODCALLTYPE QueryRenderStatusMine( - IAMVideoAcceleratorC * This, - /* [in] */ DWORD dwTypeIndex, - /* [in] */ DWORD dwBufferIndex, - /* [in] */ DWORD dwFlags) -{ - LOG(_T("\nQueryRenderStatus")); - - HRESULT hr = QueryRenderStatusOrg(This, dwTypeIndex, dwBufferIndex, dwFlags); - - LOG(_T("hr = %08x"), hr); - - return hr; -} - -static HRESULT STDMETHODCALLTYPE DisplayFrameMine( - IAMVideoAcceleratorC * This, - /* [in] */ DWORD dwFlipToIndex, - /* [in] */ IMediaSample *pMediaSample) -{ - LOG(_T("\nDisplayFrame")); - - HRESULT hr = DisplayFrameOrg(This, dwFlipToIndex, pMediaSample); - - LOG(_T("hr = %08x"), hr); - - return hr; -} - -void HookAMVideoAccelerator(IAMVideoAcceleratorC* pAMVideoAcceleratorC) -{ - BOOL res; - DWORD flOldProtect = 0; - res = VirtualProtect(pAMVideoAcceleratorC->lpVtbl, sizeof(IAMVideoAcceleratorC), PAGE_WRITECOPY, &flOldProtect); -/* -*/ - if(GetVideoAcceleratorGUIDsOrg == NULL) GetVideoAcceleratorGUIDsOrg = pAMVideoAcceleratorC->lpVtbl->GetVideoAcceleratorGUIDs; - if(GetUncompFormatsSupportedOrg == NULL) GetUncompFormatsSupportedOrg = pAMVideoAcceleratorC->lpVtbl->GetUncompFormatsSupported; - if(GetInternalMemInfoOrg == NULL) GetInternalMemInfoOrg = pAMVideoAcceleratorC->lpVtbl->GetInternalMemInfo; - if(GetCompBufferInfoOrg == NULL) GetCompBufferInfoOrg = pAMVideoAcceleratorC->lpVtbl->GetCompBufferInfo; - if(GetInternalCompBufferInfoOrg == NULL) GetInternalCompBufferInfoOrg = pAMVideoAcceleratorC->lpVtbl->GetInternalCompBufferInfo; - if(BeginFrameOrg == NULL) BeginFrameOrg = pAMVideoAcceleratorC->lpVtbl->BeginFrame; - if(EndFrameOrg == NULL) EndFrameOrg = pAMVideoAcceleratorC->lpVtbl->EndFrame; - if(GetBufferOrg == NULL) GetBufferOrg = pAMVideoAcceleratorC->lpVtbl->GetBuffer; - if(ReleaseBufferOrg == NULL) ReleaseBufferOrg = pAMVideoAcceleratorC->lpVtbl->ReleaseBuffer; - if(ExecuteOrg == NULL) ExecuteOrg = pAMVideoAcceleratorC->lpVtbl->Execute; - if(QueryRenderStatusOrg == NULL) QueryRenderStatusOrg = pAMVideoAcceleratorC->lpVtbl->QueryRenderStatus; - if(DisplayFrameOrg == NULL) DisplayFrameOrg = pAMVideoAcceleratorC->lpVtbl->DisplayFrame; -/* -*/ -/* -*/ - pAMVideoAcceleratorC->lpVtbl->GetVideoAcceleratorGUIDs = GetVideoAcceleratorGUIDsMine; - pAMVideoAcceleratorC->lpVtbl->GetUncompFormatsSupported = GetUncompFormatsSupportedMine; - pAMVideoAcceleratorC->lpVtbl->GetInternalMemInfo = GetInternalMemInfoMine; - pAMVideoAcceleratorC->lpVtbl->GetCompBufferInfo = GetCompBufferInfoMine; - pAMVideoAcceleratorC->lpVtbl->GetInternalCompBufferInfo = GetInternalCompBufferInfoMine; - pAMVideoAcceleratorC->lpVtbl->BeginFrame = BeginFrameMine; - pAMVideoAcceleratorC->lpVtbl->EndFrame = EndFrameMine; - pAMVideoAcceleratorC->lpVtbl->GetBuffer = GetBufferMine; - pAMVideoAcceleratorC->lpVtbl->ReleaseBuffer = ReleaseBufferMine; - pAMVideoAcceleratorC->lpVtbl->Execute = ExecuteMine; - pAMVideoAcceleratorC->lpVtbl->QueryRenderStatus = QueryRenderStatusMine; - pAMVideoAcceleratorC->lpVtbl->DisplayFrame = DisplayFrameMine; -/* -*/ - res = VirtualProtect(pAMVideoAcceleratorC->lpVtbl, sizeof(IAMVideoAcceleratorC), PAGE_EXECUTE, &flOldProtect); -} diff --git a/src/apps/mplayerc/IPinHook.h b/src/apps/mplayerc/IPinHook.h deleted file mode 100644 index 82ab189a2..000000000 --- a/src/apps/mplayerc/IPinHook.h +++ /dev/null @@ -1,180 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#pragma once - -interface IPinC; - -typedef struct IPinCVtbl -{ - BEGIN_INTERFACE - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IPinC * This, /* [in] */ REFIID riid, /* [iid_is][out] */ void **ppvObject ); - ULONG ( STDMETHODCALLTYPE *AddRef )( IPinC * This ); - ULONG ( STDMETHODCALLTYPE *Release )( IPinC * This ); - HRESULT ( STDMETHODCALLTYPE *Connect )( IPinC * This, /* [in] */ IPinC *pReceivePin, /* [in] */ const AM_MEDIA_TYPE *pmt ); - HRESULT ( STDMETHODCALLTYPE *ReceiveConnection )( IPinC * This, /* [in] */ IPinC *pConnector, /* [in] */ const AM_MEDIA_TYPE *pmt ); - HRESULT ( STDMETHODCALLTYPE *Disconnect )( IPinC * This ); - HRESULT ( STDMETHODCALLTYPE *ConnectedTo )( IPinC * This, /* [out] */ IPinC **pPin ); - HRESULT ( STDMETHODCALLTYPE *ConnectionMediaType )( IPinC * This, /* [out] */ AM_MEDIA_TYPE *pmt ); - HRESULT ( STDMETHODCALLTYPE *QueryPinInfo )( IPinC * This, /* [out] */ PIN_INFO *pInfo ); - HRESULT ( STDMETHODCALLTYPE *QueryDirection )( IPinC * This, /* [out] */ PIN_DIRECTION *pPinDir ); - HRESULT ( STDMETHODCALLTYPE *QueryId )( IPinC * This, /* [out] */ LPWSTR *Id ); - HRESULT ( STDMETHODCALLTYPE *QueryAccept )( IPinC * This, /* [in] */ const AM_MEDIA_TYPE *pmt ); - HRESULT ( STDMETHODCALLTYPE *EnumMediaTypes )( IPinC * This, /* [out] */ IEnumMediaTypes **ppEnum ); - HRESULT ( STDMETHODCALLTYPE *QueryInternalConnections )( IPinC * This, /* [out] */ IPinC **apPin, /* [out][in] */ ULONG *nPin ); - HRESULT ( STDMETHODCALLTYPE *EndOfStream )( IPinC * This ); - HRESULT ( STDMETHODCALLTYPE *BeginFlush )( IPinC * This ); - HRESULT ( STDMETHODCALLTYPE *EndFlush )( IPinC * This ); - HRESULT ( STDMETHODCALLTYPE *NewSegment )( IPinC * This, /* [in] */ REFERENCE_TIME tStart, /* [in] */ REFERENCE_TIME tStop, /* [in] */ double dRate ); - END_INTERFACE -} IPinCVtbl; - -interface IPinC -{ - CONST_VTBL struct IPinCVtbl *lpVtbl; -}; - -interface IMemInputPinC; - -typedef struct IMemInputPinCVtbl -{ - BEGIN_INTERFACE - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IPinC * This, /* [in] */ REFIID riid, /* [iid_is][out] */ void **ppvObject ); - ULONG ( STDMETHODCALLTYPE *AddRef )( IPinC * This ); - ULONG ( STDMETHODCALLTYPE *Release )( IPinC * This ); - HRESULT ( STDMETHODCALLTYPE *GetAllocator )( IMemInputPinC * This, IMemAllocator **ppAllocator); - HRESULT ( STDMETHODCALLTYPE *NotifyAllocator )( IMemInputPinC * This, IMemAllocator *pAllocator, BOOL bReadOnly); - HRESULT ( STDMETHODCALLTYPE *GetAllocatorRequirements )( IMemInputPinC * This, ALLOCATOR_PROPERTIES *pProps); - HRESULT ( STDMETHODCALLTYPE *Receive )( IMemInputPinC * This, IMediaSample *pSample); - HRESULT ( STDMETHODCALLTYPE *ReceiveMultiple )( IMemInputPinC * This, IMediaSample **pSamples, long nSamples, long *nSamplesProcessed); - HRESULT ( STDMETHODCALLTYPE *ReceiveCanBlock )( IMemInputPinC * This); - END_INTERFACE -} IMemInputPinCVtbl; - -interface IMemInputPinC -{ - CONST_VTBL struct IMemInputPinCVtbl *lpVtbl; -}; - -extern bool HookNewSegmentAndReceive(IPinC* pPinC, IMemInputPinC* pMemInputPin); -extern REFERENCE_TIME g_tSegmentStart, g_tSampleStart; - -// - -#include - -interface IAMVideoAcceleratorC; - -typedef struct IAMVideoAcceleratorCVtbl -{ - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAMVideoAcceleratorC * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAMVideoAcceleratorC * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAMVideoAcceleratorC * This); - - HRESULT ( STDMETHODCALLTYPE *GetVideoAcceleratorGUIDs )( - IAMVideoAcceleratorC * This, - /* [out][in] */ LPDWORD pdwNumGuidsSupported, - /* [out][in] */ LPGUID pGuidsSupported); - - HRESULT ( STDMETHODCALLTYPE *GetUncompFormatsSupported )( - IAMVideoAcceleratorC * This, - /* [in] */ const GUID *pGuid, - /* [out][in] */ LPDWORD pdwNumFormatsSupported, - /* [out][in] */ LPDDPIXELFORMAT pFormatsSupported); - - HRESULT ( STDMETHODCALLTYPE *GetInternalMemInfo )( - IAMVideoAcceleratorC * This, - /* [in] */ const GUID *pGuid, - /* [in] */ const AMVAUncompDataInfo *pamvaUncompDataInfo, - /* [out][in] */ LPAMVAInternalMemInfo pamvaInternalMemInfo); - - HRESULT ( STDMETHODCALLTYPE *GetCompBufferInfo )( - IAMVideoAcceleratorC * This, - /* [in] */ const GUID *pGuid, - /* [in] */ const AMVAUncompDataInfo *pamvaUncompDataInfo, - /* [out][in] */ LPDWORD pdwNumTypesCompBuffers, - /* [out] */ LPAMVACompBufferInfo pamvaCompBufferInfo); - - HRESULT ( STDMETHODCALLTYPE *GetInternalCompBufferInfo )( - IAMVideoAcceleratorC * This, - /* [out][in] */ LPDWORD pdwNumTypesCompBuffers, - /* [out] */ LPAMVACompBufferInfo pamvaCompBufferInfo); - - HRESULT ( STDMETHODCALLTYPE *BeginFrame )( - IAMVideoAcceleratorC * This, - /* [in] */ const AMVABeginFrameInfo *amvaBeginFrameInfo); - - HRESULT ( STDMETHODCALLTYPE *EndFrame )( - IAMVideoAcceleratorC * This, - /* [in] */ const AMVAEndFrameInfo *pEndFrameInfo); - - HRESULT ( STDMETHODCALLTYPE *GetBuffer )( - IAMVideoAcceleratorC * This, - /* [in] */ DWORD dwTypeIndex, - /* [in] */ DWORD dwBufferIndex, - /* [in] */ BOOL bReadOnly, - /* [out] */ LPVOID *ppBuffer, - /* [out] */ LONG *lpStride); - - HRESULT ( STDMETHODCALLTYPE *ReleaseBuffer )( - IAMVideoAcceleratorC * This, - /* [in] */ DWORD dwTypeIndex, - /* [in] */ DWORD dwBufferIndex); - - HRESULT ( STDMETHODCALLTYPE *Execute )( - IAMVideoAcceleratorC * This, - /* [in] */ DWORD dwFunction, - /* [in] */ LPVOID lpPrivateInputData, - /* [in] */ DWORD cbPrivateInputData, - /* [in] */ LPVOID lpPrivateOutputDat, - /* [in] */ DWORD cbPrivateOutputData, - /* [in] */ DWORD dwNumBuffers, - /* [in] */ const AMVABUFFERINFO *pamvaBufferInfo); - - HRESULT ( STDMETHODCALLTYPE *QueryRenderStatus )( - IAMVideoAcceleratorC * This, - /* [in] */ DWORD dwTypeIndex, - /* [in] */ DWORD dwBufferIndex, - /* [in] */ DWORD dwFlags); - - HRESULT ( STDMETHODCALLTYPE *DisplayFrame )( - IAMVideoAcceleratorC * This, - /* [in] */ DWORD dwFlipToIndex, - /* [in] */ IMediaSample *pMediaSample); - - END_INTERFACE -} IAMVideoAcceleratorCVtbl; - -interface IAMVideoAcceleratorC -{ - CONST_VTBL struct IAMVideoAcceleratorCVtbl *lpVtbl; -}; - -extern void HookAMVideoAccelerator(IAMVideoAcceleratorC* pAMVideoAcceleratorC); diff --git a/src/apps/mplayerc/IQTVideoSurface.h b/src/apps/mplayerc/IQTVideoSurface.h deleted file mode 100644 index 4b6adf6fe..000000000 --- a/src/apps/mplayerc/IQTVideoSurface.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#pragma once - -// -// IQTVideoSurface -// - -[uuid("A6AE36F7-A6F2-4157-AF54-6599857E4E20")] -interface IQTVideoSurface : public IUnknown -{ - STDMETHOD (BeginBlt) (const BITMAP& bm) PURE; - STDMETHOD (DoBlt) (const BITMAP& bm) PURE; -}; diff --git a/src/apps/mplayerc/ISDb.cpp b/src/apps/mplayerc/ISDb.cpp deleted file mode 100644 index df00ab9c6..000000000 --- a/src/apps/mplayerc/ISDb.cpp +++ /dev/null @@ -1,89 +0,0 @@ -#include "stdafx.h" -#include "ISDb.h" -#include "mplayerc.h" - -bool hash(LPCTSTR fn, filehash& fh) -{ - CFile f; - CFileException fe; - if(!f.Open(fn, CFile::modeRead|CFile::osSequentialScan|CFile::shareDenyNone, &fe)) - return false; - - CPath p(fn); - p.StripPath(); - fh.name = (LPCTSTR)p; - - fh.size = f.GetLength(); - - fh.hash = fh.size; - for(UINT64 tmp = 0, i = 0; i < 65536/sizeof(tmp) && f.Read(&tmp, sizeof(tmp)); fh.hash += tmp, i++); - f.Seek(max(0, (INT64)fh.size - 65536), CFile::begin); - for(UINT64 tmp = 0, i = 0; i < 65536/sizeof(tmp) && f.Read(&tmp, sizeof(tmp)); fh.hash += tmp, i++); - - return true; -} - -void hash(CPlaylist& pl, CList& fhs) -{ - fhs.RemoveAll(); - - POSITION pos = pl.GetHeadPosition(); - while(pos) - { - CString fn = pl.GetNext(pos).m_fns.GetHead(); - if(AfxGetAppSettings().Formats.FindExt(CPath(fn).GetExtension().MakeLower(), true)) - continue; - - filehash fh; - if(!hash(fn, fh)) - continue; - - fhs.AddTail(fh); - } -} - -CStringA makeargs(CPlaylist& pl) -{ - CList fhs; - hash(pl, fhs); - - CAtlList args; - - POSITION pos = fhs.GetHeadPosition(); - for(int i = 0; pos; i++) - { - filehash& fh = fhs.GetNext(pos); - - CStringA str; - str.Format("name[%d]=%s&size[%d]=%016I64x&hash[%d]=%016I64x", - i, UrlEncode(CStringA(fh.name)), - i, fh.size, - i, fh.hash); - - args.AddTail(str); - } - - return Implode(args, '&'); -} - -bool OpenUrl(CInternetSession& is, CString url, CStringA& str) -{ - str.Empty(); - - try - { - CAutoPtr f(is.OpenURL(url, 1, INTERNET_FLAG_TRANSFER_BINARY|INTERNET_FLAG_EXISTING_CONNECT)); - - char buff[1024]; - for(int len; (len = f->Read(buff, sizeof(buff))) > 0; str += CStringA(buff, len)); - - f->Close(); // must close it because the desctructor doesn't seem to do it and we will get an exception when "is" is destroying - } - catch(CInternetException* ie) - { - ie->Delete(); - return false; - } - - return true; -} diff --git a/src/apps/mplayerc/ISDb.h b/src/apps/mplayerc/ISDb.h deleted file mode 100644 index 97ee0bc9a..000000000 --- a/src/apps/mplayerc/ISDb.h +++ /dev/null @@ -1,37 +0,0 @@ -#pragma once - -#include -#include -#include "Playlist.h" - -#define ISDb_PROTOCOL_VERSION 1 - -struct isdb_subtitle -{ - int id, discs, disc_no; - CStringA name, format, language, iso639_2, nick, email; - struct isdb_subtitle() {reset();} - void reset() {id = discs = disc_no = 0; format = language = nick = email = "";} -}; - -struct isdb_movie -{ - CAtlList titles; - CAtlList subs; - void reset() {titles.RemoveAll(); subs.RemoveAll();} - void operator = (const struct isdb_movie& m) - { - titles.RemoveAll(); - titles.AddTailList(&m.titles); - subs.RemoveAll(); - subs.AddTailList(&m.subs); - } -}; - -struct filehash {CString name; UINT64 size, hash;}; - -extern bool hash(LPCTSTR fn, filehash& fh); -extern void hash(CPlaylist& pl, CList& fhs); -extern CStringA makeargs(CPlaylist& pl); -extern bool OpenUrl(CInternetSession& is, CString url, CStringA& str); - diff --git a/src/apps/mplayerc/KeyProvider.cpp b/src/apps/mplayerc/KeyProvider.cpp deleted file mode 100644 index 298f10fc8..000000000 --- a/src/apps/mplayerc/KeyProvider.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include "stdafx.h" -#include "keyprovider.h" -#include "..\..\DSUtil\DSUtil.h" -//#include "c:\WMSDK\WMFSDK9\include\wmsdk.h" - -CKeyProvider::CKeyProvider() - : CUnknown(NAME("CKeyProvider"), NULL) -{ -} - -STDMETHODIMP CKeyProvider::NonDelegatingQueryInterface(REFIID riid, void** ppv) -{ - return - QI(IServiceProvider) - __super::NonDelegatingQueryInterface(riid, ppv); -} - -STDMETHODIMP CKeyProvider::QueryService(REFIID siid, REFIID riid, void **ppv) -{ - /* - if(siid == __uuidof(IWMReader) && riid == IID_IUnknown) - { - CComPtr punkCert; - HRESULT hr = WMCreateCertificate(&punkCert); - if(SUCCEEDED(hr)) - *ppv = (void*)punkCert.Detach(); - return hr; - } - */ - - return E_NOINTERFACE; -} diff --git a/src/apps/mplayerc/KeyProvider.h b/src/apps/mplayerc/KeyProvider.h deleted file mode 100644 index 51f68010f..000000000 --- a/src/apps/mplayerc/KeyProvider.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#pragma once - -#include - -// Declare and implement a key provider class derived from IServiceProvider. - -class CKeyProvider - : public CUnknown - , public IServiceProvider -{ -public: - CKeyProvider(); - - DECLARE_IUNKNOWN; - STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv); - - // IServiceProvider - STDMETHODIMP QueryService(REFIID siid, REFIID riid, void **ppv); -}; diff --git a/src/apps/mplayerc/LineNumberEdit.cpp b/src/apps/mplayerc/LineNumberEdit.cpp deleted file mode 100644 index 563bd4a15..000000000 --- a/src/apps/mplayerc/LineNumberEdit.cpp +++ /dev/null @@ -1,971 +0,0 @@ -/* ========================================================================== - CLineNumberEdit - Author : Johan Rosengren, Abstrakt Mekanik AB - Date : 2004-03-09 - Purpose : CLineNumberEdit is a CEdit-derived class that displays - line numbers to the left of the text. - Description : The class uses the edit rect to make space for the line - numbers. The line numbers are relized through a special - CStatic-derived class, CLineNumberStatic. As soon as the - text is updated, the CLineNumberStatic is updated as - well. - Usage : The control can be dynamically created, or created from - a dialog template. The formatting string for the line - numbers can be set by calling SetLineNumberFormat (the - same format string as for CString::Format). By calling - SetMarginForegroundColor or SetMarginBackgroundColor - the fore- and background colors for the line number - display is set. - ======================================================================== - Update : Keith Bowes - Date : 2004-04-13 - Purpose : 1. To allow CLineNumberEdit to properly change colour when - Enabled/Disabled or when system colours change. - Changing system colours only has a noticable effect when - a scheme such as Marine or Plum is chosen. - 2. To allow a line number delta to be applied to the first - line number so the index does not have to start at zero. - 3. To allow a max value to be specified to stop the line - count and to allow smarter size formatting. - Description : 1. Added OnEnable and OnSysColorChange to detect when - a colour change is required. This allows the line number - area and CEdit area to update colours properly. - Added colour ref variables to hold enabled/disabled states - of the background/foreground colours. - In an attempt to allow previous functionality to take - precedence, if the colours are changed explicitly, the - system colours are no longer queried. - 2. Added m_LineDelta, applied when line numbers are formatted. - 3. Using m_maxval when > 0 to limit the max values and when - formatting colomn width. - JRO: Added m_lineDelta as well. - Usage : 1. Default behaviour is to change colours to reflect CEdit. - manually changing the colour will cause the colours to - only change to the specified colours. - 2. SetLineNumberRange sets both min and max values. - 3. SetLineNumberRange sets both min and max values. - - Comments : - Perhaps line values should be stored as UINT's as negative - values may have unexpected results. - - CLineNumberEdit::m_format creates a duplicate of - CLineNumberStatic::m_format, is this needed? - JRO: Even though the the two classes are thightly coupled, - this duplication of data makes it easier to decouple them. - A small matter, but code reuse is Politically Correct, - and as such A Desirable Feature. - - Added options could allow different system colours to be - chosen and updated as system attributes are changed. - - if m_maxval is exceeded in the edit box, new lines - are added without line numbers. This might not be the - desired behaviour. - JRO: I think this is rather nifty, actually. If I, as a - developer, sets the max number of lines to be numbered, - I also expect this to be the case :-))) - - It's not spelled wrong, just differently. ;0) - ======================================================================== - Update : Johan Rosengren - Date : 2004-04-14 - Purpose : 1. Allow deriving of CLineNumberEdit. - Description : 1. Made the message handlers virtual. - Usage : 1. Declare message handlers as virtual in derived - classes. Note that CLineNumberEdit is not built to - be derived from, however. - ======================================================================== - Update : Keith Bowes - Date : 2004-04-22 - Purpose : To allow processing of WM_LINESCROLL messages. - Description : Added OnLineScroll to handle the message. - Usage : Now will call UpdateTopAndBottom if the message is - received. - ======================================================================== - Update : Johan Rosengren - Date : 2004-05-02 - Purpose : Select complete line when a line-number is clicked - Description : Added registered user message, sent when the line- - number static is clicked. - Usage : See urm_SELECTLINE in the code. - ========================================================================*/ - -#include "stdafx.h" -#include "LineNumberEdit.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -// Registered message to allow selection of complete -// lines by clicking the line number -UINT urm_SELECTLINE = ::RegisterWindowMessage( _T("_LINE_NUMBER_EDIT_SELECTLINE_") ); - -///////////////////////////////////////////////////////////////////////////// -// CLineNumberEdit -CLineNumberEdit::CLineNumberEdit() -/* ============================================================ - Function : CLineNumberEdit::CLineNumberEdit - Description : constructor - - Return : void - Parameters : none - - Usage : - - ============================================================*/ -{ - - m_hWnd = NULL; - m_line.m_hWnd = NULL; - m_zero.cx = 0; - m_zero.cy = 0; - m_format = _T( "%03i" ); - m_LineDelta = 1; - - // Could default m_maxval to 99,999, but may cause problems - // if m_format is changed and m_maxval is not... - m_maxval = 998; - - // Setting up so by defult the original hard-coded colour - // scheme is used when enabled and the system colours are - // used when disabled. - m_bUseEnabledSystemColours = FALSE; - m_bUseDisabledSystemColours = TRUE; - m_EnabledFgCol = RGB( 0, 0, 0 ); - m_EnabledBgCol = RGB( 200, 200, 200 ); - m_DisabledFgCol = GetSysColor( COLOR_GRAYTEXT ); - m_DisabledBgCol = GetSysColor( COLOR_3DFACE ); - - SetWindowColour(); - -} - -CLineNumberEdit::~CLineNumberEdit() -/* ============================================================ - Function : CLineNumberEdit::~CLineNumberEdit - Description : destructor - - Return : void - Parameters : none - - Usage : - - ============================================================*/ -{ -} - -BEGIN_MESSAGE_MAP(CLineNumberEdit, CEdit) - ON_CONTROL_REFLECT(EN_CHANGE, OnChange) - ON_WM_VSCROLL() - ON_CONTROL_REFLECT(EN_VSCROLL, OnVscroll) - ON_MESSAGE(WM_SETFONT, OnSetFont) - ON_WM_SIZE() - ON_MESSAGE(WM_SETTEXT, OnSetText) - ON_WM_SYSCOLORCHANGE() - ON_WM_ENABLE() - ON_MESSAGE(EM_LINESCROLL, OnLineScroll) - ON_REGISTERED_MESSAGE(urm_SELECTLINE, OnSelectLine) -END_MESSAGE_MAP() - -void CLineNumberEdit::PreSubclassWindow() -/* ============================================================ - Function : CLineNumberEdit::PreSubclassWindow - Description : This function is called before the control - is subclassed for a control on a dialog - template, and during creation for - dynamically created controls. - - Return : void - Parameters : none - - Usage : Called from MFC - - ============================================================*/ -{ - - // Unfortunately, we can't change to ES_MULTILINE - // during run-time. - ASSERT( GetStyle() & ES_MULTILINE ); - - // Creating the line number control - SetLineNumberFormat( m_format ); - -} - -///////////////////////////////////////////////////////////////////////////// -// CLineNumberEdit message handlers - -void CLineNumberEdit::OnSysColorChange() -/* ============================================================ - Function : CLineNumberEdit::OnSysColorChange - Description : Handles WM_SYSCOLORCHANGE. User has changed - the system colours, want to refresh. - - Return : void - Parameters : void - - Usage : Called from Windows - - ============================================================*/ -{ - - CEdit::OnSysColorChange(); - - // update the CStatic with the new colours - SetWindowColour( IsWindowEnabled() ); - -} - -LRESULT CLineNumberEdit::OnSetText( WPARAM wParam, LPARAM lParam ) -/* ============================================================ - Function : CLineNumberEdit::OnSetText - Description : Handles WM_SETTEXT. We must update the line - numbers in the line number control as well. - - Return : LRESULT - From Def proc - Parameters : WPARAM wParam - From Windows - LPARAM lParam - From Windows - - Usage : Called from Windows - - ============================================================*/ -{ - - // Default processing - LRESULT retval = DefWindowProc( WM_SETTEXT, wParam, lParam ); - UpdateTopAndBottom(); - return retval; - -} - -void CLineNumberEdit::OnChange() -/* ============================================================ - Function : CLineNumberEdit::OnChange - Description : Mapped to EN_CHANGE. We must handle - EN_CHANGE to let the line-number control - reflect changes to the edit box content. - - Return : void - Parameters : none - - Usage : Called from Windows - - ============================================================*/ -{ - - UpdateTopAndBottom(); - -} - -void CLineNumberEdit::OnVscroll() -/* ============================================================ - Function : CLineNumberEdit::OnVscroll - Description : Mapped to EN_VSCROLL. We update the line - numbers in the line number control - - Return : void - Parameters : none - - Usage : Called from Windows - - ============================================================*/ -{ - - UpdateTopAndBottom(); - -} - -void CLineNumberEdit::OnVScroll( UINT nSBCode, UINT nPos, CScrollBar* pScrollBar ) -/* ============================================================ - Function : CLineNumberEdit::OnVScroll - Description : Handles WM_VSCROLL. We handle WM_VSCROLL - in addition to the notification EN_VSCROLL, - to handle scrollbar dragging as well - - Return : void - Parameters : UINT nSBCode - From Windows - UINT nPos - From Windows - CScrollBar* pScrollBar - From Windows - - Usage : Called from Windows - - ============================================================*/ -{ - - CEdit::OnVScroll( nSBCode, nPos, pScrollBar ); - UpdateTopAndBottom(); - -} - -LRESULT CLineNumberEdit::OnLineScroll( WPARAM wParam, LPARAM lParam ) -/* ============================================================ - Function : CLineNumberEdit::OnLineScroll - Description : Mapped to EM_LINESCROLL. We update the line - numbers in the line number control. - - Return : void - Parameters : none - Usage : Called from Windows - ============================================================*/ -{ - - // Default processing - LRESULT retval = DefWindowProc( EM_LINESCROLL, wParam, lParam ); - UpdateTopAndBottom(); - return retval; - -} - -LRESULT CLineNumberEdit::OnSetFont( WPARAM wParam, LPARAM lParam ) -/* ============================================================ - Function : CLineNumberEdit::OnSetFont - Description : Mapped to WM_SETFONT. We must recalculate - the line number control size as well. - - Return : LRESULT - Always 0 - Parameters : WPARAM wParam - From Windows - LPARAM lParam - From Windows - - Usage : Called from Windows - - ============================================================*/ -{ - - DefWindowProc( WM_SETFONT, wParam, lParam ); - // We resize the line-number - // field - Prepare(); - return 0; - -} - -void CLineNumberEdit::OnSize( UINT nType, int cx, int cy ) -/* ============================================================ - Function : CLineNumberEdit::OnSize - Description : Handles WM_SIZE. Recalculates the line - number control size as well. - - Return : void - Parameters : UINT nType - From Windows - int cx - From Windows - int cy - From Windows - - Usage : Called from Windows - - ============================================================*/ -{ - - CEdit::OnSize( nType, cx, cy ); - - // If we have the line-number - // control, it must be resized - // as well. - if( m_line.m_hWnd ) - Prepare(); - -} - -void CLineNumberEdit::OnEnable( BOOL bEnable ) -/* ============================================================ - Function : CLineNumberEdit::OnEnable - Description : Handles WM_ENABLE. Calls to set colours. - - Return : void - Parameters : BOOL bEnable - From Windows - - Usage : Called from Windows. - - ============================================================*/ -{ - - CEdit::OnEnable( bEnable ); - SetWindowColour( bEnable ); - -} - -LRESULT CLineNumberEdit::OnSelectLine(WPARAM wParam, LPARAM /*lParam*/ ) -/* ============================================================ - Function : CLineNumberEdit::OnSelectLine - Description : Handler for the urm_SELECTLINE registered - message. Will select the line in wParam. - - Return : LRESULT - Not used - Parameters : WPARAM wParam - The line to select - LPARAM lParam - Not used - - Usage : Called from MFC. Use - SendMessage( urm_SELECTLINE, line ) from - code. - - ============================================================*/ -{ - - // Calc start and end position of the line - int lineno = wParam + GetScrollPos( SB_VERT ); - int start = LineIndex( lineno ); - int end = LineIndex( lineno + 1 ); - SetSel( start, end - 1 ); - return 0; - -} - -void CLineNumberEdit::SetWindowColour( BOOL bEnable /*= TRUE*/ ) -/* ============================================================ - Function : CLineNumberEdit::SetWindowColour - Description : Handles changing window colours. - - Return : void - Parameters : BOOL bEnable - flag if set enabled/disabled - colours - - Usage : Called to change colours in the edit box. - - ============================================================*/ -{ - - if (m_bUseEnabledSystemColours) - { - // re-query the system colours in case they have changed. - m_EnabledFgCol = GetSysColor( COLOR_WINDOWTEXT ); - m_EnabledBgCol = GetSysColor( COLOR_WINDOW ); - } - - if (m_bUseDisabledSystemColours) - { - // re-query the system colours in case they have changed. - m_DisabledFgCol = GetSysColor( COLOR_GRAYTEXT ); - m_DisabledBgCol = GetSysColor( COLOR_3DFACE ); - } - - // change the colour based on bEnable - if (bEnable) - { - m_line.SetFgColor( m_EnabledFgCol, TRUE ); - m_line.SetBgColor( m_EnabledBgCol, TRUE ); - } else { - m_line.SetFgColor( m_DisabledFgCol, TRUE ); - m_line.SetBgColor( m_DisabledBgCol, TRUE ); - } - -} - -void CLineNumberEdit::UseSystemColours( BOOL bUseEnabled /*= TRUE*/, BOOL bUseDisabled /*= TRUE*/ ) -/* ============================================================ - Function : CLineNumberEdit::UseSystemColours - Description : Sets the Use*SystemColours flags. - - Return : void - Parameters : BOOL bEnabled - flag if to use enabled - system colours - BOOL bDisabled - flag if to use disabled - system colours - - Usage : Called to change colours in the edit box - - ============================================================*/ -{ - - m_bUseEnabledSystemColours = bUseEnabled; - m_bUseDisabledSystemColours = bUseDisabled; - BOOL bEnable = TRUE; - if (::IsWindow(m_hWnd)) - bEnable = IsWindowEnabled(); - - SetWindowColour( bEnable ); - -} - -///////////////////////////////////////////////////////////////////////////// -// CLineNumberEdit private implementation - -void CLineNumberEdit::Prepare() -/* ============================================================ - Function : CLineNumberEdit::Prepare - Description : Setting the edit rect for the control and - either create or move the line number - control. Also sets the top- and bottom - line numbers. - - Return : void - Parameters : none - - Usage : Must be called to (re)establish the edit - rect, must also be called as soon as the - control changes size. - - ============================================================*/ -{ - - // Calc sizes - int width = CalcLineNumberWidth(); - CRect rect; - GetClientRect( &rect ); - CRect rectEdit( rect ); - rect.right = width; - rectEdit.left = rect.right + 3; - - // Setting the edit rect and - // creating or moving child control - SetRect( &rectEdit ); - if( m_line.m_hWnd ) - m_line.MoveWindow( 0, 0, width, rect.Height() ); - else - m_line.Create(NULL,WS_CHILD | WS_VISIBLE | SS_NOTIFY, rect, this, 1 ); - - GetRect( &rectEdit ); - - // Update line number control data - m_line.SetTopMargin( rectEdit.top ); - UpdateTopAndBottom(); - -} - -int CLineNumberEdit::CalcLineNumberWidth() -/* ============================================================ - Function : CLineNumberEdit::CalcLineNumberWidth - Description : Calculates the desired width of the line - number control, using the current format - string and the max number of chars allowed - (pessimistic - assumes one character per - line). - - Return : int - The width in pixels - Parameters : none - - Usage : Called as soon as the format string is - changed. - - ============================================================*/ -{ - - CClientDC dc( this ); - - // If a new font is set during runtime, - // we must explicitly select the font into - // the CClientDC to measure it. - CFont* font = GetFont(); - CFont* oldFont = dc.SelectObject( font ); - - m_zero=dc.GetTextExtent( _T( "0" ) ); - CString format; - - // GetLimitText returns the number of bytes the edit box may contain, - // not the max number of lines... - //... which is the max number of lines, given one character per d:o :-) - int maxval = GetLimitText(); - if (m_maxval > 0) - maxval = m_maxval + m_LineDelta; - - format.Format( m_format, maxval ); - CSize fmt = dc.GetTextExtent( format ); - dc.SelectObject( oldFont ); - - // Calculate the size of the line- - // number field. We add a 5 pixel margin - // to the max size of the format string - return fmt.cx + 5; - -} - -void CLineNumberEdit::UpdateTopAndBottom() -/* ============================================================ - Function : CLineNumberEdit::UpdateTopAndBottom - Description : Updates the top- and bottom line number - for the line number control. - - Return : void - Parameters : none - Usage : Should be called as soon as the contents of - the control is changed. - - ============================================================*/ -{ - - CRect rect; - GetClientRect( &rect ); - int maxline = GetLineCount() + m_LineDelta; - - // Height for individual lines - int lineheight = m_zero.cy; - - // Calculate the number of lines to draw - int topline = GetFirstVisibleLine() + m_LineDelta; - if( ( topline + ( rect.Height() / lineheight ) ) < maxline ) - maxline = topline + ( rect.Height() / lineheight ); - - if ( m_maxval > 0 && maxline > m_maxval + m_LineDelta ) - maxline = m_maxval + m_LineDelta; - - m_line.SetTopAndBottom( topline, maxline ); - -} - -///////////////////////////////////////////////////////////////////////////// -// CLineNumberEdit public implementation - -void CLineNumberEdit::SetMarginForegroundColor( COLORREF col, BOOL redraw, BOOL bEnabled /*= TRUE*/ ) -/* ============================================================ - Function : CLineNumberEdit::SetMarginForegroundColor - Description : Sets the text color for the number - margin. - - Return : void - Parameters : COLORREF col - The new text color - BOOL redraw - TRUE if the control - should be redrawn - (default) - - Usage : Call to set a new text color for the line - number margin. The control will be redrawn - if it exists. - - ============================================================*/ -{ - - m_line.SetFgColor( col, redraw ); - if (bEnabled) - { - m_bUseEnabledSystemColours = FALSE; - m_EnabledFgCol = col; - } else { - m_bUseDisabledSystemColours = FALSE; - m_DisabledFgCol = col; - } - -} - -void CLineNumberEdit::SetMarginBackgroundColor( COLORREF col, BOOL redraw, BOOL bEnabled /*= TRUE*/ ) -/* ============================================================ - Function : CLineNumberEdit::SetMarginBackgroundColor - Description : Sets the background color for the number - margin. - - Return : void - Parameters : COLORREF col - The new background color - BOOL redraw - TRUE if the control - should be redrawn - (default) - - Usage : Call to set a new background color for the - line number margin. The control will be - redrawn if it exists. - - ============================================================*/ -{ - - m_line.SetBgColor( col, redraw ); - if (bEnabled) - { - m_bUseEnabledSystemColours = FALSE; - m_EnabledBgCol = col; - } else { - m_bUseDisabledSystemColours = FALSE; - m_DisabledBgCol = col; - } - -} - -void CLineNumberEdit::SetLineNumberFormat( CString format ) -/* ============================================================ - Function : CLineNumberEdit::SetLineNumberFormat - Description : Changes the way line numbers are presented - on screen. - - Return : void - Parameters : CString format - The new format string - - Usage : Call with a format string using the same - format as CString::Format. It should contain - one and only one numeric type. - - ============================================================*/ -{ - - m_format = format; - m_line.SetLineNumberFormat( format ); - if( m_hWnd ) - Prepare(); - -} - -void CLineNumberEdit::SetLineNumberRange( UINT nMin, UINT nMax /*= 0*/ ) -/* ============================================================ - Function : CLineNumberEdit::SetLineNumberRange - Description : Changes the default min and max line numbers. - - Return : void - Parameters : int nMin - changes the line offset - int nMax - changes the max line number - - Usage : Call to set up the min and max line numbers. - - ============================================================*/ -{ - - m_LineDelta = ( int ) nMin; - m_maxval = ( int ) nMax; - -} - -///////////////////////////////////////////////////////////////////////////// -// CLineNumberStatic - -CLineNumberStatic::CLineNumberStatic() -/* ============================================================ - Function : CLineNumberStatic::CLineNumberStatic - Description : constructor - - Return : void - Parameters : none - - Usage : - - ============================================================*/ -{ - - m_bgcol = RGB( 255, 255, 248 ); - m_fgcol = RGB( 0, 0, 0 ); - m_format = _T( "%05i" ); - m_topline = 0; - m_bottomline = 0; -} - -CLineNumberStatic::~CLineNumberStatic() -/* ============================================================ - Function : CLineNumberStatic::~CLineNumberStatic - Description : destructor - - Return : void - Parameters : none - - Usage : - - ============================================================*/ -{ -} - -BEGIN_MESSAGE_MAP(CLineNumberStatic, CStatic) - ON_WM_PAINT() - ON_WM_ERASEBKGND() - ON_WM_LBUTTONDOWN() -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CLineNumberStatic message handlers - -void CLineNumberStatic::OnPaint() -/* ============================================================ - Function : CLineNumberStatic::OnPaint - Description : Handler for WM_PAINT. - - Return : void - Parameters : none - - Usage : Called from Windows. - - ============================================================*/ -{ - - CPaintDC dcPaint( this ); - - CRect rect; - GetClientRect( &rect ); - - // We double buffer the drawing - - // preparing the memory CDC - CDC dc; - dc.CreateCompatibleDC( &dcPaint ); - int saved = dc.SaveDC(); - - // Create GDI and select objects - CBitmap bmp; - CPen pen; - bmp.CreateCompatibleBitmap( &dcPaint, rect.Width(), rect.Height() ); - pen.CreatePen( PS_SOLID, 1, m_fgcol ); - dc.SelectObject( &bmp ); - dc.SelectObject( &pen ); - - // Painting the background - dc.FillSolidRect( &rect, m_bgcol ); - dc.MoveTo( rect.right - 1, 0 ); - dc.LineTo( rect.right - 1, rect.bottom ); - - // Setting other attributes - dc.SetTextColor( m_fgcol ); - dc.SetBkColor( m_bgcol ); - dc.SelectObject( GetParent()->GetFont() ); - - // Output the line numbers - if( m_bottomline ) - { - int lineheight = dc.GetTextExtent( _T( "0" ) ).cy; - for( int t = m_topline ; t < m_bottomline ; t++ ) - { - CString output; - output.Format( m_format, t ); - int topposition = m_topmargin + lineheight * ( t - m_topline ); - dc.TextOut( 2, topposition, output ); - } - } - - dcPaint.BitBlt( 0, 0, rect. right, rect.bottom, &dc, 0, 0, SRCCOPY ); - dc.RestoreDC( saved ); - -} - -BOOL CLineNumberStatic::OnEraseBkgnd( CDC* ) -/* ============================================================ - Function : CLineNumberStatic::OnEraseBkgnd - Description : Mapped to WM_ERASEBKGND. Handled to avoid - flicker, as we redraw the complete control - in OnPaint - - Return : BOOL - Always TRUE - Parameters : CDC* - From Windows - - Usage : Called from Windows. - - ============================================================*/ -{ - - return TRUE; - -} - -void CLineNumberStatic::OnLButtonDown( UINT nFlags, CPoint point ) -/* ============================================================ - Function : CLineNumberStatic::OnLButtonDown - Description : Called when the control is clicked. Will - send the urm_SELECTLINE registered message - to the parent to select the line clicked on. - - Return : void - Parameters : UINT nFlags - Not used - CPoint point - Position of cursor - - Usage : Called from Windows. - - ============================================================*/ -{ - - // Find the line clicked on - CClientDC dc( this ); - dc.SelectObject( GetParent()->GetFont() ); - int lineheight = dc.GetTextExtent( _T( "0" ) ).cy; - int lineno = ( int ) ( ( double ) point.y / ( double ) lineheight ); - - // Select this line in the edit control - GetParent()->SendMessage( urm_SELECTLINE, lineno ); - - CStatic::OnLButtonDown( nFlags, point ); - -} - -///////////////////////////////////////////////////////////////////////////// -// CLineNumberStatic public implementation - -void CLineNumberStatic::SetBgColor( COLORREF col, BOOL redraw ) -/* ============================================================ - Function : CLineNumberStatic::SetBgColor - Description : This function sets the panel background - color - - Return : void - Parameters : COLORREF col - New background color - BOOL redraw - TRUE if the control - should be redrawn - (default) - - Usage : Called from the parent. - - ============================================================*/ -{ - - m_bgcol = col; - if( m_hWnd && redraw ) - RedrawWindow(); - -} - -void CLineNumberStatic::SetFgColor( COLORREF col, BOOL redraw ) -/* ============================================================ - Function : CLineNumberStatic::SetFgColor - Description : This function sets the panel foreground - color - - Return : void - Parameters : COLORREF col - New text color - BOOL redraw - TRUE if the control - should be redrawn - (default) - - Usage : Called from the parent. - - ============================================================*/ -{ - - m_fgcol = col; - if( m_hWnd && redraw ) - RedrawWindow(); - -} - -void CLineNumberStatic::SetTopAndBottom( int topline, int bottomline ) -/* ============================================================ - Function : CLineNumberStatic::SetTopAndBottom - Description : Sets the top- and bottom line and redraw - the control (if it exists) - - Return : void - Parameters : int topline - The top line number - int bottomline - The bottom line number - - Usage : Called when the top and bottom line is - changed in the parent. - - ============================================================*/ -{ - - m_topline = topline; - m_bottomline = bottomline; - if( m_hWnd ) - RedrawWindow(); - -} - -void CLineNumberStatic::SetTopMargin( int topmargin ) -/* ============================================================ - Function : CLineNumberStatic::SetTopMargin - Description : Sets the top margin for painting. - - Return : void - Parameters : int topmargin - The top margin to set - - Usage : Will be called with the value of GetRect - from the parent. - - ============================================================*/ -{ - - m_topmargin = topmargin; - -} - -void CLineNumberStatic::SetLineNumberFormat( CString format ) -/* ============================================================ - Function : CLineNumberStatic::SetLineNumberFormat - Description : Sets the format string of the control - - Return : void - Parameters : CString format - Format string to use - - Usage : Called from the parent when the format - string is changed. - - ============================================================*/ -{ - - m_format = format; - if( m_hWnd ) - RedrawWindow(); - -} diff --git a/src/apps/mplayerc/LineNumberEdit.h b/src/apps/mplayerc/LineNumberEdit.h deleted file mode 100644 index 4794ead44..000000000 --- a/src/apps/mplayerc/LineNumberEdit.h +++ /dev/null @@ -1,99 +0,0 @@ -#if !defined(AFX_LINENUMBEREDIT_H__CAB7A465_709C_42B8_80D0_2B0AF6D25AD4__INCLUDED_) -#define AFX_LINENUMBEREDIT_H__CAB7A465_709C_42B8_80D0_2B0AF6D25AD4__INCLUDED_ - -///////////////////////////////////////////////////////////////////////////// -// CLineNumberStatic window - -class CLineNumberStatic : public CStatic -{ -// Construction/destruction -public: - CLineNumberStatic(); - virtual ~CLineNumberStatic(); - -// Operations -public: - void SetFgColor( COLORREF col, BOOL redraw ); - void SetBgColor( COLORREF col, BOOL redraw ); - void SetTopAndBottom( int topline, int bottomline ); - void SetTopMargin( int topmargin ); - void SetLineNumberFormat( CString format ); - -protected: - afx_msg BOOL OnEraseBkgnd(CDC* pDC); - afx_msg void OnPaint(); - afx_msg void OnLButtonDown( UINT nFlags, CPoint point ); - DECLARE_MESSAGE_MAP() - -private: -// Attributes - COLORREF m_fgcol; - COLORREF m_bgcol; - CString m_format; - - int m_topmargin; // Current top margin - int m_topline; // Current top line number - int m_bottomline; // Current bottom line number -}; - - -///////////////////////////////////////////////////////////////////////////// -// CLineNumberEdit window - -class CLineNumberEdit : public CEdit -{ -// Construction/destruction -public: - CLineNumberEdit(); - virtual ~CLineNumberEdit(); - -// Operations -public: - void SetMarginForegroundColor( COLORREF col, BOOL redraw = TRUE, BOOL bEnabled = TRUE ); - void SetMarginBackgroundColor( COLORREF col, BOOL redraw = TRUE, BOOL bEnabled = TRUE ); - void SetLineNumberFormat( CString format ); - void SetLineNumberRange( UINT nMin, UINT nMax = 0 ); - void UseSystemColours( BOOL bUseEnabled = TRUE, BOOL bUseDisabled = TRUE ); - - int GetLineHeight() {return m_zero.cy;} - -protected: - virtual void PreSubclassWindow(); - - virtual afx_msg void OnEnable( BOOL bEnable ); - virtual afx_msg void OnSysColorChange(); - virtual afx_msg void OnChange(); - virtual afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); - virtual afx_msg void OnVscroll(); - virtual afx_msg void OnSize(UINT nType, int cx, int cy); - virtual afx_msg LRESULT OnSetFont(WPARAM wParam, LPARAM lParam); // Maps to WM_SETFONT - virtual afx_msg LRESULT OnSetText(WPARAM wParam, LPARAM lParam); // Maps to WM_SETTEXT - virtual afx_msg LRESULT OnLineScroll(WPARAM wParam, LPARAM lParam); // Maps to EM_LINESCROLL - virtual afx_msg LRESULT OnSelectLine(WPARAM wParam, LPARAM lParam); - DECLARE_MESSAGE_MAP() - -private: - void Prepare(); - int CalcLineNumberWidth(); - void UpdateTopAndBottom(); - - // Method to set window colour only - void SetWindowColour( BOOL bEnable = TRUE ); - -// Attributes - BOOL m_bUseEnabledSystemColours; - COLORREF m_EnabledFgCol; - COLORREF m_EnabledBgCol; - BOOL m_bUseDisabledSystemColours; - COLORREF m_DisabledFgCol; - COLORREF m_DisabledBgCol; - - CLineNumberStatic m_line; - CSize m_zero; - int m_maxval; - CString m_format; - int m_LineDelta; // Introduced to provide an offset to the first line number - -}; - -#endif // !defined(AFX_LINENUMBEREDIT_H__CAB7A465_709C_42B8_80D0_2B0AF6D25AD4__INCLUDED_) diff --git a/src/apps/mplayerc/MacrovisionKicker.cpp b/src/apps/mplayerc/MacrovisionKicker.cpp deleted file mode 100644 index 2f3e423cb..000000000 --- a/src/apps/mplayerc/MacrovisionKicker.cpp +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include "stdafx.h" -#include "MacrovisionKicker.h" - -// -// CMacrovisionKicker -// - -CMacrovisionKicker::CMacrovisionKicker(const TCHAR* pName, LPUNKNOWN pUnk) - : CUnknown(pName, pUnk) -{ -} - -CMacrovisionKicker::~CMacrovisionKicker() -{ -} - -void CMacrovisionKicker::SetInner(CComPtr pUnk) -{ - m_pInner = pUnk; -} - -STDMETHODIMP CMacrovisionKicker::NonDelegatingQueryInterface(REFIID riid, void** ppv) -{ - if(riid == __uuidof(IUnknown)) - return __super::NonDelegatingQueryInterface(riid, ppv); - if(riid == __uuidof(IKsPropertySet) && CComQIPtr(m_pInner)) - return GetInterface((IKsPropertySet*)this, ppv); - - HRESULT hr = m_pInner ? m_pInner->QueryInterface(riid, ppv) : E_NOINTERFACE; - - return SUCCEEDED(hr) ? hr : __super::NonDelegatingQueryInterface(riid, ppv); -} - -// IKsPropertySet - -STDMETHODIMP CMacrovisionKicker::Set(REFGUID PropSet, ULONG Id, LPVOID pInstanceData, ULONG InstanceLength, LPVOID pPropertyData, ULONG DataLength) -{ - if(CComQIPtr pKsPS = m_pInner) - { - if(PropSet == AM_KSPROPSETID_CopyProt && Id == AM_PROPERTY_COPY_MACROVISION - /*&& DataLength == 4 && *(DWORD*)pPropertyData*/) - { - TRACE(_T("Oops, no-no-no, no macrovision please\n")); - return S_OK; - } - - return pKsPS->Set(PropSet, Id, pInstanceData, InstanceLength, pPropertyData, DataLength); - } - - return E_UNEXPECTED; -} - -STDMETHODIMP CMacrovisionKicker::Get(REFGUID PropSet, ULONG Id, LPVOID pInstanceData, ULONG InstanceLength, LPVOID pPropertyData, ULONG DataLength, ULONG* pBytesReturned) -{ - if(CComQIPtr pKsPS = m_pInner) - { - return pKsPS->Get(PropSet, Id, pInstanceData, InstanceLength, pPropertyData, DataLength, pBytesReturned); - } - - return E_UNEXPECTED; -} - -STDMETHODIMP CMacrovisionKicker::QuerySupported(REFGUID PropSet, ULONG Id, ULONG* pTypeSupport) -{ - if(CComQIPtr pKsPS = m_pInner) - { - return pKsPS->QuerySupported(PropSet, Id, pTypeSupport); - } - - return E_UNEXPECTED; -} diff --git a/src/apps/mplayerc/MacrovisionKicker.h b/src/apps/mplayerc/MacrovisionKicker.h deleted file mode 100644 index 72b465cf3..000000000 --- a/src/apps/mplayerc/MacrovisionKicker.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#pragma once - -class CMacrovisionKicker - : public CUnknown - , public IKsPropertySet -{ - CComPtr m_pInner; - -public: - CMacrovisionKicker(const TCHAR* pName, LPUNKNOWN pUnk); - virtual ~CMacrovisionKicker(); - - void SetInner(CComPtr pUnk); - - DECLARE_IUNKNOWN; - STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv); - - // IKsPropertySet - STDMETHODIMP Set(REFGUID PropSet, ULONG Id, LPVOID pInstanceData, ULONG InstanceLength, LPVOID pPropertyData, ULONG DataLength); - STDMETHODIMP Get(REFGUID PropSet, ULONG Id, LPVOID pInstanceData, ULONG InstanceLength, LPVOID pPropertyData, ULONG DataLength, ULONG* pBytesReturned); - STDMETHODIMP QuerySupported(REFGUID PropSet, ULONG Id, ULONG* pTypeSupport); -}; - diff --git a/src/apps/mplayerc/MainFrm.cpp b/src/apps/mplayerc/MainFrm.cpp deleted file mode 100644 index 1b3c28377..000000000 --- a/src/apps/mplayerc/MainFrm.cpp +++ /dev/null @@ -1,10066 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -// MainFrm.cpp : implementation of the CMainFrame class -// - -#include "stdafx.h" -#include "mplayerc.h" - -#include "MainFrm.h" - -#include - -#include - -#include -#include -#include - -#include "OpenFileDlg.h" -#include "OpenDlg.h" -#include "SaveDlg.h" -#include "GoToDlg.h" -#include "PnSPresetsDlg.h" -#include "MediaTypesDlg.h" -#include "SaveTextFileDialog.h" -#include "SaveThumbnailsDialog.h" -#include "FavoriteAddDlg.h" -#include "FavoriteOrganizeDlg.h" -#include "ConvertDlg.h" -#include "ShaderCombineDlg.h" - -#include -#include -#include -#include -#include -#include - -#include -#include -#include "..\..\..\include\moreuuids.h" -#include -//#include - -#include "..\..\DSUtil\DSUtil.h" -#include "FGManager.h" - -#include "textpassthrufilter.h" -#include "..\..\filters\filters.h" -#include "..\..\filters\PinInfoWnd.h" - -#include "DX7AllocatorPresenter.h" -#include "DX9AllocatorPresenter.h" - -#include "..\..\subtitles\SSF.h" - -#define DEFCLIENTW 292 -#define DEFCLIENTH 200 - -static UINT s_uTaskbarRestart = RegisterWindowMessage(TEXT("TaskbarCreated")); -static UINT WM_NOTIFYICON = RegisterWindowMessage(TEXT("MYWM_NOTIFYICON")); - -#include "..\..\filters\transform\vsfilter\IDirectVobSub.h" - -class CSubClock : public CUnknown, public ISubClock -{ - STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv) - { - return - QI(ISubClock) - CUnknown::NonDelegatingQueryInterface(riid, ppv); - } - - REFERENCE_TIME m_rt; - -public: - CSubClock() : CUnknown(NAME("CSubClock"), NULL) {m_rt = 0;} - - DECLARE_IUNKNOWN; - - // ISubClock - STDMETHODIMP SetTime(REFERENCE_TIME rt) {m_rt = rt; return S_OK;} - STDMETHODIMP_(REFERENCE_TIME) GetTime() {return(m_rt);} -}; - -// - -#define SaveMediaState \ - OAFilterState __fs = GetMediaState(); \ - \ - REFERENCE_TIME __rt = 0; \ - if(m_iMediaLoadState == MLS_LOADED) __rt = GetPos(); \ - \ - if(__fs != State_Stopped) \ - SendMessage(WM_COMMAND, ID_PLAY_STOP); \ - - -#define RestoreMediaState \ - if(m_iMediaLoadState == MLS_LOADED) \ - { \ - SeekTo(__rt); \ - \ - if(__fs == State_Stopped) \ - SendMessage(WM_COMMAND, ID_PLAY_STOP); \ - else if(__fs == State_Paused) \ - SendMessage(WM_COMMAND, ID_PLAY_PAUSE); \ - else if(__fs == State_Running) \ - SendMessage(WM_COMMAND, ID_PLAY_PLAY); \ - } \ - -/* -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif -*/ -///////////////////////////////////////////////////////////////////////////// -// CMainFrame - -IMPLEMENT_DYNAMIC(CMainFrame, CFrameWnd) - -BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd) - ON_WM_CREATE() - ON_WM_DESTROY() - ON_WM_CLOSE() - - ON_REGISTERED_MESSAGE(s_uTaskbarRestart, OnTaskBarRestart) - ON_REGISTERED_MESSAGE(WM_NOTIFYICON, OnNotifyIcon) - - ON_WM_SETFOCUS() - ON_WM_GETMINMAXINFO() - ON_WM_MOVE() - ON_WM_MOVING() - ON_WM_SIZE() - ON_WM_SIZING() - ON_MESSAGE_VOID(WM_DISPLAYCHANGE, OnDisplayChange) - - ON_WM_SYSCOMMAND() - ON_WM_ACTIVATEAPP() - ON_MESSAGE(WM_APPCOMMAND, OnAppCommand) - - ON_WM_TIMER() - - ON_MESSAGE(WM_GRAPHNOTIFY, OnGraphNotify) - ON_MESSAGE(WM_REARRANGERENDERLESS, OnRepaintRenderLess) - ON_MESSAGE(WM_RESUMEFROMSTATE, OnResumeFromState) - - ON_WM_LBUTTONDOWN() - ON_WM_LBUTTONUP() - ON_WM_LBUTTONDBLCLK() - ON_WM_MBUTTONDOWN() - ON_WM_MBUTTONUP() - ON_WM_MBUTTONDBLCLK() - ON_WM_RBUTTONDOWN() - ON_WM_RBUTTONUP() - ON_WM_RBUTTONDBLCLK() - ON_MESSAGE(WM_XBUTTONDOWN, OnXButtonDown) - ON_MESSAGE(WM_XBUTTONUP, OnXButtonUp) - ON_MESSAGE(WM_XBUTTONDBLCLK, OnXButtonDblClk) - ON_WM_MOUSEWHEEL() - ON_WM_MOUSEMOVE() - - ON_WM_NCHITTEST() - - ON_WM_HSCROLL() - - ON_WM_INITMENU() - ON_WM_INITMENUPOPUP() - - ON_COMMAND(ID_MENU_PLAYER_SHORT, OnMenuPlayerShort) - ON_COMMAND(ID_MENU_PLAYER_LONG, OnMenuPlayerLong) - ON_COMMAND(ID_MENU_FILTERS, OnMenuFilters) - - ON_UPDATE_COMMAND_UI(IDC_PLAYERSTATUS, OnUpdatePlayerStatus) - - ON_COMMAND(ID_FILE_POST_OPENMEDIA, OnFilePostOpenmedia) - ON_UPDATE_COMMAND_UI(ID_FILE_POST_OPENMEDIA, OnUpdateFilePostOpenmedia) - ON_COMMAND(ID_FILE_POST_CLOSEMEDIA, OnFilePostClosemedia) - ON_UPDATE_COMMAND_UI(ID_FILE_POST_CLOSEMEDIA, OnUpdateFilePostClosemedia) - - ON_COMMAND(ID_BOSS, OnBossKey) - - ON_COMMAND_RANGE(ID_STREAM_AUDIO_NEXT, ID_STREAM_AUDIO_PREV, OnStreamAudio) - ON_COMMAND_RANGE(ID_STREAM_SUB_NEXT, ID_STREAM_SUB_PREV, OnStreamSub) - ON_COMMAND(ID_STREAM_SUB_ONOFF, OnStreamSubOnOff) - ON_COMMAND_RANGE(ID_OGM_AUDIO_NEXT, ID_OGM_AUDIO_PREV, OnOgmAudio) - ON_COMMAND_RANGE(ID_OGM_SUB_NEXT, ID_OGM_SUB_PREV, OnOgmSub) - ON_COMMAND_RANGE(ID_DVD_ANGLE_NEXT, ID_DVD_ANGLE_PREV, OnDvdAngle) - ON_COMMAND_RANGE(ID_DVD_AUDIO_NEXT, ID_DVD_AUDIO_PREV, OnDvdAudio) - ON_COMMAND_RANGE(ID_DVD_SUB_NEXT, ID_DVD_SUB_PREV, OnDvdSub) - ON_COMMAND(ID_DVD_SUB_ONOFF, OnDvdSubOnOff) - - - ON_COMMAND(ID_FILE_OPENQUICK, OnFileOpenQuick) - ON_UPDATE_COMMAND_UI(ID_FILE_OPENMEDIA, OnUpdateFileOpen) - ON_COMMAND(ID_FILE_OPENMEDIA, OnFileOpenmedia) - ON_UPDATE_COMMAND_UI(ID_FILE_OPENMEDIA, OnUpdateFileOpen) - ON_WM_COPYDATA() - ON_COMMAND(ID_FILE_OPENDVD, OnFileOpendvd) - ON_UPDATE_COMMAND_UI(ID_FILE_OPENDVD, OnUpdateFileOpen) - ON_COMMAND(ID_FILE_OPENDEVICE, OnFileOpendevice) - ON_UPDATE_COMMAND_UI(ID_FILE_OPENDEVICE, OnUpdateFileOpen) - ON_COMMAND_RANGE(ID_FILE_OPEN_CD_START, ID_FILE_OPEN_CD_END, OnFileOpenCD) - ON_UPDATE_COMMAND_UI_RANGE(ID_FILE_OPEN_CD_START, ID_FILE_OPEN_CD_END, OnUpdateFileOpen) - ON_WM_DROPFILES() - ON_COMMAND(ID_FILE_SAVE_COPY, OnFileSaveAs) - ON_UPDATE_COMMAND_UI(ID_FILE_SAVE_COPY, OnUpdateFileSaveAs) - ON_COMMAND(ID_FILE_SAVE_IMAGE, OnFileSaveImage) - ON_UPDATE_COMMAND_UI(ID_FILE_SAVE_IMAGE, OnUpdateFileSaveImage) - ON_COMMAND(ID_FILE_SAVE_IMAGE_AUTO, OnFileSaveImageAuto) - ON_UPDATE_COMMAND_UI(ID_FILE_SAVE_IMAGE_AUTO, OnUpdateFileSaveImage) - ON_COMMAND(ID_FILE_SAVE_THUMBNAILS, OnFileSaveThumbnails) - ON_UPDATE_COMMAND_UI(ID_FILE_SAVE_THUMBNAILS, OnUpdateFileSaveThumbnails) - ON_COMMAND(ID_FILE_CONVERT, OnFileConvert) - ON_UPDATE_COMMAND_UI(ID_FILE_CONVERT, OnUpdateFileConvert) - ON_COMMAND(ID_FILE_LOAD_SUBTITLE, OnFileLoadsubtitle) - ON_UPDATE_COMMAND_UI(ID_FILE_LOAD_SUBTITLE, OnUpdateFileLoadsubtitle) - ON_COMMAND(ID_FILE_SAVE_SUBTITLE, OnFileSavesubtitle) - ON_UPDATE_COMMAND_UI(ID_FILE_SAVE_SUBTITLE, OnUpdateFileSavesubtitle) - ON_COMMAND(ID_FILE_ISDB_SEARCH, OnFileISDBSearch) - ON_UPDATE_COMMAND_UI(ID_FILE_ISDB_SEARCH, OnUpdateFileISDBSearch) - ON_COMMAND(ID_FILE_ISDB_UPLOAD, OnFileISDBUpload) - ON_UPDATE_COMMAND_UI(ID_FILE_ISDB_UPLOAD, OnUpdateFileISDBUpload) - ON_COMMAND(ID_FILE_ISDB_DOWNLOAD, OnFileISDBDownload) - ON_UPDATE_COMMAND_UI(ID_FILE_ISDB_DOWNLOAD, OnUpdateFileISDBDownload) - ON_COMMAND(ID_FILE_PROPERTIES, OnFileProperties) - ON_UPDATE_COMMAND_UI(ID_FILE_PROPERTIES, OnUpdateFileProperties) - ON_COMMAND(ID_FILE_CLOSEPLAYLIST, OnFileClosePlaylist) - ON_COMMAND(ID_FILE_CLOSEMEDIA, OnFileCloseMedia) - ON_UPDATE_COMMAND_UI(ID_FILE_CLOSEMEDIA, OnUpdateFileClose) - - ON_COMMAND(ID_VIEW_CAPTIONMENU, OnViewCaptionmenu) - ON_UPDATE_COMMAND_UI(ID_VIEW_CAPTIONMENU, OnUpdateViewCaptionmenu) - ON_COMMAND_RANGE(ID_VIEW_SEEKER, ID_VIEW_STATUS, OnViewControlBar) - ON_UPDATE_COMMAND_UI_RANGE(ID_VIEW_SEEKER, ID_VIEW_STATUS, OnUpdateViewControlBar) - ON_COMMAND(ID_VIEW_SUBRESYNC, OnViewSubresync) - ON_UPDATE_COMMAND_UI(ID_VIEW_SUBRESYNC, OnUpdateViewSubresync) - ON_COMMAND(ID_VIEW_PLAYLIST, OnViewPlaylist) - ON_UPDATE_COMMAND_UI(ID_VIEW_PLAYLIST, OnUpdateViewPlaylist) - ON_COMMAND(ID_VIEW_CAPTURE, OnViewCapture) - ON_UPDATE_COMMAND_UI(ID_VIEW_CAPTURE, OnUpdateViewCapture) - ON_COMMAND(ID_VIEW_SHADEREDITOR, OnViewShaderEditor) - ON_UPDATE_COMMAND_UI(ID_VIEW_SHADEREDITOR, OnUpdateViewShaderEditor) - ON_COMMAND(ID_VIEW_PRESETS_MINIMAL, OnViewMinimal) - ON_UPDATE_COMMAND_UI(ID_VIEW_PRESETS_MINIMAL, OnUpdateViewMinimal) - ON_COMMAND(ID_VIEW_PRESETS_COMPACT, OnViewCompact) - ON_UPDATE_COMMAND_UI(ID_VIEW_PRESETS_COMPACT, OnUpdateViewCompact) - ON_COMMAND(ID_VIEW_PRESETS_NORMAL, OnViewNormal) - ON_UPDATE_COMMAND_UI(ID_VIEW_PRESETS_NORMAL, OnUpdateViewNormal) - ON_COMMAND(ID_VIEW_FULLSCREEN, OnViewFullscreen) - ON_COMMAND(ID_VIEW_FULLSCREEN_SECONDARY, OnViewFullscreenSecondary) - ON_UPDATE_COMMAND_UI(ID_VIEW_FULLSCREEN, OnUpdateViewFullscreen) - ON_COMMAND_RANGE(ID_VIEW_ZOOM_50, ID_VIEW_ZOOM_200, OnViewZoom) - ON_UPDATE_COMMAND_UI_RANGE(ID_VIEW_ZOOM_50, ID_VIEW_ZOOM_200, OnUpdateViewZoom) - ON_COMMAND(ID_VIEW_ZOOM_AUTOFIT, OnViewZoomAutoFit) - ON_UPDATE_COMMAND_UI(ID_VIEW_ZOOM_AUTOFIT, OnUpdateViewZoom) - ON_COMMAND_RANGE(ID_VIEW_VF_HALF, ID_VIEW_VF_FROMOUTSIDE, OnViewDefaultVideoFrame) - ON_UPDATE_COMMAND_UI_RANGE(ID_VIEW_VF_HALF, ID_VIEW_VF_FROMOUTSIDE, OnUpdateViewDefaultVideoFrame) - ON_COMMAND(ID_VIEW_VF_KEEPASPECTRATIO, OnViewKeepaspectratio) - ON_UPDATE_COMMAND_UI(ID_VIEW_VF_KEEPASPECTRATIO, OnUpdateViewKeepaspectratio) - ON_COMMAND(ID_VIEW_VF_COMPMONDESKARDIFF, OnViewCompMonDeskARDiff) - ON_UPDATE_COMMAND_UI(ID_VIEW_VF_COMPMONDESKARDIFF, OnUpdateViewCompMonDeskARDiff) - ON_COMMAND_RANGE(ID_VIEW_RESET, ID_PANSCAN_CENTER, OnViewPanNScan) - ON_UPDATE_COMMAND_UI_RANGE(ID_VIEW_RESET, ID_PANSCAN_CENTER, OnUpdateViewPanNScan) - ON_COMMAND_RANGE(ID_PANNSCAN_PRESETS_START, ID_PANNSCAN_PRESETS_END, OnViewPanNScanPresets) - ON_UPDATE_COMMAND_UI_RANGE(ID_PANNSCAN_PRESETS_START, ID_PANNSCAN_PRESETS_END, OnUpdateViewPanNScanPresets) - ON_COMMAND_RANGE(ID_PANSCAN_ROTATEXP, ID_PANSCAN_ROTATEZM, OnViewRotate) - ON_UPDATE_COMMAND_UI_RANGE(ID_PANSCAN_ROTATEXP, ID_PANSCAN_ROTATEZM, OnUpdateViewRotate) - ON_COMMAND_RANGE(ID_ASPECTRATIO_START, ID_ASPECTRATIO_END, OnViewAspectRatio) - ON_UPDATE_COMMAND_UI_RANGE(ID_ASPECTRATIO_START, ID_ASPECTRATIO_END, OnUpdateViewAspectRatio) - ON_COMMAND(ID_ASPECTRATIO_NEXT, OnViewAspectRatioNext) - ON_COMMAND_RANGE(ID_ONTOP_NEVER, ID_ONTOP_WHILEPLAYING, OnViewOntop) - ON_UPDATE_COMMAND_UI_RANGE(ID_ONTOP_NEVER, ID_ONTOP_WHILEPLAYING, OnUpdateViewOntop) - ON_COMMAND(ID_VIEW_OPTIONS, OnViewOptions) - - ON_COMMAND_RANGE(ID_SUB_DELAY_DOWN, ID_SUB_DELAY_UP, OnSubtitleDelay) - - ON_COMMAND(ID_PLAY_PLAY, OnPlayPlay) - ON_COMMAND(ID_PLAY_PAUSE, OnPlayPause) - ON_COMMAND(ID_PLAY_PLAYPAUSE, OnPlayPlaypause) - ON_COMMAND(ID_PLAY_STOP, OnPlayStop) - ON_UPDATE_COMMAND_UI(ID_PLAY_PLAY, OnUpdatePlayPauseStop) - ON_UPDATE_COMMAND_UI(ID_PLAY_PAUSE, OnUpdatePlayPauseStop) - ON_UPDATE_COMMAND_UI(ID_PLAY_PLAYPAUSE, OnUpdatePlayPauseStop) - ON_UPDATE_COMMAND_UI(ID_PLAY_STOP, OnUpdatePlayPauseStop) - ON_COMMAND_RANGE(ID_PLAY_FRAMESTEP, ID_PLAY_FRAMESTEPCANCEL, OnPlayFramestep) - ON_UPDATE_COMMAND_UI_RANGE(ID_PLAY_FRAMESTEP, ID_PLAY_FRAMESTEPCANCEL, OnUpdatePlayFramestep) - ON_COMMAND_RANGE(ID_PLAY_SEEKBACKWARDSMALL, ID_PLAY_SEEKFORWARDLARGE, OnPlaySeek) - ON_COMMAND_RANGE(ID_PLAY_SEEKKEYBACKWARD, ID_PLAY_SEEKKEYFORWARD, OnPlaySeekKey) - ON_UPDATE_COMMAND_UI_RANGE(ID_PLAY_SEEKBACKWARDSMALL, ID_PLAY_SEEKFORWARDLARGE, OnUpdatePlaySeek) - ON_UPDATE_COMMAND_UI_RANGE(ID_PLAY_SEEKKEYBACKWARD, ID_PLAY_SEEKKEYFORWARD, OnUpdatePlaySeek) - ON_COMMAND(ID_PLAY_GOTO, OnPlayGoto) - ON_UPDATE_COMMAND_UI(ID_PLAY_GOTO, OnUpdateGoto) - ON_COMMAND_RANGE(ID_PLAY_DECRATE, ID_PLAY_INCRATE, OnPlayChangeRate) - ON_UPDATE_COMMAND_UI_RANGE(ID_PLAY_DECRATE, ID_PLAY_INCRATE, OnUpdatePlayChangeRate) - ON_COMMAND(ID_PLAY_RESETRATE, OnPlayResetRate) - ON_UPDATE_COMMAND_UI(ID_PLAY_RESETRATE, OnUpdatePlayResetRate) - ON_COMMAND_RANGE(ID_PLAY_INCAUDDELAY, ID_PLAY_DECAUDDELAY, OnPlayChangeAudDelay) - ON_UPDATE_COMMAND_UI_RANGE(ID_PLAY_INCAUDDELAY, ID_PLAY_DECAUDDELAY, OnUpdatePlayChangeAudDelay) - ON_COMMAND_RANGE(ID_FILTERS_SUBITEM_START, ID_FILTERS_SUBITEM_END, OnPlayFilters) - ON_UPDATE_COMMAND_UI_RANGE(ID_FILTERS_SUBITEM_START, ID_FILTERS_SUBITEM_END, OnUpdatePlayFilters) - ON_COMMAND_RANGE(ID_SHADERS_START, ID_SHADERS_END, OnPlayShaders) - ON_UPDATE_COMMAND_UI_RANGE(ID_SHADERS_START, ID_SHADERS_END, OnUpdatePlayShaders) - ON_COMMAND_RANGE(ID_AUDIO_SUBITEM_START, ID_AUDIO_SUBITEM_END, OnPlayAudio) - ON_UPDATE_COMMAND_UI_RANGE(ID_AUDIO_SUBITEM_START, ID_AUDIO_SUBITEM_END, OnUpdatePlayAudio) - ON_COMMAND_RANGE(ID_SUBTITLES_SUBITEM_START, ID_SUBTITLES_SUBITEM_END, OnPlaySubtitles) - ON_UPDATE_COMMAND_UI_RANGE(ID_SUBTITLES_SUBITEM_START, ID_SUBTITLES_SUBITEM_END, OnUpdatePlaySubtitles) - ON_COMMAND_RANGE(ID_FILTERSTREAMS_SUBITEM_START, ID_FILTERSTREAMS_SUBITEM_END, OnPlayLanguage) - ON_UPDATE_COMMAND_UI_RANGE(ID_FILTERSTREAMS_SUBITEM_START, ID_FILTERSTREAMS_SUBITEM_END, OnUpdatePlayLanguage) - ON_COMMAND_RANGE(ID_VOLUME_UP, ID_VOLUME_MUTE, OnPlayVolume) - ON_COMMAND_RANGE(ID_VOLUME_BOOST_INC, ID_VOLUME_BOOST_MAX, OnPlayVolumeBoost) - ON_UPDATE_COMMAND_UI_RANGE(ID_VOLUME_BOOST_INC, ID_VOLUME_BOOST_MAX, OnUpdatePlayVolumeBoost) - ON_COMMAND_RANGE(ID_AFTERPLAYBACK_CLOSE, ID_AFTERPLAYBACK_DONOTHING, OnAfterplayback) - ON_UPDATE_COMMAND_UI_RANGE(ID_AFTERPLAYBACK_CLOSE, ID_AFTERPLAYBACK_DONOTHING, OnUpdateAfterplayback) - - ON_COMMAND_RANGE(ID_NAVIGATE_SKIPBACK, ID_NAVIGATE_SKIPFORWARD, OnNavigateSkip) - ON_UPDATE_COMMAND_UI_RANGE(ID_NAVIGATE_SKIPBACK, ID_NAVIGATE_SKIPFORWARD, OnUpdateNavigateSkip) - ON_COMMAND_RANGE(ID_NAVIGATE_SKIPBACKPLITEM, ID_NAVIGATE_SKIPFORWARDPLITEM, OnNavigateSkipPlaylistItem) - ON_UPDATE_COMMAND_UI_RANGE(ID_NAVIGATE_SKIPBACKPLITEM, ID_NAVIGATE_SKIPFORWARDPLITEM, OnUpdateNavigateSkipPlaylistItem) - ON_COMMAND_RANGE(ID_NAVIGATE_TITLEMENU, ID_NAVIGATE_CHAPTERMENU, OnNavigateMenu) - ON_UPDATE_COMMAND_UI_RANGE(ID_NAVIGATE_TITLEMENU, ID_NAVIGATE_CHAPTERMENU, OnUpdateNavigateMenu) - ON_COMMAND_RANGE(ID_NAVIGATE_AUDIO_SUBITEM_START, ID_NAVIGATE_AUDIO_SUBITEM_END, OnNavigateAudio) - ON_COMMAND_RANGE(ID_NAVIGATE_SUBP_SUBITEM_START, ID_NAVIGATE_SUBP_SUBITEM_END, OnNavigateSubpic) - ON_COMMAND_RANGE(ID_NAVIGATE_ANGLE_SUBITEM_START, ID_NAVIGATE_ANGLE_SUBITEM_END, OnNavigateAngle) - ON_COMMAND_RANGE(ID_NAVIGATE_CHAP_SUBITEM_START, ID_NAVIGATE_CHAP_SUBITEM_END, OnNavigateChapters) - ON_COMMAND_RANGE(ID_NAVIGATE_MENU_LEFT, ID_NAVIGATE_MENU_LEAVE, OnNavigateMenuItem) - ON_UPDATE_COMMAND_UI_RANGE(ID_NAVIGATE_MENU_LEFT, ID_NAVIGATE_MENU_LEAVE, OnUpdateNavigateMenuItem) - - ON_COMMAND(ID_FAVORITES_ADD, OnFavoritesAdd) - ON_UPDATE_COMMAND_UI(ID_FAVORITES_ADD, OnUpdateFavoritesAdd) - ON_COMMAND(ID_FAVORITES_ORGANIZE, OnFavoritesOrganize) - ON_UPDATE_COMMAND_UI(ID_FAVORITES_ORGANIZE, OnUpdateFavoritesOrganize) - ON_COMMAND_RANGE(ID_FAVORITES_FILE_START, ID_FAVORITES_FILE_END, OnFavoritesFile) - ON_UPDATE_COMMAND_UI_RANGE(ID_FAVORITES_FILE_START, ID_FAVORITES_FILE_END, OnUpdateFavoritesFile) - ON_COMMAND_RANGE(ID_FAVORITES_DVD_START, ID_FAVORITES_DVD_END, OnFavoritesDVD) - ON_UPDATE_COMMAND_UI_RANGE(ID_FAVORITES_DVD_START, ID_FAVORITES_DVD_END, OnUpdateFavoritesDVD) - ON_COMMAND_RANGE(ID_FAVORITES_DEVICE_START, ID_FAVORITES_DEVICE_END, OnFavoritesDevice) - ON_UPDATE_COMMAND_UI_RANGE(ID_FAVORITES_DEVICE_START, ID_FAVORITES_DEVICE_END, OnUpdateFavoritesDevice) - - ON_COMMAND(ID_HELP_HOMEPAGE, OnHelpHomepage) - ON_COMMAND(ID_HELP_DOCUMENTATION, OnHelpDocumentation) - - END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CMainFrame construction/destruction - -#pragma warning(disable : 4355) - -CMainFrame::CMainFrame() : - m_dwRegister(0), - m_iMediaLoadState(MLS_CLOSED), - m_iPlaybackMode(PM_NONE), - m_iSpeedLevel(0), - m_rtDurationOverride(-1), - m_fFullScreen(false), - m_fHideCursor(false), - m_lastMouseMove(-1, -1), - m_pLastBar(NULL), - m_nLoops(0), - m_iSubtitleSel(-1), - m_ZoomX(1), m_ZoomY(1), m_PosX(0.5), m_PosY(0.5), - m_AngleX(0), m_AngleY(0), m_AngleZ(0), - m_fCustomGraph(false), - m_fRealMediaGraph(false), m_fShockwaveGraph(false), m_fQuicktimeGraph(false), - m_fFrameSteppingActive(false), - m_fEndOfStream(false), - m_fCapturing(false), - m_fLiveWM(false), - m_fOpeningAborted(false), - m_fBuffering(false), - m_fileDropTarget(this), - m_fTrayIcon(false) -{ -} - -CMainFrame::~CMainFrame() -{ -// m_owner.DestroyWindow(); -} - -int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) -{ - if(__super::OnCreate(lpCreateStruct) == -1) - return -1; - - m_popup.LoadMenu(IDR_POPUP); - m_popupmain.LoadMenu(IDR_POPUPMAIN); - - GetMenu()->ModifyMenu(ID_FAVORITES, MF_BYCOMMAND|MF_STRING, IDR_MAINFRAME, ResStr(IDS_FAVORITES_POPUP)); - - // create a view to occupy the client area of the frame - if(!m_wndView.Create(NULL, NULL, AFX_WS_DEFAULT_VIEW, - CRect(0, 0, 0, 0), this, AFX_IDW_PANE_FIRST, NULL)) - { - TRACE0("Failed to create view window\n"); - return -1; - } - - // static bars - - if(!m_wndStatusBar.Create(this) - || !m_wndStatsBar.Create(this) - || !m_wndInfoBar.Create(this) - || !m_wndToolBar.Create(this) - || !m_wndSeekBar.Create(this)) - { - TRACE0("Failed to create all control bars\n"); - return -1; // fail to create - } - - m_bars.AddTail(&m_wndSeekBar); - m_bars.AddTail(&m_wndToolBar); - m_bars.AddTail(&m_wndInfoBar); - m_bars.AddTail(&m_wndStatsBar); - m_bars.AddTail(&m_wndStatusBar); - - m_wndSeekBar.Enable(false); - - // dockable bars - - EnableDocking(CBRS_ALIGN_ANY); - - m_dockingbars.RemoveAll(); - - m_wndSubresyncBar.Create(this, &m_csSubLock); - m_wndSubresyncBar.SetBarStyle(m_wndSubresyncBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC); - m_wndSubresyncBar.EnableDocking(CBRS_ALIGN_ANY); - m_wndSubresyncBar.SetHeight(200); - LoadControlBar(&m_wndSubresyncBar, AFX_IDW_DOCKBAR_TOP); - - m_wndPlaylistBar.Create(this); - m_wndPlaylistBar.SetBarStyle(m_wndPlaylistBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC); - m_wndPlaylistBar.EnableDocking(CBRS_ALIGN_ANY); - m_wndPlaylistBar.SetHeight(100); - LoadControlBar(&m_wndPlaylistBar, AFX_IDW_DOCKBAR_BOTTOM); - m_wndPlaylistBar.LoadPlaylist(); - - m_wndCaptureBar.Create(this); - m_wndCaptureBar.SetBarStyle(m_wndCaptureBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC); - m_wndCaptureBar.EnableDocking(CBRS_ALIGN_LEFT|CBRS_ALIGN_RIGHT); - LoadControlBar(&m_wndCaptureBar, AFX_IDW_DOCKBAR_LEFT); - - m_wndShaderEditorBar.Create(this); - m_wndShaderEditorBar.SetBarStyle(m_wndShaderEditorBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC); - m_wndShaderEditorBar.EnableDocking(CBRS_ALIGN_ANY); - LoadControlBar(&m_wndShaderEditorBar, AFX_IDW_DOCKBAR_TOP); - - m_fileDropTarget.Register(this); - - GetDesktopWindow()->GetWindowRect(&m_rcDesktop); - - AppSettings& s = AfxGetAppSettings(); - - ShowControls(s.nCS); - - SetAlwaysOnTop(s.iOnTop); - - ShowTrayIcon(s.fTrayIcon); - - SetFocus(); - - m_pGraphThread = (CGraphThread*)AfxBeginThread(RUNTIME_CLASS(CGraphThread)); - - if(m_pGraphThread) - m_pGraphThread->SetMainFrame(this); - - if(s.fEnableWebServer) - StartWebServer(s.nWebServerPort); - - // load shaders - CString strList = AfxGetAppSettings().strShaderList; - CString strRes; - int curPos= 0; - - strRes = strList.Tokenize (_T("|"), curPos); - while (strRes != _T("")) - { - m_shaderlabels.AddTail (strRes); - strRes = strList.Tokenize(_T("|"),curPos); - }; - // end - - - return 0; -} - -void CMainFrame::OnDestroy() -{ - ShowTrayIcon(false); - - m_fileDropTarget.Revoke(); - - if(m_pGraphThread) - { - CAMEvent e; - m_pGraphThread->PostThreadMessage(CGraphThread::TM_EXIT, 0, (LPARAM)&e); - if(!e.Wait(5000)) - { - TRACE(_T("ERROR: Must call TerminateThread() on CMainFrame::m_pGraphThread->m_hThread\n")); - TerminateThread(m_pGraphThread->m_hThread, -1); - } - } - - __super::OnDestroy(); -} - -void CMainFrame::OnClose() -{ - // save shader list - POSITION pos; - CString strList = ""; - - pos = m_shaderlabels.GetHeadPosition(); - while(pos) - { - strList += m_shaderlabels.GetAt (pos) + "|"; - m_dockingbars.GetNext(pos); - } - AfxGetAppSettings().strShaderList = strList; - // end - - m_wndPlaylistBar.SavePlaylist(); - - SaveControlBars(); - - ShowWindow(SW_HIDE); - - CloseMedia(); - - __super::OnClose(); -} - -DROPEFFECT CMainFrame::OnDragEnter(COleDataObject* pDataObject, DWORD dwKeyState, CPoint point) -{ - return DROPEFFECT_NONE; -} -DROPEFFECT CMainFrame::OnDragOver(COleDataObject* pDataObject, DWORD dwKeyState, CPoint point) -{ - UINT CF_URL = RegisterClipboardFormat(_T("UniformResourceLocator")); - return pDataObject->IsDataAvailable(CF_URL) ? DROPEFFECT_COPY : DROPEFFECT_NONE; -} -BOOL CMainFrame::OnDrop(COleDataObject* pDataObject, DROPEFFECT dropEffect, CPoint point) -{ - UINT CF_URL = RegisterClipboardFormat(_T("UniformResourceLocator")); - - BOOL bResult = FALSE; - - if(pDataObject->IsDataAvailable(CF_URL)) - { - FORMATETC fmt = {CF_URL, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL}; - if(HGLOBAL hGlobal = pDataObject->GetGlobalData(CF_URL, &fmt)) - { - LPCSTR pText = (LPCSTR)GlobalLock(hGlobal); - if(AfxIsValidString(pText)) - { - CStringA url(pText); - - SetForegroundWindow(); - - CAtlList sl; - sl.AddTail(CString(url)); - - if(m_wndPlaylistBar.IsWindowVisible()) - { - m_wndPlaylistBar.Append(sl, true); - } - else - { - m_wndPlaylistBar.Open(sl, true); - OpenCurPlaylistItem(); - } - - GlobalUnlock(hGlobal); - bResult = TRUE; - } - } - } - - return bResult; -} -DROPEFFECT CMainFrame::OnDropEx(COleDataObject* pDataObject, DROPEFFECT dropDefault, DROPEFFECT dropList, CPoint point) -{ - return (DROPEFFECT)-1; -} -void CMainFrame::OnDragLeave() -{ -} -DROPEFFECT CMainFrame::OnDragScroll(DWORD dwKeyState, CPoint point) -{ - return DROPEFFECT_NONE; -} - -void CMainFrame::LoadControlBar(CControlBar* pBar, UINT defDockBarID) -{ - if(!pBar) return; - - CString str; - pBar->GetWindowText(str); - if(str.IsEmpty()) return; - CString section = _T("ToolBars\\") + str; - - CWinApp* pApp = AfxGetApp(); - - UINT nID = pApp->GetProfileInt(section, _T("DockState"), defDockBarID); - - if(nID != AFX_IDW_DOCKBAR_FLOAT) - { - DockControlBar(pBar, nID); - } - - pBar->ShowWindow( - pApp->GetProfileInt(section, _T("Visible"), FALSE) - && pBar != &m_wndSubresyncBar - && pBar != &m_wndCaptureBar - && pBar != &m_wndShaderEditorBar - ? SW_SHOW - : SW_HIDE); - - if(CSizingControlBar* pSCB = dynamic_cast(pBar)) - { - pSCB->LoadState(section + _T("\\State")); - m_dockingbars.AddTail(pSCB); - } -} - -void CMainFrame::RestoreFloatingControlBars() -{ - CWinApp* pApp = AfxGetApp(); - - CRect r; - GetWindowRect(r); - - POSITION pos = m_dockingbars.GetHeadPosition(); - while(pos) - { - CSizingControlBar* pBar = m_dockingbars.GetNext(pos); - - CString str; - pBar->GetWindowText(str); - if(str.IsEmpty()) return; - CString section = _T("ToolBars\\") + str; - - if(pApp->GetProfileInt(section, _T("DockState"), AFX_IDW_DOCKBAR_FLOAT) == AFX_IDW_DOCKBAR_FLOAT) - { - CPoint p; - p.x = pApp->GetProfileInt(section, _T("DockPosX"), 100); - p.y = pApp->GetProfileInt(section, _T("DockPosY"), 100); - if(p.x < m_rcDesktop.left) p.x = m_rcDesktop.left; - if(p.y < m_rcDesktop.top) p.y = m_rcDesktop.top; - if(p.x >= m_rcDesktop.right) p.x = m_rcDesktop.right-1; - if(p.y >= m_rcDesktop.bottom) p.y = m_rcDesktop.bottom-1; - FloatControlBar(pBar, p); - } - } -} - -void CMainFrame::SaveControlBars() -{ - CWinApp* pApp = AfxGetApp(); - - POSITION pos = m_dockingbars.GetHeadPosition(); - while(pos) - { - CSizingControlBar* pBar = m_dockingbars.GetNext(pos); - - CString str; - pBar->GetWindowText(str); - if(str.IsEmpty()) return; - CString section = _T("ToolBars\\") + str; - - pApp->WriteProfileInt(section, _T("Visible"), pBar->IsWindowVisible()); - - if(CSizingControlBar* pSCB = dynamic_cast(pBar)) - { - pSCB->SaveState(section + _T("\\State")); - } - - UINT nID = pBar->GetParent()->GetDlgCtrlID(); - - if(nID == AFX_IDW_DOCKBAR_FLOAT) - { - CRect r; - pBar->GetParent()->GetParent()->GetWindowRect(r); - pApp->WriteProfileInt(section, _T("DockPosX"), r.left); - pApp->WriteProfileInt(section, _T("DockPosY"), r.top); - } - - pApp->WriteProfileInt(section, _T("DockState"), nID); - } -} - -LRESULT CMainFrame::OnTaskBarRestart(WPARAM, LPARAM) -{ - m_fTrayIcon = false; - ShowTrayIcon(AfxGetAppSettings().fTrayIcon); - - return 0; -} - -LRESULT CMainFrame::OnNotifyIcon(WPARAM wParam, LPARAM lParam) -{ - if((UINT)wParam != IDR_MAINFRAME) - return -1; - - switch((UINT)lParam) - { - case WM_LBUTTONDOWN: - ShowWindow(SW_SHOW); - MoveVideoWindow(); - SetForegroundWindow(); - break; - - case WM_LBUTTONDBLCLK: - PostMessage(WM_COMMAND, ID_FILE_OPENMEDIA); - break; - - case WM_RBUTTONDOWN: - { - POINT p; - GetCursorPos(&p); - SetForegroundWindow(); - m_popupmain.GetSubMenu(0)->TrackPopupMenu(TPM_RIGHTBUTTON|TPM_NOANIMATION, p.x, p.y, this); - PostMessage(WM_NULL); - break; - } - - case WM_MOUSEMOVE: - { - CString str; - GetWindowText(str); - SetTrayTip(str); - break; - } - - default: - break; - } - - return 0; -} - -void CMainFrame::ShowTrayIcon(bool fShow) -{ - BOOL bWasVisible = ShowWindow(SW_HIDE); - NOTIFYICONDATA tnid; - - ZeroMemory(&tnid, sizeof(NOTIFYICONDATA)); - tnid.cbSize = sizeof(NOTIFYICONDATA); - tnid.hWnd = m_hWnd; - tnid.uID = IDR_MAINFRAME; - - if(fShow) - { - if(!m_fTrayIcon) - { - tnid.hIcon = (HICON)LoadImage(AfxGetResourceHandle(), MAKEINTRESOURCE(IDR_MAINFRAME), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR); - tnid.uFlags = NIF_MESSAGE|NIF_ICON|NIF_TIP; - tnid.uCallbackMessage = WM_NOTIFYICON; - lstrcpyn(tnid.szTip, TEXT("Media Player Classic"), sizeof(tnid.szTip)); - Shell_NotifyIcon(NIM_ADD, &tnid); - - m_fTrayIcon = true; - } - } - else - { - if(m_fTrayIcon) - { - Shell_NotifyIcon(NIM_DELETE, &tnid); - - m_fTrayIcon = false; - } - } - - if(bWasVisible) - ShowWindow(SW_SHOW); -} - -void CMainFrame::SetTrayTip(CString str) -{ - NOTIFYICONDATA tnid; - tnid.cbSize = sizeof(NOTIFYICONDATA); - tnid.hWnd = m_hWnd; - tnid.uID = IDR_MAINFRAME; - tnid.uFlags = NIF_TIP; - lstrcpyn(tnid.szTip, str, sizeof(tnid.szTip)); - Shell_NotifyIcon(NIM_MODIFY, &tnid); -} - -BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs) -{ - if(!__super::PreCreateWindow(cs)) - return FALSE; - - cs.dwExStyle &= ~WS_EX_CLIENTEDGE; - cs.lpszClass = MPC_WND_CLASS_NAME; //AfxRegisterWndClass(0); - - return TRUE; -} - -BOOL CMainFrame::PreTranslateMessage(MSG* pMsg) -{ - if(pMsg->message == WM_KEYDOWN) - { -/* if(m_fShockwaveGraph - && (pMsg->wParam == VK_LEFT || pMsg->wParam == VK_RIGHT - || pMsg->wParam == VK_UP || pMsg->wParam == VK_DOWN)) - return FALSE; -*/ - if(pMsg->wParam == VK_ESCAPE && m_iMediaLoadState == MLS_LOADED && m_fFullScreen) - { - OnViewFullscreen(); - PostMessage(WM_COMMAND, ID_PLAY_PAUSE); - return TRUE; - } - else if(pMsg->wParam == VK_ESCAPE && (IsCaptionMenuHidden())) - { - PostMessage(WM_COMMAND, ID_VIEW_CAPTIONMENU); - return TRUE; - } - else if(pMsg->wParam == VK_LEFT && pAMTuner) - { - PostMessage(WM_COMMAND, ID_NAVIGATE_SKIPBACK); - return TRUE; - } - else if(pMsg->wParam == VK_RIGHT && pAMTuner) - { - PostMessage(WM_COMMAND, ID_NAVIGATE_SKIPFORWARD); - return TRUE; - } - } - - return __super::PreTranslateMessage(pMsg); -} - -void CMainFrame::RecalcLayout(BOOL bNotify) -{ - __super::RecalcLayout(bNotify); - - CRect r; - GetWindowRect(&r); - MINMAXINFO mmi; - memset(&mmi, 0, sizeof(mmi)); - SendMessage(WM_GETMINMAXINFO, 0, (LPARAM)&mmi); - r |= CRect(r.TopLeft(), CSize(r.Width(), mmi.ptMinTrackSize.y)); - MoveWindow(&r); -} - -///////////////////////////////////////////////////////////////////////////// -// CMainFrame diagnostics - -#ifdef _DEBUG -void CMainFrame::AssertValid() const -{ - __super::AssertValid(); -} - -void CMainFrame::Dump(CDumpContext& dc) const -{ - __super::Dump(dc); -} - -#endif //_DEBUG - -///////////////////////////////////////////////////////////////////////////// -// CMainFrame message handlers -void CMainFrame::OnSetFocus(CWnd* pOldWnd) -{ - SetAlwaysOnTop(AfxGetAppSettings().iOnTop); - - // forward focus to the view window - if(IsWindow(m_wndView.m_hWnd)) - m_wndView.SetFocus(); -} - -BOOL CMainFrame::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo) -{ - // let the view have first crack at the command - if(m_wndView.OnCmdMsg(nID, nCode, pExtra, pHandlerInfo)) - return TRUE; - - POSITION pos = m_bars.GetHeadPosition(); - while(pos) - { - if(m_bars.GetNext(pos)->OnCmdMsg(nID, nCode, pExtra, pHandlerInfo)) - return TRUE; - } - - pos = m_dockingbars.GetHeadPosition(); - while(pos) - { - if(m_dockingbars.GetNext(pos)->OnCmdMsg(nID, nCode, pExtra, pHandlerInfo)) - return TRUE; - } - - // otherwise, do default handling - return __super::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo); -} - -void CMainFrame::OnGetMinMaxInfo(MINMAXINFO* lpMMI) -{ - DWORD style = GetStyle(); - - MENUBARINFO mbi; - memset(&mbi, 0, sizeof(mbi)); - mbi.cbSize = sizeof(mbi); - ::GetMenuBarInfo(m_hWnd, OBJID_MENU, 0, &mbi); - - lpMMI->ptMinTrackSize.x = 0; - if(!IsCaptionMenuHidden()) - { - lpMMI->ptMinTrackSize.x = 10; - CRect r; - for(int i = 0; ::GetMenuItemRect(m_hWnd, mbi.hMenu, i, &r); i++) - lpMMI->ptMinTrackSize.x += r.Width(); - lpMMI->ptMinTrackSize.x = max(DEFCLIENTW, lpMMI->ptMinTrackSize.x); - } - if(style&WS_THICKFRAME) lpMMI->ptMinTrackSize.x += GetSystemMetrics((style&WS_CAPTION)?SM_CXSIZEFRAME:SM_CXFIXEDFRAME)*2; - - memset(&mbi, 0, sizeof(mbi)); - mbi.cbSize = sizeof(mbi); - ::GetMenuBarInfo(m_hWnd, OBJID_MENU, 0, &mbi); - - lpMMI->ptMinTrackSize.y = 0; - if(style&WS_CAPTION) lpMMI->ptMinTrackSize.y += GetSystemMetrics(SM_CYCAPTION); - if(style&WS_THICKFRAME) lpMMI->ptMinTrackSize.y += GetSystemMetrics((style&WS_CAPTION)?SM_CYSIZEFRAME:SM_CYFIXEDFRAME)*2; - lpMMI->ptMinTrackSize.y += (mbi.rcBar.bottom - mbi.rcBar.top); - if(!AfxGetAppSettings().fHideCaptionMenu) lpMMI->ptMinTrackSize.y += 3; - - POSITION pos = m_bars.GetHeadPosition(); - while(pos) - { - CControlBar* pCB = m_bars.GetNext(pos); - if(!IsWindow(pCB->m_hWnd) || !pCB->IsVisible()) continue; - - lpMMI->ptMinTrackSize.y += pCB->CalcFixedLayout(TRUE, TRUE).cy; - } - - pos = m_dockingbars.GetHeadPosition(); - while(pos) - { - CSizingControlBar* pCB = m_dockingbars.GetNext(pos); - if(IsWindow(pCB->m_hWnd) && pCB->IsWindowVisible() && !pCB->IsFloating()) - lpMMI->ptMinTrackSize.y += pCB->CalcFixedLayout(TRUE, TRUE).cy-2; - } - - __super::OnGetMinMaxInfo(lpMMI); -} - -void CMainFrame::OnMove(int x, int y) -{ - __super::OnMove(x, y); - - MoveVideoWindow(); - - WINDOWPLACEMENT wp; - GetWindowPlacement(&wp); - if(!m_fFullScreen && wp.flags != WPF_RESTORETOMAXIMIZED && wp.showCmd != SW_SHOWMINIMIZED) - GetWindowRect(AfxGetAppSettings().rcLastWindowPos); -} - -void CMainFrame::OnMoving(UINT fwSide, LPRECT pRect) -{ - __super::OnMoving(fwSide, pRect); - - if(AfxGetAppSettings().fSnapToDesktopEdges) - { - const CPoint threshold(3, 3); - - CRect r0 = m_rcDesktop; - CRect r1 = r0 + threshold; - CRect r2 = r0 - threshold; - - RECT& wr = *pRect; - CSize ws = CRect(wr).Size(); - - if(wr.left < r1.left && wr.left > r2.left) - wr.right = (wr.left = r0.left) + ws.cx; - - if(wr.top < r1.top && wr.top > r2.top) - wr.bottom = (wr.top = r0.top) + ws.cy; - - if(wr.right < r1.right && wr.right > r2.right) - wr.left = (wr.right = r0.right) - ws.cx; - - if(wr.bottom < r1.bottom && wr.bottom > r2.bottom) - wr.top = (wr.bottom = r0.bottom) - ws.cy; - } -} - -void CMainFrame::OnSize(UINT nType, int cx, int cy) -{ - __super::OnSize(nType, cx, cy); - - if(nType == SIZE_RESTORED && m_fTrayIcon) - { - ShowWindow(SW_SHOW); - } - - if(!m_fFullScreen) - { - AppSettings& s = AfxGetAppSettings(); - if(nType != SIZE_MAXIMIZED && nType != SIZE_MINIMIZED) - GetWindowRect(s.rcLastWindowPos); - s.lastWindowType = nType; - } -} - -void CMainFrame::OnSizing(UINT fwSide, LPRECT pRect) -{ - __super::OnSizing(fwSide, pRect); - - AppSettings& s = AfxGetAppSettings(); - - bool fCtrl = !!(GetAsyncKeyState(VK_CONTROL)&0x80000000); - - if(m_iMediaLoadState != MLS_LOADED || m_fFullScreen - || s.iDefaultVideoSize == DVS_STRETCH - || (fCtrl ^ s.fFreeWindowResizing)) - return; - - CSize wsize(pRect->right - pRect->left, pRect->bottom - pRect->top); - CSize vsize = GetVideoSize(); - CSize fsize(0, 0); - - if(!vsize.cx || !vsize.cy) - return; - - // TODO - { - DWORD style = GetStyle(); - - MENUBARINFO mbi; - memset(&mbi, 0, sizeof(mbi)); - mbi.cbSize = sizeof(mbi); - ::GetMenuBarInfo(m_hWnd, OBJID_MENU, 0, &mbi); - - fsize.cx += GetSystemMetrics((style&WS_CAPTION)?SM_CXSIZEFRAME:SM_CXFIXEDFRAME)*2; - - if(style&WS_CAPTION) fsize.cy += GetSystemMetrics(SM_CYCAPTION); - if(style&WS_THICKFRAME) fsize.cy += GetSystemMetrics((style&WS_CAPTION)?SM_CYSIZEFRAME:SM_CYFIXEDFRAME)*2; - fsize.cy += mbi.rcBar.bottom - mbi.rcBar.top; - if(!AfxGetAppSettings().fHideCaptionMenu) fsize.cy += 3; - - POSITION pos = m_bars.GetHeadPosition(); - while(pos) - { - CControlBar* pCB = m_bars.GetNext(pos); - if(IsWindow(pCB->m_hWnd) && pCB->IsVisible()) - fsize.cy += pCB->CalcFixedLayout(TRUE, TRUE).cy; - } - - pos = m_dockingbars.GetHeadPosition(); - while(pos) - { - CSizingControlBar* pCB = m_dockingbars.GetNext(pos); - - if(IsWindow(pCB->m_hWnd) && pCB->IsWindowVisible()) - { - if(pCB->IsHorzDocked()) fsize.cy += pCB->CalcFixedLayout(TRUE, TRUE).cy-2; - else if(pCB->IsVertDocked()) fsize.cx += pCB->CalcFixedLayout(TRUE, FALSE).cx; - } - } - } - - wsize -= fsize; - - bool fWider = wsize.cy < wsize.cx; - - wsize.SetSize( - wsize.cy * vsize.cx / vsize.cy, - wsize.cx * vsize.cy / vsize.cx); - - wsize += fsize; - - if(fwSide == WMSZ_TOP || fwSide == WMSZ_BOTTOM || !fWider && (fwSide == WMSZ_TOPRIGHT || fwSide == WMSZ_BOTTOMRIGHT)) - { - pRect->right = pRect->left + wsize.cx; - } - else if(fwSide == WMSZ_LEFT || fwSide == WMSZ_RIGHT || fWider && (fwSide == WMSZ_BOTTOMLEFT || fwSide == WMSZ_BOTTOMRIGHT)) - { - pRect->bottom = pRect->top + wsize.cy; - } - else if(!fWider && (fwSide == WMSZ_TOPLEFT || fwSide == WMSZ_BOTTOMLEFT)) - { - pRect->left = pRect->right - wsize.cx; - } - else if(fWider && (fwSide == WMSZ_TOPLEFT || fwSide == WMSZ_TOPRIGHT)) - { - pRect->top = pRect->bottom - wsize.cy; - } -} - -void CMainFrame::OnDisplayChange() // untested, not sure if it's working... -{ - TRACE(_T("*** CMainFrame::OnDisplayChange()\n")); -/* - if(m_iMediaLoadState == MLS_LOADED && m_pCAP) - m_pCAP->OnDisplayChange(); -*/ - - GetDesktopWindow()->GetWindowRect(&m_rcDesktop); -} - -#include - -void CMainFrame::OnSysCommand(UINT nID, LPARAM lParam) -{ - if( (GetMediaState() == State_Running) && (((nID & 0xFFF0) == SC_SCREENSAVE) || ((nID & 0xFFF0) == SC_MONITORPOWER)) ) - { - TRACE(_T("SC_SCREENSAVE, nID = %d, lParam = %d\n"), nID, lParam); - return; - } - else if((nID & 0xFFF0) == SC_MINIMIZE && m_fTrayIcon) - { - ShowWindow(SW_HIDE); - return; - } - - __super::OnSysCommand(nID, lParam); -} - -void CMainFrame::OnActivateApp(BOOL bActive, DWORD dwThreadID) -{ - __super::OnActivateApp(bActive, dwThreadID); - - MONITORINFO mi; - mi.cbSize = sizeof(MONITORINFO); - GetMonitorInfo(MonitorFromWindow(m_hWnd, MONITOR_DEFAULTTONEAREST), &mi); - - if(!bActive && (mi.dwFlags&MONITORINFOF_PRIMARY) && m_fFullScreen && m_iMediaLoadState == MLS_LOADED) - { - bool fExitFullscreen = true; - - if(CWnd* pWnd = GetForegroundWindow()) - { - HMONITOR hMonitor1 = MonitorFromWindow(m_hWnd, MONITOR_DEFAULTTONEAREST); - HMONITOR hMonitor2 = MonitorFromWindow(pWnd->m_hWnd, MONITOR_DEFAULTTONEAREST); - if(hMonitor1 && hMonitor2 && hMonitor1 != hMonitor2) fExitFullscreen = false; - - CString title; - pWnd->GetWindowText(title); - - CString module; - - if(GetVersion()&0x80000000) - { - module.ReleaseBufferSetLength(GetWindowModuleFileName(pWnd->m_hWnd, module.GetBuffer(MAX_PATH), MAX_PATH)); - } - else - { - DWORD pid; - GetWindowThreadProcessId(pWnd->m_hWnd, &pid); - - if(HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, pid)) - { - HMODULE hMod; - DWORD cbNeeded; - - if(EnumProcessModules(hProcess, &hMod, sizeof(hMod), &cbNeeded)) - { - module.ReleaseBufferSetLength(GetModuleFileNameEx(hProcess, hMod, module.GetBuffer(MAX_PATH), MAX_PATH)); - } - - CloseHandle(hProcess); - } - } - - CPath p(module); - p.StripPath(); - module = (LPCTSTR)p; - module.MakeLower(); - - CString str; - str.Format(_T("Focus lost to: %s - %s"), module, title); - SendStatusMessage(str, 5000); - } - - if(fExitFullscreen) OnViewFullscreen(); - } -} - -LRESULT CMainFrame::OnAppCommand(WPARAM wParam, LPARAM lParam) -{ - UINT cmd = GET_APPCOMMAND_LPARAM(lParam); - UINT uDevice = GET_DEVICE_LPARAM(lParam); - UINT dwKeys = GET_KEYSTATE_LPARAM(lParam); - - if(uDevice != FAPPCOMMAND_OEM) - { - AppSettings& s = AfxGetAppSettings(); - - BOOL fRet = FALSE; - - POSITION pos = s.wmcmds.GetHeadPosition(); - while(pos) - { - wmcmd& wc = s.wmcmds.GetNext(pos); - if(wc.appcmd == cmd && TRUE == SendMessage(WM_COMMAND, wc.cmd)) - fRet = TRUE; - } - - if(fRet) return TRUE; - } - - return Default(); -} - -void CMainFrame::OnTimer(UINT nIDEvent) -{ - if(nIDEvent == TIMER_STREAMPOSPOLLER && m_iMediaLoadState == MLS_LOADED) - { - REFERENCE_TIME rtNow = 0, rtDur = 0; - - if(m_iPlaybackMode == PM_FILE) - { - pMS->GetCurrentPosition(&rtNow); - pMS->GetDuration(&rtDur); - - if(m_rtDurationOverride >= 0) rtDur = m_rtDurationOverride; - - m_wndSeekBar.Enable(rtDur > 0); - m_wndSeekBar.SetRange(0, rtDur); - m_wndSeekBar.SetPos(rtNow); - } - else if(m_iPlaybackMode == PM_CAPTURE) - { - if(m_fCapturing && m_wndCaptureBar.m_capdlg.m_pMux) - { - CComQIPtr pMuxMS = m_wndCaptureBar.m_capdlg.m_pMux; - if(!pMuxMS || FAILED(pMuxMS->GetCurrentPosition(&rtNow))) rtNow = 0; - } - - if(m_rtDurationOverride >= 0) rtDur = m_rtDurationOverride; - - m_wndSeekBar.Enable(false); - m_wndSeekBar.SetRange(0, rtDur); - m_wndSeekBar.SetPos(rtNow); -/* - if(m_fCapturing) - { - if(rtNow > 10000i64*1000*60*60*3) - { - m_wndCaptureBar.m_capdlg.OnRecord(); - } - } -*/ - } - - if(m_pCAP && m_iPlaybackMode != PM_FILE) m_pCAP->SetTime(/*rtNow*/m_wndSeekBar.GetPos()); - } - else if(nIDEvent == TIMER_STREAMPOSPOLLER2 && m_iMediaLoadState == MLS_LOADED) - { - __int64 start, stop, pos; - m_wndSeekBar.GetRange(start, stop); - pos = m_wndSeekBar.GetPosReal(); - - GUID tf; - pMS->GetTimeFormat(&tf); - - if(m_iPlaybackMode == PM_CAPTURE && !m_fCapturing) - { - CString str = _T("Live"); - - long lChannel = 0, lVivSub = 0, lAudSub = 0; - if(pAMTuner - && m_wndCaptureBar.m_capdlg.IsTunerActive() - && SUCCEEDED(pAMTuner->get_Channel(&lChannel, &lVivSub, &lAudSub))) - { - CString ch; - ch.Format(_T(" (ch%d)"), lChannel); - str += ch; - } - - m_wndStatusBar.SetStatusTimer(str); - } - else - { - m_wndStatusBar.SetStatusTimer(pos, stop, !!m_wndSubresyncBar.IsWindowVisible(), &tf); - } - - m_wndSubresyncBar.SetTime(pos); - - if(m_pCAP && GetMediaState() == State_Paused) m_pCAP->Paint(true); - } - else if(nIDEvent == TIMER_FULLSCREENCONTROLBARHIDER) - { - CPoint p; - GetCursorPos(&p); - - CRect r; - GetWindowRect(r); - bool fCursorOutside = !r.PtInRect(p); - - CWnd* pWnd = WindowFromPoint(p); - if(pWnd && (m_wndView == *pWnd || m_wndView.IsChild(pWnd) || fCursorOutside)) - { - if(AfxGetAppSettings().nShowBarsWhenFullScreenTimeOut >= 0) - ShowControls(CS_NONE, false); - } - } - else if(nIDEvent == TIMER_FULLSCREENMOUSEHIDER) - { - CPoint p; - GetCursorPos(&p); - - CRect r; - GetWindowRect(r); - bool fCursorOutside = !r.PtInRect(p); - - CWnd* pWnd = WindowFromPoint(p); - if(pWnd && (m_wndView == *pWnd || m_wndView.IsChild(pWnd) || fCursorOutside)) - { - m_fHideCursor = true; - SetCursor(NULL); - } - } - else if(nIDEvent == TIMER_STATS) - { - if(pQP) - { - CString rate; - if(m_iSpeedLevel >= -11 && m_iSpeedLevel <= 3 && m_iSpeedLevel != -4) - { - CString speeds[] = {_T("1/8"),_T("1/4"),_T("1/2"),_T("1"),_T("2"),_T("4"),_T("8")}; - rate = speeds[(m_iSpeedLevel >= -3 ? m_iSpeedLevel : (-m_iSpeedLevel - 8)) + 3]; - if(m_iSpeedLevel < -4) rate = _T("-") + rate; - if(!rate.IsEmpty()) rate = _T("(") + rate + _T("X)"); - } - - CString info; - int val; - - pQP->get_AvgFrameRate(&val); - info.Format(_T("%d.%02d %s"), val/100, val%100, rate); - m_wndStatsBar.SetLine(_T("Frame-rate"), info); - - int avg, dev; - pQP->get_AvgSyncOffset(&avg); - pQP->get_DevSyncOffset(&dev); - info.Format(_T("avg: %d ms, dev: %d ms"), avg, dev); - m_wndStatsBar.SetLine(_T("Sync Offset"), info); - - int drawn, dropped; - pQP->get_FramesDrawn(&drawn); - pQP->get_FramesDroppedInRenderer(&dropped); - info.Format(_T("drawn: %d, dropped: %d"), drawn, dropped); - m_wndStatsBar.SetLine(_T("Frames"), info); - - pQP->get_Jitter(&val); - info.Format(_T("%d ms"), val); - m_wndStatsBar.SetLine(_T("Jitter"), info); - } - - if(pBI) - { - CAtlList sl; - - for(int i = 0, j = pBI->GetCount(); i < j; i++) - { - int samples, size; - if(S_OK == pBI->GetStatus(i, samples, size)) - { - CString str; - str.Format(_T("[%d]: %03d/%d KB"), i, samples, size / 1024); - sl.AddTail(str); - } - } - - if(!sl.IsEmpty()) - { - CString str; - str.Format(_T("%s (p%d)"), Implode(sl, ' '), pBI->GetPriority()); - - m_wndStatsBar.SetLine(_T("Buffers"), str); - } - } - - CInterfaceList pBRIs; - - BeginEnumFilters(pGB, pEF, pBF) - { - BeginEnumPins(pBF, pEP, pPin) - { - if(CComQIPtr pBRI = pPin) - { - pBRIs.AddTail(pBRI); - } - } - EndEnumPins - - if(!pBRIs.IsEmpty()) - { - CAtlList sl; - - POSITION pos = pBRIs.GetHeadPosition(); - for(int i = 0; pos; i++) - { - IBitRateInfo* pBRI = pBRIs.GetNext(pos); - - DWORD cur = pBRI->GetCurrentBitRate() / 1000; - DWORD avg = pBRI->GetAverageBitRate() / 1000; - - if(avg == 0) continue; - - CString str; - if(cur != avg) str.Format(_T("[%d]: %d/%d Kb/s"), i, avg, cur); - else str.Format(_T("[%d]: %d Kb/s"), i, avg); - sl.AddTail(str); - } - - if(!sl.IsEmpty()) - { - m_wndStatsBar.SetLine(_T("Bitrate"), Implode(sl, ' ') + _T(" (avg/cur)")); - } - - break; - } - } - EndEnumFilters - - if(m_iPlaybackMode == PM_FILE) - { - SetupChapters(); - } - - if(m_iPlaybackMode == PM_DVD) // we also use this timer to update the info panel for dvd playback - { - ULONG ulAvailable, ulCurrent; - - // Location - - CString Location('-'); - - DVD_PLAYBACK_LOCATION2 loc; - ULONG ulNumOfVolumes, ulVolume; - DVD_DISC_SIDE Side; - ULONG ulNumOfTitles; - ULONG ulNumOfChapters; - - if(SUCCEEDED(pDVDI->GetCurrentLocation(&loc)) - && SUCCEEDED(pDVDI->GetNumberOfChapters(loc.TitleNum, &ulNumOfChapters)) - && SUCCEEDED(pDVDI->GetDVDVolumeInfo(&ulNumOfVolumes, &ulVolume, &Side, &ulNumOfTitles))) - { - Location.Format(_T("Volume: %02d/%02d, Title: %02d/%02d, Chapter: %02d/%02d"), - ulVolume, ulNumOfVolumes, - loc.TitleNum, ulNumOfTitles, - loc.ChapterNum, ulNumOfChapters); - } - - m_wndInfoBar.SetLine(ResStr(IDS_INFOBAR_LOCATION), Location); - - // Video - - CString Video('-'); - - DVD_VideoAttributes VATR; - - if(SUCCEEDED(pDVDI->GetCurrentAngle(&ulAvailable, &ulCurrent)) - && SUCCEEDED(pDVDI->GetCurrentVideoAttributes(&VATR))) - { - Video.Format(_T("Angle: %02d/%02d, %dx%d %dHz %d:%d"), - ulAvailable, ulCurrent, - VATR.ulSourceResolutionX, VATR.ulSourceResolutionY, VATR.ulFrameRate, - VATR.ulAspectX, VATR.ulAspectY); - } - - m_wndInfoBar.SetLine(ResStr(IDS_INFOBAR_VIDEO), Video); - - // Audio - - CString Audio('-'); - - DVD_AudioAttributes AATR; - - if(SUCCEEDED(pDVDI->GetCurrentAudio(&ulAvailable, &ulCurrent)) - && SUCCEEDED(pDVDI->GetAudioAttributes(ulCurrent, &AATR))) - { - CString lang; - int len = GetLocaleInfo(AATR.Language, LOCALE_SENGLANGUAGE, lang.GetBuffer(64), 64); - lang.ReleaseBufferSetLength(max(len-1, 0)); - - switch(AATR.LanguageExtension) - { - case DVD_AUD_EXT_NotSpecified: - default: break; - case DVD_AUD_EXT_Captions: lang += _T(" (Captions)"); break; - case DVD_AUD_EXT_VisuallyImpaired: lang += _T(" (Visually Impaired)"); break; - case DVD_AUD_EXT_DirectorComments1: lang += _T(" (Director Comments 1)"); break; - case DVD_AUD_EXT_DirectorComments2: lang += _T(" (Director Comments 2)"); break; - } - - CString format; - switch(AATR.AudioFormat) - { - case DVD_AudioFormat_AC3: format = _T("AC3"); break; - case DVD_AudioFormat_MPEG1: - case DVD_AudioFormat_MPEG1_DRC: format = _T("MPEG1"); break; - case DVD_AudioFormat_MPEG2: - case DVD_AudioFormat_MPEG2_DRC: format = _T("MPEG2"); break; - case DVD_AudioFormat_LPCM: format = _T("LPCM"); break; - case DVD_AudioFormat_DTS: format = _T("DTS"); break; - case DVD_AudioFormat_SDDS: format = _T("SDDS"); break; - case DVD_AudioFormat_Other: - default: format = _T("Unknown format"); break; - } - - Audio.Format(_T("%s, %s %dHz %dbits %d channel(s)"), - lang, - format, - AATR.dwFrequency, - AATR.bQuantization, - AATR.bNumberOfChannels); - - m_wndStatusBar.SetStatusBitmap( - AATR.bNumberOfChannels == 1 ? IDB_MONO - : AATR.bNumberOfChannels >= 2 ? IDB_STEREO - : IDB_NOAUDIO); - } - - m_wndInfoBar.SetLine(ResStr(IDS_INFOBAR_AUDIO), Audio); - - // Subtitles - - CString Subtitles('-'); - - BOOL bIsDisabled; - DVD_SubpictureAttributes SATR; - - if(SUCCEEDED(pDVDI->GetCurrentSubpicture(&ulAvailable, &ulCurrent, &bIsDisabled)) - && SUCCEEDED(pDVDI->GetSubpictureAttributes(ulCurrent, &SATR))) - { - CString lang; - int len = GetLocaleInfo(SATR.Language, LOCALE_SENGLANGUAGE, lang.GetBuffer(64), 64); - lang.ReleaseBufferSetLength(max(len-1, 0)); - - switch(SATR.LanguageExtension) - { - case DVD_SP_EXT_NotSpecified: - default: break; - case DVD_SP_EXT_Caption_Normal: lang += _T(""); break; - case DVD_SP_EXT_Caption_Big: lang += _T(" (Big)"); break; - case DVD_SP_EXT_Caption_Children: lang += _T(" (Children)"); break; - case DVD_SP_EXT_CC_Normal: lang += _T(" (CC)"); break; - case DVD_SP_EXT_CC_Big: lang += _T(" (CC Big)"); break; - case DVD_SP_EXT_CC_Children: lang += _T(" (CC Children)"); break; - case DVD_SP_EXT_Forced: lang += _T(" (Forced)"); break; - case DVD_SP_EXT_DirectorComments_Normal: lang += _T(" (Director Comments)"); break; - case DVD_SP_EXT_DirectorComments_Big: lang += _T(" (Director Comments, Big)"); break; - case DVD_SP_EXT_DirectorComments_Children: lang += _T(" (Director Comments, Children)"); break; - } - - if(bIsDisabled) lang = _T("-"); - - Subtitles.Format(_T("%s"), - lang); - } - - m_wndInfoBar.SetLine(ResStr(IDS_INFOBAR_SUBTITLES), Subtitles); - } - - if(GetMediaState() == State_Running) - { - UINT fSaverActive = 0; - if(SystemParametersInfo(SPI_GETSCREENSAVEACTIVE, 0, (PVOID)&fSaverActive, 0)) - { - SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, 0, 0, SPIF_SENDWININICHANGE); // this might not be needed at all... - SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, fSaverActive, 0, SPIF_SENDWININICHANGE); - } - - fSaverActive = 0; - if(SystemParametersInfo(SPI_GETPOWEROFFACTIVE, 0, (PVOID)&fSaverActive, 0)) - { - SystemParametersInfo(SPI_SETPOWEROFFACTIVE, 0, 0, SPIF_SENDWININICHANGE); // this might not be needed at all... - SystemParametersInfo(SPI_SETPOWEROFFACTIVE, fSaverActive, 0, SPIF_SENDWININICHANGE); - } - } - } - else if(nIDEvent == TIMER_STATUSERASER) - { - KillTimer(TIMER_STATUSERASER); - m_playingmsg.Empty(); - } - - __super::OnTimer(nIDEvent); -} - -static bool SetShutdownPrivilege() -{ - HANDLE hToken; - TOKEN_PRIVILEGES tkp; - - // Get a token for this process. - - if(!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken)) - return(false); - - // Get the LUID for the shutdown privilege. - - LookupPrivilegeValue(NULL, SE_SHUTDOWN_NAME, &tkp.Privileges[0].Luid); - - tkp.PrivilegeCount = 1; // one privilege to set - tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; - - // Get the shutdown privilege for this process. - - AdjustTokenPrivileges(hToken, FALSE, &tkp, 0, (PTOKEN_PRIVILEGES)NULL, 0); - - if(GetLastError() != ERROR_SUCCESS) - return false; - - return true; -} - -bool CMainFrame::DoAfterPlaybackEvent() -{ - AppSettings& s = AfxGetAppSettings(); - - bool fExit = false; - - if(s.nCLSwitches&CLSW_CLOSE) - { - fExit = true; - } - - if(s.nCLSwitches&CLSW_STANDBY) - { - SetShutdownPrivilege(); - SetSystemPowerState(TRUE, TRUE); - fExit = true; // TODO: unless the app closes, it will call standby or hibernate once again forever, how to avoid that? - } - else if(s.nCLSwitches&CLSW_HIBERNATE) - { - SetShutdownPrivilege(); - SetSystemPowerState(FALSE, TRUE); - fExit = true; // TODO: unless the app closes, it will call standby or hibernate once again forever, how to avoid that? - } - else if(s.nCLSwitches&CLSW_SHUTDOWN) - { - SetShutdownPrivilege(); - ExitWindowsEx(EWX_SHUTDOWN|EWX_POWEROFF|EWX_FORCEIFHUNG, 0); - fExit = true; - } - else if(s.nCLSwitches&CLSW_LOGOFF) - { - SetShutdownPrivilege(); - ExitWindowsEx(EWX_LOGOFF|EWX_FORCEIFHUNG, 0); - fExit = true; - } - - if(!fExit) return false; - - SendMessage(WM_COMMAND, ID_FILE_EXIT); - - return true; -} - -// -// our WM_GRAPHNOTIFY handler -// -#include -LRESULT CMainFrame::OnGraphNotify(WPARAM wParam, LPARAM lParam) -{ - HRESULT hr = S_OK; - - LONG evCode, evParam1, evParam2; - while(pME && SUCCEEDED(pME->GetEvent(&evCode, (LONG_PTR*)&evParam1, (LONG_PTR*)&evParam2, 0))) - { - CString str; - - if(m_fCustomGraph) - { - if(EC_BG_ERROR == evCode) - { - str = CString((char*)evParam1); - } - } - - hr = pME->FreeEventParams(evCode, evParam1, evParam2); - - if(EC_COMPLETE == evCode) - { - AppSettings& s = AfxGetAppSettings(); - - if(m_wndPlaylistBar.GetCount() <= 1) - { - m_nLoops++; - - if(DoAfterPlaybackEvent()) return hr; - - if(s.fLoopForever || m_nLoops < s.nLoops) - { - if(GetMediaState() == State_Stopped) - { - SendMessage(WM_COMMAND, ID_PLAY_PLAY); - } - else - { - LONGLONG pos = 0; - pMS->SetPositions(&pos, AM_SEEKING_AbsolutePositioning, NULL, AM_SEEKING_NoPositioning); - - if(GetMediaState() == State_Paused) - { - SendMessage(WM_COMMAND, ID_PLAY_PLAY); - } - } - } - else - { - if(s.fRewind) SendMessage(WM_COMMAND, ID_PLAY_STOP); - else m_fEndOfStream = true; - SendMessage(WM_COMMAND, ID_PLAY_PAUSE); - - if(m_fFullScreen && s.fExitFullScreenAtTheEnd) - OnViewFullscreen(); - } - } - else if(m_wndPlaylistBar.GetCount() > 1) - { - if(m_wndPlaylistBar.IsAtEnd()) - { - if(DoAfterPlaybackEvent()) return hr; - - m_nLoops++; - } - - if(s.fLoopForever || m_nLoops < s.nLoops) - { - int nLoops = m_nLoops; - PostMessage(WM_COMMAND, ID_NAVIGATE_SKIPFORWARD); - m_nLoops = nLoops; - } - else - { - if(m_fFullScreen && s.fExitFullScreenAtTheEnd) - OnViewFullscreen(); - - if(s.fRewind) - { - AfxGetAppSettings().nCLSwitches |= CLSW_OPEN; // HACK - PostMessage(WM_COMMAND, ID_NAVIGATE_SKIPFORWARD); - } - else - { - m_fEndOfStream = true; - PostMessage(WM_COMMAND, ID_PLAY_PAUSE); - } - } - } - } - else if(EC_ERRORABORT == evCode) - { - TRACE(_T("EC_ERRORABORT, hr = %08x\n"), (HRESULT)evParam1); -// SendMessage(WM_COMMAND, ID_FILE_CLOSEMEDIA); -// m_closingmsg = _com_error((HRESULT)evParam1).ErrorMessage(); - } - else if(EC_REPAINT == evCode) - { - TRACE(_T("EC_REPAINT\n")); - } - else if(EC_BUFFERING_DATA == evCode) - { - TRACE(_T("EC_BUFFERING_DATA, %d, %d\n"), (HRESULT)evParam1, evParam2); - - m_fBuffering = ((HRESULT)evParam1 != S_OK); - } - else if(EC_STEP_COMPLETE == evCode) - { - if(m_fFrameSteppingActive) - { - m_fFrameSteppingActive = false; - pBA->put_Volume(m_VolumeBeforeFrameStepping); - } - } - else if(EC_DEVICE_LOST == evCode) - { - CComQIPtr pBF; - if(m_iPlaybackMode == PM_CAPTURE - && (!pVidCap && pVidCap == (pBF = (IUnknown*)evParam1) - || !pAudCap && pAudCap == (pBF = (IUnknown*)evParam1)) - && evParam2 == 0) - { - SendMessage(WM_COMMAND, ID_FILE_CLOSEMEDIA); - } - } - else if(EC_DVD_TITLE_CHANGE == evCode) - { - if(m_iPlaybackMode == PM_FILE) - { - SetupChapters(); - } - else if(m_iPlaybackMode == PM_DVD) - { - m_iDVDTitle = (DWORD)evParam1; - - if(m_iDVDDomain == DVD_DOMAIN_Title) - { - CString Domain; - Domain.Format(_T("Title %d"), m_iDVDTitle); - m_wndInfoBar.SetLine(ResStr(IDS_INFOBAR_DOMAIN), Domain); - } - } - } - else if(EC_DVD_DOMAIN_CHANGE == evCode) - { - m_iDVDDomain = (DVD_DOMAIN)evParam1; - - CString Domain('-'); - - switch(m_iDVDDomain) - { - case DVD_DOMAIN_FirstPlay: Domain = _T("First Play"); break; - case DVD_DOMAIN_VideoManagerMenu: Domain = _T("Video Manager Menu"); break; - case DVD_DOMAIN_VideoTitleSetMenu: Domain = _T("Video Title Set Menu"); break; - case DVD_DOMAIN_Title: Domain.Format(_T("Title %d"), m_iDVDTitle); break; - case DVD_DOMAIN_Stop: Domain = _T("Stop"); break; - default: Domain = _T("-"); break; - } - - m_wndInfoBar.SetLine(ResStr(IDS_INFOBAR_DOMAIN), Domain); - - MoveVideoWindow(); // AR might have changed - } - else if(EC_DVD_CURRENT_HMSF_TIME == evCode) - { - double fps = evParam2 == DVD_TC_FLAG_25fps ? 25.0 - : evParam2 == DVD_TC_FLAG_30fps ? 30.0 - : evParam2 == DVD_TC_FLAG_DropFrame ? 29.97 - : 25.0; - - REFERENCE_TIME rtDur = 0; - - DVD_HMSF_TIMECODE tcDur; - ULONG ulFlags; - if(SUCCEEDED(pDVDI->GetTotalTitleTime(&tcDur, &ulFlags))) - rtDur = HMSF2RT(tcDur, fps); - - m_wndSeekBar.Enable(rtDur > 0); - m_wndSeekBar.SetRange(0, rtDur); - - REFERENCE_TIME rtNow = HMSF2RT(*((DVD_HMSF_TIMECODE*)&evParam1), fps); - - m_wndSeekBar.SetPos(rtNow); - - if(m_pSubClock) m_pSubClock->SetTime(rtNow); - } - else if(EC_DVD_ERROR == evCode) - { - TRACE(_T("EC_DVD_ERROR %d %d\n"), evParam1, evParam2); - - CString err; - - switch(evParam1) - { - case DVD_ERROR_Unexpected: default: err = _T("DVD: Unexpected error"); break; - case DVD_ERROR_CopyProtectFail: err = _T("DVD: Copy-Protect Fail"); break; - case DVD_ERROR_InvalidDVD1_0Disc: err = _T("DVD: Invalid DVD 1.x Disc"); break; - case DVD_ERROR_InvalidDiscRegion: err = _T("DVD: Invalid Disc Region"); break; - case DVD_ERROR_LowParentalLevel: err = _T("DVD: Low Parental Level"); break; - case DVD_ERROR_MacrovisionFail: err = _T("DVD: Macrovision Fail"); break; - case DVD_ERROR_IncompatibleSystemAndDecoderRegions: err = _T("DVD: Incompatible System And Decoder Regions"); break; - case DVD_ERROR_IncompatibleDiscAndDecoderRegions: err = _T("DVD: Incompatible Disc And Decoder Regions"); break; - } - - SendMessage(WM_COMMAND, ID_FILE_CLOSEMEDIA); - - m_closingmsg = err; - } - else if(EC_DVD_WARNING == evCode) - { - TRACE(_T("EC_DVD_WARNING %d %d\n"), evParam1, evParam2); - } - else if(EC_VIDEO_SIZE_CHANGED == evCode) - { - TRACE(_T("EC_VIDEO_SIZE_CHANGED %dx%d\n"), CSize(evParam1)); - - WINDOWPLACEMENT wp; - wp.length = sizeof(wp); - GetWindowPlacement(&wp); - - CSize size(evParam1); - m_fAudioOnly = (size.cx <= 0 || size.cy <= 0); - - if(AfxGetAppSettings().fRememberZoomLevel - && !(m_fFullScreen || wp.showCmd == SW_SHOWMAXIMIZED || wp.showCmd == SW_SHOWMINIMIZED)) - { - ZoomVideoWindow(); - } - else - { - MoveVideoWindow(); - } - - if(m_iMediaLoadState == MLS_LOADED - && !m_fAudioOnly && (AfxGetAppSettings().nCLSwitches&CLSW_FULLSCREEN)) - { - PostMessage(WM_COMMAND, ID_VIEW_FULLSCREEN); - AfxGetAppSettings().nCLSwitches &= ~CLSW_FULLSCREEN; - } - } - else if(EC_LENGTH_CHANGED == evCode) - { - __int64 rtDur = 0; - pMS->GetDuration(&rtDur); - m_wndPlaylistBar.SetCurTime(rtDur); - } - else if(!m_fCustomGraph) - { - TRACE(_T("evCode: %d\n"), evCode); - } - else if(EC_BG_AUDIO_CHANGED == evCode) - { - int nAudioChannels = evParam1; - - m_wndStatusBar.SetStatusBitmap(nAudioChannels == 1 ? IDB_MONO - : nAudioChannels >= 2 ? IDB_STEREO - : IDB_NOAUDIO); - } - else if(EC_BG_ERROR == evCode) - { - SendMessage(WM_COMMAND, ID_FILE_CLOSEMEDIA); - m_closingmsg = !str.IsEmpty() ? str : _T("Unspecified graph error"); - m_wndPlaylistBar.SetCurValid(false); - break; - } - } - - return hr; -} - -LRESULT CMainFrame::OnRepaintRenderLess(WPARAM wParam, LPARAM lParam) -{ - MoveVideoWindow(); - return TRUE; -} - -LRESULT CMainFrame::OnResumeFromState(WPARAM wParam, LPARAM lParam) -{ - int iPlaybackMode = (int)wParam; - - if(iPlaybackMode == PM_FILE) - { - SeekTo(10000i64*int(lParam)); - } - else if(iPlaybackMode == PM_DVD) - { - CComPtr pDvdState; - pDvdState.Attach((IDvdState*)lParam); - if(pDVDC) pDVDC->SetState(pDvdState, DVD_CMD_FLAG_Block, NULL); - } - else if(iPlaybackMode == PM_CAPTURE) - { - // not implemented - } - else - { - ASSERT(0); - return FALSE; - } - - return TRUE; -} - -BOOL CMainFrame::OnButton(UINT id, UINT nFlags, CPoint point) -{ - SetFocus(); - - CRect r; - m_wndView.GetClientRect(r); - m_wndView.MapWindowPoints(this, &r); - - if(id != wmcmd::WDOWN && id != wmcmd::WUP && !r.PtInRect(point)) return FALSE; - - BOOL ret = FALSE; - - AppSettings& s = AfxGetAppSettings(); - POSITION pos = s.wmcmds.GetHeadPosition(); - while(pos) - { - wmcmd& wc = s.wmcmds.GetNext(pos); - if(wc.mouse == id) - { - SendMessage(WM_COMMAND, wc.cmd); - ret = true; - } - } - - return ret; -} - -static bool s_fLDown = false; - -void CMainFrame::OnLButtonDown(UINT nFlags, CPoint point) -{ - SetFocus(); - - bool fClicked = false; - - if(m_iPlaybackMode == PM_DVD) - { - CPoint p = point - m_wndView.GetVideoRect().TopLeft(); - - if(SUCCEEDED(pDVDC->ActivateAtPosition(p)) - || m_iDVDDomain == DVD_DOMAIN_VideoManagerMenu - || m_iDVDDomain == DVD_DOMAIN_VideoTitleSetMenu) - fClicked = true; - } - - if(!fClicked) - { - bool fLeftMouseBtnUnassigned = true; - AppSettings& s = AfxGetAppSettings(); - POSITION pos = s.wmcmds.GetHeadPosition(); - while(pos && fLeftMouseBtnUnassigned) - if(s.wmcmds.GetNext(pos).mouse == wmcmd::LDOWN) - fLeftMouseBtnUnassigned = false; - - if(!m_fFullScreen && (IsCaptionMenuHidden() || fLeftMouseBtnUnassigned)) - { - PostMessage(WM_NCLBUTTONDOWN, HTCAPTION, MAKELPARAM(point.x, point.y)); - } - else -{ -s_fLDown = true; - if(OnButton(wmcmd::LDOWN, nFlags, point)) - return; -} - } - - __super::OnLButtonDown(nFlags, point); -} - -void CMainFrame::OnLButtonUp(UINT nFlags, CPoint point) -{ - if(!OnButton(wmcmd::LUP, nFlags, point)) - __super::OnLButtonUp(nFlags, point); -} - -void CMainFrame::OnLButtonDblClk(UINT nFlags, CPoint point) -{ -if(s_fLDown) -{ - SendMessage(WM_LBUTTONDOWN, nFlags, MAKELPARAM(point.x, point.y)); -s_fLDown = false; -} - if(!OnButton(wmcmd::LDBLCLK, nFlags, point)) - __super::OnLButtonDblClk(nFlags, point); -} - -void CMainFrame::OnMButtonDown(UINT nFlags, CPoint point) -{ - SendMessage(WM_CANCELMODE); - if(!OnButton(wmcmd::MDOWN, nFlags, point)) - __super::OnMButtonDown(nFlags, point); -} - -void CMainFrame::OnMButtonUp(UINT nFlags, CPoint point) -{ - if(!OnButton(wmcmd::MUP, nFlags, point)) - __super::OnMButtonUp(nFlags, point); -} - -void CMainFrame::OnMButtonDblClk(UINT nFlags, CPoint point) -{ - SendMessage(WM_MBUTTONDOWN, nFlags, MAKELPARAM(point.x, point.y)); - if(!OnButton(wmcmd::MDBLCLK, nFlags, point)) - __super::OnMButtonDblClk(nFlags, point); -} - -void CMainFrame::OnRButtonDown(UINT nFlags, CPoint point) -{ - if(!OnButton(wmcmd::RDOWN, nFlags, point)) - __super::OnRButtonDown(nFlags, point); -} - -void CMainFrame::OnRButtonUp(UINT nFlags, CPoint point) -{ - if(!OnButton(wmcmd::RUP, nFlags, point)) - __super::OnRButtonUp(nFlags, point); -} - -void CMainFrame::OnRButtonDblClk(UINT nFlags, CPoint point) -{ - SendMessage(WM_RBUTTONDOWN, nFlags, MAKELPARAM(point.x, point.y)); - if(!OnButton(wmcmd::RDBLCLK, nFlags, point)) - __super::OnRButtonDblClk(nFlags, point); -} - -LRESULT CMainFrame::OnXButtonDown(WPARAM wParam, LPARAM lParam) -{ - SendMessage(WM_CANCELMODE); - UINT fwButton = GET_XBUTTON_WPARAM(wParam); - return OnButton(fwButton == XBUTTON1 ? wmcmd::X1DOWN : fwButton == XBUTTON2 ? wmcmd::X2DOWN : wmcmd::NONE, - GET_KEYSTATE_WPARAM(wParam), CPoint(lParam)); -} - -LRESULT CMainFrame::OnXButtonUp(WPARAM wParam, LPARAM lParam) -{ - UINT fwButton = GET_XBUTTON_WPARAM(wParam); - return OnButton(fwButton == XBUTTON1 ? wmcmd::X1UP : fwButton == XBUTTON2 ? wmcmd::X2UP : wmcmd::NONE, - GET_KEYSTATE_WPARAM(wParam), CPoint(lParam)); -} - -LRESULT CMainFrame::OnXButtonDblClk(WPARAM wParam, LPARAM lParam) -{ - SendMessage(WM_XBUTTONDOWN, wParam, lParam); - UINT fwButton = GET_XBUTTON_WPARAM(wParam); - return OnButton(fwButton == XBUTTON1 ? wmcmd::X1DBLCLK : fwButton == XBUTTON2 ? wmcmd::X2DBLCLK : wmcmd::NONE, - GET_KEYSTATE_WPARAM(wParam), CPoint(lParam)); -} - -BOOL CMainFrame::OnMouseWheel(UINT nFlags, short zDelta, CPoint point) -{ - ScreenToClient(&point); - - BOOL fRet = - zDelta > 0 ? OnButton(wmcmd::WUP, nFlags, point) : - zDelta < 0 ? OnButton(wmcmd::WDOWN, nFlags, point) : - FALSE; - - return fRet; -} - -void CMainFrame::OnMouseMove(UINT nFlags, CPoint point) -{ - if(m_iPlaybackMode == PM_DVD) - { - CPoint vp = point - m_wndView.GetVideoRect().TopLeft(); - pDVDC->SelectAtPosition(vp); - } - - CSize diff = m_lastMouseMove - point; - - if(m_fFullScreen && (abs(diff.cx)+abs(diff.cy)) >= 1) - { - int nTimeOut = AfxGetAppSettings().nShowBarsWhenFullScreenTimeOut; - - if(nTimeOut < 0) - { - m_fHideCursor = false; - if(AfxGetAppSettings().fShowBarsWhenFullScreen) - ShowControls(AfxGetAppSettings().nCS); - - KillTimer(TIMER_FULLSCREENCONTROLBARHIDER); - SetTimer(TIMER_FULLSCREENMOUSEHIDER, 2000, NULL); - } - else if(nTimeOut == 0) - { - CRect r; - GetClientRect(r); - r.top = r.bottom; - - POSITION pos = m_bars.GetHeadPosition(); - for(int i = 1; pos; i <<= 1) - { - CControlBar* pNext = m_bars.GetNext(pos); - CSize s = pNext->CalcFixedLayout(FALSE, TRUE); - if(AfxGetAppSettings().nCS&i) r.top -= s.cy; - } - - // HACK: the controls would cover the menu too early hiding some buttons - if(m_iPlaybackMode == PM_DVD - && (m_iDVDDomain == DVD_DOMAIN_VideoManagerMenu - || m_iDVDDomain == DVD_DOMAIN_VideoTitleSetMenu)) - r.top = r.bottom - 10; - - m_fHideCursor = false; - - if(r.PtInRect(point)) - { - if(AfxGetAppSettings().fShowBarsWhenFullScreen) - ShowControls(AfxGetAppSettings().nCS); - } - else - { - if(AfxGetAppSettings().fShowBarsWhenFullScreen) - ShowControls(CS_NONE, false); - } - - SetTimer(TIMER_FULLSCREENMOUSEHIDER, 2000, NULL); - } - else - { - m_fHideCursor = false; - if(AfxGetAppSettings().fShowBarsWhenFullScreen) - ShowControls(AfxGetAppSettings().nCS); - - SetTimer(TIMER_FULLSCREENCONTROLBARHIDER, nTimeOut*1000, NULL); - SetTimer(TIMER_FULLSCREENMOUSEHIDER, max(nTimeOut*1000, 2000), NULL); - } - } - - m_lastMouseMove = point; - - __super::OnMouseMove(nFlags, point); -} - -LRESULT CMainFrame::OnNcHitTest(CPoint point) -{ - LRESULT nHitTest = __super::OnNcHitTest(point); - return ((IsCaptionMenuHidden()) && nHitTest == HTCLIENT) ? HTCAPTION : nHitTest; -} - -void CMainFrame::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) -{ - if(pScrollBar->IsKindOf(RUNTIME_CLASS(CVolumeCtrl))) - { - OnPlayVolume(0); - } - else if(pScrollBar->IsKindOf(RUNTIME_CLASS(CPlayerSeekBar)) && m_iMediaLoadState == MLS_LOADED) - { - SeekTo(m_wndSeekBar.GetPos(), !!(::GetKeyState(VK_SHIFT)&0x8000)); - } - - __super::OnHScroll(nSBCode, nPos, pScrollBar); -} - -void CMainFrame::OnInitMenu(CMenu* pMenu) -{ - __super::OnInitMenu(pMenu); - - MENUITEMINFO mii; - mii.cbSize = sizeof(mii); - - for(UINT i = 0, j = pMenu->GetMenuItemCount(); i < j; i++) - { - CString str; - pMenu->GetMenuString(i, str, MF_BYPOSITION); - - CMenu* pSubMenu = NULL; - - if(str == ResStr(IDS_FAVORITES_POPUP)) - { - SetupFavoritesSubMenu(); - pSubMenu = &m_favorites; - } - - if(pSubMenu) - { - mii.fMask = MIIM_STATE|MIIM_SUBMENU; - mii.fType = MF_POPUP; - mii.hSubMenu = pSubMenu->m_hMenu; - mii.fState = (pSubMenu->GetMenuItemCount() > 0 ? MF_ENABLED : (MF_DISABLED|MF_GRAYED)); - pMenu->SetMenuItemInfo(i, &mii, TRUE); - } - } -} - -void CMainFrame::OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu) -{ - __super::OnInitMenuPopup(pPopupMenu, nIndex, bSysMenu); - - static CAtlStringMap transl; - - if(transl.IsEmpty()) - { - transl[_T("Navigate")] = IDS_NAVIGATE_POPUP; - transl[_T("Open Disc")] = IDS_OPENCDROM_POPUP; - transl[_T("Filters")] = IDS_FILTERS_POPUP; - transl[_T("Audio")] = IDS_AUDIO_POPUP; - transl[_T("Subtitles")] = IDS_SUBTITLES_POPUP; - transl[_T("Audio Language")] = IDS_AUDIOLANGUAGE_POPUP; - transl[_T("Subtitle Language")] = IDS_SUBTITLELANGUAGE_POPUP; - transl[_T("Video Angle")] = IDS_VIDEOANGLE_POPUP; - transl[_T("Jump To...")] = IDS_JUMPTO_POPUP; - transl[_T("Favorites")] = IDS_FAVORITES_POPUP; - transl[_T("Shaders")] = IDS_SHADER_POPUP; - transl[_T("Video Frame")] = IDS_VIDEOFRAME_POPUP; - transl[_T("PanScan")] = IDS_PANSCAN_POPUP; - transl[_T("Aspect Ratio")] = IDS_ASPECTRATIO_POPUP; - transl[_T("Zoom")] = IDS_ZOOM_POPUP; - } - - MENUITEMINFO mii; - mii.cbSize = sizeof(mii); - - for(UINT i = 0, j = pPopupMenu->GetMenuItemCount(); i < j; i++) - { - CString str; - pPopupMenu->GetMenuString(i, str, MF_BYPOSITION); - - CString lookupstr = str; - lookupstr.Remove('&'); - - CMenu* pSubMenu = NULL; - - UINT id; - if(transl.Lookup(lookupstr, id)) - { - str = ResStr(id); - // pPopupMenu->ModifyMenu(i, MF_BYPOSITION|MF_STRING, 0, str); - MENUITEMINFO mii; - mii.cbSize = sizeof(mii); - mii.fMask = MIIM_STRING; - mii.dwTypeData = (LPTSTR)(LPCTSTR)str; - pPopupMenu->SetMenuItemInfo(i, &mii, TRUE); - } - - if(str == ResStr(IDS_NAVIGATE_POPUP)) - { - UINT fState = (m_iMediaLoadState == MLS_LOADED - && (1/*m_iPlaybackMode == PM_DVD *//*|| (m_iPlaybackMode == PM_FILE && m_PlayList.GetCount() > 0)*/)) - ? MF_ENABLED - : (MF_DISABLED|MF_GRAYED); - - pPopupMenu->EnableMenuItem(i, MF_BYPOSITION|fState); - } - else if(str == ResStr(IDS_VIDEOFRAME_POPUP) - || str == ResStr(IDS_PANSCAN_POPUP) - || str == ResStr(IDS_ASPECTRATIO_POPUP) - || str == ResStr(IDS_ZOOM_POPUP)) - { - UINT fState = (m_iMediaLoadState == MLS_LOADED && !m_fAudioOnly) - ? MF_ENABLED - : (MF_DISABLED|MF_GRAYED); - - pPopupMenu->EnableMenuItem(i, MF_BYPOSITION|fState); - } - else if(str == ResStr(IDS_OPENCDROM_POPUP)) - { - SetupOpenCDSubMenu(); - pSubMenu = &m_opencds; - } - else if(str == ResStr(IDS_FILTERS_POPUP)) - { - SetupFiltersSubMenu(); - pSubMenu = &m_filters; - } - else if(str == ResStr(IDS_AUDIO_POPUP)) - { - SetupAudioSwitcherSubMenu(); - pSubMenu = &m_audios; - } - else if(str == ResStr(IDS_SUBTITLES_POPUP)) - { - SetupSubtitlesSubMenu(); - pSubMenu = &m_subtitles; - } - else if(str == ResStr(IDS_AUDIOLANGUAGE_POPUP)) - { - SetupNavAudioSubMenu(); - pSubMenu = &m_navaudio; - } - else if(str == ResStr(IDS_SUBTITLELANGUAGE_POPUP)) - { - SetupNavSubtitleSubMenu(); - pSubMenu = &m_navsubtitle; - } - else if(str == ResStr(IDS_VIDEOANGLE_POPUP)) - { - SetupNavAngleSubMenu(); - pSubMenu = &m_navangle; - } - else if(str == ResStr(IDS_JUMPTO_POPUP)) - { - SetupNavChaptersSubMenu(); - pSubMenu = &m_navchapters; - } - else if(str == ResStr(IDS_FAVORITES_POPUP)) - { - SetupFavoritesSubMenu(); - pSubMenu = &m_favorites; - } - else if(str == ResStr(IDS_SHADER_POPUP)) - { - SetupShadersSubMenu(); - pSubMenu = &m_shaders; - } - - if(pSubMenu) - { - mii.fMask = MIIM_STATE|MIIM_SUBMENU; - mii.fType = MF_POPUP; - mii.hSubMenu = pSubMenu->m_hMenu; - mii.fState = (pSubMenu->GetMenuItemCount() > 0 ? MF_ENABLED : (MF_DISABLED|MF_GRAYED)); - pPopupMenu->SetMenuItemInfo(i, &mii, TRUE); - } - } - - // - - for(UINT i = 0, j = pPopupMenu->GetMenuItemCount(); i < j; i++) - { - UINT nID = pPopupMenu->GetMenuItemID(i); - if(nID == ID_SEPARATOR || nID == -1 - || nID >= ID_FAVORITES_FILE_START && nID <= ID_FAVORITES_FILE_END - || nID >= ID_NAVIGATE_CHAP_SUBITEM_START && nID <= ID_NAVIGATE_CHAP_SUBITEM_END) - continue; - - CString str; - pPopupMenu->GetMenuString(i, str, MF_BYPOSITION); - int k = str.Find('\t'); - if(k > 0) str = str.Left(k); - - CString key = CPPageAccelTbl::MakeAccelShortcutLabel(nID); - if(!key.IsEmpty()) str += _T("\t") + key; - - if(key.IsEmpty() && i < 0) continue; - - // BUG(?): this disables menu item update ui calls for some reason... -// pPopupMenu->ModifyMenu(i, MF_BYPOSITION|MF_STRING, nID, str); - - // this works fine - MENUITEMINFO mii; - mii.cbSize = sizeof(mii); - mii.fMask = MIIM_STRING; - mii.dwTypeData = (LPTSTR)(LPCTSTR)str; - pPopupMenu->SetMenuItemInfo(i, &mii, TRUE); - - } - - // - - bool fPnSPresets = false; - - for(UINT i = 0, j = pPopupMenu->GetMenuItemCount(); i < j; i++) - { - UINT nID = pPopupMenu->GetMenuItemID(i); - - if(nID >= ID_PANNSCAN_PRESETS_START && nID < ID_PANNSCAN_PRESETS_END) - { - do - { - nID = pPopupMenu->GetMenuItemID(i); - pPopupMenu->DeleteMenu(i, MF_BYPOSITION); - j--; - } - while(i < j && nID >= ID_PANNSCAN_PRESETS_START && nID < ID_PANNSCAN_PRESETS_END); - - nID = pPopupMenu->GetMenuItemID(i); - } - - if(nID == ID_VIEW_RESET) - { - fPnSPresets = true; - } - } - - if(fPnSPresets) - { - AppSettings& s = AfxGetAppSettings(); - int i = 0, j = s.m_pnspresets.GetCount(); - for(; i < j; i++) - { - int k = 0; - CString label = s.m_pnspresets[i].Tokenize(_T(","), k); - pPopupMenu->InsertMenu(ID_VIEW_RESET, MF_BYCOMMAND, ID_PANNSCAN_PRESETS_START+i, label); - } -// if(j > 0) - { - pPopupMenu->InsertMenu(ID_VIEW_RESET, MF_BYCOMMAND, ID_PANNSCAN_PRESETS_START+i, ResStr(IDS_PANSCAN_EDIT)); - pPopupMenu->InsertMenu(ID_VIEW_RESET, MF_BYCOMMAND|MF_SEPARATOR); - } - } -} - -BOOL CMainFrame::OnMenu(CMenu* pMenu) -{ - if(!pMenu) return FALSE; - - KillTimer(TIMER_FULLSCREENMOUSEHIDER); - m_fHideCursor = false; - - CPoint point; - GetCursorPos(&point); - - pMenu->TrackPopupMenu(TPM_RIGHTBUTTON|TPM_NOANIMATION, point.x+1, point.y+1, this); - - return TRUE; -} - -void CMainFrame::OnMenuPlayerShort() -{ - if(IsCaptionMenuHidden()) - { - OnMenu(m_popupmain.GetSubMenu(0)); - } - else - { - OnMenu(m_popup.GetSubMenu(0)); - } -} - -void CMainFrame::OnMenuPlayerLong() -{ - OnMenu(m_popupmain.GetSubMenu(0)); -} - -void CMainFrame::OnMenuFilters() -{ - SetupFiltersSubMenu(); - OnMenu(&m_filters); -} - -void CMainFrame::OnUpdatePlayerStatus(CCmdUI* pCmdUI) -{ - if(m_iMediaLoadState == MLS_LOADING) - { - pCmdUI->SetText(ResStr(IDS_CONTROLS_OPENING)); - } - else if(m_iMediaLoadState == MLS_LOADED) - { - CString msg; - - if(!m_playingmsg.IsEmpty()) - { - msg = m_playingmsg; - } - else if(m_fCapturing) - { - msg = ResStr(IDS_CONTROLS_CAPTURING); - - if(pAMDF) - { - long lDropped = 0; - pAMDF->GetNumDropped(&lDropped); - long lNotDropped = 0; - pAMDF->GetNumNotDropped(&lNotDropped); - - if((lDropped + lNotDropped) > 0) - { - CString str; - str.Format(_T(", Total: %d, Dropped: %d"), lDropped + lNotDropped, lDropped); - msg += str; - } - } - - CComPtr pPin; - if(SUCCEEDED(pCGB->FindPin(m_wndCaptureBar.m_capdlg.m_pDst, PINDIR_INPUT, NULL, NULL, FALSE, 0, &pPin))) - { - LONGLONG size = 0; - if(CComQIPtr pStream = pPin) - { - pStream->Commit(STGC_DEFAULT); - - WIN32_FIND_DATA findFileData; - HANDLE h = FindFirstFile(m_wndCaptureBar.m_capdlg.m_file, &findFileData); - if(h != INVALID_HANDLE_VALUE) - { - size = ((LONGLONG)findFileData.nFileSizeHigh << 32) | findFileData.nFileSizeLow; - - CString str; - if(size < 1024i64*1024) - str.Format(_T(", Size: %I64dKB"), size/1024); - else //if(size < 1024i64*1024*1024) - str.Format(_T(", Size: %I64dMB"), size/1024/1024); - msg += str; - - FindClose(h); - } - } - - ULARGE_INTEGER FreeBytesAvailable, TotalNumberOfBytes, TotalNumberOfFreeBytes; - if(GetDiskFreeSpaceEx( - m_wndCaptureBar.m_capdlg.m_file.Left(m_wndCaptureBar.m_capdlg.m_file.ReverseFind('\\')+1), - &FreeBytesAvailable, &TotalNumberOfBytes, &TotalNumberOfFreeBytes)) - { - CString str; - if(FreeBytesAvailable.QuadPart < 1024i64*1024) - str.Format(_T(", Free: %I64dKB"), FreeBytesAvailable.QuadPart/1024); - else //if(FreeBytesAvailable.QuadPart < 1024i64*1024*1024) - str.Format(_T(", Free: %I64dMB"), FreeBytesAvailable.QuadPart/1024/1024); - msg += str; - } - - if(m_wndCaptureBar.m_capdlg.m_pMux) - { - __int64 pos = 0; - CComQIPtr pMuxMS = m_wndCaptureBar.m_capdlg.m_pMux; - if(pMuxMS && SUCCEEDED(pMuxMS->GetCurrentPosition(&pos)) && pos > 0) - { - double bytepersec = 10000000.0 * size / pos; - if(bytepersec > 0) - m_rtDurationOverride = __int64(10000000.0 * (FreeBytesAvailable.QuadPart+size) / bytepersec); - } - } - - if(m_wndCaptureBar.m_capdlg.m_pVidBuffer - || m_wndCaptureBar.m_capdlg.m_pAudBuffer) - { - int nFreeVidBuffers = 0, nFreeAudBuffers = 0; - if(CComQIPtr pVB = m_wndCaptureBar.m_capdlg.m_pVidBuffer) - nFreeVidBuffers = pVB->GetFreeBuffers(); - if(CComQIPtr pAB = m_wndCaptureBar.m_capdlg.m_pAudBuffer) - nFreeAudBuffers = pAB->GetFreeBuffers(); - - CString str; - str.Format(_T(", Free V/A Buffers: %03d/%03d"), nFreeVidBuffers, nFreeAudBuffers); - msg += str; - } - } - } - else if(m_fBuffering) - { - BeginEnumFilters(pGB, pEF, pBF) - { - if(CComQIPtr pAMNS = pBF) - { - long BufferingProgress = 0; - if(SUCCEEDED(pAMNS->get_BufferingProgress(&BufferingProgress)) && BufferingProgress > 0) - { - msg.Format(ResStr(IDS_CONTROLS_BUFFERING), BufferingProgress); - - __int64 start = 0, stop = 0; - m_wndSeekBar.GetRange(start, stop); - m_fLiveWM = (stop == start); - } - break; - } - } - EndEnumFilters - } - else if(pAMOP) - { - __int64 t = 0, c = 0; - if(SUCCEEDED(pAMOP->QueryProgress(&t, &c)) && t > 0 && c < t) - msg.Format(ResStr(IDS_CONTROLS_BUFFERING), c*100/t); - - if(m_fUpdateInfoBar) - OpenSetupInfoBar(); - } - - OAFilterState fs = GetMediaState(); - pCmdUI->SetText( - !msg.IsEmpty() ? msg : - fs == State_Stopped ? ResStr(IDS_CONTROLS_STOPPED) : - (fs == State_Paused || m_fFrameSteppingActive) ? ResStr(IDS_CONTROLS_PAUSED) : - fs == State_Running ? ResStr(IDS_CONTROLS_PLAYING) : - _T("")); - } - else if(m_iMediaLoadState == MLS_CLOSING) - { - pCmdUI->SetText(ResStr(IDS_CONTROLS_CLOSING)); - } - else - { - pCmdUI->SetText(m_closingmsg); - } -} - -void CMainFrame::OnFilePostOpenmedia() -{ - OpenSetupInfoBar(); - - OpenSetupStatsBar(); - - OpenSetupStatusBar(); - - // OpenSetupToolBar(); - - OpenSetupCaptureBar(); - - __int64 rtDur = 0; - pMS->GetDuration(&rtDur); - m_wndPlaylistBar.SetCurTime(rtDur); - - if(m_iPlaybackMode == PM_CAPTURE) - { - ShowControlBar(&m_wndSubresyncBar, FALSE, TRUE); -// ShowControlBar(&m_wndPlaylistBar, FALSE, TRUE); -// ShowControlBar(&m_wndCaptureBar, TRUE, TRUE); - } - - if(m_pCAP) m_pCAP->SetSubtitleDelay(0); - m_iMediaLoadState = MLS_LOADED; - - // IMPORTANT: must not call any windowing msgs before - // this point, it will deadlock when OpenMediaPrivate is - // still running and the renderer window was created on - // the same worker-thread - - { - WINDOWPLACEMENT wp; - wp.length = sizeof(wp); - GetWindowPlacement(&wp); - - // restore magnification - if(IsWindowVisible() && AfxGetAppSettings().fRememberZoomLevel - && !(m_fFullScreen || wp.showCmd == SW_SHOWMAXIMIZED || wp.showCmd == SW_SHOWMINIMIZED)) - { - ZoomVideoWindow(); - } - } - - if(!m_fAudioOnly && (AfxGetAppSettings().nCLSwitches&CLSW_FULLSCREEN)) - { - SendMessage(WM_COMMAND, ID_VIEW_FULLSCREEN); - AfxGetAppSettings().nCLSwitches &= ~CLSW_FULLSCREEN; - } - - SendNowPlayingToMSN(); - SendNowPlayingTomIRC(); -} - -void CMainFrame::OnUpdateFilePostOpenmedia(CCmdUI* pCmdUI) -{ - pCmdUI->Enable(m_iMediaLoadState == MLS_LOADING); -} - -void CMainFrame::OnFilePostClosemedia() -{ - m_wndView.SetVideoRect(); - m_wndSeekBar.Enable(false); - m_wndSeekBar.SetPos(0); - m_wndInfoBar.RemoveAllLines(); - m_wndStatsBar.RemoveAllLines(); - m_wndStatusBar.Clear(); - m_wndStatusBar.ShowTimer(false); - - if(IsWindow(m_wndSubresyncBar.m_hWnd)) - { - ShowControlBar(&m_wndSubresyncBar, FALSE, TRUE); - SetSubtitle(NULL); - } - - if(IsWindow(m_wndCaptureBar.m_hWnd)) - { - ShowControlBar(&m_wndCaptureBar, FALSE, TRUE); - m_wndCaptureBar.m_capdlg.SetupVideoControls(_T(""), NULL, NULL, NULL); - m_wndCaptureBar.m_capdlg.SetupAudioControls(_T(""), NULL, CInterfaceArray()); - } - - RecalcLayout(); - - SetWindowText(ResStr(IDR_MAINFRAME)); - - SetAlwaysOnTop(AfxGetAppSettings().iOnTop); - - // this will prevent any further UI updates on the dynamically added menu items - SetupFiltersSubMenu(); - SetupAudioSwitcherSubMenu(); - SetupSubtitlesSubMenu(); - SetupNavAudioSubMenu(); - SetupNavSubtitleSubMenu(); - SetupNavAngleSubMenu(); - SetupNavChaptersSubMenu(); - SetupFavoritesSubMenu(); - - SendNowPlayingToMSN(); -} - -void CMainFrame::OnUpdateFilePostClosemedia(CCmdUI* pCmdUI) -{ - pCmdUI->Enable(!!m_hWnd && m_iMediaLoadState == MLS_CLOSING); -} - -void CMainFrame::OnBossKey() -{ - SendMessage(WM_COMMAND, ID_PLAY_PAUSE); - if(m_fFullScreen) SendMessage(WM_COMMAND, ID_VIEW_FULLSCREEN); - SendMessage(WM_SYSCOMMAND, SC_MINIMIZE, -1); -} - -void CMainFrame::OnStreamAudio(UINT nID) -{ - nID -= ID_STREAM_AUDIO_NEXT; - - if(m_iMediaLoadState != MLS_LOADED) return; - - CComQIPtr pSS = FindFilter(__uuidof(CAudioSwitcherFilter), pGB); - if(!pSS) pSS = FindFilter(L"{D3CD7858-971A-4838-ACEC-40CA5D529DC8}", pGB); // morgan's switcher - - DWORD cStreams = 0; - if(pSS && SUCCEEDED(pSS->Count(&cStreams)) && cStreams > 1) - { - for(int i = 0; i < (int)cStreams; i++) - { - AM_MEDIA_TYPE* pmt = NULL; - DWORD dwFlags = 0; - LCID lcid = 0; - DWORD dwGroup = 0; - WCHAR* pszName = NULL; - if(FAILED(pSS->Info(i, &pmt, &dwFlags, &lcid, &dwGroup, &pszName, NULL, NULL))) - return; - if(pmt) DeleteMediaType(pmt); - if(pszName) CoTaskMemFree(pszName); - - if(dwFlags&(AMSTREAMSELECTINFO_ENABLED|AMSTREAMSELECTINFO_EXCLUSIVE)) - { - pSS->Enable((i+(nID==0?1:cStreams-1))%cStreams, AMSTREAMSELECTENABLE_ENABLE); - break; - } - } - } - else if(m_iPlaybackMode == PM_FILE) SendMessage(WM_COMMAND, ID_OGM_AUDIO_NEXT+nID); - else if(m_iPlaybackMode == PM_DVD) SendMessage(WM_COMMAND, ID_DVD_AUDIO_NEXT+nID); -} - -void CMainFrame::OnStreamSub(UINT nID) -{ - nID -= ID_STREAM_SUB_NEXT; - - if(m_iMediaLoadState != MLS_LOADED) return; - - int cnt = 0; - POSITION pos = m_pSubStreams.GetHeadPosition(); - while(pos) cnt += m_pSubStreams.GetNext(pos)->GetStreamCount(); - - if(cnt > 1) - { - int i = ((m_iSubtitleSel&0x7fffffff)+(nID==0?1:cnt-1))%cnt; - m_iSubtitleSel = i | (m_iSubtitleSel&0x80000000); - UpdateSubtitle(); - SetFocus(); - } - else if(m_iPlaybackMode == PM_FILE) SendMessage(WM_COMMAND, ID_OGM_SUB_NEXT+nID); - else if(m_iPlaybackMode == PM_DVD) SendMessage(WM_COMMAND, ID_DVD_SUB_NEXT+nID); -} - -void CMainFrame::OnStreamSubOnOff() -{ - if(m_iMediaLoadState != MLS_LOADED) return; - - int cnt = 0; - POSITION pos = m_pSubStreams.GetHeadPosition(); - while(pos) cnt += m_pSubStreams.GetNext(pos)->GetStreamCount(); - - if(cnt > 0) - { - m_iSubtitleSel ^= 0x80000000; - UpdateSubtitle(); - SetFocus(); - } - else if(m_iPlaybackMode == PM_DVD) SendMessage(WM_COMMAND, ID_DVD_SUB_ONOFF); -} - -void CMainFrame::OnOgmAudio(UINT nID) -{ - nID -= ID_OGM_AUDIO_NEXT; - - if(m_iMediaLoadState != MLS_LOADED) return; - - CComQIPtr pSS = FindFilter(CLSID_OggSplitter, pGB); - if(!pSS) pSS = FindFilter(L"{55DA30FC-F16B-49fc-BAA5-AE59FC65F82D}", pGB); - if(!pSS) return; - - CAtlArray snds; - int iSel = -1; - - DWORD cStreams = 0; - if(SUCCEEDED(pSS->Count(&cStreams)) && cStreams > 1) - { - for(int i = 0; i < (int)cStreams; i++) - { - AM_MEDIA_TYPE* pmt = NULL; - DWORD dwFlags = 0; - LCID lcid = 0; - DWORD dwGroup = 0; - WCHAR* pszName = NULL; - if(FAILED(pSS->Info(i, &pmt, &dwFlags, &lcid, &dwGroup, &pszName, NULL, NULL))) - return; - - if(dwGroup == 1) - { - if(dwFlags&(AMSTREAMSELECTINFO_ENABLED|AMSTREAMSELECTINFO_EXCLUSIVE)) - iSel = snds.GetCount(); - snds.Add(i); - } - - if(pmt) DeleteMediaType(pmt); - if(pszName) CoTaskMemFree(pszName); - - } - - int cnt = snds.GetCount(); - if(cnt > 1 && iSel >= 0) - pSS->Enable(snds[(iSel+(nID==0?1:cnt-1))%cnt], AMSTREAMSELECTENABLE_ENABLE); - } -} - -void CMainFrame::OnOgmSub(UINT nID) -{ - nID -= ID_OGM_SUB_NEXT; - - if(m_iMediaLoadState != MLS_LOADED) return; - - CComQIPtr pSS = FindFilter(CLSID_OggSplitter, pGB); - if(!pSS) pSS = FindFilter(L"{55DA30FC-F16B-49fc-BAA5-AE59FC65F82D}", pGB); - if(!pSS) return; - - CAtlArray subs; - int iSel = -1; - - DWORD cStreams = 0; - if(SUCCEEDED(pSS->Count(&cStreams)) && cStreams > 1) - { - for(int i = 0; i < (int)cStreams; i++) - { - AM_MEDIA_TYPE* pmt = NULL; - DWORD dwFlags = 0; - LCID lcid = 0; - DWORD dwGroup = 0; - WCHAR* pszName = NULL; - if(FAILED(pSS->Info(i, &pmt, &dwFlags, &lcid, &dwGroup, &pszName, NULL, NULL))) - return; - - if(dwGroup == 2) - { - if(dwFlags&(AMSTREAMSELECTINFO_ENABLED|AMSTREAMSELECTINFO_EXCLUSIVE)) - iSel = subs.GetCount(); - subs.Add(i); - } - - if(pmt) DeleteMediaType(pmt); - if(pszName) CoTaskMemFree(pszName); - - } - - int cnt = subs.GetCount(); - if(cnt > 1 && iSel >= 0) - pSS->Enable(subs[(iSel+(nID==0?1:cnt-1))%cnt], AMSTREAMSELECTENABLE_ENABLE); - } -} - -void CMainFrame::OnDvdAngle(UINT nID) -{ - nID -= ID_DVD_ANGLE_NEXT; - - if(m_iMediaLoadState != MLS_LOADED) return; - - if(pDVDI && pDVDC) - { - ULONG ulAnglesAvailable, ulCurrentAngle; - if(SUCCEEDED(pDVDI->GetCurrentAngle(&ulAnglesAvailable, &ulCurrentAngle)) && ulAnglesAvailable > 1) - { - ulCurrentAngle += nID==0 ? 1 : ulAnglesAvailable-1; - if(ulCurrentAngle > ulAnglesAvailable) ulCurrentAngle = 1; - else if(ulCurrentAngle < 1) ulCurrentAngle = ulAnglesAvailable; - pDVDC->SelectAngle(ulCurrentAngle, DVD_CMD_FLAG_Block, NULL); - } - } -} - -void CMainFrame::OnDvdAudio(UINT nID) -{ - nID -= ID_DVD_AUDIO_NEXT; - - if(m_iMediaLoadState != MLS_LOADED) return; - - if(pDVDI && pDVDC) - { - ULONG nStreamsAvailable, nCurrentStream; - if(SUCCEEDED(pDVDI->GetCurrentAudio(&nStreamsAvailable, &nCurrentStream)) && nStreamsAvailable > 1) - pDVDC->SelectAudioStream((nCurrentStream+(nID==0?1:nStreamsAvailable-1))%nStreamsAvailable, DVD_CMD_FLAG_Block, NULL); - } -} - -void CMainFrame::OnDvdSub(UINT nID) -{ - nID -= ID_DVD_SUB_NEXT; - - if(m_iMediaLoadState != MLS_LOADED) return; - - if(pDVDI && pDVDC) - { - ULONG ulStreamsAvailable, ulCurrentStream; - BOOL bIsDisabled; - if(SUCCEEDED(pDVDI->GetCurrentSubpicture(&ulStreamsAvailable, &ulCurrentStream, &bIsDisabled)) - && ulStreamsAvailable > 1) - { - pDVDC->SelectSubpictureStream( - (ulCurrentStream+(nID==0?1:ulStreamsAvailable-1))%ulStreamsAvailable, - DVD_CMD_FLAG_Block, NULL); - } - } -} - -void CMainFrame::OnDvdSubOnOff() -{ - if(m_iMediaLoadState != MLS_LOADED) return; - - if(pDVDI && pDVDC) - { - ULONG ulStreamsAvailable, ulCurrentStream; - BOOL bIsDisabled; - if(SUCCEEDED(pDVDI->GetCurrentSubpicture(&ulStreamsAvailable, &ulCurrentStream, &bIsDisabled))) - { - pDVDC->SetSubpictureState(bIsDisabled, DVD_CMD_FLAG_Block, NULL); - } - } -} - -// -// menu item handlers -// - -// file - -void CMainFrame::OnFileOpenQuick() -{ - if(m_iMediaLoadState == MLS_LOADING || !IsWindow(m_wndPlaylistBar)) return; - - CString filter; - CAtlArray mask; - AfxGetAppSettings().Formats.GetFilter(filter, mask); - - COpenFileDlg fd(mask, true, NULL, NULL, - OFN_EXPLORER|OFN_ENABLESIZING|OFN_HIDEREADONLY|OFN_ALLOWMULTISELECT|OFN_ENABLEINCLUDENOTIFY, - filter, this); - if(fd.DoModal() != IDOK) return; - - CAtlList fns; - - POSITION pos = fd.GetStartPosition(); - while(pos) fns.AddTail(fd.GetNextPathName(pos)); - - bool fMultipleFiles = false; - - if(fns.GetCount() > 1 - || fns.GetCount() == 1 - && (fns.GetHead()[fns.GetHead().GetLength()-1] == '\\' - || fns.GetHead()[fns.GetHead().GetLength()-1] == '*')) - { - fMultipleFiles = true; - } - - SendMessage(WM_COMMAND, ID_FILE_CLOSEMEDIA); - - ShowWindow(SW_SHOW); - SetForegroundWindow(); - - m_wndPlaylistBar.Open(fns, fMultipleFiles); - - if(m_wndPlaylistBar.GetCount() == 1 && m_wndPlaylistBar.IsWindowVisible() && !m_wndPlaylistBar.IsFloating()) - { - ShowControlBar(&m_wndPlaylistBar, FALSE, TRUE); - } - - OpenCurPlaylistItem(); -} - -void CMainFrame::OnFileOpenmedia() -{ - if(m_iMediaLoadState == MLS_LOADING || !IsWindow(m_wndPlaylistBar)) return; - - COpenDlg dlg; - if(dlg.DoModal() != IDOK || dlg.m_fns.GetCount() == 0) return; - - if(dlg.m_fAppendPlaylist) - { - m_wndPlaylistBar.Append(dlg.m_fns, dlg.m_fMultipleFiles); - return; - } - - SendMessage(WM_COMMAND, ID_FILE_CLOSEMEDIA); - - ShowWindow(SW_SHOW); - SetForegroundWindow(); - - m_wndPlaylistBar.Open(dlg.m_fns, dlg.m_fMultipleFiles); - - if(m_wndPlaylistBar.GetCount() == 1 && m_wndPlaylistBar.IsWindowVisible() && !m_wndPlaylistBar.IsFloating()) - { - ShowControlBar(&m_wndPlaylistBar, FALSE, TRUE); - } - - OpenCurPlaylistItem(); -} - -void CMainFrame::OnUpdateFileOpen(CCmdUI* pCmdUI) -{ - pCmdUI->Enable(m_iMediaLoadState != MLS_LOADING); -} - -BOOL CMainFrame::OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCDS) -{ - if(m_iMediaLoadState == MLS_LOADING || !IsWindow(m_wndPlaylistBar)) - return FALSE; - - if(pCDS->dwData != 0x6ABE51 || pCDS->cbData < sizeof(DWORD)) - return FALSE; - - DWORD len = *((DWORD*)pCDS->lpData); - TCHAR* pBuff = (TCHAR*)((DWORD*)pCDS->lpData + 1); - TCHAR* pBuffEnd = (TCHAR*)((BYTE*)pBuff + pCDS->cbData - sizeof(DWORD)); - - CAtlList cmdln; - - while(len-- > 0) - { - CString str; - while(pBuff < pBuffEnd && *pBuff) str += *pBuff++; - pBuff++; - cmdln.AddTail(str); - } - - AppSettings& s = AfxGetAppSettings(); - - s.ParseCommandLine(cmdln); - - POSITION pos = s.slFilters.GetHeadPosition(); - while(pos) - { - CString fullpath = MakeFullPath(s.slFilters.GetNext(pos)); - - CPath tmp(fullpath); - tmp.RemoveFileSpec(); - tmp.AddBackslash(); - CString path = tmp; - - WIN32_FIND_DATA fd = {0}; - HANDLE hFind = FindFirstFile(fullpath, &fd); - if(hFind != INVALID_HANDLE_VALUE) - { - do - { - if(fd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) continue; - - CFilterMapper2 fm2(false); - fm2.Register(path + fd.cFileName); - while(!fm2.m_filters.IsEmpty()) - { - if(FilterOverride* f = fm2.m_filters.RemoveTail()) - { - f->fTemporary = true; - - bool fFound = false; - - POSITION pos2 = s.filters.GetHeadPosition(); - while(pos2) - { - FilterOverride* f2 = s.filters.GetNext(pos2); - if(f2->type == FilterOverride::EXTERNAL && !f2->path.CompareNoCase(f->path)) - { - fFound = true; - break; - } - } - - if(!fFound) - { - CAutoPtr p(f); - s.filters.AddHead(p); - } - } - } - } - while(FindNextFile(hFind, &fd)); - - FindClose(hFind); - } - } - - bool fSetForegroundWindow = false; - - if((s.nCLSwitches&CLSW_DVD) && !s.slFiles.IsEmpty()) - { - SendMessage(WM_COMMAND, ID_FILE_CLOSEMEDIA); - fSetForegroundWindow = true; - - CAutoPtr p(new OpenDVDData()); - if(p) {p->path = s.slFiles.GetHead(); p->subs.AddTailList(&s.slSubs);} - OpenMedia(p); - } - else if(s.nCLSwitches&CLSW_CD) - { - SendMessage(WM_COMMAND, ID_FILE_CLOSEMEDIA); - fSetForegroundWindow = true; - - CAtlList sl; - - if(!s.slFiles.IsEmpty()) - { - GetCDROMType(s.slFiles.GetHead()[0], sl); - } - else - { - CString dir; - dir.ReleaseBufferSetLength(GetCurrentDirectory(MAX_PATH, dir.GetBuffer(MAX_PATH))); - - GetCDROMType(dir[0], sl); - - for(TCHAR drive = 'C'; sl.IsEmpty() && drive <= 'Z'; drive++) - { - GetCDROMType(drive, sl); - } - } - - m_wndPlaylistBar.Open(sl, true); - OpenCurPlaylistItem(); - } - else if(!s.slFiles.IsEmpty()) - { - bool fMulti = s.slFiles.GetCount() > 1; - - CAtlList sl; - sl.AddTailList(&s.slFiles); - if(!fMulti) sl.AddTailList(&s.slDubs); - - if((s.nCLSwitches&CLSW_ADD) && m_wndPlaylistBar.GetCount() > 0) - { - m_wndPlaylistBar.Append(sl, fMulti, &s.slSubs); - - if(s.nCLSwitches&(CLSW_OPEN|CLSW_PLAY)) - { - m_wndPlaylistBar.SetLast(); - OpenCurPlaylistItem(); - } - } - else - { - SendMessage(WM_COMMAND, ID_FILE_CLOSEMEDIA); - fSetForegroundWindow = true; - - m_wndPlaylistBar.Open(sl, fMulti, &s.slSubs); - OpenCurPlaylistItem((s.nCLSwitches&CLSW_STARTVALID) ? s.rtStart : 0); - - s.nCLSwitches &= ~CLSW_STARTVALID; - s.rtStart = 0; - } - } - else - { - s.nCLSwitches = CLSW_NONE; - } - - if(fSetForegroundWindow && !(s.nCLSwitches&CLSW_NOFOCUS)) - SetForegroundWindow(); - - s.nCLSwitches &= ~CLSW_NOFOCUS; - - return TRUE; -} - -void CMainFrame::OnFileOpendvd() -{ - if(m_iMediaLoadState == MLS_LOADING) return; - - SendMessage(WM_COMMAND, ID_FILE_CLOSEMEDIA); - SetForegroundWindow(); - - ShowWindow(SW_SHOW); - - CAutoPtr p(new OpenDVDData()); - if(p) - { - AppSettings& s = AfxGetAppSettings(); - if(s.fUseDVDPath && !s.sDVDPath.IsEmpty()) - { - p->path = s.sDVDPath; - p->path.Replace('/', '\\'); - if(p->path[p->path.GetLength()-1] != '\\') p->path += '\\'; - } - } - OpenMedia(p); -} - -void CMainFrame::OnFileOpendevice() -{ - if(m_iMediaLoadState == MLS_LOADING) return; - - COpenCapDeviceDlg capdlg; - if(capdlg.DoModal() != IDOK) - return; - - SendMessage(WM_COMMAND, ID_FILE_CLOSEMEDIA); - SetForegroundWindow(); - - ShowWindow(SW_SHOW); - - m_wndPlaylistBar.Empty(); - - CAutoPtr p(new OpenDeviceData()); - if(p) {p->DisplayName[0] = capdlg.m_vidstr; p->DisplayName[1] = capdlg.m_audstr;} - OpenMedia(p); -} - -void CMainFrame::OnFileOpenCD(UINT nID) -{ - nID -= ID_FILE_OPEN_CD_START; - - nID++; - for(TCHAR drive = 'C'; drive <= 'Z'; drive++) - { - CAtlList sl; - - switch(GetCDROMType(drive, sl)) - { - case CDROM_Audio: - case CDROM_VideoCD: - case CDROM_DVDVideo: - nID--; - break; - default: - break; - } - - if(nID == 0) - { - SendMessage(WM_COMMAND, ID_FILE_CLOSEMEDIA); - SetForegroundWindow(); - - ShowWindow(SW_SHOW); - - m_wndPlaylistBar.Open(sl, true); - OpenCurPlaylistItem(); - - break; - } - } -} - -void CMainFrame::OnDropFiles(HDROP hDropInfo) -{ - SetForegroundWindow(); - - if(m_wndPlaylistBar.IsWindowVisible()) - { - m_wndPlaylistBar.OnDropFiles(hDropInfo); - return; - } - - CAtlList sl; - - UINT nFiles = ::DragQueryFile(hDropInfo, (UINT)-1, NULL, 0); - - for(UINT iFile = 0; iFile < nFiles; iFile++) - { - CString fn; - fn.ReleaseBuffer(::DragQueryFile(hDropInfo, iFile, fn.GetBuffer(MAX_PATH), MAX_PATH)); - sl.AddTail(fn); - } - - ::DragFinish(hDropInfo); - - if(sl.IsEmpty()) return; - - if(sl.GetCount() == 1 && m_iMediaLoadState == MLS_LOADED && m_pCAP) - { - if(LoadSubtitle(sl.GetHead())) - { - SetSubtitle(m_pSubStreams.GetTail()); - CPath p(sl.GetHead()); - p.StripPath(); - SendStatusMessage(CString((LPCTSTR)p) + _T(" loaded successfully"), 3000); - return; - } - } - - m_wndPlaylistBar.Open(sl, true); - OpenCurPlaylistItem(); -} - -void CMainFrame::OnFileSaveAs() -{ - CString ext, in = m_wndPlaylistBar.GetCur(), out = in; - - if(out.Find(_T("://")) < 0) - { - ext = CString(CPath(out).GetExtension()).MakeLower(); - if(ext == _T(".cda")) out = out.Left(out.GetLength()-4) + _T(".wav"); - else if(ext == _T(".ifo")) out = out.Left(out.GetLength()-4) + _T(".vob"); - } - else - { - out.Empty(); - } - - CFileDialog fd(FALSE, 0, out, - OFN_EXPLORER|OFN_ENABLESIZING|OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT|OFN_PATHMUSTEXIST, - _T("All files (*.*)|*.*||"), this, 0); - if(fd.DoModal() != IDOK || !in.CompareNoCase(fd.GetPathName())) return; - - CPath p(fd.GetPathName()); - if(!ext.IsEmpty()) p.AddExtension(ext); - - OAFilterState fs = State_Stopped; - pMC->GetState(0, &fs); - if(fs == State_Running) pMC->Pause(); - - CSaveDlg dlg(in, p); - dlg.DoModal(); - - if(fs == State_Running) pMC->Run(); -} - -void CMainFrame::OnUpdateFileSaveAs(CCmdUI* pCmdUI) -{ - if(m_iMediaLoadState != MLS_LOADED || m_iPlaybackMode != PM_FILE) - { - pCmdUI->Enable(FALSE); - return; - } - - CString fn = m_wndPlaylistBar.GetCur(); - CString ext = fn.Mid(fn.ReverseFind('.')+1).MakeLower(); - - int i = fn.Find(_T("://")); - if(i >= 0) - { - CString protocol = fn.Left(i).MakeLower(); - if(protocol != _T("http")) - { - pCmdUI->Enable(FALSE); - return; - } - } - - if((GetVersion()&0x80000000) && (ext == _T("cda") || ext == _T("ifo"))) - { - pCmdUI->Enable(FALSE); - return; - } - - pCmdUI->Enable(TRUE); -} - -bool CMainFrame::GetDIB(BYTE** ppData, long& size, bool fSilent) -{ - if(!ppData) return false; - - *ppData = NULL; - size = 0; - - bool fNeedsToPause = !m_pCAP; - if(fNeedsToPause) fNeedsToPause = !IsVMR7InGraph(pGB); - if(fNeedsToPause) fNeedsToPause = !IsVMR9InGraph(pGB); - - OAFilterState fs = GetMediaState(); - - if(!(m_iMediaLoadState == MLS_LOADED && !m_fAudioOnly && (fs == State_Paused || fs == State_Running))) - return false; - - if(fs == State_Running && fNeedsToPause) - { - pMC->Pause(); - GetMediaState(); // wait for completion of the pause command - } - - HRESULT hr = S_OK; - CString errmsg; - - do - { - if(m_pCAP) - { - hr = m_pCAP->GetDIB(NULL, (DWORD*)&size); - if(FAILED(hr)) - { - OnPlayPause();GetMediaState(); // Pause and retry to support ffdshow queueing. - int retry = 0; - while(FAILED(hr) && retry < 20) - { - hr = m_pCAP->GetDIB(*ppData, (DWORD*)&size); - if(SUCCEEDED(hr)) break; - Sleep(1); - retry++; - } - if(FAILED(hr)) - {errmsg.Format(_T("GetDIB failed, hr = %08x"), hr); break;} - } - - if(!(*ppData = new BYTE[size])) return false; - - hr = m_pCAP->GetDIB(*ppData, (DWORD*)&size); - if(FAILED(hr)) {errmsg.Format(_T("GetDIB failed, hr = %08x"), hr); break;} - } - else - { - hr = pBV->GetCurrentImage(&size, NULL); - if(FAILED(hr) || size == 0) {errmsg.Format(_T("GetCurrentImage failed, hr = %08x"), hr); break;} - - if(!(*ppData = new BYTE[size])) return false; - - hr = pBV->GetCurrentImage(&size, (long*)*ppData); - if(FAILED(hr)) {errmsg.Format(_T("GetCurrentImage failed, hr = %08x"), hr); break;} - } - } - while(0); - - if(!fSilent) - { - if(!errmsg.IsEmpty()) - { - AfxMessageBox(errmsg, MB_OK); - } - } - - if(fs == State_Running && GetMediaState() != State_Running) - { - pMC->Run(); - } - - if(FAILED(hr)) - { - if(*ppData) {ASSERT(0); delete [] *ppData; *ppData = NULL;} // huh? - return false; - } - - return true; -} - -#include "jpeg.h" -#include "pngdib.h" - -void CMainFrame::SaveDIB(LPCTSTR fn, BYTE* pData, long size) -{ - CString ext = CString(CPath(fn).GetExtension()).MakeLower(); - - if(ext == _T(".bmp")) - { - if(FILE* f = _tfopen(fn, _T("wb"))) - { - BITMAPINFO* bi = (BITMAPINFO*)pData; - - BITMAPFILEHEADER bfh; - bfh.bfType = 'MB'; - bfh.bfOffBits = sizeof(bfh) + sizeof(bi->bmiHeader); - bfh.bfSize = sizeof(bfh) + size; - bfh.bfReserved1 = bfh.bfReserved2 = 0; - - if(bi->bmiHeader.biBitCount <= 8) - { - if(bi->bmiHeader.biClrUsed) bfh.bfOffBits += bi->bmiHeader.biClrUsed * sizeof(bi->bmiColors[0]); - else bfh.bfOffBits += (1 << bi->bmiHeader.biBitCount) * sizeof(bi->bmiColors[0]); - } - - fwrite(&bfh, 1, sizeof(bfh), f); - fwrite(pData, 1, size, f); - - fclose(f); - } - else - { - AfxMessageBox(_T("Cannot create file"), MB_OK); - } - } - else if(ext == _T(".png")) - { - DWORD bmpsize = size; - LPBITMAPINFOHEADER pdib; - LPBITMAPFILEHEADER pbmfh; - void *pbits; - PNGDIB *pngdib; - int ret; - - BITMAPINFO* bi = (BITMAPINFO*)pData; - - BITMAPFILEHEADER bfh; - bfh.bfType = 'MB'; - bfh.bfOffBits = sizeof(bfh) + sizeof(bi->bmiHeader); - bfh.bfSize = sizeof(bfh) + size; - bfh.bfReserved1 = bfh.bfReserved2 = 0; - - if(bi->bmiHeader.biBitCount <= 8) - { - if(bi->bmiHeader.biClrUsed) bfh.bfOffBits += bi->bmiHeader.biClrUsed * sizeof(bi->bmiColors[0]); - else bfh.bfOffBits += (1 << bi->bmiHeader.biBitCount) * sizeof(bi->bmiColors[0]); - } - pbmfh = (LPBITMAPFILEHEADER)&bfh; - pbits = &pData[pbmfh->bfOffBits-sizeof(bfh)]; - pdib = (LPBITMAPINFOHEADER)pData; - pngdib = pngdib_d2p_init(); - pngdib_d2p_set_dib(pngdib,pdib,bmpsize,pbits,0); - pngdib_d2p_set_png_filename(pngdib, fn); - pngdib_d2p_set_gamma_label(pngdib, 1, PNGDIB_DEFAULT_FILE_GAMMA); - ret = pngdib_d2p_run(pngdib); - pngdib_done(pngdib); - if(ret) { - CString err_str; - err_str.Format(_T("%s\n%s (%d)"), "Cannot create file", pngdib_get_error_msg(pngdib), ret); - AfxMessageBox(err_str, MB_OK); - } - } - else if(ext == _T(".jpg")) - { - CJpegEncoderFile(fn).Encode(pData); - } - - CPath p(fn); - - if(CDC* pDC = m_wndStatusBar.m_status.GetDC()) - { - CRect r; - m_wndStatusBar.m_status.GetClientRect(r); - p.CompactPath(pDC->m_hDC, r.Width()); - m_wndStatusBar.m_status.ReleaseDC(pDC); - } - - SendStatusMessage((LPCTSTR)p, 3000); -} - -void CMainFrame::SaveImage(LPCTSTR fn) -{ - BYTE* pData = NULL; - long size = 0; - - if(GetDIB(&pData, size)) - { - SaveDIB(fn, pData, size); - delete [] pData; - } -} - -void CMainFrame::SaveThumbnails(LPCTSTR fn) -{ - if(!pMC || !pMS || m_iPlaybackMode != PM_FILE /*&& m_iPlaybackMode != PM_DVD*/) - return; - - REFERENCE_TIME rtPos = GetPos(); - REFERENCE_TIME rtDur = GetDur(); - - if(rtDur <= 0) - { - AfxMessageBox(_T("Cannot create thumbnails for files with no duration")); - return; - } - - pMC->Pause(); - GetMediaState(); // wait for completion of the pause command - - // - - CSize video, wh(0, 0), arxy(0, 0); - - if(m_pCAP) - { - wh = m_pCAP->GetVideoSize(false); - arxy = m_pCAP->GetVideoSize(true); - } - else - { - pBV->GetVideoSize(&wh.cx, &wh.cy); - - long arx = 0, ary = 0; - CComQIPtr pBV2 = pBV; - if(pBV2 && SUCCEEDED(pBV2->GetPreferredAspectRatio(&arx, &ary)) && arx > 0 && ary > 0) - arxy.SetSize(arx, ary); - } - - if(wh.cx <= 0 || wh.cy <= 0) - { - AfxMessageBox(_T("Failed to get video frame size")); - return; - } - - // with the overlay mixer IBasicVideo2 won't tell the new AR when changed dynamically - DVD_VideoAttributes VATR; - if(m_iPlaybackMode == PM_DVD && SUCCEEDED(pDVDI->GetCurrentVideoAttributes(&VATR))) - arxy.SetSize(VATR.ulAspectX, VATR.ulAspectY); - - video = (arxy.cx <= 0 || arxy.cy <= 0) ? wh : CSize(MulDiv(wh.cy, arxy.cx, arxy.cy), wh.cy); - - // - - AppSettings& s = AfxGetAppSettings(); - - int cols = max(1, min(8, s.ThumbCols)); - int rows = max(1, min(8, s.ThumbRows)); - - int margin = 5; - int infoheight = 70; - int width = max(256, min(2048, s.ThumbWidth)); - int height = width * video.cy / video.cx * rows / cols + infoheight; - - int dibsize = sizeof(BITMAPINFOHEADER) + width*height*4; - - CAutoVectorPtr dib; - if(!dib.Allocate(dibsize)) - { - AfxMessageBox(_T("Out of memory, go buy some more!")); - return; - } - - BITMAPINFOHEADER* bih = (BITMAPINFOHEADER*)(BYTE*)dib; - memset(bih, 0, sizeof(BITMAPINFOHEADER)); - bih->biSize = sizeof(BITMAPINFOHEADER); - bih->biWidth = width; - bih->biHeight = height; - bih->biPlanes = 1; - bih->biBitCount = 32; - bih->biCompression = BI_RGB; - bih->biSizeImage = width*height*4; - memsetd(bih + 1, 0xffffff, bih->biSizeImage); - - SubPicDesc spd; - spd.w = width; - spd.h = height; - spd.bpp = 32; - spd.pitch = -width*4; - spd.bits = (BYTE*)(bih + 1) + (width*4)*(height-1); - - { - BYTE* p = (BYTE*)spd.bits; - for(int y = 0; y < spd.h; y++, p += spd.pitch) - for(int x = 0; x < spd.w; x++) - ((DWORD*)p)[x] = 0x010101 * (0xe0 + 0x08*y/spd.h + 0x18*(spd.w-x)/spd.w); - } - - CCritSec csSubLock; - RECT bbox; - - for(int i = 1, pics = cols*rows; i <= pics; i++) - { - REFERENCE_TIME rt = rtDur * i / (pics+1); - DVD_HMSF_TIMECODE hmsf = RT2HMSF(rt, 25); - - SeekTo(rt); - - m_VolumeBeforeFrameStepping = m_wndToolBar.Volume; - pBA->put_Volume(-10000); - - HRESULT hr = pFS ? pFS->Step(1, NULL) : E_FAIL; - - if(FAILED(hr)) - { - pBA->put_Volume(m_VolumeBeforeFrameStepping); - AfxMessageBox(_T("Cannot frame step, try a different video renderer.")); - return; - } - - HANDLE hGraphEvent = NULL; - pME->GetEventHandle((OAEVENT*)&hGraphEvent); - - while(hGraphEvent && WaitForSingleObject(hGraphEvent, INFINITE) == WAIT_OBJECT_0) - { - LONG evCode = 0, evParam1, evParam2; - while(SUCCEEDED(pME->GetEvent(&evCode, (LONG_PTR*)&evParam1, (LONG_PTR*)&evParam2, 0))) - { - pME->FreeEventParams(evCode, evParam1, evParam2); - if(EC_STEP_COMPLETE == evCode) hGraphEvent = NULL; - } - } - - pBA->put_Volume(m_VolumeBeforeFrameStepping); - - int col = (i-1)%cols; - int row = (i-1)/cols; - - CSize s((width-margin*2)/cols, (height-margin*2-infoheight)/rows); - CPoint p(margin+col*s.cx, margin+row*s.cy+infoheight); - CRect r(p, s); - r.DeflateRect(margin, margin); - - CRenderedTextSubtitle rts(&csSubLock); - rts.CreateDefaultStyle(0); - rts.m_dstScreenSize.SetSize(width, height); - STSStyle* style = new STSStyle(); - style->marginRect.SetRectEmpty(); - rts.AddStyle(_T("thumbs"), style); - - CStringW str; - str.Format(L"{\\an7\\1c&Hffffff&\\4a&Hb0&\\bord1\\shad4\\be1}{\\p1}m %d %d l %d %d %d %d %d %d{\\p}", - r.left, r.top, r.right, r.top, r.right, r.bottom, r.left, r.bottom); - rts.Add(str, true, 0, 1, _T("thumbs")); - str.Format(L"{\\an3\\1c&Hffffff&\\3c&H000000&\\alpha&H80&\\fs16\\b1\\bord2\\shad0\\pos(%d,%d)}%02d:%02d:%02d", - r.right-5, r.bottom-3, hmsf.bHours, hmsf.bMinutes, hmsf.bSeconds); - rts.Add(str, true, 1, 2, _T("thumbs")); - - rts.Render(spd, 0, 25, bbox); - - BYTE* pData = NULL; - long size = 0; - if(!GetDIB(&pData, size)) return; - - BITMAPINFO* bi = (BITMAPINFO*)pData; - - if(bi->bmiHeader.biBitCount != 32) - { - delete [] pData; - CString str; - str.Format(_T("Invalid image format, cannot create thumbnails out of %d bpp dibs."), bi->bmiHeader.biBitCount); - AfxMessageBox(str); - return; - } - - int sw = bi->bmiHeader.biWidth; - int sh = abs(bi->bmiHeader.biHeight); - int sp = sw*4; - const BYTE* src = pData + sizeof(bi->bmiHeader); - if(bi->bmiHeader.biHeight >= 0) {src += sp*(sh-1); sp = -sp;} - - int dw = spd.w; - int dh = spd.h; - int dp = spd.pitch; - BYTE* dst = (BYTE*)spd.bits + spd.pitch*r.top + r.left*4; - - for(DWORD h = r.bottom - r.top, y = 0, yd = (sh<<8)/h; h > 0; y += yd, h--) - { - DWORD yf = y&0xff; - DWORD yi = y>>8; - - DWORD* s0 = (DWORD*)(src + yi*sp); - DWORD* s1 = (DWORD*)(src + yi*sp + sp); - DWORD* d = (DWORD*)dst; - - for(DWORD w = r.right - r.left, x = 0, xd = (sw<<8)/w; w > 0; x += xd, w--) - { - DWORD xf = x&0xff; - DWORD xi = x>>8; - - DWORD c0 = s0[xi]; - DWORD c1 = s0[xi+1]; - DWORD c2 = s1[xi]; - DWORD c3 = s1[xi+1]; - - c0 = ((c0&0xff00ff) + ((((c1&0xff00ff) - (c0&0xff00ff)) * xf) >> 8)) & 0xff00ff - | ((c0&0x00ff00) + ((((c1&0x00ff00) - (c0&0x00ff00)) * xf) >> 8)) & 0x00ff00; - - c2 = ((c2&0xff00ff) + ((((c3&0xff00ff) - (c2&0xff00ff)) * xf) >> 8)) & 0xff00ff - | ((c2&0x00ff00) + ((((c3&0x00ff00) - (c2&0x00ff00)) * xf) >> 8)) & 0x00ff00; - - c0 = ((c0&0xff00ff) + ((((c2&0xff00ff) - (c0&0xff00ff)) * yf) >> 8)) & 0xff00ff - | ((c0&0x00ff00) + ((((c2&0x00ff00) - (c0&0x00ff00)) * yf) >> 8)) & 0x00ff00; - - *d++ = c0; - } - - dst += dp; - } - - rts.Render(spd, 10000, 25, bbox); - - delete [] pData; - } - - { - CRenderedTextSubtitle rts(&csSubLock); - rts.CreateDefaultStyle(0); - rts.m_dstScreenSize.SetSize(width, height); - STSStyle* style = new STSStyle(); - style->marginRect.SetRect(margin*2, margin*2, margin*2, height-infoheight-margin); - rts.AddStyle(_T("thumbs"), style); - - CStringW str; - str.Format(L"{\\an9\\fs%d\\b1\\bord0\\shad0\\1c&Hffffff&}%s", infoheight-10, width >= 550 ? L"Media Player Classic" : L"MPC"); - - rts.Add(str, true, 0, 1, _T("thumbs"), _T(""), _T(""), CRect(0,0,0,0), -1); - - DVD_HMSF_TIMECODE hmsf = RT2HMSF(rtDur, 25); - - CPath path(m_wndPlaylistBar.GetCur()); - path.StripPath(); - CStringW fn = (LPCTSTR)path; - - CStringW fs; - WIN32_FIND_DATA wfd; - HANDLE hFind = FindFirstFile(m_wndPlaylistBar.GetCur(), &wfd); - if(hFind != INVALID_HANDLE_VALUE) - { - FindClose(hFind); - - __int64 size = (__int64(wfd.nFileSizeHigh)<<32)|wfd.nFileSizeLow; - __int64 shortsize = size; - CStringW measure = _T("B"); - if(shortsize > 10240) shortsize /= 1024, measure = L"KB"; - if(shortsize > 10240) shortsize /= 1024, measure = L"MB"; - if(shortsize > 10240) shortsize /= 1024, measure = L"GB"; - fs.Format(L"File Size: %I64d%s (%I64d bytes)\\N", shortsize, measure, size); - } - - CStringW ar; - if(arxy.cx > 0 && arxy.cy > 0 && arxy.cx != wh.cx && arxy.cy != wh.cy) - ar.Format(L"(%d:%d)", arxy.cx, arxy.cy); - - str.Format(L"{\\an7\\1c&H000000&\\fs16\\b0\\bord0\\shad0}File Name: %s\\N%sResolution: %dx%d %s\\NDuration: %02d:%02d:%02d", - fn, fs, wh.cx, wh.cy, ar, hmsf.bHours, hmsf.bMinutes, hmsf.bSeconds); - rts.Add(str, true, 0, 1, _T("thumbs")); - - rts.Render(spd, 0, 25, bbox); - } - - SaveDIB(fn, (BYTE*)dib, dibsize); - - SeekTo(rtPos); -} - -static CString MakeSnapshotFileName(LPCTSTR prefix) -{ - CTime t = CTime::GetCurrentTime(); - CString fn; - fn.Format(_T("%s%s%s"), prefix, t.Format(_T("%Y%m%d%H%M%S")), AfxGetAppSettings().SnapShotExt); - return fn; -} - -BOOL CMainFrame::IsRendererCompatibleWithSaveImage() -{ - BOOL result = TRUE; - AppSettings& s = AfxGetAppSettings(); - - if(m_fRealMediaGraph) { - if(s.iRMVideoRendererType == VIDRNDT_RM_DEFAULT) { - AfxMessageBox(_T("The 'Save Image' and 'Save Thumbnails' functions do not work with the default video renderer for RealMedia.\nSelect one of the DirectX renderers for RealMedia in MPC's output options and reopen the file.")); - result = FALSE; - } - } else { - if(m_fQuicktimeGraph) { - if(s.iQTVideoRendererType == VIDRNDT_QT_DEFAULT) { - AfxMessageBox(_T("The 'Save Image and 'Save Thumbnails' functions do not work with the default video renderer for QuickTime.\nSelect one of the DirectX renderers for QuickTime in MPC's output options and reopen the file.")); - result = FALSE; - } - } else { - if(m_fShockwaveGraph) { - AfxMessageBox(_T("The 'Save Image' and 'Save Thumbnails' functions do not work for Shockwave files.")); - result = FALSE; - } else { - if(s.iDSVideoRendererType == VIDRNDT_DS_OVERLAYMIXER) { - AfxMessageBox(_T("The 'Save Image' and 'Save Thumbnails' functions do not work with the Overlay Mixer video renderer.\nChange the video renderer in MPC's output options and reopen the file.")); - result = FALSE; - } - } - } - } - return result; -} - -void CMainFrame::OnFileSaveImage() -{ - AppSettings& s = AfxGetAppSettings(); - - /* Check if a compatible renderer is being used */ - if(!IsRendererCompatibleWithSaveImage()) { - return; - } - - CPath psrc(s.SnapShotPath); - psrc.Combine(s.SnapShotPath, MakeSnapshotFileName(_T("snapshot"))); - - CFileDialog fd(FALSE, 0, (LPCTSTR)psrc, - OFN_EXPLORER|OFN_ENABLESIZING|OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT|OFN_PATHMUSTEXIST, - _T("Bitmaps (*.bmp)|*.bmp|Jpeg (*.jpg)|*.jpg|Png (*.png)|*.png||"), this, 0); - - if(s.SnapShotExt == _T(".bmp")) fd.m_pOFN->nFilterIndex = 1; - else if(s.SnapShotExt == _T(".jpg")) fd.m_pOFN->nFilterIndex = 2; - else if(s.SnapShotExt == _T(".png")) fd.m_pOFN->nFilterIndex = 3; - - if(fd.DoModal() != IDOK) return; - - if(fd.m_pOFN->nFilterIndex == 1) s.SnapShotExt = _T(".bmp"); - else if(fd.m_pOFN->nFilterIndex == 2) s.SnapShotExt = _T(".jpg"); - else if(fd.m_pOFN->nFilterIndex = 3) s.SnapShotExt = _T(".png"); - - CPath pdst(fd.GetPathName()); - if(pdst.GetExtension().MakeLower() != s.SnapShotExt) pdst = CPath((LPCTSTR)pdst + s.SnapShotExt); - CString path = (LPCTSTR)pdst; - pdst.RemoveFileSpec(); - s.SnapShotPath = (LPCTSTR)pdst; - - SaveImage(path); -} - -void CMainFrame::OnFileSaveImageAuto() -{ - AppSettings& s = AfxGetAppSettings(); - - /* Check if a compatible renderer is being used */ - if(!IsRendererCompatibleWithSaveImage()) { - return; - } - - CString fn; - fn.Format(_T("%s\\%s"), AfxGetAppSettings().SnapShotPath, MakeSnapshotFileName(_T("snapshot"))); - SaveImage(fn); -} - -void CMainFrame::OnUpdateFileSaveImage(CCmdUI* pCmdUI) -{ - OAFilterState fs = GetMediaState(); - pCmdUI->Enable(m_iMediaLoadState == MLS_LOADED && !m_fAudioOnly && (fs == State_Paused || fs == State_Running)); -} - -void CMainFrame::OnFileSaveThumbnails() -{ - AppSettings& s = AfxGetAppSettings(); - - /* Check if a compatible renderer is being used */ - if(!IsRendererCompatibleWithSaveImage()) { - return; - } - - CPath psrc(s.SnapShotPath); - psrc.Combine(s.SnapShotPath, MakeSnapshotFileName(_T("thumbs"))); - - CSaveThumbnailsDialog fd( - s.ThumbRows, s.ThumbCols, s.ThumbWidth, - 0, (LPCTSTR)psrc, - _T("Bitmaps (*.bmp)|*.bmp|Jpeg (*.jpg)|*.jpg|Png (*.png)|*.png||"), this); - - if(s.SnapShotExt == _T(".bmp")) fd.m_pOFN->nFilterIndex = 1; - else if(s.SnapShotExt == _T(".jpg")) fd.m_pOFN->nFilterIndex = 2; - else if(s.SnapShotExt == _T(".png")) fd.m_pOFN->nFilterIndex = 3; - - if(fd.DoModal() != IDOK) return; - - if(fd.m_pOFN->nFilterIndex == 1) s.SnapShotExt = _T(".bmp"); - else if(fd.m_pOFN->nFilterIndex == 2) s.SnapShotExt = _T(".jpg"); - else if(fd.m_pOFN->nFilterIndex = 3) s.SnapShotExt = _T(".png"); - - s.ThumbRows = fd.m_rows; - s.ThumbCols = fd.m_cols; - s.ThumbWidth = fd.m_width; - - CPath pdst(fd.GetPathName()); - if(pdst.GetExtension().MakeLower() != s.SnapShotExt) pdst = CPath((LPCTSTR)pdst + s.SnapShotExt); - CString path = (LPCTSTR)pdst; - pdst.RemoveFileSpec(); - s.SnapShotPath = (LPCTSTR)pdst; - - SaveThumbnails(path); -} - -void CMainFrame::OnUpdateFileSaveThumbnails(CCmdUI* pCmdUI) -{ - OAFilterState fs = GetMediaState(); - pCmdUI->Enable(m_iMediaLoadState == MLS_LOADED && !m_fAudioOnly && (m_iPlaybackMode == PM_FILE /*|| m_iPlaybackMode == PM_DVD*/)); -} - -void CMainFrame::OnFileConvert() -{ - CConvertDlg().DoModal(); -} - -void CMainFrame::OnUpdateFileConvert(CCmdUI* pCmdUI) -{ - // TODO: Add your command update UI handler code here -} - -void CMainFrame::OnFileLoadsubtitle() -{ -#ifndef DEBUG - if(!m_pCAP) - { - AfxMessageBox(_T("To load subtitles you have change the video renderer and reopen the file.\n") - _T("- DirectShow: VMR7/VMR9(renderless) or Haali Video Renderer\n") - _T("- RealMedia: Special renderer for RealMedia, or open it through DirectShow\n") - _T("- Quicktime: DX7 or DX9 renderer for QuickTime\n") - , MB_OK); - return; - } -#endif - static TCHAR BASED_CODE szFilter[] = - _T(".srt .sub .ssa .ass .smi .psb .txt .idx .usf .xss .ssf|") - _T("*.srt;*.sub;*.ssa;*.ass;*smi;*.psb;*.txt;*.idx;*.usf;*.xss;*.ssf|") - _T("All files (*.*)|") - _T("*.*||"); - - CFileDialog fd(TRUE, NULL, NULL, - OFN_EXPLORER | OFN_ENABLESIZING | OFN_HIDEREADONLY, - szFilter, this, 0); - - if(fd.DoModal() != IDOK) return; - - if(LoadSubtitle(fd.GetPathName())) - SetSubtitle(m_pSubStreams.GetTail()); -} - -void CMainFrame::OnUpdateFileLoadsubtitle(CCmdUI *pCmdUI) -{ -#ifdef DEBUG - pCmdUI->Enable(); -#else - pCmdUI->Enable(m_iMediaLoadState == MLS_LOADED && /*m_pCAP &&*/ !m_fAudioOnly); -#endif -} - -void CMainFrame::OnFileSavesubtitle() -{ - int i = m_iSubtitleSel; - - POSITION pos = m_pSubStreams.GetHeadPosition(); - while(pos && i >= 0) - { - CComPtr pSubStream = m_pSubStreams.GetNext(pos); - - if(i < pSubStream->GetStreamCount()) - { - CLSID clsid; - if(FAILED(pSubStream->GetClassID(&clsid))) - continue; - - if(clsid == __uuidof(CVobSubFile)) - { - CVobSubFile* pVSF = (CVobSubFile*)(ISubStream*)pSubStream; - - CFileDialog fd(FALSE, NULL, NULL, - OFN_EXPLORER|OFN_ENABLESIZING|OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT|OFN_PATHMUSTEXIST, - _T("VobSub (*.idx, *.sub)|*.idx;*.sub||"), this, 0); - - if(fd.DoModal() == IDOK) - { - CAutoLock cAutoLock(&m_csSubLock); - pVSF->Save(fd.GetPathName()); - } - - return; - } - else if(clsid == __uuidof(CRenderedTextSubtitle)) - { - CRenderedTextSubtitle* pRTS = (CRenderedTextSubtitle*)(ISubStream*)pSubStream; - - CString filter; - filter += _T("Subripper (*.srt)|*.srt|"); - filter += _T("Microdvd (*.sub)|*.sub|"); - filter += _T("Sami (*.smi)|*.smi|"); - filter += _T("Psb (*.psb)|*.psb|"); - filter += _T("Sub Station Alpha (*.ssa)|*.ssa|"); - filter += _T("Advanced Sub Station Alpha (*.ass)|*.ass|"); - filter += _T("|"); - - CSaveTextFileDialog fd(pRTS->m_encoding, NULL, NULL, filter, this); - - if(fd.DoModal() == IDOK) - { - CAutoLock cAutoLock(&m_csSubLock); - pRTS->SaveAs(fd.GetPathName(), (exttype)(fd.m_ofn.nFilterIndex-1), m_pCAP->GetFPS(), fd.GetEncoding()); - } - - return; - } - } - - i -= pSubStream->GetStreamCount(); - } -} - -void CMainFrame::OnUpdateFileSavesubtitle(CCmdUI* pCmdUI) -{ - pCmdUI->Enable(m_iSubtitleSel >= 0); -} - -/////////////// - -#include "SubtitleDlDlg.h" -#include "ISDb.h" - -void CMainFrame::OnFileISDBSearch() -{ - CStringA url = "http://" + AfxGetAppSettings().ISDb + "/index.php?"; - CStringA args = makeargs(m_wndPlaylistBar.m_pl); - ShellExecute(m_hWnd, _T("open"), CString(url+args), NULL, NULL, SW_SHOWDEFAULT); -} - -void CMainFrame::OnUpdateFileISDBSearch(CCmdUI *pCmdUI) -{ - pCmdUI->Enable(TRUE); -} - -void CMainFrame::OnFileISDBUpload() -{ - CStringA url = "http://" + AfxGetAppSettings().ISDb + "/ul.php?"; - CStringA args = makeargs(m_wndPlaylistBar.m_pl); - ShellExecute(m_hWnd, _T("open"), CString(url+args), NULL, NULL, SW_SHOWDEFAULT); -} - -void CMainFrame::OnUpdateFileISDBUpload(CCmdUI *pCmdUI) -{ - pCmdUI->Enable(m_wndPlaylistBar.GetCount() > 0); -} - -void CMainFrame::OnFileISDBDownload() -{ - filehash fh; - if(!hash(m_wndPlaylistBar.GetCur(), fh)) - { - MessageBeep(-1); - return; - } - - // TODO: put this on a worker thread - - CStringA url = "http://" + AfxGetAppSettings().ISDb + "/index.php?"; - CStringA args; - args.Format("player=mpc&name[0]=%s&size[0]=%016I64x&hash[0]=%016I64x", - UrlEncode(CStringA(fh.name)), fh.size, fh.hash); - - try - { - CInternetSession is; - - CStringA str; - if(!OpenUrl(is, CString(url+args), str)) - { - MessageBeep(-1); - return; - } - - CStringA ticket; - CList movies; - isdb_movie m; - isdb_subtitle s; - - CAtlList sl; - Explode(str, sl, '\n'); - - POSITION pos = sl.GetHeadPosition(); - while(pos) - { - str = sl.GetNext(pos); - - CStringA param = str.Left(max(0, str.Find('='))); - CStringA value = str.Mid(str.Find('=')+1); - - if(param == "ticket") ticket = value; - else if(param == "movie") {m.reset(); Explode(value, m.titles, '|');} - else if(param == "subtitle") {s.reset(); s.id = atoi(value);} - else if(param == "name") s.name = value; - else if(param == "discs") s.discs = atoi(value); - else if(param == "disc_no") s.disc_no = atoi(value); - else if(param == "format") s.format = value; - else if(param == "iso639_2") s.iso639_2 = value; - else if(param == "language") s.language = value; - else if(param == "nick") s.nick = value; - else if(param == "email") s.email = value; - else if(param == "" && value == "endsubtitle") {m.subs.AddTail(s);} - else if(param == "" && value == "endmovie") {movies.AddTail(m);} - else if(param == "" && value == "end") break; - } - - CSubtitleDlDlg dlg(movies, this); - if(IDOK == dlg.DoModal()) - { - if(dlg.m_fReplaceSubs) - m_pSubStreams.RemoveAll(); - - CComPtr pSubStreamToSet; - - POSITION pos = dlg.m_selsubs.GetHeadPosition(); - while(pos) - { - isdb_subtitle& s = dlg.m_selsubs.GetNext(pos); - - CStringA url = "http://" + AfxGetAppSettings().ISDb + "/dl.php?"; - CStringA args; - args.Format("id=%d&ticket=%s", s.id, UrlEncode(ticket)); - - if(OpenUrl(is, CString(url+args), str)) - { - CAutoPtr pRTS(new CRenderedTextSubtitle(&m_csSubLock)); - if(pRTS && pRTS->Open((BYTE*)(LPCSTR)str, str.GetLength(), DEFAULT_CHARSET, CString(s.name)) && pRTS->GetStreamCount() > 0) - { - CComPtr pSubStream = pRTS.Detach(); - m_pSubStreams.AddTail(pSubStream); - if(!pSubStreamToSet) pSubStreamToSet = pSubStream; - } - } - } - - if(pSubStreamToSet) - SetSubtitle(pSubStreamToSet); - } - } - catch(CInternetException* ie) - { - ie->Delete(); - return; - } -} - -void CMainFrame::OnUpdateFileISDBDownload(CCmdUI *pCmdUI) -{ - pCmdUI->Enable(m_iMediaLoadState == MLS_LOADED && m_pCAP && !m_fAudioOnly); -} - -void CMainFrame::OnFileProperties() -{ - CPPageFileInfoSheet m_fileinfo(m_wndPlaylistBar.GetCur(), this); - m_fileinfo.DoModal(); -} - -void CMainFrame::OnUpdateFileProperties(CCmdUI* pCmdUI) -{ - pCmdUI->Enable(m_iMediaLoadState == MLS_LOADED && m_iPlaybackMode == PM_FILE); -} - -void CMainFrame::OnFileCloseMedia() -{ - CloseMedia(); -} - -void CMainFrame::OnFileClosePlaylist() -{ - SendMessage(WM_COMMAND, ID_FILE_CLOSEMEDIA); - RestoreDefaultWindowRect(); -} - -void CMainFrame::OnUpdateFileClose(CCmdUI* pCmdUI) -{ - pCmdUI->Enable(m_iMediaLoadState == MLS_LOADED || m_iMediaLoadState == MLS_LOADING); -} - -// view - -void CMainFrame::OnViewCaptionmenu() -{ - bool fHideCaptionMenu = AfxGetAppSettings().fHideCaptionMenu; - - AfxGetAppSettings().fHideCaptionMenu = !fHideCaptionMenu; - - if(m_fFullScreen) return; - - DWORD dwRemove = 0, dwAdd = 0; - HMENU hMenu; - - if(!fHideCaptionMenu) - { - dwRemove = WS_CAPTION; - hMenu = NULL; - } - else - { - dwAdd = WS_CAPTION; - hMenu = m_hMenuDefault; - } - - ModifyStyle(dwRemove, dwAdd, SWP_NOZORDER); - ::SetMenu(m_hWnd, hMenu); - SetWindowPos(NULL, 0, 0, 0, 0, SWP_FRAMECHANGED|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER); - - MoveVideoWindow(); -} - -void CMainFrame::OnUpdateViewCaptionmenu(CCmdUI* pCmdUI) -{ - pCmdUI->SetCheck(!AfxGetAppSettings().fHideCaptionMenu); -} - -void CMainFrame::OnViewControlBar(UINT nID) -{ - nID -= ID_VIEW_SEEKER; - ShowControls(AfxGetAppSettings().nCS ^ (1<m_nID - ID_VIEW_SEEKER; - pCmdUI->SetCheck(!!(AfxGetAppSettings().nCS & (1<SetCheck(m_wndSubresyncBar.IsWindowVisible()); - pCmdUI->Enable(m_pCAP && m_iSubtitleSel >= 0); -} - -void CMainFrame::OnViewPlaylist() -{ - ShowControlBar(&m_wndPlaylistBar, !m_wndPlaylistBar.IsWindowVisible(), TRUE); -} - -void CMainFrame::OnUpdateViewPlaylist(CCmdUI* pCmdUI) -{ - pCmdUI->SetCheck(m_wndPlaylistBar.IsWindowVisible()); - pCmdUI->Enable(m_iMediaLoadState == MLS_CLOSED && m_iMediaLoadState != MLS_LOADED - || m_iMediaLoadState == MLS_LOADED /*&& (m_iPlaybackMode == PM_FILE || m_iPlaybackMode == PM_CAPTURE)*/); -} - -void CMainFrame::OnViewCapture() -{ - ShowControlBar(&m_wndCaptureBar, !m_wndCaptureBar.IsWindowVisible(), TRUE); -} - -void CMainFrame::OnUpdateViewCapture(CCmdUI* pCmdUI) -{ - pCmdUI->SetCheck(m_wndCaptureBar.IsWindowVisible()); - pCmdUI->Enable(m_iMediaLoadState == MLS_LOADED && m_iPlaybackMode == PM_CAPTURE); -} - -void CMainFrame::OnViewShaderEditor() -{ - ShowControlBar(&m_wndShaderEditorBar, !m_wndShaderEditorBar.IsWindowVisible(), TRUE); -} - -void CMainFrame::OnUpdateViewShaderEditor(CCmdUI* pCmdUI) -{ - pCmdUI->SetCheck(m_wndShaderEditorBar.IsWindowVisible()); - pCmdUI->Enable(TRUE); -} - -void CMainFrame::OnViewMinimal() -{ - if(!AfxGetAppSettings().fHideCaptionMenu) - SendMessage(WM_COMMAND, ID_VIEW_CAPTIONMENU); - ShowControls(0); -} - -void CMainFrame::OnUpdateViewMinimal(CCmdUI* pCmdUI) -{ -} - -void CMainFrame::OnViewCompact() -{ - if(AfxGetAppSettings().fHideCaptionMenu) - SendMessage(WM_COMMAND, ID_VIEW_CAPTIONMENU); - ShowControls(CS_TOOLBAR); -} - -void CMainFrame::OnUpdateViewCompact(CCmdUI* pCmdUI) -{ -} - -void CMainFrame::OnViewNormal() -{ - if(AfxGetAppSettings().fHideCaptionMenu) - SendMessage(WM_COMMAND, ID_VIEW_CAPTIONMENU); - ShowControls(CS_SEEKBAR|CS_TOOLBAR|CS_STATUSBAR|CS_INFOBAR); -} - -void CMainFrame::OnUpdateViewNormal(CCmdUI* pCmdUI) -{ -} - -void CMainFrame::OnViewFullscreen() -{ - ToggleFullscreen(true, true); -} - -void CMainFrame::OnViewFullscreenSecondary() -{ - ToggleFullscreen(true, false); -} - -void CMainFrame::OnUpdateViewFullscreen(CCmdUI* pCmdUI) -{ - pCmdUI->Enable(m_iMediaLoadState == MLS_LOADED && !m_fAudioOnly || m_fFullScreen); - pCmdUI->SetCheck(m_fFullScreen); -} - -void CMainFrame::OnViewZoom(UINT nID) -{ - ZoomVideoWindow(nID == ID_VIEW_ZOOM_50 ? 0.5 : nID == ID_VIEW_ZOOM_200 ? 2.0 : 1.0); -} - -void CMainFrame::OnUpdateViewZoom(CCmdUI* pCmdUI) -{ - pCmdUI->Enable(m_iMediaLoadState == MLS_LOADED && !m_fAudioOnly); -} - -void CMainFrame::OnViewZoomAutoFit() -{ - ZoomVideoWindow(GetZoomAutoFitScale()); -} - -void CMainFrame::OnViewDefaultVideoFrame(UINT nID) -{ - AfxGetAppSettings().iDefaultVideoSize = nID - ID_VIEW_VF_HALF; - m_ZoomX = m_ZoomY = 1; - m_PosX = m_PosY = 0.5; - MoveVideoWindow(); -} - -void CMainFrame::OnUpdateViewDefaultVideoFrame(CCmdUI* pCmdUI) -{ - pCmdUI->Enable(m_iMediaLoadState == MLS_LOADED && !m_fAudioOnly); - pCmdUI->SetRadio(AfxGetAppSettings().iDefaultVideoSize == (pCmdUI->m_nID - ID_VIEW_VF_HALF)); -} - -void CMainFrame::OnViewKeepaspectratio() -{ - AfxGetAppSettings().fKeepAspectRatio = !AfxGetAppSettings().fKeepAspectRatio; - MoveVideoWindow(); -} - -void CMainFrame::OnUpdateViewKeepaspectratio(CCmdUI* pCmdUI) -{ - pCmdUI->Enable(m_iMediaLoadState == MLS_LOADED && !m_fAudioOnly); - pCmdUI->SetCheck(AfxGetAppSettings().fKeepAspectRatio); -} - -void CMainFrame::OnViewCompMonDeskARDiff() -{ - AfxGetAppSettings().fCompMonDeskARDiff = !AfxGetAppSettings().fCompMonDeskARDiff; - MoveVideoWindow(); -} - -void CMainFrame::OnUpdateViewCompMonDeskARDiff(CCmdUI* pCmdUI) -{ - pCmdUI->Enable(m_iMediaLoadState == MLS_LOADED && !m_fAudioOnly); - pCmdUI->SetCheck(AfxGetAppSettings().fCompMonDeskARDiff); -} - -void CMainFrame::OnViewPanNScan(UINT nID) -{ - if(m_iMediaLoadState != MLS_LOADED) return; - - int x = 0, y = 0; - int dx = 0, dy = 0; - - switch(nID) - { - case ID_VIEW_RESET: m_ZoomX = m_ZoomY = 1.0; m_PosX = m_PosY = 0.5; m_AngleX = m_AngleY = m_AngleZ = 0; break; - case ID_VIEW_INCSIZE: x = y = 1; break; - case ID_VIEW_DECSIZE: x = y = -1; break; - case ID_VIEW_INCWIDTH: x = 1; break; - case ID_VIEW_DECWIDTH: x = -1; break; - case ID_VIEW_INCHEIGHT: y = 1; break; - case ID_VIEW_DECHEIGHT: y = -1; break; - case ID_PANSCAN_CENTER: m_PosX = m_PosY = 0.5; break; - case ID_PANSCAN_MOVELEFT: dx = -1; break; - case ID_PANSCAN_MOVERIGHT: dx = 1; break; - case ID_PANSCAN_MOVEUP: dy = -1; break; - case ID_PANSCAN_MOVEDOWN: dy = 1; break; - case ID_PANSCAN_MOVEUPLEFT: dx = dy = -1; break; - case ID_PANSCAN_MOVEUPRIGHT: dx = 1; dy = -1; break; - case ID_PANSCAN_MOVEDOWNLEFT: dx = -1; dy = 1; break; - case ID_PANSCAN_MOVEDOWNRIGHT: dx = dy = 1; break; - default: break; - } - - if(x > 0 && m_ZoomX < 3) m_ZoomX *= 1.02; - if(x < 0 && m_ZoomX > 0.2) m_ZoomX /= 1.02; - if(y > 0 && m_ZoomY < 3) m_ZoomY *= 1.02; - if(y < 0 && m_ZoomY > 0.2) m_ZoomY /= 1.02; - - if(dx < 0 && m_PosX > 0) m_PosX = max(m_PosX - 0.005*m_ZoomX, 0); - if(dx > 0 && m_PosX < 1) m_PosX = min(m_PosX + 0.005*m_ZoomX, 1); - if(dy < 0 && m_PosY > 0) m_PosY = max(m_PosY - 0.005*m_ZoomY, 0); - if(dy > 0 && m_PosY < 1) m_PosY = min(m_PosY + 0.005*m_ZoomY, 1); - - MoveVideoWindow(true); -} - -void CMainFrame::OnUpdateViewPanNScan(CCmdUI* pCmdUI) -{ - pCmdUI->Enable(m_iMediaLoadState == MLS_LOADED && !m_fAudioOnly); -} - -void CMainFrame::OnViewPanNScanPresets(UINT nID) -{ - if(m_iMediaLoadState != MLS_LOADED) return; - - AppSettings& s = AfxGetAppSettings(); - - nID -= ID_PANNSCAN_PRESETS_START; - - if(nID == s.m_pnspresets.GetCount()) - { - CPnSPresetsDlg dlg; - dlg.m_pnspresets.Copy(s.m_pnspresets); - if(dlg.DoModal() == IDOK) - { - s.m_pnspresets.Copy(dlg.m_pnspresets); - s.UpdateData(true); - } - return; - } - - m_PosX = 0.5; - m_PosY = 0.5; - m_ZoomX = 1.0; - m_ZoomY = 1.0; - - CString str = s.m_pnspresets[nID]; - - int i = 0, j = 0; - for(CString token = str.Tokenize(_T(","), i); !token.IsEmpty(); token = str.Tokenize(_T(","), i), j++) - { - float f = 0; - if(_stscanf(token, _T("%f"), &f) != 1) continue; - - switch(j) - { - case 0: break; - case 1: m_PosX = f; break; - case 2: m_PosY = f; break; - case 3: m_ZoomX = f; break; - case 4: m_ZoomY = f; break; - default: break; - } - } - - if(j != 5) return; - - m_PosX = min(max(m_PosX, 0), 1); - m_PosY = min(max(m_PosY, 0), 1); - m_ZoomX = min(max(m_ZoomX, 0.2), 3); - m_ZoomY = min(max(m_ZoomY, 0.2), 3); - - MoveVideoWindow(true); -} - -void CMainFrame::OnUpdateViewPanNScanPresets(CCmdUI* pCmdUI) -{ - int nID = pCmdUI->m_nID - ID_PANNSCAN_PRESETS_START; - AppSettings& s = AfxGetAppSettings(); - pCmdUI->Enable(m_iMediaLoadState == MLS_LOADED && !m_fAudioOnly && nID >= 0 && nID <= s.m_pnspresets.GetCount()); -} - -void CMainFrame::OnViewRotate(UINT nID) -{ - if(!m_pCAP) return; - - switch(nID) - { - case ID_PANSCAN_ROTATEXP: m_AngleX += 2; break; - case ID_PANSCAN_ROTATEXM: m_AngleX -= 2; break; - case ID_PANSCAN_ROTATEYP: m_AngleY += 2; break; - case ID_PANSCAN_ROTATEYM: m_AngleY -= 2; break; - case ID_PANSCAN_ROTATEZP: m_AngleZ += 2; break; - case ID_PANSCAN_ROTATEZM: m_AngleZ -= 2; break; - default: return; - } - - m_pCAP->SetVideoAngle(Vector(DegToRad(m_AngleX), DegToRad(m_AngleY), DegToRad(m_AngleZ))); - - CString info; - info.Format(_T("x: %d, y: %d, z: %d"), m_AngleX, m_AngleY, m_AngleZ); - SendStatusMessage(info, 3000); -} - -void CMainFrame::OnUpdateViewRotate(CCmdUI* pCmdUI) -{ - pCmdUI->Enable(m_iMediaLoadState == MLS_LOADED && !m_fAudioOnly && m_pCAP); -} - -// FIXME -const static SIZE s_ar[] = {{0,0}, {4,3}, {5,4}, {16,9}}; - -void CMainFrame::OnViewAspectRatio(UINT nID) -{ - CSize& ar = AfxGetAppSettings().AspectRatio; - - ar = s_ar[nID - ID_ASPECTRATIO_START]; - - CString info; - if(ar.cx && ar.cy) info.Format(_T("Aspect Ratio: %d:%d"), ar.cx, ar.cy); - else info.Format(_T("Aspect Ratio: Default")); - SendStatusMessage(info, 3000); - - MoveVideoWindow(); -} - -void CMainFrame::OnUpdateViewAspectRatio(CCmdUI* pCmdUI) -{ - pCmdUI->SetRadio(AfxGetAppSettings().AspectRatio == s_ar[pCmdUI->m_nID - ID_ASPECTRATIO_START]); - pCmdUI->Enable(m_iMediaLoadState == MLS_LOADED && !m_fAudioOnly); -} - -void CMainFrame::OnViewAspectRatioNext() -{ - CSize& ar = AfxGetAppSettings().AspectRatio; - - UINT nID = ID_ASPECTRATIO_START; - - for(int i = 0; i < countof(s_ar); i++) - { - if(ar == s_ar[i]) - { - nID += (i + 1) % countof(s_ar); - break; - } - } - - OnViewAspectRatio(nID); -} - -void CMainFrame::OnViewOntop(UINT nID) -{ - nID -= ID_ONTOP_NEVER; - if(AfxGetAppSettings().iOnTop == nID) - nID = !nID; - SetAlwaysOnTop(nID); -} - -void CMainFrame::OnUpdateViewOntop(CCmdUI* pCmdUI) -{ - pCmdUI->SetRadio(AfxGetAppSettings().iOnTop == (pCmdUI->m_nID - ID_ONTOP_NEVER)); -} - -void CMainFrame::OnViewOptions() -{ - ShowOptions(); -} - -// play - -void CMainFrame::OnPlayPlay() -{ - if(m_iMediaLoadState == MLS_LOADED) - { - if(GetMediaState() == State_Stopped) m_iSpeedLevel = 0; - - if(m_iPlaybackMode == PM_FILE) - { - if(m_fEndOfStream) SendMessage(WM_COMMAND, ID_PLAY_STOP); - pMC->Run(); - } - else if(m_iPlaybackMode == PM_DVD) - { - double dRate = 1.0; - if(m_iSpeedLevel != -4 && m_iSpeedLevel != 0) - dRate = pow(2.0, m_iSpeedLevel >= -3 ? m_iSpeedLevel : (-m_iSpeedLevel - 8)); - - pDVDC->PlayForwards(dRate, DVD_CMD_FLAG_Block, NULL); - pDVDC->Pause(FALSE); - pMC->Run(); - } - else if(m_iPlaybackMode == PM_CAPTURE) - { - pMC->Stop(); // audio preview won't be in sync if we run it from paused state - pMC->Run(); - } - - SetTimer(TIMER_STREAMPOSPOLLER, 40, NULL); - SetTimer(TIMER_STREAMPOSPOLLER2, 500, NULL); - SetTimer(TIMER_STATS, 1000, NULL); - - if(m_fFrameSteppingActive) // FIXME - { - m_fFrameSteppingActive = false; - pBA->put_Volume(m_VolumeBeforeFrameStepping); - } - - SetAlwaysOnTop(AfxGetAppSettings().iOnTop); - } - - MoveVideoWindow(); -} - -void CMainFrame::OnPlayPauseI() -{ - if(m_iMediaLoadState == MLS_LOADED) - { - SetAlwaysOnTop(AfxGetAppSettings().iOnTop); - - if(m_iPlaybackMode == PM_FILE) - { - pMC->Pause(); - } - else if(m_iPlaybackMode == PM_DVD) - { - pMC->Pause(); - } - else if(m_iPlaybackMode == PM_CAPTURE) - { - pMC->Pause(); - } - - SetTimer(TIMER_STREAMPOSPOLLER, 40, NULL); - SetTimer(TIMER_STREAMPOSPOLLER2, 500, NULL); - SetTimer(TIMER_STATS, 1000, NULL); - } - - MoveVideoWindow(); -} - -void CMainFrame::OnPlayPause() -{ - // Support ffdshow queueing. - // To avoid black out on pause, we have to lock g_ffdshowReceive to synchronize with ReceiveMine. - if(queueu_ffdshow_support) - { - CAutoLock lck(&g_ffdshowReceive); - return OnPlayPauseI(); - } - OnPlayPauseI(); -} - -void CMainFrame::OnPlayPlaypause() -{ - OAFilterState fs = GetMediaState(); - if(fs == State_Running) SendMessage(WM_COMMAND, ID_PLAY_PAUSE); - else if(fs == State_Stopped || fs == State_Paused) SendMessage(WM_COMMAND, ID_PLAY_PLAY); -} - -void CMainFrame::OnPlayStop() -{ - if(m_iMediaLoadState == MLS_LOADED) - { - if(m_iPlaybackMode == PM_FILE) - { - LONGLONG pos = 0; - pMS->SetPositions(&pos, AM_SEEKING_AbsolutePositioning, NULL, AM_SEEKING_NoPositioning); - pMC->Stop(); - - // BUG: after pause or stop the netshow url source filter won't continue - // on the next play command, unless we cheat it by setting the file name again. - // - // Note: WMPx may be using some undocumented interface to restart streaming. - - BeginEnumFilters(pGB, pEF, pBF) - { - CComQIPtr pAMNS = pBF; - CComQIPtr pFSF = pBF; - if(pAMNS && pFSF) - { - WCHAR* pFN = NULL; - AM_MEDIA_TYPE mt; - if(SUCCEEDED(pFSF->GetCurFile(&pFN, &mt)) && pFN && *pFN) - { - pFSF->Load(pFN, NULL); - CoTaskMemFree(pFN); - } - break; - } - } - EndEnumFilters - } - else if(m_iPlaybackMode == PM_DVD) - { - pDVDC->SetOption(DVD_ResetOnStop, TRUE); - pMC->Stop(); - pDVDC->SetOption(DVD_ResetOnStop, FALSE); - } - else if(m_iPlaybackMode == PM_CAPTURE) - { - pMC->Stop(); - } - - m_iSpeedLevel = 0; - - if(m_fFrameSteppingActive) // FIXME - { - m_fFrameSteppingActive = false; - pBA->put_Volume(m_VolumeBeforeFrameStepping); - } - - m_fEndOfStream = false; - } - - m_nLoops = 0; - - if(m_hWnd) - { - KillTimer(TIMER_STREAMPOSPOLLER2); - KillTimer(TIMER_STREAMPOSPOLLER); - KillTimer(TIMER_STATS); - - MoveVideoWindow(); - - if(m_iMediaLoadState == MLS_LOADED) - { - __int64 start, stop; - m_wndSeekBar.GetRange(start, stop); - GUID tf; - pMS->GetTimeFormat(&tf); - m_wndStatusBar.SetStatusTimer(m_wndSeekBar.GetPosReal(), stop, !!m_wndSubresyncBar.IsWindowVisible(), &tf); - - SetAlwaysOnTop(AfxGetAppSettings().iOnTop); - } - } -} - -void CMainFrame::OnUpdatePlayPauseStop(CCmdUI* pCmdUI) -{ - OAFilterState fs = m_fFrameSteppingActive ? State_Paused : GetMediaState(); - - pCmdUI->SetCheck(fs == State_Running && pCmdUI->m_nID == ID_PLAY_PLAY - || fs == State_Paused && pCmdUI->m_nID == ID_PLAY_PAUSE - || fs == State_Stopped && pCmdUI->m_nID == ID_PLAY_STOP - || (fs == State_Paused || fs == State_Running) && pCmdUI->m_nID == ID_PLAY_PLAYPAUSE); - - bool fEnable = false; - - if(fs >= 0) - { - if(m_iPlaybackMode == PM_FILE || m_iPlaybackMode == PM_CAPTURE) - { - fEnable = true; - - if(fs == State_Stopped && pCmdUI->m_nID == ID_PLAY_PAUSE && m_fRealMediaGraph) fEnable = false; // can't go into paused state from stopped with rm - else if(m_fCapturing) fEnable = false; - else if(m_fLiveWM && pCmdUI->m_nID == ID_PLAY_PAUSE) fEnable = false; - } - else if(m_iPlaybackMode == PM_DVD) - { - fEnable = m_iDVDDomain != DVD_DOMAIN_VideoManagerMenu - && m_iDVDDomain != DVD_DOMAIN_VideoTitleSetMenu; - - if(fs == State_Stopped && pCmdUI->m_nID == ID_PLAY_PAUSE) fEnable = false; - } - } - - pCmdUI->Enable(fEnable); -} - -void CMainFrame::OnPlayFramestep(UINT nID) -{ - REFERENCE_TIME rt; - - if(pFS && m_fQuicktimeGraph) - { - if(GetMediaState() != State_Paused && !queueu_ffdshow_support) - SendMessage(WM_COMMAND, ID_PLAY_PAUSE); - - pFS->Step(nID == ID_PLAY_FRAMESTEP ? 1 : -1, NULL); - } - else if(pFS && nID == ID_PLAY_FRAMESTEP) - { - if(GetMediaState() != State_Paused) - SendMessage(WM_COMMAND, ID_PLAY_PAUSE); - - m_fFrameSteppingActive = true; - - m_VolumeBeforeFrameStepping = m_wndToolBar.Volume; - pBA->put_Volume(-10000); - - pFS->Step(1, NULL); - } - else if(S_OK == pMS->IsFormatSupported(&TIME_FORMAT_FRAME)) - { - if(GetMediaState() != State_Paused) - SendMessage(WM_COMMAND, ID_PLAY_PAUSE); - - pMS->SetTimeFormat(&TIME_FORMAT_FRAME); - pMS->GetCurrentPosition(&rt); - if(nID == ID_PLAY_FRAMESTEP) rt++; - else if(nID == ID_PLAY_FRAMESTEPCANCEL) rt--; - pMS->SetPositions(&rt, AM_SEEKING_AbsolutePositioning, NULL, AM_SEEKING_NoPositioning); - pMS->SetTimeFormat(&TIME_FORMAT_MEDIA_TIME); - } -} - -void CMainFrame::OnUpdatePlayFramestep(CCmdUI* pCmdUI) -{ - bool fEnable = false; - - if(m_iMediaLoadState == MLS_LOADED && !m_fAudioOnly - && (m_iPlaybackMode != PM_DVD || m_iDVDDomain == DVD_DOMAIN_Title) - && m_iPlaybackMode != PM_CAPTURE - && !m_fLiveWM) - { - REFTIME AvgTimePerFrame = 0; - if(S_OK == pMS->IsFormatSupported(&TIME_FORMAT_FRAME) - || pCmdUI->m_nID == ID_PLAY_FRAMESTEP && pFS && pFS->CanStep(0, NULL) == S_OK - || m_fQuicktimeGraph && pFS) - { - fEnable = true; - } - } - - pCmdUI->Enable(fEnable); -} - -void CMainFrame::OnPlaySeek(UINT nID) -{ - AppSettings& s = AfxGetAppSettings(); - - REFERENCE_TIME dt = - nID == ID_PLAY_SEEKBACKWARDSMALL ? -10000i64*s.nJumpDistS : - nID == ID_PLAY_SEEKFORWARDSMALL ? +10000i64*s.nJumpDistS : - nID == ID_PLAY_SEEKBACKWARDMED ? -10000i64*s.nJumpDistM : - nID == ID_PLAY_SEEKFORWARDMED ? +10000i64*s.nJumpDistM : - nID == ID_PLAY_SEEKBACKWARDLARGE ? -10000i64*s.nJumpDistL : - nID == ID_PLAY_SEEKFORWARDLARGE ? +10000i64*s.nJumpDistL : - 0; - - if(!dt) return; - - // HACK: the custom graph should support frame based seeking instead - if(m_fShockwaveGraph) dt /= 10000i64*100; - - SeekTo(m_wndSeekBar.GetPos() + dt); -} - -static int rangebsearch(REFERENCE_TIME val, CAtlArray& rta) -{ - int i = 0, j = rta.GetCount() - 1, ret = -1; - - if(j >= 0 && val >= rta[j]) return(j); - - while(i < j) - { - int mid = (i + j) >> 1; - REFERENCE_TIME midt = rta[mid]; - if(val == midt) {ret = mid; break;} - else if(val < midt) {ret = -1; if(j == mid) mid--; j = mid;} - else if(val > midt) {ret = mid; if(i == mid) mid++; i = mid;} - } - - return(ret); -} - -void CMainFrame::OnPlaySeekKey(UINT nID) -{ - if(m_kfs.GetCount() > 0) - { - HRESULT hr; - - if(GetMediaState() == State_Stopped) - SendMessage(WM_COMMAND, ID_PLAY_PAUSE); - - REFERENCE_TIME rtCurrent, rtDur; - hr = pMS->GetCurrentPosition(&rtCurrent); - hr = pMS->GetDuration(&rtDur); - - int dec = 1; - int i = rangebsearch(rtCurrent, m_kfs); - if(i > 0) dec = (UINT)max(min(rtCurrent - m_kfs[i-1], 10000000), 0); - - rtCurrent = - nID == ID_PLAY_SEEKKEYBACKWARD ? max(rtCurrent - dec, 0) : - nID == ID_PLAY_SEEKKEYFORWARD ? rtCurrent : 0; - - i = rangebsearch(rtCurrent, m_kfs); - - if(nID == ID_PLAY_SEEKKEYBACKWARD) - rtCurrent = m_kfs[max(i, 0)]; - else if(nID == ID_PLAY_SEEKKEYFORWARD && i < m_kfs.GetCount()-1) - rtCurrent = m_kfs[i+1]; - else - return; - - // HACK: if d3d or something changes fpu control word the values of - // m_kfs may be different now (if it was asked again), adding a little - // to the seek position eliminates this error usually. - - rtCurrent += 10; - - hr = pMS->SetPositions( - &rtCurrent, AM_SEEKING_AbsolutePositioning|AM_SEEKING_SeekToKeyFrame, - NULL, AM_SEEKING_NoPositioning); - } -} - -void CMainFrame::OnUpdatePlaySeek(CCmdUI* pCmdUI) -{ - bool fEnable = false; - - OAFilterState fs = GetMediaState(); - - if(m_iMediaLoadState == MLS_LOADED && (fs == State_Paused || fs == State_Running)) - { - fEnable = true; - if(m_iPlaybackMode == PM_DVD && (m_iDVDDomain != DVD_DOMAIN_Title || fs != State_Running)) fEnable = false; - else if(m_iPlaybackMode == PM_CAPTURE) fEnable = false; - } - - pCmdUI->Enable(fEnable); -} - -void CMainFrame::OnPlayGoto() -{ - if(m_iMediaLoadState != MLS_LOADED) - return; - - REFTIME atpf = 0; - if(FAILED(pBV->get_AvgTimePerFrame(&atpf)) || atpf < 0) - { - atpf = 0; - - BeginEnumFilters(pGB, pEF, pBF) - { - if(atpf > 0) break; - - BeginEnumPins(pBF, pEP, pPin) - { - if(atpf > 0) break; - - AM_MEDIA_TYPE mt; - pPin->ConnectionMediaType(&mt); - - if(mt.majortype == MEDIATYPE_Video && mt.formattype == FORMAT_VideoInfo) - { - atpf = (REFTIME)((VIDEOINFOHEADER*)mt.pbFormat)->AvgTimePerFrame / 10000000i64; - } - else if(mt.majortype == MEDIATYPE_Video && mt.formattype == FORMAT_VideoInfo2) - { - atpf = (REFTIME)((VIDEOINFOHEADER2*)mt.pbFormat)->AvgTimePerFrame / 10000000i64; - } - } - EndEnumPins - } - EndEnumFilters - } - - CGoToDlg dlg((int)(m_wndSeekBar.GetPos()/10000), atpf > 0 ? (float)(1.0/atpf) : 0); - if(IDOK != dlg.DoModal() || dlg.m_time < 0) return; - - SeekTo(10000i64 * dlg.m_time); -} - -void CMainFrame::OnUpdateGoto(CCmdUI* pCmdUI) -{ - bool fEnable = false; - - if(m_iMediaLoadState == MLS_LOADED) - { - fEnable = true; - if(m_iPlaybackMode == PM_DVD && m_iDVDDomain != DVD_DOMAIN_Title) fEnable = false; - else if(m_iPlaybackMode == PM_CAPTURE) fEnable = false; - } - - pCmdUI->Enable(fEnable); -} - -void CMainFrame::OnPlayChangeRate(UINT nID) -{ - if(m_iMediaLoadState != MLS_LOADED) - return; - - if(m_iPlaybackMode == PM_CAPTURE) - { - if(GetMediaState() != State_Running) - SendMessage(WM_COMMAND, ID_PLAY_PLAY); - - long lChannelMin = 0, lChannelMax = 0; - pAMTuner->ChannelMinMax(&lChannelMin, &lChannelMax); - long lChannel = 0, lVivSub = 0, lAudSub = 0; - pAMTuner->get_Channel(&lChannel, &lVivSub, &lAudSub); - - long lFreqOrg = 0, lFreqNew = -1; - pAMTuner->get_VideoFrequency(&lFreqOrg); - -// long lSignalStrength; - do - { - if(nID == ID_PLAY_DECRATE) lChannel--; - else if(nID == ID_PLAY_INCRATE) lChannel++; - -// if(lChannel < lChannelMin) lChannel = lChannelMax; -// if(lChannel > lChannelMax) lChannel = lChannelMin; - - if(lChannel < lChannelMin || lChannel > lChannelMax) - break; - - if(FAILED(pAMTuner->put_Channel(lChannel, AMTUNER_SUBCHAN_DEFAULT, AMTUNER_SUBCHAN_DEFAULT))) - break; - - long flFoundSignal; - pAMTuner->AutoTune(lChannel, &flFoundSignal); - - pAMTuner->get_VideoFrequency(&lFreqNew); - } - while(FALSE); -/* SUCCEEDED(pAMTuner->SignalPresent(&lSignalStrength)) - && (lSignalStrength != AMTUNER_SIGNALPRESENT || lFreqNew == lFreqOrg));*/ - - } - else - { - int iNewSpeedLevel; - - if(nID == ID_PLAY_INCRATE) iNewSpeedLevel = m_iSpeedLevel+1; - else if(nID == ID_PLAY_DECRATE) iNewSpeedLevel = m_iSpeedLevel-1; - else return; - - HRESULT hr = E_FAIL; - - if(iNewSpeedLevel == -4) - { - if(GetMediaState() != State_Paused) - SendMessage(WM_COMMAND, ID_PLAY_PAUSE); - - if(GetMediaState() == State_Paused) hr = S_OK; - } - else - { - double dRate = pow(2.0, iNewSpeedLevel >= -3 ? iNewSpeedLevel : (-iNewSpeedLevel - 8)); - if(fabs(dRate - 1.0) < 0.01) dRate = 1.0; - - if(GetMediaState() != State_Running) - SendMessage(WM_COMMAND, ID_PLAY_PLAY); - - if(m_iPlaybackMode == PM_FILE) - { - hr = pMS->SetRate(dRate); - } - else if(m_iPlaybackMode == PM_DVD) - { - if(iNewSpeedLevel >= -3) - hr = pDVDC->PlayForwards(dRate, DVD_CMD_FLAG_Block, NULL); - else - hr = pDVDC->PlayBackwards(dRate, DVD_CMD_FLAG_Block, NULL); - } - } - - if(SUCCEEDED(hr)) - m_iSpeedLevel = iNewSpeedLevel; - } -} - -void CMainFrame::OnUpdatePlayChangeRate(CCmdUI* pCmdUI) -{ - bool fEnable = false; - - if(m_iMediaLoadState == MLS_LOADED) - { - bool fInc = pCmdUI->m_nID == ID_PLAY_INCRATE; - - fEnable = true; - if(fInc && m_iSpeedLevel >= 3) fEnable = false; - else if(!fInc && m_iPlaybackMode == PM_FILE && m_iSpeedLevel <= -4) fEnable = false; - else if(!fInc && m_iPlaybackMode == PM_DVD && m_iSpeedLevel <= -11) fEnable = false; - else if(m_iPlaybackMode == PM_DVD && m_iDVDDomain != DVD_DOMAIN_Title) fEnable = false; - else if(m_fRealMediaGraph || m_fShockwaveGraph) fEnable = false; - else if(m_iPlaybackMode == PM_CAPTURE && (!m_wndCaptureBar.m_capdlg.IsTunerActive() || m_fCapturing)) fEnable = false; - else if(m_fLiveWM) fEnable = false; - } - - pCmdUI->Enable(fEnable); -} - -void CMainFrame::OnPlayResetRate() -{ - if(m_iMediaLoadState != MLS_LOADED) - return; - - HRESULT hr = E_FAIL; - - if(GetMediaState() != State_Running) - SendMessage(WM_COMMAND, ID_PLAY_PLAY); - - if(m_iPlaybackMode == PM_FILE) - { - hr = pMS->SetRate(1.0); - } - else if(m_iPlaybackMode == PM_DVD) - { - hr = pDVDC->PlayForwards(1.0, DVD_CMD_FLAG_Block, NULL); - } - - if(SUCCEEDED(hr)) - m_iSpeedLevel = 0; -} - -void CMainFrame::OnUpdatePlayResetRate(CCmdUI* pCmdUI) -{ - pCmdUI->Enable(m_iMediaLoadState == MLS_LOADED); -} - -void CMainFrame::SetSubtitleDelay(int delay_ms) -{ - if(m_pCAP) { - m_pCAP->SetSubtitleDelay(delay_ms); - } -} - -void CMainFrame::OnPlayChangeAudDelay(UINT nID) -{ - if(CComQIPtr pASF = FindFilter(__uuidof(CAudioSwitcherFilter), pGB)) - { - REFERENCE_TIME rtShift = pASF->GetAudioTimeShift(); - rtShift += - nID == ID_PLAY_INCAUDDELAY ? 100000 : - nID == ID_PLAY_DECAUDDELAY ? -100000 : - 0; - pASF->SetAudioTimeShift(rtShift); - - CString str; - str.Format(_T("Audio Delay: %I64dms"), rtShift/10000); - SendStatusMessage(str, 3000); - } -} - -void CMainFrame::OnUpdatePlayChangeAudDelay(CCmdUI* pCmdUI) -{ - pCmdUI->Enable(!!pGB /*&& !!FindFilter(__uuidof(CAudioSwitcherFilter), pGB)*/); -} - -#include "ComPropertySheet.h" - -void CMainFrame::OnPlayFilters(UINT nID) -{ -// ShowPPage(m_spparray[nID - ID_FILTERS_SUBITEM_START], m_hWnd); - - CComPtr pUnk = m_pparray[nID - ID_FILTERS_SUBITEM_START]; - - CComPropertySheet ps(ResStr(IDS_PROPSHEET_PROPERTIES), this); - - if(CComQIPtr pSPP = pUnk) - { - ps.AddPages(pSPP); - } - - if(CComQIPtr pBF = pUnk) - { - HRESULT hr; - CComPtr pPP = new CInternalPropertyPageTempl(NULL, &hr); - ps.AddPage(pPP, pBF); - } - - if(ps.GetPageCount() > 0) - { - ps.DoModal(); - OpenSetupStatusBar(); - } -} - -void CMainFrame::OnUpdatePlayFilters(CCmdUI* pCmdUI) -{ - pCmdUI->Enable(!m_fCapturing); -} - -void CMainFrame::OnPlayShaders(UINT nID) -{ - if(nID == ID_SHADERS_START+2) - { - ShowControlBar(&m_wndShaderEditorBar, TRUE, TRUE); - return; - } - - if(!m_pCAP) return; - - if(nID == ID_SHADERS_START) - { - m_shaderlabels.RemoveAll(); - } - else if(nID == ID_SHADERS_START+1) - { - if(IDOK != CShaderCombineDlg(m_shaderlabels, this).DoModal()) - return; - } - else if(nID >= ID_SHADERS_START+3) - { - MENUITEMINFO mii; - memset(&mii, 0, sizeof(mii)); - mii.cbSize = sizeof(mii); - mii.fMask = MIIM_DATA; - m_shaders.GetMenuItemInfo(nID, &mii); - - m_shaderlabels.RemoveAll(); - m_shaderlabels.AddTail(((const AppSettings::Shader*)mii.dwItemData)->label); - } - - SetShaders(); -} - -void CMainFrame::OnUpdatePlayShaders(CCmdUI* pCmdUI) -{ - if(pCmdUI->m_nID >= ID_SHADERS_START) - { - pCmdUI->Enable(!!m_pCAP); - - if(pCmdUI->m_nID == ID_SHADERS_START) - { - pCmdUI->SetRadio(m_shaderlabels.IsEmpty()); - } - else if(pCmdUI->m_nID == ID_SHADERS_START+1) - { - pCmdUI->SetRadio(m_shaderlabels.GetCount() > 1); - } - else if(pCmdUI->m_nID == ID_SHADERS_START+2) - { - pCmdUI->Enable(TRUE); - } - else - { - MENUITEMINFO mii; - memset(&mii, 0, sizeof(mii)); - mii.cbSize = sizeof(mii); - mii.fMask = MIIM_DATA; - m_shaders.GetMenuItemInfo(pCmdUI->m_nID, &mii); - - pCmdUI->SetRadio(m_shaderlabels.GetCount() == 1 - && m_shaderlabels.GetHead() == ((AppSettings::Shader*)mii.dwItemData)->label); - } - } -} - -void CMainFrame::OnPlayAudio(UINT nID) -{ - int i = (int)nID - (1 + ID_AUDIO_SUBITEM_START); - - CComQIPtr pSS = FindFilter(__uuidof(CAudioSwitcherFilter), pGB); - if(!pSS) pSS = FindFilter(L"{D3CD7858-971A-4838-ACEC-40CA5D529DC8}", pGB); - - if(i == -1) - { - ShowOptions(CPPageAudioSwitcher::IDD); - } - else if(i >= 0 && pSS) - { - pSS->Enable(i, AMSTREAMSELECTENABLE_ENABLE); - } -} - -void CMainFrame::OnUpdatePlayAudio(CCmdUI* pCmdUI) -{ - UINT nID = pCmdUI->m_nID; - int i = (int)nID - (1 + ID_AUDIO_SUBITEM_START); - - CComQIPtr pSS = FindFilter(__uuidof(CAudioSwitcherFilter), pGB); - if(!pSS) pSS = FindFilter(L"{D3CD7858-971A-4838-ACEC-40CA5D529DC8}", pGB); - - /*if(i == -1) - { - // TODO**** - } - else*/ if(i >= 0 && pSS) - { - DWORD flags = 0; - - if(SUCCEEDED(pSS->Info(i, NULL, &flags, NULL, NULL, NULL, NULL, NULL))) - { - if(flags&AMSTREAMSELECTINFO_EXCLUSIVE) pCmdUI->SetRadio(TRUE); - else if(flags&AMSTREAMSELECTINFO_ENABLED) pCmdUI->SetCheck(TRUE); - else pCmdUI->SetCheck(FALSE); - } - else - { - pCmdUI->Enable(FALSE); - } - } -} - -void CMainFrame::OnPlaySubtitles(UINT nID) -{ - int i = (int)nID - (4 + ID_SUBTITLES_SUBITEM_START); - - if(i == -4) - { - ShowOptions(CPPageSubtitles::IDD); - } - else if(i == -3) - { - int i = m_iSubtitleSel; - - POSITION pos = m_pSubStreams.GetHeadPosition(); - while(pos && i >= 0) - { - CComPtr pSubStream = m_pSubStreams.GetNext(pos); - - if(i < pSubStream->GetStreamCount()) - { - CLSID clsid; - if(FAILED(pSubStream->GetClassID(&clsid))) - continue; - - if(clsid == __uuidof(CRenderedTextSubtitle)) - { - CRenderedTextSubtitle* pRTS = (CRenderedTextSubtitle*)(ISubStream*)pSubStream; - - CAutoPtrArray pages; - CAtlArray styles; - - POSITION pos = pRTS->m_styles.GetStartPosition(); - for(int i = 0; pos; i++) - { - CString key; - STSStyle* val; - pRTS->m_styles.GetNextAssoc(pos, key, val); - - CAutoPtr page(new CPPageSubStyle()); - page->InitStyle(key, *val); - pages.Add(page); - styles.Add(val); - } - - CPropertySheet dlg(_T("Styles..."), this); - for(int i = 0; i < (int)pages.GetCount(); i++) - dlg.AddPage(pages[i]); - - if(dlg.DoModal() == IDOK) - { - for(int j = 0; j < (int)pages.GetCount(); j++) - pages[j]->GetStyle(*styles[j]); - UpdateSubtitle(false); - } - - return; - } - } - - i -= pSubStream->GetStreamCount(); - } - } - else if(i == -2) - { - ReloadSubtitle(); - } - else if(i == -1) - { - if(m_iSubtitleSel == -1) m_iSubtitleSel = 0; - else m_iSubtitleSel ^= (1<<31); - UpdateSubtitle(); - } - else if(i >= 0) - { - m_iSubtitleSel = i; - UpdateSubtitle(); - } - - AfxGetAppSettings().fEnableSubtitles = !(m_iSubtitleSel & 0x80000000); -} - -void CMainFrame::OnUpdatePlaySubtitles(CCmdUI* pCmdUI) -{ - UINT nID = pCmdUI->m_nID; - int i = (int)nID - (4 + ID_SUBTITLES_SUBITEM_START); - - pCmdUI->Enable(m_pCAP && !m_fAudioOnly); - - if(i == -3) - { - pCmdUI->Enable(FALSE); - - int i = m_iSubtitleSel; - - POSITION pos = m_pSubStreams.GetHeadPosition(); - while(pos && i >= 0) - { - CComPtr pSubStream = m_pSubStreams.GetNext(pos); - - if(i < pSubStream->GetStreamCount()) - { - CLSID clsid; - if(FAILED(pSubStream->GetClassID(&clsid))) - continue; - - if(clsid == __uuidof(CRenderedTextSubtitle)) - { - pCmdUI->Enable(TRUE); - break; - } - } - - i -= pSubStream->GetStreamCount(); - } - } - else if(i == -1) - { - pCmdUI->SetCheck(m_iSubtitleSel >= 0); - } - else if(i >= 0) - { - pCmdUI->SetRadio(i == abs(m_iSubtitleSel)); - } -} - -void CMainFrame::OnPlayLanguage(UINT nID) -{ - nID -= ID_FILTERSTREAMS_SUBITEM_START; - CComPtr pAMSS = m_ssarray[nID]; - UINT i = nID; - while(i > 0 && pAMSS == m_ssarray[i-1]) i--; - if(FAILED(pAMSS->Enable(nID-i, AMSTREAMSELECTENABLE_ENABLE))) - MessageBeep(-1); - - OpenSetupStatusBar(); -} - -void CMainFrame::OnUpdatePlayLanguage(CCmdUI* pCmdUI) -{ - UINT nID = pCmdUI->m_nID; - nID -= ID_FILTERSTREAMS_SUBITEM_START; - CComPtr pAMSS = m_ssarray[nID]; - UINT i = nID; - while(i > 0 && pAMSS == m_ssarray[i-1]) i--; - DWORD flags = 0; - pAMSS->Info(nID-i, NULL, &flags, NULL, NULL, NULL, NULL, NULL); - if(flags&AMSTREAMSELECTINFO_EXCLUSIVE) pCmdUI->SetRadio(TRUE); - else if(flags&AMSTREAMSELECTINFO_ENABLED) pCmdUI->SetCheck(TRUE); - else pCmdUI->SetCheck(FALSE); -} - -void CMainFrame::OnPlayVolume(UINT nID) -{ - if(m_iMediaLoadState == MLS_LOADED) - { - pBA->put_Volume(m_wndToolBar.Volume); - } -} - -void CMainFrame::OnPlayVolumeBoost(UINT nID) -{ - AppSettings& s = AfxGetAppSettings(); - - int i = (int)(50.0f*log10(s.AudioBoost)); - - switch(nID) - { - case ID_VOLUME_BOOST_INC: i = min(i+10, 100); break; - case ID_VOLUME_BOOST_DEC: i = max(i-10, 0); break; - case ID_VOLUME_BOOST_MIN: i = 0; break; - case ID_VOLUME_BOOST_MAX: i = 100; break; - } - - s.AudioBoost = pow(10.0f, (float)i/50); - - if(CComQIPtr pASF = FindFilter(__uuidof(CAudioSwitcherFilter), pGB)) - { - bool fNormalize, fNormalizeRecover; - float boost; - pASF->GetNormalizeBoost(fNormalize, fNormalizeRecover, boost); - pASF->SetNormalizeBoost(fNormalize, fNormalizeRecover, s.AudioBoost); - } -} - -void CMainFrame::OnUpdatePlayVolumeBoost(CCmdUI* pCmdUI) -{ - pCmdUI->Enable(); -} - -void CMainFrame::OnAfterplayback(UINT nID) -{ - AppSettings& s = AfxGetAppSettings(); - - s.nCLSwitches &= ~CLSW_AFTERPLAYBACK_MASK; - - switch(nID) - { - case ID_AFTERPLAYBACK_CLOSE: s.nCLSwitches |= CLSW_CLOSE; break; - case ID_AFTERPLAYBACK_STANDBY: s.nCLSwitches |= CLSW_STANDBY; break; - case ID_AFTERPLAYBACK_HIBERNATE: s.nCLSwitches |= CLSW_HIBERNATE; break; - case ID_AFTERPLAYBACK_SHUTDOWN: s.nCLSwitches |= CLSW_SHUTDOWN; break; - case ID_AFTERPLAYBACK_LOGOFF: s.nCLSwitches |= CLSW_LOGOFF; break; - } -} - -void CMainFrame::OnUpdateAfterplayback(CCmdUI* pCmdUI) -{ - AppSettings& s = AfxGetAppSettings(); - - bool fChecked = false; - - switch(pCmdUI->m_nID) - { - case ID_AFTERPLAYBACK_CLOSE: fChecked = !!(s.nCLSwitches & CLSW_CLOSE); break; - case ID_AFTERPLAYBACK_STANDBY: fChecked = !!(s.nCLSwitches & CLSW_STANDBY); break; - case ID_AFTERPLAYBACK_HIBERNATE: fChecked = !!(s.nCLSwitches & CLSW_HIBERNATE); break; - case ID_AFTERPLAYBACK_SHUTDOWN: fChecked = !!(s.nCLSwitches & CLSW_SHUTDOWN); break; - case ID_AFTERPLAYBACK_LOGOFF: fChecked = !!(s.nCLSwitches & CLSW_LOGOFF); break; - case ID_AFTERPLAYBACK_DONOTHING: fChecked = !(s.nCLSwitches & CLSW_AFTERPLAYBACK_MASK); break; - } - - pCmdUI->SetRadio(fChecked); -} - -// navigate - -void CMainFrame::OnNavigateSkip(UINT nID) -{ - if(m_iPlaybackMode == PM_FILE || m_iPlaybackMode == PM_CAPTURE) - { - if(m_iPlaybackMode == PM_FILE) SetupChapters(); - - if(DWORD nChapters = m_pCB->ChapGetCount()) - { - REFERENCE_TIME rtCur; - pMS->GetCurrentPosition(&rtCur); - - REFERENCE_TIME rt = rtCur; - CComBSTR name; - long i; - - if(nID == ID_NAVIGATE_SKIPBACK) - { - rt -= 30000000; - i = m_pCB->ChapLookup(&rt, &name); - } - else if(nID == ID_NAVIGATE_SKIPFORWARD) - { - i = m_pCB->ChapLookup(&rt, &name) + 1; - name.Empty(); - if(i < nChapters) m_pCB->ChapGet(i, &rt, &name); - } - - if(i >= 0 && i < nChapters) - { - SeekTo(rt); - SendStatusMessage(_T("Chapter: ") + CString(name), 3000); - return; - } - } - - if(nID == ID_NAVIGATE_SKIPBACK) - { - SendMessage(WM_COMMAND, ID_NAVIGATE_SKIPBACKPLITEM); - } - else if(nID == ID_NAVIGATE_SKIPFORWARD) - { - SendMessage(WM_COMMAND, ID_NAVIGATE_SKIPFORWARDPLITEM); - } - } - else if(m_iPlaybackMode == PM_DVD) - { - m_iSpeedLevel = 0; - - if(GetMediaState() != State_Running) - SendMessage(WM_COMMAND, ID_PLAY_PLAY); - - ULONG ulNumOfVolumes, ulVolume; - DVD_DISC_SIDE Side; - ULONG ulNumOfTitles = 0; - pDVDI->GetDVDVolumeInfo(&ulNumOfVolumes, &ulVolume, &Side, &ulNumOfTitles); - - DVD_PLAYBACK_LOCATION2 Location; - pDVDI->GetCurrentLocation(&Location); - - ULONG ulNumOfChapters = 0; - pDVDI->GetNumberOfChapters(Location.TitleNum, &ulNumOfChapters); - - if(nID == ID_NAVIGATE_SKIPBACK) - { - if(Location.ChapterNum == 1 && Location.TitleNum > 1) - { - pDVDI->GetNumberOfChapters(Location.TitleNum-1, &ulNumOfChapters); - pDVDC->PlayChapterInTitle(Location.TitleNum-1, ulNumOfChapters, DVD_CMD_FLAG_Block|DVD_CMD_FLAG_Flush, NULL); - } - else - { - pDVDC->PlayPrevChapter(DVD_CMD_FLAG_Block|DVD_CMD_FLAG_Flush, NULL); - } - } - else if(nID == ID_NAVIGATE_SKIPFORWARD) - { - if(Location.ChapterNum == ulNumOfChapters && Location.TitleNum < ulNumOfTitles) - { - pDVDC->PlayChapterInTitle(Location.TitleNum+1, 1, DVD_CMD_FLAG_Block|DVD_CMD_FLAG_Flush, NULL); - } - else - { - pDVDC->PlayNextChapter(DVD_CMD_FLAG_Block|DVD_CMD_FLAG_Flush, NULL); - } - } -/* - if(nID == ID_NAVIGATE_SKIPBACK) - pDVDC->PlayPrevChapter(DVD_CMD_FLAG_Block, NULL); - else if(nID == ID_NAVIGATE_SKIPFORWARD) - pDVDC->PlayNextChapter(DVD_CMD_FLAG_Block, NULL); -*/ - } -} - -void CMainFrame::OnUpdateNavigateSkip(CCmdUI* pCmdUI) -{ - // moved to the timer callback function, that runs less frequent -// if(m_iPlaybackMode == PM_FILE) SetupChapters(); - - pCmdUI->Enable(m_iMediaLoadState == MLS_LOADED - && ((m_iPlaybackMode == PM_DVD - && m_iDVDDomain != DVD_DOMAIN_VideoManagerMenu - && m_iDVDDomain != DVD_DOMAIN_VideoTitleSetMenu) - || (m_iPlaybackMode == PM_FILE && (m_wndPlaylistBar.GetCount() > 1/*0*/ || m_pCB->ChapGetCount() > 1)) - || (m_iPlaybackMode == PM_CAPTURE && !m_fCapturing))); // TODO -} - -void CMainFrame::OnNavigateSkipPlaylistItem(UINT nID) -{ - if(m_iPlaybackMode == PM_FILE || m_iPlaybackMode == PM_CAPTURE) - { - if(m_wndPlaylistBar.GetCount() == 1) - { - SendMessage(WM_COMMAND, ID_PLAY_STOP); // do not remove this, unless you want a circular call with OnPlayPlay() - SendMessage(WM_COMMAND, ID_PLAY_PLAY); - } - else - { - if(nID == ID_NAVIGATE_SKIPBACKPLITEM) - { - m_wndPlaylistBar.SetPrev(); - } - else if(nID == ID_NAVIGATE_SKIPFORWARDPLITEM) - { - m_wndPlaylistBar.SetNext(); - } - - OpenCurPlaylistItem(); - } - } -} - -void CMainFrame::OnUpdateNavigateSkipPlaylistItem(CCmdUI* pCmdUI) -{ - pCmdUI->Enable(m_iMediaLoadState == MLS_LOADED - && ((m_iPlaybackMode == PM_FILE || m_iPlaybackMode == PM_CAPTURE && !m_fCapturing) && m_wndPlaylistBar.GetCount() > 1/*0*/)); -} - -void CMainFrame::OnNavigateMenu(UINT nID) -{ - nID -= ID_NAVIGATE_TITLEMENU; - - if(m_iMediaLoadState != MLS_LOADED || m_iPlaybackMode != PM_DVD) - return; - - m_iSpeedLevel = 0; - - if(GetMediaState() != State_Running) - SendMessage(WM_COMMAND, ID_PLAY_PLAY); - - pDVDC->ShowMenu((DVD_MENU_ID)(nID+2), DVD_CMD_FLAG_Block|DVD_CMD_FLAG_Flush, NULL); -} - -void CMainFrame::OnUpdateNavigateMenu(CCmdUI* pCmdUI) -{ - UINT nID = pCmdUI->m_nID - ID_NAVIGATE_TITLEMENU; - ULONG ulUOPs; - - if(m_iMediaLoadState != MLS_LOADED || m_iPlaybackMode != PM_DVD - || FAILED(pDVDI->GetCurrentUOPS(&ulUOPs))) - { - pCmdUI->Enable(FALSE); - return; - } - - pCmdUI->Enable(!(ulUOPs & (UOP_FLAG_ShowMenu_Title << nID))); -} - -void CMainFrame::OnNavigateAudio(UINT nID) -{ - nID -= ID_NAVIGATE_AUDIO_SUBITEM_START; - - if(m_iPlaybackMode == PM_FILE) - { - OnNavStreamSelectSubMenu(nID, 1); - } - else if(m_iPlaybackMode == PM_DVD) - { - pDVDC->SelectAudioStream(nID, DVD_CMD_FLAG_Block, NULL); - } -} - -void CMainFrame::OnNavigateSubpic(UINT nID) -{ - if(m_iPlaybackMode == PM_FILE) - { - OnNavStreamSelectSubMenu(nID - ID_NAVIGATE_SUBP_SUBITEM_START, 2); - } - else if(m_iPlaybackMode == PM_DVD) - { - int i = (int)nID - (1 + ID_NAVIGATE_SUBP_SUBITEM_START); - - if(i == -1) - { - ULONG ulStreamsAvailable, ulCurrentStream; - BOOL bIsDisabled; - if(SUCCEEDED(pDVDI->GetCurrentSubpicture(&ulStreamsAvailable, &ulCurrentStream, &bIsDisabled))) - pDVDC->SetSubpictureState(bIsDisabled, DVD_CMD_FLAG_Block, NULL); - } - else - { - pDVDC->SelectSubpictureStream(i, DVD_CMD_FLAG_Block, NULL); - pDVDC->SetSubpictureState(TRUE, DVD_CMD_FLAG_Block, NULL); - } - } -} - -void CMainFrame::OnNavigateAngle(UINT nID) -{ - nID -= ID_NAVIGATE_ANGLE_SUBITEM_START; - - if(m_iPlaybackMode == PM_FILE) - { - OnNavStreamSelectSubMenu(nID, 0); - } - else if(m_iPlaybackMode == PM_DVD) - { - pDVDC->SelectAngle(nID+1, DVD_CMD_FLAG_Block, NULL); - } -} - -void CMainFrame::OnNavigateChapters(UINT nID) -{ - nID -= ID_NAVIGATE_CHAP_SUBITEM_START; - - if(m_iPlaybackMode == PM_FILE) - { - if((int)nID >= 0 && nID < m_pCB->ChapGetCount()) - { - REFERENCE_TIME rt; - CComBSTR name; - if(SUCCEEDED(m_pCB->ChapGet(nID, &rt, &name))) - { - SeekTo(rt); - SendStatusMessage(_T("Chapter: ") + CString(name), 3000); - } - return; - } - - nID -= m_pCB->ChapGetCount(); - - if((int)nID >= 0 && (int)nID < m_wndPlaylistBar.GetCount() - && m_wndPlaylistBar.GetSelIdx() != (int)nID) - { - m_wndPlaylistBar.SetSelIdx(nID); - OpenCurPlaylistItem(); - } - } - else if(m_iPlaybackMode == PM_DVD) - { - ULONG ulNumOfVolumes, ulVolume; - DVD_DISC_SIDE Side; - ULONG ulNumOfTitles = 0; - pDVDI->GetDVDVolumeInfo(&ulNumOfVolumes, &ulVolume, &Side, &ulNumOfTitles); - - DVD_PLAYBACK_LOCATION2 Location; - pDVDI->GetCurrentLocation(&Location); - - ULONG ulNumOfChapters = 0; - pDVDI->GetNumberOfChapters(Location.TitleNum, &ulNumOfChapters); - - nID++; - - if(nID > 0 && nID <= ulNumOfTitles) - { - pDVDC->PlayTitle(nID, DVD_CMD_FLAG_Block|DVD_CMD_FLAG_Flush, NULL); // sometimes this does not do anything ... - pDVDC->PlayChapterInTitle(nID, 1, DVD_CMD_FLAG_Block|DVD_CMD_FLAG_Flush, NULL); // ... but this does! - return; - } - - nID -= ulNumOfTitles; - - if(nID > 0 && nID <= ulNumOfChapters) - { - pDVDC->PlayChapter(nID, DVD_CMD_FLAG_Block|DVD_CMD_FLAG_Flush, NULL); - return; - } - } -} - -void CMainFrame::OnNavigateMenuItem(UINT nID) -{ - nID -= ID_NAVIGATE_MENU_LEFT; - - if(m_iPlaybackMode == PM_DVD) - { - switch(nID) - { - case 0: pDVDC->SelectRelativeButton(DVD_Relative_Left); break; - case 1: pDVDC->SelectRelativeButton(DVD_Relative_Right); break; - case 2: pDVDC->SelectRelativeButton(DVD_Relative_Upper); break; - case 3: pDVDC->SelectRelativeButton(DVD_Relative_Lower); break; - case 4: pDVDC->ActivateButton(); break; - case 5: pDVDC->ReturnFromSubmenu(DVD_CMD_FLAG_Block|DVD_CMD_FLAG_Flush, NULL); break; - case 6: pDVDC->Resume(DVD_CMD_FLAG_Block|DVD_CMD_FLAG_Flush, NULL); break; - default: break; - } - } -} - -void CMainFrame::OnUpdateNavigateMenuItem(CCmdUI* pCmdUI) -{ - UINT nID = pCmdUI->m_nID - ID_NAVIGATE_MENU_LEFT; - pCmdUI->Enable(m_iMediaLoadState == MLS_LOADED && m_iPlaybackMode == PM_DVD); -} - -// favorites - -class CDVDStateStream : public CUnknown, public IStream -{ - STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv) - { - return - QI(IStream) - CUnknown::NonDelegatingQueryInterface(riid, ppv); - } - - __int64 m_pos; - -public: - CDVDStateStream() : CUnknown(NAME("CDVDStateStream"), NULL) {m_pos = 0;} - - DECLARE_IUNKNOWN; - - CAtlArray m_data; - - // ISequentialStream - STDMETHODIMP Read(void* pv, ULONG cb, ULONG* pcbRead) - { - __int64 cbRead = min(m_data.GetCount() - m_pos, (__int64)cb); - cbRead = max(cbRead, 0); - memcpy(pv, &m_data[(INT_PTR)m_pos], (int)cbRead); - if(pcbRead) *pcbRead = (ULONG)cbRead; - m_pos += cbRead; - return S_OK; - } - STDMETHODIMP Write(const void* pv, ULONG cb, ULONG* pcbWritten) - { - BYTE* p = (BYTE*)pv; - ULONG cbWritten = -1; - while(++cbWritten < cb) - m_data.Add(*p++); - if(pcbWritten) *pcbWritten = cbWritten; - return S_OK; - } - - // IStream - STDMETHODIMP Seek(LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition) {return E_NOTIMPL;} - STDMETHODIMP SetSize(ULARGE_INTEGER libNewSize) {return E_NOTIMPL;} - STDMETHODIMP CopyTo(IStream* pstm, ULARGE_INTEGER cb, ULARGE_INTEGER* pcbRead, ULARGE_INTEGER* pcbWritten) {return E_NOTIMPL;} - STDMETHODIMP Commit(DWORD grfCommitFlags) {return E_NOTIMPL;} - STDMETHODIMP Revert() {return E_NOTIMPL;} - STDMETHODIMP LockRegion(ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType) {return E_NOTIMPL;} - STDMETHODIMP UnlockRegion(ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType) {return E_NOTIMPL;} - STDMETHODIMP Stat(STATSTG* pstatstg, DWORD grfStatFlag) {return E_NOTIMPL;} - STDMETHODIMP Clone(IStream** ppstm) {return E_NOTIMPL;} -}; - - -void CMainFrame::OnFavoritesAdd() -{ - AppSettings& s = AfxGetAppSettings(); - - if(m_iPlaybackMode == PM_FILE) - { - CString fn = m_wndPlaylistBar.GetCur(); - if(fn.IsEmpty()) return; - - CString desc = fn; - desc.Replace('\\', '/'); - int i = desc.Find(_T("://")), j = desc.Find(_T("?")), k = desc.ReverseFind('/'); - if(i >= 0) desc = j >= 0 ? desc.Left(j) : desc; - else if(k >= 0) desc = desc.Mid(k+1); - - CFavoriteAddDlg dlg(desc, fn); - if(dlg.DoModal() != IDOK) return; - - CString str = dlg.m_name; - str.Remove(';'); - - CString pos(_T("0")); - if(dlg.m_fRememberPos) - pos.Format(_T("%I64d"), GetPos()); - - str += ';'; - str += pos; - - CPlaylistItem pli; - if(m_wndPlaylistBar.GetCur(pli)) - { - POSITION pos = pli.m_fns.GetHeadPosition(); - while(pos) str += _T(";") + pli.m_fns.GetNext(pos); - } - - s.AddFav(FAV_FILE, str); - } - else if(m_iPlaybackMode == PM_DVD) - { - WCHAR path[MAX_PATH]; - ULONG len = 0; - pDVDI->GetDVDDirectory(path, MAX_PATH, &len); - CString fn = path; - fn.TrimRight(_T("/\\")); - - DVD_PLAYBACK_LOCATION2 Location; - pDVDI->GetCurrentLocation(&Location); - CString desc; - desc.Format(_T("%s - T%02d C%02d - %02d:%02d:%02d"), fn, Location.TitleNum, Location.ChapterNum, - Location.TimeCode.bHours, Location.TimeCode.bMinutes, Location.TimeCode.bSeconds); - - CFavoriteAddDlg dlg(fn, desc); - if(dlg.DoModal() != IDOK) return; - - CString str = dlg.m_name; - str.Remove(';'); - - CString pos(_T("0")); - if(dlg.m_fRememberPos) - { - CDVDStateStream stream; - stream.AddRef(); - - CComPtr pStateData; - CComQIPtr pPersistStream; - if(SUCCEEDED(pDVDI->GetState(&pStateData)) - && (pPersistStream = pStateData) - && SUCCEEDED(OleSaveToStream(pPersistStream, (IStream*)&stream))) - { - pos = BinToCString(stream.m_data.GetData(), stream.m_data.GetCount()); - } - } - - str += ';'; - str += pos; - - str += ';'; - str += fn; - - s.AddFav(FAV_DVD, str); - } - else if(m_iPlaybackMode == PM_CAPTURE) - { - // TODO - } -} - -void CMainFrame::OnUpdateFavoritesAdd(CCmdUI* pCmdUI) -{ - pCmdUI->Enable(m_iPlaybackMode == PM_FILE || m_iPlaybackMode == PM_DVD); -} - -void CMainFrame::OnFavoritesOrganize() -{ - CFavoriteOrganizeDlg dlg; - dlg.DoModal(); -} - -void CMainFrame::OnUpdateFavoritesOrganize(CCmdUI* pCmdUI) -{ - // TODO: Add your command update UI handler code here -} - -void CMainFrame::OnFavoritesFile(UINT nID) -{ - nID -= ID_FAVORITES_FILE_START; - - CAtlList sl; - AfxGetAppSettings().GetFav(FAV_FILE, sl); - - if(POSITION pos = sl.FindIndex(nID)) - { - CAtlList fns; - REFERENCE_TIME rtStart = 0; - - int i = 0, j = 0; - for(CString s1 = sl.GetAt(pos), s2 = s1.Tokenize(_T(";"), i); - !s2.IsEmpty(); - s2 = s1.Tokenize(_T(";"), i), j++) - { - if(j == 0) ; // desc - else if(j == 1) _stscanf(s2, _T("%I64d"), &rtStart); // pos - else fns.AddTail(s2); // subs - } - - m_wndPlaylistBar.Open(fns, false); - OpenCurPlaylistItem(max(rtStart, 0)); - } -} - -void CMainFrame::OnUpdateFavoritesFile(CCmdUI* pCmdUI) -{ - UINT nID = pCmdUI->m_nID - ID_FAVORITES_FILE_START; -} - -void CMainFrame::OnFavoritesDVD(UINT nID) -{ - nID -= ID_FAVORITES_DVD_START; - - CAtlList sl; - AfxGetAppSettings().GetFav(FAV_DVD, sl); - - if(POSITION pos = sl.FindIndex(nID)) - { - CString fn; - - CDVDStateStream stream; - stream.AddRef(); - - int i = 0, j = 0; - for(CString s1 = sl.GetAt(pos), s2 = s1.Tokenize(_T(";"), i); - !s2.IsEmpty(); - s2 = s1.Tokenize(_T(";"), i), j++) - { - if(j == 0) ; // desc - else if(j == 1 && s2 != _T("0")) // state - { - CStringToBin(s2, stream.m_data); - } - else if(j == 2) fn = s2; // path - } - - SendMessage(WM_COMMAND, ID_FILE_CLOSEMEDIA); - - CComPtr pDvdState; - HRESULT hr = OleLoadFromStream((IStream*)&stream, IID_IDvdState, (void**)&pDvdState); - - CAutoPtr p(new OpenDVDData()); - if(p) {p->path = fn; p->pDvdState = pDvdState;} - OpenMedia(p); - } -} - -void CMainFrame::OnUpdateFavoritesDVD(CCmdUI* pCmdUI) -{ - UINT nID = pCmdUI->m_nID - ID_FAVORITES_DVD_START; -} - -void CMainFrame::OnFavoritesDevice(UINT nID) -{ - nID -= ID_FAVORITES_DEVICE_START; -} - -void CMainFrame::OnUpdateFavoritesDevice(CCmdUI* pCmdUI) -{ - UINT nID = pCmdUI->m_nID - ID_FAVORITES_DEVICE_START; -} - -// help - -void CMainFrame::OnHelpHomepage() -{ - ShellExecute(m_hWnd, _T("open"), _T("http://sourceforge.net/projects/guliverkli2/"), NULL, NULL, SW_SHOWDEFAULT); -} - -void CMainFrame::OnHelpDocumentation() -{ - ShellExecute(m_hWnd, _T("open"), _T("http://sourceforge.net/project/showfiles.php?group_id=82303&package_id=144472"), NULL, NULL, SW_SHOWDEFAULT); -} - -////////////////////////////////// - -static BOOL CALLBACK MonitorEnumProc(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData) -{ - CAtlArray* ml = (CAtlArray*)dwData; - ml->Add(hMonitor); - return TRUE; -} - -void CMainFrame::SetDefaultWindowRect(int iMonitor) -{ - AppSettings& s = AfxGetAppSettings(); - - { - CRect r1, r2; - GetClientRect(&r1); - m_wndView.GetClientRect(&r2); - - CSize logosize = m_wndView.GetLogoSize(); - int _DEFCLIENTW = max(logosize.cx, DEFCLIENTW); - int _DEFCLIENTH = max(logosize.cy, DEFCLIENTH); - - if(GetSystemMetrics(SM_REMOTESESSION)) - _DEFCLIENTH = 0; - - DWORD style = GetStyle(); - - MENUBARINFO mbi; - memset(&mbi, 0, sizeof(mbi)); - mbi.cbSize = sizeof(mbi); - ::GetMenuBarInfo(m_hWnd, OBJID_MENU, 0, &mbi); - - int w = _DEFCLIENTW + GetSystemMetrics((style&WS_CAPTION)?SM_CXSIZEFRAME:SM_CXFIXEDFRAME)*2 - + r1.Width() - r2.Width(); - int h = _DEFCLIENTH + GetSystemMetrics((style&WS_CAPTION)?SM_CYSIZEFRAME:SM_CYFIXEDFRAME)*2 - + (mbi.rcBar.bottom - mbi.rcBar.top) - + r1.Height() - r2.Height() - + 1; // ??? -// + 2; // ??? - if(style&WS_CAPTION) h += GetSystemMetrics(SM_CYCAPTION); - - if(s.HasFixedWindowSize()) - { - w = s.fixedWindowSize.cx; - h = s.fixedWindowSize.cy; - } - else if(s.fRememberWindowSize) - { - w = s.rcLastWindowPos.Width(); - h = s.rcLastWindowPos.Height(); - } - - HMONITOR hMonitor = MonitorFromWindow(m_hWnd, MONITOR_DEFAULTTONEAREST); - - if(iMonitor > 0) - { - iMonitor--; - CAtlArray ml; - EnumDisplayMonitors(NULL, NULL, MonitorEnumProc, (LPARAM)&ml); - if(iMonitor < ml.GetCount()) hMonitor = ml[iMonitor]; - } - - MONITORINFO mi; - mi.cbSize = sizeof(MONITORINFO); - GetMonitorInfo(hMonitor, &mi); - - int x = (mi.rcWork.left+mi.rcWork.right-w)/2; - int y = (mi.rcWork.top+mi.rcWork.bottom-h)/2; - - if(s.fRememberWindowPos) - { - CRect r = s.rcLastWindowPos; -// x = r.CenterPoint().x - w/2; -// y = r.CenterPoint().y - h/2; - x = r.TopLeft().x; - y = r.TopLeft().y; - } - - UINT lastWindowType = s.lastWindowType; - - MoveWindow(x, y, w, h); - - if(s.fRememberWindowSize && s.fRememberWindowPos) - { - WINDOWPLACEMENT wp; - memset(&wp, 0, sizeof(wp)); - wp.length = sizeof(WINDOWPLACEMENT); - if(lastWindowType == SIZE_MAXIMIZED) - ShowWindow(SW_MAXIMIZE); - else if(lastWindowType == SIZE_MINIMIZED) - ShowWindow(SW_MINIMIZE); - } - } - - if(s.fHideCaptionMenu) - { - ModifyStyle(WS_CAPTION, 0, SWP_NOZORDER); - ::SetMenu(m_hWnd, NULL); - SetWindowPos(NULL, 0, 0, 0, 0, SWP_FRAMECHANGED|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER); - } -} - -void CMainFrame::RestoreDefaultWindowRect() -{ - AppSettings& s = AfxGetAppSettings(); - - WINDOWPLACEMENT wp; - GetWindowPlacement(&wp); - if(!m_fFullScreen && wp.showCmd != SW_SHOWMAXIMIZED && wp.showCmd != SW_SHOWMINIMIZED -// && (GetExStyle()&WS_EX_APPWINDOW) - && !s.fRememberWindowSize) - { - CRect r1, r2; - GetClientRect(&r1); - m_wndView.GetClientRect(&r2); - - CSize logosize = m_wndView.GetLogoSize(); - int _DEFCLIENTW = max(logosize.cx, DEFCLIENTW); - int _DEFCLIENTH = max(logosize.cy, DEFCLIENTH); - - DWORD style = GetStyle(); - - MENUBARINFO mbi; - memset(&mbi, 0, sizeof(mbi)); - mbi.cbSize = sizeof(mbi); - ::GetMenuBarInfo(m_hWnd, OBJID_MENU, 0, &mbi); - - int w = _DEFCLIENTW + GetSystemMetrics((style&WS_CAPTION)?SM_CXSIZEFRAME:SM_CXFIXEDFRAME)*2 - + r1.Width() - r2.Width(); - int h = _DEFCLIENTH + GetSystemMetrics((style&WS_CAPTION)?SM_CYSIZEFRAME:SM_CYFIXEDFRAME)*2 - + (mbi.rcBar.bottom - mbi.rcBar.top) - + r1.Height() - r2.Height() - + 1; // ??? -// + 2; // ??? - if(style&WS_CAPTION) h += GetSystemMetrics(SM_CYCAPTION); - - if(s.HasFixedWindowSize()) - { - w = s.fixedWindowSize.cx; - h = s.fixedWindowSize.cy; - } - - CRect r; - GetWindowRect(r); - - int x = r.CenterPoint().x - w/2; - int y = r.CenterPoint().y - h/2; - - if(s.fRememberWindowPos) - { - CRect r = s.rcLastWindowPos; - - x = r.TopLeft().x; - y = r.TopLeft().y; - } - - MoveWindow(x, y, w, h); - } -} - -OAFilterState CMainFrame::GetMediaState() -{ - OAFilterState ret = -1; - if(m_iMediaLoadState == MLS_LOADED) pMC->GetState(0, &ret); - return(ret); -} - -CSize CMainFrame::GetVideoSize() -{ - bool fKeepAspectRatio = AfxGetAppSettings().fKeepAspectRatio; - bool fCompMonDeskARDiff = AfxGetAppSettings().fCompMonDeskARDiff; - - CSize ret(0,0); - if(m_iMediaLoadState != MLS_LOADED || m_fAudioOnly) - return ret; - - CSize wh(0, 0), arxy(0, 0); - - if(m_pCAP) - { - wh = m_pCAP->GetVideoSize(false); - arxy = m_pCAP->GetVideoSize(fKeepAspectRatio); - } - else - { - pBV->GetVideoSize(&wh.cx, &wh.cy); - - long arx = 0, ary = 0; - CComQIPtr pBV2 = pBV; - if(pBV2 && SUCCEEDED(pBV2->GetPreferredAspectRatio(&arx, &ary)) && arx > 0 && ary > 0) - arxy.SetSize(arx, ary); - } - - if(wh.cx <= 0 || wh.cy <= 0) - return ret; - - // with the overlay mixer IBasicVideo2 won't tell the new AR when changed dynamically - DVD_VideoAttributes VATR; - if(m_iPlaybackMode == PM_DVD && SUCCEEDED(pDVDI->GetCurrentVideoAttributes(&VATR))) - arxy.SetSize(VATR.ulAspectX, VATR.ulAspectY); - - CSize& ar = AfxGetAppSettings().AspectRatio; - if(ar.cx && ar.cy) arxy = ar; - - ret = (!fKeepAspectRatio || arxy.cx <= 0 || arxy.cy <= 0) - ? wh - : CSize(MulDiv(wh.cy, arxy.cx, arxy.cy), wh.cy); - - if(fCompMonDeskARDiff) - if(HDC hDC = ::GetDC(0)) - { - int _HORZSIZE = GetDeviceCaps(hDC, HORZSIZE); - int _VERTSIZE = GetDeviceCaps(hDC, VERTSIZE); - int _HORZRES = GetDeviceCaps(hDC, HORZRES); - int _VERTRES = GetDeviceCaps(hDC, VERTRES); - - if(_HORZSIZE > 0 && _VERTSIZE > 0 && _HORZRES > 0 && _VERTRES > 0) - { - double a = 1.0*_HORZSIZE/_VERTSIZE; - double b = 1.0*_HORZRES/_VERTRES; - - if(b < a) - ret.cy = (DWORD)(1.0*ret.cy * a / b); - else if(a < b) - ret.cx = (DWORD)(1.0*ret.cx * b / a); - } - - ::ReleaseDC(0, hDC); - } - - return ret; -} - -void CMainFrame::ToggleFullscreen(bool fToNearest, bool fSwitchScreenResWhenHasTo) -{ - CRect r; -// const CWnd* pWndInsertAfter; - DWORD dwRemove = 0, dwAdd = 0; - DWORD dwRemoveEx = 0, dwAddEx = 0; - HMENU hMenu; - - if(!m_fFullScreen) - { - GetWindowRect(&m_lastWindowRect); - - dispmode& dm = AfxGetAppSettings().dmFullscreenRes; - m_dmBeforeFullscreen.fValid = false; - if(dm.fValid && fSwitchScreenResWhenHasTo) - { - GetCurDispMode(m_dmBeforeFullscreen); - SetDispMode(dm); - } - - MONITORINFO mi; - mi.cbSize = sizeof(MONITORINFO); - GetMonitorInfo(MonitorFromWindow(m_hWnd, MONITOR_DEFAULTTONEAREST), &mi); - - dwRemove = WS_CAPTION|WS_THICKFRAME; - if(fToNearest) r = mi.rcMonitor; - else GetDesktopWindow()->GetWindowRect(&r); - hMenu = NULL; - } - else - { - if(m_dmBeforeFullscreen.fValid) - SetDispMode(m_dmBeforeFullscreen); - - dwAdd = (AfxGetAppSettings().fHideCaptionMenu ? 0 : WS_CAPTION) | WS_THICKFRAME; - r = m_lastWindowRect; - hMenu = AfxGetAppSettings().fHideCaptionMenu ? NULL : m_hMenuDefault; - } - - m_lastMouseMove.x = m_lastMouseMove.y = -1; - - bool fAudioOnly = m_fAudioOnly; - m_fAudioOnly = true; - - m_fFullScreen = !m_fFullScreen; - - SetAlwaysOnTop(AfxGetAppSettings().iOnTop); - - ModifyStyle(dwRemove, dwAdd, SWP_NOZORDER); - ModifyStyleEx(dwRemoveEx, dwAddEx, SWP_NOZORDER); - ::SetMenu(m_hWnd, hMenu); - SetWindowPos(NULL, r.left, r.top, r.Width(), r.Height(), SWP_NOZORDER|SWP_NOSENDCHANGING /*SWP_FRAMECHANGED*/); - - if(m_fFullScreen) - { - m_fHideCursor = true; - ShowControls(CS_NONE, false); - } - else - { - KillTimer(TIMER_FULLSCREENCONTROLBARHIDER); - KillTimer(TIMER_FULLSCREENMOUSEHIDER); - m_fHideCursor = false; - ShowControls(AfxGetAppSettings().nCS); - } - - m_wndView.SetWindowPos(NULL, 0, 0, 0, 0, SWP_FRAMECHANGED|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER); - - m_fAudioOnly = fAudioOnly; - - MoveVideoWindow(); -} - -void CMainFrame::MoveVideoWindow(bool fShowStats) -{ - if(m_iMediaLoadState == MLS_LOADED && !m_fAudioOnly && IsWindowVisible()) - { - CRect wr; - if(!m_fFullScreen) - { - m_wndView.GetClientRect(wr); - if(!AfxGetAppSettings().fHideCaptionMenu) - wr.DeflateRect(2, 2); - } - else - { - GetWindowRect(&wr); - - // HACK - CRect r; - m_wndView.GetWindowRect(&r); - wr -= r.TopLeft(); - } - - CRect vr = CRect(0,0,0,0); - - OAFilterState fs = GetMediaState(); - if(fs == State_Paused || fs == State_Running || fs == State_Stopped && (m_fShockwaveGraph || m_fQuicktimeGraph)) - { - CSize arxy = GetVideoSize(); - - int iDefaultVideoSize = AfxGetAppSettings().iDefaultVideoSize; - - CSize ws = - iDefaultVideoSize == DVS_HALF ? CSize(arxy.cx/2, arxy.cy/2) : - iDefaultVideoSize == DVS_NORMAL ? arxy : - iDefaultVideoSize == DVS_DOUBLE ? CSize(arxy.cx*2, arxy.cy*2) : - wr.Size(); - - int w = ws.cx; - int h = ws.cy; - - if(!m_fShockwaveGraph) //&& !m_fQuicktimeGraph) - { - if(iDefaultVideoSize == DVS_FROMINSIDE || iDefaultVideoSize == DVS_FROMOUTSIDE) - { - h = ws.cy; - w = MulDiv(h, arxy.cx, arxy.cy); - - if(iDefaultVideoSize == DVS_FROMINSIDE && w > ws.cx - || iDefaultVideoSize == DVS_FROMOUTSIDE && w < ws.cx) - { - w = ws.cx; - h = MulDiv(w, arxy.cy, arxy.cx); - } - } - } - - CSize size( - (int)(m_ZoomX*w), - (int)(m_ZoomY*h)); - - CPoint pos( - (int)(m_PosX*(wr.Width()*3 - m_ZoomX*w) - wr.Width()), - (int)(m_PosY*(wr.Height()*3 - m_ZoomY*h) - wr.Height())); - -/* CPoint pos( - (int)(m_PosX*(wr.Width() - size.cx)), - (int)(m_PosY*(wr.Height() - size.cy))); - -*/ - vr = CRect(pos, size); - } - - wr |= CRect(0,0,0,0); - vr |= CRect(0,0,0,0); - - if(m_pCAP) - { - m_pCAP->SetPosition(wr, vr); - m_pCAP->SetVideoAngle(Vector(DegToRad(m_AngleX), DegToRad(m_AngleY), DegToRad(m_AngleZ))); - } - else - { - HRESULT hr; - hr = pBV->SetDefaultSourcePosition(); - hr = pBV->SetDestinationPosition(vr.left, vr.top, vr.Width(), vr.Height()); - hr = pVW->SetWindowPosition(wr.left, wr.top, wr.Width(), wr.Height()); - } - - m_wndView.SetVideoRect(wr); - - if(fShowStats && vr.Height() > 0) - { - CString info; - info.Format(_T("Pos %.2f %.2f, Zoom %.2f %.2f, AR %.2f"), m_PosX, m_PosY, m_ZoomX, m_ZoomY, (float)vr.Width()/vr.Height()); - SendStatusMessage(info, 3000); - } - } - else - { - m_wndView.SetVideoRect(); - } -} - -void CMainFrame::ZoomVideoWindow(double scale) -{ - if(m_iMediaLoadState != MLS_LOADED) - return; - - AppSettings& s = AfxGetAppSettings(); - - if(scale <= 0) - { - scale = - s.iZoomLevel == 0 ? 0.5 : - s.iZoomLevel == 1 ? 1.0 : - s.iZoomLevel == 2 ? 2.0 : - s.iZoomLevel == 3 ? GetZoomAutoFitScale() : - 1.0; - } - - if(m_fFullScreen) - { - OnViewFullscreen(); - } - - MINMAXINFO mmi; - OnGetMinMaxInfo(&mmi); - - CRect r; - int w = 0, h = 0; - - if(!m_fAudioOnly) - { - CSize arxy = GetVideoSize(); - - long lWidth = int(arxy.cx * scale + 0.5); - long lHeight = int(arxy.cy * scale + 0.5); - - DWORD style = GetStyle(); - - CRect r1, r2; - GetClientRect(&r1); - m_wndView.GetClientRect(&r2); - - w = GetSystemMetrics((style&WS_CAPTION)?SM_CXSIZEFRAME:SM_CXFIXEDFRAME)*2 - + r1.Width() - r2.Width() - + lWidth; - - MENUBARINFO mbi; - memset(&mbi, 0, sizeof(mbi)); - mbi.cbSize = sizeof(mbi); - ::GetMenuBarInfo(m_hWnd, OBJID_MENU, 0, &mbi); - - h = GetSystemMetrics((style&WS_CAPTION)?SM_CYSIZEFRAME:SM_CYFIXEDFRAME)*2 - + (mbi.rcBar.bottom - mbi.rcBar.top) - + r1.Height() - r2.Height() - + lHeight; - - if(style&WS_CAPTION) - { - h += GetSystemMetrics(SM_CYCAPTION); - w += 2; h += 2; // for the 1 pixel wide sunken frame - w += 2; h += 3; // for the inner black border - } - - GetWindowRect(r); - - w = max(w, mmi.ptMinTrackSize.x); - h = max(h, mmi.ptMinTrackSize.y); - } - else - { - GetWindowRect(r); - - w = r.Width(); // mmi.ptMinTrackSize.x; - h = mmi.ptMinTrackSize.y; - } - - // center window - if(!s.fRememberWindowPos) - { - CPoint cp = r.CenterPoint(); - r.left = cp.x - w/2; - r.top = cp.y - h/2; - } - - r.right = r.left + w; - r.bottom = r.top + h; - - MONITORINFO mi; - mi.cbSize = sizeof(MONITORINFO); - GetMonitorInfo(MonitorFromWindow(m_hWnd, MONITOR_DEFAULTTONEAREST), &mi); - if(r.right > mi.rcWork.right) r.OffsetRect(mi.rcWork.right-r.right, 0); - if(r.left < mi.rcWork.left) r.OffsetRect(mi.rcWork.left-r.left, 0); - if(r.bottom > mi.rcWork.bottom) r.OffsetRect(0, mi.rcWork.bottom-r.bottom); - if(r.top < mi.rcWork.top) r.OffsetRect(0, mi.rcWork.top-r.top); - - if(m_fFullScreen || !s.HasFixedWindowSize()) - { - MoveWindow(r); - } - -// ShowWindow(SW_SHOWNORMAL); - - MoveVideoWindow(); -} - -double CMainFrame::GetZoomAutoFitScale() -{ - if(m_iMediaLoadState != MLS_LOADED || m_fAudioOnly) - return 1.0; - - CSize arxy = GetVideoSize(); - - double sx = 2.0/3 * m_rcDesktop.Width() / arxy.cx; - double sy = 2.0/3 * m_rcDesktop.Height() / arxy.cy; - - return sx < sy ? sx : sy; -} - -void CMainFrame::RepaintVideo() -{ - if(m_pCAP) m_pCAP->Paint(false); -} - -void CMainFrame::SetShaders() -{ - if(!m_pCAP) return; - - AppSettings& s = AfxGetAppSettings(); - - CAtlStringMap s2s; - - POSITION pos = s.m_shaders.GetHeadPosition(); - while(pos) - { - const AppSettings::Shader* pShader = &s.m_shaders.GetNext(pos); - s2s[pShader->label] = pShader; - } - - m_pCAP->SetPixelShader(NULL, NULL); - - CAtlList labels; - - pos = m_shaderlabels.GetHeadPosition(); - while(pos) - { - const AppSettings::Shader* pShader = NULL; - if(s2s.Lookup(m_shaderlabels.GetNext(pos), pShader)) - { - CStringA target = pShader->target; - CStringA srcdata = pShader->srcdata; - - HRESULT hr = m_pCAP->SetPixelShader(srcdata, target); - - if(FAILED(hr)) - { - m_pCAP->SetPixelShader(NULL, NULL); - SendStatusMessage(_T("Could not load shader: ") + pShader->label, 3000); - return; - } - - labels.AddTail(pShader->label); - } - } - - if(m_iMediaLoadState == MLS_LOADED) - { - CString str = Implode(labels, '|'); - str.Replace(_T("|"), _T(", ")); - SendStatusMessage(_T("Shader: ") + str, 3000); - } -} - -void CMainFrame::UpdateShaders(CString label) -{ - if(!m_pCAP) return; - - if(m_shaderlabels.GetCount() <= 1) - m_shaderlabels.RemoveAll(); - - if(m_shaderlabels.IsEmpty() && !label.IsEmpty()) - m_shaderlabels.AddTail(label); - - bool fUpdate = m_shaderlabels.IsEmpty(); - - POSITION pos = m_shaderlabels.GetHeadPosition(); - while(pos) - { - if(label == m_shaderlabels.GetNext(pos)) - { - fUpdate = true; - break; - } - } - - if(fUpdate) SetShaders(); - -} - -void CMainFrame::SetBalance(int balance) -{ - AfxGetAppSettings().nBalance = balance; - - int sign = balance>0?-1:1; - balance = max(100-abs(balance), 1); - balance = (int)((log10(1.0*balance)-2)*5000*sign); - balance = max(min(balance, 10000), -10000); - - if(m_iMediaLoadState == MLS_LOADED) - pBA->put_Balance(balance); -} - -void CMainFrame::SetupIViAudReg() -{ - if(!AfxGetAppSettings().fAutoSpeakerConf) return; - - DWORD spc = 0, defchnum = 0; - - if(AfxGetAppSettings().fAutoSpeakerConf) - { - CComPtr pDS; - if(SUCCEEDED(DirectSoundCreate(NULL, &pDS, NULL)) - && SUCCEEDED(pDS->SetCooperativeLevel(m_hWnd, DSSCL_NORMAL))) - { - if(SUCCEEDED(pDS->GetSpeakerConfig(&spc))) - { - switch(spc) - { - case DSSPEAKER_DIRECTOUT: defchnum = 6; break; - case DSSPEAKER_HEADPHONE: defchnum = 2; break; - case DSSPEAKER_MONO: defchnum = 1; break; - case DSSPEAKER_QUAD: defchnum = 4; break; - default: - case DSSPEAKER_STEREO: defchnum = 2; break; - case DSSPEAKER_SURROUND: defchnum = 2; break; - case DSSPEAKER_5POINT1: defchnum = 5; break; - case DSSPEAKER_7POINT1: defchnum = 5; break; - } - } - } - } - else - { - defchnum = 2; - } - - CRegKey iviaud; - if(ERROR_SUCCESS == iviaud.Create(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\InterVideo\\Common\\AudioDec"))) - { - DWORD chnum = 0; - if(FAILED(iviaud.QueryDWORDValue(_T("AUDIO"), chnum))) chnum = 0; - if(chnum <= defchnum) // check if the user has already set it..., but we won't skip if it's lower than sensible :P - iviaud.SetDWORDValue(_T("AUDIO"), defchnum); - } -} - -// -// Open/Close -// - - -void CMainFrame::OpenCreateGraphObject(OpenMediaData* pOMD) -{ - ASSERT(pGB == NULL); - - m_fCustomGraph = false; - m_fRealMediaGraph = m_fShockwaveGraph = m_fQuicktimeGraph = false; - - AppSettings& s = AfxGetAppSettings(); - - if(OpenFileData* p = dynamic_cast(pOMD)) - { - engine_t engine = s.Formats.GetEngine(p->fns.GetHead()); - - CStringA ct = GetContentType(p->fns.GetHead()); - - if(ct == "video/x-ms-asf") - { - // TODO: put something here to make the windows media source filter load later - } - else if(ct == "audio/x-pn-realaudio" - || ct == "audio/x-pn-realaudio-plugin" - || ct == "audio/x-realaudio-secure" - || ct == "video/vnd.rn-realvideo-secure" - || ct == "application/vnd.rn-realmedia" - || ct.Find("vnd.rn-") >= 0 - || ct.Find("realaudio") >= 0 - || ct.Find("realvideo") >= 0) - { - engine = RealMedia; - } - else if(ct == "application/x-shockwave-flash") - { - engine = ShockWave; - } - else if(ct == "video/quicktime" - || ct == "application/x-quicktimeplayer") - { - engine = QuickTime; - } - - HRESULT hr; - CComPtr pUnk; - - if(engine == RealMedia) - { - if(!(pUnk = (IUnknown*)(INonDelegatingUnknown*)new CRealMediaGraph(m_wndView.m_hWnd, hr))) - throw _T("Out of memory"); - - if(SUCCEEDED(hr) && !!(pGB = CComQIPtr(pUnk))) - m_fRealMediaGraph = true; - } - else if(engine == ShockWave) - { - if(!(pUnk = (IUnknown*)(INonDelegatingUnknown*)new CShockwaveGraph(m_wndView.m_hWnd, hr))) - throw _T("Out of memory"); - - if(FAILED(hr) || !(pGB = CComQIPtr(pUnk))) - throw _T("Can't create shockwave control"); - - m_fShockwaveGraph = true; - } - else if(engine == QuickTime) - { - if(!(pUnk = (IUnknown*)(INonDelegatingUnknown*)new CQuicktimeGraph(m_wndView.m_hWnd, hr))) - throw _T("Out of memory"); - - if(SUCCEEDED(hr) && !!(pGB = CComQIPtr(pUnk))) - m_fQuicktimeGraph = true; - } - - m_fCustomGraph = m_fRealMediaGraph || m_fShockwaveGraph || m_fQuicktimeGraph; - - if(!m_fCustomGraph) - { - pGB = new CFGManagerPlayer(_T("CFGManagerPlayer"), NULL, s.SrcFilters, s.TraFilters, m_wndView.m_hWnd); - } - } - else if(OpenDVDData* p = dynamic_cast(pOMD)) - { - pGB = new CFGManagerDVD(_T("CFGManagerDVD"), NULL, s.SrcFilters, s.TraFilters, m_wndView.m_hWnd); - } - else if(OpenDeviceData* p = dynamic_cast(pOMD)) - { - pGB = new CFGManagerCapture(_T("CFGManagerCapture"), NULL, s.SrcFilters, s.TraFilters, m_wndView.m_hWnd); - } - - if(!pGB) - { - throw _T("Failed to create the filter graph object"); - } - - pGB->AddToROT(); - - pMC = pGB; pME = pGB; pMS = pGB; // general - pVW = pGB; pBV = pGB; // video - pBA = pGB; // audio - pFS = pGB; - - if(!(pMC && pME && pMS) - || !(pVW && pBV) - || !(pBA)) - { - throw _T("Failed to query the needed interfaces for playback"); - } - - if(FAILED(pME->SetNotifyWindow((OAHWND)m_hWnd, WM_GRAPHNOTIFY, 0))) - { - throw _T("Could not set target window for graph notification"); - } - - m_pProv = (IUnknown*)new CKeyProvider(); - - if(CComQIPtr pObjectWithSite = pGB) - pObjectWithSite->SetSite(m_pProv); - - m_pCB = new CDSMChapterBag(NULL, NULL); -} - -void CMainFrame::OpenFile(OpenFileData* pOFD) -{ - if(pOFD->fns.IsEmpty()) - throw _T("Invalid argument"); - - AppSettings& s = AfxGetAppSettings(); - - bool fFirst = true; - - POSITION pos = pOFD->fns.GetHeadPosition(); - while(pos) - { - CString fn = pOFD->fns.GetNext(pos); - - fn.Trim(); - if(fn.IsEmpty() && !fFirst) - break; - - HRESULT hr = pGB->RenderFile(CStringW(fn), NULL); - - if(FAILED(hr)) - { - if(fFirst) - { - if(s.fReportFailedPins) - { - CComQIPtr pGBDE = pGB; - if(pGBDE && pGBDE->GetCount()) CMediaTypesDlg(pGBDE, this).DoModal(); - } - - CString err; - - switch(hr) - { - case E_ABORT: err = _T("Opening aborted"); break; - case E_FAIL: case E_POINTER: default: err = _T("Failed to render the file"); break; - case E_INVALIDARG: err = _T("Invalid file name"); break; - case E_OUTOFMEMORY: err = _T("Out of memory"); break; - case VFW_E_CANNOT_CONNECT: err = _T("Cannot connect the filters"); break; - case VFW_E_CANNOT_LOAD_SOURCE_FILTER: err = _T("Cannot load any source filter"); break; - case VFW_E_CANNOT_RENDER: err = _T("Cannot render the file"); break; - case VFW_E_INVALID_FILE_FORMAT: err = _T("Invalid file format"); break; - case VFW_E_NOT_FOUND: err = _T("File not found"); break; - case VFW_E_UNKNOWN_FILE_TYPE: err = _T("Unknown file type"); break; - case VFW_E_UNSUPPORTED_STREAM: err = _T("Unsupported stream"); break; - } - - throw err; - } - } - - if(s.fKeepHistory) - { - CRecentFileList* pMRU = fFirst ? &s.MRU : &s.MRUDub; - pMRU->ReadList(); - pMRU->Add(fn); - pMRU->WriteList(); - } - - if(fFirst) - { - pOFD->title = fn; - } - - fFirst = false; - - if(m_fCustomGraph) break; - } - - if(s.fReportFailedPins) - { - CComQIPtr pGBDE = pGB; - if(pGBDE && pGBDE->GetCount()) CMediaTypesDlg(pGBDE, this).DoModal(); - } - - if(!(pAMOP = pGB)) - { - BeginEnumFilters(pGB, pEF, pBF) - if(pAMOP = pBF) break; - EndEnumFilters - } - - if(FindFilter(__uuidof(CShoutcastSource), pGB)) - m_fUpdateInfoBar = true; - - SetupChapters(); - - CComQIPtr pKFI; - BeginEnumFilters(pGB, pEF, pBF) - if(pKFI = pBF) break; - EndEnumFilters - UINT nKFs = 0, nKFsTmp = 0; - if(pKFI && S_OK == pKFI->GetKeyFrameCount(nKFs) && nKFs > 0) - { - m_kfs.SetCount(nKFsTmp = nKFs); - if(S_OK != pKFI->GetKeyFrames(&TIME_FORMAT_MEDIA_TIME, m_kfs.GetData(), nKFsTmp) || nKFsTmp != nKFs) - m_kfs.RemoveAll(); - } - - m_iPlaybackMode = PM_FILE; -} - -void CMainFrame::SetupChapters() -{ - ASSERT(m_pCB); - - m_pCB->ChapRemoveAll(); - - CInterfaceList pBFs; - BeginEnumFilters(pGB, pEF, pBF) - pBFs.AddTail(pBF); - EndEnumFilters - - POSITION pos; - - pos = pBFs.GetHeadPosition(); - while(pos && !m_pCB->ChapGetCount()) - { - IBaseFilter* pBF = pBFs.GetNext(pos); - - CComQIPtr pCB = pBF; - if(!pCB) continue; - - for(DWORD i = 0, cnt = pCB->ChapGetCount(); i < cnt; i++) - { - REFERENCE_TIME rt; - CComBSTR name; - if(SUCCEEDED(pCB->ChapGet(i, &rt, &name))) - m_pCB->ChapAppend(rt, name); - } - } - - pos = pBFs.GetHeadPosition(); - while(pos && !m_pCB->ChapGetCount()) - { - IBaseFilter* pBF = pBFs.GetNext(pos); - - CComQIPtr pCI = pBF; - if(!pCI) continue; - - CHAR iso6391[3]; - ::GetLocaleInfoA(LOCALE_USER_DEFAULT, LOCALE_SISO639LANGNAME, iso6391, 3); - CStringA iso6392 = ISO6391To6392(iso6391); - if(iso6392.GetLength() < 3) iso6392 = "eng"; - - UINT cnt = pCI->GetChapterCount(CHAPTER_ROOT_ID); - for(UINT i = 1; i <= cnt; i++) - { - UINT cid = pCI->GetChapterId(CHAPTER_ROOT_ID, i); - - ChapterElement ce; - if(pCI->GetChapterInfo(cid, &ce)) - { - char pl[3] = {iso6392[0], iso6392[1], iso6392[2]}; - char cc[] = " "; - CComBSTR name; - name.Attach(pCI->GetChapterStringInfo(cid, pl, cc)); - m_pCB->ChapAppend(ce.rtStart, name); - } - } - } - - pos = pBFs.GetHeadPosition(); - while(pos && !m_pCB->ChapGetCount()) - { - IBaseFilter* pBF = pBFs.GetNext(pos); - - CComQIPtr pES = pBF; - if(!pES) continue; - - long MarkerCount = 0; - if(SUCCEEDED(pES->get_MarkerCount(&MarkerCount))) - { - for(long i = 1; i <= MarkerCount; i++) - { - double MarkerTime = 0; - if(SUCCEEDED(pES->GetMarkerTime(i, &MarkerTime))) - { - CStringW name; - name.Format(L"Chapter %d", i); - - CComBSTR bstr; - if(S_OK == pES->GetMarkerName(i, &bstr)) - name = bstr; - - m_pCB->ChapAppend(REFERENCE_TIME(MarkerTime*10000000), name); - } - } - } - } - - pos = pBFs.GetHeadPosition(); - while(pos && !m_pCB->ChapGetCount()) - { - IBaseFilter* pBF = pBFs.GetNext(pos); - - if(GetCLSID(pBF) != CLSID_OggSplitter) - continue; - - BeginEnumPins(pBF, pEP, pPin) - { - if(m_pCB->ChapGetCount()) break; - - if(CComQIPtr pPB = pPin) - { - for(int i = 1; ; i++) - { - CStringW str; - CComVariant var; - - var.Clear(); - str.Format(L"CHAPTER%02d", i); - if(S_OK != pPB->Read(str, &var, NULL)) - break; - - int h, m, s, ms; - WCHAR wc; - if(7 != swscanf(CStringW(var), L"%d%c%d%c%d%c%d", &h, &wc, &m, &wc, &s, &wc, &ms)) - break; - - CStringW name; - name.Format(L"Chapter %d", i); - var.Clear(); - str += L"NAME"; - if(S_OK == pPB->Read(str, &var, NULL)) - name = var; - - m_pCB->ChapAppend(10000i64*(((h*60 + m)*60 + s)*1000 + ms), name); - } - } - } - EndEnumPins - } - - m_pCB->ChapSort(); -} - -void CMainFrame::OpenDVD(OpenDVDData* pODD) -{ - HRESULT hr = pGB->RenderFile(CStringW(pODD->path), NULL); - - AppSettings& s = AfxGetAppSettings(); - - if(s.fReportFailedPins) - { - CComQIPtr pGBDE = pGB; - if(pGBDE && pGBDE->GetCount()) CMediaTypesDlg(pGBDE, this).DoModal(); - } - - BeginEnumFilters(pGB, pEF, pBF) - { - if((pDVDC = pBF) && (pDVDI = pBF)) - break; - } - EndEnumFilters - - if(hr == E_INVALIDARG) - throw _T("Cannot find DVD directory"); - else if(hr == VFW_E_CANNOT_RENDER) - throw _T("Failed to render all pins of the DVD Navigator filter"); - else if(hr == VFW_S_PARTIAL_RENDER) - throw _T("Failed to render some of the pins of the DVD Navigator filter"); - else if(hr == E_NOINTERFACE || !pDVDC || !pDVDI) - throw _T("Failed to query the needed interfaces for DVD playback"); - else if(hr == VFW_E_CANNOT_LOAD_SOURCE_FILTER) - throw _T("Can't create the DVD Navigator filter"); - else if(FAILED(hr)) - throw _T("Failed"); - - WCHAR buff[MAX_PATH]; - ULONG len = 0; - if(SUCCEEDED(hr = pDVDI->GetDVDDirectory(buff, countof(buff), &len))) - pODD->title = CString(CStringW(buff)); - - // TODO: resetdvd - - pDVDC->SetOption(DVD_ResetOnStop, FALSE); - pDVDC->SetOption(DVD_HMSF_TimeCodeEvents, TRUE); - - if(s.idMenuLang) pDVDC->SelectDefaultMenuLanguage(s.idMenuLang); - if(s.idAudioLang) pDVDC->SelectDefaultAudioLanguage(s.idAudioLang, DVD_AUD_EXT_NotSpecified); - if(s.idSubtitlesLang) pDVDC->SelectDefaultSubpictureLanguage(s.idSubtitlesLang, DVD_SP_EXT_NotSpecified); - - m_iDVDDomain = DVD_DOMAIN_Stop; - - m_iPlaybackMode = PM_DVD; -} - -void CMainFrame::OpenCapture(OpenDeviceData* pODD) -{ - CStringW vidfrname, audfrname; - CComPtr pVidCapTmp, pAudCapTmp; - - m_VidDispName = pODD->DisplayName[0]; - - if(!m_VidDispName.IsEmpty()) - { - if(!CreateFilter(m_VidDispName, &pVidCapTmp, vidfrname)) - throw _T("Can't create video capture filter"); - } - - m_AudDispName = pODD->DisplayName[1]; - - if(!m_AudDispName.IsEmpty()) - { - if(!CreateFilter(m_AudDispName, &pAudCapTmp, audfrname)) - throw _T("Can't create video capture filter"); - } - - if(!pVidCapTmp && !pAudCapTmp) - { - throw _T("No capture filters"); - } - - pCGB = NULL; - pVidCap = NULL; - pAudCap = NULL; - - if(FAILED(pCGB.CoCreateInstance(CLSID_CaptureGraphBuilder2))) - { - throw _T("Can't create capture graph builder object"); - } - - HRESULT hr; - - pCGB->SetFiltergraph(pGB); - - if(pVidCapTmp) - { - if(FAILED(hr = pGB->AddFilter(pVidCapTmp, vidfrname))) - { - throw _T("Can't add video capture filter to the graph"); - } - - pVidCap = pVidCapTmp; - - if(!pAudCapTmp) - { - if(FAILED(pCGB->FindInterface(&PIN_CATEGORY_CAPTURE, &MEDIATYPE_Interleaved, pVidCap, IID_IAMStreamConfig, (void **)&pAMVSCCap)) - && FAILED(pCGB->FindInterface(&PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video, pVidCap, IID_IAMStreamConfig, (void **)&pAMVSCCap))) - TRACE(_T("Warning: No IAMStreamConfig interface for vidcap capture")); - - if(FAILED(pCGB->FindInterface(&PIN_CATEGORY_PREVIEW, &MEDIATYPE_Interleaved, pVidCap, IID_IAMStreamConfig, (void **)&pAMVSCPrev)) - && FAILED(pCGB->FindInterface(&PIN_CATEGORY_PREVIEW, &MEDIATYPE_Video, pVidCap, IID_IAMStreamConfig, (void **)&pAMVSCPrev))) - TRACE(_T("Warning: No IAMStreamConfig interface for vidcap capture")); - - if(FAILED(pCGB->FindInterface(&PIN_CATEGORY_CAPTURE, &MEDIATYPE_Audio, pVidCap, IID_IAMStreamConfig, (void **)&pAMASC)) - && FAILED(pCGB->FindInterface(&PIN_CATEGORY_PREVIEW, &MEDIATYPE_Audio, pVidCap, IID_IAMStreamConfig, (void **)&pAMASC))) - { - TRACE(_T("Warning: No IAMStreamConfig interface for vidcap")); - } - else - { - pAudCap = pVidCap; - } - } - else - { - if(FAILED(pCGB->FindInterface(&PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video, pVidCap, IID_IAMStreamConfig, (void **)&pAMVSCCap))) - TRACE(_T("Warning: No IAMStreamConfig interface for vidcap capture")); - - if(FAILED(pCGB->FindInterface(&PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video, pVidCap, IID_IAMStreamConfig, (void **)&pAMVSCPrev))) - TRACE(_T("Warning: No IAMStreamConfig interface for vidcap capture")); - } - - if(FAILED(pCGB->FindInterface(&LOOK_UPSTREAM_ONLY, NULL, pVidCap, IID_IAMCrossbar, (void**)&pAMXBar))) - TRACE(_T("Warning: No IAMCrossbar interface was found\n")); - - if(FAILED(pCGB->FindInterface(&LOOK_UPSTREAM_ONLY, NULL, pVidCap, IID_IAMTVTuner, (void**)&pAMTuner))) - TRACE(_T("Warning: No IAMTVTuner interface was found\n")); -/* - if(pAMVSCCap) - { -//DumpStreamConfig(_T("c:\\mpclog.txt"), pAMVSCCap); - CComQIPtr pVfwCD = pVidCap; - if(!pAMXBar && pVfwCD) - { - m_wndCaptureBar.m_capdlg.SetupVideoControls(viddispname, pAMVSCCap, pVfwCD); - } - else - { - m_wndCaptureBar.m_capdlg.SetupVideoControls(viddispname, pAMVSCCap, pAMXBar, pAMTuner); - } - } -*/ - // TODO: init pAMXBar - - if(pAMTuner) // load saved channel - { - pAMTuner->put_CountryCode(AfxGetApp()->GetProfileInt(_T("Capture"), _T("Country"), 1)); - - int vchannel = pODD->vchannel; - if(vchannel < 0) vchannel = AfxGetApp()->GetProfileInt(_T("Capture\\") + CString(m_VidDispName), _T("Channel"), -1); - if(vchannel >= 0) - { - OAFilterState fs = State_Stopped; - pMC->GetState(0, &fs); - if(fs == State_Running) pMC->Pause(); - pAMTuner->put_Channel(vchannel, AMTUNER_SUBCHAN_DEFAULT, AMTUNER_SUBCHAN_DEFAULT); - if(fs == State_Running) pMC->Run(); - } - } - } - - if(pAudCapTmp) - { - if(FAILED(hr = pGB->AddFilter(pAudCapTmp, CStringW(audfrname)))) - { - throw _T("Can't add audio capture filter to the graph"); - } - - pAudCap = pAudCapTmp; - - if(FAILED(pCGB->FindInterface(&PIN_CATEGORY_CAPTURE, &MEDIATYPE_Audio, pAudCap, IID_IAMStreamConfig, (void **)&pAMASC)) - && FAILED(pCGB->FindInterface(&PIN_CATEGORY_PREVIEW, &MEDIATYPE_Audio, pAudCap, IID_IAMStreamConfig, (void **)&pAMASC))) - { - TRACE(_T("Warning: No IAMStreamConfig interface for vidcap")); - } -/* - CInterfaceArray pAMAIM; - - BeginEnumPins(pAudCap, pEP, pPin) - { - PIN_DIRECTION dir; - if(FAILED(pPin->QueryDirection(&dir)) || dir != PINDIR_INPUT) - continue; - - if(CComQIPtr pAIM = pPin) - pAMAIM.Add(pAIM); - } - EndEnumPins - - if(pAMASC) - { - m_wndCaptureBar.m_capdlg.SetupAudioControls(auddispname, pAMASC, pAMAIM); - } -*/ - } - - if(!(pVidCap || pAudCap)) - { - throw _T("Couldn't open any device"); - } - - pODD->title = _T("Live"); - - m_iPlaybackMode = PM_CAPTURE; -} - -void CMainFrame::OpenCustomizeGraph() -{ - if(m_iPlaybackMode == PM_CAPTURE) - return; - - CleanGraph(); - - if(m_iPlaybackMode == PM_FILE) - { - if(m_pCAP) { - if(AfxGetAppSettings().fAutoloadSubtitles) { - AddTextPassThruFilter(); - } - } - } - - if(m_iPlaybackMode == PM_DVD) - { - BeginEnumFilters(pGB, pEF, pBF) - { - if(CComQIPtr pDVS2 = pBF) - { -// pDVS2->AdviseSubClock(m_pSubClock = new CSubClock); -// break; - - // TODO: test multiple dvobsub instances with one clock - if(!m_pSubClock) m_pSubClock = new CSubClock; - pDVS2->AdviseSubClock(m_pSubClock); - } - } - EndEnumFilters - } - - BeginEnumFilters(pGB, pEF, pBF) - { - if(GetCLSID(pBF) == CLSID_OggSplitter) - { - if(CComQIPtr pSS = pBF) - { - LCID idAudio = AfxGetAppSettings().idAudioLang; - if(!idAudio) idAudio = GetUserDefaultLCID(); - LCID idSub = AfxGetAppSettings().idSubtitlesLang; - if(!idSub) idSub = GetUserDefaultLCID(); - - DWORD cnt = 0; - pSS->Count(&cnt); - for(DWORD i = 0; i < cnt; i++) - { - AM_MEDIA_TYPE* pmt = NULL; - DWORD dwFlags = 0; - LCID lcid = 0; - DWORD dwGroup = 0; - WCHAR* pszName = NULL; - if(SUCCEEDED(pSS->Info((long)i, &pmt, &dwFlags, &lcid, &dwGroup, &pszName, NULL, NULL))) - { - CStringW name(pszName), sound(L"Sound"), subtitle(L"Subtitle"); - - if(idAudio != -1 && (idAudio&0x3ff) == (lcid&0x3ff) // sublang seems to be zeroed out in ogm... - && name.GetLength() > sound.GetLength() - && !name.Left(sound.GetLength()).CompareNoCase(sound)) - { - if(SUCCEEDED(pSS->Enable(i, AMSTREAMSELECTENABLE_ENABLE))) - idAudio = -1; - } - - if(idSub != -1 && (idSub&0x3ff) == (lcid&0x3ff) // sublang seems to be zeroed out in ogm... - && name.GetLength() > subtitle.GetLength() - && !name.Left(subtitle.GetLength()).CompareNoCase(subtitle) - && name.Mid(subtitle.GetLength()).Trim().CompareNoCase(L"off")) - { - if(SUCCEEDED(pSS->Enable(i, AMSTREAMSELECTENABLE_ENABLE))) - idSub = -1; - } - - if(pmt) DeleteMediaType(pmt); - if(pszName) CoTaskMemFree(pszName); - } - } - } - } - } - EndEnumFilters - - CleanGraph(); -} - -void CMainFrame::OpenSetupVideo() -{ - m_fAudioOnly = true; - - if(m_pCAP) - { - CSize vs = m_pCAP->GetVideoSize(); - m_fAudioOnly = (vs.cx <= 0 || vs.cy <= 0); - } - else - { - { - long w = 0, h = 0; - - if(CComQIPtr pBV = pGB) - { - pBV->GetVideoSize(&w, &h); - } - - if(w > 0 && h > 0) - { - m_fAudioOnly = false; - } - } - - if(m_fAudioOnly) - { - BeginEnumFilters(pGB, pEF, pBF) - { - long w = 0, h = 0; - - if(CComQIPtr pVW = pBF) - { - long lVisible; - if(FAILED(pVW->get_Visible(&lVisible))) - continue; - - pVW->get_Width(&w); - pVW->get_Height(&h); - } - - if(w > 0 && h > 0) - { - m_fAudioOnly = false; - break; - } - } - EndEnumFilters - } - } - - if(m_fShockwaveGraph) - { - m_fAudioOnly = false; - } - - if(m_pCAP) - { - SetShaders(); - } - // else - { - // TESTME - - pVW->put_Owner((OAHWND)m_wndView.m_hWnd); - pVW->put_WindowStyle(WS_CHILD|WS_CLIPSIBLINGS|WS_CLIPCHILDREN); - pVW->put_MessageDrain((OAHWND)m_hWnd); - - for(CWnd* pWnd = m_wndView.GetWindow(GW_CHILD); pWnd; pWnd = pWnd->GetNextWindow()) - pWnd->EnableWindow(FALSE); // little trick to let WM_SETCURSOR thru - } -} - -void CMainFrame::OpenSetupAudio() -{ - pBA->put_Volume(m_wndToolBar.Volume); - - // FIXME - int balance = AfxGetAppSettings().nBalance; - int sign = balance>0?-1:1; - balance = max(100-abs(balance), 1); - balance = (int)((log10(1.0*balance)-2)*5000*sign); - balance = max(min(balance, 10000), -10000); - pBA->put_Balance(balance); -} -/* -void CMainFrame::OpenSetupToolBar() -{ -// m_wndToolBar.Volume = AfxGetAppSettings().nVolume; -// SetBalance(AfxGetAppSettings().nBalance); -} -*/ -void CMainFrame::OpenSetupCaptureBar() -{ - if(m_iPlaybackMode == PM_CAPTURE) - { - if(pVidCap && pAMVSCCap) - { - CComQIPtr pVfwCD = pVidCap; - - if(!pAMXBar && pVfwCD) - { - m_wndCaptureBar.m_capdlg.SetupVideoControls(m_VidDispName, pAMVSCCap, pVfwCD); - } - else - { - m_wndCaptureBar.m_capdlg.SetupVideoControls(m_VidDispName, pAMVSCCap, pAMXBar, pAMTuner); - } - } - - if(pAudCap && pAMASC) - { - CInterfaceArray pAMAIM; - - BeginEnumPins(pAudCap, pEP, pPin) - { - if(CComQIPtr pAIM = pPin) - pAMAIM.Add(pAIM); - } - EndEnumPins - - m_wndCaptureBar.m_capdlg.SetupAudioControls(m_AudDispName, pAMASC, pAMAIM); - } - } - - BuildGraphVideoAudio( - m_wndCaptureBar.m_capdlg.m_fVidPreview, false, - m_wndCaptureBar.m_capdlg.m_fAudPreview, false); -} - -void CMainFrame::OpenSetupInfoBar() -{ - if(m_iPlaybackMode == PM_FILE) - { - bool fEmpty = true; - BeginEnumFilters(pGB, pEF, pBF) - { - if(CComQIPtr pAMMC = pBF) - { - CComBSTR bstr; - if(SUCCEEDED(pAMMC->get_Title(&bstr))) {m_wndInfoBar.SetLine(ResStr(IDS_INFOBAR_TITLE), bstr.m_str); if(bstr.Length()) fEmpty = false;} - if(SUCCEEDED(pAMMC->get_AuthorName(&bstr))) {m_wndInfoBar.SetLine(ResStr(IDS_INFOBAR_AUTHOR), bstr.m_str); if(bstr.Length()) fEmpty = false;} - if(SUCCEEDED(pAMMC->get_Copyright(&bstr))) {m_wndInfoBar.SetLine(ResStr(IDS_INFOBAR_COPYRIGHT), bstr.m_str); if(bstr.Length()) fEmpty = false;} - if(SUCCEEDED(pAMMC->get_Rating(&bstr))) {m_wndInfoBar.SetLine(ResStr(IDS_INFOBAR_RATING), bstr.m_str); if(bstr.Length()) fEmpty = false;} - if(SUCCEEDED(pAMMC->get_Description(&bstr))) {m_wndInfoBar.SetLine(ResStr(IDS_INFOBAR_DESCRIPTION), bstr.m_str); if(bstr.Length()) fEmpty = false;} - if(!fEmpty) - { - RecalcLayout(); - break; - } - } - } - EndEnumFilters - } - else if(m_iPlaybackMode == PM_DVD) - { - CString info('-'); - m_wndInfoBar.SetLine(ResStr(IDS_INFOBAR_DOMAIN), info); - m_wndInfoBar.SetLine(ResStr(IDS_INFOBAR_LOCATION), info); - m_wndInfoBar.SetLine(ResStr(IDS_INFOBAR_VIDEO), info); - m_wndInfoBar.SetLine(ResStr(IDS_INFOBAR_AUDIO), info); - m_wndInfoBar.SetLine(ResStr(IDS_INFOBAR_SUBTITLES), info); - RecalcLayout(); - } -} - -void CMainFrame::OpenSetupStatsBar() -{ - CString info('-'); - - BeginEnumFilters(pGB, pEF, pBF) - { - if(!pQP && (pQP = pBF)) - { - m_wndStatsBar.SetLine(_T("Frame-rate"), info); - m_wndStatsBar.SetLine(_T("Sync Offset"), info); - m_wndStatsBar.SetLine(_T("Frames"), info); - m_wndStatsBar.SetLine(_T("Jitter"), info); - m_wndStatsBar.SetLine(_T("Buffers"), info); - m_wndStatsBar.SetLine(_T("Bitrate"), info); - RecalcLayout(); - } - - if(!pBI && (pBI = pBF)) - { - m_wndStatsBar.SetLine(_T("Buffers"), info); - m_wndStatsBar.SetLine(_T("Bitrate"), info); // FIXME: shouldn't be here - RecalcLayout(); - } - } - EndEnumFilters -} - -void CMainFrame::OpenSetupStatusBar() -{ - m_wndStatusBar.ShowTimer(true); - - // - - if(!m_fCustomGraph) - { - UINT id = IDB_NOAUDIO; - - BeginEnumFilters(pGB, pEF, pBF) - { - CComQIPtr pBA = pBF; - if(!pBA) continue; - - BeginEnumPins(pBF, pEP, pPin) - { - if(S_OK == pGB->IsPinDirection(pPin, PINDIR_INPUT) - && S_OK == pGB->IsPinConnected(pPin)) - { - AM_MEDIA_TYPE mt; - memset(&mt, 0, sizeof(mt)); - pPin->ConnectionMediaType(&mt); - - if(mt.majortype == MEDIATYPE_Audio && mt.formattype == FORMAT_WaveFormatEx) - { - switch(((WAVEFORMATEX*)mt.pbFormat)->nChannels) - { - case 1: id = IDB_MONO; break; - case 2: default: id = IDB_STEREO; break; - } - break; - } - else if(mt.majortype == MEDIATYPE_Midi) - { - id = NULL; - break; - } - } - } - EndEnumPins - - if(id != IDB_NOAUDIO) - { - break; - } - } - EndEnumFilters - - m_wndStatusBar.SetStatusBitmap(id); - } - - // - - HICON hIcon = NULL; - - if(m_iPlaybackMode == PM_FILE) - { - CString fn = m_wndPlaylistBar.GetCur(); - CString ext = fn.Mid(fn.ReverseFind('.')+1); - hIcon = LoadIcon(ext, true); - } - else if(m_iPlaybackMode == PM_DVD) - { - hIcon = LoadIcon(_T(".ifo"), true); - } - else if(m_iPlaybackMode == PM_DVD) - { - // hIcon = ; // TODO - } - - m_wndStatusBar.SetStatusTypeIcon(hIcon); -} - -void CMainFrame::OpenSetupWindowTitle(CString fn) -{ - CString title(MAKEINTRESOURCE(IDR_MAINFRAME)); - - AppSettings& s = AfxGetAppSettings(); - - int i = s.iTitleBarTextStyle; - - if(!fn.IsEmpty() && (i == 0 || i == 1)) - { - if(i == 1) - { - if(m_iPlaybackMode == PM_FILE) - { - fn.Replace('\\', '/'); - CString fn2 = fn.Mid(fn.ReverseFind('/')+1); - if(!fn2.IsEmpty()) fn = fn2; - - if(s.fTitleBarTextTitle) - { - BeginEnumFilters(pGB, pEF, pBF) - { - if(CComQIPtr pAMMC = pBF) - { - CComBSTR bstr; - if(SUCCEEDED(pAMMC->get_Title(&bstr)) && bstr.Length()) - { - fn = CString(bstr.m_str); - break; - } - } - } - EndEnumFilters - } - } - else if(m_iPlaybackMode == PM_DVD) - { - fn = _T("DVD"); - } - else if(m_iPlaybackMode == PM_CAPTURE) - { - fn = _T("Live"); - } - } - - title = fn + _T(" - ") + title; - } - - SetWindowText(title); -} - -bool CMainFrame::OpenMediaPrivate(CAutoPtr pOMD) -{ - if(m_iMediaLoadState != MLS_CLOSED && m_iMediaLoadState != MLS_LOADING) - { - ASSERT(0); - return(false); - } - - m_iMediaLoadState = MLS_LOADING; - - // FIXME: Don't show "Closed" initially - PostMessage(WM_KICKIDLE); - - CString err, aborted(_T("Aborted")); - - m_fUpdateInfoBar = false; - - try - { - if(m_fOpeningAborted) throw aborted; - - if(OpenFileData* pOFD = dynamic_cast(pOMD.m_p)) - { - if(pOFD->fns.IsEmpty()) throw _T("File not found"); - - CString fn = pOFD->fns.GetHead(); - - int i = fn.Find(_T(":\\")); - if(i > 0) - { - CString drive = fn.Left(i+2); - UINT type = GetDriveType(drive); - CAtlList sl; - if(type == DRIVE_REMOVABLE || type == DRIVE_CDROM && GetCDROMType(drive[0], sl) != CDROM_Audio) - { - int ret = IDRETRY; - while(ret == IDRETRY) - { - WIN32_FIND_DATA findFileData; - HANDLE h = FindFirstFile(fn, &findFileData); - if(h != INVALID_HANDLE_VALUE) - { - FindClose(h); - ret = IDOK; - } - else - { - CString msg; - msg.Format(_T("%s was not found, please insert media containing this file."), fn); - ret = AfxMessageBox(msg, MB_RETRYCANCEL); - } - } - - if(ret != IDOK) throw aborted; - } - } - } - - if(m_fOpeningAborted) throw aborted; - - OpenCreateGraphObject(pOMD); - - if(m_fOpeningAborted) throw aborted; - - SetupIViAudReg(); - - if(m_fOpeningAborted) throw aborted; - - if(OpenFileData* p = dynamic_cast(pOMD.m_p)) OpenFile(p); - else if(OpenDVDData* p = dynamic_cast(pOMD.m_p)) OpenDVD(p); - else if(OpenDeviceData* p = dynamic_cast(pOMD.m_p)) OpenCapture(p); - else throw _T("Can't open, invalid input parameters"); - - pGB->FindInterface(__uuidof(ISubPicAllocatorPresenter), (void**)&m_pCAP, TRUE); - - if(m_fOpeningAborted) throw aborted; - - OpenCustomizeGraph(); - - if(m_fOpeningAborted) throw aborted; - - OpenSetupVideo(); - - if(m_fOpeningAborted) throw aborted; - - OpenSetupAudio(); - - if(m_fOpeningAborted) throw aborted; - - if(m_pCAP && (!m_fAudioOnly || m_fRealMediaGraph)) - { - POSITION pos = pOMD->subs.GetHeadPosition(); - while(pos) LoadSubtitle(pOMD->subs.GetNext(pos)); - - if(AfxGetAppSettings().fEnableSubtitles && m_pSubStreams.GetCount() > 0) - SetSubtitle(m_pSubStreams.GetHead()); - } - - if(m_fOpeningAborted) throw aborted; - - OpenSetupWindowTitle(pOMD->title); - - if(::GetCurrentThreadId() == AfxGetApp()->m_nThreadID) - { - OnFilePostOpenmedia(); - } - else - { - PostMessage(WM_COMMAND, ID_FILE_POST_OPENMEDIA); - } - - while(m_iMediaLoadState != MLS_LOADED - && m_iMediaLoadState != MLS_CLOSING // FIXME - ) - { - Sleep(50); - } - - // PostMessage instead of SendMessage because the user might call CloseMedia and then we would deadlock - - PostMessage(WM_COMMAND, ID_PLAY_PAUSE); - - if(!(AfxGetAppSettings().nCLSwitches&CLSW_OPEN)) - PostMessage(WM_COMMAND, ID_PLAY_PLAY); - - AfxGetAppSettings().nCLSwitches &= ~CLSW_OPEN; - - if(OpenFileData* p = dynamic_cast(pOMD.m_p)) - { - if(p->rtStart > 0) - PostMessage(WM_RESUMEFROMSTATE, (WPARAM)PM_FILE, (LPARAM)(p->rtStart/10000)); // REFERENCE_TIME doesn't fit in LPARAM under a 32bit env. - } - else if(OpenDVDData* p = dynamic_cast(pOMD.m_p)) - { - if(p->pDvdState) - PostMessage(WM_RESUMEFROMSTATE, (WPARAM)PM_DVD, (LPARAM)(CComPtr(p->pDvdState).Detach())); // must be released by the called message handler - } - else if(OpenDeviceData* p = dynamic_cast(pOMD.m_p)) - { - m_wndCaptureBar.m_capdlg.SetVideoInput(p->vinput); - m_wndCaptureBar.m_capdlg.SetVideoChannel(p->vchannel); - m_wndCaptureBar.m_capdlg.SetAudioInput(p->ainput); - } - } - catch(LPCTSTR msg) - { - err = msg; - } - catch(CString msg) - { - err = msg; - } - - if(!err.IsEmpty()) - { - CloseMediaPrivate(); - m_closingmsg = err; - - OpenFileData* p = dynamic_cast(pOMD.m_p); - if(p && err != aborted) - { - m_wndPlaylistBar.SetCurValid(false); - if(m_wndPlaylistBar.GetCount() > 1) - { - CPlaylistItem pli[2]; - m_wndPlaylistBar.GetCur(pli[0]); - m_wndPlaylistBar.SetNext(); - m_wndPlaylistBar.GetCur(pli[1]); - if(pli[0].m_id != pli[1].m_id) - { - CAutoPtr p(m_wndPlaylistBar.GetCurOMD()); - if(p) OpenMediaPrivate(p); - } - } - } - } - else - { - m_wndPlaylistBar.SetCurValid(true); - } - - PostMessage(WM_KICKIDLE); // calls main thread to update things - - return(err.IsEmpty()); -} - -void CMainFrame::CloseMediaPrivate() -{ - m_iMediaLoadState = MLS_CLOSING; - - OnPlayStop(); // SendMessage(WM_COMMAND, ID_PLAY_STOP); - - m_iPlaybackMode = PM_NONE; - m_iSpeedLevel = 0; - - m_fLiveWM = false; - - m_fEndOfStream = false; - - m_rtDurationOverride = -1; - - m_kfs.RemoveAll(); - - m_pCB = NULL; - -// if(pVW) pVW->put_Visible(OAFALSE); -// if(pVW) pVW->put_MessageDrain((OAHWND)NULL), pVW->put_Owner((OAHWND)NULL); - - m_pCAP = NULL; // IMPORTANT: IVMRSurfaceAllocatorNotify/IVMRSurfaceAllocatorNotify9 has to be released before the VMR/VMR9, otherwise it will crash in Release() - - pAMXBar.Release(); pAMTuner.Release(); pAMDF.Release(); - pAMVCCap.Release(); pAMVCPrev.Release(); pAMVSCCap.Release(); pAMVSCPrev.Release(); pAMASC.Release(); - pVidCap.Release(); pAudCap.Release(); - pCGB.Release(); - pDVDC.Release(); pDVDI.Release(); - pQP.Release(); pBI.Release(); pAMOP.Release(); pFS.Release(); - pMC.Release(); pME.Release(); pMS.Release(); - pVW.Release(); pBV.Release(); - pBA.Release(); - - if(pGB) pGB->RemoveFromROT(); - pGB.Release(); - - m_fRealMediaGraph = m_fShockwaveGraph = m_fQuicktimeGraph = false; - - m_pSubClock = NULL; - - m_pProv.Release(); - - { - CAutoLock cAutoLock(&m_csSubLock); - m_pSubStreams.RemoveAll(); - } - - m_VidDispName.Empty(); - m_AudDispName.Empty(); - - m_closingmsg = ResStr(IDS_CONTROLS_CLOSED); - - AfxGetAppSettings().nCLSwitches &= CLSW_OPEN|CLSW_PLAY|CLSW_AFTERPLAYBACK_MASK|CLSW_NOFOCUS; - - m_iMediaLoadState = MLS_CLOSED; -} - -// msn - -void CMainFrame::SendNowPlayingToMSN() -{ - if(!AfxGetAppSettings().fNotifyMSN) - return; - - CString title, author; - - if(m_iMediaLoadState == MLS_LOADED) - { - m_wndInfoBar.GetLine(ResStr(IDS_INFOBAR_TITLE), title); - m_wndInfoBar.GetLine(ResStr(IDS_INFOBAR_AUTHOR), author); - - if(title.IsEmpty()) - { - CPlaylistItem pli; - m_wndPlaylistBar.GetCur(pli); - - if(!pli.m_fns.IsEmpty()) - { - CString label = !pli.m_label.IsEmpty() ? pli.m_label : pli.m_fns.GetHead(); - - if(m_iPlaybackMode == PM_FILE) - { - CString fn = label; - if(fn.Find(_T("://")) >= 0) {int i = fn.Find('?'); if(i >= 0) fn = fn.Left(i);} - CPath path(fn); - path.StripPath(); - path.MakePretty(); - path.RemoveExtension(); - title = (LPCTSTR)path; - author.Empty(); - } - else if(m_iPlaybackMode == PM_CAPTURE) - { - title = label != pli.m_fns.GetHead() ? label : _T("Live"); - author.Empty(); - } - else if(m_iPlaybackMode == PM_DVD) - { - title = _T("DVD"); - author.Empty(); - } - } - } - } - - CStringW buff; - buff += L"\\0Music\\0"; - buff += title.IsEmpty() ? L"0" : L"1"; - buff += L"\\0"; - buff += author.IsEmpty() ? L"{0}" : L"{0} - {1}"; - buff += L"\\0"; - if(!author.IsEmpty()) {buff += CStringW(author) + L"\\0";} - buff += CStringW(title) + L"\\0"; - buff += L"\\0\\0"; - - COPYDATASTRUCT data; - data.dwData = 0x0547; - data.lpData = (PVOID)(LPCWSTR)buff; - data.cbData = buff.GetLength() * 2 + 2; - - HWND hWnd = NULL; - while(hWnd = ::FindWindowEx(NULL, hWnd, _T("MsnMsgrUIManager"), NULL)) - ::SendMessage(hWnd, WM_COPYDATA, (WPARAM)NULL, (LPARAM)&data); -} - -// mIRC - -void CMainFrame::SendNowPlayingTomIRC() -{ - if(!AfxGetAppSettings().fNotifyGTSdll) - return; - - for(int i = 0; i < 20; i++) - { - HANDLE hFMap = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, 1024, _T("mIRC")); - if(!hFMap) return; - - if(GetLastError() == ERROR_ALREADY_EXISTS) - { - CloseHandle(hFMap); - Sleep(50); - continue; - } - - if(LPVOID lpMappingAddress = MapViewOfFile(hFMap, FILE_MAP_WRITE, 0, 0, 0)) - { - LPCSTR cmd = m_fAudioOnly ? "/.timerAUDGTS 1 5 mpcaud" : "/.timerVIDGTS 1 5 mpcvid"; - strcpy((char*)lpMappingAddress, cmd); - - if(HWND hWnd = ::FindWindow(_T("mIRC"), NULL)) - ::SendMessage(hWnd, (WM_USER + 200), (WPARAM)1, (LPARAM)0); - - UnmapViewOfFile(lpMappingAddress); - } - - CloseHandle(hFMap); - - break; - } -} - -// dynamic menus - -void CMainFrame::SetupOpenCDSubMenu() -{ - CMenu* pSub = &m_opencds; - - if(!IsMenu(pSub->m_hMenu)) pSub->CreatePopupMenu(); - else while(pSub->RemoveMenu(0, MF_BYPOSITION)); - - if(m_iMediaLoadState == MLS_LOADING) return; - - if(AfxGetAppSettings().fHideCDROMsSubMenu) return; - - UINT id = ID_FILE_OPEN_CD_START; - - for(TCHAR drive = 'C'; drive <= 'Z'; drive++) - { - CString label = GetDriveLabel(drive), str; - - CAtlList files; - switch(GetCDROMType(drive, files)) - { - case CDROM_Audio: - if(label.IsEmpty()) label = _T("Audio CD"); - str.Format(_T("%s (%c:)"), label, drive); - break; - case CDROM_VideoCD: - if(label.IsEmpty()) label = _T("(S)VCD"); - str.Format(_T("%s (%c:)"), label, drive); - break; - case CDROM_DVDVideo: - if(label.IsEmpty()) label = _T("DVD Video"); - str.Format(_T("%s (%c:)"), label, drive); - break; - default: - break; - } - - if(!str.IsEmpty()) - pSub->AppendMenu(MF_BYCOMMAND|MF_STRING|MF_ENABLED, id++, str); - } -} - -void CMainFrame::SetupFiltersSubMenu() -{ - CMenu* pSub = &m_filters; - - if(!IsMenu(pSub->m_hMenu)) pSub->CreatePopupMenu(); - else while(pSub->RemoveMenu(0, MF_BYPOSITION)); - - m_filterpopups.RemoveAll(); - - m_pparray.RemoveAll(); - m_ssarray.RemoveAll(); - - if(m_iMediaLoadState == MLS_LOADED) - { - UINT idf = 0; - UINT ids = ID_FILTERS_SUBITEM_START; - UINT idl = ID_FILTERSTREAMS_SUBITEM_START; - - BeginEnumFilters(pGB, pEF, pBF) - { - CString name(GetFilterName(pBF)); - if(name.GetLength() >= 43) name = name.Left(40) + _T("..."); - - CLSID clsid = GetCLSID(pBF); - if(clsid == CLSID_AVIDec) - { - CComPtr pPin = GetFirstPin(pBF); - AM_MEDIA_TYPE mt; - if(pPin && SUCCEEDED(pPin->ConnectionMediaType(&mt))) - { - DWORD c = ((VIDEOINFOHEADER*)mt.pbFormat)->bmiHeader.biCompression; - switch(c) - { - case BI_RGB: name += _T(" (RGB)"); break; - case BI_RLE4: name += _T(" (RLE4)"); break; - case BI_RLE8: name += _T(" (RLE8)"); break; - case BI_BITFIELDS: name += _T(" (BITF)"); break; - default: name.Format(_T("%s (%c%c%c%c)"), - CString(name), (TCHAR)((c>>0)&0xff), (TCHAR)((c>>8)&0xff), (TCHAR)((c>>16)&0xff), (TCHAR)((c>>24)&0xff)); break; - } - } - } - else if(clsid == CLSID_ACMWrapper) - { - CComPtr pPin = GetFirstPin(pBF); - AM_MEDIA_TYPE mt; - if(pPin && SUCCEEDED(pPin->ConnectionMediaType(&mt))) - { - WORD c = ((WAVEFORMATEX*)mt.pbFormat)->wFormatTag; - name.Format(_T("%s (0x%04x)"), CString(name), (int)c); - } - } - else if(clsid == __uuidof(CTextPassThruFilter) || clsid == __uuidof(CNullTextRenderer) - || clsid == GUIDFromCString(_T("{48025243-2D39-11CE-875D-00608CB78066}"))) // ISCR - { - // hide these - continue; - } - - CAutoPtr pSubSub(new CMenu); - pSubSub->CreatePopupMenu(); - - int nPPages = 0; - - CComQIPtr pSPP = pBF; - -/* if(pSPP) - { - CAUUID caGUID; - caGUID.pElems = NULL; - if(SUCCEEDED(pSPP->GetPages(&caGUID)) && caGUID.cElems > 0) - { -*/ m_pparray.Add(pBF); - pSubSub->AppendMenu(MF_BYCOMMAND|MF_STRING|MF_ENABLED, ids, _T("&Properties...")); -/* - if(caGUID.pElems) CoTaskMemFree(caGUID.pElems); -*/ - nPPages++; -/* } - } -*/ - BeginEnumPins(pBF, pEP, pPin) - { - CString name = GetPinName(pPin); - name.Replace(_T("&"), _T("&&")); - - if(pSPP = pPin) - { - CAUUID caGUID; - caGUID.pElems = NULL; - if(SUCCEEDED(pSPP->GetPages(&caGUID)) && caGUID.cElems > 0) - { - m_pparray.Add(pPin); - pSubSub->AppendMenu(MF_BYCOMMAND|MF_STRING|MF_ENABLED, ids+nPPages, name + _T(" (pin) properties...")); - - if(caGUID.pElems) CoTaskMemFree(caGUID.pElems); - - nPPages++; - } - } - } - EndEnumPins - - CComQIPtr pSS = pBF; - if(pSS) - { - DWORD nStreams = 0, flags, group, prevgroup = -1; - LCID lcid; - WCHAR* wname = NULL; - CComPtr pObj, pUnk; - - pSS->Count(&nStreams); - - if(nStreams > 0 && nPPages > 0) pSubSub->AppendMenu(MF_SEPARATOR|MF_ENABLED); - - UINT idlstart = idl; - - for(DWORD i = 0; i < nStreams; i++, pObj = NULL, pUnk = NULL) - { - m_ssarray.Add(pSS); - - flags = group = 0; - wname = NULL; - pSS->Info(i, NULL, &flags, &lcid, &group, &wname, &pObj, &pUnk); - - if(group != prevgroup && idl > idlstart) - pSubSub->AppendMenu(MF_SEPARATOR|MF_ENABLED); - prevgroup = group; - - if(flags & AMSTREAMSELECTINFO_EXCLUSIVE) - { - } - else if(flags & AMSTREAMSELECTINFO_ENABLED) - { - } - - if(!wname) - { - CStringW stream(L"Unknown Stream"); - wname = (WCHAR*)CoTaskMemAlloc((stream.GetLength()+3+1)*sizeof(WCHAR)); - swprintf(wname, L"%s %d", stream, min(i+1,999)); - } - - CString name(wname); - name.Replace(_T("&"), _T("&&")); - - pSubSub->AppendMenu(MF_BYCOMMAND|MF_STRING|MF_ENABLED, idl++, name); - - CoTaskMemFree(wname); - } - - if(nStreams == 0) pSS.Release(); - } - - if(nPPages == 1 && !pSS) - { - pSub->AppendMenu(MF_BYCOMMAND|MF_STRING|MF_ENABLED, ids, name); - } - else - { - pSub->AppendMenu(MF_BYPOSITION|MF_STRING|MF_DISABLED|MF_GRAYED, idf, name); - - if(nPPages > 0 || pSS) - { - MENUITEMINFO mii; - mii.cbSize = sizeof(mii); - mii.fMask = MIIM_STATE|MIIM_SUBMENU; - mii.fType = MF_POPUP; - mii.hSubMenu = pSubSub->m_hMenu; - mii.fState = (pSPP || pSS) ? MF_ENABLED : (MF_DISABLED|MF_GRAYED); - pSub->SetMenuItemInfo(idf, &mii, TRUE); - - m_filterpopups.Add(pSubSub); - } - } - - ids += nPPages; - idf++; - } - EndEnumFilters - } -} - -void CMainFrame::SetupAudioSwitcherSubMenu() -{ - CMenu* pSub = &m_audios; - - if(!IsMenu(pSub->m_hMenu)) pSub->CreatePopupMenu(); - else while(pSub->RemoveMenu(0, MF_BYPOSITION)); - - if(m_iMediaLoadState == MLS_LOADED) - { - UINT id = ID_AUDIO_SUBITEM_START; - - CComQIPtr pSS = FindFilter(__uuidof(CAudioSwitcherFilter), pGB); - if(!pSS) pSS = FindFilter(L"{D3CD7858-971A-4838-ACEC-40CA5D529DC8}", pGB); - - if(pSS) - { - DWORD cStreams = 0; - if(SUCCEEDED(pSS->Count(&cStreams)) && cStreams > 0) - { - pSub->AppendMenu(MF_BYCOMMAND|MF_STRING|MF_ENABLED, id++, ResStr(IDS_SUBTITLES_OPTIONS)); - pSub->AppendMenu(MF_SEPARATOR|MF_ENABLED); - - for(int i = 0; i < (int)cStreams; i++) - { - WCHAR* pName = NULL; - if(FAILED(pSS->Info(i, NULL, NULL, NULL, NULL, &pName, NULL, NULL))) - break; - - CString name(pName); - name.Replace(_T("&"), _T("&&")); - - pSub->AppendMenu(MF_BYCOMMAND|MF_STRING|MF_ENABLED, id++, name); - - CoTaskMemFree(pName); - } - } - } - } -} - -void CMainFrame::SetupSubtitlesSubMenu() -{ - CMenu* pSub = &m_subtitles; - - if(!IsMenu(pSub->m_hMenu)) pSub->CreatePopupMenu(); - else while(pSub->RemoveMenu(0, MF_BYPOSITION)); - - if(m_iMediaLoadState != MLS_LOADED || m_fAudioOnly || !m_pCAP) - return; - - UINT id = ID_SUBTITLES_SUBITEM_START; - - POSITION pos = m_pSubStreams.GetHeadPosition(); - - if(pos) - { - pSub->AppendMenu(MF_BYCOMMAND|MF_STRING|MF_ENABLED, id++, ResStr(IDS_SUBTITLES_OPTIONS)); - pSub->AppendMenu(MF_BYCOMMAND|MF_STRING|MF_ENABLED, id++, ResStr(IDS_SUBTITLES_STYLES)); - pSub->AppendMenu(MF_BYCOMMAND|MF_STRING|MF_ENABLED, id++, ResStr(IDS_SUBTITLES_RELOAD)); - pSub->AppendMenu(MF_SEPARATOR); - - pSub->AppendMenu(MF_BYCOMMAND|MF_STRING|MF_ENABLED, id++, ResStr(IDS_SUBTITLES_ENABLE)); - pSub->AppendMenu(MF_SEPARATOR); - } - - while(pos) - { - CComPtr pSubStream = m_pSubStreams.GetNext(pos); - if(!pSubStream) continue; - - for(int i = 0, j = pSubStream->GetStreamCount(); i < j; i++) - { - WCHAR* pName = NULL; - if(SUCCEEDED(pSubStream->GetStreamInfo(i, &pName, NULL))) - { - CString name(pName); - name.Replace(_T("&"), _T("&&")); - - pSub->AppendMenu(MF_BYCOMMAND|MF_STRING|MF_ENABLED, id++, name); - CoTaskMemFree(pName); - } - else - { - pSub->AppendMenu(MF_BYCOMMAND|MF_STRING|MF_ENABLED, id++, _T("")); - } - } - - // TODO: find a better way to group these entries - if(pos && m_pSubStreams.GetAt(pos)) - { - CLSID cur, next; - pSubStream->GetClassID(&cur); - m_pSubStreams.GetAt(pos)->GetClassID(&next); - - if(cur != next) - pSub->AppendMenu(MF_SEPARATOR); - } - } -} - -void CMainFrame::SetupNavAudioSubMenu() -{ - CMenu* pSub = &m_navaudio; - - if(!IsMenu(pSub->m_hMenu)) pSub->CreatePopupMenu(); - else while(pSub->RemoveMenu(0, MF_BYPOSITION)); - - if(m_iMediaLoadState != MLS_LOADED) return; - - UINT id = ID_NAVIGATE_AUDIO_SUBITEM_START; - - if(m_iPlaybackMode == PM_FILE) - { - SetupNavStreamSelectSubMenu(pSub, id, 1); - } - else if(m_iPlaybackMode == PM_DVD) - { - ULONG ulStreamsAvailable, ulCurrentStream; - if(FAILED(pDVDI->GetCurrentAudio(&ulStreamsAvailable, &ulCurrentStream))) - return; - - LCID DefLanguage; - DVD_AUDIO_LANG_EXT ext; - if(FAILED(pDVDI->GetDefaultAudioLanguage(&DefLanguage, &ext))) - return; - - for(ULONG i = 0; i < ulStreamsAvailable; i++) - { - LCID Language; - if(FAILED(pDVDI->GetAudioLanguage(i, &Language))) - continue; - - UINT flags = MF_BYCOMMAND|MF_STRING|MF_ENABLED; - if(Language == DefLanguage) flags |= MF_DEFAULT; - if(i == ulCurrentStream) flags |= MF_CHECKED; - - CString str(_T("Unknown")); - if(Language) - { - int len = GetLocaleInfo(Language, LOCALE_SENGLANGUAGE, str.GetBuffer(256), 256); - str.ReleaseBufferSetLength(max(len-1, 0)); - } - - DVD_AudioAttributes ATR; - if(SUCCEEDED(pDVDI->GetAudioAttributes(i, &ATR))) - { - switch(ATR.LanguageExtension) - { - case DVD_AUD_EXT_NotSpecified: - default: break; - case DVD_AUD_EXT_Captions: str += _T(" (Captions)"); break; - case DVD_AUD_EXT_VisuallyImpaired: str += _T(" (Visually Impaired)"); break; - case DVD_AUD_EXT_DirectorComments1: str += _T(" (Director Comments 1)"); break; - case DVD_AUD_EXT_DirectorComments2: str += _T(" (Director Comments 2)"); break; - } - - CString format; - switch(ATR.AudioFormat) - { - case DVD_AudioFormat_AC3: format = _T("AC3"); break; - case DVD_AudioFormat_MPEG1: - case DVD_AudioFormat_MPEG1_DRC: format = _T("MPEG1"); break; - case DVD_AudioFormat_MPEG2: - case DVD_AudioFormat_MPEG2_DRC: format = _T("MPEG2"); break; - case DVD_AudioFormat_LPCM: format = _T("LPCM"); break; - case DVD_AudioFormat_DTS: format = _T("DTS"); break; - case DVD_AudioFormat_SDDS: format = _T("SDDS"); break; - } - - if(!format.IsEmpty()) - { - str.Format(_T("%s, %s %dHz %dbits %d channel(s)"), - CString(str), - format, - ATR.dwFrequency, - ATR.bQuantization, - ATR.bNumberOfChannels); - } - } - - str.Replace(_T("&"), _T("&&")); - - pSub->AppendMenu(flags, id++, str); - } - } -} - -void CMainFrame::SetupNavSubtitleSubMenu() -{ - CMenu* pSub = &m_navsubtitle; - - if(!IsMenu(pSub->m_hMenu)) pSub->CreatePopupMenu(); - else while(pSub->RemoveMenu(0, MF_BYPOSITION)); - - if(m_iMediaLoadState != MLS_LOADED) return; - - UINT id = ID_NAVIGATE_SUBP_SUBITEM_START; - - if(m_iPlaybackMode == PM_FILE) - { - SetupNavStreamSelectSubMenu(pSub, id, 2); - } - else if(m_iPlaybackMode == PM_DVD) - { - ULONG ulStreamsAvailable, ulCurrentStream; - BOOL bIsDisabled; - if(FAILED(pDVDI->GetCurrentSubpicture(&ulStreamsAvailable, &ulCurrentStream, &bIsDisabled)) - || ulStreamsAvailable == 0) - return; - - LCID DefLanguage; - DVD_SUBPICTURE_LANG_EXT ext; - if(FAILED(pDVDI->GetDefaultSubpictureLanguage(&DefLanguage, &ext))) - return; - - pSub->AppendMenu(MF_BYCOMMAND|MF_STRING|(bIsDisabled?0:MF_CHECKED), id++, _T("Enabled")); - pSub->AppendMenu(MF_BYCOMMAND|MF_SEPARATOR|MF_ENABLED); - - for(ULONG i = 0; i < ulStreamsAvailable; i++) - { - LCID Language; - if(FAILED(pDVDI->GetSubpictureLanguage(i, &Language))) - continue; - - UINT flags = MF_BYCOMMAND|MF_STRING|MF_ENABLED; - if(Language == DefLanguage) flags |= MF_DEFAULT; - if(i == ulCurrentStream) flags |= MF_CHECKED; - - CString str(_T("Unknown")); - if(Language) - { - int len = GetLocaleInfo(Language, LOCALE_SENGLANGUAGE, str.GetBuffer(256), 256); - str.ReleaseBufferSetLength(max(len-1, 0)); - } - - DVD_SubpictureAttributes ATR; - if(SUCCEEDED(pDVDI->GetSubpictureAttributes(i, &ATR))) - { - switch(ATR.LanguageExtension) - { - case DVD_SP_EXT_NotSpecified: - default: break; - case DVD_SP_EXT_Caption_Normal: str += _T(""); break; - case DVD_SP_EXT_Caption_Big: str += _T(" (Big)"); break; - case DVD_SP_EXT_Caption_Children: str += _T(" (Children)"); break; - case DVD_SP_EXT_CC_Normal: str += _T(" (CC)"); break; - case DVD_SP_EXT_CC_Big: str += _T(" (CC Big)"); break; - case DVD_SP_EXT_CC_Children: str += _T(" (CC Children)"); break; - case DVD_SP_EXT_Forced: str += _T(" (Forced)"); break; - case DVD_SP_EXT_DirectorComments_Normal: str += _T(" (Director Comments)"); break; - case DVD_SP_EXT_DirectorComments_Big: str += _T(" (Director Comments, Big)"); break; - case DVD_SP_EXT_DirectorComments_Children: str += _T(" (Director Comments, Children)"); break; - } - } - - str.Replace(_T("&"), _T("&&")); - - pSub->AppendMenu(flags, id++, str); - } - } -} - -void CMainFrame::SetupNavAngleSubMenu() -{ - CMenu* pSub = &m_navangle; - - if(!IsMenu(pSub->m_hMenu)) pSub->CreatePopupMenu(); - else while(pSub->RemoveMenu(0, MF_BYPOSITION)); - - if(m_iMediaLoadState != MLS_LOADED) return; - - UINT id = ID_NAVIGATE_ANGLE_SUBITEM_START; - - if(m_iPlaybackMode == PM_FILE) - { - SetupNavStreamSelectSubMenu(pSub, id, 0); - } - else if(m_iPlaybackMode == PM_DVD) - { - ULONG ulStreamsAvailable, ulCurrentStream; - if(FAILED(pDVDI->GetCurrentAngle(&ulStreamsAvailable, &ulCurrentStream))) - return; - - if(ulStreamsAvailable < 2) return; // one choice is not a choice... - - for(ULONG i = 1; i <= ulStreamsAvailable; i++) - { - UINT flags = MF_BYCOMMAND|MF_STRING|MF_ENABLED; - if(i == ulCurrentStream) flags |= MF_CHECKED; - - CString str; - str.Format(_T("Angle %d"), i); - - pSub->AppendMenu(flags, id++, str); - } - } -} - -void CMainFrame::SetupNavChaptersSubMenu() -{ - CMenu* pSub = &m_navchapters; - - if(!IsMenu(pSub->m_hMenu)) pSub->CreatePopupMenu(); - else while(pSub->RemoveMenu(0, MF_BYPOSITION)); - - if(m_iMediaLoadState != MLS_LOADED) - return; - - UINT id = ID_NAVIGATE_CHAP_SUBITEM_START; - - if(m_iPlaybackMode == PM_FILE) - { - SetupChapters(); - - REFERENCE_TIME rt = GetPos(); - DWORD j = m_pCB->ChapLookup(&rt, NULL); - - for(DWORD i = 0; i < m_pCB->ChapGetCount(); i++, id++) - { - rt = 0; - CComBSTR bstr; - if(FAILED(m_pCB->ChapGet(i, &rt, &bstr))) - continue; - - int s = (int)((rt/10000000)%60); - int m = (int)((rt/10000000/60)%60); - int h = (int)((rt/10000000/60/60)); - - CString time; - time.Format(_T("[%02d:%02d:%02d] "), h, m, s); - - CString name = CString(bstr); - name.Replace(_T("&"), _T("&&")); - name.Replace(_T("\t"), _T(" ")); - - UINT flags = MF_BYCOMMAND|MF_STRING|MF_ENABLED; - if(i == j) flags |= MF_CHECKED; - if(id != ID_NAVIGATE_CHAP_SUBITEM_START && i == 0) pSub->AppendMenu(MF_SEPARATOR); - pSub->AppendMenu(flags, id, name + '\t' + time); - } - - if(m_wndPlaylistBar.GetCount() > 1) - { - POSITION pos = m_wndPlaylistBar.m_pl.GetHeadPosition(); - while(pos) - { - UINT flags = MF_BYCOMMAND|MF_STRING|MF_ENABLED; - if(pos == m_wndPlaylistBar.m_pl.GetPos()) flags |= MF_CHECKED; - if(id != ID_NAVIGATE_CHAP_SUBITEM_START && pos == m_wndPlaylistBar.m_pl.GetHeadPosition()) - pSub->AppendMenu(MF_SEPARATOR); - CPlaylistItem& pli = m_wndPlaylistBar.m_pl.GetNext(pos); - CString name = pli.GetLabel(); - name.Replace(_T("&"), _T("&&")); - pSub->AppendMenu(flags, id++, name); - } - } - } - else if(m_iPlaybackMode == PM_DVD) - { - ULONG ulNumOfVolumes, ulVolume; - DVD_DISC_SIDE Side; - ULONG ulNumOfTitles = 0; - pDVDI->GetDVDVolumeInfo(&ulNumOfVolumes, &ulVolume, &Side, &ulNumOfTitles); - - DVD_PLAYBACK_LOCATION2 Location; - pDVDI->GetCurrentLocation(&Location); - - ULONG ulNumOfChapters = 0; - pDVDI->GetNumberOfChapters(Location.TitleNum, &ulNumOfChapters); - - ULONG ulUOPs = 0; - pDVDI->GetCurrentUOPS(&ulUOPs); - - for(ULONG i = 1; i <= ulNumOfTitles; i++) - { - UINT flags = MF_BYCOMMAND|MF_STRING|MF_ENABLED; - if(i == Location.TitleNum) flags |= MF_CHECKED; - if(ulUOPs&UOP_FLAG_Play_Title) flags |= MF_DISABLED|MF_GRAYED; - - CString str; - str.Format(_T("Title %d"), i); - - pSub->AppendMenu(flags, id++, str); - } - - for(ULONG i = 1; i <= ulNumOfChapters; i++) - { - UINT flags = MF_BYCOMMAND|MF_STRING|MF_ENABLED; - if(i == Location.ChapterNum) flags |= MF_CHECKED; - if(ulUOPs&UOP_FLAG_Play_Chapter) flags |= MF_DISABLED|MF_GRAYED; - if(i == 1) flags |= MF_MENUBARBREAK; - - CString str; - str.Format(_T("Chapter %d"), i); - - pSub->AppendMenu(flags, id++, str); - } - } -} - -void CMainFrame::SetupNavStreamSelectSubMenu(CMenu* pSub, UINT id, DWORD dwSelGroup) -{ - UINT baseid = id; - - CComQIPtr pSS = FindFilter(CLSID_OggSplitter, pGB); - if(!pSS) pSS = FindFilter(L"{55DA30FC-F16B-49fc-BAA5-AE59FC65F82D}", pGB); - if(!pSS) return; - - DWORD cStreams; - if(FAILED(pSS->Count(&cStreams))) - return; - - DWORD dwPrevGroup = -1; - - for(int i = 0, j = cStreams; i < j; i++) - { - DWORD dwFlags, dwGroup; - LCID lcid; - WCHAR* pszName = NULL; - - if(FAILED(pSS->Info(i, NULL, &dwFlags, &lcid, &dwGroup, &pszName, NULL, NULL)) - || !pszName) - continue; - - CString name(pszName); - CString lcname = CString(name).MakeLower(); - - if(pszName) CoTaskMemFree(pszName); - - if(dwGroup != dwSelGroup) - continue; - - if(dwPrevGroup != -1 && dwPrevGroup != dwGroup) - pSub->AppendMenu(MF_SEPARATOR); - dwPrevGroup = dwGroup; - - CString str; - - if(lcname.Find(_T(" off")) >= 0) - { - str = _T("Disabled"); - } - else - { - if(lcid == 0) - { - str.Format(_T("Unknown %d"), id - baseid); - } - else - { - int len = GetLocaleInfo(lcid, LOCALE_SENGLANGUAGE, str.GetBuffer(64), 64); - str.ReleaseBufferSetLength(max(len-1, 0)); - } - - CString lcstr = CString(str).MakeLower(); - - if(str.IsEmpty() || lcname.Find(lcstr) >= 0) str = name; - else if(!name.IsEmpty()) str = CString(name) + _T(" (") + str + _T(")"); - } - - UINT flags = MF_BYCOMMAND|MF_STRING|MF_ENABLED; - if(dwFlags) flags |= MF_CHECKED; - - str.Replace(_T("&"), _T("&&")); - pSub->AppendMenu(flags, id++, str); - } -} - -void CMainFrame::OnNavStreamSelectSubMenu(UINT id, DWORD dwSelGroup) -{ - CComQIPtr pSS = FindFilter(CLSID_OggSplitter, pGB); - if(!pSS) pSS = FindFilter(L"{55DA30FC-F16B-49fc-BAA5-AE59FC65F82D}", pGB); - if(!pSS) return; - - DWORD cStreams; - if(FAILED(pSS->Count(&cStreams))) - return; - - for(int i = 0, j = cStreams; i < j; i++) - { - DWORD dwFlags, dwGroup; - LCID lcid; - WCHAR* pszName = NULL; - - if(FAILED(pSS->Info(i, NULL, &dwFlags, &lcid, &dwGroup, &pszName, NULL, NULL)) - || !pszName) - continue; - - if(pszName) CoTaskMemFree(pszName); - - if(dwGroup != dwSelGroup) - continue; - - if(id == 0) - { - pSS->Enable(i, AMSTREAMSELECTENABLE_ENABLE); - break; - } - - id--; - } -} - -void CMainFrame::SetupFavoritesSubMenu() -{ - CMenu* pSub = &m_favorites; - - if(!IsMenu(pSub->m_hMenu)) pSub->CreatePopupMenu(); - else while(pSub->RemoveMenu(0, MF_BYPOSITION)); - - AppSettings& s = AfxGetAppSettings(); - - pSub->AppendMenu(MF_BYCOMMAND|MF_STRING|MF_ENABLED, ID_FAVORITES_ADD, ResStr(IDS_FAVORITES_ADD)); - pSub->AppendMenu(MF_BYCOMMAND|MF_STRING|MF_ENABLED, ID_FAVORITES_ORGANIZE, ResStr(IDS_FAVORITES_ORGANIZE)); - - int nLastGroupStart = pSub->GetMenuItemCount(); - - UINT id = ID_FAVORITES_FILE_START; - - CAtlList sl; - AfxGetAppSettings().GetFav(FAV_FILE, sl); - - POSITION pos = sl.GetHeadPosition(); - while(pos) - { - UINT flags = MF_BYCOMMAND|MF_STRING|MF_ENABLED; - - CString str = sl.GetNext(pos); - str.Replace(_T("&"), _T("&&")); - str.Replace(_T("\t"), _T(" ")); - - CAtlList sl; - Explode(str, sl, ';', 2); - - str = sl.RemoveHead(); - - if(!sl.IsEmpty()) - { - REFERENCE_TIME rt = 0; - if(1 == _stscanf(sl.GetHead(), _T("%I64d"), &rt) && rt > 0) - { - DVD_HMSF_TIMECODE hmsf = RT2HMSF(rt, 0); - str.Format(_T("%s\t[%02d:%02d:%02d]"), CString(str), hmsf.bHours, hmsf.bMinutes, hmsf.bSeconds); - } - } - - if(!str.IsEmpty()) - pSub->AppendMenu(flags, id, str); - - id++; - } - - if(id > ID_FAVORITES_FILE_START) - pSub->InsertMenu(nLastGroupStart, MF_SEPARATOR|MF_ENABLED|MF_BYPOSITION); - - nLastGroupStart = pSub->GetMenuItemCount(); - - id = ID_FAVORITES_DVD_START; - - AfxGetAppSettings().GetFav(FAV_DVD, sl); - - pos = sl.GetHeadPosition(); - while(pos) - { - UINT flags = MF_BYCOMMAND|MF_STRING|MF_ENABLED; - - CString str = sl.GetNext(pos); - str.Replace(_T("&"), _T("&&")); - - CAtlList sl; - Explode(str, sl, ';', 2); - - str = sl.RemoveHead(); - - if(!sl.IsEmpty()) - { - // TODO - } - - if(!str.IsEmpty()) - pSub->AppendMenu(flags, id, str); - - id++; - } - - if(id > ID_FAVORITES_DVD_START) - pSub->InsertMenu(nLastGroupStart, MF_SEPARATOR|MF_ENABLED|MF_BYPOSITION); - - nLastGroupStart = pSub->GetMenuItemCount(); - - id = ID_FAVORITES_DEVICE_START; - - AfxGetAppSettings().GetFav(FAV_DEVICE, sl); - - pos = sl.GetHeadPosition(); - while(pos) - { - UINT flags = MF_BYCOMMAND|MF_STRING|MF_ENABLED; - - CString str = sl.GetNext(pos); - str.Replace(_T("&"), _T("&&")); - - CAtlList sl; - Explode(str, sl, ';', 2); - - str = sl.RemoveHead(); - - if(!str.IsEmpty()) - pSub->AppendMenu(flags, id, str); - - id++; - } -} - -void CMainFrame::SetupShadersSubMenu() -{ - CMenu* pSub = &m_shaders; - - if(!IsMenu(pSub->m_hMenu)) pSub->CreatePopupMenu(); - else while(pSub->RemoveMenu(0, MF_BYPOSITION)); - - CWinApp* pApp = AfxGetApp(); - - pSub->AppendMenu(MF_BYCOMMAND|MF_STRING|MF_ENABLED, ID_SHADERS_START, ResStr(IDS_SHADER_OFF)); - - UINT id = ID_SHADERS_START+1; - - if(POSITION pos = AfxGetAppSettings().m_shaders.GetHeadPosition()) - { - pSub->AppendMenu(MF_BYCOMMAND|MF_STRING|MF_ENABLED, id++, ResStr(IDS_SHADER_COMBINE)); - pSub->AppendMenu(MF_BYCOMMAND|MF_STRING|MF_ENABLED, id++, ResStr(IDS_SHADER_EDIT)); - pSub->AppendMenu(MF_SEPARATOR); - - MENUITEMINFO mii; - memset(&mii, 0, sizeof(mii)); - mii.cbSize = sizeof(mii); - mii.fMask |= MIIM_DATA; - - while(pos) - { - const AppSettings::Shader& s = AfxGetAppSettings().m_shaders.GetNext(pos); - CString label = s.label; - label.Replace(_T("&"), _T("&&")); - pSub->AppendMenu(MF_BYCOMMAND|MF_STRING|MF_ENABLED, id, label); - mii.dwItemData = (ULONG_PTR)&s; - pSub->SetMenuItemInfo(id, &mii); - id++; - } - } -} - -///////////// - -void CMainFrame::ShowControls(int nCS, bool fSave) -{ - int nCSprev = AfxGetAppSettings().nCS; - int hbefore = 0, hafter = 0; - - m_pLastBar = NULL; - - POSITION pos = m_bars.GetHeadPosition(); - for(int i = 1; pos; i <<= 1) - { - CControlBar* pNext = m_bars.GetNext(pos); - ShowControlBar(pNext, !!(nCS&i), TRUE); - if(nCS&i) m_pLastBar = pNext; - - CSize s = pNext->CalcFixedLayout(FALSE, TRUE); - if(nCSprev&i) hbefore += s.cy; - if(nCS&i) hafter += s.cy; - } - - WINDOWPLACEMENT wp; - wp.length = sizeof(wp); - GetWindowPlacement(&wp); - - if(wp.showCmd != SW_SHOWMAXIMIZED && !m_fFullScreen) - { - CRect r; - GetWindowRect(r); - MoveWindow(r.left, r.top, r.Width(), r.Height()+(hafter-hbefore)); - } - - if(fSave) - AfxGetAppSettings().nCS = nCS; - - RecalcLayout(); -} - -void CMainFrame::SetAlwaysOnTop(int i) -{ - AfxGetAppSettings().iOnTop = i; - - if(!m_fFullScreen) - { - const CWnd* pInsertAfter = NULL; - - if(i == 0) - pInsertAfter = &wndNoTopMost; - else if(i == 1) - pInsertAfter = &wndTopMost; - else // if(i == 2) - pInsertAfter = GetMediaState() == State_Running ? &wndTopMost : &wndNoTopMost; - - SetWindowPos(pInsertAfter, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE); - } - else if(!(GetWindowLong(m_hWnd, GWL_EXSTYLE)&WS_EX_TOPMOST)) - { - SetWindowPos(&wndTopMost, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE); - } -} - -void CMainFrame::AddTextPassThruFilter() -{ - BeginEnumFilters(pGB, pEF, pBF) - { - if(!IsSplitter(pBF)) continue; - - BeginEnumPins(pBF, pEP, pPin) - { - CComPtr pPinTo; - AM_MEDIA_TYPE mt; - if(FAILED(pPin->ConnectedTo(&pPinTo)) || !pPinTo - || FAILED(pPin->ConnectionMediaType(&mt)) - || mt.majortype != MEDIATYPE_Text && mt.majortype != MEDIATYPE_Subtitle) - continue; - - CComQIPtr pTPTF = new CTextPassThruFilter(this); - CStringW name; - name.Format(L"TextPassThru%08x", pTPTF); - if(FAILED(pGB->AddFilter(pTPTF, name))) - continue; - - HRESULT hr; - - hr = pPinTo->Disconnect(); - hr = pPin->Disconnect(); - - if(FAILED(hr = pGB->ConnectDirect(pPin, GetFirstPin(pTPTF, PINDIR_INPUT), NULL)) - || FAILED(hr = pGB->ConnectDirect(GetFirstPin(pTPTF, PINDIR_OUTPUT), pPinTo, NULL))) - hr = pGB->ConnectDirect(pPin, pPinTo, NULL); - else - m_pSubStreams.AddTail(CComQIPtr(pTPTF)); - } - EndEnumPins - } - EndEnumFilters -} - -bool CMainFrame::LoadSubtitle(CString fn) -{ - CComPtr pSubStream; - - // TMP: maybe this will catch something for those who get a runtime error dialog when opening subtitles from cds - try - { - if(!pSubStream) - { - CAutoPtr p(new CVobSubFile(&m_csSubLock)); - if(CString(CPath(fn).GetExtension()).MakeLower() == _T(".idx") && p && p->Open(fn) && p->GetStreamCount() > 0) - pSubStream = p.Detach(); - } - - if(!pSubStream) - { - CAutoPtr p(new ssf::CRenderer(&m_csSubLock)); - if(p && p->Open(fn) && p->GetStreamCount() > 0) - pSubStream = p.Detach(); - } - - if(!pSubStream) - { - CAutoPtr p(new CRenderedTextSubtitle(&m_csSubLock)); - if(p && p->Open(fn, DEFAULT_CHARSET) && p->GetStreamCount() > 0) - pSubStream = p.Detach(); - } - } - catch(CException* e) - { - e->Delete(); - } - - if(pSubStream) - { - m_pSubStreams.AddTail(pSubStream); - } - - return(!!pSubStream); -} - -void CMainFrame::UpdateSubtitle(bool fApplyDefStyle) -{ - if(!m_pCAP) return; - - int i = m_iSubtitleSel; - - POSITION pos = m_pSubStreams.GetHeadPosition(); - while(pos && i >= 0) - { - CComPtr pSubStream = m_pSubStreams.GetNext(pos); - - if(i < pSubStream->GetStreamCount()) - { - CAutoLock cAutoLock(&m_csSubLock); - pSubStream->SetStream(i); - SetSubtitle(pSubStream, fApplyDefStyle); - return; - } - - i -= pSubStream->GetStreamCount(); - } - - m_pCAP->SetSubPicProvider(NULL); -} - -void CMainFrame::SetSubtitle(ISubStream* pSubStream, bool fApplyDefStyle) -{ - AppSettings& s = AfxGetAppSettings(); - - if(pSubStream) - { - CLSID clsid; - pSubStream->GetClassID(&clsid); - - if(clsid == __uuidof(CVobSubFile)) - { - CVobSubFile* pVSF = (CVobSubFile*)(ISubStream*)pSubStream; - - if(fApplyDefStyle) - { - pVSF->SetAlignment(s.fOverridePlacement, s.nHorPos, s.nVerPos, 1, 1); - } - } - else if(clsid == __uuidof(CVobSubStream)) - { - CVobSubStream* pVSS = (CVobSubStream*)(ISubStream*)pSubStream; - - if(fApplyDefStyle) - { - pVSS->SetAlignment(s.fOverridePlacement, s.nHorPos, s.nVerPos, 1, 1); - } - } - else if(clsid == __uuidof(CRenderedTextSubtitle)) - { - CRenderedTextSubtitle* pRTS = (CRenderedTextSubtitle*)(ISubStream*)pSubStream; - - STSStyle style; - - if(fApplyDefStyle || !pRTS->m_fUsingDefaultStyleFromScript) - { - style = s.subdefstyle; - - if(s.fOverridePlacement) - { - style.scrAlignment = 2; - int w = pRTS->m_dstScreenSize.cx; - int h = pRTS->m_dstScreenSize.cy; - int mw = w - style.marginRect.left - style.marginRect.right; - style.marginRect.bottom = h - MulDiv(h, s.nVerPos, 100); - style.marginRect.left = MulDiv(w, s.nHorPos, 100) - mw/2; - style.marginRect.right = w - (style.marginRect.left + mw); - } - - pRTS->SetDefaultStyle(style); - } - - if(pRTS->GetDefaultStyle(style) && style.relativeTo == 2) - { - style.relativeTo = s.subdefstyle.relativeTo; - pRTS->SetDefaultStyle(style); - } - - pRTS->Deinit(); - } - } - - if(!fApplyDefStyle) - { - m_iSubtitleSel = -1; - - if(pSubStream) - { - - int i = 0; - - POSITION pos = m_pSubStreams.GetHeadPosition(); - while(pos) - { - CComPtr pSubStream2 = m_pSubStreams.GetNext(pos); - - if(pSubStream == pSubStream2) - { - m_iSubtitleSel = i + pSubStream2->GetStream(); - break; - } - - i += pSubStream2->GetStreamCount(); - } - - } - } - - m_nSubtitleId = (DWORD_PTR)pSubStream; - - if(m_pCAP) - { - m_pCAP->SetSubPicProvider(CComQIPtr(pSubStream)); - m_wndSubresyncBar.SetSubtitle(pSubStream, m_pCAP->GetFPS()); - } -} - -void CMainFrame::ReplaceSubtitle(ISubStream* pSubStreamOld, ISubStream* pSubStreamNew) -{ - POSITION pos = m_pSubStreams.GetHeadPosition(); - while(pos) - { - POSITION cur = pos; - if(pSubStreamOld == m_pSubStreams.GetNext(pos)) - { - m_pSubStreams.SetAt(cur, pSubStreamNew); - UpdateSubtitle(); - break; - } - } -} - -void CMainFrame::InvalidateSubtitle(DWORD_PTR nSubtitleId, REFERENCE_TIME rtInvalidate) -{ - if(m_pCAP) - { - if(nSubtitleId == -1 || nSubtitleId == m_nSubtitleId) - m_pCAP->Invalidate(rtInvalidate); - } -} - -void CMainFrame::ReloadSubtitle() -{ - POSITION pos = m_pSubStreams.GetHeadPosition(); - while(pos) m_pSubStreams.GetNext(pos)->Reload(); - UpdateSubtitle(); -} - -REFERENCE_TIME CMainFrame::GetPos() -{ - return(m_iMediaLoadState == MLS_LOADED ? m_wndSeekBar.GetPos() : 0); -} - -REFERENCE_TIME CMainFrame::GetDur() -{ - __int64 start, stop; - m_wndSeekBar.GetRange(start, stop); - return(m_iMediaLoadState == MLS_LOADED ? stop : 0); -} - -void CMainFrame::SeekTo(REFERENCE_TIME rtPos, bool fSeekToKeyFrame) -{ - OAFilterState fs = GetMediaState(); - - if(rtPos < 0) rtPos = 0; - - if(m_iPlaybackMode == PM_FILE) - { - if(fs == State_Stopped) - SendMessage(WM_COMMAND, ID_PLAY_PAUSE); - - HRESULT hr; - - if(fSeekToKeyFrame) - { - if(!m_kfs.IsEmpty()) - { - int i = rangebsearch(rtPos, m_kfs); - if(i >= 0 && i < m_kfs.GetCount()) - rtPos = m_kfs[i]; - } - } - - hr = pMS->SetPositions(&rtPos, AM_SEEKING_AbsolutePositioning, NULL, AM_SEEKING_NoPositioning); - } - else if(m_iPlaybackMode == PM_DVD && m_iDVDDomain == DVD_DOMAIN_Title) - { - if(fs != State_Running) - SendMessage(WM_COMMAND, ID_PLAY_PLAY); - - DVD_HMSF_TIMECODE tc = RT2HMSF(rtPos); - pDVDC->PlayAtTime(&tc, DVD_CMD_FLAG_Block|DVD_CMD_FLAG_Flush, NULL); - -// if(fs != State_Running) -// SendMessage(WM_COMMAND, ID_PLAY_PAUSE); - } - else if(m_iPlaybackMode == PM_CAPTURE) - { - TRACE(_T("Warning (CMainFrame::SeekTo): Trying to seek in capture mode")); - } - - m_fEndOfStream = false; -} - -void CMainFrame::CleanGraph() -{ - if(!pGB) return; - - BeginEnumFilters(pGB, pEF, pBF) - { - CComQIPtr pAMMF(pBF); - if(pAMMF && (pAMMF->GetMiscFlags()&AM_FILTER_MISC_FLAGS_IS_SOURCE)) - continue; - - // some capture filters forget to set AM_FILTER_MISC_FLAGS_IS_SOURCE - // or to implement the IAMFilterMiscFlags interface - if(pBF == pVidCap || pBF == pAudCap) - continue; - - if(CComQIPtr(pBF)) - continue; - - int nIn, nOut, nInC, nOutC; - if(CountPins(pBF, nIn, nOut, nInC, nOutC) > 0 && (nInC+nOutC) == 0) - { - TRACE(CStringW(L"Removing: ") + GetFilterName(pBF) + '\n'); - - pGB->RemoveFilter(pBF); - pEF->Reset(); - } - } - EndEnumFilters -} - -#define AUDIOBUFFERLEN 500 - -static void SetLatency(IBaseFilter* pBF, int cbBuffer) -{ - BeginEnumPins(pBF, pEP, pPin) - { - if(CComQIPtr pAMBN = pPin) - { - ALLOCATOR_PROPERTIES ap; - ap.cbAlign = -1; // -1 means no preference. - ap.cbBuffer = cbBuffer; - ap.cbPrefix = -1; - ap.cBuffers = -1; - pAMBN->SuggestAllocatorProperties(&ap); - } - } - EndEnumPins -} - -HRESULT CMainFrame::BuildCapture(IPin* pPin, IBaseFilter* pBF[3], const GUID& majortype, AM_MEDIA_TYPE* pmt) -{ - IBaseFilter* pBuff = pBF[0]; - IBaseFilter* pEnc = pBF[1]; - IBaseFilter* pMux = pBF[2]; - - if(!pPin || !pMux) return E_FAIL; - - CString err; - - HRESULT hr = S_OK; - - CFilterInfo fi; - if(FAILED(pMux->QueryFilterInfo(&fi)) || !fi.pGraph) - pGB->AddFilter(pMux, L"Multiplexer"); - - CStringW prefix, prefixl; - if(majortype == MEDIATYPE_Video) prefix = L"Video "; - else if(majortype == MEDIATYPE_Audio) prefix = L"Audio "; - prefixl = prefix; - prefixl.MakeLower(); - - if(pBuff) - { - hr = pGB->AddFilter(pBuff, prefix + L"Buffer"); - if(FAILED(hr)) - { - err = _T("Can't add ") + CString(prefixl) + _T("buffer filter"); - AfxMessageBox(err); - return hr; - } - - hr = pGB->ConnectFilter(pPin, pBuff); - if(FAILED(hr)) - { - err = _T("Error connecting the ") + CString(prefixl) + _T("buffer filter"); - AfxMessageBox(err); - return(hr); - } - - pPin = GetFirstPin(pBuff, PINDIR_OUTPUT); - } - - if(pEnc) - { - hr = pGB->AddFilter(pEnc, prefix + L"Encoder"); - if(FAILED(hr)) - { - err = _T("Can't add ") + CString(prefixl) + _T("encoder filter"); - AfxMessageBox(err); - return hr; - } - - hr = pGB->ConnectFilter(pPin, pEnc); - if(FAILED(hr)) - { - err = _T("Error connecting the ") + CString(prefixl) + _T("encoder filter"); - AfxMessageBox(err); - return(hr); - } - - pPin = GetFirstPin(pEnc, PINDIR_OUTPUT); - - if(CComQIPtr pAMSC = pPin) - { - if(pmt->majortype == majortype) - { - hr = pAMSC->SetFormat(pmt); - if(FAILED(hr)) - { - err = _T("Can't set compression format on the ") + CString(prefixl) + _T("encoder filter"); - AfxMessageBox(err); - return(hr); - } - } - } - - } - -// if(pMux) - { - hr = pGB->ConnectFilter(pPin, pMux); - if(FAILED(hr)) - { - err = _T("Error connecting ") + CString(prefixl) + _T(" to the muliplexer filter"); - AfxMessageBox(err); - return(hr); - } - } - - CleanGraph(); - - return S_OK; -} - -bool CMainFrame::BuildToCapturePreviewPin( - IBaseFilter* pVidCap, IPin** ppVidCapPin, IPin** ppVidPrevPin, - IBaseFilter* pAudCap, IPin** ppAudCapPin, IPin** ppAudPrevPin) -{ - HRESULT hr; - - *ppVidCapPin = *ppVidPrevPin = NULL; - *ppAudCapPin = *ppAudPrevPin = NULL; - - CComPtr pDVAudPin; - - if(pVidCap) - { - CComPtr pPin; - if(!pAudCap // only look for interleaved stream when we don't use any other audio capture source - && SUCCEEDED(pCGB->FindPin(pVidCap, PINDIR_OUTPUT, &PIN_CATEGORY_CAPTURE, &MEDIATYPE_Interleaved, TRUE, 0, &pPin))) - { - CComPtr pDVSplitter; - hr = pDVSplitter.CoCreateInstance(CLSID_DVSplitter); - hr = pGB->AddFilter(pDVSplitter, L"DV Splitter"); - - hr = pCGB->RenderStream(NULL, &MEDIATYPE_Interleaved, pPin, NULL, pDVSplitter); - - pPin = NULL; - hr = pCGB->FindPin(pDVSplitter, PINDIR_OUTPUT, NULL, &MEDIATYPE_Video, TRUE, 0, &pPin); - hr = pCGB->FindPin(pDVSplitter, PINDIR_OUTPUT, NULL, &MEDIATYPE_Audio, TRUE, 0, &pDVAudPin); - - CComPtr pDVDec; - hr = pDVDec.CoCreateInstance(CLSID_DVVideoCodec); - hr = pGB->AddFilter(pDVDec, L"DV Video Decoder"); - - hr = pGB->ConnectFilter(pPin, pDVDec); - - pPin = NULL; - hr = pCGB->FindPin(pDVDec, PINDIR_OUTPUT, NULL, &MEDIATYPE_Video, TRUE, 0, &pPin); - } - else if(SUCCEEDED(pCGB->FindPin(pVidCap, PINDIR_OUTPUT, &PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video, TRUE, 0, &pPin))) - { - } - else - { - AfxMessageBox(_T("No video capture pin was found")); - return(false); - } - - CComPtr pSmartTee; - hr = pSmartTee.CoCreateInstance(CLSID_SmartTee); - hr = pGB->AddFilter(pSmartTee, L"Smart Tee (video)"); - - hr = pGB->ConnectFilter(pPin, pSmartTee); - - hr = pSmartTee->FindPin(L"Preview", ppVidPrevPin); - hr = pSmartTee->FindPin(L"Capture", ppVidCapPin); - } - - if(pAudCap || pDVAudPin) - { - CComPtr pPin; - if(pDVAudPin) - { - pPin = pDVAudPin; - } - else if(SUCCEEDED(pCGB->FindPin(pAudCap, PINDIR_OUTPUT, &PIN_CATEGORY_CAPTURE, &MEDIATYPE_Audio, TRUE, 0, &pPin))) - { - } - else - { - AfxMessageBox(_T("No audio capture pin was found")); - return(false); - } - - CComPtr pSmartTee; - hr = pSmartTee.CoCreateInstance(CLSID_SmartTee); - hr = pGB->AddFilter(pSmartTee, L"Smart Tee (audio)"); - - hr = pGB->ConnectFilter(pPin, pSmartTee); - - hr = pSmartTee->FindPin(L"Preview", ppAudPrevPin); - hr = pSmartTee->FindPin(L"Capture", ppAudCapPin); - } - - return(true); -} - -bool CMainFrame::BuildGraphVideoAudio(int fVPreview, bool fVCapture, int fAPreview, bool fACapture) -{ - if(!pCGB) return(false); - - SaveMediaState; - - HRESULT hr; - - pGB->NukeDownstream(pVidCap); - pGB->NukeDownstream(pAudCap); - - CleanGraph(); - - if(pAMVSCCap) hr = pAMVSCCap->SetFormat(&m_wndCaptureBar.m_capdlg.m_mtv); - if(pAMVSCPrev) hr = pAMVSCPrev->SetFormat(&m_wndCaptureBar.m_capdlg.m_mtv); - if(pAMASC) hr = pAMASC->SetFormat(&m_wndCaptureBar.m_capdlg.m_mta); - - CComPtr pVidBuffer = m_wndCaptureBar.m_capdlg.m_pVidBuffer; - CComPtr pAudBuffer = m_wndCaptureBar.m_capdlg.m_pAudBuffer; - CComPtr pVidEnc = m_wndCaptureBar.m_capdlg.m_pVidEnc; - CComPtr pAudEnc = m_wndCaptureBar.m_capdlg.m_pAudEnc; - CComPtr pMux = m_wndCaptureBar.m_capdlg.m_pMux; - CComPtr pDst = m_wndCaptureBar.m_capdlg.m_pDst; - CComPtr pAudMux = m_wndCaptureBar.m_capdlg.m_pAudMux; - CComPtr pAudDst = m_wndCaptureBar.m_capdlg.m_pAudDst; - - bool fFileOutput = (pMux && pDst) || (pAudMux && pAudDst); - bool fCapture = (fVCapture || fACapture); - - if(pAudCap) - { - AM_MEDIA_TYPE* pmt = &m_wndCaptureBar.m_capdlg.m_mta; - int ms = (fACapture && fFileOutput && m_wndCaptureBar.m_capdlg.m_fAudOutput) ? AUDIOBUFFERLEN : 60; - if(pMux != pAudMux && fACapture) SetLatency(pAudCap, -1); - else if(pmt->pbFormat) SetLatency(pAudCap, ((WAVEFORMATEX*)pmt->pbFormat)->nAvgBytesPerSec * ms / 1000); - } - - CComPtr pVidCapPin, pVidPrevPin, pAudCapPin, pAudPrevPin; - BuildToCapturePreviewPin(pVidCap, &pVidCapPin, &pVidPrevPin, pAudCap, &pAudCapPin, &pAudPrevPin); - -// if(pVidCap) - { - bool fVidPrev = pVidPrevPin && fVPreview; - bool fVidCap = pVidCapPin && fVCapture && fFileOutput && m_wndCaptureBar.m_capdlg.m_fVidOutput; - - if(fVPreview == 2 && !fVidCap && pVidCapPin) - { - pVidPrevPin = pVidCapPin; - pVidCapPin = NULL; - } - - if(fVidPrev) - { - m_pCAP = NULL; - pGB->Render(pVidPrevPin); - pGB->FindInterface(__uuidof(ISubPicAllocatorPresenter), (void**)&m_pCAP, TRUE); - } - - if(fVidCap) - { - IBaseFilter* pBF[3] = {pVidBuffer, pVidEnc, pMux}; - HRESULT hr = BuildCapture(pVidCapPin, pBF, MEDIATYPE_Video, &m_wndCaptureBar.m_capdlg.m_mtcv); - } - - pAMDF = NULL; - pCGB->FindInterface(&PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video, pVidCap, IID_IAMDroppedFrames, (void**)&pAMDF); - } - -// if(pAudCap) - { - bool fAudPrev = pAudPrevPin && fAPreview; - bool fAudCap = pAudCapPin && fACapture && fFileOutput && m_wndCaptureBar.m_capdlg.m_fAudOutput; - - if(fAPreview == 2 && !fAudCap && pAudCapPin) - { - pAudPrevPin = pAudCapPin; - pAudCapPin = NULL; - } - - if(fAudPrev) - { - pGB->Render(pAudPrevPin); - } - - if(fAudCap) - { - IBaseFilter* pBF[3] = {pAudBuffer, pAudEnc, pAudMux ? pAudMux : pMux}; - HRESULT hr = BuildCapture(pAudCapPin, pBF, MEDIATYPE_Audio, &m_wndCaptureBar.m_capdlg.m_mtca); - } - } - - if((pVidCap || pAudCap) && fCapture && fFileOutput) - { - if(pMux != pDst) - { - hr = pGB->AddFilter(pDst, L"File Writer V/A"); - hr = pGB->ConnectFilter(GetFirstPin(pMux, PINDIR_OUTPUT), pDst); - } - - if(CComQIPtr pCAM = pMux) - { - int nIn, nOut, nInC, nOutC; - CountPins(pMux, nIn, nOut, nInC, nOutC); - pCAM->SetMasterStream(nInC-1); -// pCAM->SetMasterStream(-1); - pCAM->SetOutputCompatibilityIndex(FALSE); - } - - if(CComQIPtr pCI = pMux) - { -// if(FAILED(pCI->put_Mode(INTERLEAVE_CAPTURE))) - if(FAILED(pCI->put_Mode(INTERLEAVE_NONE_BUFFERED))) - pCI->put_Mode(INTERLEAVE_NONE); - - REFERENCE_TIME rtInterleave = 10000i64*AUDIOBUFFERLEN, rtPreroll = 0;//10000i64*500 - pCI->put_Interleaving(&rtInterleave, &rtPreroll); - } - - if(pMux != pAudMux && pAudMux != pAudDst) - { - hr = pGB->AddFilter(pAudDst, L"File Writer A"); - hr = pGB->ConnectFilter(GetFirstPin(pAudMux, PINDIR_OUTPUT), pAudDst); - } - } - - REFERENCE_TIME stop = MAX_TIME; - hr = pCGB->ControlStream(&PIN_CATEGORY_CAPTURE, NULL, NULL, NULL, &stop, 0, 0); // stop in the infinite - - CleanGraph(); - - OpenSetupVideo(); - OpenSetupAudio(); - OpenSetupStatsBar(); - OpenSetupStatusBar(); - - RestoreMediaState; - - return(true); -} - -bool CMainFrame::StartCapture() -{ - if(!pCGB || m_fCapturing) return(false); - - if(!m_wndCaptureBar.m_capdlg.m_pMux && !m_wndCaptureBar.m_capdlg.m_pDst) return(false); - - HRESULT hr; - - ::SetPriorityClass(::GetCurrentProcess(), HIGH_PRIORITY_CLASS); - - // rare to see two capture filters to support IAMPushSource at the same time... -// hr = CComQIPtr(pGB)->SyncUsingStreamOffset(TRUE); // TODO: - - BuildGraphVideoAudio( - m_wndCaptureBar.m_capdlg.m_fVidPreview, true, - m_wndCaptureBar.m_capdlg.m_fAudPreview, true); - - hr = pME->CancelDefaultHandling(EC_REPAINT); - - SendMessage(WM_COMMAND, ID_PLAY_PLAY); - - m_fCapturing = true; - - return(true); -} - -bool CMainFrame::StopCapture() -{ - if(!pCGB || !m_fCapturing) return(false); - - if(!m_wndCaptureBar.m_capdlg.m_pMux && !m_wndCaptureBar.m_capdlg.m_pDst) return(false); - - HRESULT hr; - - m_wndStatusBar.SetStatusMessage(ResStr(IDS_CONTROLS_COMPLETING)); - - m_fCapturing = false; - - BuildGraphVideoAudio( - m_wndCaptureBar.m_capdlg.m_fVidPreview, false, - m_wndCaptureBar.m_capdlg.m_fAudPreview, false); - - hr = pME->RestoreDefaultHandling(EC_REPAINT); - - ::SetPriorityClass(::GetCurrentProcess(), AfxGetAppSettings().priority); - - m_rtDurationOverride = -1; - - return(true); -} - -// - -void CMainFrame::ShowOptions(int idPage) -{ - AppSettings& s = AfxGetAppSettings(); - - CPPageSheet options(ResStr(IDS_OPTIONS_CAPTION), pGB, this, idPage); - - if(options.DoModal() == IDOK) - { - if(!m_fFullScreen) - SetAlwaysOnTop(s.iOnTop); - - m_wndView.LoadLogo(); - - s.UpdateData(true); - } -} - -void CMainFrame::StartWebServer(int nPort) -{ - if(!m_pWebServer) - m_pWebServer.Attach(new CWebServer(this, nPort)); -} - -void CMainFrame::StopWebServer() -{ - if(m_pWebServer) - m_pWebServer.Free(); -} - -CString CMainFrame::GetStatusMessage() -{ - CString str; - m_wndStatusBar.m_status.GetWindowText(str); - return str; -} - -void CMainFrame::SendStatusMessage(CString msg, int nTimeOut) -{ - KillTimer(TIMER_STATUSERASER); - - m_playingmsg.Empty(); - if(nTimeOut <= 0) return; - - m_playingmsg = msg; - SetTimer(TIMER_STATUSERASER, nTimeOut, NULL); -} - -void CMainFrame::OpenCurPlaylistItem(REFERENCE_TIME rtStart) -{ - if(m_wndPlaylistBar.GetCount() == 0) - return; - - CPlaylistItem pli; - if(!m_wndPlaylistBar.GetCur(pli)) m_wndPlaylistBar.SetFirst(); - if(!m_wndPlaylistBar.GetCur(pli)) return; - - CAutoPtr p(m_wndPlaylistBar.GetCurOMD(rtStart)); - if(p) OpenMedia(p); -} - -void CMainFrame::AddCurDevToPlaylist() -{ - if(m_iPlaybackMode == PM_CAPTURE) - { - m_wndPlaylistBar.Append( - m_VidDispName, - m_AudDispName, - m_wndCaptureBar.m_capdlg.GetVideoInput(), - m_wndCaptureBar.m_capdlg.GetVideoChannel(), - m_wndCaptureBar.m_capdlg.GetAudioInput() - ); - } -} - -static int s_fOpenedThruThread = false; - -void CMainFrame::OpenMedia(CAutoPtr pOMD) -{ - // shortcut - if(OpenDeviceData* p = dynamic_cast(pOMD.m_p)) - { - if(m_iMediaLoadState == MLS_LOADED && pAMTuner - && m_VidDispName == p->DisplayName[0] && m_AudDispName == p->DisplayName[1]) - { - m_wndCaptureBar.m_capdlg.SetVideoInput(p->vinput); - m_wndCaptureBar.m_capdlg.SetVideoChannel(p->vchannel); - m_wndCaptureBar.m_capdlg.SetAudioInput(p->ainput); - SendNowPlayingToMSN(); - SendNowPlayingTomIRC(); - return; - } - } - - if(m_iMediaLoadState != MLS_CLOSED) - CloseMedia(); - - m_iMediaLoadState = MLS_LOADING; // HACK: hides the logo - - AppSettings& s = AfxGetAppSettings(); - - bool fUseThread = true; - - if(OpenFileData* p = dynamic_cast(pOMD.m_p)) - { - if(p->fns.GetCount() > 0) - { - engine_t e = s.Formats.GetEngine(p->fns.GetHead()); - fUseThread = e == DirectShow /*|| e == RealMedia || e == QuickTime*/; - } - } - else if(OpenDeviceData* p = dynamic_cast(pOMD.m_p)) - { - fUseThread = false; - } - - if(m_pGraphThread && fUseThread - && AfxGetAppSettings().fEnableWorkerThreadForOpening) - { - m_pGraphThread->PostThreadMessage(CGraphThread::TM_OPEN, 0, (LPARAM)pOMD.Detach()); - s_fOpenedThruThread = true; - } - else - { - OpenMediaPrivate(pOMD); - s_fOpenedThruThread = false; - } -} - -void CMainFrame::CloseMedia() -{ - if(m_iMediaLoadState == MLS_CLOSING) - { - TRACE(_T("WARNING: CMainFrame::CloseMedia() called twice or more\n")); - return; - } - - int nTimeWaited = 0; - - while(m_iMediaLoadState == MLS_LOADING) - { - m_fOpeningAborted = true; - - if(pGB) pGB->Abort(); // TODO: lock on graph objects somehow, this is not thread safe - - if(nTimeWaited > 5*1000 && m_pGraphThread) - { - MessageBeep(MB_ICONEXCLAMATION); - TRACE(_T("CRITICAL ERROR: !!! Must kill opener thread !!!")); - TerminateThread(m_pGraphThread->m_hThread, -1); - m_pGraphThread = (CGraphThread*)AfxBeginThread(RUNTIME_CLASS(CGraphThread)); - s_fOpenedThruThread = false; - break; - } - - Sleep(50); - - nTimeWaited += 50; - } - - m_fOpeningAborted = false; - - m_closingmsg.Empty(); - - m_iMediaLoadState = MLS_CLOSING; - - OnFilePostClosemedia(); - - if(m_pGraphThread && s_fOpenedThruThread) - { - CAMEvent e; - m_pGraphThread->PostThreadMessage(CGraphThread::TM_CLOSE, 0, (LPARAM)&e); - e.Wait(); // either opening or closing has to be blocked to prevent reentering them, closing is the better choice - } - else - { - CloseMediaPrivate(); - } - - UnloadExternalObjects(); -} - -// -// CGraphThread -// - -IMPLEMENT_DYNCREATE(CGraphThread, CWinThread) - -BOOL CGraphThread::InitInstance() -{ - AfxSocketInit(); - return SUCCEEDED(CoInitialize(0)) ? TRUE : FALSE; -} - -int CGraphThread::ExitInstance() -{ - CoUninitialize(); - return __super::ExitInstance(); -} - -BEGIN_MESSAGE_MAP(CGraphThread, CWinThread) - ON_THREAD_MESSAGE(TM_EXIT, OnExit) - ON_THREAD_MESSAGE(TM_OPEN, OnOpen) - ON_THREAD_MESSAGE(TM_CLOSE, OnClose) -END_MESSAGE_MAP() - -void CGraphThread::OnExit(WPARAM wParam, LPARAM lParam) -{ - PostQuitMessage(0); - if(CAMEvent* e = (CAMEvent*)lParam) e->Set(); -} - -void CGraphThread::OnOpen(WPARAM wParam, LPARAM lParam) -{ - if(m_pMainFrame) - { - CAutoPtr pOMD((OpenMediaData*)lParam); - m_pMainFrame->OpenMediaPrivate(pOMD); - } -} - -void CGraphThread::OnClose(WPARAM wParam, LPARAM lParam) -{ - if(m_pMainFrame) m_pMainFrame->CloseMediaPrivate(); - if(CAMEvent* e = (CAMEvent*)lParam) e->Set(); -} - -afx_msg void CMainFrame::OnSubtitleDelay(UINT nID) -{ - if(m_pCAP) { - int newDelay; - int oldDelay = m_pCAP->GetSubtitleDelay(); - - if(nID == ID_SUB_DELAY_DOWN) - newDelay = oldDelay-AfxGetAppSettings().nSubDelayInterval; - else - newDelay = oldDelay+AfxGetAppSettings().nSubDelayInterval; - - SetSubtitleDelay(newDelay); - } -} diff --git a/src/apps/mplayerc/MainFrm.h b/src/apps/mplayerc/MainFrm.h deleted file mode 100644 index 2a676135a..000000000 --- a/src/apps/mplayerc/MainFrm.h +++ /dev/null @@ -1,671 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#pragma once - -#include - -#include "ChildView.h" -#include "PlayerSeekBar.h" -#include "PlayerToolBar.h" -#include "PlayerInfoBar.h" -#include "PlayerStatusBar.h" -#include "PlayerSubresyncBar.h" -#include "PlayerPlaylistBar.h" -#include "PlayerCaptureBar.h" -#include "PlayerShaderEditorBar.h" -#include "PPageSheet.h" -#include "PPageFileInfoSheet.h" -#include "OpenCapDeviceDlg.h" - -#include "FileDropTarget.h" - -#include "KeyProvider.h" - -#include "..\..\subpic\ISubPic.h" - -#include "IGraphBuilder2.h" - -#include "RealMediaGraph.h" -#include "QuicktimeGraph.h" -#include "ShockwaveGraph.h" - -#include "..\..\..\include\IChapterInfo.h" -#include "..\..\..\include\IKeyFrameInfo.h" -#include "..\..\..\include\IBufferInfo.h" - -#include "WebServer.h" - -enum {PM_NONE, PM_FILE, PM_DVD, PM_CAPTURE}; - -class OpenMediaData -{ -public: -// OpenMediaData() {} - virtual ~OpenMediaData() {} // one virtual funct is needed to enable rtti - CString title; - CAtlList subs; -}; - -class OpenFileData : public OpenMediaData -{ -public: - OpenFileData() : rtStart(0) {} - CAtlList fns; - REFERENCE_TIME rtStart; -}; - -class OpenDVDData : public OpenMediaData -{ -public: -// OpenDVDData() {} - CString path; - CComPtr pDvdState; -}; - -class OpenDeviceData : public OpenMediaData -{ -public: - OpenDeviceData() {vinput = vchannel = ainput = -1;} - CStringW DisplayName[2]; - int vinput, vchannel, ainput; -}; - -class CMainFrame; - -class CGraphThread : public CWinThread -{ - CMainFrame* m_pMainFrame; - - DECLARE_DYNCREATE(CGraphThread); - -public: - CGraphThread() : m_pMainFrame(NULL) {} - - void SetMainFrame(CMainFrame* pMainFrame) {m_pMainFrame = pMainFrame;} - - BOOL InitInstance(); - int ExitInstance(); - - enum {TM_EXIT=WM_APP, TM_OPEN, TM_CLOSE}; - DECLARE_MESSAGE_MAP() - afx_msg void OnExit(WPARAM wParam, LPARAM lParam); - afx_msg void OnOpen(WPARAM wParam, LPARAM lParam); - afx_msg void OnClose(WPARAM wParam, LPARAM lParam); -}; -/* -class CKeyFrameFinderThread : public CWinThread, public CCritSec -{ - DECLARE_DYNCREATE(CKeyFrameFinderThread); - -public: - CKeyFrameFinderThread() {} - - CUIntArray m_kfs; // protected by (CCritSec*)this - - BOOL InitInstance(); - int ExitInstance(); - - enum {TM_EXIT=WM_APP, TM_INDEX, TM_BREAK}; - DECLARE_MESSAGE_MAP() - afx_msg void OnExit(WPARAM wParam, LPARAM lParam); - afx_msg void OnIndex(WPARAM wParam, LPARAM lParam); - afx_msg void OnBreak(WPARAM wParam, LPARAM lParam); -}; -*/ -interface ISubClock; - -class CMainFrame : public CFrameWnd, public CDropTarget -{ - enum - { - TIMER_STREAMPOSPOLLER = 1, - TIMER_STREAMPOSPOLLER2, - TIMER_FULLSCREENCONTROLBARHIDER, - TIMER_FULLSCREENMOUSEHIDER, - TIMER_STATS, - TIMER_LEFTCLICK, - TIMER_STATUSERASER - }; - - friend class CPPageFileInfoSheet; - friend class CPPageLogo; - - // TODO: wrap these graph objects into a class to make it look cleaner - - DWORD m_dwRegister; - - CComPtr pGB; - CComQIPtr pMC; - CComQIPtr pME; - CComQIPtr pVW; - CComQIPtr pBV; - CComQIPtr pBA; - CComQIPtr pMS; - CComQIPtr pFS; - CComQIPtr pQP; - CComQIPtr pBI; - CComQIPtr pAMOP; - - CComQIPtr pDVDC; - CComQIPtr pDVDI; - - CComPtr pCGB; - CStringW m_VidDispName, m_AudDispName; - CComPtr pVidCap, pAudCap; - CComPtr pAMVCCap, pAMVCPrev; - CComPtr pAMVSCCap, pAMVSCPrev, pAMASC; - CComPtr pAMXBar; - CComPtr pAMTuner; - CComPtr pAMDF; - - CComPtr m_pCAP; - - void SetBalance(int balance); - - // subtitles - - CCritSec m_csSubLock; - CInterfaceList m_pSubStreams; - int m_iSubtitleSel; // if(m_iSubtitleSel&(1<<31)): disabled - DWORD_PTR m_nSubtitleId; - - friend class CTextPassThruFilter; - - // windowing - - CRect m_lastWindowRect; - CPoint m_lastMouseMove; - - CRect m_rcDesktop; - - void ShowControls(int nCS, bool fSave = true); - - void SetDefaultWindowRect(int iMonitor = 0); - void RestoreDefaultWindowRect(); - void ZoomVideoWindow(double scale = -1); - double GetZoomAutoFitScale(); - - void SetAlwaysOnTop(int i); - - // dynamic menus - - void SetupOpenCDSubMenu(); - void SetupFiltersSubMenu(); - void SetupAudioSwitcherSubMenu(); - void SetupSubtitlesSubMenu(); - void SetupNavAudioSubMenu(); - void SetupNavSubtitleSubMenu(); - void SetupNavAngleSubMenu(); - void SetupNavChaptersSubMenu(); - void SetupFavoritesSubMenu(); - void SetupShadersSubMenu(); - - void SetupNavStreamSelectSubMenu(CMenu* pSub, UINT id, DWORD dwSelGroup); - void OnNavStreamSelectSubMenu(UINT id, DWORD dwSelGroup); - - CMenu m_popupmain, m_popup; - CMenu m_opencds; - CMenu m_filters, m_subtitles, m_audios; - CAutoPtrArray m_filterpopups; - CMenu m_navaudio, m_navsubtitle, m_navangle; - CMenu m_navchapters, m_navtitles; - CMenu m_favorites; - CMenu m_shaders; - - CInterfaceArray m_pparray; - CInterfaceArray m_ssarray; - - // chapters (file mode) - CComPtr m_pCB; - void SetupChapters(); - - // - - void SetupIViAudReg(); - - void AddTextPassThruFilter(); - - int m_nLoops; - - bool m_fCustomGraph; - bool m_fRealMediaGraph, m_fShockwaveGraph, m_fQuicktimeGraph; - - CComPtr m_pSubClock; - - int m_fFrameSteppingActive; - int m_VolumeBeforeFrameStepping; - - bool m_fEndOfStream; - - bool m_fBuffering; - - bool m_fLiveWM; - - bool m_fUpdateInfoBar; - - void SendStatusMessage(CString msg, int nTimeOut); - CString m_playingmsg, m_closingmsg; - - REFERENCE_TIME m_rtDurationOverride; - - CComPtr m_pProv; - - void CleanGraph(); - - CComPtr pAudioDubSrc; - - void ShowOptions(int idPage = 0); - - bool GetDIB(BYTE** ppData, long& size, bool fSilent = false); - void SaveDIB(LPCTSTR fn, BYTE* pData, long size); - BOOL IsRendererCompatibleWithSaveImage(); - void SaveImage(LPCTSTR fn); - void SaveThumbnails(LPCTSTR fn); - - // - - friend class CWebClientSocket; - friend class CWebServer; - CAutoPtr m_pWebServer; - -public: - void StartWebServer(int nPort); - void StopWebServer(); - - CString GetStatusMessage(); - bool IsMuted() {return m_wndToolBar.GetVolume() == -10000;} - int GetVolume() {return m_wndToolBar.m_volctrl.GetPos();} - -public: - CMainFrame(); - - DECLARE_DYNAMIC(CMainFrame) - -// Attributes -public: - int m_iPlaybackMode; - - bool m_fFullScreen; - bool m_fHideCursor; - - bool IsFrameLessWindow() {return(m_fFullScreen || AfxGetAppSettings().fHideCaptionMenu);} - bool IsCaptionMenuHidden() {return(!m_fFullScreen && AfxGetAppSettings().fHideCaptionMenu);} - bool IsSomethingLoaded() {return(m_iMediaLoadState != MLS_CLOSED);} - bool IsPlaylistEmpty() {return(m_wndPlaylistBar.GetCount() == 0);} - bool IsInteractiveVideo() {return(AfxGetAppSettings().fIntRealMedia && m_fRealMediaGraph || m_fShockwaveGraph);} - - CControlBar* m_pLastBar; - -protected: - enum {MLS_CLOSED, MLS_LOADING, MLS_LOADED, MLS_CLOSING}; - int m_iMediaLoadState; - - bool m_fAudioOnly; - dispmode m_dmBeforeFullscreen; - - DVD_DOMAIN m_iDVDDomain; - DWORD m_iDVDTitle; - int m_iSpeedLevel; - - double m_ZoomX, m_ZoomY, m_PosX, m_PosY; - int m_AngleX, m_AngleY, m_AngleZ; - -// Operations - bool OpenMediaPrivate(CAutoPtr pOMD); - void CloseMediaPrivate(); - - void SendNowPlayingToMSN(); - void SendNowPlayingTomIRC(); - - void OpenCreateGraphObject(OpenMediaData* pOMD); - void OpenFile(OpenFileData* pOFD); - void OpenDVD(OpenDVDData* pODD); - void OpenCapture(OpenDeviceData* pODD); - void OpenCustomizeGraph(); - void OpenSetupVideo(); - void OpenSetupAudio(); - void OpenSetupInfoBar(); - void OpenSetupStatsBar(); - void OpenSetupStatusBar(); - // void OpenSetupToolBar(); - void OpenSetupCaptureBar(); - void OpenSetupWindowTitle(CString fn = _T("")); - - friend class CGraphThread; - CGraphThread* m_pGraphThread; - - CAtlArray m_kfs; - - bool m_fOpeningAborted; - -public: - void OpenCurPlaylistItem(REFERENCE_TIME rtStart = 0); - void OpenMedia(CAutoPtr pOMD); - void CloseMedia(); - - void AddCurDevToPlaylist(); - - bool m_fTrayIcon; - void ShowTrayIcon(bool fShow); - void SetTrayTip(CString str); - - CSize GetVideoSize(); - void ToggleFullscreen(bool fToNearest, bool fSwitchScreenResWhenHasTo); - void MoveVideoWindow(bool fShowStats = false); - void RepaintVideo(); - - OAFilterState GetMediaState(); - REFERENCE_TIME GetPos(), GetDur(); - void SeekTo(REFERENCE_TIME rt, bool fSeekToKeyFrame = false); - - bool LoadSubtitle(CString fn); - void UpdateSubtitle(bool fApplyDefStyle = false); - void SetSubtitle(ISubStream* pSubStream, bool fApplyDefStyle = false); - void ReplaceSubtitle(ISubStream* pSubStreamOld, ISubStream* pSubStreamNew); - void InvalidateSubtitle(DWORD_PTR nSubtitleId = -1, REFERENCE_TIME rtInvalidate = -1); - void ReloadSubtitle(); - - // shaders - CAtlList m_shaderlabels; - void SetShaders(); - void UpdateShaders(CString label); - - // capturing - bool m_fCapturing; - HRESULT BuildCapture(IPin* pPin, IBaseFilter* pBF[3], const GUID& majortype, AM_MEDIA_TYPE* pmt); // pBF: 0 buff, 1 enc, 2 mux, pmt is for 1 enc - bool BuildToCapturePreviewPin( - IBaseFilter* pVidCap, IPin** pVidCapPin, IPin** pVidPrevPin, - IBaseFilter* pAudCap, IPin** pAudCapPin, IPin** pAudPrevPin); - bool BuildGraphVideoAudio(int fVPreview, bool fVCapture, int fAPreview, bool fACapture); - bool DoCapture(), StartCapture(), StopCapture(); - - bool DoAfterPlaybackEvent(); - - virtual BOOL PreCreateWindow(CREATESTRUCT& cs); - virtual BOOL PreTranslateMessage(MSG* pMsg); - virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo); - virtual void RecalcLayout(BOOL bNotify = TRUE); - -// Implementation -public: - virtual ~CMainFrame(); -#ifdef _DEBUG - virtual void AssertValid() const; - virtual void Dump(CDumpContext& dc) const; -#endif - -protected: // control bar embedded members - - CChildView m_wndView; - - CPlayerSeekBar m_wndSeekBar; - CPlayerToolBar m_wndToolBar; - CPlayerInfoBar m_wndInfoBar; - CPlayerInfoBar m_wndStatsBar; - CPlayerStatusBar m_wndStatusBar; - CList m_bars; - - CPlayerSubresyncBar m_wndSubresyncBar; - CPlayerPlaylistBar m_wndPlaylistBar; - CPlayerCaptureBar m_wndCaptureBar; - CPlayerShaderEditorBar m_wndShaderEditorBar; - CList m_dockingbars; - - CFileDropTarget m_fileDropTarget; - // TODO - DROPEFFECT OnDragEnter(COleDataObject* pDataObject, DWORD dwKeyState, CPoint point); - DROPEFFECT OnDragOver(COleDataObject* pDataObject, DWORD dwKeyState, CPoint point); - BOOL OnDrop(COleDataObject* pDataObject, DROPEFFECT dropEffect, CPoint point); - DROPEFFECT OnDropEx(COleDataObject* pDataObject, DROPEFFECT dropDefault, DROPEFFECT dropList, CPoint point); - void OnDragLeave(); - DROPEFFECT OnDragScroll(DWORD dwKeyState, CPoint point); - - friend class CPPagePlayback; // TODO - friend class CMPlayerCApp; // TODO - - void LoadControlBar(CControlBar* pBar, UINT defDockBarID); - void RestoreFloatingControlBars(); - void SaveControlBars(); - -// Generated message map functions - - DECLARE_MESSAGE_MAP() - -public: - afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); - afx_msg void OnDestroy(); - - afx_msg LRESULT OnTaskBarRestart(WPARAM, LPARAM); - afx_msg LRESULT OnNotifyIcon(WPARAM, LPARAM); - - afx_msg void OnSetFocus(CWnd* pOldWnd); - afx_msg void OnGetMinMaxInfo(MINMAXINFO* lpMMI); - afx_msg void OnMove(int x, int y); - afx_msg void OnMoving(UINT fwSide, LPRECT pRect); - afx_msg void OnSize(UINT nType, int cx, int cy); - afx_msg void OnSizing(UINT fwSide, LPRECT pRect); - afx_msg void OnDisplayChange(); - - afx_msg void OnSysCommand(UINT nID, LPARAM lParam); - afx_msg void OnActivateApp(BOOL bActive, DWORD dwThreadID); - afx_msg LRESULT OnAppCommand(WPARAM wParam, LPARAM lParam); - - afx_msg void OnTimer(UINT nIDEvent); - - afx_msg LRESULT OnGraphNotify(WPARAM wParam, LPARAM lParam); - afx_msg LRESULT OnRepaintRenderLess(WPARAM wParam, LPARAM lParam); - afx_msg LRESULT OnResumeFromState(WPARAM wParam, LPARAM lParam); - - BOOL OnButton(UINT id, UINT nFlags, CPoint point); - afx_msg void OnLButtonDown(UINT nFlags, CPoint point); - afx_msg void OnLButtonUp(UINT nFlags, CPoint point); - afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point); - afx_msg void OnMButtonDown(UINT nFlags, CPoint point); - afx_msg void OnMButtonUp(UINT nFlags, CPoint point); - afx_msg void OnMButtonDblClk(UINT nFlags, CPoint point); - afx_msg void OnRButtonDown(UINT nFlags, CPoint point); - afx_msg void OnRButtonUp(UINT nFlags, CPoint point); - afx_msg void OnRButtonDblClk(UINT nFlags, CPoint point); - afx_msg LRESULT OnXButtonDown(WPARAM wParam, LPARAM lParam); - afx_msg LRESULT OnXButtonUp(WPARAM wParam, LPARAM lParam); - afx_msg LRESULT OnXButtonDblClk(WPARAM wParam, LPARAM lParam); - afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt); - afx_msg void OnMouseMove(UINT nFlags, CPoint point); - - afx_msg LRESULT OnNcHitTest(CPoint point); - - afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); - - afx_msg void OnInitMenu(CMenu* pMenu); - afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu); - - BOOL OnMenu(CMenu* pMenu); - afx_msg void OnMenuPlayerShort(); - afx_msg void OnMenuPlayerLong(); - afx_msg void OnMenuFilters(); - - afx_msg void OnUpdatePlayerStatus(CCmdUI* pCmdUI); - - afx_msg void OnFilePostOpenmedia(); - afx_msg void OnUpdateFilePostOpenmedia(CCmdUI* pCmdUI); - afx_msg void OnFilePostClosemedia(); - afx_msg void OnUpdateFilePostClosemedia(CCmdUI* pCmdUI); - - afx_msg void OnBossKey(); - - afx_msg void OnStreamAudio(UINT nID); - afx_msg void OnStreamSub(UINT nID); - afx_msg void OnStreamSubOnOff(); - afx_msg void OnOgmAudio(UINT nID); - afx_msg void OnOgmSub(UINT nID); - afx_msg void OnDvdAngle(UINT nID); - afx_msg void OnDvdAudio(UINT nID); - afx_msg void OnDvdSub(UINT nID); - afx_msg void OnDvdSubOnOff(); - - - // menu item handlers - - afx_msg void OnFileOpenQuick(); - afx_msg void OnFileOpenmedia(); - afx_msg void OnUpdateFileOpen(CCmdUI* pCmdUI); - afx_msg BOOL OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCopyDataStruct); - afx_msg void OnFileOpendvd(); - afx_msg void OnFileOpendevice(); - afx_msg void OnFileOpenCD(UINT nID); - afx_msg void OnDropFiles(HDROP hDropInfo); // no menu item - afx_msg void OnFileSaveAs(); - afx_msg void OnUpdateFileSaveAs(CCmdUI* pCmdUI); - afx_msg void OnFileSaveImage(); - afx_msg void OnFileSaveImageAuto(); - afx_msg void OnUpdateFileSaveImage(CCmdUI* pCmdUI); - afx_msg void OnFileSaveThumbnails(); - afx_msg void OnUpdateFileSaveThumbnails(CCmdUI* pCmdUI); - afx_msg void OnFileConvert(); - afx_msg void OnUpdateFileConvert(CCmdUI* pCmdUI); - afx_msg void OnFileLoadsubtitle(); - afx_msg void OnUpdateFileLoadsubtitle(CCmdUI* pCmdUI); - afx_msg void OnFileSavesubtitle(); - afx_msg void OnUpdateFileSavesubtitle(CCmdUI* pCmdUI); - afx_msg void OnFileISDBSearch(); - afx_msg void OnUpdateFileISDBSearch(CCmdUI* pCmdUI); - afx_msg void OnFileISDBUpload(); - afx_msg void OnUpdateFileISDBUpload(CCmdUI* pCmdUI); - afx_msg void OnFileISDBDownload(); - afx_msg void OnUpdateFileISDBDownload(CCmdUI* pCmdUI); - afx_msg void OnFileProperties(); - afx_msg void OnUpdateFileProperties(CCmdUI* pCmdUI); - afx_msg void OnFileClosePlaylist(); - afx_msg void OnFileCloseMedia(); // no menu item - afx_msg void OnUpdateFileClose(CCmdUI* pCmdUI); - - afx_msg void OnViewCaptionmenu(); - afx_msg void OnUpdateViewCaptionmenu(CCmdUI* pCmdUI); - afx_msg void OnViewControlBar(UINT nID); - afx_msg void OnUpdateViewControlBar(CCmdUI* pCmdUI); - afx_msg void OnViewSubresync(); - afx_msg void OnUpdateViewSubresync(CCmdUI* pCmdUI); - afx_msg void OnViewPlaylist(); - afx_msg void OnUpdateViewPlaylist(CCmdUI* pCmdUI); - afx_msg void OnViewCapture(); - afx_msg void OnUpdateViewCapture(CCmdUI* pCmdUI); - afx_msg void OnViewShaderEditor(); - afx_msg void OnUpdateViewShaderEditor(CCmdUI* pCmdUI); - afx_msg void OnViewMinimal(); - afx_msg void OnUpdateViewMinimal(CCmdUI* pCmdUI); - afx_msg void OnViewCompact(); - afx_msg void OnUpdateViewCompact(CCmdUI* pCmdUI); - afx_msg void OnViewNormal(); - afx_msg void OnUpdateViewNormal(CCmdUI* pCmdUI); - afx_msg void OnViewFullscreen(); - afx_msg void OnViewFullscreenSecondary(); - afx_msg void OnUpdateViewFullscreen(CCmdUI* pCmdUI); - afx_msg void OnViewZoom(UINT nID); - afx_msg void OnUpdateViewZoom(CCmdUI* pCmdUI); - afx_msg void OnViewZoomAutoFit(); - afx_msg void OnViewDefaultVideoFrame(UINT nID); - afx_msg void OnUpdateViewDefaultVideoFrame(CCmdUI* pCmdUI); - afx_msg void OnViewKeepaspectratio(); - afx_msg void OnUpdateViewKeepaspectratio(CCmdUI* pCmdUI); - afx_msg void OnViewCompMonDeskARDiff(); - afx_msg void OnUpdateViewCompMonDeskARDiff(CCmdUI* pCmdUI); - afx_msg void OnViewPanNScan(UINT nID); - afx_msg void OnUpdateViewPanNScan(CCmdUI* pCmdUI); - afx_msg void OnViewPanNScanPresets(UINT nID); - afx_msg void OnUpdateViewPanNScanPresets(CCmdUI* pCmdUI); - afx_msg void OnViewRotate(UINT nID); - afx_msg void OnUpdateViewRotate(CCmdUI* pCmdUI); - afx_msg void OnViewAspectRatio(UINT nID); - afx_msg void OnUpdateViewAspectRatio(CCmdUI* pCmdUI); - afx_msg void OnViewAspectRatioNext(); - afx_msg void OnViewOntop(UINT nID); - afx_msg void OnUpdateViewOntop(CCmdUI* pCmdUI); - afx_msg void OnViewOptions(); - - afx_msg void OnPlayPlay(); - afx_msg void OnPlayPause(); - afx_msg void OnPlayPauseI(); - afx_msg void OnPlayPlaypause(); - afx_msg void OnPlayStop(); - afx_msg void OnUpdatePlayPauseStop(CCmdUI* pCmdUI); - afx_msg void OnPlayFramestep(UINT nID); - afx_msg void OnUpdatePlayFramestep(CCmdUI* pCmdUI); - afx_msg void OnPlaySeek(UINT nID); - afx_msg void OnPlaySeekKey(UINT nID); // no menu item - afx_msg void OnUpdatePlaySeek(CCmdUI* pCmdUI); - afx_msg void OnPlayGoto(); - afx_msg void OnUpdateGoto(CCmdUI* pCmdUI); - afx_msg void OnPlayChangeRate(UINT nID); - afx_msg void OnUpdatePlayChangeRate(CCmdUI* pCmdUI); - afx_msg void OnPlayResetRate(); - afx_msg void OnUpdatePlayResetRate(CCmdUI* pCmdUI); - afx_msg void OnPlayChangeAudDelay(UINT nID); - afx_msg void OnUpdatePlayChangeAudDelay(CCmdUI* pCmdUI); - afx_msg void OnPlayFilters(UINT nID); - afx_msg void OnUpdatePlayFilters(CCmdUI* pCmdUI); - afx_msg void OnPlayShaders(UINT nID); - afx_msg void OnUpdatePlayShaders(CCmdUI* pCmdUI); - afx_msg void OnPlayAudio(UINT nID); - afx_msg void OnUpdatePlayAudio(CCmdUI* pCmdUI); - afx_msg void OnPlaySubtitles(UINT nID); - afx_msg void OnUpdatePlaySubtitles(CCmdUI* pCmdUI); - afx_msg void OnPlayLanguage(UINT nID); - afx_msg void OnUpdatePlayLanguage(CCmdUI* pCmdUI); - afx_msg void OnPlayVolume(UINT nID); - afx_msg void OnPlayVolumeBoost(UINT nID); - afx_msg void OnUpdatePlayVolumeBoost(CCmdUI* pCmdUI); - afx_msg void OnAfterplayback(UINT nID); - afx_msg void OnUpdateAfterplayback(CCmdUI* pCmdUI); - - afx_msg void OnSubtitleDelay(UINT nID); - - afx_msg void OnNavigateSkip(UINT nID); - afx_msg void OnUpdateNavigateSkip(CCmdUI* pCmdUI); - afx_msg void OnNavigateSkipPlaylistItem(UINT nID); - afx_msg void OnUpdateNavigateSkipPlaylistItem(CCmdUI* pCmdUI); - afx_msg void OnNavigateMenu(UINT nID); - afx_msg void OnUpdateNavigateMenu(CCmdUI* pCmdUI); - afx_msg void OnNavigateAudio(UINT nID); - afx_msg void OnNavigateSubpic(UINT nID); - afx_msg void OnNavigateAngle(UINT nID); - afx_msg void OnNavigateChapters(UINT nID); - afx_msg void OnNavigateMenuItem(UINT nID); - afx_msg void OnUpdateNavigateMenuItem(CCmdUI* pCmdUI); - - afx_msg void OnFavoritesAdd(); - afx_msg void OnUpdateFavoritesAdd(CCmdUI* pCmdUI); - afx_msg void OnFavoritesOrganize(); - afx_msg void OnUpdateFavoritesOrganize(CCmdUI* pCmdUI); - afx_msg void OnFavoritesFile(UINT nID); - afx_msg void OnUpdateFavoritesFile(CCmdUI* pCmdUI); - afx_msg void OnFavoritesDVD(UINT nID); - afx_msg void OnUpdateFavoritesDVD(CCmdUI* pCmdUI); - afx_msg void OnFavoritesDevice(UINT nID); - afx_msg void OnUpdateFavoritesDevice(CCmdUI* pCmdUI); - - afx_msg void OnHelpHomepage(); - afx_msg void OnHelpDocumentation(); - - afx_msg void OnClose(); - - void SetSubtitleDelay(int delay_ms); -}; diff --git a/src/apps/mplayerc/MediaFormats.cpp b/src/apps/mplayerc/MediaFormats.cpp deleted file mode 100644 index b827a2131..000000000 --- a/src/apps/mplayerc/MediaFormats.cpp +++ /dev/null @@ -1,366 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include "stdafx.h" -#include -#include "MediaFormats.h" - -// -// CMediaFormatCategory -// - -CMediaFormatCategory::CMediaFormatCategory() - : m_fAudioOnly(false) -{ -} - -CMediaFormatCategory::CMediaFormatCategory( - CString label, CAtlList& exts, bool fAudioOnly, - CString specreqnote, engine_t engine) -{ - m_label = label; - m_exts.AddTailList(&exts); - m_backupexts.AddTailList(&m_exts); - m_specreqnote = specreqnote; - m_fAudioOnly = fAudioOnly; - m_engine = engine; -} - -CMediaFormatCategory::CMediaFormatCategory( - CString label, CString exts, bool fAudioOnly, - CString specreqnote, engine_t engine) -{ - m_label = label; - ExplodeMin(exts, m_exts, ' '); - POSITION pos = m_exts.GetHeadPosition(); - while(pos) m_exts.GetNext(pos).TrimLeft('.'); - - m_backupexts.AddTailList(&m_exts); - m_specreqnote = specreqnote; - m_fAudioOnly = fAudioOnly; - m_engine = engine; -} - -CMediaFormatCategory::~CMediaFormatCategory() -{ -} - -void CMediaFormatCategory::UpdateData(bool fSave) -{ - if(fSave) - { - AfxGetApp()->WriteProfileString(_T("FileFormats"), m_label, GetExts(true)); - } - else - { - SetExts(AfxGetApp()->GetProfileString(_T("FileFormats"), m_label, GetExts(true))); - } -} - -CMediaFormatCategory::CMediaFormatCategory(const CMediaFormatCategory& mfc) -{ - *this = mfc; -} - -CMediaFormatCategory& CMediaFormatCategory::operator = (const CMediaFormatCategory& mfc) -{ - m_label = mfc.m_label; - m_specreqnote = mfc.m_specreqnote; - m_exts.RemoveAll(); - m_exts.AddTailList(&mfc.m_exts); - m_backupexts.RemoveAll(); - m_backupexts.AddTailList(&mfc.m_backupexts); - m_fAudioOnly = mfc.m_fAudioOnly; - m_engine = mfc.m_engine; - return *this; -} - -void CMediaFormatCategory::RestoreDefaultExts() -{ - m_exts.RemoveAll(); - m_exts.AddTailList(&m_backupexts); -} - -void CMediaFormatCategory::SetExts(CAtlList& exts) -{ - m_exts.RemoveAll(); - m_exts.AddTailList(&exts); -} - -void CMediaFormatCategory::SetExts(CString exts) -{ - m_exts.RemoveAll(); - ExplodeMin(exts, m_exts, ' '); - POSITION pos = m_exts.GetHeadPosition(); - while(pos) - { - POSITION cur = pos; - CString& ext = m_exts.GetNext(pos); - if(ext[0] == '\\') {m_engine = (engine_t)_tcstol(ext.TrimLeft('\\'), NULL, 10); m_exts.RemoveAt(cur);} - else ext.TrimLeft('.'); - } -} - -CString CMediaFormatCategory::GetFilter() -{ - CString filter; - POSITION pos = m_exts.GetHeadPosition(); - while(pos) filter += _T("*.") + m_exts.GetNext(pos) + _T(";"); - filter.TrimRight(_T(";")); // cheap... - return(filter); -} - -CString CMediaFormatCategory::GetExts(bool fAppendEngine) -{ - CString exts = Implode(m_exts, ' '); - if(fAppendEngine) exts += CString(_T(" \\")) + (TCHAR)(0x30 + (int)m_engine); - return(exts); -} - -CString CMediaFormatCategory::GetExtsWithPeriod(bool fAppendEngine) -{ - CString exts; - POSITION pos = m_exts.GetHeadPosition(); - while(pos) exts += _T(".") + m_exts.GetNext(pos) + _T(" "); - exts.TrimRight(_T(" ")); // cheap... - if(fAppendEngine) exts += CString(_T(" \\")) + (TCHAR)(0x30 + (int)m_engine); - return(exts); -} - -CString CMediaFormatCategory::GetBackupExtsWithPeriod(bool fAppendEngine) -{ - CString exts; - POSITION pos = m_backupexts.GetHeadPosition(); - while(pos) exts += _T(".") + m_backupexts.GetNext(pos) + _T(" "); - exts.TrimRight(_T(" ")); // cheap... - if(fAppendEngine) exts += CString(_T(" \\")) + (TCHAR)(0x30 + (int)m_engine); - return(exts); -} - -// -// CMediaFormats -// - -CMediaFormats::CMediaFormats() -{ -} - -CMediaFormats::~CMediaFormats() -{ -} - -void CMediaFormats::UpdateData(bool fSave) -{ - if(fSave) - { - AfxGetApp()->WriteProfileString(_T("FileFormats"), NULL, NULL); - - AfxGetApp()->WriteProfileInt(_T("FileFormats"), _T("RtspHandler"), m_iRtspHandler); - AfxGetApp()->WriteProfileInt(_T("FileFormats"), _T("RtspFileExtFirst"), m_fRtspFileExtFirst); - } - else - { - RemoveAll(); -#define ADDFMT(f) Add(CMediaFormatCategory##f) - ADDFMT((_T("Windows Media file"), _T("wmv wmp wm asf"))); - ADDFMT((_T("Windows Media Audio file"), _T("wma"), true)); - ADDFMT((_T("Video file"), _T("avi"))); - ADDFMT((_T("Audio file"), _T("wav"), true)); - ADDFMT((_T("MPEG Media file"), _T("mpg mpeg mpe m1v m2v mpv2 mp2v ts tp tpr pva m2ts m2t mts evo m2p"))); - ADDFMT((_T("VCD file"), _T("dat"))); - ADDFMT((_T("MPEG Audio file"), _T("mpa mp2 m1a m2a"), true)); - ADDFMT((_T("DVD file"), _T("vob ifo"))); - ADDFMT((_T("DVD Audio file"), _T("ac3 dts"), true)); - ADDFMT((_T("MP3 Format Sound"), _T("mp3"), true)); - ADDFMT((_T("MIDI file"), _T("mid midi rmi"), true)); - ADDFMT((_T("Indeo Video file"), _T("ivf"))); - ADDFMT((_T("AIFF Format Sound"), _T("aif aifc aiff"), true)); - ADDFMT((_T("AU Format Sound"), _T("au snd"), true)); - ADDFMT((_T("Ogg Media file"), _T("ogm ogv"))); - ADDFMT((_T("Ogg Vorbis Audio file"), _T("ogg oga"), true)); - ADDFMT((_T("CD Audio Track"), _T("cda"), true, _T("Windows 2000/XP or better"))); - ADDFMT((_T("FLIC file"), _T("fli flc flic"))); - ADDFMT((_T("DVD2AVI Project file"), _T("d2v"))); - ADDFMT((_T("MPEG4 file"), _T("mp4 m4v mp4v mpv4 hdmov 3gp 3gpp"))); - ADDFMT((_T("MPEG4 Audio file"), _T("m4a m4b aac"), true, _T(""), QuickTime)); - ADDFMT((_T("Matroska Media file"), _T("mkv"))); - ADDFMT((_T("Matroska Audio file"), _T("mka"), true)); - ADDFMT((_T("Smacker/Bink Media file"), _T("smk bik"), false, _T("smackw32/binkw32.dll in dll path"))); - ADDFMT((_T("ratdvd file"), _T("ratdvd"), false, _T("ratdvd media file"))); - ADDFMT((_T("RoQ Media file"), _T("roq"), false)); - ADDFMT((_T("Real Media file"), _T("rm ram rpm rmm"), false, _T("RealPlayer or Real Alternative"), RealMedia)); - ADDFMT((_T("Real Audio file"), _T("ra"), true, _T("RealPlayer or Real Alternative"), RealMedia)); - ADDFMT((_T("Real Script file"), _T("rt rp smi smil"), false, _T("RealPlayer or Real Alternative"), RealMedia)); - ADDFMT((_T("Dirac Video file"), _T("drc"), false)); - ADDFMT((_T("DirectShow Media file"), _T("dsm dsv dsa dss"))); - ADDFMT((_T("Musepack file"), _T("mpc"), true)); - ADDFMT((_T("FLAC Audio file"), _T("flac"), true)); - ADDFMT((_T("WavPack Audio file"), _T("wv"), true)); - ADDFMT((_T("ALAC Audio file"), _T("alac"), true)); - ADDFMT((_T("OptimFrog Audio file"), _T("ofr ofs"), true)); - ADDFMT((_T("Monkey's Audio file"), _T("ape apl"), true)); - ADDFMT((_T("True Audio file"), _T("tta"), true)); - ADDFMT((_T("AMR Audio file"), _T("amr"), true)); - ADDFMT((_T("Flash Video file"), _T("flv iflv f4v"))); - ADDFMT((_T("Shockwave Flash file"), _T("swf"), false, _T("ShockWave ActiveX control"), ShockWave)); - ADDFMT((_T("Quicktime file"), _T("mov 3g2 3gp2"), false, _T("QuickTime (Alternative)"), QuickTime)); - ADDFMT((_T("Playlist file"), _T("asx m3u pls wvx wax wmx mpcpl"))); - ADDFMT((_T("Blu-ray playlist file"), _T("mpls bdmv"))); - ADDFMT((_T("Other"), _T("divx vp6 rmvb amv"))); -#undef ADDFMT - - m_iRtspHandler = (engine_t)AfxGetApp()->GetProfileInt(_T("FileFormats"), _T("RtspHandler"), (int)RealMedia); - m_fRtspFileExtFirst = !!AfxGetApp()->GetProfileInt(_T("FileFormats"), _T("RtspFileExtFirst"), 1); - } - - for(int i = 0; i < GetCount(); i++) - GetAt(i).UpdateData(fSave); -} - -engine_t CMediaFormats::GetRtspHandler(bool& fRtspFileExtFirst) -{ - fRtspFileExtFirst = m_fRtspFileExtFirst; - return m_iRtspHandler; -} - -void CMediaFormats::SetRtspHandler(engine_t e, bool fRtspFileExtFirst) -{ - m_iRtspHandler = e; - m_fRtspFileExtFirst = fRtspFileExtFirst; -} - -bool CMediaFormats::IsUsingEngine(CString path, engine_t e) -{ - return(GetEngine(path) == e); -} - -engine_t CMediaFormats::GetEngine(CString path) -{ - path.Trim().MakeLower(); - - if(!m_fRtspFileExtFirst && path.Find(_T("rtsp://")) == 0) - return m_iRtspHandler; - - CString ext = CPath(path).GetExtension(); - ext.MakeLower(); - if(!ext.IsEmpty()) - { - if(path.Find(_T("rtsp://")) == 0) - { - if(ext == _T(".ram") || ext == _T(".rm") || ext == _T(".ra")) - return RealMedia; - if(ext == _T(".qt") || ext == _T(".mov")) - return QuickTime; - } - - for(int i = 0; i < GetCount(); i++) - { - CMediaFormatCategory& mfc = GetAt(i); - if(mfc.FindExt(ext)) - return mfc.GetEngineType(); - } - } - - if(m_fRtspFileExtFirst && path.Find(_T("rtsp://")) == 0) - return m_iRtspHandler; - - return DirectShow; -} - -bool CMediaFormats::FindExt(CString ext, bool fAudioOnly) -{ - ext.TrimLeft(_T(".")); - - if(!ext.IsEmpty()) - { - for(int i = 0; i < GetCount(); i++) - { - CMediaFormatCategory& mfc = GetAt(i); - if((!fAudioOnly || mfc.IsAudioOnly()) && mfc.FindExt(ext)) - return(true); - } - } - - return(false); -} - -void CMediaFormats::GetFilter(CString& filter, CAtlArray& mask) -{ - CString strTemp; - - filter += _T("Media files (all types)|"); - mask.Add(_T("")); - - for(int i = 0; i < GetCount(); i++) - { - strTemp = GetAt(i).GetFilter() + _T(";");; - mask[0] += strTemp; - filter += strTemp; - } - mask[0].TrimRight(_T(";")); - filter.TrimRight(_T(";")); - filter += _T("|"); - - for(int i = 0; i < GetCount(); i++) - { - CMediaFormatCategory& mfc = GetAt(i); - filter += mfc.GetLabel() + _T("|" + GetAt(i).GetFilter() + _T("|")); - mask.Add(mfc.GetFilter()); - } - - filter += _T("All files (*.*)|(*.*)|"); - mask.Add(_T("*.*")); - - filter += _T("|"); -} - -void CMediaFormats::GetAudioFilter(CString& filter, CAtlArray& mask) -{ - CString strTemp; - filter += _T("Audio files (all types)|"); - mask.Add(_T("")); - - for(int i = 0; i < GetCount(); i++) - { - CMediaFormatCategory& mfc = GetAt(i); - if(!mfc.IsAudioOnly() || mfc.GetEngineType() != DirectShow) continue; - strTemp = GetAt(i).GetFilter() + _T(";"); - mask[0] += strTemp; - filter += strTemp; - } - - mask[0].TrimRight(_T(";")); - filter.TrimRight(_T(";")); - filter += _T("|"); - - for(int i = 0; i < GetCount(); i++) - { - CMediaFormatCategory& mfc = GetAt(i); - if(!mfc.IsAudioOnly() || mfc.GetEngineType() != DirectShow) continue; - filter += mfc.GetLabel() + _T("|") + GetAt(i).GetFilter() + _T("|"); - mask.Add(mfc.GetFilter()); - } - - filter += _T("All files (*.*)|(*.*)|"); - mask.Add(_T("*.*")); - - filter += _T("|"); -} diff --git a/src/apps/mplayerc/MediaFormats.h b/src/apps/mplayerc/MediaFormats.h deleted file mode 100644 index 0f3f4a1c7..000000000 --- a/src/apps/mplayerc/MediaFormats.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#pragma once - -#include -#include "BaseGraph.h" - -class CMediaFormatCategory -{ -protected: - CString m_label, m_specreqnote; - CAtlList m_exts, m_backupexts; - bool m_fAudioOnly; - engine_t m_engine; - -public: - CMediaFormatCategory(); - CMediaFormatCategory( - CString label, CAtlList& exts, bool fAudioOnly = false, - CString specreqnote = _T(""), engine_t e = DirectShow); - CMediaFormatCategory( - CString label, CString exts, bool fAudioOnly = false, - CString specreqnote = _T(""), engine_t e = DirectShow); - virtual ~CMediaFormatCategory(); - - void UpdateData(bool fSave); - - CMediaFormatCategory(const CMediaFormatCategory& mfc); - CMediaFormatCategory& operator = (const CMediaFormatCategory& mfc); - - void RestoreDefaultExts(); - void SetExts(CAtlList& exts); - void SetExts(CString exts); - - bool FindExt(CString ext) {return m_exts.Find(ext.TrimLeft(_T(".")).MakeLower()) != NULL;} - - CString GetLabel() {return m_label;} - CString GetFilter(); - CString GetExts(bool fAppendEngine = false); - CString GetExtsWithPeriod(bool fAppendEngine = false); - CString GetBackupExtsWithPeriod(bool fAppendEngine = false); - CString GetSpecReqNote() {return m_specreqnote;} - bool IsAudioOnly() {return m_fAudioOnly;} - engine_t GetEngineType() {return m_engine;} - void SetEngineType(engine_t e) {m_engine = e;} -}; - -class CMediaFormats : public CAtlArray -{ -protected: - engine_t m_iRtspHandler; - bool m_fRtspFileExtFirst; - -public: - CMediaFormats(); - virtual ~CMediaFormats(); - - void UpdateData(bool fSave); - - engine_t GetRtspHandler(bool& fRtspFileExtFirst); - void SetRtspHandler(engine_t e, bool fRtspFileExtFirst); - - bool IsUsingEngine(CString path, engine_t e); - engine_t GetEngine(CString path); - - bool FindExt(CString ext, bool fAudioOnly = false); - - void GetFilter(CString& filter, CAtlArray& mask); - void GetAudioFilter(CString& filter, CAtlArray& mask); -}; diff --git a/src/apps/mplayerc/MediaTypesDlg.cpp b/src/apps/mplayerc/MediaTypesDlg.cpp deleted file mode 100644 index 7ebfac4fa..000000000 --- a/src/apps/mplayerc/MediaTypesDlg.cpp +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -// MediaTypesDlg.cpp : implementation file -// - -#include "stdafx.h" -#include "mplayerc.h" -#include "MediaTypesDlg.h" -#include "..\..\DSUtil\DSUtil.h" -#include "..\..\..\include\moreuuids.h" - -// CMediaTypesDlg dialog - -//IMPLEMENT_DYNAMIC(CMediaTypesDlg, CResizableDialog) -CMediaTypesDlg::CMediaTypesDlg(IGraphBuilderDeadEnd* pGBDE, CWnd* pParent /*=NULL*/) - : CResizableDialog(CMediaTypesDlg::IDD, pParent) - , m_pGBDE(pGBDE) -{ - m_subtype = GUID_NULL; - m_type = UNKNOWN; -} - -CMediaTypesDlg::~CMediaTypesDlg() -{ -} - -void CMediaTypesDlg::DoDataExchange(CDataExchange* pDX) -{ - CResizableDialog::DoDataExchange(pDX); - DDX_Control(pDX, IDC_COMBO1, m_pins); - DDX_Control(pDX, IDC_EDIT1, m_report); -} - -void CMediaTypesDlg::AddLine(CString str) -{ - str.Replace(_T("\n"), _T("\r\n")); - int len = m_report.GetWindowTextLength(); - m_report.SetSel(len, len, TRUE); - m_report.ReplaceSel(str); -} - -void CMediaTypesDlg::AddMediaType(AM_MEDIA_TYPE* pmt) -{ - m_subtype = pmt->subtype; - if(pmt->majortype == MEDIATYPE_Video) m_type = VIDEO; - else if(pmt->majortype == MEDIATYPE_Audio) m_type = AUDIO; - else m_type = UNKNOWN; - - CAtlList sl; - CMediaTypeEx(*pmt).Dump(sl); - POSITION pos = sl.GetHeadPosition(); - while(pos) AddLine(sl.GetNext(pos) + '\n'); -} - -BEGIN_MESSAGE_MAP(CMediaTypesDlg, CResizableDialog) - ON_CBN_SELCHANGE(IDC_COMBO1, OnCbnSelchangeCombo1) -END_MESSAGE_MAP() - - -// CMediaTypesDlg message handlers - -BOOL CMediaTypesDlg::OnInitDialog() -{ - __super::OnInitDialog(); - - CAtlList path; - CAtlList mts; - - for(int i = 0; S_OK == m_pGBDE->GetDeadEnd(i, path, mts); i++) - { - if(!path.GetCount()) continue; - m_pins.SetItemData(m_pins.AddString(CString(path.GetTail())), (DWORD_PTR)i); - } - - m_pins.SetCurSel(0); - OnCbnSelchangeCombo1(); - - AddAnchor(IDC_STATIC1, TOP_LEFT, TOP_RIGHT); - AddAnchor(IDC_STATIC2, TOP_LEFT, TOP_RIGHT); - AddAnchor(IDC_COMBO1, TOP_LEFT, TOP_RIGHT); - AddAnchor(IDC_EDIT1, TOP_LEFT, BOTTOM_RIGHT); - AddAnchor(IDOK, BOTTOM_RIGHT); - - SetMinTrackSize(CSize(300, 200)); - - return TRUE; // return TRUE unless you set the focus to a control - // EXCEPTION: OCX Property Pages should return FALSE -} - -void CMediaTypesDlg::OnCbnSelchangeCombo1() -{ - m_report.SetWindowText(_T("")); - - int i = m_pins.GetCurSel(); - if(i < 0) return; - - CAtlList path; - CAtlList mts; - - if(FAILED(m_pGBDE->GetDeadEnd(i, path, mts)) || !path.GetCount()) - return; - - POSITION pos = path.GetHeadPosition(); - while(pos) - { - AddLine(CString(path.GetNext(pos)) + _T("\n")); - if(!pos) AddLine(_T("\n")); - } - - pos = mts.GetHeadPosition(); - for(int j = 0; pos; j++) - { - CString str; - str.Format(_T("Media Type %d:\n"), j); - AddLine(str); - AddLine(_T("--------------------------\n")); - AddMediaType(&mts.GetNext(pos)); - AddLine(); - } - - m_report.SetSel(0, 0); -} diff --git a/src/apps/mplayerc/MediaTypesDlg.h b/src/apps/mplayerc/MediaTypesDlg.h deleted file mode 100644 index 7651f73a7..000000000 --- a/src/apps/mplayerc/MediaTypesDlg.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#pragma once - -#include -#include -#include "IGraphBuilder2.h" - -// CMediaTypesDlg dialog - -class CMediaTypesDlg : public CResizableDialog -{ -// DECLARE_DYNAMIC(CMediaTypesDlg) - -private: - CComPtr m_pGBDE; - enum {UNKNOWN, VIDEO, AUDIO} m_type; - GUID m_subtype; - void AddLine(CString str = _T("\n")); - void AddMediaType(AM_MEDIA_TYPE* pmt); - -public: - CMediaTypesDlg(IGraphBuilderDeadEnd* pGBDE, CWnd* pParent = NULL); // standard constructor - virtual ~CMediaTypesDlg(); - -// Dialog Data - enum { IDD = IDD_MEDIATYPES_DLG }; - CComboBox m_pins; - CEdit m_report; - -protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - virtual BOOL OnInitDialog(); - - DECLARE_MESSAGE_MAP() -public: - afx_msg void OnCbnSelchangeCombo1(); -}; diff --git a/src/apps/mplayerc/OpenCapDeviceDlg.cpp b/src/apps/mplayerc/OpenCapDeviceDlg.cpp deleted file mode 100644 index e4a3b0b60..000000000 --- a/src/apps/mplayerc/OpenCapDeviceDlg.cpp +++ /dev/null @@ -1,448 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -// OpenCapDeviceDlg.cpp : implementation file -// - -#include "stdafx.h" -#include "mplayerc.h" -#include "OpenCapDeviceDlg.h" -#include "..\..\DSUtil\DSUtil.h" - -static struct cc_t {long code; AnalogVideoStandard standard; const TCHAR* str;} s_countrycodes[] = -{ - {1, AnalogVideo_NTSC_M, _T("USA")}, -/* {1, AnalogVideo_NTSC_M, _T("Anguilla")}, - {1, AnalogVideo_NTSC_M, _T("Antigua")}, - {1, AnalogVideo_NTSC_M, _T("Bahamas")}, - {1, AnalogVideo_NTSC_M, _T("Barbados")}, - {1, AnalogVideo_NTSC_M, _T("Bermuda")}, - {1, AnalogVideo_NTSC_M, _T("British Virgin Islands")}, - {1, AnalogVideo_NTSC_M, _T("Canada")}, - {1, AnalogVideo_NTSC_M, _T("Cayman Islands")}, - {1, AnalogVideo_NTSC_M, _T("Dominica")}, - {1, AnalogVideo_NTSC_M, _T("Dominican Republic")}, - {1, AnalogVideo_NTSC_M, _T("Grenada")}, - {1, AnalogVideo_NTSC_M, _T("Jamaica")}, - {1, AnalogVideo_NTSC_M, _T("Montserrat")}, - {1, AnalogVideo_NTSC_M, _T("Nevis")}, - {1, AnalogVideo_NTSC_M, _T("St. Kitts")}, - {1, AnalogVideo_NTSC_M, _T("St. Vincent and the Grenadines")}, - {1, AnalogVideo_NTSC_M, _T("Trinidad and Tobago")}, - {1, AnalogVideo_NTSC_M, _T("Turks and Caicos Islands")}, - {1, AnalogVideo_NTSC_M, _T("Barbuda")}, - {1, AnalogVideo_NTSC_M, _T("Puerto Rico")}, - {1, AnalogVideo_NTSC_M, _T("Saint Lucia")}, - {1, AnalogVideo_NTSC_M, _T("United States Virgin Islands")}, -*/ {2, AnalogVideo_NTSC_M, _T("Canada")}, - {7, AnalogVideo_SECAM_D, _T("Russia")}, -/* {7, AnalogVideo_SECAM_D, _T("Kazakhstan")}, - {7, AnalogVideo_SECAM_D, _T("Kyrgyzstan")}, - {7, AnalogVideo_SECAM_D, _T("Tajikistan")}, - {7, AnalogVideo_SECAM_D, _T("Turkmenistan")}, - {7, AnalogVideo_SECAM_D, _T("Uzbekistan")}, -*/ {20, AnalogVideo_SECAM_B, _T("Egypt")}, - {27, AnalogVideo_PAL_I, _T("South Africa")}, - {30, AnalogVideo_SECAM_B, _T("Greece")}, - {31, AnalogVideo_PAL_B, _T("Netherlands")}, - {32, AnalogVideo_PAL_B, _T("Belgium")}, - {33, AnalogVideo_SECAM_L, _T("France")}, - {34, AnalogVideo_PAL_B, _T("Spain")}, - {36, AnalogVideo_SECAM_D, _T("Hungary")}, - {39, AnalogVideo_PAL_B, _T("Italy")}, - {39, AnalogVideo_PAL_B, _T("Vatican City")}, - {40, AnalogVideo_PAL_D, _T("Romania")}, - {41, AnalogVideo_PAL_B, _T("Switzerland")}, - {41, AnalogVideo_PAL_B, _T("Liechtenstein")}, - {43, AnalogVideo_PAL_B, _T("Austria")}, - {44, AnalogVideo_PAL_I, _T("United Kingdom")}, - {45, AnalogVideo_PAL_B, _T("Denmark")}, - {46, AnalogVideo_PAL_B, _T("Sweden")}, - {47, AnalogVideo_PAL_B, _T("Norway")}, - {48, AnalogVideo_PAL_B, _T("Poland")}, - {49, AnalogVideo_PAL_B, _T("Germany")}, - {51, AnalogVideo_NTSC_M, _T("Peru")}, - {52, AnalogVideo_NTSC_M, _T("Mexico")}, - {53, AnalogVideo_NTSC_M, _T("Cuba")}, - {53, AnalogVideo_NTSC_M, _T("Guantanamo Bay")}, - {54, AnalogVideo_PAL_N, _T("Argentina")}, - {55, AnalogVideo_PAL_M, _T("Brazil")}, - {56, AnalogVideo_NTSC_M, _T("Chile")}, - {57, AnalogVideo_NTSC_M, _T("Colombia")}, - {58, AnalogVideo_NTSC_M, _T("Bolivarian Republic of Venezuela")}, - {60, AnalogVideo_PAL_B, _T("Malaysia")}, - {61, AnalogVideo_PAL_B, _T("Australia")}, - // {61, AnalogVideo_NTSC_M, _T("Cocos-Keeling Islands")}, - {62, AnalogVideo_PAL_B, _T("Indonesia")}, - {63, AnalogVideo_NTSC_M, _T("Philippines")}, - {64, AnalogVideo_PAL_B, _T("New Zealand")}, - {65, AnalogVideo_PAL_B, _T("Singapore")}, - {66, AnalogVideo_PAL_B, _T("Thailand")}, - {81, AnalogVideo_NTSC_M_J, _T("Japan")}, - {82, AnalogVideo_NTSC_M, _T("Korea (South)")}, - {84, AnalogVideo_NTSC_M, _T("Vietnam")}, - {86, AnalogVideo_PAL_D, _T("China")}, - {90, AnalogVideo_PAL_B, _T("Turkey")}, - {91, AnalogVideo_PAL_B, _T("India")}, - {92, AnalogVideo_PAL_B, _T("Pakistan")}, - {93, AnalogVideo_PAL_B, _T("Afghanistan")}, - {94, AnalogVideo_PAL_B, _T("Sri Lanka")}, - {95, AnalogVideo_NTSC_M, _T("Myanmar")}, - {98, AnalogVideo_SECAM_B, _T("Iran")}, - {212, AnalogVideo_SECAM_B, _T("Morocco")}, - {213, AnalogVideo_PAL_B, _T("Algeria")}, - {216, AnalogVideo_SECAM_B, _T("Tunisia")}, - {218, AnalogVideo_SECAM_B, _T("Libya")}, - {220, AnalogVideo_SECAM_K, _T("Gambia")}, - {221, AnalogVideo_SECAM_K, _T("Senegal Republic")}, - {222, AnalogVideo_SECAM_B, _T("Mauritania")}, - {223, AnalogVideo_SECAM_K, _T("Mali")}, - {224, AnalogVideo_SECAM_K, _T("Guinea")}, - {225, AnalogVideo_SECAM_K, _T("Cote D'Ivoire")}, - {226, AnalogVideo_SECAM_K, _T("Burkina Faso")}, - {227, AnalogVideo_SECAM_K, _T("Niger")}, - {228, AnalogVideo_SECAM_K, _T("Togo")}, - {229, AnalogVideo_SECAM_K, _T("Benin")}, - {230, AnalogVideo_SECAM_B, _T("Mauritius")}, - {231, AnalogVideo_PAL_B, _T("Liberia")}, - {232, AnalogVideo_PAL_B, _T("Sierra Leone")}, - {233, AnalogVideo_PAL_B, _T("Ghana")}, - {234, AnalogVideo_PAL_B, _T("Nigeria")}, - {235, AnalogVideo_PAL_B, _T("Chad")}, - {236, AnalogVideo_PAL_B, _T("Central African Republic")}, - {237, AnalogVideo_PAL_B, _T("Cameroon")}, - {238, AnalogVideo_NTSC_M, _T("Cape Verde Islands")}, - {239, AnalogVideo_PAL_B, _T("Sao Tome and Principe")}, - {240, AnalogVideo_SECAM_B, _T("Equatorial Guinea")}, - {241, AnalogVideo_SECAM_K, _T("Gabon")}, - {242, AnalogVideo_SECAM_D, _T("Congo")}, - {243, AnalogVideo_SECAM_K, _T("Congo(DRC)")}, - {244, AnalogVideo_PAL_I, _T("Angola")}, - {245, AnalogVideo_NTSC_M, _T("Guinea-Bissau")}, - {246, AnalogVideo_NTSC_M, _T("Diego Garcia")}, - {247, AnalogVideo_NTSC_M, _T("Ascension Island")}, - {248, AnalogVideo_PAL_B, _T("Seychelle Islands")}, - {249, AnalogVideo_PAL_B, _T("Sudan")}, - {250, AnalogVideo_PAL_B, _T("Rwanda")}, - {251, AnalogVideo_PAL_B, _T("Ethiopia")}, - {252, AnalogVideo_PAL_B, _T("Somalia")}, - {253, AnalogVideo_SECAM_K, _T("Djibouti")}, - {254, AnalogVideo_PAL_B, _T("Kenya")}, - {255, AnalogVideo_PAL_B, _T("Tanzania")}, - {256, AnalogVideo_PAL_B, _T("Uganda")}, - {257, AnalogVideo_SECAM_K, _T("Burundi")}, - {258, AnalogVideo_PAL_B, _T("Mozambique")}, - {260, AnalogVideo_PAL_B, _T("Zambia")}, - {261, AnalogVideo_SECAM_K, _T("Madagascar")}, - {262, AnalogVideo_SECAM_K, _T("Reunion Island")}, - {263, AnalogVideo_PAL_B, _T("Zimbabwe")}, - {264, AnalogVideo_PAL_I, _T("Namibia")}, - {265, AnalogVideo_NTSC_M, _T("Malawi")}, - {266, AnalogVideo_PAL_I, _T("Lesotho")}, - {267, AnalogVideo_SECAM_K, _T("Botswana")}, - {268, AnalogVideo_PAL_B, _T("Swaziland")}, - {269, AnalogVideo_SECAM_K, _T("Mayotte Island")}, -// {269, AnalogVideo_NTSC_M, _T("Comoros")}, - {290, AnalogVideo_NTSC_M, _T("St. Helena")}, - {291, AnalogVideo_NTSC_M, _T("Eritrea")}, - {297, AnalogVideo_NTSC_M, _T("Aruba")}, - {298, AnalogVideo_PAL_B, _T("Faroe Islands")}, - {299, AnalogVideo_NTSC_M, _T("Greenland")}, - {350, AnalogVideo_PAL_B, _T("Gibraltar")}, - {351, AnalogVideo_PAL_B, _T("Portugal")}, - {352, AnalogVideo_PAL_B, _T("Luxembourg")}, - {353, AnalogVideo_PAL_I, _T("Ireland")}, - {354, AnalogVideo_PAL_B, _T("Iceland")}, - {355, AnalogVideo_PAL_B, _T("Albania")}, - {356, AnalogVideo_PAL_B, _T("Malta")}, - {357, AnalogVideo_PAL_B, _T("Cyprus")}, - {358, AnalogVideo_PAL_B, _T("Finland")}, - {359, AnalogVideo_SECAM_D, _T("Bulgaria")}, - {370, AnalogVideo_PAL_B, _T("Lithuania")}, - {371, AnalogVideo_SECAM_D, _T("Latvia")}, - {372, AnalogVideo_PAL_B, _T("Estonia")}, - {373, AnalogVideo_SECAM_D, _T("Moldova")}, - {374, AnalogVideo_SECAM_D, _T("Armenia")}, - {375, AnalogVideo_SECAM_D, _T("Belarus")}, - {376, AnalogVideo_NTSC_M, _T("Andorra")}, - {377, AnalogVideo_SECAM_G, _T("Monaco")}, - {378, AnalogVideo_PAL_B, _T("San Marino")}, - {380, AnalogVideo_SECAM_D, _T("Ukraine")}, - {381, AnalogVideo_PAL_B, _T("Serbia and Montenegro")}, - {385, AnalogVideo_PAL_B, _T("Croatia")}, - {386, AnalogVideo_PAL_B, _T("Slovenia")}, - {387, AnalogVideo_PAL_B, _T("Bosnia and Herzegovina")}, - {389, AnalogVideo_PAL_B, _T("F.Y.R.O.M. (Former Yugoslav Republic of Macedonia)")}, - {420, AnalogVideo_PAL_D, _T("Czech Republic")}, - {421, AnalogVideo_PAL_B, _T("Slovak Republic")}, - {500, AnalogVideo_PAL_I, _T("Falkland Islands (Islas Malvinas)")}, - {501, AnalogVideo_NTSC_M, _T("Belize")}, - {502, AnalogVideo_NTSC_M, _T("Guatemala")}, - {503, AnalogVideo_NTSC_M, _T("El Salvador")}, - {504, AnalogVideo_NTSC_M, _T("Honduras")}, - {505, AnalogVideo_NTSC_M, _T("Nicaragua")}, - {506, AnalogVideo_NTSC_M, _T("Costa Rica")}, - {507, AnalogVideo_NTSC_M, _T("Panama")}, - {508, AnalogVideo_SECAM_K, _T("St. Pierre and Miquelon")}, - {509, AnalogVideo_NTSC_M, _T("Haiti")}, - {590, AnalogVideo_SECAM_K, _T("Guadeloupe")}, -// {590, AnalogVideo_NTSC_M, _T("French Antilles")}, - {591, AnalogVideo_PAL_N, _T("Bolivia")}, - {592, AnalogVideo_SECAM_K, _T("Guyana")}, - {593, AnalogVideo_NTSC_M, _T("Ecuador")}, - {594, AnalogVideo_SECAM_K, _T("French Guiana")}, - {595, AnalogVideo_PAL_N, _T("Paraguay")}, - {596, AnalogVideo_SECAM_K, _T("Martinique")}, - {597, AnalogVideo_NTSC_M, _T("Suriname")}, - {598, AnalogVideo_PAL_N, _T("Uruguay")}, - {599, AnalogVideo_NTSC_M, _T("Netherlands Antilles")}, - {670, AnalogVideo_NTSC_M, _T("Saipan Island")}, -// {670, AnalogVideo_NTSC_M, _T("Rota Island")}, -// {670, AnalogVideo_NTSC_M, _T("Tinian Island")}, - {671, AnalogVideo_NTSC_M, _T("Guam")}, - {672, AnalogVideo_NTSC_M, _T("Christmas Island")}, - {672, AnalogVideo_NTSC_M, _T("Australian Antarctic Territory")}, - //{672, AnalogVideo_PAL_B, _T("Norfolk Island")}, - {673, AnalogVideo_PAL_B, _T("Brunei")}, - {674, AnalogVideo_NTSC_M, _T("Nauru")}, - {675, AnalogVideo_PAL_B, _T("Papua New Guinea")}, - {676, AnalogVideo_NTSC_M, _T("Tonga")}, - {677, AnalogVideo_NTSC_M, _T("Solomon Islands")}, - {678, AnalogVideo_NTSC_M, _T("Vanuatu")}, - {679, AnalogVideo_NTSC_M, _T("Fiji Islands")}, - {680, AnalogVideo_NTSC_M, _T("Palau")}, - {681, AnalogVideo_SECAM_K, _T("Wallis and Futuna Islands")}, - {682, AnalogVideo_PAL_B, _T("Cook Islands")}, - {683, AnalogVideo_NTSC_M, _T("Niue")}, - {684, AnalogVideo_NTSC_M, _T("Territory of American Samoa")}, - {685, AnalogVideo_PAL_B, _T("Samoa")}, - {686, AnalogVideo_PAL_B, _T("Kiribati Republic")}, - {687, AnalogVideo_SECAM_K, _T("New Caledonia")}, - {688, AnalogVideo_NTSC_M, _T("Tuvalu")}, - {689, AnalogVideo_SECAM_K, _T("French Polynesia")}, - {690, AnalogVideo_NTSC_M, _T("Tokelau")}, - {691, AnalogVideo_NTSC_M, _T("Micronesia")}, - {692, AnalogVideo_NTSC_M, _T("Marshall Islands")}, - {850, AnalogVideo_SECAM_D, _T("Korea (North)")}, - {852, AnalogVideo_PAL_I, _T("Hong Kong SAR")}, - {853, AnalogVideo_PAL_I, _T("Macao SAR")}, - {855, AnalogVideo_PAL_B, _T("Cambodia")}, - {856, AnalogVideo_PAL_B, _T("Laos")}, - {871, AnalogVideo_NTSC_M, _T("INMARSAT (Atlantic-East)")}, - {872, AnalogVideo_NTSC_M, _T("INMARSAT (Pacific)")}, - {873, AnalogVideo_NTSC_M, _T("INMARSAT (Indian)")}, - {874, AnalogVideo_NTSC_M, _T("INMARSAT (Atlantic-West)")}, - {880, AnalogVideo_PAL_B, _T("Bangladesh")}, - {886, AnalogVideo_NTSC_M, _T("Taiwan")}, - {960, AnalogVideo_PAL_B, _T("Maldives")}, - {961, AnalogVideo_SECAM_B, _T("Lebanon")}, - {962, AnalogVideo_PAL_B, _T("Jordan")}, - {963, AnalogVideo_SECAM_B, _T("Syria")}, - {964, AnalogVideo_SECAM_B, _T("Iraq")}, - {965, AnalogVideo_PAL_B, _T("Kuwait")}, - {966, AnalogVideo_SECAM_B, _T("Saudi Arabia")}, - {967, AnalogVideo_PAL_B, _T("Yemen")}, - {968, AnalogVideo_PAL_B, _T("Oman")}, - {971, AnalogVideo_PAL_B, _T("United Arab Emirates")}, - {972, AnalogVideo_PAL_B, _T("Israel")}, - {973, AnalogVideo_PAL_B, _T("Bahrain")}, - {974, AnalogVideo_PAL_B, _T("Qatar")}, - {975, AnalogVideo_NTSC_M, _T("Bhutan")}, - {976, AnalogVideo_SECAM_D, _T("Mongolia")}, - {977, AnalogVideo_PAL_B, _T("Nepal")}, - {994, AnalogVideo_SECAM_D, _T("Azerbaijan")}, - {995, AnalogVideo_SECAM_D,_T("Georgia")}, -}; - -// COpenCapDeviceDlg dialog - -//IMPLEMENT_DYNAMIC(COpenCapDeviceDlg, CResizableDialog) -COpenCapDeviceDlg::COpenCapDeviceDlg(CWnd* pParent /*=NULL*/) - : CResizableDialog(COpenCapDeviceDlg::IDD, pParent) - , m_vidstr(_T("")) - , m_audstr(_T("")) - , m_country(1) -{ -} - -COpenCapDeviceDlg::~COpenCapDeviceDlg() -{ -} - -void COpenCapDeviceDlg::DoDataExchange(CDataExchange* pDX) -{ - __super::DoDataExchange(pDX); - DDX_Control(pDX, IDC_COMBO1, m_vidctrl); - DDX_Control(pDX, IDC_COMBO2, m_audctrl); - DDX_Control(pDX, IDC_COMBO9, m_countryctrl); -} - -BEGIN_MESSAGE_MAP(COpenCapDeviceDlg, CResizableDialog) - ON_BN_CLICKED(IDOK, OnBnClickedOk) -END_MESSAGE_MAP() - - -// COpenCapDeviceDlg message handlers - -BOOL COpenCapDeviceDlg::OnInitDialog() -{ - __super::OnInitDialog(); - - AddAnchor(m_vidctrl, TOP_LEFT, TOP_RIGHT); - AddAnchor(m_audctrl, TOP_LEFT, TOP_RIGHT); - AddAnchor(m_countryctrl, TOP_LEFT, TOP_RIGHT); - AddAnchor(IDOK, TOP_CENTER); - AddAnchor(IDCANCEL, TOP_CENTER); - - CRect r; - GetWindowRect(r); - CSize s = r.Size(); - SetMinTrackSize(s); - s.cx = 1000; - SetMaxTrackSize(s); - - CString dummy = _T("dummy"); - CString vidstr = AfxGetApp()->GetProfileString(_T("Capture"), _T("VidDispName"), dummy); - CString audstr = AfxGetApp()->GetProfileString(_T("Capture"), _T("AudDispName"), dummy); - long country = AfxGetApp()->GetProfileInt(_T("Capture"), _T("Country"), 1); - - int iSel = vidstr == dummy ? 0 : -1; - - BeginEnumSysDev(CLSID_VideoInputDeviceCategory, pMoniker) - { - CComPtr pPB; - pMoniker->BindToStorage(0, 0, IID_IPropertyBag, (void**)&pPB); - - CComVariant var; - pPB->Read(CComBSTR(_T("FriendlyName")), &var, NULL); - int i = m_vidctrl.AddString(CString(var.bstrVal)); - - LPOLESTR strName = NULL; - if(SUCCEEDED(pMoniker->GetDisplayName(NULL, NULL, &strName))) - { - m_vidnames.Add(CString(strName)); - if(vidstr == CString(strName)) iSel = i; - CoTaskMemFree(strName); - } - } - EndEnumSysDev - - if(m_vidctrl.GetCount()) - m_vidctrl.SetCurSel(iSel); - - iSel = audstr == dummy ? 0 : -1; - - BeginEnumSysDev(CLSID_AudioInputDeviceCategory, pMoniker) - { - CComPtr pPB; - pMoniker->BindToStorage(0, 0, IID_IPropertyBag, (void**)&pPB); - - CComVariant var; - pPB->Read(CComBSTR(_T("FriendlyName")), &var, NULL); - int i = m_audctrl.AddString(CString(var.bstrVal)); - - LPOLESTR strName = NULL; - if(SUCCEEDED(pMoniker->GetDisplayName(NULL, NULL, &strName))) - { - m_audnames.Add(CString(strName)); - if(audstr == CString(strName)) iSel = i; - CoTaskMemFree(strName); - } - } - EndEnumSysDev - - { - int i = m_audctrl.AddString(_T("" + drive + "" - "Directory" - " \r\n" - " "; - files += "\r\n"; - } - - path = "Root"; - } - else - { - CString parent; - - if(path.GetLength() > 3) - { - CPath p(path + ".."); - p.Canonicalize(); - p.AddBackslash(); - parent = (LPCTSTR)p; - } - - files += "\r\n"; - files += - ".." - "Directory" - " \r\n" - " "; - files += "\r\n"; - - WIN32_FIND_DATA fd = {0}; - - HANDLE hFind = FindFirstFile(path + "*.*", &fd); - if(hFind != INVALID_HANDLE_VALUE) - { - do - { - if(!(fd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) || fd.cFileName[0] == '.') - continue; - - CString fullpath = path + fd.cFileName; - - files += "\r\n"; - files += - "" + UTF8(fd.cFileName) + "" - "Directory" - " \r\n" - "" + CStringA(CTime(fd.ftLastWriteTime).Format(_T("%Y.%m.%d %H:%M"))) + ""; - files += "\r\n"; - } - while(FindNextFile(hFind, &fd)); - - FindClose(hFind); - } - - hFind = FindFirstFile(path + "*.*", &fd); - if(hFind != INVALID_HANDLE_VALUE) - { - do - { - if(fd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) - continue; - - CString fullpath = path + fd.cFileName; - TCHAR *ext = _tcsrchr(fd.cFileName, '.'); - if (ext != NULL) ext++; - - CStringA size; - size.Format("%I64dK", ((UINT64)fd.nFileSizeHigh<<22)|(fd.nFileSizeLow>>10)); - - CString type(_T(" ")); - LoadType(fullpath, type); - - if (ext != NULL) - files += "\r\n"; - else - files += "\r\n"; - files += - "" + UTF8(fd.cFileName) + "" - "" + UTF8(type) + "" - "" + size + "\r\n" - "" + CStringA(CTime(fd.ftLastWriteTime).Format(_T("%Y.%m.%d %H:%M"))) + ""; - files += "\r\n"; - } - while(FindNextFile(hFind, &fd)); - - FindClose(hFind); - } - } - - m_pWebServer->LoadPage(IDR_HTML_BROWSER, body, m_path); - body.Replace("[charset]", "UTF-8"); // FIXME: win9x build... - body.Replace("[currentdir]", UTF8(path)); - body.Replace("[currentfiles]", files); - - return true; -} - -bool CWebClientSocket::OnControls(CStringA& hdr, CStringA& body, CStringA& mime) -{ - CString path = m_pMainFrame->m_wndPlaylistBar.GetCur(); - CString dir; - - if(!path.IsEmpty()) - { - CPath p(path); - p.RemoveFileSpec(); - dir = (LPCTSTR)p; - } - - OAFilterState fs = m_pMainFrame->GetMediaState(); - CString state; - state.Format(_T("%d"), fs); - CString statestring; - switch(fs) - { - case State_Stopped: statestring = ResStr(IDS_CONTROLS_STOPPED); break; - case State_Paused: statestring = ResStr(IDS_CONTROLS_PAUSED); break; - case State_Running: statestring = ResStr(IDS_CONTROLS_PLAYING); break; - default: statestring = _T("n/a"); break; - } - - int pos = (int)(m_pMainFrame->GetPos()/10000); - int dur = (int)(m_pMainFrame->GetDur()/10000); - - CString position, duration; - position.Format(_T("%d"), pos); - duration.Format(_T("%d"), dur); - - CString positionstring, durationstring, playbackrate; -// positionstring.Format(_T("%02d:%02d:%02d.%03d"), (pos/3600000), (pos/60000)%60, (pos/1000)%60, pos%1000); -// durationstring.Format(_T("%02d:%02d:%02d.%03d"), (dur/3600000), (dur/60000)%60, (dur/1000)%60, dur%1000); - positionstring.Format(_T("%02d:%02d:%02d"), (pos/3600000), (pos/60000)%60, (pos/1000)%60); - durationstring.Format(_T("%02d:%02d:%02d"), (dur/3600000), (dur/60000)%60, (dur/1000)%60); - playbackrate = _T("1"); // TODO - - CString volumelevel, muted; - volumelevel.Format(_T("%d"), m_pMainFrame->m_wndToolBar.m_volctrl.GetPos()); - muted.Format(_T("%d"), m_pMainFrame->m_wndToolBar.Volume == -10000 ? 1 : 0); - - CString reloadtime(_T("0")); // TODO - - m_pWebServer->LoadPage(IDR_HTML_CONTROLS, body, m_path); - body.Replace("[charset]", "UTF-8"); // FIXME: win9x build... - body.Replace("[filepatharg]", UTF8Arg(path)); - body.Replace("[filepath]", UTF8(path)); - body.Replace("[filedirarg]", UTF8Arg(dir)); - body.Replace("[filedir]", UTF8(dir)); - body.Replace("[state]", UTF8(state)); - body.Replace("[statestring]", UTF8(statestring)); - body.Replace("[position]", UTF8(position)); - body.Replace("[positionstring]", UTF8(positionstring)); - body.Replace("[duration]", UTF8(duration)); - body.Replace("[durationstring]", UTF8(durationstring)); - body.Replace("[volumelevel]", UTF8(volumelevel)); - body.Replace("[muted]", UTF8(muted)); - body.Replace("[playbackrate]", UTF8(playbackrate)); - body.Replace("[reloadtime]", UTF8(reloadtime)); - - return true; -} - -bool CWebClientSocket::OnStatus(CStringA& hdr, CStringA& body, CStringA& mime) -{ -/* - CString path = m_pMainFrame->m_wndPlaylistBar.GetCur(), dir; - if(!path.IsEmpty()) {CPath p(path); p.RemoveFileSpec(); dir = (LPCTSTR)p;} - path.Replace(_T("'"), _T("\\'")); - dir.Replace(_T("'"), _T("\\'")); - - CString volumelevel, muted; - volumelevel.Format(_T("%d"), m_pMainFrame->m_wndToolBar.m_volctrl.GetPos()); - muted.Format(_T("%d"), m_pMainFrame->m_wndToolBar.Volume == -10000 ? 1 : 0); - body.Replace("[volumelevel]", UTF8(volumelevel)); - body.Replace("[muted]", UTF8(muted)); -*/ - CString title; - m_pMainFrame->GetWindowText(title); - - CString status = m_pMainFrame->GetStatusMessage(); - - int pos = (int)(m_pMainFrame->GetPos()/10000); - int dur = (int)(m_pMainFrame->GetDur()/10000); - - CString posstr, durstr; - posstr.Format(_T("%02d:%02d:%02d"), (pos/3600000), (pos/60000)%60, (pos/1000)%60); - durstr.Format(_T("%02d:%02d:%02d"), (dur/3600000), (dur/60000)%60, (dur/1000)%60); - - title.Replace(_T("'"), _T("\\'")); - status.Replace(_T("'"), _T("\\'")); - - body.Format("OnStatus('%s', '%s', %d, '%s', %d, '%s', %d, %d)", // , '%s', '%s' - UTF8(title), UTF8(status), - pos, UTF8(posstr), dur, UTF8(durstr), - m_pMainFrame->IsMuted(), m_pMainFrame->GetVolume() - /*, UTF8(path), UTF8(dir)*/); - - return true; -} - -bool CWebClientSocket::OnError404(CStringA& hdr, CStringA& body, CStringA& mime) -{ - m_pWebServer->LoadPage(IDR_HTML_404, body, m_path); - return true; -} - -bool CWebClientSocket::OnPlayer(CStringA& hdr, CStringA& body, CStringA& mime) -{ - m_pWebServer->LoadPage(IDR_HTML_PLAYER, body, m_path); - return true; -} - -#include "jpeg.h" - -bool CWebClientSocket::OnSnapShotJpeg(CStringA& hdr, CStringA& body, CStringA& mime) -{ - // TODO: add quality control and return logo when nothing is loaded - - bool fRet = false; - - BYTE* pData = NULL; - long size = 0; - CAtlArray jpeg; - if(m_pMainFrame->GetDIB(&pData, size, true)) - { - if(CJpegEncoderMem().Encode(pData, jpeg)) - { - hdr += - "Expires: Thu, 19 Nov 1981 08:52:00 GMT\r\n" - "Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0\r\n" - "Pragma: no-cache\r\n"; - body = CStringA((char*)jpeg.GetData(), jpeg.GetCount()); - mime = "image/jpeg"; - fRet = true; - } - - delete [] pData; - } - - return fRet; -} - -#include "ConvertDlg.h" - -bool CWebClientSocket::OnConvRes(CStringA& hdr, CStringA& body, CStringA& mime) -{ - CString id; - if(!m_get.Lookup(_T("id"), id)) - return false; - - DWORD key = 0; - if(1 != _stscanf(id, _T("%x"), &key) || key == 0) - return false; - - CAutoLock cAutoLock(&CDSMResource::m_csResources); - - CDSMResource* res = NULL; - if(!CDSMResource::m_resources.Lookup(key, res) || !res) - return false; - - body = CStringA((const char*)res->data.GetData(), res->data.GetCount()); - mime = CString(res->mime); - - return true; -} diff --git a/src/apps/mplayerc/WebClientSocket.h b/src/apps/mplayerc/WebClientSocket.h deleted file mode 100644 index f7a5232be..000000000 --- a/src/apps/mplayerc/WebClientSocket.h +++ /dev/null @@ -1,44 +0,0 @@ -#pragma once - -class CWebServer; - -class CWebClientSocket : public CAsyncSocket -{ - CWebServer* m_pWebServer; - CMainFrame* m_pMainFrame; - - CString m_hdr; - - struct cookie_attribs {CString path, expire, domain;}; - CAtlStringMap m_cookieattribs; - - void Clear(); - void Header(); - -protected: - void OnReceive(int nErrorCode); - void OnClose(int nErrorCode); - -public: - CWebClientSocket(CWebServer* pWebServer, CMainFrame* pMainFrame); - virtual ~CWebClientSocket(); - - bool SetCookie(CString name, CString value = _T(""), __time64_t expire = -1, CString path = _T("/"), CString domain = _T("")); - - CString m_sessid; - CString m_cmd, m_path, m_query, m_ver; - CStringA m_data; - CAtlStringMap<> m_hdrlines; - CAtlStringMap<> m_get, m_post, m_cookie; - CAtlStringMap<> m_request; - - bool OnCommand(CStringA& hdr, CStringA& body, CStringA& mime); - bool OnIndex(CStringA& hdr, CStringA& body, CStringA& mime); - bool OnBrowser(CStringA& hdr, CStringA& body, CStringA& mime); - bool OnControls(CStringA& hdr, CStringA& body, CStringA& mime); - bool OnStatus(CStringA& hdr, CStringA& body, CStringA& mime); - bool OnError404(CStringA& hdr, CStringA& body, CStringA& mime); - bool OnPlayer(CStringA& hdr, CStringA& body, CStringA& mime); - bool OnSnapShotJpeg(CStringA& hdr, CStringA& body, CStringA& mime); - bool OnConvRes(CStringA& hdr, CStringA& body, CStringA& mime); -}; diff --git a/src/apps/mplayerc/WebServer.cpp b/src/apps/mplayerc/WebServer.cpp deleted file mode 100644 index 0832798e3..000000000 --- a/src/apps/mplayerc/WebServer.cpp +++ /dev/null @@ -1,615 +0,0 @@ -#include "..\..\zlib\zlib.h" -#include "stdafx.h" -#include "mplayerc.h" -#include "resource.h" -#include "MainFrm.h" -#include -#include -#include "WebServerSocket.h" -#include "WebClientSocket.h" -#include "WebServer.h" - - -CAtlStringMap CWebServer::m_internalpages; -CAtlStringMap CWebServer::m_downloads; -CAtlStringMap CWebServer::m_mimes; - -CWebServer::CWebServer(CMainFrame* pMainFrame, int nPort) - : m_pMainFrame(pMainFrame) - , m_nPort(nPort) -{ - if(m_internalpages.IsEmpty()) - { - m_internalpages[_T("/")] = &CWebClientSocket::OnIndex; - m_internalpages[_T("/index.html")] = &CWebClientSocket::OnIndex; - m_internalpages[_T("/browser.html")] = &CWebClientSocket::OnBrowser; - m_internalpages[_T("/controls.html")] = &CWebClientSocket::OnControls; - m_internalpages[_T("/command.html")] = &CWebClientSocket::OnCommand; - m_internalpages[_T("/status.html")] = &CWebClientSocket::OnStatus; - m_internalpages[_T("/player.html")] = &CWebClientSocket::OnPlayer; - m_internalpages[_T("/snapshot.jpg")] = &CWebClientSocket::OnSnapShotJpeg; - m_internalpages[_T("/404.html")] = &CWebClientSocket::OnError404; - m_internalpages[_T("/convres.html")] = &CWebClientSocket::OnConvRes; - } - - if(m_downloads.IsEmpty()) - { - m_downloads[_T("/default.css")] = IDF_DEFAULT_CSS; - m_downloads[_T("/vbg.gif")] = IDF_VBR_GIF; - m_downloads[_T("/vbs.gif")] = IDF_VBS_GIF; - m_downloads[_T("/sliderbar.gif")] = IDF_SLIDERBAR_GIF; - m_downloads[_T("/slidergrip.gif")] = IDF_SLIDERGRIP_GIF; - m_downloads[_T("/sliderback.gif")] = IDF_SLIDERBACK_GIF; - m_downloads[_T("/1pix.gif")] = IDF_1PIX_GIF; - m_downloads[_T("/headericon.png")] = IDF_HEADERICON_PNG; - m_downloads[_T("/headerback.png")] = IDF_HEADERBACK_PNG; - m_downloads[_T("/headerclose.png")] = IDF_HEADERCLOSE_PNG; - m_downloads[_T("/leftside.png")] = IDF_LEFTSIDE_PNG; - m_downloads[_T("/rightside.png")] = IDF_RIGHTSIDE_PNG; - m_downloads[_T("/bottomside.png")] = IDF_BOTTOMSIDE_PNG; - m_downloads[_T("/leftbottomside.png")] = IDF_LEFTBOTTOMSIDE_PNG; - m_downloads[_T("/rightbottomside.png")] = IDF_RIGHTBOTTOMSIDE_PNG; - m_downloads[_T("/seekbarleft.png")] = IDF_SEEKBARLEFT_PNG; - m_downloads[_T("/seekbarmid.png")] = IDF_SEEKBARMID_PNG; - m_downloads[_T("/seekbarright.png")] = IDF_SEEKBARRIGHT_PNG; - m_downloads[_T("/seekbargrip.png")] = IDF_SEEKBARGRIP_PNG; - m_downloads[_T("/logo.png")] = IDF_LOGO7; - m_downloads[_T("/controlback.png")] = IDF_CONTROLBACK_PNG; - m_downloads[_T("/controlbuttonplay.png")] = IDF_CONTROLBUTTONPLAY_PNG; - m_downloads[_T("/controlbuttonpause.png")] = IDF_CONTROLBUTTONPAUSE_PNG; - m_downloads[_T("/controlbuttonstop.png")] = IDF_CONTROLBUTTONSTOP_PNG; - m_downloads[_T("/controlbuttonskipback.png")] = IDF_CONTROLBUTTONSKIPBACK_PNG; - m_downloads[_T("/controlbuttondecrate.png")] = IDF_CONTROLBUTTONDECRATE_PNG; - m_downloads[_T("/controlbuttonincrate.png")] = IDF_CONTROLBUTTONINCRATE_PNG; - m_downloads[_T("/controlbuttonskipforward.png")] = IDF_CONTROLBUTTONSKIPFORWARD_PNG; - m_downloads[_T("/controlbuttonstep.png")] = IDF_CONTROLBUTTONSTEP_PNG; - m_downloads[_T("/controlvolumeon.png")] = IDF_CONTROLVOLUMEON_PNG; - m_downloads[_T("/controlvolumeoff.png")] = IDF_CONTROLVOLUMEOFF_PNG; - m_downloads[_T("/controlvolumebar.png")] = IDF_CONTROLVOLUMEBAR_PNG; - m_downloads[_T("/controlvolumegrip.png")] = IDF_CONTROLVOLUMEGRIP_PNG; - } - - CRegKey key; - CString str(_T("MIME\\Database\\Content Type")); - if(ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, str, KEY_READ)) - { - TCHAR buff[256]; - DWORD len = countof(buff); - for(int i = 0; ERROR_SUCCESS == key.EnumKey(i, buff, &len); i++, len = countof(buff)) - { - CRegKey mime; - TCHAR ext[64]; - ULONG len = countof(ext); - if(ERROR_SUCCESS == mime.Open(HKEY_CLASSES_ROOT, str + _T("\\") + buff, KEY_READ) - && ERROR_SUCCESS == mime.QueryStringValue(_T("Extension"), ext, &len)) - m_mimes[CStringA(ext).MakeLower()] = CStringA(buff).MakeLower(); - } - } - - m_mimes[".html"] = "text/html"; - m_mimes[".txt"] = "text/plain"; - m_mimes[".css"] = "text/css"; - m_mimes[".gif"] = "image/gif"; - m_mimes[".jpeg"] = "image/jpeg"; - m_mimes[".jpg"] = "image/jpeg"; - m_mimes[".png"] = "image/png"; - - GetModuleFileName(AfxGetInstanceHandle(), str.GetBuffer(MAX_PATH), MAX_PATH); - str.ReleaseBuffer(); - m_webroot = CPath(str); - m_webroot.RemoveFileSpec(); - - CString WebRoot = AfxGetAppSettings().WebRoot; - WebRoot.Replace('/', '\\'); - WebRoot.Trim(); - CPath p(WebRoot); - if(WebRoot.Find(_T(":\\")) < 0 && WebRoot.Find(_T("\\\\")) < 0) m_webroot.Append(WebRoot); - else m_webroot = p; - m_webroot.Canonicalize(); - m_webroot.MakePretty(); - if(!m_webroot.IsDirectory()) m_webroot = CPath(); - - CAtlList sl; - Explode(AfxGetAppSettings().WebServerCGI, sl, ';'); - POSITION pos = sl.GetHeadPosition(); - while(pos) - { - CAtlList sl2; - CString ext = Explode(sl.GetNext(pos), sl2, '=', 2); - if(sl2.GetCount() < 2) continue; - m_cgi[ext] = sl2.GetTail(); - } - - m_ThreadId = 0; - m_hThread = ::CreateThread(NULL, 0, StaticThreadProc, (LPVOID)this, 0, &m_ThreadId); -} - -CWebServer::~CWebServer() -{ - if(m_hThread != NULL) - { - PostThreadMessage(m_ThreadId, WM_QUIT, 0, 0); - WaitForSingleObject(m_hThread, 10000); - EXECUTE_ASSERT(CloseHandle(m_hThread)); - } -} - -DWORD WINAPI CWebServer::StaticThreadProc(LPVOID lpParam) -{ - return ((CWebServer*)lpParam)->ThreadProc(); -} - -DWORD CWebServer::ThreadProc() -{ - if(!AfxSocketInit(NULL)) - return -1; - - CWebServerSocket s(this, m_nPort); - - MSG msg; - while((int)GetMessage(&msg, NULL, 0, 0) > 0) - { - TranslateMessage(&msg); - DispatchMessage(&msg); - } - - return 0; -} - -static void PutFileContents(LPCTSTR fn, const CStringA& data) -{ - if(FILE* f = _tfopen(fn, _T("wb"))) - { - fwrite((LPCSTR)data, 1, data.GetLength(), f); - fclose(f); - } -} - -void CWebServer::Deploy(CString dir) -{ - CStringA data; - if(LoadResource(IDR_HTML_INDEX, data, RT_HTML)) PutFileContents(dir + _T("index.html"), data); - if(LoadResource(IDR_HTML_BROWSER, data, RT_HTML)) PutFileContents(dir + _T("browser.html"), data); - if(LoadResource(IDR_HTML_CONTROLS, data, RT_HTML)) PutFileContents(dir + _T("controls.html"), data); - if(LoadResource(IDR_HTML_404, data, RT_HTML)) PutFileContents(dir + _T("404.html"), data); - if(LoadResource(IDR_HTML_PLAYER, data, RT_HTML)) PutFileContents(dir + _T("player.html"), data); - - POSITION pos = m_downloads.GetStartPosition(); - while(pos) - { - CString fn; - UINT id; - m_downloads.GetNextAssoc(pos, fn, id); - if(LoadResource(id, data, _T("FILE"))) - PutFileContents(dir + fn, data); - } -} - -bool CWebServer::ToLocalPath(CString& path, CString& redir) -{ - if(!path.IsEmpty() && m_webroot.IsDirectory()) - { - CString str = path; - str.Replace('/', '\\'); - str.TrimLeft('\\'); - - CPath p; - p.Combine(m_webroot, str); - p.Canonicalize(); - - if(p.IsDirectory()) - { - CAtlList sl; - Explode(AfxGetAppSettings().WebDefIndex, sl, ';'); - POSITION pos = sl.GetHeadPosition(); - while(pos) - { - str = sl.GetNext(pos); - CPath p2 = p; - p2.Append(str); - if(p2.FileExists()) - { - p = p2; - redir = path; - if(redir.GetAt(redir.GetLength()-1) != '/') redir += '/'; - redir += str; - break; - } - } - } - - if(_tcslen(p) > _tcslen(m_webroot) && p.FileExists()) - { - path = (LPCTSTR)p; - return true; - } - } - - return false; -} - -bool CWebServer::LoadPage(UINT resid, CStringA& str, CString path) -{ - CString redir; - if(ToLocalPath(path, redir)) - { - if(FILE* f = _tfopen(path, _T("rb"))) - { - fseek(f, 0, 2); - char* buff = str.GetBufferSetLength(ftell(f)); - fseek(f, 0, 0); - int len = fread(buff, 1, str.GetLength(), f); - fclose(f); - return len == str.GetLength(); - } - } - - return LoadResource(resid, str, RT_HTML); -} - -void CWebServer::OnAccept(CWebServerSocket* pServer) -{ - CAutoPtr p(new CWebClientSocket(this, m_pMainFrame)); - if(pServer->Accept(*p)) - { - CString name; - UINT port; - if(AfxGetAppSettings().fWebServerLocalhostOnly && p->GetPeerName(name, port) && name != _T("127.0.0.1")) - { - p->Close(); - return; - } - - m_clients.AddTail(p); - } -} - -void CWebServer::OnClose(CWebClientSocket* pClient) -{ - POSITION pos = m_clients.GetHeadPosition(); - while(pos) - { - POSITION cur = pos; - if(m_clients.GetNext(pos) == pClient) - { - m_clients.RemoveAt(cur); - break; - } - } -} - -void CWebServer::OnRequest(CWebClientSocket* pClient, CStringA& hdr, CStringA& body) -{ - CPath p(pClient->m_path); - CStringA ext = p.GetExtension().MakeLower(); - CStringA mime; - if(ext.IsEmpty()) mime = "text/html"; - else m_mimes.Lookup(ext, mime); - - hdr = "HTTP/1.0 200 OK\r\n"; - - bool fHandled = false, fCGI = false; - - if(!fHandled && m_webroot.IsDirectory()) - { - CStringA tmphdr; - fHandled = fCGI = CallCGI(pClient, tmphdr, body, mime); - - if(fHandled) - { - tmphdr.Replace("\r\n", "\n"); - CAtlList hdrlines; - ExplodeMin(tmphdr, hdrlines, '\n'); - POSITION pos = hdrlines.GetHeadPosition(); - while(pos) - { - POSITION cur = pos; - CAtlList sl; - CStringA key = Explode(hdrlines.GetNext(pos), sl, ':', 2); - if(sl.GetCount() < 2) continue; - key.Trim().MakeLower(); - if(key == "content-type") {mime = sl.GetTail().Trim(); hdrlines.RemoveAt(cur);} - else if(key == "content-length") {hdrlines.RemoveAt(cur);} - } - tmphdr = Implode(hdrlines, '\n'); - tmphdr.Replace("\n", "\r\n"); - hdr += tmphdr + "\r\n"; - } - } - - RequestHandler rh = NULL; - if(!fHandled && m_internalpages.Lookup(pClient->m_path, rh) && (pClient->*rh)(hdr, body, mime)) - { - if(mime.IsEmpty()) mime = "text/html"; - - CString redir; - if(pClient->m_get.Lookup(_T("redir"), redir) - || pClient->m_post.Lookup(_T("redir"), redir)) - { - if(redir.IsEmpty()) redir = '/'; - - hdr = - "HTTP/1.0 302 Found\r\n" - "Location: " + CStringA(redir) + "\r\n"; - return; - } - - fHandled = true; - } - - if(!fHandled && m_webroot.IsDirectory()) - { - fHandled = LoadPage(0, body, pClient->m_path); - } - - UINT resid; - CStringA res; - if(!fHandled && m_downloads.Lookup(pClient->m_path, resid) && LoadResource(resid, res, _T("FILE"))) - { - if(mime.IsEmpty()) mime = "application/octet-stream"; - memcpy(body.GetBufferSetLength(res.GetLength()), res.GetBuffer(), res.GetLength()); - fHandled = true; - } - - if(!fHandled) - { - hdr = mime == "text/html" - ? "HTTP/1.0 301 Moved Permanently\r\n" "Location: /404.html\r\n" - : "HTTP/1.0 404 Not Found\r\n"; - return; - } - - if(mime == "text/html" && !fCGI) - { - hdr += - "Expires: Thu, 19 Nov 1981 08:52:00 GMT\r\n" - "Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0\r\n" - "Pragma: no-cache\r\n"; - - CStringA debug; - if(AfxGetAppSettings().fWebServerPrintDebugInfo) - { - debug += "


    \r\n"; - CString key, value; - POSITION pos; - pos = pClient->m_hdrlines.GetStartPosition(); - while(pos) {pClient->m_hdrlines.GetNextAssoc(pos, key, value); debug += "HEADER[" + key + "] = " + value + "
    \r\n";} - debug += "cmd: " + pClient->m_cmd + "
    \r\n"; - debug += "path: " + pClient->m_path + "
    \r\n"; - debug += "ver: " + pClient->m_ver + "
    \r\n"; - pos = pClient->m_get.GetStartPosition(); - while(pos) {pClient->m_get.GetNextAssoc(pos, key, value); debug += "GET[" + key + "] = " + value + "
    \r\n";} - pos = pClient->m_post.GetStartPosition(); - while(pos) {pClient->m_post.GetNextAssoc(pos, key, value); debug += "POST[" + key + "] = " + value + "
    \r\n";} - pos = pClient->m_cookie.GetStartPosition(); - while(pos) {pClient->m_cookie.GetNextAssoc(pos, key, value); debug += "COOKIE[" + key + "] = " + value + "
    \r\n";} - pos = pClient->m_request.GetStartPosition(); - while(pos) {pClient->m_request.GetNextAssoc(pos, key, value); debug += "REQUEST[" + key + "] = " + value + "
    \r\n";} - } - - body.Replace("[path]", CStringA(pClient->m_path)); - body.Replace("[indexpath]", "/index.html"); - body.Replace("[commandpath]", "/command.html"); - body.Replace("[browserpath]", "/browser.html"); - body.Replace("[controlspath]", "/controls.html"); - body.Replace("[wmcname]", "wm_command"); - body.Replace("[setposcommand]", CMD_SETPOS); - body.Replace("[setvolumecommand]", CMD_SETVOLUME); - body.Replace("[debug]", debug); - // TODO: add more general tags to replace - } - - // gzip - if(AfxGetAppSettings().fWebServerUseCompression && hdr.Find("Content-Encoding:") < 0) - do - { - CString accept_encoding; - pClient->m_hdrlines.Lookup(_T("accept-encoding"), accept_encoding); - accept_encoding.MakeLower(); - CAtlList sl; - ExplodeMin(accept_encoding, sl, ','); - if(!sl.Find(_T("gzip"))) break;; - - CHAR path[MAX_PATH], fn[MAX_PATH]; - if(!GetTempPathA(MAX_PATH, path) || !GetTempFileNameA(path, "mpc_gz", 0, fn)) - break; - - gzFile gf = gzopen(fn, "wb9"); - if(!gf || gzwrite(gf, (LPVOID)(LPCSTR)body, body.GetLength()) != body.GetLength()) - { - if(gf) gzclose(gf); - DeleteFileA(fn); - break; - } - gzclose(gf); - - FILE* f = fopen(fn, "rb"); - if(!f) {DeleteFileA(fn); break;} - fseek(f, 0, 2); - CHAR* s = body.GetBufferSetLength(ftell(f)); - fseek(f, 0, 0); - int len = fread(s, 1, body.GetLength(), f); - ASSERT(len == body.GetLength()); - fclose(f); - DeleteFileA(fn); - - hdr += "Content-Encoding: gzip\r\n"; - } - while(0); - - CStringA content; - content.Format( - "Content-Type: %s\r\n" - "Content-Length: %d\r\n", - mime, body.GetLength()); - hdr += content; -} - -static DWORD WINAPI KillCGI(LPVOID lParam) -{ - HANDLE hProcess = (HANDLE)lParam; - if(WaitForSingleObject(hProcess, 30000) == WAIT_TIMEOUT) - TerminateProcess(hProcess, 0); - return 0; -} - -bool CWebServer::CallCGI(CWebClientSocket* pClient, CStringA& hdr, CStringA& body, CStringA& mime) -{ - CString path = pClient->m_path, redir = path; - if(!ToLocalPath(path, redir)) return false; - CString ext = CPath(path).GetExtension().MakeLower(); - CPath dir(path); - dir.RemoveFileSpec(); - - CString cgi; - if(!m_cgi.Lookup(ext, cgi) || !CPath(cgi).FileExists()) - return false; - - HANDLE hProcess = GetCurrentProcess(); - HANDLE hChildStdinRd, hChildStdinWr, hChildStdinWrDup = NULL; - HANDLE hChildStdoutRd, hChildStdoutWr, hChildStdoutRdDup = NULL; - - SECURITY_ATTRIBUTES saAttr; - ZeroMemory(&saAttr, sizeof(saAttr)); - saAttr.nLength = sizeof(saAttr); - saAttr.bInheritHandle = TRUE; - - if(CreatePipe(&hChildStdoutRd, &hChildStdoutWr, &saAttr, 0)) - { - BOOL fSuccess = DuplicateHandle(hProcess, hChildStdoutRd, hProcess, &hChildStdoutRdDup, 0, FALSE, DUPLICATE_SAME_ACCESS); - CloseHandle(hChildStdoutRd); - } - - if(CreatePipe(&hChildStdinRd, &hChildStdinWr, &saAttr, 0)) - { - BOOL fSuccess = DuplicateHandle(hProcess, hChildStdinWr, hProcess, &hChildStdinWrDup, 0, FALSE, DUPLICATE_SAME_ACCESS); - CloseHandle(hChildStdinWr); - } - - STARTUPINFO siStartInfo; - ZeroMemory(&siStartInfo, sizeof(siStartInfo)); - siStartInfo.cb = sizeof(siStartInfo); - siStartInfo.hStdError = hChildStdoutWr; - siStartInfo.hStdOutput = hChildStdoutWr; - siStartInfo.hStdInput = hChildStdinRd; - siStartInfo.dwFlags |= STARTF_USESTDHANDLES|STARTF_USESHOWWINDOW; - siStartInfo.wShowWindow = SW_HIDE; - - PROCESS_INFORMATION piProcInfo; - ZeroMemory(&piProcInfo, sizeof(piProcInfo)); - - CStringA envstr; - - if(LPVOID lpvEnv = GetEnvironmentStrings()) - { - CString str; - - CAtlList env; - for(LPTSTR lpszVariable = (LPTSTR)lpvEnv; *lpszVariable; lpszVariable += _tcslen(lpszVariable)+1) - if(lpszVariable != (LPTSTR)lpvEnv) - env.AddTail(lpszVariable); - - env.AddTail(_T("GATEWAY_INTERFACE=CGI/1.1")); - env.AddTail(_T("SERVER_SOFTWARE=Media Player Classic/6.4.x.y")); - env.AddTail(_T("SERVER_PROTOCOL=") + pClient->m_ver); - env.AddTail(_T("REQUEST_METHOD=") + pClient->m_cmd); - env.AddTail(_T("PATH_INFO=") + redir); - env.AddTail(_T("PATH_TRANSLATED=") + path); - env.AddTail(_T("SCRIPT_NAME=") + redir); - env.AddTail(_T("QUERY_STRING=") + pClient->m_query); - - if(pClient->m_hdrlines.Lookup(_T("content-type"), str)) - env.AddTail(_T("CONTENT_TYPE=") + str); - if(pClient->m_hdrlines.Lookup(_T("content-length"), str)) - env.AddTail(_T("CONTENT_LENGTH=") + str); - - POSITION pos = pClient->m_hdrlines.GetStartPosition(); - while(pos) - { - CString key = pClient->m_hdrlines.GetKeyAt(pos); - CString value = pClient->m_hdrlines.GetNextValue(pos); - key.Replace(_T("-"), _T("_")); - key.MakeUpper(); - env.AddTail(_T("HTTP_") + key + _T("=") + value); - } - - CString name; - UINT port; - - if(pClient->GetPeerName(name, port)) - { - str.Format(_T("%d"), port); - env.AddTail(_T("REMOTE_ADDR=")+name); - env.AddTail(_T("REMOTE_HOST=")+name); - env.AddTail(_T("REMOTE_PORT=")+str); - } - - if(pClient->GetSockName(name, port)) - { - str.Format(_T("%d"), port); - env.AddTail(_T("SERVER_NAME=")+name); - env.AddTail(_T("SERVER_PORT=")+str); - } - - env.AddTail(_T("\0")); - - str = Implode(env, '\0'); - envstr = CStringA(str, str.GetLength()); - - FreeEnvironmentStrings((LPTSTR)lpvEnv); - } - - TCHAR* cmdln = new TCHAR[32768]; - _sntprintf(cmdln, 32768, _T("\"%s\" \"%s\""), cgi, path); - - if(hChildStdinRd && hChildStdoutWr) - if(CreateProcess( - NULL, cmdln, NULL, NULL, TRUE, 0, - envstr.GetLength() ? (LPVOID)(LPCSTR)envstr : NULL, - dir, &siStartInfo, &piProcInfo)) - { - DWORD ThreadId; - CreateThread(NULL, 0, KillCGI, (LPVOID)piProcInfo.hProcess, 0, &ThreadId); - - static const int BUFFSIZE = 1024; - DWORD dwRead, dwWritten = 0; - - int i = 0, len = pClient->m_data.GetLength(); - for(; i < len; i += dwWritten) - if(!WriteFile(hChildStdinWrDup, (LPCSTR)pClient->m_data + i, min(len - i, BUFFSIZE), &dwWritten, NULL)) - break; - - CloseHandle(hChildStdinWrDup); - CloseHandle(hChildStdoutWr); - - body.Empty(); - - CStringA buff; - while(i == len && ReadFile(hChildStdoutRdDup, buff.GetBuffer(BUFFSIZE), BUFFSIZE, &dwRead, NULL) && dwRead) - { - buff.ReleaseBufferSetLength(dwRead); - body += buff; - } - - int hdrend = body.Find("\r\n\r\n"); - if(hdrend >= 0) - { - hdr = body.Left(hdrend+2); - body = body.Mid(hdrend+4); - } - - CloseHandle(hChildStdinRd); - CloseHandle(hChildStdoutRdDup); - - CloseHandle(piProcInfo.hProcess); - CloseHandle(piProcInfo.hThread); - } - else - { - body = _T("CGI Error"); - } - - delete [] cmdln; - - return true; -} diff --git a/src/apps/mplayerc/WebServer.h b/src/apps/mplayerc/WebServer.h deleted file mode 100644 index 9518f498c..000000000 --- a/src/apps/mplayerc/WebServer.h +++ /dev/null @@ -1,50 +0,0 @@ -#pragma once - -#include -#include - -#define UTF8(str) UTF16To8(TToW(str)) -#define UTF8Arg(str) UrlEncode(UTF8(str)) - -#define CMD_SETPOS "-1" -#define CMD_SETVOLUME "-2" - - -class CWebServerSocket; -class CWebClientSocket; -class CMainFrame; - -class CWebServer -{ - CMainFrame* m_pMainFrame; - int m_nPort; - - DWORD ThreadProc(); - static DWORD WINAPI StaticThreadProc(LPVOID lpParam); - DWORD m_ThreadId; - HANDLE m_hThread; - - CAutoPtrList m_clients; - - typedef bool (CWebClientSocket::*RequestHandler)(CStringA& hdr, CStringA& body, CStringA& mime); - static CAtlStringMap m_internalpages; - static CAtlStringMap m_downloads; - static CAtlStringMap m_mimes; - CPath m_webroot; - - CAtlStringMap<> m_cgi; - bool CallCGI(CWebClientSocket* pClient, CStringA& hdr, CStringA& body, CStringA& mime); - -public: - CWebServer(CMainFrame* pMainFrame, int nPort = 13579); - virtual ~CWebServer(); - - static void Deploy(CString dir); - - bool ToLocalPath(CString& path, CString& redir); - bool LoadPage(UINT resid, CStringA& str, CString path = _T("")); - - void OnAccept(CWebServerSocket* pServer); - void OnClose(CWebClientSocket* pClient); - void OnRequest(CWebClientSocket* pClient, CStringA& reshdr, CStringA& resbody); -}; diff --git a/src/apps/mplayerc/WebServerSocket.cpp b/src/apps/mplayerc/WebServerSocket.cpp deleted file mode 100644 index ab2ab5710..000000000 --- a/src/apps/mplayerc/WebServerSocket.cpp +++ /dev/null @@ -1,22 +0,0 @@ -#include "stdafx.h" -#include ".\webserver.h" -#include ".\webserversocket.h" - -CWebServerSocket::CWebServerSocket(CWebServer* pWebServer, int port) - : m_pWebServer(pWebServer) -{ - Create(port); - Listen(); -} - -CWebServerSocket::~CWebServerSocket() -{ -} - -void CWebServerSocket::OnAccept(int nErrorCode) -{ - if(nErrorCode == 0 && m_pWebServer) - m_pWebServer->OnAccept(this); - - __super::OnAccept(nErrorCode); -} diff --git a/src/apps/mplayerc/WebServerSocket.h b/src/apps/mplayerc/WebServerSocket.h deleted file mode 100644 index e7737960d..000000000 --- a/src/apps/mplayerc/WebServerSocket.h +++ /dev/null @@ -1,15 +0,0 @@ -#pragma once - -class CWebServer; - -class CWebServerSocket : public CAsyncSocket -{ - CWebServer* m_pWebServer; - -protected: - void OnAccept(int nErrorCode); - -public: - CWebServerSocket(CWebServer* pWebServer, int port = 13579); - virtual ~CWebServerSocket(); -}; \ No newline at end of file diff --git a/src/apps/mplayerc/jpeg.cpp b/src/apps/mplayerc/jpeg.cpp deleted file mode 100644 index 0ea2172e5..000000000 --- a/src/apps/mplayerc/jpeg.cpp +++ /dev/null @@ -1,404 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - * - a simple baseline encoder - * - created exactly after the specs - * - no optimization or anything like that :) - * - */ - - -#include "stdafx.h" -#include -#include "jpeg.h" -#include "jpeg_tables.h" - -bool CJpegEncoder::PutBit(int b, int n) -{ - if(n > 24 || n <= 0) return(false); - - m_bbuff <<= n; - m_bbuff |= b & ((1 << n) - 1); - m_bwidth += n; - - while(m_bwidth >= 8) - { - BYTE c = (BYTE)(m_bbuff >> (m_bwidth - 8)); - PutByte(c); - if(c == 0xff) PutByte(0); - m_bwidth -= 8; - } - - return(true); -} - -void CJpegEncoder::Flush() -{ - if(m_bwidth > 0) - { - BYTE c = m_bbuff << (8 - m_bwidth); - PutByte(c); - if(c == 0xff) PutByte(0); - } - - m_bbuff = m_bwidth = 0; -} - -/////// - -int CJpegEncoder::GetBitWidth(short q) -{ - if(q == 0) return(0); - if(q < 0) q = -q; - - int width = 15; - for(; !(q&0x4000); q <<= 1, width--); - return(width); -} - -/////// - -void CJpegEncoder::WriteSOI() -{ - PutByte(0xff); - PutByte(0xd8); -} - -void CJpegEncoder::WriteDQT() -{ - PutByte(0xff); - PutByte(0xdb); - - WORD size = 2 + 2*(65 + 64*0); - PutByte(size>>8); - PutByte(size&0xff); - - for(int c = 0; c < 2; c++) - { - PutByte(c); - PutBytes(quanttbl[c], 64); - } -} - -void CJpegEncoder::WriteSOF0() -{ - PutByte(0xff); - PutByte(0xc0); - - WORD size = 8 + 3*ColorComponents; - PutByte(size>>8); - PutByte(size&0xff); - - PutByte(8); // precision - - PutByte(m_h>>8); - PutByte(m_h&0xff); - PutByte(m_w>>8); - PutByte(m_w&0xff); - - PutByte(ColorComponents); // color components - - PutByte(1); // component id - PutByte(0x11); // hor | ver sampling factor - PutByte(0); // quant. tbl. id - - PutByte(2); // component id - PutByte(0x11); // hor | ver sampling factor - PutByte(1); // quant. tbl. id - - PutByte(3); // component id - PutByte(0x11); // hor | ver sampling factor - PutByte(1); // quant. tbl. id -} - -void CJpegEncoder::WriteDHT() -{ - PutByte(0xff); - PutByte(0xc4); - - WORD size = 0x01A2; // 2 + n*(17+mi); - PutByte(size>>8); - PutByte(size&0xff); - - PutByte(0x00); // tbl class (DC) | tbl id - PutBytes(DCVLC_NumByLength[0], 16); - for(int i = 0; i < 12; i++) PutByte(i); - - PutByte(0x01); // tbl class (DC) | tbl id - PutBytes(DCVLC_NumByLength[1], 16); - for(int i = 0; i < 12; i++) PutByte(i); - - PutByte(0x10); // tbl class (AC) | tbl id - PutBytes(ACVLC_NumByLength[0], 16); - PutBytes(ACVLC_Data[0], sizeof(ACVLC_Data[0])); - - PutByte(0x11); // tbl class (AC) | tbl id - PutBytes(ACVLC_NumByLength[1], 16); - PutBytes(ACVLC_Data[1], sizeof(ACVLC_Data[1])); -} - -// float(1.0 / sqrt(2.0)) -#define invsq2 0.70710678118654f -#define PI 3.14159265358979 - -void CJpegEncoder::WriteSOS() -{ - PutByte(0xff); - PutByte(0xda); - - WORD size = 6 + 2*ColorComponents; - PutByte(size>>8); - PutByte(size&0xff); - - PutByte(ColorComponents); // color components: 3 - - PutByte(1); // component id - PutByte(0x00); // DC | AC huff tbl - - PutByte(2); // component id - PutByte(0x11); // DC | AC huff tbl - - PutByte(3); // component id - PutByte(0x11); // DC | AC huff tbl - - PutByte(0); // ss, first AC - PutByte(63); // se, last AC - - PutByte(0); // ah | al - - static float cosuv[8][8][8][8]; - - // oh yeah, we don't need no fast dct :) - for(int v = 0; v < 8; v++) - for(int u = 0; u < 8; u++) - for(int j = 0; j < 8; j++) - for(int i = 0; i < 8; i++) - cosuv[v][u][j][i] = (float)(cos((2*i+1)*u*PI/16) * cos((2*j+1)*v*PI/16)); - - int prevDC[3] = {0, 0, 0}; - - for(int y = 0; y < m_h; y += 8) - { - int jj = min(m_h - y, 8); - - for(int x = 0; x < m_w; x += 8) - { - int ii = min(m_w - x, 8); - - for(int c = 0; c < ColorComponents; c++) - { - int cc = !!c; - - int ACs = 0; - - static short block[64]; - - for(int zigzag = 0; zigzag < 64; zigzag++) - { - BYTE u = zigzagU[zigzag]; - BYTE v = zigzagV[zigzag]; - - float F = 0; -/* - for(int j = 0; j < jj; j++) - for(int i = 0; i < ii; i++) - F += (signed char)m_p[((y+j)*m_w + (x+i))*4 + c] * cosuv[v][u][j][i]; -*/ - for(int j = 0; j < jj; j++) - { - signed char* p = (signed char*)&m_p[((y+j)*m_w + x)*4 + c]; - for(int i = 0; i < ii; i++, p += 4) - F += *p * cosuv[v][u][j][i]; - } - - float cu = !u ? invsq2 : 1.0f; - float cv = !v ? invsq2 : 1.0f; - - block[zigzag] = short(2.0 / 8.0 * cu * cv * F) / quanttbl[cc][zigzag]; - } - - short DC = block[0] - prevDC[c]; - prevDC[c] = block[0]; - - int size = GetBitWidth(DC); - PutBit(DCVLC[cc][size], DCVLC_Size[cc][size]); - - if(DC < 0) DC = DC - 1; - PutBit(DC, size); - - int j; - for(j = 64; j > 1 && !block[j-1]; j--); - - for(int i = 1; i < j; i++) - { - short AC = block[i]; - - if(AC == 0) - { - if(++ACs == 16) - { - PutBit(ACVLC[cc][15][0], ACVLC_Size[cc][15][0]); - ACs = 0; - } - } - else - { - int size = GetBitWidth(AC); - PutBit(ACVLC[cc][ACs][size], ACVLC_Size[cc][ACs][size]); - - if(AC < 0) AC--; - PutBit(AC, size); - - ACs = 0; - } - } - - if(j < 64) PutBit(ACVLC[cc][0][0], ACVLC_Size[cc][0][0]); - } - } - } - - Flush(); -} - -void CJpegEncoder::WriteEOI() -{ - PutByte(0xff); - PutByte(0xd9); -} - -// - -CJpegEncoder::CJpegEncoder() -{ -} - -bool CJpegEncoder::Encode(const BYTE* dib) -{ - m_bbuff = m_bwidth = 0; - - BITMAPINFO* bi = (BITMAPINFO*)dib; - - int bpp = bi->bmiHeader.biBitCount; - - if(bpp != 16 && bpp != 24 && bpp != 32) // 16 & 24 not tested!!! there may be some alignment problems when the row size is not 4*something in bytes - return false; - - m_w = bi->bmiHeader.biWidth; - m_h = abs(bi->bmiHeader.biHeight); - m_p = new BYTE[m_w*m_h*4]; - - const BYTE* src = dib + sizeof(bi->bmiHeader); - if(bi->bmiHeader.biBitCount <= 8) - { - if(bi->bmiHeader.biClrUsed) src += bi->bmiHeader.biClrUsed * sizeof(bi->bmiColors[0]); - else src += (1 << bi->bmiHeader.biBitCount) * sizeof(bi->bmiColors[0]); - } - - int srcpitch = m_w*(bpp>>3); - int dstpitch = m_w*4; - - BitBltFromRGBToRGB( - m_w, m_h, - m_p, dstpitch, 32, - (BYTE*)src + srcpitch*(m_h-1), -srcpitch, bpp); - - BYTE* p = m_p; - for(BYTE* e = p + m_h*dstpitch; p < e; p += 4) - { - int r = p[2], g = p[1], b = p[0]; - - p[0] = (BYTE)min(max(0.2990*r+0.5870*g+0.1140*b, 0), 255) - 128; - p[1] = (BYTE)min(max(-0.1687*r-0.3313*g+0.5000*b + 128, 0), 255) - 128; - p[2] = (BYTE)min(max(0.5000*r-0.4187*g-0.0813*b + 128, 0), 255) - 128; - } - - if(quanttbl[0][0] == 16) - { - for(int i = 0; i < countof(quanttbl); i++) - for(int j = 0; j < countof(quanttbl[0]); j++) - quanttbl[i][j] >>= 2; // the default quantization table contains a little too large values - } - - WriteSOI(); - WriteDQT(); - WriteSOF0(); - WriteDHT(); - WriteSOS(); - WriteEOI(); - - delete [] m_p; - - return true; -} - -////////// - -CJpegEncoderFile::CJpegEncoderFile(LPCTSTR fn) -{ - m_fn = fn; - m_file = NULL; -} - -bool CJpegEncoderFile::PutByte(BYTE b) -{ - return fputc(b, m_file) != EOF; -} - -bool CJpegEncoderFile::PutBytes(const void* pData, int len) -{ - return fwrite(pData, 1, len, m_file) == len; -} - -bool CJpegEncoderFile::Encode(const BYTE* dib) -{ - if(!(m_file = _tfopen(m_fn, _T("wb")))) return false; - bool ret = __super::Encode(dib); - fclose(m_file); - m_file = NULL; - return ret; -} - -////////// - -CJpegEncoderMem::CJpegEncoderMem() -{ -} - -bool CJpegEncoderMem::PutByte(BYTE b) -{ - m_pdata->Add(b); // yeah... a bit unbuffered, for now - return true; -} - -bool CJpegEncoderMem::PutBytes(const void* pData, int len) -{ - CAtlArray moredata; - moredata.SetCount(len); - memcpy(moredata.GetData(), pData, len); - m_pdata->Append(moredata); - return true; -} - -bool CJpegEncoderMem::Encode(const BYTE* dib, CAtlArray& data) -{ - m_pdata = &data; - return __super::Encode(dib); -} - diff --git a/src/apps/mplayerc/jpeg.h b/src/apps/mplayerc/jpeg.h deleted file mode 100644 index 932da80fd..000000000 --- a/src/apps/mplayerc/jpeg.h +++ /dev/null @@ -1,59 +0,0 @@ -#pragma once - -class CJpegEncoder -{ - static const int ColorComponents = 3; - - int m_w, m_h; - BYTE* m_p; - - unsigned int m_bbuff, m_bwidth; - bool PutBit(int b, int n); - void Flush(); - int GetBitWidth(short q); - - void WriteSOI(); - void WriteDQT(); - void WriteSOF0(); - void WriteDHT(); - void WriteSOS(); - void WriteEOI(); - -protected: - virtual bool PutByte(BYTE b) = 0; - virtual bool PutBytes(const void* pData, int len) = 0; - virtual bool Encode(const BYTE* dib); - -public: - CJpegEncoder(); -}; - -class CJpegEncoderFile : public CJpegEncoder -{ - CString m_fn; - FILE* m_file; - -protected: - bool PutByte(BYTE b); - bool PutBytes(const void* pData, int len); - -public: - CJpegEncoderFile(LPCTSTR fn); - - bool Encode(const BYTE* dib); -}; - -class CJpegEncoderMem : public CJpegEncoder -{ - CAtlArray* m_pdata; - -protected: - bool PutByte(BYTE b); - bool PutBytes(const void* pData, int len); - -public: - CJpegEncoderMem(); - - bool Encode(const BYTE* dib, CAtlArray& data); -}; - diff --git a/src/apps/mplayerc/jpeg_tables.h b/src/apps/mplayerc/jpeg_tables.h deleted file mode 100644 index df01d3f67..000000000 --- a/src/apps/mplayerc/jpeg_tables.h +++ /dev/null @@ -1,233 +0,0 @@ -#pragma once - -/* Tables */ - -static unsigned char quanttbl[2][64] = -{ - { - 16, - 11, 12, - 14, 12, 10, - 16, 14, 13, 14, - 18, 17, 16, 19, 24, - 40, 26, 24, 22, 22, 24, - 49, 35, 37, 29, 40, 58, 51, - 61, 30, 57, 51, 56, 55, 64, 72, - 92, 78, 64, 68, 87, 69, 55, - 56, 80, 109, 81, 87, 95, - 98, 103, 104, 103, 62, - 77, 113, 121, 112, - 100, 120, 92, - 101, 103, - 99 - }, - { - 17, - 18, 18, - 24, 21, 24, - 47, 26, 26, 47, - 99, 66, 56, 66, 99, - 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99, 99, - 99, 99, 99, 99, - 99, 99, 99, - 99, 99, - 99 - } -}; - -static unsigned char zigzagU[64] = -{ - 0, - 1, 0, - 0, 1, 2, - 3, 2, 1, 0, - 0, 1, 2, 3, 4, - 5, 4, 3, 2, 1, 0, - 0, 1, 2, 3, 4, 5, 6, - 7, 6, 5, 4, 3, 2, 1, 0, - 1, 2, 3, 4, 5, 6, 7, - 7, 6, 5, 4, 3, 2, - 3, 4, 5, 6, 7, - 7, 6, 5, 4, - 5, 6, 7, - 7, 6, - 7, -}; - -static unsigned char zigzagV[64] = -{ - 0, - 0, 1, - 2, 1, 0, - 0, 1, 2, 3, - 4, 3, 2, 1, 0, - 0, 1, 2, 3, 4, 5, - 6, 5, 4, 3, 2, 1, 0, - 0, 1, 2, 3, 4, 5, 6, 7, - 7, 6, 5, 4, 3, 2, 1, - 2, 3, 4, 5, 6, 7, - 7, 6, 5, 4, 3, - 4, 5, 6, 7, - 7, 6, 5, - 6, 7, - 7, -}; - -static unsigned short DCVLC[2][12] = -{ - {0, 2, 3, 4, 5, 6, 14, 30, 62, 126, 254, 510}, - {0, 1, 2, 6, 14, 30, 62, 126, 254, 510, 1022, 2046} -}; - -static unsigned char DCVLC_Size[2][12] = -{ - {2, 3, 3, 3, 3, 3, 4, 5, 6, 7, 8, 9}, - {2, 2, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11} -}; - -static unsigned char DCVLC_NumByLength[2][16] = -{ - {0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0}, - {0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0} -}; - -static unsigned short ACVLC[2][16][11] = -{ - { - {10, 0, 1, 4, 11, 26, 120, 248, 1014, 65410, 65410}, - {0, 12, 27, 121, 502, 2038, 65412, 65413, 65414, 65415, 65416}, - {0, 28, 249, 1015, 4084, 65417, 65418, 65419, 65420, 65421, 65422}, - {0, 58, 503, 8181, 65423, 65424, 65425, 65426, 65427, 65428, 65429}, - {0, 59, 1016, 65430, 65431, 65432, 65433, 65434, 65435, 65436, 65437}, - {0, 122, 2039, 65438, 65439, 65440, 65441, 65442, 65443, 65444, 65445}, - {0, 123, 4086, 65446, 65447, 65448, 65449, 65450, 65451, 65452, 65453}, - {0, 250, 4087, 65454, 65455, 65456, 65457, 65458, 65459, 65460, 65461}, - {0, 504, 32704, 65462, 65463, 65464, 65465, 65466, 65467, 65468, 65469}, - {0, 505, 65470, 65471, 65472, 65473, 65474, 65475, 65476, 65477, 65478}, - {0, 506, 65479, 65480, 65481, 65482, 65483, 65484, 65485, 65486, 65487}, - {0, 1017, 65488, 65489, 65490, 65491, 65492, 65493, 65494, 65495, 65496}, - {0, 1018, 65497, 65498, 65499, 65500, 65501, 65502, 65503, 65504, 65505}, - {0, 2040, 65506, 65507, 65508, 65509, 65510, 65511, 65512, 65513, 65514}, - {0, 65515, 65516, 65517, 65518, 65519, 65520, 65521, 65522, 65523, 65524}, - {2041, 65525, 65526, 65527, 65528, 65529, 65530, 65531, 65532, 65533, 65534} - }, - { - {0, 1, 4, 10, 24, 25, 56, 120, 500, 1014, 4084}, - {0, 11, 57, 246, 501, 2038, 4085, 65416, 65417, 65418, 65419}, - {0, 26, 247, 1015, 4086, 32706, 65420, 65421, 65422, 65423, 65424}, - {0, 27, 248, 1016, 4087, 65425, 65426, 65427, 65428, 65429, 65430}, - {0, 58, 502, 65431, 65432, 65433, 65434, 65435, 65436, 65437, 65438}, - {0, 59, 1017, 65439, 65440, 65441, 65442, 65443, 65444, 65445, 65446}, - {0, 121, 2039, 65447, 65448, 65449, 65450, 65451, 65452, 65453, 65454}, - {0, 122, 2040, 65455, 65456, 65457, 65458, 65459, 65460, 65461, 65462}, - {0, 249, 65463, 65464, 65465, 65466, 65467, 65468, 65469, 65470, 65471}, - {0, 503, 65472, 65473, 65474, 65475, 65476, 65477, 65478, 65479, 65480}, - {0, 504, 65481, 65482, 65483, 65484, 65485, 65486, 65487, 65488, 65489}, - {0, 505, 65490, 65491, 65492, 65493, 65494, 65495, 65496, 65497, 65498}, - {0, 506, 65499, 65500, 65501, 65502, 65503, 65504, 65505, 65506, 65507}, - {0, 2041, 65508, 65509, 65510, 65511, 65512, 65513, 65514, 65515, 65516}, - {0, 16352, 65517, 65518, 65519, 65520, 65521, 65522, 65523, 65524, 65525}, - {1018, 32707, 65526, 65527, 65528, 65529, 65530, 65531, 65532, 65533, 65534} - } -}; - -static unsigned char ACVLC_Size[2][16][11] = -{ - { - {4, 2, 2, 3, 4, 5, 7, 8, 10, 16, 16}, - {0, 4, 5, 7, 9, 11, 16, 16, 16, 16, 16}, - {0, 5, 8, 10, 12, 16, 16, 16, 16, 16, 16}, - {0, 6, 9, 12, 16, 16, 16, 16, 16, 16, 16}, - {0, 6, 10, 16, 16, 16, 16, 16, 16, 16, 16}, - {0, 7, 11, 16, 16, 16, 16, 16, 16, 16, 16}, - {0, 7, 12, 16, 16, 16, 16, 16, 16, 16, 16}, - {0, 8, 12, 16, 16, 16, 16, 16, 16, 16, 16}, - {0, 9, 15, 16, 16, 16, 16, 16, 16, 16, 16}, - {0, 9, 16, 16, 16, 16, 16, 16, 16, 16, 16}, - {0, 9, 16, 16, 16, 16, 16, 16, 16, 16, 16}, - {0, 10, 16, 16, 16, 16, 16, 16, 16, 16, 16}, - {0, 10, 16, 16, 16, 16, 16, 16, 16, 16, 16}, - {0, 11, 16, 16, 16, 16, 16, 16, 16, 16, 16}, - {0, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16}, - {11, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16} - }, - { - {2, 2, 3, 4, 5, 5, 6, 7, 9, 10, 12}, - {0, 4, 6, 8, 9, 11, 12, 16, 16, 16, 16}, - {0, 5, 8, 10, 12, 15, 16, 16, 16, 16, 16}, - {0, 5, 8, 10, 12, 16, 16, 16, 16, 16, 16}, - {0, 6, 9, 16, 16, 16, 16, 16, 16, 16, 16}, - {0, 6, 10, 16, 16, 16, 16, 16, 16, 16, 16}, - {0, 7, 11, 16, 16, 16, 16, 16, 16, 16, 16}, - {0, 7, 11, 16, 16, 16, 16, 16, 16, 16, 16}, - {0, 8, 16, 16, 16, 16, 16, 16, 16, 16, 16}, - {0, 9, 16, 16, 16, 16, 16, 16, 16, 16, 16}, - {0, 9, 16, 16, 16, 16, 16, 16, 16, 16, 16}, - {0, 9, 16, 16, 16, 16, 16, 16, 16, 16, 16}, - {0, 9, 16, 16, 16, 16, 16, 16, 16, 16, 16}, - {0, 11, 16, 16, 16, 16, 16, 16, 16, 16, 16}, - {0, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16}, - {10, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16} - } -}; - -static unsigned char ACVLC_NumByLength[2][16] = -{ - {0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125}, - {0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 119} -}; - -static unsigned char ACVLC_Data[2][162] = -{ - { - 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12, - 0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07, - 0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xA1, 0x08, - 0x23, 0x42, 0xB1, 0xC1, 0x15, 0x52, 0xD1, 0xF0, - 0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0A, 0x16, - 0x17, 0x18, 0x19, 0x1A, 0x25, 0x26, 0x27, 0x28, - 0x29, 0x2A, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, - 0x3A, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, - 0x4A, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, - 0x5A, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, - 0x6A, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, - 0x7A, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, - 0x8A, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, - 0x99, 0x9A, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, - 0xA8, 0xA9, 0xAA, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, - 0xB7, 0xB8, 0xB9, 0xBA, 0xC2, 0xC3, 0xC4, 0xC5, - 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xD2, 0xD3, 0xD4, - 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xE1, 0xE2, - 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, - 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, - 0xF9, 0xFA - }, - { - 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21, - 0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71, - 0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91, - 0xA1, 0xB1, 0xC1, 0x09, 0x23, 0x33, 0x52, 0xF0, - 0x15, 0x62, 0x72, 0xD1, 0x0A, 0x16, 0x24, 0x34, - 0xE1, 0x25, 0xF1, 0x17, 0x18, 0x19, 0x1A, 0x26, - 0x27, 0x28, 0x29, 0x2A, 0x35, 0x36, 0x37, 0x38, - 0x39, 0x3A, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, - 0x49, 0x4A, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, - 0x59, 0x5A, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, - 0x69, 0x6A, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, - 0x79, 0x7A, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x8A, 0x92, 0x93, 0x94, 0x95, 0x96, - 0x97, 0x98, 0x99, 0x9A, 0xA2, 0xA3, 0xA4, 0xA5, - 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xB2, 0xB3, 0xB4, - 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xC2, 0xC3, - 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xD2, - 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, - 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, - 0xEA, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, - 0xF9, 0xFA - } -}; diff --git a/src/apps/mplayerc/libpng.c b/src/apps/mplayerc/libpng.c deleted file mode 100644 index d484d6142..000000000 --- a/src/apps/mplayerc/libpng.c +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include -#include -#include "libpng.h" -#include "..\..\libpng\png.h" - -static void read_data_fn(png_structp png_ptr, png_bytep data, png_size_t length) -{ - struct png_t* png = (struct png_t*)png_get_progressive_ptr(png_ptr); - if(png->pos + length > png->size) png_error(png_ptr, "Read Error"); - memcpy(data, &png->data[png->pos], length); - png->pos += length; -} - -unsigned char* DecompressPNG(struct png_t* png, int* w, int* h) -{ - png_structp png_ptr; - png_infop info_ptr; - png_infop end_info; - - unsigned char* pic; - unsigned char* row; - unsigned int x, y, c; - - if(png_sig_cmp(png->data, 0, 8) != 0) - return NULL; - - png->pos = 8; - - png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); - // (png_voidp)user_error_ptr, user_error_fn, user_warning_fn); - if(!png_ptr) - return NULL; - - png_set_read_fn(png_ptr, (png_voidp)png, read_data_fn); - - info_ptr = png_create_info_struct(png_ptr); - if(!info_ptr) - { - png_destroy_read_struct(&png_ptr, (png_infopp)NULL, (png_infopp)NULL); - return NULL; - } - - end_info = png_create_info_struct(png_ptr); - if(!end_info) - { - png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL); - return NULL; - } - - if(setjmp(png_jmpbuf(png_ptr))) - { - png_destroy_read_struct(&png_ptr, &info_ptr, &end_info); - return NULL; - } - - png_set_sig_bytes(png_ptr, 8); - - png_read_png( - png_ptr, info_ptr, - PNG_TRANSFORM_STRIP_16 | - PNG_TRANSFORM_STRIP_ALPHA | - PNG_TRANSFORM_PACKING | - PNG_TRANSFORM_EXPAND | - PNG_TRANSFORM_BGR, - NULL); - - if(png_get_channels(png_ptr, info_ptr) != 3) - { - png_destroy_read_struct(&png_ptr, &info_ptr, &end_info); - return NULL; - } - - pic = calloc(info_ptr->width * info_ptr->height, 4); - - *w = info_ptr->width; - *h = info_ptr->height; - - for(y = 0; y < info_ptr->height; y++) - { - row = &pic[y * info_ptr->width * 4]; - - for(x = 0; x < info_ptr->width*3; row += 4) - { - for(c = 0; c < 3; c++) - { - row[c] = info_ptr->row_pointers[y][x++]; - } - } - } - - png_destroy_read_struct(&png_ptr, &info_ptr, &end_info); - - return pic; -} diff --git a/src/apps/mplayerc/libpng.h b/src/apps/mplayerc/libpng.h deleted file mode 100644 index 75a09124e..000000000 --- a/src/apps/mplayerc/libpng.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#pragma once - -struct png_t {unsigned char* data; unsigned int size, pos;}; - -#ifdef __cplusplus - -extern "C" unsigned char* DecompressPNG(struct png_t* png, int* w, int* h); - -#include - -class CPngImage : public CImage -{ -public: - bool LoadFromResource(UINT id) - { - bool ret = false; - - CStringA str; - if(LoadResource(id, str, _T("FILE"))) - { - struct png_t png; - png.data = (unsigned char*)(LPCSTR)str; - png.size = str.GetLength(); - int w, h; - if(BYTE* p = DecompressPNG(&png, &w, &h)) - { - if(Create(w, -h, 32)) - { - for(int y = 0; y < h; y++) - memcpy(GetPixelAddress(0, y), &p[w*4*y], w*4); - ret = true; - } - - free(p); - } - } - - return ret; - } -}; -#endif diff --git a/src/apps/mplayerc/mplayerc.cpp b/src/apps/mplayerc/mplayerc.cpp deleted file mode 100644 index aae3c8285..000000000 --- a/src/apps/mplayerc/mplayerc.cpp +++ /dev/null @@ -1,2274 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -// mplayerc.cpp : Defines the class behaviors for the application. -// - -#include "stdafx.h" -#include "mplayerc.h" -#include -#include -#include "MainFrm.h" -#include "..\..\DSUtil\DSUtil.h" -#include "revision.h" - -///////// - -void CorrectComboListWidth(CComboBox& box, CFont* pWndFont) -{ - int cnt = box.GetCount(); - if(cnt <= 0) return; - - CDC* pDC = box.GetDC(); - pDC->SelectObject(pWndFont); - - int maxw = box.GetDroppedWidth(); - - for(int i = 0; i < cnt; i++) - { - CString str; - box.GetLBText(i, str); - int w = pDC->GetTextExtent(str).cx + 22; - if(maxw < w) maxw = w; - } - - box.ReleaseDC(pDC); - - box.SetDroppedWidth(maxw); -} - -HICON LoadIcon(CString fn, bool fSmall) -{ - if(fn.IsEmpty()) return(NULL); - - CString ext = fn.Left(fn.Find(_T("://"))+1).TrimRight(':'); - if(ext.IsEmpty() || !ext.CompareNoCase(_T("file"))) - ext = _T(".") + fn.Mid(fn.ReverseFind('.')+1); - - CSize size(fSmall?16:32,fSmall?16:32); - - if(!ext.CompareNoCase(_T(".ifo"))) - { - if(HICON hIcon = (HICON)LoadImage(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_DVD), IMAGE_ICON, size.cx, size.cy, 0)) - return(hIcon); - } - - if(!ext.CompareNoCase(_T(".cda"))) - { - if(HICON hIcon = (HICON)LoadImage(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_AUDIOCD), IMAGE_ICON, size.cx, size.cy, 0)) - return(hIcon); - } - - do - { - CRegKey key; - - TCHAR buff[256]; - ULONG len; - - if(ERROR_SUCCESS != key.Open(HKEY_CLASSES_ROOT, ext + _T("\\DefaultIcon"), KEY_READ)) - { - if(ERROR_SUCCESS != key.Open(HKEY_CLASSES_ROOT, ext, KEY_READ)) - break; - - len = sizeof(buff); - memset(buff, 0, len); - if(ERROR_SUCCESS != key.QueryStringValue(NULL, buff, &len) || (ext = buff).Trim().IsEmpty()) - break; - - if(ERROR_SUCCESS != key.Open(HKEY_CLASSES_ROOT, ext + _T("\\DefaultIcon"), KEY_READ)) - break; - } - - CString icon; - - len = sizeof(buff); - memset(buff, 0, len); - if(ERROR_SUCCESS != key.QueryStringValue(NULL, buff, &len) || (icon = buff).Trim().IsEmpty()) - break; - - int i = icon.ReverseFind(','); - if(i < 0) break; - - int id = 0; - if(_stscanf(icon.Mid(i+1), _T("%d"), &id) != 1) - break; - - icon = icon.Left(i); - - HICON hIcon = NULL; - UINT cnt = fSmall - ? ExtractIconEx(icon, id, NULL, &hIcon, 1) - : ExtractIconEx(icon, id, &hIcon, NULL, 1); - if(hIcon) return hIcon; - } - while(0); - - return((HICON)LoadImage(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_UNKNOWN), IMAGE_ICON, size.cx, size.cy, 0)); -} - -bool LoadType(CString fn, CString& type) -{ - CRegKey key; - - TCHAR buff[256]; - ULONG len; - - if(fn.IsEmpty()) return(NULL); - - CString ext = fn.Left(fn.Find(_T("://"))+1).TrimRight(':'); - if(ext.IsEmpty() || !ext.CompareNoCase(_T("file"))) - ext = _T(".") + fn.Mid(fn.ReverseFind('.')+1); - - if(ERROR_SUCCESS != key.Open(HKEY_CLASSES_ROOT, ext)) - return(false); - - CString tmp = ext; - - while(ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, tmp)) - { - len = sizeof(buff); - memset(buff, 0, len); - if(ERROR_SUCCESS != key.QueryStringValue(NULL, buff, &len)) - break; - - CString str(buff); - str.Trim(); - - if(str.IsEmpty() || str == tmp) - break; - - tmp = str; - } - - type = tmp; - - return(true); -} - -bool LoadResource(UINT resid, CStringA& str, LPCTSTR restype) -{ - str.Empty(); - HRSRC hrsrc = FindResource(AfxGetResourceHandle(), MAKEINTRESOURCE(resid), restype); - if(!hrsrc) return(false); - HGLOBAL hGlobal = LoadResource(AfxGetResourceHandle(), hrsrc); - if(!hGlobal) return(false); - DWORD size = SizeofResource(AfxGetResourceHandle(), hrsrc); - if(!size) return(false); - memcpy(str.GetBufferSetLength(size), LockResource(hGlobal), size); - return(true); -} - -///////////////////////////////////////////////////////////////////////////// -// CAboutDlg dialog used for App About - -class CAboutDlg : public CDialog -{ -public: - CAboutDlg(); - -// Dialog Data - //{{AFX_DATA(CAboutDlg) - enum { IDD = IDD_ABOUTBOX }; - //}}AFX_DATA - - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CAboutDlg) - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - //{{AFX_MSG(CAboutDlg) - // No message handlers - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -public: - CString m_appname; - CString m_strRevision; - virtual BOOL OnInitDialog() - { - UpdateData(); -#ifdef UNICODE - m_appname += _T(" (unicode build)"); -#endif - m_strRevision += MPC_REV_STR; - UpdateData(FALSE); - return TRUE; - } -}; - -CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD), m_appname(_T("")), m_strRevision(_T("")) -{ - //{{AFX_DATA_INIT(CAboutDlg) - //}}AFX_DATA_INIT -} - -void CAboutDlg::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CAboutDlg) - //}}AFX_DATA_MAP - DDX_Text(pDX, IDC_STATIC1, m_appname); - DDX_Text(pDX, IDC_VERSION, m_strRevision); -} - -BEGIN_MESSAGE_MAP(CAboutDlg, CDialog) - //{{AFX_MSG_MAP(CAboutDlg) - // No message handlers - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CMPlayerCApp - -BEGIN_MESSAGE_MAP(CMPlayerCApp, CWinApp) - //{{AFX_MSG_MAP(CMPlayerCApp) - ON_COMMAND(ID_HELP_ABOUT, OnAppAbout) - ON_COMMAND(ID_FILE_EXIT, OnFileExit) - //}}AFX_MSG_MAP - ON_COMMAND(ID_HELP_SHOWCOMMANDLINESWITCHES, OnHelpShowcommandlineswitches) -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CMPlayerCApp construction - -CMPlayerCApp::CMPlayerCApp() -// : m_hMutexOneInstance(NULL) -{ -} - -void CMPlayerCApp::ShowCmdlnSwitches() -{ - CString s; - - if(m_s.nCLSwitches&CLSW_UNRECOGNIZEDSWITCH) - { - CAtlList sl; - for(int i = 0; i < __argc; i++) sl.AddTail(__targv[i]); - s += "Unrecognized switch(es) found in command line string: \n\n" + Implode(sl, ' ') + "\n\n"; - } - - s += - _T("Usage: mplayerc.exe \"pathname\" [switches]\n\n") - _T("\"pathname\"\tThe main file or directory to be loaded. (wildcards allowed)\n") - _T("/dub \"dubname\"\tLoad an additional audio file.\n") - _T("/sub \"subname\"\tLoad an additional subtitle file.\n") - _T("/filter \"filtername\"\tLoad DirectShow filters from a dynamic link library. (wildcards allowed)\n") - _T("/dvd\t\tRun in dvd mode, \"pathname\" means the dvd folder (optional).\n") - _T("/cd\t\tLoad all the tracks of an audio cd or (s)vcd, \"pathname\" means the drive path (optional).\n") - _T("/open\t\tOpen the file, don't automatically start playing.\n") - _T("/play\t\tStart playing the file as soon the player is launched.\n") - _T("/close\t\tClose the player after playback (only works when used with /play).\n") - _T("/shutdown\tShutdown the operating system after playback\n") - _T("/fullscreen\tStart in full-screen mode.\n") - _T("/minimized\tStart in minimized mode.\n") - _T("/new\t\tUse a new instance of the player.\n") - _T("/add\t\tAdd \"pathname\" to playlist, can be combined with /open and /play.\n") - _T("/regvid\t\tCreate file associations for video files.\n") - _T("/regaud\t\tCreate file associations for audio files.\n") - _T("/unregall\t\tRemove all file associations.\n") - _T("/start ms\t\tStart playing at \"ms\" (= milliseconds)\n") - _T("/fixedsize w,h\tSet fixed window size.\n") - _T("/monitor N\tStart on monitor N, where N starts from 1.\n") - _T("/help /h /?\tShow help about command line switches. (this message box)\n"); - - AfxMessageBox(s); -} - -///////////////////////////////////////////////////////////////////////////// -// The one and only CMPlayerCApp object - -CMPlayerCApp theApp; - -HWND g_hWnd = NULL; - -bool CMPlayerCApp::StoreSettingsToIni() -{ - CString ini = GetIniPath(); -/* - FILE* f; - if(!(f = _tfopen(ini, _T("r+"))) && !(f = _tfopen(ini, _T("w")))) - return StoreSettingsToRegistry(); - fclose(f); -*/ - if(m_pszRegistryKey) free((void*)m_pszRegistryKey); - m_pszRegistryKey = NULL; - if(m_pszProfileName) free((void*)m_pszProfileName); - m_pszProfileName = _tcsdup(ini); - - return(true); -} - -bool CMPlayerCApp::StoreSettingsToRegistry() -{ - _tremove(GetIniPath()); - - if(m_pszRegistryKey) free((void*)m_pszRegistryKey); - m_pszRegistryKey = NULL; - - SetRegistryKey(_T("Gabest")); - - return(true); -} - -CString CMPlayerCApp::GetIniPath() -{ - CString path; - GetModuleFileName(AfxGetInstanceHandle(), path.GetBuffer(MAX_PATH), MAX_PATH); - path.ReleaseBuffer(); - path = path.Left(path.ReverseFind('.')+1) + _T("ini"); - return(path); -} - -bool CMPlayerCApp::IsIniValid() -{ - CFileStatus fs; - return CFileGetStatus(GetIniPath(), fs) && fs.m_size > 0; -} - -bool CMPlayerCApp::GetAppDataPath(CString& path) -{ - path.Empty(); - - CRegKey key; - if(ERROR_SUCCESS == key.Open(HKEY_CURRENT_USER, _T("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders"), KEY_READ)) - { - ULONG len = MAX_PATH; - if(ERROR_SUCCESS == key.QueryStringValue(_T("AppData"), path.GetBuffer(MAX_PATH), &len)) - path.ReleaseBufferSetLength(len); - } - - if(path.IsEmpty()) - return(false); - - CPath p; - p.Combine(path, _T("Media Player Classic")); - path = (LPCTSTR)p; - - return(true); -} - -void CMPlayerCApp::PreProcessCommandLine() -{ - m_cmdln.RemoveAll(); - for(int i = 1; i < __argc; i++) - { - CString str = CString(__targv[i]).Trim(_T(" \"")); - - if(str[0] != '/' && str[0] != '-' && str.Find(_T(":")) < 0) - { - LPTSTR p = NULL; - CString str2; - str2.ReleaseBuffer(GetFullPathName(str, MAX_PATH, str2.GetBuffer(MAX_PATH), &p)); - CFileStatus fs; - if(!str2.IsEmpty() && CFileGetStatus(str2, fs)) str = str2; - } - - m_cmdln.AddTail(str); - } -} - -void CMPlayerCApp::SendCommandLine(HWND hWnd) -{ - if(m_cmdln.IsEmpty()) - return; - - int bufflen = sizeof(DWORD); - - POSITION pos = m_cmdln.GetHeadPosition(); - while(pos) bufflen += (m_cmdln.GetNext(pos).GetLength()+1)*sizeof(TCHAR); - - CAutoVectorPtr buff; - if(!buff.Allocate(bufflen)) - return; - - BYTE* p = buff; - - *(DWORD*)p = m_cmdln.GetCount(); - p += sizeof(DWORD); - - pos = m_cmdln.GetHeadPosition(); - while(pos) - { - CString s = m_cmdln.GetNext(pos); - int len = (s.GetLength()+1)*sizeof(TCHAR); - memcpy(p, s, len); - p += len; - } - - COPYDATASTRUCT cds; - cds.dwData = 0x6ABE51; - cds.cbData = bufflen; - cds.lpData = (void*)(BYTE*)buff; - SendMessage(hWnd, WM_COPYDATA, (WPARAM)NULL, (LPARAM)&cds); -} - -///////////////////////////////////////////////////////////////////////////// -// CMPlayerCApp initialization - -#include "..\..\..\include\detours\detours.h" -#include "..\..\..\include\winddk\ntddcdvd.h" - -DETOUR_TRAMPOLINE(BOOL WINAPI Real_IsDebuggerPresent(), IsDebuggerPresent); -BOOL WINAPI Mine_IsDebuggerPresent() -{ - TRACE(_T("Oops, somebody was trying to be naughty! (called IsDebuggerPresent)\n")); - return FALSE; -} - -DETOUR_TRAMPOLINE(LONG WINAPI Real_ChangeDisplaySettingsExA(LPCSTR lpszDeviceName, LPDEVMODEA lpDevMode, HWND hwnd, DWORD dwFlags, LPVOID lParam), ChangeDisplaySettingsExA); -DETOUR_TRAMPOLINE(LONG WINAPI Real_ChangeDisplaySettingsExW(LPCWSTR lpszDeviceName, LPDEVMODEW lpDevMode, HWND hwnd, DWORD dwFlags, LPVOID lParam), ChangeDisplaySettingsExW); -LONG WINAPI Mine_ChangeDisplaySettingsEx(LONG ret, DWORD dwFlags, LPVOID lParam) -{ - if(dwFlags&CDS_VIDEOPARAMETERS) - { - VIDEOPARAMETERS* vp = (VIDEOPARAMETERS*)lParam; - - if(vp->Guid == GUIDFromCString(_T("{02C62061-1097-11d1-920F-00A024DF156E}")) - && (vp->dwFlags&VP_FLAGS_COPYPROTECT)) - { - if(vp->dwCommand == VP_COMMAND_GET) - { - if((vp->dwTVStandard&VP_TV_STANDARD_WIN_VGA) - && vp->dwTVStandard != VP_TV_STANDARD_WIN_VGA) - { - TRACE(_T("Ooops, tv-out enabled? macrovision checks suck...")); - vp->dwTVStandard = VP_TV_STANDARD_WIN_VGA; - } - } - else if(vp->dwCommand == VP_COMMAND_SET) - { - TRACE(_T("Ooops, as I already told ya, no need for any macrovision bs here")); - return 0; - } - } - } - - return ret; -} -LONG WINAPI Mine_ChangeDisplaySettingsExA(LPCSTR lpszDeviceName, LPDEVMODEA lpDevMode, HWND hwnd, DWORD dwFlags, LPVOID lParam) -{ - return Mine_ChangeDisplaySettingsEx( - Real_ChangeDisplaySettingsExA(lpszDeviceName, lpDevMode, hwnd, dwFlags, lParam), - dwFlags, - lParam); -} -LONG WINAPI Mine_ChangeDisplaySettingsExW(LPCWSTR lpszDeviceName, LPDEVMODEW lpDevMode, HWND hwnd, DWORD dwFlags, LPVOID lParam) -{ - return Mine_ChangeDisplaySettingsEx( - Real_ChangeDisplaySettingsExW(lpszDeviceName, lpDevMode, hwnd, dwFlags, lParam), - dwFlags, - lParam); -} - -DETOUR_TRAMPOLINE(HANDLE WINAPI Real_CreateFileA(LPCSTR p1, DWORD p2, DWORD p3, LPSECURITY_ATTRIBUTES p4, DWORD p5, DWORD p6, HANDLE p7), CreateFileA); -DETOUR_TRAMPOLINE(HANDLE WINAPI Real_CreateFileW(LPCWSTR p1, DWORD p2, DWORD p3, LPSECURITY_ATTRIBUTES p4, DWORD p5, DWORD p6, HANDLE p7), CreateFileW); -HANDLE WINAPI Mine_CreateFileA(LPCSTR p1, DWORD p2, DWORD p3, LPSECURITY_ATTRIBUTES p4, DWORD p5, DWORD p6, HANDLE p7) -{ - //CStringA fn(p1); - //fn.MakeLower(); - //int i = fn.Find(".part"); - //if(i > 0 && i == fn.GetLength() - 5) - p3 |= FILE_SHARE_WRITE; - - return Real_CreateFileA(p1, p2, p3, p4, p5, p6, p7); -} -HANDLE WINAPI Mine_CreateFileW(LPCWSTR p1, DWORD p2, DWORD p3, LPSECURITY_ATTRIBUTES p4, DWORD p5, DWORD p6, HANDLE p7) -{ - //CStringW fn(p1); - //fn.MakeLower(); - //int i = fn.Find(L".part"); - //if(i > 0 && i == fn.GetLength() - 5) - p3 |= FILE_SHARE_WRITE; - - return Real_CreateFileW(p1, p2, p3, p4, p5, p6, p7); -} - -DETOUR_TRAMPOLINE(MMRESULT WINAPI Real_mixerSetControlDetails(HMIXEROBJ hmxobj, LPMIXERCONTROLDETAILS pmxcd, DWORD fdwDetails), mixerSetControlDetails); -MMRESULT WINAPI Mine_mixerSetControlDetails(HMIXEROBJ hmxobj, LPMIXERCONTROLDETAILS pmxcd, DWORD fdwDetails) -{ - if(fdwDetails == (MIXER_OBJECTF_HMIXER|MIXER_SETCONTROLDETAILSF_VALUE)) - return MMSYSERR_NOERROR; // don't touch the mixer, kthx - return Real_mixerSetControlDetails(hmxobj, pmxcd, fdwDetails); -} - -DETOUR_TRAMPOLINE(BOOL WINAPI Real_DeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID lpInBuffer, DWORD nInBufferSize, LPVOID lpOutBuffer, DWORD nOutBufferSize, LPDWORD lpBytesReturned, LPOVERLAPPED lpOverlapped), DeviceIoControl); -BOOL WINAPI Mine_DeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID lpInBuffer, DWORD nInBufferSize, LPVOID lpOutBuffer, DWORD nOutBufferSize, LPDWORD lpBytesReturned, LPOVERLAPPED lpOverlapped) -{ - BOOL ret = Real_DeviceIoControl(hDevice, dwIoControlCode, lpInBuffer, nInBufferSize, lpOutBuffer, nOutBufferSize, lpBytesReturned, lpOverlapped); - - if(IOCTL_DVD_GET_REGION == dwIoControlCode && lpOutBuffer - && lpBytesReturned && *lpBytesReturned == sizeof(DVD_REGION)) - { - DVD_REGION* pDVDRegion = (DVD_REGION*)lpOutBuffer; - pDVDRegion->SystemRegion = ~pDVDRegion->RegionData; - } - - return ret; -} - -#include "../../subtitles/SSF.h" -#include "../../subtitles/RTS.h" -#include "../../subpic/MemSubPic.h" - -class ssftest -{ -public: - ssftest() - { - Sleep(10000); - - MessageBeep(-1); -// 8; // - SubPicDesc spd; - spd.w = 640; - spd.h = 480; - spd.bpp = 32; - spd.pitch = spd.w*spd.bpp>>3; - spd.type = MSP_RGB32; - spd.vidrect = CRect(0, 0, spd.w, spd.h); - spd.bits = new BYTE[spd.pitch*spd.h]; - - CCritSec csLock; -/* - CRenderedTextSubtitle s(&csLock); - s.Open(_T("../../subtitles/libssf/demo/demo.ssa"), 1); - - for(int i = 2*60*1000+2000; i < 2*60*1000+17000; i += 10) - { - memsetd(spd.bits, 0xff000000, spd.pitch*spd.h); - CRect bbox; - bbox.SetRectEmpty(); - s.Render(spd, 10000i64*i, 25, bbox); - } -*/ - try - { - ssf::CRenderer s(&csLock); - s.Open(_T("../../subtitles/libssf/demo/demo.ssf")); - - for(int i = 2*60*1000+2000; i < 2*60*1000+17000; i += 40) - // for(int i = 2*60*1000+2000; i < 2*60*1000+17000; i += 1000) - //for(int i = 0; i < 5000; i += 40) - { - memsetd(spd.bits, 0xff000000, spd.pitch*spd.h); - CRect bbox; - bbox.SetRectEmpty(); - s.Render(spd, 10000i64*i, 25, bbox); - } - } - catch(ssf::Exception& e) - { - TRACE(_T("%s\n"), e.ToString()); - ASSERT(0); - } - - delete [] spd.bits; - - ::ExitProcess(0); - } -}; - -BOOL CMPlayerCApp::InitInstance() -{ - //ssftest s; - - DetourFunctionWithTrampoline((PBYTE)Real_IsDebuggerPresent, (PBYTE)Mine_IsDebuggerPresent); - DetourFunctionWithTrampoline((PBYTE)Real_ChangeDisplaySettingsExA, (PBYTE)Mine_ChangeDisplaySettingsExA); - DetourFunctionWithTrampoline((PBYTE)Real_ChangeDisplaySettingsExW, (PBYTE)Mine_ChangeDisplaySettingsExW); - DetourFunctionWithTrampoline((PBYTE)Real_CreateFileA, (PBYTE)Mine_CreateFileA); - DetourFunctionWithTrampoline((PBYTE)Real_CreateFileW, (PBYTE)Mine_CreateFileW); - DetourFunctionWithTrampoline((PBYTE)Real_mixerSetControlDetails, (PBYTE)Mine_mixerSetControlDetails); - DetourFunctionWithTrampoline((PBYTE)Real_DeviceIoControl, (PBYTE)Mine_DeviceIoControl); - CFilterMapper2::Init(); - - HRESULT hr; - if(FAILED(hr = OleInitialize(0))) - { - AfxMessageBox(_T("OleInitialize failed!")); - return FALSE; - } - - WNDCLASS wndcls; - memset(&wndcls, 0, sizeof(WNDCLASS)); - wndcls.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW; - wndcls.lpfnWndProc = ::DefWindowProc; - wndcls.hInstance = AfxGetInstanceHandle(); - wndcls.hIcon = LoadIcon(IDR_MAINFRAME); - wndcls.hCursor = LoadCursor(IDC_ARROW); - wndcls.hbrBackground = 0;//(HBRUSH)(COLOR_WINDOW + 1); // no bkg brush, the view and the bars should always fill the whole client area - wndcls.lpszMenuName = NULL; - wndcls.lpszClassName = MPC_WND_CLASS_NAME; - - if(!AfxRegisterClass(&wndcls)) - { - AfxMessageBox(_T("MainFrm class registration failed!")); - return FALSE; - } - - if(!AfxSocketInit(NULL)) - { - AfxMessageBox(_T("AfxSocketInit failed!")); - return FALSE; - } - - PreProcessCommandLine(); - - if(IsIniValid()) StoreSettingsToIni(); - else StoreSettingsToRegistry(); - - CString AppDataPath; - if(GetAppDataPath(AppDataPath)) - CreateDirectory(AppDataPath, NULL); - - m_s.ParseCommandLine(m_cmdln); - - if(m_s.nCLSwitches&(CLSW_HELP|CLSW_UNRECOGNIZEDSWITCH)) - { - ShowCmdlnSwitches(); - return FALSE; - } - - if((m_s.nCLSwitches&CLSW_CLOSE) && m_s.slFiles.IsEmpty()) - { - return FALSE; - } - - m_s.UpdateData(false); - - if((m_s.nCLSwitches&CLSW_REGEXTVID) || (m_s.nCLSwitches&CLSW_REGEXTAUD)) - { - CMediaFormats& mf = m_s.Formats; - - for(int i = 0; i < mf.GetCount(); i++) - { - if(!mf[i].GetLabel().CompareNoCase(_T("Playlist file"))) continue; - - bool fAudioOnly = mf[i].IsAudioOnly(); - - int j = 0; - CString str = mf[i].GetExtsWithPeriod(); - for(CString ext = str.Tokenize(_T(" "), j); !ext.IsEmpty(); ext = str.Tokenize(_T(" "), j)) - { - if(((m_s.nCLSwitches&CLSW_REGEXTVID) && !fAudioOnly) || ((m_s.nCLSwitches&CLSW_REGEXTAUD) && fAudioOnly)) { - CPPageFormats::RegisterExt(ext, true); - } - } - } - - return FALSE; - } - - if((m_s.nCLSwitches&CLSW_UNREGEXT)) - { - CMediaFormats& mf = m_s.Formats; - - for(int i = 0; i < mf.GetCount(); i++) - { - int j = 0; - CString str = mf[i].GetExtsWithPeriod(); - for(CString ext = str.Tokenize(_T(" "), j); !ext.IsEmpty(); ext = str.Tokenize(_T(" "), j)) - { - CPPageFormats::RegisterExt(ext, false); - } - } - - return FALSE; - } - - m_mutexOneInstance.Create(NULL, TRUE, MPC_WND_CLASS_NAME); - - if(GetLastError() == ERROR_ALREADY_EXISTS - && (!(m_s.fAllowMultipleInst || (m_s.nCLSwitches&CLSW_NEW) || m_cmdln.IsEmpty()) - || (m_s.nCLSwitches&CLSW_ADD))) - { - if(HWND hWnd = ::FindWindow(MPC_WND_CLASS_NAME, NULL)) - { - SetForegroundWindow(hWnd); - - if(!(m_s.nCLSwitches&CLSW_MINIMIZED) && IsIconic(hWnd)) - ShowWindow(hWnd, SW_RESTORE); - - SendCommandLine(hWnd); - - return FALSE; - } - } - - if(!__super::InitInstance()) - { - AfxMessageBox(_T("InitInstance failed!")); - return FALSE; - } - - CRegKey key; - if(ERROR_SUCCESS == key.Create(HKEY_LOCAL_MACHINE, _T("Software\\Gabest\\Media Player Classic"))) - { - CString path; - GetModuleFileName(AfxGetInstanceHandle(), path.GetBuffer(MAX_PATH), MAX_PATH); - path.ReleaseBuffer(); - key.SetStringValue(_T("ExePath"), path); - } - - AfxEnableControlContainer(); - - CMainFrame* pFrame = new CMainFrame; - m_pMainWnd = pFrame; - pFrame->LoadFrame(IDR_MAINFRAME, WS_OVERLAPPEDWINDOW|FWS_ADDTOTITLE, NULL, NULL); - pFrame->SetDefaultWindowRect((m_s.nCLSwitches&CLSW_MONITOR)?m_s.iMonitor:0); - pFrame->RestoreFloatingControlBars(); - pFrame->SetIcon(AfxGetApp()->LoadIcon(IDR_MAINFRAME), TRUE); - pFrame->DragAcceptFiles(); - pFrame->ShowWindow((m_s.nCLSwitches&CLSW_MINIMIZED)?SW_SHOWMINIMIZED:SW_SHOW); - pFrame->UpdateWindow(); - pFrame->m_hAccelTable = m_s.hAccel; - - m_s.WinLircClient.SetHWND(m_pMainWnd->m_hWnd); - if(m_s.fWinLirc) m_s.WinLircClient.Connect(m_s.WinLircAddr); - m_s.UIceClient.SetHWND(m_pMainWnd->m_hWnd); - if(m_s.fUIce) m_s.UIceClient.Connect(m_s.UIceAddr); - - SendCommandLine(m_pMainWnd->m_hWnd); - - pFrame->SetFocus(); - - return TRUE; -} - -int CMPlayerCApp::ExitInstance() -{ - m_s.UpdateData(true); - - OleUninitialize(); - - return CWinApp::ExitInstance(); -} - -///////////////////////////////////////////////////////////////////////////// -// CMPlayerCApp message handlers -// App command to run the dialog - -void CMPlayerCApp::OnAppAbout() -{ - CAboutDlg aboutDlg; - aboutDlg.DoModal(); -} - -void CMPlayerCApp::OnFileExit() -{ - OnAppExit(); -} - -// CRemoteCtrlClient - -CRemoteCtrlClient::CRemoteCtrlClient() - : m_pWnd(NULL) - , m_nStatus(DISCONNECTED) -{ -} - -void CRemoteCtrlClient::SetHWND(HWND hWnd) -{ - CAutoLock cAutoLock(&m_csLock); - - m_pWnd = CWnd::FromHandle(hWnd); -} - -void CRemoteCtrlClient::Connect(CString addr) -{ - CAutoLock cAutoLock(&m_csLock); - - if(m_nStatus == CONNECTING && m_addr == addr) - { - TRACE(_T("CRemoteCtrlClient (Connect): already connecting to %s\n"), addr); - return; - } - - if(m_nStatus == CONNECTED && m_addr == addr) - { - TRACE(_T("CRemoteCtrlClient (Connect): already connected to %s\n"), addr); - return; - } - - m_nStatus = CONNECTING; - - TRACE(_T("CRemoteCtrlClient (Connect): connecting to %s\n"), addr); - - Close(); - - Create(); - - CString ip = addr.Left(addr.Find(':')+1).TrimRight(':'); - int port = _tcstol(addr.Mid(addr.Find(':')+1), NULL, 10); - - __super::Connect(ip, port); - - m_addr = addr; -} - -void CRemoteCtrlClient::OnConnect(int nErrorCode) -{ - CAutoLock cAutoLock(&m_csLock); - - m_nStatus = (nErrorCode == 0 ? CONNECTED : DISCONNECTED); - - TRACE(_T("CRemoteCtrlClient (OnConnect): %d\n"), nErrorCode); -} - -void CRemoteCtrlClient::OnClose(int nErrorCode) -{ - CAutoLock cAutoLock(&m_csLock); - - if(m_hSocket != INVALID_SOCKET && m_nStatus == CONNECTED) - { - TRACE(_T("CRemoteCtrlClient (OnClose): connection lost\n")); - } - - m_nStatus = DISCONNECTED; - - TRACE(_T("CRemoteCtrlClient (OnClose): %d\n"), nErrorCode); -} - -void CRemoteCtrlClient::OnReceive(int nErrorCode) -{ - if(nErrorCode != 0 || !m_pWnd) return; - - CStringA str; - int ret = Receive(str.GetBuffer(256), 255, 0); - if(ret <= 0) return; - str.ReleaseBuffer(ret); - - TRACE(_T("CRemoteCtrlClient (OnReceive): %s\n"), CString(str)); - - OnCommand(str); - - __super::OnReceive(nErrorCode); -} - -void CRemoteCtrlClient::ExecuteCommand(CStringA cmd, int repcnt) -{ - cmd.Trim(); - if(cmd.IsEmpty()) return; - cmd.Replace(' ', '_'); - - AppSettings& s = AfxGetAppSettings(); - - POSITION pos = s.wmcmds.GetHeadPosition(); - while(pos) - { - wmcmd wc = s.wmcmds.GetNext(pos); - CStringA name = CString(wc.name); - name.Replace(' ', '_'); - if((repcnt == 0 && wc.rmrepcnt == 0 || wc.rmrepcnt > 0 && (repcnt%wc.rmrepcnt) == 0) - && (!name.CompareNoCase(cmd) || !wc.rmcmd.CompareNoCase(cmd) || wc.cmd == (WORD)strtol(cmd, NULL, 10))) - { - CAutoLock cAutoLock(&m_csLock); - TRACE(_T("CRemoteCtrlClient (calling command): %s\n"), wc.name); - m_pWnd->SendMessage(WM_COMMAND, wc.cmd); - break; - } - } -} - -// CWinLircClient - -CWinLircClient::CWinLircClient() -{ -} - -void CWinLircClient::OnCommand(CStringA str) -{ - TRACE(_T("CWinLircClient (OnCommand): %s\n"), CString(str)); - - int i = 0, j = 0, repcnt = 0; - for(CStringA token = str.Tokenize(" ", i); - !token.IsEmpty(); - token = str.Tokenize(" ", i), j++) - { - if(j == 1) - repcnt = strtol(token, NULL, 16); - else if(j == 2) - ExecuteCommand(token, repcnt); - } -} - -// CUIceClient - -CUIceClient::CUIceClient() -{ -} - -void CUIceClient::OnCommand(CStringA str) -{ - TRACE(_T("CUIceClient (OnCommand): %s\n"), CString(str)); - - CStringA cmd; - int i = 0, j = 0; - for(CStringA token = str.Tokenize("|", i); - !token.IsEmpty(); - token = str.Tokenize("|", i), j++) - { - if(j == 0) - cmd = token; - else if(j == 1) - ExecuteCommand(cmd, strtol(token, NULL, 16)); - } -} - -// CMPlayerCApp::Settings - -CMPlayerCApp::Settings::Settings() - : fInitialized(false) - , MRU(0, _T("Recent File List"), _T("File%d"), 20) - , MRUDub(0, _T("Recent Dub List"), _T("Dub%d"), 20) - , hAccel(NULL) -{ -#define ADDCMD(cmd) wmcmds.AddTail(wmcmd##cmd) - ADDCMD((ID_FILE_OPENQUICK, 'Q', FVIRTKEY|FCONTROL|FNOINVERT, _T("Quick Open File"))); - ADDCMD((ID_FILE_OPENMEDIA, 'O', FVIRTKEY|FCONTROL|FNOINVERT, _T("Open File"))); - ADDCMD((ID_FILE_OPENDVD, 'D', FVIRTKEY|FCONTROL|FNOINVERT, _T("Open DVD"))); - ADDCMD((ID_FILE_OPENDEVICE, 'V', FVIRTKEY|FCONTROL|FNOINVERT, _T("Open Device"))); - ADDCMD((ID_FILE_SAVE_COPY, 0, FVIRTKEY|FNOINVERT, _T("Save As"))); - ADDCMD((ID_FILE_SAVE_IMAGE, 'I', FVIRTKEY|FALT|FNOINVERT, _T("Save Image"))); - ADDCMD((ID_FILE_SAVE_IMAGE_AUTO, VK_F5, FVIRTKEY|FNOINVERT, _T("Save Image (auto)"))); - ADDCMD((ID_FILE_LOAD_SUBTITLE, 'L', FVIRTKEY|FCONTROL|FNOINVERT, _T("Load Subtitle"))); - ADDCMD((ID_FILE_SAVE_SUBTITLE, 'S', FVIRTKEY|FCONTROL|FNOINVERT, _T("Save Subtitle"))); - ADDCMD((ID_FILE_CLOSEPLAYLIST, 'C', FVIRTKEY|FCONTROL|FNOINVERT, _T("Close"))); - ADDCMD((ID_FILE_PROPERTIES, VK_F10, FVIRTKEY|FSHIFT|FNOINVERT, _T("Properties"))); - ADDCMD((ID_FILE_EXIT, 'X', FVIRTKEY|FALT|FNOINVERT, _T("Exit"))); - ADDCMD((ID_PLAY_PLAYPAUSE, VK_SPACE, FVIRTKEY|FNOINVERT, _T("Play/Pause"), APPCOMMAND_MEDIA_PLAY_PAUSE, wmcmd::LDOWN)); - ADDCMD((ID_PLAY_PLAY, 0, FVIRTKEY|FNOINVERT, _T("Play"))); - ADDCMD((ID_PLAY_PAUSE, 0, FVIRTKEY|FNOINVERT, _T("Pause"))); - ADDCMD((ID_PLAY_STOP, VK_OEM_PERIOD, FVIRTKEY|FNOINVERT, _T("Stop"), APPCOMMAND_MEDIA_STOP)); - ADDCMD((ID_PLAY_FRAMESTEP, VK_RIGHT, FVIRTKEY|FNOINVERT, _T("Framestep"))); - ADDCMD((ID_PLAY_FRAMESTEPCANCEL, VK_LEFT, FVIRTKEY|FNOINVERT, _T("Framestep back"))); - ADDCMD((ID_PLAY_GOTO, 'G', FVIRTKEY|FCONTROL|FNOINVERT, _T("Go To"))); - ADDCMD((ID_PLAY_INCRATE, VK_UP, FVIRTKEY|FCONTROL|FNOINVERT, _T("Increase Rate"))); - ADDCMD((ID_PLAY_DECRATE, VK_DOWN, FVIRTKEY|FCONTROL|FNOINVERT, _T("Decrease Rate"))); - ADDCMD((ID_PLAY_RESETRATE, 'R', FVIRTKEY|FCONTROL|FNOINVERT, _T("Reset Rate"))); - ADDCMD((ID_PLAY_INCAUDDELAY, VK_ADD, FVIRTKEY|FNOINVERT, _T("Audio Delay +10ms"))); - ADDCMD((ID_PLAY_DECAUDDELAY, VK_SUBTRACT, FVIRTKEY|FNOINVERT, _T("Audio Delay -10ms"))); - ADDCMD((ID_PLAY_SEEKFORWARDSMALL, 0, FVIRTKEY|FNOINVERT, _T("Jump Forward (small)"))); - ADDCMD((ID_PLAY_SEEKBACKWARDSMALL, 0, FVIRTKEY|FNOINVERT, _T("Jump Backward (small)"))); - ADDCMD((ID_PLAY_SEEKFORWARDMED, VK_RIGHT, FVIRTKEY|FCONTROL|FNOINVERT, _T("Jump Forward (medium)"))); - ADDCMD((ID_PLAY_SEEKBACKWARDMED, VK_LEFT, FVIRTKEY|FCONTROL|FNOINVERT, _T("Jump Backward (medium)"))); - ADDCMD((ID_PLAY_SEEKFORWARDLARGE, VK_RIGHT, FVIRTKEY|FALT|FNOINVERT, _T("Jump Forward (large)"))); - ADDCMD((ID_PLAY_SEEKBACKWARDLARGE, VK_LEFT, FVIRTKEY|FALT|FNOINVERT, _T("Jump Backward (large)"))); - ADDCMD((ID_PLAY_SEEKKEYFORWARD, VK_RIGHT, FVIRTKEY|FSHIFT|FNOINVERT, _T("Jump Forward (keyframe)"))); - ADDCMD((ID_PLAY_SEEKKEYBACKWARD, VK_LEFT, FVIRTKEY|FSHIFT|FNOINVERT, _T("Jump Backward (keyframe)"))); - ADDCMD((ID_NAVIGATE_SKIPFORWARD, VK_NEXT, FVIRTKEY|FNOINVERT, _T("Next"), APPCOMMAND_MEDIA_NEXTTRACK, wmcmd::X2DOWN)); - ADDCMD((ID_NAVIGATE_SKIPBACK, VK_PRIOR, FVIRTKEY|FNOINVERT, _T("Previous"), APPCOMMAND_MEDIA_PREVIOUSTRACK, wmcmd::X1DOWN)); - ADDCMD((ID_NAVIGATE_SKIPFORWARDPLITEM, VK_NEXT, FVIRTKEY|FCONTROL|FNOINVERT, _T("Next Playlist Item"))); - ADDCMD((ID_NAVIGATE_SKIPBACKPLITEM, VK_PRIOR, FVIRTKEY|FCONTROL|FNOINVERT, _T("Previous Playlist Item"))); - ADDCMD((ID_VIEW_CAPTIONMENU, '0', FVIRTKEY|FCONTROL|FNOINVERT, _T("Toggle Caption&Menu"))); - ADDCMD((ID_VIEW_SEEKER, '1', FVIRTKEY|FCONTROL|FNOINVERT, _T("Toggle Seeker"))); - ADDCMD((ID_VIEW_CONTROLS, '2', FVIRTKEY|FCONTROL|FNOINVERT, _T("Toggle Controls"))); - ADDCMD((ID_VIEW_INFORMATION, '3', FVIRTKEY|FCONTROL|FNOINVERT, _T("Toggle Information"))); - ADDCMD((ID_VIEW_STATISTICS, '4', FVIRTKEY|FCONTROL|FNOINVERT, _T("Toggle Statistics"))); - ADDCMD((ID_VIEW_STATUS, '5', FVIRTKEY|FCONTROL|FNOINVERT, _T("Toggle Status"))); - ADDCMD((ID_VIEW_SUBRESYNC, '6', FVIRTKEY|FCONTROL|FNOINVERT, _T("Toggle Subresync Bar"))); - ADDCMD((ID_VIEW_PLAYLIST, '7', FVIRTKEY|FCONTROL|FNOINVERT, _T("Toggle Playlist Bar"))); - ADDCMD((ID_VIEW_CAPTURE, '8', FVIRTKEY|FCONTROL|FNOINVERT, _T("Toggle Capture Bar"))); - ADDCMD((ID_VIEW_SHADEREDITOR, '9', FVIRTKEY|FCONTROL|FNOINVERT, _T("Toggle Shader Editor Bar"))); - ADDCMD((ID_VIEW_PRESETS_MINIMAL, '1', FVIRTKEY|FNOINVERT, _T("View Minimal"))); - ADDCMD((ID_VIEW_PRESETS_COMPACT, '2', FVIRTKEY|FNOINVERT, _T("View Compact"))); - ADDCMD((ID_VIEW_PRESETS_NORMAL, '3', FVIRTKEY|FNOINVERT, _T("View Normal"))); - ADDCMD((ID_VIEW_FULLSCREEN, VK_RETURN, FVIRTKEY|FALT|FNOINVERT, _T("Fullscreen"), 0, wmcmd::LDBLCLK)); - ADDCMD((ID_VIEW_FULLSCREEN_SECONDARY, VK_F11, FVIRTKEY|FNOINVERT, _T("Fullscreen (w/o res.change)"))); - ADDCMD((ID_VIEW_ZOOM_50, '1', FVIRTKEY|FALT|FNOINVERT, _T("Zoom 50%"))); - ADDCMD((ID_VIEW_ZOOM_100, '2', FVIRTKEY|FALT|FNOINVERT, _T("Zoom 100%"))); - ADDCMD((ID_VIEW_ZOOM_200, '3', FVIRTKEY|FALT|FNOINVERT, _T("Zoom 200%"))); - ADDCMD((ID_VIEW_ZOOM_AUTOFIT, '4', FVIRTKEY|FALT|FNOINVERT, _T("Zoom Auto Fit"))); - ADDCMD((ID_ASPECTRATIO_NEXT, 0, FVIRTKEY|FNOINVERT, _T("Next AR Preset"))); - ADDCMD((ID_VIEW_VF_HALF, 0, FVIRTKEY|FNOINVERT, _T("VidFrm Half"))); - ADDCMD((ID_VIEW_VF_NORMAL, 0, FVIRTKEY|FNOINVERT, _T("VidFrm Normal"))); - ADDCMD((ID_VIEW_VF_DOUBLE, 0, FVIRTKEY|FNOINVERT, _T("VidFrm Double"))); - ADDCMD((ID_VIEW_VF_STRETCH, 0, FVIRTKEY|FNOINVERT, _T("VidFrm Stretch"))); - ADDCMD((ID_VIEW_VF_FROMINSIDE, 0, FVIRTKEY|FNOINVERT, _T("VidFrm Inside"))); - ADDCMD((ID_VIEW_VF_FROMOUTSIDE, 0, FVIRTKEY|FNOINVERT, _T("VidFrm Outside"))); - ADDCMD((ID_ONTOP_ALWAYS, 'T', FVIRTKEY|FCONTROL|FNOINVERT, _T("Always On Top"))); - ADDCMD((ID_VIEW_RESET, VK_NUMPAD5, FVIRTKEY|FNOINVERT, _T("PnS Reset"))); - ADDCMD((ID_VIEW_INCSIZE, VK_NUMPAD9, FVIRTKEY|FNOINVERT, _T("PnS Inc Size"))); - ADDCMD((ID_VIEW_INCWIDTH, VK_NUMPAD6, FVIRTKEY|FNOINVERT, _T("PnS Inc Width"))); - ADDCMD((ID_VIEW_INCHEIGHT, VK_NUMPAD8, FVIRTKEY|FNOINVERT, _T("PnS Inc Height"))); - ADDCMD((ID_VIEW_DECSIZE, VK_NUMPAD1, FVIRTKEY|FNOINVERT, _T("PnS Dec Size"))); - ADDCMD((ID_VIEW_DECWIDTH, VK_NUMPAD4, FVIRTKEY|FNOINVERT, _T("PnS Dec Width"))); - ADDCMD((ID_VIEW_DECHEIGHT, VK_NUMPAD2, FVIRTKEY|FNOINVERT, _T("PnS Dec Height"))); - ADDCMD((ID_PANSCAN_CENTER, VK_NUMPAD5, FVIRTKEY|FCONTROL|FNOINVERT, _T("PnS Center"))); - ADDCMD((ID_PANSCAN_MOVELEFT, VK_NUMPAD4, FVIRTKEY|FCONTROL|FNOINVERT, _T("PnS Left"))); - ADDCMD((ID_PANSCAN_MOVERIGHT, VK_NUMPAD6, FVIRTKEY|FCONTROL|FNOINVERT, _T("PnS Right"))); - ADDCMD((ID_PANSCAN_MOVEUP, VK_NUMPAD8, FVIRTKEY|FCONTROL|FNOINVERT, _T("PnS Up"))); - ADDCMD((ID_PANSCAN_MOVEDOWN, VK_NUMPAD2, FVIRTKEY|FCONTROL|FNOINVERT, _T("PnS Down"))); - ADDCMD((ID_PANSCAN_MOVEUPLEFT, VK_NUMPAD7, FVIRTKEY|FCONTROL|FNOINVERT, _T("PnS Up/Left"))); - ADDCMD((ID_PANSCAN_MOVEUPRIGHT, VK_NUMPAD9, FVIRTKEY|FCONTROL|FNOINVERT, _T("PnS Up/Right"))); - ADDCMD((ID_PANSCAN_MOVEDOWNLEFT, VK_NUMPAD1, FVIRTKEY|FCONTROL|FNOINVERT, _T("PnS Down/Left"))); - ADDCMD((ID_PANSCAN_MOVEDOWNRIGHT, VK_NUMPAD3, FVIRTKEY|FCONTROL|FNOINVERT, _T("PnS Down/Right"))); - ADDCMD((ID_PANSCAN_ROTATEXP, VK_NUMPAD8, FVIRTKEY|FALT|FNOINVERT, _T("PnS Rotate X+"))); - ADDCMD((ID_PANSCAN_ROTATEXM, VK_NUMPAD2, FVIRTKEY|FALT|FNOINVERT, _T("PnS Rotate X-"))); - ADDCMD((ID_PANSCAN_ROTATEYP, VK_NUMPAD4, FVIRTKEY|FALT|FNOINVERT, _T("PnS Rotate Y+"))); - ADDCMD((ID_PANSCAN_ROTATEYM, VK_NUMPAD6, FVIRTKEY|FALT|FNOINVERT, _T("PnS Rotate Y-"))); - ADDCMD((ID_PANSCAN_ROTATEZP, VK_NUMPAD1, FVIRTKEY|FALT|FNOINVERT, _T("PnS Rotate Z+"))); - ADDCMD((ID_PANSCAN_ROTATEZM, VK_NUMPAD3, FVIRTKEY|FALT|FNOINVERT, _T("PnS Rotate Z-"))); - ADDCMD((ID_VOLUME_UP, VK_UP, FVIRTKEY|FNOINVERT, _T("Volume Up"), APPCOMMAND_VOLUME_UP, wmcmd::WUP)); - ADDCMD((ID_VOLUME_DOWN, VK_DOWN, FVIRTKEY|FNOINVERT, _T("Volume Down"), APPCOMMAND_VOLUME_DOWN, wmcmd::WDOWN)); - ADDCMD((ID_VOLUME_MUTE, 'M', FVIRTKEY|FCONTROL|FNOINVERT, _T("Volume Mute"), APPCOMMAND_VOLUME_MUTE)); - ADDCMD((ID_VOLUME_BOOST_INC, 0, FVIRTKEY|FNOINVERT, _T("Volume Boost Increase"))); - ADDCMD((ID_VOLUME_BOOST_DEC, 0, FVIRTKEY|FNOINVERT, _T("Volume Boost Decrease"))); - ADDCMD((ID_VOLUME_BOOST_MIN, 0, FVIRTKEY|FNOINVERT, _T("Volume Boost Min"))); - ADDCMD((ID_VOLUME_BOOST_MAX, 0, FVIRTKEY|FNOINVERT, _T("Volume Boost Max"))); - ADDCMD((ID_NAVIGATE_TITLEMENU, 0, FVIRTKEY|FNOINVERT, _T("DVD Title Menu"))); - ADDCMD((ID_NAVIGATE_ROOTMENU, 0, FVIRTKEY|FNOINVERT, _T("DVD Root Menu"))); - ADDCMD((ID_NAVIGATE_SUBPICTUREMENU, 0, FVIRTKEY|FNOINVERT, _T("DVD Subtitle Menu"))); - ADDCMD((ID_NAVIGATE_AUDIOMENU, 0, FVIRTKEY|FNOINVERT, _T("DVD Audio Menu"))); - ADDCMD((ID_NAVIGATE_ANGLEMENU, 0, FVIRTKEY|FNOINVERT, _T("DVD Angle Menu"))); - ADDCMD((ID_NAVIGATE_CHAPTERMENU, 0, FVIRTKEY|FNOINVERT, _T("DVD Chapter Menu"))); - ADDCMD((ID_NAVIGATE_MENU_LEFT, 0, FVIRTKEY|FNOINVERT, _T("DVD Menu Left"))); - ADDCMD((ID_NAVIGATE_MENU_RIGHT, 0, FVIRTKEY|FNOINVERT, _T("DVD Menu Right"))); - ADDCMD((ID_NAVIGATE_MENU_UP, 0, FVIRTKEY|FNOINVERT, _T("DVD Menu Up"))); - ADDCMD((ID_NAVIGATE_MENU_DOWN, 0, FVIRTKEY|FNOINVERT, _T("DVD Menu Down"))); - ADDCMD((ID_NAVIGATE_MENU_ACTIVATE, 0, FVIRTKEY|FNOINVERT, _T("DVD Menu Activate"))); - ADDCMD((ID_NAVIGATE_MENU_BACK, 0, FVIRTKEY|FNOINVERT, _T("DVD Menu Back"))); - ADDCMD((ID_NAVIGATE_MENU_LEAVE, 0, FVIRTKEY|FNOINVERT, _T("DVD Menu Leave"))); - ADDCMD((ID_BOSS, 'B', FVIRTKEY|FNOINVERT, _T("Boss key"))); - ADDCMD((ID_MENU_PLAYER_SHORT, 0, FVIRTKEY|FNOINVERT, _T("Player Menu (short)"), 0, wmcmd::RUP)); - ADDCMD((ID_MENU_PLAYER_LONG, 0, FVIRTKEY|FNOINVERT, _T("Player Menu (long)"))); - ADDCMD((ID_MENU_FILTERS, 0, FVIRTKEY|FNOINVERT, _T("Filters Menu"))); - ADDCMD((ID_VIEW_OPTIONS, 'O', FVIRTKEY|FNOINVERT, _T("Options"))); - ADDCMD((ID_STREAM_AUDIO_NEXT, 'A', FVIRTKEY|FNOINVERT, _T("Next Audio"))); - ADDCMD((ID_STREAM_AUDIO_PREV, 'A', FVIRTKEY|FSHIFT|FNOINVERT, _T("Prev Audio"))); - ADDCMD((ID_STREAM_SUB_NEXT, 'S', FVIRTKEY|FNOINVERT, _T("Next Subtitle"))); - ADDCMD((ID_STREAM_SUB_PREV, 'S', FVIRTKEY|FSHIFT|FNOINVERT, _T("Prev Subtitle"))); - ADDCMD((ID_STREAM_SUB_ONOFF, 'W', FVIRTKEY|FNOINVERT, _T("On/Off Subtitle"))); - ADDCMD((ID_SUBTITLES_SUBITEM_START+2, 0, FVIRTKEY|FNOINVERT, _T("Reload Subtitles"))); - ADDCMD((ID_OGM_AUDIO_NEXT, 0, FVIRTKEY|FNOINVERT, _T("Next Audio (OGM)"))); - ADDCMD((ID_OGM_AUDIO_PREV, 0, FVIRTKEY|FNOINVERT, _T("Prev Audio (OGM)"))); - ADDCMD((ID_OGM_SUB_NEXT, 0, FVIRTKEY|FNOINVERT, _T("Next Subtitle (OGM)"))); - ADDCMD((ID_OGM_SUB_PREV, 0, FVIRTKEY|FNOINVERT, _T("Prev Subtitle (OGM)"))); - ADDCMD((ID_DVD_ANGLE_NEXT, 0, FVIRTKEY|FNOINVERT, _T("Next Angle (DVD)"))); - ADDCMD((ID_DVD_ANGLE_PREV, 0, FVIRTKEY|FNOINVERT, _T("Prev Angle (DVD)"))); - ADDCMD((ID_DVD_AUDIO_NEXT, 0, FVIRTKEY|FNOINVERT, _T("Next Audio (DVD)"))); - ADDCMD((ID_DVD_AUDIO_PREV, 0, FVIRTKEY|FNOINVERT, _T("Prev Audio (DVD)"))); - ADDCMD((ID_DVD_SUB_NEXT, 0, FVIRTKEY|FNOINVERT, _T("Next Subtitle (DVD)"))); - ADDCMD((ID_DVD_SUB_PREV, 0, FVIRTKEY|FNOINVERT, _T("Prev Subtitle (DVD)"))); - ADDCMD((ID_DVD_SUB_ONOFF, 0, FVIRTKEY|FNOINVERT, _T("On/Off Subtitle (DVD)"))); - ADDCMD((ID_SUB_DELAY_DOWN, VK_F1, FVIRTKEY|FNOINVERT, _T("Subtitle Delay -"))); - ADDCMD((ID_SUB_DELAY_UP, VK_F2, FVIRTKEY|FNOINVERT, _T("Subtitle Delay +"))); -#undef ADDCMD -} - -CMPlayerCApp::Settings::~Settings() -{ - if(hAccel) - DestroyAcceleratorTable(hAccel); -} - -void CMPlayerCApp::Settings::UpdateData(bool fSave) -{ - CWinApp* pApp = AfxGetApp(); - ASSERT(pApp); - - UINT len; - BYTE* ptr = NULL; - - if(fSave) - { - if(!fInitialized) return; - - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_HIDECAPTIONMENU), fHideCaptionMenu); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_CONTROLSTATE), nCS); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_DEFAULTVIDEOFRAME), iDefaultVideoSize); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_KEEPASPECTRATIO), fKeepAspectRatio); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_COMPMONDESKARDIFF), fCompMonDeskARDiff); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_VOLUME), nVolume); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_BALANCE), nBalance); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_MUTE), fMute); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_LOOPNUM), nLoops); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_LOOP), fLoopForever); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_REWIND), fRewind); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_ZOOM), iZoomLevel); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_MULTIINST), fAllowMultipleInst); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_TITLEBARTEXTSTYLE), iTitleBarTextStyle); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_TITLEBARTEXTTITLE), fTitleBarTextTitle); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_ONTOP), iOnTop); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_TRAYICON), fTrayIcon); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_AUTOZOOM), fRememberZoomLevel); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_FULLSCREENCTRLS), fShowBarsWhenFullScreen); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_FULLSCREENCTRLSTIMEOUT), nShowBarsWhenFullScreenTimeOut); - pApp->WriteProfileBinary(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_FULLSCREENRES), (BYTE*)&dmFullscreenRes, sizeof(dmFullscreenRes)); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_EXITFULLSCREENATTHEEND), fExitFullScreenAtTheEnd); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_REMEMBERWINDOWPOS), fRememberWindowPos); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_REMEMBERWINDOWSIZE), fRememberWindowSize); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_SNAPTODESKTOPEDGES), fSnapToDesktopEdges); - pApp->WriteProfileBinary(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_LASTWINDOWRECT), (BYTE*)&rcLastWindowPos, sizeof(rcLastWindowPos)); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_LASTWINDOWTYPE), lastWindowType); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_ASPECTRATIO_X), AspectRatio.cx); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_ASPECTRATIO_Y), AspectRatio.cy); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_KEEPHISTORY), fKeepHistory); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_DSVIDEORENDERERTYPE), iDSVideoRendererType); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_RMVIDEORENDERERTYPE), iRMVideoRendererType); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_QTVIDEORENDERERTYPE), iQTVideoRendererType); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_APSURACEFUSAGE), iAPSurfaceUsage); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_VMRSYNCFIX), fVMRSyncFix); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_DX9_RESIZER), iDX9Resizer); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_VMR9MIXERMODE), fVMR9MixerMode); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_VMR9MIXERYUV), fVMR9MixerYUV); - pApp->WriteProfileString(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_AUDIORENDERERTYPE), CString(AudioRendererDisplayName)); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_AUTOLOADAUDIO), fAutoloadAudio); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_AUTOLOADSUBTITLES), fAutoloadSubtitles); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_BLOCKVSFILTER), fBlockVSFilter); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_ENABLEWORKERTHREADFOROPENING), fEnableWorkerThreadForOpening); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_REPORTFAILEDPINS), fReportFailedPins); - pApp->WriteProfileString(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_DVDPATH), sDVDPath); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_USEDVDPATH), fUseDVDPath); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_MENULANG), idMenuLang); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_AUDIOLANG), idAudioLang); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_SUBTITLESLANG), idSubtitlesLang); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_AUTOSPEAKERCONF), fAutoSpeakerConf); - CString style; - pApp->WriteProfileString(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_SPLOGFONT), style <<= subdefstyle); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_SPOVERRIDEPLACEMENT), fOverridePlacement); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_SPHORPOS), nHorPos); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_SPVERPOS), nVerPos); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_SPCSIZE), nSPCSize); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_SPCMAXRES), nSPCMaxRes); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_SUBDELAYINTERVAL), nSubDelayInterval); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_POW2TEX), fSPCPow2Tex); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_ENABLESUBTITLES), fEnableSubtitles); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_ENABLEAUDIOSWITCHER), fEnableAudioSwitcher); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_ENABLEAUDIOTIMESHIFT), fAudioTimeShift); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_AUDIOTIMESHIFT), tAudioTimeShift); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_DOWNSAMPLETO441), fDownSampleTo441); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_CUSTOMCHANNELMAPPING), fCustomChannelMapping); - pApp->WriteProfileBinary(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_SPEAKERTOCHANNELMAPPING), (BYTE*)pSpeakerToChannelMap, sizeof(pSpeakerToChannelMap)); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_AUDIONORMALIZE), fAudioNormalize); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_AUDIONORMALIZERECOVER), fAudioNormalizeRecover); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_AUDIOBOOST), (int)AudioBoost); - - pApp->WriteProfileString(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_SHADERLIST), strShaderList); - - { - for(int i = 0; ; i++) - { - CString key; - key.Format(_T("%s\\%04d"), ResStr(IDS_R_FILTERS), i); - int j = pApp->GetProfileInt(key, _T("Enabled"), -1); - pApp->WriteProfileString(key, NULL, NULL); - if(j < 0) break; - } - pApp->WriteProfileString(ResStr(IDS_R_FILTERS), NULL, NULL); - - POSITION pos = filters.GetHeadPosition(); - for(int i = 0; pos; i++) - { - FilterOverride* f = filters.GetNext(pos); - - if(f->fTemporary) - continue; - - CString key; - key.Format(_T("%s\\%04d"), ResStr(IDS_R_FILTERS), i); - - pApp->WriteProfileInt(key, _T("SourceType"), (int)f->type); - pApp->WriteProfileInt(key, _T("Enabled"), (int)!f->fDisabled); - if(f->type == FilterOverride::REGISTERED) - { - pApp->WriteProfileString(key, _T("DisplayName"), CString(f->dispname)); - pApp->WriteProfileString(key, _T("Name"), f->name); - } - else if(f->type == FilterOverride::EXTERNAL) - { - pApp->WriteProfileString(key, _T("Path"), f->path); - pApp->WriteProfileString(key, _T("Name"), f->name); - pApp->WriteProfileString(key, _T("CLSID"), CStringFromGUID(f->clsid)); - } - POSITION pos2 = f->backup.GetHeadPosition(); - for(int i = 0; pos2; i++) - { - CString val; - val.Format(_T("org%04d"), i); - pApp->WriteProfileString(key, val, CStringFromGUID(f->backup.GetNext(pos2))); - } - pos2 = f->guids.GetHeadPosition(); - for(int i = 0; pos2; i++) - { - CString val; - val.Format(_T("mod%04d"), i); - pApp->WriteProfileString(key, val, CStringFromGUID(f->guids.GetNext(pos2))); - } - pApp->WriteProfileInt(key, _T("LoadType"), f->iLoadType); - pApp->WriteProfileInt(key, _T("Merit"), f->dwMerit); - } - } - - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_INTREALMEDIA), fIntRealMedia); - // pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_REALMEDIARENDERLESS), fRealMediaRenderless); - // pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_QUICKTIMERENDERER), iQuickTimeRenderer); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_REALMEDIAFPS), *((DWORD*)&RealMediaQuickTimeFPS)); - - pApp->WriteProfileString(ResStr(IDS_R_SETTINGS) + _T("\\") + ResStr(IDS_RS_PNSPRESETS), NULL, NULL); - for(int i = 0, j = m_pnspresets.GetCount(); i < j; i++) - { - CString str; - str.Format(_T("Preset%d"), i); - pApp->WriteProfileString(ResStr(IDS_R_SETTINGS) + _T("\\") + ResStr(IDS_RS_PNSPRESETS), str, m_pnspresets[i]); - } - - pApp->WriteProfileString(ResStr(IDS_R_COMMANDS), NULL, NULL); - POSITION pos = wmcmds.GetHeadPosition(); - for(int i = 0; pos; ) - { - wmcmd& wc = wmcmds.GetNext(pos); - if(wc.IsModified()) - { - CString str; - str.Format(_T("CommandMod%d"), i); - CString str2; - str2.Format(_T("%d %x %x %s %d %d %d"), - wc.cmd, wc.fVirt, wc.key, - _T("\"") + CString(wc.rmcmd) + _T("\""), wc.rmrepcnt, - wc.mouse, wc.appcmd); - pApp->WriteProfileString(ResStr(IDS_R_COMMANDS), str, str2); - i++; - } - } - - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_WINLIRC), fWinLirc); - pApp->WriteProfileString(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_WINLIRCADDR), WinLircAddr); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_UICE), fUIce); - pApp->WriteProfileString(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_UICEADDR), UIceAddr); - - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_DISABLEXPTOOLBARS), fDisabeXPToolbars); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_USEWMASFREADER), fUseWMASFReader); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_JUMPDISTS), nJumpDistS); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_JUMPDISTM), nJumpDistM); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_JUMPDISTL), nJumpDistL); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_FREEWINDOWRESIZING), fFreeWindowResizing); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_NOTIFYMSN), fNotifyMSN); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_NOTIFYGTSDLL), fNotifyGTSdll); - - Formats.UpdateData(true); - - pApp->WriteProfileInt(ResStr(IDS_R_INTERNAL_FILTERS), ResStr(IDS_RS_SRCFILTERS), SrcFilters|~(SRC_LAST-1)); - pApp->WriteProfileInt(ResStr(IDS_R_INTERNAL_FILTERS), ResStr(IDS_RS_TRAFILTERS), TraFilters|~(TRA_LAST-1)); - - pApp->WriteProfileString(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_LOGOFILE), logofn); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_LOGOID), logoid); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_LOGOEXT), logoext); - - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_HIDECDROMSSUBMENU), fHideCDROMsSubMenu); - - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_PRIORITY), priority); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_LAUNCHFULLSCREEN), launchfullscreen); - - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_ENABLEWEBSERVER), fEnableWebServer); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_WEBSERVERPORT), nWebServerPort); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_WEBSERVERPRINTDEBUGINFO), fWebServerPrintDebugInfo); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_WEBSERVERUSECOMPRESSION), fWebServerUseCompression); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_WEBSERVERLOCALHOSTONLY), fWebServerLocalhostOnly); - pApp->WriteProfileString(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_WEBROOT), WebRoot); - pApp->WriteProfileString(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_WEBDEFINDEX), WebDefIndex); - pApp->WriteProfileString(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_WEBSERVERCGI), WebServerCGI); - - pApp->WriteProfileString(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_SNAPSHOTPATH), SnapShotPath); - pApp->WriteProfileString(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_SNAPSHOTEXT), SnapShotExt); - - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_THUMBROWS), ThumbRows); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_THUMBCOLS), ThumbCols); - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_THUMBWIDTH), ThumbWidth); - - pApp->WriteProfileString(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_ISDB), ISDb); - - pApp->WriteProfileString(_T("Shaders"), NULL, NULL); - pApp->WriteProfileInt(_T("Shaders"), _T("Initialized"), 1); - pApp->WriteProfileString(_T("Shaders"), _T("Combine"), m_shadercombine); - - pos = m_shaders.GetHeadPosition(); - for(int i = 0; pos; i++) - { - const Shader& s = m_shaders.GetNext(pos); - - if(!s.label.IsEmpty()) - { - CString index; - index.Format(_T("%d"), i); - CString srcdata = s.srcdata; - srcdata.Replace(_T("\r"), _T("")); - srcdata.Replace(_T("\n"), _T("\\n")); - srcdata.Replace(_T("\t"), _T("\\t")); - AfxGetApp()->WriteProfileString(_T("Shaders"), index, s.label + _T("|") + s.target + _T("|") + srcdata); - } - } - - if(pApp->m_pszRegistryKey) - { - // WINBUG: on win2k this would crash WritePrivateProfileString - pApp->WriteProfileInt(_T(""), _T(""), pApp->GetProfileInt(_T(""), _T(""), 0)?0:1); - } - } - else - { - if(fInitialized) return; - - OSVERSIONINFO vi; - vi.dwOSVersionInfoSize = sizeof(vi); - GetVersionEx(&vi); - fXpOrBetter = (vi.dwMajorVersion >= 5 && vi.dwMinorVersion >= 1 || vi.dwMajorVersion >= 6); - - iDXVer = 0; - CRegKey dxver; - if(ERROR_SUCCESS == dxver.Open(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Microsoft\\DirectX"), KEY_READ)) - { - CString str; - ULONG len = 64; - if(ERROR_SUCCESS == dxver.QueryStringValue(_T("Version"), str.GetBuffer(len), &len)) - { - str.ReleaseBuffer(len); - int ver[4]; - _stscanf(str, _T("%d.%d.%d.%d"), ver+0, ver+1, ver+2, ver+3); - iDXVer = ver[1]; - } - } - - fHideCaptionMenu = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_HIDECAPTIONMENU), 0); - nCS = pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_CONTROLSTATE), CS_SEEKBAR|CS_TOOLBAR|CS_STATUSBAR); - iDefaultVideoSize = pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_DEFAULTVIDEOFRAME), DVS_FROMINSIDE); - fKeepAspectRatio = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_KEEPASPECTRATIO), TRUE); - fCompMonDeskARDiff = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_COMPMONDESKARDIFF), FALSE); - nVolume = pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_VOLUME), 100); - nBalance = pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_BALANCE), 0); - fMute = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_MUTE), 0); - nLoops = pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_LOOPNUM), 1); - fLoopForever = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_LOOP), 0); - fRewind = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_REWIND), FALSE); - iZoomLevel = pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_ZOOM), 1); - iDSVideoRendererType = pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_DSVIDEORENDERERTYPE), (IsVistaOrAbove() ? VIDRNDT_DS_VMR9RENDERLESS : VIDRNDT_DS_OVERLAYMIXER) ); - iRMVideoRendererType = pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_RMVIDEORENDERERTYPE), VIDRNDT_RM_DEFAULT); - iQTVideoRendererType = pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_QTVIDEORENDERERTYPE), VIDRNDT_QT_DEFAULT); - iAPSurfaceUsage = pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_APSURACEFUSAGE), VIDRNDT_AP_TEXTURE2D); - fVMRSyncFix = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_VMRSYNCFIX), FALSE); - iDX9Resizer = pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_DX9_RESIZER), 1); - fVMR9MixerMode = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_VMR9MIXERMODE), TRUE); - fVMR9MixerYUV = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_VMR9MIXERYUV), FALSE); - AudioRendererDisplayName = pApp->GetProfileString(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_AUDIORENDERERTYPE), _T("")); - fAutoloadAudio = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_AUTOLOADAUDIO), TRUE); - fAutoloadSubtitles = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_AUTOLOADSUBTITLES), IsVistaOrAbove() || !IsVSFilterInstalled() ); - fBlockVSFilter = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_BLOCKVSFILTER), TRUE); - fEnableWorkerThreadForOpening = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_ENABLEWORKERTHREADFOROPENING), TRUE); - fReportFailedPins = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_REPORTFAILEDPINS), TRUE); - fAllowMultipleInst = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_MULTIINST), 0); - iTitleBarTextStyle = pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_TITLEBARTEXTSTYLE), 1); - fTitleBarTextTitle = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_TITLEBARTEXTTITLE), FALSE); - iOnTop = pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_ONTOP), 0); - fTrayIcon = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_TRAYICON), 0); - fRememberZoomLevel = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_AUTOZOOM), 1); - fShowBarsWhenFullScreen = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_FULLSCREENCTRLS), 1); - nShowBarsWhenFullScreenTimeOut = pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_FULLSCREENCTRLSTIMEOUT), 0); - if(pApp->GetProfileBinary(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_FULLSCREENRES), &ptr, &len)) - { - memcpy(&dmFullscreenRes, ptr, sizeof(dmFullscreenRes)); - delete [] ptr; - } - else - { - dmFullscreenRes.fValid = false; - } - fExitFullScreenAtTheEnd = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_EXITFULLSCREENATTHEEND), 1); - fRememberWindowPos = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_REMEMBERWINDOWPOS), 0); - fRememberWindowSize = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_REMEMBERWINDOWSIZE), 0); - fSnapToDesktopEdges = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_SNAPTODESKTOPEDGES), 0); - AspectRatio.cx = pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_ASPECTRATIO_X), 0); - AspectRatio.cy = pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_ASPECTRATIO_Y), 0); - fKeepHistory = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_KEEPHISTORY), 0); - if(pApp->GetProfileBinary(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_LASTWINDOWRECT), &ptr, &len)) - { - memcpy(&rcLastWindowPos, ptr, sizeof(rcLastWindowPos)); - delete [] ptr; - } - else - { - fRememberWindowPos = false; - } - lastWindowType = pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_LASTWINDOWTYPE), SIZE_RESTORED); - sDVDPath = pApp->GetProfileString(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_DVDPATH), _T("")); - fUseDVDPath = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_USEDVDPATH), 0); - idMenuLang = pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_MENULANG), ::GetUserDefaultLCID()); - idAudioLang = pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_AUDIOLANG), ::GetUserDefaultLCID()); - idSubtitlesLang = pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_SUBTITLESLANG), ::GetUserDefaultLCID()); - fAutoSpeakerConf = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_AUTOSPEAKERCONF), 1); - // TODO: rename subdefstyle -> defStyle, IDS_RS_SPLOGFONT -> IDS_RS_SPSTYLE - subdefstyle <<= pApp->GetProfileString(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_SPLOGFONT), _T("")); - fOverridePlacement = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_SPOVERRIDEPLACEMENT), 0); - nHorPos = pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_SPHORPOS), 50); - nVerPos = pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_SPVERPOS), 90); - nSPCSize = pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_SPCSIZE), 3); - nSPCMaxRes = pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_SPCMAXRES), 2); - nSubDelayInterval = pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_SUBDELAYINTERVAL), 500); - fSPCPow2Tex = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_POW2TEX), TRUE); - fEnableSubtitles = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_ENABLESUBTITLES), TRUE); - fEnableAudioSwitcher = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_ENABLEAUDIOSWITCHER), TRUE); - fAudioTimeShift = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_ENABLEAUDIOTIMESHIFT), 0); - tAudioTimeShift = pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_AUDIOTIMESHIFT), 0); - fDownSampleTo441 = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_DOWNSAMPLETO441), 0); - fCustomChannelMapping = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_CUSTOMCHANNELMAPPING), 0); - if(pApp->GetProfileBinary(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_SPEAKERTOCHANNELMAPPING), &ptr, &len)) - { - memcpy(pSpeakerToChannelMap, ptr, sizeof(pSpeakerToChannelMap)); - delete [] ptr; - } - else - { - memset(pSpeakerToChannelMap, 0, sizeof(pSpeakerToChannelMap)); - for(int j = 0; j < 18; j++) - for(int i = 0; i <= j; i++) - pSpeakerToChannelMap[j][i] = 1<GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_AUDIONORMALIZE), FALSE); - fAudioNormalizeRecover = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_AUDIONORMALIZERECOVER), TRUE); - AudioBoost = pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_AUDIOBOOST), 1); - - { - for(int i = 0; ; i++) - { - CString key; - key.Format(_T("%s\\%04d"), ResStr(IDS_R_FILTERS), i); - - CAutoPtr f(new FilterOverride); - - f->fDisabled = !pApp->GetProfileInt(key, _T("Enabled"), 0); - - UINT j = pApp->GetProfileInt(key, _T("SourceType"), -1); - if(j == 0) - { - f->type = FilterOverride::REGISTERED; - f->dispname = CStringW(pApp->GetProfileString(key, _T("DisplayName"), _T(""))); - f->name = pApp->GetProfileString(key, _T("Name"), _T("")); - } - else if(j == 1) - { - f->type = FilterOverride::EXTERNAL; - f->path = pApp->GetProfileString(key, _T("Path"), _T("")); - f->name = pApp->GetProfileString(key, _T("Name"), _T("")); - f->clsid = GUIDFromCString(pApp->GetProfileString(key, _T("CLSID"), _T(""))); - } - else - { - pApp->WriteProfileString(key, NULL, 0); - break; - } - - f->backup.RemoveAll(); - for(int i = 0; ; i++) - { - CString val; - val.Format(_T("org%04d"), i); - CString guid = pApp->GetProfileString(key, val, _T("")); - if(guid.IsEmpty()) break; - f->backup.AddTail(GUIDFromCString(guid)); - } - - f->guids.RemoveAll(); - for(int i = 0; ; i++) - { - CString val; - val.Format(_T("mod%04d"), i); - CString guid = pApp->GetProfileString(key, val, _T("")); - if(guid.IsEmpty()) break; - f->guids.AddTail(GUIDFromCString(guid)); - } - - f->iLoadType = (int)pApp->GetProfileInt(key, _T("LoadType"), -1); - if(f->iLoadType < 0) break; - - f->dwMerit = pApp->GetProfileInt(key, _T("Merit"), MERIT_DO_NOT_USE+1); - - filters.AddTail(f); - } - } - - fIntRealMedia = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_INTREALMEDIA), 0); - //fRealMediaRenderless = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_REALMEDIARENDERLESS), 0); - //iQuickTimeRenderer = pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_QUICKTIMERENDERER), 2); - RealMediaQuickTimeFPS = 25.0; - *((DWORD*)&RealMediaQuickTimeFPS) = pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_REALMEDIAFPS), *((DWORD*)&RealMediaQuickTimeFPS)); - - m_pnspresets.RemoveAll(); - for(int i = 0; i < (ID_PANNSCAN_PRESETS_END - ID_PANNSCAN_PRESETS_START); i++) - { - CString str; - str.Format(_T("Preset%d"), i); - str = pApp->GetProfileString(ResStr(IDS_R_SETTINGS) + _T("\\") + ResStr(IDS_RS_PNSPRESETS), str, _T("")); - if(str.IsEmpty()) break; - m_pnspresets.Add(str); - } - if(m_pnspresets.IsEmpty()) - { - double _4p3 = 4.0/3.0; - double _16p9 = 16.0/9.0; - double _185p1 = 1.85/1.0; - double _235p1 = 2.35/1.0; - - CString str; - str.Format(_T("Scale to 16:9 TV,%.3f,%.3f,%.3f,%.3f"), 0.5, 0.5, _4p3/_4p3, _16p9/_4p3); - m_pnspresets.Add(str); - str.Format(_T("Zoom To Widescreen,%.3f,%.3f,%.3f,%.3f"), 0.5, 0.5, _16p9/_4p3, _16p9/_4p3); - m_pnspresets.Add(str); - str.Format(_T("Zoom To Ultra-Widescreen,%.3f,%.3f,%.3f,%.3f"), 0.5, 0.5, _235p1/_4p3, _235p1/_4p3); - m_pnspresets.Add(str); - } - - for(int i = 0; i < wmcmds.GetCount(); i++) - { - CString str; - str.Format(_T("CommandMod%d"), i); - str = pApp->GetProfileString(ResStr(IDS_R_COMMANDS), str, _T("")); - if(str.IsEmpty()) break; - int cmd, fVirt, key, repcnt, mouse, appcmd; - TCHAR buff[128]; - int n; - if(5 > (n = _stscanf(str, _T("%d %x %x %s %d %d %d"), &cmd, &fVirt, &key, buff, &repcnt, &mouse, &appcmd))) - break; - if(POSITION pos = wmcmds.Find(cmd)) - { - wmcmd& wc = wmcmds.GetAt(pos); - wc.cmd = cmd; - wc.fVirt = fVirt; - wc.key = key; - if(n >= 6) wc.mouse = (UINT)mouse; - if(n >= 7) wc.appcmd = (UINT)appcmd; - wc.rmcmd = CStringA(buff).Trim('\"'); - wc.rmrepcnt = repcnt; - } - } - - CAtlArray pAccel; - pAccel.SetCount(wmcmds.GetCount()); - POSITION pos = wmcmds.GetHeadPosition(); - for(int i = 0; pos; i++) pAccel[i] = wmcmds.GetNext(pos); - hAccel = CreateAcceleratorTable(pAccel.GetData(), pAccel.GetCount()); - - WinLircAddr = pApp->GetProfileString(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_WINLIRCADDR), _T("127.0.0.1:8765")); - fWinLirc = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_WINLIRC), 0); - UIceAddr = pApp->GetProfileString(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_UICEADDR), _T("127.0.0.1:1234")); - fUIce = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_UICE), 0); - - fDisabeXPToolbars = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_DISABLEXPTOOLBARS), 0); - fUseWMASFReader = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_USEWMASFREADER), FALSE); - nJumpDistS = pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_JUMPDISTS), 1000); - nJumpDistM = pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_JUMPDISTM), 5000); - nJumpDistL = pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_JUMPDISTL), 20000); - fFreeWindowResizing = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_FREEWINDOWRESIZING), TRUE); - fNotifyMSN = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_NOTIFYMSN), FALSE); - fNotifyGTSdll = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_NOTIFYGTSDLL), FALSE); - - Formats.UpdateData(false); - - SrcFilters = pApp->GetProfileInt(ResStr(IDS_R_INTERNAL_FILTERS), ResStr(IDS_RS_SRCFILTERS), ~0^SRC_MATROSKA^SRC_MP4^SRC_MPEG^SRC_OGG); - TraFilters = pApp->GetProfileInt(ResStr(IDS_R_INTERNAL_FILTERS), ResStr(IDS_RS_TRAFILTERS), ~0^TRA_MPEG1^TRA_AAC^TRA_AC3^TRA_DTS^TRA_LPCM^TRA_MPEG2^TRA_VORBIS); - - logofn = pApp->GetProfileString(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_LOGOFILE), _T("")); - logoid = pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_LOGOID), IDF_LOGO7); - logoext = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_LOGOEXT), 0); - - fHideCDROMsSubMenu = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_HIDECDROMSSUBMENU), 0); - - priority = pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_PRIORITY), NORMAL_PRIORITY_CLASS); - ::SetPriorityClass(::GetCurrentProcess(), priority); - launchfullscreen = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_LAUNCHFULLSCREEN), FALSE); - - fEnableWebServer = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_ENABLEWEBSERVER), FALSE); - nWebServerPort = pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_WEBSERVERPORT), 13579); - fWebServerPrintDebugInfo = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_WEBSERVERPRINTDEBUGINFO), FALSE); - fWebServerUseCompression = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_WEBSERVERUSECOMPRESSION), TRUE); - fWebServerLocalhostOnly = !!pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_WEBSERVERLOCALHOSTONLY), false); - WebRoot = pApp->GetProfileString(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_WEBROOT), _T("*./webroot")); - WebDefIndex = pApp->GetProfileString(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_WEBDEFINDEX), _T("index.html;index.php")); - WebServerCGI = pApp->GetProfileString(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_WEBSERVERCGI), _T("")); - - CString MyPictures; - - CRegKey key; - // grrrrr - // if(!SHGetSpecialFolderPath(NULL, MyPictures.GetBufferSetLength(MAX_PATH), CSIDL_MYPICTURES, TRUE)) MyPictures.Empty(); - // else MyPictures.ReleaseBuffer(); - if(ERROR_SUCCESS == key.Open(HKEY_CURRENT_USER, _T("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders"), KEY_READ)) - { - ULONG len = MAX_PATH; - if(ERROR_SUCCESS == key.QueryStringValue(_T("My Pictures"), MyPictures.GetBuffer(MAX_PATH), &len)) MyPictures.ReleaseBufferSetLength(len); - else MyPictures.Empty(); - } - SnapShotPath = pApp->GetProfileString(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_SNAPSHOTPATH), MyPictures); - SnapShotExt = pApp->GetProfileString(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_SNAPSHOTEXT), _T(".jpg")); - - ThumbRows = pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_THUMBROWS), 4); - ThumbCols = pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_THUMBCOLS), 4); - ThumbWidth = pApp->GetProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_THUMBWIDTH), 1024); - - ISDb = pApp->GetProfileString(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_ISDB), _T("www.opensubtitles.org/isdb")); - - pApp->WriteProfileInt(ResStr(IDS_R_SETTINGS), _T("LastUsedPage"), 0); - - // - - m_shaders.RemoveAll(); - - CAtlStringMap shaders; - - shaders[_T("16-235 -> 0-255")] = IDF_SHADER_LEVELS; - shaders[_T("contour")] = IDF_SHADER_CONTOUR; - shaders[_T("deinterlace (blend)")] = IDF_SHADER_DEINTERLACE; - shaders[_T("edge sharpen")] = IDF_SHADER_EDGE_SHARPEN; - shaders[_T("emboss")] = IDF_SHADER_EMBOSS; - shaders[_T("grayscale")] = IDF_SHADER_GRAYSCALE; - shaders[_T("invert")] = IDF_SHADER_INVERT; - shaders[_T("letterbox")] = IDF_SHADER_LETTERBOX; - shaders[_T("nightvision")] = IDF_SHADER_NIGHTVISION; - shaders[_T("procamp")] = IDF_SHADER_PROCAMP; - shaders[_T("sharpen")] = IDF_SHADER_SHARPEN; - shaders[_T("sharpen complex")] = IDF_SHADER_SHARPEN_COMPLEX; - shaders[_T("sphere")] = IDF_SHADER_SPHERE; - shaders[_T("spotlight")] = IDF_SHADER_SPOTLIGHT; - shaders[_T("wave")] = IDF_SHADER_WAVE; - - int iShader = 0; - - for(; ; iShader++) - { - CString str; - str.Format(_T("%d"), iShader); - str = pApp->GetProfileString(_T("Shaders"), str); - - CAtlList sl; - CString label = Explode(str, sl, '|'); - if(label.IsEmpty()) break; - if(sl.GetCount() < 3) continue; - - Shader s; - s.label = sl.RemoveHead(); - s.target = sl.RemoveHead(); - s.srcdata = sl.RemoveHead(); - s.srcdata.Replace(_T("\\n"), _T("\n")); - s.srcdata.Replace(_T("\\t"), _T("\t")); - m_shaders.AddTail(s); - - shaders.RemoveKey(s.label); - } - - pos = shaders.GetStartPosition(); - for(; pos; iShader++) - { - CAtlStringMap::CPair* pPair = shaders.GetNext(pos); - - CStringA srcdata; - if(LoadResource(pPair->m_value, srcdata, _T("FILE"))) - { - Shader s; - s.label = pPair->m_key; - s.target = _T("ps_2_0"); - s.srcdata = CString(srcdata); - m_shaders.AddTail(s); - } - } - - strShaderList = pApp->GetProfileString(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_SHADERLIST), _T("")); - - // TODO: sort shaders by label - - m_shadercombine = pApp->GetProfileString(_T("Shaders"), _T("Combine"), _T("")); - - fInitialized = true; - } -} - -void CMPlayerCApp::Settings::ParseCommandLine(CAtlList& cmdln) -{ - nCLSwitches = 0; - slFiles.RemoveAll(); - slDubs.RemoveAll(); - slSubs.RemoveAll(); - slFilters.RemoveAll(); - rtStart = 0; - fixedWindowSize.SetSize(0, 0); - iMonitor = 0; - - if(launchfullscreen) nCLSwitches |= CLSW_FULLSCREEN; - - POSITION pos = cmdln.GetHeadPosition(); - while(pos) - { - CString param = cmdln.GetNext(pos); - if(param.IsEmpty()) continue; - - if((param[0] == '-' || param[0] == '/') && param.GetLength() > 1) - { - CString sw = param.Mid(1).MakeLower(); - if(sw == _T("open")) nCLSwitches |= CLSW_OPEN; - else if(sw == _T("play")) nCLSwitches |= CLSW_PLAY; - else if(sw == _T("fullscreen")) nCLSwitches |= CLSW_FULLSCREEN; - else if(sw == _T("minimized")) nCLSwitches |= CLSW_MINIMIZED; - else if(sw == _T("new")) nCLSwitches |= CLSW_NEW; - else if(sw == _T("help") || sw == _T("h") || sw == _T("?")) nCLSwitches |= CLSW_HELP; - else if(sw == _T("dub") && pos) slDubs.AddTail(cmdln.GetNext(pos)); - else if(sw == _T("sub") && pos) slSubs.AddTail(cmdln.GetNext(pos)); - else if(sw == _T("filter") && pos) slFilters.AddTail(cmdln.GetNext(pos)); - else if(sw == _T("dvd")) nCLSwitches |= CLSW_DVD; - else if(sw == _T("cd")) nCLSwitches |= CLSW_CD; - else if(sw == _T("add")) nCLSwitches |= CLSW_ADD; - else if(sw == _T("regvid")) nCLSwitches |= CLSW_REGEXTVID; - else if(sw == _T("regaud")) nCLSwitches |= CLSW_REGEXTAUD; - else if(sw == _T("unregall")) nCLSwitches |= CLSW_UNREGEXT; - else if(sw == _T("unregvid")) nCLSwitches |= CLSW_UNREGEXT; /* keep for compatibility with old versions */ - else if(sw == _T("unregaud")) nCLSwitches |= CLSW_UNREGEXT; /* keep for compatibility with old versions */ - else if(sw == _T("start") && pos) {rtStart = 10000i64*_tcstol(cmdln.GetNext(pos), NULL, 10); nCLSwitches |= CLSW_STARTVALID;} - else if(sw == _T("startpos") && pos) {/* TODO: mm:ss. */;} - else if(sw == _T("nofocus")) nCLSwitches |= CLSW_NOFOCUS; - else if(sw == _T("close")) nCLSwitches |= CLSW_CLOSE; - else if(sw == _T("standby")) nCLSwitches |= CLSW_STANDBY; - else if(sw == _T("hibernate")) nCLSwitches |= CLSW_HIBERNATE; - else if(sw == _T("shutdown")) nCLSwitches |= CLSW_SHUTDOWN; - else if(sw == _T("logoff")) nCLSwitches |= CLSW_LOGOFF; - else if(sw == _T("fixedsize") && pos) - { - CAtlList sl; - Explode(cmdln.GetNext(pos), sl, ',', 2); - if(sl.GetCount() == 2) - { - fixedWindowSize.SetSize(_ttol(sl.GetHead()), _ttol(sl.GetTail())); - if(fixedWindowSize.cx > 0 && fixedWindowSize.cy > 0) - nCLSwitches |= CLSW_FIXEDSIZE; - } - } - else if(sw == _T("monitor") && pos) {iMonitor = _tcstol(cmdln.GetNext(pos), NULL, 10); nCLSwitches |= CLSW_MONITOR;} - else nCLSwitches |= CLSW_HELP|CLSW_UNRECOGNIZEDSWITCH; - } - else - { - slFiles.AddTail(param); - } - } -} - -void CMPlayerCApp::Settings::GetFav(favtype ft, CAtlList& sl) -{ - sl.RemoveAll(); - - CString root; - - switch(ft) - { - case FAV_FILE: root = ResStr(IDS_R_FAVFILES); break; - case FAV_DVD: root = ResStr(IDS_R_FAVDVDS); break; - case FAV_DEVICE: root = ResStr(IDS_R_FAVDEVICES); break; - default: return; - } - - for(int i = 0; ; i++) - { - CString s; - s.Format(_T("Name%d"), i); - s = AfxGetApp()->GetProfileString(root, s, NULL); - if(s.IsEmpty()) break; - sl.AddTail(s); - } -} - -void CMPlayerCApp::Settings::SetFav(favtype ft, CAtlList& sl) -{ - CString root; - - switch(ft) - { - case FAV_FILE: root = ResStr(IDS_R_FAVFILES); break; - case FAV_DVD: root = ResStr(IDS_R_FAVDVDS); break; - case FAV_DEVICE: root = ResStr(IDS_R_FAVDEVICES); break; - default: return; - } - - AfxGetApp()->WriteProfileString(root, NULL, NULL); - - int i = 0; - POSITION pos = sl.GetHeadPosition(); - while(pos) - { - CString s; - s.Format(_T("Name%d"), i++); - AfxGetApp()->WriteProfileString(root, s, sl.GetNext(pos)); - } -} - -void CMPlayerCApp::Settings::AddFav(favtype ft, CString s) -{ - CAtlList sl; - GetFav(ft, sl); - if(sl.Find(s)) return; - sl.AddTail(s); - SetFav(ft, sl); -} - -// CMPlayerCApp::Settings::CRecentFileAndURLList - -CMPlayerCApp::Settings::CRecentFileAndURLList::CRecentFileAndURLList(UINT nStart, LPCTSTR lpszSection, - LPCTSTR lpszEntryFormat, int nSize, - int nMaxDispLen) - : CRecentFileList(nStart, lpszSection, lpszEntryFormat, nSize, nMaxDispLen) -{ -} - -//#include -extern BOOL AFXAPI AfxFullPath(LPTSTR lpszPathOut, LPCTSTR lpszFileIn); -extern BOOL AFXAPI AfxComparePath(LPCTSTR lpszPath1, LPCTSTR lpszPath2); - -void CMPlayerCApp::Settings::CRecentFileAndURLList::Add(LPCTSTR lpszPathName) -{ - ASSERT(m_arrNames != NULL); - ASSERT(lpszPathName != NULL); - ASSERT(AfxIsValidString(lpszPathName)); - - if(CString(lpszPathName).MakeLower().Find(_T("@device:")) >= 0) - return; - - bool fURL = (CString(lpszPathName).Find(_T("://")) >= 0); - - // fully qualify the path name - TCHAR szTemp[1024]; - if(fURL) _tcscpy_s(szTemp, countof(szTemp), lpszPathName); - else AfxFullPath(szTemp, lpszPathName); - - // update the MRU list, if an existing MRU string matches file name - int iMRU; - for (iMRU = 0; iMRU < m_nSize-1; iMRU++) - { - if((fURL && !_tcscmp(m_arrNames[iMRU], szTemp)) - || AfxComparePath(m_arrNames[iMRU], szTemp)) - break; // iMRU will point to matching entry - } - // move MRU strings before this one down - for (; iMRU > 0; iMRU--) - { - ASSERT(iMRU > 0); - ASSERT(iMRU < m_nSize); - m_arrNames[iMRU] = m_arrNames[iMRU-1]; - } - // place this one at the beginning - m_arrNames[0] = szTemp; -} - - -void CMPlayerCApp::OnHelpShowcommandlineswitches() -{ - ShowCmdlnSwitches(); -} - -// - -void GetCurDispMode(dispmode& dm) -{ - if(HDC hDC = ::GetDC(0)) - { - dm.fValid = true; - dm.size = CSize(GetDeviceCaps(hDC, HORZRES), GetDeviceCaps(hDC, VERTRES)); - dm.bpp = GetDeviceCaps(hDC, BITSPIXEL); - dm.freq = GetDeviceCaps(hDC, VREFRESH); - ::ReleaseDC(0, hDC); - } -} - -bool GetDispMode(int i, dispmode& dm) -{ - DEVMODE devmode; - devmode.dmSize = sizeof(DEVMODE); - if(!EnumDisplaySettings(0, i, &devmode)) - return(false); - - dm.fValid = true; - dm.size = CSize(devmode.dmPelsWidth, devmode.dmPelsHeight); - dm.bpp = devmode.dmBitsPerPel; - dm.freq = devmode.dmDisplayFrequency; - - return(true); -} - -void SetDispMode(dispmode& dm) -{ - if(!dm.fValid) return; - - DEVMODE dmScreenSettings; - memset(&dmScreenSettings, 0, sizeof(dmScreenSettings)); - dmScreenSettings.dmSize = sizeof(dmScreenSettings); - dmScreenSettings.dmPelsWidth = dm.size.cx; - dmScreenSettings.dmPelsHeight = dm.size.cy; - dmScreenSettings.dmBitsPerPel = dm.bpp; - dmScreenSettings.dmDisplayFrequency = dm.freq; - dmScreenSettings.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT | DM_BITSPERPEL | DM_DISPLAYFREQUENCY; - ChangeDisplaySettings(&dmScreenSettings, CDS_FULLSCREEN); -} - -#include -#include -#include // put this before the first detours macro above to see an ICE with vc71 :) -#include - -typedef CAtlRegExp CAtlRegExpT; -typedef CAtlREMatchContext CAtlREMatchContextT; - -bool FindRedir(CUrl& src, CString ct, CString& body, CAtlList& urls, CAutoPtrList& res) -{ - POSITION pos = res.GetHeadPosition(); - while(pos) - { - CAtlRegExpT* re = res.GetNext(pos); - - CAtlREMatchContextT mc; - const CAtlREMatchContextT::RECHAR* s = (LPCTSTR)body; - const CAtlREMatchContextT::RECHAR* e = NULL; - for(; s && re->Match(s, &mc, &e); s = e) - { - const CAtlREMatchContextT::RECHAR* szStart = 0; - const CAtlREMatchContextT::RECHAR* szEnd = 0; - mc.GetMatch(0, &szStart, &szEnd); - - CString url; - url.Format(_T("%.*s"), szEnd - szStart, szStart); - url.Trim(); - - if(url.CompareNoCase(_T("asf path")) == 0) continue; - - CUrl dst; - dst.CrackUrl(CString(url)); - if(_tcsicmp(src.GetSchemeName(), dst.GetSchemeName()) - || _tcsicmp(src.GetHostName(), dst.GetHostName()) - || _tcsicmp(src.GetUrlPath(), dst.GetUrlPath())) - { - urls.AddTail(url); - } - else - { - // recursive - urls.RemoveAll(); - break; - } - } - } - - return urls.GetCount() > 0; -} - -bool FindRedir(CString& fn, CString ct, CAtlList& fns, CAutoPtrList& res) -{ - CString body; - - CTextFile f(CTextFile::ANSI); - if(f.Open(fn)) for(CString tmp; f.ReadString(tmp); body += tmp + '\n'); - - CString dir = fn.Left(max(fn.ReverseFind('/'), fn.ReverseFind('\\'))+1); // "ReverseFindOneOf" - - POSITION pos = res.GetHeadPosition(); - while(pos) - { - CAtlRegExpT* re = res.GetNext(pos); - - CAtlREMatchContextT mc; - const CAtlREMatchContextT::RECHAR* s = (LPCTSTR)body; - const CAtlREMatchContextT::RECHAR* e = NULL; - for(; s && re->Match(s, &mc, &e); s = e) - { - const CAtlREMatchContextT::RECHAR* szStart = 0; - const CAtlREMatchContextT::RECHAR* szEnd = 0; - mc.GetMatch(0, &szStart, &szEnd); - - CString fn2; - fn2.Format(_T("%.*s"), szEnd - szStart, szStart); - fn2.Trim(); - - if(!fn2.CompareNoCase(_T("asf path"))) continue; - if(fn2.Find(_T("EXTM3U")) == 0 || fn2.Find(_T("#EXTINF")) == 0) continue; - - if(fn2.Find(_T(":")) < 0 && fn2.Find(_T("\\\\")) != 0 && fn2.Find(_T("//")) != 0) - { - CPath p; - p.Combine(dir, fn2); - fn2 = (LPCTSTR)p; - } - - if(!fn2.CompareNoCase(fn)) - continue; - - fns.AddTail(fn2); - } - } - - return fns.GetCount() > 0; -} - -CString GetContentType(CString fn, CAtlList* redir) -{ - CUrl url; - CString ct, body; - - if(fn.Find(_T("://")) >= 0) - { - url.CrackUrl(fn); - - if(_tcsicmp(url.GetSchemeName(), _T("pnm")) == 0) - return "audio/x-pn-realaudio"; - - if(_tcsicmp(url.GetSchemeName(), _T("mms")) == 0) - return "video/x-ms-asf"; - - if(_tcsicmp(url.GetSchemeName(), _T("http")) != 0) - return ""; - - DWORD ProxyEnable = 0; - CString ProxyServer; - DWORD ProxyPort = 0; - - ULONG len = 256+1; - CRegKey key; - if(ERROR_SUCCESS == key.Open(HKEY_CURRENT_USER, _T("Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings"), KEY_READ) - && ERROR_SUCCESS == key.QueryDWORDValue(_T("ProxyEnable"), ProxyEnable) && ProxyEnable - && ERROR_SUCCESS == key.QueryStringValue(_T("ProxyServer"), ProxyServer.GetBufferSetLength(256), &len)) - { - ProxyServer.ReleaseBufferSetLength(len); - - CAtlList sl; - ProxyServer = Explode(ProxyServer, sl, ';'); - if(sl.GetCount() > 1) - { - POSITION pos = sl.GetHeadPosition(); - while(pos) - { - CAtlList sl2; - if(!Explode(sl.GetNext(pos), sl2, '=', 2).CompareNoCase(_T("http")) - && sl2.GetCount() == 2) - { - ProxyServer = sl2.GetTail(); - break; - } - } - } - - ProxyServer = Explode(ProxyServer, sl, ':'); - if(sl.GetCount() > 1) ProxyPort = _tcstol(sl.GetTail(), NULL, 10); - } - - CSocket s; - s.Create(); - if(s.Connect( - ProxyEnable ? ProxyServer : url.GetHostName(), - ProxyEnable ? ProxyPort : url.GetPortNumber())) - { - CStringA host = CStringA(url.GetHostName()); - CStringA path = CStringA(url.GetUrlPath()) + CStringA(url.GetExtraInfo()); - - if(ProxyEnable) path = "http://" + host + path; - - CStringA hdr; - hdr.Format( - "GET %s HTTP/1.0\r\n" - "User-Agent: Media Player Classic\r\n" - "Host: %s\r\n" - "Accept: */*\r\n" - "\r\n", path, host); - -// MessageBox(NULL, CString(hdr), _T("Sending..."), MB_OK); - - if(s.Send((LPCSTR)hdr, hdr.GetLength()) < hdr.GetLength()) return ""; - - hdr.Empty(); - while(1) - { - CStringA str; - str.ReleaseBuffer(s.Receive(str.GetBuffer(256), 256)); // SOCKET_ERROR == -1, also suitable for ReleaseBuffer - if(str.IsEmpty()) break; - hdr += str; - int hdrend = hdr.Find("\r\n\r\n"); - if(hdrend >= 0) {body = hdr.Mid(hdrend+4); hdr = hdr.Left(hdrend); break;} - } - -// MessageBox(NULL, CString(hdr), _T("Received..."), MB_OK); - - CAtlList sl; - Explode(hdr, sl, '\n'); - POSITION pos = sl.GetHeadPosition(); - while(pos) - { - CStringA& hdrline = sl.GetNext(pos); - CAtlList sl2; - Explode(hdrline, sl2, ':', 2); - CStringA field = sl2.RemoveHead().MakeLower(); - if(field == "location" && !sl2.IsEmpty()) - return GetContentType(CString(sl2.GetHead()), redir); - if(field == "content-type" && !sl2.IsEmpty()) - ct = sl2.GetHead(); - } - - while(body.GetLength() < 256) - { - CStringA str; - str.ReleaseBuffer(s.Receive(str.GetBuffer(256), 256)); // SOCKET_ERROR == -1, also suitable for ReleaseBuffer - if(str.IsEmpty()) break; - body += str; - } - - if(body.GetLength() >= 8) - { - CStringA str = TToA(body); - if(!strncmp((LPCSTR)str, ".ra", 3)) - return "audio/x-pn-realaudio"; - if(!strncmp((LPCSTR)str, ".RMF", 4)) - return "audio/x-pn-realaudio"; - if(*(DWORD*)(LPCSTR)str == 0x75b22630) - return "video/x-ms-wmv"; - if(!strncmp((LPCSTR)str+4, "moov", 4)) - return "video/quicktime"; - } - - if(redir && (ct == _T("audio/x-scpls") || ct == _T("audio/x-mpegurl"))) - { - while(body.GetLength() < 4*1024) // should be enough for a playlist... - { - CStringA str; - str.ReleaseBuffer(s.Receive(str.GetBuffer(256), 256)); // SOCKET_ERROR == -1, also suitable for ReleaseBuffer - if(str.IsEmpty()) break; - body += str; - } - } - } - } - else if(!fn.IsEmpty()) - { - CPath p(fn); - CString ext = p.GetExtension().MakeLower(); - if(ext == _T(".asx")) ct = _T("video/x-ms-asf"); - else if(ext == _T(".pls")) ct = _T("audio/x-scpls"); - else if(ext == _T(".m3u")) ct = _T("audio/x-mpegurl"); - else if(ext == _T(".qtl")) ct = _T("application/x-quicktimeplayer"); - else if(ext == _T(".mpcpl")) ct = _T("application/x-mpc-playlist"); - - if(FILE* f = _tfopen(fn, _T("rb"))) - { - CStringA str; - str.ReleaseBufferSetLength(fread(str.GetBuffer(10240), 1, 10240, f)); - body = AToT(str); - fclose(f); - } - } - - if(body.GetLength() >= 4) // here only those which cannot be opened through dshow - { - CStringA str = TToA(body); - if(!strncmp((LPCSTR)str, ".ra", 3)) - return "audio/x-pn-realaudio"; - if(!strncmp((LPCSTR)str, "FWS", 3)) - return "application/x-shockwave-flash"; - } - - if(redir && !ct.IsEmpty()) - { - CAutoPtrList res; - CAutoPtr re; - - if(ct == _T("video/x-ms-asf")) - { - // ...://..."/> - re.Attach(new CAtlRegExpT()); - if(re && REPARSE_ERROR_OK == re->Parse(_T("{[a-zA-Z]+://[^\n\">]*}"), FALSE)) - res.AddTail(re); - // Ref#n= ...://...\n - re.Attach(new CAtlRegExpT()); - if(re && REPARSE_ERROR_OK == re->Parse(_T("Ref\\z\\b*=\\b*[\"]*{([a-zA-Z]+://[^\n\"]+}"), FALSE)) - res.AddTail(re); - } - else if(ct == _T("audio/x-scpls")) - { - // File1=...\n - re.Attach(new CAtlRegExp<>()); - if(re && REPARSE_ERROR_OK == re->Parse(_T("file\\z\\b*=\\b*[\"]*{[^\n\"]+}"), FALSE)) - res.AddTail(re); - } - else if(ct == _T("audio/x-mpegurl")) - { - // #comment - // ... - re.Attach(new CAtlRegExp<>()); - if(re && REPARSE_ERROR_OK == re->Parse(_T("{[^#][^\n]+}"), FALSE)) - res.AddTail(re); - } - else if(ct == _T("audio/x-pn-realaudio")) - { - // rtsp://... - re.Attach(new CAtlRegExp<>()); - if(re && REPARSE_ERROR_OK == re->Parse(_T("{rtsp://[^\n]+}"), FALSE)) - res.AddTail(re); - } - - if(!body.IsEmpty()) - { - if(fn.Find(_T("://")) >= 0) FindRedir(url, ct, body, *redir, res); - else FindRedir(fn, ct, *redir, res); - } - } - - return ct; -} - -bool CMPlayerCApp::IsVistaOrAbove() -{ - OSVERSIONINFO osver; - - osver.dwOSVersionInfoSize = sizeof( OSVERSIONINFO ); - - if ( ::GetVersionEx( &osver ) && - osver.dwPlatformId == VER_PLATFORM_WIN32_NT && - (osver.dwMajorVersion >= 6 ) ) - return TRUE; - - return FALSE; -} - -bool CMPlayerCApp::IsVSFilterInstalled() -{ - bool result = false; - CRegKey key; - if(ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, _T("CLSID\\{083863F1-70DE-11d0-BD40-00A0C911CE86}\\Instance\\{9852A670-F845-491B-9BE6-EBD841B8A613}"), KEY_READ)) { - result = true; - } - - return result; -} diff --git a/src/apps/mplayerc/mplayerc.h b/src/apps/mplayerc/mplayerc.h deleted file mode 100644 index ade97548d..000000000 --- a/src/apps/mplayerc/mplayerc.h +++ /dev/null @@ -1,508 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#pragma once - -#ifndef __AFXWIN_H__ - #error include 'stdafx.h' before including this file for PCH -#endif - -#include "resource.h" // main symbols -#include -#include -#include "..\..\subtitles\STS.h" -#include "MediaFormats.h" -#include "fakefiltermapper2.h" - -#ifdef UNICODE -#define MPC_WND_CLASS_NAME L"MediaPlayerClassicW" -#else -#define MPC_WND_CLASS_NAME "MediaPlayerClassicA" -#endif - -enum -{ - WM_GRAPHNOTIFY = WM_APP+1, - WM_REARRANGERENDERLESS, - WM_RESUMEFROMSTATE -}; - -#define WM_MYMOUSELAST WM_XBUTTONDBLCLK - -/////////////// - -extern void CorrectComboListWidth(CComboBox& box, CFont* pWndFont); -extern HICON LoadIcon(CString fn, bool fSmall); -extern bool LoadType(CString fn, CString& type); -extern bool LoadResource(UINT resid, CStringA& str, LPCTSTR restype); -extern CString GetContentType(CString fn, CAtlList* redir = NULL); - -///////////////////////////////////////////////////////////////////////////// -// CMPlayerCApp: -// See mplayerc.cpp for the implementation of this class -// - -// flags for AppSettings::nCS -enum -{ - CS_NONE=0, - CS_SEEKBAR=1, - CS_TOOLBAR=CS_SEEKBAR<<1, - CS_INFOBAR=CS_TOOLBAR<<1, - CS_STATSBAR=CS_INFOBAR<<1, - CS_STATUSBAR=CS_STATSBAR<<1, - CS_LAST=CS_STATUSBAR -}; - -enum -{ - CLSW_NONE=0, - CLSW_OPEN=1, - CLSW_PLAY=CLSW_OPEN<<1, - CLSW_CLOSE=CLSW_PLAY<<1, - CLSW_STANDBY=CLSW_CLOSE<<1, - CLSW_HIBERNATE=CLSW_STANDBY<<1, - CLSW_SHUTDOWN=CLSW_HIBERNATE<<1, - CLSW_LOGOFF=CLSW_SHUTDOWN<<1, - CLSW_AFTERPLAYBACK_MASK=CLSW_CLOSE|CLSW_STANDBY|CLSW_SHUTDOWN|CLSW_HIBERNATE|CLSW_LOGOFF, - CLSW_FULLSCREEN=CLSW_LOGOFF<<1, - CLSW_NEW=CLSW_FULLSCREEN<<1, - CLSW_HELP=CLSW_NEW<<1, - CLSW_DVD=CLSW_HELP<<1, - CLSW_CD=CLSW_DVD<<1, - CLSW_ADD=CLSW_CD<<1, - CLSW_MINIMIZED=CLSW_ADD<<1, - CLSW_REGEXTVID=CLSW_MINIMIZED<<1, - CLSW_REGEXTAUD=CLSW_REGEXTVID<<1, - CLSW_UNREGEXT=CLSW_REGEXTAUD<<1, - CLSW_STARTVALID=CLSW_UNREGEXT<<2, - CLSW_NOFOCUS=CLSW_STARTVALID<<1, - CLSW_FIXEDSIZE=CLSW_NOFOCUS<<1, - CLSW_MONITOR=CLSW_FIXEDSIZE<<1, - CLSW_UNRECOGNIZEDSWITCH=CLSW_MONITOR<<1 -}; - -enum -{ - VIDRNDT_DS_DEFAULT, - VIDRNDT_DS_OLDRENDERER, - VIDRNDT_DS_OVERLAYMIXER, - VIDRNDT_DS_VMR7WINDOWED, - VIDRNDT_DS_VMR9WINDOWED, - VIDRNDT_DS_VMR7RENDERLESS, - VIDRNDT_DS_VMR9RENDERLESS, - VIDRNDT_DS_DXR, - VIDRNDT_DS_NULL_COMP, - VIDRNDT_DS_NULL_UNCOMP, -}; - -enum -{ - VIDRNDT_RM_DEFAULT, - VIDRNDT_RM_DX7, - VIDRNDT_RM_DX9, -}; - -enum -{ - VIDRNDT_QT_DEFAULT, - VIDRNDT_QT_DX7, - VIDRNDT_QT_DX9, -}; - -enum -{ - VIDRNDT_AP_SURFACE, - VIDRNDT_AP_TEXTURE2D, - VIDRNDT_AP_TEXTURE3D, -}; - -#define AUDRNDT_NULL_COMP _T("Null Audio Renderer (Any)") -#define AUDRNDT_NULL_UNCOMP _T("Null Audio Renderer (Uncompressed)") - -enum -{ - SRC_CDDA=1, - SRC_CDXA=SRC_CDDA<<1, - SRC_VTS=SRC_CDXA<<1, - SRC_FLIC=SRC_VTS<<1, - SRC_D2V=SRC_FLIC<<1, - SRC_DTSAC3=SRC_D2V<<1, - SRC_MATROSKA=SRC_DTSAC3<<1, - SRC_SHOUTCAST=SRC_MATROSKA<<1, - SRC_REALMEDIA=SRC_SHOUTCAST<<1, - SRC_AVI=SRC_REALMEDIA<<1, - SRC_RADGT=SRC_AVI<<1, - SRC_ROQ=SRC_RADGT<<1, - SRC_OGG=SRC_ROQ<<1, - SRC_NUT=SRC_OGG<<1, - SRC_MPEG=SRC_NUT<<1, - SRC_DIRAC=SRC_MPEG<<1, - SRC_MPA=SRC_DIRAC<<1, - SRC_DSM=SRC_MPA<<1, - SRC_SUBS=SRC_DSM<<1, - SRC_MP4=SRC_SUBS<<1, - SRC_FLV=SRC_MP4<<1, - SRC_LAST=SRC_FLV<<1 -}; - -enum -{ - TRA_MPEG1=1, - TRA_MPEG2=TRA_MPEG1<<1, - TRA_RV=TRA_MPEG2<<1, - TRA_RA=TRA_RV<<1, - TRA_MPA=TRA_RA<<1, - TRA_LPCM=TRA_MPA<<1, - TRA_AC3=TRA_LPCM<<1, - TRA_DTS=TRA_AC3<<1, - TRA_AAC=TRA_DTS<<1, - TRA_PS2AUD=TRA_AAC<<1, - TRA_DIRAC=TRA_PS2AUD<<1, - TRA_VORBIS=TRA_DIRAC<<1, - TRA_LAST=TRA_VORBIS<<1, -}; - -enum -{ - DVS_HALF, - DVS_NORMAL, - DVS_DOUBLE, - DVS_STRETCH, - DVS_FROMINSIDE, - DVS_FROMOUTSIDE -}; - -typedef enum -{ - FAV_FILE, - FAV_DVD, - FAV_DEVICE -} favtype; - -#pragma pack(push, 1) -typedef struct -{ - bool fValid; - CSize size; - int bpp, freq; -} dispmode; - -class wmcmd : public ACCEL -{ - ACCEL backup; - UINT appcmdorg; - UINT mouseorg; -public: - CString name; - UINT appcmd; - enum {NONE,LDOWN,LUP,LDBLCLK,MDOWN,MUP,MDBLCLK,RDOWN,RUP,RDBLCLK,X1DOWN,X1UP,X1DBLCLK,X2DOWN,X2UP,X2DBLCLK,WUP,WDOWN,LAST}; - UINT mouse; - CStringA rmcmd; - int rmrepcnt; - wmcmd(WORD cmd = 0) {this->cmd = cmd;} - wmcmd(WORD cmd, WORD key, BYTE fVirt, LPCTSTR name, UINT appcmd = 0, UINT mouse = NONE, LPCSTR rmcmd = "", int rmrepcnt = 5) - { - this->cmd = cmd; - this->key = key; - this->fVirt = fVirt; - this->appcmd = appcmdorg = appcmd; - this->name = name; - this->mouse = mouseorg = mouse; - this->rmcmd = rmcmd; - this->rmrepcnt = rmrepcnt; - backup = *this; - } - bool operator == (const wmcmd& wc) const - { - return(cmd > 0 && cmd == wc.cmd); - } - void Restore() {*(ACCEL*)this = backup; appcmd = appcmdorg; mouse = mouseorg; rmcmd.Empty(); rmrepcnt = 5;} - bool IsModified() {return(memcmp((const ACCEL*)this, &backup, sizeof(ACCEL)) || appcmd != appcmdorg || mouse != mouseorg || !rmcmd.IsEmpty() || rmrepcnt != 5);} -}; -#pragma pack(pop) - -#include - -class CRemoteCtrlClient : public CAsyncSocket -{ -protected: - CCritSec m_csLock; - CWnd* m_pWnd; - enum {DISCONNECTED, CONNECTED, CONNECTING} m_nStatus; - CString m_addr; - - virtual void OnConnect(int nErrorCode); - virtual void OnClose(int nErrorCode); - virtual void OnReceive(int nErrorCode); - - virtual void OnCommand(CStringA str) = 0; - - void ExecuteCommand(CStringA cmd, int repcnt); - -public: - CRemoteCtrlClient(); - void SetHWND(HWND hWnd); - void Connect(CString addr); - int GetStatus() {return(m_nStatus);} -}; - -class CWinLircClient : public CRemoteCtrlClient -{ -protected: - virtual void OnCommand(CStringA str); - -public: - CWinLircClient(); -}; - -class CUIceClient : public CRemoteCtrlClient -{ -protected: - virtual void OnCommand(CStringA str); - -public: - CUIceClient(); -}; - -extern void GetCurDispMode(dispmode& dm); -extern bool GetDispMode(int i, dispmode& dm); -extern void SetDispMode(dispmode& dm); - -class CMPlayerCApp : public CWinApp -{ - ATL::CMutex m_mutexOneInstance; - - CAtlList m_cmdln; - void PreProcessCommandLine(); - void SendCommandLine(HWND hWnd); - -public: - CMPlayerCApp(); - - void ShowCmdlnSwitches(); - - bool StoreSettingsToIni(); - bool StoreSettingsToRegistry(); - CString GetIniPath(); - bool IsIniValid(); - - bool GetAppDataPath(CString& path); - - static bool IsVistaOrAbove(); - static bool IsVSFilterInstalled(); - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CMPlayerCApp) - public: - virtual BOOL InitInstance(); - virtual int ExitInstance(); - //}}AFX_VIRTUAL - -// Implementation - - class Settings - { - friend class CMPlayerCApp; - - bool fInitialized; - - class CRecentFileAndURLList : public CRecentFileList - { - public: - CRecentFileAndURLList(UINT nStart, LPCTSTR lpszSection, - LPCTSTR lpszEntryFormat, int nSize, - int nMaxDispLen = AFX_ABBREV_FILENAME_LEN); - - virtual void Add(LPCTSTR lpszPathName); // we have to override CRecentFileList::Add because the original version can't handle URLs - }; - - public: - // cmdline params - int nCLSwitches; - CAtlList slFiles, slDubs, slSubs, slFilters; - __int64 rtStart; - CSize fixedWindowSize; - bool HasFixedWindowSize() {return fixedWindowSize.cx > 0 || fixedWindowSize.cy > 0;} - // int iFixedWidth, iFixedHeight; - int iMonitor; - - void ParseCommandLine(CAtlList& cmdln); - - bool fXpOrBetter; - int iDXVer; - - int nCS; - bool fHideCaptionMenu; - int iDefaultVideoSize; - bool fKeepAspectRatio; - bool fCompMonDeskARDiff; - - CRecentFileAndURLList MRU; - CRecentFileAndURLList MRUDub; - - CAutoPtrList filters; - - int iDSVideoRendererType; - int iRMVideoRendererType; - int iQTVideoRendererType; - int iAPSurfaceUsage; - bool fVMRSyncFix; - int iDX9Resizer; - bool fVMR9MixerMode; - bool fVMR9MixerYUV; - - int nVolume; - int nBalance; - bool fMute; - int nLoops; - bool fLoopForever; - bool fRewind; - int iZoomLevel; - // int iVideoRendererType; - CStringW AudioRendererDisplayName; - bool fAutoloadAudio; - bool fAutoloadSubtitles; - bool fBlockVSFilter; - bool fEnableWorkerThreadForOpening; - bool fReportFailedPins; - - bool fAllowMultipleInst; - int iTitleBarTextStyle; - bool fTitleBarTextTitle; - int iOnTop; - bool fTrayIcon; - bool fRememberZoomLevel; - bool fShowBarsWhenFullScreen; - int nShowBarsWhenFullScreenTimeOut; - dispmode dmFullscreenRes; - bool fExitFullScreenAtTheEnd; - bool fRememberWindowPos; - bool fRememberWindowSize; - bool fSnapToDesktopEdges; - CRect rcLastWindowPos; - UINT lastWindowType; - CSize AspectRatio; - bool fKeepHistory; - - CString sDVDPath; - bool fUseDVDPath; - LCID idMenuLang, idAudioLang, idSubtitlesLang; - bool fAutoSpeakerConf; - - STSStyle subdefstyle; - bool fOverridePlacement; - int nHorPos, nVerPos; - int nSPCSize; - int nSPCMaxRes; - int nSubDelayInterval; - bool fSPCPow2Tex; - bool fEnableSubtitles; - - bool fDisabeXPToolbars; - bool fUseWMASFReader; - int nJumpDistS; - int nJumpDistM; - int nJumpDistL; - bool fFreeWindowResizing; - bool fNotifyMSN; - bool fNotifyGTSdll; - - bool fEnableAudioSwitcher; - bool fDownSampleTo441; - bool fAudioTimeShift; - int tAudioTimeShift; - bool fCustomChannelMapping; - DWORD pSpeakerToChannelMap[18][18]; - bool fAudioNormalize; - bool fAudioNormalizeRecover; - float AudioBoost; - - bool fIntRealMedia; - // bool fRealMediaRenderless; - int iQuickTimeRenderer; - float RealMediaQuickTimeFPS; - - CStringArray m_pnspresets; - - CList wmcmds; - HACCEL hAccel; - - bool fWinLirc; - CString WinLircAddr; - CWinLircClient WinLircClient; - bool fUIce; - CString UIceAddr; - CUIceClient UIceClient; - - CMediaFormats Formats; - - UINT SrcFilters, TraFilters; - - CString logofn; - UINT logoid; - bool logoext; - - bool fHideCDROMsSubMenu; - - DWORD priority; - bool launchfullscreen; - - BOOL fEnableWebServer; - int nWebServerPort; - bool fWebServerPrintDebugInfo; - bool fWebServerUseCompression; - bool fWebServerLocalhostOnly; - CString WebRoot, WebDefIndex; - CString WebServerCGI; - - CString SnapShotPath, SnapShotExt; - int ThumbRows, ThumbCols, ThumbWidth; - - CString ISDb; - - struct Shader {CString label, target, srcdata;}; - CAtlList m_shaders; - CString m_shadercombine; - - CString strShaderList; - - public: - Settings(); - virtual ~Settings(); - void UpdateData(bool fSave); - - void GetFav(favtype ft, CAtlList& sl); - void SetFav(favtype ft, CAtlList& sl); - void AddFav(favtype ft, CString s); - } m_s; - -public: - DECLARE_MESSAGE_MAP() - afx_msg void OnAppAbout(); - afx_msg void OnFileExit(); - afx_msg void OnHelpShowcommandlineswitches(); -}; - -#define AfxGetMyApp() ((CMPlayerCApp*)AfxGetApp()) -#define AfxGetAppSettings() ((CMPlayerCApp*)AfxGetApp())->m_s -#define AppSettings CMPlayerCApp::Settings diff --git a/src/apps/mplayerc/mplayerc.rc b/src/apps/mplayerc/mplayerc.rc deleted file mode 100644 index 3212e53b5..000000000 --- a/src/apps/mplayerc/mplayerc.rc +++ /dev/null @@ -1,2402 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""afxres.h""\r\0" -END - -3 TEXTINCLUDE -BEGIN - "#define _AFX_NO_SPLITTER_RESOURCES\r\n" - "#define _AFX_NO_OLE_RESOURCES\r\n" - "#define _AFX_NO_TRACKER_RESOURCES\r\n" - "#define _AFX_NO_PROPERTY_RESOURCES\r\n" - "\r\n" - "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" - "LANGUAGE 9, 1\r\n" - "#pragma code_page(1252)\r\n" - "#include ""afxres.rc"" // Standard components\r\n" - "#endif\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_SELECTMEDIATYPE DIALOGEX 0, 0, 225, 47 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Select Media Type" -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - COMBOBOX IDC_COMBO1,7,7,211,120,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP - DEFPUSHBUTTON "OK",IDOK,114,26,50,14 - PUSHBUTTON "Cancel",IDCANCEL,168,26,50,14 -END - -IDD_OPENCAPDEVICE_DLG DIALOGEX 0, 0, 226, 131 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Select Capture Device" -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - LTEXT "The following input devices were found on your system:",IDC_STATIC,12,7,200,11 - LTEXT "Video",IDC_STATIC,12,23,18,8 - COMBOBOX IDC_COMBO1,47,20,165,30,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP - LTEXT "Audio",IDC_STATIC,12,41,19,8 - COMBOBOX IDC_COMBO2,47,38,165,30,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP - DEFPUSHBUTTON "OK",IDOK,60,110,50,14 - PUSHBUTTON "Cancel",IDCANCEL,115,110,50,14 - LTEXT "Some capture cards can output audio directly and not through the audio card. In that case you can leave the audio input selection empty.",IDC_STATIC,12,76,200,24 - LTEXT "Country",IDC_STATIC,12,58,27,8 - COMBOBOX IDC_COMBO9,47,56,165,102,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP -END - -IDD_CAPTURE_DLG DIALOGEX 0, 0, 127, 289 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - GROUPBOX "Video",IDC_STATIC1,3,1,116,59 - COMBOBOX IDC_COMBO4,10,10,62,116,CBS_DROPDOWNLIST | WS_DISABLED | WS_VSCROLL | WS_TABSTOP - EDITTEXT IDC_EDIT3,74,10,38,13,ES_RIGHT | ES_AUTOHSCROLL | WS_DISABLED - COMBOBOX IDC_COMBO1,10,26,37,89,CBS_DROPDOWNLIST | CBS_SORT | WS_DISABLED | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_COMBO5,50,26,62,89,CBS_DROPDOWNLIST | CBS_SORT | WS_DISABLED | WS_VSCROLL | WS_TABSTOP - EDITTEXT IDC_EDIT1,10,43,37,13,ES_RIGHT | ES_AUTOHSCROLL - CONTROL "",IDC_SPIN1,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | WS_DISABLED,35,46,11,14 - EDITTEXT IDC_EDIT2,50,43,35,13,ES_RIGHT | ES_AUTOHSCROLL - CONTROL "",IDC_SPIN2,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | WS_DISABLED,74,46,11,14 - PUSHBUTTON "Set",IDC_BUTTON1,89,43,23,13 - GROUPBOX "Audio",IDC_STATIC,3,61,116,43 - COMBOBOX IDC_COMBO3,10,71,62,99,CBS_DROPDOWNLIST | WS_DISABLED | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_COMBO2,74,71,38,98,CBS_DROPDOWNLIST | CBS_SORT | WS_DISABLED | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_COMBO6,10,87,102,118,CBS_DROPDOWNLIST | CBS_SORT | WS_DISABLED | WS_VSCROLL | WS_TABSTOP - GROUPBOX "Output",IDC_STATIC,3,105,116,171 - CONTROL "Record Video",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,114,58,10 - CONTROL "Preview",IDC_CHECK2,"Button",BS_AUTO3STATE | WS_TABSTOP,72,114,41,10 - COMBOBOX IDC_COMBO7,10,126,102,62,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_COMBO9,10,142,37,89,CBS_DROPDOWNLIST | CBS_SORT | WS_DISABLED | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_COMBO10,50,142,62,89,CBS_DROPDOWNLIST | CBS_SORT | WS_DISABLED | WS_VSCROLL | WS_TABSTOP - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,10,158,104,1 - CONTROL "Record Audio",IDC_CHECK3,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,161,59,10 - CONTROL "Preview",IDC_CHECK4,"Button",BS_AUTO3STATE | WS_TABSTOP,72,161,41,10 - COMBOBOX IDC_COMBO8,10,173,102,62,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_COMBO12,10,189,37,98,CBS_DROPDOWNLIST | CBS_SORT | WS_DISABLED | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_COMBO11,50,189,62,118,CBS_DROPDOWNLIST | CBS_SORT | WS_DISABLED | WS_VSCROLL | WS_TABSTOP - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,10,205,104,1 - LTEXT "V/A Buffers:",IDC_STATIC,10,211,40,8 - EDITTEXT IDC_EDIT5,52,209,28,12,ES_CENTER | ES_AUTOHSCROLL | ES_NUMBER - EDITTEXT IDC_EDIT6,83,209,28,12,ES_CENTER | ES_AUTOHSCROLL | ES_NUMBER - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,10,225,104,1 - EDITTEXT IDC_EDIT4,10,231,86,13,ES_AUTOHSCROLL | ES_READONLY - PUSHBUTTON "...",IDC_BUTTON3,98,231,14,13 - CONTROL "Audio to wav",IDC_CHECK5,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,260,55,10 - PUSHBUTTON "Record",IDC_BUTTON2,74,259,38,13,WS_DISABLED | WS_GROUP - COMBOBOX IDC_COMBO14,10,245,102,52,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP -END - -IDD_PPAGEAUDIOSWITCHER DIALOGEX 0, 0, 296, 198 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - CONTROL "Enable built-in audio switcher filter (needs re-opening, disables morgan switcher)",IDC_CHECK2, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,5,273,10 - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,7,18,282,1 - CONTROL "Down-sample to 44100 Hz",IDC_CHECK3,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,35,99,10 - CONTROL "Audio time shift (ms):",IDC_CHECK4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,48,82,10 - EDITTEXT IDC_EDIT2,96,47,46,13,ES_AUTOHSCROLL,WS_EX_RIGHT - CONTROL "",IDC_SPIN2,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,144,46,11,14 - CONTROL "Enable custom channel mapping",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,61,117,10 - LTEXT "Speaker configuration for ",IDC_STATIC1,7,76,84,8 - EDITTEXT IDC_EDIT1,95,74,29,13,ES_CENTER | ES_AUTOHSCROLL - CONTROL "",IDC_SPIN1,"msctls_updown32",UDS_WRAP | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,183,73,11,14 - LTEXT "input channels:",IDC_STATIC2,131,76,51,8 - CONTROL "",IDC_LIST1,"SysListView32",LVS_REPORT | LVS_OWNERDRAWFIXED | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP,7,93,282,94 - CTEXT "Hold shift for immediate changes when clicking something ",IDC_STATIC3,7,189,282,8 - CONTROL "Normalize",IDC_CHECK5,"Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,7,23,47,8 - LTEXT "Boost:",IDC_STATIC,129,23,19,8 - CONTROL "",IDC_SLIDER1,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,152,23,137,11 - CONTROL "Regain volume",IDC_CHECK6,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,59,22,59,10 -END - -IDD_GOTO_DLG DIALOGEX 0, 0, 157, 113 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Go To..." -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - LTEXT "Enter at most four numbers separated by anything but digits. One number only means ms, two numbers mean sec and ms, etc.",IDC_STATIC,7,7,143,27 - LTEXT "Time",IDC_STATIC,7,40,16,8 - EDITTEXT IDC_EDIT1,31,37,83,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "Go!",IDC_OK1,119,37,31,14 - LTEXT "Enter two numbers to jump to a specified frame, the first is the frame number, the second is the frame-rate.",IDC_STATIC,7,62,143,26 - LTEXT "Frame",IDC_STATIC,7,95,20,8 - EDITTEXT IDC_EDIT2,31,92,83,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "Go!",IDC_OK2,119,92,31,14 -END - -IDD_OPEN_DLG DIALOGEX 0, 0, 241, 87 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Open" -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - ICON IDR_MAINFRAME,IDC_STATIC,9,8,21,20 - LTEXT "Type the address of a movie or audio file (on the Internet or your computer) and the player will open it for you.",IDC_STATIC1,33,9,149,28 - LTEXT "Open:",IDC_STATIC,7,52,21,8 - COMBOBOX IDC_COMBO1,33,50,149,76,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "Browse...",IDC_BUTTON1,187,49,47,14 - LTEXT "Dub:",IDC_STATIC,7,71,16,8 - COMBOBOX IDC_COMBO2,33,68,149,20,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "Browse...",IDC_BUTTON2,187,67,47,14 - DEFPUSHBUTTON "OK",IDOK,187,9,47,14,WS_GROUP - PUSHBUTTON "Cancel",IDCANCEL,187,25,47,14 - CONTROL "Add to playlist without opening",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,33,37,115,10 -END - -IDD_ABOUTBOX DIALOGEX 0, 0, 222, 89 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "About" -FONT 8, "MS Shell Dlg", 400, 0, 0xB1 -BEGIN - ICON IDR_MAINFRAME,IDC_STATIC,11,17,20,20 - LTEXT "Media Player Classic",IDC_STATIC1,40,12,126,8,SS_NOPREFIX - LTEXT "Copyright (C) 2002-2009 Gabest et al.",IDC_STATIC,40,26,170,8 - LTEXT "Version: 6.4.9.1 ",IDC_VERSION,40,40,170,8 - PUSHBUTTON "OK",IDOK,160,8,50,14,WS_GROUP - LTEXT "This program is freeware and released under the GNU General Public License.",IDC_STATIC,40,62,170,25 -END - -IDD_PLAYERSTATUSBAR DIALOGEX 0, 0, 183, 15 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN -END - -IDD_PLAYERSEEKBAR DIALOGEX 0, 0, 254, 12 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN -END - -IDD_PLAYERINFOBAR DIALOGEX 0, 0, 183, 12 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN -END - -IDD_PPAGEPLAYER DIALOGEX 0, 0, 296, 198 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - GROUPBOX "Open options",IDC_STATIC,5,7,117,119 - CONTROL "Use the same player for each media file",IDC_RADIO1, - "Button",BS_AUTORADIOBUTTON | BS_MULTILINE | WS_GROUP,15,20,93,20 - CONTROL "Open a new player for each media file played",IDC_RADIO2, - "Button",BS_AUTORADIOBUTTON | BS_MULTILINE,15,63,98,15 - ICON IDI_SINGLE,IDC_STATIC,51,40,20,20,SS_CENTERIMAGE - ICON IDI_MULTI,IDC_STATIC,51,84,20,20,SS_CENTERIMAGE - CONTROL "Launch files in fullscreen",IDC_CHECK11,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,109,93,10 - GROUPBOX "Title bar",IDC_STATIC,5,130,117,61 - CONTROL "Display full path",IDC_RADIO3,"Button",BS_AUTORADIOBUTTON | WS_GROUP,16,143,67,10 - CONTROL "File name only",IDC_RADIO4,"Button",BS_AUTORADIOBUTTON,16,154,61,10 - CONTROL "Don't prefix anything",IDC_RADIO5,"Button",BS_AUTORADIOBUTTON,16,165,83,10 - GROUPBOX "Other",IDC_STATIC,130,7,159,184,WS_GROUP - CONTROL "Always on top",IDC_CHECK2,"Button",BS_AUTO3STATE | WS_GROUP | WS_TABSTOP,140,19,61,10 - CONTROL "Tray icon",IDC_CHECK3,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,140,32,45,10 - CONTROL "Show controls in fullscreen for",IDC_CHECK4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,140,45,112,10 - EDITTEXT IDC_EDIT1,152,60,32,13,ES_CENTER | ES_AUTOHSCROLL | ES_READONLY | ES_NUMBER - CONTROL "",IDC_SPIN1,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,175,61,11,14 - LTEXT "sec(s)",IDC_STATIC1,188,62,20,8 - LTEXT "0: auto-hide\n-1: don't hide",IDC_STATIC2,218,58,48,17 - CONTROL "Exit fullscreen at the end of playback",IDC_CHECK5, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,140,79,135,10 - CONTROL "Remember last window position",IDC_CHECK6,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,140,92,127,10 - CONTROL "Remember last window size",IDC_CHECK7,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,140,105,127,10 - CONTROL "Snap to desktop edges",IDC_CHECK12,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,140,118,89,10 - CONTROL "Store settings to .ini file",IDC_CHECK8,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,140,131,92,10 - CONTROL "Keep history of recently opened files",IDC_CHECK1, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,140,144,133,10 - CONTROL "Hide CD-ROMs menu",IDC_CHECK10,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,140,157,82,10 - CONTROL "Process priority above normal",IDC_CHECK9,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,140,170,111,10 - CONTROL "Replace file name with title",IDC_CHECK13,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,177,101,10 -END - -IDD_PPAGEDVD DIALOGEX 0, 0, 296, 193 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - GROUPBOX "Location of the DVD drive or the ""VIDEO_TS"" folder",IDC_STATIC,5,7,235,66 - CONTROL "Default",IDC_RADIO1,"Button",BS_AUTORADIOBUTTON | WS_GROUP,15,21,39,10 - CONTROL "User defined path:",IDC_RADIO2,"Button",BS_AUTORADIOBUTTON,15,35,76,10 - EDITTEXT IDC_DVDPATH,29,50,180,14,ES_AUTOHSCROLL | WS_GROUP - PUSHBUTTON "...",IDC_BUTTON1,215,50,15,14 - GROUPBOX "Preferred language for DVD Navigator and the external OGM Splitter",IDC_STATIC,5,77,235,73 - CONTROL "Menu",IDC_RADIO3,"Button",BS_AUTORADIOBUTTON | WS_GROUP,15,95,33,10 - CONTROL "Audio",IDC_RADIO4,"Button",BS_AUTORADIOBUTTON,15,111,34,10 - CONTROL "Subtitles",IDC_RADIO5,"Button",BS_AUTORADIOBUTTON,15,127,43,10 - LISTBOX IDC_LIST1,74,90,156,53,WS_VSCROLL | WS_GROUP | WS_TABSTOP - GROUPBOX "Audio channels",IDC_STATIC,5,155,235,32 - CONTROL "Automatically set speaker count for the ivideo ac3 decoder",IDC_CHECK1, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,169,204,10 -END - -IDD_PPAGEPLAYBACK DIALOGEX 0, 0, 296, 198 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - GROUPBOX "Audio",IDC_STATIC,5,7,284,58 - LTEXT "Volume",IDC_STATIC,66,19,24,8 - LTEXT "Min",IDC_STATIC,27,38,12,8 - CONTROL "",IDC_SLIDER1,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | WS_TABSTOP,41,31,75,24 - LTEXT "Max",IDC_STATIC,123,38,14,8 - LTEXT "Balance",IDC_STATIC,196,19,26,8 - LTEXT "L",IDC_STATIC,160,39,8,8 - CONTROL "",IDC_SLIDER2,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,172,36,75,19 - LTEXT "R",IDC_STATIC,252,39,8,8 - GROUPBOX "Playback",IDC_STATIC,5,67,114,71 - CONTROL "Play",IDC_RADIO1,"Button",BS_AUTORADIOBUTTON | WS_GROUP,14,86,29,10 - CONTROL "Repeat forever",IDC_RADIO2,"Button",BS_AUTORADIOBUTTON,14,102,65,10 - CONTROL "Rewind when done playing",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,14,119,101,10 - EDITTEXT IDC_EDIT1,52,85,20,13,ES_AUTOHSCROLL | ES_NUMBER - LTEXT "time(s)",IDC_STATIC1,81,87,23,8 - GROUPBOX "Output",IDC_STATIC,126,67,163,71 - CONTROL "Auto-zoom:",IDC_CHECK5,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,137,85,48,10 - COMBOBOX IDC_COMBO1,193,83,49,47,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - CONTROL "Change fullscreen resolution:",IDC_CHECK4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,137,102,109,10 - COMBOBOX IDC_COMBO2,156,116,112,64,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - GROUPBOX "Open settings",IDC_STATIC,5,140,284,43 - CONTROL "Use worker thread to construct the filter graph",IDC_CHECK7, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,153,166,10 - CONTROL "Report pins which fail to render",IDC_CHECK6,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,167,116,10 - CONTROL "Auto-load audio files",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,193,153,81,10 - CONTROL "Auto-load subtitles",IDC_CHECK3,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,193,167,76,10 -END - -IDD_PPAGESUBTITLES DIALOGEX 0, 0, 296, 203 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD -FONT 8, "MS Shell Dlg", 400, 0, 0xEE -BEGIN - GROUPBOX "",IDC_STATIC,5,3,192,38 - CONTROL "Override placement",IDC_CHECK3,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,3,75,10 - LTEXT "Horizontal:",IDC_STATIC1,14,22,35,8 - EDITTEXT IDC_EDIT2,54,20,32,12,ES_CENTER | ES_AUTOHSCROLL | ES_READONLY | ES_NUMBER - CONTROL "",IDC_SPIN2,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,74,25,11,14 - LTEXT "%",IDC_STATIC2,88,22,8,8 - LTEXT "Vertical:",IDC_STATIC3,107,22,26,8 - EDITTEXT IDC_EDIT3,139,20,32,12,ES_CENTER | ES_AUTOHSCROLL | ES_READONLY | ES_NUMBER - CONTROL "",IDC_SPIN3,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,159,26,11,14 - LTEXT "%",IDC_STATIC4,173,22,8,8 - GROUPBOX "Delay interval",IDC_STATIC,201,3,88,38 - LTEXT "ms",IDC_STATIC,266,20,15,11 - EDITTEXT IDC_EDIT4,220,18,41,13,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER - GROUPBOX "Texture settings (open the video again to see the changes)",IDC_STATIC,5,43,284,55 - LTEXT "Number of subpictures to buffer ahead:",IDC_STATIC,14,60,128,8 - EDITTEXT IDC_EDIT1,147,58,32,12,ES_CENTER | ES_AUTOHSCROLL | ES_READONLY | ES_NUMBER - CONTROL "",IDC_SPIN1,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,168,63,11,14 - LTEXT "Set 0 to disable buffering\n(not recommended)",IDC_STATIC,191,55,90,17 - LTEXT "Maximum texture resolution:",IDC_STATIC,14,79,92,8 - LTEXT "Subtitling for DirectShow is available when one of the following video renderers is selected in MPC's output options: ""VMR7 (renderless)"", ""VMR9 (renderless)"" or ""Haali Video Renderer"".",IDC_STATIC,14,148,267,25 - GROUPBOX "Before you ask",IDC_STATIC,5,136,284,65 - LTEXT "If you override and enable full-screen antialiasing somewhere at your videocard's settings, subtitles aren't going to look any better but it will surely eat your cpu.",IDC_STATIC,14,110,267,19 - COMBOBOX IDC_COMBO1,111,77,68,45,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - GROUPBOX "Warning",IDC_STATIC,5,99,284,35 - LTEXT "RealMedia and QuickTime formats can be subtitled by setting their special DirectX 7 or DirectX 9 renderers.",IDC_STATIC,14,178,267,16 - CONTROL "Round up to power of two",IDC_CHECK_SPCPOW2TEX,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,184,79,97,10 -END - -IDD_PPAGESUBDB DIALOGEX 0, 0, 296, 203 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD -FONT 8, "MS Shell Dlg", 400, 0, 0xEE -BEGIN - LTEXT "Base URL of the online subtitle database:",IDC_STATIC,5,8,133,8 - COMBOBOX IDC_COMBO1,29,22,205,30,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "Test",IDC_BUTTON1,239,21,50,14 - LTEXT "http://",IDC_STATIC,5,24,22,8 -END - -IDD_PPAGEFORMATS DIALOGEX 0, 0, 296, 198 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - CONTROL "",IDC_LIST1,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SORTASCENDING | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP,13,15,268,97 - GROUPBOX "File extensions",IDC_STATIC,6,4,283,135 - EDITTEXT IDC_EDIT1,13,118,192,14,ES_AUTOHSCROLL - PUSHBUTTON "Default",IDC_BUTTON2,210,118,34,14 - PUSHBUTTON "Set",IDC_BUTTON_EXT_SET,247,118,34,14 - GROUPBOX "Real-Time Streaming Protocol handler (for rtsp://... URLs)",IDC_STATIC,6,141,283,27 - CONTROL "RealMedia",IDC_RADIO1,"Button",BS_AUTORADIOBUTTON | WS_GROUP,14,153,49,10 - CONTROL "QuickTime",IDC_RADIO2,"Button",BS_AUTORADIOBUTTON,66,153,48,10 - CONTROL "DirectShow",IDC_RADIO3,"Button",BS_AUTORADIOBUTTON,117,153,52,10 - CONTROL "Look file extension first",IDC_CHECK5,"Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,191,153,90,10 - CONTROL "Video",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,183,31,10 - CONTROL "Music",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,45,183,31,10 - CONTROL "DVD",IDC_CHECK4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,78,183,29,10 - CONTROL "Audio CD",IDC_CHECK3,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,108,183,43,10 - PUSHBUTTON "&Video",IDC_BUTTON4,176,180,33,14 - PUSHBUTTON "A&udio",IDC_BUTTON3,212,180,33,14 - PUSHBUTTON "A&ll",IDC_BUTTON1,248,180,33,14 - GROUPBOX "Autoplay",IDC_STATIC1,6,170,151,28 -END - -IDD_PPAGETWEAKS DIALOGEX 0, 0, 296, 178 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - CONTROL "Don't use XP-theming on the player controls (needs restart)",IDC_CHECK3, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,9,207,10 - CONTROL "Use the WM ASF Reader for Windows Media files (enables faster seeking, but won't seek with incomplete files at all)",IDC_CHECK2, - "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,7,25,260,17 - GROUPBOX "Jump distances (small, medium, large in ms)",IDC_STATIC,7,50,202,34 - EDITTEXT IDC_EDIT1,15,62,40,14,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER - EDITTEXT IDC_EDIT2,64,62,40,14,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER - EDITTEXT IDC_EDIT3,110,62,40,14,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER - PUSHBUTTON "Default",IDC_BUTTON1,158,62,44,14 - CONTROL "Free window resizing",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,90,83,10 - CONTROL "Send ""Now Playing"" information to MSN Messenger",IDC_CHECK4, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,106,177,10 - CONTROL "Send ""Now Playing"" information to mIRC through GTSdll",IDC_CHECK5, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,122,193,10 - LTEXT "Click here to download GTSdll",IDC_STATICLINKGTS,19,134,95,8 -END - -IDD_PPAGEEXTERNALFILTERS DIALOGEX 0, 0, 296, 200 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - LISTBOX IDC_LIST1,6,5,208,102,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "Add Filter...",IDC_BUTTON1,220,5,69,13 - PUSHBUTTON "Remove",IDC_BUTTON2,220,20,69,13 - CONTROL "Prefer",IDC_RADIO1,"Button",BS_AUTORADIOBUTTON | WS_GROUP,220,39,53,10 - CONTROL "Block",IDC_RADIO2,"Button",BS_AUTORADIOBUTTON,220,50,53,10 - CONTROL "Set merit:",IDC_RADIO3,"Button",BS_AUTORADIOBUTTON,220,61,47,10 - EDITTEXT IDC_EDIT1,220,73,69,12,ES_RIGHT | ES_AUTOHSCROLL | WS_GROUP - PUSHBUTTON "Up",IDC_BUTTON3,220,95,33,13 - PUSHBUTTON "Down",IDC_BUTTON4,256,95,33,13 - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,6,112,283,1 - CONTROL "",IDC_TREE2,"SysTreeView32",TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP,6,117,208,81 - PUSHBUTTON "Add Media Type...",IDC_BUTTON5,220,117,69,13 - PUSHBUTTON "Add Sub Type...",IDC_BUTTON6,220,132,69,13 - PUSHBUTTON "Delete",IDC_BUTTON7,220,147,69,13 - PUSHBUTTON "Reset List",IDC_BUTTON8,220,185,69,13 -END - -IDD_FILEPROPDETAILS DIALOGEX 0, 0, 234, 202 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - ICON "",IDC_DEFAULTICON,8,8,20,20,SS_REALSIZEIMAGE - EDITTEXT IDC_EDIT1,35,16,186,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,8,35,213,1 - LTEXT "Type:",IDC_STATIC,40,42,20,8 - EDITTEXT IDC_EDIT4,73,42,148,13,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER - LTEXT "Size:",IDC_STATIC,44,55,16,8 - EDITTEXT IDC_EDIT3,73,55,148,13,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER - LTEXT "Media length:",IDC_STATIC,16,68,44,8 - EDITTEXT IDC_EDIT2,73,68,148,13,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER - LTEXT "Video size:",IDC_STATIC,25,81,35,8 - EDITTEXT IDC_EDIT5,73,81,148,13,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER - LTEXT "Created:",IDC_STATIC,30,94,30,8 - EDITTEXT IDC_EDIT6,73,94,148,13,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,8,114,213,1 - EDITTEXT IDC_EDIT7,8,121,213,69,ES_MULTILINE | ES_AUTOHSCROLL | ES_READONLY | WS_VSCROLL | WS_HSCROLL -END - -IDD_FILEPROPCLIP DIALOGEX 0, 0, 234, 202 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - ICON "",IDC_DEFAULTICON,8,8,20,20,SS_REALSIZEIMAGE - EDITTEXT IDC_EDIT1,35,16,186,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,8,35,213,1 - LTEXT "Clip:",IDC_STATIC,8,42,15,8 - EDITTEXT IDC_EDIT4,58,42,163,13,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER - LTEXT "Author:",IDC_STATIC,8,55,26,8 - EDITTEXT IDC_EDIT3,58,55,163,13,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER - LTEXT "Copyright:",IDC_STATIC,8,68,35,8 - EDITTEXT IDC_EDIT2,58,68,163,13,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER - LTEXT "Rating:",IDC_STATIC,8,81,24,8 - EDITTEXT IDC_EDIT5,58,81,163,13,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,8,101,213,1 - LTEXT "Location:",IDC_STATIC,8,108,30,8 - EDITTEXT IDC_EDIT6,58,108,163,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,8,123,213,1 - LTEXT "Description:",IDC_STATIC,8,132,39,8 - EDITTEXT IDC_EDIT7,58,132,163,60,ES_MULTILINE | ES_READONLY | WS_VSCROLL -END - -IDD_FAVADD DIALOGEX 0, 0, 252, 70 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Add Favorite" -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - GROUPBOX "Choose a name for your shortcut:",IDC_STATIC,7,7,238,36 - COMBOBOX IDC_COMBO1,15,21,222,77,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP - CONTROL "Remember position",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,51,77,10 - PUSHBUTTON "Cancel",IDCANCEL,139,49,50,14 - DEFPUSHBUTTON "OK",IDOK,195,49,50,14 -END - -IDD_FAVORGANIZE DIALOGEX 0, 0, 276, 174 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Organize Favorites" -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - CONTROL "",IDC_TAB1,"SysTabControl32",0x0,7,7,204,160 - CONTROL "",IDC_LIST2,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_EDITLABELS | LVS_OWNERDRAWFIXED | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP,10,22,197,141,WS_EX_CLIENTEDGE - PUSHBUTTON "Rename",IDC_BUTTON1,219,19,50,14 - PUSHBUTTON "Move Up",IDC_BUTTON3,219,41,50,14 - PUSHBUTTON "Move Down",IDC_BUTTON4,219,59,50,14 - PUSHBUTTON "Delete",IDC_BUTTON2,219,82,50,14 - DEFPUSHBUTTON "OK",IDOK,219,153,50,14 -END - -IDD_PNSPRESET_DLG DIALOGEX 0, 0, 203, 121 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Pan&Scan Presets" -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - LISTBOX IDC_LIST1,7,7,123,50,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP - EDITTEXT IDC_EDIT1,7,60,189,13,ES_AUTOHSCROLL - EDITTEXT IDC_EDIT2,135,18,29,12,ES_CENTER | ES_AUTOHSCROLL - EDITTEXT IDC_EDIT3,167,18,29,12,ES_CENTER | ES_AUTOHSCROLL - EDITTEXT IDC_EDIT4,135,44,29,12,ES_CENTER | ES_AUTOHSCROLL - EDITTEXT IDC_EDIT5,167,44,29,12,ES_CENTER | ES_AUTOHSCROLL - PUSHBUTTON "New",IDC_BUTTON2,7,77,33,12 - PUSHBUTTON "Delete",IDC_BUTTON3,41,77,33,12 - PUSHBUTTON "Up",IDC_BUTTON4,85,77,33,12 - PUSHBUTTON "Down",IDC_BUTTON5,119,77,33,12 - PUSHBUTTON "&Set",IDC_BUTTON1,163,77,33,12 - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,8,93,190,1 - PUSHBUTTON "&Cancel",IDCANCEL,49,100,50,14 - PUSHBUTTON "&Save",IDOK,105,100,50,14 - LTEXT "Pos: 0.0 -> 1.0",IDC_STATIC,135,7,61,8 - LTEXT "Zoom: 0.2 -> 3.0",IDC_STATIC,135,33,61,8 -END - -IDD_PPAGEACCELTBL DIALOGEX 0, 0, 296, 198 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - CONTROL "",IDC_PLACEHOLDER,"Static",SS_BLACKFRAME | NOT WS_VISIBLE,5,5,284,152 - CONTROL "",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,165,10,8 - LTEXT "WinLIRC:",IDC_STATICLINK,19,165,30,8 - EDITTEXT IDC_EDIT1,53,163,77,13,ES_AUTOHSCROLL - CONTROL "",IDC_CHECK9,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,182,10,8 - LTEXT "uICE:",IDC_STATICLINK2,19,182,19,8 - EDITTEXT IDC_EDIT2,53,180,77,13,ES_AUTOHSCROLL - PUSHBUTTON "Select All",IDC_BUTTON1,230,162,59,14 - PUSHBUTTON "Reset Selected",IDC_BUTTON2,230,179,59,14 -END - -IDD_MEDIATYPES_DLG DIALOGEX 0, 0, 296, 219 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_TOOLWINDOW -CAPTION "Warning" -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - LTEXT "Media Player Classic could not render some of the pins in the graph, you may not have the needed codecs or filters installed on the system.",IDC_STATIC1,7,7,282,18 - LTEXT "The following pin(s) failed to find a connectable filter:",IDC_STATIC2,7,28,282,11 - COMBOBOX IDC_COMBO1,7,39,282,87,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - EDITTEXT IDC_EDIT1,7,55,282,138,ES_MULTILINE | ES_AUTOHSCROLL | ES_READONLY | WS_VSCROLL | WS_HSCROLL - DEFPUSHBUTTON "Close",IDOK,239,198,50,14 -END - -IDD_SAVE_DLG DIALOGEX 0, 0, 250, 84 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Saving..." -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - CONTROL "",IDC_ANIMATE1,"SysAnimate32",ACS_CENTER | ACS_TRANSPARENT | WS_TABSTOP,7,3,187,30 - CONTROL "Static",IDC_FROMTO,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,7,38,235,17 - CONTROL "",IDC_PROGRESS1,"msctls_progress32",WS_BORDER,7,63,190,8 - LTEXT "",IDC_REPORT,7,74,189,8 - PUSHBUTTON "Cancel",IDCANCEL,203,62,39,14 -END - -IDD_SAVETEXTFILEDIALOGTEMPL DIALOGEX 0, 0, 304, 20 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - LTEXT "Encoding:",IDC_STATIC,68,2,32,8 - COMBOBOX IDC_COMBO1,130,0,164,46,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP -END - -IDD_SAVETEXTFILEDIALOGTEMPL_400 DIALOGEX 0, 0, 222, 18 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - LTEXT "Encoding:",IDC_STATIC,5,2,32,8 - COMBOBOX IDC_COMBO1,54,0,155,66,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP -END - -IDD_SAVETHUMBSDIALOGTEMPL DIALOGEX 0, 0, 304, 35 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - LTEXT "Thumbnails:",IDC_STATIC,68,2,39,8 - EDITTEXT IDC_EDIT1,130,0,30,13,ES_AUTOHSCROLL - CONTROL "",IDC_SPIN1,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,145,0,11,14 - EDITTEXT IDC_EDIT2,187,0,30,13,ES_AUTOHSCROLL - CONTROL "",IDC_SPIN2,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,203,0,11,14 - LTEXT "rows",IDC_STATIC,164,2,16,8 - LTEXT "columns",IDC_STATIC,221,2,26,8 - EDITTEXT IDC_EDIT3,130,17,36,13,ES_AUTOHSCROLL - CONTROL "",IDC_SPIN3,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,146,17,11,14 - LTEXT "Image width:",IDC_STATIC,68,19,43,8 - LTEXT "pixels",IDC_STATIC,170,19,19,8 -END - -IDD_SAVETHUMBSDIALOGTEMPL_400 DIALOGEX 0, 0, 222, 33 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - LTEXT "Thumbnails:",IDC_STATIC,5,2,39,8 - EDITTEXT IDC_EDIT1,54,0,30,13,ES_AUTOHSCROLL - CONTROL "",IDC_SPIN1,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,69,0,11,14 - EDITTEXT IDC_EDIT2,111,0,30,13,ES_AUTOHSCROLL - CONTROL "",IDC_SPIN2,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,127,0,11,14 - LTEXT "rows",IDC_STATIC,88,2,16,8 - LTEXT "columns",IDC_STATIC,145,2,26,8 - EDITTEXT IDC_EDIT3,54,16,36,13,ES_AUTOHSCROLL - CONTROL "",IDC_SPIN3,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,70,16,11,14 - LTEXT "Image width:",IDC_STATIC,5,18,43,8 - LTEXT "pixels",IDC_STATIC,95,17,19,8 -END - -IDD_COMPROPERTYPAGE DIALOGEX 0, 0, 5, 5 -STYLE DS_SETFONT | WS_CHILD -FONT 8, "MS Sans Serif", 0, 0, 0x0 -BEGIN -END - -IDD_ADDREGFILTER DIALOGEX 0, 0, 285, 182 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_MAXIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Select Filter" -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - CONTROL "",IDC_LIST2,"SysListView32",LVS_LIST | LVS_SINGLESEL | LVS_SORTASCENDING | LVS_ALIGNLEFT | WS_TABSTOP,5,5,275,154,WS_EX_CLIENTEDGE - PUSHBUTTON "Browse...",IDC_BUTTON1,5,163,50,14 - DEFPUSHBUTTON "OK",IDOK,177,163,50,14 - PUSHBUTTON "Cancel",IDCANCEL,230,163,50,14 -END - -IDD_PPAGESUBSTYLE DIALOGEX 0, 0, 296, 198 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - GROUPBOX "Font",IDC_STATIC,4,2,106,123 - PUSHBUTTON "Font",IDC_BUTTON1,11,13,89,13 - COMBOBOX IDC_COMBO1,11,30,90,52,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - LTEXT "Spacing",IDC_STATIC,11,50,26,8 - EDITTEXT IDC_EDIT3,66,48,35,13,ES_RIGHT | ES_AUTOHSCROLL - CONTROL "",IDC_SPIN3,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,93,48,11,14 - LTEXT "Angle (z,°)",IDC_STATIC,11,69,36,8 - EDITTEXT IDC_EDIT4,66,67,35,13,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER - CONTROL "",IDC_SPIN10,"msctls_updown32",UDS_WRAP | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,93,67,11,14 - LTEXT "Scale (x,%)",IDC_STATIC,11,88,39,8 - EDITTEXT IDC_EDIT5,66,86,35,13,ES_RIGHT | ES_AUTOHSCROLL - CONTROL "",IDC_SPIN4,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,93,86,11,14 - LTEXT "Scale (y,%)",IDC_STATIC,11,107,39,8 - EDITTEXT IDC_EDIT6,66,105,35,13,ES_RIGHT | ES_AUTOHSCROLL - CONTROL "",IDC_SPIN5,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,93,105,11,14 - GROUPBOX "Border Style",IDC_STATIC,4,127,106,68 - CONTROL "Outline",IDC_RADIO1,"Button",BS_AUTORADIOBUTTON | WS_GROUP,11,140,39,10 - CONTROL "Opaque box",IDC_RADIO2,"Button",BS_AUTORADIOBUTTON,50,140,52,10 - LTEXT "Border width",IDC_STATIC,13,158,42,8 - EDITTEXT IDC_EDIT1,66,155,35,13,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER - CONTROL "",IDC_SPIN1,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,94,154,11,14 - LTEXT "Shadow depth",IDC_STATIC,13,177,47,8 - EDITTEXT IDC_EDIT2,66,174,35,13,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER - CONTROL "",IDC_SPIN2,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,93,175,11,14 - GROUPBOX "Screen Alignment && Margins",IDC_STATIC,116,2,174,66 - CONTROL "",IDC_RADIO3,"Button",BS_AUTORADIOBUTTON | WS_GROUP,124,37,11,8 - CONTROL "",IDC_RADIO4,"Button",BS_AUTORADIOBUTTON,136,37,11,8 - CONTROL "",IDC_RADIO5,"Button",BS_AUTORADIOBUTTON,148,37,11,8 - CONTROL "",IDC_RADIO6,"Button",BS_AUTORADIOBUTTON,124,26,11,8 - CONTROL "",IDC_RADIO7,"Button",BS_AUTORADIOBUTTON,136,26,11,8 - CONTROL "",IDC_RADIO8,"Button",BS_AUTORADIOBUTTON,148,26,11,8 - CONTROL "",IDC_RADIO9,"Button",BS_AUTORADIOBUTTON,124,15,11,8 - CONTROL "",IDC_RADIO10,"Button",BS_AUTORADIOBUTTON,136,15,11,8 - CONTROL "",IDC_RADIO11,"Button",BS_AUTORADIOBUTTON,148,15,11,8 - LTEXT "Left",IDC_STATIC,166,17,14,8 - EDITTEXT IDC_EDIT7,188,14,30,14,ES_RIGHT | ES_AUTOHSCROLL - CONTROL "",IDC_SPIN6,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,217,14,11,14 - LTEXT "Right",IDC_STATIC,166,34,18,8 - EDITTEXT IDC_EDIT8,188,32,30,14,ES_RIGHT | ES_AUTOHSCROLL - CONTROL "",IDC_SPIN7,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,217,32,11,14 - LTEXT "Top",IDC_STATIC,223,17,13,8 - EDITTEXT IDC_EDIT9,251,14,30,14,ES_RIGHT | ES_AUTOHSCROLL - CONTROL "",IDC_SPIN8,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,280,12,11,14 - LTEXT "Bottom",IDC_STATIC,223,34,24,8 - EDITTEXT IDC_EDIT10,251,32,30,14,ES_RIGHT | ES_AUTOHSCROLL - CONTROL "",IDC_SPIN9,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,280,32,11,14 - GROUPBOX "Colors && Transparency",IDC_STATIC,116,70,174,108 - LTEXT "Primary",IDC_STATIC,123,95,25,8 - CONTROL "",IDC_COLORPRI,"Static",SS_OWNERDRAW | SS_NOTIFY,165,92,16,14,WS_EX_DLGMODALFRAME - CONTROL "",IDC_SLIDER1,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,187,94,92,12 - LTEXT "Secondary",IDC_STATIC,123,112,34,8 - CONTROL "",IDC_COLORSEC,"Static",SS_OWNERDRAW | SS_NOTIFY,165,109,16,14,WS_EX_DLGMODALFRAME - CONTROL "",IDC_SLIDER2,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,187,111,92,12 - LTEXT "Outline",IDC_STATIC,123,129,24,8 - CONTROL "",IDC_COLOROUTL,"Static",SS_OWNERDRAW | SS_NOTIFY,165,126,16,14,WS_EX_DLGMODALFRAME - CONTROL "",IDC_SLIDER3,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,187,128,92,12 - LTEXT "Shadow",IDC_STATIC,123,146,26,8 - CONTROL "",IDC_COLORSHAD,"Static",SS_OWNERDRAW | SS_NOTIFY,165,143,16,14,WS_EX_DLGMODALFRAME - CONTROL "",IDC_SLIDER4,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,187,145,92,12 - CONTROL "Link alpha channels",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,195,161,76,10 - LTEXT "100%",IDC_STATIC,265,83,20,8 - LTEXT "0%",IDC_STATIC,190,83,12,8 - CONTROL "Position subtitles relative to the video frame",IDC_CHECK_RELATIVETO, - "Button",BS_AUTO3STATE | WS_TABSTOP,125,51,157,10 -END - -IDD_PPAGEINTERNALFILTERS DIALOGEX 0, 0, 296, 200 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - GROUPBOX "Source Filters",IDC_STATIC,5,33,130,159 - LTEXT "If you would like to use the stand-alone version from these filters or a some other replacement, disable them here. Filters written bold can be double-clicked to show their property pages.",IDC_STATIC,5,4,269,25 - LISTBOX IDC_LIST1,11,44,118,142,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP - GROUPBOX "Transform Filters",IDC_STATIC,144,33,130,159 - LISTBOX IDC_LIST2,150,44,118,142,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP -END - -IDD_PPAGELOGO DIALOGEX 0, 0, 296, 203 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD -FONT 8, "MS Shell Dlg", 400, 0, 0xEE -BEGIN - CONTROL "",IDC_LOGOPREVIEW,"Static",SS_BITMAP | SS_CENTERIMAGE,5,5,284,150 - CONTROL "Internal:",IDC_RADIO1,"Button",BS_AUTORADIOBUTTON | WS_GROUP,5,164,44,10 - CONTROL "External:",IDC_RADIO2,"Button",BS_AUTORADIOBUTTON,5,181,45,10 - EDITTEXT IDC_LOGOFILENAME,51,179,182,14,ES_AUTOHSCROLL | ES_READONLY - CONTROL "",IDC_SPIN1,"msctls_updown32",UDS_ARROWKEYS | UDS_HORZ,51,163,36,12 - PUSHBUTTON "Browse...",IDC_BUTTON2,239,179,50,14 - RTEXT "",IDC_AUTHOR,95,164,194,9 -END - -IDD_PPAGEOUTPUT DIALOGEX 0, 0, 296, 203 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD -FONT 8, "MS Shell Dlg", 400, 0, 0xEE -BEGIN - GROUPBOX "DirectShow Video",IDC_STATIC,5,2,95,126 - CONTROL "System Default",IDC_DSSYSDEF,"Button",BS_AUTORADIOBUTTON | WS_GROUP,13,15,65,10 - CONTROL "Old Renderer",IDC_DSOLD,"Button",BS_AUTORADIOBUTTON,13,26,59,10 - CONTROL "Overlay Mixer *",IDC_DSOVERLAYMIXER,"Button",BS_AUTORADIOBUTTON,13,37,67,10 - CONTROL "VMR7 (windowed)",IDC_DSVMR7WIN,"Button",BS_AUTORADIOBUTTON,13,48,73,10 - CONTROL "VMR9 (windowed)",IDC_DSVMR9WIN,"Button",BS_AUTORADIOBUTTON,13,59,73,10 - CONTROL "VMR7 (renderless) **",IDC_DSVMR7REN,"Button",BS_AUTORADIOBUTTON,13,70,85,10 - CONTROL "VMR9 (renderless) **",IDC_DSVMR9REN,"Button",BS_AUTORADIOBUTTON,13,81,85,10 - CONTROL "Haali Renderer **",IDC_DSDXR,"Button",BS_AUTORADIOBUTTON,13,92,83,10 - CONTROL "Null (anything)",IDC_DSNULL_COMP,"Button",BS_AUTORADIOBUTTON,13,103,63,10 - CONTROL "Null (uncompressed)",IDC_DSNULL_UNCOMP,"Button",BS_AUTORADIOBUTTON,13,114,81,10 - GROUPBOX "RealMedia Video",IDC_STATIC,105,2,89,50 - CONTROL "System Default *",IDC_RMSYSDEF,"Button",BS_AUTORADIOBUTTON | WS_GROUP,113,14,71,10 - CONTROL "DirectX 7 **",IDC_RMDX7,"Button",BS_AUTORADIOBUTTON,113,25,55,10 - CONTROL "DirectX 9 **",IDC_RMDX9,"Button",BS_AUTORADIOBUTTON,113,36,55,10 - GROUPBOX "QuickTime Video",IDC_STATIC,199,2,89,50 - CONTROL "System Default *",IDC_QTSYSDEF,"Button",BS_AUTORADIOBUTTON | WS_GROUP,207,14,71,10 - CONTROL "DirectX 7 **",IDC_QTDX7,"Button",BS_AUTORADIOBUTTON,207,25,55,10 - CONTROL "DirectX 9 **",IDC_QTDX9,"Button",BS_AUTORADIOBUTTON,207,36,55,10 - GROUPBOX """VMR7/9 (renderless)"" && ""DirectX 7/9"" settings",IDC_STATIC,105,53,183,75 - CONTROL "Use regular offscreen plain surfaces",IDC_REGULARSURF, - "Button",BS_AUTORADIOBUTTON | WS_GROUP,113,64,131,10 - CONTROL "Use texture surfaces and render video in 2D",IDC_TEXTURESURF2D, - "Button",BS_AUTORADIOBUTTON,113,75,158,10 - CONTROL "Use texture surfaces and render video in 3D ***",IDC_TEXTURESURF3D, - "Button",BS_AUTORADIOBUTTON,113,86,172,10 - LTEXT "Resizer:",IDC_STATIC,134,99,27,8 - COMBOBOX IDC_DX9RESIZER_COMBO,163,98,94,49,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - GROUPBOX "DirectShow Audio",IDC_STATIC,5,129,283,28 - COMBOBOX IDC_COMBO1,14,139,266,66,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - CONTROL "Lock back-buffer before presenting (may fix broken vertical syncronization)",IDC_CHECK1, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,160,263,10 - LTEXT "* Saving images does not work with Overlay Mixer.",IDC_STATIC,13,171,220,8 - LTEXT "** Required for the internal subtitle filter, image rotation, and pixelshaders.",IDC_STATIC,13,181,260,8 - LTEXT "*** Required for image rotation and pixelshaders.",IDC_STATIC,13,190,240,8 - CONTROL "VMR9 mixer mode",IDC_DSVMR9LOADMIXER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,113,112,73,10 - CONTROL "YUV mixing",IDC_DSVMR9YUVMIXER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,189,112,49,10 -END - -IDD_AUTH_DLG DIALOGEX 0, 0, 213, 146 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Authentication needed" -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - DEFPUSHBUTTON "OK",IDOK,100,125,50,14 - PUSHBUTTON "Cancel",IDCANCEL,154,125,50,14 - CONTROL 214,IDC_STATIC,"Static",SS_BITMAP,0,0,213,37 - LTEXT "Restricted area",IDC_STATIC,13,48,50,8 - LTEXT "Username:",IDC_STATIC,13,66,36,8 - LTEXT "Password:",IDC_STATIC,13,83,34,8 - COMBOBOX IDC_COMBO1,75,64,129,56,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP - EDITTEXT IDC_EDIT3,75,81,129,13,ES_PASSWORD | ES_AUTOHSCROLL - CONTROL "Remember my password",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,75,99,94,10 -END - -IDD_PPAGEWEBSERVER DIALOGEX 0, 0, 296, 178 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - CONTROL "Listen on port:",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,4,63,10 - EDITTEXT IDC_EDIT1,71,3,40,12,ES_AUTOHSCROLL - LTEXT "Launch in web browser...",IDC_STATIC1,129,5,152,8 - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,7,19,282,1 - CONTROL "Enable compression",IDC_CHECK3,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,25,79,10 - CONTROL "Print debug info",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,51,67,10 - CONTROL "Serve pages from:",IDC_CHECK4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,72,75,10 - EDITTEXT IDC_EDIT2,7,85,183,14,ES_AUTOHSCROLL - PUSHBUTTON "Browse...",IDC_BUTTON1,194,85,45,14 - PUSHBUTTON "Deploy...",IDC_BUTTON2,243,85,46,14 - CONTROL "Allow access from localhost only",IDC_CHECK5,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,38,118,10 - LTEXT "CGI handlers: (.ext1=path1;.ext2=path2;...)",IDC_STATIC,8,132,148,8 - EDITTEXT IDC_EDIT3,7,144,282,14,ES_AUTOHSCROLL - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,7,65,281,1 - LTEXT "Default page:",IDC_STATIC,7,103,45,8 - EDITTEXT IDC_EDIT9,7,114,282,14,ES_AUTOHSCROLL -END - -IDD_SUBTITLEDL_DLG DIALOGEX 0, 0, 377, 158 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Subtitles available online" -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - DEFPUSHBUTTON "Download && Open",IDOK,272,136,98,14 - CONTROL "",IDC_LIST1,"SysListView32",LVS_REPORT | LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,7,7,363,124 - CONTROL "Replace currently loaded subtitles",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,138,124,10 -END - -IDD_FILEPROPRES DIALOGEX 0, 0, 234, 202 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - ICON "",IDC_DEFAULTICON,8,8,21,20,SS_REALSIZEIMAGE - EDITTEXT IDC_EDIT1,35,16,186,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER - CONTROL "",-1,"Static",SS_ETCHEDHORZ,8,35,213,1 - PUSHBUTTON "Save As...",IDC_BUTTON1,8,182,50,14 - CONTROL "",IDC_LIST1,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SORTASCENDING | LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,8,43,213,134 -END - -IDD_SHADERCOMBINE_DLG DIALOGEX 0, 0, 225, 153 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Shader Combiner" -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - LISTBOX IDC_LIST1,7,7,157,117,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP - DEFPUSHBUTTON "OK",IDOK,168,7,50,14 - PUSHBUTTON "Cancel",IDCANCEL,168,23,50,14 - PUSHBUTTON "Move &Up",IDC_BUTTON1,168,57,50,14 - PUSHBUTTON "Move &Down",IDC_BUTTON4,168,73,50,14 - PUSHBUTTON "&Remove",IDC_BUTTON3,168,110,50,14 - CONTROL "",IDC_STATIC1,"Static",SS_ETCHEDHORZ,7,128,211,1 - COMBOBOX IDC_COMBO1,7,133,157,120,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "&Add",IDC_BUTTON2,168,132,50,14 -END - -IDD_SHADEREDITOR_DLG DIALOGEX 0, 0, 198, 71 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - COMBOBOX IDC_COMBO1,0,0,115,51,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP - EDITTEXT IDC_EDIT1,0,15,198,27,ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN | WS_VSCROLL - COMBOBOX IDC_COMBO2,117,0,47,42,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP - EDITTEXT IDC_EDIT2,0,44,198,26,ES_MULTILINE | ES_AUTOHSCROLL | ES_READONLY | WS_VSCROLL - PUSHBUTTON "Delete",IDC_BUTTON1,166,0,32,13 -END - -IDD_SHADERAUTOCOMPLETE_DLG DIALOGEX 0, 0, 99, 81 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_SYSMENU | WS_THICKFRAME -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - LISTBOX IDC_LIST1,0,0,99,81,LBS_SORT | LBS_NOINTEGRALHEIGHT | NOT WS_BORDER | WS_VSCROLL | WS_TABSTOP -END - -IDD_CONVERT_DLG DIALOGEX 0, 0, 322, 190 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME -EXSTYLE WS_EX_ACCEPTFILES -CAPTION "DSM Converter - Right click the empty area to add media files" -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - CONTROL "",IDC_TREE1,"SysTreeView32",TVS_HASBUTTONS | TVS_LINESATROOT | TVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP,5,5,312,138 - PUSHBUTTON "Save &As...",IDC_BUTTON1,267,146,50,14 - EDITTEXT IDC_EDIT1,5,146,259,14,ES_AUTOHSCROLL | ES_READONLY - PUSHBUTTON "Start",IDC_BUTTON2,83,171,50,14 - PUSHBUTTON "Pause",IDC_BUTTON3,136,171,50,14 - PUSHBUTTON "Stop",IDC_BUTTON4,188,171,50,14 - CONTROL "",IDC_HLINE,"Static",SS_ETCHEDHORZ,5,165,310,1 -END - -IDD_CONVERTPROPS_DLG DIALOGEX 0, 0, 266, 145 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Properties" -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - PUSHBUTTON "OK",IDOK,81,125,50,14 - PUSHBUTTON "Cancel",IDCANCEL,133,125,50,14 - COMBOBOX IDC_COMBO1,7,7,48,82,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP - EDITTEXT IDC_EDIT1,56,7,167,13,ES_AUTOHSCROLL - DEFPUSHBUTTON "Set",IDC_BUTTON1,225,7,34,13 - CONTROL "",IDC_LIST1,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,7,22,252,98 -END - -IDD_CONVERTRES_DLG DIALOGEX 0, 0, 230, 126 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Resource" -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - DEFPUSHBUTTON "OK",IDOK,64,106,50,14 - PUSHBUTTON "Cancel",IDCANCEL,116,106,50,14 - COMBOBOX IDC_COMBO1,7,40,216,30,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP - EDITTEXT IDC_EDIT2,7,65,216,36,ES_MULTILINE | ES_AUTOHSCROLL | ES_WANTRETURN - EDITTEXT IDC_EDIT3,7,16,216,13,ES_AUTOHSCROLL - LTEXT "Name",IDC_STATIC,7,6,19,8 - LTEXT "Mime",IDC_STATIC,7,30,17,8 - LTEXT "Description",IDC_STATIC,7,55,36,8 -END - -IDD_CONVERTCHAP_DLG DIALOGEX 0, 0, 213, 46 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Chapter" -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - DEFPUSHBUTTON "OK",IDOK,55,25,50,14 - PUSHBUTTON "Cancel",IDCANCEL,107,25,50,14 - EDITTEXT IDC_EDIT2,72,7,134,13,ES_AUTOHSCROLL - EDITTEXT IDC_EDIT1,7,7,61,13,ES_AUTOHSCROLL -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO -BEGIN - IDD_SELECTMEDIATYPE, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 218 - TOPMARGIN, 7 - BOTTOMMARGIN, 40 - END - - IDD_OPENCAPDEVICE_DLG, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 219 - VERTGUIDE, 12 - VERTGUIDE, 47 - VERTGUIDE, 212 - TOPMARGIN, 7 - BOTTOMMARGIN, 124 - END - - IDD_CAPTURE_DLG, DIALOG - BEGIN - RIGHTMARGIN, 125 - VERTGUIDE, 3 - VERTGUIDE, 10 - VERTGUIDE, 47 - VERTGUIDE, 50 - VERTGUIDE, 72 - VERTGUIDE, 74 - VERTGUIDE, 112 - VERTGUIDE, 119 - END - - IDD_PPAGEAUDIOSWITCHER, DIALOG - BEGIN - VERTGUIDE, 7 - VERTGUIDE, 289 - BOTTOMMARGIN, 193 - END - - IDD_GOTO_DLG, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 150 - VERTGUIDE, 31 - VERTGUIDE, 114 - TOPMARGIN, 7 - BOTTOMMARGIN, 106 - END - - IDD_OPEN_DLG, DIALOG - BEGIN - VERTGUIDE, 7 - VERTGUIDE, 33 - VERTGUIDE, 182 - VERTGUIDE, 187 - VERTGUIDE, 234 - BOTTOMMARGIN, 84 - HORZGUIDE, 9 - END - - IDD_ABOUTBOX, DIALOG - BEGIN - VERTGUIDE, 40 - VERTGUIDE, 210 - END - - IDD_PPAGEPLAYER, DIALOG - BEGIN - VERTGUIDE, 15 - VERTGUIDE, 140 - VERTGUIDE, 289 - BOTTOMMARGIN, 192 - END - - IDD_PPAGEDVD, DIALOG - BEGIN - VERTGUIDE, 5 - VERTGUIDE, 15 - VERTGUIDE, 240 - HORZGUIDE, 57 - END - - IDD_PPAGEPLAYBACK, DIALOG - BEGIN - VERTGUIDE, 5 - VERTGUIDE, 13 - VERTGUIDE, 137 - VERTGUIDE, 193 - VERTGUIDE, 289 - END - - IDD_PPAGESUBTITLES, DIALOG - BEGIN - VERTGUIDE, 5 - VERTGUIDE, 14 - VERTGUIDE, 281 - VERTGUIDE, 289 - BOTTOMMARGIN, 200 - END - - IDD_PPAGESUBDB, DIALOG - BEGIN - VERTGUIDE, 5 - VERTGUIDE, 289 - BOTTOMMARGIN, 200 - END - - IDD_PPAGEFORMATS, DIALOG - BEGIN - VERTGUIDE, 6 - VERTGUIDE, 13 - VERTGUIDE, 281 - VERTGUIDE, 289 - END - - IDD_PPAGETWEAKS, DIALOG - BEGIN - RIGHTMARGIN, 289 - VERTGUIDE, 7 - VERTGUIDE, 15 - VERTGUIDE, 289 - END - - IDD_FILEPROPDETAILS, DIALOG - BEGIN - VERTGUIDE, 8 - VERTGUIDE, 60 - VERTGUIDE, 73 - VERTGUIDE, 221 - HORZGUIDE, 42 - HORZGUIDE, 55 - HORZGUIDE, 68 - HORZGUIDE, 81 - HORZGUIDE, 94 - END - - IDD_FILEPROPCLIP, DIALOG - BEGIN - VERTGUIDE, 8 - VERTGUIDE, 35 - VERTGUIDE, 58 - VERTGUIDE, 221 - HORZGUIDE, 42 - HORZGUIDE, 55 - HORZGUIDE, 68 - HORZGUIDE, 81 - HORZGUIDE, 108 - END - - IDD_FAVADD, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 245 - TOPMARGIN, 7 - BOTTOMMARGIN, 63 - END - - IDD_FAVORGANIZE, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 269 - TOPMARGIN, 7 - BOTTOMMARGIN, 167 - END - - IDD_PNSPRESET_DLG, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 196 - VERTGUIDE, 135 - VERTGUIDE, 168 - VERTGUIDE, 196 - TOPMARGIN, 7 - BOTTOMMARGIN, 114 - END - - IDD_PPAGEACCELTBL, DIALOG - BEGIN - VERTGUIDE, 5 - VERTGUIDE, 289 - BOTTOMMARGIN, 197 - HORZGUIDE, 169 - HORZGUIDE, 186 - END - - IDD_MEDIATYPES_DLG, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 289 - TOPMARGIN, 7 - BOTTOMMARGIN, 212 - END - - IDD_SAVE_DLG, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 242 - TOPMARGIN, 3 - BOTTOMMARGIN, 82 - END - - IDD_SAVETHUMBSDIALOGTEMPL, DIALOG - BEGIN - VERTGUIDE, 68 - VERTGUIDE, 130 - END - - IDD_SAVETHUMBSDIALOGTEMPL_400, DIALOG - BEGIN - VERTGUIDE, 5 - VERTGUIDE, 54 - BOTTOMMARGIN, 30 - END - - IDD_ADDREGFILTER, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 280 - TOPMARGIN, 5 - BOTTOMMARGIN, 177 - HORZGUIDE, 159 - END - - IDD_PPAGEINTERNALFILTERS, DIALOG - BEGIN - VERTGUIDE, 5 - VERTGUIDE, 274 - VERTGUIDE, 289 - HORZGUIDE, 29 - HORZGUIDE, 33 - HORZGUIDE, 44 - HORZGUIDE, 186 - HORZGUIDE, 192 - HORZGUIDE, 198 - END - - IDD_PPAGELOGO, DIALOG - BEGIN - VERTGUIDE, 5 - VERTGUIDE, 289 - BOTTOMMARGIN, 200 - HORZGUIDE, 5 - HORZGUIDE, 155 - HORZGUIDE, 163 - END - - IDD_PPAGEOUTPUT, DIALOG - BEGIN - VERTGUIDE, 5 - VERTGUIDE, 13 - VERTGUIDE, 288 - BOTTOMMARGIN, 200 - END - - IDD_AUTH_DLG, DIALOG - BEGIN - VERTGUIDE, 13 - VERTGUIDE, 75 - VERTGUIDE, 204 - BOTTOMMARGIN, 139 - END - - IDD_PPAGEWEBSERVER, DIALOG - BEGIN - RIGHTMARGIN, 289 - VERTGUIDE, 7 - VERTGUIDE, 289 - END - - IDD_SUBTITLEDL_DLG, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 370 - TOPMARGIN, 7 - BOTTOMMARGIN, 151 - END - - IDD_FILEPROPRES, DIALOG - BEGIN - VERTGUIDE, 8 - VERTGUIDE, 35 - VERTGUIDE, 221 - END - - IDD_SHADERCOMBINE_DLG, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 218 - VERTGUIDE, 164 - TOPMARGIN, 7 - BOTTOMMARGIN, 146 - END - - IDD_SHADEREDITOR_DLG, DIALOG - BEGIN - BOTTOMMARGIN, 70 - END - - IDD_CONVERT_DLG, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 317 - VERTGUIDE, 12 - TOPMARGIN, 5 - BOTTOMMARGIN, 185 - END - - IDD_CONVERTPROPS_DLG, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 259 - TOPMARGIN, 7 - BOTTOMMARGIN, 139 - END - - IDD_CONVERTRES_DLG, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 223 - TOPMARGIN, 6 - BOTTOMMARGIN, 120 - END - - IDD_CONVERTCHAP_DLG, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 206 - TOPMARGIN, 7 - BOTTOMMARGIN, 39 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Bitmap -// - -IDB_ONOFF BITMAP "res\\onoff.bmp" -IDB_PLAYERTOOLBAR BITMAP "res\\toolbar1.bmp" -IDB_MONO BITMAP "res\\mono.bmp" -IDB_STEREO BITMAP "res\\stereo.bmp" -IDB_NOAUDIO BITMAP "res\\noaudio.bmp" -IDB_AUTHHDRPIC BITMAP "res\\authhdrpic.bmp" -IDB_STREAMTYPES BITMAP "res\\streamtypes.bmp" - -///////////////////////////////////////////////////////////////////////////// -// -// FILE -// - -IDF_SHADER_EMPTY FILE "res\\shaders\\empty.psh" -IDF_SHADER_CONTOUR FILE "res\\shaders\\contour.psh" -IDF_SHADER_DEINTERLACE FILE "res\\shaders\\deinterlace (blend).psh" -IDF_SHADER_EMBOSS FILE "res\\shaders\\emboss.psh" -IDF_SHADER_GRAYSCALE FILE "res\\shaders\\grayscale.psh" -IDF_SHADER_INVERT FILE "res\\shaders\\invert.psh" -IDF_SHADER_LETTERBOX FILE "res\\shaders\\letterbox.psh" -IDF_SHADER_PROCAMP FILE "res\\shaders\\procamp.psh" -IDF_SHADER_SHARPEN FILE "res\\shaders\\sharpen.psh" -IDF_SHADER_SPHERE FILE "res\\shaders\\sphere.psh" -IDF_SHADER_SPOTLIGHT FILE "res\\shaders\\spotlight.psh" -IDF_SHADER_WAVE FILE "res\\shaders\\wave.psh" -IDF_SHADER_LEVELS FILE "res\\shaders\\levels.psh" -IDF_SHADER_NIGHTVISION FILE "res\\shaders\\nightvision.psh" -IDF_SHADER_EDGE_SHARPEN FILE "res\\shaders\\EdgeSharpen.psh" -IDF_SHADER_SHARPEN_COMPLEX FILE "res\\shaders\\SharpenComplex.psh" -IDF_DEFAULT_CSS FILE "res\\web\\default.css" -IDF_VBR_GIF FILE "res\\web\\vbg.gif" -IDF_VBS_GIF FILE "res\\web\\vbs.GIF" -IDF_SLIDERBAR_GIF FILE "res\\web\\sliderbar.gif" -IDF_SLIDERGRIP_GIF FILE "res\\web\\slidergrip.gif" -IDF_1PIX_GIF FILE "res\\web\\1pix.gif" -IDF_SLIDERBACK_GIF FILE "res\\web\\sliderback.gif" -IDF_HEADERICON_PNG FILE "res\\web\\headericon.png" -IDF_HEADERBACK_PNG FILE "res\\web\\headerback.png" -IDF_HEADERCLOSE_PNG FILE "res\\web\\headerclose.png" -IDF_LEFTSIDE_PNG FILE "res\\web\\leftside.png" -IDF_RIGHTSIDE_PNG FILE "res\\web\\rightside.png" -IDF_BOTTOMSIDE_PNG FILE "res\\web\\bottomside.png" -IDF_LEFTBOTTOMSIDE_PNG FILE "res\\web\\leftbottomside.png" -IDF_RIGHTBOTTOMSIDE_PNG FILE "res\\web\\rightbottomside.png" -IDF_SEEKBARLEFT_PNG FILE "res\\web\\seekbarleft.png" -IDF_SEEKBARMID_PNG FILE "res\\web\\seekbarmid.png" -IDF_SEEKBARRIGHT_PNG FILE "res\\web\\seekbarright.png" -IDF_SEEKBARGRIP_PNG FILE "res\\web\\seekbargrip.png" -IDF_CONTROLBACK_PNG FILE "res\\web\\controlback.png" -IDF_CONTROLBUTTONPLAY_PNG FILE "res\\web\\controlbuttonplay.png" -IDF_CONTROLBUTTONPAUSE_PNG FILE "res\\web\\controlbuttonpause.png" -IDF_CONTROLBUTTONSTOP_PNG FILE "res\\web\\controlbuttonstop.png" -IDF_CONTROLBUTTONSKIPBACK_PNG FILE "res\\web\\controlbuttonskipback.png" -IDF_CONTROLBUTTONDECRATE_PNG FILE "res\\web\\controlbuttondecrate.png" -IDF_CONTROLBUTTONINCRATE_PNG FILE "res\\web\\controlbuttonincrate.png" -IDF_CONTROLBUTTONSKIPFORWARD_PNG FILE "res\\web\\controlbuttonskipforward.png" -IDF_CONTROLBUTTONSTEP_PNG FILE "res\\web\\controlbuttonstep.png" -IDF_CONTROLVOLUMEON_PNG FILE "res\\web\\controlvolumeon.png" -IDF_CONTROLVOLUMEOFF_PNG FILE "res\\web\\controlvolumeoff.png" -IDF_CONTROLVOLUMEBAR_PNG FILE "res\\web\\controlvolumebar.png" -IDF_CONTROLVOLUMEGRIP_PNG FILE "res\\web\\controlvolumegrip.png" -IDF_SHADER_RESIZER FILE "res\\shaders\\resizer.psh" -IDF_LOGO0 FILE "res\\logo.0.png" -IDF_LOGO1 FILE "res\\logo.1.png" -IDF_LOGO2 FILE "res\\logo.2.png" -IDF_LOGO3 FILE "res\\logo.3.png" -IDF_LOGO4 FILE "res\\logo.4.png" -IDF_LOGO5 FILE "res\\logo.5.png" -IDF_LOGO6 FILE "res\\logo.6.png" -IDF_LOGO7 FILE "res\\logo.7.png" - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDR_MAINFRAME ICON "res\\icon.ico" -IDI_SINGLE ICON "res\\single.ico" -IDI_MULTI ICON "res\\multi.ico" -IDI_AUDIOCD ICON "res\\Icon_41.ico" -IDI_DVD ICON "res\\Icon_114.ico" -IDI_UNKNOWN ICON "res\\Icon_116.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// Toolbar -// - -IDB_PLAYERTOOLBAR TOOLBAR 16, 16 -BEGIN - BUTTON ID_PLAY_PLAY - BUTTON ID_PLAY_PAUSE - BUTTON ID_PLAY_STOP - BUTTON ID_BUTTONSEP - BUTTON ID_NAVIGATE_SKIPBACK - BUTTON ID_PLAY_DECRATE - BUTTON ID_PLAY_INCRATE - BUTTON ID_NAVIGATE_SKIPFORWARD - BUTTON ID_BUTTONSEP - BUTTON ID_PLAY_FRAMESTEP - BUTTON ID_BUTTONSEP - BUTTON ID_DUMMYSEPARATOR - BUTTON ID_VOLUME_MUTE - BUTTON ID_VOLUME_MUTE_ON - BUTTON ID_VOLUME_MUTE_DISABLED -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog Info -// - -IDD_PPAGEPLAYBACK DLGINIT -BEGIN - IDC_COMBO1, 0x403, 4, 0 -0x3035, 0x0025, - IDC_COMBO1, 0x403, 5, 0 -0x3031, 0x2530, "\000" - IDC_COMBO1, 0x403, 5, 0 -0x3032, 0x2530, "\000" - IDC_COMBO1, 0x403, 9, 0 -0x7541, 0x6f74, 0x4620, 0x7469, "\000" - 0 -END - -IDD_PPAGEOUTPUT DLGINIT -BEGIN - IDC_DX9RESIZER_COMBO, 0x403, 17, 0 -0x654e, 0x7261, 0x7365, 0x2074, 0x656e, 0x6769, 0x6268, 0x726f, "\000" - IDC_DX9RESIZER_COMBO, 0x403, 9, 0 -0x6942, 0x696c, 0x656e, 0x7261, "\000" - IDC_DX9RESIZER_COMBO, 0x403, 18, 0 -0x6942, 0x696c, 0x656e, 0x7261, 0x2820, 0x5350, 0x3220, 0x302e, 0x0029, - - IDC_DX9RESIZER_COMBO, 0x403, 25, 0 -0x6942, 0x7563, 0x6962, 0x2063, 0x3d41, 0x302d, 0x362e, 0x2030, 0x5028, -0x2053, 0x2e32, 0x2930, "\000" - IDC_DX9RESIZER_COMBO, 0x403, 25, 0 -0x6942, 0x7563, 0x6962, 0x2063, 0x3d41, 0x302d, 0x372e, 0x2035, 0x5028, -0x2053, 0x2e32, 0x2930, "\000" - IDC_DX9RESIZER_COMBO, 0x403, 25, 0 -0x6942, 0x7563, 0x6962, 0x2063, 0x3d41, 0x312d, 0x302e, 0x2030, 0x5028, -0x2053, 0x2e32, 0x2930, "\000" - 0 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 6,4,9,1 - PRODUCTVERSION 6,4,9,1 - FILEFLAGSMASK 0x1fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x4L - FILETYPE 0x1L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "CompanyName", "Gabest" - VALUE "FileDescription", "Media Player Classic" - VALUE "FileVersion", "6, 4, 9, 1" - VALUE "InternalName", "Media Player Classic" - VALUE "LegalCopyright", "Copyright (C) 2002-2009 Gabest et al." - VALUE "OriginalFilename", "mplayerc.exe" - VALUE "ProductName", "Media Player Classic" - VALUE "ProductVersion", "6, 4, 9, 1" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Menu -// - -IDR_MAINFRAME MENU -BEGIN - POPUP "&File" - BEGIN - MENUITEM "&Quick Open File...\tCtrl+Q", ID_FILE_OPENQUICK - MENUITEM SEPARATOR - MENUITEM "&Open File...\tCtrl+O", ID_FILE_OPENMEDIA - MENUITEM "Open &DVD...\tCtrl+D", ID_FILE_OPENDVD - MENUITEM "Open De&vice...\tCtrl+V", ID_FILE_OPENDEVICE - MENUITEM "O&pen Disc", 65535 - MENUITEM "&Close", ID_FILE_CLOSEPLAYLIST - MENUITEM SEPARATOR - MENUITEM "&Save As...", ID_FILE_SAVE_COPY - MENUITEM "Save &Image...", ID_FILE_SAVE_IMAGE - MENUITEM "Save Thumbnails...", ID_FILE_SAVE_THUMBNAILS - MENUITEM SEPARATOR - MENUITEM "&Load Subtitle...\tCtrl+L", ID_FILE_LOAD_SUBTITLE - MENUITEM "Save Subtitle...\tCtrl+S", ID_FILE_SAVE_SUBTITLE - POPUP "Subtitle Database" - BEGIN - MENUITEM "Search...", ID_FILE_ISDB_SEARCH - MENUITEM "Upload...", ID_FILE_ISDB_UPLOAD - MENUITEM "Download...", ID_FILE_ISDB_DOWNLOAD - END - MENUITEM SEPARATOR - MENUITEM "P&roperties", ID_FILE_PROPERTIES - MENUITEM SEPARATOR - POPUP "Utils" - BEGIN - MENUITEM "DSM Co&nverter...", ID_FILE_CONVERT - END - MENUITEM SEPARATOR - MENUITEM "E&xit\tAlt+X", ID_FILE_EXIT - END - POPUP "&View" - BEGIN - MENUITEM "Caption&&Menu\tCtrl+0", ID_VIEW_CAPTIONMENU - MENUITEM "&Seek Bar\tCtrl+1", ID_VIEW_SEEKER - MENUITEM "Cont&rols\tCtrl+2", ID_VIEW_CONTROLS - MENUITEM "&Information\tCtrl+3", ID_VIEW_INFORMATION - MENUITEM "S&tatistics\tCtrl+4", ID_VIEW_STATISTICS - MENUITEM "St&atus\tCtrl+5", ID_VIEW_STATUS - MENUITEM "Subresync\tCtrl+6", ID_VIEW_SUBRESYNC - MENUITEM "Playlist\tCtrl+7", ID_VIEW_PLAYLIST - MENUITEM "Capture\tCtrl+8", ID_VIEW_CAPTURE - MENUITEM "Shader Editor\tCtrl+9", ID_VIEW_SHADEREDITOR - POPUP "Presets..." - BEGIN - MENUITEM "Minimal", ID_VIEW_PRESETS_MINIMAL - MENUITEM "Compact", ID_VIEW_PRESETS_COMPACT - MENUITEM "Normal", ID_VIEW_PRESETS_NORMAL - END - MENUITEM SEPARATOR - MENUITEM "Fu&ll Screen\tAlt+Enter", ID_VIEW_FULLSCREEN - POPUP "&Zoom" - BEGIN - MENUITEM "&50%\tAlt+1", ID_VIEW_ZOOM_50 - MENUITEM "&100%\tAlt+2", ID_VIEW_ZOOM_100 - MENUITEM "&200%\tAlt+3", ID_VIEW_ZOOM_200 - MENUITEM "Auto Fit\tAlt+4", ID_VIEW_ZOOM_AUTOFIT - END - MENUITEM SEPARATOR - POPUP "&Video Frame" - BEGIN - MENUITEM "&Half Size", ID_VIEW_VF_HALF - MENUITEM "&Normal Size", ID_VIEW_VF_NORMAL - MENUITEM "&Double Size", ID_VIEW_VF_DOUBLE - MENUITEM "&Stretch To Window", ID_VIEW_VF_STRETCH - MENUITEM "Touch Window From &Inside", ID_VIEW_VF_FROMINSIDE - MENUITEM "Touch Window From &Outside", ID_VIEW_VF_FROMOUTSIDE - MENUITEM SEPARATOR - MENUITEM "&Keep Aspect Ratio", ID_VIEW_VF_KEEPASPECTRATIO - POPUP "Override Aspect Ratio" - BEGIN - MENUITEM "Default", ID_ASPECTRATIO_SOURCE - MENUITEM "4:3", ID_ASPECTRATIO_4_3 - MENUITEM "5:4", ID_ASPECTRATIO_5_4 - MENUITEM "16:9", ID_ASPECTRATIO_16_9 - END - MENUITEM "Correct Monitor/Desktop AR Diff", ID_VIEW_VF_COMPMONDESKARDIFF - END - POPUP "Pan&&S&can" - BEGIN - MENUITEM "Increase Size\tNumpad 9", ID_VIEW_INCSIZE - MENUITEM "Decrease Size\tNumpad 1", ID_VIEW_DECSIZE - MENUITEM "Increase Width\tNumpad 6", ID_VIEW_INCWIDTH - MENUITEM "Decrease Width\tNumpad 4", ID_VIEW_DECWIDTH - MENUITEM "Increase Height\tNumpad 8", ID_VIEW_INCHEIGHT - MENUITEM "Decrease Height\tNumpad 2", ID_VIEW_DECHEIGHT - MENUITEM SEPARATOR - MENUITEM "Move Right\tCtrl+Numpad 6", ID_PANSCAN_MOVERIGHT - MENUITEM "Move Left\tCtrl+Numpad 4", ID_PANSCAN_MOVELEFT - MENUITEM "Move Up\tCtrl+Numpad 8", ID_PANSCAN_MOVEUP - MENUITEM "Move Down\tCtrl+Numpad 2", ID_PANSCAN_MOVEDOWN - MENUITEM "Center\tCtrl+Numpad 5", ID_PANSCAN_CENTER - MENUITEM SEPARATOR - MENUITEM "Reset\tNumpad 5", ID_VIEW_RESET - END - MENUITEM SEPARATOR - POPUP "On Top" - BEGIN - MENUITEM "Never", ID_ONTOP_NEVER - MENUITEM "Always", ID_ONTOP_ALWAYS - MENUITEM "While Playing", ID_ONTOP_WHILEPLAYING - END - MENUITEM "&Options...", ID_VIEW_OPTIONS - END - POPUP "&Play" - BEGIN - MENUITEM "&Play/Pause\tSpace", ID_PLAY_PLAYPAUSE - MENUITEM "&Stop\tPeriod", ID_PLAY_STOP - MENUITEM "F&rame Step\tRight", ID_PLAY_FRAMESTEP - MENUITEM "&Go To...\tCtrl+G", ID_PLAY_GOTO - MENUITEM SEPARATOR - MENUITEM "&Decrease Rate\tCtrl+Down", ID_PLAY_DECRATE - MENUITEM "&Increase Rate\tCtrl+Up", ID_PLAY_INCRATE - MENUITEM "Reset Rate\tCtrl+R", ID_PLAY_RESETRATE - MENUITEM SEPARATOR - MENUITEM "&Filters", 65535 - MENUITEM "S&haders", 65535 - MENUITEM SEPARATOR - MENUITEM "&Audio", 65535 - MENUITEM "Su&btitles", 65535 - MENUITEM SEPARATOR - POPUP "Vol&ume" - BEGIN - MENUITEM "&Up\tUp Arrow", ID_VOLUME_UP - MENUITEM "&Down\tDown Arrow", ID_VOLUME_DOWN - MENUITEM "&Mute\tCtrl+M", ID_VOLUME_MUTE - END - POPUP "After Playback" - BEGIN - MENUITEM "Close ", ID_AFTERPLAYBACK_CLOSE - MENUITEM "Stand By", ID_AFTERPLAYBACK_STANDBY - MENUITEM "Hibernate", ID_AFTERPLAYBACK_HIBERNATE - MENUITEM "Shutdown", ID_AFTERPLAYBACK_SHUTDOWN - MENUITEM "Log Off", ID_AFTERPLAYBACK_LOGOFF - MENUITEM SEPARATOR - MENUITEM "Do Nothing", ID_AFTERPLAYBACK_DONOTHING - END - END - POPUP "&Navigate" - BEGIN - MENUITEM "&Previous\tPage Up", ID_NAVIGATE_SKIPBACK - MENUITEM "&Next\tPage Down", ID_NAVIGATE_SKIPFORWARD - MENUITEM "&Jump To...", 65535 - MENUITEM SEPARATOR - MENUITEM "A&udio Language", 65535 - MENUITEM "Su&btitle Language", 65535 - MENUITEM "Video Ang&le", 65535 - MENUITEM SEPARATOR - MENUITEM "Title Menu", ID_NAVIGATE_TITLEMENU - MENUITEM "&Root Menu", ID_NAVIGATE_ROOTMENU - MENUITEM "&Subtitle Menu", ID_NAVIGATE_SUBPICTUREMENU - MENUITEM "&Audio Menu", ID_NAVIGATE_AUDIOMENU - MENUITEM "An&gle Menu", ID_NAVIGATE_ANGLEMENU - MENUITEM "&Chapter Menu", ID_NAVIGATE_CHAPTERMENU - END - MENUITEM "F&avorites", ID_FAVORITES - POPUP "&Help" - BEGIN - MENUITEM "Home Page", ID_HELP_HOMEPAGE - MENUITEM "Documentation (sf.net)", ID_HELP_DOCUMENTATION - MENUITEM "Command Line Switches", ID_HELP_SHOWCOMMANDLINESWITCHES - MENUITEM SEPARATOR - MENUITEM "&About...", ID_HELP_ABOUT - END -END - -IDR_POPUP MENU -BEGIN - POPUP "" - BEGIN - MENUITEM "&Play/Pause", ID_PLAY_PLAYPAUSE - MENUITEM "&Stop", ID_PLAY_STOP - MENUITEM SEPARATOR - MENUITEM "Fu&ll Screen", ID_VIEW_FULLSCREEN - POPUP "&Zoom" - BEGIN - MENUITEM "&50%\tAlt+1", ID_VIEW_ZOOM_50 - MENUITEM "&100%\tAlt+2", ID_VIEW_ZOOM_100 - MENUITEM "&200%\tAlt+3", ID_VIEW_ZOOM_200 - MENUITEM "Auto Fit\tAlt+4", ID_VIEW_ZOOM_AUTOFIT - END - MENUITEM SEPARATOR - POPUP "&Video Frame" - BEGIN - MENUITEM "&Half Size", ID_VIEW_VF_HALF - MENUITEM "&Normal Size", ID_VIEW_VF_NORMAL - MENUITEM "&Double Size", ID_VIEW_VF_DOUBLE - MENUITEM "&Stretch To Window", ID_VIEW_VF_STRETCH - MENUITEM "Touch Window From &Inside", ID_VIEW_VF_FROMINSIDE - MENUITEM "Touch Window From &Outside", ID_VIEW_VF_FROMOUTSIDE - MENUITEM SEPARATOR - MENUITEM "&Keep Aspect Ratio", ID_VIEW_VF_KEEPASPECTRATIO - POPUP "Override Aspect Ratio" - BEGIN - MENUITEM "Default", ID_ASPECTRATIO_SOURCE - MENUITEM "4:3", ID_ASPECTRATIO_4_3 - MENUITEM "5:4", ID_ASPECTRATIO_5_4 - MENUITEM "16:9", ID_ASPECTRATIO_16_9 - END - MENUITEM "Correct Monitor/Desktop AR Diff", ID_VIEW_VF_COMPMONDESKARDIFF - END - POPUP "Pan&&S&can" - BEGIN - MENUITEM "Increase Size\tNumpad 9", ID_VIEW_INCSIZE - MENUITEM "Decrease Size\tNumpad 1", ID_VIEW_DECSIZE - MENUITEM "Increase Width\tNumpad 6", ID_VIEW_INCWIDTH - MENUITEM "Decrease Width\tNumpad 4", ID_VIEW_DECWIDTH - MENUITEM "Increase Height\tNumpad 8", ID_VIEW_INCHEIGHT - MENUITEM "Decrease Height\tNumpad 2", ID_VIEW_DECHEIGHT - MENUITEM SEPARATOR - MENUITEM "Move Right\tCtrl+Numpad 6", ID_PANSCAN_MOVERIGHT - MENUITEM "Move Left\tCtrl+Numpad 4", ID_PANSCAN_MOVELEFT - MENUITEM "Move Up\tCtrl+Numpad 8", ID_PANSCAN_MOVEUP - MENUITEM "Move Down\tCtrl+Numpad 2", ID_PANSCAN_MOVEDOWN - MENUITEM "Center\tCtrl+Numpad 5", ID_PANSCAN_CENTER - MENUITEM SEPARATOR - MENUITEM "Reset\tNumpad 5", ID_VIEW_RESET - END - MENUITEM SEPARATOR - POPUP "&Navigate" - BEGIN - MENUITEM "&Previous\tPage Up", ID_NAVIGATE_SKIPBACK - MENUITEM "&Next\tPage Down", ID_NAVIGATE_SKIPFORWARD - MENUITEM "&Jump To...", 65535 - MENUITEM SEPARATOR - MENUITEM "A&udio Language", 65535 - MENUITEM "Su&btitle Language", 65535 - MENUITEM "Video Ang&le", 65535 - MENUITEM SEPARATOR - MENUITEM "&Title Menu", ID_NAVIGATE_TITLEMENU - MENUITEM "&Root Menu", ID_NAVIGATE_ROOTMENU - MENUITEM "&Subtitle Menu", ID_NAVIGATE_SUBPICTUREMENU - MENUITEM "&Audio Menu", ID_NAVIGATE_AUDIOMENU - MENUITEM "An&gle Menu", ID_NAVIGATE_ANGLEMENU - MENUITEM "&Chapter Menu", ID_NAVIGATE_CHAPTERMENU - END - MENUITEM "&Favorites", 65535 - MENUITEM SEPARATOR - MENUITEM "F&ilters", 65535 - MENUITEM "S&haders", 65535 - MENUITEM SEPARATOR - MENUITEM "&Audio", 65535 - MENUITEM "Su&btitles", 65535 - MENUITEM SEPARATOR - POPUP "Vol&ume" - BEGIN - MENUITEM "&Up\tUp Arrow", ID_VOLUME_UP - MENUITEM "&Down\tDown Arrow", ID_VOLUME_DOWN - MENUITEM "&Mute\tCtrl+M", ID_VOLUME_MUTE - END - POPUP "After Playback" - BEGIN - MENUITEM "Close ", ID_AFTERPLAYBACK_CLOSE - MENUITEM "Stand By", ID_AFTERPLAYBACK_STANDBY - MENUITEM "Hibernate", ID_AFTERPLAYBACK_HIBERNATE - MENUITEM "Shutdown", ID_AFTERPLAYBACK_SHUTDOWN - MENUITEM "Log Off", ID_AFTERPLAYBACK_LOGOFF - MENUITEM SEPARATOR - MENUITEM "Do Nothing", ID_AFTERPLAYBACK_DONOTHING - END - MENUITEM SEPARATOR - POPUP "Vi&ew" - BEGIN - POPUP "On Top" - BEGIN - MENUITEM "Never", ID_ONTOP_NEVER - MENUITEM "Always", ID_ONTOP_ALWAYS - MENUITEM "While Playing", ID_ONTOP_WHILEPLAYING - END - MENUITEM SEPARATOR - MENUITEM "Caption&&Menu", ID_VIEW_CAPTIONMENU - MENUITEM "Seek Bar", ID_VIEW_SEEKER - MENUITEM "Cont&rols", ID_VIEW_CONTROLS - MENUITEM "&Information", ID_VIEW_INFORMATION - MENUITEM "St&atistics", ID_VIEW_STATISTICS - MENUITEM "S&tatus", ID_VIEW_STATUS - MENUITEM "Subresync", ID_VIEW_SUBRESYNC - MENUITEM "Playlist", ID_VIEW_PLAYLIST - MENUITEM "Capture", ID_VIEW_CAPTURE - MENUITEM "Shader Editor", ID_VIEW_SHADEREDITOR - POPUP "Presets..." - BEGIN - MENUITEM "Minimal", ID_VIEW_PRESETS_MINIMAL - MENUITEM "Compact", ID_VIEW_PRESETS_COMPACT - MENUITEM "Normal", ID_VIEW_PRESETS_NORMAL - END - END - MENUITEM "P&roperties", ID_FILE_PROPERTIES - MENUITEM "&Options...", ID_VIEW_OPTIONS - END -END - -IDR_POPUPMAIN MENU -BEGIN - POPUP "" - BEGIN - POPUP "&File" - BEGIN - MENUITEM "&Quick Open File...\tCtrl+Q", ID_FILE_OPENQUICK - MENUITEM SEPARATOR - MENUITEM "&Open File...\tCtrl+O", ID_FILE_OPENMEDIA - MENUITEM "Open &DVD...\tCtrl+D", ID_FILE_OPENDVD - MENUITEM "Open De&vice...\tCtrl+V", ID_FILE_OPENDEVICE - MENUITEM "O&pen Disc", 65535 - MENUITEM "&Close", ID_FILE_CLOSEPLAYLIST - MENUITEM SEPARATOR - MENUITEM "&Save As...", ID_FILE_SAVE_COPY - MENUITEM "Save Image...", ID_FILE_SAVE_IMAGE - MENUITEM "Save Thumbnails...", ID_FILE_SAVE_THUMBNAILS - MENUITEM SEPARATOR - MENUITEM "&Load Subtitle...\tCtrl+L", ID_FILE_LOAD_SUBTITLE - MENUITEM "Save Subtitle...\tCtrl+S", ID_FILE_SAVE_SUBTITLE - POPUP "Subtitle Database" - BEGIN - MENUITEM "Search...", ID_FILE_ISDB_SEARCH - MENUITEM "Upload...", ID_FILE_ISDB_UPLOAD - MENUITEM "Download...", ID_FILE_ISDB_DOWNLOAD - END - MENUITEM SEPARATOR - MENUITEM "Prope&rties", ID_FILE_PROPERTIES - MENUITEM SEPARATOR - POPUP "Utils" - BEGIN - MENUITEM "DSM Co&nverter...", ID_FILE_CONVERT - END - END - POPUP "&View" - BEGIN - MENUITEM "Caption&&Menu\tCtrl+0", ID_VIEW_CAPTIONMENU - MENUITEM "&Seek Bar\tCtrl+1", ID_VIEW_SEEKER - MENUITEM "Cont&rols\tCtrl+2", ID_VIEW_CONTROLS - MENUITEM "&Information\tCtrl+3", ID_VIEW_INFORMATION - MENUITEM "S&tatistics\tCtrl+4", ID_VIEW_STATISTICS - MENUITEM "St&atus\tCtrl+5", ID_VIEW_STATUS - MENUITEM "Subresync\tCtrl+6", ID_VIEW_SUBRESYNC - MENUITEM "Playlist\tCtrl+7", ID_VIEW_PLAYLIST - MENUITEM "Capture\tCtrl+8", ID_VIEW_CAPTURE - MENUITEM "Shader Editor\tCtrl+9", ID_VIEW_SHADEREDITOR - POPUP "Presets..." - BEGIN - MENUITEM "Minimal", ID_VIEW_PRESETS_MINIMAL - MENUITEM "Compact", ID_VIEW_PRESETS_COMPACT - MENUITEM "Normal", ID_VIEW_PRESETS_NORMAL - END - MENUITEM SEPARATOR - MENUITEM "Fu&ll Screen\tAlt+Enter", ID_VIEW_FULLSCREEN - POPUP "&Zoom" - BEGIN - MENUITEM "&50%\tAlt+1", ID_VIEW_ZOOM_50 - MENUITEM "&100%\tAlt+2", ID_VIEW_ZOOM_100 - MENUITEM "&200%\tAlt+3", ID_VIEW_ZOOM_200 - MENUITEM "Auto Fit\tAlt+4", ID_VIEW_ZOOM_AUTOFIT - END - MENUITEM SEPARATOR - POPUP "&Video Frame" - BEGIN - MENUITEM "&Half Size", ID_VIEW_VF_HALF - MENUITEM "&Normal Size", ID_VIEW_VF_NORMAL - MENUITEM "&Double Size", ID_VIEW_VF_DOUBLE - MENUITEM "&Stretch To Window", ID_VIEW_VF_STRETCH - MENUITEM "Touch Window From &Inside", ID_VIEW_VF_FROMINSIDE - MENUITEM "Touch Window From &Outside", ID_VIEW_VF_FROMOUTSIDE - MENUITEM SEPARATOR - MENUITEM "&Keep Aspect Ratio", ID_VIEW_VF_KEEPASPECTRATIO - POPUP "Override Aspect Ratio" - BEGIN - MENUITEM "Default", ID_ASPECTRATIO_SOURCE - MENUITEM "4:3", ID_ASPECTRATIO_4_3 - MENUITEM "5:4", ID_ASPECTRATIO_5_4 - MENUITEM "16:9", ID_ASPECTRATIO_16_9 - END - MENUITEM "Correct Monitor/Desktop AR Diff", ID_VIEW_VF_COMPMONDESKARDIFF - END - POPUP "Pan&&S&can" - BEGIN - MENUITEM "Increase Size\tNumpad 9", ID_VIEW_INCSIZE - MENUITEM "Decrease Size\tNumpad 1", ID_VIEW_DECSIZE - MENUITEM "Increase Width\tNumpad 6", ID_VIEW_INCWIDTH - MENUITEM "Decrease Width\tNumpad 4", ID_VIEW_DECWIDTH - MENUITEM "Increase Height\tNumpad 8", ID_VIEW_INCHEIGHT - MENUITEM "Decrease Height\tNumpad 2", ID_VIEW_DECHEIGHT - MENUITEM SEPARATOR - MENUITEM "Move Right\tCtrl+Numpad 6", ID_PANSCAN_MOVERIGHT - MENUITEM "Move Left\tCtrl+Numpad 4", ID_PANSCAN_MOVELEFT - MENUITEM "Move Up\tCtrl+Numpad 8", ID_PANSCAN_MOVEUP - MENUITEM "Move Down\tCtrl+Numpad 2", ID_PANSCAN_MOVEDOWN - MENUITEM "Center\tCtrl+Numpad 5", ID_PANSCAN_CENTER - MENUITEM SEPARATOR - MENUITEM "Reset\tNumpad 5", ID_VIEW_RESET - END - MENUITEM SEPARATOR - POPUP "On Top" - BEGIN - MENUITEM "Never", ID_ONTOP_NEVER - MENUITEM "Always", ID_ONTOP_ALWAYS - MENUITEM "While Playing", ID_ONTOP_WHILEPLAYING - END - MENUITEM "&Options...", ID_VIEW_OPTIONS - END - POPUP "&Play" - BEGIN - MENUITEM "&Play/Pause\tSpace", ID_PLAY_PLAYPAUSE - MENUITEM "&Stop\tPeriod", ID_PLAY_STOP - MENUITEM "F&rame Step\tRight", ID_PLAY_FRAMESTEP - MENUITEM "&Go To...\tCtrl+G", ID_PLAY_GOTO - MENUITEM SEPARATOR - MENUITEM "&Decrease Rate\tCtrl+Down", ID_PLAY_DECRATE - MENUITEM "&Increase Rate\tCtrl+Up", ID_PLAY_INCRATE - MENUITEM "Reset Rate\tCtrl+R", ID_PLAY_RESETRATE - END - POPUP "&Navigate" - BEGIN - MENUITEM "&Previous\tPage Up", ID_NAVIGATE_SKIPBACK - MENUITEM "&Next\tPage Down", ID_NAVIGATE_SKIPFORWARD - MENUITEM "&Jump To...", 65535 - MENUITEM SEPARATOR - MENUITEM "A&udio Language", 65535 - MENUITEM "Su&btitle Language", 65535 - MENUITEM "Video Ang&le", 65535 - MENUITEM SEPARATOR - MENUITEM "Title Menu", ID_NAVIGATE_TITLEMENU - MENUITEM "&Root Menu", ID_NAVIGATE_ROOTMENU - MENUITEM "&Subtitle Menu", ID_NAVIGATE_SUBPICTUREMENU - MENUITEM "&Audio Menu", ID_NAVIGATE_AUDIOMENU - MENUITEM "An&gle Menu", ID_NAVIGATE_ANGLEMENU - MENUITEM "&Chapter Menu", ID_NAVIGATE_CHAPTERMENU - END - MENUITEM "&Favorites", 65535 - POPUP "&Help" - BEGIN - MENUITEM "Home Page", ID_HELP_HOMEPAGE - MENUITEM "Command Line Switches", ID_HELP_SHOWCOMMANDLINESWITCHES - MENUITEM SEPARATOR - MENUITEM "&About...", ID_HELP_ABOUT - END - MENUITEM SEPARATOR - MENUITEM "&Filters", 65535 - MENUITEM "S&haders", 65535 - MENUITEM SEPARATOR - MENUITEM "&Audio", 65535 - MENUITEM "Su&btitles", 65535 - MENUITEM SEPARATOR - POPUP "Vol&ume" - BEGIN - MENUITEM "&Up\tUp Arrow", ID_VOLUME_UP - MENUITEM "&Down\tDown Arrow", ID_VOLUME_DOWN - MENUITEM "&Mute\tCtrl+M", ID_VOLUME_MUTE - END - POPUP "After Playback" - BEGIN - MENUITEM "Close ", ID_AFTERPLAYBACK_CLOSE - MENUITEM "Stand By", ID_AFTERPLAYBACK_STANDBY - MENUITEM "Hibernate", ID_AFTERPLAYBACK_HIBERNATE - MENUITEM "Shutdown", ID_AFTERPLAYBACK_SHUTDOWN - MENUITEM "Log Off", ID_AFTERPLAYBACK_LOGOFF - MENUITEM SEPARATOR - MENUITEM "Do Nothing", ID_AFTERPLAYBACK_DONOTHING - END - MENUITEM SEPARATOR - MENUITEM "E&xit\tAlt+X", ID_FILE_EXIT - END -END - - -///////////////////////////////////////////////////////////////////////////// -// -// AVI -// - -IDR_AVI_FILECOPY AVI "res\\ani.avi" - -///////////////////////////////////////////////////////////////////////////// -// -// HTML -// - -IDR_HTML_INDEX HTML "res\\web\\index.html" -IDR_HTML_404 HTML "res\\web\\404.html" -IDR_HTML_BROWSER HTML "res\\web\\browser.html" -IDR_HTML_CONTROLS HTML "res\\web\\controls.html" -IDR_HTML_PLAYER HTML "res\\web\\player.html" - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE -BEGIN - IDR_MAINFRAME "Media Player Classic" -END - -STRINGTABLE -BEGIN - IDS_R_SETTINGS "Settings" - IDS_RS_TITLEBARTEXTSTYLE "TitleBarTextStyle" - IDS_RS_USEWMASFREADER "UseWMASFReader" - IDS_RS_CONTROLSTATE "ControlState" - IDS_RS_VOLUME "Volume" - IDS_RS_MUTE "Mute" - IDS_RS_BALANCE "Balance" - IDS_RS_LOOP "Loop" -END - -STRINGTABLE -BEGIN - IDS_RS_SNAPTODESKTOPEDGES "SnapToDesktopEdges" - IDS_RS_ENABLESUBTITLES "EnableSubtitles" - IDS_RS_MPEGINTERLACED "MPEGInterlaced" - IDS_RS_THUMBWIDTH "ThumbWidth" - IDS_RS_AUDIONORMALIZE "AudioNormalize" - IDS_RS_AUDIOBOOST "AudioBoost" - IDS_RS_AUDIONORMALIZERECOVER "AudioNormalizeRecover" - IDS_RS_VMR9MIXERYUV "VMRMixerYUV" - IDS_RS_TITLEBARTEXTTITLE "TitleBarTextTitle" - IDS_RS_SHADERLIST "Shaders List" -END - -STRINGTABLE -BEGIN - IDS_VIDRENDDESC "Move the mouse pointer over the choices to see their description." - IDS_CONVERT_ADDFILE "Add File..." - IDS_CONVERT_PROPERTIES "Properties..." - IDS_CONVERT_REMOVE "Remove" - IDS_CONVERT_ENABLESTREAM "Enable Stream" - IDS_CONVERT_DISABLESTREAM "Disable Stream" - IDS_CONVERT_PINPROPERTIES "Pin Properties..." - IDS_CONVERT_ADDRESOURCE "Add Resource..." - IDS_CONVERT_REMOVEALL "Remove All" - IDS_CONVERT_SAVEAS "Save As..." - IDS_CONVERT_RESOURCEPROPERTIES "Resource Properties..." - IDS_CONVERT_LAUNCHINBROWSER "Launch in Browser..." -END - -STRINGTABLE -BEGIN - IDS_CONVERT_ADDCHAPTER "Add Chapter..." - IDS_CONVERT_CHAPTERPROPERTIES "Chapter Properties..." - IDS_CONVERT_DEMUXSTREAM "Demux..." - IDS_PLAYLIST_OPEN "&Open" - IDS_PLAYLIST_ADD "A&dd" - IDS_PLAYLIST_REMOVE "&Remove" - IDS_PLAYLIST_COPYTOCLIPBOARD "&Copy to clipboard" - IDS_PLAYLIST_SAVEAS "&Save As..." - IDS_PLAYLIST_SORTBYLABEL "Sort by &label" - IDS_PLAYLIST_SORTBYPATH "Sort by &path" - IDS_PLAYLIST_RANDOMIZE "R&andomize" - IDS_PLAYLIST_RESTORE "R&estore" - IDS_SUBRESYNC_SEPARATOR "&Separator" - IDS_SUBRESYNC_DELETE "&Delete" - IDS_SUBRESYNC_DUPLICATE "D&uplicate" - IDS_SUBRESYNC_RESET "&Reset" -END - -STRINGTABLE -BEGIN - IDS_RS_LOOPNUM "LoopNum" - IDS_RS_REWIND "Rewind" - IDS_RS_ZOOM "Zoom" - IDS_RS_MULTIINST "AllowMultipleInstances" - IDS_RS_ALWAYSONTOP "AlwaysOnTop" - IDS_RS_AUTOZOOM "AutoZoom" - IDS_RS_FULLSCREENCTRLS "FullScreenCtrls" - IDS_RS_FULLSCREENCTRLSTIMEOUT "FullScreenCtrlsTimeOut" - IDS_RS_VMRFLIP "VMRFlip" - IDS_RS_DVDPATH "DVDPath" - IDS_RS_USEDVDPATH "UseDVDPath" - IDS_RS_MENULANG "MenuLang" - IDS_RS_AUDIOLANG "AudioLang" - IDS_RS_SUBTITLESLANG "SubtitlesLang" - IDS_RS_SPLOGFONT "SPDefaultStyle" -END - -STRINGTABLE -BEGIN - IDS_RS_SPOVERRIDEPLACEMENT "SPOverridePlacement" - IDS_RS_SPHORPOS "SPHorPos" - IDS_RS_SPVERPOS "SPVerPos" - IDS_RS_SPCSIZE "SPCSize" - IDS_RS_SPCMAXRES "SPCMaxRes" - IDS_RS_INTREALMEDIA "IntRealMedia" - IDS_RS_DISABLEXPTOOLBARS "DisableXPToolbars" - IDS_RS_USEDEDYNAMIC "UseDeDynamic" - IDS_RS_DBLCLICKFULLSCREEN "DblClickFullScreen" - IDS_RS_EXITFULLSCREENATTHEEND "ExitFullscreenAtTheEnd" -END - -STRINGTABLE -BEGIN - AFX_IDS_APP_TITLE "Media Player Classic" -END - -STRINGTABLE -BEGIN - IDS_RS_AUTOSPEAKERCONF "AutoSpeakerConf" - IDS_RS_REMEMBERWINDOWPOS "RememberWindowPos" - IDS_RS_LASTWINDOWRECT "LastWindowRect" - IDS_RS_AUDIORENDERERTYPE "AudioRendererType" - IDS_RS_SPEAKERTOCHANNELMAPPING "SpeakerToChannelMapping" - IDS_RS_CUSTOMCHANNELMAPPING "CustomChannelMapping" - IDS_RS_DOWNSAMPLETO441 "DownSampleTo441" - IDS_RS_ENABLEAUDIOSWITCHER "EnableAudioSwitcher" - IDS_RS_HIDECAPTIONMENU "HideCaptionMenu" - IDS_R_FILTERS "Filters" - IDS_RS_DEFAULTVIDEOFRAME "DefaultVideoFrame" - IDS_RS_REMEMBERWINDOWSIZE "RememberWindowSize" - IDS_RS_REALMEDIARENDERLESS "RealMediaRenderless" - IDS_RS_QUICKTIMERENDERER "QuickTimeRenderer" - IDS_RS_REALMEDIAFPS "RealMediaFPS" - IDS_RS_AUDIOTIMESHIFT "AudioTimeShift" - IDS_RS_SUBDELAYINTERVAL "SubDelayInterval" -END - -STRINGTABLE -BEGIN - IDD_PPAGEPLAYBACK "Playback" - IDD_PPAGEPLAYER "Player" - IDD_PPAGEDVD "Playback::DVD/OGM" - IDD_PPAGESUBTITLES "Subtitles" - IDD_PPAGEFORMATS "Player::Formats" - IDD_PPAGETWEAKS "Tweaks" - IDD_PPAGEAUDIOSWITCHER "Internal Filters::Audio Switcher" - IDD_PPAGEEXTERNALFILTERS "External Filters" -END - -STRINGTABLE -BEGIN - IDF_LOGO3 "Andrew S. Gildehaus, agildehaus@runbox.com" - IDF_LOGO4 "Marcel Hoffs, marcelhoffs@hotmail.com" - IDF_LOGO7 "Steven W. Smith, smith78@sbcglobal.net" -END - -STRINGTABLE -BEGIN - IDD_PPAGEACCELTBL "Player::Keys" - IDD_PPAGESUBSTYLE "Subtitles::Default Style" - IDD_PPAGEINTERNALFILTERS "Internal Filters" - IDD_PPAGELOGO "Player::Logo" - IDD_PPAGEOUTPUT "Playback::Output" - IDD_PPAGEWEBSERVER "Player::Web Interface" - IDD_PPAGEAUDIODEC "Internal Filters::Audio Decoders" - IDD_PPAGESUBDB "Subtitles::Database" -END - -STRINGTABLE -BEGIN - IDD_FILEPROPDETAILS "Details" - IDD_FILEPROPCLIP "Clip" -END - -STRINGTABLE -BEGIN - IDS_INFOBAR_LOCATION "Location" - IDS_INFOBAR_VIDEO "Video" - IDS_INFOBAR_AUDIO "Audio" - IDS_INFOBAR_SUBTITLES "Subtitles" - IDS_CONTROLS_COMPLETING "Completing..." - IDS_AUTOPLAY_PLAYVIDEO "Play Video" - IDS_AUTOPLAY_PLAYMUSIC "Play Music" - IDS_AUTOPLAY_PLAYAUDIOCD "Play Audio CD" - IDS_AUTOPLAY_PLAYDVDMOVIE "Play DVD Movie" - IDS_PROPSHEET_PROPERTIES "Properties" - IDS_GRAPHBUILDER_AUDIOSWITCHER "Audio Switcher" - IDS_SHADER_EDIT "&Edit..." - IDS_FAVFILES "Files" - IDS_FAVDVDS "DVDs" - IDS_FAVDEVICES "Devices" -END - -STRINGTABLE -BEGIN - IDS_RS_ENABLEAUDIOTIMESHIFT "EnableAudioTimeShift" - IDS_R_FAVFILES "Favorites\\Files" - IDS_R_FAVDVDS "Favorites\\DVDs" - IDS_R_FAVDEVICES "Favorites\\Devices" - IDS_RS_LOGOFILE "LogoFile" - IDS_RS_ENABLEWORKERTHREADFOROPENING "EnableWorkerThreadForOpening" - IDS_RS_PNSPRESETS "PnSPresets" - IDS_RS_AUTOLOADAUDIO "AutoloadAudio" - IDS_RS_AUTOLOADSUBTITLES "AutoloadSubtitles" - IDS_RS_SEARCHKEYFRAMES "SearchKeyframes" - IDS_RS_ACCELTBL "AccelTbl" - IDS_RS_SETFULLSCREENRES "SetFullscreenRes" - IDS_RS_FULLSCREENRES "FullscreenRes" - IDS_RS_WINLIRCADDR "WinLircAddr" - IDS_R_COMMANDS "Commands2" - IDS_RS_WINLIRC "UseWinLirc" - IDS_RS_BLOCKVSFILTER "BlockVSFilter" -END - -STRINGTABLE -BEGIN - IDS_RS_TRAYICON "TrayIcon" - IDS_RS_KEEPASPECTRATIO "KeepAspectRatio" - IDS_RS_UICEADDR "UICEAddr" - IDS_RS_UICE "UseUICE" - IDS_RS_JUMPDISTS "JumpDistS" - IDS_RS_JUMPDISTM "JumpDistM" - IDS_RS_JUMPDISTL "JumpDistL" - IDS_RS_REPORTFAILEDPINS "ReportFailedPins" - IDS_RS_SRCFILTERS "SrcFilters" - IDS_RS_KEEPHISTORY "KeepHistory" - IDS_RS_LOGOID "LogoID2" - IDS_RS_LOGOEXT "LogoExt" - IDS_RS_TRAFILTERS "TraFilters" - IDS_RS_MPEGDI "MPEGDI" - IDS_RS_MPEGBRIGHT "MPEGBright" - IDS_RS_MPEGCONT "MPEGCont" -END - -STRINGTABLE -BEGIN - IDS_RS_MPEGHUE "MPEGHue" - IDS_RS_MPEGSAT "MPEGSat" - IDS_RS_MPEGFORCEDSUBS "MPEGForcedSubs" - IDS_RS_MPEGPLANARYUV "MPEGPlanarYUV" - IDS_RS_COMPMONDESKARDIFF "CompMonDeskARDiff" - IDS_RS_HIDECDROMSSUBMENU "HideCDROMsSubMenu" - IDS_RS_VMRTEXTURE "VMRTexture" - IDS_RS_VMR3D "VMR3D" - IDS_RS_DSVIDEORENDERERTYPE "DSVidRen" - IDS_RS_RMVIDEORENDERERTYPE "RMVidRen" - IDS_RS_QTVIDEORENDERERTYPE "QTVidRen" - IDS_RS_APSURACEFUSAGE "APSurfaceUsage" - IDS_R_LOGINS "Logins" - IDS_RS_ENABLEWEBSERVER "EnableWebServer" - IDS_RS_WEBSERVERPORT "WebServerPort" - IDS_RS_LASTWINDOWTYPE "LastWindowType" -END - -STRINGTABLE -BEGIN - IDS_RS_ONTOP "OnTop" - IDS_RS_MPASF "MPASampleFormat" - IDS_RS_AC3SC "AC3SpeakerConfig" - IDS_RS_AC3DRC "AC3DynamicRangeControl" - IDS_RS_WEBSERVERPRINTDEBUGINFO "WebServerPrintDebugIfo" - IDS_RS_WEBSERVERUSECOMPRESSION "WebServerUseCompression" - IDS_RS_MPANORMALIZE "MPANormalize" - IDS_RS_DTSSC "DTSSpeakerConfig" - IDS_RS_DTSDRC "DTSDynamicRangeControl" - IDS_RS_SNAPSHOTPATH "SnapShotPath" - IDS_RS_PRIORITY "Priority" - IDS_RS_SNAPSHOTEXT "SnapShotExt" - IDS_RS_LAUNCHFULLSCREEN "LaunchFullScreen" - IDS_RS_MPABOOST "MpaBoost" - IDS_RS_AACSC "AACSpeakerConfig" - IDS_RS_VMRSYNCFIX "VMRSyncFix" -END - -STRINGTABLE -BEGIN - IDC_DSSYSDEF "Default video renderer filter for DirectShow. Others will fall back to this one when they can't be loaded for some reason. On Windown XP this is the same as VMR7 (windowed)." - IDC_DSOLD "This is the default renderer of Windows 9x/me/2k. Depending on the visiblity of the video window and your video card's abilies, it will switch between GDI, DirectDraw, Overlay rendering modes dynamically." - IDC_DSOVERLAYMIXER "Always renders in overlay. Generally only YUV formats are allowed, but they are presented directly without any color conversion to RGB. This is the fastest rendering method of all and the only where you can be sure about full screen video mirroring to tv-out activating." - IDC_DSVMR7WIN "The default renderer of Windows XP. Very stable and just a little slower than the Overlay mixer. Uses DirectDraw and runs in Overlay when it can." - IDC_DSVMR9WIN "Only available if you have DirectX 9 installed. Has the same abilies as VMR7 (windowed), but it will never use Overlay rendering and because of this it may be a little slower than VMR7 (windowed)." - IDC_DSVMR7REN "Same as the VMR7 (windowed), but with the Allocator-Presenter plugin of MPC for subtitling. Overlay video mirroring WILL NOT work. 'True Color' desktop color space recommended." - IDC_DSVMR9REN "Same as the VMR9 (windowed), but with the Allocator-Presenter plugin of MPC for subtitling. Overlay video mirroring MIGHT work. 'True Color' desktop color space recommended." - IDC_DSNULL_COMP "Connects to any video-like media type and will send the incoming samples to nowhere. Use it when you don't need the video display and want to save the cpu from working unnecessarily." - IDC_DSNULL_UNCOMP "Same as the normal Null renderer, but this will only connect to uncompressed types." -END - -STRINGTABLE -BEGIN - IDC_RMSYSDEF "Real's own renderer. SMIL scripts will work, but interaction not likely. Uses DirectDraw and runs in Overlay when it can." - IDC_RMDX7 "The output of Real's engine rendered by the DX7-based Allocator-Presenter of VMR7 (renderless)." - IDC_RMDX9 "The output of Real's engine rendered by the DX9-based Allocator-Presenter of VMR9 (renderless)." - IDC_QTSYSDEF "QuickTime's own renderer. Gets a little slow when its video area is resized or partially covered by another window. When Overlay is not available it likes to fall back to GDI." - IDC_QTDX7 "The output of QuickTime's engine rendered by the DX7-based Allocator-Presenter of VMR7 (renderless)." - IDC_QTDX9 "The output of QuickTime's engine rendered by the DX9-based Allocator-Presenter of VMR9 (renderless)." - IDC_REGULARSURF "Video surface will be allocated as a regular offscreen surface." -END - -STRINGTABLE -BEGIN - IDC_TEXTURESURF2D "Video surface will be allocated as a texture but still the 2d functions will be used to copy and stretch it onto the backbuffer. Requires a video card which can allocate 32bit, RGBA, non-power-of-two sized textures and at least in the resolution of the video." - IDC_TEXTURESURF3D "Video surface will be allocated as a texture and drawn as two triangles in 3d. Antialiasing turned on at the display settings may have a bad effect on the rendering speed." - IDC_DX9RESIZER_COMBO "If there is no Pixel Shader 2.0 support, simple bilinear is used automatically." - IDC_DSVMR9LOADMIXER "Puts VMR9 (renderless) into mixer mode, this means most of the controls on its property page will work and it will use a separate worker thread to renderer frames." - IDC_CHECK_MPEGINTERLACED - "Use it together with ""Weave"" if the video renderer can also deinterlace. The currently loaded file has to be opened again." -END - -STRINGTABLE -BEGIN - IDS_SRC_RADGT "6.4.0.0\nRequires smackw32.dll and binkw32.dll" - IDS_SRC_CDDA "6.4.0.2\n2K/XP only" - IDS_SRC_AVI "6.4.0.9\nNon-interleaved files are not welcome" - IDS_SRC_CDXA "6.4.0.2" - IDS_SRC_VTS "6.4.0.0\nOpen VTS_xx_0.ifo to load VTS_xx_x.vob files in one piece" - IDS_SRC_FLIC "6.4.0.1" - IDS_SRC_D2V "6.4.0.0" - IDS_SRC_DTSAC3 "6.4.0.2" - IDS_SRC_SHOUTCAST "6.4.0.1" - IDS_SRC_REALMEDIA "6.4.1.2\nRealMedia format categories must be set to 'DirectShow' to make it load\nDoesn't support streaming!" - IDS_SRC_MATROSKA "6.4.3.0" - IDS_SRC_ROQ "6.4.0.0" - IDS_SRC_OGG "6.4.0.1" - IDS_SRC_NUT "6.4.0.0\nBased on ""NUT Open Container Format DRAFT 20030906""\nStill very incomplete, if you have or can make test files, please contact me." - IDS_SRC_DIRAC "6.4.0.1\nBased on libdirac 0.5.0" - IDS_SRC_DSM "6.4.0.5" -END - -STRINGTABLE -BEGIN - IDS_SRC_MPA "6.4.0.2\nSource filter for mp3 and aac" - IDS_SRC_MP4 "6.4.0.4" - IDS_TRA_RV "6.4.1.0\nRequires RealVideo decoder dlls, RV10 also works with ffdshow" - IDS_TRA_RA "6.4.1.0\nRequires RealAudio decoder dlls, DNET also works with ac3filter" - IDS_TRA_MPEG1 "6.4.0.4\nBased on libmpeg2 (mpeg1 video decoding is bogus)" - IDS_TRA_MPEG2 "6.4.0.4\nBased on libmpeg2" - IDS_TRA_MPA "6.4.0.4\nBased on libmad, liba52, libdts, libfaad" - IDS_TRA_LPCM "6.4.0.1" - IDS_TRA_AC3 "6.4.0.1\nBased on liba52 0.7.4, http://liba52.sourceforge.net/" - IDS_TRA_DTS "6.4.0.1\nBased on libdts 0.0.2, http://www.videolan.org/dtsdec.html" - IDS_TRA_AAC "6.4.0.2\nBased on libfaad 2.6, http://www.audiocoding.com/" - IDS_TRA_DIRAC "6.4.0.1\nBased on libdirac 0.5.0" - IDS_TRA_PS2AUD "6.4.0.1\nDecodes audio streams of PSS files" - IDS_SRC_FLV "6.4.0.4" -END - -STRINGTABLE -BEGIN - IDS_RS_ISDB "ISDb" - IDS_RS_POW2TEX "SPCPow2Tex" - IDS_R_INTERNAL_FILTERS "Internal Filters" - IDS_RS_WEBROOT "WebRoot" - IDS_RS_WEBSERVERLOCALHOSTONLY "WebServerLocalhostOnly" - IDS_RS_ASPECTRATIO_X "AspectRatioX" - IDS_RS_ASPECTRATIO_Y "AspectRatioY" - IDS_RS_DX9_RESIZER "DX9Resizer" - IDS_RS_WEBSERVERCGI "WebServerCGI" - IDS_RS_WEBDEFINDEX "WebDefIndex" - IDS_RS_FREEWINDOWRESIZING "FreeWindowResizing" - IDS_RS_NOTIFYMSN "NotifyMSN2" - IDS_RS_NOTIFYGTSDLL "NotifyGTSdll" - IDS_RS_VMR9MIXERMODE "VMR9MixerMode" - IDS_RS_THUMBROWS "ThumbRows" - IDS_RS_THUMBCOLS "ThumbCols" -END - -STRINGTABLE -BEGIN - IDC_CHECK_RELATIVETO "Default state gets inherited to other styles where it is still undefined" - IDC_CHECK_SPCPOW2TEX "Unchecking this frees up a little video memory and saves bandwidth on local to video memory transfers, but it may not work with older video cards." - IDC_BUTTON_EXT_SET "After clicking this button, the checked state of the format group will reflect the actual file association for mpc. A newly added extension will usually make it grayed, so don't forget to check it again before closing this dialog!" -END - -STRINGTABLE -BEGIN - ID_PLAY_PLAY "Play\nPlay" - ID_PLAY_PAUSE "Pause\nPause" - ID_PLAY_STOP "Stop\nStop" - ID_PLAY_FRAMESTEP "Step\nStep" - ID_PLAY_DECRATE "Decrease speed\nDecrease speed" - ID_PLAY_INCRATE "Increase speed\nIncrease speed" -END - -STRINGTABLE -BEGIN - ID_VOLUME_MUTE "Mute\nMute" - ID_VOLUME_MUTE_ON "Mute\nMute" - ID_VOLUME_MUTE_DISABLED "No audio\nNo audio" -END - -STRINGTABLE -BEGIN - ID_NAVIGATE_SKIPBACK "Skip back\nSkip back" - ID_NAVIGATE_SKIPFORWARD "Skip forward\nSkip forward" -END - -STRINGTABLE -BEGIN - IDS_SUBRESYNC_ORIGINAL "&Original" - IDS_SUBRESYNC_CURRENT "&Current" - IDS_SUBRESYNC_EDIT "&Edit" - IDS_SUBRESYNC_YES "&Yes" - IDS_SUBRESYNC_NO "&No" - IDS_SUBRESYNC_DECREASE "&Decrease" - IDS_SUBRESYNC_INCREASE "&Increase" - IDS_OPTIONS_CAPTION "Options" - IDS_SHADER_COMBINE "&Combine..." - IDS_SHADER_OFF "Off" - IDS_SHADER_POPUP "Shaders" - IDS_FAVORITES_POPUP "F&avorites" - IDS_JUMPTO_POPUP "Jump To..." - IDS_VIDEOANGLE_POPUP "Video Angle" - IDS_SUBTITLELANGUAGE_POPUP "Subtitle Language" - IDS_AUDIOLANGUAGE_POPUP "Audio Language" -END - -STRINGTABLE -BEGIN - IDD_FILEPROPRES "Resources" -END - -STRINGTABLE -BEGIN - IDS_SUBTITLES_POPUP "Subtitles" - IDS_AUDIO_POPUP "Audio" - IDS_FILTERS_POPUP "Filters" - IDS_OPENCDROM_POPUP "O&pen Disc" - IDS_NAVIGATE_POPUP "Navigate" - IDS_VIDEOFRAME_POPUP "Video Frame" - IDS_PANSCAN_POPUP "Pan&&Scan" - IDS_ASPECTRATIO_POPUP "Aspect Ratio" - IDS_ZOOM_POPUP "Zoom" - IDS_FAVORITES_ADD "&Add to Favorites..." - IDS_FAVORITES_ORGANIZE "&Organize Favorites..." - IDS_PLAYLIST_SHUFFLE "Shuffle" - IDS_PLAYLIST_REMEBERITEMS "Remember items" - IDS_CONTROLS_CLOSING "Closing..." - IDS_CONTROLS_PLAYING "Playing" - IDS_CONTROLS_PAUSED "Paused" -END - -STRINGTABLE -BEGIN - IDS_CONTROLS_STOPPED "Stopped" - IDS_CONTROLS_BUFFERING "Buffering... (%d%%)" - IDS_CONTROLS_CAPTURING "Capturing..." - IDS_CONTROLS_OPENING "Opening..." - IDS_CONTROLS_CLOSED "Closed" - IDS_SUBTITLES_OPTIONS "&Options..." - IDS_SUBTITLES_STYLES "&Styles..." - IDS_SUBTITLES_RELOAD "&Reload" - IDS_SUBTITLES_ENABLE "&Enable" - IDS_PANSCAN_EDIT "Edit..." - IDS_INFOBAR_TITLE "Title" - IDS_INFOBAR_AUTHOR "Author" - IDS_INFOBAR_COPYRIGHT "Copyright" - IDS_INFOBAR_RATING "Rating" - IDS_INFOBAR_DESCRIPTION "Description" - IDS_INFOBAR_DOMAIN "Domain" -END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// -#define _AFX_NO_SPLITTER_RESOURCES -#define _AFX_NO_OLE_RESOURCES -#define _AFX_NO_TRACKER_RESOURCES -#define _AFX_NO_PROPERTY_RESOURCES - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -LANGUAGE 9, 1 -#pragma code_page(1252) -#include "afxres.rc" // Standard components -#endif -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/src/apps/mplayerc/mplayerc_vs2005.sln b/src/apps/mplayerc/mplayerc_vs2005.sln deleted file mode 100644 index c03eee5c6..000000000 --- a/src/apps/mplayerc/mplayerc_vs2005.sln +++ /dev/null @@ -1,189 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mplayerc", "mplayerc_vs2005.vcproj", "{8CE7E5D0-C821-47AC-A247-28EC95B34670}" - ProjectSection(ProjectDependencies) = postProject - {1A2DFD1A-3C6C-44D1-909D-294AF646B575} = {1A2DFD1A-3C6C-44D1-909D-294AF646B575} - {FC8080D1-603C-45EC-BCFA-7172E2F3D989} = {FC8080D1-603C-45EC-BCFA-7172E2F3D989} - {DD9D2D92-2241-408A-859E-B85D444B7E3C} = {DD9D2D92-2241-408A-859E-B85D444B7E3C} - {FC70988B-1AE5-4381-866D-4F405E28AC42} = {FC70988B-1AE5-4381-866D-4F405E28AC42} - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0} = {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0} - {5E56335F-0FB1-4EEA-B240-D8DC5E0608E4} = {5E56335F-0FB1-4EEA-B240-D8DC5E0608E4} - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F} = {61E6EB4D-2F1A-443B-94B0-E8200B26E99F} - {D514EA4D-EAFB-47A9-A437-A582CA571251} = {D514EA4D-EAFB-47A9-A437-A582CA571251} - {AB494732-EF6D-44D0-BCF8-80FF04858D10} = {AB494732-EF6D-44D0-BCF8-80FF04858D10} - {03208025-D5C2-426A-B0FA-251D4338F30C} = {03208025-D5C2-426A-B0FA-251D4338F30C} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "subtitles", "..\..\subtitles\subtitles_vs2005.vcproj", "{5E56335F-0FB1-4EEA-B240-D8DC5E0608E4}" - ProjectSection(ProjectDependencies) = postProject - {DD9D2D92-2241-408A-859E-B85D444B7E3C} = {DD9D2D92-2241-408A-859E-B85D444B7E3C} - {D514EA4D-EAFB-47A9-A437-A582CA571251} = {D514EA4D-EAFB-47A9-A437-A582CA571251} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dsutil", "..\..\dsutil\dsutil_vs2005.vcproj", "{FC70988B-1AE5-4381-866D-4F405E28AC42}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "subpic", "..\..\subpic\subpic_vs2005.vcproj", "{D514EA4D-EAFB-47A9-A437-A582CA571251}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "decss", "..\..\decss\decss_vs2005.vcproj", "{1A2DFD1A-3C6C-44D1-909D-294AF646B575}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ResizableLib", "..\..\ui\ResizableLib\ResizableLib_vs2005.vcproj", "{4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CmdUI", "..\..\ui\CmdUI\CmdUI_vs2005.vcproj", "{03208025-D5C2-426A-B0FA-251D4338F30C}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sizecbar", "..\..\ui\sizecbar\sizecbar_vs2005.vcproj", "{61E6EB4D-2F1A-443B-94B0-E8200B26E99F}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TreePropSheet", "..\..\ui\TreePropSheet\TreePropSheet_vs2005.vcproj", "{AB494732-EF6D-44D0-BCF8-80FF04858D10}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libssf", "..\..\subtitles\libssf\libssf.vcproj", "{DD9D2D92-2241-408A-859E-B85D444B7E3C}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpng", "..\..\libpng\libpng_vs2005.vcproj", "{FC8080D1-603C-45EC-BCFA-7172E2F3D989}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug Unicode|Win32 = Debug Unicode|Win32 - Debug Unicode|Win64 (AMD64) = Debug Unicode|Win64 (AMD64) - Debug|Win32 = Debug|Win32 - Debug|Win64 (AMD64) = Debug|Win64 (AMD64) - Release Unicode|Win32 = Release Unicode|Win32 - Release Unicode|Win64 (AMD64) = Release Unicode|Win64 (AMD64) - Release|Win32 = Release|Win32 - Release|Win64 (AMD64) = Release|Win64 (AMD64) - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {8CE7E5D0-C821-47AC-A247-28EC95B34670}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32 - {8CE7E5D0-C821-47AC-A247-28EC95B34670}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32 - {8CE7E5D0-C821-47AC-A247-28EC95B34670}.Debug Unicode|Win64 (AMD64).ActiveCfg = Debug Unicode|Win32 - {8CE7E5D0-C821-47AC-A247-28EC95B34670}.Debug|Win32.ActiveCfg = Debug|Win32 - {8CE7E5D0-C821-47AC-A247-28EC95B34670}.Debug|Win32.Build.0 = Debug|Win32 - {8CE7E5D0-C821-47AC-A247-28EC95B34670}.Debug|Win64 (AMD64).ActiveCfg = Debug|Win32 - {8CE7E5D0-C821-47AC-A247-28EC95B34670}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32 - {8CE7E5D0-C821-47AC-A247-28EC95B34670}.Release Unicode|Win32.Build.0 = Release Unicode|Win32 - {8CE7E5D0-C821-47AC-A247-28EC95B34670}.Release Unicode|Win64 (AMD64).ActiveCfg = Release Unicode|Win32 - {8CE7E5D0-C821-47AC-A247-28EC95B34670}.Release|Win32.ActiveCfg = Release|Win32 - {8CE7E5D0-C821-47AC-A247-28EC95B34670}.Release|Win32.Build.0 = Release|Win32 - {8CE7E5D0-C821-47AC-A247-28EC95B34670}.Release|Win64 (AMD64).ActiveCfg = Release|Win32 - {5E56335F-0FB1-4EEA-B240-D8DC5E0608E4}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32 - {5E56335F-0FB1-4EEA-B240-D8DC5E0608E4}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32 - {5E56335F-0FB1-4EEA-B240-D8DC5E0608E4}.Debug Unicode|Win64 (AMD64).ActiveCfg = Debug Unicode|Win32 - {5E56335F-0FB1-4EEA-B240-D8DC5E0608E4}.Debug|Win32.ActiveCfg = Debug|Win32 - {5E56335F-0FB1-4EEA-B240-D8DC5E0608E4}.Debug|Win32.Build.0 = Debug|Win32 - {5E56335F-0FB1-4EEA-B240-D8DC5E0608E4}.Debug|Win64 (AMD64).ActiveCfg = Debug|Win32 - {5E56335F-0FB1-4EEA-B240-D8DC5E0608E4}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32 - {5E56335F-0FB1-4EEA-B240-D8DC5E0608E4}.Release Unicode|Win32.Build.0 = Release Unicode|Win32 - {5E56335F-0FB1-4EEA-B240-D8DC5E0608E4}.Release Unicode|Win64 (AMD64).ActiveCfg = Release Unicode|Win32 - {5E56335F-0FB1-4EEA-B240-D8DC5E0608E4}.Release|Win32.ActiveCfg = Release|Win32 - {5E56335F-0FB1-4EEA-B240-D8DC5E0608E4}.Release|Win32.Build.0 = Release|Win32 - {5E56335F-0FB1-4EEA-B240-D8DC5E0608E4}.Release|Win64 (AMD64).ActiveCfg = Release|Win32 - {FC70988B-1AE5-4381-866D-4F405E28AC42}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32 - {FC70988B-1AE5-4381-866D-4F405E28AC42}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32 - {FC70988B-1AE5-4381-866D-4F405E28AC42}.Debug Unicode|Win64 (AMD64).ActiveCfg = Debug Unicode|Win32 - {FC70988B-1AE5-4381-866D-4F405E28AC42}.Debug|Win32.ActiveCfg = Debug|Win32 - {FC70988B-1AE5-4381-866D-4F405E28AC42}.Debug|Win32.Build.0 = Debug|Win32 - {FC70988B-1AE5-4381-866D-4F405E28AC42}.Debug|Win64 (AMD64).ActiveCfg = Debug|Win32 - {FC70988B-1AE5-4381-866D-4F405E28AC42}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32 - {FC70988B-1AE5-4381-866D-4F405E28AC42}.Release Unicode|Win32.Build.0 = Release Unicode|Win32 - {FC70988B-1AE5-4381-866D-4F405E28AC42}.Release Unicode|Win64 (AMD64).ActiveCfg = Release Unicode|Win32 - {FC70988B-1AE5-4381-866D-4F405E28AC42}.Release|Win32.ActiveCfg = Release|Win32 - {FC70988B-1AE5-4381-866D-4F405E28AC42}.Release|Win32.Build.0 = Release|Win32 - {FC70988B-1AE5-4381-866D-4F405E28AC42}.Release|Win64 (AMD64).ActiveCfg = Release|Win32 - {D514EA4D-EAFB-47A9-A437-A582CA571251}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32 - {D514EA4D-EAFB-47A9-A437-A582CA571251}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32 - {D514EA4D-EAFB-47A9-A437-A582CA571251}.Debug Unicode|Win64 (AMD64).ActiveCfg = Debug Unicode|Win32 - {D514EA4D-EAFB-47A9-A437-A582CA571251}.Debug|Win32.ActiveCfg = Debug|Win32 - {D514EA4D-EAFB-47A9-A437-A582CA571251}.Debug|Win32.Build.0 = Debug|Win32 - {D514EA4D-EAFB-47A9-A437-A582CA571251}.Debug|Win64 (AMD64).ActiveCfg = Debug|Win32 - {D514EA4D-EAFB-47A9-A437-A582CA571251}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32 - {D514EA4D-EAFB-47A9-A437-A582CA571251}.Release Unicode|Win32.Build.0 = Release Unicode|Win32 - {D514EA4D-EAFB-47A9-A437-A582CA571251}.Release Unicode|Win64 (AMD64).ActiveCfg = Release Unicode|Win32 - {D514EA4D-EAFB-47A9-A437-A582CA571251}.Release|Win32.ActiveCfg = Release|Win32 - {D514EA4D-EAFB-47A9-A437-A582CA571251}.Release|Win32.Build.0 = Release|Win32 - {D514EA4D-EAFB-47A9-A437-A582CA571251}.Release|Win64 (AMD64).ActiveCfg = Release|Win32 - {1A2DFD1A-3C6C-44D1-909D-294AF646B575}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32 - {1A2DFD1A-3C6C-44D1-909D-294AF646B575}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32 - {1A2DFD1A-3C6C-44D1-909D-294AF646B575}.Debug Unicode|Win64 (AMD64).ActiveCfg = Debug Unicode|Win32 - {1A2DFD1A-3C6C-44D1-909D-294AF646B575}.Debug|Win32.ActiveCfg = Debug|Win32 - {1A2DFD1A-3C6C-44D1-909D-294AF646B575}.Debug|Win32.Build.0 = Debug|Win32 - {1A2DFD1A-3C6C-44D1-909D-294AF646B575}.Debug|Win64 (AMD64).ActiveCfg = Debug|Win32 - {1A2DFD1A-3C6C-44D1-909D-294AF646B575}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32 - {1A2DFD1A-3C6C-44D1-909D-294AF646B575}.Release Unicode|Win32.Build.0 = Release Unicode|Win32 - {1A2DFD1A-3C6C-44D1-909D-294AF646B575}.Release Unicode|Win64 (AMD64).ActiveCfg = Release Unicode|Win32 - {1A2DFD1A-3C6C-44D1-909D-294AF646B575}.Release|Win32.ActiveCfg = Release|Win32 - {1A2DFD1A-3C6C-44D1-909D-294AF646B575}.Release|Win32.Build.0 = Release|Win32 - {1A2DFD1A-3C6C-44D1-909D-294AF646B575}.Release|Win64 (AMD64).ActiveCfg = Release|Win32 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Debug Unicode|Win64 (AMD64).ActiveCfg = Debug Unicode|Win32 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Debug|Win32.ActiveCfg = Debug|Win32 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Debug|Win32.Build.0 = Debug|Win32 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Debug|Win64 (AMD64).ActiveCfg = Debug|Win32 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Release Unicode|Win32.Build.0 = Release Unicode|Win32 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Release Unicode|Win64 (AMD64).ActiveCfg = Release Unicode|Win32 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Release|Win32.ActiveCfg = Release|Win32 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Release|Win32.Build.0 = Release|Win32 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Release|Win64 (AMD64).ActiveCfg = Release|Win32 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Debug Unicode|Win64 (AMD64).ActiveCfg = Debug Unicode|Win32 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Debug|Win32.ActiveCfg = Debug|Win32 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Debug|Win32.Build.0 = Debug|Win32 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Debug|Win64 (AMD64).ActiveCfg = Debug|Win32 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Release Unicode|Win32.Build.0 = Release Unicode|Win32 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Release Unicode|Win64 (AMD64).ActiveCfg = Release Unicode|Win32 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Release|Win32.ActiveCfg = Release|Win32 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Release|Win32.Build.0 = Release|Win32 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Release|Win64 (AMD64).ActiveCfg = Release|Win32 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Debug Unicode|Win64 (AMD64).ActiveCfg = Debug Unicode|Win32 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Debug|Win32.ActiveCfg = Debug|Win32 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Debug|Win32.Build.0 = Debug|Win32 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Debug|Win64 (AMD64).ActiveCfg = Debug|Win32 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Release Unicode|Win32.Build.0 = Release Unicode|Win32 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Release Unicode|Win64 (AMD64).ActiveCfg = Release Unicode|Win32 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Release|Win32.ActiveCfg = Release|Win32 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Release|Win32.Build.0 = Release|Win32 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Release|Win64 (AMD64).ActiveCfg = Release|Win32 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Debug Unicode|Win64 (AMD64).ActiveCfg = Debug Unicode|Win32 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Debug|Win32.ActiveCfg = Debug|Win32 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Debug|Win32.Build.0 = Debug|Win32 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Debug|Win64 (AMD64).ActiveCfg = Debug|Win32 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Release Unicode|Win32.Build.0 = Release Unicode|Win32 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Release Unicode|Win64 (AMD64).ActiveCfg = Release Unicode|Win32 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Release|Win32.ActiveCfg = Release|Win32 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Release|Win32.Build.0 = Release|Win32 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Release|Win64 (AMD64).ActiveCfg = Release|Win32 - {DD9D2D92-2241-408A-859E-B85D444B7E3C}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32 - {DD9D2D92-2241-408A-859E-B85D444B7E3C}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32 - {DD9D2D92-2241-408A-859E-B85D444B7E3C}.Debug Unicode|Win64 (AMD64).ActiveCfg = Debug Unicode|Win32 - {DD9D2D92-2241-408A-859E-B85D444B7E3C}.Debug|Win32.ActiveCfg = Debug|Win32 - {DD9D2D92-2241-408A-859E-B85D444B7E3C}.Debug|Win32.Build.0 = Debug|Win32 - {DD9D2D92-2241-408A-859E-B85D444B7E3C}.Debug|Win64 (AMD64).ActiveCfg = Debug|Win32 - {DD9D2D92-2241-408A-859E-B85D444B7E3C}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32 - {DD9D2D92-2241-408A-859E-B85D444B7E3C}.Release Unicode|Win32.Build.0 = Release Unicode|Win32 - {DD9D2D92-2241-408A-859E-B85D444B7E3C}.Release Unicode|Win64 (AMD64).ActiveCfg = Release Unicode|Win32 - {DD9D2D92-2241-408A-859E-B85D444B7E3C}.Release|Win32.ActiveCfg = Release|Win32 - {DD9D2D92-2241-408A-859E-B85D444B7E3C}.Release|Win32.Build.0 = Release|Win32 - {DD9D2D92-2241-408A-859E-B85D444B7E3C}.Release|Win64 (AMD64).ActiveCfg = Release|Win32 - {FC8080D1-603C-45EC-BCFA-7172E2F3D989}.Debug Unicode|Win32.ActiveCfg = Debug|Win32 - {FC8080D1-603C-45EC-BCFA-7172E2F3D989}.Debug Unicode|Win32.Build.0 = Debug|Win32 - {FC8080D1-603C-45EC-BCFA-7172E2F3D989}.Debug Unicode|Win64 (AMD64).ActiveCfg = Debug|Win32 - {FC8080D1-603C-45EC-BCFA-7172E2F3D989}.Debug|Win32.ActiveCfg = Debug|Win32 - {FC8080D1-603C-45EC-BCFA-7172E2F3D989}.Debug|Win32.Build.0 = Debug|Win32 - {FC8080D1-603C-45EC-BCFA-7172E2F3D989}.Debug|Win64 (AMD64).ActiveCfg = Debug|Win32 - {FC8080D1-603C-45EC-BCFA-7172E2F3D989}.Release Unicode|Win32.ActiveCfg = Release|Win32 - {FC8080D1-603C-45EC-BCFA-7172E2F3D989}.Release Unicode|Win32.Build.0 = Release|Win32 - {FC8080D1-603C-45EC-BCFA-7172E2F3D989}.Release Unicode|Win64 (AMD64).ActiveCfg = Release|Win32 - {FC8080D1-603C-45EC-BCFA-7172E2F3D989}.Release|Win32.ActiveCfg = Release|Win32 - {FC8080D1-603C-45EC-BCFA-7172E2F3D989}.Release|Win32.Build.0 = Release|Win32 - {FC8080D1-603C-45EC-BCFA-7172E2F3D989}.Release|Win64 (AMD64).ActiveCfg = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/apps/mplayerc/mplayerc_vs2005.vcproj b/src/apps/mplayerc/mplayerc_vs2005.vcproj deleted file mode 100644 index fc13bc8d6..000000000 --- a/src/apps/mplayerc/mplayerc_vs2005.vcproj +++ /dev/null @@ -1,1493 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/apps/mplayerc/mplayerc_vs2008.vcproj b/src/apps/mplayerc/mplayerc_vs2008.vcproj deleted file mode 100644 index dda51e0e0..000000000 --- a/src/apps/mplayerc/mplayerc_vs2008.vcproj +++ /dev/null @@ -1,1496 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/apps/mplayerc/pngdib.c b/src/apps/mplayerc/pngdib.c deleted file mode 100644 index 187c8aa32..000000000 --- a/src/apps/mplayerc/pngdib.c +++ /dev/null @@ -1,1594 +0,0 @@ -// pngdib.c -// -// PNGDIB - a mini PNG<->DIB (BMP) image conversion library for Win32 -// By Jason Summers -// This software may be used without restriction. -// - -#include -#include -#include -#include -#include -#include - -#include "..\..\libpng\png.h" - -#define PNGDIB_INTERNALS -#include "pngdib.h" - - -#define PNGDIB_SRC_VERSION 30001 -#define PNGDIB_SRC_VERSION_STRING _T("3.0.1") - - -#if PNGDIB_SRC_VERSION != PNGDIB_HEADER_VERSION -#error Wrong PNGDIB header file version -#endif - -#if (PNG_LIBPNG_VER<10202) || \ - (PNG_LIBPNG_VER==10202 && PNG_LIBPNG_BUILD_TYPE<2) || \ - (PNG_LIBPNG_VER==10202 && PNG_LIBPNG_BUILD_TYPE==2 && PNG_LIBPNG_VER_BUILD<5) -#error libpng 1.2.2b5 or higher is recommended -/* You can comment out the previous line if you aren't using gamma - * correction, or don't care about a few obscure gamma correction - * problems that exist in earlier versions of libpng. */ -#endif - - -// This is basically a Windows-only utility with a simple-as-possible -// interface, so I'm not too concerned about allowing a -// user-configurable screen gamma. -//static const double screen_gamma = 2.2; - -#define MAX_ERRMSGLEN 100 - -struct errstruct { - jmp_buf *jbufp; - TCHAR *errmsg; -}; - -static void pngd_get_error_message(int rv,TCHAR *e) -{ - switch(rv) { - case PNGD_E_ERROR: lstrcpy(e,_T("Unknown error")); break; - case PNGD_E_VERSION: lstrcpy(e,_T("Incompatible library version")); break; - case PNGD_E_NOMEM: lstrcpy(e,_T("Unable to allocate memory")); break; - case PNGD_E_UNSUPP: lstrcpy(e,_T("Invalid or unsupported image")); break; - case PNGD_E_LIBPNG: lstrcpy(e,_T("libpng reported an error")); break; - case PNGD_E_BADBMP: lstrcpy(e,_T("Invalid BMP image")); break; - case PNGD_E_BADPNG: lstrcpy(e,_T("Invalid PNG image")); break; - case PNGD_E_READ: lstrcpy(e,_T("Unable to read file")); break; - case PNGD_E_WRITE: lstrcpy(e,_T("Unable to write file")); break; - } -} - -static unsigned char* uncompress_dib(LPBITMAPINFO lpbmi1, int infosize, void *lpbits1) -{ - LPBITMAPINFOHEADER lpdib2; - unsigned char *lpbits2; - void *whatever; - int linesize, bitssize; - HBITMAP hb; - HDC hdc; - HGDIOBJ rvgdi; - int rvi; - int width,height; - LPBITMAPINFOHEADER lpdib1; - - lpdib1=(LPBITMAPINFOHEADER)lpbmi1; - width=lpdib1->biWidth; - height=lpdib1->biHeight; - - linesize= (((width * lpdib1->biBitCount)+31)/32)*4; - bitssize= linesize*height; - - lpdib2= (LPBITMAPINFOHEADER)malloc(infosize); - if(!lpdib2) return NULL; - - // create a header for the new uncompressed DIB - CopyMemory((void*)lpdib2,(void*)lpdib1,infosize); - lpdib2->biCompression=BI_RGB; - lpdib2->biSizeImage=0; - - lpbits2= (unsigned char*)malloc(bitssize); - if(!lpbits2) { free((void*)lpdib2); return NULL; } - - - // Windows bitmap handling functions are not exactly convenient, - // especially when trying to deal with DIBs. Every function wants - // to convert them into DDBs. We have to play stupid games and - // convert back and forth. This probably uses too much memory, - // and I'm not 100% sure it is exactly correct, but it seems to - // work for me. - - hb=CreateDIBSection(NULL,(LPBITMAPINFO)lpdib2,DIB_RGB_COLORS,&whatever,NULL,0); - - hdc=CreateCompatibleDC(NULL); - rvgdi=SelectObject(hdc,hb); - //SetStretchBltMode(hdc,COLORONCOLOR); - rvi=StretchDIBits(hdc, - 0,0,width,height, - 0,0,width,height, - lpbits1, (LPBITMAPINFO)lpdib1, - DIB_RGB_COLORS,SRCCOPY); - rvi=GetDIBits(hdc,hb,0,height, (LPVOID)lpbits2, - (LPBITMAPINFO)lpdib2,DIB_RGB_COLORS); - - DeleteDC(hdc); - DeleteObject(hb); - free((void*)lpdib2); - - return lpbits2; -} - - -static void my_png_error_fn(png_structp png_ptr, const char *err_msg) -{ - struct errstruct *errinfop; - jmp_buf *j; - - errinfop = (struct errstruct *)png_get_error_ptr(png_ptr); - j = errinfop->jbufp; - -#ifdef _UNICODE - _snwprintf(errinfop->errmsg,MAX_ERRMSGLEN,_T("[libpng] %S"),err_msg); -#else - _snprintf(errinfop->errmsg,MAX_ERRMSGLEN,"[libpng] %s",err_msg); -#endif - - errinfop->errmsg[MAX_ERRMSGLEN-1]='\0'; - longjmp(*j, -1); -} - - -static void my_png_warning_fn(png_structp png_ptr, const char *warn_msg) -{ - return; -} - -// A callback function used when reading memory-mapped PNG files. -static void my_png_read_fn(png_structp png_ptr, - png_bytep data, png_size_t length) -{ - struct p2d_struct *p2d; - - p2d = (struct p2d_struct*)png_get_io_ptr(png_ptr); - - if(p2d->input_memblk_size>0) { - if((int)length > (p2d->input_memblk_size - p2d->input_memblk_curpos)) { - png_error(png_ptr, "read error: unexpected end of file"); - return; - } - } - - CopyMemory((void*)data,(void*)&p2d->input_memblk[p2d->input_memblk_curpos],length); - p2d->input_memblk_curpos+=length; -} - - -// This function should perform identically to libpng's gamma correction. -// I'd prefer to have libpng do all gamma correction itself, -// but I can't figure out how to do that efficiently. -static void gamma_correct(double screen_gamma,double file_gamma, - unsigned char *red, unsigned char *green, unsigned char *blue) -{ - double g; - -#ifndef PNG_GAMMA_THRESHOLD -# define PNG_GAMMA_THRESHOLD 0.05 -#endif - - if(fabs(screen_gamma*file_gamma-1.0)<=PNG_GAMMA_THRESHOLD) return; - - if (screen_gamma>0.000001) - g=1.0/(file_gamma*screen_gamma); - else - g=1.0; - - (*red) = (unsigned char)(pow((double)(*red )/255.0,g)*255.0+0.5); - (*green) = (unsigned char)(pow((double)(*green)/255.0,g)*255.0+0.5); - (*blue) = (unsigned char)(pow((double)(*blue )/255.0,g)*255.0+0.5); -} - - -int PNGDIB_DECL pngdib_p2d_run(PNGDIB *qq) -{ - struct p2d_struct *p2d; - - png_structp png_ptr; - png_infop info_ptr; - jmp_buf jbuf; - struct errstruct errinfo; - png_uint_32 width, height; - int png_bit_depth, color_type, interlace_type; - png_colorp png_palette; - png_uint_32 res_x, res_y; - int has_phys, has_gama; - int res_unit_type; - FILE *fp; - int palette_entries; - unsigned char **row_pointers; - unsigned char *lpdib; - unsigned char *dib_palette; - unsigned char *dib_bits; - unsigned char *tmprow; - int dib_bpp, dib_bytesperrow; - int i,j; - int rv; - png_color_16 bkgd; // used with png_set_background - int has_trns, trns_color; - int has_bkgd; // ==1 if there a bkgd chunk, and USE_BKGD flag - png_color_16p temp_colorp; - png_color_16p bg_colorp; // background color (if has_bkgd) - png_bytep trns_trans; - int manual_trns; - int manual_gamma; - struct PNGD_COLOR_struct bkgd_color; - int is_grayscale,has_alpha_channel; - double file_gamma; - int dib_alpha32; - int write_bitfields; - - p2d=(struct p2d_struct*)qq; - - dib_alpha32=0; - write_bitfields=0; - - - manual_trns=0; - has_trns=has_bkgd=0; - rv=PNGD_E_ERROR; - png_ptr=NULL; - info_ptr=NULL; - fp=NULL; - row_pointers=NULL; - lpdib=NULL; - - lstrcpy(p2d->common.errmsg,_T("")); - - if(p2d->use_custom_bg_flag) { - bkgd_color.red= p2d->bgcolor.red; - bkgd_color.green= p2d->bgcolor.green; - bkgd_color.blue= p2d->bgcolor.blue; - } - else { - bkgd_color.red= 255; // Should never get used. If the - bkgd_color.green= 128; // background turns orange, it's a bug. - bkgd_color.blue= 0; - } - - // Set the user-defined pointer to point to our jmp_buf. This will - // hopefully protect against potentially different sized jmp_buf's in - // libpng, while still allowing this library to be threadsafe. - errinfo.jbufp = &jbuf; - errinfo.errmsg = p2d->common.errmsg; - - png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING,(void*)(&errinfo), - my_png_error_fn, my_png_warning_fn); - if(!png_ptr) { rv=PNGD_E_NOMEM; goto abort; } - - - info_ptr = png_create_info_struct(png_ptr); - if(!info_ptr) { - //png_destroy_read_struct(&png_ptr, (png_infopp)NULL, (png_infopp)NULL); - rv=PNGD_E_NOMEM; goto abort; - } - - if(setjmp(jbuf)) { - // we'll get here if an error occurred in any of the following - // png_ functions - - rv=PNGD_E_LIBPNG; - goto abort; - } - - if(p2d->input_method==0) { - // reading from a filename - if(!p2d->input_filename) { - wsprintf(p2d->common.errmsg,_T("Input filename not set")); - rv=PNGD_E_ERROR; goto abort; - } - - if((fp = _tfopen(p2d->input_filename,_T("rb"))) == NULL) { - rv=PNGD_E_READ; - goto abort; - } - png_init_io(png_ptr, fp); - } - else if(p2d->input_method==1) { - // reading from a memory block - p2d->input_memblk_curpos=0; - png_set_read_fn(png_ptr, (void*)p2d, my_png_read_fn); - } - else { goto abort; } - - png_read_info(png_ptr, info_ptr); - - png_get_IHDR(png_ptr, info_ptr, &width, &height, &png_bit_depth, &color_type, - &interlace_type, NULL, NULL); - - p2d->color_type=color_type; - p2d->bits_per_sample=png_bit_depth; - p2d->interlace=interlace_type; - switch(color_type) { - case PNG_COLOR_TYPE_RGB: p2d->bits_per_pixel=png_bit_depth*3; break; - case PNG_COLOR_TYPE_RGB_ALPHA: p2d->bits_per_pixel=png_bit_depth*4; break; - case PNG_COLOR_TYPE_GRAY_ALPHA: p2d->bits_per_pixel=png_bit_depth*2; break; - default: p2d->bits_per_pixel=png_bit_depth; - } - - is_grayscale = !(color_type&PNG_COLOR_MASK_COLOR); - has_alpha_channel = (color_type&PNG_COLOR_MASK_ALPHA)?1:0; - - has_trns = png_get_valid(png_ptr,info_ptr,PNG_INFO_tRNS); - - if(p2d->common.dib_alpha32 && (has_trns || has_alpha_channel)) { - // Fixme - if trns(for palette) has no transparent entries, - // we could skip this. - dib_alpha32=1; - write_bitfields=1; - - if (!(color_type&PNG_COLOR_MASK_COLOR)) { - png_set_gray_to_rgb(png_ptr); - } - else if(color_type==PNG_COLOR_TYPE_PALETTE) { - png_set_palette_to_rgb(png_ptr); - } - - if (has_trns) png_set_tRNS_to_alpha(png_ptr); - - goto notrans; - } - - // look for bKGD chunk, and process if applicable - if(p2d->use_file_bg_flag) { - if(png_get_bKGD(png_ptr, info_ptr, &bg_colorp)) { - // process the background, store 8-bit RGB in bkgd_color - has_bkgd=1; - - if(is_grayscale && png_bit_depth<8) { - bkgd_color.red = - bkgd_color.green= - bkgd_color.blue = - (unsigned char) ( (bg_colorp->gray*255)/( (1<red); - bkgd_color.green=(unsigned char)(bg_colorp->green); - bkgd_color.blue =(unsigned char)(bg_colorp->blue); - } - else { - bkgd_color.red=(unsigned char)(bg_colorp->red>>8); - bkgd_color.green=(unsigned char)(bg_colorp->green>>8); - bkgd_color.blue =(unsigned char)(bg_colorp->blue>>8); - } - } - } - - if( !(color_type & PNG_COLOR_MASK_ALPHA) && !has_trns) { - // If no transparency, we can skip this whole background-color mess. - goto notrans; - } - - if(has_bkgd && (png_bit_depth>8 || !is_grayscale || has_alpha_channel)) { - png_set_background(png_ptr, bg_colorp, - PNG_BACKGROUND_GAMMA_FILE, 1, 1.0); - } - else if(is_grayscale && has_trns && png_bit_depth<=8 - && (has_bkgd || (p2d->use_custom_bg_flag)) ) - { - // grayscale binarytrans,<=8bpp: transparency is handle manually - // by modifying a palette entry (later) - png_get_tRNS(png_ptr,info_ptr,&trns_trans, &i, &temp_colorp); - if(i>=1) { - trns_color= temp_colorp->gray; // corresponds to a palette entry - manual_trns=1; - } - } - else if(!has_bkgd && (has_trns || has_alpha_channel) && - (p2d->use_custom_bg_flag) ) - { // process most CUSTOM background colors - bkgd.index = 0; // unused - bkgd.red = p2d->bgcolor.red; - bkgd.green = p2d->bgcolor.green; - bkgd.blue = p2d->bgcolor.blue; - - // libpng may use bkgd.gray if bkgd.red==bkgd.green==bkgd.blue. - // Not sure if that's a libpng bug or not. - bkgd.gray = p2d->bgcolor.red; - - if(png_bit_depth>8) { - bkgd.red = (bkgd.red <<8)|bkgd.red; - bkgd.green= (bkgd.green<<8)|bkgd.green; - bkgd.blue = (bkgd.blue <<8)|bkgd.blue; - bkgd.gray = (bkgd.gray <<8)|bkgd.gray; - } - - if(is_grayscale) { - /* assert(png_bit_depth>8); */ - - /* Need to expand to full RGB if unless background is pure gray */ - if(bkgd.red!=bkgd.green || bkgd.red!=bkgd.blue) { - png_set_gray_to_rgb(png_ptr); - - // png_set_tRNS_to_alpha() is called here because otherwise - // binary transparency for 16-bps grayscale images doesn't - // work. Libpng will think black pixels are transparent. - // I don't know exactly why it works. It does *not* add an - // alpha channel, as you might think (adding an alpha - // channnel makes no sense if you are using - // png_set_background). - // - // Here's an alternate hack that also seems to work, but - // uses direct structure access: - // - // png_ptr->trans_values.red = - // png_ptr->trans_values.green = - // png_ptr->trans_values.blue = png_ptr->trans_values.gray; - if(has_trns) - png_set_tRNS_to_alpha(png_ptr); - - png_set_background(png_ptr, &bkgd, - PNG_BACKGROUND_GAMMA_SCREEN, 0, 1.0); - - } - else { // gray custom background - png_set_background(png_ptr, &bkgd, - PNG_BACKGROUND_GAMMA_SCREEN, 1, 1.0); - } - - } - else { - png_set_background(png_ptr, &bkgd, - PNG_BACKGROUND_GAMMA_SCREEN, 0, 1.0); - } - } - -notrans: - - // If we don't have any background color at all that we can use, - // strip the alpha channel. - if(!dib_alpha32 && has_alpha_channel && !has_bkgd && - !(p2d->use_custom_bg_flag) ) - { - png_set_strip_alpha(png_ptr); - } - - if(png_bit_depth>8) - png_set_strip_16(png_ptr); - - if (png_get_sRGB(png_ptr, info_ptr, &i)) { - has_gama=1; - file_gamma = 0.45455; - } - else if(png_get_gAMA(png_ptr, info_ptr, &file_gamma)) { - has_gama=1; - } - else { - has_gama=0; - file_gamma = 0.45455; - } - - if(/*imginfo && */ has_gama) { - p2d->file_gamma=file_gamma; - p2d->gamma_returned=1; - } - - manual_gamma=0; - if(p2d->gamma_correction) { - - if(!is_grayscale || png_bit_depth>8 || has_alpha_channel) { - png_set_gamma(png_ptr, p2d->screen_gamma, file_gamma); - //png_ptr->transformations |= 0x2000; // hack for old libpng versions - } - else manual_gamma=1; - - if(has_bkgd) { - // Gamma correct the background color (if we got it from the file) - // before returning it to the app. - gamma_correct(p2d->screen_gamma,file_gamma,&bkgd_color.red,&bkgd_color.green,&bkgd_color.blue); - } - } - - png_read_update_info(png_ptr, info_ptr); - - // color type may have changed, due to our transformations - color_type = png_get_color_type(png_ptr,info_ptr); - - - switch(color_type) { - case PNG_COLOR_TYPE_RGB_ALPHA: - assert(dib_alpha32); - dib_bpp= 32; - palette_entries=0; - png_set_bgr(png_ptr); - break; - case PNG_COLOR_TYPE_RGB: - dib_bpp= 24; - palette_entries=0; - png_set_bgr(png_ptr); - break; - case PNG_COLOR_TYPE_PALETTE: - dib_bpp=png_bit_depth; - png_get_PLTE(png_ptr,info_ptr,&png_palette,&palette_entries); - break; - case PNG_COLOR_TYPE_GRAY: - case PNG_COLOR_TYPE_GRAY_ALPHA: - dib_bpp=png_bit_depth; - if(png_bit_depth>8) dib_bpp=8; - palette_entries= 1<0 && res_y>0) { - p2d->res_x=res_x; - p2d->res_y=res_y; - p2d->res_units=res_unit_type; - p2d->res_valid=1; - } - } - - // DIB scanlines are padded to 4-byte boundaries. - dib_bytesperrow= (((width * dib_bpp)+31)/32)*4; - - p2d->bitssize = height*dib_bytesperrow; - - p2d->dibsize=sizeof(BITMAPINFOHEADER) + 4*palette_entries + - (write_bitfields?12:0) + p2d->bitssize;; - - if(p2d->common.malloc_function) { - lpdib = (unsigned char*)(*(p2d->common.malloc_function))(p2d->common.userdata,p2d->dibsize); - } - else { - lpdib = (unsigned char*)calloc(p2d->dibsize,1); - } - - - if(!lpdib) { rv=PNGD_E_NOMEM; goto abort; } - p2d->pdib = (LPBITMAPINFOHEADER)lpdib; - - row_pointers=(unsigned char**)malloc(height*sizeof(unsigned char*)); - if(!row_pointers) { rv=PNGD_E_NOMEM; goto abort; } - - // there is some redundancy here... - p2d->palette_offs=sizeof(BITMAPINFOHEADER); - p2d->bits_offs =sizeof(BITMAPINFOHEADER) + 4*palette_entries + (write_bitfields?12:0); - dib_palette= &lpdib[p2d->palette_offs]; - p2d->palette= (RGBQUAD*)dib_palette; - dib_bits = &lpdib[p2d->bits_offs]; - p2d->pbits = (VOID*)dib_bits; - p2d->palette_colors = palette_entries; - - // set up the DIB palette, if needed - switch(color_type) { - case PNG_COLOR_TYPE_PALETTE: - for(i=0;ipalette[i].rgbRed = png_palette[i].red; - p2d->palette[i].rgbGreen = png_palette[i].green; - p2d->palette[i].rgbBlue = png_palette[i].blue; - } - break; - case PNG_COLOR_TYPE_GRAY: - case PNG_COLOR_TYPE_GRAY_ALPHA: - for(i=0;ipalette[i].rgbRed = - p2d->palette[i].rgbGreen = - p2d->palette[i].rgbBlue = (i*255)/(palette_entries-1); - if(manual_gamma) { - gamma_correct(p2d->screen_gamma,file_gamma, - &(p2d->palette[i].rgbRed), - &(p2d->palette[i].rgbGreen), - &(p2d->palette[i].rgbBlue)); - } - } - if(manual_trns) { - p2d->palette[trns_color].rgbRed = bkgd_color.red; - p2d->palette[trns_color].rgbGreen = bkgd_color.green; - p2d->palette[trns_color].rgbBlue = bkgd_color.blue; - } - break; - } - - // set up BITFIELDS, if needed - if(dib_alpha32) { - static const unsigned char bf_data[12] = { - 0x00,0x00,0xff,0x00, - 0x00,0xff,0x00,0x00, - 0xff,0x00,0x00,0x00 - }; - - for(i=0;i<12;i++) { - lpdib[p2d->palette_offs+i]=bf_data[i]; - } - - } - - for(j=0;j<(int)height;j++) { - row_pointers[height-1-j]= &dib_bits[j*dib_bytesperrow]; - } - - png_read_image(png_ptr, row_pointers); - - // special handling for this bit depth, since it doesn't exist in DIBs - // expand 2bpp to 4bpp - if(png_bit_depth==2) { - tmprow = (unsigned char*)malloc((width+3)/4 ); - if(!tmprow) { rv=PNGD_E_NOMEM; goto abort; } - - for(j=0;j<(int)height;j++) { - CopyMemory(tmprow, row_pointers[j], (width+3)/4 ); - ZeroMemory(row_pointers[j], (width+1)/2 ); - - for(i=0;i<(int)width;i++) { - row_pointers[j][i/2] |= - ( ((tmprow[i/4] >> (2*(3-i%4)) ) & 0x03)<< (4*(1-i%2)) ); - } - } - free((void*)tmprow); - } - - free((void*)row_pointers); - row_pointers=NULL; - - png_read_end(png_ptr, info_ptr); - - png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL); - png_ptr=NULL; - - if(p2d->input_method==0) { - fclose(fp); - fp=NULL; - } - - // fill in the DIB header fields - p2d->pdib->biSize= sizeof(BITMAPINFOHEADER); - p2d->pdib->biWidth= width; - p2d->pdib->biHeight= height; - p2d->pdib->biPlanes= 1; - p2d->pdib->biBitCount= dib_bpp; - p2d->pdib->biCompression= write_bitfields?BI_BITFIELDS:BI_RGB; - // biSizeImage can also be 0 in uncompressed bitmaps - p2d->pdib->biSizeImage= height*dib_bytesperrow; - - if(has_phys) { - if(res_unit_type==1) { - p2d->pdib->biXPelsPerMeter= res_x; - p2d->pdib->biYPelsPerMeter= res_y; - } - } - p2d->pdib->biClrUsed= palette_entries; - p2d->pdib->biClrImportant= 0; - - if(has_bkgd || (p2d->use_custom_bg_flag)) { - // return the background color if one was used - p2d->bgcolor.red = bkgd_color.red; - p2d->bgcolor.green = bkgd_color.green; - p2d->bgcolor.blue = bkgd_color.blue; - p2d->bgcolor_returned=1; - } - - return PNGD_E_SUCCESS; - -abort: - - if(png_ptr) png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL); - if(p2d->input_method==0 && fp) fclose(fp); - if(row_pointers) free((void*)row_pointers); - if(lpdib) { - pngdib_p2d_free_dib((PNGDIB*)p2d,NULL); - } - - // If we don't have an error message yet, use a - // default one based on the code - if(!lstrlen(p2d->common.errmsg)) { - pngd_get_error_message(rv,p2d->common.errmsg); - } - - return rv; -} - -void PNGDIB_DECL pngdib_p2d_free_dib(PNGDIB *qq, BITMAPINFOHEADER* pdib) -{ - struct p2d_struct *p2d; - - if(!qq) { - if(pdib) free((void*)pdib); - return; - } - - p2d=(struct p2d_struct*)qq; - if(!pdib) { - // DIB not explicitly given; use the one from the PNGDIB object. - // (this is the normal case) - pdib = p2d->pdib; - p2d->pdib = NULL; - } - if(pdib) { - if(p2d->common.free_function) { - (*(p2d->common.free_function))(p2d->common.userdata,(void*)pdib); - } - else { - free((void*)pdib); - } - } -} - -int PNGDIB_DECL pngdib_d2p_run(PNGDIB *qq) -{ - struct d2p_struct *d2p; - png_structp png_ptr; - png_infop info_ptr; - jmp_buf jbuf; - struct errstruct errinfo; - png_text text_ptr[1]; - unsigned char *bits; - unsigned char *newimage; - RGBQUAD* dib_palette; - int headersize, dib_bpp; - int png_color_type; - png_uint_32 res_x, res_y; - png_color_8 pngc8; - int height,width; - int palette_entries; - int topdown; - int dib_bytesperrow; - int compression; - FILE *fp; - png_color png_palette[256]; - unsigned char **row_pointers; - int i,x,y,size; - DWORD *bitfields; - unsigned int v; - int bf_format; // bitfields format identifier - int iscompressed; - int bfsize; // bytes in "bitfields" section - int palsize; // bytes in palette - - int palentsize; // bytes in a palette entry: 3 or 4; - BITMAPCOREHEADER *lpolddib; - int rv; // return code - int dib_alpha32; - - d2p=(struct d2p_struct*)qq; - - rv=PNGD_E_ERROR; // this should always get changed before returning - png_ptr=NULL; - info_ptr=NULL; - fp=NULL; - row_pointers=NULL; - newimage=NULL; - dib_alpha32=0; - - lstrcpy(d2p->common.errmsg,_T("")); - - if(!d2p->output_filename) { - wsprintf(d2p->common.errmsg,_T("Output filename not set")); - rv=PNGD_E_ERROR; goto abort; - } - - if(!d2p->pdib) { - wsprintf(d2p->common.errmsg,_T("Input DIB not set")); - rv=PNGD_E_ERROR; goto abort; - } - - - headersize= d2p->pdib->biSize; - - if(headersize<40 && headersize!=12) { - wsprintf(d2p->common.errmsg,_T("Unexpected BMP header size (%d)"),headersize); - rv=PNGD_E_BADBMP; goto abort; - } - - if(headersize==12) { - // This is to support an old kind of DIBs (OS/2) that aren't really - // used anymore. - palentsize= 3; - lpolddib= (BITMAPCOREHEADER*) d2p->pdib; - width= lpolddib->bcWidth; - height= lpolddib->bcHeight; - dib_bpp= lpolddib->bcBitCount; - compression = BI_RGB; - res_x = res_y = 0; - - // This will get adjusted later if there is a palette. - // Not sure it's right, though. Do old DIBs always have a - // full-sized palette? - palette_entries=0; - } - else { - palentsize=4; - width = d2p->pdib->biWidth; - height = d2p->pdib->biHeight; - dib_bpp = d2p->pdib->biBitCount; - compression = d2p->pdib->biCompression; - res_x = d2p->pdib->biXPelsPerMeter; - res_y = d2p->pdib->biYPelsPerMeter; - palette_entries = d2p->pdib->biClrUsed; - } - - // supposedly, if the height is negative, the top scanline is stored first - topdown=0; - if(height<0) { - height= -height; - topdown=1; - } - - // sanity check - if(height<1 || height>1000000 || width<1 || width>1000000) { - wsprintf(d2p->common.errmsg,_T("Unreasonable image dimensions (%dx%d)"),width,height); - rv=PNGD_E_BADBMP; goto abort; - } - - if(dib_bpp==32 && (d2p->common.dib_alpha32)) { - dib_alpha32=1; - } - - // only certain combinations of compression and bpp are allowed - switch(compression) { - case BI_RGB: - if(dib_bpp!=1 && dib_bpp!=4 && dib_bpp!=8 && dib_bpp!=16 - && dib_bpp!=24 && dib_bpp!=32) - { - wsprintf(d2p->common.errmsg,_T("Unsupported bit depth (%d)"),dib_bpp); - rv=PNGD_E_UNSUPP; goto abort; - } - break; - case BI_RLE4: - if(dib_bpp!=4) { - rv=PNGD_E_UNSUPP; goto abort; - } - break; - case BI_RLE8: - if(dib_bpp!=8) { - rv=PNGD_E_UNSUPP; goto abort; - } - break; - case BI_BITFIELDS: - if(dib_bpp!=16 && dib_bpp!=32) { - rv=PNGD_E_UNSUPP; goto abort; - } - break; - default: - wsprintf(d2p->common.errmsg,_T("Unsupported compression scheme")); - return PNGD_E_UNSUPP; - } - - iscompressed= (compression==BI_RLE4 || compression==BI_RLE8); - - // uncompressed dibs are padded to 4-byte bondaries - dib_bytesperrow= (((width * dib_bpp)+31)/32)*4; - - if(dib_bpp<16) { - if(palette_entries==0) palette_entries = 1<dibsize) { - if(size>d2p->dibsize) { - rv=PNGD_E_BADBMP; goto abort; - } - } - - if(d2p->pbits) { - if(d2p->bitssize && !iscompressed) { // bounds check - size=dib_bytesperrow*height; - if(size>d2p->bitssize) { rv=PNGD_E_BADBMP; goto abort; } - } - - bits=(unsigned char*)d2p->pbits; - } - else { - // If not provided by user, assume the bits immediately - // follow the palette. - - if(d2p->dibsize && !iscompressed) { // bounds check - size= headersize+bfsize+palsize+dib_bytesperrow*height; - if(size>d2p->dibsize) { rv=PNGD_E_BADBMP; goto abort; } - } - - bits= &((unsigned char*)(d2p->pdib))[headersize+bfsize+palsize]; - } - - bitfields = (DWORD*) ( &((unsigned char*)(d2p->pdib))[headersize] ); - dib_palette = (RGBQUAD*) ( &((unsigned char*)(d2p->pdib))[headersize+bfsize] ); - - bf_format=0; - if(compression==BI_BITFIELDS) { - if(dib_bpp==16) { - if (bitfields[0]==0x00007c00 && bitfields[1]==0x000003e0 && - bitfields[2]==0x0000001f) bf_format=11; // 555 - else if(bitfields[0]==0x0000f800 && bitfields[1]==0x000007e0 && - bitfields[2]==0x0000001f) bf_format=12; // 565 - else { rv=PNGD_E_UNSUPP; goto abort; } - } - if(dib_bpp==32) { - if (bitfields[0]==0x00ff0000 && bitfields[1]==0x0000ff00 && - bitfields[2]==0x000000ff) bf_format=21; - else { rv=PNGD_E_UNSUPP; goto abort; } - } - } - - if(bf_format==0 && dib_bpp==16) bf_format=10; - if(bf_format==0 && dib_bpp==32) bf_format=20; - - - // Done analyzing the DIB, now time to convert it to PNG - - // FIXME: this probably isn't quite right - // jbuf: see comments in read_png_to_dib() - errinfo.jbufp = &jbuf; - errinfo.errmsg = d2p->common.errmsg; - png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, (void*)(&errinfo), - my_png_error_fn, my_png_warning_fn); - if (!png_ptr) { rv=PNGD_E_NOMEM; goto abort; } - - - info_ptr = png_create_info_struct(png_ptr); - if (!info_ptr) { - //png_destroy_write_struct(&png_ptr,(png_infopp)NULL); - rv=PNGD_E_NOMEM; goto abort; - } - - if(setjmp(jbuf)) { - // we'll get here if an error occurred in any of the following - // png_ functions - rv=PNGD_E_LIBPNG; - goto abort; - } - - fp= _tfopen(d2p->output_filename,_T("wb")); - if(!fp) { - rv=PNGD_E_WRITE; - goto abort; - } - - png_init_io(png_ptr, fp); - - if(dib_alpha32) { - png_color_type = PNG_COLOR_TYPE_RGB_ALPHA; - } - else { - png_color_type = (dib_bpp>8)?PNG_COLOR_TYPE_RGB:PNG_COLOR_TYPE_PALETTE; - } - - png_set_IHDR(png_ptr, info_ptr, width, height, (dib_bpp>8)?8:dib_bpp, - png_color_type, - (d2p->interlaced)?PNG_INTERLACE_ADAM7:PNG_INTERLACE_NONE, - PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE); - - // write sRGB and gAMA chunks - if(d2p->file_gamma_valid) { - if(d2p->file_gamma>0.454539 && d2p->file_gamma<0.454551) { - png_set_sRGB(png_ptr, info_ptr, PNG_sRGB_INTENT_RELATIVE); - } - png_set_gAMA(png_ptr, info_ptr, d2p->file_gamma); - } - - // For 16-bit DIBs, we get to write an sBIT chunk. - if(bf_format==10 || bf_format==11) { - pngc8.red= 5; pngc8.green= 5; pngc8.blue= 5; - png_set_sBIT(png_ptr, info_ptr, &pngc8); - } - if(bf_format==12) { - pngc8.red= 5; pngc8.green= 6; pngc8.blue= 5; - png_set_sBIT(png_ptr, info_ptr, &pngc8); - } - - // pHYs - if(res_x>0 && res_y>0) - png_set_pHYs(png_ptr, info_ptr, res_x, res_y, 1); - - - if(palette_entries>0) { - for(i=0;i8) - png_set_bgr(png_ptr); - - png_write_info(png_ptr, info_ptr); - - row_pointers=(unsigned char**)malloc(height*sizeof(unsigned char*)); - if(!row_pointers) { rv=PNGD_E_NOMEM; goto abort; } - - - if(dib_bpp==16 || (dib_bpp==32 && !dib_alpha32)) { - - // Special handling for these bit depths. - // This uses a lot of memory, and could be improved by processing - // one line at a time (but that makes it tricky to write interlaced - // images). - - newimage=(unsigned char*)malloc(height*width*3); - if(!newimage) { rv=PNGD_E_NOMEM; goto abort; } - - for(y=0;y>2; // blue - newimage[(y*width+x)*3+1]= (v & 0x000003e0)>>2 | (v & 0x000003e0)>>7; // green - newimage[(y*width+x)*3+2]= (v & 0x00007c00)>>7 | (v & 0x00007c00)>>12; // red - break; - case 12: // 16-bit, format 565 (RRRRRGGG GGGBBBBB) - v= bits[y*dib_bytesperrow+x*2+0] | (bits[y*dib_bytesperrow+x*2+1]<<8); - newimage[(y*width+x)*3+0]= (v & 0x0000001f)<<3 | (v & 0x0000001f)>>2; // blue - newimage[(y*width+x)*3+1]= (v & 0x000007e0)>>3 | (v & 0x000007e0)>>9; // green - newimage[(y*width+x)*3+2]= (v & 0x0000f800)>>8 | (v & 0x0000f800)>>13; // red - break; - case 20: case 21: // 32-bit, every 4th byte wasted (b g r x) - newimage[(y*width+x)*3+0]= bits[y*dib_bytesperrow+x*4+0]; // blue - newimage[(y*width+x)*3+1]= bits[y*dib_bytesperrow+x*4+1]; // green - newimage[(y*width+x)*3+2]= bits[y*dib_bytesperrow+x*4+2]; // red - break; - } - } - } - - for(i=0;ipdib, headersize+bfsize+palsize, bits); - if(!newimage) { rv=PNGD_E_NOMEM; goto abort; } - for(i=0;isoftware_id_string) { - text_ptr[0].key = "Software"; - text_ptr[0].text = d2p->software_id_string; - text_ptr[0].compression = PNG_TEXT_COMPRESSION_NONE; - png_set_text(png_ptr, info_ptr, text_ptr, 1); - } - - png_write_end(png_ptr, info_ptr); - - rv=PNGD_E_SUCCESS; - -abort: - if(png_ptr) png_destroy_write_struct(&png_ptr, &info_ptr); - if(fp) fclose(fp); - if(row_pointers) free(row_pointers); - if(newimage) free(newimage); - - // If we don't have an error message yet, use a - // default one based on the code - if(!lstrlen(d2p->common.errmsg)) { - pngd_get_error_message(rv,d2p->common.errmsg); - } - return rv; -} - -TCHAR* PNGDIB_DECL pngdib_get_version_string(void) -{ - return PNGDIB_SRC_VERSION_STRING; -} - -int PNGDIB_DECL pngdib_get_version(void) -{ - return PNGDIB_SRC_VERSION; -} - - -PNGDIB* PNGDIB_DECL _pngdib_init(int structtype, int caller_header_vers) -{ - PNGDIB *qq = NULL; - - if(structtype==PNGD_ST_D2P) { - struct d2p_struct *d2p; - - d2p = (struct d2p_struct *)calloc(sizeof(struct d2p_struct),1); - if(d2p) { - d2p->common.structtype = PNGD_ST_D2P; - d2p->file_gamma_valid = 1; - d2p->file_gamma = PNGDIB_DEFAULT_FILE_GAMMA; - } - qq=(PNGDIB*)d2p; - - } - else if(structtype==PNGD_ST_P2D) { - struct p2d_struct *p2d; - - p2d = (struct p2d_struct *)calloc(sizeof(struct p2d_struct),1); - if(p2d) { - p2d->common.structtype = PNGD_ST_P2D; - } - qq=(PNGDIB*)p2d; - } - - // initialize common fields: - if(qq) { - qq->errmsg = calloc(PNGDIB_ERRMSG_MAX,sizeof(TCHAR)); - } - - return qq; -} - - -int PNGDIB_DECL pngdib_d2p_set_dib(PNGDIB *qq, - const BITMAPINFOHEADER* lpdib, int dibsize, - const void* lpbits, int bitssize) -{ - struct d2p_struct *d2p; - if(qq->structtype!=PNGD_ST_D2P) return 0; - d2p=(struct d2p_struct*)qq; - - d2p->pdib = lpdib; - d2p->dibsize = dibsize; - d2p->pbits = lpbits; - d2p->bitssize = bitssize; - return 1; -} - -void PNGDIB_DECL pngdib_d2p_set_interlace(PNGDIB *qq, int interlaced) -{ - struct d2p_struct *d2p; - d2p=(struct d2p_struct*)qq; - d2p->interlaced = interlaced; -} - -int PNGDIB_DECL pngdib_d2p_set_png_filename(PNGDIB *qq, const TCHAR *fn) -{ - struct d2p_struct *d2p; - d2p=(struct d2p_struct*)qq; - d2p->output_filename = _tcsdup(fn); - return (d2p->output_filename)?1:0; -} - -int PNGDIB_DECL pngdib_d2p_set_software_id(PNGDIB *qq, const TCHAR *s) -{ - struct d2p_struct *d2p; - int len; - - d2p=(struct d2p_struct*)qq; - len= lstrlen(s); - - // The software id is never stored as UNICODE. -#ifdef _UNICODE - d2p->software_id_string = calloc(len+10,1); - _snprintf(d2p->software_id_string,len+10,"%S",s); -#else - d2p->software_id_string = _strdup(s); -#endif - - return (d2p->output_filename)?1:0; -} - - -void PNGDIB_DECL pngdib_d2p_set_gamma_label(PNGDIB *qq, int flag, double file_gamma) -{ - struct d2p_struct *d2p; - d2p=(struct d2p_struct*)qq; - d2p->file_gamma_valid = flag; - d2p->file_gamma = file_gamma; -} - -int PNGDIB_DECL pngdib_done(PNGDIB *qq) -{ - struct d2p_struct *d2p; - struct p2d_struct *p2d; - - if(!qq) return 0; - - if(qq->errmsg) free(qq->errmsg); - - switch(qq->structtype) { - case PNGD_ST_D2P: - d2p=(struct d2p_struct*)qq; - if(d2p->output_filename) free(d2p->output_filename); - if(d2p->software_id_string) free(d2p->software_id_string); - free(d2p); - return 1; - case PNGD_ST_P2D: - p2d=(struct p2d_struct*)qq; - if(p2d->input_filename) free(p2d->input_filename); - free(p2d); - return 1; - } - return 0; -} - -void PNGDIB_DECL pngdib_setcallback_malloc(PNGDIB *qq, - pngdib_malloc_cb_type mallocfunc, - pngdib_free_cb_type freefunc, - pngdib_realloc_cb_type reallocfunc) -{ - qq->malloc_function = mallocfunc; - qq->free_function = freefunc; - qq->realloc_function = reallocfunc; -} - - -TCHAR* PNGDIB_DECL pngdib_get_error_msg(PNGDIB *qq) -{ - return qq->errmsg; -} - -void PNGDIB_DECL pngdib_set_userdata(PNGDIB* qq, void* userdata) -{ - qq->userdata = userdata; -} - -void* PNGDIB_DECL pngdib_get_userdata(PNGDIB* qq) -{ - return qq->userdata; -} - - -int PNGDIB_DECL pngdib_p2d_set_png_filename(PNGDIB *qq, const TCHAR *fn) -{ - struct p2d_struct *p2d; - p2d=(struct p2d_struct*)qq; - p2d->input_filename = _tcsdup(fn); - p2d->input_method = 0; - return (p2d->input_filename)?1:0; -} - -void PNGDIB_DECL pngdib_p2d_set_png_memblk(PNGDIB *qq, const void *mem, int memsize) -{ - struct p2d_struct *p2d; - p2d=(struct p2d_struct*)qq; - p2d->input_memblk = (unsigned char*)mem; - p2d->input_method = 1; - if(memsize>=0) - p2d->input_memblk_size = memsize; -} - -void PNGDIB_DECL pngdib_p2d_set_use_file_bg(PNGDIB *qq, int flag) -{ - struct p2d_struct *p2d; - p2d=(struct p2d_struct*)qq; - p2d->use_file_bg_flag = flag; -} - - -void PNGDIB_DECL pngdib_p2d_set_custom_bg(PNGDIB *qq, unsigned char r, - unsigned char g, unsigned char b) -{ - struct p2d_struct *p2d; - p2d=(struct p2d_struct*)qq; - p2d->bgcolor.red = r; - p2d->bgcolor.green = g; - p2d->bgcolor.blue = b; - p2d->use_custom_bg_flag = 1; -} - -void PNGDIB_DECL pngdib_p2d_set_gamma_correction(PNGDIB *qq, int flag, double screen_gamma) -{ - struct p2d_struct *p2d; - p2d=(struct p2d_struct*)qq; - p2d->screen_gamma = screen_gamma; - p2d->gamma_correction = flag; -} - - -int PNGDIB_DECL pngdib_p2d_get_dib(PNGDIB *qq, - BITMAPINFOHEADER **ppdib, int *pdibsize) -{ - struct p2d_struct *p2d; - p2d=(struct p2d_struct*)qq; - *ppdib = p2d->pdib; - if(pdibsize) *pdibsize = p2d->dibsize; - return 1; -} - -int PNGDIB_DECL pngdib_p2d_get_dibbits(PNGDIB *qq, void **ppbits, int *pbitsoffset, int *pbitssize) -{ - struct p2d_struct *p2d; - p2d=(struct p2d_struct*)qq; - *ppbits = p2d->pbits; - if(pbitsoffset) *pbitsoffset = p2d->bits_offs; - if(pbitssize) *pbitssize = p2d->bitssize; - return 1; -} - -int PNGDIB_DECL pngdib_p2d_get_palette(PNGDIB *qq, RGBQUAD **ppal, int *ppaloffset, int *ppalnumcolors) -{ - struct p2d_struct *p2d; - p2d=(struct p2d_struct*)qq; - if(ppal) *ppal = p2d->palette; - if(ppaloffset) *ppaloffset = p2d->palette_offs; - if(ppalnumcolors) *ppalnumcolors = p2d->palette_colors; - return 1; -} - -int PNGDIB_DECL pngdib_p2d_get_colortype(PNGDIB *qq) -{ - struct p2d_struct *p2d; - p2d=(struct p2d_struct*)qq; - return p2d->color_type; -} - -int PNGDIB_DECL pngdib_p2d_get_bitspersample(PNGDIB *qq) -{ - struct p2d_struct *p2d; - p2d=(struct p2d_struct*)qq; - return p2d->bits_per_sample; -} - -int PNGDIB_DECL pngdib_p2d_get_bitsperpixel(PNGDIB *qq) -{ - struct p2d_struct *p2d; - p2d=(struct p2d_struct*)qq; - return p2d->bits_per_pixel; -} - -int PNGDIB_DECL pngdib_p2d_get_samplesperpixel(PNGDIB *qq) -{ - struct p2d_struct *p2d; - p2d=(struct p2d_struct*)qq; - return p2d->bits_per_pixel/p2d->bits_per_sample; -} - -int PNGDIB_DECL pngdib_p2d_get_interlace(PNGDIB *qq) -{ - struct p2d_struct *p2d; - p2d=(struct p2d_struct*)qq; - return p2d->interlace; -} - -int PNGDIB_DECL pngdib_p2d_get_density(PNGDIB *qq, int *pres_x, int *pres_y, int *pres_units) -{ - struct p2d_struct *p2d; - p2d=(struct p2d_struct*)qq; - if(p2d->res_valid) { - *pres_x = p2d->res_x; - *pres_y = p2d->res_y; - *pres_units = p2d->res_units; - return 1; - } - *pres_x = 1; - *pres_y = 1; - *pres_units = 0; - return 0; -} - -int PNGDIB_DECL pngdib_p2d_get_file_gamma(PNGDIB *qq, double *pgamma) -{ - struct p2d_struct *p2d; - p2d=(struct p2d_struct*)qq; - if(p2d->gamma_returned) { - *pgamma = p2d->file_gamma; - return 1; - } - return 0; -} - -int PNGDIB_DECL pngdib_p2d_get_bgcolor(PNGDIB *qq, unsigned char *pr, unsigned char *pg, unsigned char *pb) -{ - struct p2d_struct *p2d; - p2d=(struct p2d_struct*)qq; - - if(p2d->bgcolor_returned) { - *pr = p2d->bgcolor.red; - *pg = p2d->bgcolor.green; - *pb = p2d->bgcolor.blue; - return 1; - } - return 0; -} - -void PNGDIB_DECL pngdib_set_dibalpha32(PNGDIB *qq, int flag) -{ - qq->dib_alpha32 = flag; -} - - -//////////////////////////////////// -//////////////////////////////////// - -#if PNGDIB_V2COMPATIBLE - -static void* PNGDIB_DECL globalalloc_callback(void *userdata, int memblksize) -{ - return (void*)GlobalAlloc(GPTR,memblksize); -} - -static void PNGDIB_DECL globalfree_callback(void *userdata, void *memblk) -{ - GlobalFree((HGLOBAL)memblk); -} - - -static void* PNGDIB_DECL heapalloc_callback(void *userdata, int memblksize) -{ - return HeapAlloc((HANDLE)userdata,HEAP_ZERO_MEMORY,memblksize); -} - -static void PNGDIB_DECL heapfree_callback(void *userdata, void *memblk) -{ - HeapFree((HANDLE)userdata,0,memblk); -} - - -int read_png_to_dib(PNGD_P2DINFO *p2dp) -{ - PNGDIB *qq; - int errcode; - char *msg; - HANDLE heap; - int use_heapalloc; - int imginfo; - - imginfo=0; - use_heapalloc=0; - - - qq=pngdib_p2d_init(); - if(!qq) return PNGD_E_NOMEM; - - - // fields through errmsg must exist - if(p2dp->structsize<48) return PNGD_E_VERSION; - - // try to be somewhat backward-compatible - if(p2dp->structsize>=88) { - imginfo=1; - } - - if(p2dp->structsize>=96) { - if(p2dp->flags & PNGD_USE_HEAPALLOC) { - use_heapalloc=1; - heap = p2dp->heap; - if(!heap) heap = GetProcessHeap(); - } - } - - if(use_heapalloc) { - pngdib_set_userdata(qq,(void*)heap); - pngdib_setcallback_malloc(qq,heapalloc_callback,heapfree_callback,NULL); - } - else { - pngdib_setcallback_malloc(qq,globalalloc_callback,globalfree_callback,NULL); - } - - pngdib_p2d_set_png_filename(qq,p2dp->pngfn); - - pngdib_p2d_set_gamma_correction(qq,(p2dp->flags&PNGD_GAMMA_CORRECTION)?1:0,PNGDIB_DEFAULT_SCREEN_GAMMA); - - if(p2dp->flags&PNGD_USE_BKGD) - pngdib_p2d_set_use_file_bg(qq,1); - - - if(p2dp->flags&PNGD_USE_CUSTOM_BG) { - pngdib_p2d_set_custom_bg(qq,p2dp->bgcolor.red, - p2dp->bgcolor.green,p2dp->bgcolor.blue); - } - - if(p2dp->flags&PNGD_DIB_ALPHA32) - pngdib_set_dibalpha32(qq,1); - - errcode=pngdib_p2d_run(qq); - - if(!errcode) { - - pngdib_p2d_get_dib(qq,&p2dp->lpdib, &p2dp->dibsize); - pngdib_p2d_get_dibbits(qq,&p2dp->lpbits, &p2dp->bits_offs, NULL); - pngdib_p2d_get_palette(qq,&p2dp->palette, &p2dp->palette_offs, &p2dp->palette_colors); - - if(imginfo) { - p2dp->color_type = pngdib_p2d_get_colortype(qq); - p2dp->bits_per_sample = pngdib_p2d_get_bitspersample(qq); - p2dp->interlace = pngdib_p2d_get_interlace(qq); - p2dp->bits_per_pixel = pngdib_p2d_get_bitsperpixel(qq); - if(pngdib_p2d_get_file_gamma(qq, &p2dp->file_gamma)) { - p2dp->flags |= PNGD_GAMMA_RETURNED; - } - if(pngdib_p2d_get_density(qq, &p2dp->res_x, &p2dp->res_y, &p2dp->res_units)) { - p2dp->flags |= PNGD_RES_RETURNED; - } - if(pngdib_p2d_get_bgcolor(qq, &p2dp->bgcolor.red, &p2dp->bgcolor.green, - &p2dp->bgcolor.blue)) - { - p2dp->flags |= PNGD_BG_RETURNED; - } - } - } - - if(p2dp->errmsg) { - msg=pngdib_get_error_msg(qq); - lstrcpyn(p2dp->errmsg,msg,100); - } - - pngdib_done(qq); - - return errcode; -} - -int write_dib_to_png(PNGD_D2PINFO *d2pp) -{ - PNGDIB *qq; - int errcode; - char *msg; - - if(d2pp->structsize != sizeof(PNGD_D2PINFO)) return PNGD_E_VERSION; - - qq=pngdib_d2p_init(); - if(!qq) return PNGD_E_NOMEM; - pngdib_d2p_set_dib(qq,d2pp->lpdib,d2pp->dibsize, - d2pp->lpbits,d2pp->bitssize); - if(d2pp->flags&PNGD_INTERLACED) - pngdib_d2p_set_interlace(qq,1); - - if(d2pp->flags&PNGD_NO_GAMMA_LABEL) - pngdib_d2p_set_gamma_label(qq,0,0.0); - else - pngdib_d2p_set_gamma_label(qq,1,PNGDIB_DEFAULT_FILE_GAMMA); - - pngdib_d2p_set_png_filename(qq,d2pp->pngfn); - - if(d2pp->software) - pngdib_d2p_set_software_id(qq, d2pp->software); - - if(d2pp->flags&PNGD_DIB_ALPHA32) - pngdib_set_dibalpha32(qq,1); - - errcode=pngdib_d2p_run(qq); - - if(d2pp->errmsg) { - msg=pngdib_get_error_msg(qq); - lstrcpyn(d2pp->errmsg,msg,100); - } - - pngdib_done(qq); - return errcode; -} - -#endif // PNGDIB_V2COMPATIBLE diff --git a/src/apps/mplayerc/pngdib.h b/src/apps/mplayerc/pngdib.h deleted file mode 100644 index 124864ee9..000000000 --- a/src/apps/mplayerc/pngdib.h +++ /dev/null @@ -1,291 +0,0 @@ -// pngdib.h - -#ifndef PNGDIB_H_INCLUDED -#define PNGDIB_H_INCLUDED - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef _UNICODE -// the V2 compatibility layer isn't UNICODE compatible -#define PNGDIB_V2COMPATIBLE 0 -#endif - -// If you don't need to be compatible with PNGDIB v1.x and v2.x, -// you can define this to 0 and save a few bytes. -#ifndef PNGDIB_V2COMPATIBLE -#define PNGDIB_V2COMPATIBLE 1 -#endif - -#define PNGDIB_HEADER_VERSION 30001 - - -#define PNGDIB_DEFAULT_SCREEN_GAMMA 2.20000 -#define PNGDIB_DEFAULT_FILE_GAMMA 0.45455 - - -#define PNGDIB_DECL __stdcall - -#define PNGDIB_EXT - - -// error codes returned by pngdib_*_run() - -#define PNGD_E_SUCCESS 0 -#define PNGD_E_ERROR 1 // unspecified error -#define PNGD_E_VERSION 2 // struct size problem -#define PNGD_E_NOMEM 3 // could not alloc memory -#define PNGD_E_UNSUPP 4 // unsupported image type -#define PNGD_E_LIBPNG 5 // libpng error (corrupt PNG?) -#define PNGD_E_BADBMP 6 // corrupt or unsupported DIB -#define PNGD_E_BADPNG 7 // corrupt or unsupported PNG -#define PNGD_E_READ 8 // couldn't read PNG file -#define PNGD_E_WRITE 9 // couldn't write PNG file - -#if (PNGDIB_V2COMPATIBLE) || defined(PNGDIB_INTERNALS) - -struct PNGD_COLOR_struct { - unsigned char red, green, blue, reserved; -}; - -#endif - - -#if PNGDIB_V2COMPATIBLE - -typedef struct PNGD_D2PINFO_struct { - DWORD structsize; // sizeof(PNGD_D2PINFO) - DWORD flags; -#define PNGD_INTERLACED 0x00000001 -#define PNGD_NO_GAMMA_LABEL 0x00000002 -#define PNGD_DIB_ALPHA32 0x00000010 - - char* pngfn; // PNG filename to write - - LPBITMAPINFOHEADER lpdib; - int dibsize; // can be 0 - - VOID* lpbits; // can be NULL - int bitssize; // can be 0 - - char* software; // (NULL==don't include) -// added in v2.0 - char* errmsg; // user can set to null or 100-char buffer -} PNGD_D2PINFO; - - -typedef struct PNGD_IMAGEINFO_struct { - DWORD structsize; // sizeof(PNGD_IMAGEINFO) - DWORD flags; - -} PNGD_IMAGEINFO; - -typedef struct PNGD_P2DINFO_struct { - DWORD structsize; // sizeof(PNGD_P2DINFO) - - DWORD flags; // combination of below: -#define PNGD_USE_BKGD 0x00000001 -#define PNGD_USE_CUSTOM_BG 0x00000002 -#define PNGD_GAMMA_CORRECTION 0x00000004 -#define PNGD_USE_HEAPALLOC 0x00000008 -//#define PNGD_DIB_ALPHA32 0x00000010 already defined above - -#define PNGD_BG_RETURNED 0x00010000 // return value only -#define PNGD_RES_RETURNED 0x00020000 // set if xres,yres,res_units are valid -#define PNGD_GAMMA_RETURNED 0x00040000 // set if file_gamma is valid - - char* pngfn; // PNG filename to read - - LPBITMAPINFOHEADER lpdib; // return value only - int dibsize; // return value only - int palette_offs; // return value only - int bits_offs; // return value only - RGBQUAD* palette; // return value only - int palette_colors; // return value only - VOID* lpbits; // return value only -// added in v2.0 (size=48) - struct PNGD_COLOR_struct bgcolor; // IN OUT - char* errmsg; // user can set to null or 100-char buffer -// added in v2.1 (size=88) - int color_type; - int bits_per_sample; - int bits_per_pixel; - int interlace; - int res_x,res_y; - int res_units; - int reserved1; - double file_gamma; -// added in v2.2 (size=96) - HANDLE heap; - int reserved2; - -} PNGD_P2DINFO; - -int read_png_to_dib(PNGD_P2DINFO *p2dinfo); -int write_dib_to_png(PNGD_D2PINFO *d2pinfo); - -#endif // PNGDIB_V2COMPATIBLE - - -// public definitions - -typedef void* (PNGDIB_DECL *pngdib_malloc_cb_type)(void *userdata, int memblksize); -typedef void (PNGDIB_DECL *pngdib_free_cb_type)(void *userdata, void *memblk); -typedef void* (PNGDIB_DECL *pngdib_realloc_cb_type)(void *userdata, void *memblk, int memblksize); - -struct pngdib_common_struct; -typedef struct pngdib_common_struct PNGDIB; - - -#define PNGD_ST_D2P 1 -#define PNGD_ST_P2D 2 - - -#ifdef PNGDIB_INTERNALS - -// definitions for internal library use only - -#define PNGDIB_ERRMSG_MAX 200 - - -struct pngdib_common_struct { - int structtype; - void *userdata; - TCHAR *errmsg; - pngdib_malloc_cb_type malloc_function; - pngdib_free_cb_type free_function; - pngdib_realloc_cb_type realloc_function; - int dib_alpha32; -}; - -struct d2p_struct { - struct pngdib_common_struct common; - - const BITMAPINFOHEADER* pdib; - int dibsize; - const void* pbits; - int bitssize; - int interlaced; - TCHAR* output_filename; - char* software_id_string; - int file_gamma_valid; - double file_gamma; -}; - -struct p2d_struct { - struct pngdib_common_struct common; - - int input_method; // 0=filename, 1=memory - TCHAR* input_filename; - unsigned char* input_memblk; - int input_memblk_size; - int input_memblk_curpos; - - int use_file_bg_flag; - int use_custom_bg_flag; - struct PNGD_COLOR_struct bgcolor; - int gamma_correction; // should we gamma correct (using screen_gamma)? - double screen_gamma; - - BITMAPINFOHEADER* pdib; - int dibsize; - int palette_offs; - int bits_offs; - int bitssize; - RGBQUAD* palette; - int palette_colors; - void* pbits; - int color_type; - int bits_per_sample; - int bits_per_pixel; - int interlace; - int res_x,res_y; - int res_units; - int res_valid; // are res_x, res_y, res_units valid? - double file_gamma; - int gamma_returned; // set if we know the file gamma - int bgcolor_returned; -}; - -#undef _PNGD_DEFINE_COMMON_FIELDS - - -#endif // PNGDIB_INTERNALS - -///////////// d2p functions - -#define pngdib_d2p_init() _pngdib_init(PNGD_ST_D2P,PNGDIB_HEADER_VERSION) - -PNGDIB_EXT int PNGDIB_DECL pngdib_d2p_set_dib(PNGDIB *d2p, - const BITMAPINFOHEADER* pdib, int dibsize, - const void* pbits, int bitssize); - -PNGDIB_EXT void PNGDIB_DECL pngdib_d2p_set_interlace(PNGDIB *d2p, int interlaced); -PNGDIB_EXT int PNGDIB_DECL pngdib_d2p_set_png_filename(PNGDIB *d2p, const TCHAR *fn); -PNGDIB_EXT int PNGDIB_DECL pngdib_d2p_set_software_id(PNGDIB *d2p, const TCHAR *s); -PNGDIB_EXT void PNGDIB_DECL pngdib_d2p_set_gamma_label(PNGDIB *d2p, int flag, double file_gamma); - -PNGDIB_EXT int PNGDIB_DECL pngdib_d2p_run(PNGDIB *d2p); - -//////////// - -//////////// p2d functions - -#define pngdib_p2d_init() _pngdib_init(PNGD_ST_P2D,PNGDIB_HEADER_VERSION) - -PNGDIB_EXT int PNGDIB_DECL pngdib_p2d_set_png_filename(PNGDIB *p2d, const TCHAR *fn); -PNGDIB_EXT void PNGDIB_DECL pngdib_p2d_set_png_memblk(PNGDIB *p2d, const void *mem, int memsize); - -PNGDIB_EXT void PNGDIB_DECL pngdib_p2d_set_use_file_bg(PNGDIB *p2d, int flag); -PNGDIB_EXT void PNGDIB_DECL pngdib_p2d_set_custom_bg(PNGDIB *p2d, unsigned char r, - unsigned char g, unsigned char b); -PNGDIB_EXT void PNGDIB_DECL pngdib_p2d_set_gamma_correction(PNGDIB *p2d, int flag, double screen_gamma); - -PNGDIB_EXT int PNGDIB_DECL pngdib_p2d_run(PNGDIB *p2d); - -PNGDIB_EXT int PNGDIB_DECL pngdib_p2d_get_dib(PNGDIB *p2d, BITMAPINFOHEADER **ppdib, int *pdibsize); -PNGDIB_EXT int PNGDIB_DECL pngdib_p2d_get_dibbits(PNGDIB *p2d, void **ppbits, int *pbitsoffset, int *pbitssize); -PNGDIB_EXT int PNGDIB_DECL pngdib_p2d_get_palette(PNGDIB *p2d, RGBQUAD **ppal, int *ppaloffset, int *ppalnumcolors); - -PNGDIB_EXT int PNGDIB_DECL pngdib_p2d_get_colortype(PNGDIB *p2d); -PNGDIB_EXT int PNGDIB_DECL pngdib_p2d_get_bitspersample(PNGDIB *p2d); -PNGDIB_EXT int PNGDIB_DECL pngdib_p2d_get_bitsperpixel(PNGDIB *p2d); -PNGDIB_EXT int PNGDIB_DECL pngdib_p2d_get_samplesperpixel(PNGDIB *p2d); -PNGDIB_EXT int PNGDIB_DECL pngdib_p2d_get_interlace(PNGDIB *p2d); -PNGDIB_EXT int PNGDIB_DECL pngdib_p2d_get_density(PNGDIB *p2d, int *pres_x, int *pres_y, int *pres_units); -PNGDIB_EXT int PNGDIB_DECL pngdib_p2d_get_file_gamma(PNGDIB *p2d, double *pgamma); -PNGDIB_EXT int PNGDIB_DECL pngdib_p2d_get_bgcolor(PNGDIB *p2d, unsigned char *pr, unsigned char *pg, unsigned char *pb); - -PNGDIB_EXT void PNGDIB_DECL pngdib_p2d_free_dib(PNGDIB *p2d, BITMAPINFOHEADER *pdib); - -//////////// common functions - -PNGDIB_EXT PNGDIB* PNGDIB_DECL _pngdib_init(int structtype, int caller_header_vers); - -PNGDIB_EXT int PNGDIB_DECL pngdib_done(PNGDIB *xx); - -PNGDIB_EXT void PNGDIB_DECL pngdib_setcallback_malloc(PNGDIB *xx, - pngdib_malloc_cb_type mallocfunc, - pngdib_free_cb_type freefunc, - pngdib_realloc_cb_type reallocfunc); - -PNGDIB_EXT void PNGDIB_DECL pngdib_set_userdata(PNGDIB *xx, void *userdata); -PNGDIB_EXT void* PNGDIB_DECL pngdib_get_userdata(PNGDIB *xx); -PNGDIB_EXT TCHAR* PNGDIB_DECL pngdib_get_error_msg(PNGDIB *xx); - -PNGDIB_EXT TCHAR* PNGDIB_DECL pngdib_get_version_string(void); -PNGDIB_EXT int PNGDIB_DECL pngdib_get_version(void); - -PNGDIB_EXT void PNGDIB_DECL pngdib_set_dibalpha32(PNGDIB *xx, int flag); - -//////////// - - -#ifdef __cplusplus -} -#endif - -#endif // PNGDIB_H_INCLUDED diff --git a/src/apps/mplayerc/res/Icon_114.ico b/src/apps/mplayerc/res/Icon_114.ico deleted file mode 100644 index 31c5175ad9a081608939c1a192bd376f12bbc07c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 23558 zcmeI42Y6LQ+Q%mb4P+sRt}B*Zu&re+Sg8VnT@kUNh=?FAASDWTA+B&0m53;)hy^k9 zrhpn(U4jxRalIlzdN6?`B2A&SMCK)rTih(~Gu4+uvW5w@< zyB=xGhLe2$x@PJb#@uv@&rcY>AFuZL>zc0Q^=4aR&Z11RG|eI5IH(K55e^&Y@s~%F znVE^NH`e_(*6Io3pI-5&mUFy}^Pb$_)FF>%jEzR|A~h5WWlZnyzo<>{(TwQ>w?&f- zCmfnRW!tu7m$>%cy~GpV7;+4?hYwQxz-=KfoZ26TM`sV*7z()rLxzaqL!w={cK`k` zq^1(>64V|7Lw{q2_+jGvhilcU>W7IR5)A8oiSR&$#Rnjv-$;JL_mPhm9vGUQnmTBZ z7hh}0z>O(0GeV)g`}#Y4&u7C@X9&2y{>S%o*OaMVUr!CCjP<^M z%3JT$szonO$)HOQ*&9mvWMf?I(4f%IpM;X>F8iu(bpF^K^w8R&ludL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k3)nXiRe4$y%6`a VpbM;56|vssILf(ru2pCAKLC)zASnO< diff --git a/src/apps/mplayerc/res/ani.avi b/src/apps/mplayerc/res/ani.avi deleted file mode 100644 index df6050bde5204ff8524a66cb39698871d23b4eb2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 14848 zcmeHOd3aUTwO{+(bB9bf3E`nHRQj zA``| z(7jI$r^g<9jQZpar2PDR8kzSD6%-Uue85O*ntKf`np{Bc(mvFrtIO!RX-nzGX`j-N*$XL}SWE3*`;ua> zucp)9+(6kyo2cEpTj?R43q z9dzx-JLsl`JL!hyJL&30mGtX{KhSl{l62z=lWzFrN4ja*e){A1ZIm~;oI1b1hHiUr z7xnsZ7j;>(l{zonPPeYyO^(Gcu1U`q@22i0Cf)JH0ea{QlkQtxP4|~nQ}1n6)NNIY z?)~~O^(r|`zyI2y-fNFj-!CgE@2e#B+hEdDYmzj0y-6cCRMMmC8|jH}UF!G!5gN4P z2=)E0js|UMqCwm0Y4G=rG<+jIw>4404ws(Uo1zg(m&S}4LkngYR5))Ty|m;Lnz3Rr z&73`#=FOW&#j__-+1v^A)q4i5S^5@jU;H}#_{qz(b6F9s{Bk}u6_2B)lIgT%<5EhN z%%el=Kcr*d&ZK>t=27Fux5+J=P41Qt$ldt?rAil2^=ABRTt4gI>jjKX=zf03mH`Q`!8tPwXT1^v8KGH-}@Kadh zlHs@%uXpLS2AAHfYoKW^=&noe?6c^7v|o}uOe-o6)7y2&sHnD)<{frv7I^10y0j?e z(gJ)gYjWw!jo;Cc@-=iYSpqD+1P;aI?p=pZlvAsy(fW?u{hO(&YCCY*Nu^as=-Wee zv>I*K<7ewpmv$YlqsEDjWyI% ze}qzK+jQIkZynWP+)Ygl953?EKpa2}yY|}4hYWh^a(rule_r2yPqsh*N}{`d*X?eH z1J9{Hrw}-Wz$pYyA#e(TQwW?w;1mL<5cq$90H4h-!C`vPlSA{axT5c)eCBpzxv~G` zcY2IMmuez2GjnH*f|0aHBtk!hgt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!_ z5tRWG8QoleQmzYEkhYiCmPkuB3+@ADi@j{KEtx7hXR0WE_Qh6NC;?=lc#?1@-zwik zaU%x>876vtNamO@t&-oJkXI5^YiDi!i%i`o_iL~yFP{Xz8Y>uj5-z zzZ^M@h;R7(a!;%jd{5<fLh`sF2O6Y&|uFZcQ>5$|{X W^3&&H{H@AcIuOaI#9;lO`t#q(T^7Fp diff --git a/src/apps/mplayerc/res/authhdrpic.bmp b/src/apps/mplayerc/res/authhdrpic.bmp deleted file mode 100644 index 69deb8350072e7c17d278bca5d9afde08da226ba..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 57654 zcmeI5v5OqnvWI>D3#ZPW!c8tLyx_6$g16wn0tYrIFv5Wl4vcVM#7)HFKnMj!C=fz{ zU=;{ffnXH~R*7I02zCR36d2ZA98BO~0tFk~px;-g`czk+KHbyP-7~wg*VOHMrl+T; zk@U^)S9PjSZ+-dCe}5MK`zPD~;(!11kIz2)Z~p%upM4(oe^$P)FLYZB`|m$RF-4rl z|K=YHjoG}gIGGhbj{Yb#4u3B+4t^^v_TCl5?r|0O-V_!)uL_HsuZkNls<{5VAg(?u z5p(r18zhX(Q%eZ?whit4nEod1=;&lmEMv#{XVA866YA+YM~TyGyZbz%~aR{6cY- zUv~E87ow-*7pTYc3)F-81?OJ;g7XEx707MyvOk3voEz}6CxsWBN5jh*GW_<$Dh2bf zIPM>HneO?GO>%8d2f~Z_h2^Nf3{w4d`~q^9{-VW;^f%!bmNWXx&QASZ1;0RD)8BS} z(c*RLFLK;Re-Ywt{q^s1P7HvYdAs<23tc`%ni&UIaQfpmFB1tK$gi-xG5=uKcs( z7m&05c}@J{rCa=SoBnq2ix7MNycEAU>XH6=a(*G59|VOr@+%ZGR<3{87DrvT&|~?% zwmtu0dvBZd3C`%Rli);u z2k@I9+@Zgya5n$V>MxGE%753!FIpV)Uk1(m_x$h+vr4YQ+r{tJQv7BtwE5>UHQo^M z1>S_;Hu3$culUydb02m}c!xo{@KgO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8-AU0UeI>s#JA^d3;CJf$Zt}x@-LhG){0lGq7&-RE7#w8UC5(hV=EWiAfvwy zHxA>oASr|f=UkcRc1y3>vH9wf<;zw7q?%+wIAp}t<<${pl2^;lTDhvW@%alNY%{;g zFIytcC21kro9BA{3Vt`^D$rxibB13)Fjy8222$*>?WwtXB@@EiCcbMn&v|~&ck!wu z1?3$izD8D!V#hB&)*P>~%$FuAtjg=R&FkUgJ``bQei`VQp*WFXUefTa*=_}I@XxYS zBpA&tZ)8vlt^7s{?fA{k9|eBL^<3%9k#6(pLNaMSLa^IJ2Jvz>Nzq^UT1m zt-PdoJtnWofRk`GZQc-yJ--fixo05=afPtcU-%6cS~M5`Z2YojyUrg`f{xBv2hKm6 z_-=R%2aogoE~UaAy$)LSEq`#&aR<4)m9fo>%2va~cM^UPTpv?)ZhS(?FBIqbh0sug zf?u_`a%9wECC)(REv&M^Tm7mm;#UMW6t&6|hM$F!;*#G};MEX>jp7==<(zLDzfyUw z#217kzfpXrs9bgFuOZVDvDF=BSCSp99A20FqP9tloH@#y=T9j4oz_3Q0y4^Ip yRR(oyHy^bPzS}HvA@}Adkz017tV+dsUjI@xx3-PX{N=s|i`uf26D>Xo!v7DC*jnxY diff --git a/src/apps/mplayerc/res/icon.ico b/src/apps/mplayerc/res/icon.ico deleted file mode 100644 index 1c25677436fe170c446a6d3f49a22ffe72910b53..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 142454 zcmeF42Y?kt*0!4*L_k3VK>-yN0~is8VaQ0%NKlfXfT9vqKyn_GU?zj8Am}Q}iXbLT zsH>uwMNtgvnpb!CTiI{F-umCCrq9sRa|ak1H~qA}RQH{})!pa3b7Ti_NfaGA5mjL{{7pxn=+$L`sa zxo1J<0yjGdN|c+^;JgL1#*7*3GBbbH@z|d;Z=F1Q`?j%rW{>?@wN7?!+~mw5nUfcc z8vCP;$GX`K7VMdjxo6MyWB;W3C%Xpc?{V|Tx&@a^=6aLen1#;GdTGI)v`mf{?Add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3afN!F6v<@0%O skPUXA+EriU79XUS9R1BHUk)n~8yO TMsm(|AdA7%)z4*}Q$iB}xl1-{ diff --git a/src/apps/mplayerc/res/logo.1.png b/src/apps/mplayerc/res/logo.1.png deleted file mode 100644 index 46c5197125adb76da5ed14d2c31923500a7c8e48..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6110 zcmV<47a{10P)Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBU}TuDShRCr$Poq2Fo*L}zJU&onFq3%qL(@9_^ll;*!HZ!$rQw(vN zIGHq_*e!-M#s-B1Y*3|$rDm}}1lxd-5FijBR!QuLMM&5zl8}HPApt@l79oShA~u6% z%-*IM`g!`PcW&-_^fpOP=gyrs;=XgwIrscN_xt;u-?{e@7pFHp0(u1W2eBcMk> zkANP57#@Mgjd735^d9^O#4sDGm!=sC{uXMv{qz>6848}E7X8+nW+-?sCh+M^Go%>` z`7Y4DO#8A>A<_(KhBQN=IwOCE8V5aQcgcW+YJeCx-%*E7mc{8^Mj(KWFyxX*ivb2g zy#x=29+z?Rb@{y&Agx30qkx(%(%E{?V2IYP^h$NhBQN(Asr7nMl8{CWOz)iLt2Nl z4rv`y*CGEoRxl;B4s|6R3WgB>b2LMmA%9AAo;nn7*J*Q%jxlwpv^bxybx7+_sAOq| zG((!9P&}3Yx!RZc6Q*@Y>ySSsI;Qql8}|}ghx`fCI;3^TpOPr((2eFB`G3eyT$(sw z@__2I)nb*?%a&EAr10r00}V~L2Yj%v_}Eq7k`L}QG&iPSJv!iCb89Q+Q?^xH8nN*3 z_?5NhgY<#@tA+;e%IS9c*7RR|^b4-STvF?hKVc#2P;pH$;~w{Vob26x)$PEE1GjJA zzI*rX`kpErs{iUj6%oU4Qw@ZR|gpTFzHgb^reTi+lFa2lnQsCc4BCOCO*= zWlc)Y-}W>vVMzLrufP798YoQ7;b*As+i{(1_k}2EhM))4k)eNW`fHg5nH9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4u%jt?G!!lcdHU@_{uEI_$eeZ08P$@m z5fVv!#{KYcX3)7pSL`P2S}!5n@lYuKgonaO25VW+F9>$X6jhq2ip6D|AW&2a!Sf+V2!U!?(f-MDDqQD zyS!Z|rc7|t+B7Z0f*ig>L6Bhebr3vm1eL(F5S}0sPa{m*Flh^Nq7VP+87BNwzDvKO z&-k{-x^X#LbmT^z!|~0?t<^Eo={n`G0C^4z^Y$VO9ib6kax+3}djvPj0Gs2u5uQmx zxXZH7=Q8J;yYCV!!csksmu|l-p9M`&s90Ea+}N=6_gU84-w)U_vKig@ifKseec2VPqzLkNfqg1Q|(n}~qXG5Cd;5zF8D{a`= zeM7dKW-q=QR1ivobPI^4y>9eDzUZX!!Jz3He(;yInlGJrzv5BjAdQX|1{^3$s)?pM zh90)r#`=QL5gIOnrN6u)X@{K4rI{#=a|5>JSIpw&9?iO)ekZKr{fGOc_a`6WQWcLH znWiMcH$E2#y{t+hUMn(peW)mBU@%ZA@gsRb8B)rlj8qy2>(V zoGcYU2@6Rg&qdSL9QGJoi@~H#WxO^%V>U_>tsTgBL#~E$`VvDcgxWx2-433#(<;M& z$PH#R;t$cd5gjQl+XUDNz@tQ4*w7rv_e7r5al5?PgYyrkU|q5;lZ|lJ&S18jO}SX6 zcuV0UDBquYu8JvBHTIbuzvYZsw{SacTB?+$N@SRYPn{mzxoeK*jvhFA;1zn{e=f>$ Uy;AEF_5c6?07*qoM6N<$f`0~v6aWAK diff --git a/src/apps/mplayerc/res/logo.4.png b/src/apps/mplayerc/res/logo.4.png deleted file mode 100644 index 53c2c66cdc43f21d41dbd7c446b212c77e7c91ba..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17380 zcmX_GWmFu^65YjJg1fr}TihLjyL*rYf(CaFuEAjm?iSqL-CctxxZC6V^XAM<&&-+A zU0q#uySr}vP*IXWMIuB3005|RvXW{a<>beei~#j<*RT%!uK>EJ$%q50CW((fUSO=m z6vY65+BoDFQ`nDpa&uWVMF7By761q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XMRNTGlVP*X+%@04TVfW9ZP9d$}F#%B_6dVL2~bvg^NTf zT{5=Oek4a9zfFe}sx&L<9xb_^2A^kPr}Sthr1=%$zRE_*t1FwZeX@$R95#D9P(-wT z@h+`DyM6cOp-?kLo*EO#x5v5FJA&ax;0;5Dwv9i_di8W-j>aNoC`H}Pb*|bwhY7c? zQQN_}_z7}al+e-#oqq9I7hild4_cDA(KwK}?=T>Y3v;HZUYUt_S7!Avy8Z2e>WN3% rMwB2Ym{}JL``J4=Rp9qcneWOHRN!-^YaMa_z6-Wz9Bmp;d#C&#yYpCa diff --git a/src/apps/mplayerc/res/logo.6.png b/src/apps/mplayerc/res/logo.6.png deleted file mode 100644 index fdab9483ec60746f24b1719ee545931419e1d1cf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 36995 zcmV*qKt;caP)Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBWY0ZBwbRCr$Py$8IV<$2{RpfZVC)KvU4gMHFm?sTuE4Xp0^>)qp4AJF zebd+#_@%Evz`4!SYr=#HJmk-2O`JHIR23BoG!gy@vArVd@xrcJB=UcZsYzFJ;C zXbz6Yp!|$K#b2p!2xJ?)Rwfm5q7XRNHNC7EgI9eTkMjyawm%|huEZ>qf2BT@v0rxB z6=+yC{92i{f;Hf4@Hw+A{;B?T)~s2xXV2!(tmesisVVwY=^AfU$Ts9E zSSwON9)Asp2NAFc2CoYiEI97CNm=`VE4W6eeV~)_{AfSJaXeZ{~%$Wm%d4477ieqmQexe{Y)KlS%g?BG~1RI2DT@8Y4BL)JO-e4@GTZOD}7q}pD z-n@BNU3Jytk3ar~H@sno9d-c9S&J4eI{*ChA9&z_n{K*^f8v=e;mtQTXl`&E5QAfH z!ZDBHrH0^`2EC{ie2p-uJ9UNZXo53QD{$daPzW5+4ENuE|A#;P;gu^_g4enZIph#n z`CadN*Ro~H#55|xRdKAYkdm_%3}WIjLHtq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ygvt_Hgr2yrSL*Rw)xq$hTTlEdM*fVbg&2> zM8j%{FtOG|Dkb8w)d){s)T{_G*J%kA<$0Xv=i5WB-GLy(o6l+=L@l^6kZnp7#_0A% zgx%3|u$3rr(+1ISoV5nWgFqb5SihpK3P(A+`k5eq;%JE))pc=f$%IgD09`dkMP&D}Rr8tpk(ctt)7e|+ zfHaNiO+9WDLY1~gv}35FB151!9`cGs{U00000NkvXXu0mjfufWQC diff --git a/src/apps/mplayerc/res/logo.7.png b/src/apps/mplayerc/res/logo.7.png deleted file mode 100644 index 9ee6a389b5d096785cbae7bf633540e4401b3a82..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 61474 zcmV){Kz+Z7P)00001b5ch_0Itp) z=>Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBXiph-kQRCr$OeFc1!SHAY$7L9uXad&rjcXxMp4{;#`l0YB?g1fuB zySuwP1mc2#QxjJ)r2p7Z?m{MUbdJHDNPZ)f1!8TfVv zzMX+@XW)Ny2LAGwzx{@WjaI|KhZXJF*Wkt!-G?(XhFLPGyK-|E{p`E~~Wf6l=7 z-+wP4AP^lLeemGH5%1|Kf?d=;kZoGBt*36kRA+o>w?z{i1ulntCzny`l^H$mOA-A;9;iXa=AmOJ2Tw`R2_VND4BTi$jAup5xghf0TAcn;`+b*h2K8=Kj#d9K>eZ{YwYBy1^dQ9H zz&?5MWLa66q@?73&WZi@OaBkf0D>d%CBvjc#02s;Gc(i5$_iow)*;aB=H}+;=%}x+ zzkU052#?>89KTc`kljm`EOByjvbD9v-0=1FZEkLcKV;6FIp5rT{|8t4Kjb6FjT;A{ zyl>yWy?ghgo!n zH#IfIEgaYgq(g^zdU}o-Gv+_!Jb(L{fA|@ITLX>=q#uEp4;(nq+S=;v?G2FtK%1DD z0Lnlii(K&tI9py`e%rQf{}4~Z0n*jg1wE~f2g~&V zgAz&xe-2n;{6rr=a4X%?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cEnu=5X*4#vdLg5D>7|$c>%aaE={dAx?b@{q>AxA@{6l?_GsivV z3?Q(E0{NMzo(7r+R37DWC4ve%lh5G@p#_S*7_1R73y`#M94kL0>|m%t!Yji=he9#L z*$gHh89EG_!vw0!F2C##e;^YYr~*P16s5tLWb+K_e$+F7LJayB5eS2Y_rN{(>^gfV z`eXzCAO?yf2U1_pY^Z0kIan{E!CXn^u+;|4C#VWJD-dSX*Q3bD^>_jh?m&7D2@UvW z@S7nD3e|y`UcevqyPSEm>1hy<@u7Hxb}g{*KKt|&Fi0U$uxY~v%=Jmc6GnqsCROmb zjdVH-Vv}`sV1m$*gjT9Fn9zb&0g(L>G*<=8pIWeB0h$12Xw5SK`zg=B6hjCUdl2Oi zFg*SA(}xcqMx_wUIH+Wx+X|BJOl9ApebuLn&IJLFfkr`^ikyCD2mcC|L`D4(&+sLUla{g zGv{;W4E&>?0eDzH1j;1S`MBd|3fePJnK=V9XJFE{%o+HR&%pl&_x5afO514<00000NkvXXu0mjfFHMQd diff --git a/src/apps/mplayerc/res/mono.bmp b/src/apps/mplayerc/res/mono.bmp deleted file mode 100644 index 7c9eeb0122c2f975da28f2d000b06dd30bbf8b30..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1582 zcmc(eAx~UU5QPuPrn?~+L|0*oDyC+VCfN0xV9>bv3z&*k=q61_u0ymfeGl{Qev(?1Nt>*K&=0E0o`2Jag!9b(YNLyQ5+TPyQcs$n5&W?6>ceS^-r^CZT zO{Y^$CKK)N?`!rhb#RdSpiAX_=-cH_UEbd6{g9)mX!sk2jE79AvS% Xe5Ow3Q@&t6qd&+0^nTa2`7hF6`g4`2 diff --git a/src/apps/mplayerc/res/mpc.png b/src/apps/mplayerc/res/mpc.png deleted file mode 100644 index 61230b249f3947305eacb6214b77d1bf825ef142..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9145 zcmb_ic{r5c+ka-pFc|wbvJJ9}v70Q7t+ERt>)0jAR)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;P$R=cL`1l`xkDaN`P_im zIfM+puC4}e8t6PP;3kXR)4aV#^#blIpc{BZ4<{vsBZS`@>!K+uUQ&M70o z1b%WY!`K-{i+;pj?0@HA$A3x*`djp3Y-~6T6L1ge31ef!2tvygW(EmP84V{_3;LU9 zaL^q+I;uqGn$BDP{*dRGnHdmia7Pw*P>G5Y{ge@txjmo zaB9fCvJ8^^XFJq<&=AanuV23kRtPy@2#6`{Hnlla%N%A;Ka|6s#hzj)iVuh}g-m8X zdul;Ev4t)Yk&4{Wm#-1l_YxZghhfZ9d4BmR=XZ?>rYFsOG@r6Oxm?hny`lvnxWkHV zpyy8qT!FI3u=8XIFQqt}-gPMto%Hs*-!q-|-c^FXWa{MlL&ATM^r!y;(!Ksgq{UDD f3(x+ahVg*y0cU}pi{4G}?hT-?XQErFjgR^-)VeX% diff --git a/src/apps/mplayerc/res/mplayerc.manifest b/src/apps/mplayerc/res/mplayerc.manifest deleted file mode 100644 index 97710ee01..000000000 --- a/src/apps/mplayerc/res/mplayerc.manifest +++ /dev/null @@ -1,41 +0,0 @@ - - - - MediaPlayerClassic - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/apps/mplayerc/res/multi.ico b/src/apps/mplayerc/res/multi.ico deleted file mode 100644 index 96584e103abad9c6a5907a9134ec26c7a94e7906..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 766 zcmb7CF%H5o47>tTRwm|-`~n6Be$bsF3L^tjvW2tTv=)k>Tyjp%c63n`py6oS zBLt5faN>FPZ!D_180MUemA=bQy;^C%v8rlgrS&Ip`9iQ(r5@fK_WWpdz5!AAw;%uj diff --git a/src/apps/mplayerc/res/noaudio.bmp b/src/apps/mplayerc/res/noaudio.bmp deleted file mode 100644 index f3ea250ec2f9f99761f9c4a66b688a3c077e9fdb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1666 zcmd6mAy1q^5QblxOLGEqqKF1lRMC?(!Jh6V7&LDF0;b|pfhK7}vJTNUsi@%>oT@0J z!4!ocAx#R7q+nAk~ z-AYaT7UmK^&F8~F&!ZNLg%;lyy8il6qtQs?@mQ;?tC~zET3cJw`ue&yHa4`mxv8C< z9nEGlO{Y_BZEb1(CbhktdZ$z6_t2NqA3D9f)WN6E7#YoJjTS>_XohBJ*0mg#IJ%=d zx}!UK-`3C@dLwA)4V^)O9_WD{2!Wo&Nt{v6MsN5ViHuFARN2!R3Ea2R^&91e%UVFE!?a=0U}|_bCL2i_-VN`%j`Bvwzv18T?^o3DZ`7v2&|qlPpMfF*zk4C@tuCD<4&3WR`#AB{ZRNx%}l9>vn% zhJFiZFeD5KL&A_SBnHth2K-ou8lU;^IPAS68~ZxzX+I zt*(Ej-X9(DKb}+F{vYTA`6}vpd)TA@@H0RT%u9F!@^FsjsXE+4yXvrg^#l9vdo7pa f&)kwxg^$iLxt!}R#{&@eCjY+gv7C1a{^8RvZ%CjS diff --git a/src/apps/mplayerc/res/onoff.bmp b/src/apps/mplayerc/res/onoff.bmp deleted file mode 100644 index b40c5c9f9b3afbbc40b4f8570052c7ed27b76a65..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 358 zcmZXPu?+(u3`PG*DI+;Uq_{cKXN`;yN*Ili=&p30AHuZSpJG!GQ z+H}FC)_vHG6dF+^wn`ZZ=crmMISSsl+~b5;fx;qeb)(=mJ1t*Erjqd=YdmCjq?tw0 pETug4F@G=`&%5R_v+OCK%)P^`p&(-Ju`$v@4kUm|3h6Mls diff --git a/src/apps/mplayerc/res/shaders/EdgeSharpen.psh b/src/apps/mplayerc/res/shaders/EdgeSharpen.psh deleted file mode 100644 index 5013be96d..000000000 --- a/src/apps/mplayerc/res/shaders/EdgeSharpen.psh +++ /dev/null @@ -1,51 +0,0 @@ -sampler s0 : register(s0); -float4 p0 : register(c0); -float4 p1 : register(c1); - -#define width (p0[0]) -#define height (p0[1]) -#define counter (p0[2]) -#define clock (p0[3]) -#define one_over_width (p1[0]) -#define one_over_height (p1[1]) - -#define PI acos(-1) - -#define NbPixel 1 - -#define Edge_threshold 0.2 - -#define Sharpen_val0 2.0 -#define Sharpen_val1 0.125 - -float4 main(float2 tex : TEXCOORD0) : COLOR -{ - float dx = NbPixel/width; - float dy = NbPixel/height; - float4 Res = 0; - - float4 c0 = tex2D(s0, tex); - float4 c1 = tex2D(s0, tex + float2(-dx,-dy)); - float4 c2 = tex2D(s0, tex + float2(0,-dy)); - float4 c3 = tex2D(s0, tex + float2(dx,-dy)); - float4 c4 = tex2D(s0, tex + float2(-dx,0)); - float4 c5 = tex2D(s0, tex + float2(dx,0)); - float4 c6 = tex2D(s0, tex + float2(-dx,dy)); - float4 c7 = tex2D(s0, tex + float2(0,dy)); - float4 c8 = tex2D(s0, tex + float2(dx,dy)); - - float4 delta1 = (c6+c4+c1-c3-c5-c8); - float4 delta2 = (c4+c1+c2-c5-c8-c7); - float4 delta3 = (c1+c2+c3-c8-c7-c6); - float4 delta4 = (c2+c3+c5-c7-c6-c4); - - float value = length(abs(delta1) + abs(delta2) + abs(delta3) + abs(delta4))/6; - - if(value > Edge_threshold ) - { - Res = c0 * Sharpen_val0 - (c1 + c2 + c3 + c4 + c5 + c6 + c7 + c8 ) * Sharpen_val1 ; - return Res; - } - else - return c0; -} \ No newline at end of file diff --git a/src/apps/mplayerc/res/shaders/SharpenComplex.psh b/src/apps/mplayerc/res/shaders/SharpenComplex.psh deleted file mode 100644 index 2df118d4f..000000000 --- a/src/apps/mplayerc/res/shaders/SharpenComplex.psh +++ /dev/null @@ -1,52 +0,0 @@ -sampler s0 : register(s0); -float4 p0 : register(c0); -float4 p1 : register(c1); - -#define width (p0[0]) -#define height (p0[1]) - -#define dx (p1[0]) -#define dy (p1[1]) - -float4 main( float2 tex : TEXCOORD0 ) : COLOR -{ - float4 ori; - float4 flou; - float4 cori; - float4 final; - - ori = tex2D(s0, tex); - float4 c1 = tex2D(s0, tex + float2(-dx,-dy)); - float4 c2 = tex2D(s0, tex + float2(0,-dy)); - float4 c3 = tex2D(s0, tex + float2(dx,-dy)); - float4 c4 = tex2D(s0, tex + float2(-dx,0)); - float4 c5 = tex2D(s0, tex + float2(dx,0)); - float4 c6 = tex2D(s0, tex + float2(-dx,dy)); - float4 c7 = tex2D(s0, tex + float2(0,dy)); - float4 c8 = tex2D(s0, tex + float2(dx,dy)); - - flou = (c1+c3+c6+c8 + 2*(c2+c4+c5+c7)+ 4*ori)*0.0625; - - cori = 2*ori - flou; - - float delta1; - float delta2; - float value; - - delta1 = (c3 + 2*c5 + c8)-(c1 + 2*c4 + c6); - delta2 = (c6 + 2*c7 + c8)-(c1 + 2*c2 + c3); - - value = sqrt( mul(delta1,delta1) + mul(delta2,delta2) ) ; - - if( value >.3 ) - { -#define Sharpen_val0 2.0 -#define Sharpen_val1 0.125 - final = ori*2 - (c1 + c2 + c3 + c4 + c5 + c6 + c7 + c8 ) * 0.125 ; - return final; - } - else - { - return cori; - } -} \ No newline at end of file diff --git a/src/apps/mplayerc/res/shaders/contour.psh b/src/apps/mplayerc/res/shaders/contour.psh deleted file mode 100644 index 7b0480d50..000000000 --- a/src/apps/mplayerc/res/shaders/contour.psh +++ /dev/null @@ -1,30 +0,0 @@ -sampler s0 : register(s0); -float4 p0 : register(c0); -float4 p1 : register(c1); - -#define width (p0[0]) -#define height (p0[1]) -#define counter (p0[2]) -#define clock (p0[3]) -#define one_over_width (p1[0]) -#define one_over_height (p1[1]) - -#define PI acos(-1) - -float4 main(float2 tex : TEXCOORD0) : COLOR -{ - float dx = 4/width; - float dy = 4/height; - - float4 c2 = tex2D(s0, tex + float2(0,-dy)); - float4 c4 = tex2D(s0, tex + float2(-dx,0)); - float4 c5 = tex2D(s0, tex + float2(0,0)); - float4 c6 = tex2D(s0, tex + float2(dx,0)); - float4 c8 = tex2D(s0, tex + float2(0,dy)); - - float4 c0 = (-c2-c4+c5*4-c6-c8); - if(length(c0) < 1.0) c0 = float4(0,0,0,0); - else c0 = float4(1,1,1,0); - - return c0; -} diff --git a/src/apps/mplayerc/res/shaders/deinterlace (blend).psh b/src/apps/mplayerc/res/shaders/deinterlace (blend).psh deleted file mode 100644 index 2dc2606e5..000000000 --- a/src/apps/mplayerc/res/shaders/deinterlace (blend).psh +++ /dev/null @@ -1,24 +0,0 @@ -sampler s0 : register(s0); -float4 p0 : register(c0); -float4 p1 : register(c1); - -#define width (p0[0]) -#define height (p0[1]) -#define counter (p0[2]) -#define clock (p0[3]) -#define one_over_width (p1[0]) -#define one_over_height (p1[1]) - -#define PI acos(-1) - -float4 main(float2 tex : TEXCOORD0) : COLOR -{ - float4 c0 = tex2D(s0, tex); - - float2 h = float2(0, 1/height); - float4 c1 = tex2D(s0, tex-h); - float4 c2 = tex2D(s0, tex+h); - c0 = (c0*2+c1+c2)/4; - - return c0; -} \ No newline at end of file diff --git a/src/apps/mplayerc/res/shaders/emboss.psh b/src/apps/mplayerc/res/shaders/emboss.psh deleted file mode 100644 index 4dc2bba00..000000000 --- a/src/apps/mplayerc/res/shaders/emboss.psh +++ /dev/null @@ -1,30 +0,0 @@ -sampler s0 : register(s0); -float4 p0 : register(c0); -float4 p1 : register(c1); - -#define width (p0[0]) -#define height (p0[1]) -#define counter (p0[2]) -#define clock (p0[3]) -#define one_over_width (p1[0]) -#define one_over_height (p1[1]) - -#define PI acos(-1) - -float4 main(float2 tex : TEXCOORD0) : COLOR -{ - float dx = 1/width; - float dy = 1/height; - - float4 c1 = tex2D(s0, tex + float2(-dx,-dy)); - float4 c2 = tex2D(s0, tex + float2(0,-dy)); - float4 c4 = tex2D(s0, tex + float2(-dx,0)); - float4 c6 = tex2D(s0, tex + float2(dx,0)); - float4 c8 = tex2D(s0, tex + float2(0,dy)); - float4 c9 = tex2D(s0, tex + float2(dx,dy)); - - float4 c0 = (-c1-c2-c4+c6+c8+c9); - c0 = (c0.r+c0.g+c0.b)/3 + 0.5; - - return c0; -} diff --git a/src/apps/mplayerc/res/shaders/empty.psh b/src/apps/mplayerc/res/shaders/empty.psh deleted file mode 100644 index 3d0ab987a..000000000 --- a/src/apps/mplayerc/res/shaders/empty.psh +++ /dev/null @@ -1,19 +0,0 @@ -sampler s0 : register(s0); -float4 p0 : register(c0); -float4 p1 : register(c1); - -#define width (p0[0]) -#define height (p0[1]) -#define counter (p0[2]) -#define clock (p0[3]) -#define one_over_width (p1[0]) -#define one_over_height (p1[1]) - -#define PI acos(-1) - -float4 main(float2 tex : TEXCOORD0) : COLOR -{ - float4 c0 = tex2D(s0, tex); - - return c0; -} diff --git a/src/apps/mplayerc/res/shaders/grayscale.psh b/src/apps/mplayerc/res/shaders/grayscale.psh deleted file mode 100644 index d57c94201..000000000 --- a/src/apps/mplayerc/res/shaders/grayscale.psh +++ /dev/null @@ -1,19 +0,0 @@ -sampler s0 : register(s0); -float4 p0 : register(c0); -float4 p1 : register(c1); - -#define width (p0[0]) -#define height (p0[1]) -#define counter (p0[2]) -#define clock (p0[3]) -#define one_over_width (p1[0]) -#define one_over_height (p1[1]) - -#define PI acos(-1) - -float4 main(float2 tex : TEXCOORD0) : COLOR -{ - float c0 = dot(tex2D(s0, tex), float4(0.299, 0.587, 0.114, 0)); - - return c0; -} diff --git a/src/apps/mplayerc/res/shaders/invert.psh b/src/apps/mplayerc/res/shaders/invert.psh deleted file mode 100644 index 4d61115c3..000000000 --- a/src/apps/mplayerc/res/shaders/invert.psh +++ /dev/null @@ -1,19 +0,0 @@ -sampler s0 : register(s0); -float4 p0 : register(c0); -float4 p1 : register(c1); - -#define width (p0[0]) -#define height (p0[1]) -#define counter (p0[2]) -#define clock (p0[3]) -#define one_over_width (p1[0]) -#define one_over_height (p1[1]) - -#define PI acos(-1) - -float4 main(float2 tex : TEXCOORD0) : COLOR -{ - float4 c0 = float4(1, 1, 1, 1) - tex2D(s0, tex); - - return c0; -} diff --git a/src/apps/mplayerc/res/shaders/letterbox.psh b/src/apps/mplayerc/res/shaders/letterbox.psh deleted file mode 100644 index c3a17297b..000000000 --- a/src/apps/mplayerc/res/shaders/letterbox.psh +++ /dev/null @@ -1,25 +0,0 @@ -sampler s0 : register(s0); -float4 p0 : register(c0); -float4 p1 : register(c1); - -#define width (p0[0]) -#define height (p0[1]) -#define counter (p0[2]) -#define clock (p0[3]) -#define one_over_width (p1[0]) -#define one_over_height (p1[1]) - -#define PI acos(-1) - -float4 main(float2 tex : TEXCOORD0) : COLOR -{ - float4 c0 = 0; - - float2 ar = float2(16, 9); - float h = (1 - width/height * ar.y/ar.x) / 2; - - if(tex.y >= h && tex.y <= 1-h) - c0 = tex2D(s0, tex); - - return c0; -} \ No newline at end of file diff --git a/src/apps/mplayerc/res/shaders/levels.psh b/src/apps/mplayerc/res/shaders/levels.psh deleted file mode 100644 index 8d756841a..000000000 --- a/src/apps/mplayerc/res/shaders/levels.psh +++ /dev/null @@ -1,9 +0,0 @@ -sampler s0 : register(s0); - -#define Const_1 (16.0/255.0) -#define Const_2 (255.0/219.0) - -float4 main(float2 tex : TEXCOORD0) : COLOR -{ - return( ( tex2D( s0, tex ) - Const_1 ) * Const_2 ); -} diff --git a/src/apps/mplayerc/res/shaders/nightvision.psh b/src/apps/mplayerc/res/shaders/nightvision.psh deleted file mode 100644 index 1fc4adfee..000000000 --- a/src/apps/mplayerc/res/shaders/nightvision.psh +++ /dev/null @@ -1,7 +0,0 @@ -sampler s0 : register(s0); - -float4 main(float2 tex : TEXCOORD0) : COLOR -{ - float c = dot(tex2D(s0, tex), float4(0.2, 0.6, 0.1, 0.1)); - return float4(0,c,0,0); -} diff --git a/src/apps/mplayerc/res/shaders/procamp.psh b/src/apps/mplayerc/res/shaders/procamp.psh deleted file mode 100644 index ec331d6bd..000000000 --- a/src/apps/mplayerc/res/shaders/procamp.psh +++ /dev/null @@ -1,61 +0,0 @@ -sampler s0 : register(s0); -float4 p0 : register(c0); -float4 p1 : register(c1); - -#define width (p0[0]) -#define height (p0[1]) -#define counter (p0[2]) -#define clock (p0[3]) -#define one_over_width (p1[0]) -#define one_over_height (p1[1]) - -#define PI acos(-1) - -static float4x4 r2y = -{ - 0.299, 0.587, 0.114, 0, - -0.147, -0.289, 0.437, 0, - 0.615, -0.515, -0.100, 0, - 0, 0, 0, 0 -}; - -static float4x4 y2r = -{ - 1.0, 0.0, 1.140, 0, - 1.0, -0.394, -0.581, 0, - 1.0, 2.028, 0.0, 0, - 0, 0, 0, 0 -}; - -#define ymin (16.0/255) -#define ymax (235.0/255) - -// Brightness: -1.0 to 1.0, default 0.0 -// Contrast: 0.0 to 10.0, default 1.0 -// Hue: -180.0 to +180.0, default 0.0 -// Saturation: 0.0 to 10.0, default 1.0 - -#define Brightness 0.0 -#define Contrast 1.0 -#define Hue 0.0 -#define Saturation 1.0 - -// tv -> pc scale -// #define Brightness (-ymin) -// #define Contrast (1.0/(ymax-ymin)) - -static float2x2 HueMatrix = -{ - cos(Hue * PI / 180), sin(Hue * PI / 180), - -sin(Hue * PI / 180), cos(Hue * PI / 180) -}; - -float4 main(float2 tex : TEXCOORD0) : COLOR -{ - float4 c0 = tex2D(s0, tex); - c0 = mul(r2y, c0); - c0.r = Contrast * (c0.r - ymin) + ymin + Brightness; - c0.gb = mul(HueMatrix, c0.gb) * Saturation; - c0 = mul(y2r, c0); - return c0; -} diff --git a/src/apps/mplayerc/res/shaders/resizer.psh b/src/apps/mplayerc/res/shaders/resizer.psh deleted file mode 100644 index 1c31f7653..000000000 --- a/src/apps/mplayerc/res/shaders/resizer.psh +++ /dev/null @@ -1,105 +0,0 @@ - -sampler s0 : register(s0); -sampler s1 : register(s1); -sampler s2 : register(s2); -sampler s3 : register(s3); -sampler s4 : register(s4); - -float4 p0 : register(c0); -float2 dxdy : register(c1); -float2 dx : register(c2); -float2 dy : register(c3); - -#define A _The_Value_Of_A_Is_Set_Here_ - -// none of the resizers here can be used for 1:1 mapping! -// tex * size won't be 0, 1, 2, 3, .. as you might expect, but something like 0, 0.999, 2.001, 2.999, ... -// this means when the fractional part becomes 0.999 we will be interpolating with the wrong value!!! - -struct PS_INPUT -{ - float2 t0 : TEXCOORD0; - float2 t1 : TEXCOORD1; - float2 t2 : TEXCOORD2; - float2 t3 : TEXCOORD3; - float2 t4 : TEXCOORD4; -}; - -float4 main_bilinear(PS_INPUT input) : COLOR -{ - float2 dd = frac(input.t4); - - float4 c = lerp( - lerp(tex2D(s0, input.t0), tex2D(s1, input.t1), dd.x), - lerp(tex2D(s2, input.t2), tex2D(s3, input.t3), dd.x), - dd.y); - - return c; -} - -static float4x4 tco = -{ - 0, A, -2*A, A, - 1, 0, -A-3, A+2, - 0, -A, 2*A+3, -A-2, - 0, 0, A, -A -}; - -float4 taps(float t) -{ - return mul(tco, float4(1, t, t*t, t*t*t)); -} - -float4 SampleX(float4 tx, float2 t0) -{ - return - mul(tx, - float4x4( - tex2D(s0, t0 - dx), - tex2D(s0, t0), - tex2D(s0, t0 + dx), - tex2D(s0, t0 + dx + dx) - ) - ); -} - -float4 SampleY(float4 tx, float4 ty, float2 t0) -{ - return - mul(ty, - float4x4( - SampleX(tx, t0 - dy), - SampleX(tx, t0), - SampleX(tx, t0 + dy), - SampleX(tx, t0 + dy + dy) - ) - ); -} - -float4 main_bicubic1pass(PS_INPUT input) : COLOR -{ - float2 dd = frac(input.t1); - return SampleY(taps(dd.x), taps(dd.y), input.t0); - // return SampleY(tex1D(s1, dd.x), tex1D(s1, dd.y), input.t0); -} - -float4 Sample(float4 t, PS_INPUT input) -{ - return - mul(t, - float4x4( - tex2D(s0, input.t0), - tex2D(s1, input.t1), - tex2D(s2, input.t2), - tex2D(s3, input.t3) - ) - ); -} - -float4 main_bicubic2pass(PS_INPUT input) : COLOR -{ - float2 dd = frac(input.t4); - return Sample(taps(dd.x), input); - // return Sample(tex1D(s4, dd.x), input); -} - diff --git a/src/apps/mplayerc/res/shaders/sharpen.psh b/src/apps/mplayerc/res/shaders/sharpen.psh deleted file mode 100644 index e1001f476..000000000 --- a/src/apps/mplayerc/res/shaders/sharpen.psh +++ /dev/null @@ -1,30 +0,0 @@ -sampler s0 : register(s0); -float4 p0 : register(c0); -float4 p1 : register(c1); - -#define effect_width (1.6) -#define val0 (2.0) -#define val1 (-0.125) - -#define width (p0[0]) -#define height (p0[1]) - -float4 main(float2 tex : TEXCOORD0) : COLOR -{ - float dx = effect_width/width; - float dy = effect_width/height; - - float4 c1 = tex2D(s0, tex + float2(-dx,-dy)) * val1; - float4 c2 = tex2D(s0, tex + float2(0,-dy)) * val1; - float4 c3 = tex2D(s0, tex + float2(-dx,0)) * val1; - float4 c4 = tex2D(s0, tex + float2(dx,0)) * val1; - float4 c5 = tex2D(s0, tex + float2(0,dy)) * val1; - float4 c6 = tex2D(s0, tex + float2(dx,dy)) * val1; - float4 c7 = tex2D(s0, tex + float2(-dx,+dy)) * val1; - float4 c8 = tex2D(s0, tex + float2(+dx,-dy)) * val1; - float4 c9 = tex2D(s0, tex) * val0; - - float4 c0 = (c1 + c2 + c3 + c4 + c5 + c6 + c7 + c8 +c9); - - return c0; -} \ No newline at end of file diff --git a/src/apps/mplayerc/res/shaders/sphere.psh b/src/apps/mplayerc/res/shaders/sphere.psh deleted file mode 100644 index 62dca5645..000000000 --- a/src/apps/mplayerc/res/shaders/sphere.psh +++ /dev/null @@ -1,60 +0,0 @@ -sampler s0 : register(s0); -float4 p0 : register(c0); -float4 p1 : register(c1); - -#define width (p0[0]) -#define height (p0[1]) -#define counter (p0[2]) -#define clock (p0[3]) -#define one_over_width (p1[0]) -#define one_over_height (p1[1]) - -#define PI acos(-1) - -float4 main(float2 tex : TEXCOORD0) : COLOR -{ - // - this is a very simple raytracer, one sphere only - // - no reflection or refraction, yet (my ati 9800 has a 64 + 32 instruction limit...) - - float3 pl = float3(3,-3,-4); // light pos - float4 cl = 0.4; // light color - - float3 pc = float3(0,0,-1); // cam pos - float3 ps = float3(0,0,0.5); // sphere pos - float r = 0.65; // sphere radius - - float3 pd = normalize(float3(tex.x-0.5, tex.y-0.5, 0) - pc); - - float A = 1; - float B = 2*dot(pd, pc - ps); - float C = dot(pc - ps, pc - ps) - r*r; - float D = B*B - 4*A*C; - - float4 c0 = 0; - - if(D >= 0) - { - // t2 is the smaller, obviously... - // float t1 = (-B + sqrt(D)) / (2*A); - // float t2 = (-B - sqrt(D)) / (2*A); - // float t = min(t1, t2); - - float t = (-B - sqrt(D)) / (2*A); - - // intersection data - float3 p = pc + pd*t; - float3 n = normalize(p - ps); - float3 l = normalize(pl - p); - - // mapping the image onto the sphere - tex = acos(-n)/PI; - - // rotate it - tex.x = frac(tex.x + frac(clock/10)); - - // diffuse + specular - c0 = tex2D(s0, tex) * dot(n, l) + cl * pow(max(dot(l, reflect(pd, n)), 0), 50); - } - - return c0; -} diff --git a/src/apps/mplayerc/res/shaders/spotlight.psh b/src/apps/mplayerc/res/shaders/spotlight.psh deleted file mode 100644 index 1a185a8f4..000000000 --- a/src/apps/mplayerc/res/shaders/spotlight.psh +++ /dev/null @@ -1,22 +0,0 @@ -sampler s0 : register(s0); -float4 p0 : register(c0); -float4 p1 : register(c1); - -#define width (p0[0]) -#define height (p0[1]) -#define counter (p0[2]) -#define clock (p0[3]) -#define one_over_width (p1[0]) -#define one_over_height (p1[1]) - -#define PI acos(-1) - -float4 main(float2 tex : TEXCOORD0) : COLOR -{ - float4 c0 = tex2D(s0, tex); - float3 lightsrc = float3(sin(clock*PI/1.5)/2+0.5,cos(clock*PI)/2+0.5,1); - float3 light = normalize(lightsrc - float3(tex.x,tex.y,0)); - c0 *= pow(dot(light, float3(0,0,1)), 50); - - return c0; -} diff --git a/src/apps/mplayerc/res/shaders/wave.psh b/src/apps/mplayerc/res/shaders/wave.psh deleted file mode 100644 index 8cc42ed5c..000000000 --- a/src/apps/mplayerc/res/shaders/wave.psh +++ /dev/null @@ -1,29 +0,0 @@ -sampler s0 : register(s0); -float4 p0 : register(c0); -float4 p1 : register(c1); - -#define width (p0[0]) -#define height (p0[1]) -#define counter (p0[2]) -#define clock (p0[3]) -#define one_over_width (p1[0]) -#define one_over_height (p1[1]) - -#define PI acos(-1) - -float4 main(float2 tex : TEXCOORD0) : COLOR -{ - // don't look at this for too long, you'll get dizzy :) - - float4 c0 = 0; - - tex.x += sin(tex.x+clock/0.3)/20; - tex.y += sin(tex.x+clock/0.3)/20; - - if(tex.x >= 0 && tex.x <= 1 && tex.y >= 0 && tex.y <= 1) - { - c0 = tex2D(s0, tex); - } - - return c0; -} diff --git a/src/apps/mplayerc/res/single.ico b/src/apps/mplayerc/res/single.ico deleted file mode 100644 index 626da9bc20f1dbb0b3bd72b27ae1e6a0f0298bbb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 766 zcmd6kJraU25QQI(GnBESHKoU(;6UkYQf$ewavYCf7vD=@E9rFf+r0e?fz1F6v=}cC zj}tI4-l#~;)POTR;ogp(?kCi-wqT}=qA@9@Fsf7ALaoXunp$!{C#;TXm~eM`opVkp rsri0C>692vKKxtl*V*P@oIbCYORxD`Hd>9ZvVZC*K7s2eboBlgsp)#4;2P(Ei?iGL7qWE76WFnK#6PbT{C(UM4+U>S3a z>GgWDySpoc!9e=`zHDu6$>?Rs&Q8c{IhB~Yd_0}W>E)%odjA0_ zMV(^khHmJFZs_^8gr3k7i-exgnZ(f@-O(Mv(Svoc4lmBisQ4>|l$%sSiamqEpfD&5 z3PVAHL19oB6b6N%V8Wmjg+XD^K!Zc!(9980I)K8Qe~EAcJwGxm zhPh#66g5~%8@Onk7%T=$X$u?%hrwZR7#yWla2N~*gTatnXK)w{27}`jjHQM6)IZjx zy}3J3;ho4Tt;RdSlrT*gB$yK3iHnIM3Gak=*^c6kj(@^G;h(oC;h*SDf+4|>=tJH% zx>BAVg_$vLBRz2Z95#o;@he-KIp~4I;hBR6E8ERY4vWL$Ksbiw6@bOL(MfUyhlM{u z9rnaw@!XHXlHZ2B3urI|3;{#H5HJJ`<#mF=VF(xk28V$%1oMLel8am z7jkuVCD+&2a(8zp^F_#;!$ZE~5#7z-K%S^qR=I9o=GA|CG#XV^eI?4V*6mh{#r;RA zszp_`R#)qsR=3+*Uj8|UtFzfG=Nue-p-xpjoHL!awzpf;>EGux8t}}1sMC9hIrGft k+3WW97hcB^b%*XS2{alab{JuYb(&zjA`p4Jb0H|}jL;wH) diff --git a/src/apps/mplayerc/res/streamtypes.bmp b/src/apps/mplayerc/res/streamtypes.bmp deleted file mode 100644 index 8aef0738965296e68a5866060bc76eb381729f3e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6966 zcmeI0drVwa9>>ubV`5CSX4Rx?v_@mIT8$ZFQrF#7)TEK^{-e~@7-?D@6r^h_Tc9l# zI<&NaeemqiTA`)Tg7m?o!UAoF%9gelsW5GYPI)ydBA8x#ymH?!BMy@Ao_BPUN!J=12I-Yp56EFCBmL@OMwd6R1&cpQi(=`Mc#Vfw>@{ zoJF~l`=qV@G-=gGvW8RJQ@@0X=a(HR>7?;it94*t;7YiHF&HVn#q8VZ>FLXsEsKeX znf)cdX=G(mVt3^pX6MWEe=Nykc5-)4{q{`gBbhTXF`i7)A9#3l!|L9eZ?7CK>8aS$ zU0%$Usn72({?EQ5n5HNn^Ed9ufeP%xA5YX*7Jd`jpasSQX-7wgN~QWDT)`NOyze&_ z+(NBXa!MuYKnb?`3wv@&Bk*pL0d&~7CCN2(5$4pL6|A>Ku zH0zy{H|(ZC+qlkZ=(UV$XY}1O`Yx-!6VlLlc=eN;8|G)!J@NJN$2J~)G`0HSb%!7N z>d=F04nDBD^!_jQ-xt5{-p@+ziBm^KML`104<@s(1@a07Nx-YskRUlZnH~~B0sIIG zbV}gR09KO<>@cvw_y?0fmVbMD^R!t%V;Lud7Okz#vJug|?O(*7Bxp!@hxog$HjxCT z(}yMeJ+@nJi@`O0Q;=X{z-qi^8U1BOuQmH5VEmuS`ga`1KfR?<&GY}%%G;kydvF#K zBqk;XI%Mb`=KM?r%0eK2##cCwQ>)dHk&#T7K)hl3Yj&i%M!E&_MZxsNs*0t5P%9!( zkDn<)2u!xsNF;{;6aTcd4ZscwoGvTO<8i?d3*yIU+nMUtYX$Q~!I-9esJ6iJbAz+5 zg(R5NR1<%P!+{Io|GaZLJ1a9GK2E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@h9qEbgdGunX9)IFPY5Qmr`WXMkNqb}z&huuA><#I6CnWe zSSOK-1e+YORlEfo%v&OXkNciVNx}Em^4N{w&uVx++Oq!7dtAhyBtR@+MfT7CX3^F( z@w#}>@j$e)?>B<&~`C|YiKqA6gfaUm3erFRugQN}q$UN8pN&4sH zkoZG_Usdo)fd0|r>jUBArtp7FN(v0X(<+-bWfTmxw!{}ywKQsCGK(eOzsNt}PsXAE z5}@BumzE*`;h|YJjuE@bQa}0zntK0{+3QyH)xnC^x~~ JzW)<}{{o7X!^Hpq diff --git a/src/apps/mplayerc/res/toolbar1.bmp b/src/apps/mplayerc/res/toolbar1.bmp deleted file mode 100644 index a0cd5087ab9223c9a77d1c63b3f2e0dc8f2e42b2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2038 zcmchYy-ve06orj~lrq6%FfvxkfW*$bSgM2*F(jLfI)K!{vKV*;R;Kikm?$ViIOp1+ zPzVDhb!y*hJMQQE5I;VQH9_|DXnwUQ;o@HLh;$G5`|PdJy@T;5)vo_l+xNwU7F;D z>G+xJX6hWH-SgExzWbR)a$m>H8Ui-n|qHbrm;NI8mkp~y5m2)IqE*Rq~B`JU={%`7w*yaxV z(ct2`%a6&03?E$dr?&UJZpF_JkZ)e>MT8SqwmD`mqAF+YZ}D9eo#fSuG9a%ksEI4s zQ9tjN&t?(xxuU%BI7gq{h#lj`FzwJ5uBLsSlHV(v>`mAm{`vQ%i$|Fcl=7V{agO#; U=ILIT5AKD1aMKMixCcRf2OjZ6E&u=k diff --git a/src/apps/mplayerc/res/web/1pix.gif b/src/apps/mplayerc/res/web/1pix.gif deleted file mode 100644 index 410a04b28ec47678fd4487a86dbc97d70ad931de..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 43 scmZ?wbhEHbWMp7uXaHgchX4QnEB<5wvKSe3fLtI2WHT}OFfv#J0KfzX0{{R3 diff --git a/src/apps/mplayerc/res/web/404.html b/src/apps/mplayerc/res/web/404.html deleted file mode 100644 index eabeda830..000000000 --- a/src/apps/mplayerc/res/web/404.html +++ /dev/null @@ -1,10 +0,0 @@ - - - MPC WebServer - - - - 404 - The requested URL was not found! - - -[debug] diff --git a/src/apps/mplayerc/res/web/bottomside.png b/src/apps/mplayerc/res/web/bottomside.png deleted file mode 100644 index 69d4e40d1720db6db415d90b761411fd96f19f20..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 97 zcmeAS@N?(olHy`uVBq!ia0vp^j6lr7!2~1^>^hVS;-owJIx;Y9?C1WI$O`03c)B=- tNQ5UReE4zVKtlEOM#nrw=H>!^2D$gln_Bnp{sC0O;OXk;vd$@?2>>Lh8q5Fy diff --git a/src/apps/mplayerc/res/web/browser.html b/src/apps/mplayerc/res/web/browser.html deleted file mode 100644 index 6cae6c267..000000000 --- a/src/apps/mplayerc/res/web/browser.html +++ /dev/null @@ -1,28 +0,0 @@ - - - MPC WebServer - - - - -

    - - - - -
    Location: [currentdir]
    -

    -

    - - - - - - - - [currentfiles] -
    NameTypeSizeDate Modified
    -

    - - -[debug] diff --git a/src/apps/mplayerc/res/web/controlback.png b/src/apps/mplayerc/res/web/controlback.png deleted file mode 100644 index 9dddb5e7ece5148cf9e0bc63fbbaec9f5447f5e9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 148 zcmeAS@N?(olHy`uVBq!ia0vp^j6f{I!2~4r?VVZM~ac3QL3HQV5b7Rnbhk%ROy_gWtQ1lk&T3O$u2zJwD0Ly+c#vD96Xj_G6yi9_>B5m;xX5wXv2SPCDB) cQ$&g3bL1tL4MH7Tf%Y&2hmZrXiE#W|WEEtnPwctdoQuuDZBm$xJ45 zj(K}Lxy7HvG*0t2;8l8{{Ax!l*F&dP3nk6^ixyXVccpH*b5w|_S?lWBNW;lREDY1W WN?!UanpFd|kipZ{&t;ucLK6VXtvW9N diff --git a/src/apps/mplayerc/res/web/controlbuttonpause.png b/src/apps/mplayerc/res/web/controlbuttonpause.png deleted file mode 100644 index f8837a310c0360e2dbc3aa555fe48a1dd73245a0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 143 zcmeAS@N?(olHy`uVBq!ia0vp^;y^6J!2~2(`!|~aDVB6cUq=Rpjs4tz5?O(KH%}MG z5D)L&5^(_UU9|w%Ys5fUMW-7YA1PK@t{MkS9Gjq pEq8aGK1C`mVCi&I?X;jihAnUJJ^jBdW-ri022WQ%mvv4FO#t0KD;@v< diff --git a/src/apps/mplayerc/res/web/controlbuttonplay.png b/src/apps/mplayerc/res/web/controlbuttonplay.png deleted file mode 100644 index 2f97c6f02695325b0ead5d97a6b03c4ea03437fc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 237 zcmeAS@N?(olHy`uVBq!ia0vp^l0YoO!2~3w-J08h6k~CayA#8@b22Z19F}xPUq=Rp zjs4tz5?O(Kg=CK)Uj~LMH3o);76yi2K%s^g3=E|P3=FRl7#OT(FffQ0%-I!a1C+@2 zba4#v@J_Dz{E3ZuE5ikyEJd~~NtRFdIn23*_8wtpvRit>vsFU4)3jT{d{UZNo$yIR z?&+ORX17Y}f(Yp+Gg`I%JdL^QPbpl}d9_48$)|CJqGGpzNy!zRORJhLevmrwA!>7y c+ExJuhsh45dY;oC0Nn{1`OFdm2 zLp;2bYd(KsV-97wps-4TZPg5>PuEsBvN$(POJwm0J@M`F^FyIYg@T*>Jc3+TxIJBT zqy1&&4!??~_7#qg7iAuKsq`eLd0OuVHXFP3fyZ4>+*@eU^C0bEr%TO7H-oo=(r$~{ o1pOu~PBdvclySCeW{4w$RlMIcgIK+}KnE~*y85}Sb4q9e0GlyKJOBUy diff --git a/src/apps/mplayerc/res/web/controlbuttonskipforward.png b/src/apps/mplayerc/res/web/controlbuttonskipforward.png deleted file mode 100644 index db720c892a059765e61fd0067e9d3911fe2997c1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 190 zcmeAS@N?(olHy`uVBq!ia0vp^G9b*s1SJ3FdmIK*Ea{HEjtmSN`?>!lvI6;~o-U3d z9^T0{pFgoNUuC=yuu7S2)ohMWR#$m#OLP9NSQye*`zDdgXX}ZL?en`O&s*@insH1r zelY9e8-=q0JJKr3nqMrx63|ii#Kwo!`JtaPA7fWcmrTbM&fr(a?OK-}%(y47`)fta nmy1jKq)ewIp6!|$;?BVOKc&3o?ji@E0~kDA{an^LB{Ts5FULpB diff --git a/src/apps/mplayerc/res/web/controlbuttonstep.png b/src/apps/mplayerc/res/web/controlbuttonstep.png deleted file mode 100644 index 2eb1671cd5e77101b9ffb44163a5ab8a89e56acc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 183 zcmeAS@N?(olHy`uVBq!ia0vp^@<1%Z!2~45B0e7gQY`6?zK#qG8~eHcB(ehed7dtg zAs*hzHJ?ARF~4QFP;yI=?Up1jm*}mTb+2yx3cS3L?Y#nrq(@rA4!)Vb29^R(%X}_B zoc3^gL(S#RjSWhdIinmVzH~Oe!?{apQNxM}ikEbJQWr0K%(d&{1j!i_7Uu4?%Cefb hs44Mm*UT->3>oqcv4OEEzkoI~c)I$ztaD0e0s!KHLt6j< diff --git a/src/apps/mplayerc/res/web/controlbuttonstop.png b/src/apps/mplayerc/res/web/controlbuttonstop.png deleted file mode 100644 index fcc80afa93cf53c4b10ef4aad10972665889270e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 149 zcmeAS@N?(olHy`uVBq!ia0vp^l0YoO!2~3w-J08h6id3JuOkD)#(wTUiL5}rkEe@c zh=+G_&F4>S%v%{Q=wvCfWl6GplHYp9sx;^C2~+NHrGvsdEDmR1(OI+5Oe!uyh|Th4 wcMp&KqR-z9xb(B8eOErZ##B2kh?|ii*v53;wcq - - MPC WebServer - - - - - -

    - - Feel free to redesign this page (nice image buttons, more "player-like" layout, etc.), but if you do - alter the page here - and not the one you can save from the browser. Post your comments, remarks, ideas, progress into - this topic. - -

    -

    - File Info - -
    - - - - - - - - - - -
    - - Loaded file: [filepath] - Browse... - -
    - Status: [statestring] - - - - - - - -
    [positionstring]/[durationstring]
    -
    - - -
    -

    -

    -

    - Goto control - -
    - - - - - - - -
    - - - - - - -
    -
    - - - - - - -
    -
    -

    -

    - - - - - -
    - Playback control
    - - - - - - - - - - - - - - -
    - - - -   - - - - - -   - - -
    -
    -   - - Seek
    - - - - - - - - - - - -
    - - - - - - - -
    -
    -

    -

    - - - - - - - - - -
    - Volume control -
    - - - - - - - - - -
    - U - - - - - - - -
    - - - - - - -
    -
    -
    -
    - - - - -
    -
    -   - - Playlist - - - - - -
    - -
    -
    -   - - Panic Button
    - - - - -
    -
    -
    -   - - Audio Delay
    - - - - - -
    - -
    -
    -

    - -

    - - - -
    - Pan&Scan Move
    - - - - - - - - - - - - - - - - -
    - - - - -
    -
    -
    - - - - -
    -
    -
    - - - - -
    -
    -
    - - - - -
    -
    -
    - - - - -
    -
    -
    - - - - -
    -
    -
    - - - - -
    -
    -
    - - - - -
    -
    -
    - - - - -
    -
    -
    -
    -   - - Pan&Scan Size
    - - - - - - - - - - - - - - -
    -   - - - - - -
    -
    -
    - - - - -
    -
    -
    - - - - -
    -
    -
    - - - - -
    -
    -
    - - - - -
    -
    -
    - - - - -
    -
    -
    - - - - -
    -
    -
    -
    -

    -

    - - - - - - -
    - Video Frame
    - - - - - - - - - - - - - -
    - - - - -
    -
    -
    - - - - -
    -
    -
    - - - - -
    -
    -
    - - - - -
    -
    -
    - - - - -
    -
    -
    - - - - -
    -
    -
    -
    - - DVD Menu Controler
    - - - - - - - - - - - - - - - -
    -   - - - - - -
    -
    -
    -   -
    - - - - -
    -
    -
    - - - - -
    -
    -
    - - - - -
    -
    -
    - - - - -
    -
    -
    - - - - -
    -
    -
    - - - - -
    -
    -
    -
    -   - - Misc
    - - - - - - - - - - - - - - - -
    - - - - -
    -
    -
    - - - - -
    -
    -
    - - - - -
    -
    -
    - - - - -
    -
    -
    - - - - -
    -
    -
    - - - - -
    -
    -
    - - - - -
    -
    -
    - - - - -
    -
    -
    - - - - -
    -
    -
    -
    -

    -

    - - - - - - -
    - Zoom control
    - - - - - - -
    - - -
    -
    -   - - Fullscreen control
    - - - - - -
    - -
    -
    -

    -

    - - - - - - -
    - Player views
    - - - - - - -
    - - -
    -
    - - Detachable Controlls
    - - - - - - -
    - - -
    -
    - - - - - - - - - -
    - - - - - -
    -

    -

    - - - - - - -
    - Generic Audio/Subtitles
    - - - - - - - - -
    - - -   - - -
    -
    -   - - - OGM Audio/Subtitles
    - - - - - - - - -
    - - -   - - -
    -
    -

    -

    - - - - - - -
    - Subtitles
    - - - - - -
    - -
    -
    -   - - DVD Angles/Audio/Subtitles
    - - - - - - - - - - - -
    - - -   - - - -   - - -
    -
    -

    -

    - - - - - - -
    - DVD Menus
    - - - - - - - - - -
    - - - - - -
    -
    -   - - Media Player Classic Menu's - - - - - - -
    - - -
    -
    -

    -

    - Always On Top
    - - - - - - -
    - - -
    -

    - - -
    -

    - - -[debug] diff --git a/src/apps/mplayerc/res/web/controlvolumebar.png b/src/apps/mplayerc/res/web/controlvolumebar.png deleted file mode 100644 index ab51a5d01e41903e84215f04792f85b10d774bfe..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 239 zcmeAS@N?(olHy`uVBq!ia0vp^=0GgN!2~3|E^T-Mq*&4&eH|GXHuiJ>Nn{1`mwCE4 zhD5l(oqmw>fC7)}+ke6(&2m-&;Tk3FCawY#qqeAhlvlFkh?CR*x#D!G9AmwqY8`9M zk>$7jEKR(BZxaff((!cC$sj`+u~ffl{ts$SIo-~-Sr&M0i(^39LDeMX>Hi<}Xs|yN z(Tu)yp}M)FG{$RoO_j-(&cIb!(o46rXZ!X?`tSc7;_Lt9aq@)LA8M;s9U}oXkrghb7(7*O7r? zV?XzwL{=bQA=x9ymw};5je((|g@NH0P^jSr14F3+1H-EX1_rAc3=HB0b9M#V0420N zT^vI+f|GyrGw-RaY-Z$W*yJFl7PUF)*@`b28xBljGqGgQjNzCP^?{k;Rr1v-geAf429jl&BWNLGpr0P0}>NM8ITyE(n%daOdTtsR#k-% zYj}whU(PvnxjQ;EvTkrLU!LtadH6ma=Zk;o{k`xS(2C~(FMhcugxQAm6(&^gt}gR(kD zv={{nvx3fs1|kG{jmDH>tJ`EiBaJTHGF}T6nUTKC6hx7*%qvexgg|N(5x>}Tr6dAG zH}Nq91x|@t`w;YtlU-U>3bEr*)=N-LiQG<4S@=OIv+9RJ5ie$|bhLb(Sjp+LZ74Y> z{k9R+3L4t)>7l#HjYe;eKIQuFlMU7A{3FT*4dH6e9ed0zv5{`#{z`94pOYNn{1`BRpLk zLnOkJ6FMqSCfNVAZ~oTupXZJ0e~B5!`wR?J_9QcO8oSu0Cv;S_$-3`LNMLx_aovF@ zME>j4MnlGq;5s9NCI3FVdQ I&MBb@0NVvMnE(I) diff --git a/src/apps/mplayerc/res/web/headerclose.png b/src/apps/mplayerc/res/web/headerclose.png deleted file mode 100644 index 72fd81c988840ed6621823f15edd7ddb20e98edc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1658 zcmV-=28H>FP)mw-}?2MBU6XlO;1tOjNvJ-1XD+gE1Kk2y)qm(#v~mi(HiHKwS5nzNJNGwtZOh z&*^!er{~xId7g7#4yv>w_A|?V%^~E4=H`*tpY|s=uPzf#ZIgy(I}5hiaG|6|({g&enmxCd-rJLXYlKjPoBEqoB014VS&f=<3B z2riDi^Pz3A0LN-s+ba;Ne1_8cSu8@kUU8b|+_baqx*2!vG)MD0s(p&K+Q+J=@aTwW zCJ?LYaXdm+X~CrfK?GE0Lb(G-IEta}+s57NteiTFTa6inw$iAQ!cvkB!LL~<3|KNf zh$9(A#h?)+8peVN5R-mFepl^I+4X;0v#@MoF)U-nQUC#hQVM$<0;1p!*19hdk{LZq z#~RO2q;<|&>Hj!sJn`5wwFevI-@`cGwC9$Ms*5Nej z{vv1zhMJFRr!Ids-F0E&i<9GL4_HrkSdO=tkLj2rTHu-w)-n5PnB6L>t(0sQ6WekP zs-*tn$SZN{a9d#eAb`Gif5E98%IvNL+~md1C+Ck^PqkYr8Py^u zbtR;(7#Bp7X{t`um&f;ud0mNq7@F9R#X_N`c>8uJ-Bvn&cK`S%hk*FJ=Pr(PsOT02 zsgn>51w?JOsVdc^N{0BeAG(Z6{+J?mKpJ%|_1%AhLUXJqTCJycf=6fT?L-k#n*~H; zdAu`jER7y3jTw-<3F>H+-6^RpfC}PWAJH=V)Xw!pT`o~0G*u?Lh|&n7jHj1J4M=#` zQUb8kHU+s|y5tHF@(5x}h)MjONfK<>5;j;Ib|Y!M3(A^>^N$-P zCoxo&M7PM9jtU0a-CjYpmf|bWBy!caB8pUmld@n^vVoKY8l^!)ML{@;IkQslvdhSQ}%lr(^n1enADLj?gh2Y$|dRDP2C@lub9JG4%-+b+j{XE?!OLc@L+p z?B3*sp`uAtV8MQYi(h@PV~GP;pTt>7of=&d|5HHdKMCo($_)-3}t*%RSKaN6174?okprt zNOclbBcQ9In2IoSSs?5kY%+N(38CjuoZF3X4u*=KIm`kS-hmjZnTNzklFx6s0guFy zk4ra?DdY4N@p>g+U(Pp_#~777LJ>yD0!i_DvXD#WdJ`GT^vP}yHlr&c$N^=!0Cj9% zGfzI5|G6l#Cz;!m;oqAV)GG?>6@~W}g!YL-9ux%i=WiIy_aDsh9m?Vk3VnuBmJcR) zJc#Ao<)N$Tffy>EahPSH_(*By8$X|!80z~vFY?kR@2=R@SNUr$3)WtaUDGAtUK4Py z^H+7pdf$p!aXb30Zk|_nr2Fj%&h=2#l^$q$*xPt+>P^t6#sB~S diff --git a/src/apps/mplayerc/res/web/headericon.png b/src/apps/mplayerc/res/web/headericon.png deleted file mode 100644 index f8e9dc705d127c84fb4079c6fa9e42a6f5034da6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 801 zcmV++1K#|JP)2*uk;J!q7)JJQd_9hLab?<2&FZK z7GqDIir_&|P*D5_Ui=GQyoe~+(t{KU7+Y&iS_=tnp=p!x{pOpUY|~h~JS>yVe9yi! zJ2T1{L-tZVUzE~lnC&?K)=HjJ>@c_Enht5&spGD+Hg!Wg4GIDZP+%|BGaDOQkLT-0 z9-59vOy^^B>X}JAHHnwz!V9MB6?5rzE3BZ)pHLs;i2)Fue%=H|!9R2g zHM#<5?2iDQp4iZnHAv|}UFQvuHtznRG>Fc;r|tp`es>Hn)18v&AQD*j5Ad&5fc|fc zh^)nnT(rAY@`PdW7r%^7zS&111B{MQ%J>PwX38{NB0BnZx8i3sg;)5pW+lRc!R7V} z*2_!myfB&aba?TbQzb4II7Q+^I1x6&Fc*7#rK})cY*0ikPSIDSn~SW3-u7ryY1b;A z?@7_|j?R6ih(d~+@08`ADF;I(p`GIF9QFU8fhDA{#aM4{f9T9g6mMZsb1skq3XB4Z zTfcdmg$m9r$@kn{9Q5ZBQQTM(g$%)p_Pg^=9$E!FcXa$Cou8-VFZQK)7XMo>eL}@* zs2C_ya)nZ>ej;T$+g?!x2cctg)K!prO0P8);Zb5oNDKeWnv#HV>M4ew*fe0g2aPSnt=oShb+onJo7b`lD@fs{Z2C^Xa zP#%0bgKPt+Yz^yT#w(!oTVwwQf7A&BRIcF^5`l*|4(ov~IZ#1UAr>e=EVmP%tTTCw zJ#wSO?l(YGQN-u7s<$BUnbf;TeG3kpFTU+kh~ml&EM6qK f7Ni4%&bI$w3YUcy1g+3n00000NkvXXu0mjfhE`== diff --git a/src/apps/mplayerc/res/web/index.html b/src/apps/mplayerc/res/web/index.html deleted file mode 100644 index e050e98be..000000000 --- a/src/apps/mplayerc/res/web/index.html +++ /dev/null @@ -1,35 +0,0 @@ - - - MPC WebServer - - - -

    - Sorry, this is just a little demo page for now, I'm still awaiting ideas what - to put here ... and mostly why (hehe) Anyway, I'm sure there will be some use - of this web server in the future. You users can always come up with something. -

    -

    - And if you are already here, why don't you try sending a few commands to MPC, - just to see if it works :) -

    -

    -

    - - -
    -

    -

    - File browser -

    -

    - The media player interface made by chobits -

    -

    - New in this release: MPC in the browser! -

    - [debug] - - diff --git a/src/apps/mplayerc/res/web/leftbottomside.png b/src/apps/mplayerc/res/web/leftbottomside.png deleted file mode 100644 index 93c69604604e9b646e1102123c839a20b109ae74..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 180 zcmeAS@N?(olHy`uVBq!ia0vp^EFjFm1SHiab7}%9#^NA%Cx&(BWL|<~(j9#r85lP9 zbN@+X1@aY=J%W507^>757#dm_7=8hT8eT9klo~KFyh>nTu$sZZAYL$MSD+10!pPIb zF+?IfIc0*)dBuZAm!3GRbnqm@BZ+%YO82V@6wPmR%#m%r!( - - - - - -Media Player Classic - - - - - - - - - -
    - - - - - - - - - - - - - - -
    - - - - - - - -
    - - - - - - - - - - - - - - - - -
    - - - - - - - - - - -
    - snapshot -
    - - - - - - - - -
    -
    - - - - - - - - - - - - - - -
     
    -
    - - - - - -
     
    -
    -
    -
    - - - \ No newline at end of file diff --git a/src/apps/mplayerc/res/web/rightbottomside.png b/src/apps/mplayerc/res/web/rightbottomside.png deleted file mode 100644 index ee3241c5f46608295f7f554484cbd2ca9afcf58a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 118 zcmeAS@N?(olHy`uVBq!ia0vp^EFjFm1SHiab83P(>5jgR3=A9lx&I`x0{Ob0E{-7* z;mIi*_8$K5P>`dx`tX5-x<!lvI6;`o-U3d z8o|jmpFgoN8#1iulQ{BWzCc41M@ZZKJ*L`eO?O;pSuIdo!;vA{Rq4QYXRd&^0>gZ( zlz!gS(jR}i)xA7=_+tzkb^LsGHLp}u``9>1Y~m}1%kSmCwO!e91ZV++r>mdKI;Vst E0AcYo1ONa4 diff --git a/src/apps/mplayerc/res/web/seekbarleft.png b/src/apps/mplayerc/res/web/seekbarleft.png deleted file mode 100644 index 880e254a3f3763954d1293131937b062226e4730..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 112 zcmeAS@N?(olHy`uVBq!ia0vp^EI=&G!2~2N9IQbSEa{HEjtmSN`?>!lvI6<)o-U3d z65+`;pFgoN%P?3L9B~j#Kif5vgIVL*pa1{o8$EBR>3k#4(CfKh{nLjAb)XgoPgg&e IbxsLQ0AO4n>i_@% diff --git a/src/apps/mplayerc/res/web/seekbarmid.png b/src/apps/mplayerc/res/web/seekbarmid.png deleted file mode 100644 index f93e037f0601f6273e23939b7ec8da02f6683582..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 100 zcmeAS@N?(olHy`uVBq!ia0vp^j6f{R!2~4lWq$AjQY`6?zK#qG8~eHcB(ehe(w;7k xArj%q6`wz`F`Mm4JL=Q+|NsBwqZVHn7*;Pb{=t0k4hv8jgQu&X%Q~loCIFX&9V-9; diff --git a/src/apps/mplayerc/res/web/seekbarright.png b/src/apps/mplayerc/res/web/seekbarright.png deleted file mode 100644 index f411c42d21429797bfcd7a254fdb07b97909d6ea..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 107 zcmeAS@N?(olHy`uVBq!ia0vp^EI=&G!2~2N9IQbSEa{HEjtmSN`?>!lvI6-^o-U3d z65+`;pFgoN%P?3L9C6@#{{R1f4(1i76^~n5d}UxbaO7xv@Uk7MK-CPMu6{1-oD!M< DzDgZJ diff --git a/src/apps/mplayerc/res/web/sliderback.gif b/src/apps/mplayerc/res/web/sliderback.gif deleted file mode 100644 index d4e5cd6f961cbd69080d963971051ed3f2b38fee..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 351 zcmZ?wbhEHbWM&d!Xl7t!U|?tf;|4I*0OU1*z<~n?{sYDTGyDfrKpMyb0>z&!Kt0?H zIzUMVkQvM@{|ZieuHI|$`t0ui2^xJVne#GMt;>16uR!N~N$&lMb? z|HP7_lQ~xNFRUo>S{t=qqowTh+p7H!HdOfN%|8EPOV!!D-Sh9_7>z^=j(&Q;qr%j(Rvw@$ZioIgN!bOXhEM2yI#mZHyz&!AUzB^ WAOd6tGYf~niOLCE^Ivf=SOWmZ9vl|{ diff --git a/src/apps/mplayerc/res/web/slidergrip.gif b/src/apps/mplayerc/res/web/slidergrip.gif deleted file mode 100644 index 15002f09b8250fd428becd795a8bad5409195410..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 157 zcmZ?wbhEHbz&!Kt0?H zIzUMVkQvM@UIiyTwRc%$f7$h)pDE^Ho2+vByv&L{AG#Nuc$Dv!}_fy8{H&=!^2$@-TSH^2LRQSl{n;+S7OPrCx8UUlgJD&gm diff --git a/src/apps/mplayerc/res/web/vbg.GIF b/src/apps/mplayerc/res/web/vbg.GIF deleted file mode 100644 index 5247809caebcad974fdc19aec7c4bd6268699fc5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 228 zcmZ?wbhEHb%wrH?Xl7t!U|?tf;|4I*0OU1*z<~n?{sYDTGyDfrKpMyb0>z&!Kt0?H zIzUMVkQvM@6AMmyuHI|$`t0ui2^xJVt#i^>u6xtE@42FUZf^bu>-X%x?l^?;9i7b^ zzkh*Hxz4G+3&BM@bF3EMxHDx{Q{3i+7t>CEtUH|XW`>TT_~n8hQW>?!-~X^Yx%cqz z|8~kXwGFLpRl?0~Z9Tm~ouxK?lcxk(rB9tXmEW3w-uwj%7cE}0blLJ1D_8N)TD#6Y NXXB>LTO0)$tO12z&!Kt0?H zIzUMVkQvM@Iv-AI3RY-jm%O_s`>pVvMBkDhbJKS2lK#EQkmuISn9Jt#A1`Sxuwaqs K_i$igum%89*e(wM diff --git a/src/apps/mplayerc/resource.h b/src/apps/mplayerc/resource.h deleted file mode 100644 index fd3db430f..000000000 --- a/src/apps/mplayerc/resource.h +++ /dev/null @@ -1,739 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by mplayerc.rc -// -#define IDR_MAINFRAME 128 -#define IDR_POPUP 129 -#define IDR_POPUPMAIN 130 -#define IDB_PLAYERTOOLBAR 201 -#define IDB_NOAUDIO 202 -#define IDB_MONO 203 -#define IDB_STEREO 204 -#define IDB_ONOFF 205 -#define IDF_LOGO0 206 -#define IDF_LOGO1 207 -#define IDF_LOGO2 208 -#define IDF_LOGO3 209 -#define IDF_LOGO4 210 -#define IDF_LOGO5 211 -#define IDF_LOGO6 212 -#define IDF_LOGO7 213 -#define IDB_AUTHHDRPIC 214 -#define IDB_STREAMTYPES 215 -#define IDI_SINGLE 300 -#define IDI_MULTI 301 -#define IDI_DVD 302 -#define IDI_AUDIOCD 303 -#define IDI_UNKNOWN 304 -#define IDR_AVI_FILECOPY 400 -#define IDR_HTML_INDEX 500 -#define IDR_HTML_404 501 -#define IDR_HTML_BROWSER 502 -#define IDR_HTML_CONTROLS 503 -#define IDR_HTML_PLAYER 504 -#define IDF_DEFAULT_CSS 505 -#define IDF_SLIDERBAR_GIF 506 -#define IDF_VBR_GIF 507 -#define IDF_VBS_GIF 508 -#define IDF_SLIDERGRIP_GIF 509 -#define IDF_1PIX_GIF 510 -#define IDF_SLIDERBACK_GIF 511 -#define IDF_HEADERICON_PNG 512 -#define IDF_HEADERBACK_PNG 513 -#define IDF_HEADERCLOSE_PNG 514 -#define IDF_LEFTSIDE_PNG 515 -#define IDF_RIGHTSIDE_PNG 516 -#define IDF_BOTTOMSIDE_PNG 517 -#define IDF_LEFTBOTTOMSIDE_PNG 518 -#define IDF_RIGHTBOTTOMSIDE_PNG 519 -#define IDF_SEEKBARLEFT_PNG 520 -#define IDF_SEEKBARMID_PNG 521 -#define IDF_SEEKBARRIGHT_PNG 522 -#define IDF_SEEKBARGRIP_PNG 523 -#define IDF_LOGO_PNG 524 -#define IDF_CONTROLBACK_PNG 525 -#define IDF_CONTROLBUTTONPLAY_PNG 526 -#define IDF_CONTROLBUTTONPAUSE_PNG 527 -#define IDF_CONTROLBUTTONSTOP_PNG 528 -#define IDF_CONTROLBUTTONSKIPBACK_PNG 529 -#define IDF_CONTROLBUTTONDECRATE_PNG 530 -#define IDF_CONTROLBUTTONINCRATE_PNG 531 -#define IDF_CONTROLBUTTONSKIPFORWARD_PNG 532 -#define IDF_CONTROLBUTTONSTEP_PNG 533 -#define IDF_CONTROLVOLUMEON_PNG 534 -#define IDF_CONTROLVOLUMEOFF_PNG 535 -#define IDF_CONTROLVOLUMEBAR_PNG 536 -#define IDF_CONTROLVOLUMEGRIP_PNG 537 -#define IDF_SHADER_RESIZER 700 -#define IDF_SHADER_EMPTY 701 -#define IDF_SHADER_CONTOUR 702 -#define IDF_SHADER_DEINTERLACE 703 -#define IDF_SHADER_EMBOSS 704 -#define IDF_SHADER_GRAYSCALE 705 -#define IDF_SHADER_INVERT 706 -#define IDF_SHADER_LETTERBOX 707 -#define IDF_SHADER_SHARPEN 708 -#define IDF_SHADER_SPHERE 709 -#define IDF_SHADER_SPOTLIGHT 710 -#define IDF_SHADER_WAVE 711 -#define IDF_SHADER_PROCAMP 712 -#define IDF_SHADER_LEVELS 713 -#define IDF_SHADER_NIGHTVISION 714 -#define IDF_SHADER_EDGE_SHARPEN 715 -#define IDF_SHADER_SHARPEN_COMPLEX 716 -#define ID_FILE_OPENMEDIA 800 -#define ID_FILE_OPENDVD 801 -#define ID_FILE_OPENDEVICE 802 -#define ID_FILE_CLOSEMEDIA 803 -#define ID_FILE_CLOSEPLAYLIST 804 -#define ID_FILE_SAVE_COPY 805 -#define ID_FILE_SAVE_IMAGE 806 -#define ID_FILE_SAVE_IMAGE_AUTO 807 -#define ID_FILE_SAVE_THUMBNAILS 808 -#define ID_FILE_LOAD_SUBTITLE 809 -#define ID_FILE_SAVE_SUBTITLE 810 -#define ID_FILE_ISDB_UPLOAD 811 -#define ID_FILE_ISDB_DOWNLOAD 812 -#define ID_FILE_ISDB_SEARCH 813 -#define ID_FILE_PROPERTIES 814 -#define ID_FILE_CONVERT 815 -#define ID_FILE_EXIT 816 -#define ID_VIEW_CAPTIONMENU 817 -#define ID_VIEW_SEEKER 818 -#define ID_VIEW_CONTROLS 819 -#define ID_VIEW_INFORMATION 820 -#define ID_VIEW_STATISTICS 821 -#define ID_VIEW_STATUS 822 -#define ID_VIEW_SUBRESYNC 823 -#define ID_VIEW_PLAYLIST 824 -#define ID_VIEW_CAPTURE 825 -#define ID_VIEW_SHADEREDITOR 826 -#define ID_VIEW_PRESETS_MINIMAL 827 -#define ID_VIEW_PRESETS_COMPACT 828 -#define ID_VIEW_PRESETS_NORMAL 829 -#define ID_VIEW_FULLSCREEN 830 -#define ID_VIEW_FULLSCREEN_SECONDARY 831 -#define ID_VIEW_ZOOM_50 832 -#define ID_VIEW_ZOOM_100 833 -#define ID_VIEW_ZOOM_200 834 -#define ID_VIEW_VF_HALF 835 -#define ID_VIEW_VF_NORMAL 836 -#define ID_VIEW_VF_DOUBLE 837 -#define ID_VIEW_VF_STRETCH 838 -#define ID_VIEW_VF_FROMINSIDE 839 -#define ID_VIEW_VF_FROMOUTSIDE 840 -#define ID_VIEW_VF_KEEPASPECTRATIO 841 -#define ID_VIEW_VF_COMPMONDESKARDIFF 842 -#define ID_ASPECTRATIO_START 850 -#define ID_ASPECTRATIO_SOURCE 850 -#define ID_ASPECTRATIO_4_3 851 -#define ID_ASPECTRATIO_5_4 852 -#define ID_ASPECTRATIO_16_9 853 -#define ID_ASPECTRATIO_END 859 -#define ID_ASPECTRATIO_NEXT 860 -#define ID_VIEW_RESET 861 -#define ID_VIEW_INCSIZE 862 -#define ID_VIEW_DECSIZE 863 -#define ID_VIEW_INCWIDTH 864 -#define ID_VIEW_DECWIDTH 865 -#define ID_VIEW_INCHEIGHT 866 -#define ID_VIEW_DECHEIGHT 867 -#define ID_PANSCAN_MOVELEFT 868 -#define ID_PANSCAN_MOVERIGHT 869 -#define ID_PANSCAN_MOVEUP 870 -#define ID_PANSCAN_MOVEDOWN 871 -#define ID_PANSCAN_MOVEUPLEFT 872 -#define ID_PANSCAN_MOVEUPRIGHT 873 -#define ID_PANSCAN_MOVEDOWNLEFT 874 -#define ID_PANSCAN_MOVEDOWNRIGHT 875 -#define ID_PANSCAN_CENTER 876 -#define ID_PANSCAN_ROTATEXP 877 -#define ID_PANSCAN_ROTATEXM 878 -#define ID_PANSCAN_ROTATEYP 879 -#define ID_PANSCAN_ROTATEYM 880 -#define ID_PANSCAN_ROTATEZP 881 -#define ID_PANSCAN_ROTATEZM 882 -#define ID_ONTOP_NEVER 883 -#define ID_ONTOP_ALWAYS 884 -#define ID_ONTOP_WHILEPLAYING 885 -#define ID_VIEW_OPTIONS 886 -#define ID_PLAY_PLAY 887 -#define ID_PLAY_PAUSE 888 -#define ID_PLAY_PLAYPAUSE 889 -#define ID_PLAY_STOP 890 -#define ID_PLAY_FRAMESTEP 891 -#define ID_PLAY_FRAMESTEPCANCEL 892 -#define ID_PLAY_GOTO 893 -#define ID_PLAY_DECRATE 894 -#define ID_PLAY_INCRATE 895 -#define ID_PLAY_RESETRATE 896 -#define ID_PLAY_SEEKKEYBACKWARD 897 -#define ID_PLAY_SEEKKEYFORWARD 898 -#define ID_PLAY_SEEKBACKWARDSMALL 899 -#define ID_PLAY_SEEKFORWARDSMALL 900 -#define ID_PLAY_SEEKBACKWARDMED 901 -#define ID_PLAY_SEEKFORWARDMED 902 -#define ID_PLAY_SEEKBACKWARDLARGE 903 -#define ID_PLAY_SEEKFORWARDLARGE 904 -#define ID_PLAY_INCAUDDELAY 905 -#define ID_PLAY_DECAUDDELAY 906 -#define ID_VOLUME_UP 907 -#define ID_VOLUME_DOWN 908 -#define ID_VOLUME_MUTE 909 -#define ID_VOLUME_MUTE_ON 910 -#define ID_VOLUME_MUTE_DISABLED 911 -#define ID_AFTERPLAYBACK_CLOSE 912 -#define ID_AFTERPLAYBACK_STANDBY 913 -#define ID_AFTERPLAYBACK_HIBERNATE 914 -#define ID_AFTERPLAYBACK_SHUTDOWN 915 -#define ID_AFTERPLAYBACK_LOGOFF 916 -#define ID_AFTERPLAYBACK_DONOTHING 917 -#define ID_NAVIGATE_SKIPBACKPLITEM 918 -#define ID_NAVIGATE_SKIPFORWARDPLITEM 919 -#define ID_NAVIGATE_SKIPBACK 920 -#define ID_NAVIGATE_SKIPFORWARD 921 -#define ID_NAVIGATE_TITLEMENU 922 -#define ID_NAVIGATE_ROOTMENU 923 -#define ID_NAVIGATE_SUBPICTUREMENU 924 -#define ID_NAVIGATE_AUDIOMENU 925 -#define ID_NAVIGATE_ANGLEMENU 926 -#define ID_NAVIGATE_CHAPTERMENU 927 -#define ID_NAVIGATE_MENU_LEFT 928 -#define ID_NAVIGATE_MENU_RIGHT 929 -#define ID_NAVIGATE_MENU_UP 930 -#define ID_NAVIGATE_MENU_DOWN 931 -#define ID_NAVIGATE_MENU_ACTIVATE 932 -#define ID_NAVIGATE_MENU_BACK 933 -#define ID_NAVIGATE_MENU_LEAVE 934 -#define ID_FAVORITES 935 -#define ID_FAVORITES_ORGANIZE 936 -#define ID_FAVORITES_ADD 937 -#define ID_HELP_HOMEPAGE 938 -#define ID_HELP_DOCUMENTATION 939 -#define ID_HELP_SHOWCOMMANDLINESWITCHES 940 -#define ID_HELP_ABOUT 942 -#define ID_BOSS 943 -#define ID_DUMMYSEPARATOR 944 -#define ID_BUTTONSEP 945 -#define ID_FILE_POST_OPENMEDIA 946 -#define ID_FILE_POST_CLOSEMEDIA 947 -#define ID_MENU_PLAYER_SHORT 948 -#define ID_MENU_PLAYER_LONG 949 -#define ID_MENU_FILTERS 950 -#define ID_STREAM_AUDIO_NEXT 951 -#define ID_STREAM_AUDIO_PREV 952 -#define ID_STREAM_SUB_NEXT 953 -#define ID_STREAM_SUB_PREV 954 -#define ID_STREAM_SUB_ONOFF 955 -#define ID_OGM_AUDIO_NEXT 956 -#define ID_OGM_AUDIO_PREV 957 -#define ID_OGM_SUB_NEXT 958 -#define ID_OGM_SUB_PREV 959 -#define ID_DVD_ANGLE_NEXT 960 -#define ID_DVD_ANGLE_PREV 961 -#define ID_DVD_AUDIO_NEXT 962 -#define ID_DVD_AUDIO_PREV 963 -#define ID_DVD_SUB_NEXT 964 -#define ID_DVD_SUB_PREV 965 -#define ID_DVD_SUB_ONOFF 966 -#define ID_VIEW_ZOOM_AUTOFIT 967 -#define ID_FILE_OPENQUICK 968 -#define ID_VOLUME_BOOST_INC 969 -#define ID_VOLUME_BOOST_DEC 970 -#define ID_VOLUME_BOOST_MIN 971 -#define ID_VOLUME_BOOST_MAX 972 -#define ID_FILTERS_SUBITEM_START 2000 -#define ID_FILTERS_SUBITEM_END 2099 -#define ID_FILTERSTREAMS_SUBITEM_START 2100 -#define ID_FILTERSTREAMS_SUBITEM_END 2199 -#define ID_AUDIO_SUBITEM_START 2200 -#define ID_AUDIO_SUBITEM_END 2299 -#define ID_SUBTITLES_SUBITEM_START 2300 -#define ID_SUBTITLES_SUBITEM_END 2399 -#define ID_NAVIGATE_CHAP_SUBITEM_START 2400 -#define ID_NAVIGATE_CHAP_SUBITEM_END 2499 -#define ID_NAVIGATE_AUDIO_SUBITEM_START 2500 -#define ID_NAVIGATE_AUDIO_SUBITEM_END 2599 -#define ID_NAVIGATE_SUBP_SUBITEM_START 2600 -#define ID_NAVIGATE_SUBP_SUBITEM_END 2699 -#define ID_NAVIGATE_ANGLE_SUBITEM_START 2700 -#define ID_NAVIGATE_ANGLE_SUBITEM_END 2799 -#define ID_FAVORITES_FILE_START 2800 -#define ID_FAVORITES_FILE_END 3799 -#define ID_FAVORITES_DVD_START 3800 -#define ID_FAVORITES_DVD_END 3899 -#define ID_FAVORITES_DEVICE_START 3900 -#define ID_FAVORITES_DEVICE_END 3999 -#define ID_FILE_OPEN_CD_START 4000 -#define ID_FILE_OPEN_CD_END 4099 -#define ID_PANNSCAN_PRESETS_START 4100 -#define ID_PANNSCAN_PRESETS_END 4199 -#define ID_SHADERS_START 4200 -#define ID_SHADERS_END 4299 -#define IDD_OPEN_DLG 10000 -#define IDD_OPENCAPDEVICE_DLG 10001 -#define IDD_MEDIATYPES_DLG 10002 -#define IDD_AUTH_DLG 10003 -#define IDD_SAVE_DLG 10004 -#define IDD_SUBTITLEDL_DLG 10005 -#define IDD_CONVERT_DLG 10006 -#define IDD_CONVERTPROPS_DLG 10007 -#define IDD_CONVERTRES_DLG 10008 -#define IDD_CONVERTCHAP_DLG 10009 -#define IDD_FILEPROPDETAILS 10010 -#define IDD_FILEPROPCLIP 10011 -#define IDD_SHADEREDITOR_DLG 10012 -#define IDD_SHADERAUTOCOMPLETE_DLG 10013 -#define IDD_SHADERCOMBINE_DLG 10014 -#define IDD_PNSPRESET_DLG 10015 -#define IDD_GOTO_DLG 10016 -#define IDD_FAVADD 10017 -#define IDD_FAVORGANIZE 10018 -#define IDD_ABOUTBOX 10019 -#define IDD_PLAYERINFOBAR 10020 -#define IDD_PLAYERSTATUSBAR 10021 -#define IDD_PLAYERSEEKBAR 10022 -#define IDD_PPAGEPLAYBACK 10023 -#define IDD_PPAGEPLAYER 10024 -#define IDD_PPAGEDVD 10025 -#define IDD_PPAGESUBTITLES 10026 -#define IDD_PPAGEFORMATS 10027 -#define IDD_PPAGETWEAKS 10028 -#define IDD_PPAGEAUDIOSWITCHER 10029 -#define IDD_PPAGEEXTERNALFILTERS 10030 -#define IDD_PPAGEACCELTBL 10032 -#define IDD_PPAGESUBSTYLE 10033 -#define IDD_PPAGEMOUSE 10034 -#define IDD_PPAGEINTERNALFILTERS 10036 -#define IDD_PPAGELOGO 10037 -#define IDD_PPAGEVIDREND 10038 -#define IDD_PPAGEOUTPUT 10039 -#define IDD_PPAGEWEBSERVER 10040 -#define IDD_PPAGEAUDIODEC 10041 -#define IDD_PPAGESUBDB 10042 -#define IDD_SAVETEXTFILEDIALOGTEMPL 10043 -#define IDD_SAVETEXTFILEDIALOGTEMPL_400 10044 -#define IDD_CAPTURE_DLG 10045 -#define IDD_ADDREGFILTER 10046 -#define IDD_SELECTMEDIATYPE 10047 -#define IDD_COMPROPERTYPAGE 10048 -#define IDD_FILEPROPRES 10049 -#define IDD_SAVETHUMBSDIALOGTEMPL 10050 -#define IDD_SAVETHUMBSDIALOGTEMPL_400 10051 -#define IDC_COMBO1 11000 -#define IDC_COMBO2 11001 -#define IDC_COMBO3 11002 -#define IDC_COMBO4 11003 -#define IDC_COMBO5 11004 -#define IDC_COMBO6 11005 -#define IDC_COMBO7 11006 -#define IDC_COMBO8 11007 -#define IDC_COMBO9 11008 -#define IDC_COMBO10 11009 -#define IDC_COMBO11 11010 -#define IDC_COMBO12 11011 -#define IDC_COMBO13 11012 -#define IDC_COMBO14 11013 -#define IDC_SLIDER1 11020 -#define IDC_SLIDER2 11021 -#define IDC_SLIDER3 11022 -#define IDC_SLIDER4 11023 -#define IDC_RADIO1 11040 -#define IDC_RADIO2 11041 -#define IDC_RADIO3 11042 -#define IDC_RADIO4 11043 -#define IDC_RADIO5 11044 -#define IDC_RADIO6 11045 -#define IDC_RADIO7 11046 -#define IDC_RADIO8 11047 -#define IDC_RADIO9 11048 -#define IDC_RADIO10 11049 -#define IDC_RADIO11 11050 -#define IDC_EDIT1 11060 -#define IDC_EDIT3 11061 -#define IDC_EDIT2 11062 -#define IDC_EDIT4 11063 -#define IDC_EDIT5 11064 -#define IDC_EDIT6 11065 -#define IDC_EDIT7 11066 -#define IDC_EDIT8 11067 -#define IDC_EDIT9 11068 -#define IDC_EDIT10 11069 -#define IDC_CHECK1 11080 -#define IDC_CHECK2 11081 -#define IDC_CHECK3 11082 -#define IDC_CHECK4 11083 -#define IDC_CHECK5 11084 -#define IDC_CHECK6 11085 -#define IDC_CHECK7 11086 -#define IDC_CHECK8 11087 -#define IDC_CHECK9 11088 -#define IDC_CHECK10 11089 -#define IDC_CHECK11 11090 -#define IDC_CHECK12 11091 -#define IDC_CHECK13 11092 -#define IDC_SPIN1 11100 -#define IDC_SPIN2 11101 -#define IDC_SPIN3 11102 -#define IDC_SPIN4 11103 -#define IDC_SPIN5 11104 -#define IDC_SPIN6 11105 -#define IDC_SPIN7 11106 -#define IDC_SPIN8 11107 -#define IDC_SPIN9 11108 -#define IDC_SPIN10 11109 -#define IDC_BUTTON1 11120 -#define IDC_BUTTON2 11121 -#define IDC_BUTTON3 11122 -#define IDC_BUTTON4 11123 -#define IDC_BUTTON5 11124 -#define IDC_BUTTON6 11125 -#define IDC_BUTTON7 11126 -#define IDC_BUTTON8 11127 -#define IDC_TREE1 11140 -#define IDC_TREE2 11141 -#define IDC_LIST1 11160 -#define IDC_LIST2 11180 -#define IDC_TAB1 11200 -#define IDC_ANIMATE1 11220 -#define IDC_PROGRESS1 11240 -#define IDC_STATIC1 11260 -#define IDC_STATIC2 11261 -#define IDC_STATIC3 11262 -#define IDC_STATIC4 11263 -#define IDC_DVDPATH 12000 -#define IDC_SUBRESYNCLIST 12001 -#define IDC_PLAYLIST 12002 -#define IDC_COLORPRI 12003 -#define IDC_COLORSEC 12004 -#define IDC_COLOROUTL 12005 -#define IDC_COLORSHAD 12006 -#define IDC_STATICLINK 12007 -#define IDC_STATICLINK2 12008 -#define IDC_DEFAULTICON 12009 -#define IDC_PLACEHOLDER 12010 -#define IDC_REPORT 12011 -#define IDC_FROMTO 12012 -#define IDC_TYPE 12013 -#define IDC_LOGOPREVIEW 12014 -#define IDC_LOGONAME 12015 -#define IDC_LOGOFILENAME 12016 -#define IDC_DESC 12017 -#define IDC_AUTHOR 12018 -#define IDC_CHECK_RELATIVETO 12019 -#define IDC_CHECK_SPCPOW2TEX 12020 -#define IDC_HLINE 12021 -#define IDC_STATICLINKGTS 12022 -#define IDC_BUTTON_EXT_SET 12023 -#define IDC_OK1 12024 -#define IDC_OK2 12025 -#define IDC_PLAYERSTATUS 12026 -#define IDC_PLAYERTIME 12027 -#define IDC_DSSYSDEF 12100 -#define IDC_DSOLD 12101 -#define IDC_DSOVERLAYMIXER 12102 -#define IDC_DSVMR7WIN 12103 -#define IDC_DSVMR9WIN 12104 -#define IDC_DSVMR7REN 12105 -#define IDC_DSVMR9REN 12106 -#define IDC_DSDXR 12107 -#define IDC_DSNULL_COMP 12108 -#define IDC_DSNULL_UNCOMP 12109 -#define IDC_RMSYSDEF 12120 -#define IDC_RMDX7 12121 -#define IDC_RMDX9 12122 -#define IDC_QTSYSDEF 12123 -#define IDC_QTDX7 12124 -#define IDC_QTDX9 12125 -#define IDC_REULARSURF 12126 -#define IDC_REGULARSURF 12127 -#define IDC_TEXTURESURF2D 12128 -#define IDC_TEXTURESURF3D 12129 -#define IDC_DX9RESIZER_COMBO 12130 -#define IDC_DSVMR9LOADMIXER 12131 -#define IDC_CHECK_MPEGINTERLACED 12132 -#define IDC_DSVMR9YUVMIXER 12133 -#define IDC_VERSION 12134 - -#define IDS_R_SETTINGS 13000 -#define IDS_RS_TITLEBARTEXTSTYLE 13001 -#define IDS_RS_USEWMASFREADER 13002 -#define IDS_RS_CONTROLSTATE 13003 -#define IDS_RS_VOLUME 13004 -#define IDS_RS_MUTE 13005 -#define IDS_RS_BALANCE 13006 -#define IDS_RS_LOOP 13007 -#define IDS_RS_LOOPNUM 13008 -#define IDS_RS_REWIND 13009 -#define IDS_RS_ZOOM 13010 -#define IDS_RS_HWACCEL 13011 -#define IDS_RS_MULTIINST 13012 -#define IDS_RS_ALWAYSONTOP 13013 -#define IDS_RS_AUTOZOOM 13014 -#define IDS_RS_FULLSCREENCTRLS 13015 -#define IDS_RS_FULLSCREENCTRLSTIMEOUT 13016 -#define IDS_RS_VMRFLIP 13017 -#define IDS_RS_DVDPATH 13018 -#define IDS_RS_USEDVDPATH 13019 -#define IDS_RS_MENULANG 13020 -#define IDS_RS_AUDIOLANG 13021 -#define IDS_RS_SUBTITLESLANG 13022 -#define IDS_RS_SPLOGFONT 13023 -#define IDS_RS_SPOUTLINE 13024 -#define IDS_RS_SPSHADOW 13025 -#define IDS_RS_SPSFGCOLOR 13026 -#define IDS_RS_SPOVERRIDEPLACEMENT 13027 -#define IDS_RS_SPHORPOS 13028 -#define IDS_RS_SPVERPOS 13029 -#define IDS_RS_SPCSIZE 13030 -#define IDS_RS_SPC16BPP 13031 -#define IDS_RS_SPCMAXRES 13032 -#define IDS_RS_SPCCOMPRESS 13033 -#define IDS_RS_INTREALMEDIA 13034 -#define IDS_RS_FAVORWAVEOUT 13035 -#define IDS_RS_DISABLEXPTOOLBARS 13036 -#define IDS_RS_USEDEDYNAMIC 13037 -#define IDS_RS_DBLCLICKFULLSCREEN 13038 -#define IDS_RS_EXITFULLSCREENATTHEEND 13039 -#define IDS_RS_AUTOSPEAKERCONF 13040 -#define IDS_RS_REMEMBERWINDOWPOS 13041 -#define IDS_RS_LASTWINDOWRECT 13042 -#define IDS_RS_AUDIORENDERERTYPE 13043 -#define IDS_RS_SPEAKERTOCHANNELMAPPING 13044 -#define IDS_RS_CUSTOMCHANNELMAPPING 13045 -#define IDS_RS_DOWNSAMPLETO441 13046 -#define IDS_RS_ENABLEAUDIOSWITCHER 13047 -#define IDS_RS_HIDECAPTIONMENU 13048 -#define IDS_R_FILTERS 13049 -#define IDS_RS_DEFAULTVIDEOFRAME 13050 -#define IDS_RS_REMEMBERWINDOWSIZE 13051 -#define IDS_RS_REALMEDIARENDERLESS 13052 -#define IDS_RS_QUICKTIMERENDERER 13053 -#define IDS_RS_REALMEDIAFPS 13054 -#define IDS_RS_AUDIOTIMESHIFT 13055 -#define IDS_RS_ENABLEAUDIOTIMESHIFT 13056 -#define IDS_R_FAVFILES 13057 -#define IDS_R_FAVDVDS 13058 -#define IDS_R_FAVDEVICES 13059 -#define IDS_RS_LOGOFILE 13060 -#define IDS_RS_ENABLEWORKERTHREADFOROPENING 13061 -#define IDS_RS_PNSPRESETS 13062 -#define IDS_RS_AUTOLOADAUDIO 13063 -#define IDS_RS_AUTOLOADSUBTITLES 13064 -#define IDS_RS_SEARCHKEYFRAMES 13065 -#define IDS_RS_ACCELTBL 13066 -#define IDS_RS_SETFULLSCREENRES 13067 -#define IDS_RS_FULLSCREENRES 13068 -#define IDS_RS_WINLIRCADDR 13069 -#define IDS_R_COMMANDS 13070 -#define IDS_RS_WINLIRC 13071 -#define IDS_RS_TRAYICON 13072 -#define IDS_RS_KEEPASPECTRATIO 13073 -#define IDS_RS_UICEADDR 13074 -#define IDS_RS_UICE 13075 -#define IDS_RS_JUMPDISTS 13076 -#define IDS_RS_JUMPDISTM 13077 -#define IDS_RS_JUMPDISTL 13078 -#define IDS_RS_REPORTFAILEDPINS 13079 -#define IDS_RS_SRCFILTERS 13080 -#define IDS_RS_KEEPHISTORY 13081 -#define IDS_RS_LOGOID 13082 -#define IDS_RS_LOGOEXT 13083 -#define IDS_RS_TRAFILTERS 13084 -#define IDS_RS_MPEGDI 13085 -#define IDS_RS_MPEGBRIGHT 13086 -#define IDS_RS_MPEGCONT 13087 -#define IDS_RS_MPEGHUE 13088 -#define IDS_RS_MPEGSAT 13089 -#define IDS_RS_MPEGFORCEDSUBS 13090 -#define IDS_RS_MPEGPLANARYUV 13091 -#define IDS_RS_COMPMONDESKARDIFF 13092 -#define IDS_RS_HIDECDROMSSUBMENU 13093 -#define IDS_RS_VMRTEXTURE 13094 -#define IDS_RS_VMR3D 13095 -#define IDS_RS_DSVIDEORENDERERTYPE 13096 -#define IDS_RS_RMVIDEORENDERERTYPE 13097 -#define IDS_RS_QTVIDEORENDERERTYPE 13098 -#define IDS_RS_APSURACEFUSAGE 13099 -#define IDS_R_LOGINS 13100 -#define IDS_RS_ENABLEWEBSERVER 13101 -#define IDS_RS_WEBSERVERPORT 13102 -#define IDS_RS_LASTWINDOWTYPE 13103 -#define IDS_RS_ONTOP 13104 -#define IDS_RS_MPASF 13105 -#define IDS_RS_AC3SC 13106 -#define IDS_RS_AC3DRC 13107 -#define IDS_RS_WEBSERVERPRINTDEBUGINFO 13108 -#define IDS_RS_WEBSERVERUSECOMPRESSION 13109 -#define IDS_RS_MPANORMALIZE 13110 -#define IDS_RS_DTSSC 13111 -#define IDS_RS_DTSDRC 13112 -#define IDS_RS_SNAPSHOTPATH 13113 -#define IDS_RS_PRIORITY 13114 -#define IDS_RS_SNAPSHOTEXT 13115 -#define IDS_RS_LAUNCHFULLSCREEN 13116 -#define IDS_RS_MPABOOST 13117 -#define IDS_RS_AACSC 13118 -#define IDS_RS_VMRSYNCFIX 13119 -#define IDS_RS_ISDB 13120 -#define IDS_RS_POW2TEX 13121 -#define IDS_R_INTERNAL_FILTERS 13122 -#define IDS_RS_WEBROOT 13123 -#define IDS_RS_WEBSERVERLOCALHOSTONLY 13124 -#define IDS_RS_ASPECTRATIO_X 13125 -#define IDS_RS_ASPECTRATIO_Y 13126 -#define IDS_RS_DX9_RESIZER 13127 -#define IDS_RS_WEBSERVERCGI 13128 -#define IDS_RS_WEBDEFINDEX 13129 -#define IDS_RS_FREEWINDOWRESIZING 13130 -#define IDS_RS_NOTIFYMSN 13131 -#define IDS_RS_NOTIFYGTSDLL 13132 -#define IDS_RS_VMR9MIXERMODE 13133 -#define IDS_RS_THUMBROWS 13134 -#define IDS_RS_THUMBCOLS 13135 -#define IDS_RS_SNAPTODESKTOPEDGES 13136 -#define IDS_RS_ENABLESUBTITLES 13137 -#define IDS_RS_MPEGINTERLACED 13138 -#define IDS_RS_THUMBWIDTH 13139 -#define IDS_RS_AUDIONORMALIZE 13140 -#define IDS_RS_AUDIOBOOST 13141 -#define IDS_RS_AUDIONORMALIZERECOVER 13142 -#define IDS_RS_VMR9MIXERYUV 13143 -#define IDS_RS_TITLEBARTEXTTITLE 13144 -#define IDS_RS_SHADERLIST 13145 -#define IDS_RS_BLOCKVSFILTER 13146 -#define IDS_SRC_RADGT 14000 -#define IDS_SRC_CDDA 14001 -#define IDS_SRC_AVI 14002 -#define IDS_SRC_CDXA 14003 -#define IDS_SRC_VTS 14004 -#define IDS_SRC_FLIC 14005 -#define IDS_SRC_D2V 14006 -#define IDS_SRC_DTSAC3 14007 -#define IDS_SRC_SHOUTCAST 14008 -#define IDS_SRC_REALMEDIA 14009 -#define IDS_SRC_MATROSKA 14010 -#define IDS_SRC_ROQ 14011 -#define IDS_SRC_OGG 14012 -#define IDS_SRC_NUT 14013 -#define IDS_SRC_DIRAC 14014 -#define IDS_SRC_DSM 14015 -#define IDS_SRC_MPA 14016 -#define IDS_SRC_MP4 14017 -#define IDS_TRA_RV 14018 -#define IDS_TRA_RA 14019 -#define IDS_TRA_MPEG1 14020 -#define IDS_TRA_MPEG2 14021 -#define IDS_TRA_MPA 14022 -#define IDS_TRA_LPCM 14023 -#define IDS_TRA_AC3 14024 -#define IDS_TRA_DTS 14025 -#define IDS_TRA_AAC 14026 -#define IDS_TRA_DIRAC 14027 -#define IDS_TRA_PS2AUD 14028 -#define IDS_SRC_FLV 14029 -#define IDS_VIDRENDDESC 14100 -#define IDS_CONVERT_ADDFILE 14101 -#define IDS_CONVERT_PROPERTIES 14102 -#define IDS_CONVERT_REMOVE 14103 -#define IDS_CONVERT_ENABLESTREAM 14104 -#define IDS_CONVERT_DISABLESTREAM 14105 -#define IDS_CONVERT_PINPROPERTIES 14106 -#define IDS_CONVERT_ADDRESOURCE 14107 -#define IDS_CONVERT_REMOVEALL 14108 -#define IDS_CONVERT_SAVEAS 14109 -#define IDS_CONVERT_RESOURCEPROPERTIES 14110 -#define IDS_CONVERT_LAUNCHINBROWSER 14111 -#define IDS_CONVERT_ADDCHAPTER 14112 -#define IDS_CONVERT_CHAPTERPROPERTIES 14113 -#define IDS_CONVERT_DEMUXSTREAM 14114 -#define IDS_PLAYLIST_OPEN 14115 -#define IDS_PLAYLIST_ADD 14116 -#define IDS_PLAYLIST_REMOVE 14117 -#define IDS_PLAYLIST_COPYTOCLIPBOARD 14118 -#define IDS_PLAYLIST_SAVEAS 14119 -#define IDS_PLAYLIST_SORTBYLABEL 14120 -#define IDS_PLAYLIST_SORTBYPATH 14121 -#define IDS_PLAYLIST_RANDOMIZE 14122 -#define IDS_PLAYLIST_RESTORE 14123 -#define IDS_SUBRESYNC_SEPARATOR 14124 -#define IDS_SUBRESYNC_DELETE 14125 -#define IDS_SUBRESYNC_DUPLICATE 14126 -#define IDS_SUBRESYNC_RESET 14127 -#define IDS_SUBRESYNC_ORIGINAL 14128 -#define IDS_SUBRESYNC_CURRENT 14129 -#define IDS_SUBRESYNC_EDIT 14130 -#define IDS_SUBRESYNC_YES 14131 -#define IDS_SUBRESYNC_NO 14132 -#define IDS_SUBRESYNC_DECREASE 14133 -#define IDS_SUBRESYNC_INCREASE 14134 -#define IDS_OPTIONS_CAPTION 14135 -#define IDS_SHADER_COMBINE 14136 -#define IDS_SHADER_OFF 14137 -#define IDS_SHADER_POPUP 14138 -#define IDS_FAVORITES_POPUP 14139 -#define IDS_JUMPTO_POPUP 14140 -#define IDS_VIDEOANGLE_POPUP 14141 -#define IDS_SUBTITLELANGUAGE_POPUP 14142 -#define IDS_AUDIOLANGUAGE_POPUP 14143 -#define IDS_SUBTITLES_POPUP 14144 -#define IDS_AUDIO_POPUP 14145 -#define IDS_FILTERS_POPUP 14146 -#define IDS_OPENCDROM_POPUP 14147 -#define IDS_NAVIGATE_POPUP 14148 -#define IDS_VIDEOFRAME_POPUP 14149 -#define IDS_PANSCAN_POPUP 14150 -#define IDS_ASPECTRATIO_POPUP 14151 -#define IDS_ZOOM_POPUP 14152 -#define IDS_FAVORITES_ADD 14153 -#define IDS_FAVORITES_ORGANIZE 14154 -#define IDS_PLAYLIST_SHUFFLE 14155 -#define IDS_PLAYLIST_REMEBERITEMS 14156 -#define IDS_CONTROLS_CLOSING 14157 -#define IDS_CONTROLS_PLAYING 14158 -#define IDS_CONTROLS_PAUSED 14159 -#define IDS_CONTROLS_STOPPED 14160 -#define IDS_CONTROLS_BUFFERING 14161 -#define IDS_CONTROLS_CAPTURING 14162 -#define IDS_CONTROLS_OPENING 14163 -#define IDS_CONTROLS_CLOSED 14164 -#define IDS_SUBTITLES_OPTIONS 14165 -#define IDS_SUBTITLES_STYLES 14166 -#define IDS_SUBTITLES_RELOAD 14167 -#define IDS_SUBTITLES_ENABLE 14168 -#define IDS_PANSCAN_EDIT 14169 -#define IDS_INFOBAR_TITLE 14170 -#define IDS_INFOBAR_AUTHOR 14171 -#define IDS_INFOBAR_COPYRIGHT 14172 -#define IDS_INFOBAR_RATING 14173 -#define IDS_INFOBAR_DESCRIPTION 14174 -#define IDS_INFOBAR_DOMAIN 14175 -#define IDS_INFOBAR_LOCATION 14176 -#define IDS_INFOBAR_VIDEO 14177 -#define IDS_INFOBAR_AUDIO 14178 -#define IDS_INFOBAR_SUBTITLES 14179 -#define IDS_CONTROLS_COMPLETING 14180 -#define IDS_AUTOPLAY_PLAYVIDEO 14181 -#define IDS_AUTOPLAY_PLAYMUSIC 14182 -#define IDS_AUTOPLAY_PLAYAUDIOCD 14183 -#define IDS_AUTOPLAY_PLAYDVDMOVIE 14184 -#define IDS_PROPSHEET_PROPERTIES 14185 -#define IDS_GRAPHBUILDER_AUDIOSWITCHER 14186 -#define IDS_SHADER_EDIT 14187 -#define IDS_FAVFILES 14188 -#define IDS_FAVDVDS 14189 -#define IDS_FAVDEVICES 14190 -#define ID_SUB_DELAY_DOWN 14191 -#define ID_SUB_DELAY_UP 14192 -#define IDS_RS_SUBDELAYINTERVAL 14193 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 20000 -#define _APS_NEXT_COMMAND_VALUE 32768 -#define _APS_NEXT_CONTROL_VALUE 22000 -#define _APS_NEXT_SYMED_VALUE 24000 -#endif -#endif diff --git a/src/filters/FilterApp.cpp b/src/filters/FilterApp.cpp deleted file mode 100644 index 30cc0da63..000000000 --- a/src/filters/FilterApp.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include "stdafx.h" -#include "FilterApp.h" - -extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID); - -CFilterApp::CFilterApp() -{ -} - -BOOL CFilterApp::InitInstance() -{ - if(!__super::InitInstance()) - return FALSE; - - SetRegistryKey(_T("Gabest")); - - DllEntryPoint(AfxGetInstanceHandle(), DLL_PROCESS_ATTACH, 0); - - return TRUE; -} - -BOOL CFilterApp::ExitInstance() -{ - DllEntryPoint(AfxGetInstanceHandle(), DLL_PROCESS_DETACH, 0); - - return __super::ExitInstance(); -} - -BEGIN_MESSAGE_MAP(CFilterApp, CWinApp) -END_MESSAGE_MAP() - diff --git a/src/filters/FilterApp.h b/src/filters/FilterApp.h deleted file mode 100644 index 0c95ee723..000000000 --- a/src/filters/FilterApp.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#pragma once - -class CFilterApp : public CWinApp -{ -public: - CFilterApp(); - - BOOL InitInstance(); - BOOL ExitInstance(); - - DECLARE_MESSAGE_MAP() -}; diff --git a/src/filters/InternalPropertyPage.cpp b/src/filters/InternalPropertyPage.cpp deleted file mode 100644 index 4231ab8ca..000000000 --- a/src/filters/InternalPropertyPage.cpp +++ /dev/null @@ -1,312 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include "stdafx.h" -#include "InternalPropertyPage.h" -#include "..\dsutil\dsutil.h" - -// -// CInternalPropertyPageWnd -// - -CInternalPropertyPageWnd::CInternalPropertyPageWnd() - : m_fDirty(false) - , m_fontheight(13) -{ -} - -BOOL CInternalPropertyPageWnd::Create(IPropertyPageSite* pPageSite, LPCRECT pRect, CWnd* pParentWnd) -{ - if(!pPageSite || !pRect) return FALSE; - - m_pPageSite = pPageSite; - - if(!m_font.m_hObject) - { - CString face; - WORD height; - extern BOOL AFXAPI AfxGetPropSheetFont(CString& strFace, WORD& wSize, BOOL bWizard); // yay - if(!AfxGetPropSheetFont(face, height, FALSE)) - return FALSE; - - LOGFONT lf; - memset(&lf, 0, sizeof(lf)); - _tcscpy(lf.lfFaceName, face); - HDC hDC = ::GetDC(0); - lf.lfHeight = -MulDiv(height, GetDeviceCaps(hDC, LOGPIXELSY), 72); - ::ReleaseDC(0, hDC); - lf.lfWeight = FW_NORMAL; - lf.lfCharSet = DEFAULT_CHARSET; - if(!m_font.CreateFontIndirect(&lf)) - return FALSE; - - lf.lfHeight -= -1; - _tcscpy(lf.lfFaceName, _T("Lucida Console")); - if(!m_monospacefont.CreateFontIndirect(&lf)) - { - _tcscpy(lf.lfFaceName, _T("Courier New")); - if(!m_monospacefont.CreateFontIndirect(&lf)) - return FALSE; - } - - hDC = ::GetDC(0); - HFONT hFontOld = (HFONT)::SelectObject(hDC, m_font.m_hObject); - CSize size; - ::GetTextExtentPoint32(hDC, _T("x"), 1, &size); - ::SelectObject(hDC, hFontOld); - ::ReleaseDC(0, hDC); - - m_fontheight = size.cy; - } - - LPCTSTR wc = AfxRegisterWndClass(CS_VREDRAW|CS_HREDRAW|CS_DBLCLKS, 0, (HBRUSH)(COLOR_BTNFACE + 1)); - if(!CreateEx(0, wc, _T("CInternalPropertyPageWnd"), WS_CHILDWINDOW, *pRect, pParentWnd, 0)) - return FALSE; - - SetFont(&m_font); - - return TRUE; -} - -BOOL CInternalPropertyPageWnd::OnWndMsg(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pResult) -{ - if(message == WM_COMMAND || message == WM_HSCROLL || message == WM_VSCROLL) - { - SetDirty(true); - } - - return __super::OnWndMsg(message, wParam, lParam, pResult); -} - -BEGIN_MESSAGE_MAP(CInternalPropertyPageWnd, CWnd) -END_MESSAGE_MAP() - -// -// CInternalPropertyPage -// - -CInternalPropertyPage::CInternalPropertyPage(LPUNKNOWN lpunk, HRESULT* phr) - : CUnknown(_T("CInternalPropertyPage"), lpunk) - , m_pWnd(NULL) -{ - if(phr) *phr = S_OK; -} - -CInternalPropertyPage::~CInternalPropertyPage() -{ - if(m_pWnd) - { - if(m_pWnd->m_hWnd) {ASSERT(0); m_pWnd->DestroyWindow();} - delete m_pWnd; - m_pWnd = NULL; - } -} - -STDMETHODIMP CInternalPropertyPage::NonDelegatingQueryInterface(REFIID riid, void** ppv) -{ - return - QI2(IPropertyPage) - __super::NonDelegatingQueryInterface(riid, ppv); -} - -// IPropertyPage - -STDMETHODIMP CInternalPropertyPage::SetPageSite(IPropertyPageSite* pPageSite) -{ - CAutoLock cAutoLock(this); - - if(pPageSite && m_pPageSite || !pPageSite && !m_pPageSite) - return E_UNEXPECTED; - - m_pPageSite = pPageSite; - - return S_OK; -} - -STDMETHODIMP CInternalPropertyPage::Activate(HWND hwndParent, LPCRECT pRect, BOOL fModal) -{ - AFX_MANAGE_STATE(AfxGetStaticModuleState()); - - CAutoLock cAutoLock(this); - - CheckPointer(pRect, E_POINTER); - - if(!m_pWnd || m_pWnd->m_hWnd || m_pUnks.IsEmpty()) - return E_UNEXPECTED; - - if(!m_pWnd->Create(m_pPageSite, pRect, CWnd::FromHandle(hwndParent))) - return E_OUTOFMEMORY; - - if(!m_pWnd->OnActivate()) - { - m_pWnd->DestroyWindow(); - return E_FAIL; - } - - m_pWnd->ModifyStyleEx(WS_EX_DLGMODALFRAME, WS_EX_CONTROLPARENT); - m_pWnd->ShowWindow(SW_SHOWNORMAL); - - return S_OK; -} - -STDMETHODIMP CInternalPropertyPage::Deactivate() -{ - AFX_MANAGE_STATE(AfxGetStaticModuleState()); - - CAutoLock cAutoLock(this); - - if(!m_pWnd || !m_pWnd->m_hWnd) - return E_UNEXPECTED; - - m_pWnd->OnDeactivate(); - - m_pWnd->ModifyStyleEx(WS_EX_CONTROLPARENT, 0); - m_pWnd->DestroyWindow(); - - return S_OK; -} - -STDMETHODIMP CInternalPropertyPage::GetPageInfo(PROPPAGEINFO* pPageInfo) -{ - CAutoLock cAutoLock(this); - - CheckPointer(pPageInfo, E_POINTER); - - LPOLESTR pszTitle; - HRESULT hr = AMGetWideString(CStringW(GetWindowTitle()), &pszTitle); - if(FAILED(hr)) return hr; - - pPageInfo->cb = sizeof(PROPPAGEINFO); - pPageInfo->pszTitle = pszTitle; - pPageInfo->pszDocString = NULL; - pPageInfo->pszHelpFile = NULL; - pPageInfo->dwHelpContext = 0; - pPageInfo->size = GetWindowSize(); - - return S_OK; -} - -STDMETHODIMP CInternalPropertyPage::SetObjects(ULONG cObjects, LPUNKNOWN* ppUnk) -{ - CAutoLock cAutoLock(this); - - if(cObjects && m_pWnd || !cObjects && !m_pWnd) - return E_UNEXPECTED; - - m_pUnks.RemoveAll(); - - if(cObjects > 0) - { - CheckPointer(ppUnk, E_POINTER); - - for(ULONG i = 0; i < cObjects; i++) - m_pUnks.AddTail(ppUnk[i]); - - if(!(m_pWnd = GetWindow())) - return E_OUTOFMEMORY; - - if(!m_pWnd->OnConnect(m_pUnks)) - { - delete m_pWnd; - m_pWnd = NULL; - - return E_FAIL; - } - } - else - { - m_pWnd->OnDisconnect(); - - m_pWnd->DestroyWindow(); - delete m_pWnd; - m_pWnd = NULL; - } - - return S_OK; -} - -STDMETHODIMP CInternalPropertyPage::Show(UINT nCmdShow) -{ - AFX_MANAGE_STATE(AfxGetStaticModuleState()); - - CAutoLock cAutoLock(this); - - if(!m_pWnd) return E_UNEXPECTED; - - if((nCmdShow != SW_SHOW) && (nCmdShow != SW_SHOWNORMAL) && (nCmdShow != SW_HIDE)) - return E_INVALIDARG; - - m_pWnd->ShowWindow(nCmdShow); - m_pWnd->Invalidate(); - - return S_OK; -} - -STDMETHODIMP CInternalPropertyPage::Move(LPCRECT pRect) -{ - AFX_MANAGE_STATE(AfxGetStaticModuleState()); - - CAutoLock cAutoLock(this); - - CheckPointer(pRect, E_POINTER); - - if(!m_pWnd) return E_UNEXPECTED; - - m_pWnd->MoveWindow(pRect, TRUE); - - return S_OK; -} - -STDMETHODIMP CInternalPropertyPage::IsPageDirty() -{ - CAutoLock cAutoLock(this); - - return m_pWnd && m_pWnd->GetDirty() ? S_OK : S_FALSE; -} - -STDMETHODIMP CInternalPropertyPage::Apply() -{ - AFX_MANAGE_STATE(AfxGetStaticModuleState()); - - CAutoLock cAutoLock(this); - - if(!m_pWnd || m_pUnks.IsEmpty() || !m_pPageSite) - return E_UNEXPECTED; - - if(m_pWnd->GetDirty() && m_pWnd->OnApply()) - m_pWnd->SetDirty(false); - - return S_OK; -} - -STDMETHODIMP CInternalPropertyPage::Help(LPCWSTR lpszHelpDir) -{ - CAutoLock cAutoLock(this); - - return E_NOTIMPL; -} - -STDMETHODIMP CInternalPropertyPage::TranslateAccelerator(LPMSG lpMsg) -{ - CAutoLock cAutoLock(this); - - return E_NOTIMPL; -} diff --git a/src/filters/InternalPropertyPage.h b/src/filters/InternalPropertyPage.h deleted file mode 100644 index c49f05aa7..000000000 --- a/src/filters/InternalPropertyPage.h +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#pragma once - -#include - -[uuid("03481710-D73E-4674-839F-03EDE2D60ED8")] -interface ISpecifyPropertyPages2 : public ISpecifyPropertyPages -{ - STDMETHOD (CreatePage) (const GUID& guid, IPropertyPage** ppPage) = 0; -}; - -class CInternalPropertyPageWnd : public CWnd -{ - bool m_fDirty; - CComPtr m_pPageSite; - -protected: - CFont m_font, m_monospacefont; - int m_fontheight; - - virtual BOOL OnWndMsg(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pResult); - -public: - CInternalPropertyPageWnd(); - - void SetDirty(bool fDirty = true) {m_fDirty = fDirty; if(fDirty && m_pPageSite) m_pPageSite->OnStatusChange(PROPPAGESTATUS_DIRTY);} - bool GetDirty() {return m_fDirty;} - - virtual BOOL Create(IPropertyPageSite* pPageSite, LPCRECT pRect, CWnd* pParentWnd); - - virtual bool OnConnect(const CInterfaceList& pUnks) {return true;} - virtual void OnDisconnect() {} - virtual bool OnActivate() {return true;} - virtual void OnDeactivate() {} - virtual bool OnApply() {return true;} - - DECLARE_MESSAGE_MAP() -}; - -class CInternalPropertyPage - : public CUnknown - , public IPropertyPage - , public CCritSec -{ - CComPtr m_pPageSite; - CInterfaceList m_pUnks; - CInternalPropertyPageWnd* m_pWnd; - -protected: - virtual CInternalPropertyPageWnd* GetWindow() = 0; - virtual LPCTSTR GetWindowTitle() = 0; - virtual CSize GetWindowSize() = 0; - -public: - CInternalPropertyPage(LPUNKNOWN lpunk, HRESULT* phr); - virtual ~CInternalPropertyPage(); - - DECLARE_IUNKNOWN; - STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv); - - // IPropertyPage - - STDMETHODIMP SetPageSite(IPropertyPageSite* pPageSite); - STDMETHODIMP Activate(HWND hwndParent, LPCRECT pRect, BOOL fModal); - STDMETHODIMP Deactivate(); - STDMETHODIMP GetPageInfo(PROPPAGEINFO* pPageInfo); - STDMETHODIMP SetObjects(ULONG cObjects, LPUNKNOWN* ppUnk); - STDMETHODIMP Show(UINT nCmdShow); - STDMETHODIMP Move(LPCRECT prect); - STDMETHODIMP IsPageDirty(); - STDMETHODIMP Apply(); - STDMETHODIMP Help(LPCWSTR lpszHelpDir); - STDMETHODIMP TranslateAccelerator(LPMSG lpMsg); -}; - -template -class CInternalPropertyPageTempl : public CInternalPropertyPage -{ - virtual CInternalPropertyPageWnd* GetWindow() - { - return new WndClass(); - } - - virtual LPCTSTR GetWindowTitle() - { - return WndClass::GetWindowTitle(); - } - - virtual CSize GetWindowSize() - { - return WndClass::GetWindowSize(); - } - -public: - CInternalPropertyPageTempl(LPUNKNOWN lpunk, HRESULT* phr) - : CInternalPropertyPage(lpunk, phr) - { - } -}; diff --git a/src/filters/PinInfoWnd.cpp b/src/filters/PinInfoWnd.cpp deleted file mode 100644 index 6dadd3eb6..000000000 --- a/src/filters/PinInfoWnd.cpp +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include "stdafx.h" -#include "PinInfoWnd.h" -#include "..\dsutil\dsutil.h" - -// -// CPinInfoWnd -// - -CPinInfoWnd::CPinInfoWnd() -{ -} - -bool CPinInfoWnd::OnConnect(const CInterfaceList& pUnks) -{ - ASSERT(!m_pBF); - - m_pBF.Release(); - - POSITION pos = pUnks.GetHeadPosition(); - while(pos && !(m_pBF = pUnks.GetNext(pos))); - - if(!m_pBF) return false; - - return true; -} - -void CPinInfoWnd::OnDisconnect() -{ - m_pBF.Release(); -} - -bool CPinInfoWnd::OnActivate() -{ - DWORD dwStyle = WS_VISIBLE|WS_CHILD|WS_TABSTOP; - - CPoint p(10, 10); - - m_pin_static.Create(_T("Pin:"), dwStyle, CRect(p + CPoint(0, 3), CSize(30, m_fontheight)), this); - m_pin_combo.Create(dwStyle|CBS_DROPDOWNLIST, CRect(p + CPoint(30, 0), CSize(450, 200)), this, IDC_PP_COMBO1); - BeginEnumPins(m_pBF, pEP, pPin) - { - CPinInfo pi; - if(FAILED(pPin->QueryPinInfo(&pi))) continue; - CString str = CString(pi.achName); - CString dir = _T("[?] "); - if(pi.dir == PINDIR_INPUT) dir = _T("[IN] "); - else if(pi.dir == PINDIR_OUTPUT) dir = _T("[OUT] "); - m_pin_combo.SetItemDataPtr(m_pin_combo.AddString(dir + str), pPin); - } - EndEnumPins - m_pin_combo.SetCurSel(0); - - p.y += m_fontheight + 20; - - m_info_edit.CreateEx(WS_EX_CLIENTEDGE, _T("EDIT"), _T(""), dwStyle|WS_BORDER|WS_VSCROLL|WS_HSCROLL|ES_MULTILINE|ES_AUTOHSCROLL|ES_READONLY, CRect(p, CSize(480, m_fontheight*20)), this, IDC_PP_EDIT1); - m_info_edit.SetLimitText(60000); - - OnCbnSelchangeCombo1(); - - for(CWnd* pWnd = GetWindow(GW_CHILD); pWnd; pWnd = pWnd->GetNextWindow()) - pWnd->SetFont(&m_font, FALSE); - - m_info_edit.SetFont(&m_monospacefont); - - return true; -} - -void CPinInfoWnd::OnDeactivate() -{ -} - -bool CPinInfoWnd::OnApply() -{ - OnDeactivate(); - - if(m_pBF) - { - } - - return true; -} - -BEGIN_MESSAGE_MAP(CPinInfoWnd, CInternalPropertyPageWnd) - ON_CBN_SELCHANGE(IDC_PP_COMBO1, OnCbnSelchangeCombo1) -END_MESSAGE_MAP() - -void CPinInfoWnd::AddLine(CString str) -{ - str.Replace(_T("\n"), _T("\r\n")); - int len = m_info_edit.GetWindowTextLength(); - m_info_edit.SetSel(len, len, TRUE); - m_info_edit.ReplaceSel(str); -} - -void CPinInfoWnd::OnCbnSelchangeCombo1() -{ - m_info_edit.SetWindowText(_T("")); - - int i = m_pin_combo.GetCurSel(); - if(i < 0) return; - - CComPtr pPin = (IPin*)m_pin_combo.GetItemDataPtr(i); - if(!pPin) return; - - CString str; - - PIN_INFO PinInfo; - if (SUCCEEDED (pPin->QueryPinInfo(&PinInfo))) - { - CString strName; - CLSID FilterClsid; - FILTER_INFO FilterInfo; - - if (SUCCEEDED (PinInfo.pFilter->QueryFilterInfo (&FilterInfo))) - { - CRegKey key; - PinInfo.pFilter->GetClassID(&FilterClsid); - if (ERROR_SUCCESS == key.Open (HKEY_CLASSES_ROOT, _T("CLSID\\{083863F1-70DE-11D0-BD40-00A0C911CE86}\\Instance\\") + CStringFromGUID(FilterClsid), KEY_READ)) - { - ULONG len; - TCHAR buff[128]; - len = countof(buff); - key.QueryStringValue(_T("FriendlyName"), buff, &len); - strName = CString (buff); - } - else - strName = FilterInfo.achName; - str.Format (_T("CLSID: %s\nFilter: %s\n\n"), CStringFromGUID(FilterClsid), strName); - AddLine(str); - FilterInfo.pGraph->Release(); - } - PinInfo.pFilter->Release(); - } - - CMediaTypeEx cmt; - - CComPtr pPinTo; - if(SUCCEEDED(pPin->ConnectedTo(&pPinTo)) && pPinTo) - { - str.Format(_T("- Connected to:\n\nCLSID: %s\nFilter: %s\nPin: %s\n\n"), - CString(CStringFromGUID(GetCLSID(pPinTo))), - CString(GetFilterName(GetFilterFromPin(pPinTo))), - CString(GetPinName(pPinTo))); - - AddLine(str); - - AddLine(_T("- Connection media type:\n\n")); - - if(SUCCEEDED(pPin->ConnectionMediaType(&cmt))) - { - CAtlList sl; - cmt.Dump(sl); - POSITION pos = sl.GetHeadPosition(); - while(pos) AddLine(sl.GetNext(pos) + '\n'); - } - } - else - { - str = _T("- Not connected\n\n"); - } - - int iMT = 0; - - BeginEnumMediaTypes(pPin, pEMT, pmt) - { - CMediaTypeEx mt(*pmt); - - str.Format(_T("- Enumerated media type %d:\n\n"), iMT++); - AddLine(str); - - if(cmt.majortype != GUID_NULL && mt == cmt) - { - AddLine(_T("Set as the current media type\n\n")); - } - else - { - CAtlList sl; - mt.Dump(sl); - POSITION pos = sl.GetHeadPosition(); - while(pos) AddLine(sl.GetNext(pos) + '\n'); - } - } - EndEnumMediaTypes(pmt) - - m_info_edit.SetSel(0, 0); -} \ No newline at end of file diff --git a/src/filters/PinInfoWnd.h b/src/filters/PinInfoWnd.h deleted file mode 100644 index 6efa4c56b..000000000 --- a/src/filters/PinInfoWnd.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#pragma once - -#include "InternalPropertyPage.h" -#include - -[uuid("A1EB391C-6089-4A87-9988-BE50872317D4")] -class CPinInfoWnd : public CInternalPropertyPageWnd -{ - CComQIPtr m_pBF; - - enum - { - IDC_PP_COMBO1 = 10000, - IDC_PP_EDIT1, - }; - - CStatic m_pin_static; - CComboBox m_pin_combo; - CEdit m_info_edit; - - void AddLine(CString str); - -public: - CPinInfoWnd(); - - bool OnConnect(const CInterfaceList& pUnks); - void OnDisconnect(); - bool OnActivate(); - void OnDeactivate(); - bool OnApply(); - - static LPCTSTR GetWindowTitle() {return _T("Pin Info");} - static CSize GetWindowSize() {return CSize(500, 300);} - - DECLARE_MESSAGE_MAP() - - void OnCbnSelchangeCombo1(); -}; \ No newline at end of file diff --git a/src/filters/filters.h b/src/filters/filters.h deleted file mode 100644 index ab41e7803..000000000 --- a/src/filters/filters.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (C) 2003-2006 Gabest. -// http://www.gabest.org -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit -// http://www.gnu.org/copyleft/gpl.html - -#include ".\reader\CDDAReader\CDDAReader.h" -#include ".\reader\CDXAReader\CDXAReader.h" -#include ".\reader\UDPReader\UDPReader.h" -#include ".\reader\VTSReader\VTSReader.h" -#include ".\source\D2VSource\D2VSource.h" -#include ".\source\DTSAC3Source\DTSAC3Source.h" -#include ".\source\FLICSource\FLICSource.h" -#include ".\source\ShoutcastSource\ShoutcastSource.h" -#include ".\source\SubtitleSource\SubtitleSource.h" -#include ".\switcher\AudioSwitcher\AudioSwitcher.h" -#include ".\transform\avi2ac3filter\AVI2AC3Filter.h" -#include ".\transform\BufferFilter\BufferFilter.h" -#include ".\transform\DeCSSFilter\DeCSSFilter.h" -#include ".\transform\Mpeg2DecFilter\Mpeg2DecFilter.h" -#include ".\transform\MpaDecFilter\MpaDecFilter.h" -#include ".\muxer\wavdest\wavdest.h" -#include ".\muxer\DSMMuxer\DSMMuxer.h" -#include ".\muxer\MatroskaMuxer\MatroskaMuxer.h" -#include ".\parser\StreamDriveThru\StreamDriveThru.h" -#include ".\parser\MatroskaSplitter\MatroskaSplitter.h" -#include ".\parser\RealMediaSplitter\RealMediaSplitter.h" -#include ".\parser\AviSplitter\AviSplitter.h" -//#include ".\parser\RadGtSplitter\RadGtSplitter.h" -#include ".\parser\RoQSplitter\RoQSplitter.h" -#include ".\parser\OggSplitter\OggSplitter.h" -//#include ".\parser\NutSplitter\NutSplitter.h" -#include ".\parser\MpegSplitter\MpegSplitter.h" -//#include ".\parser\DiracSplitter\DiracSplitter.h" -#include ".\parser\MpaSplitter\MpaSplitter.h" -#include ".\parser\DSMSplitter\DSMSplitter.h" -#include ".\parser\MP4Splitter\MP4Splitter.h" -#include ".\parser\FLVSplitter\FLVSplitter.h" -#include ".\parser\SSFSplitter\SSFSplitter.h" diff --git a/src/filters/stdafx.cpp b/src/filters/stdafx.cpp deleted file mode 100644 index fd94566f5..000000000 --- a/src/filters/stdafx.cpp +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -// stdafx.cpp : source file that includes just the standard includes -// misc.pch will be the pre-compiled header -// stdafx.obj will contain the pre-compiled type information - -#include "stdafx.h" - -// TODO: reference any additional headers you need in STDAFX.H -// and not in this file diff --git a/src/filters/stdafx.h b/src/filters/stdafx.h deleted file mode 100644 index 05f885264..000000000 --- a/src/filters/stdafx.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -// stdafx.h : include file for standard system include files, -// or project specific include files that are used frequently, but -// are changed infrequently -// - -#pragma once - -#include "../../../include/stdafx_common.h" -#include "../../../include/stdafx_common_afx.h" -#include "../../../include/stdafx_common_dshow.h" diff --git a/src/libpng/LICENSE b/src/libpng/LICENSE deleted file mode 100644 index 94b081878..000000000 --- a/src/libpng/LICENSE +++ /dev/null @@ -1,109 +0,0 @@ - -This copy of the libpng notices is provided for your convenience. In case of -any discrepancy between this copy and the notices in the file png.h that is -included in the libpng distribution, the latter shall prevail. - -COPYRIGHT NOTICE, DISCLAIMER, and LICENSE: - -If you modify libpng you may insert additional notices immediately following -this sentence. - -libpng versions 1.2.6, August 15, 2004, through 1.2.37, June 4, 2009, are -Copyright (c) 2004, 2006-2009 Glenn Randers-Pehrson, and are -distributed according to the same disclaimer and license as libpng-1.2.5 -with the following individual added to the list of Contributing Authors - - Cosmin Truta - -libpng versions 1.0.7, July 1, 2000, through 1.2.5 - October 3, 2002, are -Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are -distributed according to the same disclaimer and license as libpng-1.0.6 -with the following individuals added to the list of Contributing Authors - - Simon-Pierre Cadieux - Eric S. Raymond - Gilles Vollant - -and with the following additions to the disclaimer: - - There is no warranty against interference with your enjoyment of the - library or against infringement. There is no warranty that our - efforts or the library will fulfill any of your particular purposes - or needs. This library is provided with all faults, and the entire - risk of satisfactory quality, performance, accuracy, and effort is with - the user. - -libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are -Copyright (c) 1998, 1999 Glenn Randers-Pehrson, and are -distributed according to the same disclaimer and license as libpng-0.96, -with the following individuals added to the list of Contributing Authors: - - Tom Lane - Glenn Randers-Pehrson - Willem van Schaik - -libpng versions 0.89, June 1996, through 0.96, May 1997, are -Copyright (c) 1996, 1997 Andreas Dilger -Distributed according to the same disclaimer and license as libpng-0.88, -with the following individuals added to the list of Contributing Authors: - - John Bowler - Kevin Bracey - Sam Bushell - Magnus Holmgren - Greg Roelofs - Tom Tanner - -libpng versions 0.5, May 1995, through 0.88, January 1996, are -Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. - -For the purposes of this copyright and license, "Contributing Authors" -is defined as the following set of individuals: - - Andreas Dilger - Dave Martindale - Guy Eric Schalnat - Paul Schmidt - Tim Wegner - -The PNG Reference Library is supplied "AS IS". The Contributing Authors -and Group 42, Inc. disclaim all warranties, expressed or implied, -including, without limitation, the warranties of merchantability and of -fitness for any purpose. The Contributing Authors and Group 42, Inc. -assume no liability for direct, indirect, incidental, special, exemplary, -or consequential damages, which may result from the use of the PNG -Reference Library, even if advised of the possibility of such damage. - -Permission is hereby granted to use, copy, modify, and distribute this -source code, or portions hereof, for any purpose, without fee, subject -to the following restrictions: - -1. The origin of this source code must not be misrepresented. - -2. Altered versions must be plainly marked as such and must not - be misrepresented as being the original source. - -3. This Copyright notice may not be removed or altered from any - source or altered source distribution. - -The Contributing Authors and Group 42, Inc. specifically permit, without -fee, and encourage the use of this source code as a component to -supporting the PNG file format in commercial products. If you use this -source code in a product, acknowledgment is not required but would be -appreciated. - - -A "png_get_copyright" function is available, for convenient use in "about" -boxes and the like: - - printf("%s",png_get_copyright(NULL)); - -Also, the PNG logo (in PNG format, of course) is supplied in the -files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31). - -Libpng is OSI Certified Open Source Software. OSI Certified Open Source is a -certification mark of the Open Source Initiative. - -Glenn Randers-Pehrson -glennrp at users.sourceforge.net -June 4, 2009 diff --git a/src/libpng/README b/src/libpng/README deleted file mode 100644 index 06fb4c306..000000000 --- a/src/libpng/README +++ /dev/null @@ -1,267 +0,0 @@ -README for libpng version 1.2.37 - June 4, 2009 (shared library 12.0) -See the note about version numbers near the top of png.h - -See INSTALL for instructions on how to install libpng. - -Libpng comes in several distribution formats. Get libpng-*.tar.gz, -libpng-*.tar.lzma, or libpng-*.tar.bz2 if you want UNIX-style line -endings in the text files, or lpng*.7z or lpng*.zip if you want DOS-style -line endings. You can get UNIX-style line endings from the *.zip file -by using "unzip -a" but there seems to be no simple way to recover -UNIX-style line endings from the *.7z file. The *.tar.lzma file is -recommended for *NIX users instead. - -Version 0.89 was the first official release of libpng. Don't let the -fact that it's the first release fool you. The libpng library has been in -extensive use and testing since mid-1995. By late 1997 it had -finally gotten to the stage where there hadn't been significant -changes to the API in some time, and people have a bad feeling about -libraries with versions < 1.0. Version 1.0.0 was released in -March 1998. - -**** -Note that some of the changes to the png_info structure render this -version of the library binary incompatible with libpng-0.89 or -earlier versions if you are using a shared library. The type of the -"filler" parameter for png_set_filler() has changed from png_byte to -png_uint_32, which will affect shared-library applications that use -this function. - -To avoid problems with changes to the internals of png_info_struct, -new APIs have been made available in 0.95 to avoid direct application -access to info_ptr. These functions are the png_set_ and -png_get_ functions. These functions should be used when -accessing/storing the info_struct data, rather than manipulating it -directly, to avoid such problems in the future. - -It is important to note that the APIs do not make current programs -that access the info struct directly incompatible with the new -library. However, it is strongly suggested that new programs use -the new APIs (as shown in example.c and pngtest.c), and older programs -be converted to the new format, to facilitate upgrades in the future. -**** - -Additions since 0.90 include the ability to compile libpng as a -Windows DLL, and new APIs for accessing data in the info struct. -Experimental functions include the ability to set weighting and cost -factors for row filter selection, direct reads of integers from buffers -on big-endian processors that support misaligned data access, faster -methods of doing alpha composition, and more accurate 16->8 bit color -conversion. - -The additions since 0.89 include the ability to read from a PNG stream -which has had some (or all) of the signature bytes read by the calling -application. This also allows the reading of embedded PNG streams that -do not have the PNG file signature. As well, it is now possible to set -the library action on the detection of chunk CRC errors. It is possible -to set different actions based on whether the CRC error occurred in a -critical or an ancillary chunk. - -The changes made to the library, and bugs fixed are based on discussions -on the png-mng-implement mailing list -and not on material submitted privately to Guy, Andreas, or Glenn. They will -forward any good suggestions to the list. - -For a detailed description on using libpng, read libpng.txt. For -examples of libpng in a program, see example.c and pngtest.c. For usage -information and restrictions (what little they are) on libpng, see -png.h. For a description on using zlib (the compression library used by -libpng) and zlib's restrictions, see zlib.h - -I have included a general makefile, as well as several machine and -compiler specific ones, but you may have to modify one for your own needs. - -You should use zlib 1.0.4 or later to run this, but it MAY work with -versions as old as zlib 0.95. Even so, there are bugs in older zlib -versions which can cause the output of invalid compression streams for -some images. You will definitely need zlib 1.0.4 or later if you are -taking advantage of the MS-DOS "far" structure allocation for the small -and medium memory models. You should also note that zlib is a -compression library that is useful for more things than just PNG files. -You can use zlib as a drop-in replacement for fread() and fwrite() if -you are so inclined. - -zlib should be available at the same place that libpng is, or at -ftp://ftp.simplesystems.org/pub/png/src/ - -You may also want a copy of the PNG specification. It is available -as an RFC, a W3C Recommendation, and an ISO/IEC Standard. You can find -these at http://www.libpng.org/pub/png/pngdocs.html - -This code is currently being archived at libpng.sf.net in the -[DOWNLOAD] area, and on CompuServe, Lib 20 (PNG SUPPORT) -at GO GRAPHSUP. If you can't find it in any of those places, -e-mail me, and I'll help you find it. - -If you have any code changes, requests, problems, etc., please e-mail -them to me. Also, I'd appreciate any make files or project files, -and any modifications you needed to make to get libpng to compile, -along with a #define variable to tell what compiler/system you are on. -If you needed to add transformations to libpng, or wish libpng would -provide the image in a different way, drop me a note (and code, if -possible), so I can consider supporting the transformation. -Finally, if you get any warning messages when compiling libpng -(note: not zlib), and they are easy to fix, I'd appreciate the -fix. Please mention "libpng" somewhere in the subject line. Thanks. - -This release was created and will be supported by myself (of course -based in a large way on Guy's and Andreas' earlier work), and the PNG group. - -Send comments/corrections/commendations to png-mng-implement at lists.sf.net -(subscription required; visit -https://lists.sourceforge.net/lists/listinfo/png-mng-implement -to subscribe) or to glennrp at users.sourceforge.net - -You can't reach Guy, the original libpng author, at the addresses -given in previous versions of this document. He and Andreas will read mail -addressed to the png-mng-implement list, however. - -Please do not send general questions about PNG. Send them to -the (png-mng-misc at lists.sourceforge.net, subscription required, visit -https://lists.sourceforge.net/lists/listinfo/png-mng-implement to subscribe) -On the other hand, -please do not send libpng questions to that address, send them to me -or to the png-mng-implement list. I'll -get them in the end anyway. If you have a question about something -in the PNG specification that is related to using libpng, send it -to me. Send me any questions that start with "I was using libpng, -and ...". If in doubt, send questions to me. I'll bounce them -to others, if necessary. - -Please do not send suggestions on how to change PNG. We have -been discussing PNG for twelve years now, and it is official and -finished. If you have suggestions for libpng, however, I'll -gladly listen. Even if your suggestion is not used immediately, -it may be used later. - -Files in this distribution: - - ANNOUNCE => Announcement of this version, with recent changes - CHANGES => Description of changes between libpng versions - KNOWNBUG => List of known bugs and deficiencies - LICENSE => License to use and redistribute libpng - README => This file - TODO => Things not implemented in the current library - Y2KINFO => Statement of Y2K compliance - example.c => Example code for using libpng functions - libpng-*-*-diff.txt => Diff from previous release - libpng.3 => manual page for libpng (includes libpng.txt) - libpng.txt => Description of libpng and its functions - libpngpf.3 => manual page for libpng's private functions - png.5 => manual page for the PNG format - png.c => Basic interface functions common to library - png.h => Library function and interface declarations - pngconf.h => System specific library configuration - pngerror.c => Error/warning message I/O functions - pngget.c => Functions for retrieving info from struct - pngmem.c => Memory handling functions - pngbar.png => PNG logo, 88x31 - pngnow.png => PNG logo, 98x31 - pngpread.c => Progressive reading functions - pngread.c => Read data/helper high-level functions - pngrio.c => Lowest-level data read I/O functions - pngrtran.c => Read data transformation functions - pngrutil.c => Read data utility functions - pngset.c => Functions for storing data into the info_struct - pngtest.c => Library test program - pngtest.png => Library test sample image - pngtrans.c => Common data transformation functions - pngwio.c => Lowest-level write I/O functions - pngwrite.c => High-level write functions - pngwtran.c => Write data transformations - pngwutil.c => Write utility functions - contrib => Contributions - gregbook => source code for PNG reading and writing, from - Greg Roelofs' "PNG: The Definitive Guide", - O'Reilly, 1999 - msvctest => Builds and runs pngtest using a MSVC workspace - pngminus => Simple pnm2png and png2pnm programs - pngsuite => Test images - visupng => Contains a MSVC workspace for VisualPng - projects => Contains project files and workspaces for building DLL - beos => Contains a Beos workspace for building libpng - c5builder => Contains a Borland workspace for building libpng - and zlib - visualc6 => Contains a Microsoft Visual C++ (MSVC) workspace - for building libpng and zlib - netware.txt => Contains instructions for downloading a set of - project files for building libpng and zlib on - Netware. - wince.txt => Contains instructions for downloading a Microsoft - Visual C++ (Windows CD Toolkit) workspace for - building libpng and zlib on WindowsCE - scripts => Directory containing scripts for building libpng: - descrip.mms => VMS makefile for MMS or MMK - makefile.std => Generic UNIX makefile (cc, creates static libpng.a) - makefile.elf => Linux/ELF makefile symbol versioning, - gcc, creates libpng12.so.0.1.2.37) - makefile.linux => Linux/ELF makefile - (gcc, creates libpng12.so.0.1.2.37) - makefile.gcmmx => Linux/ELF makefile - (gcc, creates libpng12.so.0.1.2.37, - uses assembler code tuned for Intel MMX platform) - makefile.gcc => Generic makefile (gcc, creates static libpng.a) - makefile.knr => Archaic UNIX Makefile that converts files with - ansi2knr (Requires ansi2knr.c from - ftp://ftp.cs.wisc.edu/ghost) - makefile.aix => AIX makefile - makefile.cygwin => Cygwin/gcc makefile - makefile.darwin => Darwin makefile - makefile.dec => DEC Alpha UNIX makefile - makefile.freebsd => FreeBSD makefile - makefile.hpgcc => HPUX makefile using gcc - makefile.hpux => HPUX (10.20 and 11.00) makefile - makefile.hp64 => HPUX (10.20 and 11.00) makefile, 64 bit - makefile.ibmc => IBM C/C++ version 3.x for Win32 and OS/2 (static) - makefile.intel => Intel C/C++ version 4.0 and later - libpng.icc => Project file, IBM VisualAge/C++ 4.0 or later - makefile.netbsd => NetBSD/cc makefile, PNGGCCRD, makes libpng.so. - makefile.ne12bsd => NetBSD/cc makefile, PNGGCCRD, makes libpng12.so - makefile.openbsd => OpenBSD makefile - makefile.sgi => Silicon Graphics IRIX (cc, creates static lib) - makefile.sggcc => Silicon Graphics - (gcc, creates libpng12.so.0.1.2.37) - makefile.sunos => Sun makefile - makefile.solaris => Solaris 2.X makefile - (gcc, creates libpng12.so.0.1.2.37) - makefile.so9 => Solaris 9 makefile - (gcc, creates libpng12.so.0.1.2.37) - makefile.32sunu => Sun Ultra 32-bit makefile - makefile.64sunu => Sun Ultra 64-bit makefile - makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc - makefile.mips => MIPS makefile - makefile.acorn => Acorn makefile - makefile.amiga => Amiga makefile - smakefile.ppc => AMIGA smakefile for SAS C V6.58/7.00 PPC - compiler (Requires SCOPTIONS, copied from - scripts/SCOPTIONS.ppc) - makefile.atari => Atari makefile - makefile.beos => BEOS makefile for X86 - makefile.bor => Borland makefile (uses bcc) - makefile.bc32 => 32-bit Borland C++ (all modules compiled in C mode) - makefile.tc3 => Turbo C 3.0 makefile - makefile.dj2 => DJGPP 2 makefile - makefile.msc => Microsoft C makefile - makefile.vcawin32=> makefile for Microsoft Visual C++ 5.0 and - later (uses assembler code tuned for Intel MMX - platform) - makefile.vcwin32 => makefile for Microsoft Visual C++ 4.0 and - later (does not use assembler code) - makefile.os2 => OS/2 Makefile (gcc and emx, requires pngos2.def) - pngos2.def => OS/2 module definition file used by makefile.os2 - makefile.watcom => Watcom 10a+ Makefile, 32-bit flat memory model - makevms.com => VMS build script - SCOPTIONS.ppc => Used with smakefile.ppc - -Good luck, and happy coding. - --Glenn Randers-Pehrson (current maintainer) - Internet: glennrp at users.sourceforge.net - --Andreas Eric Dilger (former maintainer, 1996-1997) - Internet: adilger at enel.ucalgary.ca - Web: http://members.shaw.ca/adilger/ - --Guy Eric Schalnat (original author and former maintainer, 1995-1996) - (formerly of Group 42, Inc) - Internet: gschal at infinet.com diff --git a/src/libpng/libpng.txt b/src/libpng/libpng.txt deleted file mode 100644 index a4697a878..000000000 --- a/src/libpng/libpng.txt +++ /dev/null @@ -1,3115 +0,0 @@ -libpng.txt - A description on how to use and modify libpng - - libpng version 1.2.37 - June 4, 2009 - Updated and distributed by Glenn Randers-Pehrson - - Copyright (c) 1998-2009 Glenn Randers-Pehrson - For conditions of distribution and use, see copyright - notice in png.h. - - Based on: - - libpng versions 0.97, January 1998, through 1.2.37 - June 4, 2009 - Updated and distributed by Glenn Randers-Pehrson - Copyright (c) 1998-2009 Glenn Randers-Pehrson - - libpng 1.0 beta 6 version 0.96 May 28, 1997 - Updated and distributed by Andreas Dilger - Copyright (c) 1996, 1997 Andreas Dilger - - libpng 1.0 beta 2 - version 0.88 January 26, 1996 - For conditions of distribution and use, see copyright - notice in png.h. Copyright (c) 1995, 1996 Guy Eric - Schalnat, Group 42, Inc. - - Updated/rewritten per request in the libpng FAQ - Copyright (c) 1995, 1996 Frank J. T. Wojcik - December 18, 1995 & January 20, 1996 - -I. Introduction - -This file describes how to use and modify the PNG reference library -(known as libpng) for your own use. There are five sections to this -file: introduction, structures, reading, writing, and modification and -configuration notes for various special platforms. In addition to this -file, example.c is a good starting point for using the library, as -it is heavily commented and should include everything most people -will need. We assume that libpng is already installed; see the -INSTALL file for instructions on how to install libpng. - -For examples of libpng usage, see the files "example.c", "pngtest.c", -and the files in the "contrib" directory, all of which are included in the -libpng distribution. - -Libpng was written as a companion to the PNG specification, as a way -of reducing the amount of time and effort it takes to support the PNG -file format in application programs. - -The PNG specification (second edition), November 2003, is available as -a W3C Recommendation and as an ISO Standard (ISO/IEC 15948:2003 (E)) at -. It is technically equivalent -to the PNG specification (second edition) but has some additional material. - -The PNG-1.0 specification is available -as RFC 2083 and as a -W3C Recommendation . - -Some additional chunks are described in the special-purpose public chunks -documents at . - -Other information -about PNG, and the latest version of libpng, can be found at the PNG home -page, . - -Most users will not have to modify the library significantly; advanced -users may want to modify it more. All attempts were made to make it as -complete as possible, while keeping the code easy to understand. -Currently, this library only supports C. Support for other languages -is being considered. - -Libpng has been designed to handle multiple sessions at one time, -to be easily modifiable, to be portable to the vast majority of -machines (ANSI, K&R, 16-, 32-, and 64-bit) available, and to be easy -to use. The ultimate goal of libpng is to promote the acceptance of -the PNG file format in whatever way possible. While there is still -work to be done (see the TODO file), libpng should cover the -majority of the needs of its users. - -Libpng uses zlib for its compression and decompression of PNG files. -Further information about zlib, and the latest version of zlib, can -be found at the zlib home page, . -The zlib compression utility is a general purpose utility that is -useful for more than PNG files, and can be used without libpng. -See the documentation delivered with zlib for more details. -You can usually find the source files for the zlib utility wherever you -find the libpng source files. - -Libpng is thread safe, provided the threads are using different -instances of the structures. Each thread should have its own -png_struct and png_info instances, and thus its own image. -Libpng does not protect itself against two threads using the -same instance of a structure. - -II. Structures - -There are two main structures that are important to libpng, png_struct -and png_info. The first, png_struct, is an internal structure that -will not, for the most part, be used by a user except as the first -variable passed to every libpng function call. - -The png_info structure is designed to provide information about the -PNG file. At one time, the fields of png_info were intended to be -directly accessible to the user. However, this tended to cause problems -with applications using dynamically loaded libraries, and as a result -a set of interface functions for png_info (the png_get_*() and png_set_*() -functions) was developed. The fields of png_info are still available for -older applications, but it is suggested that applications use the new -interfaces if at all possible. - -Applications that do make direct access to the members of png_struct (except -for png_ptr->jmpbuf) must be recompiled whenever the library is updated, -and applications that make direct access to the members of png_info must -be recompiled if they were compiled or loaded with libpng version 1.0.6, -in which the members were in a different order. In version 1.0.7, the -members of the png_info structure reverted to the old order, as they were -in versions 0.97c through 1.0.5. Starting with version 2.0.0, both -structures are going to be hidden, and the contents of the structures will -only be accessible through the png_get/png_set functions. - -The png.h header file is an invaluable reference for programming with libpng. -And while I'm on the topic, make sure you include the libpng header file: - -#include - -III. Reading - -We'll now walk you through the possible functions to call when reading -in a PNG file sequentially, briefly explaining the syntax and purpose -of each one. See example.c and png.h for more detail. While -progressive reading is covered in the next section, you will still -need some of the functions discussed in this section to read a PNG -file. - -Setup - -You will want to do the I/O initialization(*) before you get into libpng, -so if it doesn't work, you don't have much to undo. Of course, you -will also want to insure that you are, in fact, dealing with a PNG -file. Libpng provides a simple check to see if a file is a PNG file. -To use it, pass in the first 1 to 8 bytes of the file to the function -png_sig_cmp(), and it will return 0 (false) if the bytes match the -corresponding bytes of the PNG signature, or nonzero (true) otherwise. -Of course, the more bytes you pass in, the greater the accuracy of the -prediction. - -If you are intending to keep the file pointer open for use in libpng, -you must ensure you don't read more than 8 bytes from the beginning -of the file, and you also have to make a call to png_set_sig_bytes_read() -with the number of bytes you read from the beginning. Libpng will -then only check the bytes (if any) that your program didn't read. - -(*): If you are not using the standard I/O functions, you will need -to replace them with custom functions. See the discussion under -Customizing libpng. - - - FILE *fp = fopen(file_name, "rb"); - if (!fp) - { - return (ERROR); - } - fread(header, 1, number, fp); - is_png = !png_sig_cmp(header, 0, number); - if (!is_png) - { - return (NOT_PNG); - } - - -Next, png_struct and png_info need to be allocated and initialized. In -order to ensure that the size of these structures is correct even with a -dynamically linked libpng, there are functions to initialize and -allocate the structures. We also pass the library version, optional -pointers to error handling functions, and a pointer to a data struct for -use by the error functions, if necessary (the pointer and functions can -be NULL if the default error handlers are to be used). See the section -on Changes to Libpng below regarding the old initialization functions. -The structure allocation functions quietly return NULL if they fail to -create the structure, so your application should check for that. - - png_structp png_ptr = png_create_read_struct - (PNG_LIBPNG_VER_STRING, (png_voidp)user_error_ptr, - user_error_fn, user_warning_fn); - if (!png_ptr) - return (ERROR); - - png_infop info_ptr = png_create_info_struct(png_ptr); - if (!info_ptr) - { - png_destroy_read_struct(&png_ptr, - (png_infopp)NULL, (png_infopp)NULL); - return (ERROR); - } - - png_infop end_info = png_create_info_struct(png_ptr); - if (!end_info) - { - png_destroy_read_struct(&png_ptr, &info_ptr, - (png_infopp)NULL); - return (ERROR); - } - -If you want to use your own memory allocation routines, -define PNG_USER_MEM_SUPPORTED and use -png_create_read_struct_2() instead of png_create_read_struct(): - - png_structp png_ptr = png_create_read_struct_2 - (PNG_LIBPNG_VER_STRING, (png_voidp)user_error_ptr, - user_error_fn, user_warning_fn, (png_voidp) - user_mem_ptr, user_malloc_fn, user_free_fn); - -The error handling routines passed to png_create_read_struct() -and the memory alloc/free routines passed to png_create_struct_2() -are only necessary if you are not using the libpng supplied error -handling and memory alloc/free functions. - -When libpng encounters an error, it expects to longjmp back -to your routine. Therefore, you will need to call setjmp and pass -your png_jmpbuf(png_ptr). If you read the file from different -routines, you will need to update the jmpbuf field every time you enter -a new routine that will call a png_*() function. - -See your documentation of setjmp/longjmp for your compiler for more -information on setjmp/longjmp. See the discussion on libpng error -handling in the Customizing Libpng section below for more information -on the libpng error handling. If an error occurs, and libpng longjmp's -back to your setjmp, you will want to call png_destroy_read_struct() to -free any memory. - - if (setjmp(png_jmpbuf(png_ptr))) - { - png_destroy_read_struct(&png_ptr, &info_ptr, - &end_info); - fclose(fp); - return (ERROR); - } - -If you would rather avoid the complexity of setjmp/longjmp issues, -you can compile libpng with PNG_SETJMP_NOT_SUPPORTED, in which case -errors will result in a call to PNG_ABORT() which defaults to abort(). - -Now you need to set up the input code. The default for libpng is to -use the C function fread(). If you use this, you will need to pass a -valid FILE * in the function png_init_io(). Be sure that the file is -opened in binary mode. If you wish to handle reading data in another -way, you need not call the png_init_io() function, but you must then -implement the libpng I/O methods discussed in the Customizing Libpng -section below. - - png_init_io(png_ptr, fp); - -If you had previously opened the file and read any of the signature from -the beginning in order to see if this was a PNG file, you need to let -libpng know that there are some bytes missing from the start of the file. - - png_set_sig_bytes(png_ptr, number); - -Setting up callback code - -You can set up a callback function to handle any unknown chunks in the -input stream. You must supply the function - - read_chunk_callback(png_ptr ptr, - png_unknown_chunkp chunk); - { - /* The unknown chunk structure contains your - chunk data, along with similar data for any other - unknown chunks: */ - - png_byte name[5]; - png_byte *data; - png_size_t size; - - /* Note that libpng has already taken care of - the CRC handling */ - - /* put your code here. Search for your chunk in the - unknown chunk structure, process it, and return one - of the following: */ - - return (-n); /* chunk had an error */ - return (0); /* did not recognize */ - return (n); /* success */ - } - -(You can give your function another name that you like instead of -"read_chunk_callback") - -To inform libpng about your function, use - - png_set_read_user_chunk_fn(png_ptr, user_chunk_ptr, - read_chunk_callback); - -This names not only the callback function, but also a user pointer that -you can retrieve with - - png_get_user_chunk_ptr(png_ptr); - -If you call the png_set_read_user_chunk_fn() function, then all unknown -chunks will be saved when read, in case your callback function will need -one or more of them. This behavior can be changed with the -png_set_keep_unknown_chunks() function, described below. - -At this point, you can set up a callback function that will be -called after each row has been read, which you can use to control -a progress meter or the like. It's demonstrated in pngtest.c. -You must supply a function - - void read_row_callback(png_ptr ptr, png_uint_32 row, - int pass); - { - /* put your code here */ - } - -(You can give it another name that you like instead of "read_row_callback") - -To inform libpng about your function, use - - png_set_read_status_fn(png_ptr, read_row_callback); - -Width and height limits - -The PNG specification allows the width and height of an image to be as -large as 2^31-1 (0x7fffffff), or about 2.147 billion rows and columns. -Since very few applications really need to process such large images, -we have imposed an arbitrary 1-million limit on rows and columns. -Larger images will be rejected immediately with a png_error() call. If -you wish to override this limit, you can use - - png_set_user_limits(png_ptr, width_max, height_max); - -to set your own limits, or use width_max = height_max = 0x7fffffffL -to allow all valid dimensions (libpng may reject some very large images -anyway because of potential buffer overflow conditions). - -You should put this statement after you create the PNG structure and -before calling png_read_info(), png_read_png(), or png_process_data(). -If you need to retrieve the limits that are being applied, use - - width_max = png_get_user_width_max(png_ptr); - height_max = png_get_user_height_max(png_ptr); - -Unknown-chunk handling - -Now you get to set the way the library processes unknown chunks in the -input PNG stream. Both known and unknown chunks will be read. Normal -behavior is that known chunks will be parsed into information in -various info_ptr members while unknown chunks will be discarded. This -behavior can be wasteful if your application will never use some known -chunk types. To change this, you can call: - - png_set_keep_unknown_chunks(png_ptr, keep, - chunk_list, num_chunks); - keep - 0: default unknown chunk handling - 1: ignore; do not keep - 2: keep only if safe-to-copy - 3: keep even if unsafe-to-copy - You can use these definitions: - PNG_HANDLE_CHUNK_AS_DEFAULT 0 - PNG_HANDLE_CHUNK_NEVER 1 - PNG_HANDLE_CHUNK_IF_SAFE 2 - PNG_HANDLE_CHUNK_ALWAYS 3 - chunk_list - list of chunks affected (a byte string, - five bytes per chunk, NULL or '\0' if - num_chunks is 0) - num_chunks - number of chunks affected; if 0, all - unknown chunks are affected. If nonzero, - only the chunks in the list are affected - -Unknown chunks declared in this way will be saved as raw data onto a -list of png_unknown_chunk structures. If a chunk that is normally -known to libpng is named in the list, it will be handled as unknown, -according to the "keep" directive. If a chunk is named in successive -instances of png_set_keep_unknown_chunks(), the final instance will -take precedence. The IHDR and IEND chunks should not be named in -chunk_list; if they are, libpng will process them normally anyway. - -Here is an example of the usage of png_set_keep_unknown_chunks(), -where the private "vpAg" chunk will later be processed by a user chunk -callback function: - - png_byte vpAg[5]={118, 112, 65, 103, (png_byte) '\0'}; - - #if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) - png_byte unused_chunks[]= - { - 104, 73, 83, 84, (png_byte) '\0', /* hIST */ - 105, 84, 88, 116, (png_byte) '\0', /* iTXt */ - 112, 67, 65, 76, (png_byte) '\0', /* pCAL */ - 115, 67, 65, 76, (png_byte) '\0', /* sCAL */ - 115, 80, 76, 84, (png_byte) '\0', /* sPLT */ - 116, 73, 77, 69, (png_byte) '\0', /* tIME */ - }; - #endif - - ... - - #if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) - /* ignore all unknown chunks: */ - png_set_keep_unknown_chunks(read_ptr, 1, NULL, 0); - /* except for vpAg: */ - png_set_keep_unknown_chunks(read_ptr, 2, vpAg, 1); - /* also ignore unused known chunks: */ - png_set_keep_unknown_chunks(read_ptr, 1, unused_chunks, - (int)sizeof(unused_chunks)/5); - #endif - -User limits - -The PNG specification allows the width and height of an image to be as -large as 2^31-1 (0x7fffffff), or about 2.147 billion rows and columns. -Since very few applications really need to process such large images, -we have imposed an arbitrary 1-million limit on rows and columns. -Larger images will be rejected immediately with a png_error() call. If -you wish to override this limit, you can use - - png_set_user_limits(png_ptr, width_max, height_max); - -to set your own limits, or use width_max = height_max = 0x7fffffffL -to allow all valid dimensions (libpng may reject some very large images -anyway because of potential buffer overflow conditions). - -You should put this statement after you create the PNG structure and -before calling png_read_info(), png_read_png(), or png_process_data(). -If you need to retrieve the limits that are being applied, use - - width_max = png_get_user_width_max(png_ptr); - height_max = png_get_user_height_max(png_ptr); - -The high-level read interface - -At this point there are two ways to proceed; through the high-level -read interface, or through a sequence of low-level read operations. -You can use the high-level interface if (a) you are willing to read -the entire image into memory, and (b) the input transformations -you want to do are limited to the following set: - - PNG_TRANSFORM_IDENTITY No transformation - PNG_TRANSFORM_STRIP_16 Strip 16-bit samples to - 8 bits - PNG_TRANSFORM_STRIP_ALPHA Discard the alpha channel - PNG_TRANSFORM_PACKING Expand 1, 2 and 4-bit - samples to bytes - PNG_TRANSFORM_PACKSWAP Change order of packed - pixels to LSB first - PNG_TRANSFORM_EXPAND Perform set_expand() - PNG_TRANSFORM_INVERT_MONO Invert monochrome images - PNG_TRANSFORM_SHIFT Normalize pixels to the - sBIT depth - PNG_TRANSFORM_BGR Flip RGB to BGR, RGBA - to BGRA - PNG_TRANSFORM_SWAP_ALPHA Flip RGBA to ARGB or GA - to AG - PNG_TRANSFORM_INVERT_ALPHA Change alpha from opacity - to transparency - PNG_TRANSFORM_SWAP_ENDIAN Byte-swap 16-bit samples - -(This excludes setting a background color, doing gamma transformation, -dithering, and setting filler.) If this is the case, simply do this: - - png_read_png(png_ptr, info_ptr, png_transforms, NULL) - -where png_transforms is an integer containing the bitwise OR of -some set of transformation flags. This call is equivalent to png_read_info(), -followed the set of transformations indicated by the transform mask, -then png_read_image(), and finally png_read_end(). - -(The final parameter of this call is not yet used. Someday it might point -to transformation parameters required by some future input transform.) - -You must use png_transforms and not call any png_set_transform() functions -when you use png_read_png(). - -After you have called png_read_png(), you can retrieve the image data -with - - row_pointers = png_get_rows(png_ptr, info_ptr); - -where row_pointers is an array of pointers to the pixel data for each row: - - png_bytep row_pointers[height]; - -If you know your image size and pixel size ahead of time, you can allocate -row_pointers prior to calling png_read_png() with - - if (height > PNG_UINT_32_MAX/png_sizeof(png_byte)) - png_error (png_ptr, - "Image is too tall to process in memory"); - if (width > PNG_UINT_32_MAX/pixel_size) - png_error (png_ptr, - "Image is too wide to process in memory"); - row_pointers = png_malloc(png_ptr, - height*png_sizeof(png_bytep)); - for (int i=0; i) and -png_get_(png_ptr, info_ptr, ...) functions return non-zero if the -data has been read, or zero if it is missing. The parameters to the -png_get_ are set directly if they are simple data types, or a pointer -into the info_ptr is returned for any complex types. - - png_get_PLTE(png_ptr, info_ptr, &palette, - &num_palette); - palette - the palette for the file - (array of png_color) - num_palette - number of entries in the palette - - png_get_gAMA(png_ptr, info_ptr, &gamma); - gamma - the gamma the file is written - at (PNG_INFO_gAMA) - - png_get_sRGB(png_ptr, info_ptr, &srgb_intent); - srgb_intent - the rendering intent (PNG_INFO_sRGB) - The presence of the sRGB chunk - means that the pixel data is in the - sRGB color space. This chunk also - implies specific values of gAMA and - cHRM. - - png_get_iCCP(png_ptr, info_ptr, &name, - &compression_type, &profile, &proflen); - name - The profile name. - compression - The compression type; always - PNG_COMPRESSION_TYPE_BASE for PNG 1.0. - You may give NULL to this argument to - ignore it. - profile - International Color Consortium color - profile data. May contain NULs. - proflen - length of profile data in bytes. - - png_get_sBIT(png_ptr, info_ptr, &sig_bit); - sig_bit - the number of significant bits for - (PNG_INFO_sBIT) each of the gray, - red, green, and blue channels, - whichever are appropriate for the - given color type (png_color_16) - - png_get_tRNS(png_ptr, info_ptr, &trans, &num_trans, - &trans_values); - trans - array of transparent entries for - palette (PNG_INFO_tRNS) - trans_values - graylevel or color sample values of - the single transparent color for - non-paletted images (PNG_INFO_tRNS) - num_trans - number of transparent entries - (PNG_INFO_tRNS) - - png_get_hIST(png_ptr, info_ptr, &hist); - (PNG_INFO_hIST) - hist - histogram of palette (array of - png_uint_16) - - png_get_tIME(png_ptr, info_ptr, &mod_time); - mod_time - time image was last modified - (PNG_VALID_tIME) - - png_get_bKGD(png_ptr, info_ptr, &background); - background - background color (PNG_VALID_bKGD) - valid 16-bit red, green and blue - values, regardless of color_type - - num_comments = png_get_text(png_ptr, info_ptr, - &text_ptr, &num_text); - num_comments - number of comments - text_ptr - array of png_text holding image - comments - text_ptr[i].compression - type of compression used - on "text" PNG_TEXT_COMPRESSION_NONE - PNG_TEXT_COMPRESSION_zTXt - PNG_ITXT_COMPRESSION_NONE - PNG_ITXT_COMPRESSION_zTXt - text_ptr[i].key - keyword for comment. Must contain - 1-79 characters. - text_ptr[i].text - text comments for current - keyword. Can be empty. - text_ptr[i].text_length - length of text string, - after decompression, 0 for iTXt - text_ptr[i].itxt_length - length of itxt string, - after decompression, 0 for tEXt/zTXt - text_ptr[i].lang - language of comment (empty - string for unknown). - text_ptr[i].lang_key - keyword in UTF-8 - (empty string for unknown). - num_text - number of comments (same as - num_comments; you can put NULL here - to avoid the duplication) - Note while png_set_text() will accept text, language, - and translated keywords that can be NULL pointers, the - structure returned by png_get_text will always contain - regular zero-terminated C strings. They might be - empty strings but they will never be NULL pointers. - - num_spalettes = png_get_sPLT(png_ptr, info_ptr, - &palette_ptr); - palette_ptr - array of palette structures holding - contents of one or more sPLT chunks - read. - num_spalettes - number of sPLT chunks read. - - png_get_oFFs(png_ptr, info_ptr, &offset_x, &offset_y, - &unit_type); - offset_x - positive offset from the left edge - of the screen - offset_y - positive offset from the top edge - of the screen - unit_type - PNG_OFFSET_PIXEL, PNG_OFFSET_MICROMETER - - png_get_pHYs(png_ptr, info_ptr, &res_x, &res_y, - &unit_type); - res_x - pixels/unit physical resolution in - x direction - res_y - pixels/unit physical resolution in - x direction - unit_type - PNG_RESOLUTION_UNKNOWN, - PNG_RESOLUTION_METER - - png_get_sCAL(png_ptr, info_ptr, &unit, &width, - &height) - unit - physical scale units (an integer) - width - width of a pixel in physical scale units - height - height of a pixel in physical scale units - (width and height are doubles) - - png_get_sCAL_s(png_ptr, info_ptr, &unit, &width, - &height) - unit - physical scale units (an integer) - width - width of a pixel in physical scale units - height - height of a pixel in physical scale units - (width and height are strings like "2.54") - - num_unknown_chunks = png_get_unknown_chunks(png_ptr, - info_ptr, &unknowns) - unknowns - array of png_unknown_chunk - structures holding unknown chunks - unknowns[i].name - name of unknown chunk - unknowns[i].data - data of unknown chunk - unknowns[i].size - size of unknown chunk's data - unknowns[i].location - position of chunk in file - - The value of "i" corresponds to the order in which the - chunks were read from the PNG file or inserted with the - png_set_unknown_chunks() function. - -The data from the pHYs chunk can be retrieved in several convenient -forms: - - res_x = png_get_x_pixels_per_meter(png_ptr, - info_ptr) - res_y = png_get_y_pixels_per_meter(png_ptr, - info_ptr) - res_x_and_y = png_get_pixels_per_meter(png_ptr, - info_ptr) - res_x = png_get_x_pixels_per_inch(png_ptr, - info_ptr) - res_y = png_get_y_pixels_per_inch(png_ptr, - info_ptr) - res_x_and_y = png_get_pixels_per_inch(png_ptr, - info_ptr) - aspect_ratio = png_get_pixel_aspect_ratio(png_ptr, - info_ptr) - - (Each of these returns 0 [signifying "unknown"] if - the data is not present or if res_x is 0; - res_x_and_y is 0 if res_x != res_y) - -The data from the oFFs chunk can be retrieved in several convenient -forms: - - x_offset = png_get_x_offset_microns(png_ptr, info_ptr); - y_offset = png_get_y_offset_microns(png_ptr, info_ptr); - x_offset = png_get_x_offset_inches(png_ptr, info_ptr); - y_offset = png_get_y_offset_inches(png_ptr, info_ptr); - - (Each of these returns 0 [signifying "unknown" if both - x and y are 0] if the data is not present or if the - chunk is present but the unit is the pixel) - -For more information, see the png_info definition in png.h and the -PNG specification for chunk contents. Be careful with trusting -rowbytes, as some of the transformations could increase the space -needed to hold a row (expand, filler, gray_to_rgb, etc.). -See png_read_update_info(), below. - -A quick word about text_ptr and num_text. PNG stores comments in -keyword/text pairs, one pair per chunk, with no limit on the number -of text chunks, and a 2^31 byte limit on their size. While there are -suggested keywords, there is no requirement to restrict the use to these -strings. It is strongly suggested that keywords and text be sensible -to humans (that's the point), so don't use abbreviations. Non-printing -symbols are not allowed. See the PNG specification for more details. -There is also no requirement to have text after the keyword. - -Keywords should be limited to 79 Latin-1 characters without leading or -trailing spaces, but non-consecutive spaces are allowed within the -keyword. It is possible to have the same keyword any number of times. -The text_ptr is an array of png_text structures, each holding a -pointer to a language string, a pointer to a keyword and a pointer to -a text string. The text string, language code, and translated -keyword may be empty or NULL pointers. The keyword/text -pairs are put into the array in the order that they are received. -However, some or all of the text chunks may be after the image, so, to -make sure you have read all the text chunks, don't mess with these -until after you read the stuff after the image. This will be -mentioned again below in the discussion that goes with png_read_end(). - -Input transformations - -After you've read the header information, you can set up the library -to handle any special transformations of the image data. The various -ways to transform the data will be described in the order that they -should occur. This is important, as some of these change the color -type and/or bit depth of the data, and some others only work on -certain color types and bit depths. Even though each transformation -checks to see if it has data that it can do something with, you should -make sure to only enable a transformation if it will be valid for the -data. For example, don't swap red and blue on grayscale data. - -The colors used for the background and transparency values should be -supplied in the same format/depth as the current image data. They -are stored in the same format/depth as the image data in a bKGD or tRNS -chunk, so this is what libpng expects for this data. The colors are -transformed to keep in sync with the image data when an application -calls the png_read_update_info() routine (see below). - -Data will be decoded into the supplied row buffers packed into bytes -unless the library has been told to transform it into another format. -For example, 4 bit/pixel paletted or grayscale data will be returned -2 pixels/byte with the leftmost pixel in the high-order bits of the -byte, unless png_set_packing() is called. 8-bit RGB data will be stored -in RGB RGB RGB format unless png_set_filler() or png_set_add_alpha() -is called to insert filler bytes, either before or after each RGB triplet. -16-bit RGB data will be returned RRGGBB RRGGBB, with the most significant -byte of the color value first, unless png_set_strip_16() is called to -transform it to regular RGB RGB triplets, or png_set_filler() or -png_set_add alpha() is called to insert filler bytes, either before or -after each RRGGBB triplet. Similarly, 8-bit or 16-bit grayscale data can -be modified with -png_set_filler(), png_set_add_alpha(), or png_set_strip_16(). - -The following code transforms grayscale images of less than 8 to 8 bits, -changes paletted images to RGB, and adds a full alpha channel if there is -transparency information in a tRNS chunk. This is most useful on -grayscale images with bit depths of 2 or 4 or if there is a multiple-image -viewing application that wishes to treat all images in the same way. - - if (color_type == PNG_COLOR_TYPE_PALETTE) - png_set_palette_to_rgb(png_ptr); - - if (color_type == PNG_COLOR_TYPE_GRAY && - bit_depth < 8) png_set_expand_gray_1_2_4_to_8(png_ptr); - - if (png_get_valid(png_ptr, info_ptr, - PNG_INFO_tRNS)) png_set_tRNS_to_alpha(png_ptr); - -These three functions are actually aliases for png_set_expand(), added -in libpng version 1.0.4, with the function names expanded to improve code -readability. In some future version they may actually do different -things. - -As of libpng version 1.2.9, png_set_expand_gray_1_2_4_to_8() was -added. It expands the sample depth without changing tRNS to alpha. - -PNG can have files with 16 bits per channel. If you only can handle -8 bits per channel, this will strip the pixels down to 8 bit. - - if (bit_depth == 16) - png_set_strip_16(png_ptr); - -If, for some reason, you don't need the alpha channel on an image, -and you want to remove it rather than combining it with the background -(but the image author certainly had in mind that you *would* combine -it with the background, so that's what you should probably do): - - if (color_type & PNG_COLOR_MASK_ALPHA) - png_set_strip_alpha(png_ptr); - -In PNG files, the alpha channel in an image -is the level of opacity. If you need the alpha channel in an image to -be the level of transparency instead of opacity, you can invert the -alpha channel (or the tRNS chunk data) after it's read, so that 0 is -fully opaque and 255 (in 8-bit or paletted images) or 65535 (in 16-bit -images) is fully transparent, with - - png_set_invert_alpha(png_ptr); - -PNG files pack pixels of bit depths 1, 2, and 4 into bytes as small as -they can, resulting in, for example, 8 pixels per byte for 1 bit -files. This code expands to 1 pixel per byte without changing the -values of the pixels: - - if (bit_depth < 8) - png_set_packing(png_ptr); - -PNG files have possible bit depths of 1, 2, 4, 8, and 16. All pixels -stored in a PNG image have been "scaled" or "shifted" up to the next -higher possible bit depth (e.g. from 5 bits/sample in the range [0,31] to -8 bits/sample in the range [0, 255]). However, it is also possible to -convert the PNG pixel data back to the original bit depth of the image. -This call reduces the pixels back down to the original bit depth: - - png_color_8p sig_bit; - - if (png_get_sBIT(png_ptr, info_ptr, &sig_bit)) - png_set_shift(png_ptr, sig_bit); - -PNG files store 3-color pixels in red, green, blue order. This code -changes the storage of the pixels to blue, green, red: - - if (color_type == PNG_COLOR_TYPE_RGB || - color_type == PNG_COLOR_TYPE_RGB_ALPHA) - png_set_bgr(png_ptr); - -PNG files store RGB pixels packed into 3 or 6 bytes. This code expands them -into 4 or 8 bytes for windowing systems that need them in this format: - - if (color_type == PNG_COLOR_TYPE_RGB) - png_set_filler(png_ptr, filler, PNG_FILLER_BEFORE); - -where "filler" is the 8 or 16-bit number to fill with, and the location is -either PNG_FILLER_BEFORE or PNG_FILLER_AFTER, depending upon whether -you want the filler before the RGB or after. This transformation -does not affect images that already have full alpha channels. To add an -opaque alpha channel, use filler=0xff or 0xffff and PNG_FILLER_AFTER which -will generate RGBA pixels. - -Note that png_set_filler() does not change the color type. If you want -to do that, you can add a true alpha channel with - - if (color_type == PNG_COLOR_TYPE_RGB || - color_type == PNG_COLOR_TYPE_GRAY) - png_set_add_alpha(png_ptr, filler, PNG_FILLER_AFTER); - -where "filler" contains the alpha value to assign to each pixel. -This function was added in libpng-1.2.7. - -If you are reading an image with an alpha channel, and you need the -data as ARGB instead of the normal PNG format RGBA: - - if (color_type == PNG_COLOR_TYPE_RGB_ALPHA) - png_set_swap_alpha(png_ptr); - -For some uses, you may want a grayscale image to be represented as -RGB. This code will do that conversion: - - if (color_type == PNG_COLOR_TYPE_GRAY || - color_type == PNG_COLOR_TYPE_GRAY_ALPHA) - png_set_gray_to_rgb(png_ptr); - -Conversely, you can convert an RGB or RGBA image to grayscale or grayscale -with alpha. - - if (color_type == PNG_COLOR_TYPE_RGB || - color_type == PNG_COLOR_TYPE_RGB_ALPHA) - png_set_rgb_to_gray_fixed(png_ptr, error_action, - int red_weight, int green_weight); - - error_action = 1: silently do the conversion - error_action = 2: issue a warning if the original - image has any pixel where - red != green or red != blue - error_action = 3: issue an error and abort the - conversion if the original - image has any pixel where - red != green or red != blue - - red_weight: weight of red component times 100000 - green_weight: weight of green component times 100000 - If either weight is negative, default - weights (21268, 71514) are used. - -If you have set error_action = 1 or 2, you can -later check whether the image really was gray, after processing -the image rows, with the png_get_rgb_to_gray_status(png_ptr) function. -It will return a png_byte that is zero if the image was gray or -1 if there were any non-gray pixels. bKGD and sBIT data -will be silently converted to grayscale, using the green channel -data, regardless of the error_action setting. - -With red_weight+green_weight<=100000, -the normalized graylevel is computed: - - int rw = red_weight * 65536; - int gw = green_weight * 65536; - int bw = 65536 - (rw + gw); - gray = (rw*red + gw*green + bw*blue)/65536; - -The default values approximate those recommended in the Charles -Poynton's Color FAQ, -Copyright (c) 1998-01-04 Charles Poynton - - Y = 0.212671 * R + 0.715160 * G + 0.072169 * B - -Libpng approximates this with - - Y = 0.21268 * R + 0.7151 * G + 0.07217 * B - -which can be expressed with integers as - - Y = (6969 * R + 23434 * G + 2365 * B)/32768 - -The calculation is done in a linear colorspace, if the image gamma -is known. - -If you have a grayscale and you are using png_set_expand_depth(), -png_set_expand(), or png_set_gray_to_rgb to change to truecolor or to -a higher bit-depth, you must either supply the background color as a gray -value at the original file bit-depth (need_expand = 1) or else supply the -background color as an RGB triplet at the final, expanded bit depth -(need_expand = 0). Similarly, if you are reading a paletted image, you -must either supply the background color as a palette index (need_expand = 1) -or as an RGB triplet that may or may not be in the palette (need_expand = 0). - - png_color_16 my_background; - png_color_16p image_background; - - if (png_get_bKGD(png_ptr, info_ptr, &image_background)) - png_set_background(png_ptr, image_background, - PNG_BACKGROUND_GAMMA_FILE, 1, 1.0); - else - png_set_background(png_ptr, &my_background, - PNG_BACKGROUND_GAMMA_SCREEN, 0, 1.0); - -The png_set_background() function tells libpng to composite images -with alpha or simple transparency against the supplied background -color. If the PNG file contains a bKGD chunk (PNG_INFO_bKGD valid), -you may use this color, or supply another color more suitable for -the current display (e.g., the background color from a web page). You -need to tell libpng whether the color is in the gamma space of the -display (PNG_BACKGROUND_GAMMA_SCREEN for colors you supply), the file -(PNG_BACKGROUND_GAMMA_FILE for colors from the bKGD chunk), or one -that is neither of these gammas (PNG_BACKGROUND_GAMMA_UNIQUE - I don't -know why anyone would use this, but it's here). - -To properly display PNG images on any kind of system, the application needs -to know what the display gamma is. Ideally, the user will know this, and -the application will allow them to set it. One method of allowing the user -to set the display gamma separately for each system is to check for a -SCREEN_GAMMA or DISPLAY_GAMMA environment variable, which will hopefully be -correctly set. - -Note that display_gamma is the overall gamma correction required to produce -pleasing results, which depends on the lighting conditions in the surrounding -environment. In a dim or brightly lit room, no compensation other than -the physical gamma exponent of the monitor is needed, while in a dark room -a slightly smaller exponent is better. - - double gamma, screen_gamma; - - if (/* We have a user-defined screen - gamma value */) - { - screen_gamma = user_defined_screen_gamma; - } - /* One way that applications can share the same - screen gamma value */ - else if ((gamma_str = getenv("SCREEN_GAMMA")) - != NULL) - { - screen_gamma = (double)atof(gamma_str); - } - /* If we don't have another value */ - else - { - screen_gamma = 2.2; /* A good guess for a - PC monitor in a bright office or a dim room */ - screen_gamma = 2.0; /* A good guess for a - PC monitor in a dark room */ - screen_gamma = 1.7 or 1.0; /* A good - guess for Mac systems */ - } - -The png_set_gamma() function handles gamma transformations of the data. -Pass both the file gamma and the current screen_gamma. If the file does -not have a gamma value, you can pass one anyway if you have an idea what -it is (usually 0.45455 is a good guess for GIF images on PCs). Note -that file gammas are inverted from screen gammas. See the discussions -on gamma in the PNG specification for an excellent description of what -gamma is, and why all applications should support it. It is strongly -recommended that PNG viewers support gamma correction. - - if (png_get_gAMA(png_ptr, info_ptr, &gamma)) - png_set_gamma(png_ptr, screen_gamma, gamma); - else - png_set_gamma(png_ptr, screen_gamma, 0.45455); - -If you need to reduce an RGB file to a paletted file, or if a paletted -file has more entries then will fit on your screen, png_set_dither() -will do that. Note that this is a simple match dither that merely -finds the closest color available. This should work fairly well with -optimized palettes, and fairly badly with linear color cubes. If you -pass a palette that is larger then maximum_colors, the file will -reduce the number of colors in the palette so it will fit into -maximum_colors. If there is a histogram, it will use it to make -more intelligent choices when reducing the palette. If there is no -histogram, it may not do as good a job. - - if (color_type & PNG_COLOR_MASK_COLOR) - { - if (png_get_valid(png_ptr, info_ptr, - PNG_INFO_PLTE)) - { - png_uint_16p histogram = NULL; - - png_get_hIST(png_ptr, info_ptr, - &histogram); - png_set_dither(png_ptr, palette, num_palette, - max_screen_colors, histogram, 1); - } - else - { - png_color std_color_cube[MAX_SCREEN_COLORS] = - { ... colors ... }; - - png_set_dither(png_ptr, std_color_cube, - MAX_SCREEN_COLORS, MAX_SCREEN_COLORS, - NULL,0); - } - } - -PNG files describe monochrome as black being zero and white being one. -The following code will reverse this (make black be one and white be -zero): - - if (bit_depth == 1 && color_type == PNG_COLOR_TYPE_GRAY) - png_set_invert_mono(png_ptr); - -This function can also be used to invert grayscale and gray-alpha images: - - if (color_type == PNG_COLOR_TYPE_GRAY || - color_type == PNG_COLOR_TYPE_GRAY_ALPHA) - png_set_invert_mono(png_ptr); - -PNG files store 16 bit pixels in network byte order (big-endian, -ie. most significant bits first). This code changes the storage to the -other way (little-endian, i.e. least significant bits first, the -way PCs store them): - - if (bit_depth == 16) - png_set_swap(png_ptr); - -If you are using packed-pixel images (1, 2, or 4 bits/pixel), and you -need to change the order the pixels are packed into bytes, you can use: - - if (bit_depth < 8) - png_set_packswap(png_ptr); - -Finally, you can write your own transformation function if none of -the existing ones meets your needs. This is done by setting a callback -with - - png_set_read_user_transform_fn(png_ptr, - read_transform_fn); - -You must supply the function - - void read_transform_fn(png_ptr ptr, row_info_ptr - row_info, png_bytep data) - -See pngtest.c for a working example. Your function will be called -after all of the other transformations have been processed. - -You can also set up a pointer to a user structure for use by your -callback function, and you can inform libpng that your transform -function will change the number of channels or bit depth with the -function - - png_set_user_transform_info(png_ptr, user_ptr, - user_depth, user_channels); - -The user's application, not libpng, is responsible for allocating and -freeing any memory required for the user structure. - -You can retrieve the pointer via the function -png_get_user_transform_ptr(). For example: - - voidp read_user_transform_ptr = - png_get_user_transform_ptr(png_ptr); - -The last thing to handle is interlacing; this is covered in detail below, -but you must call the function here if you want libpng to handle expansion -of the interlaced image. - - number_of_passes = png_set_interlace_handling(png_ptr); - -After setting the transformations, libpng can update your png_info -structure to reflect any transformations you've requested with this -call. This is most useful to update the info structure's rowbytes -field so you can use it to allocate your image memory. This function -will also update your palette with the correct screen_gamma and -background if these have been given with the calls above. - - png_read_update_info(png_ptr, info_ptr); - -After you call png_read_update_info(), you can allocate any -memory you need to hold the image. The row data is simply -raw byte data for all forms of images. As the actual allocation -varies among applications, no example will be given. If you -are allocating one large chunk, you will need to build an -array of pointers to each row, as it will be needed for some -of the functions below. - -Reading image data - -After you've allocated memory, you can read the image data. -The simplest way to do this is in one function call. If you are -allocating enough memory to hold the whole image, you can just -call png_read_image() and libpng will read in all the image data -and put it in the memory area supplied. You will need to pass in -an array of pointers to each row. - -This function automatically handles interlacing, so you don't need -to call png_set_interlace_handling() or call this function multiple -times, or any of that other stuff necessary with png_read_rows(). - - png_read_image(png_ptr, row_pointers); - -where row_pointers is: - - png_bytep row_pointers[height]; - -You can point to void or char or whatever you use for pixels. - -If you don't want to read in the whole image at once, you can -use png_read_rows() instead. If there is no interlacing (check -interlace_type == PNG_INTERLACE_NONE), this is simple: - - png_read_rows(png_ptr, row_pointers, NULL, - number_of_rows); - -where row_pointers is the same as in the png_read_image() call. - -If you are doing this just one row at a time, you can do this with -a single row_pointer instead of an array of row_pointers: - - png_bytep row_pointer = row; - png_read_row(png_ptr, row_pointer, NULL); - -If the file is interlaced (interlace_type != 0 in the IHDR chunk), things -get somewhat harder. The only current (PNG Specification version 1.2) -interlacing type for PNG is (interlace_type == PNG_INTERLACE_ADAM7) -is a somewhat complicated 2D interlace scheme, known as Adam7, that -breaks down an image into seven smaller images of varying size, based -on an 8x8 grid. - -libpng can fill out those images or it can give them to you "as is". -If you want them filled out, there are two ways to do that. The one -mentioned in the PNG specification is to expand each pixel to cover -those pixels that have not been read yet (the "rectangle" method). -This results in a blocky image for the first pass, which gradually -smooths out as more pixels are read. The other method is the "sparkle" -method, where pixels are drawn only in their final locations, with the -rest of the image remaining whatever colors they were initialized to -before the start of the read. The first method usually looks better, -but tends to be slower, as there are more pixels to put in the rows. - -If you don't want libpng to handle the interlacing details, just call -png_read_rows() seven times to read in all seven images. Each of the -images is a valid image by itself, or they can all be combined on an -8x8 grid to form a single image (although if you intend to combine them -you would be far better off using the libpng interlace handling). - -The first pass will return an image 1/8 as wide as the entire image -(every 8th column starting in column 0) and 1/8 as high as the original -(every 8th row starting in row 0), the second will be 1/8 as wide -(starting in column 4) and 1/8 as high (also starting in row 0). The -third pass will be 1/4 as wide (every 4th pixel starting in column 0) and -1/8 as high (every 8th row starting in row 4), and the fourth pass will -be 1/4 as wide and 1/4 as high (every 4th column starting in column 2, -and every 4th row starting in row 0). The fifth pass will return an -image 1/2 as wide, and 1/4 as high (starting at column 0 and row 2), -while the sixth pass will be 1/2 as wide and 1/2 as high as the original -(starting in column 1 and row 0). The seventh and final pass will be as -wide as the original, and 1/2 as high, containing all of the odd -numbered scanlines. Phew! - -If you want libpng to expand the images, call this before calling -png_start_read_image() or png_read_update_info(): - - if (interlace_type == PNG_INTERLACE_ADAM7) - number_of_passes - = png_set_interlace_handling(png_ptr); - -This will return the number of passes needed. Currently, this -is seven, but may change if another interlace type is added. -This function can be called even if the file is not interlaced, -where it will return one pass. - -If you are not going to display the image after each pass, but are -going to wait until the entire image is read in, use the sparkle -effect. This effect is faster and the end result of either method -is exactly the same. If you are planning on displaying the image -after each pass, the "rectangle" effect is generally considered the -better looking one. - -If you only want the "sparkle" effect, just call png_read_rows() as -normal, with the third parameter NULL. Make sure you make pass over -the image number_of_passes times, and you don't change the data in the -rows between calls. You can change the locations of the data, just -not the data. Each pass only writes the pixels appropriate for that -pass, and assumes the data from previous passes is still valid. - - png_read_rows(png_ptr, row_pointers, NULL, - number_of_rows); - -If you only want the first effect (the rectangles), do the same as -before except pass the row buffer in the third parameter, and leave -the second parameter NULL. - - png_read_rows(png_ptr, NULL, row_pointers, - number_of_rows); - -Finishing a sequential read - -After you are finished reading the image through the -low-level interface, you can finish reading the file. If you are -interested in comments or time, which may be stored either before or -after the image data, you should pass the separate png_info struct if -you want to keep the comments from before and after the image -separate. If you are not interested, you can pass NULL. - - png_read_end(png_ptr, end_info); - -When you are done, you can free all memory allocated by libpng like this: - - png_destroy_read_struct(&png_ptr, &info_ptr, - &end_info); - -It is also possible to individually free the info_ptr members that -point to libpng-allocated storage with the following function: - - png_free_data(png_ptr, info_ptr, mask, seq) - mask - identifies data to be freed, a mask - containing the bitwise OR of one or - more of - PNG_FREE_PLTE, PNG_FREE_TRNS, - PNG_FREE_HIST, PNG_FREE_ICCP, - PNG_FREE_PCAL, PNG_FREE_ROWS, - PNG_FREE_SCAL, PNG_FREE_SPLT, - PNG_FREE_TEXT, PNG_FREE_UNKN, - or simply PNG_FREE_ALL - seq - sequence number of item to be freed - (-1 for all items) - -This function may be safely called when the relevant storage has -already been freed, or has not yet been allocated, or was allocated -by the user and not by libpng, and will in those -cases do nothing. The "seq" parameter is ignored if only one item -of the selected data type, such as PLTE, is allowed. If "seq" is not --1, and multiple items are allowed for the data type identified in -the mask, such as text or sPLT, only the n'th item in the structure -is freed, where n is "seq". - -The default behavior is only to free data that was allocated internally -by libpng. This can be changed, so that libpng will not free the data, -or so that it will free data that was allocated by the user with png_malloc() -or png_zalloc() and passed in via a png_set_*() function, with - - png_data_freer(png_ptr, info_ptr, freer, mask) - mask - which data elements are affected - same choices as in png_free_data() - freer - one of - PNG_DESTROY_WILL_FREE_DATA - PNG_SET_WILL_FREE_DATA - PNG_USER_WILL_FREE_DATA - -This function only affects data that has already been allocated. -You can call this function after reading the PNG data but before calling -any png_set_*() functions, to control whether the user or the png_set_*() -function is responsible for freeing any existing data that might be present, -and again after the png_set_*() functions to control whether the user -or png_destroy_*() is supposed to free the data. When the user assumes -responsibility for libpng-allocated data, the application must use -png_free() to free it, and when the user transfers responsibility to libpng -for data that the user has allocated, the user must have used png_malloc() -or png_zalloc() to allocate it. - -If you allocated your row_pointers in a single block, as suggested above in -the description of the high level read interface, you must not transfer -responsibility for freeing it to the png_set_rows or png_read_destroy function, -because they would also try to free the individual row_pointers[i]. - -If you allocated text_ptr.text, text_ptr.lang, and text_ptr.translated_keyword -separately, do not transfer responsibility for freeing text_ptr to libpng, -because when libpng fills a png_text structure it combines these members with -the key member, and png_free_data() will free only text_ptr.key. Similarly, -if you transfer responsibility for free'ing text_ptr from libpng to your -application, your application must not separately free those members. - -The png_free_data() function will turn off the "valid" flag for anything -it frees. If you need to turn the flag off for a chunk that was freed by your -application instead of by libpng, you can use - - png_set_invalid(png_ptr, info_ptr, mask); - mask - identifies the chunks to be made invalid, - containing the bitwise OR of one or - more of - PNG_INFO_gAMA, PNG_INFO_sBIT, - PNG_INFO_cHRM, PNG_INFO_PLTE, - PNG_INFO_tRNS, PNG_INFO_bKGD, - PNG_INFO_hIST, PNG_INFO_pHYs, - PNG_INFO_oFFs, PNG_INFO_tIME, - PNG_INFO_pCAL, PNG_INFO_sRGB, - PNG_INFO_iCCP, PNG_INFO_sPLT, - PNG_INFO_sCAL, PNG_INFO_IDAT - -For a more compact example of reading a PNG image, see the file example.c. - -Reading PNG files progressively - -The progressive reader is slightly different then the non-progressive -reader. Instead of calling png_read_info(), png_read_rows(), and -png_read_end(), you make one call to png_process_data(), which calls -callbacks when it has the info, a row, or the end of the image. You -set up these callbacks with png_set_progressive_read_fn(). You don't -have to worry about the input/output functions of libpng, as you are -giving the library the data directly in png_process_data(). I will -assume that you have read the section on reading PNG files above, -so I will only highlight the differences (although I will show -all of the code). - -png_structp png_ptr; -png_infop info_ptr; - - /* An example code fragment of how you would - initialize the progressive reader in your - application. */ - int - initialize_png_reader() - { - png_ptr = png_create_read_struct - (PNG_LIBPNG_VER_STRING, (png_voidp)user_error_ptr, - user_error_fn, user_warning_fn); - if (!png_ptr) - return (ERROR); - info_ptr = png_create_info_struct(png_ptr); - if (!info_ptr) - { - png_destroy_read_struct(&png_ptr, (png_infopp)NULL, - (png_infopp)NULL); - return (ERROR); - } - - if (setjmp(png_jmpbuf(png_ptr))) - { - png_destroy_read_struct(&png_ptr, &info_ptr, - (png_infopp)NULL); - return (ERROR); - } - - /* This one's new. You can provide functions - to be called when the header info is valid, - when each row is completed, and when the image - is finished. If you aren't using all functions, - you can specify NULL parameters. Even when all - three functions are NULL, you need to call - png_set_progressive_read_fn(). You can use - any struct as the user_ptr (cast to a void pointer - for the function call), and retrieve the pointer - from inside the callbacks using the function - - png_get_progressive_ptr(png_ptr); - - which will return a void pointer, which you have - to cast appropriately. - */ - png_set_progressive_read_fn(png_ptr, (void *)user_ptr, - info_callback, row_callback, end_callback); - - return 0; - } - - /* A code fragment that you call as you receive blocks - of data */ - int - process_data(png_bytep buffer, png_uint_32 length) - { - if (setjmp(png_jmpbuf(png_ptr))) - { - png_destroy_read_struct(&png_ptr, &info_ptr, - (png_infopp)NULL); - return (ERROR); - } - - /* This one's new also. Simply give it a chunk - of data from the file stream (in order, of - course). On machines with segmented memory - models machines, don't give it any more than - 64K. The library seems to run fine with sizes - of 4K. Although you can give it much less if - necessary (I assume you can give it chunks of - 1 byte, I haven't tried less then 256 bytes - yet). When this function returns, you may - want to display any rows that were generated - in the row callback if you don't already do - so there. - */ - png_process_data(png_ptr, info_ptr, buffer, length); - return 0; - } - - /* This function is called (as set by - png_set_progressive_read_fn() above) when enough data - has been supplied so all of the header has been - read. - */ - void - info_callback(png_structp png_ptr, png_infop info) - { - /* Do any setup here, including setting any of - the transformations mentioned in the Reading - PNG files section. For now, you _must_ call - either png_start_read_image() or - png_read_update_info() after all the - transformations are set (even if you don't set - any). You may start getting rows before - png_process_data() returns, so this is your - last chance to prepare for that. - */ - } - - /* This function is called when each row of image - data is complete */ - void - row_callback(png_structp png_ptr, png_bytep new_row, - png_uint_32 row_num, int pass) - { - /* If the image is interlaced, and you turned - on the interlace handler, this function will - be called for every row in every pass. Some - of these rows will not be changed from the - previous pass. When the row is not changed, - the new_row variable will be NULL. The rows - and passes are called in order, so you don't - really need the row_num and pass, but I'm - supplying them because it may make your life - easier. - - For the non-NULL rows of interlaced images, - you must call png_progressive_combine_row() - passing in the row and the old row. You can - call this function for NULL rows (it will just - return) and for non-interlaced images (it just - does the memcpy for you) if it will make the - code easier. Thus, you can just do this for - all cases: - */ - - png_progressive_combine_row(png_ptr, old_row, - new_row); - - /* where old_row is what was displayed for - previously for the row. Note that the first - pass (pass == 0, really) will completely cover - the old row, so the rows do not have to be - initialized. After the first pass (and only - for interlaced images), you will have to pass - the current row, and the function will combine - the old row and the new row. - */ - } - - void - end_callback(png_structp png_ptr, png_infop info) - { - /* This function is called after the whole image - has been read, including any chunks after the - image (up to and including the IEND). You - will usually have the same info chunk as you - had in the header, although some data may have - been added to the comments and time fields. - - Most people won't do much here, perhaps setting - a flag that marks the image as finished. - */ - } - - - -IV. Writing - -Much of this is very similar to reading. However, everything of -importance is repeated here, so you won't have to constantly look -back up in the reading section to understand writing. - -Setup - -You will want to do the I/O initialization before you get into libpng, -so if it doesn't work, you don't have anything to undo. If you are not -using the standard I/O functions, you will need to replace them with -custom writing functions. See the discussion under Customizing libpng. - - FILE *fp = fopen(file_name, "wb"); - if (!fp) - { - return (ERROR); - } - -Next, png_struct and png_info need to be allocated and initialized. -As these can be both relatively large, you may not want to store these -on the stack, unless you have stack space to spare. Of course, you -will want to check if they return NULL. If you are also reading, -you won't want to name your read structure and your write structure -both "png_ptr"; you can call them anything you like, such as -"read_ptr" and "write_ptr". Look at pngtest.c, for example. - - png_structp png_ptr = png_create_write_struct - (PNG_LIBPNG_VER_STRING, (png_voidp)user_error_ptr, - user_error_fn, user_warning_fn); - if (!png_ptr) - return (ERROR); - - png_infop info_ptr = png_create_info_struct(png_ptr); - if (!info_ptr) - { - png_destroy_write_struct(&png_ptr, - (png_infopp)NULL); - return (ERROR); - } - -If you want to use your own memory allocation routines, -define PNG_USER_MEM_SUPPORTED and use -png_create_write_struct_2() instead of png_create_write_struct(): - - png_structp png_ptr = png_create_write_struct_2 - (PNG_LIBPNG_VER_STRING, (png_voidp)user_error_ptr, - user_error_fn, user_warning_fn, (png_voidp) - user_mem_ptr, user_malloc_fn, user_free_fn); - -After you have these structures, you will need to set up the -error handling. When libpng encounters an error, it expects to -longjmp() back to your routine. Therefore, you will need to call -setjmp() and pass the png_jmpbuf(png_ptr). If you -write the file from different routines, you will need to update -the png_jmpbuf(png_ptr) every time you enter a new routine that will -call a png_*() function. See your documentation of setjmp/longjmp -for your compiler for more information on setjmp/longjmp. See -the discussion on libpng error handling in the Customizing Libpng -section below for more information on the libpng error handling. - - if (setjmp(png_jmpbuf(png_ptr))) - { - png_destroy_write_struct(&png_ptr, &info_ptr); - fclose(fp); - return (ERROR); - } - ... - return; - -If you would rather avoid the complexity of setjmp/longjmp issues, -you can compile libpng with PNG_SETJMP_NOT_SUPPORTED, in which case -errors will result in a call to PNG_ABORT() which defaults to abort(). - -Now you need to set up the output code. The default for libpng is to -use the C function fwrite(). If you use this, you will need to pass a -valid FILE * in the function png_init_io(). Be sure that the file is -opened in binary mode. Again, if you wish to handle writing data in -another way, see the discussion on libpng I/O handling in the Customizing -Libpng section below. - - png_init_io(png_ptr, fp); - -If you are embedding your PNG into a datastream such as MNG, and don't -want libpng to write the 8-byte signature, or if you have already -written the signature in your application, use - - png_set_sig_bytes(png_ptr, 8); - -to inform libpng that it should not write a signature. - -Write callbacks - -At this point, you can set up a callback function that will be -called after each row has been written, which you can use to control -a progress meter or the like. It's demonstrated in pngtest.c. -You must supply a function - - void write_row_callback(png_ptr, png_uint_32 row, - int pass); - { - /* put your code here */ - } - -(You can give it another name that you like instead of "write_row_callback") - -To inform libpng about your function, use - - png_set_write_status_fn(png_ptr, write_row_callback); - -You now have the option of modifying how the compression library will -run. The following functions are mainly for testing, but may be useful -in some cases, like if you need to write PNG files extremely fast and -are willing to give up some compression, or if you want to get the -maximum possible compression at the expense of slower writing. If you -have no special needs in this area, let the library do what it wants by -not calling this function at all, as it has been tuned to deliver a good -speed/compression ratio. The second parameter to png_set_filter() is -the filter method, for which the only valid values are 0 (as of the -July 1999 PNG specification, version 1.2) or 64 (if you are writing -a PNG datastream that is to be embedded in a MNG datastream). The third -parameter is a flag that indicates which filter type(s) are to be tested -for each scanline. See the PNG specification for details on the specific filter -types. - - - /* turn on or off filtering, and/or choose - specific filters. You can use either a single - PNG_FILTER_VALUE_NAME or the bitwise OR of one - or more PNG_FILTER_NAME masks. */ - png_set_filter(png_ptr, 0, - PNG_FILTER_NONE | PNG_FILTER_VALUE_NONE | - PNG_FILTER_SUB | PNG_FILTER_VALUE_SUB | - PNG_FILTER_UP | PNG_FILTER_VALUE_UP | - PNG_FILTER_AVG | PNG_FILTER_VALUE_AVG | - PNG_FILTER_PAETH | PNG_FILTER_VALUE_PAETH| - PNG_ALL_FILTERS); - -If an application -wants to start and stop using particular filters during compression, -it should start out with all of the filters (to ensure that the previous -row of pixels will be stored in case it's needed later), and then add -and remove them after the start of compression. - -If you are writing a PNG datastream that is to be embedded in a MNG -datastream, the second parameter can be either 0 or 64. - -The png_set_compression_*() functions interface to the zlib compression -library, and should mostly be ignored unless you really know what you are -doing. The only generally useful call is png_set_compression_level() -which changes how much time zlib spends on trying to compress the image -data. See the Compression Library (zlib.h and algorithm.txt, distributed -with zlib) for details on the compression levels. - - /* set the zlib compression level */ - png_set_compression_level(png_ptr, - Z_BEST_COMPRESSION); - - /* set other zlib parameters */ - png_set_compression_mem_level(png_ptr, 8); - png_set_compression_strategy(png_ptr, - Z_DEFAULT_STRATEGY); - png_set_compression_window_bits(png_ptr, 15); - png_set_compression_method(png_ptr, 8); - png_set_compression_buffer_size(png_ptr, 8192) - -extern PNG_EXPORT(void,png_set_zbuf_size) - -Setting the contents of info for output - -You now need to fill in the png_info structure with all the data you -wish to write before the actual image. Note that the only thing you -are allowed to write after the image is the text chunks and the time -chunk (as of PNG Specification 1.2, anyway). See png_write_end() and -the latest PNG specification for more information on that. If you -wish to write them before the image, fill them in now, and flag that -data as being valid. If you want to wait until after the data, don't -fill them until png_write_end(). For all the fields in png_info and -their data types, see png.h. For explanations of what the fields -contain, see the PNG specification. - -Some of the more important parts of the png_info are: - - png_set_IHDR(png_ptr, info_ptr, width, height, - bit_depth, color_type, interlace_type, - compression_type, filter_method) - width - holds the width of the image - in pixels (up to 2^31). - height - holds the height of the image - in pixels (up to 2^31). - bit_depth - holds the bit depth of one of the - image channels. - (valid values are 1, 2, 4, 8, 16 - and depend also on the - color_type. See also significant - bits (sBIT) below). - color_type - describes which color/alpha - channels are present. - PNG_COLOR_TYPE_GRAY - (bit depths 1, 2, 4, 8, 16) - PNG_COLOR_TYPE_GRAY_ALPHA - (bit depths 8, 16) - PNG_COLOR_TYPE_PALETTE - (bit depths 1, 2, 4, 8) - PNG_COLOR_TYPE_RGB - (bit_depths 8, 16) - PNG_COLOR_TYPE_RGB_ALPHA - (bit_depths 8, 16) - - PNG_COLOR_MASK_PALETTE - PNG_COLOR_MASK_COLOR - PNG_COLOR_MASK_ALPHA - - interlace_type - PNG_INTERLACE_NONE or - PNG_INTERLACE_ADAM7 - compression_type - (must be - PNG_COMPRESSION_TYPE_DEFAULT) - filter_method - (must be PNG_FILTER_TYPE_DEFAULT - or, if you are writing a PNG to - be embedded in a MNG datastream, - can also be - PNG_INTRAPIXEL_DIFFERENCING) - -If you call png_set_IHDR(), the call must appear before any of the -other png_set_*() functions, which might require access to some of -the IHDR settings. The remaining png_set_*() functions can be called -in any order. - - png_set_PLTE(png_ptr, info_ptr, palette, - num_palette); - palette - the palette for the file - (array of png_color) - num_palette - number of entries in the palette - - png_set_gAMA(png_ptr, info_ptr, gamma); - gamma - the gamma the image was created - at (PNG_INFO_gAMA) - - png_set_sRGB(png_ptr, info_ptr, srgb_intent); - srgb_intent - the rendering intent - (PNG_INFO_sRGB) The presence of - the sRGB chunk means that the pixel - data is in the sRGB color space. - This chunk also implies specific - values of gAMA and cHRM. Rendering - intent is the CSS-1 property that - has been defined by the International - Color Consortium - (http://www.color.org). - It can be one of - PNG_sRGB_INTENT_SATURATION, - PNG_sRGB_INTENT_PERCEPTUAL, - PNG_sRGB_INTENT_ABSOLUTE, or - PNG_sRGB_INTENT_RELATIVE. - - - png_set_sRGB_gAMA_and_cHRM(png_ptr, info_ptr, - srgb_intent); - srgb_intent - the rendering intent - (PNG_INFO_sRGB) The presence of the - sRGB chunk means that the pixel - data is in the sRGB color space. - This function also causes gAMA and - cHRM chunks with the specific values - that are consistent with sRGB to be - written. - - png_set_iCCP(png_ptr, info_ptr, name, compression_type, - profile, proflen); - name - The profile name. - compression - The compression type; always - PNG_COMPRESSION_TYPE_BASE for PNG 1.0. - You may give NULL to this argument to - ignore it. - profile - International Color Consortium color - profile data. May contain NULs. - proflen - length of profile data in bytes. - - png_set_sBIT(png_ptr, info_ptr, sig_bit); - sig_bit - the number of significant bits for - (PNG_INFO_sBIT) each of the gray, red, - green, and blue channels, whichever are - appropriate for the given color type - (png_color_16) - - png_set_tRNS(png_ptr, info_ptr, trans, num_trans, - trans_values); - trans - array of transparent entries for - palette (PNG_INFO_tRNS) - trans_values - graylevel or color sample values of - the single transparent color for - non-paletted images (PNG_INFO_tRNS) - num_trans - number of transparent entries - (PNG_INFO_tRNS) - - png_set_hIST(png_ptr, info_ptr, hist); - (PNG_INFO_hIST) - hist - histogram of palette (array of - png_uint_16) - - png_set_tIME(png_ptr, info_ptr, mod_time); - mod_time - time image was last modified - (PNG_VALID_tIME) - - png_set_bKGD(png_ptr, info_ptr, background); - background - background color (PNG_VALID_bKGD) - - png_set_text(png_ptr, info_ptr, text_ptr, num_text); - text_ptr - array of png_text holding image - comments - text_ptr[i].compression - type of compression used - on "text" PNG_TEXT_COMPRESSION_NONE - PNG_TEXT_COMPRESSION_zTXt - PNG_ITXT_COMPRESSION_NONE - PNG_ITXT_COMPRESSION_zTXt - text_ptr[i].key - keyword for comment. Must contain - 1-79 characters. - text_ptr[i].text - text comments for current - keyword. Can be NULL or empty. - text_ptr[i].text_length - length of text string, - after decompression, 0 for iTXt - text_ptr[i].itxt_length - length of itxt string, - after decompression, 0 for tEXt/zTXt - text_ptr[i].lang - language of comment (NULL or - empty for unknown). - text_ptr[i].translated_keyword - keyword in UTF-8 (NULL - or empty for unknown). - num_text - number of comments - - png_set_sPLT(png_ptr, info_ptr, &palette_ptr, - num_spalettes); - palette_ptr - array of png_sPLT_struct structures - to be added to the list of palettes - in the info structure. - num_spalettes - number of palette structures to be - added. - - png_set_oFFs(png_ptr, info_ptr, offset_x, offset_y, - unit_type); - offset_x - positive offset from the left - edge of the screen - offset_y - positive offset from the top - edge of the screen - unit_type - PNG_OFFSET_PIXEL, PNG_OFFSET_MICROMETER - - png_set_pHYs(png_ptr, info_ptr, res_x, res_y, - unit_type); - res_x - pixels/unit physical resolution - in x direction - res_y - pixels/unit physical resolution - in y direction - unit_type - PNG_RESOLUTION_UNKNOWN, - PNG_RESOLUTION_METER - - png_set_sCAL(png_ptr, info_ptr, unit, width, height) - unit - physical scale units (an integer) - width - width of a pixel in physical scale units - height - height of a pixel in physical scale units - (width and height are doubles) - - png_set_sCAL_s(png_ptr, info_ptr, unit, width, height) - unit - physical scale units (an integer) - width - width of a pixel in physical scale units - height - height of a pixel in physical scale units - (width and height are strings like "2.54") - - png_set_unknown_chunks(png_ptr, info_ptr, &unknowns, - num_unknowns) - unknowns - array of png_unknown_chunk - structures holding unknown chunks - unknowns[i].name - name of unknown chunk - unknowns[i].data - data of unknown chunk - unknowns[i].size - size of unknown chunk's data - unknowns[i].location - position to write chunk in file - 0: do not write chunk - PNG_HAVE_IHDR: before PLTE - PNG_HAVE_PLTE: before IDAT - PNG_AFTER_IDAT: after IDAT - -The "location" member is set automatically according to -what part of the output file has already been written. -You can change its value after calling png_set_unknown_chunks() -as demonstrated in pngtest.c. Within each of the "locations", -the chunks are sequenced according to their position in the -structure (that is, the value of "i", which is the order in which -the chunk was either read from the input file or defined with -png_set_unknown_chunks). - -A quick word about text and num_text. text is an array of png_text -structures. num_text is the number of valid structures in the array. -Each png_text structure holds a language code, a keyword, a text value, -and a compression type. - -The compression types have the same valid numbers as the compression -types of the image data. Currently, the only valid number is zero. -However, you can store text either compressed or uncompressed, unlike -images, which always have to be compressed. So if you don't want the -text compressed, set the compression type to PNG_TEXT_COMPRESSION_NONE. -Because tEXt and zTXt chunks don't have a language field, if you -specify PNG_TEXT_COMPRESSION_NONE or PNG_TEXT_COMPRESSION_zTXt -any language code or translated keyword will not be written out. - -Until text gets around 1000 bytes, it is not worth compressing it. -After the text has been written out to the file, the compression type -is set to PNG_TEXT_COMPRESSION_NONE_WR or PNG_TEXT_COMPRESSION_zTXt_WR, -so that it isn't written out again at the end (in case you are calling -png_write_end() with the same struct. - -The keywords that are given in the PNG Specification are: - - Title Short (one line) title or - caption for image - Author Name of image's creator - Description Description of image (possibly long) - Copyright Copyright notice - Creation Time Time of original image creation - (usually RFC 1123 format, see below) - Software Software used to create the image - Disclaimer Legal disclaimer - Warning Warning of nature of content - Source Device used to create the image - Comment Miscellaneous comment; conversion - from other image format - -The keyword-text pairs work like this. Keywords should be short -simple descriptions of what the comment is about. Some typical -keywords are found in the PNG specification, as is some recommendations -on keywords. You can repeat keywords in a file. You can even write -some text before the image and some after. For example, you may want -to put a description of the image before the image, but leave the -disclaimer until after, so viewers working over modem connections -don't have to wait for the disclaimer to go over the modem before -they start seeing the image. Finally, keywords should be full -words, not abbreviations. Keywords and text are in the ISO 8859-1 -(Latin-1) character set (a superset of regular ASCII) and can not -contain NUL characters, and should not contain control or other -unprintable characters. To make the comments widely readable, stick -with basic ASCII, and avoid machine specific character set extensions -like the IBM-PC character set. The keyword must be present, but -you can leave off the text string on non-compressed pairs. -Compressed pairs must have a text string, as only the text string -is compressed anyway, so the compression would be meaningless. - -PNG supports modification time via the png_time structure. Two -conversion routines are provided, png_convert_from_time_t() for -time_t and png_convert_from_struct_tm() for struct tm. The -time_t routine uses gmtime(). You don't have to use either of -these, but if you wish to fill in the png_time structure directly, -you should provide the time in universal time (GMT) if possible -instead of your local time. Note that the year number is the full -year (e.g. 1998, rather than 98 - PNG is year 2000 compliant!), and -that months start with 1. - -If you want to store the time of the original image creation, you should -use a plain tEXt chunk with the "Creation Time" keyword. This is -necessary because the "creation time" of a PNG image is somewhat vague, -depending on whether you mean the PNG file, the time the image was -created in a non-PNG format, a still photo from which the image was -scanned, or possibly the subject matter itself. In order to facilitate -machine-readable dates, it is recommended that the "Creation Time" -tEXt chunk use RFC 1123 format dates (e.g. "22 May 1997 18:07:10 GMT"), -although this isn't a requirement. Unlike the tIME chunk, the -"Creation Time" tEXt chunk is not expected to be automatically changed -by the software. To facilitate the use of RFC 1123 dates, a function -png_convert_to_rfc1123(png_timep) is provided to convert from PNG -time to an RFC 1123 format string. - -Writing unknown chunks - -You can use the png_set_unknown_chunks function to queue up chunks -for writing. You give it a chunk name, raw data, and a size; that's -all there is to it. The chunks will be written by the next following -png_write_info_before_PLTE, png_write_info, or png_write_end function. -Any chunks previously read into the info structure's unknown-chunk -list will also be written out in a sequence that satisfies the PNG -specification's ordering rules. - -The high-level write interface - -At this point there are two ways to proceed; through the high-level -write interface, or through a sequence of low-level write operations. -You can use the high-level interface if your image data is present -in the info structure. All defined output -transformations are permitted, enabled by the following masks. - - PNG_TRANSFORM_IDENTITY No transformation - PNG_TRANSFORM_PACKING Pack 1, 2 and 4-bit samples - PNG_TRANSFORM_PACKSWAP Change order of packed - pixels to LSB first - PNG_TRANSFORM_INVERT_MONO Invert monochrome images - PNG_TRANSFORM_SHIFT Normalize pixels to the - sBIT depth - PNG_TRANSFORM_BGR Flip RGB to BGR, RGBA - to BGRA - PNG_TRANSFORM_SWAP_ALPHA Flip RGBA to ARGB or GA - to AG - PNG_TRANSFORM_INVERT_ALPHA Change alpha from opacity - to transparency - PNG_TRANSFORM_SWAP_ENDIAN Byte-swap 16-bit samples - PNG_TRANSFORM_STRIP_FILLER Strip out filler - bytes (deprecated). - PNG_TRANSFORM_STRIP_FILLER_BEFORE Strip out leading - filler bytes - PNG_TRANSFORM_STRIP_FILLER_AFTER Strip out trailing - filler bytes - -If you have valid image data in the info structure (you can use -png_set_rows() to put image data in the info structure), simply do this: - - png_write_png(png_ptr, info_ptr, png_transforms, NULL) - -where png_transforms is an integer containing the bitwise OR of some set of -transformation flags. This call is equivalent to png_write_info(), -followed the set of transformations indicated by the transform mask, -then png_write_image(), and finally png_write_end(). - -(The final parameter of this call is not yet used. Someday it might point -to transformation parameters required by some future output transform.) - -You must use png_transforms and not call any png_set_transform() functions -when you use png_write_png(). - -The low-level write interface - -If you are going the low-level route instead, you are now ready to -write all the file information up to the actual image data. You do -this with a call to png_write_info(). - - png_write_info(png_ptr, info_ptr); - -Note that there is one transformation you may need to do before -png_write_info(). In PNG files, the alpha channel in an image is the -level of opacity. If your data is supplied as a level of -transparency, you can invert the alpha channel before you write it, so -that 0 is fully transparent and 255 (in 8-bit or paletted images) or -65535 (in 16-bit images) is fully opaque, with - - png_set_invert_alpha(png_ptr); - -This must appear before png_write_info() instead of later with the -other transformations because in the case of paletted images the tRNS -chunk data has to be inverted before the tRNS chunk is written. If -your image is not a paletted image, the tRNS data (which in such cases -represents a single color to be rendered as transparent) won't need to -be changed, and you can safely do this transformation after your -png_write_info() call. - -If you need to write a private chunk that you want to appear before -the PLTE chunk when PLTE is present, you can write the PNG info in -two steps, and insert code to write your own chunk between them: - - png_write_info_before_PLTE(png_ptr, info_ptr); - png_set_unknown_chunks(png_ptr, info_ptr, ...); - png_write_info(png_ptr, info_ptr); - -After you've written the file information, you can set up the library -to handle any special transformations of the image data. The various -ways to transform the data will be described in the order that they -should occur. This is important, as some of these change the color -type and/or bit depth of the data, and some others only work on -certain color types and bit depths. Even though each transformation -checks to see if it has data that it can do something with, you should -make sure to only enable a transformation if it will be valid for the -data. For example, don't swap red and blue on grayscale data. - -PNG files store RGB pixels packed into 3 or 6 bytes. This code tells -the library to strip input data that has 4 or 8 bytes per pixel down -to 3 or 6 bytes (or strip 2 or 4-byte grayscale+filler data to 1 or 2 -bytes per pixel). - - png_set_filler(png_ptr, 0, PNG_FILLER_BEFORE); - -where the 0 is unused, and the location is either PNG_FILLER_BEFORE or -PNG_FILLER_AFTER, depending upon whether the filler byte in the pixel -is stored XRGB or RGBX. - -PNG files pack pixels of bit depths 1, 2, and 4 into bytes as small as -they can, resulting in, for example, 8 pixels per byte for 1 bit files. -If the data is supplied at 1 pixel per byte, use this code, which will -correctly pack the pixels into a single byte: - - png_set_packing(png_ptr); - -PNG files reduce possible bit depths to 1, 2, 4, 8, and 16. If your -data is of another bit depth, you can write an sBIT chunk into the -file so that decoders can recover the original data if desired. - - /* Set the true bit depth of the image data */ - if (color_type & PNG_COLOR_MASK_COLOR) - { - sig_bit.red = true_bit_depth; - sig_bit.green = true_bit_depth; - sig_bit.blue = true_bit_depth; - } - else - { - sig_bit.gray = true_bit_depth; - } - if (color_type & PNG_COLOR_MASK_ALPHA) - { - sig_bit.alpha = true_bit_depth; - } - - png_set_sBIT(png_ptr, info_ptr, &sig_bit); - -If the data is stored in the row buffer in a bit depth other than -one supported by PNG (e.g. 3 bit data in the range 0-7 for a 4-bit PNG), -this will scale the values to appear to be the correct bit depth as -is required by PNG. - - png_set_shift(png_ptr, &sig_bit); - -PNG files store 16 bit pixels in network byte order (big-endian, -ie. most significant bits first). This code would be used if they are -supplied the other way (little-endian, i.e. least significant bits -first, the way PCs store them): - - if (bit_depth > 8) - png_set_swap(png_ptr); - -If you are using packed-pixel images (1, 2, or 4 bits/pixel), and you -need to change the order the pixels are packed into bytes, you can use: - - if (bit_depth < 8) - png_set_packswap(png_ptr); - -PNG files store 3 color pixels in red, green, blue order. This code -would be used if they are supplied as blue, green, red: - - png_set_bgr(png_ptr); - -PNG files describe monochrome as black being zero and white being -one. This code would be used if the pixels are supplied with this reversed -(black being one and white being zero): - - png_set_invert_mono(png_ptr); - -Finally, you can write your own transformation function if none of -the existing ones meets your needs. This is done by setting a callback -with - - png_set_write_user_transform_fn(png_ptr, - write_transform_fn); - -You must supply the function - - void write_transform_fn(png_ptr ptr, row_info_ptr - row_info, png_bytep data) - -See pngtest.c for a working example. Your function will be called -before any of the other transformations are processed. - -You can also set up a pointer to a user structure for use by your -callback function. - - png_set_user_transform_info(png_ptr, user_ptr, 0, 0); - -The user_channels and user_depth parameters of this function are ignored -when writing; you can set them to zero as shown. - -You can retrieve the pointer via the function png_get_user_transform_ptr(). -For example: - - voidp write_user_transform_ptr = - png_get_user_transform_ptr(png_ptr); - -It is possible to have libpng flush any pending output, either manually, -or automatically after a certain number of lines have been written. To -flush the output stream a single time call: - - png_write_flush(png_ptr); - -and to have libpng flush the output stream periodically after a certain -number of scanlines have been written, call: - - png_set_flush(png_ptr, nrows); - -Note that the distance between rows is from the last time png_write_flush() -was called, or the first row of the image if it has never been called. -So if you write 50 lines, and then png_set_flush 25, it will flush the -output on the next scanline, and every 25 lines thereafter, unless -png_write_flush() is called before 25 more lines have been written. -If nrows is too small (less than about 10 lines for a 640 pixel wide -RGB image) the image compression may decrease noticeably (although this -may be acceptable for real-time applications). Infrequent flushing will -only degrade the compression performance by a few percent over images -that do not use flushing. - -Writing the image data - -That's it for the transformations. Now you can write the image data. -The simplest way to do this is in one function call. If you have the -whole image in memory, you can just call png_write_image() and libpng -will write the image. You will need to pass in an array of pointers to -each row. This function automatically handles interlacing, so you don't -need to call png_set_interlace_handling() or call this function multiple -times, or any of that other stuff necessary with png_write_rows(). - - png_write_image(png_ptr, row_pointers); - -where row_pointers is: - - png_byte *row_pointers[height]; - -You can point to void or char or whatever you use for pixels. - -If you don't want to write the whole image at once, you can -use png_write_rows() instead. If the file is not interlaced, -this is simple: - - png_write_rows(png_ptr, row_pointers, - number_of_rows); - -row_pointers is the same as in the png_write_image() call. - -If you are just writing one row at a time, you can do this with -a single row_pointer instead of an array of row_pointers: - - png_bytep row_pointer = row; - - png_write_row(png_ptr, row_pointer); - -When the file is interlaced, things can get a good deal more -complicated. The only currently (as of the PNG Specification -version 1.2, dated July 1999) defined interlacing scheme for PNG files -is the "Adam7" interlace scheme, that breaks down an -image into seven smaller images of varying size. libpng will build -these images for you, or you can do them yourself. If you want to -build them yourself, see the PNG specification for details of which -pixels to write when. - -If you don't want libpng to handle the interlacing details, just -use png_set_interlace_handling() and call png_write_rows() the -correct number of times to write all seven sub-images. - -If you want libpng to build the sub-images, call this before you start -writing any rows: - - number_of_passes = - png_set_interlace_handling(png_ptr); - -This will return the number of passes needed. Currently, this -is seven, but may change if another interlace type is added. - -Then write the complete image number_of_passes times. - - png_write_rows(png_ptr, row_pointers, - number_of_rows); - -As some of these rows are not used, and thus return immediately, -you may want to read about interlacing in the PNG specification, -and only update the rows that are actually used. - -Finishing a sequential write - -After you are finished writing the image, you should finish writing -the file. If you are interested in writing comments or time, you should -pass an appropriately filled png_info pointer. If you are not interested, -you can pass NULL. - - png_write_end(png_ptr, info_ptr); - -When you are done, you can free all memory used by libpng like this: - - png_destroy_write_struct(&png_ptr, &info_ptr); - -It is also possible to individually free the info_ptr members that -point to libpng-allocated storage with the following function: - - png_free_data(png_ptr, info_ptr, mask, seq) - mask - identifies data to be freed, a mask - containing the bitwise OR of one or - more of - PNG_FREE_PLTE, PNG_FREE_TRNS, - PNG_FREE_HIST, PNG_FREE_ICCP, - PNG_FREE_PCAL, PNG_FREE_ROWS, - PNG_FREE_SCAL, PNG_FREE_SPLT, - PNG_FREE_TEXT, PNG_FREE_UNKN, - or simply PNG_FREE_ALL - seq - sequence number of item to be freed - (-1 for all items) - -This function may be safely called when the relevant storage has -already been freed, or has not yet been allocated, or was allocated -by the user and not by libpng, and will in those -cases do nothing. The "seq" parameter is ignored if only one item -of the selected data type, such as PLTE, is allowed. If "seq" is not --1, and multiple items are allowed for the data type identified in -the mask, such as text or sPLT, only the n'th item in the structure -is freed, where n is "seq". - -If you allocated data such as a palette that you passed -in to libpng with png_set_*, you must not free it until just before the call to -png_destroy_write_struct(). - -The default behavior is only to free data that was allocated internally -by libpng. This can be changed, so that libpng will not free the data, -or so that it will free data that was allocated by the user with png_malloc() -or png_zalloc() and passed in via a png_set_*() function, with - - png_data_freer(png_ptr, info_ptr, freer, mask) - mask - which data elements are affected - same choices as in png_free_data() - freer - one of - PNG_DESTROY_WILL_FREE_DATA - PNG_SET_WILL_FREE_DATA - PNG_USER_WILL_FREE_DATA - -For example, to transfer responsibility for some data from a read structure -to a write structure, you could use - - png_data_freer(read_ptr, read_info_ptr, - PNG_USER_WILL_FREE_DATA, - PNG_FREE_PLTE|PNG_FREE_tRNS|PNG_FREE_hIST) - png_data_freer(write_ptr, write_info_ptr, - PNG_DESTROY_WILL_FREE_DATA, - PNG_FREE_PLTE|PNG_FREE_tRNS|PNG_FREE_hIST) - -thereby briefly reassigning responsibility for freeing to the user but -immediately afterwards reassigning it once more to the write_destroy -function. Having done this, it would then be safe to destroy the read -structure and continue to use the PLTE, tRNS, and hIST data in the write -structure. - -This function only affects data that has already been allocated. -You can call this function before calling after the png_set_*() functions -to control whether the user or png_destroy_*() is supposed to free the data. -When the user assumes responsibility for libpng-allocated data, the -application must use -png_free() to free it, and when the user transfers responsibility to libpng -for data that the user has allocated, the user must have used png_malloc() -or png_zalloc() to allocate it. - -If you allocated text_ptr.text, text_ptr.lang, and text_ptr.translated_keyword -separately, do not transfer responsibility for freeing text_ptr to libpng, -because when libpng fills a png_text structure it combines these members with -the key member, and png_free_data() will free only text_ptr.key. Similarly, -if you transfer responsibility for free'ing text_ptr from libpng to your -application, your application must not separately free those members. -For a more compact example of writing a PNG image, see the file example.c. - -V. Modifying/Customizing libpng: - -There are two issues here. The first is changing how libpng does -standard things like memory allocation, input/output, and error handling. -The second deals with more complicated things like adding new chunks, -adding new transformations, and generally changing how libpng works. -Both of those are compile-time issues; that is, they are generally -determined at the time the code is written, and there is rarely a need -to provide the user with a means of changing them. - -Memory allocation, input/output, and error handling - -All of the memory allocation, input/output, and error handling in libpng -goes through callbacks that are user-settable. The default routines are -in pngmem.c, pngrio.c, pngwio.c, and pngerror.c, respectively. To change -these functions, call the appropriate png_set_*_fn() function. - -Memory allocation is done through the functions png_malloc() -and png_free(). These currently just call the standard C functions. If -your pointers can't access more then 64K at a time, you will want to set -MAXSEG_64K in zlib.h. Since it is unlikely that the method of handling -memory allocation on a platform will change between applications, these -functions must be modified in the library at compile time. If you prefer -to use a different method of allocating and freeing data, you can use -png_create_read_struct_2() or png_create_write_struct_2() to register -your own functions as described above. -These functions also provide a void pointer that can be retrieved via - - mem_ptr=png_get_mem_ptr(png_ptr); - -Your replacement memory functions must have prototypes as follows: - - png_voidp malloc_fn(png_structp png_ptr, - png_size_t size); - void free_fn(png_structp png_ptr, png_voidp ptr); - -Your malloc_fn() must return NULL in case of failure. The png_malloc() -function will normally call png_error() if it receives a NULL from the -system memory allocator or from your replacement malloc_fn(). - -Your free_fn() will never be called with a NULL ptr, since libpng's -png_free() checks for NULL before calling free_fn(). - -Input/Output in libpng is done through png_read() and png_write(), -which currently just call fread() and fwrite(). The FILE * is stored in -png_struct and is initialized via png_init_io(). If you wish to change -the method of I/O, the library supplies callbacks that you can set -through the function png_set_read_fn() and png_set_write_fn() at run -time, instead of calling the png_init_io() function. These functions -also provide a void pointer that can be retrieved via the function -png_get_io_ptr(). For example: - - png_set_read_fn(png_structp read_ptr, - voidp read_io_ptr, png_rw_ptr read_data_fn) - - png_set_write_fn(png_structp write_ptr, - voidp write_io_ptr, png_rw_ptr write_data_fn, - png_flush_ptr output_flush_fn); - - voidp read_io_ptr = png_get_io_ptr(read_ptr); - voidp write_io_ptr = png_get_io_ptr(write_ptr); - -The replacement I/O functions must have prototypes as follows: - - void user_read_data(png_structp png_ptr, - png_bytep data, png_size_t length); - void user_write_data(png_structp png_ptr, - png_bytep data, png_size_t length); - void user_flush_data(png_structp png_ptr); - -The user_read_data() function is responsible for detecting and -handling end-of-data errors. - -Supplying NULL for the read, write, or flush functions sets them back -to using the default C stream functions, which expect the io_ptr to -point to a standard *FILE structure. It is probably a mistake -to use NULL for one of write_data_fn and output_flush_fn but not both -of them, unless you have built libpng with PNG_NO_WRITE_FLUSH defined. -It is an error to read from a write stream, and vice versa. - -Error handling in libpng is done through png_error() and png_warning(). -Errors handled through png_error() are fatal, meaning that png_error() -should never return to its caller. Currently, this is handled via -setjmp() and longjmp() (unless you have compiled libpng with -PNG_SETJMP_NOT_SUPPORTED, in which case it is handled via PNG_ABORT()), -but you could change this to do things like exit() if you should wish. - -On non-fatal errors, png_warning() is called -to print a warning message, and then control returns to the calling code. -By default png_error() and png_warning() print a message on stderr via -fprintf() unless the library is compiled with PNG_NO_CONSOLE_IO defined -(because you don't want the messages) or PNG_NO_STDIO defined (because -fprintf() isn't available). If you wish to change the behavior of the error -functions, you will need to set up your own message callbacks. These -functions are normally supplied at the time that the png_struct is created. -It is also possible to redirect errors and warnings to your own replacement -functions after png_create_*_struct() has been called by calling: - - png_set_error_fn(png_structp png_ptr, - png_voidp error_ptr, png_error_ptr error_fn, - png_error_ptr warning_fn); - - png_voidp error_ptr = png_get_error_ptr(png_ptr); - -If NULL is supplied for either error_fn or warning_fn, then the libpng -default function will be used, calling fprintf() and/or longjmp() if a -problem is encountered. The replacement error functions should have -parameters as follows: - - void user_error_fn(png_structp png_ptr, - png_const_charp error_msg); - void user_warning_fn(png_structp png_ptr, - png_const_charp warning_msg); - -The motivation behind using setjmp() and longjmp() is the C++ throw and -catch exception handling methods. This makes the code much easier to write, -as there is no need to check every return code of every function call. -However, there are some uncertainties about the status of local variables -after a longjmp, so the user may want to be careful about doing anything after -setjmp returns non-zero besides returning itself. Consult your compiler -documentation for more details. For an alternative approach, you may wish -to use the "cexcept" facility (see http://cexcept.sourceforge.net). - -Custom chunks - -If you need to read or write custom chunks, you may need to get deeper -into the libpng code. The library now has mechanisms for storing -and writing chunks of unknown type; you can even declare callbacks -for custom chunks. However, this may not be good enough if the -library code itself needs to know about interactions between your -chunk and existing `intrinsic' chunks. - -If you need to write a new intrinsic chunk, first read the PNG -specification. Acquire a first level of -understanding of how it works. Pay particular attention to the -sections that describe chunk names, and look at how other chunks were -designed, so you can do things similarly. Second, check out the -sections of libpng that read and write chunks. Try to find a chunk -that is similar to yours and use it as a template. More details can -be found in the comments inside the code. It is best to handle unknown -chunks in a generic method, via callback functions, instead of by -modifying libpng functions. - -If you wish to write your own transformation for the data, look through -the part of the code that does the transformations, and check out some of -the simpler ones to get an idea of how they work. Try to find a similar -transformation to the one you want to add and copy off of it. More details -can be found in the comments inside the code itself. - -Configuring for 16 bit platforms - -You will want to look into zconf.h to tell zlib (and thus libpng) that -it cannot allocate more then 64K at a time. Even if you can, the memory -won't be accessible. So limit zlib and libpng to 64K by defining MAXSEG_64K. - -Configuring for DOS - -For DOS users who only have access to the lower 640K, you will -have to limit zlib's memory usage via a png_set_compression_mem_level() -call. See zlib.h or zconf.h in the zlib library for more information. - -Configuring for Medium Model - -Libpng's support for medium model has been tested on most of the popular -compilers. Make sure MAXSEG_64K gets defined, USE_FAR_KEYWORD gets -defined, and FAR gets defined to far in pngconf.h, and you should be -all set. Everything in the library (except for zlib's structure) is -expecting far data. You must use the typedefs with the p or pp on -the end for pointers (or at least look at them and be careful). Make -note that the rows of data are defined as png_bytepp, which is an -unsigned char far * far *. - -Configuring for gui/windowing platforms: - -You will need to write new error and warning functions that use the GUI -interface, as described previously, and set them to be the error and -warning functions at the time that png_create_*_struct() is called, -in order to have them available during the structure initialization. -They can be changed later via png_set_error_fn(). On some compilers, -you may also have to change the memory allocators (png_malloc, etc.). - -Configuring for compiler xxx: - -All includes for libpng are in pngconf.h. If you need to add, change -or delete an include, this is the place to do it. -The includes that are not needed outside libpng are protected by the -PNG_INTERNAL definition, which is only defined for those routines inside -libpng itself. The files in libpng proper only include png.h, which -includes pngconf.h. - -Configuring zlib: - -There are special functions to configure the compression. Perhaps the -most useful one changes the compression level, which currently uses -input compression values in the range 0 - 9. The library normally -uses the default compression level (Z_DEFAULT_COMPRESSION = 6). Tests -have shown that for a large majority of images, compression values in -the range 3-6 compress nearly as well as higher levels, and do so much -faster. For online applications it may be desirable to have maximum speed -(Z_BEST_SPEED = 1). With versions of zlib after v0.99, you can also -specify no compression (Z_NO_COMPRESSION = 0), but this would create -files larger than just storing the raw bitmap. You can specify the -compression level by calling: - - png_set_compression_level(png_ptr, level); - -Another useful one is to reduce the memory level used by the library. -The memory level defaults to 8, but it can be lowered if you are -short on memory (running DOS, for example, where you only have 640K). -Note that the memory level does have an effect on compression; among -other things, lower levels will result in sections of incompressible -data being emitted in smaller stored blocks, with a correspondingly -larger relative overhead of up to 15% in the worst case. - - png_set_compression_mem_level(png_ptr, level); - -The other functions are for configuring zlib. They are not recommended -for normal use and may result in writing an invalid PNG file. See -zlib.h for more information on what these mean. - - png_set_compression_strategy(png_ptr, - strategy); - png_set_compression_window_bits(png_ptr, - window_bits); - png_set_compression_method(png_ptr, method); - png_set_compression_buffer_size(png_ptr, size); - -Controlling row filtering - -If you want to control whether libpng uses filtering or not, which -filters are used, and how it goes about picking row filters, you -can call one of these functions. The selection and configuration -of row filters can have a significant impact on the size and -encoding speed and a somewhat lesser impact on the decoding speed -of an image. Filtering is enabled by default for RGB and grayscale -images (with and without alpha), but not for paletted images nor -for any images with bit depths less than 8 bits/pixel. - -The 'method' parameter sets the main filtering method, which is -currently only '0' in the PNG 1.2 specification. The 'filters' -parameter sets which filter(s), if any, should be used for each -scanline. Possible values are PNG_ALL_FILTERS and PNG_NO_FILTERS -to turn filtering on and off, respectively. - -Individual filter types are PNG_FILTER_NONE, PNG_FILTER_SUB, -PNG_FILTER_UP, PNG_FILTER_AVG, PNG_FILTER_PAETH, which can be bitwise -ORed together with '|' to specify one or more filters to use. -These filters are described in more detail in the PNG specification. -If you intend to change the filter type during the course of writing -the image, you should start with flags set for all of the filters -you intend to use so that libpng can initialize its internal -structures appropriately for all of the filter types. (Note that this -means the first row must always be adaptively filtered, because libpng -currently does not allocate the filter buffers until png_write_row() -is called for the first time.) - - filters = PNG_FILTER_NONE | PNG_FILTER_SUB - PNG_FILTER_UP | PNG_FILTER_AVG | - PNG_FILTER_PAETH | PNG_ALL_FILTERS; - - png_set_filter(png_ptr, PNG_FILTER_TYPE_BASE, - filters); - The second parameter can also be - PNG_INTRAPIXEL_DIFFERENCING if you are - writing a PNG to be embedded in a MNG - datastream. This parameter must be the - same as the value of filter_method used - in png_set_IHDR(). - -It is also possible to influence how libpng chooses from among the -available filters. This is done in one or both of two ways - by -telling it how important it is to keep the same filter for successive -rows, and by telling it the relative computational costs of the filters. - - double weights[3] = {1.5, 1.3, 1.1}, - costs[PNG_FILTER_VALUE_LAST] = - {1.0, 1.3, 1.3, 1.5, 1.7}; - - png_set_filter_heuristics(png_ptr, - PNG_FILTER_HEURISTIC_WEIGHTED, 3, - weights, costs); - -The weights are multiplying factors that indicate to libpng that the -row filter should be the same for successive rows unless another row filter -is that many times better than the previous filter. In the above example, -if the previous 3 filters were SUB, SUB, NONE, the SUB filter could have a -"sum of absolute differences" 1.5 x 1.3 times higher than other filters -and still be chosen, while the NONE filter could have a sum 1.1 times -higher than other filters and still be chosen. Unspecified weights are -taken to be 1.0, and the specified weights should probably be declining -like those above in order to emphasize recent filters over older filters. - -The filter costs specify for each filter type a relative decoding cost -to be considered when selecting row filters. This means that filters -with higher costs are less likely to be chosen over filters with lower -costs, unless their "sum of absolute differences" is that much smaller. -The costs do not necessarily reflect the exact computational speeds of -the various filters, since this would unduly influence the final image -size. - -Note that the numbers above were invented purely for this example and -are given only to help explain the function usage. Little testing has -been done to find optimum values for either the costs or the weights. - -Removing unwanted object code - -There are a bunch of #define's in pngconf.h that control what parts of -libpng are compiled. All the defines end in _SUPPORTED. If you are -never going to use a capability, you can change the #define to #undef -before recompiling libpng and save yourself code and data space, or -you can turn off individual capabilities with defines that begin with -PNG_NO_. - -You can also turn all of the transforms and ancillary chunk capabilities -off en masse with compiler directives that define -PNG_NO_READ[or WRITE]_TRANSFORMS, or PNG_NO_READ[or WRITE]_ANCILLARY_CHUNKS, -or all four, -along with directives to turn on any of the capabilities that you do -want. The PNG_NO_READ[or WRITE]_TRANSFORMS directives disable -the extra transformations but still leave the library fully capable of reading -and writing PNG files with all known public chunks -Use of the PNG_NO_READ[or WRITE]_ANCILLARY_CHUNKS directive -produces a library that is incapable of reading or writing ancillary chunks. -If you are not using the progressive reading capability, you can -turn that off with PNG_NO_PROGRESSIVE_READ (don't confuse -this with the INTERLACING capability, which you'll still have). - -All the reading and writing specific code are in separate files, so the -linker should only grab the files it needs. However, if you want to -make sure, or if you are building a stand alone library, all the -reading files start with pngr and all the writing files start with -pngw. The files that don't match either (like png.c, pngtrans.c, etc.) -are used for both reading and writing, and always need to be included. -The progressive reader is in pngpread.c - -If you are creating or distributing a dynamically linked library (a .so -or DLL file), you should not remove or disable any parts of the library, -as this will cause applications linked with different versions of the -library to fail if they call functions not available in your library. -The size of the library itself should not be an issue, because only -those sections that are actually used will be loaded into memory. - -Requesting debug printout - -The macro definition PNG_DEBUG can be used to request debugging -printout. Set it to an integer value in the range 0 to 3. Higher -numbers result in increasing amounts of debugging information. The -information is printed to the "stderr" file, unless another file -name is specified in the PNG_DEBUG_FILE macro definition. - -When PNG_DEBUG > 0, the following functions (macros) become available: - - png_debug(level, message) - png_debug1(level, message, p1) - png_debug2(level, message, p1, p2) - -in which "level" is compared to PNG_DEBUG to decide whether to print -the message, "message" is the formatted string to be printed, -and p1 and p2 are parameters that are to be embedded in the string -according to printf-style formatting directives. For example, - - png_debug1(2, "foo=%d\n", foo); - -is expanded to - - if(PNG_DEBUG > 2) - fprintf(PNG_DEBUG_FILE, "foo=%d\n", foo); - -When PNG_DEBUG is defined but is zero, the macros aren't defined, but you -can still use PNG_DEBUG to control your own debugging: - - #ifdef PNG_DEBUG - fprintf(stderr, ... - #endif - -When PNG_DEBUG = 1, the macros are defined, but only png_debug statements -having level = 0 will be printed. There aren't any such statements in -this version of libpng, but if you insert some they will be printed. - -VI. MNG support - -The MNG specification (available at http://www.libpng.org/pub/mng) allows -certain extensions to PNG for PNG images that are embedded in MNG datastreams. -Libpng can support some of these extensions. To enable them, use the -png_permit_mng_features() function: - - feature_set = png_permit_mng_features(png_ptr, mask) - mask is a png_uint_32 containing the bitwise OR of the - features you want to enable. These include - PNG_FLAG_MNG_EMPTY_PLTE - PNG_FLAG_MNG_FILTER_64 - PNG_ALL_MNG_FEATURES - feature_set is a png_uint_32 that is the bitwise AND of - your mask with the set of MNG features that is - supported by the version of libpng that you are using. - -It is an error to use this function when reading or writing a standalone -PNG file with the PNG 8-byte signature. The PNG datastream must be wrapped -in a MNG datastream. As a minimum, it must have the MNG 8-byte signature -and the MHDR and MEND chunks. Libpng does not provide support for these -or any other MNG chunks; your application must provide its own support for -them. You may wish to consider using libmng (available at -http://www.libmng.com) instead. - -VII. Changes to Libpng from version 0.88 - -It should be noted that versions of libpng later than 0.96 are not -distributed by the original libpng author, Guy Schalnat, nor by -Andreas Dilger, who had taken over from Guy during 1996 and 1997, and -distributed versions 0.89 through 0.96, but rather by another member -of the original PNG Group, Glenn Randers-Pehrson. Guy and Andreas are -still alive and well, but they have moved on to other things. - -The old libpng functions png_read_init(), png_write_init(), -png_info_init(), png_read_destroy(), and png_write_destroy() have been -moved to PNG_INTERNAL in version 0.95 to discourage their use. These -functions will be removed from libpng version 2.0.0. - -The preferred method of creating and initializing the libpng structures is -via the png_create_read_struct(), png_create_write_struct(), and -png_create_info_struct() because they isolate the size of the structures -from the application, allow version error checking, and also allow the -use of custom error handling routines during the initialization, which -the old functions do not. The functions png_read_destroy() and -png_write_destroy() do not actually free the memory that libpng -allocated for these structs, but just reset the data structures, so they -can be used instead of png_destroy_read_struct() and -png_destroy_write_struct() if you feel there is too much system overhead -allocating and freeing the png_struct for each image read. - -Setting the error callbacks via png_set_message_fn() before -png_read_init() as was suggested in libpng-0.88 is no longer supported -because this caused applications that do not use custom error functions -to fail if the png_ptr was not initialized to zero. It is still possible -to set the error callbacks AFTER png_read_init(), or to change them with -png_set_error_fn(), which is essentially the same function, but with a new -name to force compilation errors with applications that try to use the old -method. - -Starting with version 1.0.7, you can find out which version of the library -you are using at run-time: - - png_uint_32 libpng_vn = png_access_version_number(); - -The number libpng_vn is constructed from the major version, minor -version with leading zero, and release number with leading zero, -(e.g., libpng_vn for version 1.0.7 is 10007). - -You can also check which version of png.h you used when compiling your -application: - - png_uint_32 application_vn = PNG_LIBPNG_VER; - -VIII. Changes to Libpng from version 1.0.x to 1.2.x - -Support for user memory management was enabled by default. To -accomplish this, the functions png_create_read_struct_2(), -png_create_write_struct_2(), png_set_mem_fn(), png_get_mem_ptr(), -png_malloc_default(), and png_free_default() were added. - -Support for certain MNG features was enabled. - -Support for numbered error messages was added. However, we never got -around to actually numbering the error messages. The function -png_set_strip_error_numbers() was added (Note: the prototype for this -function was inadvertently removed from png.h in PNG_NO_ASSEMBLER_CODE -builds of libpng-1.2.15. It was restored in libpng-1.2.36). - -The png_malloc_warn() function was added at libpng-1.2.3. This issues -a png_warning and returns NULL instead of aborting when it fails to -acquire the requested memory allocation. - -Support for setting user limits on image width and height was enabled -by default. The functions png_set_user_limits(), png_get_user_width_max(), -and png_get_user_height_max() were added at libpng-1.2.6. - -The png_set_add_alpha() function was added at libpng-1.2.7. - -The function png_set_expand_gray_1_2_4_to_8() was added at libpng-1.2.9. -Unlike png_set_gray_1_2_4_to_8(), the new function does not expand the -tRNS chunk to alpha. The png_set_gray_1_2_4_to_8() function is -deprecated. - -A number of macro definitions in support of runtime selection of -assembler code features (especially Intel MMX code support) were -added at libpng-1.2.0: - - PNG_ASM_FLAG_MMX_SUPPORT_COMPILED - PNG_ASM_FLAG_MMX_SUPPORT_IN_CPU - PNG_ASM_FLAG_MMX_READ_COMBINE_ROW - PNG_ASM_FLAG_MMX_READ_INTERLACE - PNG_ASM_FLAG_MMX_READ_FILTER_SUB - PNG_ASM_FLAG_MMX_READ_FILTER_UP - PNG_ASM_FLAG_MMX_READ_FILTER_AVG - PNG_ASM_FLAG_MMX_READ_FILTER_PAETH - PNG_ASM_FLAGS_INITIALIZED - PNG_MMX_READ_FLAGS - PNG_MMX_FLAGS - PNG_MMX_WRITE_FLAGS - PNG_MMX_FLAGS - -We added the following functions in support of runtime -selection of assembler code features: - - png_get_mmx_flagmask() - png_set_mmx_thresholds() - png_get_asm_flags() - png_get_mmx_bitdepth_threshold() - png_get_mmx_rowbytes_threshold() - png_set_asm_flags() - -We replaced all of these functions with simple stubs in libpng-1.2.20, -when the Intel assembler code was removed due to a licensing issue. - -IX. (Omitted) - -X. Detecting libpng - -The png_get_io_ptr() function has been present since libpng-0.88, has never -changed, and is unaffected by conditional compilation macros. It is the -best choice for use in configure scripts for detecting the presence of any -libpng version since 0.88. - -XI. Source code repository - -Since about February 2009, version 1.2.34, libpng has been under "git" source -control. The git repository was built from old libpng-x.y.z.tar.gz files -going back to version 0.70. You can access the git repository (read only) -at - - git://libpng.git.sourceforge.net/gitroot/libpng - -or you can browse it via "gitweb" at - - http://libpng.git.sourceforge.net/git/gitweb.cgi?p=libpng - -Patches can be sent to glennrp at users.sourceforge.net or to -png-mng-implement at lists.sourceforge.net or you can upload them to -the libpng bug tracker at - - http://libpng.sourceforge.net - -XII. Coding style - -Our coding style is similar to the "Allman" style, with curly -braces on separate lines: - - if (condition) - { - action; - } - - else if (another condition) - { - another action; - } - -The braces can be omitted from simple one-line actions: - - if (condition) - return (0); - -We use 3-space indentation, except for continued statements which -are usually indented the same as the first line of the statement -plus four more spaces. - -Comments appear with the leading "/*" at the same indentation as -the statement that follows the comment: - - /* Single-line comment */ - statement; - - /* Multiple-line - * comment - */ - statement; - -Very short comments can be placed at the end of the statement -to which they pertain: - - statement; /* comment */ - -We don't use C++ style ("//") comments. We have, however, -used them in the past in some now-abandoned MMX assembler -code. - -Functions and their curly brackets are not indented, and -exported functions are marked with PNGAPI: - - /* This is a public function that is visible to - * application programers. It does thus-and-so. - */ - void PNGAPI - png_exported_function(png_ptr, png_info, foo) - { - body; - } - -The prototypes for all exported functions appear in png.h. - -We mark all non-exported functions with "/* PRIVATE */"": - - void /* PRIVATE */ - png_non_exported_function(png_ptr, png_info, foo) - { - body; - } - -The prototypes for non-exported functions can appear in -pngpriv.h or in the file where the function is located. - -The names of all exported functions and variables begin -with "png_", and all publicly visible C preprocessor -macros begin with "PNG_". - -We put a space after each comma and after each semicolon -in "for" statments, and we put spaces before and after each -C binary operator and after "for" or "while". We don't -put a space between a typecast and the expression being -cast, nor do we put one between a function name and the -left parenthesis that follows it: - - for (i = 2; i > 0; --i) - x[i] = a(x) + (int)b; - -Other rules can be inferred by inspecting the libpng -source. - -XIII. Y2K Compliance in libpng - -June 4, 2009 - -Since the PNG Development group is an ad-hoc body, we can't make -an official declaration. - -This is your unofficial assurance that libpng from version 0.71 and -upward through 1.2.37 are Y2K compliant. It is my belief that earlier -versions were also Y2K compliant. - -Libpng only has three year fields. One is a 2-byte unsigned integer that -will hold years up to 65535. The other two hold the date in text -format, and will hold years up to 9999. - -The integer is - "png_uint_16 year" in png_time_struct. - -The strings are - "png_charp time_buffer" in png_struct and - "near_time_buffer", which is a local character string in png.c. - -There are seven time-related functions: - - png_convert_to_rfc_1123() in png.c - (formerly png_convert_to_rfc_1152() in error) - png_convert_from_struct_tm() in pngwrite.c, called - in pngwrite.c - png_convert_from_time_t() in pngwrite.c - png_get_tIME() in pngget.c - png_handle_tIME() in pngrutil.c, called in pngread.c - png_set_tIME() in pngset.c - png_write_tIME() in pngwutil.c, called in pngwrite.c - -All appear to handle dates properly in a Y2K environment. The -png_convert_from_time_t() function calls gmtime() to convert from system -clock time, which returns (year - 1900), which we properly convert to -the full 4-digit year. There is a possibility that applications using -libpng are not passing 4-digit years into the png_convert_to_rfc_1123() -function, or that they are incorrectly passing only a 2-digit year -instead of "year - 1900" into the png_convert_from_struct_tm() function, -but this is not under our control. The libpng documentation has always -stated that it works with 4-digit years, and the APIs have been -documented as such. - -The tIME chunk itself is also Y2K compliant. It uses a 2-byte unsigned -integer to hold the year, and can hold years as large as 65535. - -zlib, upon which libpng depends, is also Y2K compliant. It contains -no date-related code. - - - Glenn Randers-Pehrson - libpng maintainer - PNG Development Group diff --git a/src/libpng/libpng_vs2005.vcproj b/src/libpng/libpng_vs2005.vcproj deleted file mode 100644 index d80f0fe85..000000000 --- a/src/libpng/libpng_vs2005.vcproj +++ /dev/null @@ -1,237 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/libpng/libpng_vs2008.vcproj b/src/libpng/libpng_vs2008.vcproj deleted file mode 100644 index 189d5e5aa..000000000 --- a/src/libpng/libpng_vs2008.vcproj +++ /dev/null @@ -1,238 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/libpng/png.c b/src/libpng/png.c deleted file mode 100644 index 7f268b993..000000000 --- a/src/libpng/png.c +++ /dev/null @@ -1,922 +0,0 @@ - -/* png.c - location for general purpose libpng functions - * - * Last changed in libpng 1.2.37 [June 4, 2009] - * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2009 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - */ - -#define PNG_INTERNAL -#define PNG_NO_EXTERN -#include "png.h" - -/* Generate a compiler error if there is an old png.h in the search path. */ -typedef version_1_2_37 Your_png_h_is_not_version_1_2_37; - -/* Version information for C files. This had better match the version - * string defined in png.h. */ - -#ifdef PNG_USE_GLOBAL_ARRAYS -/* png_libpng_ver was changed to a function in version 1.0.5c */ -PNG_CONST char png_libpng_ver[18] = PNG_LIBPNG_VER_STRING; - -#ifdef PNG_READ_SUPPORTED - -/* png_sig was changed to a function in version 1.0.5c */ -/* Place to hold the signature string for a PNG file. */ -PNG_CONST png_byte FARDATA png_sig[8] = {137, 80, 78, 71, 13, 10, 26, 10}; -#endif /* PNG_READ_SUPPORTED */ - -/* Invoke global declarations for constant strings for known chunk types */ -PNG_IHDR; -PNG_IDAT; -PNG_IEND; -PNG_PLTE; -PNG_bKGD; -PNG_cHRM; -PNG_gAMA; -PNG_hIST; -PNG_iCCP; -PNG_iTXt; -PNG_oFFs; -PNG_pCAL; -PNG_sCAL; -PNG_pHYs; -PNG_sBIT; -PNG_sPLT; -PNG_sRGB; -PNG_tEXt; -PNG_tIME; -PNG_tRNS; -PNG_zTXt; - -#ifdef PNG_READ_SUPPORTED -/* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */ - -/* Start of interlace block */ -PNG_CONST int FARDATA png_pass_start[] = {0, 4, 0, 2, 0, 1, 0}; - -/* Offset to next interlace block */ -PNG_CONST int FARDATA png_pass_inc[] = {8, 8, 4, 4, 2, 2, 1}; - -/* Start of interlace block in the y direction */ -PNG_CONST int FARDATA png_pass_ystart[] = {0, 0, 4, 0, 2, 0, 1}; - -/* Offset to next interlace block in the y direction */ -PNG_CONST int FARDATA png_pass_yinc[] = {8, 8, 8, 4, 4, 2, 2}; - -/* Height of interlace block. This is not currently used - if you need - * it, uncomment it here and in png.h -PNG_CONST int FARDATA png_pass_height[] = {8, 8, 4, 4, 2, 2, 1}; -*/ - -/* Mask to determine which pixels are valid in a pass */ -PNG_CONST int FARDATA png_pass_mask[] = {0x80, 0x08, 0x88, 0x22, 0xaa, 0x55, 0xff}; - -/* Mask to determine which pixels to overwrite while displaying */ -PNG_CONST int FARDATA png_pass_dsp_mask[] - = {0xff, 0x0f, 0xff, 0x33, 0xff, 0x55, 0xff}; - -#endif /* PNG_READ_SUPPORTED */ -#endif /* PNG_USE_GLOBAL_ARRAYS */ - -/* Tells libpng that we have already handled the first "num_bytes" bytes - * of the PNG file signature. If the PNG data is embedded into another - * stream we can set num_bytes = 8 so that libpng will not attempt to read - * or write any of the magic bytes before it starts on the IHDR. - */ - -#ifdef PNG_READ_SUPPORTED -void PNGAPI -png_set_sig_bytes(png_structp png_ptr, int num_bytes) -{ - if (png_ptr == NULL) - return; - png_debug(1, "in png_set_sig_bytes"); - if (num_bytes > 8) - png_error(png_ptr, "Too many bytes for PNG signature."); - - png_ptr->sig_bytes = (png_byte)(num_bytes < 0 ? 0 : num_bytes); -} - -/* Checks whether the supplied bytes match the PNG signature. We allow - * checking less than the full 8-byte signature so that those apps that - * already read the first few bytes of a file to determine the file type - * can simply check the remaining bytes for extra assurance. Returns - * an integer less than, equal to, or greater than zero if sig is found, - * respectively, to be less than, to match, or be greater than the correct - * PNG signature (this is the same behaviour as strcmp, memcmp, etc). - */ -int PNGAPI -png_sig_cmp(png_bytep sig, png_size_t start, png_size_t num_to_check) -{ - png_byte png_signature[8] = {137, 80, 78, 71, 13, 10, 26, 10}; - if (num_to_check > 8) - num_to_check = 8; - else if (num_to_check < 1) - return (-1); - - if (start > 7) - return (-1); - - if (start + num_to_check > 8) - num_to_check = 8 - start; - - return ((int)(png_memcmp(&sig[start], &png_signature[start], num_to_check))); -} - -#if defined(PNG_1_0_X) || defined(PNG_1_2_X) -/* (Obsolete) function to check signature bytes. It does not allow one - * to check a partial signature. This function might be removed in the - * future - use png_sig_cmp(). Returns true (nonzero) if the file is PNG. - */ -int PNGAPI -png_check_sig(png_bytep sig, int num) -{ - return ((int)!png_sig_cmp(sig, (png_size_t)0, (png_size_t)num)); -} -#endif -#endif /* PNG_READ_SUPPORTED */ - -#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) -/* Function to allocate memory for zlib and clear it to 0. */ -#ifdef PNG_1_0_X -voidpf PNGAPI -#else -voidpf /* private */ -#endif -png_zalloc(voidpf png_ptr, uInt items, uInt size) -{ - png_voidp ptr; - png_structp p=(png_structp)png_ptr; - png_uint_32 save_flags=p->flags; - png_uint_32 num_bytes; - - if (png_ptr == NULL) - return (NULL); - if (items > PNG_UINT_32_MAX/size) - { - png_warning (p, "Potential overflow in png_zalloc()"); - return (NULL); - } - num_bytes = (png_uint_32)items * size; - - p->flags|=PNG_FLAG_MALLOC_NULL_MEM_OK; - ptr = (png_voidp)png_malloc((png_structp)png_ptr, num_bytes); - p->flags=save_flags; - -#if defined(PNG_1_0_X) && !defined(PNG_NO_ZALLOC_ZERO) - if (ptr == NULL) - return ((voidpf)ptr); - - if (num_bytes > (png_uint_32)0x8000L) - { - png_memset(ptr, 0, (png_size_t)0x8000L); - png_memset((png_bytep)ptr + (png_size_t)0x8000L, 0, - (png_size_t)(num_bytes - (png_uint_32)0x8000L)); - } - else - { - png_memset(ptr, 0, (png_size_t)num_bytes); - } -#endif - return ((voidpf)ptr); -} - -/* Function to free memory for zlib */ -#ifdef PNG_1_0_X -void PNGAPI -#else -void /* private */ -#endif -png_zfree(voidpf png_ptr, voidpf ptr) -{ - png_free((png_structp)png_ptr, (png_voidp)ptr); -} - -/* Reset the CRC variable to 32 bits of 1's. Care must be taken - * in case CRC is > 32 bits to leave the top bits 0. - */ -void /* PRIVATE */ -png_reset_crc(png_structp png_ptr) -{ - png_ptr->crc = crc32(0, Z_NULL, 0); -} - -/* Calculate the CRC over a section of data. We can only pass as - * much data to this routine as the largest single buffer size. We - * also check that this data will actually be used before going to the - * trouble of calculating it. - */ -void /* PRIVATE */ -png_calculate_crc(png_structp png_ptr, png_bytep ptr, png_size_t length) -{ - int need_crc = 1; - - if (png_ptr->chunk_name[0] & 0x20) /* ancillary */ - { - if ((png_ptr->flags & PNG_FLAG_CRC_ANCILLARY_MASK) == - (PNG_FLAG_CRC_ANCILLARY_USE | PNG_FLAG_CRC_ANCILLARY_NOWARN)) - need_crc = 0; - } - else /* critical */ - { - if (png_ptr->flags & PNG_FLAG_CRC_CRITICAL_IGNORE) - need_crc = 0; - } - - if (need_crc) - png_ptr->crc = crc32(png_ptr->crc, ptr, (uInt)length); -} - -/* Allocate the memory for an info_struct for the application. We don't - * really need the png_ptr, but it could potentially be useful in the - * future. This should be used in favour of malloc(png_sizeof(png_info)) - * and png_info_init() so that applications that want to use a shared - * libpng don't have to be recompiled if png_info changes size. - */ -png_infop PNGAPI -png_create_info_struct(png_structp png_ptr) -{ - png_infop info_ptr; - - png_debug(1, "in png_create_info_struct"); - if (png_ptr == NULL) - return (NULL); -#ifdef PNG_USER_MEM_SUPPORTED - info_ptr = (png_infop)png_create_struct_2(PNG_STRUCT_INFO, - png_ptr->malloc_fn, png_ptr->mem_ptr); -#else - info_ptr = (png_infop)png_create_struct(PNG_STRUCT_INFO); -#endif - if (info_ptr != NULL) - png_info_init_3(&info_ptr, png_sizeof(png_info)); - - return (info_ptr); -} - -/* This function frees the memory associated with a single info struct. - * Normally, one would use either png_destroy_read_struct() or - * png_destroy_write_struct() to free an info struct, but this may be - * useful for some applications. - */ -void PNGAPI -png_destroy_info_struct(png_structp png_ptr, png_infopp info_ptr_ptr) -{ - png_infop info_ptr = NULL; - if (png_ptr == NULL) - return; - - png_debug(1, "in png_destroy_info_struct"); - if (info_ptr_ptr != NULL) - info_ptr = *info_ptr_ptr; - - if (info_ptr != NULL) - { - png_info_destroy(png_ptr, info_ptr); - -#ifdef PNG_USER_MEM_SUPPORTED - png_destroy_struct_2((png_voidp)info_ptr, png_ptr->free_fn, - png_ptr->mem_ptr); -#else - png_destroy_struct((png_voidp)info_ptr); -#endif - *info_ptr_ptr = NULL; - } -} - -/* Initialize the info structure. This is now an internal function (0.89) - * and applications using it are urged to use png_create_info_struct() - * instead. - */ -#if defined(PNG_1_0_X) || defined(PNG_1_2_X) -#undef png_info_init -void PNGAPI -png_info_init(png_infop info_ptr) -{ - /* We only come here via pre-1.0.12-compiled applications */ - png_info_init_3(&info_ptr, 0); -} -#endif - -void PNGAPI -png_info_init_3(png_infopp ptr_ptr, png_size_t png_info_struct_size) -{ - png_infop info_ptr = *ptr_ptr; - - if (info_ptr == NULL) - return; - - png_debug(1, "in png_info_init_3"); - - if (png_sizeof(png_info) > png_info_struct_size) - { - png_destroy_struct(info_ptr); - info_ptr = (png_infop)png_create_struct(PNG_STRUCT_INFO); - *ptr_ptr = info_ptr; - } - - /* Set everything to 0 */ - png_memset(info_ptr, 0, png_sizeof(png_info)); -} - -#ifdef PNG_FREE_ME_SUPPORTED -void PNGAPI -png_data_freer(png_structp png_ptr, png_infop info_ptr, - int freer, png_uint_32 mask) -{ - png_debug(1, "in png_data_freer"); - if (png_ptr == NULL || info_ptr == NULL) - return; - if (freer == PNG_DESTROY_WILL_FREE_DATA) - info_ptr->free_me |= mask; - else if (freer == PNG_USER_WILL_FREE_DATA) - info_ptr->free_me &= ~mask; - else - png_warning(png_ptr, - "Unknown freer parameter in png_data_freer."); -} -#endif - -void PNGAPI -png_free_data(png_structp png_ptr, png_infop info_ptr, png_uint_32 mask, - int num) -{ - png_debug(1, "in png_free_data"); - if (png_ptr == NULL || info_ptr == NULL) - return; - -#if defined(PNG_TEXT_SUPPORTED) - /* Free text item num or (if num == -1) all text items */ -#ifdef PNG_FREE_ME_SUPPORTED - if ((mask & PNG_FREE_TEXT) & info_ptr->free_me) -#else - if (mask & PNG_FREE_TEXT) -#endif - { - if (num != -1) - { - if (info_ptr->text && info_ptr->text[num].key) - { - png_free(png_ptr, info_ptr->text[num].key); - info_ptr->text[num].key = NULL; - } - } - else - { - int i; - for (i = 0; i < info_ptr->num_text; i++) - png_free_data(png_ptr, info_ptr, PNG_FREE_TEXT, i); - png_free(png_ptr, info_ptr->text); - info_ptr->text = NULL; - info_ptr->num_text=0; - } - } -#endif - -#if defined(PNG_tRNS_SUPPORTED) - /* Free any tRNS entry */ -#ifdef PNG_FREE_ME_SUPPORTED - if ((mask & PNG_FREE_TRNS) & info_ptr->free_me) -#else - if ((mask & PNG_FREE_TRNS) && (png_ptr->flags & PNG_FLAG_FREE_TRNS)) -#endif - { - png_free(png_ptr, info_ptr->trans); - info_ptr->trans = NULL; - info_ptr->valid &= ~PNG_INFO_tRNS; -#ifndef PNG_FREE_ME_SUPPORTED - png_ptr->flags &= ~PNG_FLAG_FREE_TRNS; -#endif - } -#endif - -#if defined(PNG_sCAL_SUPPORTED) - /* Free any sCAL entry */ -#ifdef PNG_FREE_ME_SUPPORTED - if ((mask & PNG_FREE_SCAL) & info_ptr->free_me) -#else - if (mask & PNG_FREE_SCAL) -#endif - { -#if defined(PNG_FIXED_POINT_SUPPORTED) && !defined(PNG_FLOATING_POINT_SUPPORTED) - png_free(png_ptr, info_ptr->scal_s_width); - png_free(png_ptr, info_ptr->scal_s_height); - info_ptr->scal_s_width = NULL; - info_ptr->scal_s_height = NULL; -#endif - info_ptr->valid &= ~PNG_INFO_sCAL; - } -#endif - -#if defined(PNG_pCAL_SUPPORTED) - /* Free any pCAL entry */ -#ifdef PNG_FREE_ME_SUPPORTED - if ((mask & PNG_FREE_PCAL) & info_ptr->free_me) -#else - if (mask & PNG_FREE_PCAL) -#endif - { - png_free(png_ptr, info_ptr->pcal_purpose); - png_free(png_ptr, info_ptr->pcal_units); - info_ptr->pcal_purpose = NULL; - info_ptr->pcal_units = NULL; - if (info_ptr->pcal_params != NULL) - { - int i; - for (i = 0; i < (int)info_ptr->pcal_nparams; i++) - { - png_free(png_ptr, info_ptr->pcal_params[i]); - info_ptr->pcal_params[i]=NULL; - } - png_free(png_ptr, info_ptr->pcal_params); - info_ptr->pcal_params = NULL; - } - info_ptr->valid &= ~PNG_INFO_pCAL; - } -#endif - -#if defined(PNG_iCCP_SUPPORTED) - /* Free any iCCP entry */ -#ifdef PNG_FREE_ME_SUPPORTED - if ((mask & PNG_FREE_ICCP) & info_ptr->free_me) -#else - if (mask & PNG_FREE_ICCP) -#endif - { - png_free(png_ptr, info_ptr->iccp_name); - png_free(png_ptr, info_ptr->iccp_profile); - info_ptr->iccp_name = NULL; - info_ptr->iccp_profile = NULL; - info_ptr->valid &= ~PNG_INFO_iCCP; - } -#endif - -#if defined(PNG_sPLT_SUPPORTED) - /* Free a given sPLT entry, or (if num == -1) all sPLT entries */ -#ifdef PNG_FREE_ME_SUPPORTED - if ((mask & PNG_FREE_SPLT) & info_ptr->free_me) -#else - if (mask & PNG_FREE_SPLT) -#endif - { - if (num != -1) - { - if (info_ptr->splt_palettes) - { - png_free(png_ptr, info_ptr->splt_palettes[num].name); - png_free(png_ptr, info_ptr->splt_palettes[num].entries); - info_ptr->splt_palettes[num].name = NULL; - info_ptr->splt_palettes[num].entries = NULL; - } - } - else - { - if (info_ptr->splt_palettes_num) - { - int i; - for (i = 0; i < (int)info_ptr->splt_palettes_num; i++) - png_free_data(png_ptr, info_ptr, PNG_FREE_SPLT, i); - - png_free(png_ptr, info_ptr->splt_palettes); - info_ptr->splt_palettes = NULL; - info_ptr->splt_palettes_num = 0; - } - info_ptr->valid &= ~PNG_INFO_sPLT; - } - } -#endif - -#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) - if (png_ptr->unknown_chunk.data) - { - png_free(png_ptr, png_ptr->unknown_chunk.data); - png_ptr->unknown_chunk.data = NULL; - } - -#ifdef PNG_FREE_ME_SUPPORTED - if ((mask & PNG_FREE_UNKN) & info_ptr->free_me) -#else - if (mask & PNG_FREE_UNKN) -#endif - { - if (num != -1) - { - if (info_ptr->unknown_chunks) - { - png_free(png_ptr, info_ptr->unknown_chunks[num].data); - info_ptr->unknown_chunks[num].data = NULL; - } - } - else - { - int i; - - if (info_ptr->unknown_chunks_num) - { - for (i = 0; i < (int)info_ptr->unknown_chunks_num; i++) - png_free_data(png_ptr, info_ptr, PNG_FREE_UNKN, i); - - png_free(png_ptr, info_ptr->unknown_chunks); - info_ptr->unknown_chunks = NULL; - info_ptr->unknown_chunks_num = 0; - } - } - } -#endif - -#if defined(PNG_hIST_SUPPORTED) - /* Free any hIST entry */ -#ifdef PNG_FREE_ME_SUPPORTED - if ((mask & PNG_FREE_HIST) & info_ptr->free_me) -#else - if ((mask & PNG_FREE_HIST) && (png_ptr->flags & PNG_FLAG_FREE_HIST)) -#endif - { - png_free(png_ptr, info_ptr->hist); - info_ptr->hist = NULL; - info_ptr->valid &= ~PNG_INFO_hIST; -#ifndef PNG_FREE_ME_SUPPORTED - png_ptr->flags &= ~PNG_FLAG_FREE_HIST; -#endif - } -#endif - - /* Free any PLTE entry that was internally allocated */ -#ifdef PNG_FREE_ME_SUPPORTED - if ((mask & PNG_FREE_PLTE) & info_ptr->free_me) -#else - if ((mask & PNG_FREE_PLTE) && (png_ptr->flags & PNG_FLAG_FREE_PLTE)) -#endif - { - png_zfree(png_ptr, info_ptr->palette); - info_ptr->palette = NULL; - info_ptr->valid &= ~PNG_INFO_PLTE; -#ifndef PNG_FREE_ME_SUPPORTED - png_ptr->flags &= ~PNG_FLAG_FREE_PLTE; -#endif - info_ptr->num_palette = 0; - } - -#if defined(PNG_INFO_IMAGE_SUPPORTED) - /* Free any image bits attached to the info structure */ -#ifdef PNG_FREE_ME_SUPPORTED - if ((mask & PNG_FREE_ROWS) & info_ptr->free_me) -#else - if (mask & PNG_FREE_ROWS) -#endif - { - if (info_ptr->row_pointers) - { - int row; - for (row = 0; row < (int)info_ptr->height; row++) - { - png_free(png_ptr, info_ptr->row_pointers[row]); - info_ptr->row_pointers[row]=NULL; - } - png_free(png_ptr, info_ptr->row_pointers); - info_ptr->row_pointers=NULL; - } - info_ptr->valid &= ~PNG_INFO_IDAT; - } -#endif - -#ifdef PNG_FREE_ME_SUPPORTED - if (num == -1) - info_ptr->free_me &= ~mask; - else - info_ptr->free_me &= ~(mask & ~PNG_FREE_MUL); -#endif -} - -/* This is an internal routine to free any memory that the info struct is - * pointing to before re-using it or freeing the struct itself. Recall - * that png_free() checks for NULL pointers for us. - */ -void /* PRIVATE */ -png_info_destroy(png_structp png_ptr, png_infop info_ptr) -{ - png_debug(1, "in png_info_destroy"); - - png_free_data(png_ptr, info_ptr, PNG_FREE_ALL, -1); - -#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) - if (png_ptr->num_chunk_list) - { - png_free(png_ptr, png_ptr->chunk_list); - png_ptr->chunk_list=NULL; - png_ptr->num_chunk_list = 0; - } -#endif - - png_info_init_3(&info_ptr, png_sizeof(png_info)); -} -#endif /* defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) */ - -/* This function returns a pointer to the io_ptr associated with the user - * functions. The application should free any memory associated with this - * pointer before png_write_destroy() or png_read_destroy() are called. - */ -png_voidp PNGAPI -png_get_io_ptr(png_structp png_ptr) -{ - if (png_ptr == NULL) - return (NULL); - return (png_ptr->io_ptr); -} - -#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) -#if !defined(PNG_NO_STDIO) -/* Initialize the default input/output functions for the PNG file. If you - * use your own read or write routines, you can call either png_set_read_fn() - * or png_set_write_fn() instead of png_init_io(). If you have defined - * PNG_NO_STDIO, you must use a function of your own because "FILE *" isn't - * necessarily available. - */ -void PNGAPI -png_init_io(png_structp png_ptr, png_FILE_p fp) -{ - png_debug(1, "in png_init_io"); - if (png_ptr == NULL) - return; - png_ptr->io_ptr = (png_voidp)fp; -} -#endif - -#if defined(PNG_TIME_RFC1123_SUPPORTED) -/* Convert the supplied time into an RFC 1123 string suitable for use in - * a "Creation Time" or other text-based time string. - */ -png_charp PNGAPI -png_convert_to_rfc1123(png_structp png_ptr, png_timep ptime) -{ - static PNG_CONST char short_months[12][4] = - {"Jan", "Feb", "Mar", "Apr", "May", "Jun", - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; - - if (png_ptr == NULL) - return (NULL); - if (png_ptr->time_buffer == NULL) - { - png_ptr->time_buffer = (png_charp)png_malloc(png_ptr, (png_uint_32)(29* - png_sizeof(char))); - } - -#if defined(_WIN32_WCE) - { - wchar_t time_buf[29]; - wsprintf(time_buf, TEXT("%d %S %d %02d:%02d:%02d +0000"), - ptime->day % 32, short_months[(ptime->month - 1) % 12], - ptime->year, ptime->hour % 24, ptime->minute % 60, - ptime->second % 61); - WideCharToMultiByte(CP_ACP, 0, time_buf, -1, png_ptr->time_buffer, 29, - NULL, NULL); - } -#else -#ifdef USE_FAR_KEYWORD - { - char near_time_buf[29]; - png_snprintf6(near_time_buf, 29, "%d %s %d %02d:%02d:%02d +0000", - ptime->day % 32, short_months[(ptime->month - 1) % 12], - ptime->year, ptime->hour % 24, ptime->minute % 60, - ptime->second % 61); - png_memcpy(png_ptr->time_buffer, near_time_buf, - 29*png_sizeof(char)); - } -#else - png_snprintf6(png_ptr->time_buffer, 29, "%d %s %d %02d:%02d:%02d +0000", - ptime->day % 32, short_months[(ptime->month - 1) % 12], - ptime->year, ptime->hour % 24, ptime->minute % 60, - ptime->second % 61); -#endif -#endif /* _WIN32_WCE */ - return ((png_charp)png_ptr->time_buffer); -} -#endif /* PNG_TIME_RFC1123_SUPPORTED */ - -#endif /* defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) */ - -png_charp PNGAPI -png_get_copyright(png_structp png_ptr) -{ - png_ptr = png_ptr; /* Silence compiler warning about unused png_ptr */ - return ((png_charp) "\n libpng version 1.2.37 - June 4, 2009\n\ - Copyright (c) 1998-2009 Glenn Randers-Pehrson\n\ - Copyright (c) 1996-1997 Andreas Dilger\n\ - Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.\n"); -} - -/* The following return the library version as a short string in the - * format 1.0.0 through 99.99.99zz. To get the version of *.h files - * used with your application, print out PNG_LIBPNG_VER_STRING, which - * is defined in png.h. - * Note: now there is no difference between png_get_libpng_ver() and - * png_get_header_ver(). Due to the version_nn_nn_nn typedef guard, - * it is guaranteed that png.c uses the correct version of png.h. - */ -png_charp PNGAPI -png_get_libpng_ver(png_structp png_ptr) -{ - /* Version of *.c files used when building libpng */ - png_ptr = png_ptr; /* Silence compiler warning about unused png_ptr */ - return ((png_charp) PNG_LIBPNG_VER_STRING); -} - -png_charp PNGAPI -png_get_header_ver(png_structp png_ptr) -{ - /* Version of *.h files used when building libpng */ - png_ptr = png_ptr; /* Silence compiler warning about unused png_ptr */ - return ((png_charp) PNG_LIBPNG_VER_STRING); -} - -png_charp PNGAPI -png_get_header_version(png_structp png_ptr) -{ - /* Returns longer string containing both version and date */ - png_ptr = png_ptr; /* Silence compiler warning about unused png_ptr */ - return ((png_charp) PNG_HEADER_VERSION_STRING -#ifndef PNG_READ_SUPPORTED - " (NO READ SUPPORT)" -#endif - "\n"); -} - -#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) -#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED -int PNGAPI -png_handle_as_unknown(png_structp png_ptr, png_bytep chunk_name) -{ - /* Check chunk_name and return "keep" value if it's on the list, else 0 */ - int i; - png_bytep p; - if (png_ptr == NULL || chunk_name == NULL || png_ptr->num_chunk_list<=0) - return 0; - p = png_ptr->chunk_list + png_ptr->num_chunk_list*5 - 5; - for (i = png_ptr->num_chunk_list; i; i--, p -= 5) - if (!png_memcmp(chunk_name, p, 4)) - return ((int)*(p + 4)); - return 0; -} -#endif - -/* This function, added to libpng-1.0.6g, is untested. */ -int PNGAPI -png_reset_zstream(png_structp png_ptr) -{ - if (png_ptr == NULL) - return Z_STREAM_ERROR; - return (inflateReset(&png_ptr->zstream)); -} -#endif /* defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) */ - -/* This function was added to libpng-1.0.7 */ -png_uint_32 PNGAPI -png_access_version_number(void) -{ - /* Version of *.c files used when building libpng */ - return((png_uint_32) PNG_LIBPNG_VER); -} - - -#if defined(PNG_READ_SUPPORTED) && defined(PNG_ASSEMBLER_CODE_SUPPORTED) -#if !defined(PNG_1_0_X) -/* This function was added to libpng 1.2.0 */ -int PNGAPI -png_mmx_support(void) -{ - /* Obsolete, to be removed from libpng-1.4.0 */ - return -1; -} -#endif /* PNG_1_0_X */ -#endif /* PNG_READ_SUPPORTED && PNG_ASSEMBLER_CODE_SUPPORTED */ - -#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) -#ifdef PNG_SIZE_T -/* Added at libpng version 1.2.6 */ - PNG_EXTERN png_size_t PNGAPI png_convert_size PNGARG((size_t size)); -png_size_t PNGAPI -png_convert_size(size_t size) -{ - if (size > (png_size_t)-1) - PNG_ABORT(); /* We haven't got access to png_ptr, so no png_error() */ - return ((png_size_t)size); -} -#endif /* PNG_SIZE_T */ - -/* Added at libpng version 1.2.34 and 1.4.0 (moved from pngset.c) */ -#if defined(PNG_cHRM_SUPPORTED) -#if !defined(PNG_NO_CHECK_cHRM) - -/* - * Multiply two 32-bit numbers, V1 and V2, using 32-bit - * arithmetic, to produce a 64 bit result in the HI/LO words. - * - * A B - * x C D - * ------ - * AD || BD - * AC || CB || 0 - * - * where A and B are the high and low 16-bit words of V1, - * C and D are the 16-bit words of V2, AD is the product of - * A and D, and X || Y is (X << 16) + Y. -*/ - -void png_64bit_product (long v1, long v2, unsigned long *hi_product, - unsigned long *lo_product) -{ - int a, b, c, d; - long lo, hi, x, y; - - a = (v1 >> 16) & 0xffff; - b = v1 & 0xffff; - c = (v2 >> 16) & 0xffff; - d = v2 & 0xffff; - - lo = b * d; /* BD */ - x = a * d + c * b; /* AD + CB */ - y = ((lo >> 16) & 0xffff) + x; - - lo = (lo & 0xffff) | ((y & 0xffff) << 16); - hi = (y >> 16) & 0xffff; - - hi += a * c; /* AC */ - - *hi_product = (unsigned long)hi; - *lo_product = (unsigned long)lo; -} - -int /* private */ -png_check_cHRM_fixed(png_structp png_ptr, - png_fixed_point white_x, png_fixed_point white_y, png_fixed_point red_x, - png_fixed_point red_y, png_fixed_point green_x, png_fixed_point green_y, - png_fixed_point blue_x, png_fixed_point blue_y) -{ - int ret = 1; - unsigned long xy_hi,xy_lo,yx_hi,yx_lo; - - png_debug(1, "in function png_check_cHRM_fixed"); - if (png_ptr == NULL) - return 0; - - if (white_x < 0 || white_y <= 0 || - red_x < 0 || red_y < 0 || - green_x < 0 || green_y < 0 || - blue_x < 0 || blue_y < 0) - { - png_warning(png_ptr, - "Ignoring attempt to set negative chromaticity value"); - ret = 0; - } - if (white_x > (png_fixed_point) PNG_UINT_31_MAX || - white_y > (png_fixed_point) PNG_UINT_31_MAX || - red_x > (png_fixed_point) PNG_UINT_31_MAX || - red_y > (png_fixed_point) PNG_UINT_31_MAX || - green_x > (png_fixed_point) PNG_UINT_31_MAX || - green_y > (png_fixed_point) PNG_UINT_31_MAX || - blue_x > (png_fixed_point) PNG_UINT_31_MAX || - blue_y > (png_fixed_point) PNG_UINT_31_MAX ) - { - png_warning(png_ptr, - "Ignoring attempt to set chromaticity value exceeding 21474.83"); - ret = 0; - } - if (white_x > 100000L - white_y) - { - png_warning(png_ptr, "Invalid cHRM white point"); - ret = 0; - } - if (red_x > 100000L - red_y) - { - png_warning(png_ptr, "Invalid cHRM red point"); - ret = 0; - } - if (green_x > 100000L - green_y) - { - png_warning(png_ptr, "Invalid cHRM green point"); - ret = 0; - } - if (blue_x > 100000L - blue_y) - { - png_warning(png_ptr, "Invalid cHRM blue point"); - ret = 0; - } - - png_64bit_product(green_x - red_x, blue_y - red_y, &xy_hi, &xy_lo); - png_64bit_product(green_y - red_y, blue_x - red_x, &yx_hi, &yx_lo); - - if (xy_hi == yx_hi && xy_lo == yx_lo) - { - png_warning(png_ptr, - "Ignoring attempt to set cHRM RGB triangle with zero area"); - ret = 0; - } - - return ret; -} -#endif /* NO_PNG_CHECK_cHRM */ -#endif /* PNG_cHRM_SUPPORTED */ -#endif /* defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) */ diff --git a/src/libpng/png.h b/src/libpng/png.h deleted file mode 100644 index 8e7e6aaf9..000000000 --- a/src/libpng/png.h +++ /dev/null @@ -1,3685 +0,0 @@ -/* png.h - header file for PNG reference library - * - * libpng version 1.2.37 - June 4, 2009 - * Copyright (c) 1998-2009 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - * - * Authors and maintainers: - * libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat - * libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger - * libpng versions 0.97, January 1998, through 1.2.37 - June 4, 2009: Glenn - * See also "Contributing Authors", below. - * - * Note about libpng version numbers: - * - * Due to various miscommunications, unforeseen code incompatibilities - * and occasional factors outside the authors' control, version numbering - * on the library has not always been consistent and straightforward. - * The following table summarizes matters since version 0.89c, which was - * the first widely used release: - * - * source png.h png.h shared-lib - * version string int version - * ------- ------ ----- ---------- - * 0.89c "1.0 beta 3" 0.89 89 1.0.89 - * 0.90 "1.0 beta 4" 0.90 90 0.90 [should have been 2.0.90] - * 0.95 "1.0 beta 5" 0.95 95 0.95 [should have been 2.0.95] - * 0.96 "1.0 beta 6" 0.96 96 0.96 [should have been 2.0.96] - * 0.97b "1.00.97 beta 7" 1.00.97 97 1.0.1 [should have been 2.0.97] - * 0.97c 0.97 97 2.0.97 - * 0.98 0.98 98 2.0.98 - * 0.99 0.99 98 2.0.99 - * 0.99a-m 0.99 99 2.0.99 - * 1.00 1.00 100 2.1.0 [100 should be 10000] - * 1.0.0 (from here on, the 100 2.1.0 [100 should be 10000] - * 1.0.1 png.h string is 10001 2.1.0 - * 1.0.1a-e identical to the 10002 from here on, the shared library - * 1.0.2 source version) 10002 is 2.V where V is the source code - * 1.0.2a-b 10003 version, except as noted. - * 1.0.3 10003 - * 1.0.3a-d 10004 - * 1.0.4 10004 - * 1.0.4a-f 10005 - * 1.0.5 (+ 2 patches) 10005 - * 1.0.5a-d 10006 - * 1.0.5e-r 10100 (not source compatible) - * 1.0.5s-v 10006 (not binary compatible) - * 1.0.6 (+ 3 patches) 10006 (still binary incompatible) - * 1.0.6d-f 10007 (still binary incompatible) - * 1.0.6g 10007 - * 1.0.6h 10007 10.6h (testing xy.z so-numbering) - * 1.0.6i 10007 10.6i - * 1.0.6j 10007 2.1.0.6j (incompatible with 1.0.0) - * 1.0.7beta11-14 DLLNUM 10007 2.1.0.7beta11-14 (binary compatible) - * 1.0.7beta15-18 1 10007 2.1.0.7beta15-18 (binary compatible) - * 1.0.7rc1-2 1 10007 2.1.0.7rc1-2 (binary compatible) - * 1.0.7 1 10007 (still compatible) - * 1.0.8beta1-4 1 10008 2.1.0.8beta1-4 - * 1.0.8rc1 1 10008 2.1.0.8rc1 - * 1.0.8 1 10008 2.1.0.8 - * 1.0.9beta1-6 1 10009 2.1.0.9beta1-6 - * 1.0.9rc1 1 10009 2.1.0.9rc1 - * 1.0.9beta7-10 1 10009 2.1.0.9beta7-10 - * 1.0.9rc2 1 10009 2.1.0.9rc2 - * 1.0.9 1 10009 2.1.0.9 - * 1.0.10beta1 1 10010 2.1.0.10beta1 - * 1.0.10rc1 1 10010 2.1.0.10rc1 - * 1.0.10 1 10010 2.1.0.10 - * 1.0.11beta1-3 1 10011 2.1.0.11beta1-3 - * 1.0.11rc1 1 10011 2.1.0.11rc1 - * 1.0.11 1 10011 2.1.0.11 - * 1.0.12beta1-2 2 10012 2.1.0.12beta1-2 - * 1.0.12rc1 2 10012 2.1.0.12rc1 - * 1.0.12 2 10012 2.1.0.12 - * 1.1.0a-f - 10100 2.1.1.0a-f (branch abandoned) - * 1.2.0beta1-2 2 10200 2.1.2.0beta1-2 - * 1.2.0beta3-5 3 10200 3.1.2.0beta3-5 - * 1.2.0rc1 3 10200 3.1.2.0rc1 - * 1.2.0 3 10200 3.1.2.0 - * 1.2.1beta1-4 3 10201 3.1.2.1beta1-4 - * 1.2.1rc1-2 3 10201 3.1.2.1rc1-2 - * 1.2.1 3 10201 3.1.2.1 - * 1.2.2beta1-6 12 10202 12.so.0.1.2.2beta1-6 - * 1.0.13beta1 10 10013 10.so.0.1.0.13beta1 - * 1.0.13rc1 10 10013 10.so.0.1.0.13rc1 - * 1.2.2rc1 12 10202 12.so.0.1.2.2rc1 - * 1.0.13 10 10013 10.so.0.1.0.13 - * 1.2.2 12 10202 12.so.0.1.2.2 - * 1.2.3rc1-6 12 10203 12.so.0.1.2.3rc1-6 - * 1.2.3 12 10203 12.so.0.1.2.3 - * 1.2.4beta1-3 13 10204 12.so.0.1.2.4beta1-3 - * 1.0.14rc1 13 10014 10.so.0.1.0.14rc1 - * 1.2.4rc1 13 10204 12.so.0.1.2.4rc1 - * 1.0.14 10 10014 10.so.0.1.0.14 - * 1.2.4 13 10204 12.so.0.1.2.4 - * 1.2.5beta1-2 13 10205 12.so.0.1.2.5beta1-2 - * 1.0.15rc1-3 10 10015 10.so.0.1.0.15rc1-3 - * 1.2.5rc1-3 13 10205 12.so.0.1.2.5rc1-3 - * 1.0.15 10 10015 10.so.0.1.0.15 - * 1.2.5 13 10205 12.so.0.1.2.5 - * 1.2.6beta1-4 13 10206 12.so.0.1.2.6beta1-4 - * 1.0.16 10 10016 10.so.0.1.0.16 - * 1.2.6 13 10206 12.so.0.1.2.6 - * 1.2.7beta1-2 13 10207 12.so.0.1.2.7beta1-2 - * 1.0.17rc1 10 10017 10.so.0.1.0.17rc1 - * 1.2.7rc1 13 10207 12.so.0.1.2.7rc1 - * 1.0.17 10 10017 10.so.0.1.0.17 - * 1.2.7 13 10207 12.so.0.1.2.7 - * 1.2.8beta1-5 13 10208 12.so.0.1.2.8beta1-5 - * 1.0.18rc1-5 10 10018 10.so.0.1.0.18rc1-5 - * 1.2.8rc1-5 13 10208 12.so.0.1.2.8rc1-5 - * 1.0.18 10 10018 10.so.0.1.0.18 - * 1.2.8 13 10208 12.so.0.1.2.8 - * 1.2.9beta1-3 13 10209 12.so.0.1.2.9beta1-3 - * 1.2.9beta4-11 13 10209 12.so.0.9[.0] - * 1.2.9rc1 13 10209 12.so.0.9[.0] - * 1.2.9 13 10209 12.so.0.9[.0] - * 1.2.10beta1-8 13 10210 12.so.0.10[.0] - * 1.2.10rc1-3 13 10210 12.so.0.10[.0] - * 1.2.10 13 10210 12.so.0.10[.0] - * 1.2.11beta1-4 13 10211 12.so.0.11[.0] - * 1.0.19rc1-5 10 10019 10.so.0.19[.0] - * 1.2.11rc1-5 13 10211 12.so.0.11[.0] - * 1.0.19 10 10019 10.so.0.19[.0] - * 1.2.11 13 10211 12.so.0.11[.0] - * 1.0.20 10 10020 10.so.0.20[.0] - * 1.2.12 13 10212 12.so.0.12[.0] - * 1.2.13beta1 13 10213 12.so.0.13[.0] - * 1.0.21 10 10021 10.so.0.21[.0] - * 1.2.13 13 10213 12.so.0.13[.0] - * 1.2.14beta1-2 13 10214 12.so.0.14[.0] - * 1.0.22rc1 10 10022 10.so.0.22[.0] - * 1.2.14rc1 13 10214 12.so.0.14[.0] - * 1.0.22 10 10022 10.so.0.22[.0] - * 1.2.14 13 10214 12.so.0.14[.0] - * 1.2.15beta1-6 13 10215 12.so.0.15[.0] - * 1.0.23rc1-5 10 10023 10.so.0.23[.0] - * 1.2.15rc1-5 13 10215 12.so.0.15[.0] - * 1.0.23 10 10023 10.so.0.23[.0] - * 1.2.15 13 10215 12.so.0.15[.0] - * 1.2.16beta1-2 13 10216 12.so.0.16[.0] - * 1.2.16rc1 13 10216 12.so.0.16[.0] - * 1.0.24 10 10024 10.so.0.24[.0] - * 1.2.16 13 10216 12.so.0.16[.0] - * 1.2.17beta1-2 13 10217 12.so.0.17[.0] - * 1.0.25rc1 10 10025 10.so.0.25[.0] - * 1.2.17rc1-3 13 10217 12.so.0.17[.0] - * 1.0.25 10 10025 10.so.0.25[.0] - * 1.2.17 13 10217 12.so.0.17[.0] - * 1.0.26 10 10026 10.so.0.26[.0] - * 1.2.18 13 10218 12.so.0.18[.0] - * 1.2.19beta1-31 13 10219 12.so.0.19[.0] - * 1.0.27rc1-6 10 10027 10.so.0.27[.0] - * 1.2.19rc1-6 13 10219 12.so.0.19[.0] - * 1.0.27 10 10027 10.so.0.27[.0] - * 1.2.19 13 10219 12.so.0.19[.0] - * 1.2.20beta01-04 13 10220 12.so.0.20[.0] - * 1.0.28rc1-6 10 10028 10.so.0.28[.0] - * 1.2.20rc1-6 13 10220 12.so.0.20[.0] - * 1.0.28 10 10028 10.so.0.28[.0] - * 1.2.20 13 10220 12.so.0.20[.0] - * 1.2.21beta1-2 13 10221 12.so.0.21[.0] - * 1.2.21rc1-3 13 10221 12.so.0.21[.0] - * 1.0.29 10 10029 10.so.0.29[.0] - * 1.2.21 13 10221 12.so.0.21[.0] - * 1.2.22beta1-4 13 10222 12.so.0.22[.0] - * 1.0.30rc1 10 10030 10.so.0.30[.0] - * 1.2.22rc1 13 10222 12.so.0.22[.0] - * 1.0.30 10 10030 10.so.0.30[.0] - * 1.2.22 13 10222 12.so.0.22[.0] - * 1.2.23beta01-05 13 10223 12.so.0.23[.0] - * 1.2.23rc01 13 10223 12.so.0.23[.0] - * 1.2.23 13 10223 12.so.0.23[.0] - * 1.2.24beta01-02 13 10224 12.so.0.24[.0] - * 1.2.24rc01 13 10224 12.so.0.24[.0] - * 1.2.24 13 10224 12.so.0.24[.0] - * 1.2.25beta01-06 13 10225 12.so.0.25[.0] - * 1.2.25rc01-02 13 10225 12.so.0.25[.0] - * 1.0.31 10 10031 10.so.0.31[.0] - * 1.2.25 13 10225 12.so.0.25[.0] - * 1.2.26beta01-06 13 10226 12.so.0.26[.0] - * 1.2.26rc01 13 10226 12.so.0.26[.0] - * 1.2.26 13 10226 12.so.0.26[.0] - * 1.0.32 10 10032 10.so.0.32[.0] - * 1.2.27beta01-06 13 10227 12.so.0.27[.0] - * 1.2.27rc01 13 10227 12.so.0.27[.0] - * 1.0.33 10 10033 10.so.0.33[.0] - * 1.2.27 13 10227 12.so.0.27[.0] - * 1.0.34 10 10034 10.so.0.34[.0] - * 1.2.28 13 10228 12.so.0.28[.0] - * 1.2.29beta01-03 13 10229 12.so.0.29[.0] - * 1.2.29rc01 13 10229 12.so.0.29[.0] - * 1.0.35 10 10035 10.so.0.35[.0] - * 1.2.29 13 10229 12.so.0.29[.0] - * 1.0.37 10 10037 10.so.0.37[.0] - * 1.2.30beta01-04 13 10230 12.so.0.30[.0] - * 1.0.38rc01-08 10 10038 10.so.0.38[.0] - * 1.2.30rc01-08 13 10230 12.so.0.30[.0] - * 1.0.38 10 10038 10.so.0.38[.0] - * 1.2.30 13 10230 12.so.0.30[.0] - * 1.0.39rc01-03 10 10039 10.so.0.39[.0] - * 1.2.31rc01-03 13 10231 12.so.0.31[.0] - * 1.0.39 10 10039 10.so.0.39[.0] - * 1.2.31 13 10231 12.so.0.31[.0] - * 1.2.32beta01-02 13 10232 12.so.0.32[.0] - * 1.0.40rc01 10 10040 10.so.0.40[.0] - * 1.2.32rc01 13 10232 12.so.0.32[.0] - * 1.0.40 10 10040 10.so.0.40[.0] - * 1.2.32 13 10232 12.so.0.32[.0] - * 1.2.33beta01-02 13 10233 12.so.0.33[.0] - * 1.2.33rc01-02 13 10233 12.so.0.33[.0] - * 1.0.41rc01 10 10041 10.so.0.41[.0] - * 1.2.33 13 10233 12.so.0.33[.0] - * 1.0.41 10 10041 10.so.0.41[.0] - * 1.2.34beta01-07 13 10234 12.so.0.34[.0] - * 1.0.42rc01 10 10042 10.so.0.42[.0] - * 1.2.34rc01 13 10234 12.so.0.34[.0] - * 1.0.42 10 10042 10.so.0.42[.0] - * 1.2.34 13 10234 12.so.0.34[.0] - * 1.2.35beta01-03 13 10235 12.so.0.35[.0] - * 1.0.43rc01-02 10 10043 10.so.0.43[.0] - * 1.2.35rc01-02 13 10235 12.so.0.35[.0] - * 1.0.43 10 10043 10.so.0.43[.0] - * 1.2.35 13 10235 12.so.0.35[.0] - * 1.2.36beta01-05 13 10236 12.so.0.36[.0] - * 1.2.36rc01 13 10236 12.so.0.36[.0] - * 1.0.44 10 10044 10.so.0.44[.0] - * 1.2.36 13 10236 12.so.0.36[.0] - * 1.2.37beta01-03 13 10237 12.so.0.37[.0] - * 1.2.37rc01 13 10237 12.so.0.37[.0] - * 1.2.37 13 10237 12.so.0.37[.0] - * - * Henceforth the source version will match the shared-library major - * and minor numbers; the shared-library major version number will be - * used for changes in backward compatibility, as it is intended. The - * PNG_LIBPNG_VER macro, which is not used within libpng but is available - * for applications, is an unsigned integer of the form xyyzz corresponding - * to the source version x.y.z (leading zeros in y and z). Beta versions - * were given the previous public release number plus a letter, until - * version 1.0.6j; from then on they were given the upcoming public - * release number plus "betaNN" or "rcNN". - * - * Binary incompatibility exists only when applications make direct access - * to the info_ptr or png_ptr members through png.h, and the compiled - * application is loaded with a different version of the library. - * - * DLLNUM will change each time there are forward or backward changes - * in binary compatibility (e.g., when a new feature is added). - * - * See libpng.txt or libpng.3 for more information. The PNG specification - * is available as a W3C Recommendation and as an ISO Specification, - * defines should NOT be changed. - */ -#define PNG_INFO_gAMA 0x0001 -#define PNG_INFO_sBIT 0x0002 -#define PNG_INFO_cHRM 0x0004 -#define PNG_INFO_PLTE 0x0008 -#define PNG_INFO_tRNS 0x0010 -#define PNG_INFO_bKGD 0x0020 -#define PNG_INFO_hIST 0x0040 -#define PNG_INFO_pHYs 0x0080 -#define PNG_INFO_oFFs 0x0100 -#define PNG_INFO_tIME 0x0200 -#define PNG_INFO_pCAL 0x0400 -#define PNG_INFO_sRGB 0x0800 /* GR-P, 0.96a */ -#define PNG_INFO_iCCP 0x1000 /* ESR, 1.0.6 */ -#define PNG_INFO_sPLT 0x2000 /* ESR, 1.0.6 */ -#define PNG_INFO_sCAL 0x4000 /* ESR, 1.0.6 */ -#define PNG_INFO_IDAT 0x8000L /* ESR, 1.0.6 */ - -/* This is used for the transformation routines, as some of them - * change these values for the row. It also should enable using - * the routines for other purposes. - */ -typedef struct png_row_info_struct -{ - png_uint_32 width; /* width of row */ - png_uint_32 rowbytes; /* number of bytes in row */ - png_byte color_type; /* color type of row */ - png_byte bit_depth; /* bit depth of row */ - png_byte channels; /* number of channels (1, 2, 3, or 4) */ - png_byte pixel_depth; /* bits per pixel (depth * channels) */ -} png_row_info; - -typedef png_row_info FAR * png_row_infop; -typedef png_row_info FAR * FAR * png_row_infopp; - -/* These are the function types for the I/O functions and for the functions - * that allow the user to override the default I/O functions with his or her - * own. The png_error_ptr type should match that of user-supplied warning - * and error functions, while the png_rw_ptr type should match that of the - * user read/write data functions. - */ -typedef struct png_struct_def png_struct; -typedef png_struct FAR * png_structp; - -typedef void (PNGAPI *png_error_ptr) PNGARG((png_structp, png_const_charp)); -typedef void (PNGAPI *png_rw_ptr) PNGARG((png_structp, png_bytep, png_size_t)); -typedef void (PNGAPI *png_flush_ptr) PNGARG((png_structp)); -typedef void (PNGAPI *png_read_status_ptr) PNGARG((png_structp, png_uint_32, - int)); -typedef void (PNGAPI *png_write_status_ptr) PNGARG((png_structp, png_uint_32, - int)); - -#ifdef PNG_PROGRESSIVE_READ_SUPPORTED -typedef void (PNGAPI *png_progressive_info_ptr) PNGARG((png_structp, png_infop)); -typedef void (PNGAPI *png_progressive_end_ptr) PNGARG((png_structp, png_infop)); -typedef void (PNGAPI *png_progressive_row_ptr) PNGARG((png_structp, png_bytep, - png_uint_32, int)); -#endif - -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_LEGACY_SUPPORTED) -typedef void (PNGAPI *png_user_transform_ptr) PNGARG((png_structp, - png_row_infop, png_bytep)); -#endif - -#if defined(PNG_USER_CHUNKS_SUPPORTED) -typedef int (PNGAPI *png_user_chunk_ptr) PNGARG((png_structp, png_unknown_chunkp)); -#endif -#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) -typedef void (PNGAPI *png_unknown_chunk_ptr) PNGARG((png_structp)); -#endif - -/* Transform masks for the high-level interface */ -#define PNG_TRANSFORM_IDENTITY 0x0000 /* read and write */ -#define PNG_TRANSFORM_STRIP_16 0x0001 /* read only */ -#define PNG_TRANSFORM_STRIP_ALPHA 0x0002 /* read only */ -#define PNG_TRANSFORM_PACKING 0x0004 /* read and write */ -#define PNG_TRANSFORM_PACKSWAP 0x0008 /* read and write */ -#define PNG_TRANSFORM_EXPAND 0x0010 /* read only */ -#define PNG_TRANSFORM_INVERT_MONO 0x0020 /* read and write */ -#define PNG_TRANSFORM_SHIFT 0x0040 /* read and write */ -#define PNG_TRANSFORM_BGR 0x0080 /* read and write */ -#define PNG_TRANSFORM_SWAP_ALPHA 0x0100 /* read and write */ -#define PNG_TRANSFORM_SWAP_ENDIAN 0x0200 /* read and write */ -#define PNG_TRANSFORM_INVERT_ALPHA 0x0400 /* read and write */ -#define PNG_TRANSFORM_STRIP_FILLER 0x0800 /* WRITE only, deprecated */ -/* Added to libpng-1.2.34 */ -#define PNG_TRANSFORM_STRIP_FILLER_BEFORE 0x0800 /* WRITE only */ -#define PNG_TRANSFORM_STRIP_FILLER_AFTER 0x1000 /* WRITE only */ - -/* Flags for MNG supported features */ -#define PNG_FLAG_MNG_EMPTY_PLTE 0x01 -#define PNG_FLAG_MNG_FILTER_64 0x04 -#define PNG_ALL_MNG_FEATURES 0x05 - -typedef png_voidp (*png_malloc_ptr) PNGARG((png_structp, png_size_t)); -typedef void (*png_free_ptr) PNGARG((png_structp, png_voidp)); - -/* The structure that holds the information to read and write PNG files. - * The only people who need to care about what is inside of this are the - * people who will be modifying the library for their own special needs. - * It should NOT be accessed directly by an application, except to store - * the jmp_buf. - */ - -struct png_struct_def -{ -#ifdef PNG_SETJMP_SUPPORTED - jmp_buf jmpbuf; /* used in png_error */ -#endif - png_error_ptr error_fn; /* function for printing errors and aborting */ - png_error_ptr warning_fn; /* function for printing warnings */ - png_voidp error_ptr; /* user supplied struct for error functions */ - png_rw_ptr write_data_fn; /* function for writing output data */ - png_rw_ptr read_data_fn; /* function for reading input data */ - png_voidp io_ptr; /* ptr to application struct for I/O functions */ - -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) - png_user_transform_ptr read_user_transform_fn; /* user read transform */ -#endif - -#if defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) - png_user_transform_ptr write_user_transform_fn; /* user write transform */ -#endif - -/* These were added in libpng-1.0.2 */ -#if defined(PNG_USER_TRANSFORM_PTR_SUPPORTED) -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) - png_voidp user_transform_ptr; /* user supplied struct for user transform */ - png_byte user_transform_depth; /* bit depth of user transformed pixels */ - png_byte user_transform_channels; /* channels in user transformed pixels */ -#endif -#endif - - png_uint_32 mode; /* tells us where we are in the PNG file */ - png_uint_32 flags; /* flags indicating various things to libpng */ - png_uint_32 transformations; /* which transformations to perform */ - - z_stream zstream; /* pointer to decompression structure (below) */ - png_bytep zbuf; /* buffer for zlib */ - png_size_t zbuf_size; /* size of zbuf */ - int zlib_level; /* holds zlib compression level */ - int zlib_method; /* holds zlib compression method */ - int zlib_window_bits; /* holds zlib compression window bits */ - int zlib_mem_level; /* holds zlib compression memory level */ - int zlib_strategy; /* holds zlib compression strategy */ - - png_uint_32 width; /* width of image in pixels */ - png_uint_32 height; /* height of image in pixels */ - png_uint_32 num_rows; /* number of rows in current pass */ - png_uint_32 usr_width; /* width of row at start of write */ - png_uint_32 rowbytes; /* size of row in bytes */ - png_uint_32 irowbytes; /* size of current interlaced row in bytes */ - png_uint_32 iwidth; /* width of current interlaced row in pixels */ - png_uint_32 row_number; /* current row in interlace pass */ - png_bytep prev_row; /* buffer to save previous (unfiltered) row */ - png_bytep row_buf; /* buffer to save current (unfiltered) row */ -#ifndef PNG_NO_WRITE_FILTER - png_bytep sub_row; /* buffer to save "sub" row when filtering */ - png_bytep up_row; /* buffer to save "up" row when filtering */ - png_bytep avg_row; /* buffer to save "avg" row when filtering */ - png_bytep paeth_row; /* buffer to save "Paeth" row when filtering */ -#endif - png_row_info row_info; /* used for transformation routines */ - - png_uint_32 idat_size; /* current IDAT size for read */ - png_uint_32 crc; /* current chunk CRC value */ - png_colorp palette; /* palette from the input file */ - png_uint_16 num_palette; /* number of color entries in palette */ - png_uint_16 num_trans; /* number of transparency values */ - png_byte chunk_name[5]; /* null-terminated name of current chunk */ - png_byte compression; /* file compression type (always 0) */ - png_byte filter; /* file filter type (always 0) */ - png_byte interlaced; /* PNG_INTERLACE_NONE, PNG_INTERLACE_ADAM7 */ - png_byte pass; /* current interlace pass (0 - 6) */ - png_byte do_filter; /* row filter flags (see PNG_FILTER_ below ) */ - png_byte color_type; /* color type of file */ - png_byte bit_depth; /* bit depth of file */ - png_byte usr_bit_depth; /* bit depth of users row */ - png_byte pixel_depth; /* number of bits per pixel */ - png_byte channels; /* number of channels in file */ - png_byte usr_channels; /* channels at start of write */ - png_byte sig_bytes; /* magic bytes read/written from start of file */ - -#if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED) -#ifdef PNG_LEGACY_SUPPORTED - png_byte filler; /* filler byte for pixel expansion */ -#else - png_uint_16 filler; /* filler bytes for pixel expansion */ -#endif -#endif - -#if defined(PNG_bKGD_SUPPORTED) - png_byte background_gamma_type; -# ifdef PNG_FLOATING_POINT_SUPPORTED - float background_gamma; -# endif - png_color_16 background; /* background color in screen gamma space */ -#if defined(PNG_READ_GAMMA_SUPPORTED) - png_color_16 background_1; /* background normalized to gamma 1.0 */ -#endif -#endif /* PNG_bKGD_SUPPORTED */ - -#if defined(PNG_WRITE_FLUSH_SUPPORTED) - png_flush_ptr output_flush_fn;/* Function for flushing output */ - png_uint_32 flush_dist; /* how many rows apart to flush, 0 - no flush */ - png_uint_32 flush_rows; /* number of rows written since last flush */ -#endif - -#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) - int gamma_shift; /* number of "insignificant" bits 16-bit gamma */ -#ifdef PNG_FLOATING_POINT_SUPPORTED - float gamma; /* file gamma value */ - float screen_gamma; /* screen gamma value (display_exponent) */ -#endif -#endif - -#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) - png_bytep gamma_table; /* gamma table for 8-bit depth files */ - png_bytep gamma_from_1; /* converts from 1.0 to screen */ - png_bytep gamma_to_1; /* converts from file to 1.0 */ - png_uint_16pp gamma_16_table; /* gamma table for 16-bit depth files */ - png_uint_16pp gamma_16_from_1; /* converts from 1.0 to screen */ - png_uint_16pp gamma_16_to_1; /* converts from file to 1.0 */ -#endif - -#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_sBIT_SUPPORTED) - png_color_8 sig_bit; /* significant bits in each available channel */ -#endif - -#if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED) - png_color_8 shift; /* shift for significant bit tranformation */ -#endif - -#if defined(PNG_tRNS_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) \ - || defined(PNG_READ_EXPAND_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) - png_bytep trans; /* transparency values for paletted files */ - png_color_16 trans_values; /* transparency values for non-paletted files */ -#endif - - png_read_status_ptr read_row_fn; /* called after each row is decoded */ - png_write_status_ptr write_row_fn; /* called after each row is encoded */ -#ifdef PNG_PROGRESSIVE_READ_SUPPORTED - png_progressive_info_ptr info_fn; /* called after header data fully read */ - png_progressive_row_ptr row_fn; /* called after each prog. row is decoded */ - png_progressive_end_ptr end_fn; /* called after image is complete */ - png_bytep save_buffer_ptr; /* current location in save_buffer */ - png_bytep save_buffer; /* buffer for previously read data */ - png_bytep current_buffer_ptr; /* current location in current_buffer */ - png_bytep current_buffer; /* buffer for recently used data */ - png_uint_32 push_length; /* size of current input chunk */ - png_uint_32 skip_length; /* bytes to skip in input data */ - png_size_t save_buffer_size; /* amount of data now in save_buffer */ - png_size_t save_buffer_max; /* total size of save_buffer */ - png_size_t buffer_size; /* total amount of available input data */ - png_size_t current_buffer_size; /* amount of data now in current_buffer */ - int process_mode; /* what push library is currently doing */ - int cur_palette; /* current push library palette index */ - -# if defined(PNG_TEXT_SUPPORTED) - png_size_t current_text_size; /* current size of text input data */ - png_size_t current_text_left; /* how much text left to read in input */ - png_charp current_text; /* current text chunk buffer */ - png_charp current_text_ptr; /* current location in current_text */ -# endif /* PNG_TEXT_SUPPORTED */ -#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ - -#if defined(__TURBOC__) && !defined(_Windows) && !defined(__FLAT__) -/* for the Borland special 64K segment handler */ - png_bytepp offset_table_ptr; - png_bytep offset_table; - png_uint_16 offset_table_number; - png_uint_16 offset_table_count; - png_uint_16 offset_table_count_free; -#endif - -#if defined(PNG_READ_DITHER_SUPPORTED) - png_bytep palette_lookup; /* lookup table for dithering */ - png_bytep dither_index; /* index translation for palette files */ -#endif - -#if defined(PNG_READ_DITHER_SUPPORTED) || defined(PNG_hIST_SUPPORTED) - png_uint_16p hist; /* histogram */ -#endif - -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) - png_byte heuristic_method; /* heuristic for row filter selection */ - png_byte num_prev_filters; /* number of weights for previous rows */ - png_bytep prev_filters; /* filter type(s) of previous row(s) */ - png_uint_16p filter_weights; /* weight(s) for previous line(s) */ - png_uint_16p inv_filter_weights; /* 1/weight(s) for previous line(s) */ - png_uint_16p filter_costs; /* relative filter calculation cost */ - png_uint_16p inv_filter_costs; /* 1/relative filter calculation cost */ -#endif - -#if defined(PNG_TIME_RFC1123_SUPPORTED) - png_charp time_buffer; /* String to hold RFC 1123 time text */ -#endif - -/* New members added in libpng-1.0.6 */ - -#ifdef PNG_FREE_ME_SUPPORTED - png_uint_32 free_me; /* flags items libpng is responsible for freeing */ -#endif - -#if defined(PNG_USER_CHUNKS_SUPPORTED) - png_voidp user_chunk_ptr; - png_user_chunk_ptr read_user_chunk_fn; /* user read chunk handler */ -#endif - -#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) - int num_chunk_list; - png_bytep chunk_list; -#endif - -/* New members added in libpng-1.0.3 */ -#if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) - png_byte rgb_to_gray_status; - /* These were changed from png_byte in libpng-1.0.6 */ - png_uint_16 rgb_to_gray_red_coeff; - png_uint_16 rgb_to_gray_green_coeff; - png_uint_16 rgb_to_gray_blue_coeff; -#endif - -/* New member added in libpng-1.0.4 (renamed in 1.0.9) */ -#if defined(PNG_MNG_FEATURES_SUPPORTED) || \ - defined(PNG_READ_EMPTY_PLTE_SUPPORTED) || \ - defined(PNG_WRITE_EMPTY_PLTE_SUPPORTED) -/* changed from png_byte to png_uint_32 at version 1.2.0 */ -#ifdef PNG_1_0_X - png_byte mng_features_permitted; -#else - png_uint_32 mng_features_permitted; -#endif /* PNG_1_0_X */ -#endif - -/* New member added in libpng-1.0.7 */ -#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) - png_fixed_point int_gamma; -#endif - -/* New member added in libpng-1.0.9, ifdef'ed out in 1.0.12, enabled in 1.2.0 */ -#if defined(PNG_MNG_FEATURES_SUPPORTED) - png_byte filter_type; -#endif - -#if defined(PNG_1_0_X) -/* New member added in libpng-1.0.10, ifdef'ed out in 1.2.0 */ - png_uint_32 row_buf_size; -#endif - -/* New members added in libpng-1.2.0 */ -#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) -# if !defined(PNG_1_0_X) -# if defined(PNG_MMX_CODE_SUPPORTED) - png_byte mmx_bitdepth_threshold; - png_uint_32 mmx_rowbytes_threshold; -# endif - png_uint_32 asm_flags; -# endif -#endif - -/* New members added in libpng-1.0.2 but first enabled by default in 1.2.0 */ -#ifdef PNG_USER_MEM_SUPPORTED - png_voidp mem_ptr; /* user supplied struct for mem functions */ - png_malloc_ptr malloc_fn; /* function for allocating memory */ - png_free_ptr free_fn; /* function for freeing memory */ -#endif - -/* New member added in libpng-1.0.13 and 1.2.0 */ - png_bytep big_row_buf; /* buffer to save current (unfiltered) row */ - -#if defined(PNG_READ_DITHER_SUPPORTED) -/* The following three members were added at version 1.0.14 and 1.2.4 */ - png_bytep dither_sort; /* working sort array */ - png_bytep index_to_palette; /* where the original index currently is */ - /* in the palette */ - png_bytep palette_to_index; /* which original index points to this */ - /* palette color */ -#endif - -/* New members added in libpng-1.0.16 and 1.2.6 */ - png_byte compression_type; - -#ifdef PNG_SET_USER_LIMITS_SUPPORTED - png_uint_32 user_width_max; - png_uint_32 user_height_max; -#endif - -/* New member added in libpng-1.0.25 and 1.2.17 */ -#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) - /* storage for unknown chunk that the library doesn't recognize. */ - png_unknown_chunk unknown_chunk; -#endif - -/* New members added in libpng-1.2.26 */ - png_uint_32 old_big_row_buf_size, old_prev_row_size; - -/* New member added in libpng-1.2.30 */ - png_charp chunkdata; /* buffer for reading chunk data */ - -}; - - -/* This triggers a compiler error in png.c, if png.c and png.h - * do not agree upon the version number. - */ -typedef png_structp version_1_2_37; - -typedef png_struct FAR * FAR * png_structpp; - -/* Here are the function definitions most commonly used. This is not - * the place to find out how to use libpng. See libpng.txt for the - * full explanation, see example.c for the summary. This just provides - * a simple one line description of the use of each function. - */ - -/* Returns the version number of the library */ -extern PNG_EXPORT(png_uint_32,png_access_version_number) PNGARG((void)); - -/* Tell lib we have already handled the first magic bytes. - * Handling more than 8 bytes from the beginning of the file is an error. - */ -extern PNG_EXPORT(void,png_set_sig_bytes) PNGARG((png_structp png_ptr, - int num_bytes)); - -/* Check sig[start] through sig[start + num_to_check - 1] to see if it's a - * PNG file. Returns zero if the supplied bytes match the 8-byte PNG - * signature, and non-zero otherwise. Having num_to_check == 0 or - * start > 7 will always fail (ie return non-zero). - */ -extern PNG_EXPORT(int,png_sig_cmp) PNGARG((png_bytep sig, png_size_t start, - png_size_t num_to_check)); - -/* Simple signature checking function. This is the same as calling - * png_check_sig(sig, n) := !png_sig_cmp(sig, 0, n). - */ -extern PNG_EXPORT(int,png_check_sig) PNGARG((png_bytep sig, int num)); - -/* Allocate and initialize png_ptr struct for reading, and any other memory. */ -extern PNG_EXPORT(png_structp,png_create_read_struct) - PNGARG((png_const_charp user_png_ver, png_voidp error_ptr, - png_error_ptr error_fn, png_error_ptr warn_fn)); - -/* Allocate and initialize png_ptr struct for writing, and any other memory */ -extern PNG_EXPORT(png_structp,png_create_write_struct) - PNGARG((png_const_charp user_png_ver, png_voidp error_ptr, - png_error_ptr error_fn, png_error_ptr warn_fn)); - -#ifdef PNG_WRITE_SUPPORTED -extern PNG_EXPORT(png_uint_32,png_get_compression_buffer_size) - PNGARG((png_structp png_ptr)); -#endif - -#ifdef PNG_WRITE_SUPPORTED -extern PNG_EXPORT(void,png_set_compression_buffer_size) - PNGARG((png_structp png_ptr, png_uint_32 size)); -#endif - -/* Reset the compression stream */ -extern PNG_EXPORT(int,png_reset_zstream) PNGARG((png_structp png_ptr)); - -/* New functions added in libpng-1.0.2 (not enabled by default until 1.2.0) */ -#ifdef PNG_USER_MEM_SUPPORTED -extern PNG_EXPORT(png_structp,png_create_read_struct_2) - PNGARG((png_const_charp user_png_ver, png_voidp error_ptr, - png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr, - png_malloc_ptr malloc_fn, png_free_ptr free_fn)); -extern PNG_EXPORT(png_structp,png_create_write_struct_2) - PNGARG((png_const_charp user_png_ver, png_voidp error_ptr, - png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr, - png_malloc_ptr malloc_fn, png_free_ptr free_fn)); -#endif - -/* Write a PNG chunk - size, type, (optional) data, CRC. */ -extern PNG_EXPORT(void,png_write_chunk) PNGARG((png_structp png_ptr, - png_bytep chunk_name, png_bytep data, png_size_t length)); - -/* Write the start of a PNG chunk - length and chunk name. */ -extern PNG_EXPORT(void,png_write_chunk_start) PNGARG((png_structp png_ptr, - png_bytep chunk_name, png_uint_32 length)); - -/* Write the data of a PNG chunk started with png_write_chunk_start(). */ -extern PNG_EXPORT(void,png_write_chunk_data) PNGARG((png_structp png_ptr, - png_bytep data, png_size_t length)); - -/* Finish a chunk started with png_write_chunk_start() (includes CRC). */ -extern PNG_EXPORT(void,png_write_chunk_end) PNGARG((png_structp png_ptr)); - -/* Allocate and initialize the info structure */ -extern PNG_EXPORT(png_infop,png_create_info_struct) - PNGARG((png_structp png_ptr)); - -#if defined(PNG_1_0_X) || defined (PNG_1_2_X) -/* Initialize the info structure (old interface - DEPRECATED) */ -extern PNG_EXPORT(void,png_info_init) PNGARG((png_infop info_ptr)); -#undef png_info_init -#define png_info_init(info_ptr) png_info_init_3(&info_ptr,\ - png_sizeof(png_info)); -#endif - -extern PNG_EXPORT(void,png_info_init_3) PNGARG((png_infopp info_ptr, - png_size_t png_info_struct_size)); - -/* Writes all the PNG information before the image. */ -extern PNG_EXPORT(void,png_write_info_before_PLTE) PNGARG((png_structp png_ptr, - png_infop info_ptr)); -extern PNG_EXPORT(void,png_write_info) PNGARG((png_structp png_ptr, - png_infop info_ptr)); - -#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED -/* read the information before the actual image data. */ -extern PNG_EXPORT(void,png_read_info) PNGARG((png_structp png_ptr, - png_infop info_ptr)); -#endif - -#if defined(PNG_TIME_RFC1123_SUPPORTED) -extern PNG_EXPORT(png_charp,png_convert_to_rfc1123) - PNGARG((png_structp png_ptr, png_timep ptime)); -#endif - -#if !defined(_WIN32_WCE) -/* "time.h" functions are not supported on WindowsCE */ -#if defined(PNG_WRITE_tIME_SUPPORTED) -/* convert from a struct tm to png_time */ -extern PNG_EXPORT(void,png_convert_from_struct_tm) PNGARG((png_timep ptime, - struct tm FAR * ttime)); - -/* convert from time_t to png_time. Uses gmtime() */ -extern PNG_EXPORT(void,png_convert_from_time_t) PNGARG((png_timep ptime, - time_t ttime)); -#endif /* PNG_WRITE_tIME_SUPPORTED */ -#endif /* _WIN32_WCE */ - -#if defined(PNG_READ_EXPAND_SUPPORTED) -/* Expand data to 24-bit RGB, or 8-bit grayscale, with alpha if available. */ -extern PNG_EXPORT(void,png_set_expand) PNGARG((png_structp png_ptr)); -#if !defined(PNG_1_0_X) -extern PNG_EXPORT(void,png_set_expand_gray_1_2_4_to_8) PNGARG((png_structp - png_ptr)); -#endif -extern PNG_EXPORT(void,png_set_palette_to_rgb) PNGARG((png_structp png_ptr)); -extern PNG_EXPORT(void,png_set_tRNS_to_alpha) PNGARG((png_structp png_ptr)); -#if defined(PNG_1_0_X) || defined (PNG_1_2_X) -/* Deprecated */ -extern PNG_EXPORT(void,png_set_gray_1_2_4_to_8) PNGARG((png_structp png_ptr)); -#endif -#endif - -#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED) -/* Use blue, green, red order for pixels. */ -extern PNG_EXPORT(void,png_set_bgr) PNGARG((png_structp png_ptr)); -#endif - -#if defined(PNG_READ_GRAY_TO_RGB_SUPPORTED) -/* Expand the grayscale to 24-bit RGB if necessary. */ -extern PNG_EXPORT(void,png_set_gray_to_rgb) PNGARG((png_structp png_ptr)); -#endif - -#if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) -/* Reduce RGB to grayscale. */ -#ifdef PNG_FLOATING_POINT_SUPPORTED -extern PNG_EXPORT(void,png_set_rgb_to_gray) PNGARG((png_structp png_ptr, - int error_action, double red, double green )); -#endif -extern PNG_EXPORT(void,png_set_rgb_to_gray_fixed) PNGARG((png_structp png_ptr, - int error_action, png_fixed_point red, png_fixed_point green )); -extern PNG_EXPORT(png_byte,png_get_rgb_to_gray_status) PNGARG((png_structp - png_ptr)); -#endif - -extern PNG_EXPORT(void,png_build_grayscale_palette) PNGARG((int bit_depth, - png_colorp palette)); - -#if defined(PNG_READ_STRIP_ALPHA_SUPPORTED) -extern PNG_EXPORT(void,png_set_strip_alpha) PNGARG((png_structp png_ptr)); -#endif - -#if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) || \ - defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED) -extern PNG_EXPORT(void,png_set_swap_alpha) PNGARG((png_structp png_ptr)); -#endif - -#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) || \ - defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED) -extern PNG_EXPORT(void,png_set_invert_alpha) PNGARG((png_structp png_ptr)); -#endif - -#if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED) -/* Add a filler byte to 8-bit Gray or 24-bit RGB images. */ -extern PNG_EXPORT(void,png_set_filler) PNGARG((png_structp png_ptr, - png_uint_32 filler, int flags)); -/* The values of the PNG_FILLER_ defines should NOT be changed */ -#define PNG_FILLER_BEFORE 0 -#define PNG_FILLER_AFTER 1 -/* Add an alpha byte to 8-bit Gray or 24-bit RGB images. */ -#if !defined(PNG_1_0_X) -extern PNG_EXPORT(void,png_set_add_alpha) PNGARG((png_structp png_ptr, - png_uint_32 filler, int flags)); -#endif -#endif /* PNG_READ_FILLER_SUPPORTED || PNG_WRITE_FILLER_SUPPORTED */ - -#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED) -/* Swap bytes in 16-bit depth files. */ -extern PNG_EXPORT(void,png_set_swap) PNGARG((png_structp png_ptr)); -#endif - -#if defined(PNG_READ_PACK_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED) -/* Use 1 byte per pixel in 1, 2, or 4-bit depth files. */ -extern PNG_EXPORT(void,png_set_packing) PNGARG((png_structp png_ptr)); -#endif - -#if defined(PNG_READ_PACKSWAP_SUPPORTED) || defined(PNG_WRITE_PACKSWAP_SUPPORTED) -/* Swap packing order of pixels in bytes. */ -extern PNG_EXPORT(void,png_set_packswap) PNGARG((png_structp png_ptr)); -#endif - -#if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED) -/* Converts files to legal bit depths. */ -extern PNG_EXPORT(void,png_set_shift) PNGARG((png_structp png_ptr, - png_color_8p true_bits)); -#endif - -#if defined(PNG_READ_INTERLACING_SUPPORTED) || \ - defined(PNG_WRITE_INTERLACING_SUPPORTED) -/* Have the code handle the interlacing. Returns the number of passes. */ -extern PNG_EXPORT(int,png_set_interlace_handling) PNGARG((png_structp png_ptr)); -#endif - -#if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED) -/* Invert monochrome files */ -extern PNG_EXPORT(void,png_set_invert_mono) PNGARG((png_structp png_ptr)); -#endif - -#if defined(PNG_READ_BACKGROUND_SUPPORTED) -/* Handle alpha and tRNS by replacing with a background color. */ -#ifdef PNG_FLOATING_POINT_SUPPORTED -extern PNG_EXPORT(void,png_set_background) PNGARG((png_structp png_ptr, - png_color_16p background_color, int background_gamma_code, - int need_expand, double background_gamma)); -#endif -#define PNG_BACKGROUND_GAMMA_UNKNOWN 0 -#define PNG_BACKGROUND_GAMMA_SCREEN 1 -#define PNG_BACKGROUND_GAMMA_FILE 2 -#define PNG_BACKGROUND_GAMMA_UNIQUE 3 -#endif - -#if defined(PNG_READ_16_TO_8_SUPPORTED) -/* strip the second byte of information from a 16-bit depth file. */ -extern PNG_EXPORT(void,png_set_strip_16) PNGARG((png_structp png_ptr)); -#endif - -#if defined(PNG_READ_DITHER_SUPPORTED) -/* Turn on dithering, and reduce the palette to the number of colors available. */ -extern PNG_EXPORT(void,png_set_dither) PNGARG((png_structp png_ptr, - png_colorp palette, int num_palette, int maximum_colors, - png_uint_16p histogram, int full_dither)); -#endif - -#if defined(PNG_READ_GAMMA_SUPPORTED) -/* Handle gamma correction. Screen_gamma=(display_exponent) */ -#ifdef PNG_FLOATING_POINT_SUPPORTED -extern PNG_EXPORT(void,png_set_gamma) PNGARG((png_structp png_ptr, - double screen_gamma, double default_file_gamma)); -#endif -#endif - -#if defined(PNG_1_0_X) || defined (PNG_1_2_X) -#if defined(PNG_READ_EMPTY_PLTE_SUPPORTED) || \ - defined(PNG_WRITE_EMPTY_PLTE_SUPPORTED) -/* Permit or disallow empty PLTE (0: not permitted, 1: permitted) */ -/* Deprecated and will be removed. Use png_permit_mng_features() instead. */ -extern PNG_EXPORT(void,png_permit_empty_plte) PNGARG((png_structp png_ptr, - int empty_plte_permitted)); -#endif -#endif - -#if defined(PNG_WRITE_FLUSH_SUPPORTED) -/* Set how many lines between output flushes - 0 for no flushing */ -extern PNG_EXPORT(void,png_set_flush) PNGARG((png_structp png_ptr, int nrows)); -/* Flush the current PNG output buffer */ -extern PNG_EXPORT(void,png_write_flush) PNGARG((png_structp png_ptr)); -#endif - -/* optional update palette with requested transformations */ -extern PNG_EXPORT(void,png_start_read_image) PNGARG((png_structp png_ptr)); - -/* optional call to update the users info structure */ -extern PNG_EXPORT(void,png_read_update_info) PNGARG((png_structp png_ptr, - png_infop info_ptr)); - -#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED -/* read one or more rows of image data. */ -extern PNG_EXPORT(void,png_read_rows) PNGARG((png_structp png_ptr, - png_bytepp row, png_bytepp display_row, png_uint_32 num_rows)); -#endif - -#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED -/* read a row of data. */ -extern PNG_EXPORT(void,png_read_row) PNGARG((png_structp png_ptr, - png_bytep row, - png_bytep display_row)); -#endif - -#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED -/* read the whole image into memory at once. */ -extern PNG_EXPORT(void,png_read_image) PNGARG((png_structp png_ptr, - png_bytepp image)); -#endif - -/* write a row of image data */ -extern PNG_EXPORT(void,png_write_row) PNGARG((png_structp png_ptr, - png_bytep row)); - -/* write a few rows of image data */ -extern PNG_EXPORT(void,png_write_rows) PNGARG((png_structp png_ptr, - png_bytepp row, png_uint_32 num_rows)); - -/* write the image data */ -extern PNG_EXPORT(void,png_write_image) PNGARG((png_structp png_ptr, - png_bytepp image)); - -/* writes the end of the PNG file. */ -extern PNG_EXPORT(void,png_write_end) PNGARG((png_structp png_ptr, - png_infop info_ptr)); - -#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED -/* read the end of the PNG file. */ -extern PNG_EXPORT(void,png_read_end) PNGARG((png_structp png_ptr, - png_infop info_ptr)); -#endif - -/* free any memory associated with the png_info_struct */ -extern PNG_EXPORT(void,png_destroy_info_struct) PNGARG((png_structp png_ptr, - png_infopp info_ptr_ptr)); - -/* free any memory associated with the png_struct and the png_info_structs */ -extern PNG_EXPORT(void,png_destroy_read_struct) PNGARG((png_structpp - png_ptr_ptr, png_infopp info_ptr_ptr, png_infopp end_info_ptr_ptr)); - -/* free all memory used by the read (old method - NOT DLL EXPORTED) */ -extern void png_read_destroy PNGARG((png_structp png_ptr, png_infop info_ptr, - png_infop end_info_ptr)); - -/* free any memory associated with the png_struct and the png_info_structs */ -extern PNG_EXPORT(void,png_destroy_write_struct) - PNGARG((png_structpp png_ptr_ptr, png_infopp info_ptr_ptr)); - -/* free any memory used in png_ptr struct (old method - NOT DLL EXPORTED) */ -extern void png_write_destroy PNGARG((png_structp png_ptr)); - -/* set the libpng method of handling chunk CRC errors */ -extern PNG_EXPORT(void,png_set_crc_action) PNGARG((png_structp png_ptr, - int crit_action, int ancil_action)); - -/* Values for png_set_crc_action() to say how to handle CRC errors in - * ancillary and critical chunks, and whether to use the data contained - * therein. Note that it is impossible to "discard" data in a critical - * chunk. For versions prior to 0.90, the action was always error/quit, - * whereas in version 0.90 and later, the action for CRC errors in ancillary - * chunks is warn/discard. These values should NOT be changed. - * - * value action:critical action:ancillary - */ -#define PNG_CRC_DEFAULT 0 /* error/quit warn/discard data */ -#define PNG_CRC_ERROR_QUIT 1 /* error/quit error/quit */ -#define PNG_CRC_WARN_DISCARD 2 /* (INVALID) warn/discard data */ -#define PNG_CRC_WARN_USE 3 /* warn/use data warn/use data */ -#define PNG_CRC_QUIET_USE 4 /* quiet/use data quiet/use data */ -#define PNG_CRC_NO_CHANGE 5 /* use current value use current value */ - -/* These functions give the user control over the scan-line filtering in - * libpng and the compression methods used by zlib. These functions are - * mainly useful for testing, as the defaults should work with most users. - * Those users who are tight on memory or want faster performance at the - * expense of compression can modify them. See the compression library - * header file (zlib.h) for an explination of the compression functions. - */ - -/* set the filtering method(s) used by libpng. Currently, the only valid - * value for "method" is 0. - */ -extern PNG_EXPORT(void,png_set_filter) PNGARG((png_structp png_ptr, int method, - int filters)); - -/* Flags for png_set_filter() to say which filters to use. The flags - * are chosen so that they don't conflict with real filter types - * below, in case they are supplied instead of the #defined constants. - * These values should NOT be changed. - */ -#define PNG_NO_FILTERS 0x00 -#define PNG_FILTER_NONE 0x08 -#define PNG_FILTER_SUB 0x10 -#define PNG_FILTER_UP 0x20 -#define PNG_FILTER_AVG 0x40 -#define PNG_FILTER_PAETH 0x80 -#define PNG_ALL_FILTERS (PNG_FILTER_NONE | PNG_FILTER_SUB | PNG_FILTER_UP | \ - PNG_FILTER_AVG | PNG_FILTER_PAETH) - -/* Filter values (not flags) - used in pngwrite.c, pngwutil.c for now. - * These defines should NOT be changed. - */ -#define PNG_FILTER_VALUE_NONE 0 -#define PNG_FILTER_VALUE_SUB 1 -#define PNG_FILTER_VALUE_UP 2 -#define PNG_FILTER_VALUE_AVG 3 -#define PNG_FILTER_VALUE_PAETH 4 -#define PNG_FILTER_VALUE_LAST 5 - -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) /* EXPERIMENTAL */ -/* The "heuristic_method" is given by one of the PNG_FILTER_HEURISTIC_ - * defines, either the default (minimum-sum-of-absolute-differences), or - * the experimental method (weighted-minimum-sum-of-absolute-differences). - * - * Weights are factors >= 1.0, indicating how important it is to keep the - * filter type consistent between rows. Larger numbers mean the current - * filter is that many times as likely to be the same as the "num_weights" - * previous filters. This is cumulative for each previous row with a weight. - * There needs to be "num_weights" values in "filter_weights", or it can be - * NULL if the weights aren't being specified. Weights have no influence on - * the selection of the first row filter. Well chosen weights can (in theory) - * improve the compression for a given image. - * - * Costs are factors >= 1.0 indicating the relative decoding costs of a - * filter type. Higher costs indicate more decoding expense, and are - * therefore less likely to be selected over a filter with lower computational - * costs. There needs to be a value in "filter_costs" for each valid filter - * type (given by PNG_FILTER_VALUE_LAST), or it can be NULL if you aren't - * setting the costs. Costs try to improve the speed of decompression without - * unduly increasing the compressed image size. - * - * A negative weight or cost indicates the default value is to be used, and - * values in the range [0.0, 1.0) indicate the value is to remain unchanged. - * The default values for both weights and costs are currently 1.0, but may - * change if good general weighting/cost heuristics can be found. If both - * the weights and costs are set to 1.0, this degenerates the WEIGHTED method - * to the UNWEIGHTED method, but with added encoding time/computation. - */ -#ifdef PNG_FLOATING_POINT_SUPPORTED -extern PNG_EXPORT(void,png_set_filter_heuristics) PNGARG((png_structp png_ptr, - int heuristic_method, int num_weights, png_doublep filter_weights, - png_doublep filter_costs)); -#endif -#endif /* PNG_WRITE_WEIGHTED_FILTER_SUPPORTED */ - -/* Heuristic used for row filter selection. These defines should NOT be - * changed. - */ -#define PNG_FILTER_HEURISTIC_DEFAULT 0 /* Currently "UNWEIGHTED" */ -#define PNG_FILTER_HEURISTIC_UNWEIGHTED 1 /* Used by libpng < 0.95 */ -#define PNG_FILTER_HEURISTIC_WEIGHTED 2 /* Experimental feature */ -#define PNG_FILTER_HEURISTIC_LAST 3 /* Not a valid value */ - -/* Set the library compression level. Currently, valid values range from - * 0 - 9, corresponding directly to the zlib compression levels 0 - 9 - * (0 - no compression, 9 - "maximal" compression). Note that tests have - * shown that zlib compression levels 3-6 usually perform as well as level 9 - * for PNG images, and do considerably fewer caclulations. In the future, - * these values may not correspond directly to the zlib compression levels. - */ -extern PNG_EXPORT(void,png_set_compression_level) PNGARG((png_structp png_ptr, - int level)); - -extern PNG_EXPORT(void,png_set_compression_mem_level) - PNGARG((png_structp png_ptr, int mem_level)); - -extern PNG_EXPORT(void,png_set_compression_strategy) - PNGARG((png_structp png_ptr, int strategy)); - -extern PNG_EXPORT(void,png_set_compression_window_bits) - PNGARG((png_structp png_ptr, int window_bits)); - -extern PNG_EXPORT(void,png_set_compression_method) PNGARG((png_structp png_ptr, - int method)); - -/* These next functions are called for input/output, memory, and error - * handling. They are in the file pngrio.c, pngwio.c, and pngerror.c, - * and call standard C I/O routines such as fread(), fwrite(), and - * fprintf(). These functions can be made to use other I/O routines - * at run time for those applications that need to handle I/O in a - * different manner by calling png_set_???_fn(). See libpng.txt for - * more information. - */ - -#if !defined(PNG_NO_STDIO) -/* Initialize the input/output for the PNG file to the default functions. */ -extern PNG_EXPORT(void,png_init_io) PNGARG((png_structp png_ptr, png_FILE_p fp)); -#endif - -/* Replace the (error and abort), and warning functions with user - * supplied functions. If no messages are to be printed you must still - * write and use replacement functions. The replacement error_fn should - * still do a longjmp to the last setjmp location if you are using this - * method of error handling. If error_fn or warning_fn is NULL, the - * default function will be used. - */ - -extern PNG_EXPORT(void,png_set_error_fn) PNGARG((png_structp png_ptr, - png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warning_fn)); - -/* Return the user pointer associated with the error functions */ -extern PNG_EXPORT(png_voidp,png_get_error_ptr) PNGARG((png_structp png_ptr)); - -/* Replace the default data output functions with a user supplied one(s). - * If buffered output is not used, then output_flush_fn can be set to NULL. - * If PNG_WRITE_FLUSH_SUPPORTED is not defined at libpng compile time - * output_flush_fn will be ignored (and thus can be NULL). - * It is probably a mistake to use NULL for output_flush_fn if - * write_data_fn is not also NULL unless you have built libpng with - * PNG_WRITE_FLUSH_SUPPORTED undefined, because in this case libpng's - * default flush function, which uses the standard *FILE structure, will - * be used. - */ -extern PNG_EXPORT(void,png_set_write_fn) PNGARG((png_structp png_ptr, - png_voidp io_ptr, png_rw_ptr write_data_fn, png_flush_ptr output_flush_fn)); - -/* Replace the default data input function with a user supplied one. */ -extern PNG_EXPORT(void,png_set_read_fn) PNGARG((png_structp png_ptr, - png_voidp io_ptr, png_rw_ptr read_data_fn)); - -/* Return the user pointer associated with the I/O functions */ -extern PNG_EXPORT(png_voidp,png_get_io_ptr) PNGARG((png_structp png_ptr)); - -extern PNG_EXPORT(void,png_set_read_status_fn) PNGARG((png_structp png_ptr, - png_read_status_ptr read_row_fn)); - -extern PNG_EXPORT(void,png_set_write_status_fn) PNGARG((png_structp png_ptr, - png_write_status_ptr write_row_fn)); - -#ifdef PNG_USER_MEM_SUPPORTED -/* Replace the default memory allocation functions with user supplied one(s). */ -extern PNG_EXPORT(void,png_set_mem_fn) PNGARG((png_structp png_ptr, - png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn)); -/* Return the user pointer associated with the memory functions */ -extern PNG_EXPORT(png_voidp,png_get_mem_ptr) PNGARG((png_structp png_ptr)); -#endif - -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_LEGACY_SUPPORTED) -extern PNG_EXPORT(void,png_set_read_user_transform_fn) PNGARG((png_structp - png_ptr, png_user_transform_ptr read_user_transform_fn)); -#endif - -#if defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_LEGACY_SUPPORTED) -extern PNG_EXPORT(void,png_set_write_user_transform_fn) PNGARG((png_structp - png_ptr, png_user_transform_ptr write_user_transform_fn)); -#endif - -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_LEGACY_SUPPORTED) -extern PNG_EXPORT(void,png_set_user_transform_info) PNGARG((png_structp - png_ptr, png_voidp user_transform_ptr, int user_transform_depth, - int user_transform_channels)); -/* Return the user pointer associated with the user transform functions */ -extern PNG_EXPORT(png_voidp,png_get_user_transform_ptr) - PNGARG((png_structp png_ptr)); -#endif - -#ifdef PNG_USER_CHUNKS_SUPPORTED -extern PNG_EXPORT(void,png_set_read_user_chunk_fn) PNGARG((png_structp png_ptr, - png_voidp user_chunk_ptr, png_user_chunk_ptr read_user_chunk_fn)); -extern PNG_EXPORT(png_voidp,png_get_user_chunk_ptr) PNGARG((png_structp - png_ptr)); -#endif - -#ifdef PNG_PROGRESSIVE_READ_SUPPORTED -/* Sets the function callbacks for the push reader, and a pointer to a - * user-defined structure available to the callback functions. - */ -extern PNG_EXPORT(void,png_set_progressive_read_fn) PNGARG((png_structp png_ptr, - png_voidp progressive_ptr, - png_progressive_info_ptr info_fn, png_progressive_row_ptr row_fn, - png_progressive_end_ptr end_fn)); - -/* returns the user pointer associated with the push read functions */ -extern PNG_EXPORT(png_voidp,png_get_progressive_ptr) - PNGARG((png_structp png_ptr)); - -/* function to be called when data becomes available */ -extern PNG_EXPORT(void,png_process_data) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_bytep buffer, png_size_t buffer_size)); - -/* function that combines rows. Not very much different than the - * png_combine_row() call. Is this even used????? - */ -extern PNG_EXPORT(void,png_progressive_combine_row) PNGARG((png_structp png_ptr, - png_bytep old_row, png_bytep new_row)); -#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ - -extern PNG_EXPORT(png_voidp,png_malloc) PNGARG((png_structp png_ptr, - png_uint_32 size)); - -#if defined(PNG_1_0_X) -# define png_malloc_warn png_malloc -#else -/* Added at libpng version 1.2.4 */ -extern PNG_EXPORT(png_voidp,png_malloc_warn) PNGARG((png_structp png_ptr, - png_uint_32 size)); -#endif - -/* frees a pointer allocated by png_malloc() */ -extern PNG_EXPORT(void,png_free) PNGARG((png_structp png_ptr, png_voidp ptr)); - -#if defined(PNG_1_0_X) -/* Function to allocate memory for zlib. */ -extern PNG_EXPORT(voidpf,png_zalloc) PNGARG((voidpf png_ptr, uInt items, - uInt size)); - -/* Function to free memory for zlib */ -extern PNG_EXPORT(void,png_zfree) PNGARG((voidpf png_ptr, voidpf ptr)); -#endif - -/* Free data that was allocated internally */ -extern PNG_EXPORT(void,png_free_data) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_uint_32 free_me, int num)); -#ifdef PNG_FREE_ME_SUPPORTED -/* Reassign responsibility for freeing existing data, whether allocated - * by libpng or by the application */ -extern PNG_EXPORT(void,png_data_freer) PNGARG((png_structp png_ptr, - png_infop info_ptr, int freer, png_uint_32 mask)); -#endif -/* assignments for png_data_freer */ -#define PNG_DESTROY_WILL_FREE_DATA 1 -#define PNG_SET_WILL_FREE_DATA 1 -#define PNG_USER_WILL_FREE_DATA 2 -/* Flags for png_ptr->free_me and info_ptr->free_me */ -#define PNG_FREE_HIST 0x0008 -#define PNG_FREE_ICCP 0x0010 -#define PNG_FREE_SPLT 0x0020 -#define PNG_FREE_ROWS 0x0040 -#define PNG_FREE_PCAL 0x0080 -#define PNG_FREE_SCAL 0x0100 -#define PNG_FREE_UNKN 0x0200 -#define PNG_FREE_LIST 0x0400 -#define PNG_FREE_PLTE 0x1000 -#define PNG_FREE_TRNS 0x2000 -#define PNG_FREE_TEXT 0x4000 -#define PNG_FREE_ALL 0x7fff -#define PNG_FREE_MUL 0x4220 /* PNG_FREE_SPLT|PNG_FREE_TEXT|PNG_FREE_UNKN */ - -#ifdef PNG_USER_MEM_SUPPORTED -extern PNG_EXPORT(png_voidp,png_malloc_default) PNGARG((png_structp png_ptr, - png_uint_32 size)); -extern PNG_EXPORT(void,png_free_default) PNGARG((png_structp png_ptr, - png_voidp ptr)); -#endif - -extern PNG_EXPORT(png_voidp,png_memcpy_check) PNGARG((png_structp png_ptr, - png_voidp s1, png_voidp s2, png_uint_32 size)); - -extern PNG_EXPORT(png_voidp,png_memset_check) PNGARG((png_structp png_ptr, - png_voidp s1, int value, png_uint_32 size)); - -#if defined(USE_FAR_KEYWORD) /* memory model conversion function */ -extern void *png_far_to_near PNGARG((png_structp png_ptr,png_voidp ptr, - int check)); -#endif /* USE_FAR_KEYWORD */ - -#ifndef PNG_NO_ERROR_TEXT -/* Fatal error in PNG image of libpng - can't continue */ -extern PNG_EXPORT(void,png_error) PNGARG((png_structp png_ptr, - png_const_charp error_message)); - -/* The same, but the chunk name is prepended to the error string. */ -extern PNG_EXPORT(void,png_chunk_error) PNGARG((png_structp png_ptr, - png_const_charp error_message)); -#else -/* Fatal error in PNG image of libpng - can't continue */ -extern PNG_EXPORT(void,png_err) PNGARG((png_structp png_ptr)); -#endif - -#ifndef PNG_NO_WARNINGS -/* Non-fatal error in libpng. Can continue, but may have a problem. */ -extern PNG_EXPORT(void,png_warning) PNGARG((png_structp png_ptr, - png_const_charp warning_message)); - -#ifdef PNG_READ_SUPPORTED -/* Non-fatal error in libpng, chunk name is prepended to message. */ -extern PNG_EXPORT(void,png_chunk_warning) PNGARG((png_structp png_ptr, - png_const_charp warning_message)); -#endif /* PNG_READ_SUPPORTED */ -#endif /* PNG_NO_WARNINGS */ - -/* The png_set_ functions are for storing values in the png_info_struct. - * Similarly, the png_get_ calls are used to read values from the - * png_info_struct, either storing the parameters in the passed variables, or - * setting pointers into the png_info_struct where the data is stored. The - * png_get_ functions return a non-zero value if the data was available - * in info_ptr, or return zero and do not change any of the parameters if the - * data was not available. - * - * These functions should be used instead of directly accessing png_info - * to avoid problems with future changes in the size and internal layout of - * png_info_struct. - */ -/* Returns "flag" if chunk data is valid in info_ptr. */ -extern PNG_EXPORT(png_uint_32,png_get_valid) PNGARG((png_structp png_ptr, -png_infop info_ptr, png_uint_32 flag)); - -/* Returns number of bytes needed to hold a transformed row. */ -extern PNG_EXPORT(png_uint_32,png_get_rowbytes) PNGARG((png_structp png_ptr, -png_infop info_ptr)); - -#if defined(PNG_INFO_IMAGE_SUPPORTED) -/* Returns row_pointers, which is an array of pointers to scanlines that was -returned from png_read_png(). */ -extern PNG_EXPORT(png_bytepp,png_get_rows) PNGARG((png_structp png_ptr, -png_infop info_ptr)); -/* Set row_pointers, which is an array of pointers to scanlines for use -by png_write_png(). */ -extern PNG_EXPORT(void,png_set_rows) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_bytepp row_pointers)); -#endif - -/* Returns number of color channels in image. */ -extern PNG_EXPORT(png_byte,png_get_channels) PNGARG((png_structp png_ptr, -png_infop info_ptr)); - -#ifdef PNG_EASY_ACCESS_SUPPORTED -/* Returns image width in pixels. */ -extern PNG_EXPORT(png_uint_32, png_get_image_width) PNGARG((png_structp -png_ptr, png_infop info_ptr)); - -/* Returns image height in pixels. */ -extern PNG_EXPORT(png_uint_32, png_get_image_height) PNGARG((png_structp -png_ptr, png_infop info_ptr)); - -/* Returns image bit_depth. */ -extern PNG_EXPORT(png_byte, png_get_bit_depth) PNGARG((png_structp -png_ptr, png_infop info_ptr)); - -/* Returns image color_type. */ -extern PNG_EXPORT(png_byte, png_get_color_type) PNGARG((png_structp -png_ptr, png_infop info_ptr)); - -/* Returns image filter_type. */ -extern PNG_EXPORT(png_byte, png_get_filter_type) PNGARG((png_structp -png_ptr, png_infop info_ptr)); - -/* Returns image interlace_type. */ -extern PNG_EXPORT(png_byte, png_get_interlace_type) PNGARG((png_structp -png_ptr, png_infop info_ptr)); - -/* Returns image compression_type. */ -extern PNG_EXPORT(png_byte, png_get_compression_type) PNGARG((png_structp -png_ptr, png_infop info_ptr)); - -/* Returns image resolution in pixels per meter, from pHYs chunk data. */ -extern PNG_EXPORT(png_uint_32, png_get_pixels_per_meter) PNGARG((png_structp -png_ptr, png_infop info_ptr)); -extern PNG_EXPORT(png_uint_32, png_get_x_pixels_per_meter) PNGARG((png_structp -png_ptr, png_infop info_ptr)); -extern PNG_EXPORT(png_uint_32, png_get_y_pixels_per_meter) PNGARG((png_structp -png_ptr, png_infop info_ptr)); - -/* Returns pixel aspect ratio, computed from pHYs chunk data. */ -#ifdef PNG_FLOATING_POINT_SUPPORTED -extern PNG_EXPORT(float, png_get_pixel_aspect_ratio) PNGARG((png_structp -png_ptr, png_infop info_ptr)); -#endif - -/* Returns image x, y offset in pixels or microns, from oFFs chunk data. */ -extern PNG_EXPORT(png_int_32, png_get_x_offset_pixels) PNGARG((png_structp -png_ptr, png_infop info_ptr)); -extern PNG_EXPORT(png_int_32, png_get_y_offset_pixels) PNGARG((png_structp -png_ptr, png_infop info_ptr)); -extern PNG_EXPORT(png_int_32, png_get_x_offset_microns) PNGARG((png_structp -png_ptr, png_infop info_ptr)); -extern PNG_EXPORT(png_int_32, png_get_y_offset_microns) PNGARG((png_structp -png_ptr, png_infop info_ptr)); - -#endif /* PNG_EASY_ACCESS_SUPPORTED */ - -/* Returns pointer to signature string read from PNG header */ -extern PNG_EXPORT(png_bytep,png_get_signature) PNGARG((png_structp png_ptr, -png_infop info_ptr)); - -#if defined(PNG_bKGD_SUPPORTED) -extern PNG_EXPORT(png_uint_32,png_get_bKGD) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_color_16p *background)); -#endif - -#if defined(PNG_bKGD_SUPPORTED) -extern PNG_EXPORT(void,png_set_bKGD) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_color_16p background)); -#endif - -#if defined(PNG_cHRM_SUPPORTED) -#ifdef PNG_FLOATING_POINT_SUPPORTED -extern PNG_EXPORT(png_uint_32,png_get_cHRM) PNGARG((png_structp png_ptr, - png_infop info_ptr, double *white_x, double *white_y, double *red_x, - double *red_y, double *green_x, double *green_y, double *blue_x, - double *blue_y)); -#endif -#ifdef PNG_FIXED_POINT_SUPPORTED -extern PNG_EXPORT(png_uint_32,png_get_cHRM_fixed) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_fixed_point *int_white_x, png_fixed_point - *int_white_y, png_fixed_point *int_red_x, png_fixed_point *int_red_y, - png_fixed_point *int_green_x, png_fixed_point *int_green_y, png_fixed_point - *int_blue_x, png_fixed_point *int_blue_y)); -#endif -#endif - -#if defined(PNG_cHRM_SUPPORTED) -#ifdef PNG_FLOATING_POINT_SUPPORTED -extern PNG_EXPORT(void,png_set_cHRM) PNGARG((png_structp png_ptr, - png_infop info_ptr, double white_x, double white_y, double red_x, - double red_y, double green_x, double green_y, double blue_x, double blue_y)); -#endif -#ifdef PNG_FIXED_POINT_SUPPORTED -extern PNG_EXPORT(void,png_set_cHRM_fixed) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_fixed_point int_white_x, png_fixed_point int_white_y, - png_fixed_point int_red_x, png_fixed_point int_red_y, png_fixed_point - int_green_x, png_fixed_point int_green_y, png_fixed_point int_blue_x, - png_fixed_point int_blue_y)); -#endif -#endif - -#if defined(PNG_gAMA_SUPPORTED) -#ifdef PNG_FLOATING_POINT_SUPPORTED -extern PNG_EXPORT(png_uint_32,png_get_gAMA) PNGARG((png_structp png_ptr, - png_infop info_ptr, double *file_gamma)); -#endif -extern PNG_EXPORT(png_uint_32,png_get_gAMA_fixed) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_fixed_point *int_file_gamma)); -#endif - -#if defined(PNG_gAMA_SUPPORTED) -#ifdef PNG_FLOATING_POINT_SUPPORTED -extern PNG_EXPORT(void,png_set_gAMA) PNGARG((png_structp png_ptr, - png_infop info_ptr, double file_gamma)); -#endif -extern PNG_EXPORT(void,png_set_gAMA_fixed) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_fixed_point int_file_gamma)); -#endif - -#if defined(PNG_hIST_SUPPORTED) -extern PNG_EXPORT(png_uint_32,png_get_hIST) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_uint_16p *hist)); -#endif - -#if defined(PNG_hIST_SUPPORTED) -extern PNG_EXPORT(void,png_set_hIST) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_uint_16p hist)); -#endif - -extern PNG_EXPORT(png_uint_32,png_get_IHDR) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_uint_32 *width, png_uint_32 *height, - int *bit_depth, int *color_type, int *interlace_method, - int *compression_method, int *filter_method)); - -extern PNG_EXPORT(void,png_set_IHDR) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_uint_32 width, png_uint_32 height, int bit_depth, - int color_type, int interlace_method, int compression_method, - int filter_method)); - -#if defined(PNG_oFFs_SUPPORTED) -extern PNG_EXPORT(png_uint_32,png_get_oFFs) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_int_32 *offset_x, png_int_32 *offset_y, - int *unit_type)); -#endif - -#if defined(PNG_oFFs_SUPPORTED) -extern PNG_EXPORT(void,png_set_oFFs) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_int_32 offset_x, png_int_32 offset_y, - int unit_type)); -#endif - -#if defined(PNG_pCAL_SUPPORTED) -extern PNG_EXPORT(png_uint_32,png_get_pCAL) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_charp *purpose, png_int_32 *X0, png_int_32 *X1, - int *type, int *nparams, png_charp *units, png_charpp *params)); -#endif - -#if defined(PNG_pCAL_SUPPORTED) -extern PNG_EXPORT(void,png_set_pCAL) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_charp purpose, png_int_32 X0, png_int_32 X1, - int type, int nparams, png_charp units, png_charpp params)); -#endif - -#if defined(PNG_pHYs_SUPPORTED) -extern PNG_EXPORT(png_uint_32,png_get_pHYs) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type)); -#endif - -#if defined(PNG_pHYs_SUPPORTED) -extern PNG_EXPORT(void,png_set_pHYs) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_uint_32 res_x, png_uint_32 res_y, int unit_type)); -#endif - -extern PNG_EXPORT(png_uint_32,png_get_PLTE) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_colorp *palette, int *num_palette)); - -extern PNG_EXPORT(void,png_set_PLTE) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_colorp palette, int num_palette)); - -#if defined(PNG_sBIT_SUPPORTED) -extern PNG_EXPORT(png_uint_32,png_get_sBIT) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_color_8p *sig_bit)); -#endif - -#if defined(PNG_sBIT_SUPPORTED) -extern PNG_EXPORT(void,png_set_sBIT) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_color_8p sig_bit)); -#endif - -#if defined(PNG_sRGB_SUPPORTED) -extern PNG_EXPORT(png_uint_32,png_get_sRGB) PNGARG((png_structp png_ptr, - png_infop info_ptr, int *intent)); -#endif - -#if defined(PNG_sRGB_SUPPORTED) -extern PNG_EXPORT(void,png_set_sRGB) PNGARG((png_structp png_ptr, - png_infop info_ptr, int intent)); -extern PNG_EXPORT(void,png_set_sRGB_gAMA_and_cHRM) PNGARG((png_structp png_ptr, - png_infop info_ptr, int intent)); -#endif - -#if defined(PNG_iCCP_SUPPORTED) -extern PNG_EXPORT(png_uint_32,png_get_iCCP) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_charpp name, int *compression_type, - png_charpp profile, png_uint_32 *proflen)); - /* Note to maintainer: profile should be png_bytepp */ -#endif - -#if defined(PNG_iCCP_SUPPORTED) -extern PNG_EXPORT(void,png_set_iCCP) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_charp name, int compression_type, - png_charp profile, png_uint_32 proflen)); - /* Note to maintainer: profile should be png_bytep */ -#endif - -#if defined(PNG_sPLT_SUPPORTED) -extern PNG_EXPORT(png_uint_32,png_get_sPLT) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_sPLT_tpp entries)); -#endif - -#if defined(PNG_sPLT_SUPPORTED) -extern PNG_EXPORT(void,png_set_sPLT) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_sPLT_tp entries, int nentries)); -#endif - -#if defined(PNG_TEXT_SUPPORTED) -/* png_get_text also returns the number of text chunks in *num_text */ -extern PNG_EXPORT(png_uint_32,png_get_text) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_textp *text_ptr, int *num_text)); -#endif - -/* - * Note while png_set_text() will accept a structure whose text, - * language, and translated keywords are NULL pointers, the structure - * returned by png_get_text will always contain regular - * zero-terminated C strings. They might be empty strings but - * they will never be NULL pointers. - */ - -#if defined(PNG_TEXT_SUPPORTED) -extern PNG_EXPORT(void,png_set_text) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_textp text_ptr, int num_text)); -#endif - -#if defined(PNG_tIME_SUPPORTED) -extern PNG_EXPORT(png_uint_32,png_get_tIME) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_timep *mod_time)); -#endif - -#if defined(PNG_tIME_SUPPORTED) -extern PNG_EXPORT(void,png_set_tIME) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_timep mod_time)); -#endif - -#if defined(PNG_tRNS_SUPPORTED) -extern PNG_EXPORT(png_uint_32,png_get_tRNS) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_bytep *trans, int *num_trans, - png_color_16p *trans_values)); -#endif - -#if defined(PNG_tRNS_SUPPORTED) -extern PNG_EXPORT(void,png_set_tRNS) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_bytep trans, int num_trans, - png_color_16p trans_values)); -#endif - -#if defined(PNG_tRNS_SUPPORTED) -#endif - -#if defined(PNG_sCAL_SUPPORTED) -#ifdef PNG_FLOATING_POINT_SUPPORTED -extern PNG_EXPORT(png_uint_32,png_get_sCAL) PNGARG((png_structp png_ptr, - png_infop info_ptr, int *unit, double *width, double *height)); -#else -#ifdef PNG_FIXED_POINT_SUPPORTED -extern PNG_EXPORT(png_uint_32,png_get_sCAL_s) PNGARG((png_structp png_ptr, - png_infop info_ptr, int *unit, png_charpp swidth, png_charpp sheight)); -#endif -#endif -#endif /* PNG_sCAL_SUPPORTED */ - -#if defined(PNG_sCAL_SUPPORTED) -#ifdef PNG_FLOATING_POINT_SUPPORTED -extern PNG_EXPORT(void,png_set_sCAL) PNGARG((png_structp png_ptr, - png_infop info_ptr, int unit, double width, double height)); -#else -#ifdef PNG_FIXED_POINT_SUPPORTED -extern PNG_EXPORT(void,png_set_sCAL_s) PNGARG((png_structp png_ptr, - png_infop info_ptr, int unit, png_charp swidth, png_charp sheight)); -#endif -#endif -#endif /* PNG_sCAL_SUPPORTED || PNG_WRITE_sCAL_SUPPORTED */ - -#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) -/* provide a list of chunks and how they are to be handled, if the built-in - handling or default unknown chunk handling is not desired. Any chunks not - listed will be handled in the default manner. The IHDR and IEND chunks - must not be listed. - keep = 0: follow default behaviour - = 1: do not keep - = 2: keep only if safe-to-copy - = 3: keep even if unsafe-to-copy -*/ -extern PNG_EXPORT(void, png_set_keep_unknown_chunks) PNGARG((png_structp - png_ptr, int keep, png_bytep chunk_list, int num_chunks)); -extern PNG_EXPORT(void, png_set_unknown_chunks) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_unknown_chunkp unknowns, int num_unknowns)); -extern PNG_EXPORT(void, png_set_unknown_chunk_location) - PNGARG((png_structp png_ptr, png_infop info_ptr, int chunk, int location)); -extern PNG_EXPORT(png_uint_32,png_get_unknown_chunks) PNGARG((png_structp - png_ptr, png_infop info_ptr, png_unknown_chunkpp entries)); -#endif -#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED -PNG_EXPORT(int,png_handle_as_unknown) PNGARG((png_structp png_ptr, png_bytep - chunk_name)); -#endif - -/* Png_free_data() will turn off the "valid" flag for anything it frees. - If you need to turn it off for a chunk that your application has freed, - you can use png_set_invalid(png_ptr, info_ptr, PNG_INFO_CHNK); */ -extern PNG_EXPORT(void, png_set_invalid) PNGARG((png_structp png_ptr, - png_infop info_ptr, int mask)); - -#if defined(PNG_INFO_IMAGE_SUPPORTED) -/* The "params" pointer is currently not used and is for future expansion. */ -extern PNG_EXPORT(void, png_read_png) PNGARG((png_structp png_ptr, - png_infop info_ptr, - int transforms, - png_voidp params)); -extern PNG_EXPORT(void, png_write_png) PNGARG((png_structp png_ptr, - png_infop info_ptr, - int transforms, - png_voidp params)); -#endif - -/* Define PNG_DEBUG at compile time for debugging information. Higher - * numbers for PNG_DEBUG mean more debugging information. This has - * only been added since version 0.95 so it is not implemented throughout - * libpng yet, but more support will be added as needed. - */ -#ifdef PNG_DEBUG -#if (PNG_DEBUG > 0) -#if !defined(PNG_DEBUG_FILE) && defined(_MSC_VER) -#include -#if (PNG_DEBUG > 1) -#ifndef _DEBUG -# define _DEBUG -#endif -#ifndef png_debug -#define png_debug(l,m) _RPT0(_CRT_WARN,m PNG_STRING_NEWLINE) -#endif -#ifndef png_debug1 -#define png_debug1(l,m,p1) _RPT1(_CRT_WARN,m PNG_STRING_NEWLINE,p1) -#endif -#ifndef png_debug2 -#define png_debug2(l,m,p1,p2) _RPT2(_CRT_WARN,m PNG_STRING_NEWLINE,p1,p2) -#endif -#endif -#else /* PNG_DEBUG_FILE || !_MSC_VER */ -#ifndef PNG_DEBUG_FILE -#define PNG_DEBUG_FILE stderr -#endif /* PNG_DEBUG_FILE */ - -#if (PNG_DEBUG > 1) -/* Note: ["%s"m PNG_STRING_NEWLINE] probably does not work on - * non-ISO compilers */ -# ifdef __STDC__ -# ifndef png_debug -# define png_debug(l,m) \ - { \ - int num_tabs=l; \ - fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \ - (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":"")))); \ - } -# endif -# ifndef png_debug1 -# define png_debug1(l,m,p1) \ - { \ - int num_tabs=l; \ - fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \ - (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1); \ - } -# endif -# ifndef png_debug2 -# define png_debug2(l,m,p1,p2) \ - { \ - int num_tabs=l; \ - fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \ - (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1,p2); \ - } -# endif -# else /* __STDC __ */ -# ifndef png_debug -# define png_debug(l,m) \ - { \ - int num_tabs=l; \ - char format[256]; \ - snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \ - (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \ - m,PNG_STRING_NEWLINE); \ - fprintf(PNG_DEBUG_FILE,format); \ - } -# endif -# ifndef png_debug1 -# define png_debug1(l,m,p1) \ - { \ - int num_tabs=l; \ - char format[256]; \ - snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \ - (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \ - m,PNG_STRING_NEWLINE); \ - fprintf(PNG_DEBUG_FILE,format,p1); \ - } -# endif -# ifndef png_debug2 -# define png_debug2(l,m,p1,p2) \ - { \ - int num_tabs=l; \ - char format[256]; \ - snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \ - (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \ - m,PNG_STRING_NEWLINE); \ - fprintf(PNG_DEBUG_FILE,format,p1,p2); \ - } -# endif -# endif /* __STDC __ */ -#endif /* (PNG_DEBUG > 1) */ - -#endif /* _MSC_VER */ -#endif /* (PNG_DEBUG > 0) */ -#endif /* PNG_DEBUG */ -#ifndef png_debug -#define png_debug(l, m) -#endif -#ifndef png_debug1 -#define png_debug1(l, m, p1) -#endif -#ifndef png_debug2 -#define png_debug2(l, m, p1, p2) -#endif - -extern PNG_EXPORT(png_charp,png_get_copyright) PNGARG((png_structp png_ptr)); -extern PNG_EXPORT(png_charp,png_get_header_ver) PNGARG((png_structp png_ptr)); -extern PNG_EXPORT(png_charp,png_get_header_version) PNGARG((png_structp png_ptr)); -extern PNG_EXPORT(png_charp,png_get_libpng_ver) PNGARG((png_structp png_ptr)); - -#ifdef PNG_MNG_FEATURES_SUPPORTED -extern PNG_EXPORT(png_uint_32,png_permit_mng_features) PNGARG((png_structp - png_ptr, png_uint_32 mng_features_permitted)); -#endif - -/* For use in png_set_keep_unknown, added to version 1.2.6 */ -#define PNG_HANDLE_CHUNK_AS_DEFAULT 0 -#define PNG_HANDLE_CHUNK_NEVER 1 -#define PNG_HANDLE_CHUNK_IF_SAFE 2 -#define PNG_HANDLE_CHUNK_ALWAYS 3 - -/* Added to version 1.2.0 */ -#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) -#if defined(PNG_MMX_CODE_SUPPORTED) -#define PNG_ASM_FLAG_MMX_SUPPORT_COMPILED 0x01 /* not user-settable */ -#define PNG_ASM_FLAG_MMX_SUPPORT_IN_CPU 0x02 /* not user-settable */ -#define PNG_ASM_FLAG_MMX_READ_COMBINE_ROW 0x04 -#define PNG_ASM_FLAG_MMX_READ_INTERLACE 0x08 -#define PNG_ASM_FLAG_MMX_READ_FILTER_SUB 0x10 -#define PNG_ASM_FLAG_MMX_READ_FILTER_UP 0x20 -#define PNG_ASM_FLAG_MMX_READ_FILTER_AVG 0x40 -#define PNG_ASM_FLAG_MMX_READ_FILTER_PAETH 0x80 -#define PNG_ASM_FLAGS_INITIALIZED 0x80000000 /* not user-settable */ - -#define PNG_MMX_READ_FLAGS ( PNG_ASM_FLAG_MMX_READ_COMBINE_ROW \ - | PNG_ASM_FLAG_MMX_READ_INTERLACE \ - | PNG_ASM_FLAG_MMX_READ_FILTER_SUB \ - | PNG_ASM_FLAG_MMX_READ_FILTER_UP \ - | PNG_ASM_FLAG_MMX_READ_FILTER_AVG \ - | PNG_ASM_FLAG_MMX_READ_FILTER_PAETH ) -#define PNG_MMX_WRITE_FLAGS ( 0 ) - -#define PNG_MMX_FLAGS ( PNG_ASM_FLAG_MMX_SUPPORT_COMPILED \ - | PNG_ASM_FLAG_MMX_SUPPORT_IN_CPU \ - | PNG_MMX_READ_FLAGS \ - | PNG_MMX_WRITE_FLAGS ) - -#define PNG_SELECT_READ 1 -#define PNG_SELECT_WRITE 2 -#endif /* PNG_MMX_CODE_SUPPORTED */ - -#if !defined(PNG_1_0_X) -/* pngget.c */ -extern PNG_EXPORT(png_uint_32,png_get_mmx_flagmask) - PNGARG((int flag_select, int *compilerID)); - -/* pngget.c */ -extern PNG_EXPORT(png_uint_32,png_get_asm_flagmask) - PNGARG((int flag_select)); - -/* pngget.c */ -extern PNG_EXPORT(png_uint_32,png_get_asm_flags) - PNGARG((png_structp png_ptr)); - -/* pngget.c */ -extern PNG_EXPORT(png_byte,png_get_mmx_bitdepth_threshold) - PNGARG((png_structp png_ptr)); - -/* pngget.c */ -extern PNG_EXPORT(png_uint_32,png_get_mmx_rowbytes_threshold) - PNGARG((png_structp png_ptr)); - -/* pngset.c */ -extern PNG_EXPORT(void,png_set_asm_flags) - PNGARG((png_structp png_ptr, png_uint_32 asm_flags)); - -/* pngset.c */ -extern PNG_EXPORT(void,png_set_mmx_thresholds) - PNGARG((png_structp png_ptr, png_byte mmx_bitdepth_threshold, - png_uint_32 mmx_rowbytes_threshold)); - -#endif /* PNG_1_0_X */ - -#if !defined(PNG_1_0_X) -/* png.c, pnggccrd.c, or pngvcrd.c */ -extern PNG_EXPORT(int,png_mmx_support) PNGARG((void)); -#endif /* PNG_1_0_X */ -#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */ - -/* Strip the prepended error numbers ("#nnn ") from error and warning - * messages before passing them to the error or warning handler. */ -#ifdef PNG_ERROR_NUMBERS_SUPPORTED -extern PNG_EXPORT(void,png_set_strip_error_numbers) PNGARG((png_structp - png_ptr, png_uint_32 strip_mode)); -#endif - -/* Added at libpng-1.2.6 */ -#ifdef PNG_SET_USER_LIMITS_SUPPORTED -extern PNG_EXPORT(void,png_set_user_limits) PNGARG((png_structp - png_ptr, png_uint_32 user_width_max, png_uint_32 user_height_max)); -extern PNG_EXPORT(png_uint_32,png_get_user_width_max) PNGARG((png_structp - png_ptr)); -extern PNG_EXPORT(png_uint_32,png_get_user_height_max) PNGARG((png_structp - png_ptr)); -#endif - - -/* Maintainer: Put new public prototypes here ^, in libpng.3, and project defs */ - -#ifdef PNG_READ_COMPOSITE_NODIV_SUPPORTED -/* With these routines we avoid an integer divide, which will be slower on - * most machines. However, it does take more operations than the corresponding - * divide method, so it may be slower on a few RISC systems. There are two - * shifts (by 8 or 16 bits) and an addition, versus a single integer divide. - * - * Note that the rounding factors are NOT supposed to be the same! 128 and - * 32768 are correct for the NODIV code; 127 and 32767 are correct for the - * standard method. - * - * [Optimized code by Greg Roelofs and Mark Adler...blame us for bugs. :-) ] - */ - - /* fg and bg should be in `gamma 1.0' space; alpha is the opacity */ - -# define png_composite(composite, fg, alpha, bg) \ - { png_uint_16 temp = (png_uint_16)((png_uint_16)(fg) * (png_uint_16)(alpha) \ - + (png_uint_16)(bg)*(png_uint_16)(255 - \ - (png_uint_16)(alpha)) + (png_uint_16)128); \ - (composite) = (png_byte)((temp + (temp >> 8)) >> 8); } - -# define png_composite_16(composite, fg, alpha, bg) \ - { png_uint_32 temp = (png_uint_32)((png_uint_32)(fg) * (png_uint_32)(alpha) \ - + (png_uint_32)(bg)*(png_uint_32)(65535L - \ - (png_uint_32)(alpha)) + (png_uint_32)32768L); \ - (composite) = (png_uint_16)((temp + (temp >> 16)) >> 16); } - -#else /* standard method using integer division */ - -# define png_composite(composite, fg, alpha, bg) \ - (composite) = (png_byte)(((png_uint_16)(fg) * (png_uint_16)(alpha) + \ - (png_uint_16)(bg) * (png_uint_16)(255 - (png_uint_16)(alpha)) + \ - (png_uint_16)127) / 255) - -# define png_composite_16(composite, fg, alpha, bg) \ - (composite) = (png_uint_16)(((png_uint_32)(fg) * (png_uint_32)(alpha) + \ - (png_uint_32)(bg)*(png_uint_32)(65535L - (png_uint_32)(alpha)) + \ - (png_uint_32)32767) / (png_uint_32)65535L) - -#endif /* PNG_READ_COMPOSITE_NODIV_SUPPORTED */ - -/* Inline macros to do direct reads of bytes from the input buffer. These - * require that you are using an architecture that uses PNG byte ordering - * (MSB first) and supports unaligned data storage. I think that PowerPC - * in big-endian mode and 680x0 are the only ones that will support this. - * The x86 line of processors definitely do not. The png_get_int_32() - * routine also assumes we are using two's complement format for negative - * values, which is almost certainly true. - */ -#if defined(PNG_READ_BIG_ENDIAN_SUPPORTED) -# define png_get_uint_32(buf) ( *((png_uint_32p) (buf))) -# define png_get_uint_16(buf) ( *((png_uint_16p) (buf))) -# define png_get_int_32(buf) ( *((png_int_32p) (buf))) -#else -extern PNG_EXPORT(png_uint_32,png_get_uint_32) PNGARG((png_bytep buf)); -extern PNG_EXPORT(png_uint_16,png_get_uint_16) PNGARG((png_bytep buf)); -extern PNG_EXPORT(png_int_32,png_get_int_32) PNGARG((png_bytep buf)); -#endif /* !PNG_READ_BIG_ENDIAN_SUPPORTED */ -extern PNG_EXPORT(png_uint_32,png_get_uint_31) - PNGARG((png_structp png_ptr, png_bytep buf)); -/* No png_get_int_16 -- may be added if there's a real need for it. */ - -/* Place a 32-bit number into a buffer in PNG byte order (big-endian). - */ -extern PNG_EXPORT(void,png_save_uint_32) - PNGARG((png_bytep buf, png_uint_32 i)); -extern PNG_EXPORT(void,png_save_int_32) - PNGARG((png_bytep buf, png_int_32 i)); - -/* Place a 16-bit number into a buffer in PNG byte order. - * The parameter is declared unsigned int, not png_uint_16, - * just to avoid potential problems on pre-ANSI C compilers. - */ -extern PNG_EXPORT(void,png_save_uint_16) - PNGARG((png_bytep buf, unsigned int i)); -/* No png_save_int_16 -- may be added if there's a real need for it. */ - -/* ************************************************************************* */ - -/* These next functions are used internally in the code. They generally - * shouldn't be used unless you are writing code to add or replace some - * functionality in libpng. More information about most functions can - * be found in the files where the functions are located. - */ - - -/* Various modes of operation, that are visible to applications because - * they are used for unknown chunk location. - */ -#define PNG_HAVE_IHDR 0x01 -#define PNG_HAVE_PLTE 0x02 -#define PNG_HAVE_IDAT 0x04 -#define PNG_AFTER_IDAT 0x08 /* Have complete zlib datastream */ -#define PNG_HAVE_IEND 0x10 - -#if defined(PNG_INTERNAL) - -/* More modes of operation. Note that after an init, mode is set to - * zero automatically when the structure is created. - */ -#define PNG_HAVE_gAMA 0x20 -#define PNG_HAVE_cHRM 0x40 -#define PNG_HAVE_sRGB 0x80 -#define PNG_HAVE_CHUNK_HEADER 0x100 -#define PNG_WROTE_tIME 0x200 -#define PNG_WROTE_INFO_BEFORE_PLTE 0x400 -#define PNG_BACKGROUND_IS_GRAY 0x800 -#define PNG_HAVE_PNG_SIGNATURE 0x1000 -#define PNG_HAVE_CHUNK_AFTER_IDAT 0x2000 /* Have another chunk after IDAT */ - -/* flags for the transformations the PNG library does on the image data */ -#define PNG_BGR 0x0001 -#define PNG_INTERLACE 0x0002 -#define PNG_PACK 0x0004 -#define PNG_SHIFT 0x0008 -#define PNG_SWAP_BYTES 0x0010 -#define PNG_INVERT_MONO 0x0020 -#define PNG_DITHER 0x0040 -#define PNG_BACKGROUND 0x0080 -#define PNG_BACKGROUND_EXPAND 0x0100 - /* 0x0200 unused */ -#define PNG_16_TO_8 0x0400 -#define PNG_RGBA 0x0800 -#define PNG_EXPAND 0x1000 -#define PNG_GAMMA 0x2000 -#define PNG_GRAY_TO_RGB 0x4000 -#define PNG_FILLER 0x8000L -#define PNG_PACKSWAP 0x10000L -#define PNG_SWAP_ALPHA 0x20000L -#define PNG_STRIP_ALPHA 0x40000L -#define PNG_INVERT_ALPHA 0x80000L -#define PNG_USER_TRANSFORM 0x100000L -#define PNG_RGB_TO_GRAY_ERR 0x200000L -#define PNG_RGB_TO_GRAY_WARN 0x400000L -#define PNG_RGB_TO_GRAY 0x600000L /* two bits, RGB_TO_GRAY_ERR|WARN */ - /* 0x800000L Unused */ -#define PNG_ADD_ALPHA 0x1000000L /* Added to libpng-1.2.7 */ -#define PNG_EXPAND_tRNS 0x2000000L /* Added to libpng-1.2.9 */ - /* 0x4000000L unused */ - /* 0x8000000L unused */ - /* 0x10000000L unused */ - /* 0x20000000L unused */ - /* 0x40000000L unused */ - -/* flags for png_create_struct */ -#define PNG_STRUCT_PNG 0x0001 -#define PNG_STRUCT_INFO 0x0002 - -/* Scaling factor for filter heuristic weighting calculations */ -#define PNG_WEIGHT_SHIFT 8 -#define PNG_WEIGHT_FACTOR (1<<(PNG_WEIGHT_SHIFT)) -#define PNG_COST_SHIFT 3 -#define PNG_COST_FACTOR (1<<(PNG_COST_SHIFT)) - -/* flags for the png_ptr->flags rather than declaring a byte for each one */ -#define PNG_FLAG_ZLIB_CUSTOM_STRATEGY 0x0001 -#define PNG_FLAG_ZLIB_CUSTOM_LEVEL 0x0002 -#define PNG_FLAG_ZLIB_CUSTOM_MEM_LEVEL 0x0004 -#define PNG_FLAG_ZLIB_CUSTOM_WINDOW_BITS 0x0008 -#define PNG_FLAG_ZLIB_CUSTOM_METHOD 0x0010 -#define PNG_FLAG_ZLIB_FINISHED 0x0020 -#define PNG_FLAG_ROW_INIT 0x0040 -#define PNG_FLAG_FILLER_AFTER 0x0080 -#define PNG_FLAG_CRC_ANCILLARY_USE 0x0100 -#define PNG_FLAG_CRC_ANCILLARY_NOWARN 0x0200 -#define PNG_FLAG_CRC_CRITICAL_USE 0x0400 -#define PNG_FLAG_CRC_CRITICAL_IGNORE 0x0800 -#define PNG_FLAG_FREE_PLTE 0x1000 -#define PNG_FLAG_FREE_TRNS 0x2000 -#define PNG_FLAG_FREE_HIST 0x4000 -#define PNG_FLAG_KEEP_UNKNOWN_CHUNKS 0x8000L -#define PNG_FLAG_KEEP_UNSAFE_CHUNKS 0x10000L -#define PNG_FLAG_LIBRARY_MISMATCH 0x20000L -#define PNG_FLAG_STRIP_ERROR_NUMBERS 0x40000L -#define PNG_FLAG_STRIP_ERROR_TEXT 0x80000L -#define PNG_FLAG_MALLOC_NULL_MEM_OK 0x100000L -#define PNG_FLAG_ADD_ALPHA 0x200000L /* Added to libpng-1.2.8 */ -#define PNG_FLAG_STRIP_ALPHA 0x400000L /* Added to libpng-1.2.8 */ - /* 0x800000L unused */ - /* 0x1000000L unused */ - /* 0x2000000L unused */ - /* 0x4000000L unused */ - /* 0x8000000L unused */ - /* 0x10000000L unused */ - /* 0x20000000L unused */ - /* 0x40000000L unused */ - -#define PNG_FLAG_CRC_ANCILLARY_MASK (PNG_FLAG_CRC_ANCILLARY_USE | \ - PNG_FLAG_CRC_ANCILLARY_NOWARN) - -#define PNG_FLAG_CRC_CRITICAL_MASK (PNG_FLAG_CRC_CRITICAL_USE | \ - PNG_FLAG_CRC_CRITICAL_IGNORE) - -#define PNG_FLAG_CRC_MASK (PNG_FLAG_CRC_ANCILLARY_MASK | \ - PNG_FLAG_CRC_CRITICAL_MASK) - -/* save typing and make code easier to understand */ - -#define PNG_COLOR_DIST(c1, c2) (abs((int)((c1).red) - (int)((c2).red)) + \ - abs((int)((c1).green) - (int)((c2).green)) + \ - abs((int)((c1).blue) - (int)((c2).blue))) - -/* Added to libpng-1.2.6 JB */ -#define PNG_ROWBYTES(pixel_bits, width) \ - ((pixel_bits) >= 8 ? \ - ((width) * (((png_uint_32)(pixel_bits)) >> 3)) : \ - (( ((width) * ((png_uint_32)(pixel_bits))) + 7) >> 3) ) - -/* PNG_OUT_OF_RANGE returns true if value is outside the range - ideal-delta..ideal+delta. Each argument is evaluated twice. - "ideal" and "delta" should be constants, normally simple - integers, "value" a variable. Added to libpng-1.2.6 JB */ -#define PNG_OUT_OF_RANGE(value, ideal, delta) \ - ( (value) < (ideal)-(delta) || (value) > (ideal)+(delta) ) - -/* variables declared in png.c - only it needs to define PNG_NO_EXTERN */ -#if !defined(PNG_NO_EXTERN) || defined(PNG_ALWAYS_EXTERN) -/* place to hold the signature string for a PNG file. */ -#ifdef PNG_USE_GLOBAL_ARRAYS - PNG_EXPORT_VAR (PNG_CONST png_byte FARDATA) png_sig[8]; -#else -#endif -#endif /* PNG_NO_EXTERN */ - -/* Constant strings for known chunk types. If you need to add a chunk, - * define the name here, and add an invocation of the macro in png.c and - * wherever it's needed. - */ -#define PNG_IHDR png_byte png_IHDR[5] = { 73, 72, 68, 82, '\0'} -#define PNG_IDAT png_byte png_IDAT[5] = { 73, 68, 65, 84, '\0'} -#define PNG_IEND png_byte png_IEND[5] = { 73, 69, 78, 68, '\0'} -#define PNG_PLTE png_byte png_PLTE[5] = { 80, 76, 84, 69, '\0'} -#define PNG_bKGD png_byte png_bKGD[5] = { 98, 75, 71, 68, '\0'} -#define PNG_cHRM png_byte png_cHRM[5] = { 99, 72, 82, 77, '\0'} -#define PNG_gAMA png_byte png_gAMA[5] = {103, 65, 77, 65, '\0'} -#define PNG_hIST png_byte png_hIST[5] = {104, 73, 83, 84, '\0'} -#define PNG_iCCP png_byte png_iCCP[5] = {105, 67, 67, 80, '\0'} -#define PNG_iTXt png_byte png_iTXt[5] = {105, 84, 88, 116, '\0'} -#define PNG_oFFs png_byte png_oFFs[5] = {111, 70, 70, 115, '\0'} -#define PNG_pCAL png_byte png_pCAL[5] = {112, 67, 65, 76, '\0'} -#define PNG_sCAL png_byte png_sCAL[5] = {115, 67, 65, 76, '\0'} -#define PNG_pHYs png_byte png_pHYs[5] = {112, 72, 89, 115, '\0'} -#define PNG_sBIT png_byte png_sBIT[5] = {115, 66, 73, 84, '\0'} -#define PNG_sPLT png_byte png_sPLT[5] = {115, 80, 76, 84, '\0'} -#define PNG_sRGB png_byte png_sRGB[5] = {115, 82, 71, 66, '\0'} -#define PNG_tEXt png_byte png_tEXt[5] = {116, 69, 88, 116, '\0'} -#define PNG_tIME png_byte png_tIME[5] = {116, 73, 77, 69, '\0'} -#define PNG_tRNS png_byte png_tRNS[5] = {116, 82, 78, 83, '\0'} -#define PNG_zTXt png_byte png_zTXt[5] = {122, 84, 88, 116, '\0'} - -#ifdef PNG_USE_GLOBAL_ARRAYS -PNG_EXPORT_VAR (png_byte FARDATA) png_IHDR[5]; -PNG_EXPORT_VAR (png_byte FARDATA) png_IDAT[5]; -PNG_EXPORT_VAR (png_byte FARDATA) png_IEND[5]; -PNG_EXPORT_VAR (png_byte FARDATA) png_PLTE[5]; -PNG_EXPORT_VAR (png_byte FARDATA) png_bKGD[5]; -PNG_EXPORT_VAR (png_byte FARDATA) png_cHRM[5]; -PNG_EXPORT_VAR (png_byte FARDATA) png_gAMA[5]; -PNG_EXPORT_VAR (png_byte FARDATA) png_hIST[5]; -PNG_EXPORT_VAR (png_byte FARDATA) png_iCCP[5]; -PNG_EXPORT_VAR (png_byte FARDATA) png_iTXt[5]; -PNG_EXPORT_VAR (png_byte FARDATA) png_oFFs[5]; -PNG_EXPORT_VAR (png_byte FARDATA) png_pCAL[5]; -PNG_EXPORT_VAR (png_byte FARDATA) png_sCAL[5]; -PNG_EXPORT_VAR (png_byte FARDATA) png_pHYs[5]; -PNG_EXPORT_VAR (png_byte FARDATA) png_sBIT[5]; -PNG_EXPORT_VAR (png_byte FARDATA) png_sPLT[5]; -PNG_EXPORT_VAR (png_byte FARDATA) png_sRGB[5]; -PNG_EXPORT_VAR (png_byte FARDATA) png_tEXt[5]; -PNG_EXPORT_VAR (png_byte FARDATA) png_tIME[5]; -PNG_EXPORT_VAR (png_byte FARDATA) png_tRNS[5]; -PNG_EXPORT_VAR (png_byte FARDATA) png_zTXt[5]; -#endif /* PNG_USE_GLOBAL_ARRAYS */ - -#if defined(PNG_1_0_X) || defined (PNG_1_2_X) -/* Initialize png_ptr struct for reading, and allocate any other memory. - * (old interface - DEPRECATED - use png_create_read_struct instead). - */ -extern PNG_EXPORT(void,png_read_init) PNGARG((png_structp png_ptr)); -#undef png_read_init -#define png_read_init(png_ptr) png_read_init_3(&png_ptr, \ - PNG_LIBPNG_VER_STRING, png_sizeof(png_struct)); -#endif - -extern PNG_EXPORT(void,png_read_init_3) PNGARG((png_structpp ptr_ptr, - png_const_charp user_png_ver, png_size_t png_struct_size)); -#if defined(PNG_1_0_X) || defined (PNG_1_2_X) -extern PNG_EXPORT(void,png_read_init_2) PNGARG((png_structp png_ptr, - png_const_charp user_png_ver, png_size_t png_struct_size, png_size_t - png_info_size)); -#endif - -#if defined(PNG_1_0_X) || defined (PNG_1_2_X) -/* Initialize png_ptr struct for writing, and allocate any other memory. - * (old interface - DEPRECATED - use png_create_write_struct instead). - */ -extern PNG_EXPORT(void,png_write_init) PNGARG((png_structp png_ptr)); -#undef png_write_init -#define png_write_init(png_ptr) png_write_init_3(&png_ptr, \ - PNG_LIBPNG_VER_STRING, png_sizeof(png_struct)); -#endif - -extern PNG_EXPORT(void,png_write_init_3) PNGARG((png_structpp ptr_ptr, - png_const_charp user_png_ver, png_size_t png_struct_size)); -extern PNG_EXPORT(void,png_write_init_2) PNGARG((png_structp png_ptr, - png_const_charp user_png_ver, png_size_t png_struct_size, png_size_t - png_info_size)); - -/* Allocate memory for an internal libpng struct */ -PNG_EXTERN png_voidp png_create_struct PNGARG((int type)); - -/* Free memory from internal libpng struct */ -PNG_EXTERN void png_destroy_struct PNGARG((png_voidp struct_ptr)); - -PNG_EXTERN png_voidp png_create_struct_2 PNGARG((int type, png_malloc_ptr - malloc_fn, png_voidp mem_ptr)); -PNG_EXTERN void png_destroy_struct_2 PNGARG((png_voidp struct_ptr, - png_free_ptr free_fn, png_voidp mem_ptr)); - -/* Free any memory that info_ptr points to and reset struct. */ -PNG_EXTERN void png_info_destroy PNGARG((png_structp png_ptr, - png_infop info_ptr)); - -#ifndef PNG_1_0_X -/* Function to allocate memory for zlib. */ -PNG_EXTERN voidpf png_zalloc PNGARG((voidpf png_ptr, uInt items, uInt size)); - -/* Function to free memory for zlib */ -PNG_EXTERN void png_zfree PNGARG((voidpf png_ptr, voidpf ptr)); - -#ifdef PNG_SIZE_T -/* Function to convert a sizeof an item to png_sizeof item */ - PNG_EXTERN png_size_t PNGAPI png_convert_size PNGARG((size_t size)); -#endif - -/* Next four functions are used internally as callbacks. PNGAPI is required - * but not PNG_EXPORT. PNGAPI added at libpng version 1.2.3. */ - -PNG_EXTERN void PNGAPI png_default_read_data PNGARG((png_structp png_ptr, - png_bytep data, png_size_t length)); - -#ifdef PNG_PROGRESSIVE_READ_SUPPORTED -PNG_EXTERN void PNGAPI png_push_fill_buffer PNGARG((png_structp png_ptr, - png_bytep buffer, png_size_t length)); -#endif - -PNG_EXTERN void PNGAPI png_default_write_data PNGARG((png_structp png_ptr, - png_bytep data, png_size_t length)); - -#if defined(PNG_WRITE_FLUSH_SUPPORTED) -#if !defined(PNG_NO_STDIO) -PNG_EXTERN void PNGAPI png_default_flush PNGARG((png_structp png_ptr)); -#endif -#endif -#else /* PNG_1_0_X */ -#ifdef PNG_PROGRESSIVE_READ_SUPPORTED -PNG_EXTERN void png_push_fill_buffer PNGARG((png_structp png_ptr, - png_bytep buffer, png_size_t length)); -#endif -#endif /* PNG_1_0_X */ - -/* Reset the CRC variable */ -PNG_EXTERN void png_reset_crc PNGARG((png_structp png_ptr)); - -/* Write the "data" buffer to whatever output you are using. */ -PNG_EXTERN void png_write_data PNGARG((png_structp png_ptr, png_bytep data, - png_size_t length)); - -/* Read data from whatever input you are using into the "data" buffer */ -PNG_EXTERN void png_read_data PNGARG((png_structp png_ptr, png_bytep data, - png_size_t length)); - -/* Read bytes into buf, and update png_ptr->crc */ -PNG_EXTERN void png_crc_read PNGARG((png_structp png_ptr, png_bytep buf, - png_size_t length)); - -/* Decompress data in a chunk that uses compression */ -#if defined(PNG_zTXt_SUPPORTED) || defined(PNG_iTXt_SUPPORTED) || \ - defined(PNG_iCCP_SUPPORTED) || defined(PNG_sPLT_SUPPORTED) -PNG_EXTERN void png_decompress_chunk PNGARG((png_structp png_ptr, - int comp_type, png_size_t chunklength, - png_size_t prefix_length, png_size_t *data_length)); -#endif - -/* Read "skip" bytes, read the file crc, and (optionally) verify png_ptr->crc */ -PNG_EXTERN int png_crc_finish PNGARG((png_structp png_ptr, png_uint_32 skip)); - -/* Read the CRC from the file and compare it to the libpng calculated CRC */ -PNG_EXTERN int png_crc_error PNGARG((png_structp png_ptr)); - -/* Calculate the CRC over a section of data. Note that we are only - * passing a maximum of 64K on systems that have this as a memory limit, - * since this is the maximum buffer size we can specify. - */ -PNG_EXTERN void png_calculate_crc PNGARG((png_structp png_ptr, png_bytep ptr, - png_size_t length)); - -#if defined(PNG_WRITE_FLUSH_SUPPORTED) -PNG_EXTERN void png_flush PNGARG((png_structp png_ptr)); -#endif - -/* simple function to write the signature */ -PNG_EXTERN void png_write_sig PNGARG((png_structp png_ptr)); - -/* write various chunks */ - -/* Write the IHDR chunk, and update the png_struct with the necessary - * information. - */ -PNG_EXTERN void png_write_IHDR PNGARG((png_structp png_ptr, png_uint_32 width, - png_uint_32 height, - int bit_depth, int color_type, int compression_method, int filter_method, - int interlace_method)); - -PNG_EXTERN void png_write_PLTE PNGARG((png_structp png_ptr, png_colorp palette, - png_uint_32 num_pal)); - -PNG_EXTERN void png_write_IDAT PNGARG((png_structp png_ptr, png_bytep data, - png_size_t length)); - -PNG_EXTERN void png_write_IEND PNGARG((png_structp png_ptr)); - -#if defined(PNG_WRITE_gAMA_SUPPORTED) -#ifdef PNG_FLOATING_POINT_SUPPORTED -PNG_EXTERN void png_write_gAMA PNGARG((png_structp png_ptr, double file_gamma)); -#endif -#ifdef PNG_FIXED_POINT_SUPPORTED -PNG_EXTERN void png_write_gAMA_fixed PNGARG((png_structp png_ptr, png_fixed_point - file_gamma)); -#endif -#endif - -#if defined(PNG_WRITE_sBIT_SUPPORTED) -PNG_EXTERN void png_write_sBIT PNGARG((png_structp png_ptr, png_color_8p sbit, - int color_type)); -#endif - -#if defined(PNG_WRITE_cHRM_SUPPORTED) -#ifdef PNG_FLOATING_POINT_SUPPORTED -PNG_EXTERN void png_write_cHRM PNGARG((png_structp png_ptr, - double white_x, double white_y, - double red_x, double red_y, double green_x, double green_y, - double blue_x, double blue_y)); -#endif -#ifdef PNG_FIXED_POINT_SUPPORTED -PNG_EXTERN void png_write_cHRM_fixed PNGARG((png_structp png_ptr, - png_fixed_point int_white_x, png_fixed_point int_white_y, - png_fixed_point int_red_x, png_fixed_point int_red_y, png_fixed_point - int_green_x, png_fixed_point int_green_y, png_fixed_point int_blue_x, - png_fixed_point int_blue_y)); -#endif -#endif - -#if defined(PNG_WRITE_sRGB_SUPPORTED) -PNG_EXTERN void png_write_sRGB PNGARG((png_structp png_ptr, - int intent)); -#endif - -#if defined(PNG_WRITE_iCCP_SUPPORTED) -PNG_EXTERN void png_write_iCCP PNGARG((png_structp png_ptr, - png_charp name, int compression_type, - png_charp profile, int proflen)); - /* Note to maintainer: profile should be png_bytep */ -#endif - -#if defined(PNG_WRITE_sPLT_SUPPORTED) -PNG_EXTERN void png_write_sPLT PNGARG((png_structp png_ptr, - png_sPLT_tp palette)); -#endif - -#if defined(PNG_WRITE_tRNS_SUPPORTED) -PNG_EXTERN void png_write_tRNS PNGARG((png_structp png_ptr, png_bytep trans, - png_color_16p values, int number, int color_type)); -#endif - -#if defined(PNG_WRITE_bKGD_SUPPORTED) -PNG_EXTERN void png_write_bKGD PNGARG((png_structp png_ptr, - png_color_16p values, int color_type)); -#endif - -#if defined(PNG_WRITE_hIST_SUPPORTED) -PNG_EXTERN void png_write_hIST PNGARG((png_structp png_ptr, png_uint_16p hist, - int num_hist)); -#endif - -#if defined(PNG_WRITE_TEXT_SUPPORTED) || defined(PNG_WRITE_pCAL_SUPPORTED) || \ - defined(PNG_WRITE_iCCP_SUPPORTED) || defined(PNG_WRITE_sPLT_SUPPORTED) -PNG_EXTERN png_size_t png_check_keyword PNGARG((png_structp png_ptr, - png_charp key, png_charpp new_key)); -#endif - -#if defined(PNG_WRITE_tEXt_SUPPORTED) -PNG_EXTERN void png_write_tEXt PNGARG((png_structp png_ptr, png_charp key, - png_charp text, png_size_t text_len)); -#endif - -#if defined(PNG_WRITE_zTXt_SUPPORTED) -PNG_EXTERN void png_write_zTXt PNGARG((png_structp png_ptr, png_charp key, - png_charp text, png_size_t text_len, int compression)); -#endif - -#if defined(PNG_WRITE_iTXt_SUPPORTED) -PNG_EXTERN void png_write_iTXt PNGARG((png_structp png_ptr, - int compression, png_charp key, png_charp lang, png_charp lang_key, - png_charp text)); -#endif - -#if defined(PNG_TEXT_SUPPORTED) /* Added at version 1.0.14 and 1.2.4 */ -PNG_EXTERN int png_set_text_2 PNGARG((png_structp png_ptr, - png_infop info_ptr, png_textp text_ptr, int num_text)); -#endif - -#if defined(PNG_WRITE_oFFs_SUPPORTED) -PNG_EXTERN void png_write_oFFs PNGARG((png_structp png_ptr, - png_int_32 x_offset, png_int_32 y_offset, int unit_type)); -#endif - -#if defined(PNG_WRITE_pCAL_SUPPORTED) -PNG_EXTERN void png_write_pCAL PNGARG((png_structp png_ptr, png_charp purpose, - png_int_32 X0, png_int_32 X1, int type, int nparams, - png_charp units, png_charpp params)); -#endif - -#if defined(PNG_WRITE_pHYs_SUPPORTED) -PNG_EXTERN void png_write_pHYs PNGARG((png_structp png_ptr, - png_uint_32 x_pixels_per_unit, png_uint_32 y_pixels_per_unit, - int unit_type)); -#endif - -#if defined(PNG_WRITE_tIME_SUPPORTED) -PNG_EXTERN void png_write_tIME PNGARG((png_structp png_ptr, - png_timep mod_time)); -#endif - -#if defined(PNG_WRITE_sCAL_SUPPORTED) -#if defined(PNG_FLOATING_POINT_SUPPORTED) && !defined(PNG_NO_STDIO) -PNG_EXTERN void png_write_sCAL PNGARG((png_structp png_ptr, - int unit, double width, double height)); -#else -#ifdef PNG_FIXED_POINT_SUPPORTED -PNG_EXTERN void png_write_sCAL_s PNGARG((png_structp png_ptr, - int unit, png_charp width, png_charp height)); -#endif -#endif -#endif - -/* Called when finished processing a row of data */ -PNG_EXTERN void png_write_finish_row PNGARG((png_structp png_ptr)); - -/* Internal use only. Called before first row of data */ -PNG_EXTERN void png_write_start_row PNGARG((png_structp png_ptr)); - -#if defined(PNG_READ_GAMMA_SUPPORTED) -PNG_EXTERN void png_build_gamma_table PNGARG((png_structp png_ptr)); -#endif - -/* combine a row of data, dealing with alpha, etc. if requested */ -PNG_EXTERN void png_combine_row PNGARG((png_structp png_ptr, png_bytep row, - int mask)); - -#if defined(PNG_READ_INTERLACING_SUPPORTED) -/* expand an interlaced row */ -/* OLD pre-1.0.9 interface: -PNG_EXTERN void png_do_read_interlace PNGARG((png_row_infop row_info, - png_bytep row, int pass, png_uint_32 transformations)); - */ -PNG_EXTERN void png_do_read_interlace PNGARG((png_structp png_ptr)); -#endif - -/* GRR TO DO (2.0 or whenever): simplify other internal calling interfaces */ - -#if defined(PNG_WRITE_INTERLACING_SUPPORTED) -/* grab pixels out of a row for an interlaced pass */ -PNG_EXTERN void png_do_write_interlace PNGARG((png_row_infop row_info, - png_bytep row, int pass)); -#endif - -/* unfilter a row */ -PNG_EXTERN void png_read_filter_row PNGARG((png_structp png_ptr, - png_row_infop row_info, png_bytep row, png_bytep prev_row, int filter)); - -/* Choose the best filter to use and filter the row data */ -PNG_EXTERN void png_write_find_filter PNGARG((png_structp png_ptr, - png_row_infop row_info)); - -/* Write out the filtered row. */ -PNG_EXTERN void png_write_filtered_row PNGARG((png_structp png_ptr, - png_bytep filtered_row)); -/* finish a row while reading, dealing with interlacing passes, etc. */ -PNG_EXTERN void png_read_finish_row PNGARG((png_structp png_ptr)); - -/* initialize the row buffers, etc. */ -PNG_EXTERN void png_read_start_row PNGARG((png_structp png_ptr)); -/* optional call to update the users info structure */ -PNG_EXTERN void png_read_transform_info PNGARG((png_structp png_ptr, - png_infop info_ptr)); - -/* these are the functions that do the transformations */ -#if defined(PNG_READ_FILLER_SUPPORTED) -PNG_EXTERN void png_do_read_filler PNGARG((png_row_infop row_info, - png_bytep row, png_uint_32 filler, png_uint_32 flags)); -#endif - -#if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) -PNG_EXTERN void png_do_read_swap_alpha PNGARG((png_row_infop row_info, - png_bytep row)); -#endif - -#if defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED) -PNG_EXTERN void png_do_write_swap_alpha PNGARG((png_row_infop row_info, - png_bytep row)); -#endif - -#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) -PNG_EXTERN void png_do_read_invert_alpha PNGARG((png_row_infop row_info, - png_bytep row)); -#endif - -#if defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED) -PNG_EXTERN void png_do_write_invert_alpha PNGARG((png_row_infop row_info, - png_bytep row)); -#endif - -#if defined(PNG_WRITE_FILLER_SUPPORTED) || \ - defined(PNG_READ_STRIP_ALPHA_SUPPORTED) -PNG_EXTERN void png_do_strip_filler PNGARG((png_row_infop row_info, - png_bytep row, png_uint_32 flags)); -#endif - -#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED) -PNG_EXTERN void png_do_swap PNGARG((png_row_infop row_info, png_bytep row)); -#endif - -#if defined(PNG_READ_PACKSWAP_SUPPORTED) || defined(PNG_WRITE_PACKSWAP_SUPPORTED) -PNG_EXTERN void png_do_packswap PNGARG((png_row_infop row_info, png_bytep row)); -#endif - -#if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) -PNG_EXTERN int png_do_rgb_to_gray PNGARG((png_structp png_ptr, png_row_infop - row_info, png_bytep row)); -#endif - -#if defined(PNG_READ_GRAY_TO_RGB_SUPPORTED) -PNG_EXTERN void png_do_gray_to_rgb PNGARG((png_row_infop row_info, - png_bytep row)); -#endif - -#if defined(PNG_READ_PACK_SUPPORTED) -PNG_EXTERN void png_do_unpack PNGARG((png_row_infop row_info, png_bytep row)); -#endif - -#if defined(PNG_READ_SHIFT_SUPPORTED) -PNG_EXTERN void png_do_unshift PNGARG((png_row_infop row_info, png_bytep row, - png_color_8p sig_bits)); -#endif - -#if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED) -PNG_EXTERN void png_do_invert PNGARG((png_row_infop row_info, png_bytep row)); -#endif - -#if defined(PNG_READ_16_TO_8_SUPPORTED) -PNG_EXTERN void png_do_chop PNGARG((png_row_infop row_info, png_bytep row)); -#endif - -#if defined(PNG_READ_DITHER_SUPPORTED) -PNG_EXTERN void png_do_dither PNGARG((png_row_infop row_info, - png_bytep row, png_bytep palette_lookup, png_bytep dither_lookup)); - -# if defined(PNG_CORRECT_PALETTE_SUPPORTED) -PNG_EXTERN void png_correct_palette PNGARG((png_structp png_ptr, - png_colorp palette, int num_palette)); -# endif -#endif - -#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED) -PNG_EXTERN void png_do_bgr PNGARG((png_row_infop row_info, png_bytep row)); -#endif - -#if defined(PNG_WRITE_PACK_SUPPORTED) -PNG_EXTERN void png_do_pack PNGARG((png_row_infop row_info, - png_bytep row, png_uint_32 bit_depth)); -#endif - -#if defined(PNG_WRITE_SHIFT_SUPPORTED) -PNG_EXTERN void png_do_shift PNGARG((png_row_infop row_info, png_bytep row, - png_color_8p bit_depth)); -#endif - -#if defined(PNG_READ_BACKGROUND_SUPPORTED) -#if defined(PNG_READ_GAMMA_SUPPORTED) -PNG_EXTERN void png_do_background PNGARG((png_row_infop row_info, png_bytep row, - png_color_16p trans_values, png_color_16p background, - png_color_16p background_1, - png_bytep gamma_table, png_bytep gamma_from_1, png_bytep gamma_to_1, - png_uint_16pp gamma_16, png_uint_16pp gamma_16_from_1, - png_uint_16pp gamma_16_to_1, int gamma_shift)); -#else -PNG_EXTERN void png_do_background PNGARG((png_row_infop row_info, png_bytep row, - png_color_16p trans_values, png_color_16p background)); -#endif -#endif - -#if defined(PNG_READ_GAMMA_SUPPORTED) -PNG_EXTERN void png_do_gamma PNGARG((png_row_infop row_info, png_bytep row, - png_bytep gamma_table, png_uint_16pp gamma_16_table, - int gamma_shift)); -#endif - -#if defined(PNG_READ_EXPAND_SUPPORTED) -PNG_EXTERN void png_do_expand_palette PNGARG((png_row_infop row_info, - png_bytep row, png_colorp palette, png_bytep trans, int num_trans)); -PNG_EXTERN void png_do_expand PNGARG((png_row_infop row_info, - png_bytep row, png_color_16p trans_value)); -#endif - -/* The following decodes the appropriate chunks, and does error correction, - * then calls the appropriate callback for the chunk if it is valid. - */ - -/* decode the IHDR chunk */ -PNG_EXTERN void png_handle_IHDR PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); -PNG_EXTERN void png_handle_PLTE PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); -PNG_EXTERN void png_handle_IEND PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); - -#if defined(PNG_READ_bKGD_SUPPORTED) -PNG_EXTERN void png_handle_bKGD PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); -#endif - -#if defined(PNG_READ_cHRM_SUPPORTED) -PNG_EXTERN void png_handle_cHRM PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); -#endif - -#if defined(PNG_READ_gAMA_SUPPORTED) -PNG_EXTERN void png_handle_gAMA PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); -#endif - -#if defined(PNG_READ_hIST_SUPPORTED) -PNG_EXTERN void png_handle_hIST PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); -#endif - -#if defined(PNG_READ_iCCP_SUPPORTED) -extern void png_handle_iCCP PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); -#endif /* PNG_READ_iCCP_SUPPORTED */ - -#if defined(PNG_READ_iTXt_SUPPORTED) -PNG_EXTERN void png_handle_iTXt PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); -#endif - -#if defined(PNG_READ_oFFs_SUPPORTED) -PNG_EXTERN void png_handle_oFFs PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); -#endif - -#if defined(PNG_READ_pCAL_SUPPORTED) -PNG_EXTERN void png_handle_pCAL PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); -#endif - -#if defined(PNG_READ_pHYs_SUPPORTED) -PNG_EXTERN void png_handle_pHYs PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); -#endif - -#if defined(PNG_READ_sBIT_SUPPORTED) -PNG_EXTERN void png_handle_sBIT PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); -#endif - -#if defined(PNG_READ_sCAL_SUPPORTED) -PNG_EXTERN void png_handle_sCAL PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); -#endif - -#if defined(PNG_READ_sPLT_SUPPORTED) -extern void png_handle_sPLT PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); -#endif /* PNG_READ_sPLT_SUPPORTED */ - -#if defined(PNG_READ_sRGB_SUPPORTED) -PNG_EXTERN void png_handle_sRGB PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); -#endif - -#if defined(PNG_READ_tEXt_SUPPORTED) -PNG_EXTERN void png_handle_tEXt PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); -#endif - -#if defined(PNG_READ_tIME_SUPPORTED) -PNG_EXTERN void png_handle_tIME PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); -#endif - -#if defined(PNG_READ_tRNS_SUPPORTED) -PNG_EXTERN void png_handle_tRNS PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); -#endif - -#if defined(PNG_READ_zTXt_SUPPORTED) -PNG_EXTERN void png_handle_zTXt PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); -#endif - -PNG_EXTERN void png_handle_unknown PNGARG((png_structp png_ptr, - png_infop info_ptr, png_uint_32 length)); - -PNG_EXTERN void png_check_chunk_name PNGARG((png_structp png_ptr, - png_bytep chunk_name)); - -/* handle the transformations for reading and writing */ -PNG_EXTERN void png_do_read_transformations PNGARG((png_structp png_ptr)); -PNG_EXTERN void png_do_write_transformations PNGARG((png_structp png_ptr)); - -PNG_EXTERN void png_init_read_transformations PNGARG((png_structp png_ptr)); - -#ifdef PNG_PROGRESSIVE_READ_SUPPORTED -PNG_EXTERN void png_push_read_chunk PNGARG((png_structp png_ptr, - png_infop info_ptr)); -PNG_EXTERN void png_push_read_sig PNGARG((png_structp png_ptr, - png_infop info_ptr)); -PNG_EXTERN void png_push_check_crc PNGARG((png_structp png_ptr)); -PNG_EXTERN void png_push_crc_skip PNGARG((png_structp png_ptr, - png_uint_32 length)); -PNG_EXTERN void png_push_crc_finish PNGARG((png_structp png_ptr)); -PNG_EXTERN void png_push_save_buffer PNGARG((png_structp png_ptr)); -PNG_EXTERN void png_push_restore_buffer PNGARG((png_structp png_ptr, - png_bytep buffer, png_size_t buffer_length)); -PNG_EXTERN void png_push_read_IDAT PNGARG((png_structp png_ptr)); -PNG_EXTERN void png_process_IDAT_data PNGARG((png_structp png_ptr, - png_bytep buffer, png_size_t buffer_length)); -PNG_EXTERN void png_push_process_row PNGARG((png_structp png_ptr)); -PNG_EXTERN void png_push_handle_unknown PNGARG((png_structp png_ptr, - png_infop info_ptr, png_uint_32 length)); -PNG_EXTERN void png_push_have_info PNGARG((png_structp png_ptr, - png_infop info_ptr)); -PNG_EXTERN void png_push_have_end PNGARG((png_structp png_ptr, - png_infop info_ptr)); -PNG_EXTERN void png_push_have_row PNGARG((png_structp png_ptr, png_bytep row)); -PNG_EXTERN void png_push_read_end PNGARG((png_structp png_ptr, - png_infop info_ptr)); -PNG_EXTERN void png_process_some_data PNGARG((png_structp png_ptr, - png_infop info_ptr)); -PNG_EXTERN void png_read_push_finish_row PNGARG((png_structp png_ptr)); -#if defined(PNG_READ_tEXt_SUPPORTED) -PNG_EXTERN void png_push_handle_tEXt PNGARG((png_structp png_ptr, - png_infop info_ptr, png_uint_32 length)); -PNG_EXTERN void png_push_read_tEXt PNGARG((png_structp png_ptr, - png_infop info_ptr)); -#endif -#if defined(PNG_READ_zTXt_SUPPORTED) -PNG_EXTERN void png_push_handle_zTXt PNGARG((png_structp png_ptr, - png_infop info_ptr, png_uint_32 length)); -PNG_EXTERN void png_push_read_zTXt PNGARG((png_structp png_ptr, - png_infop info_ptr)); -#endif -#if defined(PNG_READ_iTXt_SUPPORTED) -PNG_EXTERN void png_push_handle_iTXt PNGARG((png_structp png_ptr, - png_infop info_ptr, png_uint_32 length)); -PNG_EXTERN void png_push_read_iTXt PNGARG((png_structp png_ptr, - png_infop info_ptr)); -#endif - -#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ - -#ifdef PNG_MNG_FEATURES_SUPPORTED -PNG_EXTERN void png_do_read_intrapixel PNGARG((png_row_infop row_info, - png_bytep row)); -PNG_EXTERN void png_do_write_intrapixel PNGARG((png_row_infop row_info, - png_bytep row)); -#endif - -#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) -#if defined(PNG_MMX_CODE_SUPPORTED) -/* png.c */ /* PRIVATE */ -PNG_EXTERN void png_init_mmx_flags PNGARG((png_structp png_ptr)); -#endif -#endif - -#if defined(PNG_INCH_CONVERSIONS) && defined(PNG_FLOATING_POINT_SUPPORTED) -PNG_EXTERN png_uint_32 png_get_pixels_per_inch PNGARG((png_structp png_ptr, -png_infop info_ptr)); - -PNG_EXTERN png_uint_32 png_get_x_pixels_per_inch PNGARG((png_structp png_ptr, -png_infop info_ptr)); - -PNG_EXTERN png_uint_32 png_get_y_pixels_per_inch PNGARG((png_structp png_ptr, -png_infop info_ptr)); - -PNG_EXTERN float png_get_x_offset_inches PNGARG((png_structp png_ptr, -png_infop info_ptr)); - -PNG_EXTERN float png_get_y_offset_inches PNGARG((png_structp png_ptr, -png_infop info_ptr)); - -#if defined(PNG_pHYs_SUPPORTED) -PNG_EXTERN png_uint_32 png_get_pHYs_dpi PNGARG((png_structp png_ptr, -png_infop info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type)); -#endif /* PNG_pHYs_SUPPORTED */ -#endif /* PNG_INCH_CONVERSIONS && PNG_FLOATING_POINT_SUPPORTED */ - -/* Read the chunk header (length + type name) */ -PNG_EXTERN png_uint_32 png_read_chunk_header PNGARG((png_structp png_ptr)); - -/* Added at libpng version 1.2.34 */ -#if defined(PNG_cHRM_SUPPORTED) -PNG_EXTERN int png_check_cHRM_fixed PNGARG((png_structp png_ptr, - png_fixed_point int_white_x, png_fixed_point int_white_y, - png_fixed_point int_red_x, png_fixed_point int_red_y, png_fixed_point - int_green_x, png_fixed_point int_green_y, png_fixed_point int_blue_x, - png_fixed_point int_blue_y)); -#endif - -/* Maintainer: Put new private prototypes here ^ and in libpngpf.3 */ - -#endif /* PNG_INTERNAL */ - -#ifdef __cplusplus -} -#endif - -#endif /* PNG_VERSION_INFO_ONLY */ -/* do not put anything past this line */ -#endif /* PNG_H */ diff --git a/src/libpng/pngconf.h b/src/libpng/pngconf.h deleted file mode 100644 index 558b3e59f..000000000 --- a/src/libpng/pngconf.h +++ /dev/null @@ -1,1496 +0,0 @@ - -/* pngconf.h - machine configurable file for libpng - * - * libpng version 1.2.37 - June 4, 2009 - * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2009 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - */ - -/* Any machine specific code is near the front of this file, so if you - * are configuring libpng for a machine, you may want to read the section - * starting here down to where it starts to typedef png_color, png_text, - * and png_info. - */ - -#ifndef PNGCONF_H -#define PNGCONF_H - -#define PNG_1_2_X - -/* - * PNG_USER_CONFIG has to be defined on the compiler command line. This - * includes the resource compiler for Windows DLL configurations. - */ -#ifdef PNG_USER_CONFIG -# ifndef PNG_USER_PRIVATEBUILD -# define PNG_USER_PRIVATEBUILD -# endif -#include "pngusr.h" -#endif - -/* PNG_CONFIGURE_LIBPNG is set by the "configure" script. */ -#ifdef PNG_CONFIGURE_LIBPNG -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#endif - -/* - * Added at libpng-1.2.8 - * - * If you create a private DLL you need to define in "pngusr.h" the followings: - * #define PNG_USER_PRIVATEBUILD - * e.g. #define PNG_USER_PRIVATEBUILD "Build by MyCompany for xyz reasons." - * #define PNG_USER_DLLFNAME_POSTFIX - * e.g. // private DLL "libpng13gx.dll" - * #define PNG_USER_DLLFNAME_POSTFIX "gx" - * - * The following macros are also at your disposal if you want to complete the - * DLL VERSIONINFO structure. - * - PNG_USER_VERSIONINFO_COMMENTS - * - PNG_USER_VERSIONINFO_COMPANYNAME - * - PNG_USER_VERSIONINFO_LEGALTRADEMARKS - */ - -#ifdef __STDC__ -#ifdef SPECIALBUILD -# pragma message("PNG_LIBPNG_SPECIALBUILD (and deprecated SPECIALBUILD)\ - are now LIBPNG reserved macros. Use PNG_USER_PRIVATEBUILD instead.") -#endif - -#ifdef PRIVATEBUILD -# pragma message("PRIVATEBUILD is deprecated.\ - Use PNG_USER_PRIVATEBUILD instead.") -# define PNG_USER_PRIVATEBUILD PRIVATEBUILD -#endif -#endif /* __STDC__ */ - -#ifndef PNG_VERSION_INFO_ONLY - -/* End of material added to libpng-1.2.8 */ - -/* Added at libpng-1.2.19, removed at libpng-1.2.20 because it caused trouble - Restored at libpng-1.2.21 */ -#if !defined(PNG_NO_WARN_UNINITIALIZED_ROW) && \ - !defined(PNG_WARN_UNINITIALIZED_ROW) -# define PNG_WARN_UNINITIALIZED_ROW 1 -#endif -/* End of material added at libpng-1.2.19/1.2.21 */ - -/* This is the size of the compression buffer, and thus the size of - * an IDAT chunk. Make this whatever size you feel is best for your - * machine. One of these will be allocated per png_struct. When this - * is full, it writes the data to the disk, and does some other - * calculations. Making this an extremely small size will slow - * the library down, but you may want to experiment to determine - * where it becomes significant, if you are concerned with memory - * usage. Note that zlib allocates at least 32Kb also. For readers, - * this describes the size of the buffer available to read the data in. - * Unless this gets smaller than the size of a row (compressed), - * it should not make much difference how big this is. - */ - -#ifndef PNG_ZBUF_SIZE -# define PNG_ZBUF_SIZE 8192 -#endif - -/* Enable if you want a write-only libpng */ - -#ifndef PNG_NO_READ_SUPPORTED -# define PNG_READ_SUPPORTED -#endif - -/* Enable if you want a read-only libpng */ - -#ifndef PNG_NO_WRITE_SUPPORTED -# define PNG_WRITE_SUPPORTED -#endif - -/* Enabled by default in 1.2.0. You can disable this if you don't need to - support PNGs that are embedded in MNG datastreams */ -#if !defined(PNG_1_0_X) && !defined(PNG_NO_MNG_FEATURES) -# ifndef PNG_MNG_FEATURES_SUPPORTED -# define PNG_MNG_FEATURES_SUPPORTED -# endif -#endif - -#ifndef PNG_NO_FLOATING_POINT_SUPPORTED -# ifndef PNG_FLOATING_POINT_SUPPORTED -# define PNG_FLOATING_POINT_SUPPORTED -# endif -#endif - -/* If you are running on a machine where you cannot allocate more - * than 64K of memory at once, uncomment this. While libpng will not - * normally need that much memory in a chunk (unless you load up a very - * large file), zlib needs to know how big of a chunk it can use, and - * libpng thus makes sure to check any memory allocation to verify it - * will fit into memory. -#define PNG_MAX_MALLOC_64K - */ -#if defined(MAXSEG_64K) && !defined(PNG_MAX_MALLOC_64K) -# define PNG_MAX_MALLOC_64K -#endif - -/* Special munging to support doing things the 'cygwin' way: - * 'Normal' png-on-win32 defines/defaults: - * PNG_BUILD_DLL -- building dll - * PNG_USE_DLL -- building an application, linking to dll - * (no define) -- building static library, or building an - * application and linking to the static lib - * 'Cygwin' defines/defaults: - * PNG_BUILD_DLL -- (ignored) building the dll - * (no define) -- (ignored) building an application, linking to the dll - * PNG_STATIC -- (ignored) building the static lib, or building an - * application that links to the static lib. - * ALL_STATIC -- (ignored) building various static libs, or building an - * application that links to the static libs. - * Thus, - * a cygwin user should define either PNG_BUILD_DLL or PNG_STATIC, and - * this bit of #ifdefs will define the 'correct' config variables based on - * that. If a cygwin user *wants* to define 'PNG_USE_DLL' that's okay, but - * unnecessary. - * - * Also, the precedence order is: - * ALL_STATIC (since we can't #undef something outside our namespace) - * PNG_BUILD_DLL - * PNG_STATIC - * (nothing) == PNG_USE_DLL - * - * CYGWIN (2002-01-20): The preceding is now obsolete. With the advent - * of auto-import in binutils, we no longer need to worry about - * __declspec(dllexport) / __declspec(dllimport) and friends. Therefore, - * we don't need to worry about PNG_STATIC or ALL_STATIC when it comes - * to __declspec() stuff. However, we DO need to worry about - * PNG_BUILD_DLL and PNG_STATIC because those change some defaults - * such as CONSOLE_IO and whether GLOBAL_ARRAYS are allowed. - */ -#if defined(__CYGWIN__) -# if defined(ALL_STATIC) -# if defined(PNG_BUILD_DLL) -# undef PNG_BUILD_DLL -# endif -# if defined(PNG_USE_DLL) -# undef PNG_USE_DLL -# endif -# if defined(PNG_DLL) -# undef PNG_DLL -# endif -# if !defined(PNG_STATIC) -# define PNG_STATIC -# endif -# else -# if defined (PNG_BUILD_DLL) -# if defined(PNG_STATIC) -# undef PNG_STATIC -# endif -# if defined(PNG_USE_DLL) -# undef PNG_USE_DLL -# endif -# if !defined(PNG_DLL) -# define PNG_DLL -# endif -# else -# if defined(PNG_STATIC) -# if defined(PNG_USE_DLL) -# undef PNG_USE_DLL -# endif -# if defined(PNG_DLL) -# undef PNG_DLL -# endif -# else -# if !defined(PNG_USE_DLL) -# define PNG_USE_DLL -# endif -# if !defined(PNG_DLL) -# define PNG_DLL -# endif -# endif -# endif -# endif -#endif - -/* This protects us against compilers that run on a windowing system - * and thus don't have or would rather us not use the stdio types: - * stdin, stdout, and stderr. The only one currently used is stderr - * in png_error() and png_warning(). #defining PNG_NO_CONSOLE_IO will - * prevent these from being compiled and used. #defining PNG_NO_STDIO - * will also prevent these, plus will prevent the entire set of stdio - * macros and functions (FILE *, printf, etc.) from being compiled and used, - * unless (PNG_DEBUG > 0) has been #defined. - * - * #define PNG_NO_CONSOLE_IO - * #define PNG_NO_STDIO - */ - -#if defined(_WIN32_WCE) -# include - /* Console I/O functions are not supported on WindowsCE */ -# define PNG_NO_CONSOLE_IO - /* abort() may not be supported on some/all Windows CE platforms */ -# define PNG_ABORT() exit(-1) -# ifdef PNG_DEBUG -# undef PNG_DEBUG -# endif -#endif - -#ifdef PNG_BUILD_DLL -# ifndef PNG_CONSOLE_IO_SUPPORTED -# ifndef PNG_NO_CONSOLE_IO -# define PNG_NO_CONSOLE_IO -# endif -# endif -#endif - -# ifdef PNG_NO_STDIO -# ifndef PNG_NO_CONSOLE_IO -# define PNG_NO_CONSOLE_IO -# endif -# ifdef PNG_DEBUG -# if (PNG_DEBUG > 0) -# include -# endif -# endif -# else -# if !defined(_WIN32_WCE) -/* "stdio.h" functions are not supported on WindowsCE */ -# include -# endif -# endif - -/* This macro protects us against machines that don't have function - * prototypes (ie K&R style headers). If your compiler does not handle - * function prototypes, define this macro and use the included ansi2knr. - * I've always been able to use _NO_PROTO as the indicator, but you may - * need to drag the empty declaration out in front of here, or change the - * ifdef to suit your own needs. - */ -#ifndef PNGARG - -#ifdef OF /* zlib prototype munger */ -# define PNGARG(arglist) OF(arglist) -#else - -#ifdef _NO_PROTO -# define PNGARG(arglist) () -# ifndef PNG_TYPECAST_NULL -# define PNG_TYPECAST_NULL -# endif -#else -# define PNGARG(arglist) arglist -#endif /* _NO_PROTO */ - - -#endif /* OF */ - -#endif /* PNGARG */ - -/* Try to determine if we are compiling on a Mac. Note that testing for - * just __MWERKS__ is not good enough, because the Codewarrior is now used - * on non-Mac platforms. - */ -#ifndef MACOS -# if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \ - defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC) -# define MACOS -# endif -#endif - -/* enough people need this for various reasons to include it here */ -#if !defined(MACOS) && !defined(RISCOS) && !defined(_WIN32_WCE) -# include -#endif - -#if !defined(PNG_SETJMP_NOT_SUPPORTED) && !defined(PNG_NO_SETJMP_SUPPORTED) -# define PNG_SETJMP_SUPPORTED -#endif - -#ifdef PNG_SETJMP_SUPPORTED -/* This is an attempt to force a single setjmp behaviour on Linux. If - * the X config stuff didn't define _BSD_SOURCE we wouldn't need this. - * - * You can bypass this test if you know that your application uses exactly - * the same setjmp.h that was included when libpng was built. Only define - * PNG_SKIP_SETJMP_CHECK while building your application, prior to the - * application's '#include "png.h"'. Don't define PNG_SKIP_SETJMP_CHECK - * while building a separate libpng library for general use. - */ - -# ifndef PNG_SKIP_SETJMP_CHECK -# ifdef __linux__ -# ifdef _BSD_SOURCE -# define PNG_SAVE_BSD_SOURCE -# undef _BSD_SOURCE -# endif -# ifdef _SETJMP_H - /* If you encounter a compiler error here, see the explanation - * near the end of INSTALL. - */ - __pngconf.h__ in libpng already includes setjmp.h; - __dont__ include it again.; -# endif -# endif /* __linux__ */ -# endif /* PNG_SKIP_SETJMP_CHECK */ - - /* include setjmp.h for error handling */ -# include - -# ifdef __linux__ -# ifdef PNG_SAVE_BSD_SOURCE -# ifndef _BSD_SOURCE -# define _BSD_SOURCE -# endif -# undef PNG_SAVE_BSD_SOURCE -# endif -# endif /* __linux__ */ -#endif /* PNG_SETJMP_SUPPORTED */ - -#ifdef BSD -# include -#else -# include -#endif - -/* Other defines for things like memory and the like can go here. */ -#ifdef PNG_INTERNAL - -#include - -/* The functions exported by PNG_EXTERN are PNG_INTERNAL functions, which - * aren't usually used outside the library (as far as I know), so it is - * debatable if they should be exported at all. In the future, when it is - * possible to have run-time registry of chunk-handling functions, some of - * these will be made available again. -#define PNG_EXTERN extern - */ -#define PNG_EXTERN - -/* Other defines specific to compilers can go here. Try to keep - * them inside an appropriate ifdef/endif pair for portability. - */ - -#if defined(PNG_FLOATING_POINT_SUPPORTED) -# if defined(MACOS) - /* We need to check that hasn't already been included earlier - * as it seems it doesn't agree with , yet we should really use - * if possible. - */ -# if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__) -# include -# endif -# else -# include -# endif -# if defined(_AMIGA) && defined(__SASC) && defined(_M68881) - /* Amiga SAS/C: We must include builtin FPU functions when compiling using - * MATH=68881 - */ -# include -# endif -#endif - -/* Codewarrior on NT has linking problems without this. */ -#if (defined(__MWERKS__) && defined(WIN32)) || defined(__STDC__) -# define PNG_ALWAYS_EXTERN -#endif - -/* This provides the non-ANSI (far) memory allocation routines. */ -#if defined(__TURBOC__) && defined(__MSDOS__) -# include -# include -#endif - -/* I have no idea why is this necessary... */ -#if defined(_MSC_VER) && (defined(WIN32) || defined(_Windows) || \ - defined(_WINDOWS) || defined(_WIN32) || defined(__WIN32__)) -# include -#endif - -/* This controls how fine the dithering gets. As this allocates - * a largish chunk of memory (32K), those who are not as concerned - * with dithering quality can decrease some or all of these. - */ -#ifndef PNG_DITHER_RED_BITS -# define PNG_DITHER_RED_BITS 5 -#endif -#ifndef PNG_DITHER_GREEN_BITS -# define PNG_DITHER_GREEN_BITS 5 -#endif -#ifndef PNG_DITHER_BLUE_BITS -# define PNG_DITHER_BLUE_BITS 5 -#endif - -/* This controls how fine the gamma correction becomes when you - * are only interested in 8 bits anyway. Increasing this value - * results in more memory being used, and more pow() functions - * being called to fill in the gamma tables. Don't set this value - * less then 8, and even that may not work (I haven't tested it). - */ - -#ifndef PNG_MAX_GAMMA_8 -# define PNG_MAX_GAMMA_8 11 -#endif - -/* This controls how much a difference in gamma we can tolerate before - * we actually start doing gamma conversion. - */ -#ifndef PNG_GAMMA_THRESHOLD -# define PNG_GAMMA_THRESHOLD 0.05 -#endif - -#endif /* PNG_INTERNAL */ - -/* The following uses const char * instead of char * for error - * and warning message functions, so some compilers won't complain. - * If you do not want to use const, define PNG_NO_CONST here. - */ - -#ifndef PNG_NO_CONST -# define PNG_CONST const -#else -# define PNG_CONST -#endif - -/* The following defines give you the ability to remove code from the - * library that you will not be using. I wish I could figure out how to - * automate this, but I can't do that without making it seriously hard - * on the users. So if you are not using an ability, change the #define - * to and #undef, and that part of the library will not be compiled. If - * your linker can't find a function, you may want to make sure the - * ability is defined here. Some of these depend upon some others being - * defined. I haven't figured out all the interactions here, so you may - * have to experiment awhile to get everything to compile. If you are - * creating or using a shared library, you probably shouldn't touch this, - * as it will affect the size of the structures, and this will cause bad - * things to happen if the library and/or application ever change. - */ - -/* Any features you will not be using can be undef'ed here */ - -/* GR-P, 0.96a: Set "*TRANSFORMS_SUPPORTED as default but allow user - * to turn it off with "*TRANSFORMS_NOT_SUPPORTED" or *PNG_NO_*_TRANSFORMS - * on the compile line, then pick and choose which ones to define without - * having to edit this file. It is safe to use the *TRANSFORMS_NOT_SUPPORTED - * if you only want to have a png-compliant reader/writer but don't need - * any of the extra transformations. This saves about 80 kbytes in a - * typical installation of the library. (PNG_NO_* form added in version - * 1.0.1c, for consistency) - */ - -/* The size of the png_text structure changed in libpng-1.0.6 when - * iTXt support was added. iTXt support was turned off by default through - * libpng-1.2.x, to support old apps that malloc the png_text structure - * instead of calling png_set_text() and letting libpng malloc it. It - * was turned on by default in libpng-1.3.0. - */ - -#if defined(PNG_1_0_X) || defined (PNG_1_2_X) -# ifndef PNG_NO_iTXt_SUPPORTED -# define PNG_NO_iTXt_SUPPORTED -# endif -# ifndef PNG_NO_READ_iTXt -# define PNG_NO_READ_iTXt -# endif -# ifndef PNG_NO_WRITE_iTXt -# define PNG_NO_WRITE_iTXt -# endif -#endif - -#if !defined(PNG_NO_iTXt_SUPPORTED) -# if !defined(PNG_READ_iTXt_SUPPORTED) && !defined(PNG_NO_READ_iTXt) -# define PNG_READ_iTXt -# endif -# if !defined(PNG_WRITE_iTXt_SUPPORTED) && !defined(PNG_NO_WRITE_iTXt) -# define PNG_WRITE_iTXt -# endif -#endif - -/* The following support, added after version 1.0.0, can be turned off here en - * masse by defining PNG_LEGACY_SUPPORTED in case you need binary compatibility - * with old applications that require the length of png_struct and png_info - * to remain unchanged. - */ - -#ifdef PNG_LEGACY_SUPPORTED -# define PNG_NO_FREE_ME -# define PNG_NO_READ_UNKNOWN_CHUNKS -# define PNG_NO_WRITE_UNKNOWN_CHUNKS -# define PNG_NO_READ_USER_CHUNKS -# define PNG_NO_READ_iCCP -# define PNG_NO_WRITE_iCCP -# define PNG_NO_READ_iTXt -# define PNG_NO_WRITE_iTXt -# define PNG_NO_READ_sCAL -# define PNG_NO_WRITE_sCAL -# define PNG_NO_READ_sPLT -# define PNG_NO_WRITE_sPLT -# define PNG_NO_INFO_IMAGE -# define PNG_NO_READ_RGB_TO_GRAY -# define PNG_NO_READ_USER_TRANSFORM -# define PNG_NO_WRITE_USER_TRANSFORM -# define PNG_NO_USER_MEM -# define PNG_NO_READ_EMPTY_PLTE -# define PNG_NO_MNG_FEATURES -# define PNG_NO_FIXED_POINT_SUPPORTED -#endif - -/* Ignore attempt to turn off both floating and fixed point support */ -#if !defined(PNG_FLOATING_POINT_SUPPORTED) || \ - !defined(PNG_NO_FIXED_POINT_SUPPORTED) -# define PNG_FIXED_POINT_SUPPORTED -#endif - -#ifndef PNG_NO_FREE_ME -# define PNG_FREE_ME_SUPPORTED -#endif - -#if defined(PNG_READ_SUPPORTED) - -#if !defined(PNG_READ_TRANSFORMS_NOT_SUPPORTED) && \ - !defined(PNG_NO_READ_TRANSFORMS) -# define PNG_READ_TRANSFORMS_SUPPORTED -#endif - -#ifdef PNG_READ_TRANSFORMS_SUPPORTED -# ifndef PNG_NO_READ_EXPAND -# define PNG_READ_EXPAND_SUPPORTED -# endif -# ifndef PNG_NO_READ_SHIFT -# define PNG_READ_SHIFT_SUPPORTED -# endif -# ifndef PNG_NO_READ_PACK -# define PNG_READ_PACK_SUPPORTED -# endif -# ifndef PNG_NO_READ_BGR -# define PNG_READ_BGR_SUPPORTED -# endif -# ifndef PNG_NO_READ_SWAP -# define PNG_READ_SWAP_SUPPORTED -# endif -# ifndef PNG_NO_READ_PACKSWAP -# define PNG_READ_PACKSWAP_SUPPORTED -# endif -# ifndef PNG_NO_READ_INVERT -# define PNG_READ_INVERT_SUPPORTED -# endif -# ifndef PNG_NO_READ_DITHER -# define PNG_READ_DITHER_SUPPORTED -# endif -# ifndef PNG_NO_READ_BACKGROUND -# define PNG_READ_BACKGROUND_SUPPORTED -# endif -# ifndef PNG_NO_READ_16_TO_8 -# define PNG_READ_16_TO_8_SUPPORTED -# endif -# ifndef PNG_NO_READ_FILLER -# define PNG_READ_FILLER_SUPPORTED -# endif -# ifndef PNG_NO_READ_GAMMA -# define PNG_READ_GAMMA_SUPPORTED -# endif -# ifndef PNG_NO_READ_GRAY_TO_RGB -# define PNG_READ_GRAY_TO_RGB_SUPPORTED -# endif -# ifndef PNG_NO_READ_SWAP_ALPHA -# define PNG_READ_SWAP_ALPHA_SUPPORTED -# endif -# ifndef PNG_NO_READ_INVERT_ALPHA -# define PNG_READ_INVERT_ALPHA_SUPPORTED -# endif -# ifndef PNG_NO_READ_STRIP_ALPHA -# define PNG_READ_STRIP_ALPHA_SUPPORTED -# endif -# ifndef PNG_NO_READ_USER_TRANSFORM -# define PNG_READ_USER_TRANSFORM_SUPPORTED -# endif -# ifndef PNG_NO_READ_RGB_TO_GRAY -# define PNG_READ_RGB_TO_GRAY_SUPPORTED -# endif -#endif /* PNG_READ_TRANSFORMS_SUPPORTED */ - -#if !defined(PNG_NO_PROGRESSIVE_READ) && \ - !defined(PNG_PROGRESSIVE_READ_SUPPORTED) /* if you don't do progressive */ -# define PNG_PROGRESSIVE_READ_SUPPORTED /* reading. This is not talking */ -#endif /* about interlacing capability! You'll */ - /* still have interlacing unless you change the following line: */ - -#define PNG_READ_INTERLACING_SUPPORTED /* required in PNG-compliant decoders */ - -#ifndef PNG_NO_READ_COMPOSITE_NODIV -# ifndef PNG_NO_READ_COMPOSITED_NODIV /* libpng-1.0.x misspelling */ -# define PNG_READ_COMPOSITE_NODIV_SUPPORTED /* well tested on Intel, SGI */ -# endif -#endif - -#if defined(PNG_1_0_X) || defined (PNG_1_2_X) -/* Deprecated, will be removed from version 2.0.0. - Use PNG_MNG_FEATURES_SUPPORTED instead. */ -#ifndef PNG_NO_READ_EMPTY_PLTE -# define PNG_READ_EMPTY_PLTE_SUPPORTED -#endif -#endif - -#endif /* PNG_READ_SUPPORTED */ - -#if defined(PNG_WRITE_SUPPORTED) - -# if !defined(PNG_WRITE_TRANSFORMS_NOT_SUPPORTED) && \ - !defined(PNG_NO_WRITE_TRANSFORMS) -# define PNG_WRITE_TRANSFORMS_SUPPORTED -#endif - -#ifdef PNG_WRITE_TRANSFORMS_SUPPORTED -# ifndef PNG_NO_WRITE_SHIFT -# define PNG_WRITE_SHIFT_SUPPORTED -# endif -# ifndef PNG_NO_WRITE_PACK -# define PNG_WRITE_PACK_SUPPORTED -# endif -# ifndef PNG_NO_WRITE_BGR -# define PNG_WRITE_BGR_SUPPORTED -# endif -# ifndef PNG_NO_WRITE_SWAP -# define PNG_WRITE_SWAP_SUPPORTED -# endif -# ifndef PNG_NO_WRITE_PACKSWAP -# define PNG_WRITE_PACKSWAP_SUPPORTED -# endif -# ifndef PNG_NO_WRITE_INVERT -# define PNG_WRITE_INVERT_SUPPORTED -# endif -# ifndef PNG_NO_WRITE_FILLER -# define PNG_WRITE_FILLER_SUPPORTED /* same as WRITE_STRIP_ALPHA */ -# endif -# ifndef PNG_NO_WRITE_SWAP_ALPHA -# define PNG_WRITE_SWAP_ALPHA_SUPPORTED -# endif -# ifndef PNG_NO_WRITE_INVERT_ALPHA -# define PNG_WRITE_INVERT_ALPHA_SUPPORTED -# endif -# ifndef PNG_NO_WRITE_USER_TRANSFORM -# define PNG_WRITE_USER_TRANSFORM_SUPPORTED -# endif -#endif /* PNG_WRITE_TRANSFORMS_SUPPORTED */ - -#if !defined(PNG_NO_WRITE_INTERLACING_SUPPORTED) && \ - !defined(PNG_WRITE_INTERLACING_SUPPORTED) -#define PNG_WRITE_INTERLACING_SUPPORTED /* not required for PNG-compliant - encoders, but can cause trouble - if left undefined */ -#endif - -#if !defined(PNG_NO_WRITE_WEIGHTED_FILTER) && \ - !defined(PNG_WRITE_WEIGHTED_FILTER) && \ - defined(PNG_FLOATING_POINT_SUPPORTED) -# define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED -#endif - -#ifndef PNG_NO_WRITE_FLUSH -# define PNG_WRITE_FLUSH_SUPPORTED -#endif - -#if defined(PNG_1_0_X) || defined (PNG_1_2_X) -/* Deprecated, see PNG_MNG_FEATURES_SUPPORTED, above */ -#ifndef PNG_NO_WRITE_EMPTY_PLTE -# define PNG_WRITE_EMPTY_PLTE_SUPPORTED -#endif -#endif - -#endif /* PNG_WRITE_SUPPORTED */ - -#ifndef PNG_1_0_X -# ifndef PNG_NO_ERROR_NUMBERS -# define PNG_ERROR_NUMBERS_SUPPORTED -# endif -#endif /* PNG_1_0_X */ - -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) -# ifndef PNG_NO_USER_TRANSFORM_PTR -# define PNG_USER_TRANSFORM_PTR_SUPPORTED -# endif -#endif - -#ifndef PNG_NO_STDIO -# define PNG_TIME_RFC1123_SUPPORTED -#endif - -/* This adds extra functions in pngget.c for accessing data from the - * info pointer (added in version 0.99) - * png_get_image_width() - * png_get_image_height() - * png_get_bit_depth() - * png_get_color_type() - * png_get_compression_type() - * png_get_filter_type() - * png_get_interlace_type() - * png_get_pixel_aspect_ratio() - * png_get_pixels_per_meter() - * png_get_x_offset_pixels() - * png_get_y_offset_pixels() - * png_get_x_offset_microns() - * png_get_y_offset_microns() - */ -#if !defined(PNG_NO_EASY_ACCESS) && !defined(PNG_EASY_ACCESS_SUPPORTED) -# define PNG_EASY_ACCESS_SUPPORTED -#endif - -/* PNG_ASSEMBLER_CODE was enabled by default in version 1.2.0 - * and removed from version 1.2.20. The following will be removed - * from libpng-1.4.0 -*/ - -#if defined(PNG_READ_SUPPORTED) && !defined(PNG_NO_OPTIMIZED_CODE) -# ifndef PNG_OPTIMIZED_CODE_SUPPORTED -# define PNG_OPTIMIZED_CODE_SUPPORTED -# endif -#endif - -#if defined(PNG_READ_SUPPORTED) && !defined(PNG_NO_ASSEMBLER_CODE) -# ifndef PNG_ASSEMBLER_CODE_SUPPORTED -# define PNG_ASSEMBLER_CODE_SUPPORTED -# endif - -# if defined(__GNUC__) && defined(__x86_64__) && (__GNUC__ < 4) - /* work around 64-bit gcc compiler bugs in gcc-3.x */ -# if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE) -# define PNG_NO_MMX_CODE -# endif -# endif - -# if defined(__APPLE__) -# if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE) -# define PNG_NO_MMX_CODE -# endif -# endif - -# if (defined(__MWERKS__) && ((__MWERKS__ < 0x0900) || macintosh)) -# if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE) -# define PNG_NO_MMX_CODE -# endif -# endif - -# if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE) -# define PNG_MMX_CODE_SUPPORTED -# endif - -#endif -/* end of obsolete code to be removed from libpng-1.4.0 */ - -#if !defined(PNG_1_0_X) -#if !defined(PNG_NO_USER_MEM) && !defined(PNG_USER_MEM_SUPPORTED) -# define PNG_USER_MEM_SUPPORTED -#endif -#endif /* PNG_1_0_X */ - -/* Added at libpng-1.2.6 */ -#if !defined(PNG_1_0_X) -#ifndef PNG_SET_USER_LIMITS_SUPPORTED -#if !defined(PNG_NO_SET_USER_LIMITS) && !defined(PNG_SET_USER_LIMITS_SUPPORTED) -# define PNG_SET_USER_LIMITS_SUPPORTED -#endif -#endif -#endif /* PNG_1_0_X */ - -/* Added at libpng-1.0.16 and 1.2.6. To accept all valid PNGS no matter - * how large, set these limits to 0x7fffffffL - */ -#ifndef PNG_USER_WIDTH_MAX -# define PNG_USER_WIDTH_MAX 1000000L -#endif -#ifndef PNG_USER_HEIGHT_MAX -# define PNG_USER_HEIGHT_MAX 1000000L -#endif - -/* Added at libpng-1.2.34 and 1.4.0 */ -#ifndef PNG_STRING_NEWLINE -#define PNG_STRING_NEWLINE "\n" -#endif - -/* These are currently experimental features, define them if you want */ - -/* very little testing */ -/* -#ifdef PNG_READ_SUPPORTED -# ifndef PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED -# define PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED -# endif -#endif -*/ - -/* This is only for PowerPC big-endian and 680x0 systems */ -/* some testing */ -/* -#ifndef PNG_READ_BIG_ENDIAN_SUPPORTED -# define PNG_READ_BIG_ENDIAN_SUPPORTED -#endif -*/ - -/* Buggy compilers (e.g., gcc 2.7.2.2) need this */ -/* -#define PNG_NO_POINTER_INDEXING -*/ - -/* These functions are turned off by default, as they will be phased out. */ -/* -#define PNG_USELESS_TESTS_SUPPORTED -#define PNG_CORRECT_PALETTE_SUPPORTED -*/ - -/* Any chunks you are not interested in, you can undef here. The - * ones that allocate memory may be expecially important (hIST, - * tEXt, zTXt, tRNS, pCAL). Others will just save time and make png_info - * a bit smaller. - */ - -#if defined(PNG_READ_SUPPORTED) && \ - !defined(PNG_READ_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \ - !defined(PNG_NO_READ_ANCILLARY_CHUNKS) -# define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED -#endif - -#if defined(PNG_WRITE_SUPPORTED) && \ - !defined(PNG_WRITE_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \ - !defined(PNG_NO_WRITE_ANCILLARY_CHUNKS) -# define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED -#endif - -#ifdef PNG_READ_ANCILLARY_CHUNKS_SUPPORTED - -#ifdef PNG_NO_READ_TEXT -# define PNG_NO_READ_iTXt -# define PNG_NO_READ_tEXt -# define PNG_NO_READ_zTXt -#endif -#ifndef PNG_NO_READ_bKGD -# define PNG_READ_bKGD_SUPPORTED -# define PNG_bKGD_SUPPORTED -#endif -#ifndef PNG_NO_READ_cHRM -# define PNG_READ_cHRM_SUPPORTED -# define PNG_cHRM_SUPPORTED -#endif -#ifndef PNG_NO_READ_gAMA -# define PNG_READ_gAMA_SUPPORTED -# define PNG_gAMA_SUPPORTED -#endif -#ifndef PNG_NO_READ_hIST -# define PNG_READ_hIST_SUPPORTED -# define PNG_hIST_SUPPORTED -#endif -#ifndef PNG_NO_READ_iCCP -# define PNG_READ_iCCP_SUPPORTED -# define PNG_iCCP_SUPPORTED -#endif -#ifndef PNG_NO_READ_iTXt -# ifndef PNG_READ_iTXt_SUPPORTED -# define PNG_READ_iTXt_SUPPORTED -# endif -# ifndef PNG_iTXt_SUPPORTED -# define PNG_iTXt_SUPPORTED -# endif -#endif -#ifndef PNG_NO_READ_oFFs -# define PNG_READ_oFFs_SUPPORTED -# define PNG_oFFs_SUPPORTED -#endif -#ifndef PNG_NO_READ_pCAL -# define PNG_READ_pCAL_SUPPORTED -# define PNG_pCAL_SUPPORTED -#endif -#ifndef PNG_NO_READ_sCAL -# define PNG_READ_sCAL_SUPPORTED -# define PNG_sCAL_SUPPORTED -#endif -#ifndef PNG_NO_READ_pHYs -# define PNG_READ_pHYs_SUPPORTED -# define PNG_pHYs_SUPPORTED -#endif -#ifndef PNG_NO_READ_sBIT -# define PNG_READ_sBIT_SUPPORTED -# define PNG_sBIT_SUPPORTED -#endif -#ifndef PNG_NO_READ_sPLT -# define PNG_READ_sPLT_SUPPORTED -# define PNG_sPLT_SUPPORTED -#endif -#ifndef PNG_NO_READ_sRGB -# define PNG_READ_sRGB_SUPPORTED -# define PNG_sRGB_SUPPORTED -#endif -#ifndef PNG_NO_READ_tEXt -# define PNG_READ_tEXt_SUPPORTED -# define PNG_tEXt_SUPPORTED -#endif -#ifndef PNG_NO_READ_tIME -# define PNG_READ_tIME_SUPPORTED -# define PNG_tIME_SUPPORTED -#endif -#ifndef PNG_NO_READ_tRNS -# define PNG_READ_tRNS_SUPPORTED -# define PNG_tRNS_SUPPORTED -#endif -#ifndef PNG_NO_READ_zTXt -# define PNG_READ_zTXt_SUPPORTED -# define PNG_zTXt_SUPPORTED -#endif -#ifndef PNG_NO_READ_UNKNOWN_CHUNKS -# define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED -# ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED -# define PNG_UNKNOWN_CHUNKS_SUPPORTED -# endif -# ifndef PNG_NO_HANDLE_AS_UNKNOWN -# define PNG_HANDLE_AS_UNKNOWN_SUPPORTED -# endif -#endif -#if !defined(PNG_NO_READ_USER_CHUNKS) && \ - defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) -# define PNG_READ_USER_CHUNKS_SUPPORTED -# define PNG_USER_CHUNKS_SUPPORTED -# ifdef PNG_NO_READ_UNKNOWN_CHUNKS -# undef PNG_NO_READ_UNKNOWN_CHUNKS -# endif -# ifdef PNG_NO_HANDLE_AS_UNKNOWN -# undef PNG_NO_HANDLE_AS_UNKNOWN -# endif -#endif -#ifndef PNG_NO_READ_OPT_PLTE -# define PNG_READ_OPT_PLTE_SUPPORTED /* only affects support of the */ -#endif /* optional PLTE chunk in RGB and RGBA images */ -#if defined(PNG_READ_iTXt_SUPPORTED) || defined(PNG_READ_tEXt_SUPPORTED) || \ - defined(PNG_READ_zTXt_SUPPORTED) -# define PNG_READ_TEXT_SUPPORTED -# define PNG_TEXT_SUPPORTED -#endif - -#endif /* PNG_READ_ANCILLARY_CHUNKS_SUPPORTED */ - -#ifdef PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED - -#ifdef PNG_NO_WRITE_TEXT -# define PNG_NO_WRITE_iTXt -# define PNG_NO_WRITE_tEXt -# define PNG_NO_WRITE_zTXt -#endif -#ifndef PNG_NO_WRITE_bKGD -# define PNG_WRITE_bKGD_SUPPORTED -# ifndef PNG_bKGD_SUPPORTED -# define PNG_bKGD_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_cHRM -# define PNG_WRITE_cHRM_SUPPORTED -# ifndef PNG_cHRM_SUPPORTED -# define PNG_cHRM_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_gAMA -# define PNG_WRITE_gAMA_SUPPORTED -# ifndef PNG_gAMA_SUPPORTED -# define PNG_gAMA_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_hIST -# define PNG_WRITE_hIST_SUPPORTED -# ifndef PNG_hIST_SUPPORTED -# define PNG_hIST_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_iCCP -# define PNG_WRITE_iCCP_SUPPORTED -# ifndef PNG_iCCP_SUPPORTED -# define PNG_iCCP_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_iTXt -# ifndef PNG_WRITE_iTXt_SUPPORTED -# define PNG_WRITE_iTXt_SUPPORTED -# endif -# ifndef PNG_iTXt_SUPPORTED -# define PNG_iTXt_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_oFFs -# define PNG_WRITE_oFFs_SUPPORTED -# ifndef PNG_oFFs_SUPPORTED -# define PNG_oFFs_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_pCAL -# define PNG_WRITE_pCAL_SUPPORTED -# ifndef PNG_pCAL_SUPPORTED -# define PNG_pCAL_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_sCAL -# define PNG_WRITE_sCAL_SUPPORTED -# ifndef PNG_sCAL_SUPPORTED -# define PNG_sCAL_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_pHYs -# define PNG_WRITE_pHYs_SUPPORTED -# ifndef PNG_pHYs_SUPPORTED -# define PNG_pHYs_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_sBIT -# define PNG_WRITE_sBIT_SUPPORTED -# ifndef PNG_sBIT_SUPPORTED -# define PNG_sBIT_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_sPLT -# define PNG_WRITE_sPLT_SUPPORTED -# ifndef PNG_sPLT_SUPPORTED -# define PNG_sPLT_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_sRGB -# define PNG_WRITE_sRGB_SUPPORTED -# ifndef PNG_sRGB_SUPPORTED -# define PNG_sRGB_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_tEXt -# define PNG_WRITE_tEXt_SUPPORTED -# ifndef PNG_tEXt_SUPPORTED -# define PNG_tEXt_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_tIME -# define PNG_WRITE_tIME_SUPPORTED -# ifndef PNG_tIME_SUPPORTED -# define PNG_tIME_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_tRNS -# define PNG_WRITE_tRNS_SUPPORTED -# ifndef PNG_tRNS_SUPPORTED -# define PNG_tRNS_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_zTXt -# define PNG_WRITE_zTXt_SUPPORTED -# ifndef PNG_zTXt_SUPPORTED -# define PNG_zTXt_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_UNKNOWN_CHUNKS -# define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED -# ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED -# define PNG_UNKNOWN_CHUNKS_SUPPORTED -# endif -# ifndef PNG_NO_HANDLE_AS_UNKNOWN -# ifndef PNG_HANDLE_AS_UNKNOWN_SUPPORTED -# define PNG_HANDLE_AS_UNKNOWN_SUPPORTED -# endif -# endif -#endif -#if defined(PNG_WRITE_iTXt_SUPPORTED) || defined(PNG_WRITE_tEXt_SUPPORTED) || \ - defined(PNG_WRITE_zTXt_SUPPORTED) -# define PNG_WRITE_TEXT_SUPPORTED -# ifndef PNG_TEXT_SUPPORTED -# define PNG_TEXT_SUPPORTED -# endif -#endif - -#endif /* PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED */ - -/* Turn this off to disable png_read_png() and - * png_write_png() and leave the row_pointers member - * out of the info structure. - */ -#ifndef PNG_NO_INFO_IMAGE -# define PNG_INFO_IMAGE_SUPPORTED -#endif - -/* need the time information for reading tIME chunks */ -#if defined(PNG_tIME_SUPPORTED) -# if !defined(_WIN32_WCE) - /* "time.h" functions are not supported on WindowsCE */ -# include -# endif -#endif - -/* Some typedefs to get us started. These should be safe on most of the - * common platforms. The typedefs should be at least as large as the - * numbers suggest (a png_uint_32 must be at least 32 bits long), but they - * don't have to be exactly that size. Some compilers dislike passing - * unsigned shorts as function parameters, so you may be better off using - * unsigned int for png_uint_16. Likewise, for 64-bit systems, you may - * want to have unsigned int for png_uint_32 instead of unsigned long. - */ - -typedef unsigned long png_uint_32; -typedef long png_int_32; -typedef unsigned short png_uint_16; -typedef short png_int_16; -typedef unsigned char png_byte; - -/* This is usually size_t. It is typedef'ed just in case you need it to - change (I'm not sure if you will or not, so I thought I'd be safe) */ -#ifdef PNG_SIZE_T - typedef PNG_SIZE_T png_size_t; -# define png_sizeof(x) png_convert_size(sizeof(x)) -#else - typedef size_t png_size_t; -# define png_sizeof(x) sizeof(x) -#endif - -/* The following is needed for medium model support. It cannot be in the - * PNG_INTERNAL section. Needs modification for other compilers besides - * MSC. Model independent support declares all arrays and pointers to be - * large using the far keyword. The zlib version used must also support - * model independent data. As of version zlib 1.0.4, the necessary changes - * have been made in zlib. The USE_FAR_KEYWORD define triggers other - * changes that are needed. (Tim Wegner) - */ - -/* Separate compiler dependencies (problem here is that zlib.h always - defines FAR. (SJT) */ -#ifdef __BORLANDC__ -# if defined(__LARGE__) || defined(__HUGE__) || defined(__COMPACT__) -# define LDATA 1 -# else -# define LDATA 0 -# endif - /* GRR: why is Cygwin in here? Cygwin is not Borland C... */ -# if !defined(__WIN32__) && !defined(__FLAT__) && !defined(__CYGWIN__) -# define PNG_MAX_MALLOC_64K -# if (LDATA != 1) -# ifndef FAR -# define FAR __far -# endif -# define USE_FAR_KEYWORD -# endif /* LDATA != 1 */ - /* Possibly useful for moving data out of default segment. - * Uncomment it if you want. Could also define FARDATA as - * const if your compiler supports it. (SJT) -# define FARDATA FAR - */ -# endif /* __WIN32__, __FLAT__, __CYGWIN__ */ -#endif /* __BORLANDC__ */ - - -/* Suggest testing for specific compiler first before testing for - * FAR. The Watcom compiler defines both __MEDIUM__ and M_I86MM, - * making reliance oncertain keywords suspect. (SJT) - */ - -/* MSC Medium model */ -#if defined(FAR) -# if defined(M_I86MM) -# define USE_FAR_KEYWORD -# define FARDATA FAR -# include -# endif -#endif - -/* SJT: default case */ -#ifndef FAR -# define FAR -#endif - -/* At this point FAR is always defined */ -#ifndef FARDATA -# define FARDATA -#endif - -/* Typedef for floating-point numbers that are converted - to fixed-point with a multiple of 100,000, e.g., int_gamma */ -typedef png_int_32 png_fixed_point; - -/* Add typedefs for pointers */ -typedef void FAR * png_voidp; -typedef png_byte FAR * png_bytep; -typedef png_uint_32 FAR * png_uint_32p; -typedef png_int_32 FAR * png_int_32p; -typedef png_uint_16 FAR * png_uint_16p; -typedef png_int_16 FAR * png_int_16p; -typedef PNG_CONST char FAR * png_const_charp; -typedef char FAR * png_charp; -typedef png_fixed_point FAR * png_fixed_point_p; - -#ifndef PNG_NO_STDIO -#if defined(_WIN32_WCE) -typedef HANDLE png_FILE_p; -#else -typedef FILE * png_FILE_p; -#endif -#endif - -#ifdef PNG_FLOATING_POINT_SUPPORTED -typedef double FAR * png_doublep; -#endif - -/* Pointers to pointers; i.e. arrays */ -typedef png_byte FAR * FAR * png_bytepp; -typedef png_uint_32 FAR * FAR * png_uint_32pp; -typedef png_int_32 FAR * FAR * png_int_32pp; -typedef png_uint_16 FAR * FAR * png_uint_16pp; -typedef png_int_16 FAR * FAR * png_int_16pp; -typedef PNG_CONST char FAR * FAR * png_const_charpp; -typedef char FAR * FAR * png_charpp; -typedef png_fixed_point FAR * FAR * png_fixed_point_pp; -#ifdef PNG_FLOATING_POINT_SUPPORTED -typedef double FAR * FAR * png_doublepp; -#endif - -/* Pointers to pointers to pointers; i.e., pointer to array */ -typedef char FAR * FAR * FAR * png_charppp; - -#if defined(PNG_1_0_X) || defined(PNG_1_2_X) -/* SPC - Is this stuff deprecated? */ -/* It'll be removed as of libpng-1.3.0 - GR-P */ -/* libpng typedefs for types in zlib. If zlib changes - * or another compression library is used, then change these. - * Eliminates need to change all the source files. - */ -typedef charf * png_zcharp; -typedef charf * FAR * png_zcharpp; -typedef z_stream FAR * png_zstreamp; -#endif /* (PNG_1_0_X) || defined(PNG_1_2_X) */ - -/* - * Define PNG_BUILD_DLL if the module being built is a Windows - * LIBPNG DLL. - * - * Define PNG_USE_DLL if you want to *link* to the Windows LIBPNG DLL. - * It is equivalent to Microsoft predefined macro _DLL that is - * automatically defined when you compile using the share - * version of the CRT (C Run-Time library) - * - * The cygwin mods make this behavior a little different: - * Define PNG_BUILD_DLL if you are building a dll for use with cygwin - * Define PNG_STATIC if you are building a static library for use with cygwin, - * -or- if you are building an application that you want to link to the - * static library. - * PNG_USE_DLL is defined by default (no user action needed) unless one of - * the other flags is defined. - */ - -#if !defined(PNG_DLL) && (defined(PNG_BUILD_DLL) || defined(PNG_USE_DLL)) -# define PNG_DLL -#endif -/* If CYGWIN, then disallow GLOBAL ARRAYS unless building a static lib. - * When building a static lib, default to no GLOBAL ARRAYS, but allow - * command-line override - */ -#if defined(__CYGWIN__) -# if !defined(PNG_STATIC) -# if defined(PNG_USE_GLOBAL_ARRAYS) -# undef PNG_USE_GLOBAL_ARRAYS -# endif -# if !defined(PNG_USE_LOCAL_ARRAYS) -# define PNG_USE_LOCAL_ARRAYS -# endif -# else -# if defined(PNG_USE_LOCAL_ARRAYS) || defined(PNG_NO_GLOBAL_ARRAYS) -# if defined(PNG_USE_GLOBAL_ARRAYS) -# undef PNG_USE_GLOBAL_ARRAYS -# endif -# endif -# endif -# if !defined(PNG_USE_LOCAL_ARRAYS) && !defined(PNG_USE_GLOBAL_ARRAYS) -# define PNG_USE_LOCAL_ARRAYS -# endif -#endif - -/* Do not use global arrays (helps with building DLL's) - * They are no longer used in libpng itself, since version 1.0.5c, - * but might be required for some pre-1.0.5c applications. - */ -#if !defined(PNG_USE_LOCAL_ARRAYS) && !defined(PNG_USE_GLOBAL_ARRAYS) -# if defined(PNG_NO_GLOBAL_ARRAYS) || \ - (defined(__GNUC__) && defined(PNG_DLL)) || defined(_MSC_VER) -# define PNG_USE_LOCAL_ARRAYS -# else -# define PNG_USE_GLOBAL_ARRAYS -# endif -#endif - -#if defined(__CYGWIN__) -# undef PNGAPI -# define PNGAPI __cdecl -# undef PNG_IMPEXP -# define PNG_IMPEXP -#endif - -/* If you define PNGAPI, e.g., with compiler option "-DPNGAPI=__stdcall", - * you may get warnings regarding the linkage of png_zalloc and png_zfree. - * Don't ignore those warnings; you must also reset the default calling - * convention in your compiler to match your PNGAPI, and you must build - * zlib and your applications the same way you build libpng. - */ - -#if defined(__MINGW32__) && !defined(PNG_MODULEDEF) -# ifndef PNG_NO_MODULEDEF -# define PNG_NO_MODULEDEF -# endif -#endif - -#if !defined(PNG_IMPEXP) && defined(PNG_BUILD_DLL) && !defined(PNG_NO_MODULEDEF) -# define PNG_IMPEXP -#endif - -#if defined(PNG_DLL) || defined(_DLL) || defined(__DLL__ ) || \ - (( defined(_Windows) || defined(_WINDOWS) || \ - defined(WIN32) || defined(_WIN32) || defined(__WIN32__) )) - -# ifndef PNGAPI -# if defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800)) -# define PNGAPI __cdecl -# else -# define PNGAPI _cdecl -# endif -# endif - -# if !defined(PNG_IMPEXP) && (!defined(PNG_DLL) || \ - 0 /* WINCOMPILER_WITH_NO_SUPPORT_FOR_DECLIMPEXP */) -# define PNG_IMPEXP -# endif - -# if !defined(PNG_IMPEXP) - -# define PNG_EXPORT_TYPE1(type,symbol) PNG_IMPEXP type PNGAPI symbol -# define PNG_EXPORT_TYPE2(type,symbol) type PNG_IMPEXP PNGAPI symbol - - /* Borland/Microsoft */ -# if defined(_MSC_VER) || defined(__BORLANDC__) -# if (_MSC_VER >= 800) || (__BORLANDC__ >= 0x500) -# define PNG_EXPORT PNG_EXPORT_TYPE1 -# else -# define PNG_EXPORT PNG_EXPORT_TYPE2 -# if defined(PNG_BUILD_DLL) -# define PNG_IMPEXP __export -# else -# define PNG_IMPEXP /*__import */ /* doesn't exist AFAIK in - VC++ */ -# endif /* Exists in Borland C++ for - C++ classes (== huge) */ -# endif -# endif - -# if !defined(PNG_IMPEXP) -# if defined(PNG_BUILD_DLL) -# define PNG_IMPEXP __declspec(dllexport) -# else -# define PNG_IMPEXP __declspec(dllimport) -# endif -# endif -# endif /* PNG_IMPEXP */ -#else /* !(DLL || non-cygwin WINDOWS) */ -# if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__) -# ifndef PNGAPI -# define PNGAPI _System -# endif -# else -# if 0 /* ... other platforms, with other meanings */ -# endif -# endif -#endif - -#ifndef PNGAPI -# define PNGAPI -#endif -#ifndef PNG_IMPEXP -# define PNG_IMPEXP -#endif - -#ifdef PNG_BUILDSYMS -# ifndef PNG_EXPORT -# define PNG_EXPORT(type,symbol) PNG_FUNCTION_EXPORT symbol END -# endif -# ifdef PNG_USE_GLOBAL_ARRAYS -# ifndef PNG_EXPORT_VAR -# define PNG_EXPORT_VAR(type) PNG_DATA_EXPORT -# endif -# endif -#endif - -#ifndef PNG_EXPORT -# define PNG_EXPORT(type,symbol) PNG_IMPEXP type PNGAPI symbol -#endif - -#ifdef PNG_USE_GLOBAL_ARRAYS -# ifndef PNG_EXPORT_VAR -# define PNG_EXPORT_VAR(type) extern PNG_IMPEXP type -# endif -#endif - -/* User may want to use these so they are not in PNG_INTERNAL. Any library - * functions that are passed far data must be model independent. - */ - -#ifndef PNG_ABORT -# define PNG_ABORT() abort() -#endif - -#ifdef PNG_SETJMP_SUPPORTED -# define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf) -#else -# define png_jmpbuf(png_ptr) \ - (LIBPNG_WAS_COMPILED_WITH__PNG_SETJMP_NOT_SUPPORTED) -#endif - -#if defined(USE_FAR_KEYWORD) /* memory model independent fns */ -/* use this to make far-to-near assignments */ -# define CHECK 1 -# define NOCHECK 0 -# define CVT_PTR(ptr) (png_far_to_near(png_ptr,ptr,CHECK)) -# define CVT_PTR_NOCHECK(ptr) (png_far_to_near(png_ptr,ptr,NOCHECK)) -# define png_snprintf _fsnprintf /* Added to v 1.2.19 */ -# define png_strlen _fstrlen -# define png_memcmp _fmemcmp /* SJT: added */ -# define png_memcpy _fmemcpy -# define png_memset _fmemset -#else /* use the usual functions */ -# define CVT_PTR(ptr) (ptr) -# define CVT_PTR_NOCHECK(ptr) (ptr) -# ifndef PNG_NO_SNPRINTF -# ifdef _MSC_VER -# define png_snprintf _snprintf /* Added to v 1.2.19 */ -# define png_snprintf2 _snprintf -# define png_snprintf6 _snprintf -# else -# define png_snprintf snprintf /* Added to v 1.2.19 */ -# define png_snprintf2 snprintf -# define png_snprintf6 snprintf -# endif -# else - /* You don't have or don't want to use snprintf(). Caution: Using - * sprintf instead of snprintf exposes your application to accidental - * or malevolent buffer overflows. If you don't have snprintf() - * as a general rule you should provide one (you can get one from - * Portable OpenSSH). */ -# define png_snprintf(s1,n,fmt,x1) sprintf(s1,fmt,x1) -# define png_snprintf2(s1,n,fmt,x1,x2) sprintf(s1,fmt,x1,x2) -# define png_snprintf6(s1,n,fmt,x1,x2,x3,x4,x5,x6) \ - sprintf(s1,fmt,x1,x2,x3,x4,x5,x6) -# endif -# define png_strlen strlen -# define png_memcmp memcmp /* SJT: added */ -# define png_memcpy memcpy -# define png_memset memset -#endif -/* End of memory model independent support */ - -/* Just a little check that someone hasn't tried to define something - * contradictory. - */ -#if (PNG_ZBUF_SIZE > 65536L) && defined(PNG_MAX_MALLOC_64K) -# undef PNG_ZBUF_SIZE -# define PNG_ZBUF_SIZE 65536L -#endif - -/* Added at libpng-1.2.8 */ -#endif /* PNG_VERSION_INFO_ONLY */ - -#endif /* PNGCONF_H */ diff --git a/src/libpng/pngerror.c b/src/libpng/pngerror.c deleted file mode 100644 index 285d72027..000000000 --- a/src/libpng/pngerror.c +++ /dev/null @@ -1,361 +0,0 @@ - -/* pngerror.c - stub functions for i/o and memory allocation - * - * Last changed in libpng 1.2.37 [June 4, 2009] - * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2009 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - * - * This file provides a location for all error handling. Users who - * need special error handling are expected to write replacement functions - * and use png_set_error_fn() to use those functions. See the instructions - * at each function. - */ - -#define PNG_INTERNAL -#include "png.h" -#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) - -static void /* PRIVATE */ -png_default_error PNGARG((png_structp png_ptr, - png_const_charp error_message)); -#ifndef PNG_NO_WARNINGS -static void /* PRIVATE */ -png_default_warning PNGARG((png_structp png_ptr, - png_const_charp warning_message)); -#endif /* PNG_NO_WARNINGS */ - -/* This function is called whenever there is a fatal error. This function - * should not be changed. If there is a need to handle errors differently, - * you should supply a replacement error function and use png_set_error_fn() - * to replace the error function at run-time. - */ -#ifndef PNG_NO_ERROR_TEXT -void PNGAPI -png_error(png_structp png_ptr, png_const_charp error_message) -{ -#ifdef PNG_ERROR_NUMBERS_SUPPORTED - char msg[16]; - if (png_ptr != NULL) - { - if (png_ptr->flags& - (PNG_FLAG_STRIP_ERROR_NUMBERS|PNG_FLAG_STRIP_ERROR_TEXT)) - { - if (*error_message == '#') - { - /* Strip "#nnnn " from beginning of error message. */ - int offset; - for (offset = 1; offset<15; offset++) - if (error_message[offset] == ' ') - break; - if (png_ptr->flags&PNG_FLAG_STRIP_ERROR_TEXT) - { - int i; - for (i = 0; i < offset - 1; i++) - msg[i] = error_message[i + 1]; - msg[i - 1] = '\0'; - error_message = msg; - } - else - error_message += offset; - } - else - { - if (png_ptr->flags&PNG_FLAG_STRIP_ERROR_TEXT) - { - msg[0] = '0'; - msg[1] = '\0'; - error_message = msg; - } - } - } - } -#endif - if (png_ptr != NULL && png_ptr->error_fn != NULL) - (*(png_ptr->error_fn))(png_ptr, error_message); - - /* If the custom handler doesn't exist, or if it returns, - use the default handler, which will not return. */ - png_default_error(png_ptr, error_message); -} -#else -void PNGAPI -png_err(png_structp png_ptr) -{ - if (png_ptr != NULL && png_ptr->error_fn != NULL) - (*(png_ptr->error_fn))(png_ptr, '\0'); - - /* If the custom handler doesn't exist, or if it returns, - use the default handler, which will not return. */ - png_default_error(png_ptr, '\0'); -} -#endif /* PNG_NO_ERROR_TEXT */ - -#ifndef PNG_NO_WARNINGS -/* This function is called whenever there is a non-fatal error. This function - * should not be changed. If there is a need to handle warnings differently, - * you should supply a replacement warning function and use - * png_set_error_fn() to replace the warning function at run-time. - */ -void PNGAPI -png_warning(png_structp png_ptr, png_const_charp warning_message) -{ - int offset = 0; - if (png_ptr != NULL) - { -#ifdef PNG_ERROR_NUMBERS_SUPPORTED - if (png_ptr->flags& - (PNG_FLAG_STRIP_ERROR_NUMBERS|PNG_FLAG_STRIP_ERROR_TEXT)) -#endif - { - if (*warning_message == '#') - { - for (offset = 1; offset < 15; offset++) - if (warning_message[offset] == ' ') - break; - } - } - } - if (png_ptr != NULL && png_ptr->warning_fn != NULL) - (*(png_ptr->warning_fn))(png_ptr, warning_message + offset); - else - png_default_warning(png_ptr, warning_message + offset); -} -#endif /* PNG_NO_WARNINGS */ - - -/* These utilities are used internally to build an error message that relates - * to the current chunk. The chunk name comes from png_ptr->chunk_name, - * this is used to prefix the message. The message is limited in length - * to 63 bytes, the name characters are output as hex digits wrapped in [] - * if the character is invalid. - */ -#define isnonalpha(c) ((c) < 65 || (c) > 122 || ((c) > 90 && (c) < 97)) -static PNG_CONST char png_digit[16] = { - '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', - 'A', 'B', 'C', 'D', 'E', 'F' -}; - -#define PNG_MAX_ERROR_TEXT 64 - -#if !defined(PNG_NO_WARNINGS) || !defined(PNG_NO_ERROR_TEXT) -static void /* PRIVATE */ -png_format_buffer(png_structp png_ptr, png_charp buffer, png_const_charp - error_message) -{ - int iout = 0, iin = 0; - - while (iin < 4) - { - int c = png_ptr->chunk_name[iin++]; - if (isnonalpha(c)) - { - buffer[iout++] = '['; - buffer[iout++] = png_digit[(c & 0xf0) >> 4]; - buffer[iout++] = png_digit[c & 0x0f]; - buffer[iout++] = ']'; - } - else - { - buffer[iout++] = (png_byte)c; - } - } - - if (error_message == NULL) - buffer[iout] = '\0'; - else - { - buffer[iout++] = ':'; - buffer[iout++] = ' '; - png_memcpy(buffer + iout, error_message, PNG_MAX_ERROR_TEXT); - buffer[iout + PNG_MAX_ERROR_TEXT - 1] = '\0'; - } -} - -#ifdef PNG_READ_SUPPORTED -void PNGAPI -png_chunk_error(png_structp png_ptr, png_const_charp error_message) -{ - char msg[18+PNG_MAX_ERROR_TEXT]; - if (png_ptr == NULL) - png_error(png_ptr, error_message); - else - { - png_format_buffer(png_ptr, msg, error_message); - png_error(png_ptr, msg); - } -} -#endif /* PNG_READ_SUPPORTED */ -#endif /* !defined(PNG_NO_WARNINGS) || !defined(PNG_NO_ERROR_TEXT) */ - -#ifndef PNG_NO_WARNINGS -void PNGAPI -png_chunk_warning(png_structp png_ptr, png_const_charp warning_message) -{ - char msg[18+PNG_MAX_ERROR_TEXT]; - if (png_ptr == NULL) - png_warning(png_ptr, warning_message); - else - { - png_format_buffer(png_ptr, msg, warning_message); - png_warning(png_ptr, msg); - } -} -#endif /* PNG_NO_WARNINGS */ - - -/* This is the default error handling function. Note that replacements for - * this function MUST NOT RETURN, or the program will likely crash. This - * function is used by default, or if the program supplies NULL for the - * error function pointer in png_set_error_fn(). - */ -static void /* PRIVATE */ -png_default_error(png_structp png_ptr, png_const_charp error_message) -{ -#ifndef PNG_NO_CONSOLE_IO -#ifdef PNG_ERROR_NUMBERS_SUPPORTED - if (*error_message == '#') - { - /* Strip "#nnnn " from beginning of error message. */ - int offset; - char error_number[16]; - for (offset = 0; offset<15; offset++) - { - error_number[offset] = error_message[offset + 1]; - if (error_message[offset] == ' ') - break; - } - if ((offset > 1) && (offset < 15)) - { - error_number[offset - 1] = '\0'; - fprintf(stderr, "libpng error no. %s: %s", - error_number, error_message + offset + 1); - fprintf(stderr, PNG_STRING_NEWLINE); - } - else - { - fprintf(stderr, "libpng error: %s, offset=%d", - error_message, offset); - fprintf(stderr, PNG_STRING_NEWLINE); - } - } - else -#endif - { - fprintf(stderr, "libpng error: %s", error_message); - fprintf(stderr, PNG_STRING_NEWLINE); - } -#endif - -#ifdef PNG_SETJMP_SUPPORTED - if (png_ptr) - { -# ifdef USE_FAR_KEYWORD - { - jmp_buf jmpbuf; - png_memcpy(jmpbuf, png_ptr->jmpbuf, png_sizeof(jmp_buf)); - longjmp(jmpbuf, 1); - } -# else - longjmp(png_ptr->jmpbuf, 1); -# endif - } -#else - PNG_ABORT(); -#endif -#ifdef PNG_NO_CONSOLE_IO - error_message = error_message; /* Make compiler happy */ -#endif -} - -#ifndef PNG_NO_WARNINGS -/* This function is called when there is a warning, but the library thinks - * it can continue anyway. Replacement functions don't have to do anything - * here if you don't want them to. In the default configuration, png_ptr is - * not used, but it is passed in case it may be useful. - */ -static void /* PRIVATE */ -png_default_warning(png_structp png_ptr, png_const_charp warning_message) -{ -#ifndef PNG_NO_CONSOLE_IO -# ifdef PNG_ERROR_NUMBERS_SUPPORTED - if (*warning_message == '#') - { - int offset; - char warning_number[16]; - for (offset = 0; offset < 15; offset++) - { - warning_number[offset] = warning_message[offset + 1]; - if (warning_message[offset] == ' ') - break; - } - if ((offset > 1) && (offset < 15)) - { - warning_number[offset + 1] = '\0'; - fprintf(stderr, "libpng warning no. %s: %s", - warning_number, warning_message + offset); - fprintf(stderr, PNG_STRING_NEWLINE); - } - else - { - fprintf(stderr, "libpng warning: %s", - warning_message); - fprintf(stderr, PNG_STRING_NEWLINE); - } - } - else -# endif - { - fprintf(stderr, "libpng warning: %s", warning_message); - fprintf(stderr, PNG_STRING_NEWLINE); - } -#else - warning_message = warning_message; /* Make compiler happy */ -#endif - png_ptr = png_ptr; /* Make compiler happy */ -} -#endif /* PNG_NO_WARNINGS */ - -/* This function is called when the application wants to use another method - * of handling errors and warnings. Note that the error function MUST NOT - * return to the calling routine or serious problems will occur. The return - * method used in the default routine calls longjmp(png_ptr->jmpbuf, 1) - */ -void PNGAPI -png_set_error_fn(png_structp png_ptr, png_voidp error_ptr, - png_error_ptr error_fn, png_error_ptr warning_fn) -{ - if (png_ptr == NULL) - return; - png_ptr->error_ptr = error_ptr; - png_ptr->error_fn = error_fn; - png_ptr->warning_fn = warning_fn; -} - - -/* This function returns a pointer to the error_ptr associated with the user - * functions. The application should free any memory associated with this - * pointer before png_write_destroy and png_read_destroy are called. - */ -png_voidp PNGAPI -png_get_error_ptr(png_structp png_ptr) -{ - if (png_ptr == NULL) - return NULL; - return ((png_voidp)png_ptr->error_ptr); -} - - -#ifdef PNG_ERROR_NUMBERS_SUPPORTED -void PNGAPI -png_set_strip_error_numbers(png_structp png_ptr, png_uint_32 strip_mode) -{ - if (png_ptr != NULL) - { - png_ptr->flags &= - ((~(PNG_FLAG_STRIP_ERROR_NUMBERS|PNG_FLAG_STRIP_ERROR_TEXT))&strip_mode); - } -} -#endif -#endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */ diff --git a/src/libpng/pnggccrd.c b/src/libpng/pnggccrd.c deleted file mode 100644 index 6d932abf0..000000000 --- a/src/libpng/pnggccrd.c +++ /dev/null @@ -1,103 +0,0 @@ -/* pnggccrd.c was removed from libpng-1.2.20. */ - -/* This code snippet is for use by configure's compilation test. */ - -#if (!defined _MSC_VER) && \ - defined(PNG_ASSEMBLER_CODE_SUPPORTED) && \ - defined(PNG_MMX_CODE_SUPPORTED) - -int PNGAPI png_dummy_mmx_support(void); - -static int _mmx_supported = 2; // 0: no MMX; 1: MMX supported; 2: not tested - -int PNGAPI -png_dummy_mmx_support(void) __attribute__((noinline)); - -int PNGAPI -png_dummy_mmx_support(void) -{ - int result; -#if defined(PNG_MMX_CODE_SUPPORTED) // superfluous, but what the heck - __asm__ __volatile__ ( -#if defined(__x86_64__) - "pushq %%rbx \n\t" // rbx gets clobbered by CPUID instruction - "pushq %%rcx \n\t" // so does rcx... - "pushq %%rdx \n\t" // ...and rdx (but rcx & rdx safe on Linux) - "pushfq \n\t" // save Eflag to stack - "popq %%rax \n\t" // get Eflag from stack into rax - "movq %%rax, %%rcx \n\t" // make another copy of Eflag in rcx - "xorl $0x200000, %%eax \n\t" // toggle ID bit in Eflag (i.e., bit 21) - "pushq %%rax \n\t" // save modified Eflag back to stack - "popfq \n\t" // restore modified value to Eflag reg - "pushfq \n\t" // save Eflag to stack - "popq %%rax \n\t" // get Eflag from stack - "pushq %%rcx \n\t" // save original Eflag to stack - "popfq \n\t" // restore original Eflag -#else - "pushl %%ebx \n\t" // ebx gets clobbered by CPUID instruction - "pushl %%ecx \n\t" // so does ecx... - "pushl %%edx \n\t" // ...and edx (but ecx & edx safe on Linux) - "pushfl \n\t" // save Eflag to stack - "popl %%eax \n\t" // get Eflag from stack into eax - "movl %%eax, %%ecx \n\t" // make another copy of Eflag in ecx - "xorl $0x200000, %%eax \n\t" // toggle ID bit in Eflag (i.e., bit 21) - "pushl %%eax \n\t" // save modified Eflag back to stack - "popfl \n\t" // restore modified value to Eflag reg - "pushfl \n\t" // save Eflag to stack - "popl %%eax \n\t" // get Eflag from stack - "pushl %%ecx \n\t" // save original Eflag to stack - "popfl \n\t" // restore original Eflag -#endif - "xorl %%ecx, %%eax \n\t" // compare new Eflag with original Eflag - "jz 0f \n\t" // if same, CPUID instr. is not supported - - "xorl %%eax, %%eax \n\t" // set eax to zero -// ".byte 0x0f, 0xa2 \n\t" // CPUID instruction (two-byte opcode) - "cpuid \n\t" // get the CPU identification info - "cmpl $1, %%eax \n\t" // make sure eax return non-zero value - "jl 0f \n\t" // if eax is zero, MMX is not supported - - "xorl %%eax, %%eax \n\t" // set eax to zero and... - "incl %%eax \n\t" // ...increment eax to 1. This pair is - // faster than the instruction "mov eax, 1" - "cpuid \n\t" // get the CPU identification info again - "andl $0x800000, %%edx \n\t" // mask out all bits but MMX bit (23) - "cmpl $0, %%edx \n\t" // 0 = MMX not supported - "jz 0f \n\t" // non-zero = yes, MMX IS supported - - "movl $1, %%eax \n\t" // set return value to 1 - "jmp 1f \n\t" // DONE: have MMX support - - "0: \n\t" // .NOT_SUPPORTED: target label for jump instructions - "movl $0, %%eax \n\t" // set return value to 0 - "1: \n\t" // .RETURN: target label for jump instructions -#if defined(__x86_64__) - "popq %%rdx \n\t" // restore rdx - "popq %%rcx \n\t" // restore rcx - "popq %%rbx \n\t" // restore rbx -#else - "popl %%edx \n\t" // restore edx - "popl %%ecx \n\t" // restore ecx - "popl %%ebx \n\t" // restore ebx -#endif - -// "ret \n\t" // DONE: no MMX support - // (fall through to standard C "ret") - - : "=a" (result) // output list - - : // any variables used on input (none) - - // no clobber list -// , "%ebx", "%ecx", "%edx" // GRR: we handle these manually -// , "memory" // if write to a variable gcc thought was in a reg -// , "cc" // "condition codes" (flag bits) - ); - _mmx_supported = result; -#else - _mmx_supported = 0; -#endif /* PNG_MMX_CODE_SUPPORTED */ - - return _mmx_supported; -} -#endif diff --git a/src/libpng/pngget.c b/src/libpng/pngget.c deleted file mode 100644 index 3b89e6eb9..000000000 --- a/src/libpng/pngget.c +++ /dev/null @@ -1,939 +0,0 @@ - -/* pngget.c - retrieval of values from info struct - * - * Last changed in libpng 1.2.37 [June 4, 2009] - * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2009 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - */ - -#define PNG_INTERNAL -#include "png.h" -#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) - -png_uint_32 PNGAPI -png_get_valid(png_structp png_ptr, png_infop info_ptr, png_uint_32 flag) -{ - if (png_ptr != NULL && info_ptr != NULL) - return(info_ptr->valid & flag); - - else - return(0); -} - -png_uint_32 PNGAPI -png_get_rowbytes(png_structp png_ptr, png_infop info_ptr) -{ - if (png_ptr != NULL && info_ptr != NULL) - return(info_ptr->rowbytes); - - else - return(0); -} - -#if defined(PNG_INFO_IMAGE_SUPPORTED) -png_bytepp PNGAPI -png_get_rows(png_structp png_ptr, png_infop info_ptr) -{ - if (png_ptr != NULL && info_ptr != NULL) - return(info_ptr->row_pointers); - - else - return(0); -} -#endif - -#ifdef PNG_EASY_ACCESS_SUPPORTED -/* Easy access to info, added in libpng-0.99 */ -png_uint_32 PNGAPI -png_get_image_width(png_structp png_ptr, png_infop info_ptr) -{ - if (png_ptr != NULL && info_ptr != NULL) - return info_ptr->width; - - return (0); -} - -png_uint_32 PNGAPI -png_get_image_height(png_structp png_ptr, png_infop info_ptr) -{ - if (png_ptr != NULL && info_ptr != NULL) - return info_ptr->height; - - return (0); -} - -png_byte PNGAPI -png_get_bit_depth(png_structp png_ptr, png_infop info_ptr) -{ - if (png_ptr != NULL && info_ptr != NULL) - return info_ptr->bit_depth; - - return (0); -} - -png_byte PNGAPI -png_get_color_type(png_structp png_ptr, png_infop info_ptr) -{ - if (png_ptr != NULL && info_ptr != NULL) - return info_ptr->color_type; - - return (0); -} - -png_byte PNGAPI -png_get_filter_type(png_structp png_ptr, png_infop info_ptr) -{ - if (png_ptr != NULL && info_ptr != NULL) - return info_ptr->filter_type; - - return (0); -} - -png_byte PNGAPI -png_get_interlace_type(png_structp png_ptr, png_infop info_ptr) -{ - if (png_ptr != NULL && info_ptr != NULL) - return info_ptr->interlace_type; - - return (0); -} - -png_byte PNGAPI -png_get_compression_type(png_structp png_ptr, png_infop info_ptr) -{ - if (png_ptr != NULL && info_ptr != NULL) - return info_ptr->compression_type; - - return (0); -} - -png_uint_32 PNGAPI -png_get_x_pixels_per_meter(png_structp png_ptr, png_infop info_ptr) -{ - if (png_ptr != NULL && info_ptr != NULL) -#if defined(PNG_pHYs_SUPPORTED) - if (info_ptr->valid & PNG_INFO_pHYs) - { - png_debug1(1, "in %s retrieval function", "png_get_x_pixels_per_meter"); - - if (info_ptr->phys_unit_type != PNG_RESOLUTION_METER) - return (0); - - else - return (info_ptr->x_pixels_per_unit); - } -#else - return (0); -#endif - return (0); -} - -png_uint_32 PNGAPI -png_get_y_pixels_per_meter(png_structp png_ptr, png_infop info_ptr) -{ - if (png_ptr != NULL && info_ptr != NULL) -#if defined(PNG_pHYs_SUPPORTED) - if (info_ptr->valid & PNG_INFO_pHYs) - { - png_debug1(1, "in %s retrieval function", "png_get_y_pixels_per_meter"); - - if (info_ptr->phys_unit_type != PNG_RESOLUTION_METER) - return (0); - - else - return (info_ptr->y_pixels_per_unit); - } -#else - return (0); -#endif - return (0); -} - -png_uint_32 PNGAPI -png_get_pixels_per_meter(png_structp png_ptr, png_infop info_ptr) -{ - if (png_ptr != NULL && info_ptr != NULL) -#if defined(PNG_pHYs_SUPPORTED) - if (info_ptr->valid & PNG_INFO_pHYs) - { - png_debug1(1, "in %s retrieval function", "png_get_pixels_per_meter"); - - if (info_ptr->phys_unit_type != PNG_RESOLUTION_METER || - info_ptr->x_pixels_per_unit != info_ptr->y_pixels_per_unit) - return (0); - - else - return (info_ptr->x_pixels_per_unit); - } -#else - return (0); -#endif - return (0); -} - -#ifdef PNG_FLOATING_POINT_SUPPORTED -float PNGAPI -png_get_pixel_aspect_ratio(png_structp png_ptr, png_infop info_ptr) - { - if (png_ptr != NULL && info_ptr != NULL) -#if defined(PNG_pHYs_SUPPORTED) - - if (info_ptr->valid & PNG_INFO_pHYs) - { - png_debug1(1, "in %s retrieval function", "png_get_aspect_ratio"); - if (info_ptr->x_pixels_per_unit == 0) - return ((float)0.0); - else - return ((float)((float)info_ptr->y_pixels_per_unit - /(float)info_ptr->x_pixels_per_unit)); - } -#else - return (0.0); -#endif - return ((float)0.0); -} -#endif - -png_int_32 PNGAPI -png_get_x_offset_microns(png_structp png_ptr, png_infop info_ptr) -{ - if (png_ptr != NULL && info_ptr != NULL) -#if defined(PNG_oFFs_SUPPORTED) - - if (info_ptr->valid & PNG_INFO_oFFs) - { - png_debug1(1, "in %s retrieval function", "png_get_x_offset_microns"); - - if (info_ptr->offset_unit_type != PNG_OFFSET_MICROMETER) - return (0); - - else - return (info_ptr->x_offset); - } -#else - return (0); -#endif - return (0); -} - -png_int_32 PNGAPI -png_get_y_offset_microns(png_structp png_ptr, png_infop info_ptr) -{ - if (png_ptr != NULL && info_ptr != NULL) - -#if defined(PNG_oFFs_SUPPORTED) - if (info_ptr->valid & PNG_INFO_oFFs) - { - png_debug1(1, "in %s retrieval function", "png_get_y_offset_microns"); - - if (info_ptr->offset_unit_type != PNG_OFFSET_MICROMETER) - return (0); - - else - return (info_ptr->y_offset); - } -#else - return (0); -#endif - return (0); -} - -png_int_32 PNGAPI -png_get_x_offset_pixels(png_structp png_ptr, png_infop info_ptr) -{ - if (png_ptr != NULL && info_ptr != NULL) - -#if defined(PNG_oFFs_SUPPORTED) - if (info_ptr->valid & PNG_INFO_oFFs) - { - png_debug1(1, "in %s retrieval function", "png_get_x_offset_microns"); - - if (info_ptr->offset_unit_type != PNG_OFFSET_PIXEL) - return (0); - - else - return (info_ptr->x_offset); - } -#else - return (0); -#endif - return (0); -} - -png_int_32 PNGAPI -png_get_y_offset_pixels(png_structp png_ptr, png_infop info_ptr) -{ - if (png_ptr != NULL && info_ptr != NULL) - -#if defined(PNG_oFFs_SUPPORTED) - if (info_ptr->valid & PNG_INFO_oFFs) - { - png_debug1(1, "in %s retrieval function", "png_get_y_offset_microns"); - - if (info_ptr->offset_unit_type != PNG_OFFSET_PIXEL) - return (0); - - else - return (info_ptr->y_offset); - } -#else - return (0); -#endif - return (0); -} - -#if defined(PNG_INCH_CONVERSIONS) && defined(PNG_FLOATING_POINT_SUPPORTED) -png_uint_32 PNGAPI -png_get_pixels_per_inch(png_structp png_ptr, png_infop info_ptr) -{ - return ((png_uint_32)((float)png_get_pixels_per_meter(png_ptr, info_ptr) - *.0254 +.5)); -} - -png_uint_32 PNGAPI -png_get_x_pixels_per_inch(png_structp png_ptr, png_infop info_ptr) -{ - return ((png_uint_32)((float)png_get_x_pixels_per_meter(png_ptr, info_ptr) - *.0254 +.5)); -} - -png_uint_32 PNGAPI -png_get_y_pixels_per_inch(png_structp png_ptr, png_infop info_ptr) -{ - return ((png_uint_32)((float)png_get_y_pixels_per_meter(png_ptr, info_ptr) - *.0254 +.5)); -} - -float PNGAPI -png_get_x_offset_inches(png_structp png_ptr, png_infop info_ptr) -{ - return ((float)png_get_x_offset_microns(png_ptr, info_ptr) - *.00003937); -} - -float PNGAPI -png_get_y_offset_inches(png_structp png_ptr, png_infop info_ptr) -{ - return ((float)png_get_y_offset_microns(png_ptr, info_ptr) - *.00003937); -} - -#if defined(PNG_pHYs_SUPPORTED) -png_uint_32 PNGAPI -png_get_pHYs_dpi(png_structp png_ptr, png_infop info_ptr, - png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type) -{ - png_uint_32 retval = 0; - - if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_pHYs)) - { - png_debug1(1, "in %s retrieval function", "pHYs"); - if (res_x != NULL) - { - *res_x = info_ptr->x_pixels_per_unit; - retval |= PNG_INFO_pHYs; - } - if (res_y != NULL) - { - *res_y = info_ptr->y_pixels_per_unit; - retval |= PNG_INFO_pHYs; - } - if (unit_type != NULL) - { - *unit_type = (int)info_ptr->phys_unit_type; - retval |= PNG_INFO_pHYs; - if (*unit_type == 1) - { - if (res_x != NULL) *res_x = (png_uint_32)(*res_x * .0254 + .50); - if (res_y != NULL) *res_y = (png_uint_32)(*res_y * .0254 + .50); - } - } - } - return (retval); -} -#endif /* PNG_pHYs_SUPPORTED */ -#endif /* PNG_INCH_CONVERSIONS && PNG_FLOATING_POINT_SUPPORTED */ - -/* png_get_channels really belongs in here, too, but it's been around longer */ - -#endif /* PNG_EASY_ACCESS_SUPPORTED */ - -png_byte PNGAPI -png_get_channels(png_structp png_ptr, png_infop info_ptr) -{ - if (png_ptr != NULL && info_ptr != NULL) - return(info_ptr->channels); - else - return (0); -} - -png_bytep PNGAPI -png_get_signature(png_structp png_ptr, png_infop info_ptr) -{ - if (png_ptr != NULL && info_ptr != NULL) - return(info_ptr->signature); - else - return (NULL); -} - -#if defined(PNG_bKGD_SUPPORTED) -png_uint_32 PNGAPI -png_get_bKGD(png_structp png_ptr, png_infop info_ptr, - png_color_16p *background) -{ - if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_bKGD) - && background != NULL) - { - png_debug1(1, "in %s retrieval function", "bKGD"); - *background = &(info_ptr->background); - return (PNG_INFO_bKGD); - } - return (0); -} -#endif - -#if defined(PNG_cHRM_SUPPORTED) -#ifdef PNG_FLOATING_POINT_SUPPORTED -png_uint_32 PNGAPI -png_get_cHRM(png_structp png_ptr, png_infop info_ptr, - double *white_x, double *white_y, double *red_x, double *red_y, - double *green_x, double *green_y, double *blue_x, double *blue_y) -{ - if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_cHRM)) - { - png_debug1(1, "in %s retrieval function", "cHRM"); - if (white_x != NULL) - *white_x = (double)info_ptr->x_white; - if (white_y != NULL) - *white_y = (double)info_ptr->y_white; - if (red_x != NULL) - *red_x = (double)info_ptr->x_red; - if (red_y != NULL) - *red_y = (double)info_ptr->y_red; - if (green_x != NULL) - *green_x = (double)info_ptr->x_green; - if (green_y != NULL) - *green_y = (double)info_ptr->y_green; - if (blue_x != NULL) - *blue_x = (double)info_ptr->x_blue; - if (blue_y != NULL) - *blue_y = (double)info_ptr->y_blue; - return (PNG_INFO_cHRM); - } - return (0); -} -#endif -#ifdef PNG_FIXED_POINT_SUPPORTED -png_uint_32 PNGAPI -png_get_cHRM_fixed(png_structp png_ptr, png_infop info_ptr, - png_fixed_point *white_x, png_fixed_point *white_y, png_fixed_point *red_x, - png_fixed_point *red_y, png_fixed_point *green_x, png_fixed_point *green_y, - png_fixed_point *blue_x, png_fixed_point *blue_y) -{ - if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_cHRM)) - { - png_debug1(1, "in %s retrieval function", "cHRM"); - if (white_x != NULL) - *white_x = info_ptr->int_x_white; - if (white_y != NULL) - *white_y = info_ptr->int_y_white; - if (red_x != NULL) - *red_x = info_ptr->int_x_red; - if (red_y != NULL) - *red_y = info_ptr->int_y_red; - if (green_x != NULL) - *green_x = info_ptr->int_x_green; - if (green_y != NULL) - *green_y = info_ptr->int_y_green; - if (blue_x != NULL) - *blue_x = info_ptr->int_x_blue; - if (blue_y != NULL) - *blue_y = info_ptr->int_y_blue; - return (PNG_INFO_cHRM); - } - return (0); -} -#endif -#endif - -#if defined(PNG_gAMA_SUPPORTED) -#ifdef PNG_FLOATING_POINT_SUPPORTED -png_uint_32 PNGAPI -png_get_gAMA(png_structp png_ptr, png_infop info_ptr, double *file_gamma) -{ - if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_gAMA) - && file_gamma != NULL) - { - png_debug1(1, "in %s retrieval function", "gAMA"); - *file_gamma = (double)info_ptr->gamma; - return (PNG_INFO_gAMA); - } - return (0); -} -#endif -#ifdef PNG_FIXED_POINT_SUPPORTED -png_uint_32 PNGAPI -png_get_gAMA_fixed(png_structp png_ptr, png_infop info_ptr, - png_fixed_point *int_file_gamma) -{ - if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_gAMA) - && int_file_gamma != NULL) - { - png_debug1(1, "in %s retrieval function", "gAMA"); - *int_file_gamma = info_ptr->int_gamma; - return (PNG_INFO_gAMA); - } - return (0); -} -#endif -#endif - -#if defined(PNG_sRGB_SUPPORTED) -png_uint_32 PNGAPI -png_get_sRGB(png_structp png_ptr, png_infop info_ptr, int *file_srgb_intent) -{ - if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_sRGB) - && file_srgb_intent != NULL) - { - png_debug1(1, "in %s retrieval function", "sRGB"); - *file_srgb_intent = (int)info_ptr->srgb_intent; - return (PNG_INFO_sRGB); - } - return (0); -} -#endif - -#if defined(PNG_iCCP_SUPPORTED) -png_uint_32 PNGAPI -png_get_iCCP(png_structp png_ptr, png_infop info_ptr, - png_charpp name, int *compression_type, - png_charpp profile, png_uint_32 *proflen) -{ - if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_iCCP) - && name != NULL && profile != NULL && proflen != NULL) - { - png_debug1(1, "in %s retrieval function", "iCCP"); - *name = info_ptr->iccp_name; - *profile = info_ptr->iccp_profile; - /* Compression_type is a dummy so the API won't have to change - * if we introduce multiple compression types later. - */ - *proflen = (int)info_ptr->iccp_proflen; - *compression_type = (int)info_ptr->iccp_compression; - return (PNG_INFO_iCCP); - } - return (0); -} -#endif - -#if defined(PNG_sPLT_SUPPORTED) -png_uint_32 PNGAPI -png_get_sPLT(png_structp png_ptr, png_infop info_ptr, - png_sPLT_tpp spalettes) -{ - if (png_ptr != NULL && info_ptr != NULL && spalettes != NULL) - { - *spalettes = info_ptr->splt_palettes; - return ((png_uint_32)info_ptr->splt_palettes_num); - } - return (0); -} -#endif - -#if defined(PNG_hIST_SUPPORTED) -png_uint_32 PNGAPI -png_get_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_16p *hist) -{ - if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_hIST) - && hist != NULL) - { - png_debug1(1, "in %s retrieval function", "hIST"); - *hist = info_ptr->hist; - return (PNG_INFO_hIST); - } - return (0); -} -#endif - -png_uint_32 PNGAPI -png_get_IHDR(png_structp png_ptr, png_infop info_ptr, - png_uint_32 *width, png_uint_32 *height, int *bit_depth, - int *color_type, int *interlace_type, int *compression_type, - int *filter_type) - -{ - if (png_ptr != NULL && info_ptr != NULL && width != NULL && height != NULL && - bit_depth != NULL && color_type != NULL) - { - png_debug1(1, "in %s retrieval function", "IHDR"); - *width = info_ptr->width; - *height = info_ptr->height; - *bit_depth = info_ptr->bit_depth; - if (info_ptr->bit_depth < 1 || info_ptr->bit_depth > 16) - png_error(png_ptr, "Invalid bit depth"); - - *color_type = info_ptr->color_type; - - if (info_ptr->color_type > 6) - png_error(png_ptr, "Invalid color type"); - - if (compression_type != NULL) - *compression_type = info_ptr->compression_type; - - if (filter_type != NULL) - *filter_type = info_ptr->filter_type; - - if (interlace_type != NULL) - *interlace_type = info_ptr->interlace_type; - - /* Check for potential overflow of rowbytes */ - if (*width == 0 || *width > PNG_UINT_31_MAX) - png_error(png_ptr, "Invalid image width"); - - if (*height == 0 || *height > PNG_UINT_31_MAX) - png_error(png_ptr, "Invalid image height"); - - if (info_ptr->width > (PNG_UINT_32_MAX - >> 3) /* 8-byte RGBA pixels */ - - 64 /* bigrowbuf hack */ - - 1 /* filter byte */ - - 7*8 /* rounding of width to multiple of 8 pixels */ - - 8) /* extra max_pixel_depth pad */ - { - png_warning(png_ptr, - "Width too large for libpng to process image data."); - } - - return (1); - } - return (0); -} - -#if defined(PNG_oFFs_SUPPORTED) -png_uint_32 PNGAPI -png_get_oFFs(png_structp png_ptr, png_infop info_ptr, - png_int_32 *offset_x, png_int_32 *offset_y, int *unit_type) -{ - if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_oFFs) - && offset_x != NULL && offset_y != NULL && unit_type != NULL) - { - png_debug1(1, "in %s retrieval function", "oFFs"); - *offset_x = info_ptr->x_offset; - *offset_y = info_ptr->y_offset; - *unit_type = (int)info_ptr->offset_unit_type; - return (PNG_INFO_oFFs); - } - return (0); -} -#endif - -#if defined(PNG_pCAL_SUPPORTED) -png_uint_32 PNGAPI -png_get_pCAL(png_structp png_ptr, png_infop info_ptr, - png_charp *purpose, png_int_32 *X0, png_int_32 *X1, int *type, int *nparams, - png_charp *units, png_charpp *params) -{ - if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_pCAL) - && purpose != NULL && X0 != NULL && X1 != NULL && type != NULL && - nparams != NULL && units != NULL && params != NULL) - { - png_debug1(1, "in %s retrieval function", "pCAL"); - *purpose = info_ptr->pcal_purpose; - *X0 = info_ptr->pcal_X0; - *X1 = info_ptr->pcal_X1; - *type = (int)info_ptr->pcal_type; - *nparams = (int)info_ptr->pcal_nparams; - *units = info_ptr->pcal_units; - *params = info_ptr->pcal_params; - return (PNG_INFO_pCAL); - } - return (0); -} -#endif - -#if defined(PNG_sCAL_SUPPORTED) -#ifdef PNG_FLOATING_POINT_SUPPORTED -png_uint_32 PNGAPI -png_get_sCAL(png_structp png_ptr, png_infop info_ptr, - int *unit, double *width, double *height) -{ - if (png_ptr != NULL && info_ptr != NULL && - (info_ptr->valid & PNG_INFO_sCAL)) - { - *unit = info_ptr->scal_unit; - *width = info_ptr->scal_pixel_width; - *height = info_ptr->scal_pixel_height; - return (PNG_INFO_sCAL); - } - return(0); -} -#else -#ifdef PNG_FIXED_POINT_SUPPORTED -png_uint_32 PNGAPI -png_get_sCAL_s(png_structp png_ptr, png_infop info_ptr, - int *unit, png_charpp width, png_charpp height) -{ - if (png_ptr != NULL && info_ptr != NULL && - (info_ptr->valid & PNG_INFO_sCAL)) - { - *unit = info_ptr->scal_unit; - *width = info_ptr->scal_s_width; - *height = info_ptr->scal_s_height; - return (PNG_INFO_sCAL); - } - return(0); -} -#endif -#endif -#endif - -#if defined(PNG_pHYs_SUPPORTED) -png_uint_32 PNGAPI -png_get_pHYs(png_structp png_ptr, png_infop info_ptr, - png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type) -{ - png_uint_32 retval = 0; - - if (png_ptr != NULL && info_ptr != NULL && - (info_ptr->valid & PNG_INFO_pHYs)) - { - png_debug1(1, "in %s retrieval function", "pHYs"); - - if (res_x != NULL) - { - *res_x = info_ptr->x_pixels_per_unit; - retval |= PNG_INFO_pHYs; - } - - if (res_y != NULL) - { - *res_y = info_ptr->y_pixels_per_unit; - retval |= PNG_INFO_pHYs; - } - - if (unit_type != NULL) - { - *unit_type = (int)info_ptr->phys_unit_type; - retval |= PNG_INFO_pHYs; - } - } - return (retval); -} -#endif - -png_uint_32 PNGAPI -png_get_PLTE(png_structp png_ptr, png_infop info_ptr, png_colorp *palette, - int *num_palette) -{ - if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_PLTE) - && palette != NULL) - { - png_debug1(1, "in %s retrieval function", "PLTE"); - *palette = info_ptr->palette; - *num_palette = info_ptr->num_palette; - png_debug1(3, "num_palette = %d", *num_palette); - return (PNG_INFO_PLTE); - } - return (0); -} - -#if defined(PNG_sBIT_SUPPORTED) -png_uint_32 PNGAPI -png_get_sBIT(png_structp png_ptr, png_infop info_ptr, png_color_8p *sig_bit) -{ - if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_sBIT) - && sig_bit != NULL) - { - png_debug1(1, "in %s retrieval function", "sBIT"); - *sig_bit = &(info_ptr->sig_bit); - return (PNG_INFO_sBIT); - } - return (0); -} -#endif - -#if defined(PNG_TEXT_SUPPORTED) -png_uint_32 PNGAPI -png_get_text(png_structp png_ptr, png_infop info_ptr, png_textp *text_ptr, - int *num_text) -{ - if (png_ptr != NULL && info_ptr != NULL && info_ptr->num_text > 0) - { - png_debug1(1, "in %s retrieval function", - (png_ptr->chunk_name[0] == '\0' ? "text" - : (png_const_charp)png_ptr->chunk_name)); - - if (text_ptr != NULL) - *text_ptr = info_ptr->text; - - if (num_text != NULL) - *num_text = info_ptr->num_text; - - return ((png_uint_32)info_ptr->num_text); - } - if (num_text != NULL) - *num_text = 0; - return(0); -} -#endif - -#if defined(PNG_tIME_SUPPORTED) -png_uint_32 PNGAPI -png_get_tIME(png_structp png_ptr, png_infop info_ptr, png_timep *mod_time) -{ - if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_tIME) - && mod_time != NULL) - { - png_debug1(1, "in %s retrieval function", "tIME"); - *mod_time = &(info_ptr->mod_time); - return (PNG_INFO_tIME); - } - return (0); -} -#endif - -#if defined(PNG_tRNS_SUPPORTED) -png_uint_32 PNGAPI -png_get_tRNS(png_structp png_ptr, png_infop info_ptr, - png_bytep *trans, int *num_trans, png_color_16p *trans_values) -{ - png_uint_32 retval = 0; - if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_tRNS)) - { - png_debug1(1, "in %s retrieval function", "tRNS"); - if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - { - if (trans != NULL) - { - *trans = info_ptr->trans; - retval |= PNG_INFO_tRNS; - } - - if (trans_values != NULL) - *trans_values = &(info_ptr->trans_values); - } - else /* if (info_ptr->color_type != PNG_COLOR_TYPE_PALETTE) */ - { - if (trans_values != NULL) - { - *trans_values = &(info_ptr->trans_values); - retval |= PNG_INFO_tRNS; - } - - if (trans != NULL) - *trans = NULL; - } - if (num_trans != NULL) - { - *num_trans = info_ptr->num_trans; - retval |= PNG_INFO_tRNS; - } - } - return (retval); -} -#endif - -#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) -png_uint_32 PNGAPI -png_get_unknown_chunks(png_structp png_ptr, png_infop info_ptr, - png_unknown_chunkpp unknowns) -{ - if (png_ptr != NULL && info_ptr != NULL && unknowns != NULL) - { - *unknowns = info_ptr->unknown_chunks; - return ((png_uint_32)info_ptr->unknown_chunks_num); - } - return (0); -} -#endif - -#if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) -png_byte PNGAPI -png_get_rgb_to_gray_status (png_structp png_ptr) -{ - return (png_byte)(png_ptr? png_ptr->rgb_to_gray_status : 0); -} -#endif - -#if defined(PNG_USER_CHUNKS_SUPPORTED) -png_voidp PNGAPI -png_get_user_chunk_ptr(png_structp png_ptr) -{ - return (png_ptr? png_ptr->user_chunk_ptr : NULL); -} -#endif - -#ifdef PNG_WRITE_SUPPORTED -png_uint_32 PNGAPI -png_get_compression_buffer_size(png_structp png_ptr) -{ - return (png_uint_32)(png_ptr? png_ptr->zbuf_size : 0L); -} -#endif - -#ifdef PNG_ASSEMBLER_CODE_SUPPORTED -#ifndef PNG_1_0_X -/* This function was added to libpng 1.2.0 and should exist by default */ -png_uint_32 PNGAPI -png_get_asm_flags (png_structp png_ptr) -{ - /* Obsolete, to be removed from libpng-1.4.0 */ - return (png_ptr? 0L: 0L); -} - -/* This function was added to libpng 1.2.0 and should exist by default */ -png_uint_32 PNGAPI -png_get_asm_flagmask (int flag_select) -{ - /* Obsolete, to be removed from libpng-1.4.0 */ - flag_select=flag_select; - return 0L; -} - - /* GRR: could add this: && defined(PNG_MMX_CODE_SUPPORTED) */ -/* This function was added to libpng 1.2.0 */ -png_uint_32 PNGAPI -png_get_mmx_flagmask (int flag_select, int *compilerID) -{ - /* Obsolete, to be removed from libpng-1.4.0 */ - flag_select=flag_select; - *compilerID = -1; /* unknown (i.e., no asm/MMX code compiled) */ - return 0L; -} - -/* This function was added to libpng 1.2.0 */ -png_byte PNGAPI -png_get_mmx_bitdepth_threshold (png_structp png_ptr) -{ - /* Obsolete, to be removed from libpng-1.4.0 */ - return (png_ptr? 0: 0); -} - -/* This function was added to libpng 1.2.0 */ -png_uint_32 PNGAPI -png_get_mmx_rowbytes_threshold (png_structp png_ptr) -{ - /* Obsolete, to be removed from libpng-1.4.0 */ - return (png_ptr? 0L: 0L); -} -#endif /* ?PNG_1_0_X */ -#endif /* ?PNG_ASSEMBLER_CODE_SUPPORTED */ - -#ifdef PNG_SET_USER_LIMITS_SUPPORTED -/* These functions were added to libpng 1.2.6 */ -png_uint_32 PNGAPI -png_get_user_width_max (png_structp png_ptr) -{ - return (png_ptr? png_ptr->user_width_max : 0); -} -png_uint_32 PNGAPI -png_get_user_height_max (png_structp png_ptr) -{ - return (png_ptr? png_ptr->user_height_max : 0); -} -#endif /* ?PNG_SET_USER_LIMITS_SUPPORTED */ - - -#endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */ diff --git a/src/libpng/pngmem.c b/src/libpng/pngmem.c deleted file mode 100644 index 451dba31c..000000000 --- a/src/libpng/pngmem.c +++ /dev/null @@ -1,617 +0,0 @@ - -/* pngmem.c - stub functions for memory allocation - * - * Last changed in libpng 1.2.37 [June 4, 2009] - * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2009 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - * - * This file provides a location for all memory allocation. Users who - * need special memory handling are expected to supply replacement - * functions for png_malloc() and png_free(), and to use - * png_create_read_struct_2() and png_create_write_struct_2() to - * identify the replacement functions. - */ - -#define PNG_INTERNAL -#include "png.h" -#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) - -/* Borland DOS special memory handler */ -#if defined(__TURBOC__) && !defined(_Windows) && !defined(__FLAT__) -/* If you change this, be sure to change the one in png.h also */ - -/* Allocate memory for a png_struct. The malloc and memset can be replaced - by a single call to calloc() if this is thought to improve performance. */ -png_voidp /* PRIVATE */ -png_create_struct(int type) -{ -#ifdef PNG_USER_MEM_SUPPORTED - return (png_create_struct_2(type, png_malloc_ptr_NULL, png_voidp_NULL)); -} - -/* Alternate version of png_create_struct, for use with user-defined malloc. */ -png_voidp /* PRIVATE */ -png_create_struct_2(int type, png_malloc_ptr malloc_fn, png_voidp mem_ptr) -{ -#endif /* PNG_USER_MEM_SUPPORTED */ - png_size_t size; - png_voidp struct_ptr; - - if (type == PNG_STRUCT_INFO) - size = png_sizeof(png_info); - else if (type == PNG_STRUCT_PNG) - size = png_sizeof(png_struct); - else - return (png_get_copyright(NULL)); - -#ifdef PNG_USER_MEM_SUPPORTED - if (malloc_fn != NULL) - { - png_struct dummy_struct; - png_structp png_ptr = &dummy_struct; - png_ptr->mem_ptr=mem_ptr; - struct_ptr = (*(malloc_fn))(png_ptr, (png_uint_32)size); - } - else -#endif /* PNG_USER_MEM_SUPPORTED */ - struct_ptr = (png_voidp)farmalloc(size); - if (struct_ptr != NULL) - png_memset(struct_ptr, 0, size); - return (struct_ptr); -} - -/* Free memory allocated by a png_create_struct() call */ -void /* PRIVATE */ -png_destroy_struct(png_voidp struct_ptr) -{ -#ifdef PNG_USER_MEM_SUPPORTED - png_destroy_struct_2(struct_ptr, png_free_ptr_NULL, png_voidp_NULL); -} - -/* Free memory allocated by a png_create_struct() call */ -void /* PRIVATE */ -png_destroy_struct_2(png_voidp struct_ptr, png_free_ptr free_fn, - png_voidp mem_ptr) -{ -#endif - if (struct_ptr != NULL) - { -#ifdef PNG_USER_MEM_SUPPORTED - if (free_fn != NULL) - { - png_struct dummy_struct; - png_structp png_ptr = &dummy_struct; - png_ptr->mem_ptr=mem_ptr; - (*(free_fn))(png_ptr, struct_ptr); - return; - } -#endif /* PNG_USER_MEM_SUPPORTED */ - farfree (struct_ptr); - } -} - -/* Allocate memory. For reasonable files, size should never exceed - * 64K. However, zlib may allocate more then 64K if you don't tell - * it not to. See zconf.h and png.h for more information. zlib does - * need to allocate exactly 64K, so whatever you call here must - * have the ability to do that. - * - * Borland seems to have a problem in DOS mode for exactly 64K. - * It gives you a segment with an offset of 8 (perhaps to store its - * memory stuff). zlib doesn't like this at all, so we have to - * detect and deal with it. This code should not be needed in - * Windows or OS/2 modes, and only in 16 bit mode. This code has - * been updated by Alexander Lehmann for version 0.89 to waste less - * memory. - * - * Note that we can't use png_size_t for the "size" declaration, - * since on some systems a png_size_t is a 16-bit quantity, and as a - * result, we would be truncating potentially larger memory requests - * (which should cause a fatal error) and introducing major problems. - */ - -png_voidp PNGAPI -png_malloc(png_structp png_ptr, png_uint_32 size) -{ - png_voidp ret; - - if (png_ptr == NULL || size == 0) - return (NULL); - -#ifdef PNG_USER_MEM_SUPPORTED - if (png_ptr->malloc_fn != NULL) - ret = ((png_voidp)(*(png_ptr->malloc_fn))(png_ptr, (png_size_t)size)); - else - ret = (png_malloc_default(png_ptr, size)); - if (ret == NULL && (png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0) - png_error(png_ptr, "Out of memory!"); - return (ret); -} - -png_voidp PNGAPI -png_malloc_default(png_structp png_ptr, png_uint_32 size) -{ - png_voidp ret; -#endif /* PNG_USER_MEM_SUPPORTED */ - - if (png_ptr == NULL || size == 0) - return (NULL); - -#ifdef PNG_MAX_MALLOC_64K - if (size > (png_uint_32)65536L) - { - png_warning(png_ptr, "Cannot Allocate > 64K"); - ret = NULL; - } - else -#endif - - if (size != (size_t)size) - ret = NULL; - else if (size == (png_uint_32)65536L) - { - if (png_ptr->offset_table == NULL) - { - /* Try to see if we need to do any of this fancy stuff */ - ret = farmalloc(size); - if (ret == NULL || ((png_size_t)ret & 0xffff)) - { - int num_blocks; - png_uint_32 total_size; - png_bytep table; - int i; - png_byte huge * hptr; - - if (ret != NULL) - { - farfree(ret); - ret = NULL; - } - - if (png_ptr->zlib_window_bits > 14) - num_blocks = (int)(1 << (png_ptr->zlib_window_bits - 14)); - else - num_blocks = 1; - if (png_ptr->zlib_mem_level >= 7) - num_blocks += (int)(1 << (png_ptr->zlib_mem_level - 7)); - else - num_blocks++; - - total_size = ((png_uint_32)65536L) * (png_uint_32)num_blocks+16; - - table = farmalloc(total_size); - - if (table == NULL) - { -#ifndef PNG_USER_MEM_SUPPORTED - if ((png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0) - png_error(png_ptr, "Out Of Memory."); /* Note "O" and "M" */ - else - png_warning(png_ptr, "Out Of Memory."); -#endif - return (NULL); - } - - if ((png_size_t)table & 0xfff0) - { -#ifndef PNG_USER_MEM_SUPPORTED - if ((png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0) - png_error(png_ptr, - "Farmalloc didn't return normalized pointer"); - else - png_warning(png_ptr, - "Farmalloc didn't return normalized pointer"); -#endif - return (NULL); - } - - png_ptr->offset_table = table; - png_ptr->offset_table_ptr = farmalloc(num_blocks * - png_sizeof(png_bytep)); - - if (png_ptr->offset_table_ptr == NULL) - { -#ifndef PNG_USER_MEM_SUPPORTED - if ((png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0) - png_error(png_ptr, "Out Of memory."); /* Note "O" and "M" */ - else - png_warning(png_ptr, "Out Of memory."); -#endif - return (NULL); - } - - hptr = (png_byte huge *)table; - if ((png_size_t)hptr & 0xf) - { - hptr = (png_byte huge *)((long)(hptr) & 0xfffffff0L); - hptr = hptr + 16L; /* "hptr += 16L" fails on Turbo C++ 3.0 */ - } - for (i = 0; i < num_blocks; i++) - { - png_ptr->offset_table_ptr[i] = (png_bytep)hptr; - hptr = hptr + (png_uint_32)65536L; /* "+=" fails on TC++3.0 */ - } - - png_ptr->offset_table_number = num_blocks; - png_ptr->offset_table_count = 0; - png_ptr->offset_table_count_free = 0; - } - } - - if (png_ptr->offset_table_count >= png_ptr->offset_table_number) - { -#ifndef PNG_USER_MEM_SUPPORTED - if ((png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0) - png_error(png_ptr, "Out of Memory."); /* Note "o" and "M" */ - else - png_warning(png_ptr, "Out of Memory."); -#endif - return (NULL); - } - - ret = png_ptr->offset_table_ptr[png_ptr->offset_table_count++]; - } - else - ret = farmalloc(size); - -#ifndef PNG_USER_MEM_SUPPORTED - if (ret == NULL) - { - if ((png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0) - png_error(png_ptr, "Out of memory."); /* Note "o" and "m" */ - else - png_warning(png_ptr, "Out of memory."); /* Note "o" and "m" */ - } -#endif - - return (ret); -} - -/* Free a pointer allocated by png_malloc(). In the default - * configuration, png_ptr is not used, but is passed in case it - * is needed. If ptr is NULL, return without taking any action. - */ -void PNGAPI -png_free(png_structp png_ptr, png_voidp ptr) -{ - if (png_ptr == NULL || ptr == NULL) - return; - -#ifdef PNG_USER_MEM_SUPPORTED - if (png_ptr->free_fn != NULL) - { - (*(png_ptr->free_fn))(png_ptr, ptr); - return; - } - else - png_free_default(png_ptr, ptr); -} - -void PNGAPI -png_free_default(png_structp png_ptr, png_voidp ptr) -{ -#endif /* PNG_USER_MEM_SUPPORTED */ - - if (png_ptr == NULL || ptr == NULL) - return; - - if (png_ptr->offset_table != NULL) - { - int i; - - for (i = 0; i < png_ptr->offset_table_count; i++) - { - if (ptr == png_ptr->offset_table_ptr[i]) - { - ptr = NULL; - png_ptr->offset_table_count_free++; - break; - } - } - if (png_ptr->offset_table_count_free == png_ptr->offset_table_count) - { - farfree(png_ptr->offset_table); - farfree(png_ptr->offset_table_ptr); - png_ptr->offset_table = NULL; - png_ptr->offset_table_ptr = NULL; - } - } - - if (ptr != NULL) - { - farfree(ptr); - } -} - -#else /* Not the Borland DOS special memory handler */ - -/* Allocate memory for a png_struct or a png_info. The malloc and - memset can be replaced by a single call to calloc() if this is thought - to improve performance noticably. */ -png_voidp /* PRIVATE */ -png_create_struct(int type) -{ -#ifdef PNG_USER_MEM_SUPPORTED - return (png_create_struct_2(type, png_malloc_ptr_NULL, png_voidp_NULL)); -} - -/* Allocate memory for a png_struct or a png_info. The malloc and - memset can be replaced by a single call to calloc() if this is thought - to improve performance noticably. */ -png_voidp /* PRIVATE */ -png_create_struct_2(int type, png_malloc_ptr malloc_fn, png_voidp mem_ptr) -{ -#endif /* PNG_USER_MEM_SUPPORTED */ - png_size_t size; - png_voidp struct_ptr; - - if (type == PNG_STRUCT_INFO) - size = png_sizeof(png_info); - else if (type == PNG_STRUCT_PNG) - size = png_sizeof(png_struct); - else - return (NULL); - -#ifdef PNG_USER_MEM_SUPPORTED - if (malloc_fn != NULL) - { - png_struct dummy_struct; - png_structp png_ptr = &dummy_struct; - png_ptr->mem_ptr=mem_ptr; - struct_ptr = (*(malloc_fn))(png_ptr, size); - if (struct_ptr != NULL) - png_memset(struct_ptr, 0, size); - return (struct_ptr); - } -#endif /* PNG_USER_MEM_SUPPORTED */ - -#if defined(__TURBOC__) && !defined(__FLAT__) - struct_ptr = (png_voidp)farmalloc(size); -#else -# if defined(_MSC_VER) && defined(MAXSEG_64K) - struct_ptr = (png_voidp)halloc(size, 1); -# else - struct_ptr = (png_voidp)malloc(size); -# endif -#endif - if (struct_ptr != NULL) - png_memset(struct_ptr, 0, size); - - return (struct_ptr); -} - - -/* Free memory allocated by a png_create_struct() call */ -void /* PRIVATE */ -png_destroy_struct(png_voidp struct_ptr) -{ -#ifdef PNG_USER_MEM_SUPPORTED - png_destroy_struct_2(struct_ptr, png_free_ptr_NULL, png_voidp_NULL); -} - -/* Free memory allocated by a png_create_struct() call */ -void /* PRIVATE */ -png_destroy_struct_2(png_voidp struct_ptr, png_free_ptr free_fn, - png_voidp mem_ptr) -{ -#endif /* PNG_USER_MEM_SUPPORTED */ - if (struct_ptr != NULL) - { -#ifdef PNG_USER_MEM_SUPPORTED - if (free_fn != NULL) - { - png_struct dummy_struct; - png_structp png_ptr = &dummy_struct; - png_ptr->mem_ptr=mem_ptr; - (*(free_fn))(png_ptr, struct_ptr); - return; - } -#endif /* PNG_USER_MEM_SUPPORTED */ -#if defined(__TURBOC__) && !defined(__FLAT__) - farfree(struct_ptr); -#else -# if defined(_MSC_VER) && defined(MAXSEG_64K) - hfree(struct_ptr); -# else - free(struct_ptr); -# endif -#endif - } -} - -/* Allocate memory. For reasonable files, size should never exceed - * 64K. However, zlib may allocate more then 64K if you don't tell - * it not to. See zconf.h and png.h for more information. zlib does - * need to allocate exactly 64K, so whatever you call here must - * have the ability to do that. - */ - - -png_voidp PNGAPI -png_malloc(png_structp png_ptr, png_uint_32 size) -{ - png_voidp ret; - -#ifdef PNG_USER_MEM_SUPPORTED - if (png_ptr == NULL || size == 0) - return (NULL); - - if (png_ptr->malloc_fn != NULL) - ret = ((png_voidp)(*(png_ptr->malloc_fn))(png_ptr, (png_size_t)size)); - else - ret = (png_malloc_default(png_ptr, size)); - if (ret == NULL && (png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0) - png_error(png_ptr, "Out of Memory!"); - return (ret); -} - -png_voidp PNGAPI -png_malloc_default(png_structp png_ptr, png_uint_32 size) -{ - png_voidp ret; -#endif /* PNG_USER_MEM_SUPPORTED */ - - if (png_ptr == NULL || size == 0) - return (NULL); - -#ifdef PNG_MAX_MALLOC_64K - if (size > (png_uint_32)65536L) - { -#ifndef PNG_USER_MEM_SUPPORTED - if ((png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0) - png_error(png_ptr, "Cannot Allocate > 64K"); - else -#endif - return NULL; - } -#endif - - /* Check for overflow */ -#if defined(__TURBOC__) && !defined(__FLAT__) - if (size != (unsigned long)size) - ret = NULL; - else - ret = farmalloc(size); -#else -# if defined(_MSC_VER) && defined(MAXSEG_64K) - if (size != (unsigned long)size) - ret = NULL; - else - ret = halloc(size, 1); -# else - if (size != (size_t)size) - ret = NULL; - else - ret = malloc((size_t)size); -# endif -#endif - -#ifndef PNG_USER_MEM_SUPPORTED - if (ret == NULL && (png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0) - png_error(png_ptr, "Out of Memory"); -#endif - - return (ret); -} - -/* Free a pointer allocated by png_malloc(). If ptr is NULL, return - * without taking any action. - */ -void PNGAPI -png_free(png_structp png_ptr, png_voidp ptr) -{ - if (png_ptr == NULL || ptr == NULL) - return; - -#ifdef PNG_USER_MEM_SUPPORTED - if (png_ptr->free_fn != NULL) - { - (*(png_ptr->free_fn))(png_ptr, ptr); - return; - } - else - png_free_default(png_ptr, ptr); -} -void PNGAPI -png_free_default(png_structp png_ptr, png_voidp ptr) -{ - if (png_ptr == NULL || ptr == NULL) - return; - -#endif /* PNG_USER_MEM_SUPPORTED */ - -#if defined(__TURBOC__) && !defined(__FLAT__) - farfree(ptr); -#else -# if defined(_MSC_VER) && defined(MAXSEG_64K) - hfree(ptr); -# else - free(ptr); -# endif -#endif -} - -#endif /* Not Borland DOS special memory handler */ - -#if defined(PNG_1_0_X) -# define png_malloc_warn png_malloc -#else -/* This function was added at libpng version 1.2.3. The png_malloc_warn() - * function will set up png_malloc() to issue a png_warning and return NULL - * instead of issuing a png_error, if it fails to allocate the requested - * memory. - */ -png_voidp PNGAPI -png_malloc_warn(png_structp png_ptr, png_uint_32 size) -{ - png_voidp ptr; - png_uint_32 save_flags; - if (png_ptr == NULL) - return (NULL); - - save_flags = png_ptr->flags; - png_ptr->flags|=PNG_FLAG_MALLOC_NULL_MEM_OK; - ptr = (png_voidp)png_malloc((png_structp)png_ptr, size); - png_ptr->flags=save_flags; - return(ptr); -} -#endif - -png_voidp PNGAPI -png_memcpy_check (png_structp png_ptr, png_voidp s1, png_voidp s2, - png_uint_32 length) -{ - png_size_t size; - - size = (png_size_t)length; - if ((png_uint_32)size != length) - png_error(png_ptr, "Overflow in png_memcpy_check."); - - return(png_memcpy (s1, s2, size)); -} - -png_voidp PNGAPI -png_memset_check (png_structp png_ptr, png_voidp s1, int value, - png_uint_32 length) -{ - png_size_t size; - - size = (png_size_t)length; - if ((png_uint_32)size != length) - png_error(png_ptr, "Overflow in png_memset_check."); - - return (png_memset (s1, value, size)); - -} - -#ifdef PNG_USER_MEM_SUPPORTED -/* This function is called when the application wants to use another method - * of allocating and freeing memory. - */ -void PNGAPI -png_set_mem_fn(png_structp png_ptr, png_voidp mem_ptr, png_malloc_ptr - malloc_fn, png_free_ptr free_fn) -{ - if (png_ptr != NULL) - { - png_ptr->mem_ptr = mem_ptr; - png_ptr->malloc_fn = malloc_fn; - png_ptr->free_fn = free_fn; - } -} - -/* This function returns a pointer to the mem_ptr associated with the user - * functions. The application should free any memory associated with this - * pointer before png_write_destroy and png_read_destroy are called. - */ -png_voidp PNGAPI -png_get_mem_ptr(png_structp png_ptr) -{ - if (png_ptr == NULL) - return (NULL); - return ((png_voidp)png_ptr->mem_ptr); -} -#endif /* PNG_USER_MEM_SUPPORTED */ -#endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */ diff --git a/src/libpng/pngpread.c b/src/libpng/pngpread.c deleted file mode 100644 index 5c73923fe..000000000 --- a/src/libpng/pngpread.c +++ /dev/null @@ -1,1724 +0,0 @@ - -/* pngpread.c - read a png file in push mode - * - * Last changed in libpng 1.2.37 [June 4, 2009] - * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2009 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - */ - -#define PNG_INTERNAL -#include "png.h" -#ifdef PNG_PROGRESSIVE_READ_SUPPORTED - -/* Push model modes */ -#define PNG_READ_SIG_MODE 0 -#define PNG_READ_CHUNK_MODE 1 -#define PNG_READ_IDAT_MODE 2 -#define PNG_SKIP_MODE 3 -#define PNG_READ_tEXt_MODE 4 -#define PNG_READ_zTXt_MODE 5 -#define PNG_READ_DONE_MODE 6 -#define PNG_READ_iTXt_MODE 7 -#define PNG_ERROR_MODE 8 - -void PNGAPI -png_process_data(png_structp png_ptr, png_infop info_ptr, - png_bytep buffer, png_size_t buffer_size) -{ - if (png_ptr == NULL || info_ptr == NULL) - return; - - png_push_restore_buffer(png_ptr, buffer, buffer_size); - - while (png_ptr->buffer_size) - { - png_process_some_data(png_ptr, info_ptr); - } -} - -/* What we do with the incoming data depends on what we were previously - * doing before we ran out of data... - */ -void /* PRIVATE */ -png_process_some_data(png_structp png_ptr, png_infop info_ptr) -{ - if (png_ptr == NULL) - return; - - switch (png_ptr->process_mode) - { - case PNG_READ_SIG_MODE: - { - png_push_read_sig(png_ptr, info_ptr); - break; - } - - case PNG_READ_CHUNK_MODE: - { - png_push_read_chunk(png_ptr, info_ptr); - break; - } - - case PNG_READ_IDAT_MODE: - { - png_push_read_IDAT(png_ptr); - break; - } - -#if defined(PNG_READ_tEXt_SUPPORTED) - case PNG_READ_tEXt_MODE: - { - png_push_read_tEXt(png_ptr, info_ptr); - break; - } - -#endif -#if defined(PNG_READ_zTXt_SUPPORTED) - case PNG_READ_zTXt_MODE: - { - png_push_read_zTXt(png_ptr, info_ptr); - break; - } - -#endif -#if defined(PNG_READ_iTXt_SUPPORTED) - case PNG_READ_iTXt_MODE: - { - png_push_read_iTXt(png_ptr, info_ptr); - break; - } - -#endif - case PNG_SKIP_MODE: - { - png_push_crc_finish(png_ptr); - break; - } - - default: - { - png_ptr->buffer_size = 0; - break; - } - } -} - -/* Read any remaining signature bytes from the stream and compare them with - * the correct PNG signature. It is possible that this routine is called - * with bytes already read from the signature, either because they have been - * checked by the calling application, or because of multiple calls to this - * routine. - */ -void /* PRIVATE */ -png_push_read_sig(png_structp png_ptr, png_infop info_ptr) -{ - png_size_t num_checked = png_ptr->sig_bytes, - num_to_check = 8 - num_checked; - - if (png_ptr->buffer_size < num_to_check) - { - num_to_check = png_ptr->buffer_size; - } - - png_push_fill_buffer(png_ptr, &(info_ptr->signature[num_checked]), - num_to_check); - png_ptr->sig_bytes = (png_byte)(png_ptr->sig_bytes + num_to_check); - - if (png_sig_cmp(info_ptr->signature, num_checked, num_to_check)) - { - if (num_checked < 4 && - png_sig_cmp(info_ptr->signature, num_checked, num_to_check - 4)) - png_error(png_ptr, "Not a PNG file"); - else - png_error(png_ptr, "PNG file corrupted by ASCII conversion"); - } - else - { - if (png_ptr->sig_bytes >= 8) - { - png_ptr->process_mode = PNG_READ_CHUNK_MODE; - } - } -} - -void /* PRIVATE */ -png_push_read_chunk(png_structp png_ptr, png_infop info_ptr) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_CONST PNG_IHDR; - PNG_CONST PNG_IDAT; - PNG_CONST PNG_IEND; - PNG_CONST PNG_PLTE; -#if defined(PNG_READ_bKGD_SUPPORTED) - PNG_CONST PNG_bKGD; -#endif -#if defined(PNG_READ_cHRM_SUPPORTED) - PNG_CONST PNG_cHRM; -#endif -#if defined(PNG_READ_gAMA_SUPPORTED) - PNG_CONST PNG_gAMA; -#endif -#if defined(PNG_READ_hIST_SUPPORTED) - PNG_CONST PNG_hIST; -#endif -#if defined(PNG_READ_iCCP_SUPPORTED) - PNG_CONST PNG_iCCP; -#endif -#if defined(PNG_READ_iTXt_SUPPORTED) - PNG_CONST PNG_iTXt; -#endif -#if defined(PNG_READ_oFFs_SUPPORTED) - PNG_CONST PNG_oFFs; -#endif -#if defined(PNG_READ_pCAL_SUPPORTED) - PNG_CONST PNG_pCAL; -#endif -#if defined(PNG_READ_pHYs_SUPPORTED) - PNG_CONST PNG_pHYs; -#endif -#if defined(PNG_READ_sBIT_SUPPORTED) - PNG_CONST PNG_sBIT; -#endif -#if defined(PNG_READ_sCAL_SUPPORTED) - PNG_CONST PNG_sCAL; -#endif -#if defined(PNG_READ_sRGB_SUPPORTED) - PNG_CONST PNG_sRGB; -#endif -#if defined(PNG_READ_sPLT_SUPPORTED) - PNG_CONST PNG_sPLT; -#endif -#if defined(PNG_READ_tEXt_SUPPORTED) - PNG_CONST PNG_tEXt; -#endif -#if defined(PNG_READ_tIME_SUPPORTED) - PNG_CONST PNG_tIME; -#endif -#if defined(PNG_READ_tRNS_SUPPORTED) - PNG_CONST PNG_tRNS; -#endif -#if defined(PNG_READ_zTXt_SUPPORTED) - PNG_CONST PNG_zTXt; -#endif -#endif /* PNG_USE_LOCAL_ARRAYS */ - /* First we make sure we have enough data for the 4 byte chunk name - * and the 4 byte chunk length before proceeding with decoding the - * chunk data. To fully decode each of these chunks, we also make - * sure we have enough data in the buffer for the 4 byte CRC at the - * end of every chunk (except IDAT, which is handled separately). - */ - if (!(png_ptr->mode & PNG_HAVE_CHUNK_HEADER)) - { - png_byte chunk_length[4]; - - if (png_ptr->buffer_size < 8) - { - png_push_save_buffer(png_ptr); - return; - } - - png_push_fill_buffer(png_ptr, chunk_length, 4); - png_ptr->push_length = png_get_uint_31(png_ptr, chunk_length); - png_reset_crc(png_ptr); - png_crc_read(png_ptr, png_ptr->chunk_name, 4); - png_check_chunk_name(png_ptr, png_ptr->chunk_name); - png_ptr->mode |= PNG_HAVE_CHUNK_HEADER; - } - - if (!png_memcmp(png_ptr->chunk_name, png_IDAT, 4)) - if (png_ptr->mode & PNG_AFTER_IDAT) - png_ptr->mode |= PNG_HAVE_CHUNK_AFTER_IDAT; - - if (!png_memcmp(png_ptr->chunk_name, png_IHDR, 4)) - { - if (png_ptr->push_length != 13) - png_error(png_ptr, "Invalid IHDR length"); - - if (png_ptr->push_length + 4 > png_ptr->buffer_size) - { - png_push_save_buffer(png_ptr); - return; - } - - png_handle_IHDR(png_ptr, info_ptr, png_ptr->push_length); - } - - else if (!png_memcmp(png_ptr->chunk_name, png_IEND, 4)) - { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) - { - png_push_save_buffer(png_ptr); - return; - } - - png_handle_IEND(png_ptr, info_ptr, png_ptr->push_length); - - png_ptr->process_mode = PNG_READ_DONE_MODE; - png_push_have_end(png_ptr, info_ptr); - } - -#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED - else if (png_handle_as_unknown(png_ptr, png_ptr->chunk_name)) - { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) - { - png_push_save_buffer(png_ptr); - return; - } - - if (!png_memcmp(png_ptr->chunk_name, png_IDAT, 4)) - png_ptr->mode |= PNG_HAVE_IDAT; - - png_handle_unknown(png_ptr, info_ptr, png_ptr->push_length); - - if (!png_memcmp(png_ptr->chunk_name, png_PLTE, 4)) - png_ptr->mode |= PNG_HAVE_PLTE; - - else if (!png_memcmp(png_ptr->chunk_name, png_IDAT, 4)) - { - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before IDAT"); - - else if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE && - !(png_ptr->mode & PNG_HAVE_PLTE)) - png_error(png_ptr, "Missing PLTE before IDAT"); - } - } - -#endif - else if (!png_memcmp(png_ptr->chunk_name, png_PLTE, 4)) - { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) - { - png_push_save_buffer(png_ptr); - return; - } - png_handle_PLTE(png_ptr, info_ptr, png_ptr->push_length); - } - - else if (!png_memcmp(png_ptr->chunk_name, png_IDAT, 4)) - { - /* If we reach an IDAT chunk, this means we have read all of the - * header chunks, and we can start reading the image (or if this - * is called after the image has been read - we have an error). - */ - - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before IDAT"); - - else if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE && - !(png_ptr->mode & PNG_HAVE_PLTE)) - png_error(png_ptr, "Missing PLTE before IDAT"); - - if (png_ptr->mode & PNG_HAVE_IDAT) - { - if (!(png_ptr->mode & PNG_HAVE_CHUNK_AFTER_IDAT)) - if (png_ptr->push_length == 0) - return; - - if (png_ptr->mode & PNG_AFTER_IDAT) - png_error(png_ptr, "Too many IDAT's found"); - } - - png_ptr->idat_size = png_ptr->push_length; - png_ptr->mode |= PNG_HAVE_IDAT; - png_ptr->process_mode = PNG_READ_IDAT_MODE; - png_push_have_info(png_ptr, info_ptr); - png_ptr->zstream.avail_out = (uInt)png_ptr->irowbytes; - png_ptr->zstream.next_out = png_ptr->row_buf; - return; - } - -#if defined(PNG_READ_gAMA_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_gAMA, 4)) - { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) - { - png_push_save_buffer(png_ptr); - return; - } - - png_handle_gAMA(png_ptr, info_ptr, png_ptr->push_length); - } - -#endif -#if defined(PNG_READ_sBIT_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_sBIT, 4)) - { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) - { - png_push_save_buffer(png_ptr); - return; - } - - png_handle_sBIT(png_ptr, info_ptr, png_ptr->push_length); - } - -#endif -#if defined(PNG_READ_cHRM_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_cHRM, 4)) - { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) - { - png_push_save_buffer(png_ptr); - return; - } - - png_handle_cHRM(png_ptr, info_ptr, png_ptr->push_length); - } - -#endif -#if defined(PNG_READ_sRGB_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_sRGB, 4)) - { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) - { - png_push_save_buffer(png_ptr); - return; - } - - png_handle_sRGB(png_ptr, info_ptr, png_ptr->push_length); - } - -#endif -#if defined(PNG_READ_iCCP_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_iCCP, 4)) - { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) - { - png_push_save_buffer(png_ptr); - return; - } - - png_handle_iCCP(png_ptr, info_ptr, png_ptr->push_length); - } - -#endif -#if defined(PNG_READ_sPLT_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_sPLT, 4)) - { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) - { - png_push_save_buffer(png_ptr); - return; - } - - png_handle_sPLT(png_ptr, info_ptr, png_ptr->push_length); - } - -#endif -#if defined(PNG_READ_tRNS_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_tRNS, 4)) - { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) - { - png_push_save_buffer(png_ptr); - return; - } - - png_handle_tRNS(png_ptr, info_ptr, png_ptr->push_length); - } - -#endif -#if defined(PNG_READ_bKGD_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_bKGD, 4)) - { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) - { - png_push_save_buffer(png_ptr); - return; - } - - png_handle_bKGD(png_ptr, info_ptr, png_ptr->push_length); - } - -#endif -#if defined(PNG_READ_hIST_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_hIST, 4)) - { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) - { - png_push_save_buffer(png_ptr); - return; - } - - png_handle_hIST(png_ptr, info_ptr, png_ptr->push_length); - } - -#endif -#if defined(PNG_READ_pHYs_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_pHYs, 4)) - { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) - { - png_push_save_buffer(png_ptr); - return; - } - - png_handle_pHYs(png_ptr, info_ptr, png_ptr->push_length); - } - -#endif -#if defined(PNG_READ_oFFs_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_oFFs, 4)) - { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) - { - png_push_save_buffer(png_ptr); - return; - } - - png_handle_oFFs(png_ptr, info_ptr, png_ptr->push_length); - } -#endif - -#if defined(PNG_READ_pCAL_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_pCAL, 4)) - { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) - { - png_push_save_buffer(png_ptr); - return; - } - - png_handle_pCAL(png_ptr, info_ptr, png_ptr->push_length); - } - -#endif -#if defined(PNG_READ_sCAL_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_sCAL, 4)) - { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) - { - png_push_save_buffer(png_ptr); - return; - } - - png_handle_sCAL(png_ptr, info_ptr, png_ptr->push_length); - } - -#endif -#if defined(PNG_READ_tIME_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_tIME, 4)) - { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) - { - png_push_save_buffer(png_ptr); - return; - } - - png_handle_tIME(png_ptr, info_ptr, png_ptr->push_length); - } - -#endif -#if defined(PNG_READ_tEXt_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_tEXt, 4)) - { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) - { - png_push_save_buffer(png_ptr); - return; - } - - png_push_handle_tEXt(png_ptr, info_ptr, png_ptr->push_length); - } - -#endif -#if defined(PNG_READ_zTXt_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_zTXt, 4)) - { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) - { - png_push_save_buffer(png_ptr); - return; - } - - png_push_handle_zTXt(png_ptr, info_ptr, png_ptr->push_length); - } - -#endif -#if defined(PNG_READ_iTXt_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_iTXt, 4)) - { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) - { - png_push_save_buffer(png_ptr); - return; - } - - png_push_handle_iTXt(png_ptr, info_ptr, png_ptr->push_length); - } - -#endif - else - { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) - { - png_push_save_buffer(png_ptr); - return; - } - png_push_handle_unknown(png_ptr, info_ptr, png_ptr->push_length); - } - - png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER; -} - -void /* PRIVATE */ -png_push_crc_skip(png_structp png_ptr, png_uint_32 skip) -{ - png_ptr->process_mode = PNG_SKIP_MODE; - png_ptr->skip_length = skip; -} - -void /* PRIVATE */ -png_push_crc_finish(png_structp png_ptr) -{ - if (png_ptr->skip_length && png_ptr->save_buffer_size) - { - png_size_t save_size; - - if (png_ptr->skip_length < (png_uint_32)png_ptr->save_buffer_size) - save_size = (png_size_t)png_ptr->skip_length; - else - save_size = png_ptr->save_buffer_size; - - png_calculate_crc(png_ptr, png_ptr->save_buffer_ptr, save_size); - - png_ptr->skip_length -= save_size; - png_ptr->buffer_size -= save_size; - png_ptr->save_buffer_size -= save_size; - png_ptr->save_buffer_ptr += save_size; - } - if (png_ptr->skip_length && png_ptr->current_buffer_size) - { - png_size_t save_size; - - if (png_ptr->skip_length < (png_uint_32)png_ptr->current_buffer_size) - save_size = (png_size_t)png_ptr->skip_length; - else - save_size = png_ptr->current_buffer_size; - - png_calculate_crc(png_ptr, png_ptr->current_buffer_ptr, save_size); - - png_ptr->skip_length -= save_size; - png_ptr->buffer_size -= save_size; - png_ptr->current_buffer_size -= save_size; - png_ptr->current_buffer_ptr += save_size; - } - if (!png_ptr->skip_length) - { - if (png_ptr->buffer_size < 4) - { - png_push_save_buffer(png_ptr); - return; - } - - png_crc_finish(png_ptr, 0); - png_ptr->process_mode = PNG_READ_CHUNK_MODE; - } -} - -void PNGAPI -png_push_fill_buffer(png_structp png_ptr, png_bytep buffer, png_size_t length) -{ - png_bytep ptr; - - if (png_ptr == NULL) - return; - - ptr = buffer; - if (png_ptr->save_buffer_size) - { - png_size_t save_size; - - if (length < png_ptr->save_buffer_size) - save_size = length; - else - save_size = png_ptr->save_buffer_size; - - png_memcpy(ptr, png_ptr->save_buffer_ptr, save_size); - length -= save_size; - ptr += save_size; - png_ptr->buffer_size -= save_size; - png_ptr->save_buffer_size -= save_size; - png_ptr->save_buffer_ptr += save_size; - } - if (length && png_ptr->current_buffer_size) - { - png_size_t save_size; - - if (length < png_ptr->current_buffer_size) - save_size = length; - - else - save_size = png_ptr->current_buffer_size; - - png_memcpy(ptr, png_ptr->current_buffer_ptr, save_size); - png_ptr->buffer_size -= save_size; - png_ptr->current_buffer_size -= save_size; - png_ptr->current_buffer_ptr += save_size; - } -} - -void /* PRIVATE */ -png_push_save_buffer(png_structp png_ptr) -{ - if (png_ptr->save_buffer_size) - { - if (png_ptr->save_buffer_ptr != png_ptr->save_buffer) - { - png_size_t i, istop; - png_bytep sp; - png_bytep dp; - - istop = png_ptr->save_buffer_size; - for (i = 0, sp = png_ptr->save_buffer_ptr, dp = png_ptr->save_buffer; - i < istop; i++, sp++, dp++) - { - *dp = *sp; - } - } - } - if (png_ptr->save_buffer_size + png_ptr->current_buffer_size > - png_ptr->save_buffer_max) - { - png_size_t new_max; - png_bytep old_buffer; - - if (png_ptr->save_buffer_size > PNG_SIZE_MAX - - (png_ptr->current_buffer_size + 256)) - { - png_error(png_ptr, "Potential overflow of save_buffer"); - } - - new_max = png_ptr->save_buffer_size + png_ptr->current_buffer_size + 256; - old_buffer = png_ptr->save_buffer; - png_ptr->save_buffer = (png_bytep)png_malloc(png_ptr, - (png_uint_32)new_max); - png_memcpy(png_ptr->save_buffer, old_buffer, png_ptr->save_buffer_size); - png_free(png_ptr, old_buffer); - png_ptr->save_buffer_max = new_max; - } - if (png_ptr->current_buffer_size) - { - png_memcpy(png_ptr->save_buffer + png_ptr->save_buffer_size, - png_ptr->current_buffer_ptr, png_ptr->current_buffer_size); - png_ptr->save_buffer_size += png_ptr->current_buffer_size; - png_ptr->current_buffer_size = 0; - } - png_ptr->save_buffer_ptr = png_ptr->save_buffer; - png_ptr->buffer_size = 0; -} - -void /* PRIVATE */ -png_push_restore_buffer(png_structp png_ptr, png_bytep buffer, - png_size_t buffer_length) -{ - png_ptr->current_buffer = buffer; - png_ptr->current_buffer_size = buffer_length; - png_ptr->buffer_size = buffer_length + png_ptr->save_buffer_size; - png_ptr->current_buffer_ptr = png_ptr->current_buffer; -} - -void /* PRIVATE */ -png_push_read_IDAT(png_structp png_ptr) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_CONST PNG_IDAT; -#endif - if (!(png_ptr->mode & PNG_HAVE_CHUNK_HEADER)) - { - png_byte chunk_length[4]; - - if (png_ptr->buffer_size < 8) - { - png_push_save_buffer(png_ptr); - return; - } - - png_push_fill_buffer(png_ptr, chunk_length, 4); - png_ptr->push_length = png_get_uint_31(png_ptr, chunk_length); - png_reset_crc(png_ptr); - png_crc_read(png_ptr, png_ptr->chunk_name, 4); - png_ptr->mode |= PNG_HAVE_CHUNK_HEADER; - - if (png_memcmp(png_ptr->chunk_name, png_IDAT, 4)) - { - png_ptr->process_mode = PNG_READ_CHUNK_MODE; - if (!(png_ptr->flags & PNG_FLAG_ZLIB_FINISHED)) - png_error(png_ptr, "Not enough compressed data"); - return; - } - - png_ptr->idat_size = png_ptr->push_length; - } - if (png_ptr->idat_size && png_ptr->save_buffer_size) - { - png_size_t save_size; - - if (png_ptr->idat_size < (png_uint_32)png_ptr->save_buffer_size) - { - save_size = (png_size_t)png_ptr->idat_size; - - /* Check for overflow */ - if ((png_uint_32)save_size != png_ptr->idat_size) - png_error(png_ptr, "save_size overflowed in pngpread"); - } - else - save_size = png_ptr->save_buffer_size; - - png_calculate_crc(png_ptr, png_ptr->save_buffer_ptr, save_size); - - if (!(png_ptr->flags & PNG_FLAG_ZLIB_FINISHED)) - png_process_IDAT_data(png_ptr, png_ptr->save_buffer_ptr, save_size); - - png_ptr->idat_size -= save_size; - png_ptr->buffer_size -= save_size; - png_ptr->save_buffer_size -= save_size; - png_ptr->save_buffer_ptr += save_size; - } - if (png_ptr->idat_size && png_ptr->current_buffer_size) - { - png_size_t save_size; - - if (png_ptr->idat_size < (png_uint_32)png_ptr->current_buffer_size) - { - save_size = (png_size_t)png_ptr->idat_size; - - /* Check for overflow */ - if ((png_uint_32)save_size != png_ptr->idat_size) - png_error(png_ptr, "save_size overflowed in pngpread"); - } - else - save_size = png_ptr->current_buffer_size; - - png_calculate_crc(png_ptr, png_ptr->current_buffer_ptr, save_size); - if (!(png_ptr->flags & PNG_FLAG_ZLIB_FINISHED)) - png_process_IDAT_data(png_ptr, png_ptr->current_buffer_ptr, save_size); - - png_ptr->idat_size -= save_size; - png_ptr->buffer_size -= save_size; - png_ptr->current_buffer_size -= save_size; - png_ptr->current_buffer_ptr += save_size; - } - if (!png_ptr->idat_size) - { - if (png_ptr->buffer_size < 4) - { - png_push_save_buffer(png_ptr); - return; - } - - png_crc_finish(png_ptr, 0); - png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER; - png_ptr->mode |= PNG_AFTER_IDAT; - } -} - -void /* PRIVATE */ -png_process_IDAT_data(png_structp png_ptr, png_bytep buffer, - png_size_t buffer_length) -{ - int ret; - - if ((png_ptr->flags & PNG_FLAG_ZLIB_FINISHED) && buffer_length) - png_error(png_ptr, "Extra compression data"); - - png_ptr->zstream.next_in = buffer; - png_ptr->zstream.avail_in = (uInt)buffer_length; - for (;;) - { - ret = inflate(&png_ptr->zstream, Z_PARTIAL_FLUSH); - if (ret != Z_OK) - { - if (ret == Z_STREAM_END) - { - if (png_ptr->zstream.avail_in) - png_error(png_ptr, "Extra compressed data"); - - if (!(png_ptr->zstream.avail_out)) - { - png_push_process_row(png_ptr); - } - - png_ptr->mode |= PNG_AFTER_IDAT; - png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED; - break; - } - else if (ret == Z_BUF_ERROR) - break; - - else - png_error(png_ptr, "Decompression Error"); - } - if (!(png_ptr->zstream.avail_out)) - { - if (( -#if defined(PNG_READ_INTERLACING_SUPPORTED) - png_ptr->interlaced && png_ptr->pass > 6) || - (!png_ptr->interlaced && -#endif - png_ptr->row_number == png_ptr->num_rows)) - { - if (png_ptr->zstream.avail_in) - png_warning(png_ptr, "Too much data in IDAT chunks"); - png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED; - break; - } - png_push_process_row(png_ptr); - png_ptr->zstream.avail_out = (uInt)png_ptr->irowbytes; - png_ptr->zstream.next_out = png_ptr->row_buf; - } - - else - break; - } -} - -void /* PRIVATE */ -png_push_process_row(png_structp png_ptr) -{ - png_ptr->row_info.color_type = png_ptr->color_type; - png_ptr->row_info.width = png_ptr->iwidth; - png_ptr->row_info.channels = png_ptr->channels; - png_ptr->row_info.bit_depth = png_ptr->bit_depth; - png_ptr->row_info.pixel_depth = png_ptr->pixel_depth; - - png_ptr->row_info.rowbytes = PNG_ROWBYTES(png_ptr->row_info.pixel_depth, - png_ptr->row_info.width); - - png_read_filter_row(png_ptr, &(png_ptr->row_info), - png_ptr->row_buf + 1, png_ptr->prev_row + 1, - (int)(png_ptr->row_buf[0])); - - png_memcpy_check(png_ptr, png_ptr->prev_row, png_ptr->row_buf, - png_ptr->rowbytes + 1); - - if (png_ptr->transformations || (png_ptr->flags&PNG_FLAG_STRIP_ALPHA)) - png_do_read_transformations(png_ptr); - -#if defined(PNG_READ_INTERLACING_SUPPORTED) - /* Blow up interlaced rows to full size */ - if (png_ptr->interlaced && (png_ptr->transformations & PNG_INTERLACE)) - { - if (png_ptr->pass < 6) -/* old interface (pre-1.0.9): - png_do_read_interlace(&(png_ptr->row_info), - png_ptr->row_buf + 1, png_ptr->pass, png_ptr->transformations); - */ - png_do_read_interlace(png_ptr); - - switch (png_ptr->pass) - { - case 0: - { - int i; - for (i = 0; i < 8 && png_ptr->pass == 0; i++) - { - png_push_have_row(png_ptr, png_ptr->row_buf + 1); - png_read_push_finish_row(png_ptr); /* Updates png_ptr->pass */ - } - - if (png_ptr->pass == 2) /* Pass 1 might be empty */ - { - for (i = 0; i < 4 && png_ptr->pass == 2; i++) - { - png_push_have_row(png_ptr, png_bytep_NULL); - png_read_push_finish_row(png_ptr); - } - } - - if (png_ptr->pass == 4 && png_ptr->height <= 4) - { - for (i = 0; i < 2 && png_ptr->pass == 4; i++) - { - png_push_have_row(png_ptr, png_bytep_NULL); - png_read_push_finish_row(png_ptr); - } - } - - if (png_ptr->pass == 6 && png_ptr->height <= 4) - { - png_push_have_row(png_ptr, png_bytep_NULL); - png_read_push_finish_row(png_ptr); - } - - break; - } - - case 1: - { - int i; - for (i = 0; i < 8 && png_ptr->pass == 1; i++) - { - png_push_have_row(png_ptr, png_ptr->row_buf + 1); - png_read_push_finish_row(png_ptr); - } - - if (png_ptr->pass == 2) /* Skip top 4 generated rows */ - { - for (i = 0; i < 4 && png_ptr->pass == 2; i++) - { - png_push_have_row(png_ptr, png_bytep_NULL); - png_read_push_finish_row(png_ptr); - } - } - - break; - } - - case 2: - { - int i; - - for (i = 0; i < 4 && png_ptr->pass == 2; i++) - { - png_push_have_row(png_ptr, png_ptr->row_buf + 1); - png_read_push_finish_row(png_ptr); - } - - for (i = 0; i < 4 && png_ptr->pass == 2; i++) - { - png_push_have_row(png_ptr, png_bytep_NULL); - png_read_push_finish_row(png_ptr); - } - - if (png_ptr->pass == 4) /* Pass 3 might be empty */ - { - for (i = 0; i < 2 && png_ptr->pass == 4; i++) - { - png_push_have_row(png_ptr, png_bytep_NULL); - png_read_push_finish_row(png_ptr); - } - } - - break; - } - - case 3: - { - int i; - - for (i = 0; i < 4 && png_ptr->pass == 3; i++) - { - png_push_have_row(png_ptr, png_ptr->row_buf + 1); - png_read_push_finish_row(png_ptr); - } - - if (png_ptr->pass == 4) /* Skip top two generated rows */ - { - for (i = 0; i < 2 && png_ptr->pass == 4; i++) - { - png_push_have_row(png_ptr, png_bytep_NULL); - png_read_push_finish_row(png_ptr); - } - } - - break; - } - - case 4: - { - int i; - - for (i = 0; i < 2 && png_ptr->pass == 4; i++) - { - png_push_have_row(png_ptr, png_ptr->row_buf + 1); - png_read_push_finish_row(png_ptr); - } - - for (i = 0; i < 2 && png_ptr->pass == 4; i++) - { - png_push_have_row(png_ptr, png_bytep_NULL); - png_read_push_finish_row(png_ptr); - } - - if (png_ptr->pass == 6) /* Pass 5 might be empty */ - { - png_push_have_row(png_ptr, png_bytep_NULL); - png_read_push_finish_row(png_ptr); - } - - break; - } - - case 5: - { - int i; - - for (i = 0; i < 2 && png_ptr->pass == 5; i++) - { - png_push_have_row(png_ptr, png_ptr->row_buf + 1); - png_read_push_finish_row(png_ptr); - } - - if (png_ptr->pass == 6) /* Skip top generated row */ - { - png_push_have_row(png_ptr, png_bytep_NULL); - png_read_push_finish_row(png_ptr); - } - - break; - } - case 6: - { - png_push_have_row(png_ptr, png_ptr->row_buf + 1); - png_read_push_finish_row(png_ptr); - - if (png_ptr->pass != 6) - break; - - png_push_have_row(png_ptr, png_bytep_NULL); - png_read_push_finish_row(png_ptr); - } - } - } - else -#endif - { - png_push_have_row(png_ptr, png_ptr->row_buf + 1); - png_read_push_finish_row(png_ptr); - } -} - -void /* PRIVATE */ -png_read_push_finish_row(png_structp png_ptr) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */ - - /* Start of interlace block */ - PNG_CONST int FARDATA png_pass_start[] = {0, 4, 0, 2, 0, 1, 0}; - - /* Offset to next interlace block */ - PNG_CONST int FARDATA png_pass_inc[] = {8, 8, 4, 4, 2, 2, 1}; - - /* Start of interlace block in the y direction */ - PNG_CONST int FARDATA png_pass_ystart[] = {0, 0, 4, 0, 2, 0, 1}; - - /* Offset to next interlace block in the y direction */ - PNG_CONST int FARDATA png_pass_yinc[] = {8, 8, 8, 4, 4, 2, 2}; - - /* Height of interlace block. This is not currently used - if you need - * it, uncomment it here and in png.h - PNG_CONST int FARDATA png_pass_height[] = {8, 8, 4, 4, 2, 2, 1}; - */ -#endif - - png_ptr->row_number++; - if (png_ptr->row_number < png_ptr->num_rows) - return; - -#if defined(PNG_READ_INTERLACING_SUPPORTED) - if (png_ptr->interlaced) - { - png_ptr->row_number = 0; - png_memset_check(png_ptr, png_ptr->prev_row, 0, - png_ptr->rowbytes + 1); - do - { - png_ptr->pass++; - if ((png_ptr->pass == 1 && png_ptr->width < 5) || - (png_ptr->pass == 3 && png_ptr->width < 3) || - (png_ptr->pass == 5 && png_ptr->width < 2)) - png_ptr->pass++; - - if (png_ptr->pass > 7) - png_ptr->pass--; - - if (png_ptr->pass >= 7) - break; - - png_ptr->iwidth = (png_ptr->width + - png_pass_inc[png_ptr->pass] - 1 - - png_pass_start[png_ptr->pass]) / - png_pass_inc[png_ptr->pass]; - - png_ptr->irowbytes = PNG_ROWBYTES(png_ptr->pixel_depth, - png_ptr->iwidth) + 1; - - if (png_ptr->transformations & PNG_INTERLACE) - break; - - png_ptr->num_rows = (png_ptr->height + - png_pass_yinc[png_ptr->pass] - 1 - - png_pass_ystart[png_ptr->pass]) / - png_pass_yinc[png_ptr->pass]; - - } while (png_ptr->iwidth == 0 || png_ptr->num_rows == 0); - } -#endif /* PNG_READ_INTERLACING_SUPPORTED */ -} - -#if defined(PNG_READ_tEXt_SUPPORTED) -void /* PRIVATE */ -png_push_handle_tEXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 - length) -{ - if (!(png_ptr->mode & PNG_HAVE_IHDR) || (png_ptr->mode & PNG_HAVE_IEND)) - { - png_error(png_ptr, "Out of place tEXt"); - info_ptr = info_ptr; /* To quiet some compiler warnings */ - } - -#ifdef PNG_MAX_MALLOC_64K - png_ptr->skip_length = 0; /* This may not be necessary */ - - if (length > (png_uint_32)65535L) /* Can't hold entire string in memory */ - { - png_warning(png_ptr, "tEXt chunk too large to fit in memory"); - png_ptr->skip_length = length - (png_uint_32)65535L; - length = (png_uint_32)65535L; - } -#endif - - png_ptr->current_text = (png_charp)png_malloc(png_ptr, - (png_uint_32)(length + 1)); - png_ptr->current_text[length] = '\0'; - png_ptr->current_text_ptr = png_ptr->current_text; - png_ptr->current_text_size = (png_size_t)length; - png_ptr->current_text_left = (png_size_t)length; - png_ptr->process_mode = PNG_READ_tEXt_MODE; -} - -void /* PRIVATE */ -png_push_read_tEXt(png_structp png_ptr, png_infop info_ptr) -{ - if (png_ptr->buffer_size && png_ptr->current_text_left) - { - png_size_t text_size; - - if (png_ptr->buffer_size < png_ptr->current_text_left) - text_size = png_ptr->buffer_size; - - else - text_size = png_ptr->current_text_left; - - png_crc_read(png_ptr, (png_bytep)png_ptr->current_text_ptr, text_size); - png_ptr->current_text_left -= text_size; - png_ptr->current_text_ptr += text_size; - } - if (!(png_ptr->current_text_left)) - { - png_textp text_ptr; - png_charp text; - png_charp key; - int ret; - - if (png_ptr->buffer_size < 4) - { - png_push_save_buffer(png_ptr); - return; - } - - png_push_crc_finish(png_ptr); - -#if defined(PNG_MAX_MALLOC_64K) - if (png_ptr->skip_length) - return; -#endif - - key = png_ptr->current_text; - - for (text = key; *text; text++) - /* Empty loop */ ; - - if (text < key + png_ptr->current_text_size) - text++; - - text_ptr = (png_textp)png_malloc(png_ptr, - (png_uint_32)png_sizeof(png_text)); - text_ptr->compression = PNG_TEXT_COMPRESSION_NONE; - text_ptr->key = key; -#ifdef PNG_iTXt_SUPPORTED - text_ptr->lang = NULL; - text_ptr->lang_key = NULL; -#endif - text_ptr->text = text; - - ret = png_set_text_2(png_ptr, info_ptr, text_ptr, 1); - - png_free(png_ptr, key); - png_free(png_ptr, text_ptr); - png_ptr->current_text = NULL; - - if (ret) - png_warning(png_ptr, "Insufficient memory to store text chunk."); - } -} -#endif - -#if defined(PNG_READ_zTXt_SUPPORTED) -void /* PRIVATE */ -png_push_handle_zTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 - length) -{ - if (!(png_ptr->mode & PNG_HAVE_IHDR) || (png_ptr->mode & PNG_HAVE_IEND)) - { - png_error(png_ptr, "Out of place zTXt"); - info_ptr = info_ptr; /* To quiet some compiler warnings */ - } - -#ifdef PNG_MAX_MALLOC_64K - /* We can't handle zTXt chunks > 64K, since we don't have enough space - * to be able to store the uncompressed data. Actually, the threshold - * is probably around 32K, but it isn't as definite as 64K is. - */ - if (length > (png_uint_32)65535L) - { - png_warning(png_ptr, "zTXt chunk too large to fit in memory"); - png_push_crc_skip(png_ptr, length); - return; - } -#endif - - png_ptr->current_text = (png_charp)png_malloc(png_ptr, - (png_uint_32)(length + 1)); - png_ptr->current_text[length] = '\0'; - png_ptr->current_text_ptr = png_ptr->current_text; - png_ptr->current_text_size = (png_size_t)length; - png_ptr->current_text_left = (png_size_t)length; - png_ptr->process_mode = PNG_READ_zTXt_MODE; -} - -void /* PRIVATE */ -png_push_read_zTXt(png_structp png_ptr, png_infop info_ptr) -{ - if (png_ptr->buffer_size && png_ptr->current_text_left) - { - png_size_t text_size; - - if (png_ptr->buffer_size < (png_uint_32)png_ptr->current_text_left) - text_size = png_ptr->buffer_size; - - else - text_size = png_ptr->current_text_left; - - png_crc_read(png_ptr, (png_bytep)png_ptr->current_text_ptr, text_size); - png_ptr->current_text_left -= text_size; - png_ptr->current_text_ptr += text_size; - } - if (!(png_ptr->current_text_left)) - { - png_textp text_ptr; - png_charp text; - png_charp key; - int ret; - png_size_t text_size, key_size; - - if (png_ptr->buffer_size < 4) - { - png_push_save_buffer(png_ptr); - return; - } - - png_push_crc_finish(png_ptr); - - key = png_ptr->current_text; - - for (text = key; *text; text++) - /* Empty loop */ ; - - /* zTXt can't have zero text */ - if (text >= key + png_ptr->current_text_size) - { - png_ptr->current_text = NULL; - png_free(png_ptr, key); - return; - } - - text++; - - if (*text != PNG_TEXT_COMPRESSION_zTXt) /* Check compression byte */ - { - png_ptr->current_text = NULL; - png_free(png_ptr, key); - return; - } - - text++; - - png_ptr->zstream.next_in = (png_bytep )text; - png_ptr->zstream.avail_in = (uInt)(png_ptr->current_text_size - - (text - key)); - png_ptr->zstream.next_out = png_ptr->zbuf; - png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; - - key_size = text - key; - text_size = 0; - text = NULL; - ret = Z_STREAM_END; - - while (png_ptr->zstream.avail_in) - { - ret = inflate(&png_ptr->zstream, Z_PARTIAL_FLUSH); - if (ret != Z_OK && ret != Z_STREAM_END) - { - inflateReset(&png_ptr->zstream); - png_ptr->zstream.avail_in = 0; - png_ptr->current_text = NULL; - png_free(png_ptr, key); - png_free(png_ptr, text); - return; - } - if (!(png_ptr->zstream.avail_out) || ret == Z_STREAM_END) - { - if (text == NULL) - { - text = (png_charp)png_malloc(png_ptr, - (png_uint_32)(png_ptr->zbuf_size - - png_ptr->zstream.avail_out + key_size + 1)); - - png_memcpy(text + key_size, png_ptr->zbuf, - png_ptr->zbuf_size - png_ptr->zstream.avail_out); - - png_memcpy(text, key, key_size); - - text_size = key_size + png_ptr->zbuf_size - - png_ptr->zstream.avail_out; - - *(text + text_size) = '\0'; - } - else - { - png_charp tmp; - - tmp = text; - text = (png_charp)png_malloc(png_ptr, text_size + - (png_uint_32)(png_ptr->zbuf_size - - png_ptr->zstream.avail_out + 1)); - - png_memcpy(text, tmp, text_size); - png_free(png_ptr, tmp); - - png_memcpy(text + text_size, png_ptr->zbuf, - png_ptr->zbuf_size - png_ptr->zstream.avail_out); - - text_size += png_ptr->zbuf_size - png_ptr->zstream.avail_out; - *(text + text_size) = '\0'; - } - if (ret != Z_STREAM_END) - { - png_ptr->zstream.next_out = png_ptr->zbuf; - png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; - } - } - else - { - break; - } - - if (ret == Z_STREAM_END) - break; - } - - inflateReset(&png_ptr->zstream); - png_ptr->zstream.avail_in = 0; - - if (ret != Z_STREAM_END) - { - png_ptr->current_text = NULL; - png_free(png_ptr, key); - png_free(png_ptr, text); - return; - } - - png_ptr->current_text = NULL; - png_free(png_ptr, key); - key = text; - text += key_size; - - text_ptr = (png_textp)png_malloc(png_ptr, - (png_uint_32)png_sizeof(png_text)); - text_ptr->compression = PNG_TEXT_COMPRESSION_zTXt; - text_ptr->key = key; -#ifdef PNG_iTXt_SUPPORTED - text_ptr->lang = NULL; - text_ptr->lang_key = NULL; -#endif - text_ptr->text = text; - - ret = png_set_text_2(png_ptr, info_ptr, text_ptr, 1); - - png_free(png_ptr, key); - png_free(png_ptr, text_ptr); - - if (ret) - png_warning(png_ptr, "Insufficient memory to store text chunk."); - } -} -#endif - -#if defined(PNG_READ_iTXt_SUPPORTED) -void /* PRIVATE */ -png_push_handle_iTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 - length) -{ - if (!(png_ptr->mode & PNG_HAVE_IHDR) || (png_ptr->mode & PNG_HAVE_IEND)) - { - png_error(png_ptr, "Out of place iTXt"); - info_ptr = info_ptr; /* To quiet some compiler warnings */ - } - -#ifdef PNG_MAX_MALLOC_64K - png_ptr->skip_length = 0; /* This may not be necessary */ - - if (length > (png_uint_32)65535L) /* Can't hold entire string in memory */ - { - png_warning(png_ptr, "iTXt chunk too large to fit in memory"); - png_ptr->skip_length = length - (png_uint_32)65535L; - length = (png_uint_32)65535L; - } -#endif - - png_ptr->current_text = (png_charp)png_malloc(png_ptr, - (png_uint_32)(length + 1)); - png_ptr->current_text[length] = '\0'; - png_ptr->current_text_ptr = png_ptr->current_text; - png_ptr->current_text_size = (png_size_t)length; - png_ptr->current_text_left = (png_size_t)length; - png_ptr->process_mode = PNG_READ_iTXt_MODE; -} - -void /* PRIVATE */ -png_push_read_iTXt(png_structp png_ptr, png_infop info_ptr) -{ - - if (png_ptr->buffer_size && png_ptr->current_text_left) - { - png_size_t text_size; - - if (png_ptr->buffer_size < png_ptr->current_text_left) - text_size = png_ptr->buffer_size; - - else - text_size = png_ptr->current_text_left; - - png_crc_read(png_ptr, (png_bytep)png_ptr->current_text_ptr, text_size); - png_ptr->current_text_left -= text_size; - png_ptr->current_text_ptr += text_size; - } - if (!(png_ptr->current_text_left)) - { - png_textp text_ptr; - png_charp key; - int comp_flag; - png_charp lang; - png_charp lang_key; - png_charp text; - int ret; - - if (png_ptr->buffer_size < 4) - { - png_push_save_buffer(png_ptr); - return; - } - - png_push_crc_finish(png_ptr); - -#if defined(PNG_MAX_MALLOC_64K) - if (png_ptr->skip_length) - return; -#endif - - key = png_ptr->current_text; - - for (lang = key; *lang; lang++) - /* Empty loop */ ; - - if (lang < key + png_ptr->current_text_size - 3) - lang++; - - comp_flag = *lang++; - lang++; /* Skip comp_type, always zero */ - - for (lang_key = lang; *lang_key; lang_key++) - /* Empty loop */ ; - - lang_key++; /* Skip NUL separator */ - - text=lang_key; - - if (lang_key < key + png_ptr->current_text_size - 1) - { - for (; *text; text++) - /* Empty loop */ ; - } - - if (text < key + png_ptr->current_text_size) - text++; - - text_ptr = (png_textp)png_malloc(png_ptr, - (png_uint_32)png_sizeof(png_text)); - - text_ptr->compression = comp_flag + 2; - text_ptr->key = key; - text_ptr->lang = lang; - text_ptr->lang_key = lang_key; - text_ptr->text = text; - text_ptr->text_length = 0; - text_ptr->itxt_length = png_strlen(text); - - ret = png_set_text_2(png_ptr, info_ptr, text_ptr, 1); - - png_ptr->current_text = NULL; - - png_free(png_ptr, text_ptr); - if (ret) - png_warning(png_ptr, "Insufficient memory to store iTXt chunk."); - } -} -#endif - -/* This function is called when we haven't found a handler for this - * chunk. If there isn't a problem with the chunk itself (ie a bad chunk - * name or a critical chunk), the chunk is (currently) silently ignored. - */ -void /* PRIVATE */ -png_push_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32 - length) -{ - png_uint_32 skip = 0; - - if (!(png_ptr->chunk_name[0] & 0x20)) - { -#if defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) - if (png_handle_as_unknown(png_ptr, png_ptr->chunk_name) != - PNG_HANDLE_CHUNK_ALWAYS -#if defined(PNG_READ_USER_CHUNKS_SUPPORTED) - && png_ptr->read_user_chunk_fn == NULL -#endif - ) -#endif - png_chunk_error(png_ptr, "unknown critical chunk"); - - info_ptr = info_ptr; /* To quiet some compiler warnings */ - } - -#if defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) - if (png_ptr->flags & PNG_FLAG_KEEP_UNKNOWN_CHUNKS) - { -#ifdef PNG_MAX_MALLOC_64K - if (length > (png_uint_32)65535L) - { - png_warning(png_ptr, "unknown chunk too large to fit in memory"); - skip = length - (png_uint_32)65535L; - length = (png_uint_32)65535L; - } -#endif - png_memcpy((png_charp)png_ptr->unknown_chunk.name, - (png_charp)png_ptr->chunk_name, - png_sizeof(png_ptr->unknown_chunk.name)); - png_ptr->unknown_chunk.name[png_sizeof(png_ptr->unknown_chunk.name) - 1] - = '\0'; - - png_ptr->unknown_chunk.size = (png_size_t)length; - - if (length == 0) - png_ptr->unknown_chunk.data = NULL; - - else - { - png_ptr->unknown_chunk.data = (png_bytep)png_malloc(png_ptr, - (png_uint_32)length); - png_crc_read(png_ptr, (png_bytep)png_ptr->unknown_chunk.data, length); - } - -#if defined(PNG_READ_USER_CHUNKS_SUPPORTED) - if (png_ptr->read_user_chunk_fn != NULL) - { - /* Callback to user unknown chunk handler */ - int ret; - ret = (*(png_ptr->read_user_chunk_fn)) - (png_ptr, &png_ptr->unknown_chunk); - - if (ret < 0) - png_chunk_error(png_ptr, "error in user chunk"); - - if (ret == 0) - { - if (!(png_ptr->chunk_name[0] & 0x20)) - if (png_handle_as_unknown(png_ptr, png_ptr->chunk_name) != - PNG_HANDLE_CHUNK_ALWAYS) - png_chunk_error(png_ptr, "unknown critical chunk"); - png_set_unknown_chunks(png_ptr, info_ptr, - &png_ptr->unknown_chunk, 1); - } - } - - else -#endif - png_set_unknown_chunks(png_ptr, info_ptr, &png_ptr->unknown_chunk, 1); - png_free(png_ptr, png_ptr->unknown_chunk.data); - png_ptr->unknown_chunk.data = NULL; - } - - else -#endif - skip=length; - png_push_crc_skip(png_ptr, skip); -} - -void /* PRIVATE */ -png_push_have_info(png_structp png_ptr, png_infop info_ptr) -{ - if (png_ptr->info_fn != NULL) - (*(png_ptr->info_fn))(png_ptr, info_ptr); -} - -void /* PRIVATE */ -png_push_have_end(png_structp png_ptr, png_infop info_ptr) -{ - if (png_ptr->end_fn != NULL) - (*(png_ptr->end_fn))(png_ptr, info_ptr); -} - -void /* PRIVATE */ -png_push_have_row(png_structp png_ptr, png_bytep row) -{ - if (png_ptr->row_fn != NULL) - (*(png_ptr->row_fn))(png_ptr, row, png_ptr->row_number, - (int)png_ptr->pass); -} - -void PNGAPI -png_progressive_combine_row (png_structp png_ptr, - png_bytep old_row, png_bytep new_row) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_CONST int FARDATA png_pass_dsp_mask[7] = - {0xff, 0x0f, 0xff, 0x33, 0xff, 0x55, 0xff}; -#endif - if (png_ptr == NULL) - return; - - if (new_row != NULL) /* new_row must == png_ptr->row_buf here. */ - png_combine_row(png_ptr, old_row, png_pass_dsp_mask[png_ptr->pass]); -} - -void PNGAPI -png_set_progressive_read_fn(png_structp png_ptr, png_voidp progressive_ptr, - png_progressive_info_ptr info_fn, png_progressive_row_ptr row_fn, - png_progressive_end_ptr end_fn) -{ - if (png_ptr == NULL) - return; - - png_ptr->info_fn = info_fn; - png_ptr->row_fn = row_fn; - png_ptr->end_fn = end_fn; - - png_set_read_fn(png_ptr, progressive_ptr, png_push_fill_buffer); -} - -png_voidp PNGAPI -png_get_progressive_ptr(png_structp png_ptr) -{ - if (png_ptr == NULL) - return (NULL); - - return png_ptr->io_ptr; -} -#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ diff --git a/src/libpng/pngread.c b/src/libpng/pngread.c deleted file mode 100644 index f1def0edb..000000000 --- a/src/libpng/pngread.c +++ /dev/null @@ -1,1470 +0,0 @@ - -/* pngread.c - read a PNG file - * - * Last changed in libpng 1.2.37 [June 4, 2009] - * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2009 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - * - * This file contains routines that an application calls directly to - * read a PNG file or stream. - */ - -#define PNG_INTERNAL -#include "png.h" -#if defined(PNG_READ_SUPPORTED) - -/* Create a PNG structure for reading, and allocate any memory needed. */ -png_structp PNGAPI -png_create_read_struct(png_const_charp user_png_ver, png_voidp error_ptr, - png_error_ptr error_fn, png_error_ptr warn_fn) -{ - -#ifdef PNG_USER_MEM_SUPPORTED - return (png_create_read_struct_2(user_png_ver, error_ptr, error_fn, - warn_fn, png_voidp_NULL, png_malloc_ptr_NULL, png_free_ptr_NULL)); -} - -/* Alternate create PNG structure for reading, and allocate any memory needed. */ -png_structp PNGAPI -png_create_read_struct_2(png_const_charp user_png_ver, png_voidp error_ptr, - png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr, - png_malloc_ptr malloc_fn, png_free_ptr free_fn) -{ -#endif /* PNG_USER_MEM_SUPPORTED */ - -#ifdef PNG_SETJMP_SUPPORTED - volatile -#endif - png_structp png_ptr; - -#ifdef PNG_SETJMP_SUPPORTED -#ifdef USE_FAR_KEYWORD - jmp_buf jmpbuf; -#endif -#endif - - int i; - - png_debug(1, "in png_create_read_struct"); -#ifdef PNG_USER_MEM_SUPPORTED - png_ptr = (png_structp)png_create_struct_2(PNG_STRUCT_PNG, - (png_malloc_ptr)malloc_fn, (png_voidp)mem_ptr); -#else - png_ptr = (png_structp)png_create_struct(PNG_STRUCT_PNG); -#endif - if (png_ptr == NULL) - return (NULL); - - /* Added at libpng-1.2.6 */ -#ifdef PNG_SET_USER_LIMITS_SUPPORTED - png_ptr->user_width_max=PNG_USER_WIDTH_MAX; - png_ptr->user_height_max=PNG_USER_HEIGHT_MAX; -#endif - -#ifdef PNG_SETJMP_SUPPORTED -#ifdef USE_FAR_KEYWORD - if (setjmp(jmpbuf)) -#else - if (setjmp(png_ptr->jmpbuf)) -#endif - { - png_free(png_ptr, png_ptr->zbuf); - png_ptr->zbuf = NULL; -#ifdef PNG_USER_MEM_SUPPORTED - png_destroy_struct_2((png_voidp)png_ptr, - (png_free_ptr)free_fn, (png_voidp)mem_ptr); -#else - png_destroy_struct((png_voidp)png_ptr); -#endif - return (NULL); - } -#ifdef USE_FAR_KEYWORD - png_memcpy(png_ptr->jmpbuf, jmpbuf, png_sizeof(jmp_buf)); -#endif -#endif - -#ifdef PNG_USER_MEM_SUPPORTED - png_set_mem_fn(png_ptr, mem_ptr, malloc_fn, free_fn); -#endif - - png_set_error_fn(png_ptr, error_ptr, error_fn, warn_fn); - - if (user_png_ver) - { - i = 0; - do - { - if (user_png_ver[i] != png_libpng_ver[i]) - png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH; - } while (png_libpng_ver[i++]); - } - else - png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH; - - - if (png_ptr->flags & PNG_FLAG_LIBRARY_MISMATCH) - { - /* Libpng 0.90 and later are binary incompatible with libpng 0.89, so - * we must recompile any applications that use any older library version. - * For versions after libpng 1.0, we will be compatible, so we need - * only check the first digit. - */ - if (user_png_ver == NULL || user_png_ver[0] != png_libpng_ver[0] || - (user_png_ver[0] == '1' && user_png_ver[2] != png_libpng_ver[2]) || - (user_png_ver[0] == '0' && user_png_ver[2] < '9')) - { -#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE) - char msg[80]; - if (user_png_ver) - { - png_snprintf(msg, 80, - "Application was compiled with png.h from libpng-%.20s", - user_png_ver); - png_warning(png_ptr, msg); - } - png_snprintf(msg, 80, - "Application is running with png.c from libpng-%.20s", - png_libpng_ver); - png_warning(png_ptr, msg); -#endif -#ifdef PNG_ERROR_NUMBERS_SUPPORTED - png_ptr->flags = 0; -#endif - png_error(png_ptr, - "Incompatible libpng version in application and library"); - } - } - - /* Initialize zbuf - compression buffer */ - png_ptr->zbuf_size = PNG_ZBUF_SIZE; - png_ptr->zbuf = (png_bytep)png_malloc(png_ptr, - (png_uint_32)png_ptr->zbuf_size); - png_ptr->zstream.zalloc = png_zalloc; - png_ptr->zstream.zfree = png_zfree; - png_ptr->zstream.opaque = (voidpf)png_ptr; - - switch (inflateInit(&png_ptr->zstream)) - { - case Z_OK: /* Do nothing */ break; - case Z_MEM_ERROR: - case Z_STREAM_ERROR: png_error(png_ptr, "zlib memory error"); break; - case Z_VERSION_ERROR: png_error(png_ptr, "zlib version error"); break; - default: png_error(png_ptr, "Unknown zlib error"); - } - - png_ptr->zstream.next_out = png_ptr->zbuf; - png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; - - png_set_read_fn(png_ptr, png_voidp_NULL, png_rw_ptr_NULL); - -#ifdef PNG_SETJMP_SUPPORTED -/* Applications that neglect to set up their own setjmp() and then encounter - a png_error() will longjmp here. Since the jmpbuf is then meaningless we - abort instead of returning. */ -#ifdef USE_FAR_KEYWORD - if (setjmp(jmpbuf)) - PNG_ABORT(); - png_memcpy(png_ptr->jmpbuf, jmpbuf, png_sizeof(jmp_buf)); -#else - if (setjmp(png_ptr->jmpbuf)) - PNG_ABORT(); -#endif -#endif - return (png_ptr); -} - -#if defined(PNG_1_0_X) || defined(PNG_1_2_X) -/* Initialize PNG structure for reading, and allocate any memory needed. - This interface is deprecated in favour of the png_create_read_struct(), - and it will disappear as of libpng-1.3.0. */ -#undef png_read_init -void PNGAPI -png_read_init(png_structp png_ptr) -{ - /* We only come here via pre-1.0.7-compiled applications */ - png_read_init_2(png_ptr, "1.0.6 or earlier", 0, 0); -} - -void PNGAPI -png_read_init_2(png_structp png_ptr, png_const_charp user_png_ver, - png_size_t png_struct_size, png_size_t png_info_size) -{ - /* We only come here via pre-1.0.12-compiled applications */ - if (png_ptr == NULL) - return; -#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE) - if (png_sizeof(png_struct) > png_struct_size || - png_sizeof(png_info) > png_info_size) - { - char msg[80]; - png_ptr->warning_fn = NULL; - if (user_png_ver) - { - png_snprintf(msg, 80, - "Application was compiled with png.h from libpng-%.20s", - user_png_ver); - png_warning(png_ptr, msg); - } - png_snprintf(msg, 80, - "Application is running with png.c from libpng-%.20s", - png_libpng_ver); - png_warning(png_ptr, msg); - } -#endif - if (png_sizeof(png_struct) > png_struct_size) - { - png_ptr->error_fn = NULL; -#ifdef PNG_ERROR_NUMBERS_SUPPORTED - png_ptr->flags = 0; -#endif - png_error(png_ptr, - "The png struct allocated by the application for reading is too small."); - } - if (png_sizeof(png_info) > png_info_size) - { - png_ptr->error_fn = NULL; -#ifdef PNG_ERROR_NUMBERS_SUPPORTED - png_ptr->flags = 0; -#endif - png_error(png_ptr, - "The info struct allocated by application for reading is too small."); - } - png_read_init_3(&png_ptr, user_png_ver, png_struct_size); -} -#endif /* PNG_1_0_X || PNG_1_2_X */ - -void PNGAPI -png_read_init_3(png_structpp ptr_ptr, png_const_charp user_png_ver, - png_size_t png_struct_size) -{ -#ifdef PNG_SETJMP_SUPPORTED - jmp_buf tmp_jmp; /* to save current jump buffer */ -#endif - - int i = 0; - - png_structp png_ptr=*ptr_ptr; - - if (png_ptr == NULL) - return; - - do - { - if (user_png_ver[i] != png_libpng_ver[i]) - { -#ifdef PNG_LEGACY_SUPPORTED - png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH; -#else - png_ptr->warning_fn = NULL; - png_warning(png_ptr, - "Application uses deprecated png_read_init() and should be recompiled."); - break; -#endif - } - } while (png_libpng_ver[i++]); - - png_debug(1, "in png_read_init_3"); - -#ifdef PNG_SETJMP_SUPPORTED - /* Save jump buffer and error functions */ - png_memcpy(tmp_jmp, png_ptr->jmpbuf, png_sizeof(jmp_buf)); -#endif - - if (png_sizeof(png_struct) > png_struct_size) - { - png_destroy_struct(png_ptr); - *ptr_ptr = (png_structp)png_create_struct(PNG_STRUCT_PNG); - png_ptr = *ptr_ptr; - } - - /* Reset all variables to 0 */ - png_memset(png_ptr, 0, png_sizeof(png_struct)); - -#ifdef PNG_SETJMP_SUPPORTED - /* Restore jump buffer */ - png_memcpy(png_ptr->jmpbuf, tmp_jmp, png_sizeof(jmp_buf)); -#endif - - /* Added at libpng-1.2.6 */ -#ifdef PNG_SET_USER_LIMITS_SUPPORTED - png_ptr->user_width_max=PNG_USER_WIDTH_MAX; - png_ptr->user_height_max=PNG_USER_HEIGHT_MAX; -#endif - - /* Initialize zbuf - compression buffer */ - png_ptr->zbuf_size = PNG_ZBUF_SIZE; - png_ptr->zbuf = (png_bytep)png_malloc(png_ptr, - (png_uint_32)png_ptr->zbuf_size); - png_ptr->zstream.zalloc = png_zalloc; - png_ptr->zstream.zfree = png_zfree; - png_ptr->zstream.opaque = (voidpf)png_ptr; - - switch (inflateInit(&png_ptr->zstream)) - { - case Z_OK: /* Do nothing */ break; - case Z_MEM_ERROR: - case Z_STREAM_ERROR: png_error(png_ptr, "zlib memory"); break; - case Z_VERSION_ERROR: png_error(png_ptr, "zlib version"); break; - default: png_error(png_ptr, "Unknown zlib error"); - } - - png_ptr->zstream.next_out = png_ptr->zbuf; - png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; - - png_set_read_fn(png_ptr, png_voidp_NULL, png_rw_ptr_NULL); -} - -#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED -/* Read the information before the actual image data. This has been - * changed in v0.90 to allow reading a file that already has the magic - * bytes read from the stream. You can tell libpng how many bytes have - * been read from the beginning of the stream (up to the maximum of 8) - * via png_set_sig_bytes(), and we will only check the remaining bytes - * here. The application can then have access to the signature bytes we - * read if it is determined that this isn't a valid PNG file. - */ -void PNGAPI -png_read_info(png_structp png_ptr, png_infop info_ptr) -{ - if (png_ptr == NULL || info_ptr == NULL) - return; - png_debug(1, "in png_read_info"); - /* If we haven't checked all of the PNG signature bytes, do so now. */ - if (png_ptr->sig_bytes < 8) - { - png_size_t num_checked = png_ptr->sig_bytes, - num_to_check = 8 - num_checked; - - png_read_data(png_ptr, &(info_ptr->signature[num_checked]), num_to_check); - png_ptr->sig_bytes = 8; - - if (png_sig_cmp(info_ptr->signature, num_checked, num_to_check)) - { - if (num_checked < 4 && - png_sig_cmp(info_ptr->signature, num_checked, num_to_check - 4)) - png_error(png_ptr, "Not a PNG file"); - else - png_error(png_ptr, "PNG file corrupted by ASCII conversion"); - } - if (num_checked < 3) - png_ptr->mode |= PNG_HAVE_PNG_SIGNATURE; - } - - for (;;) - { -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_CONST PNG_IHDR; - PNG_CONST PNG_IDAT; - PNG_CONST PNG_IEND; - PNG_CONST PNG_PLTE; -#if defined(PNG_READ_bKGD_SUPPORTED) - PNG_CONST PNG_bKGD; -#endif -#if defined(PNG_READ_cHRM_SUPPORTED) - PNG_CONST PNG_cHRM; -#endif -#if defined(PNG_READ_gAMA_SUPPORTED) - PNG_CONST PNG_gAMA; -#endif -#if defined(PNG_READ_hIST_SUPPORTED) - PNG_CONST PNG_hIST; -#endif -#if defined(PNG_READ_iCCP_SUPPORTED) - PNG_CONST PNG_iCCP; -#endif -#if defined(PNG_READ_iTXt_SUPPORTED) - PNG_CONST PNG_iTXt; -#endif -#if defined(PNG_READ_oFFs_SUPPORTED) - PNG_CONST PNG_oFFs; -#endif -#if defined(PNG_READ_pCAL_SUPPORTED) - PNG_CONST PNG_pCAL; -#endif -#if defined(PNG_READ_pHYs_SUPPORTED) - PNG_CONST PNG_pHYs; -#endif -#if defined(PNG_READ_sBIT_SUPPORTED) - PNG_CONST PNG_sBIT; -#endif -#if defined(PNG_READ_sCAL_SUPPORTED) - PNG_CONST PNG_sCAL; -#endif -#if defined(PNG_READ_sPLT_SUPPORTED) - PNG_CONST PNG_sPLT; -#endif -#if defined(PNG_READ_sRGB_SUPPORTED) - PNG_CONST PNG_sRGB; -#endif -#if defined(PNG_READ_tEXt_SUPPORTED) - PNG_CONST PNG_tEXt; -#endif -#if defined(PNG_READ_tIME_SUPPORTED) - PNG_CONST PNG_tIME; -#endif -#if defined(PNG_READ_tRNS_SUPPORTED) - PNG_CONST PNG_tRNS; -#endif -#if defined(PNG_READ_zTXt_SUPPORTED) - PNG_CONST PNG_zTXt; -#endif -#endif /* PNG_USE_LOCAL_ARRAYS */ - png_uint_32 length = png_read_chunk_header(png_ptr); - PNG_CONST png_bytep chunk_name = png_ptr->chunk_name; - - /* This should be a binary subdivision search or a hash for - * matching the chunk name rather than a linear search. - */ - if (!png_memcmp(chunk_name, png_IDAT, 4)) - if (png_ptr->mode & PNG_AFTER_IDAT) - png_ptr->mode |= PNG_HAVE_CHUNK_AFTER_IDAT; - - if (!png_memcmp(chunk_name, png_IHDR, 4)) - png_handle_IHDR(png_ptr, info_ptr, length); - else if (!png_memcmp(chunk_name, png_IEND, 4)) - png_handle_IEND(png_ptr, info_ptr, length); -#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED - else if (png_handle_as_unknown(png_ptr, chunk_name)) - { - if (!png_memcmp(chunk_name, png_IDAT, 4)) - png_ptr->mode |= PNG_HAVE_IDAT; - png_handle_unknown(png_ptr, info_ptr, length); - if (!png_memcmp(chunk_name, png_PLTE, 4)) - png_ptr->mode |= PNG_HAVE_PLTE; - else if (!png_memcmp(chunk_name, png_IDAT, 4)) - { - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before IDAT"); - else if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE && - !(png_ptr->mode & PNG_HAVE_PLTE)) - png_error(png_ptr, "Missing PLTE before IDAT"); - break; - } - } -#endif - else if (!png_memcmp(chunk_name, png_PLTE, 4)) - png_handle_PLTE(png_ptr, info_ptr, length); - else if (!png_memcmp(chunk_name, png_IDAT, 4)) - { - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before IDAT"); - else if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE && - !(png_ptr->mode & PNG_HAVE_PLTE)) - png_error(png_ptr, "Missing PLTE before IDAT"); - - png_ptr->idat_size = length; - png_ptr->mode |= PNG_HAVE_IDAT; - break; - } -#if defined(PNG_READ_bKGD_SUPPORTED) - else if (!png_memcmp(chunk_name, png_bKGD, 4)) - png_handle_bKGD(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_cHRM_SUPPORTED) - else if (!png_memcmp(chunk_name, png_cHRM, 4)) - png_handle_cHRM(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_gAMA_SUPPORTED) - else if (!png_memcmp(chunk_name, png_gAMA, 4)) - png_handle_gAMA(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_hIST_SUPPORTED) - else if (!png_memcmp(chunk_name, png_hIST, 4)) - png_handle_hIST(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_oFFs_SUPPORTED) - else if (!png_memcmp(chunk_name, png_oFFs, 4)) - png_handle_oFFs(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_pCAL_SUPPORTED) - else if (!png_memcmp(chunk_name, png_pCAL, 4)) - png_handle_pCAL(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_sCAL_SUPPORTED) - else if (!png_memcmp(chunk_name, png_sCAL, 4)) - png_handle_sCAL(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_pHYs_SUPPORTED) - else if (!png_memcmp(chunk_name, png_pHYs, 4)) - png_handle_pHYs(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_sBIT_SUPPORTED) - else if (!png_memcmp(chunk_name, png_sBIT, 4)) - png_handle_sBIT(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_sRGB_SUPPORTED) - else if (!png_memcmp(chunk_name, png_sRGB, 4)) - png_handle_sRGB(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_iCCP_SUPPORTED) - else if (!png_memcmp(chunk_name, png_iCCP, 4)) - png_handle_iCCP(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_sPLT_SUPPORTED) - else if (!png_memcmp(chunk_name, png_sPLT, 4)) - png_handle_sPLT(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_tEXt_SUPPORTED) - else if (!png_memcmp(chunk_name, png_tEXt, 4)) - png_handle_tEXt(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_tIME_SUPPORTED) - else if (!png_memcmp(chunk_name, png_tIME, 4)) - png_handle_tIME(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_tRNS_SUPPORTED) - else if (!png_memcmp(chunk_name, png_tRNS, 4)) - png_handle_tRNS(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_zTXt_SUPPORTED) - else if (!png_memcmp(chunk_name, png_zTXt, 4)) - png_handle_zTXt(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_iTXt_SUPPORTED) - else if (!png_memcmp(chunk_name, png_iTXt, 4)) - png_handle_iTXt(png_ptr, info_ptr, length); -#endif - else - png_handle_unknown(png_ptr, info_ptr, length); - } -} -#endif /* PNG_NO_SEQUENTIAL_READ_SUPPORTED */ - -/* Optional call to update the users info_ptr structure */ -void PNGAPI -png_read_update_info(png_structp png_ptr, png_infop info_ptr) -{ - png_debug(1, "in png_read_update_info"); - if (png_ptr == NULL) - return; - if (!(png_ptr->flags & PNG_FLAG_ROW_INIT)) - png_read_start_row(png_ptr); - else - png_warning(png_ptr, - "Ignoring extra png_read_update_info() call; row buffer not reallocated"); - png_read_transform_info(png_ptr, info_ptr); -} - -#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED -/* Initialize palette, background, etc, after transformations - * are set, but before any reading takes place. This allows - * the user to obtain a gamma-corrected palette, for example. - * If the user doesn't call this, we will do it ourselves. - */ -void PNGAPI -png_start_read_image(png_structp png_ptr) -{ - png_debug(1, "in png_start_read_image"); - if (png_ptr == NULL) - return; - if (!(png_ptr->flags & PNG_FLAG_ROW_INIT)) - png_read_start_row(png_ptr); -} -#endif /* PNG_NO_SEQUENTIAL_READ_SUPPORTED */ - -#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED -void PNGAPI -png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_CONST PNG_IDAT; - PNG_CONST int png_pass_dsp_mask[7] = {0xff, 0x0f, 0xff, 0x33, 0xff, 0x55, - 0xff}; - PNG_CONST int png_pass_mask[7] = {0x80, 0x08, 0x88, 0x22, 0xaa, 0x55, 0xff}; -#endif - int ret; - if (png_ptr == NULL) - return; - png_debug2(1, "in png_read_row (row %lu, pass %d)", - png_ptr->row_number, png_ptr->pass); - if (!(png_ptr->flags & PNG_FLAG_ROW_INIT)) - png_read_start_row(png_ptr); - if (png_ptr->row_number == 0 && png_ptr->pass == 0) - { - /* Check for transforms that have been set but were defined out */ -#if defined(PNG_WRITE_INVERT_SUPPORTED) && !defined(PNG_READ_INVERT_SUPPORTED) - if (png_ptr->transformations & PNG_INVERT_MONO) - png_warning(png_ptr, "PNG_READ_INVERT_SUPPORTED is not defined."); -#endif -#if defined(PNG_WRITE_FILLER_SUPPORTED) && !defined(PNG_READ_FILLER_SUPPORTED) - if (png_ptr->transformations & PNG_FILLER) - png_warning(png_ptr, "PNG_READ_FILLER_SUPPORTED is not defined."); -#endif -#if defined(PNG_WRITE_PACKSWAP_SUPPORTED) && !defined(PNG_READ_PACKSWAP_SUPPORTED) - if (png_ptr->transformations & PNG_PACKSWAP) - png_warning(png_ptr, "PNG_READ_PACKSWAP_SUPPORTED is not defined."); -#endif -#if defined(PNG_WRITE_PACK_SUPPORTED) && !defined(PNG_READ_PACK_SUPPORTED) - if (png_ptr->transformations & PNG_PACK) - png_warning(png_ptr, "PNG_READ_PACK_SUPPORTED is not defined."); -#endif -#if defined(PNG_WRITE_SHIFT_SUPPORTED) && !defined(PNG_READ_SHIFT_SUPPORTED) - if (png_ptr->transformations & PNG_SHIFT) - png_warning(png_ptr, "PNG_READ_SHIFT_SUPPORTED is not defined."); -#endif -#if defined(PNG_WRITE_BGR_SUPPORTED) && !defined(PNG_READ_BGR_SUPPORTED) - if (png_ptr->transformations & PNG_BGR) - png_warning(png_ptr, "PNG_READ_BGR_SUPPORTED is not defined."); -#endif -#if defined(PNG_WRITE_SWAP_SUPPORTED) && !defined(PNG_READ_SWAP_SUPPORTED) - if (png_ptr->transformations & PNG_SWAP_BYTES) - png_warning(png_ptr, "PNG_READ_SWAP_SUPPORTED is not defined."); -#endif - } - -#if defined(PNG_READ_INTERLACING_SUPPORTED) - /* If interlaced and we do not need a new row, combine row and return */ - if (png_ptr->interlaced && (png_ptr->transformations & PNG_INTERLACE)) - { - switch (png_ptr->pass) - { - case 0: - if (png_ptr->row_number & 0x07) - { - if (dsp_row != NULL) - png_combine_row(png_ptr, dsp_row, - png_pass_dsp_mask[png_ptr->pass]); - png_read_finish_row(png_ptr); - return; - } - break; - case 1: - if ((png_ptr->row_number & 0x07) || png_ptr->width < 5) - { - if (dsp_row != NULL) - png_combine_row(png_ptr, dsp_row, - png_pass_dsp_mask[png_ptr->pass]); - png_read_finish_row(png_ptr); - return; - } - break; - case 2: - if ((png_ptr->row_number & 0x07) != 4) - { - if (dsp_row != NULL && (png_ptr->row_number & 4)) - png_combine_row(png_ptr, dsp_row, - png_pass_dsp_mask[png_ptr->pass]); - png_read_finish_row(png_ptr); - return; - } - break; - case 3: - if ((png_ptr->row_number & 3) || png_ptr->width < 3) - { - if (dsp_row != NULL) - png_combine_row(png_ptr, dsp_row, - png_pass_dsp_mask[png_ptr->pass]); - png_read_finish_row(png_ptr); - return; - } - break; - case 4: - if ((png_ptr->row_number & 3) != 2) - { - if (dsp_row != NULL && (png_ptr->row_number & 2)) - png_combine_row(png_ptr, dsp_row, - png_pass_dsp_mask[png_ptr->pass]); - png_read_finish_row(png_ptr); - return; - } - break; - case 5: - if ((png_ptr->row_number & 1) || png_ptr->width < 2) - { - if (dsp_row != NULL) - png_combine_row(png_ptr, dsp_row, - png_pass_dsp_mask[png_ptr->pass]); - png_read_finish_row(png_ptr); - return; - } - break; - case 6: - if (!(png_ptr->row_number & 1)) - { - png_read_finish_row(png_ptr); - return; - } - break; - } - } -#endif - - if (!(png_ptr->mode & PNG_HAVE_IDAT)) - png_error(png_ptr, "Invalid attempt to read row data"); - - png_ptr->zstream.next_out = png_ptr->row_buf; - png_ptr->zstream.avail_out = (uInt)png_ptr->irowbytes; - do - { - if (!(png_ptr->zstream.avail_in)) - { - while (!png_ptr->idat_size) - { - png_crc_finish(png_ptr, 0); - - png_ptr->idat_size = png_read_chunk_header(png_ptr); - if (png_memcmp(png_ptr->chunk_name, png_IDAT, 4)) - png_error(png_ptr, "Not enough image data"); - } - png_ptr->zstream.avail_in = (uInt)png_ptr->zbuf_size; - png_ptr->zstream.next_in = png_ptr->zbuf; - if (png_ptr->zbuf_size > png_ptr->idat_size) - png_ptr->zstream.avail_in = (uInt)png_ptr->idat_size; - png_crc_read(png_ptr, png_ptr->zbuf, - (png_size_t)png_ptr->zstream.avail_in); - png_ptr->idat_size -= png_ptr->zstream.avail_in; - } - ret = inflate(&png_ptr->zstream, Z_PARTIAL_FLUSH); - if (ret == Z_STREAM_END) - { - if (png_ptr->zstream.avail_out || png_ptr->zstream.avail_in || - png_ptr->idat_size) - png_error(png_ptr, "Extra compressed data"); - png_ptr->mode |= PNG_AFTER_IDAT; - png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED; - break; - } - if (ret != Z_OK) - png_error(png_ptr, png_ptr->zstream.msg ? png_ptr->zstream.msg : - "Decompression error"); - - } while (png_ptr->zstream.avail_out); - - png_ptr->row_info.color_type = png_ptr->color_type; - png_ptr->row_info.width = png_ptr->iwidth; - png_ptr->row_info.channels = png_ptr->channels; - png_ptr->row_info.bit_depth = png_ptr->bit_depth; - png_ptr->row_info.pixel_depth = png_ptr->pixel_depth; - png_ptr->row_info.rowbytes = PNG_ROWBYTES(png_ptr->row_info.pixel_depth, - png_ptr->row_info.width); - - if (png_ptr->row_buf[0]) - png_read_filter_row(png_ptr, &(png_ptr->row_info), - png_ptr->row_buf + 1, png_ptr->prev_row + 1, - (int)(png_ptr->row_buf[0])); - - png_memcpy_check(png_ptr, png_ptr->prev_row, png_ptr->row_buf, - png_ptr->rowbytes + 1); - -#if defined(PNG_MNG_FEATURES_SUPPORTED) - if ((png_ptr->mng_features_permitted & PNG_FLAG_MNG_FILTER_64) && - (png_ptr->filter_type == PNG_INTRAPIXEL_DIFFERENCING)) - { - /* Intrapixel differencing */ - png_do_read_intrapixel(&(png_ptr->row_info), png_ptr->row_buf + 1); - } -#endif - - - if (png_ptr->transformations || (png_ptr->flags&PNG_FLAG_STRIP_ALPHA)) - png_do_read_transformations(png_ptr); - -#if defined(PNG_READ_INTERLACING_SUPPORTED) - /* Blow up interlaced rows to full size */ - if (png_ptr->interlaced && - (png_ptr->transformations & PNG_INTERLACE)) - { - if (png_ptr->pass < 6) - /* Old interface (pre-1.0.9): - * png_do_read_interlace(&(png_ptr->row_info), - * png_ptr->row_buf + 1, png_ptr->pass, png_ptr->transformations); - */ - png_do_read_interlace(png_ptr); - - if (dsp_row != NULL) - png_combine_row(png_ptr, dsp_row, - png_pass_dsp_mask[png_ptr->pass]); - if (row != NULL) - png_combine_row(png_ptr, row, - png_pass_mask[png_ptr->pass]); - } - else -#endif - { - if (row != NULL) - png_combine_row(png_ptr, row, 0xff); - if (dsp_row != NULL) - png_combine_row(png_ptr, dsp_row, 0xff); - } - png_read_finish_row(png_ptr); - - if (png_ptr->read_row_fn != NULL) - (*(png_ptr->read_row_fn))(png_ptr, png_ptr->row_number, png_ptr->pass); -} -#endif /* PNG_NO_SEQUENTIAL_READ_SUPPORTED */ - -#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED -/* Read one or more rows of image data. If the image is interlaced, - * and png_set_interlace_handling() has been called, the rows need to - * contain the contents of the rows from the previous pass. If the - * image has alpha or transparency, and png_handle_alpha()[*] has been - * called, the rows contents must be initialized to the contents of the - * screen. - * - * "row" holds the actual image, and pixels are placed in it - * as they arrive. If the image is displayed after each pass, it will - * appear to "sparkle" in. "display_row" can be used to display a - * "chunky" progressive image, with finer detail added as it becomes - * available. If you do not want this "chunky" display, you may pass - * NULL for display_row. If you do not want the sparkle display, and - * you have not called png_handle_alpha(), you may pass NULL for rows. - * If you have called png_handle_alpha(), and the image has either an - * alpha channel or a transparency chunk, you must provide a buffer for - * rows. In this case, you do not have to provide a display_row buffer - * also, but you may. If the image is not interlaced, or if you have - * not called png_set_interlace_handling(), the display_row buffer will - * be ignored, so pass NULL to it. - * - * [*] png_handle_alpha() does not exist yet, as of this version of libpng - */ - -void PNGAPI -png_read_rows(png_structp png_ptr, png_bytepp row, - png_bytepp display_row, png_uint_32 num_rows) -{ - png_uint_32 i; - png_bytepp rp; - png_bytepp dp; - - png_debug(1, "in png_read_rows"); - if (png_ptr == NULL) - return; - rp = row; - dp = display_row; - if (rp != NULL && dp != NULL) - for (i = 0; i < num_rows; i++) - { - png_bytep rptr = *rp++; - png_bytep dptr = *dp++; - - png_read_row(png_ptr, rptr, dptr); - } - else if (rp != NULL) - for (i = 0; i < num_rows; i++) - { - png_bytep rptr = *rp; - png_read_row(png_ptr, rptr, png_bytep_NULL); - rp++; - } - else if (dp != NULL) - for (i = 0; i < num_rows; i++) - { - png_bytep dptr = *dp; - png_read_row(png_ptr, png_bytep_NULL, dptr); - dp++; - } -} -#endif /* PNG_NO_SEQUENTIAL_READ_SUPPORTED */ - -#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED -/* Read the entire image. If the image has an alpha channel or a tRNS - * chunk, and you have called png_handle_alpha()[*], you will need to - * initialize the image to the current image that PNG will be overlaying. - * We set the num_rows again here, in case it was incorrectly set in - * png_read_start_row() by a call to png_read_update_info() or - * png_start_read_image() if png_set_interlace_handling() wasn't called - * prior to either of these functions like it should have been. You can - * only call this function once. If you desire to have an image for - * each pass of a interlaced image, use png_read_rows() instead. - * - * [*] png_handle_alpha() does not exist yet, as of this version of libpng - */ -void PNGAPI -png_read_image(png_structp png_ptr, png_bytepp image) -{ - png_uint_32 i, image_height; - int pass, j; - png_bytepp rp; - - png_debug(1, "in png_read_image"); - if (png_ptr == NULL) - return; - -#ifdef PNG_READ_INTERLACING_SUPPORTED - pass = png_set_interlace_handling(png_ptr); -#else - if (png_ptr->interlaced) - png_error(png_ptr, - "Cannot read interlaced image -- interlace handler disabled."); - pass = 1; -#endif - - - image_height=png_ptr->height; - png_ptr->num_rows = image_height; /* Make sure this is set correctly */ - - for (j = 0; j < pass; j++) - { - rp = image; - for (i = 0; i < image_height; i++) - { - png_read_row(png_ptr, *rp, png_bytep_NULL); - rp++; - } - } -} -#endif /* PNG_NO_SEQUENTIAL_READ_SUPPORTED */ - -#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED -/* Read the end of the PNG file. Will not read past the end of the - * file, will verify the end is accurate, and will read any comments - * or time information at the end of the file, if info is not NULL. - */ -void PNGAPI -png_read_end(png_structp png_ptr, png_infop info_ptr) -{ - png_debug(1, "in png_read_end"); - if (png_ptr == NULL) - return; - png_crc_finish(png_ptr, 0); /* Finish off CRC from last IDAT chunk */ - - do - { -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_CONST PNG_IHDR; - PNG_CONST PNG_IDAT; - PNG_CONST PNG_IEND; - PNG_CONST PNG_PLTE; -#if defined(PNG_READ_bKGD_SUPPORTED) - PNG_CONST PNG_bKGD; -#endif -#if defined(PNG_READ_cHRM_SUPPORTED) - PNG_CONST PNG_cHRM; -#endif -#if defined(PNG_READ_gAMA_SUPPORTED) - PNG_CONST PNG_gAMA; -#endif -#if defined(PNG_READ_hIST_SUPPORTED) - PNG_CONST PNG_hIST; -#endif -#if defined(PNG_READ_iCCP_SUPPORTED) - PNG_CONST PNG_iCCP; -#endif -#if defined(PNG_READ_iTXt_SUPPORTED) - PNG_CONST PNG_iTXt; -#endif -#if defined(PNG_READ_oFFs_SUPPORTED) - PNG_CONST PNG_oFFs; -#endif -#if defined(PNG_READ_pCAL_SUPPORTED) - PNG_CONST PNG_pCAL; -#endif -#if defined(PNG_READ_pHYs_SUPPORTED) - PNG_CONST PNG_pHYs; -#endif -#if defined(PNG_READ_sBIT_SUPPORTED) - PNG_CONST PNG_sBIT; -#endif -#if defined(PNG_READ_sCAL_SUPPORTED) - PNG_CONST PNG_sCAL; -#endif -#if defined(PNG_READ_sPLT_SUPPORTED) - PNG_CONST PNG_sPLT; -#endif -#if defined(PNG_READ_sRGB_SUPPORTED) - PNG_CONST PNG_sRGB; -#endif -#if defined(PNG_READ_tEXt_SUPPORTED) - PNG_CONST PNG_tEXt; -#endif -#if defined(PNG_READ_tIME_SUPPORTED) - PNG_CONST PNG_tIME; -#endif -#if defined(PNG_READ_tRNS_SUPPORTED) - PNG_CONST PNG_tRNS; -#endif -#if defined(PNG_READ_zTXt_SUPPORTED) - PNG_CONST PNG_zTXt; -#endif -#endif /* PNG_USE_LOCAL_ARRAYS */ - png_uint_32 length = png_read_chunk_header(png_ptr); - PNG_CONST png_bytep chunk_name = png_ptr->chunk_name; - - if (!png_memcmp(chunk_name, png_IHDR, 4)) - png_handle_IHDR(png_ptr, info_ptr, length); - else if (!png_memcmp(chunk_name, png_IEND, 4)) - png_handle_IEND(png_ptr, info_ptr, length); -#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED - else if (png_handle_as_unknown(png_ptr, chunk_name)) - { - if (!png_memcmp(chunk_name, png_IDAT, 4)) - { - if ((length > 0) || (png_ptr->mode & PNG_HAVE_CHUNK_AFTER_IDAT)) - png_error(png_ptr, "Too many IDAT's found"); - } - png_handle_unknown(png_ptr, info_ptr, length); - if (!png_memcmp(chunk_name, png_PLTE, 4)) - png_ptr->mode |= PNG_HAVE_PLTE; - } -#endif - else if (!png_memcmp(chunk_name, png_IDAT, 4)) - { - /* Zero length IDATs are legal after the last IDAT has been - * read, but not after other chunks have been read. - */ - if ((length > 0) || (png_ptr->mode & PNG_HAVE_CHUNK_AFTER_IDAT)) - png_error(png_ptr, "Too many IDAT's found"); - png_crc_finish(png_ptr, length); - } - else if (!png_memcmp(chunk_name, png_PLTE, 4)) - png_handle_PLTE(png_ptr, info_ptr, length); -#if defined(PNG_READ_bKGD_SUPPORTED) - else if (!png_memcmp(chunk_name, png_bKGD, 4)) - png_handle_bKGD(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_cHRM_SUPPORTED) - else if (!png_memcmp(chunk_name, png_cHRM, 4)) - png_handle_cHRM(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_gAMA_SUPPORTED) - else if (!png_memcmp(chunk_name, png_gAMA, 4)) - png_handle_gAMA(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_hIST_SUPPORTED) - else if (!png_memcmp(chunk_name, png_hIST, 4)) - png_handle_hIST(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_oFFs_SUPPORTED) - else if (!png_memcmp(chunk_name, png_oFFs, 4)) - png_handle_oFFs(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_pCAL_SUPPORTED) - else if (!png_memcmp(chunk_name, png_pCAL, 4)) - png_handle_pCAL(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_sCAL_SUPPORTED) - else if (!png_memcmp(chunk_name, png_sCAL, 4)) - png_handle_sCAL(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_pHYs_SUPPORTED) - else if (!png_memcmp(chunk_name, png_pHYs, 4)) - png_handle_pHYs(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_sBIT_SUPPORTED) - else if (!png_memcmp(chunk_name, png_sBIT, 4)) - png_handle_sBIT(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_sRGB_SUPPORTED) - else if (!png_memcmp(chunk_name, png_sRGB, 4)) - png_handle_sRGB(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_iCCP_SUPPORTED) - else if (!png_memcmp(chunk_name, png_iCCP, 4)) - png_handle_iCCP(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_sPLT_SUPPORTED) - else if (!png_memcmp(chunk_name, png_sPLT, 4)) - png_handle_sPLT(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_tEXt_SUPPORTED) - else if (!png_memcmp(chunk_name, png_tEXt, 4)) - png_handle_tEXt(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_tIME_SUPPORTED) - else if (!png_memcmp(chunk_name, png_tIME, 4)) - png_handle_tIME(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_tRNS_SUPPORTED) - else if (!png_memcmp(chunk_name, png_tRNS, 4)) - png_handle_tRNS(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_zTXt_SUPPORTED) - else if (!png_memcmp(chunk_name, png_zTXt, 4)) - png_handle_zTXt(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_iTXt_SUPPORTED) - else if (!png_memcmp(chunk_name, png_iTXt, 4)) - png_handle_iTXt(png_ptr, info_ptr, length); -#endif - else - png_handle_unknown(png_ptr, info_ptr, length); - } while (!(png_ptr->mode & PNG_HAVE_IEND)); -} -#endif /* PNG_NO_SEQUENTIAL_READ_SUPPORTED */ - -/* Free all memory used by the read */ -void PNGAPI -png_destroy_read_struct(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr, - png_infopp end_info_ptr_ptr) -{ - png_structp png_ptr = NULL; - png_infop info_ptr = NULL, end_info_ptr = NULL; -#ifdef PNG_USER_MEM_SUPPORTED - png_free_ptr free_fn = NULL; - png_voidp mem_ptr = NULL; -#endif - - png_debug(1, "in png_destroy_read_struct"); - if (png_ptr_ptr != NULL) - png_ptr = *png_ptr_ptr; - if (png_ptr == NULL) - return; - -#ifdef PNG_USER_MEM_SUPPORTED - free_fn = png_ptr->free_fn; - mem_ptr = png_ptr->mem_ptr; -#endif - - if (info_ptr_ptr != NULL) - info_ptr = *info_ptr_ptr; - - if (end_info_ptr_ptr != NULL) - end_info_ptr = *end_info_ptr_ptr; - - png_read_destroy(png_ptr, info_ptr, end_info_ptr); - - if (info_ptr != NULL) - { -#if defined(PNG_TEXT_SUPPORTED) - png_free_data(png_ptr, info_ptr, PNG_FREE_TEXT, -1); -#endif - -#ifdef PNG_USER_MEM_SUPPORTED - png_destroy_struct_2((png_voidp)info_ptr, (png_free_ptr)free_fn, - (png_voidp)mem_ptr); -#else - png_destroy_struct((png_voidp)info_ptr); -#endif - *info_ptr_ptr = NULL; - } - - if (end_info_ptr != NULL) - { -#if defined(PNG_READ_TEXT_SUPPORTED) - png_free_data(png_ptr, end_info_ptr, PNG_FREE_TEXT, -1); -#endif -#ifdef PNG_USER_MEM_SUPPORTED - png_destroy_struct_2((png_voidp)end_info_ptr, (png_free_ptr)free_fn, - (png_voidp)mem_ptr); -#else - png_destroy_struct((png_voidp)end_info_ptr); -#endif - *end_info_ptr_ptr = NULL; - } - - if (png_ptr != NULL) - { -#ifdef PNG_USER_MEM_SUPPORTED - png_destroy_struct_2((png_voidp)png_ptr, (png_free_ptr)free_fn, - (png_voidp)mem_ptr); -#else - png_destroy_struct((png_voidp)png_ptr); -#endif - *png_ptr_ptr = NULL; - } -} - -/* Free all memory used by the read (old method) */ -void /* PRIVATE */ -png_read_destroy(png_structp png_ptr, png_infop info_ptr, png_infop end_info_ptr) -{ -#ifdef PNG_SETJMP_SUPPORTED - jmp_buf tmp_jmp; -#endif - png_error_ptr error_fn; - png_error_ptr warning_fn; - png_voidp error_ptr; -#ifdef PNG_USER_MEM_SUPPORTED - png_free_ptr free_fn; -#endif - - png_debug(1, "in png_read_destroy"); - if (info_ptr != NULL) - png_info_destroy(png_ptr, info_ptr); - - if (end_info_ptr != NULL) - png_info_destroy(png_ptr, end_info_ptr); - - png_free(png_ptr, png_ptr->zbuf); - png_free(png_ptr, png_ptr->big_row_buf); - png_free(png_ptr, png_ptr->prev_row); - png_free(png_ptr, png_ptr->chunkdata); -#if defined(PNG_READ_DITHER_SUPPORTED) - png_free(png_ptr, png_ptr->palette_lookup); - png_free(png_ptr, png_ptr->dither_index); -#endif -#if defined(PNG_READ_GAMMA_SUPPORTED) - png_free(png_ptr, png_ptr->gamma_table); -#endif -#if defined(PNG_READ_BACKGROUND_SUPPORTED) - png_free(png_ptr, png_ptr->gamma_from_1); - png_free(png_ptr, png_ptr->gamma_to_1); -#endif -#ifdef PNG_FREE_ME_SUPPORTED - if (png_ptr->free_me & PNG_FREE_PLTE) - png_zfree(png_ptr, png_ptr->palette); - png_ptr->free_me &= ~PNG_FREE_PLTE; -#else - if (png_ptr->flags & PNG_FLAG_FREE_PLTE) - png_zfree(png_ptr, png_ptr->palette); - png_ptr->flags &= ~PNG_FLAG_FREE_PLTE; -#endif -#if defined(PNG_tRNS_SUPPORTED) || \ - defined(PNG_READ_EXPAND_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) -#ifdef PNG_FREE_ME_SUPPORTED - if (png_ptr->free_me & PNG_FREE_TRNS) - png_free(png_ptr, png_ptr->trans); - png_ptr->free_me &= ~PNG_FREE_TRNS; -#else - if (png_ptr->flags & PNG_FLAG_FREE_TRNS) - png_free(png_ptr, png_ptr->trans); - png_ptr->flags &= ~PNG_FLAG_FREE_TRNS; -#endif -#endif -#if defined(PNG_READ_hIST_SUPPORTED) -#ifdef PNG_FREE_ME_SUPPORTED - if (png_ptr->free_me & PNG_FREE_HIST) - png_free(png_ptr, png_ptr->hist); - png_ptr->free_me &= ~PNG_FREE_HIST; -#else - if (png_ptr->flags & PNG_FLAG_FREE_HIST) - png_free(png_ptr, png_ptr->hist); - png_ptr->flags &= ~PNG_FLAG_FREE_HIST; -#endif -#endif -#if defined(PNG_READ_GAMMA_SUPPORTED) - if (png_ptr->gamma_16_table != NULL) - { - int i; - int istop = (1 << (8 - png_ptr->gamma_shift)); - for (i = 0; i < istop; i++) - { - png_free(png_ptr, png_ptr->gamma_16_table[i]); - } - png_free(png_ptr, png_ptr->gamma_16_table); - } -#if defined(PNG_READ_BACKGROUND_SUPPORTED) - if (png_ptr->gamma_16_from_1 != NULL) - { - int i; - int istop = (1 << (8 - png_ptr->gamma_shift)); - for (i = 0; i < istop; i++) - { - png_free(png_ptr, png_ptr->gamma_16_from_1[i]); - } - png_free(png_ptr, png_ptr->gamma_16_from_1); - } - if (png_ptr->gamma_16_to_1 != NULL) - { - int i; - int istop = (1 << (8 - png_ptr->gamma_shift)); - for (i = 0; i < istop; i++) - { - png_free(png_ptr, png_ptr->gamma_16_to_1[i]); - } - png_free(png_ptr, png_ptr->gamma_16_to_1); - } -#endif -#endif -#if defined(PNG_TIME_RFC1123_SUPPORTED) - png_free(png_ptr, png_ptr->time_buffer); -#endif - - inflateEnd(&png_ptr->zstream); -#ifdef PNG_PROGRESSIVE_READ_SUPPORTED - png_free(png_ptr, png_ptr->save_buffer); -#endif - -#ifdef PNG_PROGRESSIVE_READ_SUPPORTED -#ifdef PNG_TEXT_SUPPORTED - png_free(png_ptr, png_ptr->current_text); -#endif /* PNG_TEXT_SUPPORTED */ -#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ - - /* Save the important info out of the png_struct, in case it is - * being used again. - */ -#ifdef PNG_SETJMP_SUPPORTED - png_memcpy(tmp_jmp, png_ptr->jmpbuf, png_sizeof(jmp_buf)); -#endif - - error_fn = png_ptr->error_fn; - warning_fn = png_ptr->warning_fn; - error_ptr = png_ptr->error_ptr; -#ifdef PNG_USER_MEM_SUPPORTED - free_fn = png_ptr->free_fn; -#endif - - png_memset(png_ptr, 0, png_sizeof(png_struct)); - - png_ptr->error_fn = error_fn; - png_ptr->warning_fn = warning_fn; - png_ptr->error_ptr = error_ptr; -#ifdef PNG_USER_MEM_SUPPORTED - png_ptr->free_fn = free_fn; -#endif - -#ifdef PNG_SETJMP_SUPPORTED - png_memcpy(png_ptr->jmpbuf, tmp_jmp, png_sizeof(jmp_buf)); -#endif - -} - -void PNGAPI -png_set_read_status_fn(png_structp png_ptr, png_read_status_ptr read_row_fn) -{ - if (png_ptr == NULL) - return; - png_ptr->read_row_fn = read_row_fn; -} - - -#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED -#if defined(PNG_INFO_IMAGE_SUPPORTED) -void PNGAPI -png_read_png(png_structp png_ptr, png_infop info_ptr, - int transforms, - voidp params) -{ - int row; - - if (png_ptr == NULL) - return; -#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) - /* Invert the alpha channel from opacity to transparency - */ - if (transforms & PNG_TRANSFORM_INVERT_ALPHA) - png_set_invert_alpha(png_ptr); -#endif - - /* png_read_info() gives us all of the information from the - * PNG file before the first IDAT (image data chunk). - */ - png_read_info(png_ptr, info_ptr); - if (info_ptr->height > PNG_UINT_32_MAX/png_sizeof(png_bytep)) - png_error(png_ptr, "Image is too high to process with png_read_png()"); - - /* -------------- image transformations start here ------------------- */ - -#if defined(PNG_READ_16_TO_8_SUPPORTED) - /* Tell libpng to strip 16 bit/color files down to 8 bits per color. - */ - if (transforms & PNG_TRANSFORM_STRIP_16) - png_set_strip_16(png_ptr); -#endif - -#if defined(PNG_READ_STRIP_ALPHA_SUPPORTED) - /* Strip alpha bytes from the input data without combining with - * the background (not recommended). - */ - if (transforms & PNG_TRANSFORM_STRIP_ALPHA) - png_set_strip_alpha(png_ptr); -#endif - -#if defined(PNG_READ_PACK_SUPPORTED) && !defined(PNG_READ_EXPAND_SUPPORTED) - /* Extract multiple pixels with bit depths of 1, 2, or 4 from a single - * byte into separate bytes (useful for paletted and grayscale images). - */ - if (transforms & PNG_TRANSFORM_PACKING) - png_set_packing(png_ptr); -#endif - -#if defined(PNG_READ_PACKSWAP_SUPPORTED) - /* Change the order of packed pixels to least significant bit first - * (not useful if you are using png_set_packing). - */ - if (transforms & PNG_TRANSFORM_PACKSWAP) - png_set_packswap(png_ptr); -#endif - -#if defined(PNG_READ_EXPAND_SUPPORTED) - /* Expand paletted colors into true RGB triplets - * Expand grayscale images to full 8 bits from 1, 2, or 4 bits/pixel - * Expand paletted or RGB images with transparency to full alpha - * channels so the data will be available as RGBA quartets. - */ - if (transforms & PNG_TRANSFORM_EXPAND) - if ((png_ptr->bit_depth < 8) || - (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) || - (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS))) - png_set_expand(png_ptr); -#endif - - /* We don't handle background color or gamma transformation or dithering. - */ - -#if defined(PNG_READ_INVERT_SUPPORTED) - /* Invert monochrome files to have 0 as white and 1 as black - */ - if (transforms & PNG_TRANSFORM_INVERT_MONO) - png_set_invert_mono(png_ptr); -#endif - -#if defined(PNG_READ_SHIFT_SUPPORTED) - /* If you want to shift the pixel values from the range [0,255] or - * [0,65535] to the original [0,7] or [0,31], or whatever range the - * colors were originally in: - */ - if ((transforms & PNG_TRANSFORM_SHIFT) - && png_get_valid(png_ptr, info_ptr, PNG_INFO_sBIT)) - { - png_color_8p sig_bit; - - png_get_sBIT(png_ptr, info_ptr, &sig_bit); - png_set_shift(png_ptr, sig_bit); - } -#endif - -#if defined(PNG_READ_BGR_SUPPORTED) - /* Flip the RGB pixels to BGR (or RGBA to BGRA) - */ - if (transforms & PNG_TRANSFORM_BGR) - png_set_bgr(png_ptr); -#endif - -#if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) - /* Swap the RGBA or GA data to ARGB or AG (or BGRA to ABGR) - */ - if (transforms & PNG_TRANSFORM_SWAP_ALPHA) - png_set_swap_alpha(png_ptr); -#endif - -#if defined(PNG_READ_SWAP_SUPPORTED) - /* Swap bytes of 16 bit files to least significant byte first - */ - if (transforms & PNG_TRANSFORM_SWAP_ENDIAN) - png_set_swap(png_ptr); -#endif - - /* We don't handle adding filler bytes */ - - /* Optional call to gamma correct and add the background to the palette - * and update info structure. REQUIRED if you are expecting libpng to - * update the palette for you (i.e., you selected such a transform above). - */ - png_read_update_info(png_ptr, info_ptr); - - /* -------------- image transformations end here ------------------- */ - -#ifdef PNG_FREE_ME_SUPPORTED - png_free_data(png_ptr, info_ptr, PNG_FREE_ROWS, 0); -#endif - if (info_ptr->row_pointers == NULL) - { - info_ptr->row_pointers = (png_bytepp)png_malloc(png_ptr, - info_ptr->height * png_sizeof(png_bytep)); - png_memset(info_ptr->row_pointers, 0, info_ptr->height - * png_sizeof(png_bytep)); -#ifdef PNG_FREE_ME_SUPPORTED - info_ptr->free_me |= PNG_FREE_ROWS; -#endif - for (row = 0; row < (int)info_ptr->height; row++) - info_ptr->row_pointers[row] = (png_bytep)png_malloc(png_ptr, - png_get_rowbytes(png_ptr, info_ptr)); - } - - png_read_image(png_ptr, info_ptr->row_pointers); - info_ptr->valid |= PNG_INFO_IDAT; - - /* Read rest of file, and get additional chunks in info_ptr - REQUIRED */ - png_read_end(png_ptr, info_ptr); - - transforms = transforms; /* Quiet compiler warnings */ - params = params; - -} -#endif /* PNG_INFO_IMAGE_SUPPORTED */ -#endif /* PNG_NO_SEQUENTIAL_READ_SUPPORTED */ -#endif /* PNG_READ_SUPPORTED */ diff --git a/src/libpng/pngrio.c b/src/libpng/pngrio.c deleted file mode 100644 index 8704afa4b..000000000 --- a/src/libpng/pngrio.c +++ /dev/null @@ -1,174 +0,0 @@ - -/* pngrio.c - functions for data input - * - * Last changed in libpng 1.2.37 [June 4, 2009] - * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2009 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - * - * This file provides a location for all input. Users who need - * special handling are expected to write a function that has the same - * arguments as this and performs a similar function, but that possibly - * has a different input method. Note that you shouldn't change this - * function, but rather write a replacement function and then make - * libpng use it at run time with png_set_read_fn(...). - */ - -#define PNG_INTERNAL -#include "png.h" -#if defined(PNG_READ_SUPPORTED) - -/* Read the data from whatever input you are using. The default routine - * reads from a file pointer. Note that this routine sometimes gets called - * with very small lengths, so you should implement some kind of simple - * buffering if you are using unbuffered reads. This should never be asked - * to read more then 64K on a 16 bit machine. - */ -void /* PRIVATE */ -png_read_data(png_structp png_ptr, png_bytep data, png_size_t length) -{ - png_debug1(4, "reading %d bytes", (int)length); - if (png_ptr->read_data_fn != NULL) - (*(png_ptr->read_data_fn))(png_ptr, data, length); - else - png_error(png_ptr, "Call to NULL read function"); -} - -#if !defined(PNG_NO_STDIO) -/* This is the function that does the actual reading of data. If you are - * not reading from a standard C stream, you should create a replacement - * read_data function and use it at run time with png_set_read_fn(), rather - * than changing the library. - */ -#ifndef USE_FAR_KEYWORD -void PNGAPI -png_default_read_data(png_structp png_ptr, png_bytep data, png_size_t length) -{ - png_size_t check; - - if (png_ptr == NULL) - return; - /* fread() returns 0 on error, so it is OK to store this in a png_size_t - * instead of an int, which is what fread() actually returns. - */ -#if defined(_WIN32_WCE) - if ( !ReadFile((HANDLE)(png_ptr->io_ptr), data, length, &check, NULL) ) - check = 0; -#else - check = (png_size_t)fread(data, (png_size_t)1, length, - (png_FILE_p)png_ptr->io_ptr); -#endif - - if (check != length) - png_error(png_ptr, "Read Error"); -} -#else -/* This is the model-independent version. Since the standard I/O library - can't handle far buffers in the medium and small models, we have to copy - the data. -*/ - -#define NEAR_BUF_SIZE 1024 -#define MIN(a,b) (a <= b ? a : b) - -static void PNGAPI -png_default_read_data(png_structp png_ptr, png_bytep data, png_size_t length) -{ - int check; - png_byte *n_data; - png_FILE_p io_ptr; - - if (png_ptr == NULL) - return; - /* Check if data really is near. If so, use usual code. */ - n_data = (png_byte *)CVT_PTR_NOCHECK(data); - io_ptr = (png_FILE_p)CVT_PTR(png_ptr->io_ptr); - if ((png_bytep)n_data == data) - { -#if defined(_WIN32_WCE) - if ( !ReadFile((HANDLE)(png_ptr->io_ptr), data, length, &check, NULL) ) - check = 0; -#else - check = fread(n_data, 1, length, io_ptr); -#endif - } - else - { - png_byte buf[NEAR_BUF_SIZE]; - png_size_t read, remaining, err; - check = 0; - remaining = length; - do - { - read = MIN(NEAR_BUF_SIZE, remaining); -#if defined(_WIN32_WCE) - if ( !ReadFile((HANDLE)(io_ptr), buf, read, &err, NULL) ) - err = 0; -#else - err = fread(buf, (png_size_t)1, read, io_ptr); -#endif - png_memcpy(data, buf, read); /* copy far buffer to near buffer */ - if (err != read) - break; - else - check += err; - data += read; - remaining -= read; - } - while (remaining != 0); - } - if ((png_uint_32)check != (png_uint_32)length) - png_error(png_ptr, "read Error"); -} -#endif -#endif - -/* This function allows the application to supply a new input function - * for libpng if standard C streams aren't being used. - * - * This function takes as its arguments: - * png_ptr - pointer to a png input data structure - * io_ptr - pointer to user supplied structure containing info about - * the input functions. May be NULL. - * read_data_fn - pointer to a new input function that takes as its - * arguments a pointer to a png_struct, a pointer to - * a location where input data can be stored, and a 32-bit - * unsigned int that is the number of bytes to be read. - * To exit and output any fatal error messages the new write - * function should call png_error(png_ptr, "Error msg"). - * May be NULL, in which case libpng's default function will - * be used. - */ -void PNGAPI -png_set_read_fn(png_structp png_ptr, png_voidp io_ptr, - png_rw_ptr read_data_fn) -{ - if (png_ptr == NULL) - return; - png_ptr->io_ptr = io_ptr; - -#if !defined(PNG_NO_STDIO) - if (read_data_fn != NULL) - png_ptr->read_data_fn = read_data_fn; - else - png_ptr->read_data_fn = png_default_read_data; -#else - png_ptr->read_data_fn = read_data_fn; -#endif - - /* It is an error to write to a read device */ - if (png_ptr->write_data_fn != NULL) - { - png_ptr->write_data_fn = NULL; - png_warning(png_ptr, - "It's an error to set both read_data_fn and write_data_fn in the "); - png_warning(png_ptr, - "same structure. Resetting write_data_fn to NULL."); - } - -#if defined(PNG_WRITE_FLUSH_SUPPORTED) - png_ptr->output_flush_fn = NULL; -#endif -} -#endif /* PNG_READ_SUPPORTED */ diff --git a/src/libpng/pngrtran.c b/src/libpng/pngrtran.c deleted file mode 100644 index 1c7f474b4..000000000 --- a/src/libpng/pngrtran.c +++ /dev/null @@ -1,4382 +0,0 @@ - -/* pngrtran.c - transforms the data in a row for PNG readers - * - * Last changed in libpng 1.2.37 [June 4, 2009] - * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2009 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - * - * This file contains functions optionally called by an application - * in order to tell libpng how to handle data when reading a PNG. - * Transformations that are used in both reading and writing are - * in pngtrans.c. - */ - -#define PNG_INTERNAL -#include "png.h" -#if defined(PNG_READ_SUPPORTED) - -/* Set the action on getting a CRC error for an ancillary or critical chunk. */ -void PNGAPI -png_set_crc_action(png_structp png_ptr, int crit_action, int ancil_action) -{ - png_debug(1, "in png_set_crc_action"); - /* Tell libpng how we react to CRC errors in critical chunks */ - if (png_ptr == NULL) - return; - switch (crit_action) - { - case PNG_CRC_NO_CHANGE: /* Leave setting as is */ - break; - - case PNG_CRC_WARN_USE: /* Warn/use data */ - png_ptr->flags &= ~PNG_FLAG_CRC_CRITICAL_MASK; - png_ptr->flags |= PNG_FLAG_CRC_CRITICAL_USE; - break; - - case PNG_CRC_QUIET_USE: /* Quiet/use data */ - png_ptr->flags &= ~PNG_FLAG_CRC_CRITICAL_MASK; - png_ptr->flags |= PNG_FLAG_CRC_CRITICAL_USE | - PNG_FLAG_CRC_CRITICAL_IGNORE; - break; - - case PNG_CRC_WARN_DISCARD: /* Not a valid action for critical data */ - png_warning(png_ptr, - "Can't discard critical data on CRC error."); - case PNG_CRC_ERROR_QUIT: /* Error/quit */ - - case PNG_CRC_DEFAULT: - default: - png_ptr->flags &= ~PNG_FLAG_CRC_CRITICAL_MASK; - break; - } - - switch (ancil_action) - { - case PNG_CRC_NO_CHANGE: /* Leave setting as is */ - break; - - case PNG_CRC_WARN_USE: /* Warn/use data */ - png_ptr->flags &= ~PNG_FLAG_CRC_ANCILLARY_MASK; - png_ptr->flags |= PNG_FLAG_CRC_ANCILLARY_USE; - break; - - case PNG_CRC_QUIET_USE: /* Quiet/use data */ - png_ptr->flags &= ~PNG_FLAG_CRC_ANCILLARY_MASK; - png_ptr->flags |= PNG_FLAG_CRC_ANCILLARY_USE | - PNG_FLAG_CRC_ANCILLARY_NOWARN; - break; - - case PNG_CRC_ERROR_QUIT: /* Error/quit */ - png_ptr->flags &= ~PNG_FLAG_CRC_ANCILLARY_MASK; - png_ptr->flags |= PNG_FLAG_CRC_ANCILLARY_NOWARN; - break; - - case PNG_CRC_WARN_DISCARD: /* Warn/discard data */ - - case PNG_CRC_DEFAULT: - default: - png_ptr->flags &= ~PNG_FLAG_CRC_ANCILLARY_MASK; - break; - } -} - -#if defined(PNG_READ_BACKGROUND_SUPPORTED) && \ - defined(PNG_FLOATING_POINT_SUPPORTED) -/* Handle alpha and tRNS via a background color */ -void PNGAPI -png_set_background(png_structp png_ptr, - png_color_16p background_color, int background_gamma_code, - int need_expand, double background_gamma) -{ - png_debug(1, "in png_set_background"); - if (png_ptr == NULL) - return; - if (background_gamma_code == PNG_BACKGROUND_GAMMA_UNKNOWN) - { - png_warning(png_ptr, "Application must supply a known background gamma"); - return; - } - - png_ptr->transformations |= PNG_BACKGROUND; - png_memcpy(&(png_ptr->background), background_color, - png_sizeof(png_color_16)); - png_ptr->background_gamma = (float)background_gamma; - png_ptr->background_gamma_type = (png_byte)(background_gamma_code); - png_ptr->transformations |= (need_expand ? PNG_BACKGROUND_EXPAND : 0); -} -#endif - -#if defined(PNG_READ_16_TO_8_SUPPORTED) -/* Strip 16 bit depth files to 8 bit depth */ -void PNGAPI -png_set_strip_16(png_structp png_ptr) -{ - png_debug(1, "in png_set_strip_16"); - if (png_ptr == NULL) - return; - png_ptr->transformations |= PNG_16_TO_8; -} -#endif - -#if defined(PNG_READ_STRIP_ALPHA_SUPPORTED) -void PNGAPI -png_set_strip_alpha(png_structp png_ptr) -{ - png_debug(1, "in png_set_strip_alpha"); - if (png_ptr == NULL) - return; - png_ptr->flags |= PNG_FLAG_STRIP_ALPHA; -} -#endif - -#if defined(PNG_READ_DITHER_SUPPORTED) -/* Dither file to 8 bit. Supply a palette, the current number - * of elements in the palette, the maximum number of elements - * allowed, and a histogram if possible. If the current number - * of colors is greater then the maximum number, the palette will be - * modified to fit in the maximum number. "full_dither" indicates - * whether we need a dithering cube set up for RGB images, or if we - * simply are reducing the number of colors in a paletted image. - */ - -typedef struct png_dsort_struct -{ - struct png_dsort_struct FAR * next; - png_byte left; - png_byte right; -} png_dsort; -typedef png_dsort FAR * png_dsortp; -typedef png_dsort FAR * FAR * png_dsortpp; - -void PNGAPI -png_set_dither(png_structp png_ptr, png_colorp palette, - int num_palette, int maximum_colors, png_uint_16p histogram, - int full_dither) -{ - png_debug(1, "in png_set_dither"); - if (png_ptr == NULL) - return; - png_ptr->transformations |= PNG_DITHER; - - if (!full_dither) - { - int i; - - png_ptr->dither_index = (png_bytep)png_malloc(png_ptr, - (png_uint_32)(num_palette * png_sizeof(png_byte))); - for (i = 0; i < num_palette; i++) - png_ptr->dither_index[i] = (png_byte)i; - } - - if (num_palette > maximum_colors) - { - if (histogram != NULL) - { - /* This is easy enough, just throw out the least used colors. - * Perhaps not the best solution, but good enough. - */ - - int i; - - /* Initialize an array to sort colors */ - png_ptr->dither_sort = (png_bytep)png_malloc(png_ptr, - (png_uint_32)(num_palette * png_sizeof(png_byte))); - - /* Initialize the dither_sort array */ - for (i = 0; i < num_palette; i++) - png_ptr->dither_sort[i] = (png_byte)i; - - /* Find the least used palette entries by starting a - * bubble sort, and running it until we have sorted - * out enough colors. Note that we don't care about - * sorting all the colors, just finding which are - * least used. - */ - - for (i = num_palette - 1; i >= maximum_colors; i--) - { - int done; /* To stop early if the list is pre-sorted */ - int j; - - done = 1; - for (j = 0; j < i; j++) - { - if (histogram[png_ptr->dither_sort[j]] - < histogram[png_ptr->dither_sort[j + 1]]) - { - png_byte t; - - t = png_ptr->dither_sort[j]; - png_ptr->dither_sort[j] = png_ptr->dither_sort[j + 1]; - png_ptr->dither_sort[j + 1] = t; - done = 0; - } - } - if (done) - break; - } - - /* Swap the palette around, and set up a table, if necessary */ - if (full_dither) - { - int j = num_palette; - - /* Put all the useful colors within the max, but don't - * move the others. - */ - for (i = 0; i < maximum_colors; i++) - { - if ((int)png_ptr->dither_sort[i] >= maximum_colors) - { - do - j--; - while ((int)png_ptr->dither_sort[j] >= maximum_colors); - palette[i] = palette[j]; - } - } - } - else - { - int j = num_palette; - - /* Move all the used colors inside the max limit, and - * develop a translation table. - */ - for (i = 0; i < maximum_colors; i++) - { - /* Only move the colors we need to */ - if ((int)png_ptr->dither_sort[i] >= maximum_colors) - { - png_color tmp_color; - - do - j--; - while ((int)png_ptr->dither_sort[j] >= maximum_colors); - - tmp_color = palette[j]; - palette[j] = palette[i]; - palette[i] = tmp_color; - /* Indicate where the color went */ - png_ptr->dither_index[j] = (png_byte)i; - png_ptr->dither_index[i] = (png_byte)j; - } - } - - /* Find closest color for those colors we are not using */ - for (i = 0; i < num_palette; i++) - { - if ((int)png_ptr->dither_index[i] >= maximum_colors) - { - int min_d, k, min_k, d_index; - - /* Find the closest color to one we threw out */ - d_index = png_ptr->dither_index[i]; - min_d = PNG_COLOR_DIST(palette[d_index], palette[0]); - for (k = 1, min_k = 0; k < maximum_colors; k++) - { - int d; - - d = PNG_COLOR_DIST(palette[d_index], palette[k]); - - if (d < min_d) - { - min_d = d; - min_k = k; - } - } - /* Point to closest color */ - png_ptr->dither_index[i] = (png_byte)min_k; - } - } - } - png_free(png_ptr, png_ptr->dither_sort); - png_ptr->dither_sort = NULL; - } - else - { - /* This is much harder to do simply (and quickly). Perhaps - * we need to go through a median cut routine, but those - * don't always behave themselves with only a few colors - * as input. So we will just find the closest two colors, - * and throw out one of them (chosen somewhat randomly). - * [We don't understand this at all, so if someone wants to - * work on improving it, be our guest - AED, GRP] - */ - int i; - int max_d; - int num_new_palette; - png_dsortp t; - png_dsortpp hash; - - t = NULL; - - /* Initialize palette index arrays */ - png_ptr->index_to_palette = (png_bytep)png_malloc(png_ptr, - (png_uint_32)(num_palette * png_sizeof(png_byte))); - png_ptr->palette_to_index = (png_bytep)png_malloc(png_ptr, - (png_uint_32)(num_palette * png_sizeof(png_byte))); - - /* Initialize the sort array */ - for (i = 0; i < num_palette; i++) - { - png_ptr->index_to_palette[i] = (png_byte)i; - png_ptr->palette_to_index[i] = (png_byte)i; - } - - hash = (png_dsortpp)png_malloc(png_ptr, (png_uint_32)(769 * - png_sizeof(png_dsortp))); - png_memset(hash, 0, 769 * png_sizeof(png_dsortp)); - - num_new_palette = num_palette; - - /* Initial wild guess at how far apart the farthest pixel - * pair we will be eliminating will be. Larger - * numbers mean more areas will be allocated, Smaller - * numbers run the risk of not saving enough data, and - * having to do this all over again. - * - * I have not done extensive checking on this number. - */ - max_d = 96; - - while (num_new_palette > maximum_colors) - { - for (i = 0; i < num_new_palette - 1; i++) - { - int j; - - for (j = i + 1; j < num_new_palette; j++) - { - int d; - - d = PNG_COLOR_DIST(palette[i], palette[j]); - - if (d <= max_d) - { - - t = (png_dsortp)png_malloc_warn(png_ptr, - (png_uint_32)(png_sizeof(png_dsort))); - if (t == NULL) - break; - t->next = hash[d]; - t->left = (png_byte)i; - t->right = (png_byte)j; - hash[d] = t; - } - } - if (t == NULL) - break; - } - - if (t != NULL) - for (i = 0; i <= max_d; i++) - { - if (hash[i] != NULL) - { - png_dsortp p; - - for (p = hash[i]; p; p = p->next) - { - if ((int)png_ptr->index_to_palette[p->left] - < num_new_palette && - (int)png_ptr->index_to_palette[p->right] - < num_new_palette) - { - int j, next_j; - - if (num_new_palette & 0x01) - { - j = p->left; - next_j = p->right; - } - else - { - j = p->right; - next_j = p->left; - } - - num_new_palette--; - palette[png_ptr->index_to_palette[j]] - = palette[num_new_palette]; - if (!full_dither) - { - int k; - - for (k = 0; k < num_palette; k++) - { - if (png_ptr->dither_index[k] == - png_ptr->index_to_palette[j]) - png_ptr->dither_index[k] = - png_ptr->index_to_palette[next_j]; - if ((int)png_ptr->dither_index[k] == - num_new_palette) - png_ptr->dither_index[k] = - png_ptr->index_to_palette[j]; - } - } - - png_ptr->index_to_palette[png_ptr->palette_to_index - [num_new_palette]] = png_ptr->index_to_palette[j]; - png_ptr->palette_to_index[png_ptr->index_to_palette[j]] - = png_ptr->palette_to_index[num_new_palette]; - - png_ptr->index_to_palette[j] = (png_byte)num_new_palette; - png_ptr->palette_to_index[num_new_palette] = (png_byte)j; - } - if (num_new_palette <= maximum_colors) - break; - } - if (num_new_palette <= maximum_colors) - break; - } - } - - for (i = 0; i < 769; i++) - { - if (hash[i] != NULL) - { - png_dsortp p = hash[i]; - while (p) - { - t = p->next; - png_free(png_ptr, p); - p = t; - } - } - hash[i] = 0; - } - max_d += 96; - } - png_free(png_ptr, hash); - png_free(png_ptr, png_ptr->palette_to_index); - png_free(png_ptr, png_ptr->index_to_palette); - png_ptr->palette_to_index = NULL; - png_ptr->index_to_palette = NULL; - } - num_palette = maximum_colors; - } - if (png_ptr->palette == NULL) - { - png_ptr->palette = palette; - } - png_ptr->num_palette = (png_uint_16)num_palette; - - if (full_dither) - { - int i; - png_bytep distance; - int total_bits = PNG_DITHER_RED_BITS + PNG_DITHER_GREEN_BITS + - PNG_DITHER_BLUE_BITS; - int num_red = (1 << PNG_DITHER_RED_BITS); - int num_green = (1 << PNG_DITHER_GREEN_BITS); - int num_blue = (1 << PNG_DITHER_BLUE_BITS); - png_size_t num_entries = ((png_size_t)1 << total_bits); - png_ptr->palette_lookup = (png_bytep )png_malloc(png_ptr, - (png_uint_32)(num_entries * png_sizeof(png_byte))); - png_memset(png_ptr->palette_lookup, 0, num_entries * - png_sizeof(png_byte)); - - distance = (png_bytep)png_malloc(png_ptr, (png_uint_32)(num_entries * - png_sizeof(png_byte))); - - png_memset(distance, 0xff, num_entries * png_sizeof(png_byte)); - - for (i = 0; i < num_palette; i++) - { - int ir, ig, ib; - int r = (palette[i].red >> (8 - PNG_DITHER_RED_BITS)); - int g = (palette[i].green >> (8 - PNG_DITHER_GREEN_BITS)); - int b = (palette[i].blue >> (8 - PNG_DITHER_BLUE_BITS)); - - for (ir = 0; ir < num_red; ir++) - { - /* int dr = abs(ir - r); */ - int dr = ((ir > r) ? ir - r : r - ir); - int index_r = (ir << (PNG_DITHER_BLUE_BITS + PNG_DITHER_GREEN_BITS)); - - for (ig = 0; ig < num_green; ig++) - { - /* int dg = abs(ig - g); */ - int dg = ((ig > g) ? ig - g : g - ig); - int dt = dr + dg; - int dm = ((dr > dg) ? dr : dg); - int index_g = index_r | (ig << PNG_DITHER_BLUE_BITS); - - for (ib = 0; ib < num_blue; ib++) - { - int d_index = index_g | ib; - /* int db = abs(ib - b); */ - int db = ((ib > b) ? ib - b : b - ib); - int dmax = ((dm > db) ? dm : db); - int d = dmax + dt + db; - - if (d < (int)distance[d_index]) - { - distance[d_index] = (png_byte)d; - png_ptr->palette_lookup[d_index] = (png_byte)i; - } - } - } - } - } - - png_free(png_ptr, distance); - } -} -#endif - -#if defined(PNG_READ_GAMMA_SUPPORTED) && defined(PNG_FLOATING_POINT_SUPPORTED) -/* Transform the image from the file_gamma to the screen_gamma. We - * only do transformations on images where the file_gamma and screen_gamma - * are not close reciprocals, otherwise it slows things down slightly, and - * also needlessly introduces small errors. - * - * We will turn off gamma transformation later if no semitransparent entries - * are present in the tRNS array for palette images. We can't do it here - * because we don't necessarily have the tRNS chunk yet. - */ -void PNGAPI -png_set_gamma(png_structp png_ptr, double scrn_gamma, double file_gamma) -{ - png_debug(1, "in png_set_gamma"); - if (png_ptr == NULL) - return; - if ((fabs(scrn_gamma * file_gamma - 1.0) > PNG_GAMMA_THRESHOLD) || - (png_ptr->color_type & PNG_COLOR_MASK_ALPHA) || - (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)) - png_ptr->transformations |= PNG_GAMMA; - png_ptr->gamma = (float)file_gamma; - png_ptr->screen_gamma = (float)scrn_gamma; -} -#endif - -#if defined(PNG_READ_EXPAND_SUPPORTED) -/* Expand paletted images to RGB, expand grayscale images of - * less than 8-bit depth to 8-bit depth, and expand tRNS chunks - * to alpha channels. - */ -void PNGAPI -png_set_expand(png_structp png_ptr) -{ - png_debug(1, "in png_set_expand"); - if (png_ptr == NULL) - return; - png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS); - png_ptr->flags &= ~PNG_FLAG_ROW_INIT; -} - -/* GRR 19990627: the following three functions currently are identical - * to png_set_expand(). However, it is entirely reasonable that someone - * might wish to expand an indexed image to RGB but *not* expand a single, - * fully transparent palette entry to a full alpha channel--perhaps instead - * convert tRNS to the grayscale/RGB format (16-bit RGB value), or replace - * the transparent color with a particular RGB value, or drop tRNS entirely. - * IOW, a future version of the library may make the transformations flag - * a bit more fine-grained, with separate bits for each of these three - * functions. - * - * More to the point, these functions make it obvious what libpng will be - * doing, whereas "expand" can (and does) mean any number of things. - * - * GRP 20060307: In libpng-1.4.0, png_set_gray_1_2_4_to_8() was modified - * to expand only the sample depth but not to expand the tRNS to alpha. - */ - -/* Expand paletted images to RGB. */ -void PNGAPI -png_set_palette_to_rgb(png_structp png_ptr) -{ - png_debug(1, "in png_set_palette_to_rgb"); - if (png_ptr == NULL) - return; - png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS); - png_ptr->flags &= ~PNG_FLAG_ROW_INIT; -} - -#if !defined(PNG_1_0_X) -/* Expand grayscale images of less than 8-bit depth to 8 bits. */ -void PNGAPI -png_set_expand_gray_1_2_4_to_8(png_structp png_ptr) -{ - png_debug(1, "in png_set_expand_gray_1_2_4_to_8"); - if (png_ptr == NULL) - return; - png_ptr->transformations |= PNG_EXPAND; - png_ptr->flags &= ~PNG_FLAG_ROW_INIT; -} -#endif - -#if defined(PNG_1_0_X) || defined(PNG_1_2_X) -/* Expand grayscale images of less than 8-bit depth to 8 bits. */ -/* Deprecated as of libpng-1.2.9 */ -void PNGAPI -png_set_gray_1_2_4_to_8(png_structp png_ptr) -{ - png_debug(1, "in png_set_gray_1_2_4_to_8"); - if (png_ptr == NULL) - return; - png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS); -} -#endif - - -/* Expand tRNS chunks to alpha channels. */ -void PNGAPI -png_set_tRNS_to_alpha(png_structp png_ptr) -{ - png_debug(1, "in png_set_tRNS_to_alpha"); - png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS); - png_ptr->flags &= ~PNG_FLAG_ROW_INIT; -} -#endif /* defined(PNG_READ_EXPAND_SUPPORTED) */ - -#if defined(PNG_READ_GRAY_TO_RGB_SUPPORTED) -void PNGAPI -png_set_gray_to_rgb(png_structp png_ptr) -{ - png_debug(1, "in png_set_gray_to_rgb"); - png_ptr->transformations |= PNG_GRAY_TO_RGB; - png_ptr->flags &= ~PNG_FLAG_ROW_INIT; -} -#endif - -#if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) -#if defined(PNG_FLOATING_POINT_SUPPORTED) -/* Convert a RGB image to a grayscale of the same width. This allows us, - * for example, to convert a 24 bpp RGB image into an 8 bpp grayscale image. - */ - -void PNGAPI -png_set_rgb_to_gray(png_structp png_ptr, int error_action, double red, - double green) -{ - int red_fixed = (int)((float)red*100000.0 + 0.5); - int green_fixed = (int)((float)green*100000.0 + 0.5); - if (png_ptr == NULL) - return; - png_set_rgb_to_gray_fixed(png_ptr, error_action, red_fixed, green_fixed); -} -#endif - -void PNGAPI -png_set_rgb_to_gray_fixed(png_structp png_ptr, int error_action, - png_fixed_point red, png_fixed_point green) -{ - png_debug(1, "in png_set_rgb_to_gray"); - if (png_ptr == NULL) - return; - switch(error_action) - { - case 1: png_ptr->transformations |= PNG_RGB_TO_GRAY; - break; - - case 2: png_ptr->transformations |= PNG_RGB_TO_GRAY_WARN; - break; - - case 3: png_ptr->transformations |= PNG_RGB_TO_GRAY_ERR; - } - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) -#if defined(PNG_READ_EXPAND_SUPPORTED) - png_ptr->transformations |= PNG_EXPAND; -#else - { - png_warning(png_ptr, - "Cannot do RGB_TO_GRAY without EXPAND_SUPPORTED."); - png_ptr->transformations &= ~PNG_RGB_TO_GRAY; - } -#endif - { - png_uint_16 red_int, green_int; - if (red < 0 || green < 0) - { - red_int = 6968; /* .212671 * 32768 + .5 */ - green_int = 23434; /* .715160 * 32768 + .5 */ - } - else if (red + green < 100000L) - { - red_int = (png_uint_16)(((png_uint_32)red*32768L)/100000L); - green_int = (png_uint_16)(((png_uint_32)green*32768L)/100000L); - } - else - { - png_warning(png_ptr, "ignoring out of range rgb_to_gray coefficients"); - red_int = 6968; - green_int = 23434; - } - png_ptr->rgb_to_gray_red_coeff = red_int; - png_ptr->rgb_to_gray_green_coeff = green_int; - png_ptr->rgb_to_gray_blue_coeff = - (png_uint_16)(32768 - red_int - green_int); - } -} -#endif - -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_LEGACY_SUPPORTED) -void PNGAPI -png_set_read_user_transform_fn(png_structp png_ptr, png_user_transform_ptr - read_user_transform_fn) -{ - png_debug(1, "in png_set_read_user_transform_fn"); - if (png_ptr == NULL) - return; -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) - png_ptr->transformations |= PNG_USER_TRANSFORM; - png_ptr->read_user_transform_fn = read_user_transform_fn; -#endif -#ifdef PNG_LEGACY_SUPPORTED - if (read_user_transform_fn) - png_warning(png_ptr, - "This version of libpng does not support user transforms"); -#endif -} -#endif - -/* Initialize everything needed for the read. This includes modifying - * the palette. - */ -void /* PRIVATE */ -png_init_read_transformations(png_structp png_ptr) -{ - png_debug(1, "in png_init_read_transformations"); -#if defined(PNG_USELESS_TESTS_SUPPORTED) - if (png_ptr != NULL) -#endif - { -#if defined(PNG_READ_BACKGROUND_SUPPORTED) || defined(PNG_READ_SHIFT_SUPPORTED) \ - || defined(PNG_READ_GAMMA_SUPPORTED) - int color_type = png_ptr->color_type; -#endif - -#if defined(PNG_READ_EXPAND_SUPPORTED) && defined(PNG_READ_BACKGROUND_SUPPORTED) - -#if defined(PNG_READ_GRAY_TO_RGB_SUPPORTED) - /* Detect gray background and attempt to enable optimization - * for gray --> RGB case - * - * Note: if PNG_BACKGROUND_EXPAND is set and color_type is either RGB or - * RGB_ALPHA (in which case need_expand is superfluous anyway), the - * background color might actually be gray yet not be flagged as such. - * This is not a problem for the current code, which uses - * PNG_BACKGROUND_IS_GRAY only to decide when to do the - * png_do_gray_to_rgb() transformation. - */ - if ((png_ptr->transformations & PNG_BACKGROUND_EXPAND) && - !(color_type & PNG_COLOR_MASK_COLOR)) - { - png_ptr->mode |= PNG_BACKGROUND_IS_GRAY; - } else if ((png_ptr->transformations & PNG_BACKGROUND) && - !(png_ptr->transformations & PNG_BACKGROUND_EXPAND) && - (png_ptr->transformations & PNG_GRAY_TO_RGB) && - png_ptr->background.red == png_ptr->background.green && - png_ptr->background.red == png_ptr->background.blue) - { - png_ptr->mode |= PNG_BACKGROUND_IS_GRAY; - png_ptr->background.gray = png_ptr->background.red; - } -#endif - - if ((png_ptr->transformations & PNG_BACKGROUND_EXPAND) && - (png_ptr->transformations & PNG_EXPAND)) - { - if (!(color_type & PNG_COLOR_MASK_COLOR)) /* i.e., GRAY or GRAY_ALPHA */ - { - /* Expand background and tRNS chunks */ - switch (png_ptr->bit_depth) - { - case 1: - png_ptr->background.gray *= (png_uint_16)0xff; - png_ptr->background.red = png_ptr->background.green - = png_ptr->background.blue = png_ptr->background.gray; - if (!(png_ptr->transformations & PNG_EXPAND_tRNS)) - { - png_ptr->trans_values.gray *= (png_uint_16)0xff; - png_ptr->trans_values.red = png_ptr->trans_values.green - = png_ptr->trans_values.blue = png_ptr->trans_values.gray; - } - break; - - case 2: - png_ptr->background.gray *= (png_uint_16)0x55; - png_ptr->background.red = png_ptr->background.green - = png_ptr->background.blue = png_ptr->background.gray; - if (!(png_ptr->transformations & PNG_EXPAND_tRNS)) - { - png_ptr->trans_values.gray *= (png_uint_16)0x55; - png_ptr->trans_values.red = png_ptr->trans_values.green - = png_ptr->trans_values.blue = png_ptr->trans_values.gray; - } - break; - - case 4: - png_ptr->background.gray *= (png_uint_16)0x11; - png_ptr->background.red = png_ptr->background.green - = png_ptr->background.blue = png_ptr->background.gray; - if (!(png_ptr->transformations & PNG_EXPAND_tRNS)) - { - png_ptr->trans_values.gray *= (png_uint_16)0x11; - png_ptr->trans_values.red = png_ptr->trans_values.green - = png_ptr->trans_values.blue = png_ptr->trans_values.gray; - } - break; - - case 8: - - case 16: - png_ptr->background.red = png_ptr->background.green - = png_ptr->background.blue = png_ptr->background.gray; - break; - } - } - else if (color_type == PNG_COLOR_TYPE_PALETTE) - { - png_ptr->background.red = - png_ptr->palette[png_ptr->background.index].red; - png_ptr->background.green = - png_ptr->palette[png_ptr->background.index].green; - png_ptr->background.blue = - png_ptr->palette[png_ptr->background.index].blue; - -#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) - if (png_ptr->transformations & PNG_INVERT_ALPHA) - { -#if defined(PNG_READ_EXPAND_SUPPORTED) - if (!(png_ptr->transformations & PNG_EXPAND_tRNS)) -#endif - { - /* Invert the alpha channel (in tRNS) unless the pixels are - * going to be expanded, in which case leave it for later - */ - int i, istop; - istop=(int)png_ptr->num_trans; - for (i=0; itrans[i] = (png_byte)(255 - png_ptr->trans[i]); - } - } -#endif - - } - } -#endif - -#if defined(PNG_READ_BACKGROUND_SUPPORTED) && defined(PNG_READ_GAMMA_SUPPORTED) - png_ptr->background_1 = png_ptr->background; -#endif -#if defined(PNG_READ_GAMMA_SUPPORTED) && defined(PNG_FLOATING_POINT_SUPPORTED) - - if ((color_type == PNG_COLOR_TYPE_PALETTE && png_ptr->num_trans != 0) - && (fabs(png_ptr->screen_gamma * png_ptr->gamma - 1.0) - < PNG_GAMMA_THRESHOLD)) - { - int i, k; - k=0; - for (i=0; inum_trans; i++) - { - if (png_ptr->trans[i] != 0 && png_ptr->trans[i] != 0xff) - k=1; /* Partial transparency is present */ - } - if (k == 0) - png_ptr->transformations &= ~PNG_GAMMA; - } - - if ((png_ptr->transformations & (PNG_GAMMA | PNG_RGB_TO_GRAY)) && - png_ptr->gamma != 0.0) - { - png_build_gamma_table(png_ptr); -#if defined(PNG_READ_BACKGROUND_SUPPORTED) - if (png_ptr->transformations & PNG_BACKGROUND) - { - if (color_type == PNG_COLOR_TYPE_PALETTE) - { - /* Could skip if no transparency */ - png_color back, back_1; - png_colorp palette = png_ptr->palette; - int num_palette = png_ptr->num_palette; - int i; - if (png_ptr->background_gamma_type == PNG_BACKGROUND_GAMMA_FILE) - { - back.red = png_ptr->gamma_table[png_ptr->background.red]; - back.green = png_ptr->gamma_table[png_ptr->background.green]; - back.blue = png_ptr->gamma_table[png_ptr->background.blue]; - - back_1.red = png_ptr->gamma_to_1[png_ptr->background.red]; - back_1.green = png_ptr->gamma_to_1[png_ptr->background.green]; - back_1.blue = png_ptr->gamma_to_1[png_ptr->background.blue]; - } - else - { - double g, gs; - - switch (png_ptr->background_gamma_type) - { - case PNG_BACKGROUND_GAMMA_SCREEN: - g = (png_ptr->screen_gamma); - gs = 1.0; - break; - - case PNG_BACKGROUND_GAMMA_FILE: - g = 1.0 / (png_ptr->gamma); - gs = 1.0 / (png_ptr->gamma * png_ptr->screen_gamma); - break; - - case PNG_BACKGROUND_GAMMA_UNIQUE: - g = 1.0 / (png_ptr->background_gamma); - gs = 1.0 / (png_ptr->background_gamma * - png_ptr->screen_gamma); - break; - default: - g = 1.0; /* back_1 */ - gs = 1.0; /* back */ - } - - if ( fabs(gs - 1.0) < PNG_GAMMA_THRESHOLD) - { - back.red = (png_byte)png_ptr->background.red; - back.green = (png_byte)png_ptr->background.green; - back.blue = (png_byte)png_ptr->background.blue; - } - else - { - back.red = (png_byte)(pow( - (double)png_ptr->background.red/255, gs) * 255.0 + .5); - back.green = (png_byte)(pow( - (double)png_ptr->background.green/255, gs) * 255.0 + .5); - back.blue = (png_byte)(pow( - (double)png_ptr->background.blue/255, gs) * 255.0 + .5); - } - - back_1.red = (png_byte)(pow( - (double)png_ptr->background.red/255, g) * 255.0 + .5); - back_1.green = (png_byte)(pow( - (double)png_ptr->background.green/255, g) * 255.0 + .5); - back_1.blue = (png_byte)(pow( - (double)png_ptr->background.blue/255, g) * 255.0 + .5); - } - for (i = 0; i < num_palette; i++) - { - if (i < (int)png_ptr->num_trans && png_ptr->trans[i] != 0xff) - { - if (png_ptr->trans[i] == 0) - { - palette[i] = back; - } - else /* if (png_ptr->trans[i] != 0xff) */ - { - png_byte v, w; - - v = png_ptr->gamma_to_1[palette[i].red]; - png_composite(w, v, png_ptr->trans[i], back_1.red); - palette[i].red = png_ptr->gamma_from_1[w]; - - v = png_ptr->gamma_to_1[palette[i].green]; - png_composite(w, v, png_ptr->trans[i], back_1.green); - palette[i].green = png_ptr->gamma_from_1[w]; - - v = png_ptr->gamma_to_1[palette[i].blue]; - png_composite(w, v, png_ptr->trans[i], back_1.blue); - palette[i].blue = png_ptr->gamma_from_1[w]; - } - } - else - { - palette[i].red = png_ptr->gamma_table[palette[i].red]; - palette[i].green = png_ptr->gamma_table[palette[i].green]; - palette[i].blue = png_ptr->gamma_table[palette[i].blue]; - } - } - /* Prevent the transformations being done again, and make sure - * that the now spurious alpha channel is stripped - the code - * has just reduced background composition and gamma correction - * to a simple alpha channel strip. - */ - png_ptr->transformations &= ~PNG_BACKGROUND; - png_ptr->transformations &= ~PNG_GAMMA; - png_ptr->transformations |= PNG_STRIP_ALPHA; - } - /* if (png_ptr->background_gamma_type!=PNG_BACKGROUND_GAMMA_UNKNOWN) */ - else - /* color_type != PNG_COLOR_TYPE_PALETTE */ - { - double m = (double)(((png_uint_32)1 << png_ptr->bit_depth) - 1); - double g = 1.0; - double gs = 1.0; - - switch (png_ptr->background_gamma_type) - { - case PNG_BACKGROUND_GAMMA_SCREEN: - g = (png_ptr->screen_gamma); - gs = 1.0; - break; - - case PNG_BACKGROUND_GAMMA_FILE: - g = 1.0 / (png_ptr->gamma); - gs = 1.0 / (png_ptr->gamma * png_ptr->screen_gamma); - break; - - case PNG_BACKGROUND_GAMMA_UNIQUE: - g = 1.0 / (png_ptr->background_gamma); - gs = 1.0 / (png_ptr->background_gamma * - png_ptr->screen_gamma); - break; - } - - png_ptr->background_1.gray = (png_uint_16)(pow( - (double)png_ptr->background.gray / m, g) * m + .5); - png_ptr->background.gray = (png_uint_16)(pow( - (double)png_ptr->background.gray / m, gs) * m + .5); - - if ((png_ptr->background.red != png_ptr->background.green) || - (png_ptr->background.red != png_ptr->background.blue) || - (png_ptr->background.red != png_ptr->background.gray)) - { - /* RGB or RGBA with color background */ - png_ptr->background_1.red = (png_uint_16)(pow( - (double)png_ptr->background.red / m, g) * m + .5); - png_ptr->background_1.green = (png_uint_16)(pow( - (double)png_ptr->background.green / m, g) * m + .5); - png_ptr->background_1.blue = (png_uint_16)(pow( - (double)png_ptr->background.blue / m, g) * m + .5); - png_ptr->background.red = (png_uint_16)(pow( - (double)png_ptr->background.red / m, gs) * m + .5); - png_ptr->background.green = (png_uint_16)(pow( - (double)png_ptr->background.green / m, gs) * m + .5); - png_ptr->background.blue = (png_uint_16)(pow( - (double)png_ptr->background.blue / m, gs) * m + .5); - } - else - { - /* GRAY, GRAY ALPHA, RGB, or RGBA with gray background */ - png_ptr->background_1.red = png_ptr->background_1.green - = png_ptr->background_1.blue = png_ptr->background_1.gray; - png_ptr->background.red = png_ptr->background.green - = png_ptr->background.blue = png_ptr->background.gray; - } - } - } - else - /* Transformation does not include PNG_BACKGROUND */ -#endif /* PNG_READ_BACKGROUND_SUPPORTED */ - if (color_type == PNG_COLOR_TYPE_PALETTE) - { - png_colorp palette = png_ptr->palette; - int num_palette = png_ptr->num_palette; - int i; - - for (i = 0; i < num_palette; i++) - { - palette[i].red = png_ptr->gamma_table[palette[i].red]; - palette[i].green = png_ptr->gamma_table[palette[i].green]; - palette[i].blue = png_ptr->gamma_table[palette[i].blue]; - } - - /* Done the gamma correction. */ - png_ptr->transformations &= ~PNG_GAMMA; - } - } -#if defined(PNG_READ_BACKGROUND_SUPPORTED) - else -#endif -#endif /* PNG_READ_GAMMA_SUPPORTED && PNG_FLOATING_POINT_SUPPORTED */ -#if defined(PNG_READ_BACKGROUND_SUPPORTED) - /* No GAMMA transformation */ - if ((png_ptr->transformations & PNG_BACKGROUND) && - (color_type == PNG_COLOR_TYPE_PALETTE)) - { - int i; - int istop = (int)png_ptr->num_trans; - png_color back; - png_colorp palette = png_ptr->palette; - - back.red = (png_byte)png_ptr->background.red; - back.green = (png_byte)png_ptr->background.green; - back.blue = (png_byte)png_ptr->background.blue; - - for (i = 0; i < istop; i++) - { - if (png_ptr->trans[i] == 0) - { - palette[i] = back; - } - else if (png_ptr->trans[i] != 0xff) - { - /* The png_composite() macro is defined in png.h */ - png_composite(palette[i].red, palette[i].red, - png_ptr->trans[i], back.red); - png_composite(palette[i].green, palette[i].green, - png_ptr->trans[i], back.green); - png_composite(palette[i].blue, palette[i].blue, - png_ptr->trans[i], back.blue); - } - } - - /* Handled alpha, still need to strip the channel. */ - png_ptr->transformations &= ~PNG_BACKGROUND; - png_ptr->transformations |= PNG_STRIP_ALPHA; - } -#endif /* PNG_READ_BACKGROUND_SUPPORTED */ - -#if defined(PNG_READ_SHIFT_SUPPORTED) - if ((png_ptr->transformations & PNG_SHIFT) && - (color_type == PNG_COLOR_TYPE_PALETTE)) - { - png_uint_16 i; - png_uint_16 istop = png_ptr->num_palette; - int sr = 8 - png_ptr->sig_bit.red; - int sg = 8 - png_ptr->sig_bit.green; - int sb = 8 - png_ptr->sig_bit.blue; - - if (sr < 0 || sr > 8) - sr = 0; - if (sg < 0 || sg > 8) - sg = 0; - if (sb < 0 || sb > 8) - sb = 0; - for (i = 0; i < istop; i++) - { - png_ptr->palette[i].red >>= sr; - png_ptr->palette[i].green >>= sg; - png_ptr->palette[i].blue >>= sb; - } - } -#endif /* PNG_READ_SHIFT_SUPPORTED */ - } -#if !defined(PNG_READ_GAMMA_SUPPORTED) && !defined(PNG_READ_SHIFT_SUPPORTED) \ - && !defined(PNG_READ_BACKGROUND_SUPPORTED) - if (png_ptr) - return; -#endif -} - -/* Modify the info structure to reflect the transformations. The - * info should be updated so a PNG file could be written with it, - * assuming the transformations result in valid PNG data. - */ -void /* PRIVATE */ -png_read_transform_info(png_structp png_ptr, png_infop info_ptr) -{ - png_debug(1, "in png_read_transform_info"); -#if defined(PNG_READ_EXPAND_SUPPORTED) - if (png_ptr->transformations & PNG_EXPAND) - { - if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - { - if (png_ptr->num_trans && - (png_ptr->transformations & PNG_EXPAND_tRNS)) - info_ptr->color_type = PNG_COLOR_TYPE_RGB_ALPHA; - else - info_ptr->color_type = PNG_COLOR_TYPE_RGB; - info_ptr->bit_depth = 8; - info_ptr->num_trans = 0; - } - else - { - if (png_ptr->num_trans) - { - if (png_ptr->transformations & PNG_EXPAND_tRNS) - info_ptr->color_type |= PNG_COLOR_MASK_ALPHA; -#if 0 /* Removed from libpng-1.2.27 */ - else - info_ptr->color_type |= PNG_COLOR_MASK_COLOR; -#endif - } - if (info_ptr->bit_depth < 8) - info_ptr->bit_depth = 8; - info_ptr->num_trans = 0; - } - } -#endif - -#if defined(PNG_READ_BACKGROUND_SUPPORTED) - if (png_ptr->transformations & PNG_BACKGROUND) - { - info_ptr->color_type &= ~PNG_COLOR_MASK_ALPHA; - info_ptr->num_trans = 0; - info_ptr->background = png_ptr->background; - } -#endif - -#if defined(PNG_READ_GAMMA_SUPPORTED) - if (png_ptr->transformations & PNG_GAMMA) - { -#ifdef PNG_FLOATING_POINT_SUPPORTED - info_ptr->gamma = png_ptr->gamma; -#endif -#ifdef PNG_FIXED_POINT_SUPPORTED - info_ptr->int_gamma = png_ptr->int_gamma; -#endif - } -#endif - -#if defined(PNG_READ_16_TO_8_SUPPORTED) - if ((png_ptr->transformations & PNG_16_TO_8) && (info_ptr->bit_depth == 16)) - info_ptr->bit_depth = 8; -#endif - -#if defined(PNG_READ_GRAY_TO_RGB_SUPPORTED) - if (png_ptr->transformations & PNG_GRAY_TO_RGB) - info_ptr->color_type |= PNG_COLOR_MASK_COLOR; -#endif - -#if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) - if (png_ptr->transformations & PNG_RGB_TO_GRAY) - info_ptr->color_type &= ~PNG_COLOR_MASK_COLOR; -#endif - -#if defined(PNG_READ_DITHER_SUPPORTED) - if (png_ptr->transformations & PNG_DITHER) - { - if (((info_ptr->color_type == PNG_COLOR_TYPE_RGB) || - (info_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA)) && - png_ptr->palette_lookup && info_ptr->bit_depth == 8) - { - info_ptr->color_type = PNG_COLOR_TYPE_PALETTE; - } - } -#endif - -#if defined(PNG_READ_PACK_SUPPORTED) - if ((png_ptr->transformations & PNG_PACK) && (info_ptr->bit_depth < 8)) - info_ptr->bit_depth = 8; -#endif - - if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - info_ptr->channels = 1; - else if (info_ptr->color_type & PNG_COLOR_MASK_COLOR) - info_ptr->channels = 3; - else - info_ptr->channels = 1; - -#if defined(PNG_READ_STRIP_ALPHA_SUPPORTED) - if (png_ptr->flags & PNG_FLAG_STRIP_ALPHA) - info_ptr->color_type &= ~PNG_COLOR_MASK_ALPHA; -#endif - - if (info_ptr->color_type & PNG_COLOR_MASK_ALPHA) - info_ptr->channels++; - -#if defined(PNG_READ_FILLER_SUPPORTED) - /* STRIP_ALPHA and FILLER allowed: MASK_ALPHA bit stripped above */ - if ((png_ptr->transformations & PNG_FILLER) && - ((info_ptr->color_type == PNG_COLOR_TYPE_RGB) || - (info_ptr->color_type == PNG_COLOR_TYPE_GRAY))) - { - info_ptr->channels++; - /* If adding a true alpha channel not just filler */ -#if !defined(PNG_1_0_X) - if (png_ptr->transformations & PNG_ADD_ALPHA) - info_ptr->color_type |= PNG_COLOR_MASK_ALPHA; -#endif - } -#endif - -#if defined(PNG_USER_TRANSFORM_PTR_SUPPORTED) && \ -defined(PNG_READ_USER_TRANSFORM_SUPPORTED) - if (png_ptr->transformations & PNG_USER_TRANSFORM) - { - if (info_ptr->bit_depth < png_ptr->user_transform_depth) - info_ptr->bit_depth = png_ptr->user_transform_depth; - if (info_ptr->channels < png_ptr->user_transform_channels) - info_ptr->channels = png_ptr->user_transform_channels; - } -#endif - - info_ptr->pixel_depth = (png_byte)(info_ptr->channels * - info_ptr->bit_depth); - - info_ptr->rowbytes = PNG_ROWBYTES(info_ptr->pixel_depth, info_ptr->width); - -#if !defined(PNG_READ_EXPAND_SUPPORTED) - if (png_ptr) - return; -#endif -} - -/* Transform the row. The order of transformations is significant, - * and is very touchy. If you add a transformation, take care to - * decide how it fits in with the other transformations here. - */ -void /* PRIVATE */ -png_do_read_transformations(png_structp png_ptr) -{ - png_debug(1, "in png_do_read_transformations"); - if (png_ptr->row_buf == NULL) - { -#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE) - char msg[50]; - - png_snprintf2(msg, 50, - "NULL row buffer for row %ld, pass %d", (long)png_ptr->row_number, - png_ptr->pass); - png_error(png_ptr, msg); -#else - png_error(png_ptr, "NULL row buffer"); -#endif - } -#ifdef PNG_WARN_UNINITIALIZED_ROW - if (!(png_ptr->flags & PNG_FLAG_ROW_INIT)) - /* Application has failed to call either png_read_start_image() - * or png_read_update_info() after setting transforms that expand - * pixels. This check added to libpng-1.2.19 - */ -#if (PNG_WARN_UNINITIALIZED_ROW==1) - png_error(png_ptr, "Uninitialized row"); -#else - png_warning(png_ptr, "Uninitialized row"); -#endif -#endif - -#if defined(PNG_READ_EXPAND_SUPPORTED) - if (png_ptr->transformations & PNG_EXPAND) - { - if (png_ptr->row_info.color_type == PNG_COLOR_TYPE_PALETTE) - { - png_do_expand_palette(&(png_ptr->row_info), png_ptr->row_buf + 1, - png_ptr->palette, png_ptr->trans, png_ptr->num_trans); - } - else - { - if (png_ptr->num_trans && - (png_ptr->transformations & PNG_EXPAND_tRNS)) - png_do_expand(&(png_ptr->row_info), png_ptr->row_buf + 1, - &(png_ptr->trans_values)); - else - png_do_expand(&(png_ptr->row_info), png_ptr->row_buf + 1, - NULL); - } - } -#endif - -#if defined(PNG_READ_STRIP_ALPHA_SUPPORTED) - if (png_ptr->flags & PNG_FLAG_STRIP_ALPHA) - png_do_strip_filler(&(png_ptr->row_info), png_ptr->row_buf + 1, - PNG_FLAG_FILLER_AFTER | (png_ptr->flags & PNG_FLAG_STRIP_ALPHA)); -#endif - -#if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) - if (png_ptr->transformations & PNG_RGB_TO_GRAY) - { - int rgb_error = - png_do_rgb_to_gray(png_ptr, &(png_ptr->row_info), png_ptr->row_buf + 1); - if (rgb_error) - { - png_ptr->rgb_to_gray_status=1; - if ((png_ptr->transformations & PNG_RGB_TO_GRAY) == - PNG_RGB_TO_GRAY_WARN) - png_warning(png_ptr, "png_do_rgb_to_gray found nongray pixel"); - if ((png_ptr->transformations & PNG_RGB_TO_GRAY) == - PNG_RGB_TO_GRAY_ERR) - png_error(png_ptr, "png_do_rgb_to_gray found nongray pixel"); - } - } -#endif - -/* From Andreas Dilger e-mail to png-implement, 26 March 1998: - * - * In most cases, the "simple transparency" should be done prior to doing - * gray-to-RGB, or you will have to test 3x as many bytes to check if a - * pixel is transparent. You would also need to make sure that the - * transparency information is upgraded to RGB. - * - * To summarize, the current flow is: - * - Gray + simple transparency -> compare 1 or 2 gray bytes and composite - * with background "in place" if transparent, - * convert to RGB if necessary - * - Gray + alpha -> composite with gray background and remove alpha bytes, - * convert to RGB if necessary - * - * To support RGB backgrounds for gray images we need: - * - Gray + simple transparency -> convert to RGB + simple transparency, - * compare 3 or 6 bytes and composite with - * background "in place" if transparent - * (3x compare/pixel compared to doing - * composite with gray bkgrnd) - * - Gray + alpha -> convert to RGB + alpha, composite with background and - * remove alpha bytes (3x float - * operations/pixel compared with composite - * on gray background) - * - * Greg's change will do this. The reason it wasn't done before is for - * performance, as this increases the per-pixel operations. If we would check - * in advance if the background was gray or RGB, and position the gray-to-RGB - * transform appropriately, then it would save a lot of work/time. - */ - -#if defined(PNG_READ_GRAY_TO_RGB_SUPPORTED) - /* If gray -> RGB, do so now only if background is non-gray; else do later - * for performance reasons - */ - if ((png_ptr->transformations & PNG_GRAY_TO_RGB) && - !(png_ptr->mode & PNG_BACKGROUND_IS_GRAY)) - png_do_gray_to_rgb(&(png_ptr->row_info), png_ptr->row_buf + 1); -#endif - -#if defined(PNG_READ_BACKGROUND_SUPPORTED) - if ((png_ptr->transformations & PNG_BACKGROUND) && - ((png_ptr->num_trans != 0 ) || - (png_ptr->color_type & PNG_COLOR_MASK_ALPHA))) - png_do_background(&(png_ptr->row_info), png_ptr->row_buf + 1, - &(png_ptr->trans_values), &(png_ptr->background) -#if defined(PNG_READ_GAMMA_SUPPORTED) - , &(png_ptr->background_1), - png_ptr->gamma_table, png_ptr->gamma_from_1, - png_ptr->gamma_to_1, png_ptr->gamma_16_table, - png_ptr->gamma_16_from_1, png_ptr->gamma_16_to_1, - png_ptr->gamma_shift -#endif -); -#endif - -#if defined(PNG_READ_GAMMA_SUPPORTED) - if ((png_ptr->transformations & PNG_GAMMA) && -#if defined(PNG_READ_BACKGROUND_SUPPORTED) - !((png_ptr->transformations & PNG_BACKGROUND) && - ((png_ptr->num_trans != 0) || - (png_ptr->color_type & PNG_COLOR_MASK_ALPHA))) && -#endif - (png_ptr->color_type != PNG_COLOR_TYPE_PALETTE)) - png_do_gamma(&(png_ptr->row_info), png_ptr->row_buf + 1, - png_ptr->gamma_table, png_ptr->gamma_16_table, - png_ptr->gamma_shift); -#endif - -#if defined(PNG_READ_16_TO_8_SUPPORTED) - if (png_ptr->transformations & PNG_16_TO_8) - png_do_chop(&(png_ptr->row_info), png_ptr->row_buf + 1); -#endif - -#if defined(PNG_READ_DITHER_SUPPORTED) - if (png_ptr->transformations & PNG_DITHER) - { - png_do_dither((png_row_infop)&(png_ptr->row_info), png_ptr->row_buf + 1, - png_ptr->palette_lookup, png_ptr->dither_index); - if (png_ptr->row_info.rowbytes == (png_uint_32)0) - png_error(png_ptr, "png_do_dither returned rowbytes=0"); - } -#endif - -#if defined(PNG_READ_INVERT_SUPPORTED) - if (png_ptr->transformations & PNG_INVERT_MONO) - png_do_invert(&(png_ptr->row_info), png_ptr->row_buf + 1); -#endif - -#if defined(PNG_READ_SHIFT_SUPPORTED) - if (png_ptr->transformations & PNG_SHIFT) - png_do_unshift(&(png_ptr->row_info), png_ptr->row_buf + 1, - &(png_ptr->shift)); -#endif - -#if defined(PNG_READ_PACK_SUPPORTED) - if (png_ptr->transformations & PNG_PACK) - png_do_unpack(&(png_ptr->row_info), png_ptr->row_buf + 1); -#endif - -#if defined(PNG_READ_BGR_SUPPORTED) - if (png_ptr->transformations & PNG_BGR) - png_do_bgr(&(png_ptr->row_info), png_ptr->row_buf + 1); -#endif - -#if defined(PNG_READ_PACKSWAP_SUPPORTED) - if (png_ptr->transformations & PNG_PACKSWAP) - png_do_packswap(&(png_ptr->row_info), png_ptr->row_buf + 1); -#endif - -#if defined(PNG_READ_GRAY_TO_RGB_SUPPORTED) - /* If gray -> RGB, do so now only if we did not do so above */ - if ((png_ptr->transformations & PNG_GRAY_TO_RGB) && - (png_ptr->mode & PNG_BACKGROUND_IS_GRAY)) - png_do_gray_to_rgb(&(png_ptr->row_info), png_ptr->row_buf + 1); -#endif - -#if defined(PNG_READ_FILLER_SUPPORTED) - if (png_ptr->transformations & PNG_FILLER) - png_do_read_filler(&(png_ptr->row_info), png_ptr->row_buf + 1, - (png_uint_32)png_ptr->filler, png_ptr->flags); -#endif - -#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) - if (png_ptr->transformations & PNG_INVERT_ALPHA) - png_do_read_invert_alpha(&(png_ptr->row_info), png_ptr->row_buf + 1); -#endif - -#if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) - if (png_ptr->transformations & PNG_SWAP_ALPHA) - png_do_read_swap_alpha(&(png_ptr->row_info), png_ptr->row_buf + 1); -#endif - -#if defined(PNG_READ_SWAP_SUPPORTED) - if (png_ptr->transformations & PNG_SWAP_BYTES) - png_do_swap(&(png_ptr->row_info), png_ptr->row_buf + 1); -#endif - -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) - if (png_ptr->transformations & PNG_USER_TRANSFORM) - { - if (png_ptr->read_user_transform_fn != NULL) - (*(png_ptr->read_user_transform_fn)) /* User read transform function */ - (png_ptr, /* png_ptr */ - &(png_ptr->row_info), /* row_info: */ - /* png_uint_32 width; width of row */ - /* png_uint_32 rowbytes; number of bytes in row */ - /* png_byte color_type; color type of pixels */ - /* png_byte bit_depth; bit depth of samples */ - /* png_byte channels; number of channels (1-4) */ - /* png_byte pixel_depth; bits per pixel (depth*channels) */ - png_ptr->row_buf + 1); /* start of pixel data for row */ -#if defined(PNG_USER_TRANSFORM_PTR_SUPPORTED) - if (png_ptr->user_transform_depth) - png_ptr->row_info.bit_depth = png_ptr->user_transform_depth; - if (png_ptr->user_transform_channels) - png_ptr->row_info.channels = png_ptr->user_transform_channels; -#endif - png_ptr->row_info.pixel_depth = (png_byte)(png_ptr->row_info.bit_depth * - png_ptr->row_info.channels); - png_ptr->row_info.rowbytes = PNG_ROWBYTES(png_ptr->row_info.pixel_depth, - png_ptr->row_info.width); - } -#endif - -} - -#if defined(PNG_READ_PACK_SUPPORTED) -/* Unpack pixels of 1, 2, or 4 bits per pixel into 1 byte per pixel, - * without changing the actual values. Thus, if you had a row with - * a bit depth of 1, you would end up with bytes that only contained - * the numbers 0 or 1. If you would rather they contain 0 and 255, use - * png_do_shift() after this. - */ -void /* PRIVATE */ -png_do_unpack(png_row_infop row_info, png_bytep row) -{ - png_debug(1, "in png_do_unpack"); -#if defined(PNG_USELESS_TESTS_SUPPORTED) - if (row != NULL && row_info != NULL && row_info->bit_depth < 8) -#else - if (row_info->bit_depth < 8) -#endif - { - png_uint_32 i; - png_uint_32 row_width=row_info->width; - - switch (row_info->bit_depth) - { - case 1: - { - png_bytep sp = row + (png_size_t)((row_width - 1) >> 3); - png_bytep dp = row + (png_size_t)row_width - 1; - png_uint_32 shift = 7 - (int)((row_width + 7) & 0x07); - for (i = 0; i < row_width; i++) - { - *dp = (png_byte)((*sp >> shift) & 0x01); - if (shift == 7) - { - shift = 0; - sp--; - } - else - shift++; - - dp--; - } - break; - } - - case 2: - { - - png_bytep sp = row + (png_size_t)((row_width - 1) >> 2); - png_bytep dp = row + (png_size_t)row_width - 1; - png_uint_32 shift = (int)((3 - ((row_width + 3) & 0x03)) << 1); - for (i = 0; i < row_width; i++) - { - *dp = (png_byte)((*sp >> shift) & 0x03); - if (shift == 6) - { - shift = 0; - sp--; - } - else - shift += 2; - - dp--; - } - break; - } - - case 4: - { - png_bytep sp = row + (png_size_t)((row_width - 1) >> 1); - png_bytep dp = row + (png_size_t)row_width - 1; - png_uint_32 shift = (int)((1 - ((row_width + 1) & 0x01)) << 2); - for (i = 0; i < row_width; i++) - { - *dp = (png_byte)((*sp >> shift) & 0x0f); - if (shift == 4) - { - shift = 0; - sp--; - } - else - shift = 4; - - dp--; - } - break; - } - } - row_info->bit_depth = 8; - row_info->pixel_depth = (png_byte)(8 * row_info->channels); - row_info->rowbytes = row_width * row_info->channels; - } -} -#endif - -#if defined(PNG_READ_SHIFT_SUPPORTED) -/* Reverse the effects of png_do_shift. This routine merely shifts the - * pixels back to their significant bits values. Thus, if you have - * a row of bit depth 8, but only 5 are significant, this will shift - * the values back to 0 through 31. - */ -void /* PRIVATE */ -png_do_unshift(png_row_infop row_info, png_bytep row, png_color_8p sig_bits) -{ - png_debug(1, "in png_do_unshift"); - if ( -#if defined(PNG_USELESS_TESTS_SUPPORTED) - row != NULL && row_info != NULL && sig_bits != NULL && -#endif - row_info->color_type != PNG_COLOR_TYPE_PALETTE) - { - int shift[4]; - int channels = 0; - int c; - png_uint_16 value = 0; - png_uint_32 row_width = row_info->width; - - if (row_info->color_type & PNG_COLOR_MASK_COLOR) - { - shift[channels++] = row_info->bit_depth - sig_bits->red; - shift[channels++] = row_info->bit_depth - sig_bits->green; - shift[channels++] = row_info->bit_depth - sig_bits->blue; - } - else - { - shift[channels++] = row_info->bit_depth - sig_bits->gray; - } - if (row_info->color_type & PNG_COLOR_MASK_ALPHA) - { - shift[channels++] = row_info->bit_depth - sig_bits->alpha; - } - - for (c = 0; c < channels; c++) - { - if (shift[c] <= 0) - shift[c] = 0; - else - value = 1; - } - - if (!value) - return; - - switch (row_info->bit_depth) - { - case 2: - { - png_bytep bp; - png_uint_32 i; - png_uint_32 istop = row_info->rowbytes; - - for (bp = row, i = 0; i < istop; i++) - { - *bp >>= 1; - *bp++ &= 0x55; - } - break; - } - - case 4: - { - png_bytep bp = row; - png_uint_32 i; - png_uint_32 istop = row_info->rowbytes; - png_byte mask = (png_byte)((((int)0xf0 >> shift[0]) & (int)0xf0) | - (png_byte)((int)0xf >> shift[0])); - - for (i = 0; i < istop; i++) - { - *bp >>= shift[0]; - *bp++ &= mask; - } - break; - } - - case 8: - { - png_bytep bp = row; - png_uint_32 i; - png_uint_32 istop = row_width * channels; - - for (i = 0; i < istop; i++) - { - *bp++ >>= shift[i%channels]; - } - break; - } - - case 16: - { - png_bytep bp = row; - png_uint_32 i; - png_uint_32 istop = channels * row_width; - - for (i = 0; i < istop; i++) - { - value = (png_uint_16)((*bp << 8) + *(bp + 1)); - value >>= shift[i%channels]; - *bp++ = (png_byte)(value >> 8); - *bp++ = (png_byte)(value & 0xff); - } - break; - } - } - } -} -#endif - -#if defined(PNG_READ_16_TO_8_SUPPORTED) -/* Chop rows of bit depth 16 down to 8 */ -void /* PRIVATE */ -png_do_chop(png_row_infop row_info, png_bytep row) -{ - png_debug(1, "in png_do_chop"); -#if defined(PNG_USELESS_TESTS_SUPPORTED) - if (row != NULL && row_info != NULL && row_info->bit_depth == 16) -#else - if (row_info->bit_depth == 16) -#endif - { - png_bytep sp = row; - png_bytep dp = row; - png_uint_32 i; - png_uint_32 istop = row_info->width * row_info->channels; - - for (i = 0; i> 8)) >> 8; - * - * Approximate calculation with shift/add instead of multiply/divide: - * *dp = ((((png_uint_32)(*sp) << 8) | - * (png_uint_32)((int)(*(sp + 1)) - *sp)) + 128) >> 8; - * - * What we actually do to avoid extra shifting and conversion: - */ - - *dp = *sp + ((((int)(*(sp + 1)) - *sp) > 128) ? 1 : 0); -#else - /* Simply discard the low order byte */ - *dp = *sp; -#endif - } - row_info->bit_depth = 8; - row_info->pixel_depth = (png_byte)(8 * row_info->channels); - row_info->rowbytes = row_info->width * row_info->channels; - } -} -#endif - -#if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) -void /* PRIVATE */ -png_do_read_swap_alpha(png_row_infop row_info, png_bytep row) -{ - png_debug(1, "in png_do_read_swap_alpha"); -#if defined(PNG_USELESS_TESTS_SUPPORTED) - if (row != NULL && row_info != NULL) -#endif - { - png_uint_32 row_width = row_info->width; - if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) - { - /* This converts from RGBA to ARGB */ - if (row_info->bit_depth == 8) - { - png_bytep sp = row + row_info->rowbytes; - png_bytep dp = sp; - png_byte save; - png_uint_32 i; - - for (i = 0; i < row_width; i++) - { - save = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = save; - } - } - /* This converts from RRGGBBAA to AARRGGBB */ - else - { - png_bytep sp = row + row_info->rowbytes; - png_bytep dp = sp; - png_byte save[2]; - png_uint_32 i; - - for (i = 0; i < row_width; i++) - { - save[0] = *(--sp); - save[1] = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = save[0]; - *(--dp) = save[1]; - } - } - } - else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) - { - /* This converts from GA to AG */ - if (row_info->bit_depth == 8) - { - png_bytep sp = row + row_info->rowbytes; - png_bytep dp = sp; - png_byte save; - png_uint_32 i; - - for (i = 0; i < row_width; i++) - { - save = *(--sp); - *(--dp) = *(--sp); - *(--dp) = save; - } - } - /* This converts from GGAA to AAGG */ - else - { - png_bytep sp = row + row_info->rowbytes; - png_bytep dp = sp; - png_byte save[2]; - png_uint_32 i; - - for (i = 0; i < row_width; i++) - { - save[0] = *(--sp); - save[1] = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = save[0]; - *(--dp) = save[1]; - } - } - } - } -} -#endif - -#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) -void /* PRIVATE */ -png_do_read_invert_alpha(png_row_infop row_info, png_bytep row) -{ - png_debug(1, "in png_do_read_invert_alpha"); -#if defined(PNG_USELESS_TESTS_SUPPORTED) - if (row != NULL && row_info != NULL) -#endif - { - png_uint_32 row_width = row_info->width; - if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) - { - /* This inverts the alpha channel in RGBA */ - if (row_info->bit_depth == 8) - { - png_bytep sp = row + row_info->rowbytes; - png_bytep dp = sp; - png_uint_32 i; - - for (i = 0; i < row_width; i++) - { - *(--dp) = (png_byte)(255 - *(--sp)); - -/* This does nothing: - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - We can replace it with: -*/ - sp-=3; - dp=sp; - } - } - /* This inverts the alpha channel in RRGGBBAA */ - else - { - png_bytep sp = row + row_info->rowbytes; - png_bytep dp = sp; - png_uint_32 i; - - for (i = 0; i < row_width; i++) - { - *(--dp) = (png_byte)(255 - *(--sp)); - *(--dp) = (png_byte)(255 - *(--sp)); - -/* This does nothing: - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - We can replace it with: -*/ - sp-=6; - dp=sp; - } - } - } - else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) - { - /* This inverts the alpha channel in GA */ - if (row_info->bit_depth == 8) - { - png_bytep sp = row + row_info->rowbytes; - png_bytep dp = sp; - png_uint_32 i; - - for (i = 0; i < row_width; i++) - { - *(--dp) = (png_byte)(255 - *(--sp)); - *(--dp) = *(--sp); - } - } - /* This inverts the alpha channel in GGAA */ - else - { - png_bytep sp = row + row_info->rowbytes; - png_bytep dp = sp; - png_uint_32 i; - - for (i = 0; i < row_width; i++) - { - *(--dp) = (png_byte)(255 - *(--sp)); - *(--dp) = (png_byte)(255 - *(--sp)); -/* - *(--dp) = *(--sp); - *(--dp) = *(--sp); -*/ - sp-=2; - dp=sp; - } - } - } - } -} -#endif - -#if defined(PNG_READ_FILLER_SUPPORTED) -/* Add filler channel if we have RGB color */ -void /* PRIVATE */ -png_do_read_filler(png_row_infop row_info, png_bytep row, - png_uint_32 filler, png_uint_32 flags) -{ - png_uint_32 i; - png_uint_32 row_width = row_info->width; - - png_byte hi_filler = (png_byte)((filler>>8) & 0xff); - png_byte lo_filler = (png_byte)(filler & 0xff); - - png_debug(1, "in png_do_read_filler"); - if ( -#if defined(PNG_USELESS_TESTS_SUPPORTED) - row != NULL && row_info != NULL && -#endif - row_info->color_type == PNG_COLOR_TYPE_GRAY) - { - if (row_info->bit_depth == 8) - { - /* This changes the data from G to GX */ - if (flags & PNG_FLAG_FILLER_AFTER) - { - png_bytep sp = row + (png_size_t)row_width; - png_bytep dp = sp + (png_size_t)row_width; - for (i = 1; i < row_width; i++) - { - *(--dp) = lo_filler; - *(--dp) = *(--sp); - } - *(--dp) = lo_filler; - row_info->channels = 2; - row_info->pixel_depth = 16; - row_info->rowbytes = row_width * 2; - } - /* This changes the data from G to XG */ - else - { - png_bytep sp = row + (png_size_t)row_width; - png_bytep dp = sp + (png_size_t)row_width; - for (i = 0; i < row_width; i++) - { - *(--dp) = *(--sp); - *(--dp) = lo_filler; - } - row_info->channels = 2; - row_info->pixel_depth = 16; - row_info->rowbytes = row_width * 2; - } - } - else if (row_info->bit_depth == 16) - { - /* This changes the data from GG to GGXX */ - if (flags & PNG_FLAG_FILLER_AFTER) - { - png_bytep sp = row + (png_size_t)row_width * 2; - png_bytep dp = sp + (png_size_t)row_width * 2; - for (i = 1; i < row_width; i++) - { - *(--dp) = hi_filler; - *(--dp) = lo_filler; - *(--dp) = *(--sp); - *(--dp) = *(--sp); - } - *(--dp) = hi_filler; - *(--dp) = lo_filler; - row_info->channels = 2; - row_info->pixel_depth = 32; - row_info->rowbytes = row_width * 4; - } - /* This changes the data from GG to XXGG */ - else - { - png_bytep sp = row + (png_size_t)row_width * 2; - png_bytep dp = sp + (png_size_t)row_width * 2; - for (i = 0; i < row_width; i++) - { - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = hi_filler; - *(--dp) = lo_filler; - } - row_info->channels = 2; - row_info->pixel_depth = 32; - row_info->rowbytes = row_width * 4; - } - } - } /* COLOR_TYPE == GRAY */ - else if (row_info->color_type == PNG_COLOR_TYPE_RGB) - { - if (row_info->bit_depth == 8) - { - /* This changes the data from RGB to RGBX */ - if (flags & PNG_FLAG_FILLER_AFTER) - { - png_bytep sp = row + (png_size_t)row_width * 3; - png_bytep dp = sp + (png_size_t)row_width; - for (i = 1; i < row_width; i++) - { - *(--dp) = lo_filler; - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - } - *(--dp) = lo_filler; - row_info->channels = 4; - row_info->pixel_depth = 32; - row_info->rowbytes = row_width * 4; - } - /* This changes the data from RGB to XRGB */ - else - { - png_bytep sp = row + (png_size_t)row_width * 3; - png_bytep dp = sp + (png_size_t)row_width; - for (i = 0; i < row_width; i++) - { - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = lo_filler; - } - row_info->channels = 4; - row_info->pixel_depth = 32; - row_info->rowbytes = row_width * 4; - } - } - else if (row_info->bit_depth == 16) - { - /* This changes the data from RRGGBB to RRGGBBXX */ - if (flags & PNG_FLAG_FILLER_AFTER) - { - png_bytep sp = row + (png_size_t)row_width * 6; - png_bytep dp = sp + (png_size_t)row_width * 2; - for (i = 1; i < row_width; i++) - { - *(--dp) = hi_filler; - *(--dp) = lo_filler; - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - } - *(--dp) = hi_filler; - *(--dp) = lo_filler; - row_info->channels = 4; - row_info->pixel_depth = 64; - row_info->rowbytes = row_width * 8; - } - /* This changes the data from RRGGBB to XXRRGGBB */ - else - { - png_bytep sp = row + (png_size_t)row_width * 6; - png_bytep dp = sp + (png_size_t)row_width * 2; - for (i = 0; i < row_width; i++) - { - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = hi_filler; - *(--dp) = lo_filler; - } - row_info->channels = 4; - row_info->pixel_depth = 64; - row_info->rowbytes = row_width * 8; - } - } - } /* COLOR_TYPE == RGB */ -} -#endif - -#if defined(PNG_READ_GRAY_TO_RGB_SUPPORTED) -/* Expand grayscale files to RGB, with or without alpha */ -void /* PRIVATE */ -png_do_gray_to_rgb(png_row_infop row_info, png_bytep row) -{ - png_uint_32 i; - png_uint_32 row_width = row_info->width; - - png_debug(1, "in png_do_gray_to_rgb"); - if (row_info->bit_depth >= 8 && -#if defined(PNG_USELESS_TESTS_SUPPORTED) - row != NULL && row_info != NULL && -#endif - !(row_info->color_type & PNG_COLOR_MASK_COLOR)) - { - if (row_info->color_type == PNG_COLOR_TYPE_GRAY) - { - if (row_info->bit_depth == 8) - { - png_bytep sp = row + (png_size_t)row_width - 1; - png_bytep dp = sp + (png_size_t)row_width * 2; - for (i = 0; i < row_width; i++) - { - *(dp--) = *sp; - *(dp--) = *sp; - *(dp--) = *(sp--); - } - } - else - { - png_bytep sp = row + (png_size_t)row_width * 2 - 1; - png_bytep dp = sp + (png_size_t)row_width * 4; - for (i = 0; i < row_width; i++) - { - *(dp--) = *sp; - *(dp--) = *(sp - 1); - *(dp--) = *sp; - *(dp--) = *(sp - 1); - *(dp--) = *(sp--); - *(dp--) = *(sp--); - } - } - } - else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) - { - if (row_info->bit_depth == 8) - { - png_bytep sp = row + (png_size_t)row_width * 2 - 1; - png_bytep dp = sp + (png_size_t)row_width * 2; - for (i = 0; i < row_width; i++) - { - *(dp--) = *(sp--); - *(dp--) = *sp; - *(dp--) = *sp; - *(dp--) = *(sp--); - } - } - else - { - png_bytep sp = row + (png_size_t)row_width * 4 - 1; - png_bytep dp = sp + (png_size_t)row_width * 4; - for (i = 0; i < row_width; i++) - { - *(dp--) = *(sp--); - *(dp--) = *(sp--); - *(dp--) = *sp; - *(dp--) = *(sp - 1); - *(dp--) = *sp; - *(dp--) = *(sp - 1); - *(dp--) = *(sp--); - *(dp--) = *(sp--); - } - } - } - row_info->channels += (png_byte)2; - row_info->color_type |= PNG_COLOR_MASK_COLOR; - row_info->pixel_depth = (png_byte)(row_info->channels * - row_info->bit_depth); - row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth, row_width); - } -} -#endif - -#if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) -/* Reduce RGB files to grayscale, with or without alpha - * using the equation given in Poynton's ColorFAQ at - * (THIS LINK IS DEAD June 2008) - * New link: - * - * Charles Poynton poynton at poynton.com - * - * Y = 0.212671 * R + 0.715160 * G + 0.072169 * B - * - * We approximate this with - * - * Y = 0.21268 * R + 0.7151 * G + 0.07217 * B - * - * which can be expressed with integers as - * - * Y = (6969 * R + 23434 * G + 2365 * B)/32768 - * - * The calculation is to be done in a linear colorspace. - * - * Other integer coefficents can be used via png_set_rgb_to_gray(). - */ -int /* PRIVATE */ -png_do_rgb_to_gray(png_structp png_ptr, png_row_infop row_info, png_bytep row) - -{ - png_uint_32 i; - - png_uint_32 row_width = row_info->width; - int rgb_error = 0; - - png_debug(1, "in png_do_rgb_to_gray"); - if ( -#if defined(PNG_USELESS_TESTS_SUPPORTED) - row != NULL && row_info != NULL && -#endif - (row_info->color_type & PNG_COLOR_MASK_COLOR)) - { - png_uint_32 rc = png_ptr->rgb_to_gray_red_coeff; - png_uint_32 gc = png_ptr->rgb_to_gray_green_coeff; - png_uint_32 bc = png_ptr->rgb_to_gray_blue_coeff; - - if (row_info->color_type == PNG_COLOR_TYPE_RGB) - { - if (row_info->bit_depth == 8) - { -#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) - if (png_ptr->gamma_from_1 != NULL && png_ptr->gamma_to_1 != NULL) - { - png_bytep sp = row; - png_bytep dp = row; - - for (i = 0; i < row_width; i++) - { - png_byte red = png_ptr->gamma_to_1[*(sp++)]; - png_byte green = png_ptr->gamma_to_1[*(sp++)]; - png_byte blue = png_ptr->gamma_to_1[*(sp++)]; - if (red != green || red != blue) - { - rgb_error |= 1; - *(dp++) = png_ptr->gamma_from_1[ - (rc*red + gc*green + bc*blue)>>15]; - } - else - *(dp++) = *(sp - 1); - } - } - else -#endif - { - png_bytep sp = row; - png_bytep dp = row; - for (i = 0; i < row_width; i++) - { - png_byte red = *(sp++); - png_byte green = *(sp++); - png_byte blue = *(sp++); - if (red != green || red != blue) - { - rgb_error |= 1; - *(dp++) = (png_byte)((rc*red + gc*green + bc*blue)>>15); - } - else - *(dp++) = *(sp - 1); - } - } - } - - else /* RGB bit_depth == 16 */ - { -#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) - if (png_ptr->gamma_16_to_1 != NULL && - png_ptr->gamma_16_from_1 != NULL) - { - png_bytep sp = row; - png_bytep dp = row; - for (i = 0; i < row_width; i++) - { - png_uint_16 red, green, blue, w; - - red = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2; - green = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2; - blue = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2; - - if (red == green && red == blue) - w = red; - else - { - png_uint_16 red_1 = png_ptr->gamma_16_to_1[(red&0xff) >> - png_ptr->gamma_shift][red>>8]; - png_uint_16 green_1 = png_ptr->gamma_16_to_1[(green&0xff) >> - png_ptr->gamma_shift][green>>8]; - png_uint_16 blue_1 = png_ptr->gamma_16_to_1[(blue&0xff) >> - png_ptr->gamma_shift][blue>>8]; - png_uint_16 gray16 = (png_uint_16)((rc*red_1 + gc*green_1 - + bc*blue_1)>>15); - w = png_ptr->gamma_16_from_1[(gray16&0xff) >> - png_ptr->gamma_shift][gray16 >> 8]; - rgb_error |= 1; - } - - *(dp++) = (png_byte)((w>>8) & 0xff); - *(dp++) = (png_byte)(w & 0xff); - } - } - else -#endif - { - png_bytep sp = row; - png_bytep dp = row; - for (i = 0; i < row_width; i++) - { - png_uint_16 red, green, blue, gray16; - - red = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2; - green = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2; - blue = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2; - - if (red != green || red != blue) - rgb_error |= 1; - gray16 = (png_uint_16)((rc*red + gc*green + bc*blue)>>15); - *(dp++) = (png_byte)((gray16>>8) & 0xff); - *(dp++) = (png_byte)(gray16 & 0xff); - } - } - } - } - if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) - { - if (row_info->bit_depth == 8) - { -#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) - if (png_ptr->gamma_from_1 != NULL && png_ptr->gamma_to_1 != NULL) - { - png_bytep sp = row; - png_bytep dp = row; - for (i = 0; i < row_width; i++) - { - png_byte red = png_ptr->gamma_to_1[*(sp++)]; - png_byte green = png_ptr->gamma_to_1[*(sp++)]; - png_byte blue = png_ptr->gamma_to_1[*(sp++)]; - if (red != green || red != blue) - rgb_error |= 1; - *(dp++) = png_ptr->gamma_from_1 - [(rc*red + gc*green + bc*blue)>>15]; - *(dp++) = *(sp++); /* alpha */ - } - } - else -#endif - { - png_bytep sp = row; - png_bytep dp = row; - for (i = 0; i < row_width; i++) - { - png_byte red = *(sp++); - png_byte green = *(sp++); - png_byte blue = *(sp++); - if (red != green || red != blue) - rgb_error |= 1; - *(dp++) = (png_byte)((rc*red + gc*green + bc*blue)>>15); - *(dp++) = *(sp++); /* alpha */ - } - } - } - else /* RGBA bit_depth == 16 */ - { -#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) - if (png_ptr->gamma_16_to_1 != NULL && - png_ptr->gamma_16_from_1 != NULL) - { - png_bytep sp = row; - png_bytep dp = row; - for (i = 0; i < row_width; i++) - { - png_uint_16 red, green, blue, w; - - red = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2; - green = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2; - blue = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2; - - if (red == green && red == blue) - w = red; - else - { - png_uint_16 red_1 = png_ptr->gamma_16_to_1[(red&0xff) >> - png_ptr->gamma_shift][red>>8]; - png_uint_16 green_1 = png_ptr->gamma_16_to_1[(green&0xff) >> - png_ptr->gamma_shift][green>>8]; - png_uint_16 blue_1 = png_ptr->gamma_16_to_1[(blue&0xff) >> - png_ptr->gamma_shift][blue>>8]; - png_uint_16 gray16 = (png_uint_16)((rc * red_1 - + gc * green_1 + bc * blue_1)>>15); - w = png_ptr->gamma_16_from_1[(gray16&0xff) >> - png_ptr->gamma_shift][gray16 >> 8]; - rgb_error |= 1; - } - - *(dp++) = (png_byte)((w>>8) & 0xff); - *(dp++) = (png_byte)(w & 0xff); - *(dp++) = *(sp++); /* alpha */ - *(dp++) = *(sp++); - } - } - else -#endif - { - png_bytep sp = row; - png_bytep dp = row; - for (i = 0; i < row_width; i++) - { - png_uint_16 red, green, blue, gray16; - red = (png_uint_16)((*(sp)<<8) | *(sp+1)); sp+=2; - green = (png_uint_16)((*(sp)<<8) | *(sp+1)); sp+=2; - blue = (png_uint_16)((*(sp)<<8) | *(sp+1)); sp+=2; - if (red != green || red != blue) - rgb_error |= 1; - gray16 = (png_uint_16)((rc*red + gc*green + bc*blue)>>15); - *(dp++) = (png_byte)((gray16>>8) & 0xff); - *(dp++) = (png_byte)(gray16 & 0xff); - *(dp++) = *(sp++); /* alpha */ - *(dp++) = *(sp++); - } - } - } - } - row_info->channels -= (png_byte)2; - row_info->color_type &= ~PNG_COLOR_MASK_COLOR; - row_info->pixel_depth = (png_byte)(row_info->channels * - row_info->bit_depth); - row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth, row_width); - } - return rgb_error; -} -#endif - -/* Build a grayscale palette. Palette is assumed to be 1 << bit_depth - * large of png_color. This lets grayscale images be treated as - * paletted. Most useful for gamma correction and simplification - * of code. - */ -void PNGAPI -png_build_grayscale_palette(int bit_depth, png_colorp palette) -{ - int num_palette; - int color_inc; - int i; - int v; - - png_debug(1, "in png_do_build_grayscale_palette"); - if (palette == NULL) - return; - - switch (bit_depth) - { - case 1: - num_palette = 2; - color_inc = 0xff; - break; - - case 2: - num_palette = 4; - color_inc = 0x55; - break; - - case 4: - num_palette = 16; - color_inc = 0x11; - break; - - case 8: - num_palette = 256; - color_inc = 1; - break; - - default: - num_palette = 0; - color_inc = 0; - break; - } - - for (i = 0, v = 0; i < num_palette; i++, v += color_inc) - { - palette[i].red = (png_byte)v; - palette[i].green = (png_byte)v; - palette[i].blue = (png_byte)v; - } -} - -/* This function is currently unused. Do we really need it? */ -#if defined(PNG_READ_DITHER_SUPPORTED) && defined(PNG_CORRECT_PALETTE_SUPPORTED) -void /* PRIVATE */ -png_correct_palette(png_structp png_ptr, png_colorp palette, - int num_palette) -{ - png_debug(1, "in png_correct_palette"); -#if defined(PNG_READ_BACKGROUND_SUPPORTED) && \ - defined(PNG_READ_GAMMA_SUPPORTED) && defined(PNG_FLOATING_POINT_SUPPORTED) - if (png_ptr->transformations & (PNG_GAMMA | PNG_BACKGROUND)) - { - png_color back, back_1; - - if (png_ptr->background_gamma_type == PNG_BACKGROUND_GAMMA_FILE) - { - back.red = png_ptr->gamma_table[png_ptr->background.red]; - back.green = png_ptr->gamma_table[png_ptr->background.green]; - back.blue = png_ptr->gamma_table[png_ptr->background.blue]; - - back_1.red = png_ptr->gamma_to_1[png_ptr->background.red]; - back_1.green = png_ptr->gamma_to_1[png_ptr->background.green]; - back_1.blue = png_ptr->gamma_to_1[png_ptr->background.blue]; - } - else - { - double g; - - g = 1.0 / (png_ptr->background_gamma * png_ptr->screen_gamma); - - if (png_ptr->background_gamma_type == PNG_BACKGROUND_GAMMA_SCREEN || - fabs(g - 1.0) < PNG_GAMMA_THRESHOLD) - { - back.red = png_ptr->background.red; - back.green = png_ptr->background.green; - back.blue = png_ptr->background.blue; - } - else - { - back.red = - (png_byte)(pow((double)png_ptr->background.red/255, g) * - 255.0 + 0.5); - back.green = - (png_byte)(pow((double)png_ptr->background.green/255, g) * - 255.0 + 0.5); - back.blue = - (png_byte)(pow((double)png_ptr->background.blue/255, g) * - 255.0 + 0.5); - } - - g = 1.0 / png_ptr->background_gamma; - - back_1.red = - (png_byte)(pow((double)png_ptr->background.red/255, g) * - 255.0 + 0.5); - back_1.green = - (png_byte)(pow((double)png_ptr->background.green/255, g) * - 255.0 + 0.5); - back_1.blue = - (png_byte)(pow((double)png_ptr->background.blue/255, g) * - 255.0 + 0.5); - } - - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - { - png_uint_32 i; - - for (i = 0; i < (png_uint_32)num_palette; i++) - { - if (i < png_ptr->num_trans && png_ptr->trans[i] == 0) - { - palette[i] = back; - } - else if (i < png_ptr->num_trans && png_ptr->trans[i] != 0xff) - { - png_byte v, w; - - v = png_ptr->gamma_to_1[png_ptr->palette[i].red]; - png_composite(w, v, png_ptr->trans[i], back_1.red); - palette[i].red = png_ptr->gamma_from_1[w]; - - v = png_ptr->gamma_to_1[png_ptr->palette[i].green]; - png_composite(w, v, png_ptr->trans[i], back_1.green); - palette[i].green = png_ptr->gamma_from_1[w]; - - v = png_ptr->gamma_to_1[png_ptr->palette[i].blue]; - png_composite(w, v, png_ptr->trans[i], back_1.blue); - palette[i].blue = png_ptr->gamma_from_1[w]; - } - else - { - palette[i].red = png_ptr->gamma_table[palette[i].red]; - palette[i].green = png_ptr->gamma_table[palette[i].green]; - palette[i].blue = png_ptr->gamma_table[palette[i].blue]; - } - } - } - else - { - int i; - - for (i = 0; i < num_palette; i++) - { - if (palette[i].red == (png_byte)png_ptr->trans_values.gray) - { - palette[i] = back; - } - else - { - palette[i].red = png_ptr->gamma_table[palette[i].red]; - palette[i].green = png_ptr->gamma_table[palette[i].green]; - palette[i].blue = png_ptr->gamma_table[palette[i].blue]; - } - } - } - } - else -#endif -#if defined(PNG_READ_GAMMA_SUPPORTED) - if (png_ptr->transformations & PNG_GAMMA) - { - int i; - - for (i = 0; i < num_palette; i++) - { - palette[i].red = png_ptr->gamma_table[palette[i].red]; - palette[i].green = png_ptr->gamma_table[palette[i].green]; - palette[i].blue = png_ptr->gamma_table[palette[i].blue]; - } - } -#if defined(PNG_READ_BACKGROUND_SUPPORTED) - else -#endif -#endif -#if defined(PNG_READ_BACKGROUND_SUPPORTED) - if (png_ptr->transformations & PNG_BACKGROUND) - { - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - { - png_color back; - - back.red = (png_byte)png_ptr->background.red; - back.green = (png_byte)png_ptr->background.green; - back.blue = (png_byte)png_ptr->background.blue; - - for (i = 0; i < (int)png_ptr->num_trans; i++) - { - if (png_ptr->trans[i] == 0) - { - palette[i].red = back.red; - palette[i].green = back.green; - palette[i].blue = back.blue; - } - else if (png_ptr->trans[i] != 0xff) - { - png_composite(palette[i].red, png_ptr->palette[i].red, - png_ptr->trans[i], back.red); - png_composite(palette[i].green, png_ptr->palette[i].green, - png_ptr->trans[i], back.green); - png_composite(palette[i].blue, png_ptr->palette[i].blue, - png_ptr->trans[i], back.blue); - } - } - } - else /* Assume grayscale palette (what else could it be?) */ - { - int i; - - for (i = 0; i < num_palette; i++) - { - if (i == (png_byte)png_ptr->trans_values.gray) - { - palette[i].red = (png_byte)png_ptr->background.red; - palette[i].green = (png_byte)png_ptr->background.green; - palette[i].blue = (png_byte)png_ptr->background.blue; - } - } - } - } -#endif -} -#endif - -#if defined(PNG_READ_BACKGROUND_SUPPORTED) -/* Replace any alpha or transparency with the supplied background color. - * "background" is already in the screen gamma, while "background_1" is - * at a gamma of 1.0. Paletted files have already been taken care of. - */ -void /* PRIVATE */ -png_do_background(png_row_infop row_info, png_bytep row, - png_color_16p trans_values, png_color_16p background -#if defined(PNG_READ_GAMMA_SUPPORTED) - , png_color_16p background_1, - png_bytep gamma_table, png_bytep gamma_from_1, png_bytep gamma_to_1, - png_uint_16pp gamma_16, png_uint_16pp gamma_16_from_1, - png_uint_16pp gamma_16_to_1, int gamma_shift -#endif - ) -{ - png_bytep sp, dp; - png_uint_32 i; - png_uint_32 row_width=row_info->width; - int shift; - - png_debug(1, "in png_do_background"); - if (background != NULL && -#if defined(PNG_USELESS_TESTS_SUPPORTED) - row != NULL && row_info != NULL && -#endif - (!(row_info->color_type & PNG_COLOR_MASK_ALPHA) || - (row_info->color_type != PNG_COLOR_TYPE_PALETTE && trans_values))) - { - switch (row_info->color_type) - { - case PNG_COLOR_TYPE_GRAY: - { - switch (row_info->bit_depth) - { - case 1: - { - sp = row; - shift = 7; - for (i = 0; i < row_width; i++) - { - if ((png_uint_16)((*sp >> shift) & 0x01) - == trans_values->gray) - { - *sp &= (png_byte)((0x7f7f >> (7 - shift)) & 0xff); - *sp |= (png_byte)(background->gray << shift); - } - if (!shift) - { - shift = 7; - sp++; - } - else - shift--; - } - break; - } - - case 2: - { -#if defined(PNG_READ_GAMMA_SUPPORTED) - if (gamma_table != NULL) - { - sp = row; - shift = 6; - for (i = 0; i < row_width; i++) - { - if ((png_uint_16)((*sp >> shift) & 0x03) - == trans_values->gray) - { - *sp &= (png_byte)((0x3f3f >> (6 - shift)) & 0xff); - *sp |= (png_byte)(background->gray << shift); - } - else - { - png_byte p = (png_byte)((*sp >> shift) & 0x03); - png_byte g = (png_byte)((gamma_table [p | (p << 2) | - (p << 4) | (p << 6)] >> 6) & 0x03); - *sp &= (png_byte)((0x3f3f >> (6 - shift)) & 0xff); - *sp |= (png_byte)(g << shift); - } - if (!shift) - { - shift = 6; - sp++; - } - else - shift -= 2; - } - } - else -#endif - { - sp = row; - shift = 6; - for (i = 0; i < row_width; i++) - { - if ((png_uint_16)((*sp >> shift) & 0x03) - == trans_values->gray) - { - *sp &= (png_byte)((0x3f3f >> (6 - shift)) & 0xff); - *sp |= (png_byte)(background->gray << shift); - } - if (!shift) - { - shift = 6; - sp++; - } - else - shift -= 2; - } - } - break; - } - - case 4: - { -#if defined(PNG_READ_GAMMA_SUPPORTED) - if (gamma_table != NULL) - { - sp = row; - shift = 4; - for (i = 0; i < row_width; i++) - { - if ((png_uint_16)((*sp >> shift) & 0x0f) - == trans_values->gray) - { - *sp &= (png_byte)((0xf0f >> (4 - shift)) & 0xff); - *sp |= (png_byte)(background->gray << shift); - } - else - { - png_byte p = (png_byte)((*sp >> shift) & 0x0f); - png_byte g = (png_byte)((gamma_table[p | - (p << 4)] >> 4) & 0x0f); - *sp &= (png_byte)((0xf0f >> (4 - shift)) & 0xff); - *sp |= (png_byte)(g << shift); - } - if (!shift) - { - shift = 4; - sp++; - } - else - shift -= 4; - } - } - else -#endif - { - sp = row; - shift = 4; - for (i = 0; i < row_width; i++) - { - if ((png_uint_16)((*sp >> shift) & 0x0f) - == trans_values->gray) - { - *sp &= (png_byte)((0xf0f >> (4 - shift)) & 0xff); - *sp |= (png_byte)(background->gray << shift); - } - if (!shift) - { - shift = 4; - sp++; - } - else - shift -= 4; - } - } - break; - } - - case 8: - { -#if defined(PNG_READ_GAMMA_SUPPORTED) - if (gamma_table != NULL) - { - sp = row; - for (i = 0; i < row_width; i++, sp++) - { - if (*sp == trans_values->gray) - { - *sp = (png_byte)background->gray; - } - else - { - *sp = gamma_table[*sp]; - } - } - } - else -#endif - { - sp = row; - for (i = 0; i < row_width; i++, sp++) - { - if (*sp == trans_values->gray) - { - *sp = (png_byte)background->gray; - } - } - } - break; - } - - case 16: - { -#if defined(PNG_READ_GAMMA_SUPPORTED) - if (gamma_16 != NULL) - { - sp = row; - for (i = 0; i < row_width; i++, sp += 2) - { - png_uint_16 v; - - v = (png_uint_16)(((*sp) << 8) + *(sp + 1)); - if (v == trans_values->gray) - { - /* Background is already in screen gamma */ - *sp = (png_byte)((background->gray >> 8) & 0xff); - *(sp + 1) = (png_byte)(background->gray & 0xff); - } - else - { - v = gamma_16[*(sp + 1) >> gamma_shift][*sp]; - *sp = (png_byte)((v >> 8) & 0xff); - *(sp + 1) = (png_byte)(v & 0xff); - } - } - } - else -#endif - { - sp = row; - for (i = 0; i < row_width; i++, sp += 2) - { - png_uint_16 v; - - v = (png_uint_16)(((*sp) << 8) + *(sp + 1)); - if (v == trans_values->gray) - { - *sp = (png_byte)((background->gray >> 8) & 0xff); - *(sp + 1) = (png_byte)(background->gray & 0xff); - } - } - } - break; - } - } - break; - } - - case PNG_COLOR_TYPE_RGB: - { - if (row_info->bit_depth == 8) - { -#if defined(PNG_READ_GAMMA_SUPPORTED) - if (gamma_table != NULL) - { - sp = row; - for (i = 0; i < row_width; i++, sp += 3) - { - if (*sp == trans_values->red && - *(sp + 1) == trans_values->green && - *(sp + 2) == trans_values->blue) - { - *sp = (png_byte)background->red; - *(sp + 1) = (png_byte)background->green; - *(sp + 2) = (png_byte)background->blue; - } - else - { - *sp = gamma_table[*sp]; - *(sp + 1) = gamma_table[*(sp + 1)]; - *(sp + 2) = gamma_table[*(sp + 2)]; - } - } - } - else -#endif - { - sp = row; - for (i = 0; i < row_width; i++, sp += 3) - { - if (*sp == trans_values->red && - *(sp + 1) == trans_values->green && - *(sp + 2) == trans_values->blue) - { - *sp = (png_byte)background->red; - *(sp + 1) = (png_byte)background->green; - *(sp + 2) = (png_byte)background->blue; - } - } - } - } - else /* if (row_info->bit_depth == 16) */ - { -#if defined(PNG_READ_GAMMA_SUPPORTED) - if (gamma_16 != NULL) - { - sp = row; - for (i = 0; i < row_width; i++, sp += 6) - { - png_uint_16 r = (png_uint_16)(((*sp) << 8) + *(sp + 1)); - png_uint_16 g = (png_uint_16)(((*(sp+2)) << 8) + *(sp+3)); - png_uint_16 b = (png_uint_16)(((*(sp+4)) << 8) + *(sp+5)); - if (r == trans_values->red && g == trans_values->green && - b == trans_values->blue) - { - /* Background is already in screen gamma */ - *sp = (png_byte)((background->red >> 8) & 0xff); - *(sp + 1) = (png_byte)(background->red & 0xff); - *(sp + 2) = (png_byte)((background->green >> 8) & 0xff); - *(sp + 3) = (png_byte)(background->green & 0xff); - *(sp + 4) = (png_byte)((background->blue >> 8) & 0xff); - *(sp + 5) = (png_byte)(background->blue & 0xff); - } - else - { - png_uint_16 v = gamma_16[*(sp + 1) >> gamma_shift][*sp]; - *sp = (png_byte)((v >> 8) & 0xff); - *(sp + 1) = (png_byte)(v & 0xff); - v = gamma_16[*(sp + 3) >> gamma_shift][*(sp + 2)]; - *(sp + 2) = (png_byte)((v >> 8) & 0xff); - *(sp + 3) = (png_byte)(v & 0xff); - v = gamma_16[*(sp + 5) >> gamma_shift][*(sp + 4)]; - *(sp + 4) = (png_byte)((v >> 8) & 0xff); - *(sp + 5) = (png_byte)(v & 0xff); - } - } - } - else -#endif - { - sp = row; - for (i = 0; i < row_width; i++, sp += 6) - { - png_uint_16 r = (png_uint_16)(((*sp) << 8) + *(sp+1)); - png_uint_16 g = (png_uint_16)(((*(sp+2)) << 8) + *(sp+3)); - png_uint_16 b = (png_uint_16)(((*(sp+4)) << 8) + *(sp+5)); - - if (r == trans_values->red && g == trans_values->green && - b == trans_values->blue) - { - *sp = (png_byte)((background->red >> 8) & 0xff); - *(sp + 1) = (png_byte)(background->red & 0xff); - *(sp + 2) = (png_byte)((background->green >> 8) & 0xff); - *(sp + 3) = (png_byte)(background->green & 0xff); - *(sp + 4) = (png_byte)((background->blue >> 8) & 0xff); - *(sp + 5) = (png_byte)(background->blue & 0xff); - } - } - } - } - break; - } - - case PNG_COLOR_TYPE_GRAY_ALPHA: - { - if (row_info->bit_depth == 8) - { -#if defined(PNG_READ_GAMMA_SUPPORTED) - if (gamma_to_1 != NULL && gamma_from_1 != NULL && - gamma_table != NULL) - { - sp = row; - dp = row; - for (i = 0; i < row_width; i++, sp += 2, dp++) - { - png_uint_16 a = *(sp + 1); - - if (a == 0xff) - { - *dp = gamma_table[*sp]; - } - else if (a == 0) - { - /* Background is already in screen gamma */ - *dp = (png_byte)background->gray; - } - else - { - png_byte v, w; - - v = gamma_to_1[*sp]; - png_composite(w, v, a, background_1->gray); - *dp = gamma_from_1[w]; - } - } - } - else -#endif - { - sp = row; - dp = row; - for (i = 0; i < row_width; i++, sp += 2, dp++) - { - png_byte a = *(sp + 1); - - if (a == 0xff) - { - *dp = *sp; - } -#if defined(PNG_READ_GAMMA_SUPPORTED) - else if (a == 0) - { - *dp = (png_byte)background->gray; - } - else - { - png_composite(*dp, *sp, a, background_1->gray); - } -#else - *dp = (png_byte)background->gray; -#endif - } - } - } - else /* if (png_ptr->bit_depth == 16) */ - { -#if defined(PNG_READ_GAMMA_SUPPORTED) - if (gamma_16 != NULL && gamma_16_from_1 != NULL && - gamma_16_to_1 != NULL) - { - sp = row; - dp = row; - for (i = 0; i < row_width; i++, sp += 4, dp += 2) - { - png_uint_16 a = (png_uint_16)(((*(sp+2)) << 8) + *(sp+3)); - - if (a == (png_uint_16)0xffff) - { - png_uint_16 v; - - v = gamma_16[*(sp + 1) >> gamma_shift][*sp]; - *dp = (png_byte)((v >> 8) & 0xff); - *(dp + 1) = (png_byte)(v & 0xff); - } -#if defined(PNG_READ_GAMMA_SUPPORTED) - else if (a == 0) -#else - else -#endif - { - /* Background is already in screen gamma */ - *dp = (png_byte)((background->gray >> 8) & 0xff); - *(dp + 1) = (png_byte)(background->gray & 0xff); - } -#if defined(PNG_READ_GAMMA_SUPPORTED) - else - { - png_uint_16 g, v, w; - - g = gamma_16_to_1[*(sp + 1) >> gamma_shift][*sp]; - png_composite_16(v, g, a, background_1->gray); - w = gamma_16_from_1[(v&0xff) >> gamma_shift][v >> 8]; - *dp = (png_byte)((w >> 8) & 0xff); - *(dp + 1) = (png_byte)(w & 0xff); - } -#endif - } - } - else -#endif - { - sp = row; - dp = row; - for (i = 0; i < row_width; i++, sp += 4, dp += 2) - { - png_uint_16 a = (png_uint_16)(((*(sp+2)) << 8) + *(sp+3)); - if (a == (png_uint_16)0xffff) - { - png_memcpy(dp, sp, 2); - } -#if defined(PNG_READ_GAMMA_SUPPORTED) - else if (a == 0) -#else - else -#endif - { - *dp = (png_byte)((background->gray >> 8) & 0xff); - *(dp + 1) = (png_byte)(background->gray & 0xff); - } -#if defined(PNG_READ_GAMMA_SUPPORTED) - else - { - png_uint_16 g, v; - - g = (png_uint_16)(((*sp) << 8) + *(sp + 1)); - png_composite_16(v, g, a, background_1->gray); - *dp = (png_byte)((v >> 8) & 0xff); - *(dp + 1) = (png_byte)(v & 0xff); - } -#endif - } - } - } - break; - } - - case PNG_COLOR_TYPE_RGB_ALPHA: - { - if (row_info->bit_depth == 8) - { -#if defined(PNG_READ_GAMMA_SUPPORTED) - if (gamma_to_1 != NULL && gamma_from_1 != NULL && - gamma_table != NULL) - { - sp = row; - dp = row; - for (i = 0; i < row_width; i++, sp += 4, dp += 3) - { - png_byte a = *(sp + 3); - - if (a == 0xff) - { - *dp = gamma_table[*sp]; - *(dp + 1) = gamma_table[*(sp + 1)]; - *(dp + 2) = gamma_table[*(sp + 2)]; - } - else if (a == 0) - { - /* Background is already in screen gamma */ - *dp = (png_byte)background->red; - *(dp + 1) = (png_byte)background->green; - *(dp + 2) = (png_byte)background->blue; - } - else - { - png_byte v, w; - - v = gamma_to_1[*sp]; - png_composite(w, v, a, background_1->red); - *dp = gamma_from_1[w]; - v = gamma_to_1[*(sp + 1)]; - png_composite(w, v, a, background_1->green); - *(dp + 1) = gamma_from_1[w]; - v = gamma_to_1[*(sp + 2)]; - png_composite(w, v, a, background_1->blue); - *(dp + 2) = gamma_from_1[w]; - } - } - } - else -#endif - { - sp = row; - dp = row; - for (i = 0; i < row_width; i++, sp += 4, dp += 3) - { - png_byte a = *(sp + 3); - - if (a == 0xff) - { - *dp = *sp; - *(dp + 1) = *(sp + 1); - *(dp + 2) = *(sp + 2); - } - else if (a == 0) - { - *dp = (png_byte)background->red; - *(dp + 1) = (png_byte)background->green; - *(dp + 2) = (png_byte)background->blue; - } - else - { - png_composite(*dp, *sp, a, background->red); - png_composite(*(dp + 1), *(sp + 1), a, - background->green); - png_composite(*(dp + 2), *(sp + 2), a, - background->blue); - } - } - } - } - else /* if (row_info->bit_depth == 16) */ - { -#if defined(PNG_READ_GAMMA_SUPPORTED) - if (gamma_16 != NULL && gamma_16_from_1 != NULL && - gamma_16_to_1 != NULL) - { - sp = row; - dp = row; - for (i = 0; i < row_width; i++, sp += 8, dp += 6) - { - png_uint_16 a = (png_uint_16)(((png_uint_16)(*(sp + 6)) - << 8) + (png_uint_16)(*(sp + 7))); - if (a == (png_uint_16)0xffff) - { - png_uint_16 v; - - v = gamma_16[*(sp + 1) >> gamma_shift][*sp]; - *dp = (png_byte)((v >> 8) & 0xff); - *(dp + 1) = (png_byte)(v & 0xff); - v = gamma_16[*(sp + 3) >> gamma_shift][*(sp + 2)]; - *(dp + 2) = (png_byte)((v >> 8) & 0xff); - *(dp + 3) = (png_byte)(v & 0xff); - v = gamma_16[*(sp + 5) >> gamma_shift][*(sp + 4)]; - *(dp + 4) = (png_byte)((v >> 8) & 0xff); - *(dp + 5) = (png_byte)(v & 0xff); - } - else if (a == 0) - { - /* Background is already in screen gamma */ - *dp = (png_byte)((background->red >> 8) & 0xff); - *(dp + 1) = (png_byte)(background->red & 0xff); - *(dp + 2) = (png_byte)((background->green >> 8) & 0xff); - *(dp + 3) = (png_byte)(background->green & 0xff); - *(dp + 4) = (png_byte)((background->blue >> 8) & 0xff); - *(dp + 5) = (png_byte)(background->blue & 0xff); - } - else - { - png_uint_16 v, w, x; - - v = gamma_16_to_1[*(sp + 1) >> gamma_shift][*sp]; - png_composite_16(w, v, a, background_1->red); - x = gamma_16_from_1[((w&0xff) >> gamma_shift)][w >> 8]; - *dp = (png_byte)((x >> 8) & 0xff); - *(dp + 1) = (png_byte)(x & 0xff); - v = gamma_16_to_1[*(sp + 3) >> gamma_shift][*(sp + 2)]; - png_composite_16(w, v, a, background_1->green); - x = gamma_16_from_1[((w&0xff) >> gamma_shift)][w >> 8]; - *(dp + 2) = (png_byte)((x >> 8) & 0xff); - *(dp + 3) = (png_byte)(x & 0xff); - v = gamma_16_to_1[*(sp + 5) >> gamma_shift][*(sp + 4)]; - png_composite_16(w, v, a, background_1->blue); - x = gamma_16_from_1[(w & 0xff) >> gamma_shift][w >> 8]; - *(dp + 4) = (png_byte)((x >> 8) & 0xff); - *(dp + 5) = (png_byte)(x & 0xff); - } - } - } - else -#endif - { - sp = row; - dp = row; - for (i = 0; i < row_width; i++, sp += 8, dp += 6) - { - png_uint_16 a = (png_uint_16)(((png_uint_16)(*(sp + 6)) - << 8) + (png_uint_16)(*(sp + 7))); - if (a == (png_uint_16)0xffff) - { - png_memcpy(dp, sp, 6); - } - else if (a == 0) - { - *dp = (png_byte)((background->red >> 8) & 0xff); - *(dp + 1) = (png_byte)(background->red & 0xff); - *(dp + 2) = (png_byte)((background->green >> 8) & 0xff); - *(dp + 3) = (png_byte)(background->green & 0xff); - *(dp + 4) = (png_byte)((background->blue >> 8) & 0xff); - *(dp + 5) = (png_byte)(background->blue & 0xff); - } - else - { - png_uint_16 v; - - png_uint_16 r = (png_uint_16)(((*sp) << 8) + *(sp + 1)); - png_uint_16 g = (png_uint_16)(((*(sp + 2)) << 8) - + *(sp + 3)); - png_uint_16 b = (png_uint_16)(((*(sp + 4)) << 8) - + *(sp + 5)); - - png_composite_16(v, r, a, background->red); - *dp = (png_byte)((v >> 8) & 0xff); - *(dp + 1) = (png_byte)(v & 0xff); - png_composite_16(v, g, a, background->green); - *(dp + 2) = (png_byte)((v >> 8) & 0xff); - *(dp + 3) = (png_byte)(v & 0xff); - png_composite_16(v, b, a, background->blue); - *(dp + 4) = (png_byte)((v >> 8) & 0xff); - *(dp + 5) = (png_byte)(v & 0xff); - } - } - } - } - break; - } - } - - if (row_info->color_type & PNG_COLOR_MASK_ALPHA) - { - row_info->color_type &= ~PNG_COLOR_MASK_ALPHA; - row_info->channels--; - row_info->pixel_depth = (png_byte)(row_info->channels * - row_info->bit_depth); - row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth, row_width); - } - } -} -#endif - -#if defined(PNG_READ_GAMMA_SUPPORTED) -/* Gamma correct the image, avoiding the alpha channel. Make sure - * you do this after you deal with the transparency issue on grayscale - * or RGB images. If your bit depth is 8, use gamma_table, if it - * is 16, use gamma_16_table and gamma_shift. Build these with - * build_gamma_table(). - */ -void /* PRIVATE */ -png_do_gamma(png_row_infop row_info, png_bytep row, - png_bytep gamma_table, png_uint_16pp gamma_16_table, - int gamma_shift) -{ - png_bytep sp; - png_uint_32 i; - png_uint_32 row_width=row_info->width; - - png_debug(1, "in png_do_gamma"); - if ( -#if defined(PNG_USELESS_TESTS_SUPPORTED) - row != NULL && row_info != NULL && -#endif - ((row_info->bit_depth <= 8 && gamma_table != NULL) || - (row_info->bit_depth == 16 && gamma_16_table != NULL))) - { - switch (row_info->color_type) - { - case PNG_COLOR_TYPE_RGB: - { - if (row_info->bit_depth == 8) - { - sp = row; - for (i = 0; i < row_width; i++) - { - *sp = gamma_table[*sp]; - sp++; - *sp = gamma_table[*sp]; - sp++; - *sp = gamma_table[*sp]; - sp++; - } - } - else /* if (row_info->bit_depth == 16) */ - { - sp = row; - for (i = 0; i < row_width; i++) - { - png_uint_16 v; - - v = gamma_16_table[*(sp + 1) >> gamma_shift][*sp]; - *sp = (png_byte)((v >> 8) & 0xff); - *(sp + 1) = (png_byte)(v & 0xff); - sp += 2; - v = gamma_16_table[*(sp + 1) >> gamma_shift][*sp]; - *sp = (png_byte)((v >> 8) & 0xff); - *(sp + 1) = (png_byte)(v & 0xff); - sp += 2; - v = gamma_16_table[*(sp + 1) >> gamma_shift][*sp]; - *sp = (png_byte)((v >> 8) & 0xff); - *(sp + 1) = (png_byte)(v & 0xff); - sp += 2; - } - } - break; - } - - case PNG_COLOR_TYPE_RGB_ALPHA: - { - if (row_info->bit_depth == 8) - { - sp = row; - for (i = 0; i < row_width; i++) - { - *sp = gamma_table[*sp]; - sp++; - *sp = gamma_table[*sp]; - sp++; - *sp = gamma_table[*sp]; - sp++; - sp++; - } - } - else /* if (row_info->bit_depth == 16) */ - { - sp = row; - for (i = 0; i < row_width; i++) - { - png_uint_16 v = gamma_16_table[*(sp + 1) >> gamma_shift][*sp]; - *sp = (png_byte)((v >> 8) & 0xff); - *(sp + 1) = (png_byte)(v & 0xff); - sp += 2; - v = gamma_16_table[*(sp + 1) >> gamma_shift][*sp]; - *sp = (png_byte)((v >> 8) & 0xff); - *(sp + 1) = (png_byte)(v & 0xff); - sp += 2; - v = gamma_16_table[*(sp + 1) >> gamma_shift][*sp]; - *sp = (png_byte)((v >> 8) & 0xff); - *(sp + 1) = (png_byte)(v & 0xff); - sp += 4; - } - } - break; - } - - case PNG_COLOR_TYPE_GRAY_ALPHA: - { - if (row_info->bit_depth == 8) - { - sp = row; - for (i = 0; i < row_width; i++) - { - *sp = gamma_table[*sp]; - sp += 2; - } - } - else /* if (row_info->bit_depth == 16) */ - { - sp = row; - for (i = 0; i < row_width; i++) - { - png_uint_16 v = gamma_16_table[*(sp + 1) >> gamma_shift][*sp]; - *sp = (png_byte)((v >> 8) & 0xff); - *(sp + 1) = (png_byte)(v & 0xff); - sp += 4; - } - } - break; - } - - case PNG_COLOR_TYPE_GRAY: - { - if (row_info->bit_depth == 2) - { - sp = row; - for (i = 0; i < row_width; i += 4) - { - int a = *sp & 0xc0; - int b = *sp & 0x30; - int c = *sp & 0x0c; - int d = *sp & 0x03; - - *sp = (png_byte)( - ((((int)gamma_table[a|(a>>2)|(a>>4)|(a>>6)]) ) & 0xc0)| - ((((int)gamma_table[(b<<2)|b|(b>>2)|(b>>4)])>>2) & 0x30)| - ((((int)gamma_table[(c<<4)|(c<<2)|c|(c>>2)])>>4) & 0x0c)| - ((((int)gamma_table[(d<<6)|(d<<4)|(d<<2)|d])>>6) )); - sp++; - } - } - - if (row_info->bit_depth == 4) - { - sp = row; - for (i = 0; i < row_width; i += 2) - { - int msb = *sp & 0xf0; - int lsb = *sp & 0x0f; - - *sp = (png_byte)((((int)gamma_table[msb | (msb >> 4)]) & 0xf0) - | (((int)gamma_table[(lsb << 4) | lsb]) >> 4)); - sp++; - } - } - - else if (row_info->bit_depth == 8) - { - sp = row; - for (i = 0; i < row_width; i++) - { - *sp = gamma_table[*sp]; - sp++; - } - } - - else if (row_info->bit_depth == 16) - { - sp = row; - for (i = 0; i < row_width; i++) - { - png_uint_16 v = gamma_16_table[*(sp + 1) >> gamma_shift][*sp]; - *sp = (png_byte)((v >> 8) & 0xff); - *(sp + 1) = (png_byte)(v & 0xff); - sp += 2; - } - } - break; - } - } - } -} -#endif - -#if defined(PNG_READ_EXPAND_SUPPORTED) -/* Expands a palette row to an RGB or RGBA row depending - * upon whether you supply trans and num_trans. - */ -void /* PRIVATE */ -png_do_expand_palette(png_row_infop row_info, png_bytep row, - png_colorp palette, png_bytep trans, int num_trans) -{ - int shift, value; - png_bytep sp, dp; - png_uint_32 i; - png_uint_32 row_width=row_info->width; - - png_debug(1, "in png_do_expand_palette"); - if ( -#if defined(PNG_USELESS_TESTS_SUPPORTED) - row != NULL && row_info != NULL && -#endif - row_info->color_type == PNG_COLOR_TYPE_PALETTE) - { - if (row_info->bit_depth < 8) - { - switch (row_info->bit_depth) - { - case 1: - { - sp = row + (png_size_t)((row_width - 1) >> 3); - dp = row + (png_size_t)row_width - 1; - shift = 7 - (int)((row_width + 7) & 0x07); - for (i = 0; i < row_width; i++) - { - if ((*sp >> shift) & 0x01) - *dp = 1; - else - *dp = 0; - if (shift == 7) - { - shift = 0; - sp--; - } - else - shift++; - - dp--; - } - break; - } - - case 2: - { - sp = row + (png_size_t)((row_width - 1) >> 2); - dp = row + (png_size_t)row_width - 1; - shift = (int)((3 - ((row_width + 3) & 0x03)) << 1); - for (i = 0; i < row_width; i++) - { - value = (*sp >> shift) & 0x03; - *dp = (png_byte)value; - if (shift == 6) - { - shift = 0; - sp--; - } - else - shift += 2; - - dp--; - } - break; - } - - case 4: - { - sp = row + (png_size_t)((row_width - 1) >> 1); - dp = row + (png_size_t)row_width - 1; - shift = (int)((row_width & 0x01) << 2); - for (i = 0; i < row_width; i++) - { - value = (*sp >> shift) & 0x0f; - *dp = (png_byte)value; - if (shift == 4) - { - shift = 0; - sp--; - } - else - shift += 4; - - dp--; - } - break; - } - } - row_info->bit_depth = 8; - row_info->pixel_depth = 8; - row_info->rowbytes = row_width; - } - switch (row_info->bit_depth) - { - case 8: - { - if (trans != NULL) - { - sp = row + (png_size_t)row_width - 1; - dp = row + (png_size_t)(row_width << 2) - 1; - - for (i = 0; i < row_width; i++) - { - if ((int)(*sp) >= num_trans) - *dp-- = 0xff; - else - *dp-- = trans[*sp]; - *dp-- = palette[*sp].blue; - *dp-- = palette[*sp].green; - *dp-- = palette[*sp].red; - sp--; - } - row_info->bit_depth = 8; - row_info->pixel_depth = 32; - row_info->rowbytes = row_width * 4; - row_info->color_type = 6; - row_info->channels = 4; - } - else - { - sp = row + (png_size_t)row_width - 1; - dp = row + (png_size_t)(row_width * 3) - 1; - - for (i = 0; i < row_width; i++) - { - *dp-- = palette[*sp].blue; - *dp-- = palette[*sp].green; - *dp-- = palette[*sp].red; - sp--; - } - - row_info->bit_depth = 8; - row_info->pixel_depth = 24; - row_info->rowbytes = row_width * 3; - row_info->color_type = 2; - row_info->channels = 3; - } - break; - } - } - } -} - -/* If the bit depth < 8, it is expanded to 8. Also, if the already - * expanded transparency value is supplied, an alpha channel is built. - */ -void /* PRIVATE */ -png_do_expand(png_row_infop row_info, png_bytep row, - png_color_16p trans_value) -{ - int shift, value; - png_bytep sp, dp; - png_uint_32 i; - png_uint_32 row_width=row_info->width; - - png_debug(1, "in png_do_expand"); -#if defined(PNG_USELESS_TESTS_SUPPORTED) - if (row != NULL && row_info != NULL) -#endif - { - if (row_info->color_type == PNG_COLOR_TYPE_GRAY) - { - png_uint_16 gray = (png_uint_16)(trans_value ? trans_value->gray : 0); - - if (row_info->bit_depth < 8) - { - switch (row_info->bit_depth) - { - case 1: - { - gray = (png_uint_16)((gray&0x01)*0xff); - sp = row + (png_size_t)((row_width - 1) >> 3); - dp = row + (png_size_t)row_width - 1; - shift = 7 - (int)((row_width + 7) & 0x07); - for (i = 0; i < row_width; i++) - { - if ((*sp >> shift) & 0x01) - *dp = 0xff; - else - *dp = 0; - if (shift == 7) - { - shift = 0; - sp--; - } - else - shift++; - - dp--; - } - break; - } - - case 2: - { - gray = (png_uint_16)((gray&0x03)*0x55); - sp = row + (png_size_t)((row_width - 1) >> 2); - dp = row + (png_size_t)row_width - 1; - shift = (int)((3 - ((row_width + 3) & 0x03)) << 1); - for (i = 0; i < row_width; i++) - { - value = (*sp >> shift) & 0x03; - *dp = (png_byte)(value | (value << 2) | (value << 4) | - (value << 6)); - if (shift == 6) - { - shift = 0; - sp--; - } - else - shift += 2; - - dp--; - } - break; - } - - case 4: - { - gray = (png_uint_16)((gray&0x0f)*0x11); - sp = row + (png_size_t)((row_width - 1) >> 1); - dp = row + (png_size_t)row_width - 1; - shift = (int)((1 - ((row_width + 1) & 0x01)) << 2); - for (i = 0; i < row_width; i++) - { - value = (*sp >> shift) & 0x0f; - *dp = (png_byte)(value | (value << 4)); - if (shift == 4) - { - shift = 0; - sp--; - } - else - shift = 4; - - dp--; - } - break; - } - } - - row_info->bit_depth = 8; - row_info->pixel_depth = 8; - row_info->rowbytes = row_width; - } - - if (trans_value != NULL) - { - if (row_info->bit_depth == 8) - { - gray = gray & 0xff; - sp = row + (png_size_t)row_width - 1; - dp = row + (png_size_t)(row_width << 1) - 1; - for (i = 0; i < row_width; i++) - { - if (*sp == gray) - *dp-- = 0; - else - *dp-- = 0xff; - *dp-- = *sp--; - } - } - - else if (row_info->bit_depth == 16) - { - png_byte gray_high = (gray >> 8) & 0xff; - png_byte gray_low = gray & 0xff; - sp = row + row_info->rowbytes - 1; - dp = row + (row_info->rowbytes << 1) - 1; - for (i = 0; i < row_width; i++) - { - if (*(sp - 1) == gray_high && *(sp) == gray_low) - { - *dp-- = 0; - *dp-- = 0; - } - else - { - *dp-- = 0xff; - *dp-- = 0xff; - } - *dp-- = *sp--; - *dp-- = *sp--; - } - } - - row_info->color_type = PNG_COLOR_TYPE_GRAY_ALPHA; - row_info->channels = 2; - row_info->pixel_depth = (png_byte)(row_info->bit_depth << 1); - row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth, - row_width); - } - } - else if (row_info->color_type == PNG_COLOR_TYPE_RGB && trans_value) - { - if (row_info->bit_depth == 8) - { - png_byte red = trans_value->red & 0xff; - png_byte green = trans_value->green & 0xff; - png_byte blue = trans_value->blue & 0xff; - sp = row + (png_size_t)row_info->rowbytes - 1; - dp = row + (png_size_t)(row_width << 2) - 1; - for (i = 0; i < row_width; i++) - { - if (*(sp - 2) == red && *(sp - 1) == green && *(sp) == blue) - *dp-- = 0; - else - *dp-- = 0xff; - *dp-- = *sp--; - *dp-- = *sp--; - *dp-- = *sp--; - } - } - else if (row_info->bit_depth == 16) - { - png_byte red_high = (trans_value->red >> 8) & 0xff; - png_byte green_high = (trans_value->green >> 8) & 0xff; - png_byte blue_high = (trans_value->blue >> 8) & 0xff; - png_byte red_low = trans_value->red & 0xff; - png_byte green_low = trans_value->green & 0xff; - png_byte blue_low = trans_value->blue & 0xff; - sp = row + row_info->rowbytes - 1; - dp = row + (png_size_t)(row_width << 3) - 1; - for (i = 0; i < row_width; i++) - { - if (*(sp - 5) == red_high && - *(sp - 4) == red_low && - *(sp - 3) == green_high && - *(sp - 2) == green_low && - *(sp - 1) == blue_high && - *(sp ) == blue_low) - { - *dp-- = 0; - *dp-- = 0; - } - else - { - *dp-- = 0xff; - *dp-- = 0xff; - } - *dp-- = *sp--; - *dp-- = *sp--; - *dp-- = *sp--; - *dp-- = *sp--; - *dp-- = *sp--; - *dp-- = *sp--; - } - } - row_info->color_type = PNG_COLOR_TYPE_RGB_ALPHA; - row_info->channels = 4; - row_info->pixel_depth = (png_byte)(row_info->bit_depth << 2); - row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth, row_width); - } - } -} -#endif - -#if defined(PNG_READ_DITHER_SUPPORTED) -void /* PRIVATE */ -png_do_dither(png_row_infop row_info, png_bytep row, - png_bytep palette_lookup, png_bytep dither_lookup) -{ - png_bytep sp, dp; - png_uint_32 i; - png_uint_32 row_width=row_info->width; - - png_debug(1, "in png_do_dither"); -#if defined(PNG_USELESS_TESTS_SUPPORTED) - if (row != NULL && row_info != NULL) -#endif - { - if (row_info->color_type == PNG_COLOR_TYPE_RGB && - palette_lookup && row_info->bit_depth == 8) - { - int r, g, b, p; - sp = row; - dp = row; - for (i = 0; i < row_width; i++) - { - r = *sp++; - g = *sp++; - b = *sp++; - - /* This looks real messy, but the compiler will reduce - * it down to a reasonable formula. For example, with - * 5 bits per color, we get: - * p = (((r >> 3) & 0x1f) << 10) | - * (((g >> 3) & 0x1f) << 5) | - * ((b >> 3) & 0x1f); - */ - p = (((r >> (8 - PNG_DITHER_RED_BITS)) & - ((1 << PNG_DITHER_RED_BITS) - 1)) << - (PNG_DITHER_GREEN_BITS + PNG_DITHER_BLUE_BITS)) | - (((g >> (8 - PNG_DITHER_GREEN_BITS)) & - ((1 << PNG_DITHER_GREEN_BITS) - 1)) << - (PNG_DITHER_BLUE_BITS)) | - ((b >> (8 - PNG_DITHER_BLUE_BITS)) & - ((1 << PNG_DITHER_BLUE_BITS) - 1)); - - *dp++ = palette_lookup[p]; - } - row_info->color_type = PNG_COLOR_TYPE_PALETTE; - row_info->channels = 1; - row_info->pixel_depth = row_info->bit_depth; - row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth, row_width); - } - else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA && - palette_lookup != NULL && row_info->bit_depth == 8) - { - int r, g, b, p; - sp = row; - dp = row; - for (i = 0; i < row_width; i++) - { - r = *sp++; - g = *sp++; - b = *sp++; - sp++; - - p = (((r >> (8 - PNG_DITHER_RED_BITS)) & - ((1 << PNG_DITHER_RED_BITS) - 1)) << - (PNG_DITHER_GREEN_BITS + PNG_DITHER_BLUE_BITS)) | - (((g >> (8 - PNG_DITHER_GREEN_BITS)) & - ((1 << PNG_DITHER_GREEN_BITS) - 1)) << - (PNG_DITHER_BLUE_BITS)) | - ((b >> (8 - PNG_DITHER_BLUE_BITS)) & - ((1 << PNG_DITHER_BLUE_BITS) - 1)); - - *dp++ = palette_lookup[p]; - } - row_info->color_type = PNG_COLOR_TYPE_PALETTE; - row_info->channels = 1; - row_info->pixel_depth = row_info->bit_depth; - row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth, row_width); - } - else if (row_info->color_type == PNG_COLOR_TYPE_PALETTE && - dither_lookup && row_info->bit_depth == 8) - { - sp = row; - for (i = 0; i < row_width; i++, sp++) - { - *sp = dither_lookup[*sp]; - } - } - } -} -#endif - -#ifdef PNG_FLOATING_POINT_SUPPORTED -#if defined(PNG_READ_GAMMA_SUPPORTED) -static PNG_CONST int png_gamma_shift[] = - {0x10, 0x21, 0x42, 0x84, 0x110, 0x248, 0x550, 0xff0, 0x00}; - -/* We build the 8- or 16-bit gamma tables here. Note that for 16-bit - * tables, we don't make a full table if we are reducing to 8-bit in - * the future. Note also how the gamma_16 tables are segmented so that - * we don't need to allocate > 64K chunks for a full 16-bit table. - */ -void /* PRIVATE */ -png_build_gamma_table(png_structp png_ptr) -{ - png_debug(1, "in png_build_gamma_table"); - - if (png_ptr->bit_depth <= 8) - { - int i; - double g; - - if (png_ptr->screen_gamma > .000001) - g = 1.0 / (png_ptr->gamma * png_ptr->screen_gamma); - - else - g = 1.0; - - png_ptr->gamma_table = (png_bytep)png_malloc(png_ptr, - (png_uint_32)256); - - for (i = 0; i < 256; i++) - { - png_ptr->gamma_table[i] = (png_byte)(pow((double)i / 255.0, - g) * 255.0 + .5); - } - -#if defined(PNG_READ_BACKGROUND_SUPPORTED) || \ - defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) - if (png_ptr->transformations & ((PNG_BACKGROUND) | PNG_RGB_TO_GRAY)) - { - - g = 1.0 / (png_ptr->gamma); - - png_ptr->gamma_to_1 = (png_bytep)png_malloc(png_ptr, - (png_uint_32)256); - - for (i = 0; i < 256; i++) - { - png_ptr->gamma_to_1[i] = (png_byte)(pow((double)i / 255.0, - g) * 255.0 + .5); - } - - - png_ptr->gamma_from_1 = (png_bytep)png_malloc(png_ptr, - (png_uint_32)256); - - if (png_ptr->screen_gamma > 0.000001) - g = 1.0 / png_ptr->screen_gamma; - - else - g = png_ptr->gamma; /* Probably doing rgb_to_gray */ - - for (i = 0; i < 256; i++) - { - png_ptr->gamma_from_1[i] = (png_byte)(pow((double)i / 255.0, - g) * 255.0 + .5); - - } - } -#endif /* PNG_READ_BACKGROUND_SUPPORTED || PNG_RGB_TO_GRAY_SUPPORTED */ - } - else - { - double g; - int i, j, shift, num; - int sig_bit; - png_uint_32 ig; - - if (png_ptr->color_type & PNG_COLOR_MASK_COLOR) - { - sig_bit = (int)png_ptr->sig_bit.red; - - if ((int)png_ptr->sig_bit.green > sig_bit) - sig_bit = png_ptr->sig_bit.green; - - if ((int)png_ptr->sig_bit.blue > sig_bit) - sig_bit = png_ptr->sig_bit.blue; - } - else - { - sig_bit = (int)png_ptr->sig_bit.gray; - } - - if (sig_bit > 0) - shift = 16 - sig_bit; - - else - shift = 0; - - if (png_ptr->transformations & PNG_16_TO_8) - { - if (shift < (16 - PNG_MAX_GAMMA_8)) - shift = (16 - PNG_MAX_GAMMA_8); - } - - if (shift > 8) - shift = 8; - - if (shift < 0) - shift = 0; - - png_ptr->gamma_shift = (png_byte)shift; - - num = (1 << (8 - shift)); - - if (png_ptr->screen_gamma > .000001) - g = 1.0 / (png_ptr->gamma * png_ptr->screen_gamma); - else - g = 1.0; - - png_ptr->gamma_16_table = (png_uint_16pp)png_malloc(png_ptr, - (png_uint_32)(num * png_sizeof(png_uint_16p))); - png_memset(png_ptr->gamma_16_table, 0, num * png_sizeof(png_uint_16p)); - - if (png_ptr->transformations & (PNG_16_TO_8 | PNG_BACKGROUND)) - { - double fin, fout; - png_uint_32 last, max; - - for (i = 0; i < num; i++) - { - png_ptr->gamma_16_table[i] = (png_uint_16p)png_malloc(png_ptr, - (png_uint_32)(256 * png_sizeof(png_uint_16))); - } - - g = 1.0 / g; - last = 0; - for (i = 0; i < 256; i++) - { - fout = ((double)i + 0.5) / 256.0; - fin = pow(fout, g); - max = (png_uint_32)(fin * (double)((png_uint_32)num << 8)); - while (last <= max) - { - png_ptr->gamma_16_table[(int)(last & (0xff >> shift))] - [(int)(last >> (8 - shift))] = (png_uint_16)( - (png_uint_16)i | ((png_uint_16)i << 8)); - last++; - } - } - while (last < ((png_uint_32)num << 8)) - { - png_ptr->gamma_16_table[(int)(last & (0xff >> shift))] - [(int)(last >> (8 - shift))] = (png_uint_16)65535L; - last++; - } - } - else - { - for (i = 0; i < num; i++) - { - png_ptr->gamma_16_table[i] = (png_uint_16p)png_malloc(png_ptr, - (png_uint_32)(256 * png_sizeof(png_uint_16))); - - ig = (((png_uint_32)i * (png_uint_32)png_gamma_shift[shift]) >> 4); - - for (j = 0; j < 256; j++) - { - png_ptr->gamma_16_table[i][j] = - (png_uint_16)(pow((double)(ig + ((png_uint_32)j << 8)) / - 65535.0, g) * 65535.0 + .5); - } - } - } - -#if defined(PNG_READ_BACKGROUND_SUPPORTED) || \ - defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) - if (png_ptr->transformations & (PNG_BACKGROUND | PNG_RGB_TO_GRAY)) - { - - g = 1.0 / (png_ptr->gamma); - - png_ptr->gamma_16_to_1 = (png_uint_16pp)png_malloc(png_ptr, - (png_uint_32)(num * png_sizeof(png_uint_16p ))); - png_memset(png_ptr->gamma_16_to_1, 0, num * png_sizeof(png_uint_16p)); - - for (i = 0; i < num; i++) - { - png_ptr->gamma_16_to_1[i] = (png_uint_16p)png_malloc(png_ptr, - (png_uint_32)(256 * png_sizeof(png_uint_16))); - - ig = (((png_uint_32)i * - (png_uint_32)png_gamma_shift[shift]) >> 4); - for (j = 0; j < 256; j++) - { - png_ptr->gamma_16_to_1[i][j] = - (png_uint_16)(pow((double)(ig + ((png_uint_32)j << 8)) / - 65535.0, g) * 65535.0 + .5); - } - } - - if (png_ptr->screen_gamma > 0.000001) - g = 1.0 / png_ptr->screen_gamma; - - else - g = png_ptr->gamma; /* Probably doing rgb_to_gray */ - - png_ptr->gamma_16_from_1 = (png_uint_16pp)png_malloc(png_ptr, - (png_uint_32)(num * png_sizeof(png_uint_16p))); - png_memset(png_ptr->gamma_16_from_1, 0, - num * png_sizeof(png_uint_16p)); - - for (i = 0; i < num; i++) - { - png_ptr->gamma_16_from_1[i] = (png_uint_16p)png_malloc(png_ptr, - (png_uint_32)(256 * png_sizeof(png_uint_16))); - - ig = (((png_uint_32)i * - (png_uint_32)png_gamma_shift[shift]) >> 4); - - for (j = 0; j < 256; j++) - { - png_ptr->gamma_16_from_1[i][j] = - (png_uint_16)(pow((double)(ig + ((png_uint_32)j << 8)) / - 65535.0, g) * 65535.0 + .5); - } - } - } -#endif /* PNG_READ_BACKGROUND_SUPPORTED || PNG_RGB_TO_GRAY_SUPPORTED */ - } -} -#endif -/* To do: install integer version of png_build_gamma_table here */ -#endif - -#if defined(PNG_MNG_FEATURES_SUPPORTED) -/* Undoes intrapixel differencing */ -void /* PRIVATE */ -png_do_read_intrapixel(png_row_infop row_info, png_bytep row) -{ - png_debug(1, "in png_do_read_intrapixel"); - if ( -#if defined(PNG_USELESS_TESTS_SUPPORTED) - row != NULL && row_info != NULL && -#endif - (row_info->color_type & PNG_COLOR_MASK_COLOR)) - { - int bytes_per_pixel; - png_uint_32 row_width = row_info->width; - if (row_info->bit_depth == 8) - { - png_bytep rp; - png_uint_32 i; - - if (row_info->color_type == PNG_COLOR_TYPE_RGB) - bytes_per_pixel = 3; - - else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) - bytes_per_pixel = 4; - - else - return; - - for (i = 0, rp = row; i < row_width; i++, rp += bytes_per_pixel) - { - *(rp) = (png_byte)((256 + *rp + *(rp+1))&0xff); - *(rp+2) = (png_byte)((256 + *(rp+2) + *(rp+1))&0xff); - } - } - else if (row_info->bit_depth == 16) - { - png_bytep rp; - png_uint_32 i; - - if (row_info->color_type == PNG_COLOR_TYPE_RGB) - bytes_per_pixel = 6; - - else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) - bytes_per_pixel = 8; - - else - return; - - for (i = 0, rp = row; i < row_width; i++, rp += bytes_per_pixel) - { - png_uint_32 s0 = (*(rp ) << 8) | *(rp + 1); - png_uint_32 s1 = (*(rp + 2) << 8) | *(rp + 3); - png_uint_32 s2 = (*(rp + 4) << 8) | *(rp + 5); - png_uint_32 red = (png_uint_32)((s0 + s1 + 65536L) & 0xffffL); - png_uint_32 blue = (png_uint_32)((s2 + s1 + 65536L) & 0xffffL); - *(rp ) = (png_byte)((red >> 8) & 0xff); - *(rp+1) = (png_byte)(red & 0xff); - *(rp+4) = (png_byte)((blue >> 8) & 0xff); - *(rp+5) = (png_byte)(blue & 0xff); - } - } - } -} -#endif /* PNG_MNG_FEATURES_SUPPORTED */ -#endif /* PNG_READ_SUPPORTED */ diff --git a/src/libpng/pngrutil.c b/src/libpng/pngrutil.c deleted file mode 100644 index a5f9ccf3c..000000000 --- a/src/libpng/pngrutil.c +++ /dev/null @@ -1,3244 +0,0 @@ - -/* pngrutil.c - utilities to read a PNG file - * - * Last changed in libpng 1.2.37 [June 4, 2009] - * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2009 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - * - * This file contains routines that are only called from within - * libpng itself during the course of reading an image. - */ - -#define PNG_INTERNAL -#include "png.h" -#if defined(PNG_READ_SUPPORTED) - -#if defined(_WIN32_WCE) && (_WIN32_WCE<0x500) -# define WIN32_WCE_OLD -#endif - -#ifdef PNG_FLOATING_POINT_SUPPORTED -# if defined(WIN32_WCE_OLD) -/* The strtod() function is not supported on WindowsCE */ -__inline double png_strtod(png_structp png_ptr, PNG_CONST char *nptr, char **endptr) -{ - double result = 0; - int len; - wchar_t *str, *end; - - len = MultiByteToWideChar(CP_ACP, 0, nptr, -1, NULL, 0); - str = (wchar_t *)png_malloc(png_ptr, len * png_sizeof(wchar_t)); - if ( NULL != str ) - { - MultiByteToWideChar(CP_ACP, 0, nptr, -1, str, len); - result = wcstod(str, &end); - len = WideCharToMultiByte(CP_ACP, 0, end, -1, NULL, 0, NULL, NULL); - *endptr = (char *)nptr + (png_strlen(nptr) - len + 1); - png_free(png_ptr, str); - } - return result; -} -# else -# define png_strtod(p,a,b) strtod(a,b) -# endif -#endif - -png_uint_32 PNGAPI -png_get_uint_31(png_structp png_ptr, png_bytep buf) -{ -#ifdef PNG_READ_BIG_ENDIAN_SUPPORTED - png_uint_32 i = png_get_uint_32(buf); -#else - /* Avoid an extra function call by inlining the result. */ - png_uint_32 i = ((png_uint_32)(*buf) << 24) + - ((png_uint_32)(*(buf + 1)) << 16) + - ((png_uint_32)(*(buf + 2)) << 8) + - (png_uint_32)(*(buf + 3)); -#endif - if (i > PNG_UINT_31_MAX) - png_error(png_ptr, "PNG unsigned integer out of range."); - return (i); -} -#ifndef PNG_READ_BIG_ENDIAN_SUPPORTED -/* Grab an unsigned 32-bit integer from a buffer in big-endian format. */ -png_uint_32 PNGAPI -png_get_uint_32(png_bytep buf) -{ - png_uint_32 i = ((png_uint_32)(*buf) << 24) + - ((png_uint_32)(*(buf + 1)) << 16) + - ((png_uint_32)(*(buf + 2)) << 8) + - (png_uint_32)(*(buf + 3)); - - return (i); -} - -/* Grab a signed 32-bit integer from a buffer in big-endian format. The - * data is stored in the PNG file in two's complement format, and it is - * assumed that the machine format for signed integers is the same. - */ -png_int_32 PNGAPI -png_get_int_32(png_bytep buf) -{ - png_int_32 i = ((png_int_32)(*buf) << 24) + - ((png_int_32)(*(buf + 1)) << 16) + - ((png_int_32)(*(buf + 2)) << 8) + - (png_int_32)(*(buf + 3)); - - return (i); -} - -/* Grab an unsigned 16-bit integer from a buffer in big-endian format. */ -png_uint_16 PNGAPI -png_get_uint_16(png_bytep buf) -{ - png_uint_16 i = (png_uint_16)(((png_uint_16)(*buf) << 8) + - (png_uint_16)(*(buf + 1))); - - return (i); -} -#endif /* PNG_READ_BIG_ENDIAN_SUPPORTED */ - -/* Read the chunk header (length + type name). - * Put the type name into png_ptr->chunk_name, and return the length. - */ -png_uint_32 /* PRIVATE */ -png_read_chunk_header(png_structp png_ptr) -{ - png_byte buf[8]; - png_uint_32 length; - - /* Read the length and the chunk name */ - png_read_data(png_ptr, buf, 8); - length = png_get_uint_31(png_ptr, buf); - - /* Put the chunk name into png_ptr->chunk_name */ - png_memcpy(png_ptr->chunk_name, buf + 4, 4); - - png_debug2(0, "Reading %s chunk, length = %lu", - png_ptr->chunk_name, length); - - /* Reset the crc and run it over the chunk name */ - png_reset_crc(png_ptr); - png_calculate_crc(png_ptr, png_ptr->chunk_name, 4); - - /* Check to see if chunk name is valid */ - png_check_chunk_name(png_ptr, png_ptr->chunk_name); - - return length; -} - -/* Read data, and (optionally) run it through the CRC. */ -void /* PRIVATE */ -png_crc_read(png_structp png_ptr, png_bytep buf, png_size_t length) -{ - if (png_ptr == NULL) - return; - png_read_data(png_ptr, buf, length); - png_calculate_crc(png_ptr, buf, length); -} - -/* Optionally skip data and then check the CRC. Depending on whether we - * are reading a ancillary or critical chunk, and how the program has set - * things up, we may calculate the CRC on the data and print a message. - * Returns '1' if there was a CRC error, '0' otherwise. - */ -int /* PRIVATE */ -png_crc_finish(png_structp png_ptr, png_uint_32 skip) -{ - png_size_t i; - png_size_t istop = png_ptr->zbuf_size; - - for (i = (png_size_t)skip; i > istop; i -= istop) - { - png_crc_read(png_ptr, png_ptr->zbuf, png_ptr->zbuf_size); - } - if (i) - { - png_crc_read(png_ptr, png_ptr->zbuf, i); - } - - if (png_crc_error(png_ptr)) - { - if (((png_ptr->chunk_name[0] & 0x20) && /* Ancillary */ - !(png_ptr->flags & PNG_FLAG_CRC_ANCILLARY_NOWARN)) || - (!(png_ptr->chunk_name[0] & 0x20) && /* Critical */ - (png_ptr->flags & PNG_FLAG_CRC_CRITICAL_USE))) - { - png_chunk_warning(png_ptr, "CRC error"); - } - else - { - png_chunk_error(png_ptr, "CRC error"); - } - return (1); - } - - return (0); -} - -/* Compare the CRC stored in the PNG file with that calculated by libpng from - * the data it has read thus far. - */ -int /* PRIVATE */ -png_crc_error(png_structp png_ptr) -{ - png_byte crc_bytes[4]; - png_uint_32 crc; - int need_crc = 1; - - if (png_ptr->chunk_name[0] & 0x20) /* ancillary */ - { - if ((png_ptr->flags & PNG_FLAG_CRC_ANCILLARY_MASK) == - (PNG_FLAG_CRC_ANCILLARY_USE | PNG_FLAG_CRC_ANCILLARY_NOWARN)) - need_crc = 0; - } - else /* critical */ - { - if (png_ptr->flags & PNG_FLAG_CRC_CRITICAL_IGNORE) - need_crc = 0; - } - - png_read_data(png_ptr, crc_bytes, 4); - - if (need_crc) - { - crc = png_get_uint_32(crc_bytes); - return ((int)(crc != png_ptr->crc)); - } - else - return (0); -} - -#if defined(PNG_READ_zTXt_SUPPORTED) || defined(PNG_READ_iTXt_SUPPORTED) || \ - defined(PNG_READ_iCCP_SUPPORTED) -/* - * Decompress trailing data in a chunk. The assumption is that chunkdata - * points at an allocated area holding the contents of a chunk with a - * trailing compressed part. What we get back is an allocated area - * holding the original prefix part and an uncompressed version of the - * trailing part (the malloc area passed in is freed). - */ -void /* PRIVATE */ -png_decompress_chunk(png_structp png_ptr, int comp_type, - png_size_t chunklength, - png_size_t prefix_size, png_size_t *newlength) -{ - static PNG_CONST char msg[] = "Error decoding compressed text"; - png_charp text; - png_size_t text_size; - - if (comp_type == PNG_COMPRESSION_TYPE_BASE) - { - int ret = Z_OK; - png_ptr->zstream.next_in = (png_bytep)(png_ptr->chunkdata + prefix_size); - png_ptr->zstream.avail_in = (uInt)(chunklength - prefix_size); - png_ptr->zstream.next_out = png_ptr->zbuf; - png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; - - text_size = 0; - text = NULL; - - while (png_ptr->zstream.avail_in) - { - ret = inflate(&png_ptr->zstream, Z_PARTIAL_FLUSH); - if (ret != Z_OK && ret != Z_STREAM_END) - { - if (png_ptr->zstream.msg != NULL) - png_warning(png_ptr, png_ptr->zstream.msg); - else - png_warning(png_ptr, msg); - inflateReset(&png_ptr->zstream); - png_ptr->zstream.avail_in = 0; - - if (text == NULL) - { - text_size = prefix_size + png_sizeof(msg) + 1; - text = (png_charp)png_malloc_warn(png_ptr, text_size); - if (text == NULL) - { - png_free(png_ptr, png_ptr->chunkdata); - png_ptr->chunkdata = NULL; - png_error(png_ptr, "Not enough memory to decompress chunk"); - } - png_memcpy(text, png_ptr->chunkdata, prefix_size); - } - - text[text_size - 1] = 0x00; - - /* Copy what we can of the error message into the text chunk */ - text_size = (png_size_t)(chunklength - - (text - png_ptr->chunkdata) - 1); - if (text_size > png_sizeof(msg)) - text_size = png_sizeof(msg); - png_memcpy(text + prefix_size, msg, text_size); - break; - } - if (!png_ptr->zstream.avail_out || ret == Z_STREAM_END) - { - if (text == NULL) - { - text_size = prefix_size + - png_ptr->zbuf_size - png_ptr->zstream.avail_out; - text = (png_charp)png_malloc_warn(png_ptr, text_size + 1); - if (text == NULL) - { - png_free(png_ptr, png_ptr->chunkdata); - png_ptr->chunkdata = NULL; - png_error(png_ptr, - "Not enough memory to decompress chunk."); - } - png_memcpy(text + prefix_size, png_ptr->zbuf, - text_size - prefix_size); - png_memcpy(text, png_ptr->chunkdata, prefix_size); - *(text + text_size) = 0x00; - } - else - { - png_charp tmp; - - tmp = text; - text = (png_charp)png_malloc_warn(png_ptr, - (png_uint_32)(text_size + - png_ptr->zbuf_size - png_ptr->zstream.avail_out + 1)); - if (text == NULL) - { - png_free(png_ptr, tmp); - png_free(png_ptr, png_ptr->chunkdata); - png_ptr->chunkdata = NULL; - png_error(png_ptr, - "Not enough memory to decompress chunk.."); - } - png_memcpy(text, tmp, text_size); - png_free(png_ptr, tmp); - png_memcpy(text + text_size, png_ptr->zbuf, - (png_ptr->zbuf_size - png_ptr->zstream.avail_out)); - text_size += png_ptr->zbuf_size - png_ptr->zstream.avail_out; - *(text + text_size) = 0x00; - } - if (ret == Z_STREAM_END) - break; - else - { - png_ptr->zstream.next_out = png_ptr->zbuf; - png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; - } - } - } - if (ret != Z_STREAM_END) - { -#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE) - char umsg[52]; - - if (ret == Z_BUF_ERROR) - png_snprintf(umsg, 52, - "Buffer error in compressed datastream in %s chunk", - png_ptr->chunk_name); - - else if (ret == Z_DATA_ERROR) - png_snprintf(umsg, 52, - "Data error in compressed datastream in %s chunk", - png_ptr->chunk_name); - - else - png_snprintf(umsg, 52, - "Incomplete compressed datastream in %s chunk", - png_ptr->chunk_name); - - png_warning(png_ptr, umsg); -#else - png_warning(png_ptr, - "Incomplete compressed datastream in chunk other than IDAT"); -#endif - text_size = prefix_size; - if (text == NULL) - { - text = (png_charp)png_malloc_warn(png_ptr, text_size+1); - if (text == NULL) - { - png_free(png_ptr, png_ptr->chunkdata); - png_ptr->chunkdata = NULL; - png_error(png_ptr, "Not enough memory for text."); - } - png_memcpy(text, png_ptr->chunkdata, prefix_size); - } - *(text + text_size) = 0x00; - } - - inflateReset(&png_ptr->zstream); - png_ptr->zstream.avail_in = 0; - - png_free(png_ptr, png_ptr->chunkdata); - png_ptr->chunkdata = text; - *newlength=text_size; - } - else /* if (comp_type != PNG_COMPRESSION_TYPE_BASE) */ - { -#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE) - char umsg[50]; - - png_snprintf(umsg, 50, "Unknown zTXt compression type %d", comp_type); - png_warning(png_ptr, umsg); -#else - png_warning(png_ptr, "Unknown zTXt compression type"); -#endif - - *(png_ptr->chunkdata + prefix_size) = 0x00; - *newlength = prefix_size; - } -} -#endif - -/* Read and check the IDHR chunk */ -void /* PRIVATE */ -png_handle_IHDR(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -{ - png_byte buf[13]; - png_uint_32 width, height; - int bit_depth, color_type, compression_type, filter_type; - int interlace_type; - - png_debug(1, "in png_handle_IHDR"); - - if (png_ptr->mode & PNG_HAVE_IHDR) - png_error(png_ptr, "Out of place IHDR"); - - /* Check the length */ - if (length != 13) - png_error(png_ptr, "Invalid IHDR chunk"); - - png_ptr->mode |= PNG_HAVE_IHDR; - - png_crc_read(png_ptr, buf, 13); - png_crc_finish(png_ptr, 0); - - width = png_get_uint_31(png_ptr, buf); - height = png_get_uint_31(png_ptr, buf + 4); - bit_depth = buf[8]; - color_type = buf[9]; - compression_type = buf[10]; - filter_type = buf[11]; - interlace_type = buf[12]; - - /* Set internal variables */ - png_ptr->width = width; - png_ptr->height = height; - png_ptr->bit_depth = (png_byte)bit_depth; - png_ptr->interlaced = (png_byte)interlace_type; - png_ptr->color_type = (png_byte)color_type; -#if defined(PNG_MNG_FEATURES_SUPPORTED) - png_ptr->filter_type = (png_byte)filter_type; -#endif - png_ptr->compression_type = (png_byte)compression_type; - - /* Find number of channels */ - switch (png_ptr->color_type) - { - case PNG_COLOR_TYPE_GRAY: - case PNG_COLOR_TYPE_PALETTE: - png_ptr->channels = 1; - break; - - case PNG_COLOR_TYPE_RGB: - png_ptr->channels = 3; - break; - - case PNG_COLOR_TYPE_GRAY_ALPHA: - png_ptr->channels = 2; - break; - - case PNG_COLOR_TYPE_RGB_ALPHA: - png_ptr->channels = 4; - break; - } - - /* Set up other useful info */ - png_ptr->pixel_depth = (png_byte)(png_ptr->bit_depth * - png_ptr->channels); - png_ptr->rowbytes = PNG_ROWBYTES(png_ptr->pixel_depth, png_ptr->width); - png_debug1(3, "bit_depth = %d", png_ptr->bit_depth); - png_debug1(3, "channels = %d", png_ptr->channels); - png_debug1(3, "rowbytes = %lu", png_ptr->rowbytes); - png_set_IHDR(png_ptr, info_ptr, width, height, bit_depth, - color_type, interlace_type, compression_type, filter_type); -} - -/* Read and check the palette */ -void /* PRIVATE */ -png_handle_PLTE(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -{ - png_color palette[PNG_MAX_PALETTE_LENGTH]; - int num, i; -#ifndef PNG_NO_POINTER_INDEXING - png_colorp pal_ptr; -#endif - - png_debug(1, "in png_handle_PLTE"); - - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before PLTE"); - - else if (png_ptr->mode & PNG_HAVE_IDAT) - { - png_warning(png_ptr, "Invalid PLTE after IDAT"); - png_crc_finish(png_ptr, length); - return; - } - - else if (png_ptr->mode & PNG_HAVE_PLTE) - png_error(png_ptr, "Duplicate PLTE chunk"); - - png_ptr->mode |= PNG_HAVE_PLTE; - - if (!(png_ptr->color_type&PNG_COLOR_MASK_COLOR)) - { - png_warning(png_ptr, - "Ignoring PLTE chunk in grayscale PNG"); - png_crc_finish(png_ptr, length); - return; - } -#if !defined(PNG_READ_OPT_PLTE_SUPPORTED) - if (png_ptr->color_type != PNG_COLOR_TYPE_PALETTE) - { - png_crc_finish(png_ptr, length); - return; - } -#endif - - if (length > 3*PNG_MAX_PALETTE_LENGTH || length % 3) - { - if (png_ptr->color_type != PNG_COLOR_TYPE_PALETTE) - { - png_warning(png_ptr, "Invalid palette chunk"); - png_crc_finish(png_ptr, length); - return; - } - - else - { - png_error(png_ptr, "Invalid palette chunk"); - } - } - - num = (int)length / 3; - -#ifndef PNG_NO_POINTER_INDEXING - for (i = 0, pal_ptr = palette; i < num; i++, pal_ptr++) - { - png_byte buf[3]; - - png_crc_read(png_ptr, buf, 3); - pal_ptr->red = buf[0]; - pal_ptr->green = buf[1]; - pal_ptr->blue = buf[2]; - } -#else - for (i = 0; i < num; i++) - { - png_byte buf[3]; - - png_crc_read(png_ptr, buf, 3); - /* Don't depend upon png_color being any order */ - palette[i].red = buf[0]; - palette[i].green = buf[1]; - palette[i].blue = buf[2]; - } -#endif - - /* If we actually NEED the PLTE chunk (ie for a paletted image), we do - * whatever the normal CRC configuration tells us. However, if we - * have an RGB image, the PLTE can be considered ancillary, so - * we will act as though it is. - */ -#if !defined(PNG_READ_OPT_PLTE_SUPPORTED) - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) -#endif - { - png_crc_finish(png_ptr, 0); - } -#if !defined(PNG_READ_OPT_PLTE_SUPPORTED) - else if (png_crc_error(png_ptr)) /* Only if we have a CRC error */ - { - /* If we don't want to use the data from an ancillary chunk, - we have two options: an error abort, or a warning and we - ignore the data in this chunk (which should be OK, since - it's considered ancillary for a RGB or RGBA image). */ - if (!(png_ptr->flags & PNG_FLAG_CRC_ANCILLARY_USE)) - { - if (png_ptr->flags & PNG_FLAG_CRC_ANCILLARY_NOWARN) - { - png_chunk_error(png_ptr, "CRC error"); - } - else - { - png_chunk_warning(png_ptr, "CRC error"); - return; - } - } - /* Otherwise, we (optionally) emit a warning and use the chunk. */ - else if (!(png_ptr->flags & PNG_FLAG_CRC_ANCILLARY_NOWARN)) - { - png_chunk_warning(png_ptr, "CRC error"); - } - } -#endif - - png_set_PLTE(png_ptr, info_ptr, palette, num); - -#if defined(PNG_READ_tRNS_SUPPORTED) - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - { - if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_tRNS)) - { - if (png_ptr->num_trans > (png_uint_16)num) - { - png_warning(png_ptr, "Truncating incorrect tRNS chunk length"); - png_ptr->num_trans = (png_uint_16)num; - } - if (info_ptr->num_trans > (png_uint_16)num) - { - png_warning(png_ptr, "Truncating incorrect info tRNS chunk length"); - info_ptr->num_trans = (png_uint_16)num; - } - } - } -#endif - -} - -void /* PRIVATE */ -png_handle_IEND(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -{ - png_debug(1, "in png_handle_IEND"); - - if (!(png_ptr->mode & PNG_HAVE_IHDR) || !(png_ptr->mode & PNG_HAVE_IDAT)) - { - png_error(png_ptr, "No image in file"); - } - - png_ptr->mode |= (PNG_AFTER_IDAT | PNG_HAVE_IEND); - - if (length != 0) - { - png_warning(png_ptr, "Incorrect IEND chunk length"); - } - png_crc_finish(png_ptr, length); - - info_ptr = info_ptr; /* Quiet compiler warnings about unused info_ptr */ -} - -#if defined(PNG_READ_gAMA_SUPPORTED) -void /* PRIVATE */ -png_handle_gAMA(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -{ - png_fixed_point igamma; -#ifdef PNG_FLOATING_POINT_SUPPORTED - float file_gamma; -#endif - png_byte buf[4]; - - png_debug(1, "in png_handle_gAMA"); - - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before gAMA"); - else if (png_ptr->mode & PNG_HAVE_IDAT) - { - png_warning(png_ptr, "Invalid gAMA after IDAT"); - png_crc_finish(png_ptr, length); - return; - } - else if (png_ptr->mode & PNG_HAVE_PLTE) - /* Should be an error, but we can cope with it */ - png_warning(png_ptr, "Out of place gAMA chunk"); - - if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_gAMA) -#if defined(PNG_READ_sRGB_SUPPORTED) - && !(info_ptr->valid & PNG_INFO_sRGB) -#endif - ) - { - png_warning(png_ptr, "Duplicate gAMA chunk"); - png_crc_finish(png_ptr, length); - return; - } - - if (length != 4) - { - png_warning(png_ptr, "Incorrect gAMA chunk length"); - png_crc_finish(png_ptr, length); - return; - } - - png_crc_read(png_ptr, buf, 4); - if (png_crc_finish(png_ptr, 0)) - return; - - igamma = (png_fixed_point)png_get_uint_32(buf); - /* Check for zero gamma */ - if (igamma == 0) - { - png_warning(png_ptr, - "Ignoring gAMA chunk with gamma=0"); - return; - } - -#if defined(PNG_READ_sRGB_SUPPORTED) - if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_sRGB)) - if (PNG_OUT_OF_RANGE(igamma, 45500L, 500)) - { - png_warning(png_ptr, - "Ignoring incorrect gAMA value when sRGB is also present"); -#ifndef PNG_NO_CONSOLE_IO - fprintf(stderr, "gamma = (%d/100000)", (int)igamma); -#endif - return; - } -#endif /* PNG_READ_sRGB_SUPPORTED */ - -#ifdef PNG_FLOATING_POINT_SUPPORTED - file_gamma = (float)igamma / (float)100000.0; -# ifdef PNG_READ_GAMMA_SUPPORTED - png_ptr->gamma = file_gamma; -# endif - png_set_gAMA(png_ptr, info_ptr, file_gamma); -#endif -#ifdef PNG_FIXED_POINT_SUPPORTED - png_set_gAMA_fixed(png_ptr, info_ptr, igamma); -#endif -} -#endif - -#if defined(PNG_READ_sBIT_SUPPORTED) -void /* PRIVATE */ -png_handle_sBIT(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -{ - png_size_t truelen; - png_byte buf[4]; - - png_debug(1, "in png_handle_sBIT"); - - buf[0] = buf[1] = buf[2] = buf[3] = 0; - - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before sBIT"); - else if (png_ptr->mode & PNG_HAVE_IDAT) - { - png_warning(png_ptr, "Invalid sBIT after IDAT"); - png_crc_finish(png_ptr, length); - return; - } - else if (png_ptr->mode & PNG_HAVE_PLTE) - { - /* Should be an error, but we can cope with it */ - png_warning(png_ptr, "Out of place sBIT chunk"); - } - if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_sBIT)) - { - png_warning(png_ptr, "Duplicate sBIT chunk"); - png_crc_finish(png_ptr, length); - return; - } - - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - truelen = 3; - else - truelen = (png_size_t)png_ptr->channels; - - if (length != truelen || length > 4) - { - png_warning(png_ptr, "Incorrect sBIT chunk length"); - png_crc_finish(png_ptr, length); - return; - } - - png_crc_read(png_ptr, buf, truelen); - if (png_crc_finish(png_ptr, 0)) - return; - - if (png_ptr->color_type & PNG_COLOR_MASK_COLOR) - { - png_ptr->sig_bit.red = buf[0]; - png_ptr->sig_bit.green = buf[1]; - png_ptr->sig_bit.blue = buf[2]; - png_ptr->sig_bit.alpha = buf[3]; - } - else - { - png_ptr->sig_bit.gray = buf[0]; - png_ptr->sig_bit.red = buf[0]; - png_ptr->sig_bit.green = buf[0]; - png_ptr->sig_bit.blue = buf[0]; - png_ptr->sig_bit.alpha = buf[1]; - } - png_set_sBIT(png_ptr, info_ptr, &(png_ptr->sig_bit)); -} -#endif - -#if defined(PNG_READ_cHRM_SUPPORTED) -void /* PRIVATE */ -png_handle_cHRM(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -{ - png_byte buf[32]; -#ifdef PNG_FLOATING_POINT_SUPPORTED - float white_x, white_y, red_x, red_y, green_x, green_y, blue_x, blue_y; -#endif - png_fixed_point int_x_white, int_y_white, int_x_red, int_y_red, int_x_green, - int_y_green, int_x_blue, int_y_blue; - - png_uint_32 uint_x, uint_y; - - png_debug(1, "in png_handle_cHRM"); - - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before cHRM"); - else if (png_ptr->mode & PNG_HAVE_IDAT) - { - png_warning(png_ptr, "Invalid cHRM after IDAT"); - png_crc_finish(png_ptr, length); - return; - } - else if (png_ptr->mode & PNG_HAVE_PLTE) - /* Should be an error, but we can cope with it */ - png_warning(png_ptr, "Missing PLTE before cHRM"); - - if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_cHRM) -#if defined(PNG_READ_sRGB_SUPPORTED) - && !(info_ptr->valid & PNG_INFO_sRGB) -#endif - ) - { - png_warning(png_ptr, "Duplicate cHRM chunk"); - png_crc_finish(png_ptr, length); - return; - } - - if (length != 32) - { - png_warning(png_ptr, "Incorrect cHRM chunk length"); - png_crc_finish(png_ptr, length); - return; - } - - png_crc_read(png_ptr, buf, 32); - if (png_crc_finish(png_ptr, 0)) - return; - - uint_x = png_get_uint_32(buf); - uint_y = png_get_uint_32(buf + 4); - int_x_white = (png_fixed_point)uint_x; - int_y_white = (png_fixed_point)uint_y; - - uint_x = png_get_uint_32(buf + 8); - uint_y = png_get_uint_32(buf + 12); - int_x_red = (png_fixed_point)uint_x; - int_y_red = (png_fixed_point)uint_y; - - uint_x = png_get_uint_32(buf + 16); - uint_y = png_get_uint_32(buf + 20); - int_x_green = (png_fixed_point)uint_x; - int_y_green = (png_fixed_point)uint_y; - - uint_x = png_get_uint_32(buf + 24); - uint_y = png_get_uint_32(buf + 28); - int_x_blue = (png_fixed_point)uint_x; - int_y_blue = (png_fixed_point)uint_y; - -#ifdef PNG_FLOATING_POINT_SUPPORTED - white_x = (float)int_x_white / (float)100000.0; - white_y = (float)int_y_white / (float)100000.0; - red_x = (float)int_x_red / (float)100000.0; - red_y = (float)int_y_red / (float)100000.0; - green_x = (float)int_x_green / (float)100000.0; - green_y = (float)int_y_green / (float)100000.0; - blue_x = (float)int_x_blue / (float)100000.0; - blue_y = (float)int_y_blue / (float)100000.0; -#endif - -#if defined(PNG_READ_sRGB_SUPPORTED) - if ((info_ptr != NULL) && (info_ptr->valid & PNG_INFO_sRGB)) - { - if (PNG_OUT_OF_RANGE(int_x_white, 31270, 1000) || - PNG_OUT_OF_RANGE(int_y_white, 32900, 1000) || - PNG_OUT_OF_RANGE(int_x_red, 64000L, 1000) || - PNG_OUT_OF_RANGE(int_y_red, 33000, 1000) || - PNG_OUT_OF_RANGE(int_x_green, 30000, 1000) || - PNG_OUT_OF_RANGE(int_y_green, 60000L, 1000) || - PNG_OUT_OF_RANGE(int_x_blue, 15000, 1000) || - PNG_OUT_OF_RANGE(int_y_blue, 6000, 1000)) - { - png_warning(png_ptr, - "Ignoring incorrect cHRM value when sRGB is also present"); -#ifndef PNG_NO_CONSOLE_IO -#ifdef PNG_FLOATING_POINT_SUPPORTED - fprintf(stderr, "wx=%f, wy=%f, rx=%f, ry=%f\n", - white_x, white_y, red_x, red_y); - fprintf(stderr, "gx=%f, gy=%f, bx=%f, by=%f\n", - green_x, green_y, blue_x, blue_y); -#else - fprintf(stderr, "wx=%ld, wy=%ld, rx=%ld, ry=%ld\n", - int_x_white, int_y_white, int_x_red, int_y_red); - fprintf(stderr, "gx=%ld, gy=%ld, bx=%ld, by=%ld\n", - int_x_green, int_y_green, int_x_blue, int_y_blue); -#endif -#endif /* PNG_NO_CONSOLE_IO */ - } - return; - } -#endif /* PNG_READ_sRGB_SUPPORTED */ - -#ifdef PNG_FLOATING_POINT_SUPPORTED - png_set_cHRM(png_ptr, info_ptr, - white_x, white_y, red_x, red_y, green_x, green_y, blue_x, blue_y); -#endif -#ifdef PNG_FIXED_POINT_SUPPORTED - png_set_cHRM_fixed(png_ptr, info_ptr, - int_x_white, int_y_white, int_x_red, int_y_red, int_x_green, - int_y_green, int_x_blue, int_y_blue); -#endif -} -#endif - -#if defined(PNG_READ_sRGB_SUPPORTED) -void /* PRIVATE */ -png_handle_sRGB(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -{ - int intent; - png_byte buf[1]; - - png_debug(1, "in png_handle_sRGB"); - - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before sRGB"); - else if (png_ptr->mode & PNG_HAVE_IDAT) - { - png_warning(png_ptr, "Invalid sRGB after IDAT"); - png_crc_finish(png_ptr, length); - return; - } - else if (png_ptr->mode & PNG_HAVE_PLTE) - /* Should be an error, but we can cope with it */ - png_warning(png_ptr, "Out of place sRGB chunk"); - - if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_sRGB)) - { - png_warning(png_ptr, "Duplicate sRGB chunk"); - png_crc_finish(png_ptr, length); - return; - } - - if (length != 1) - { - png_warning(png_ptr, "Incorrect sRGB chunk length"); - png_crc_finish(png_ptr, length); - return; - } - - png_crc_read(png_ptr, buf, 1); - if (png_crc_finish(png_ptr, 0)) - return; - - intent = buf[0]; - /* Check for bad intent */ - if (intent >= PNG_sRGB_INTENT_LAST) - { - png_warning(png_ptr, "Unknown sRGB intent"); - return; - } - -#if defined(PNG_READ_gAMA_SUPPORTED) && defined(PNG_READ_GAMMA_SUPPORTED) - if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_gAMA)) - { - png_fixed_point igamma; -#ifdef PNG_FIXED_POINT_SUPPORTED - igamma=info_ptr->int_gamma; -#else -# ifdef PNG_FLOATING_POINT_SUPPORTED - igamma=(png_fixed_point)(info_ptr->gamma * 100000.); -# endif -#endif - if (PNG_OUT_OF_RANGE(igamma, 45500L, 500)) - { - png_warning(png_ptr, - "Ignoring incorrect gAMA value when sRGB is also present"); -#ifndef PNG_NO_CONSOLE_IO -# ifdef PNG_FIXED_POINT_SUPPORTED - fprintf(stderr, "incorrect gamma=(%d/100000)\n", - (int)png_ptr->int_gamma); -# else -# ifdef PNG_FLOATING_POINT_SUPPORTED - fprintf(stderr, "incorrect gamma=%f\n", png_ptr->gamma); -# endif -# endif -#endif - } - } -#endif /* PNG_READ_gAMA_SUPPORTED */ - -#ifdef PNG_READ_cHRM_SUPPORTED -#ifdef PNG_FIXED_POINT_SUPPORTED - if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_cHRM)) - if (PNG_OUT_OF_RANGE(info_ptr->int_x_white, 31270, 1000) || - PNG_OUT_OF_RANGE(info_ptr->int_y_white, 32900, 1000) || - PNG_OUT_OF_RANGE(info_ptr->int_x_red, 64000L, 1000) || - PNG_OUT_OF_RANGE(info_ptr->int_y_red, 33000, 1000) || - PNG_OUT_OF_RANGE(info_ptr->int_x_green, 30000, 1000) || - PNG_OUT_OF_RANGE(info_ptr->int_y_green, 60000L, 1000) || - PNG_OUT_OF_RANGE(info_ptr->int_x_blue, 15000, 1000) || - PNG_OUT_OF_RANGE(info_ptr->int_y_blue, 6000, 1000)) - { - png_warning(png_ptr, - "Ignoring incorrect cHRM value when sRGB is also present"); - } -#endif /* PNG_FIXED_POINT_SUPPORTED */ -#endif /* PNG_READ_cHRM_SUPPORTED */ - - png_set_sRGB_gAMA_and_cHRM(png_ptr, info_ptr, intent); -} -#endif /* PNG_READ_sRGB_SUPPORTED */ - -#if defined(PNG_READ_iCCP_SUPPORTED) -void /* PRIVATE */ -png_handle_iCCP(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -/* Note: this does not properly handle chunks that are > 64K under DOS */ -{ - png_byte compression_type; - png_bytep pC; - png_charp profile; - png_uint_32 skip = 0; - png_uint_32 profile_size, profile_length; - png_size_t slength, prefix_length, data_length; - - png_debug(1, "in png_handle_iCCP"); - - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before iCCP"); - else if (png_ptr->mode & PNG_HAVE_IDAT) - { - png_warning(png_ptr, "Invalid iCCP after IDAT"); - png_crc_finish(png_ptr, length); - return; - } - else if (png_ptr->mode & PNG_HAVE_PLTE) - /* Should be an error, but we can cope with it */ - png_warning(png_ptr, "Out of place iCCP chunk"); - - if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_iCCP)) - { - png_warning(png_ptr, "Duplicate iCCP chunk"); - png_crc_finish(png_ptr, length); - return; - } - -#ifdef PNG_MAX_MALLOC_64K - if (length > (png_uint_32)65535L) - { - png_warning(png_ptr, "iCCP chunk too large to fit in memory"); - skip = length - (png_uint_32)65535L; - length = (png_uint_32)65535L; - } -#endif - - png_free(png_ptr, png_ptr->chunkdata); - png_ptr->chunkdata = (png_charp)png_malloc(png_ptr, length + 1); - slength = (png_size_t)length; - png_crc_read(png_ptr, (png_bytep)png_ptr->chunkdata, slength); - - if (png_crc_finish(png_ptr, skip)) - { - png_free(png_ptr, png_ptr->chunkdata); - png_ptr->chunkdata = NULL; - return; - } - - png_ptr->chunkdata[slength] = 0x00; - - for (profile = png_ptr->chunkdata; *profile; profile++) - /* Empty loop to find end of name */ ; - - ++profile; - - /* There should be at least one zero (the compression type byte) - * following the separator, and we should be on it - */ - if ( profile >= png_ptr->chunkdata + slength - 1) - { - png_free(png_ptr, png_ptr->chunkdata); - png_ptr->chunkdata = NULL; - png_warning(png_ptr, "Malformed iCCP chunk"); - return; - } - - /* Compression_type should always be zero */ - compression_type = *profile++; - if (compression_type) - { - png_warning(png_ptr, "Ignoring nonzero compression type in iCCP chunk"); - compression_type = 0x00; /* Reset it to zero (libpng-1.0.6 through 1.0.8 - wrote nonzero) */ - } - - prefix_length = profile - png_ptr->chunkdata; - png_decompress_chunk(png_ptr, compression_type, - slength, prefix_length, &data_length); - - profile_length = data_length - prefix_length; - - if ( prefix_length > data_length || profile_length < 4) - { - png_free(png_ptr, png_ptr->chunkdata); - png_ptr->chunkdata = NULL; - png_warning(png_ptr, "Profile size field missing from iCCP chunk"); - return; - } - - /* Check the profile_size recorded in the first 32 bits of the ICC profile */ - pC = (png_bytep)(png_ptr->chunkdata + prefix_length); - profile_size = ((*(pC ))<<24) | - ((*(pC + 1))<<16) | - ((*(pC + 2))<< 8) | - ((*(pC + 3)) ); - - if (profile_size < profile_length) - profile_length = profile_size; - - if (profile_size > profile_length) - { - png_free(png_ptr, png_ptr->chunkdata); - png_ptr->chunkdata = NULL; - png_warning(png_ptr, "Ignoring truncated iCCP profile."); - return; - } - - png_set_iCCP(png_ptr, info_ptr, png_ptr->chunkdata, - compression_type, png_ptr->chunkdata + prefix_length, profile_length); - png_free(png_ptr, png_ptr->chunkdata); - png_ptr->chunkdata = NULL; -} -#endif /* PNG_READ_iCCP_SUPPORTED */ - -#if defined(PNG_READ_sPLT_SUPPORTED) -void /* PRIVATE */ -png_handle_sPLT(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -/* Note: this does not properly handle chunks that are > 64K under DOS */ -{ - png_bytep entry_start; - png_sPLT_t new_palette; -#ifdef PNG_NO_POINTER_INDEXING - png_sPLT_entryp pp; -#endif - int data_length, entry_size, i; - png_uint_32 skip = 0; - png_size_t slength; - - png_debug(1, "in png_handle_sPLT"); - - - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before sPLT"); - else if (png_ptr->mode & PNG_HAVE_IDAT) - { - png_warning(png_ptr, "Invalid sPLT after IDAT"); - png_crc_finish(png_ptr, length); - return; - } - -#ifdef PNG_MAX_MALLOC_64K - if (length > (png_uint_32)65535L) - { - png_warning(png_ptr, "sPLT chunk too large to fit in memory"); - skip = length - (png_uint_32)65535L; - length = (png_uint_32)65535L; - } -#endif - - png_free(png_ptr, png_ptr->chunkdata); - png_ptr->chunkdata = (png_charp)png_malloc(png_ptr, length + 1); - slength = (png_size_t)length; - png_crc_read(png_ptr, (png_bytep)png_ptr->chunkdata, slength); - - if (png_crc_finish(png_ptr, skip)) - { - png_free(png_ptr, png_ptr->chunkdata); - png_ptr->chunkdata = NULL; - return; - } - - png_ptr->chunkdata[slength] = 0x00; - - for (entry_start = (png_bytep)png_ptr->chunkdata; *entry_start; entry_start++) - /* Empty loop to find end of name */ ; - ++entry_start; - - /* A sample depth should follow the separator, and we should be on it */ - if (entry_start > (png_bytep)png_ptr->chunkdata + slength - 2) - { - png_free(png_ptr, png_ptr->chunkdata); - png_ptr->chunkdata = NULL; - png_warning(png_ptr, "malformed sPLT chunk"); - return; - } - - new_palette.depth = *entry_start++; - entry_size = (new_palette.depth == 8 ? 6 : 10); - data_length = (slength - (entry_start - (png_bytep)png_ptr->chunkdata)); - - /* Integrity-check the data length */ - if (data_length % entry_size) - { - png_free(png_ptr, png_ptr->chunkdata); - png_ptr->chunkdata = NULL; - png_warning(png_ptr, "sPLT chunk has bad length"); - return; - } - - new_palette.nentries = (png_int_32) ( data_length / entry_size); - if ((png_uint_32) new_palette.nentries > - (png_uint_32) (PNG_SIZE_MAX / png_sizeof(png_sPLT_entry))) - { - png_warning(png_ptr, "sPLT chunk too long"); - return; - } - new_palette.entries = (png_sPLT_entryp)png_malloc_warn( - png_ptr, new_palette.nentries * png_sizeof(png_sPLT_entry)); - if (new_palette.entries == NULL) - { - png_warning(png_ptr, "sPLT chunk requires too much memory"); - return; - } - -#ifndef PNG_NO_POINTER_INDEXING - for (i = 0; i < new_palette.nentries; i++) - { - png_sPLT_entryp pp = new_palette.entries + i; - - if (new_palette.depth == 8) - { - pp->red = *entry_start++; - pp->green = *entry_start++; - pp->blue = *entry_start++; - pp->alpha = *entry_start++; - } - else - { - pp->red = png_get_uint_16(entry_start); entry_start += 2; - pp->green = png_get_uint_16(entry_start); entry_start += 2; - pp->blue = png_get_uint_16(entry_start); entry_start += 2; - pp->alpha = png_get_uint_16(entry_start); entry_start += 2; - } - pp->frequency = png_get_uint_16(entry_start); entry_start += 2; - } -#else - pp = new_palette.entries; - for (i = 0; i < new_palette.nentries; i++) - { - - if (new_palette.depth == 8) - { - pp[i].red = *entry_start++; - pp[i].green = *entry_start++; - pp[i].blue = *entry_start++; - pp[i].alpha = *entry_start++; - } - else - { - pp[i].red = png_get_uint_16(entry_start); entry_start += 2; - pp[i].green = png_get_uint_16(entry_start); entry_start += 2; - pp[i].blue = png_get_uint_16(entry_start); entry_start += 2; - pp[i].alpha = png_get_uint_16(entry_start); entry_start += 2; - } - pp->frequency = png_get_uint_16(entry_start); entry_start += 2; - } -#endif - - /* Discard all chunk data except the name and stash that */ - new_palette.name = png_ptr->chunkdata; - - png_set_sPLT(png_ptr, info_ptr, &new_palette, 1); - - png_free(png_ptr, png_ptr->chunkdata); - png_ptr->chunkdata = NULL; - png_free(png_ptr, new_palette.entries); -} -#endif /* PNG_READ_sPLT_SUPPORTED */ - -#if defined(PNG_READ_tRNS_SUPPORTED) -void /* PRIVATE */ -png_handle_tRNS(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -{ - png_byte readbuf[PNG_MAX_PALETTE_LENGTH]; - - png_debug(1, "in png_handle_tRNS"); - - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before tRNS"); - else if (png_ptr->mode & PNG_HAVE_IDAT) - { - png_warning(png_ptr, "Invalid tRNS after IDAT"); - png_crc_finish(png_ptr, length); - return; - } - else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_tRNS)) - { - png_warning(png_ptr, "Duplicate tRNS chunk"); - png_crc_finish(png_ptr, length); - return; - } - - if (png_ptr->color_type == PNG_COLOR_TYPE_GRAY) - { - png_byte buf[2]; - - if (length != 2) - { - png_warning(png_ptr, "Incorrect tRNS chunk length"); - png_crc_finish(png_ptr, length); - return; - } - - png_crc_read(png_ptr, buf, 2); - png_ptr->num_trans = 1; - png_ptr->trans_values.gray = png_get_uint_16(buf); - } - else if (png_ptr->color_type == PNG_COLOR_TYPE_RGB) - { - png_byte buf[6]; - - if (length != 6) - { - png_warning(png_ptr, "Incorrect tRNS chunk length"); - png_crc_finish(png_ptr, length); - return; - } - png_crc_read(png_ptr, buf, (png_size_t)length); - png_ptr->num_trans = 1; - png_ptr->trans_values.red = png_get_uint_16(buf); - png_ptr->trans_values.green = png_get_uint_16(buf + 2); - png_ptr->trans_values.blue = png_get_uint_16(buf + 4); - } - else if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - { - if (!(png_ptr->mode & PNG_HAVE_PLTE)) - { - /* Should be an error, but we can cope with it. */ - png_warning(png_ptr, "Missing PLTE before tRNS"); - } - if (length > (png_uint_32)png_ptr->num_palette || - length > PNG_MAX_PALETTE_LENGTH) - { - png_warning(png_ptr, "Incorrect tRNS chunk length"); - png_crc_finish(png_ptr, length); - return; - } - if (length == 0) - { - png_warning(png_ptr, "Zero length tRNS chunk"); - png_crc_finish(png_ptr, length); - return; - } - png_crc_read(png_ptr, readbuf, (png_size_t)length); - png_ptr->num_trans = (png_uint_16)length; - } - else - { - png_warning(png_ptr, "tRNS chunk not allowed with alpha channel"); - png_crc_finish(png_ptr, length); - return; - } - - if (png_crc_finish(png_ptr, 0)) - { - png_ptr->num_trans = 0; - return; - } - - png_set_tRNS(png_ptr, info_ptr, readbuf, png_ptr->num_trans, - &(png_ptr->trans_values)); -} -#endif - -#if defined(PNG_READ_bKGD_SUPPORTED) -void /* PRIVATE */ -png_handle_bKGD(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -{ - png_size_t truelen; - png_byte buf[6]; - - png_debug(1, "in png_handle_bKGD"); - - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before bKGD"); - else if (png_ptr->mode & PNG_HAVE_IDAT) - { - png_warning(png_ptr, "Invalid bKGD after IDAT"); - png_crc_finish(png_ptr, length); - return; - } - else if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE && - !(png_ptr->mode & PNG_HAVE_PLTE)) - { - png_warning(png_ptr, "Missing PLTE before bKGD"); - png_crc_finish(png_ptr, length); - return; - } - else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_bKGD)) - { - png_warning(png_ptr, "Duplicate bKGD chunk"); - png_crc_finish(png_ptr, length); - return; - } - - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - truelen = 1; - else if (png_ptr->color_type & PNG_COLOR_MASK_COLOR) - truelen = 6; - else - truelen = 2; - - if (length != truelen) - { - png_warning(png_ptr, "Incorrect bKGD chunk length"); - png_crc_finish(png_ptr, length); - return; - } - - png_crc_read(png_ptr, buf, truelen); - if (png_crc_finish(png_ptr, 0)) - return; - - /* We convert the index value into RGB components so that we can allow - * arbitrary RGB values for background when we have transparency, and - * so it is easy to determine the RGB values of the background color - * from the info_ptr struct. */ - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - { - png_ptr->background.index = buf[0]; - if (info_ptr && info_ptr->num_palette) - { - if (buf[0] >= info_ptr->num_palette) - { - png_warning(png_ptr, "Incorrect bKGD chunk index value"); - return; - } - png_ptr->background.red = - (png_uint_16)png_ptr->palette[buf[0]].red; - png_ptr->background.green = - (png_uint_16)png_ptr->palette[buf[0]].green; - png_ptr->background.blue = - (png_uint_16)png_ptr->palette[buf[0]].blue; - } - } - else if (!(png_ptr->color_type & PNG_COLOR_MASK_COLOR)) /* GRAY */ - { - png_ptr->background.red = - png_ptr->background.green = - png_ptr->background.blue = - png_ptr->background.gray = png_get_uint_16(buf); - } - else - { - png_ptr->background.red = png_get_uint_16(buf); - png_ptr->background.green = png_get_uint_16(buf + 2); - png_ptr->background.blue = png_get_uint_16(buf + 4); - } - - png_set_bKGD(png_ptr, info_ptr, &(png_ptr->background)); -} -#endif - -#if defined(PNG_READ_hIST_SUPPORTED) -void /* PRIVATE */ -png_handle_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -{ - unsigned int num, i; - png_uint_16 readbuf[PNG_MAX_PALETTE_LENGTH]; - - png_debug(1, "in png_handle_hIST"); - - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before hIST"); - else if (png_ptr->mode & PNG_HAVE_IDAT) - { - png_warning(png_ptr, "Invalid hIST after IDAT"); - png_crc_finish(png_ptr, length); - return; - } - else if (!(png_ptr->mode & PNG_HAVE_PLTE)) - { - png_warning(png_ptr, "Missing PLTE before hIST"); - png_crc_finish(png_ptr, length); - return; - } - else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_hIST)) - { - png_warning(png_ptr, "Duplicate hIST chunk"); - png_crc_finish(png_ptr, length); - return; - } - - num = length / 2 ; - if (num != (unsigned int) png_ptr->num_palette || num > - (unsigned int) PNG_MAX_PALETTE_LENGTH) - { - png_warning(png_ptr, "Incorrect hIST chunk length"); - png_crc_finish(png_ptr, length); - return; - } - - for (i = 0; i < num; i++) - { - png_byte buf[2]; - - png_crc_read(png_ptr, buf, 2); - readbuf[i] = png_get_uint_16(buf); - } - - if (png_crc_finish(png_ptr, 0)) - return; - - png_set_hIST(png_ptr, info_ptr, readbuf); -} -#endif - -#if defined(PNG_READ_pHYs_SUPPORTED) -void /* PRIVATE */ -png_handle_pHYs(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -{ - png_byte buf[9]; - png_uint_32 res_x, res_y; - int unit_type; - - png_debug(1, "in png_handle_pHYs"); - - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before pHYs"); - else if (png_ptr->mode & PNG_HAVE_IDAT) - { - png_warning(png_ptr, "Invalid pHYs after IDAT"); - png_crc_finish(png_ptr, length); - return; - } - else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_pHYs)) - { - png_warning(png_ptr, "Duplicate pHYs chunk"); - png_crc_finish(png_ptr, length); - return; - } - - if (length != 9) - { - png_warning(png_ptr, "Incorrect pHYs chunk length"); - png_crc_finish(png_ptr, length); - return; - } - - png_crc_read(png_ptr, buf, 9); - if (png_crc_finish(png_ptr, 0)) - return; - - res_x = png_get_uint_32(buf); - res_y = png_get_uint_32(buf + 4); - unit_type = buf[8]; - png_set_pHYs(png_ptr, info_ptr, res_x, res_y, unit_type); -} -#endif - -#if defined(PNG_READ_oFFs_SUPPORTED) -void /* PRIVATE */ -png_handle_oFFs(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -{ - png_byte buf[9]; - png_int_32 offset_x, offset_y; - int unit_type; - - png_debug(1, "in png_handle_oFFs"); - - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before oFFs"); - else if (png_ptr->mode & PNG_HAVE_IDAT) - { - png_warning(png_ptr, "Invalid oFFs after IDAT"); - png_crc_finish(png_ptr, length); - return; - } - else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_oFFs)) - { - png_warning(png_ptr, "Duplicate oFFs chunk"); - png_crc_finish(png_ptr, length); - return; - } - - if (length != 9) - { - png_warning(png_ptr, "Incorrect oFFs chunk length"); - png_crc_finish(png_ptr, length); - return; - } - - png_crc_read(png_ptr, buf, 9); - if (png_crc_finish(png_ptr, 0)) - return; - - offset_x = png_get_int_32(buf); - offset_y = png_get_int_32(buf + 4); - unit_type = buf[8]; - png_set_oFFs(png_ptr, info_ptr, offset_x, offset_y, unit_type); -} -#endif - -#if defined(PNG_READ_pCAL_SUPPORTED) -/* Read the pCAL chunk (described in the PNG Extensions document) */ -void /* PRIVATE */ -png_handle_pCAL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -{ - png_int_32 X0, X1; - png_byte type, nparams; - png_charp buf, units, endptr; - png_charpp params; - png_size_t slength; - int i; - - png_debug(1, "in png_handle_pCAL"); - - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before pCAL"); - else if (png_ptr->mode & PNG_HAVE_IDAT) - { - png_warning(png_ptr, "Invalid pCAL after IDAT"); - png_crc_finish(png_ptr, length); - return; - } - else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_pCAL)) - { - png_warning(png_ptr, "Duplicate pCAL chunk"); - png_crc_finish(png_ptr, length); - return; - } - - png_debug1(2, "Allocating and reading pCAL chunk data (%lu bytes)", - length + 1); - png_free(png_ptr, png_ptr->chunkdata); - png_ptr->chunkdata = (png_charp)png_malloc_warn(png_ptr, length + 1); - if (png_ptr->chunkdata == NULL) - { - png_warning(png_ptr, "No memory for pCAL purpose."); - return; - } - slength = (png_size_t)length; - png_crc_read(png_ptr, (png_bytep)png_ptr->chunkdata, slength); - - if (png_crc_finish(png_ptr, 0)) - { - png_free(png_ptr, png_ptr->chunkdata); - png_ptr->chunkdata = NULL; - return; - } - - png_ptr->chunkdata[slength] = 0x00; /* Null terminate the last string */ - - png_debug(3, "Finding end of pCAL purpose string"); - for (buf = png_ptr->chunkdata; *buf; buf++) - /* Empty loop */ ; - - endptr = png_ptr->chunkdata + slength; - - /* We need to have at least 12 bytes after the purpose string - in order to get the parameter information. */ - if (endptr <= buf + 12) - { - png_warning(png_ptr, "Invalid pCAL data"); - png_free(png_ptr, png_ptr->chunkdata); - png_ptr->chunkdata = NULL; - return; - } - - png_debug(3, "Reading pCAL X0, X1, type, nparams, and units"); - X0 = png_get_int_32((png_bytep)buf+1); - X1 = png_get_int_32((png_bytep)buf+5); - type = buf[9]; - nparams = buf[10]; - units = buf + 11; - - png_debug(3, "Checking pCAL equation type and number of parameters"); - /* Check that we have the right number of parameters for known - equation types. */ - if ((type == PNG_EQUATION_LINEAR && nparams != 2) || - (type == PNG_EQUATION_BASE_E && nparams != 3) || - (type == PNG_EQUATION_ARBITRARY && nparams != 3) || - (type == PNG_EQUATION_HYPERBOLIC && nparams != 4)) - { - png_warning(png_ptr, "Invalid pCAL parameters for equation type"); - png_free(png_ptr, png_ptr->chunkdata); - png_ptr->chunkdata = NULL; - return; - } - else if (type >= PNG_EQUATION_LAST) - { - png_warning(png_ptr, "Unrecognized equation type for pCAL chunk"); - } - - for (buf = units; *buf; buf++) - /* Empty loop to move past the units string. */ ; - - png_debug(3, "Allocating pCAL parameters array"); - params = (png_charpp)png_malloc_warn(png_ptr, - (png_uint_32)(nparams * png_sizeof(png_charp))) ; - if (params == NULL) - { - png_free(png_ptr, png_ptr->chunkdata); - png_ptr->chunkdata = NULL; - png_warning(png_ptr, "No memory for pCAL params."); - return; - } - - /* Get pointers to the start of each parameter string. */ - for (i = 0; i < (int)nparams; i++) - { - buf++; /* Skip the null string terminator from previous parameter. */ - - png_debug1(3, "Reading pCAL parameter %d", i); - for (params[i] = buf; buf <= endptr && *buf != 0x00; buf++) - /* Empty loop to move past each parameter string */ ; - - /* Make sure we haven't run out of data yet */ - if (buf > endptr) - { - png_warning(png_ptr, "Invalid pCAL data"); - png_free(png_ptr, png_ptr->chunkdata); - png_ptr->chunkdata = NULL; - png_free(png_ptr, params); - return; - } - } - - png_set_pCAL(png_ptr, info_ptr, png_ptr->chunkdata, X0, X1, type, nparams, - units, params); - - png_free(png_ptr, png_ptr->chunkdata); - png_ptr->chunkdata = NULL; - png_free(png_ptr, params); -} -#endif - -#if defined(PNG_READ_sCAL_SUPPORTED) -/* Read the sCAL chunk */ -void /* PRIVATE */ -png_handle_sCAL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -{ - png_charp ep; -#ifdef PNG_FLOATING_POINT_SUPPORTED - double width, height; - png_charp vp; -#else -#ifdef PNG_FIXED_POINT_SUPPORTED - png_charp swidth, sheight; -#endif -#endif - png_size_t slength; - - png_debug(1, "in png_handle_sCAL"); - - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before sCAL"); - else if (png_ptr->mode & PNG_HAVE_IDAT) - { - png_warning(png_ptr, "Invalid sCAL after IDAT"); - png_crc_finish(png_ptr, length); - return; - } - else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_sCAL)) - { - png_warning(png_ptr, "Duplicate sCAL chunk"); - png_crc_finish(png_ptr, length); - return; - } - - png_debug1(2, "Allocating and reading sCAL chunk data (%lu bytes)", - length + 1); - png_ptr->chunkdata = (png_charp)png_malloc_warn(png_ptr, length + 1); - if (png_ptr->chunkdata == NULL) - { - png_warning(png_ptr, "Out of memory while processing sCAL chunk"); - return; - } - slength = (png_size_t)length; - png_crc_read(png_ptr, (png_bytep)png_ptr->chunkdata, slength); - - if (png_crc_finish(png_ptr, 0)) - { - png_free(png_ptr, png_ptr->chunkdata); - png_ptr->chunkdata = NULL; - return; - } - - png_ptr->chunkdata[slength] = 0x00; /* Null terminate the last string */ - - ep = png_ptr->chunkdata + 1; /* Skip unit byte */ - -#ifdef PNG_FLOATING_POINT_SUPPORTED - width = png_strtod(png_ptr, ep, &vp); - if (*vp) - { - png_warning(png_ptr, "malformed width string in sCAL chunk"); - return; - } -#else -#ifdef PNG_FIXED_POINT_SUPPORTED - swidth = (png_charp)png_malloc_warn(png_ptr, png_strlen(ep) + 1); - if (swidth == NULL) - { - png_warning(png_ptr, "Out of memory while processing sCAL chunk width"); - return; - } - png_memcpy(swidth, ep, (png_size_t)png_strlen(ep)); -#endif -#endif - - for (ep = png_ptr->chunkdata; *ep; ep++) - /* Empty loop */ ; - ep++; - - if (png_ptr->chunkdata + slength < ep) - { - png_warning(png_ptr, "Truncated sCAL chunk"); -#if defined(PNG_FIXED_POINT_SUPPORTED) && \ - !defined(PNG_FLOATING_POINT_SUPPORTED) - png_free(png_ptr, swidth); -#endif - png_free(png_ptr, png_ptr->chunkdata); - png_ptr->chunkdata = NULL; - return; - } - -#ifdef PNG_FLOATING_POINT_SUPPORTED - height = png_strtod(png_ptr, ep, &vp); - if (*vp) - { - png_warning(png_ptr, "malformed height string in sCAL chunk"); - return; - } -#else -#ifdef PNG_FIXED_POINT_SUPPORTED - sheight = (png_charp)png_malloc_warn(png_ptr, png_strlen(ep) + 1); - if (sheight == NULL) - { - png_warning(png_ptr, "Out of memory while processing sCAL chunk height"); - return; - } - png_memcpy(sheight, ep, (png_size_t)png_strlen(ep)); -#endif -#endif - - if (png_ptr->chunkdata + slength < ep -#ifdef PNG_FLOATING_POINT_SUPPORTED - || width <= 0. || height <= 0. -#endif - ) - { - png_warning(png_ptr, "Invalid sCAL data"); - png_free(png_ptr, png_ptr->chunkdata); - png_ptr->chunkdata = NULL; -#if defined(PNG_FIXED_POINT_SUPPORTED) && !defined(PNG_FLOATING_POINT_SUPPORTED) - png_free(png_ptr, swidth); - png_free(png_ptr, sheight); -#endif - return; - } - - -#ifdef PNG_FLOATING_POINT_SUPPORTED - png_set_sCAL(png_ptr, info_ptr, png_ptr->chunkdata[0], width, height); -#else -#ifdef PNG_FIXED_POINT_SUPPORTED - png_set_sCAL_s(png_ptr, info_ptr, png_ptr->chunkdata[0], swidth, sheight); -#endif -#endif - - png_free(png_ptr, png_ptr->chunkdata); - png_ptr->chunkdata = NULL; -#if defined(PNG_FIXED_POINT_SUPPORTED) && !defined(PNG_FLOATING_POINT_SUPPORTED) - png_free(png_ptr, swidth); - png_free(png_ptr, sheight); -#endif -} -#endif - -#if defined(PNG_READ_tIME_SUPPORTED) -void /* PRIVATE */ -png_handle_tIME(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -{ - png_byte buf[7]; - png_time mod_time; - - png_debug(1, "in png_handle_tIME"); - - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Out of place tIME chunk"); - else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_tIME)) - { - png_warning(png_ptr, "Duplicate tIME chunk"); - png_crc_finish(png_ptr, length); - return; - } - - if (png_ptr->mode & PNG_HAVE_IDAT) - png_ptr->mode |= PNG_AFTER_IDAT; - - if (length != 7) - { - png_warning(png_ptr, "Incorrect tIME chunk length"); - png_crc_finish(png_ptr, length); - return; - } - - png_crc_read(png_ptr, buf, 7); - if (png_crc_finish(png_ptr, 0)) - return; - - mod_time.second = buf[6]; - mod_time.minute = buf[5]; - mod_time.hour = buf[4]; - mod_time.day = buf[3]; - mod_time.month = buf[2]; - mod_time.year = png_get_uint_16(buf); - - png_set_tIME(png_ptr, info_ptr, &mod_time); -} -#endif - -#if defined(PNG_READ_tEXt_SUPPORTED) -/* Note: this does not properly handle chunks that are > 64K under DOS */ -void /* PRIVATE */ -png_handle_tEXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -{ - png_textp text_ptr; - png_charp key; - png_charp text; - png_uint_32 skip = 0; - png_size_t slength; - int ret; - - png_debug(1, "in png_handle_tEXt"); - - - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before tEXt"); - - if (png_ptr->mode & PNG_HAVE_IDAT) - png_ptr->mode |= PNG_AFTER_IDAT; - -#ifdef PNG_MAX_MALLOC_64K - if (length > (png_uint_32)65535L) - { - png_warning(png_ptr, "tEXt chunk too large to fit in memory"); - skip = length - (png_uint_32)65535L; - length = (png_uint_32)65535L; - } -#endif - - png_free(png_ptr, png_ptr->chunkdata); - - png_ptr->chunkdata = (png_charp)png_malloc_warn(png_ptr, length + 1); - if (png_ptr->chunkdata == NULL) - { - png_warning(png_ptr, "No memory to process text chunk."); - return; - } - slength = (png_size_t)length; - png_crc_read(png_ptr, (png_bytep)png_ptr->chunkdata, slength); - - if (png_crc_finish(png_ptr, skip)) - { - png_free(png_ptr, png_ptr->chunkdata); - png_ptr->chunkdata = NULL; - return; - } - - key = png_ptr->chunkdata; - - key[slength] = 0x00; - - for (text = key; *text; text++) - /* Empty loop to find end of key */ ; - - if (text != key + slength) - text++; - - text_ptr = (png_textp)png_malloc_warn(png_ptr, - (png_uint_32)png_sizeof(png_text)); - if (text_ptr == NULL) - { - png_warning(png_ptr, "Not enough memory to process text chunk."); - png_free(png_ptr, png_ptr->chunkdata); - png_ptr->chunkdata = NULL; - return; - } - text_ptr->compression = PNG_TEXT_COMPRESSION_NONE; - text_ptr->key = key; -#ifdef PNG_iTXt_SUPPORTED - text_ptr->lang = NULL; - text_ptr->lang_key = NULL; - text_ptr->itxt_length = 0; -#endif - text_ptr->text = text; - text_ptr->text_length = png_strlen(text); - - ret = png_set_text_2(png_ptr, info_ptr, text_ptr, 1); - - png_free(png_ptr, png_ptr->chunkdata); - png_ptr->chunkdata = NULL; - png_free(png_ptr, text_ptr); - if (ret) - png_warning(png_ptr, "Insufficient memory to process text chunk."); -} -#endif - -#if defined(PNG_READ_zTXt_SUPPORTED) -/* Note: this does not correctly handle chunks that are > 64K under DOS */ -void /* PRIVATE */ -png_handle_zTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -{ - png_textp text_ptr; - png_charp text; - int comp_type; - int ret; - png_size_t slength, prefix_len, data_len; - - png_debug(1, "in png_handle_zTXt"); - - - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before zTXt"); - - if (png_ptr->mode & PNG_HAVE_IDAT) - png_ptr->mode |= PNG_AFTER_IDAT; - -#ifdef PNG_MAX_MALLOC_64K - /* We will no doubt have problems with chunks even half this size, but - there is no hard and fast rule to tell us where to stop. */ - if (length > (png_uint_32)65535L) - { - png_warning(png_ptr, "zTXt chunk too large to fit in memory"); - png_crc_finish(png_ptr, length); - return; - } -#endif - - png_free(png_ptr, png_ptr->chunkdata); - png_ptr->chunkdata = (png_charp)png_malloc_warn(png_ptr, length + 1); - if (png_ptr->chunkdata == NULL) - { - png_warning(png_ptr, "Out of memory processing zTXt chunk."); - return; - } - slength = (png_size_t)length; - png_crc_read(png_ptr, (png_bytep)png_ptr->chunkdata, slength); - if (png_crc_finish(png_ptr, 0)) - { - png_free(png_ptr, png_ptr->chunkdata); - png_ptr->chunkdata = NULL; - return; - } - - png_ptr->chunkdata[slength] = 0x00; - - for (text = png_ptr->chunkdata; *text; text++) - /* Empty loop */ ; - - /* zTXt must have some text after the chunkdataword */ - if (text >= png_ptr->chunkdata + slength - 2) - { - png_warning(png_ptr, "Truncated zTXt chunk"); - png_free(png_ptr, png_ptr->chunkdata); - png_ptr->chunkdata = NULL; - return; - } - else - { - comp_type = *(++text); - if (comp_type != PNG_TEXT_COMPRESSION_zTXt) - { - png_warning(png_ptr, "Unknown compression type in zTXt chunk"); - comp_type = PNG_TEXT_COMPRESSION_zTXt; - } - text++; /* Skip the compression_method byte */ - } - prefix_len = text - png_ptr->chunkdata; - - png_decompress_chunk(png_ptr, comp_type, - (png_size_t)length, prefix_len, &data_len); - - text_ptr = (png_textp)png_malloc_warn(png_ptr, - (png_uint_32)png_sizeof(png_text)); - if (text_ptr == NULL) - { - png_warning(png_ptr, "Not enough memory to process zTXt chunk."); - png_free(png_ptr, png_ptr->chunkdata); - png_ptr->chunkdata = NULL; - return; - } - text_ptr->compression = comp_type; - text_ptr->key = png_ptr->chunkdata; -#ifdef PNG_iTXt_SUPPORTED - text_ptr->lang = NULL; - text_ptr->lang_key = NULL; - text_ptr->itxt_length = 0; -#endif - text_ptr->text = png_ptr->chunkdata + prefix_len; - text_ptr->text_length = data_len; - - ret = png_set_text_2(png_ptr, info_ptr, text_ptr, 1); - - png_free(png_ptr, text_ptr); - png_free(png_ptr, png_ptr->chunkdata); - png_ptr->chunkdata = NULL; - if (ret) - png_error(png_ptr, "Insufficient memory to store zTXt chunk."); -} -#endif - -#if defined(PNG_READ_iTXt_SUPPORTED) -/* Note: this does not correctly handle chunks that are > 64K under DOS */ -void /* PRIVATE */ -png_handle_iTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -{ - png_textp text_ptr; - png_charp key, lang, text, lang_key; - int comp_flag; - int comp_type = 0; - int ret; - png_size_t slength, prefix_len, data_len; - - png_debug(1, "in png_handle_iTXt"); - - - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before iTXt"); - - if (png_ptr->mode & PNG_HAVE_IDAT) - png_ptr->mode |= PNG_AFTER_IDAT; - -#ifdef PNG_MAX_MALLOC_64K - /* We will no doubt have problems with chunks even half this size, but - there is no hard and fast rule to tell us where to stop. */ - if (length > (png_uint_32)65535L) - { - png_warning(png_ptr, "iTXt chunk too large to fit in memory"); - png_crc_finish(png_ptr, length); - return; - } -#endif - - png_free(png_ptr, png_ptr->chunkdata); - png_ptr->chunkdata = (png_charp)png_malloc_warn(png_ptr, length + 1); - if (png_ptr->chunkdata == NULL) - { - png_warning(png_ptr, "No memory to process iTXt chunk."); - return; - } - slength = (png_size_t)length; - png_crc_read(png_ptr, (png_bytep)png_ptr->chunkdata, slength); - if (png_crc_finish(png_ptr, 0)) - { - png_free(png_ptr, png_ptr->chunkdata); - png_ptr->chunkdata = NULL; - return; - } - - png_ptr->chunkdata[slength] = 0x00; - - for (lang = png_ptr->chunkdata; *lang; lang++) - /* Empty loop */ ; - lang++; /* Skip NUL separator */ - - /* iTXt must have a language tag (possibly empty), two compression bytes, - * translated keyword (possibly empty), and possibly some text after the - * keyword - */ - - if (lang >= png_ptr->chunkdata + slength - 3) - { - png_warning(png_ptr, "Truncated iTXt chunk"); - png_free(png_ptr, png_ptr->chunkdata); - png_ptr->chunkdata = NULL; - return; - } - else - { - comp_flag = *lang++; - comp_type = *lang++; - } - - for (lang_key = lang; *lang_key; lang_key++) - /* Empty loop */ ; - lang_key++; /* Skip NUL separator */ - - if (lang_key >= png_ptr->chunkdata + slength) - { - png_warning(png_ptr, "Truncated iTXt chunk"); - png_free(png_ptr, png_ptr->chunkdata); - png_ptr->chunkdata = NULL; - return; - } - - for (text = lang_key; *text; text++) - /* Empty loop */ ; - text++; /* Skip NUL separator */ - if (text >= png_ptr->chunkdata + slength) - { - png_warning(png_ptr, "Malformed iTXt chunk"); - png_free(png_ptr, png_ptr->chunkdata); - png_ptr->chunkdata = NULL; - return; - } - - prefix_len = text - png_ptr->chunkdata; - - key=png_ptr->chunkdata; - if (comp_flag) - png_decompress_chunk(png_ptr, comp_type, - (size_t)length, prefix_len, &data_len); - else - data_len = png_strlen(png_ptr->chunkdata + prefix_len); - text_ptr = (png_textp)png_malloc_warn(png_ptr, - (png_uint_32)png_sizeof(png_text)); - if (text_ptr == NULL) - { - png_warning(png_ptr, "Not enough memory to process iTXt chunk."); - png_free(png_ptr, png_ptr->chunkdata); - png_ptr->chunkdata = NULL; - return; - } - text_ptr->compression = (int)comp_flag + 1; - text_ptr->lang_key = png_ptr->chunkdata + (lang_key - key); - text_ptr->lang = png_ptr->chunkdata + (lang - key); - text_ptr->itxt_length = data_len; - text_ptr->text_length = 0; - text_ptr->key = png_ptr->chunkdata; - text_ptr->text = png_ptr->chunkdata + prefix_len; - - ret = png_set_text_2(png_ptr, info_ptr, text_ptr, 1); - - png_free(png_ptr, text_ptr); - png_free(png_ptr, png_ptr->chunkdata); - png_ptr->chunkdata = NULL; - if (ret) - png_error(png_ptr, "Insufficient memory to store iTXt chunk."); -} -#endif - -/* This function is called when we haven't found a handler for a - chunk. If there isn't a problem with the chunk itself (ie bad - chunk name, CRC, or a critical chunk), the chunk is silently ignored - -- unless the PNG_FLAG_UNKNOWN_CHUNKS_SUPPORTED flag is on in which - case it will be saved away to be written out later. */ -void /* PRIVATE */ -png_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -{ - png_uint_32 skip = 0; - - png_debug(1, "in png_handle_unknown"); - - - if (png_ptr->mode & PNG_HAVE_IDAT) - { -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_CONST PNG_IDAT; -#endif - if (png_memcmp(png_ptr->chunk_name, png_IDAT, 4)) /* Not an IDAT */ - png_ptr->mode |= PNG_AFTER_IDAT; - } - - if (!(png_ptr->chunk_name[0] & 0x20)) - { -#if defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) - if (png_handle_as_unknown(png_ptr, png_ptr->chunk_name) != - PNG_HANDLE_CHUNK_ALWAYS -#if defined(PNG_READ_USER_CHUNKS_SUPPORTED) - && png_ptr->read_user_chunk_fn == NULL -#endif - ) -#endif - png_chunk_error(png_ptr, "unknown critical chunk"); - } - -#if defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) - if ((png_ptr->flags & PNG_FLAG_KEEP_UNKNOWN_CHUNKS) || - (png_ptr->read_user_chunk_fn != NULL)) - { -#ifdef PNG_MAX_MALLOC_64K - if (length > (png_uint_32)65535L) - { - png_warning(png_ptr, "unknown chunk too large to fit in memory"); - skip = length - (png_uint_32)65535L; - length = (png_uint_32)65535L; - } -#endif - png_memcpy((png_charp)png_ptr->unknown_chunk.name, - (png_charp)png_ptr->chunk_name, - png_sizeof(png_ptr->unknown_chunk.name)); - png_ptr->unknown_chunk.name[png_sizeof(png_ptr->unknown_chunk.name)-1] = '\0'; - png_ptr->unknown_chunk.size = (png_size_t)length; - if (length == 0) - png_ptr->unknown_chunk.data = NULL; - else - { - png_ptr->unknown_chunk.data = (png_bytep)png_malloc(png_ptr, length); - png_crc_read(png_ptr, (png_bytep)png_ptr->unknown_chunk.data, length); - } -#if defined(PNG_READ_USER_CHUNKS_SUPPORTED) - if (png_ptr->read_user_chunk_fn != NULL) - { - /* Callback to user unknown chunk handler */ - int ret; - ret = (*(png_ptr->read_user_chunk_fn)) - (png_ptr, &png_ptr->unknown_chunk); - if (ret < 0) - png_chunk_error(png_ptr, "error in user chunk"); - if (ret == 0) - { - if (!(png_ptr->chunk_name[0] & 0x20)) - if (png_handle_as_unknown(png_ptr, png_ptr->chunk_name) != - PNG_HANDLE_CHUNK_ALWAYS) - png_chunk_error(png_ptr, "unknown critical chunk"); - png_set_unknown_chunks(png_ptr, info_ptr, - &png_ptr->unknown_chunk, 1); - } - } - else -#endif - png_set_unknown_chunks(png_ptr, info_ptr, &png_ptr->unknown_chunk, 1); - png_free(png_ptr, png_ptr->unknown_chunk.data); - png_ptr->unknown_chunk.data = NULL; - } - else -#endif - skip = length; - - png_crc_finish(png_ptr, skip); - -#if !defined(PNG_READ_USER_CHUNKS_SUPPORTED) - info_ptr = info_ptr; /* Quiet compiler warnings about unused info_ptr */ -#endif -} - -/* This function is called to verify that a chunk name is valid. - This function can't have the "critical chunk check" incorporated - into it, since in the future we will need to be able to call user - functions to handle unknown critical chunks after we check that - the chunk name itself is valid. */ - -#define isnonalpha(c) ((c) < 65 || (c) > 122 || ((c) > 90 && (c) < 97)) - -void /* PRIVATE */ -png_check_chunk_name(png_structp png_ptr, png_bytep chunk_name) -{ - png_debug(1, "in png_check_chunk_name"); - if (isnonalpha(chunk_name[0]) || isnonalpha(chunk_name[1]) || - isnonalpha(chunk_name[2]) || isnonalpha(chunk_name[3])) - { - png_chunk_error(png_ptr, "invalid chunk type"); - } -} - -/* Combines the row recently read in with the existing pixels in the - row. This routine takes care of alpha and transparency if requested. - This routine also handles the two methods of progressive display - of interlaced images, depending on the mask value. - The mask value describes which pixels are to be combined with - the row. The pattern always repeats every 8 pixels, so just 8 - bits are needed. A one indicates the pixel is to be combined, - a zero indicates the pixel is to be skipped. This is in addition - to any alpha or transparency value associated with the pixel. If - you want all pixels to be combined, pass 0xff (255) in mask. */ - -void /* PRIVATE */ -png_combine_row(png_structp png_ptr, png_bytep row, int mask) -{ - png_debug(1, "in png_combine_row"); - if (mask == 0xff) - { - png_memcpy(row, png_ptr->row_buf + 1, - PNG_ROWBYTES(png_ptr->row_info.pixel_depth, png_ptr->width)); - } - else - { - switch (png_ptr->row_info.pixel_depth) - { - case 1: - { - png_bytep sp = png_ptr->row_buf + 1; - png_bytep dp = row; - int s_inc, s_start, s_end; - int m = 0x80; - int shift; - png_uint_32 i; - png_uint_32 row_width = png_ptr->width; - -#if defined(PNG_READ_PACKSWAP_SUPPORTED) - if (png_ptr->transformations & PNG_PACKSWAP) - { - s_start = 0; - s_end = 7; - s_inc = 1; - } - else -#endif - { - s_start = 7; - s_end = 0; - s_inc = -1; - } - - shift = s_start; - - for (i = 0; i < row_width; i++) - { - if (m & mask) - { - int value; - - value = (*sp >> shift) & 0x01; - *dp &= (png_byte)((0x7f7f >> (7 - shift)) & 0xff); - *dp |= (png_byte)(value << shift); - } - - if (shift == s_end) - { - shift = s_start; - sp++; - dp++; - } - else - shift += s_inc; - - if (m == 1) - m = 0x80; - else - m >>= 1; - } - break; - } - case 2: - { - png_bytep sp = png_ptr->row_buf + 1; - png_bytep dp = row; - int s_start, s_end, s_inc; - int m = 0x80; - int shift; - png_uint_32 i; - png_uint_32 row_width = png_ptr->width; - int value; - -#if defined(PNG_READ_PACKSWAP_SUPPORTED) - if (png_ptr->transformations & PNG_PACKSWAP) - { - s_start = 0; - s_end = 6; - s_inc = 2; - } - else -#endif - { - s_start = 6; - s_end = 0; - s_inc = -2; - } - - shift = s_start; - - for (i = 0; i < row_width; i++) - { - if (m & mask) - { - value = (*sp >> shift) & 0x03; - *dp &= (png_byte)((0x3f3f >> (6 - shift)) & 0xff); - *dp |= (png_byte)(value << shift); - } - - if (shift == s_end) - { - shift = s_start; - sp++; - dp++; - } - else - shift += s_inc; - if (m == 1) - m = 0x80; - else - m >>= 1; - } - break; - } - case 4: - { - png_bytep sp = png_ptr->row_buf + 1; - png_bytep dp = row; - int s_start, s_end, s_inc; - int m = 0x80; - int shift; - png_uint_32 i; - png_uint_32 row_width = png_ptr->width; - int value; - -#if defined(PNG_READ_PACKSWAP_SUPPORTED) - if (png_ptr->transformations & PNG_PACKSWAP) - { - s_start = 0; - s_end = 4; - s_inc = 4; - } - else -#endif - { - s_start = 4; - s_end = 0; - s_inc = -4; - } - shift = s_start; - - for (i = 0; i < row_width; i++) - { - if (m & mask) - { - value = (*sp >> shift) & 0xf; - *dp &= (png_byte)((0xf0f >> (4 - shift)) & 0xff); - *dp |= (png_byte)(value << shift); - } - - if (shift == s_end) - { - shift = s_start; - sp++; - dp++; - } - else - shift += s_inc; - if (m == 1) - m = 0x80; - else - m >>= 1; - } - break; - } - default: - { - png_bytep sp = png_ptr->row_buf + 1; - png_bytep dp = row; - png_size_t pixel_bytes = (png_ptr->row_info.pixel_depth >> 3); - png_uint_32 i; - png_uint_32 row_width = png_ptr->width; - png_byte m = 0x80; - - - for (i = 0; i < row_width; i++) - { - if (m & mask) - { - png_memcpy(dp, sp, pixel_bytes); - } - - sp += pixel_bytes; - dp += pixel_bytes; - - if (m == 1) - m = 0x80; - else - m >>= 1; - } - break; - } - } - } -} - -#ifdef PNG_READ_INTERLACING_SUPPORTED -/* OLD pre-1.0.9 interface: -void png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass, - png_uint_32 transformations) - */ -void /* PRIVATE */ -png_do_read_interlace(png_structp png_ptr) -{ - png_row_infop row_info = &(png_ptr->row_info); - png_bytep row = png_ptr->row_buf + 1; - int pass = png_ptr->pass; - png_uint_32 transformations = png_ptr->transformations; -#ifdef PNG_USE_LOCAL_ARRAYS - /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */ - /* Offset to next interlace block */ - PNG_CONST int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; -#endif - - png_debug(1, "in png_do_read_interlace"); - if (row != NULL && row_info != NULL) - { - png_uint_32 final_width; - - final_width = row_info->width * png_pass_inc[pass]; - - switch (row_info->pixel_depth) - { - case 1: - { - png_bytep sp = row + (png_size_t)((row_info->width - 1) >> 3); - png_bytep dp = row + (png_size_t)((final_width - 1) >> 3); - int sshift, dshift; - int s_start, s_end, s_inc; - int jstop = png_pass_inc[pass]; - png_byte v; - png_uint_32 i; - int j; - -#if defined(PNG_READ_PACKSWAP_SUPPORTED) - if (transformations & PNG_PACKSWAP) - { - sshift = (int)((row_info->width + 7) & 0x07); - dshift = (int)((final_width + 7) & 0x07); - s_start = 7; - s_end = 0; - s_inc = -1; - } - else -#endif - { - sshift = 7 - (int)((row_info->width + 7) & 0x07); - dshift = 7 - (int)((final_width + 7) & 0x07); - s_start = 0; - s_end = 7; - s_inc = 1; - } - - for (i = 0; i < row_info->width; i++) - { - v = (png_byte)((*sp >> sshift) & 0x01); - for (j = 0; j < jstop; j++) - { - *dp &= (png_byte)((0x7f7f >> (7 - dshift)) & 0xff); - *dp |= (png_byte)(v << dshift); - if (dshift == s_end) - { - dshift = s_start; - dp--; - } - else - dshift += s_inc; - } - if (sshift == s_end) - { - sshift = s_start; - sp--; - } - else - sshift += s_inc; - } - break; - } - case 2: - { - png_bytep sp = row + (png_uint_32)((row_info->width - 1) >> 2); - png_bytep dp = row + (png_uint_32)((final_width - 1) >> 2); - int sshift, dshift; - int s_start, s_end, s_inc; - int jstop = png_pass_inc[pass]; - png_uint_32 i; - -#if defined(PNG_READ_PACKSWAP_SUPPORTED) - if (transformations & PNG_PACKSWAP) - { - sshift = (int)(((row_info->width + 3) & 0x03) << 1); - dshift = (int)(((final_width + 3) & 0x03) << 1); - s_start = 6; - s_end = 0; - s_inc = -2; - } - else -#endif - { - sshift = (int)((3 - ((row_info->width + 3) & 0x03)) << 1); - dshift = (int)((3 - ((final_width + 3) & 0x03)) << 1); - s_start = 0; - s_end = 6; - s_inc = 2; - } - - for (i = 0; i < row_info->width; i++) - { - png_byte v; - int j; - - v = (png_byte)((*sp >> sshift) & 0x03); - for (j = 0; j < jstop; j++) - { - *dp &= (png_byte)((0x3f3f >> (6 - dshift)) & 0xff); - *dp |= (png_byte)(v << dshift); - if (dshift == s_end) - { - dshift = s_start; - dp--; - } - else - dshift += s_inc; - } - if (sshift == s_end) - { - sshift = s_start; - sp--; - } - else - sshift += s_inc; - } - break; - } - case 4: - { - png_bytep sp = row + (png_size_t)((row_info->width - 1) >> 1); - png_bytep dp = row + (png_size_t)((final_width - 1) >> 1); - int sshift, dshift; - int s_start, s_end, s_inc; - png_uint_32 i; - int jstop = png_pass_inc[pass]; - -#if defined(PNG_READ_PACKSWAP_SUPPORTED) - if (transformations & PNG_PACKSWAP) - { - sshift = (int)(((row_info->width + 1) & 0x01) << 2); - dshift = (int)(((final_width + 1) & 0x01) << 2); - s_start = 4; - s_end = 0; - s_inc = -4; - } - else -#endif - { - sshift = (int)((1 - ((row_info->width + 1) & 0x01)) << 2); - dshift = (int)((1 - ((final_width + 1) & 0x01)) << 2); - s_start = 0; - s_end = 4; - s_inc = 4; - } - - for (i = 0; i < row_info->width; i++) - { - png_byte v = (png_byte)((*sp >> sshift) & 0xf); - int j; - - for (j = 0; j < jstop; j++) - { - *dp &= (png_byte)((0xf0f >> (4 - dshift)) & 0xff); - *dp |= (png_byte)(v << dshift); - if (dshift == s_end) - { - dshift = s_start; - dp--; - } - else - dshift += s_inc; - } - if (sshift == s_end) - { - sshift = s_start; - sp--; - } - else - sshift += s_inc; - } - break; - } - default: - { - png_size_t pixel_bytes = (row_info->pixel_depth >> 3); - png_bytep sp = row + (png_size_t)(row_info->width - 1) * pixel_bytes; - png_bytep dp = row + (png_size_t)(final_width - 1) * pixel_bytes; - - int jstop = png_pass_inc[pass]; - png_uint_32 i; - - for (i = 0; i < row_info->width; i++) - { - png_byte v[8]; - int j; - - png_memcpy(v, sp, pixel_bytes); - for (j = 0; j < jstop; j++) - { - png_memcpy(dp, v, pixel_bytes); - dp -= pixel_bytes; - } - sp -= pixel_bytes; - } - break; - } - } - row_info->width = final_width; - row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth, final_width); - } -#if !defined(PNG_READ_PACKSWAP_SUPPORTED) - transformations = transformations; /* Silence compiler warning */ -#endif -} -#endif /* PNG_READ_INTERLACING_SUPPORTED */ - -void /* PRIVATE */ -png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep row, - png_bytep prev_row, int filter) -{ - png_debug(1, "in png_read_filter_row"); - png_debug2(2, "row = %lu, filter = %d", png_ptr->row_number, filter); - switch (filter) - { - case PNG_FILTER_VALUE_NONE: - break; - case PNG_FILTER_VALUE_SUB: - { - png_uint_32 i; - png_uint_32 istop = row_info->rowbytes; - png_uint_32 bpp = (row_info->pixel_depth + 7) >> 3; - png_bytep rp = row + bpp; - png_bytep lp = row; - - for (i = bpp; i < istop; i++) - { - *rp = (png_byte)(((int)(*rp) + (int)(*lp++)) & 0xff); - rp++; - } - break; - } - case PNG_FILTER_VALUE_UP: - { - png_uint_32 i; - png_uint_32 istop = row_info->rowbytes; - png_bytep rp = row; - png_bytep pp = prev_row; - - for (i = 0; i < istop; i++) - { - *rp = (png_byte)(((int)(*rp) + (int)(*pp++)) & 0xff); - rp++; - } - break; - } - case PNG_FILTER_VALUE_AVG: - { - png_uint_32 i; - png_bytep rp = row; - png_bytep pp = prev_row; - png_bytep lp = row; - png_uint_32 bpp = (row_info->pixel_depth + 7) >> 3; - png_uint_32 istop = row_info->rowbytes - bpp; - - for (i = 0; i < bpp; i++) - { - *rp = (png_byte)(((int)(*rp) + - ((int)(*pp++) / 2 )) & 0xff); - rp++; - } - - for (i = 0; i < istop; i++) - { - *rp = (png_byte)(((int)(*rp) + - (int)(*pp++ + *lp++) / 2 ) & 0xff); - rp++; - } - break; - } - case PNG_FILTER_VALUE_PAETH: - { - png_uint_32 i; - png_bytep rp = row; - png_bytep pp = prev_row; - png_bytep lp = row; - png_bytep cp = prev_row; - png_uint_32 bpp = (row_info->pixel_depth + 7) >> 3; - png_uint_32 istop=row_info->rowbytes - bpp; - - for (i = 0; i < bpp; i++) - { - *rp = (png_byte)(((int)(*rp) + (int)(*pp++)) & 0xff); - rp++; - } - - for (i = 0; i < istop; i++) /* Use leftover rp,pp */ - { - int a, b, c, pa, pb, pc, p; - - a = *lp++; - b = *pp++; - c = *cp++; - - p = b - c; - pc = a - c; - -#ifdef PNG_USE_ABS - pa = abs(p); - pb = abs(pc); - pc = abs(p + pc); -#else - pa = p < 0 ? -p : p; - pb = pc < 0 ? -pc : pc; - pc = (p + pc) < 0 ? -(p + pc) : p + pc; -#endif - - /* - if (pa <= pb && pa <= pc) - p = a; - else if (pb <= pc) - p = b; - else - p = c; - */ - - p = (pa <= pb && pa <= pc) ? a : (pb <= pc) ? b : c; - - *rp = (png_byte)(((int)(*rp) + p) & 0xff); - rp++; - } - break; - } - default: - png_warning(png_ptr, "Ignoring bad adaptive filter type"); - *row = 0; - break; - } -} - -#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED -void /* PRIVATE */ -png_read_finish_row(png_structp png_ptr) -{ -#ifdef PNG_USE_LOCAL_ARRAYS -#ifdef PNG_READ_INTERLACING_SUPPORTED - /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */ - - /* Start of interlace block */ - PNG_CONST int png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; - - /* Offset to next interlace block */ - PNG_CONST int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; - - /* Start of interlace block in the y direction */ - PNG_CONST int png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1}; - - /* Offset to next interlace block in the y direction */ - PNG_CONST int png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2}; -#endif /* PNG_READ_INTERLACING_SUPPORTED */ -#endif - - png_debug(1, "in png_read_finish_row"); - png_ptr->row_number++; - if (png_ptr->row_number < png_ptr->num_rows) - return; - -#ifdef PNG_READ_INTERLACING_SUPPORTED - if (png_ptr->interlaced) - { - png_ptr->row_number = 0; - png_memset_check(png_ptr, png_ptr->prev_row, 0, - png_ptr->rowbytes + 1); - do - { - png_ptr->pass++; - if (png_ptr->pass >= 7) - break; - png_ptr->iwidth = (png_ptr->width + - png_pass_inc[png_ptr->pass] - 1 - - png_pass_start[png_ptr->pass]) / - png_pass_inc[png_ptr->pass]; - - png_ptr->irowbytes = PNG_ROWBYTES(png_ptr->pixel_depth, - png_ptr->iwidth) + 1; - - if (!(png_ptr->transformations & PNG_INTERLACE)) - { - png_ptr->num_rows = (png_ptr->height + - png_pass_yinc[png_ptr->pass] - 1 - - png_pass_ystart[png_ptr->pass]) / - png_pass_yinc[png_ptr->pass]; - if (!(png_ptr->num_rows)) - continue; - } - else /* if (png_ptr->transformations & PNG_INTERLACE) */ - break; - } while (png_ptr->iwidth == 0); - - if (png_ptr->pass < 7) - return; - } -#endif /* PNG_READ_INTERLACING_SUPPORTED */ - - if (!(png_ptr->flags & PNG_FLAG_ZLIB_FINISHED)) - { -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_CONST PNG_IDAT; -#endif - char extra; - int ret; - - png_ptr->zstream.next_out = (Byte *)&extra; - png_ptr->zstream.avail_out = (uInt)1; - for (;;) - { - if (!(png_ptr->zstream.avail_in)) - { - while (!png_ptr->idat_size) - { - png_byte chunk_length[4]; - - png_crc_finish(png_ptr, 0); - - png_read_data(png_ptr, chunk_length, 4); - png_ptr->idat_size = png_get_uint_31(png_ptr, chunk_length); - png_reset_crc(png_ptr); - png_crc_read(png_ptr, png_ptr->chunk_name, 4); - if (png_memcmp(png_ptr->chunk_name, png_IDAT, 4)) - png_error(png_ptr, "Not enough image data"); - - } - png_ptr->zstream.avail_in = (uInt)png_ptr->zbuf_size; - png_ptr->zstream.next_in = png_ptr->zbuf; - if (png_ptr->zbuf_size > png_ptr->idat_size) - png_ptr->zstream.avail_in = (uInt)png_ptr->idat_size; - png_crc_read(png_ptr, png_ptr->zbuf, png_ptr->zstream.avail_in); - png_ptr->idat_size -= png_ptr->zstream.avail_in; - } - ret = inflate(&png_ptr->zstream, Z_PARTIAL_FLUSH); - if (ret == Z_STREAM_END) - { - if (!(png_ptr->zstream.avail_out) || png_ptr->zstream.avail_in || - png_ptr->idat_size) - png_warning(png_ptr, "Extra compressed data"); - png_ptr->mode |= PNG_AFTER_IDAT; - png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED; - break; - } - if (ret != Z_OK) - png_error(png_ptr, png_ptr->zstream.msg ? png_ptr->zstream.msg : - "Decompression Error"); - - if (!(png_ptr->zstream.avail_out)) - { - png_warning(png_ptr, "Extra compressed data."); - png_ptr->mode |= PNG_AFTER_IDAT; - png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED; - break; - } - - } - png_ptr->zstream.avail_out = 0; - } - - if (png_ptr->idat_size || png_ptr->zstream.avail_in) - png_warning(png_ptr, "Extra compression data"); - - inflateReset(&png_ptr->zstream); - - png_ptr->mode |= PNG_AFTER_IDAT; -} -#endif /* PNG_NO_SEQUENTIAL_READ_SUPPORTED */ - -void /* PRIVATE */ -png_read_start_row(png_structp png_ptr) -{ -#ifdef PNG_USE_LOCAL_ARRAYS -#ifdef PNG_READ_INTERLACING_SUPPORTED - /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */ - - /* Start of interlace block */ - PNG_CONST int png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; - - /* Offset to next interlace block */ - PNG_CONST int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; - - /* Start of interlace block in the y direction */ - PNG_CONST int png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1}; - - /* Offset to next interlace block in the y direction */ - PNG_CONST int png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2}; -#endif -#endif - - int max_pixel_depth; - png_size_t row_bytes; - - png_debug(1, "in png_read_start_row"); - png_ptr->zstream.avail_in = 0; - png_init_read_transformations(png_ptr); -#ifdef PNG_READ_INTERLACING_SUPPORTED - if (png_ptr->interlaced) - { - if (!(png_ptr->transformations & PNG_INTERLACE)) - png_ptr->num_rows = (png_ptr->height + png_pass_yinc[0] - 1 - - png_pass_ystart[0]) / png_pass_yinc[0]; - else - png_ptr->num_rows = png_ptr->height; - - png_ptr->iwidth = (png_ptr->width + - png_pass_inc[png_ptr->pass] - 1 - - png_pass_start[png_ptr->pass]) / - png_pass_inc[png_ptr->pass]; - - png_ptr->irowbytes = - PNG_ROWBYTES(png_ptr->pixel_depth, png_ptr->iwidth) + 1; - } - else -#endif /* PNG_READ_INTERLACING_SUPPORTED */ - { - png_ptr->num_rows = png_ptr->height; - png_ptr->iwidth = png_ptr->width; - png_ptr->irowbytes = png_ptr->rowbytes + 1; - } - max_pixel_depth = png_ptr->pixel_depth; - -#if defined(PNG_READ_PACK_SUPPORTED) - if ((png_ptr->transformations & PNG_PACK) && png_ptr->bit_depth < 8) - max_pixel_depth = 8; -#endif - -#if defined(PNG_READ_EXPAND_SUPPORTED) - if (png_ptr->transformations & PNG_EXPAND) - { - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - { - if (png_ptr->num_trans) - max_pixel_depth = 32; - else - max_pixel_depth = 24; - } - else if (png_ptr->color_type == PNG_COLOR_TYPE_GRAY) - { - if (max_pixel_depth < 8) - max_pixel_depth = 8; - if (png_ptr->num_trans) - max_pixel_depth *= 2; - } - else if (png_ptr->color_type == PNG_COLOR_TYPE_RGB) - { - if (png_ptr->num_trans) - { - max_pixel_depth *= 4; - max_pixel_depth /= 3; - } - } - } -#endif - -#if defined(PNG_READ_FILLER_SUPPORTED) - if (png_ptr->transformations & (PNG_FILLER)) - { - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - max_pixel_depth = 32; - else if (png_ptr->color_type == PNG_COLOR_TYPE_GRAY) - { - if (max_pixel_depth <= 8) - max_pixel_depth = 16; - else - max_pixel_depth = 32; - } - else if (png_ptr->color_type == PNG_COLOR_TYPE_RGB) - { - if (max_pixel_depth <= 32) - max_pixel_depth = 32; - else - max_pixel_depth = 64; - } - } -#endif - -#if defined(PNG_READ_GRAY_TO_RGB_SUPPORTED) - if (png_ptr->transformations & PNG_GRAY_TO_RGB) - { - if ( -#if defined(PNG_READ_EXPAND_SUPPORTED) - (png_ptr->num_trans && (png_ptr->transformations & PNG_EXPAND)) || -#endif -#if defined(PNG_READ_FILLER_SUPPORTED) - (png_ptr->transformations & (PNG_FILLER)) || -#endif - png_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) - { - if (max_pixel_depth <= 16) - max_pixel_depth = 32; - else - max_pixel_depth = 64; - } - else - { - if (max_pixel_depth <= 8) - { - if (png_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA) - max_pixel_depth = 32; - else - max_pixel_depth = 24; - } - else if (png_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA) - max_pixel_depth = 64; - else - max_pixel_depth = 48; - } - } -#endif - -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) && \ -defined(PNG_USER_TRANSFORM_PTR_SUPPORTED) - if (png_ptr->transformations & PNG_USER_TRANSFORM) - { - int user_pixel_depth = png_ptr->user_transform_depth* - png_ptr->user_transform_channels; - if (user_pixel_depth > max_pixel_depth) - max_pixel_depth=user_pixel_depth; - } -#endif - - /* Align the width on the next larger 8 pixels. Mainly used - * for interlacing - */ - row_bytes = ((png_ptr->width + 7) & ~((png_uint_32)7)); - /* Calculate the maximum bytes needed, adding a byte and a pixel - * for safety's sake - */ - row_bytes = PNG_ROWBYTES(max_pixel_depth, row_bytes) + - 1 + ((max_pixel_depth + 7) >> 3); -#ifdef PNG_MAX_MALLOC_64K - if (row_bytes > (png_uint_32)65536L) - png_error(png_ptr, "This image requires a row greater than 64KB"); -#endif - - if (row_bytes + 64 > png_ptr->old_big_row_buf_size) - { - png_free(png_ptr, png_ptr->big_row_buf); - png_ptr->big_row_buf = (png_bytep)png_malloc(png_ptr, row_bytes + 64); - if (png_ptr->interlaced) - png_memset(png_ptr->big_row_buf, 0, row_bytes + 64); - png_ptr->row_buf = png_ptr->big_row_buf + 32; - png_ptr->old_big_row_buf_size = row_bytes + 64; - } - -#ifdef PNG_MAX_MALLOC_64K - if ((png_uint_32)row_bytes + 1 > (png_uint_32)65536L) - png_error(png_ptr, "This image requires a row greater than 64KB"); -#endif - if ((png_uint_32)row_bytes > (png_uint_32)(PNG_SIZE_MAX - 1)) - png_error(png_ptr, "Row has too many bytes to allocate in memory."); - - if (row_bytes + 1 > png_ptr->old_prev_row_size) - { - png_free(png_ptr, png_ptr->prev_row); - png_ptr->prev_row = (png_bytep)png_malloc(png_ptr, (png_uint_32)( - row_bytes + 1)); - png_memset_check(png_ptr, png_ptr->prev_row, 0, row_bytes + 1); - png_ptr->old_prev_row_size = row_bytes + 1; - } - - png_ptr->rowbytes = row_bytes; - - png_debug1(3, "width = %lu,", png_ptr->width); - png_debug1(3, "height = %lu,", png_ptr->height); - png_debug1(3, "iwidth = %lu,", png_ptr->iwidth); - png_debug1(3, "num_rows = %lu,", png_ptr->num_rows); - png_debug1(3, "rowbytes = %lu,", png_ptr->rowbytes); - png_debug1(3, "irowbytes = %lu", png_ptr->irowbytes); - - png_ptr->flags |= PNG_FLAG_ROW_INIT; -} -#endif /* PNG_READ_SUPPORTED */ diff --git a/src/libpng/pngset.c b/src/libpng/pngset.c deleted file mode 100644 index 198ded897..000000000 --- a/src/libpng/pngset.c +++ /dev/null @@ -1,1255 +0,0 @@ - -/* pngset.c - storage of image information into info struct - * - * Last changed in libpng 1.2.37 [June 4, 2009] - * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2009 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - * - * The functions here are used during reads to store data from the file - * into the info struct, and during writes to store application data - * into the info struct for writing into the file. This abstracts the - * info struct and allows us to change the structure in the future. - */ - -#define PNG_INTERNAL -#include "png.h" -#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) - -#if defined(PNG_bKGD_SUPPORTED) -void PNGAPI -png_set_bKGD(png_structp png_ptr, png_infop info_ptr, png_color_16p background) -{ - png_debug1(1, "in %s storage function", "bKGD"); - if (png_ptr == NULL || info_ptr == NULL) - return; - - png_memcpy(&(info_ptr->background), background, png_sizeof(png_color_16)); - info_ptr->valid |= PNG_INFO_bKGD; -} -#endif - -#if defined(PNG_cHRM_SUPPORTED) -#ifdef PNG_FLOATING_POINT_SUPPORTED -void PNGAPI -png_set_cHRM(png_structp png_ptr, png_infop info_ptr, - double white_x, double white_y, double red_x, double red_y, - double green_x, double green_y, double blue_x, double blue_y) -{ - png_debug1(1, "in %s storage function", "cHRM"); - if (png_ptr == NULL || info_ptr == NULL) - return; - - info_ptr->x_white = (float)white_x; - info_ptr->y_white = (float)white_y; - info_ptr->x_red = (float)red_x; - info_ptr->y_red = (float)red_y; - info_ptr->x_green = (float)green_x; - info_ptr->y_green = (float)green_y; - info_ptr->x_blue = (float)blue_x; - info_ptr->y_blue = (float)blue_y; -#ifdef PNG_FIXED_POINT_SUPPORTED - info_ptr->int_x_white = (png_fixed_point)(white_x*100000.+0.5); - info_ptr->int_y_white = (png_fixed_point)(white_y*100000.+0.5); - info_ptr->int_x_red = (png_fixed_point)( red_x*100000.+0.5); - info_ptr->int_y_red = (png_fixed_point)( red_y*100000.+0.5); - info_ptr->int_x_green = (png_fixed_point)(green_x*100000.+0.5); - info_ptr->int_y_green = (png_fixed_point)(green_y*100000.+0.5); - info_ptr->int_x_blue = (png_fixed_point)( blue_x*100000.+0.5); - info_ptr->int_y_blue = (png_fixed_point)( blue_y*100000.+0.5); -#endif - info_ptr->valid |= PNG_INFO_cHRM; -} -#endif /* PNG_FLOATING_POINT_SUPPORTED */ - -#ifdef PNG_FIXED_POINT_SUPPORTED -void PNGAPI -png_set_cHRM_fixed(png_structp png_ptr, png_infop info_ptr, - png_fixed_point white_x, png_fixed_point white_y, png_fixed_point red_x, - png_fixed_point red_y, png_fixed_point green_x, png_fixed_point green_y, - png_fixed_point blue_x, png_fixed_point blue_y) -{ - png_debug1(1, "in %s storage function", "cHRM fixed"); - if (png_ptr == NULL || info_ptr == NULL) - return; - -#if !defined(PNG_NO_CHECK_cHRM) - if (png_check_cHRM_fixed(png_ptr, - white_x, white_y, red_x, red_y, green_x, green_y, blue_x, blue_y)) -#endif - { - info_ptr->int_x_white = white_x; - info_ptr->int_y_white = white_y; - info_ptr->int_x_red = red_x; - info_ptr->int_y_red = red_y; - info_ptr->int_x_green = green_x; - info_ptr->int_y_green = green_y; - info_ptr->int_x_blue = blue_x; - info_ptr->int_y_blue = blue_y; -#ifdef PNG_FLOATING_POINT_SUPPORTED - info_ptr->x_white = (float)(white_x/100000.); - info_ptr->y_white = (float)(white_y/100000.); - info_ptr->x_red = (float)( red_x/100000.); - info_ptr->y_red = (float)( red_y/100000.); - info_ptr->x_green = (float)(green_x/100000.); - info_ptr->y_green = (float)(green_y/100000.); - info_ptr->x_blue = (float)( blue_x/100000.); - info_ptr->y_blue = (float)( blue_y/100000.); -#endif - info_ptr->valid |= PNG_INFO_cHRM; - } -} -#endif /* PNG_FIXED_POINT_SUPPORTED */ -#endif /* PNG_cHRM_SUPPORTED */ - -#if defined(PNG_gAMA_SUPPORTED) -#ifdef PNG_FLOATING_POINT_SUPPORTED -void PNGAPI -png_set_gAMA(png_structp png_ptr, png_infop info_ptr, double file_gamma) -{ - double png_gamma; - png_debug1(1, "in %s storage function", "gAMA"); - if (png_ptr == NULL || info_ptr == NULL) - return; - - /* Check for overflow */ - if (file_gamma > 21474.83) - { - png_warning(png_ptr, "Limiting gamma to 21474.83"); - png_gamma=21474.83; - } - else - png_gamma = file_gamma; - info_ptr->gamma = (float)png_gamma; -#ifdef PNG_FIXED_POINT_SUPPORTED - info_ptr->int_gamma = (int)(png_gamma*100000.+.5); -#endif - info_ptr->valid |= PNG_INFO_gAMA; - if (png_gamma == 0.0) - png_warning(png_ptr, "Setting gamma=0"); -} -#endif -void PNGAPI -png_set_gAMA_fixed(png_structp png_ptr, png_infop info_ptr, png_fixed_point - int_gamma) -{ - png_fixed_point png_gamma; - - png_debug1(1, "in %s storage function", "gAMA"); - if (png_ptr == NULL || info_ptr == NULL) - return; - - if (int_gamma > (png_fixed_point)PNG_UINT_31_MAX) - { - png_warning(png_ptr, "Limiting gamma to 21474.83"); - png_gamma=PNG_UINT_31_MAX; - } - else - { - if (int_gamma < 0) - { - png_warning(png_ptr, "Setting negative gamma to zero"); - png_gamma = 0; - } - else - png_gamma = int_gamma; - } -#ifdef PNG_FLOATING_POINT_SUPPORTED - info_ptr->gamma = (float)(png_gamma/100000.); -#endif -#ifdef PNG_FIXED_POINT_SUPPORTED - info_ptr->int_gamma = png_gamma; -#endif - info_ptr->valid |= PNG_INFO_gAMA; - if (png_gamma == 0) - png_warning(png_ptr, "Setting gamma=0"); -} -#endif - -#if defined(PNG_hIST_SUPPORTED) -void PNGAPI -png_set_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_16p hist) -{ - int i; - - png_debug1(1, "in %s storage function", "hIST"); - if (png_ptr == NULL || info_ptr == NULL) - return; - if (info_ptr->num_palette == 0 || info_ptr->num_palette - > PNG_MAX_PALETTE_LENGTH) - { - png_warning(png_ptr, - "Invalid palette size, hIST allocation skipped."); - return; - } - -#ifdef PNG_FREE_ME_SUPPORTED - png_free_data(png_ptr, info_ptr, PNG_FREE_HIST, 0); -#endif - /* Changed from info->num_palette to PNG_MAX_PALETTE_LENGTH in - * version 1.2.1 - */ - png_ptr->hist = (png_uint_16p)png_malloc_warn(png_ptr, - (png_uint_32)(PNG_MAX_PALETTE_LENGTH * png_sizeof(png_uint_16))); - if (png_ptr->hist == NULL) - { - png_warning(png_ptr, "Insufficient memory for hIST chunk data."); - return; - } - - for (i = 0; i < info_ptr->num_palette; i++) - png_ptr->hist[i] = hist[i]; - info_ptr->hist = png_ptr->hist; - info_ptr->valid |= PNG_INFO_hIST; - -#ifdef PNG_FREE_ME_SUPPORTED - info_ptr->free_me |= PNG_FREE_HIST; -#else - png_ptr->flags |= PNG_FLAG_FREE_HIST; -#endif -} -#endif - -void PNGAPI -png_set_IHDR(png_structp png_ptr, png_infop info_ptr, - png_uint_32 width, png_uint_32 height, int bit_depth, - int color_type, int interlace_type, int compression_type, - int filter_type) -{ - png_debug1(1, "in %s storage function", "IHDR"); - if (png_ptr == NULL || info_ptr == NULL) - return; - - /* Check for width and height valid values */ - if (width == 0 || height == 0) - png_error(png_ptr, "Image width or height is zero in IHDR"); -#ifdef PNG_SET_USER_LIMITS_SUPPORTED - if (width > png_ptr->user_width_max || height > png_ptr->user_height_max) - png_error(png_ptr, "image size exceeds user limits in IHDR"); -#else - if (width > PNG_USER_WIDTH_MAX || height > PNG_USER_HEIGHT_MAX) - png_error(png_ptr, "image size exceeds user limits in IHDR"); -#endif - if (width > PNG_UINT_31_MAX || height > PNG_UINT_31_MAX) - png_error(png_ptr, "Invalid image size in IHDR"); - if ( width > (PNG_UINT_32_MAX - >> 3) /* 8-byte RGBA pixels */ - - 64 /* bigrowbuf hack */ - - 1 /* filter byte */ - - 7*8 /* rounding of width to multiple of 8 pixels */ - - 8) /* extra max_pixel_depth pad */ - png_warning(png_ptr, "Width is too large for libpng to process pixels"); - - /* Check other values */ - if (bit_depth != 1 && bit_depth != 2 && bit_depth != 4 && - bit_depth != 8 && bit_depth != 16) - png_error(png_ptr, "Invalid bit depth in IHDR"); - - if (color_type < 0 || color_type == 1 || - color_type == 5 || color_type > 6) - png_error(png_ptr, "Invalid color type in IHDR"); - - if (((color_type == PNG_COLOR_TYPE_PALETTE) && bit_depth > 8) || - ((color_type == PNG_COLOR_TYPE_RGB || - color_type == PNG_COLOR_TYPE_GRAY_ALPHA || - color_type == PNG_COLOR_TYPE_RGB_ALPHA) && bit_depth < 8)) - png_error(png_ptr, "Invalid color type/bit depth combination in IHDR"); - - if (interlace_type >= PNG_INTERLACE_LAST) - png_error(png_ptr, "Unknown interlace method in IHDR"); - - if (compression_type != PNG_COMPRESSION_TYPE_BASE) - png_error(png_ptr, "Unknown compression method in IHDR"); - -#if defined(PNG_MNG_FEATURES_SUPPORTED) - /* Accept filter_method 64 (intrapixel differencing) only if - * 1. Libpng was compiled with PNG_MNG_FEATURES_SUPPORTED and - * 2. Libpng did not read a PNG signature (this filter_method is only - * used in PNG datastreams that are embedded in MNG datastreams) and - * 3. The application called png_permit_mng_features with a mask that - * included PNG_FLAG_MNG_FILTER_64 and - * 4. The filter_method is 64 and - * 5. The color_type is RGB or RGBA - */ - if ((png_ptr->mode&PNG_HAVE_PNG_SIGNATURE)&&png_ptr->mng_features_permitted) - png_warning(png_ptr, "MNG features are not allowed in a PNG datastream"); - if (filter_type != PNG_FILTER_TYPE_BASE) - { - if (!((png_ptr->mng_features_permitted & PNG_FLAG_MNG_FILTER_64) && - (filter_type == PNG_INTRAPIXEL_DIFFERENCING) && - ((png_ptr->mode&PNG_HAVE_PNG_SIGNATURE) == 0) && - (color_type == PNG_COLOR_TYPE_RGB || - color_type == PNG_COLOR_TYPE_RGB_ALPHA))) - png_error(png_ptr, "Unknown filter method in IHDR"); - if (png_ptr->mode&PNG_HAVE_PNG_SIGNATURE) - png_warning(png_ptr, "Invalid filter method in IHDR"); - } -#else - if (filter_type != PNG_FILTER_TYPE_BASE) - png_error(png_ptr, "Unknown filter method in IHDR"); -#endif - - info_ptr->width = width; - info_ptr->height = height; - info_ptr->bit_depth = (png_byte)bit_depth; - info_ptr->color_type =(png_byte) color_type; - info_ptr->compression_type = (png_byte)compression_type; - info_ptr->filter_type = (png_byte)filter_type; - info_ptr->interlace_type = (png_byte)interlace_type; - if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - info_ptr->channels = 1; - else if (info_ptr->color_type & PNG_COLOR_MASK_COLOR) - info_ptr->channels = 3; - else - info_ptr->channels = 1; - if (info_ptr->color_type & PNG_COLOR_MASK_ALPHA) - info_ptr->channels++; - info_ptr->pixel_depth = (png_byte)(info_ptr->channels * info_ptr->bit_depth); - - /* Check for potential overflow */ - if (width > (PNG_UINT_32_MAX - >> 3) /* 8-byte RGBA pixels */ - - 64 /* bigrowbuf hack */ - - 1 /* filter byte */ - - 7*8 /* rounding of width to multiple of 8 pixels */ - - 8) /* extra max_pixel_depth pad */ - info_ptr->rowbytes = (png_size_t)0; - else - info_ptr->rowbytes = PNG_ROWBYTES(info_ptr->pixel_depth, width); -} - -#if defined(PNG_oFFs_SUPPORTED) -void PNGAPI -png_set_oFFs(png_structp png_ptr, png_infop info_ptr, - png_int_32 offset_x, png_int_32 offset_y, int unit_type) -{ - png_debug1(1, "in %s storage function", "oFFs"); - if (png_ptr == NULL || info_ptr == NULL) - return; - - info_ptr->x_offset = offset_x; - info_ptr->y_offset = offset_y; - info_ptr->offset_unit_type = (png_byte)unit_type; - info_ptr->valid |= PNG_INFO_oFFs; -} -#endif - -#if defined(PNG_pCAL_SUPPORTED) -void PNGAPI -png_set_pCAL(png_structp png_ptr, png_infop info_ptr, - png_charp purpose, png_int_32 X0, png_int_32 X1, int type, int nparams, - png_charp units, png_charpp params) -{ - png_uint_32 length; - int i; - - png_debug1(1, "in %s storage function", "pCAL"); - if (png_ptr == NULL || info_ptr == NULL) - return; - - length = png_strlen(purpose) + 1; - png_debug1(3, "allocating purpose for info (%lu bytes)", - (unsigned long)length); - info_ptr->pcal_purpose = (png_charp)png_malloc_warn(png_ptr, length); - if (info_ptr->pcal_purpose == NULL) - { - png_warning(png_ptr, "Insufficient memory for pCAL purpose."); - return; - } - png_memcpy(info_ptr->pcal_purpose, purpose, (png_size_t)length); - - png_debug(3, "storing X0, X1, type, and nparams in info"); - info_ptr->pcal_X0 = X0; - info_ptr->pcal_X1 = X1; - info_ptr->pcal_type = (png_byte)type; - info_ptr->pcal_nparams = (png_byte)nparams; - - length = png_strlen(units) + 1; - png_debug1(3, "allocating units for info (%lu bytes)", - (unsigned long)length); - info_ptr->pcal_units = (png_charp)png_malloc_warn(png_ptr, length); - if (info_ptr->pcal_units == NULL) - { - png_warning(png_ptr, "Insufficient memory for pCAL units."); - return; - } - png_memcpy(info_ptr->pcal_units, units, (png_size_t)length); - - info_ptr->pcal_params = (png_charpp)png_malloc_warn(png_ptr, - (png_uint_32)((nparams + 1) * png_sizeof(png_charp))); - if (info_ptr->pcal_params == NULL) - { - png_warning(png_ptr, "Insufficient memory for pCAL params."); - return; - } - - png_memset(info_ptr->pcal_params, 0, (nparams + 1) * png_sizeof(png_charp)); - - for (i = 0; i < nparams; i++) - { - length = png_strlen(params[i]) + 1; - png_debug2(3, "allocating parameter %d for info (%lu bytes)", i, - (unsigned long)length); - info_ptr->pcal_params[i] = (png_charp)png_malloc_warn(png_ptr, length); - if (info_ptr->pcal_params[i] == NULL) - { - png_warning(png_ptr, "Insufficient memory for pCAL parameter."); - return; - } - png_memcpy(info_ptr->pcal_params[i], params[i], (png_size_t)length); - } - - info_ptr->valid |= PNG_INFO_pCAL; -#ifdef PNG_FREE_ME_SUPPORTED - info_ptr->free_me |= PNG_FREE_PCAL; -#endif -} -#endif - -#if defined(PNG_READ_sCAL_SUPPORTED) || defined(PNG_WRITE_sCAL_SUPPORTED) -#ifdef PNG_FLOATING_POINT_SUPPORTED -void PNGAPI -png_set_sCAL(png_structp png_ptr, png_infop info_ptr, - int unit, double width, double height) -{ - png_debug1(1, "in %s storage function", "sCAL"); - if (png_ptr == NULL || info_ptr == NULL) - return; - - info_ptr->scal_unit = (png_byte)unit; - info_ptr->scal_pixel_width = width; - info_ptr->scal_pixel_height = height; - - info_ptr->valid |= PNG_INFO_sCAL; -} -#else -#ifdef PNG_FIXED_POINT_SUPPORTED -void PNGAPI -png_set_sCAL_s(png_structp png_ptr, png_infop info_ptr, - int unit, png_charp swidth, png_charp sheight) -{ - png_uint_32 length; - - png_debug1(1, "in %s storage function", "sCAL"); - if (png_ptr == NULL || info_ptr == NULL) - return; - - info_ptr->scal_unit = (png_byte)unit; - - length = png_strlen(swidth) + 1; - png_debug1(3, "allocating unit for info (%u bytes)", - (unsigned int)length); - info_ptr->scal_s_width = (png_charp)png_malloc_warn(png_ptr, length); - if (info_ptr->scal_s_width == NULL) - { - png_warning(png_ptr, - "Memory allocation failed while processing sCAL."); - return; - } - png_memcpy(info_ptr->scal_s_width, swidth, (png_size_t)length); - - length = png_strlen(sheight) + 1; - png_debug1(3, "allocating unit for info (%u bytes)", - (unsigned int)length); - info_ptr->scal_s_height = (png_charp)png_malloc_warn(png_ptr, length); - if (info_ptr->scal_s_height == NULL) - { - png_free (png_ptr, info_ptr->scal_s_width); - info_ptr->scal_s_width = NULL; - png_warning(png_ptr, - "Memory allocation failed while processing sCAL."); - return; - } - png_memcpy(info_ptr->scal_s_height, sheight, (png_size_t)length); - info_ptr->valid |= PNG_INFO_sCAL; -#ifdef PNG_FREE_ME_SUPPORTED - info_ptr->free_me |= PNG_FREE_SCAL; -#endif -} -#endif -#endif -#endif - -#if defined(PNG_pHYs_SUPPORTED) -void PNGAPI -png_set_pHYs(png_structp png_ptr, png_infop info_ptr, - png_uint_32 res_x, png_uint_32 res_y, int unit_type) -{ - png_debug1(1, "in %s storage function", "pHYs"); - if (png_ptr == NULL || info_ptr == NULL) - return; - - info_ptr->x_pixels_per_unit = res_x; - info_ptr->y_pixels_per_unit = res_y; - info_ptr->phys_unit_type = (png_byte)unit_type; - info_ptr->valid |= PNG_INFO_pHYs; -} -#endif - -void PNGAPI -png_set_PLTE(png_structp png_ptr, png_infop info_ptr, - png_colorp palette, int num_palette) -{ - - png_debug1(1, "in %s storage function", "PLTE"); - if (png_ptr == NULL || info_ptr == NULL) - return; - - if (num_palette < 0 || num_palette > PNG_MAX_PALETTE_LENGTH) - { - if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - png_error(png_ptr, "Invalid palette length"); - else - { - png_warning(png_ptr, "Invalid palette length"); - return; - } - } - - /* - * It may not actually be necessary to set png_ptr->palette here; - * we do it for backward compatibility with the way the png_handle_tRNS - * function used to do the allocation. - */ -#ifdef PNG_FREE_ME_SUPPORTED - png_free_data(png_ptr, info_ptr, PNG_FREE_PLTE, 0); -#endif - - /* Changed in libpng-1.2.1 to allocate PNG_MAX_PALETTE_LENGTH instead - * of num_palette entries, in case of an invalid PNG file that has - * too-large sample values. - */ - png_ptr->palette = (png_colorp)png_malloc(png_ptr, - PNG_MAX_PALETTE_LENGTH * png_sizeof(png_color)); - png_memset(png_ptr->palette, 0, PNG_MAX_PALETTE_LENGTH * - png_sizeof(png_color)); - png_memcpy(png_ptr->palette, palette, num_palette * png_sizeof(png_color)); - info_ptr->palette = png_ptr->palette; - info_ptr->num_palette = png_ptr->num_palette = (png_uint_16)num_palette; - -#ifdef PNG_FREE_ME_SUPPORTED - info_ptr->free_me |= PNG_FREE_PLTE; -#else - png_ptr->flags |= PNG_FLAG_FREE_PLTE; -#endif - - info_ptr->valid |= PNG_INFO_PLTE; -} - -#if defined(PNG_sBIT_SUPPORTED) -void PNGAPI -png_set_sBIT(png_structp png_ptr, png_infop info_ptr, - png_color_8p sig_bit) -{ - png_debug1(1, "in %s storage function", "sBIT"); - if (png_ptr == NULL || info_ptr == NULL) - return; - - png_memcpy(&(info_ptr->sig_bit), sig_bit, png_sizeof(png_color_8)); - info_ptr->valid |= PNG_INFO_sBIT; -} -#endif - -#if defined(PNG_sRGB_SUPPORTED) -void PNGAPI -png_set_sRGB(png_structp png_ptr, png_infop info_ptr, int intent) -{ - png_debug1(1, "in %s storage function", "sRGB"); - if (png_ptr == NULL || info_ptr == NULL) - return; - - info_ptr->srgb_intent = (png_byte)intent; - info_ptr->valid |= PNG_INFO_sRGB; -} - -void PNGAPI -png_set_sRGB_gAMA_and_cHRM(png_structp png_ptr, png_infop info_ptr, - int intent) -{ -#if defined(PNG_gAMA_SUPPORTED) -#ifdef PNG_FLOATING_POINT_SUPPORTED - float file_gamma; -#endif -#ifdef PNG_FIXED_POINT_SUPPORTED - png_fixed_point int_file_gamma; -#endif -#endif -#if defined(PNG_cHRM_SUPPORTED) -#ifdef PNG_FLOATING_POINT_SUPPORTED - float white_x, white_y, red_x, red_y, green_x, green_y, blue_x, blue_y; -#endif - png_fixed_point int_white_x, int_white_y, int_red_x, int_red_y, int_green_x, - int_green_y, int_blue_x, int_blue_y; -#endif - png_debug1(1, "in %s storage function", "sRGB_gAMA_and_cHRM"); - if (png_ptr == NULL || info_ptr == NULL) - return; - - png_set_sRGB(png_ptr, info_ptr, intent); - -#if defined(PNG_gAMA_SUPPORTED) -#ifdef PNG_FLOATING_POINT_SUPPORTED - file_gamma = (float).45455; - png_set_gAMA(png_ptr, info_ptr, file_gamma); -#endif -#ifdef PNG_FIXED_POINT_SUPPORTED - int_file_gamma = 45455L; - png_set_gAMA_fixed(png_ptr, info_ptr, int_file_gamma); -#endif -#endif - -#if defined(PNG_cHRM_SUPPORTED) - int_white_x = 31270L; - int_white_y = 32900L; - int_red_x = 64000L; - int_red_y = 33000L; - int_green_x = 30000L; - int_green_y = 60000L; - int_blue_x = 15000L; - int_blue_y = 6000L; - -#ifdef PNG_FLOATING_POINT_SUPPORTED - white_x = (float).3127; - white_y = (float).3290; - red_x = (float).64; - red_y = (float).33; - green_x = (float).30; - green_y = (float).60; - blue_x = (float).15; - blue_y = (float).06; -#endif - -#if !defined(PNG_NO_CHECK_cHRM) - if (png_check_cHRM_fixed(png_ptr, - int_white_x, int_white_y, int_red_x, int_red_y, int_green_x, - int_green_y, int_blue_x, int_blue_y)) -#endif - { -#ifdef PNG_FIXED_POINT_SUPPORTED - png_set_cHRM_fixed(png_ptr, info_ptr, - int_white_x, int_white_y, int_red_x, int_red_y, int_green_x, - int_green_y, int_blue_x, int_blue_y); -#endif -#ifdef PNG_FLOATING_POINT_SUPPORTED - png_set_cHRM(png_ptr, info_ptr, - white_x, white_y, red_x, red_y, green_x, green_y, blue_x, blue_y); -#endif - } -#endif /* cHRM */ -} -#endif /* sRGB */ - - -#if defined(PNG_iCCP_SUPPORTED) -void PNGAPI -png_set_iCCP(png_structp png_ptr, png_infop info_ptr, - png_charp name, int compression_type, - png_charp profile, png_uint_32 proflen) -{ - png_charp new_iccp_name; - png_charp new_iccp_profile; - png_uint_32 length; - - png_debug1(1, "in %s storage function", "iCCP"); - if (png_ptr == NULL || info_ptr == NULL || name == NULL || profile == NULL) - return; - - length = png_strlen(name)+1; - new_iccp_name = (png_charp)png_malloc_warn(png_ptr, length); - if (new_iccp_name == NULL) - { - png_warning(png_ptr, "Insufficient memory to process iCCP chunk."); - return; - } - png_memcpy(new_iccp_name, name, length); - new_iccp_profile = (png_charp)png_malloc_warn(png_ptr, proflen); - if (new_iccp_profile == NULL) - { - png_free (png_ptr, new_iccp_name); - png_warning(png_ptr, - "Insufficient memory to process iCCP profile."); - return; - } - png_memcpy(new_iccp_profile, profile, (png_size_t)proflen); - - png_free_data(png_ptr, info_ptr, PNG_FREE_ICCP, 0); - - info_ptr->iccp_proflen = proflen; - info_ptr->iccp_name = new_iccp_name; - info_ptr->iccp_profile = new_iccp_profile; - /* Compression is always zero but is here so the API and info structure - * does not have to change if we introduce multiple compression types */ - info_ptr->iccp_compression = (png_byte)compression_type; -#ifdef PNG_FREE_ME_SUPPORTED - info_ptr->free_me |= PNG_FREE_ICCP; -#endif - info_ptr->valid |= PNG_INFO_iCCP; -} -#endif - -#if defined(PNG_TEXT_SUPPORTED) -void PNGAPI -png_set_text(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr, - int num_text) -{ - int ret; - ret = png_set_text_2(png_ptr, info_ptr, text_ptr, num_text); - if (ret) - png_error(png_ptr, "Insufficient memory to store text"); -} - -int /* PRIVATE */ -png_set_text_2(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr, - int num_text) -{ - int i; - - png_debug1(1, "in %s storage function", (png_ptr->chunk_name[0] == '\0' ? - "text" : (png_const_charp)png_ptr->chunk_name)); - - if (png_ptr == NULL || info_ptr == NULL || num_text == 0) - return(0); - - /* Make sure we have enough space in the "text" array in info_struct - * to hold all of the incoming text_ptr objects. - */ - if (info_ptr->num_text + num_text > info_ptr->max_text) - { - if (info_ptr->text != NULL) - { - png_textp old_text; - int old_max; - - old_max = info_ptr->max_text; - info_ptr->max_text = info_ptr->num_text + num_text + 8; - old_text = info_ptr->text; - info_ptr->text = (png_textp)png_malloc_warn(png_ptr, - (png_uint_32)(info_ptr->max_text * png_sizeof(png_text))); - if (info_ptr->text == NULL) - { - png_free(png_ptr, old_text); - return(1); - } - png_memcpy(info_ptr->text, old_text, (png_size_t)(old_max * - png_sizeof(png_text))); - png_free(png_ptr, old_text); - } - else - { - info_ptr->max_text = num_text + 8; - info_ptr->num_text = 0; - info_ptr->text = (png_textp)png_malloc_warn(png_ptr, - (png_uint_32)(info_ptr->max_text * png_sizeof(png_text))); - if (info_ptr->text == NULL) - return(1); -#ifdef PNG_FREE_ME_SUPPORTED - info_ptr->free_me |= PNG_FREE_TEXT; -#endif - } - png_debug1(3, "allocated %d entries for info_ptr->text", - info_ptr->max_text); - } - for (i = 0; i < num_text; i++) - { - png_size_t text_length, key_len; - png_size_t lang_len, lang_key_len; - png_textp textp = &(info_ptr->text[info_ptr->num_text]); - - if (text_ptr[i].key == NULL) - continue; - - key_len = png_strlen(text_ptr[i].key); - - if (text_ptr[i].compression <= 0) - { - lang_len = 0; - lang_key_len = 0; - } - else -#ifdef PNG_iTXt_SUPPORTED - { - /* Set iTXt data */ - if (text_ptr[i].lang != NULL) - lang_len = png_strlen(text_ptr[i].lang); - else - lang_len = 0; - if (text_ptr[i].lang_key != NULL) - lang_key_len = png_strlen(text_ptr[i].lang_key); - else - lang_key_len = 0; - } -#else - { - png_warning(png_ptr, "iTXt chunk not supported."); - continue; - } -#endif - - if (text_ptr[i].text == NULL || text_ptr[i].text[0] == '\0') - { - text_length = 0; -#ifdef PNG_iTXt_SUPPORTED - if (text_ptr[i].compression > 0) - textp->compression = PNG_ITXT_COMPRESSION_NONE; - else -#endif - textp->compression = PNG_TEXT_COMPRESSION_NONE; - } - else - { - text_length = png_strlen(text_ptr[i].text); - textp->compression = text_ptr[i].compression; - } - - textp->key = (png_charp)png_malloc_warn(png_ptr, - (png_uint_32) - (key_len + text_length + lang_len + lang_key_len + 4)); - if (textp->key == NULL) - return(1); - png_debug2(2, "Allocated %lu bytes at %x in png_set_text", - (png_uint_32) - (key_len + lang_len + lang_key_len + text_length + 4), - (int)textp->key); - - png_memcpy(textp->key, text_ptr[i].key,(png_size_t)(key_len)); - *(textp->key + key_len) = '\0'; -#ifdef PNG_iTXt_SUPPORTED - if (text_ptr[i].compression > 0) - { - textp->lang = textp->key + key_len + 1; - png_memcpy(textp->lang, text_ptr[i].lang, lang_len); - *(textp->lang + lang_len) = '\0'; - textp->lang_key = textp->lang + lang_len + 1; - png_memcpy(textp->lang_key, text_ptr[i].lang_key, lang_key_len); - *(textp->lang_key + lang_key_len) = '\0'; - textp->text = textp->lang_key + lang_key_len + 1; - } - else -#endif - { -#ifdef PNG_iTXt_SUPPORTED - textp->lang=NULL; - textp->lang_key=NULL; -#endif - textp->text = textp->key + key_len + 1; - } - if (text_length) - png_memcpy(textp->text, text_ptr[i].text, - (png_size_t)(text_length)); - *(textp->text + text_length) = '\0'; - -#ifdef PNG_iTXt_SUPPORTED - if (textp->compression > 0) - { - textp->text_length = 0; - textp->itxt_length = text_length; - } - else -#endif - { - textp->text_length = text_length; -#ifdef PNG_iTXt_SUPPORTED - textp->itxt_length = 0; -#endif - } - info_ptr->num_text++; - png_debug1(3, "transferred text chunk %d", info_ptr->num_text); - } - return(0); -} -#endif - -#if defined(PNG_tIME_SUPPORTED) -void PNGAPI -png_set_tIME(png_structp png_ptr, png_infop info_ptr, png_timep mod_time) -{ - png_debug1(1, "in %s storage function", "tIME"); - if (png_ptr == NULL || info_ptr == NULL || - (png_ptr->mode & PNG_WROTE_tIME)) - return; - - png_memcpy(&(info_ptr->mod_time), mod_time, png_sizeof(png_time)); - info_ptr->valid |= PNG_INFO_tIME; -} -#endif - -#if defined(PNG_tRNS_SUPPORTED) -void PNGAPI -png_set_tRNS(png_structp png_ptr, png_infop info_ptr, - png_bytep trans, int num_trans, png_color_16p trans_values) -{ - png_debug1(1, "in %s storage function", "tRNS"); - if (png_ptr == NULL || info_ptr == NULL) - return; - - if (trans != NULL) - { - /* - * It may not actually be necessary to set png_ptr->trans here; - * we do it for backward compatibility with the way the png_handle_tRNS - * function used to do the allocation. - */ - -#ifdef PNG_FREE_ME_SUPPORTED - png_free_data(png_ptr, info_ptr, PNG_FREE_TRNS, 0); -#endif - - /* Changed from num_trans to PNG_MAX_PALETTE_LENGTH in version 1.2.1 */ - png_ptr->trans = info_ptr->trans = (png_bytep)png_malloc(png_ptr, - (png_uint_32)PNG_MAX_PALETTE_LENGTH); - if (num_trans > 0 && num_trans <= PNG_MAX_PALETTE_LENGTH) - png_memcpy(info_ptr->trans, trans, (png_size_t)num_trans); - } - - if (trans_values != NULL) - { - int sample_max = (1 << info_ptr->bit_depth); - if ((info_ptr->color_type == PNG_COLOR_TYPE_GRAY && - (int)trans_values->gray > sample_max) || - (info_ptr->color_type == PNG_COLOR_TYPE_RGB && - ((int)trans_values->red > sample_max || - (int)trans_values->green > sample_max || - (int)trans_values->blue > sample_max))) - png_warning(png_ptr, - "tRNS chunk has out-of-range samples for bit_depth"); - png_memcpy(&(info_ptr->trans_values), trans_values, - png_sizeof(png_color_16)); - if (num_trans == 0) - num_trans = 1; - } - - info_ptr->num_trans = (png_uint_16)num_trans; - if (num_trans != 0) - { - info_ptr->valid |= PNG_INFO_tRNS; -#ifdef PNG_FREE_ME_SUPPORTED - info_ptr->free_me |= PNG_FREE_TRNS; -#else - png_ptr->flags |= PNG_FLAG_FREE_TRNS; -#endif - } -} -#endif - -#if defined(PNG_sPLT_SUPPORTED) -void PNGAPI -png_set_sPLT(png_structp png_ptr, - png_infop info_ptr, png_sPLT_tp entries, int nentries) -/* - * entries - array of png_sPLT_t structures - * to be added to the list of palettes - * in the info structure. - * nentries - number of palette structures to be - * added. - */ -{ - png_sPLT_tp np; - int i; - - if (png_ptr == NULL || info_ptr == NULL) - return; - - np = (png_sPLT_tp)png_malloc_warn(png_ptr, - (info_ptr->splt_palettes_num + nentries) * - (png_uint_32)png_sizeof(png_sPLT_t)); - if (np == NULL) - { - png_warning(png_ptr, "No memory for sPLT palettes."); - return; - } - - png_memcpy(np, info_ptr->splt_palettes, - info_ptr->splt_palettes_num * png_sizeof(png_sPLT_t)); - png_free(png_ptr, info_ptr->splt_palettes); - info_ptr->splt_palettes=NULL; - - for (i = 0; i < nentries; i++) - { - png_sPLT_tp to = np + info_ptr->splt_palettes_num + i; - png_sPLT_tp from = entries + i; - png_uint_32 length; - - length = png_strlen(from->name) + 1; - to->name = (png_charp)png_malloc_warn(png_ptr, length); - if (to->name == NULL) - { - png_warning(png_ptr, - "Out of memory while processing sPLT chunk"); - continue; - } - png_memcpy(to->name, from->name, length); - to->entries = (png_sPLT_entryp)png_malloc_warn(png_ptr, - (png_uint_32)(from->nentries * png_sizeof(png_sPLT_entry))); - if (to->entries == NULL) - { - png_warning(png_ptr, - "Out of memory while processing sPLT chunk"); - png_free(png_ptr, to->name); - to->name = NULL; - continue; - } - png_memcpy(to->entries, from->entries, - from->nentries * png_sizeof(png_sPLT_entry)); - to->nentries = from->nentries; - to->depth = from->depth; - } - - info_ptr->splt_palettes = np; - info_ptr->splt_palettes_num += nentries; - info_ptr->valid |= PNG_INFO_sPLT; -#ifdef PNG_FREE_ME_SUPPORTED - info_ptr->free_me |= PNG_FREE_SPLT; -#endif -} -#endif /* PNG_sPLT_SUPPORTED */ - -#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) -void PNGAPI -png_set_unknown_chunks(png_structp png_ptr, - png_infop info_ptr, png_unknown_chunkp unknowns, int num_unknowns) -{ - png_unknown_chunkp np; - int i; - - if (png_ptr == NULL || info_ptr == NULL || num_unknowns == 0) - return; - - np = (png_unknown_chunkp)png_malloc_warn(png_ptr, - (png_uint_32)((info_ptr->unknown_chunks_num + num_unknowns) * - png_sizeof(png_unknown_chunk))); - if (np == NULL) - { - png_warning(png_ptr, - "Out of memory while processing unknown chunk."); - return; - } - - png_memcpy(np, info_ptr->unknown_chunks, - info_ptr->unknown_chunks_num * png_sizeof(png_unknown_chunk)); - png_free(png_ptr, info_ptr->unknown_chunks); - info_ptr->unknown_chunks=NULL; - - for (i = 0; i < num_unknowns; i++) - { - png_unknown_chunkp to = np + info_ptr->unknown_chunks_num + i; - png_unknown_chunkp from = unknowns + i; - - png_memcpy((png_charp)to->name, - (png_charp)from->name, - png_sizeof(from->name)); - to->name[png_sizeof(to->name)-1] = '\0'; - to->size = from->size; - /* Note our location in the read or write sequence */ - to->location = (png_byte)(png_ptr->mode & 0xff); - - if (from->size == 0) - to->data=NULL; - else - { - to->data = (png_bytep)png_malloc_warn(png_ptr, - (png_uint_32)from->size); - if (to->data == NULL) - { - png_warning(png_ptr, - "Out of memory while processing unknown chunk."); - to->size = 0; - } - else - png_memcpy(to->data, from->data, from->size); - } - } - - info_ptr->unknown_chunks = np; - info_ptr->unknown_chunks_num += num_unknowns; -#ifdef PNG_FREE_ME_SUPPORTED - info_ptr->free_me |= PNG_FREE_UNKN; -#endif -} -void PNGAPI -png_set_unknown_chunk_location(png_structp png_ptr, png_infop info_ptr, - int chunk, int location) -{ - if (png_ptr != NULL && info_ptr != NULL && chunk >= 0 && chunk < - (int)info_ptr->unknown_chunks_num) - info_ptr->unknown_chunks[chunk].location = (png_byte)location; -} -#endif - -#if defined(PNG_1_0_X) || defined(PNG_1_2_X) -#if defined(PNG_READ_EMPTY_PLTE_SUPPORTED) || \ - defined(PNG_WRITE_EMPTY_PLTE_SUPPORTED) -void PNGAPI -png_permit_empty_plte (png_structp png_ptr, int empty_plte_permitted) -{ - /* This function is deprecated in favor of png_permit_mng_features() - and will be removed from libpng-1.3.0 */ - png_debug(1, "in png_permit_empty_plte, DEPRECATED."); - if (png_ptr == NULL) - return; - png_ptr->mng_features_permitted = (png_byte) - ((png_ptr->mng_features_permitted & (~PNG_FLAG_MNG_EMPTY_PLTE)) | - ((empty_plte_permitted & PNG_FLAG_MNG_EMPTY_PLTE))); -} -#endif -#endif - -#if defined(PNG_MNG_FEATURES_SUPPORTED) -png_uint_32 PNGAPI -png_permit_mng_features (png_structp png_ptr, png_uint_32 mng_features) -{ - png_debug(1, "in png_permit_mng_features"); - if (png_ptr == NULL) - return (png_uint_32)0; - png_ptr->mng_features_permitted = - (png_byte)(mng_features & PNG_ALL_MNG_FEATURES); - return (png_uint_32)png_ptr->mng_features_permitted; -} -#endif - -#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) -void PNGAPI -png_set_keep_unknown_chunks(png_structp png_ptr, int keep, png_bytep - chunk_list, int num_chunks) -{ - png_bytep new_list, p; - int i, old_num_chunks; - if (png_ptr == NULL) - return; - if (num_chunks == 0) - { - if (keep == PNG_HANDLE_CHUNK_ALWAYS || keep == PNG_HANDLE_CHUNK_IF_SAFE) - png_ptr->flags |= PNG_FLAG_KEEP_UNKNOWN_CHUNKS; - else - png_ptr->flags &= ~PNG_FLAG_KEEP_UNKNOWN_CHUNKS; - - if (keep == PNG_HANDLE_CHUNK_ALWAYS) - png_ptr->flags |= PNG_FLAG_KEEP_UNSAFE_CHUNKS; - else - png_ptr->flags &= ~PNG_FLAG_KEEP_UNSAFE_CHUNKS; - return; - } - if (chunk_list == NULL) - return; - old_num_chunks = png_ptr->num_chunk_list; - new_list=(png_bytep)png_malloc(png_ptr, - (png_uint_32) - (5*(num_chunks + old_num_chunks))); - if (png_ptr->chunk_list != NULL) - { - png_memcpy(new_list, png_ptr->chunk_list, - (png_size_t)(5*old_num_chunks)); - png_free(png_ptr, png_ptr->chunk_list); - png_ptr->chunk_list=NULL; - } - png_memcpy(new_list + 5*old_num_chunks, chunk_list, - (png_size_t)(5*num_chunks)); - for (p = new_list + 5*old_num_chunks + 4, i = 0; inum_chunk_list = old_num_chunks + num_chunks; - png_ptr->chunk_list = new_list; -#ifdef PNG_FREE_ME_SUPPORTED - png_ptr->free_me |= PNG_FREE_LIST; -#endif -} -#endif - -#if defined(PNG_READ_USER_CHUNKS_SUPPORTED) -void PNGAPI -png_set_read_user_chunk_fn(png_structp png_ptr, png_voidp user_chunk_ptr, - png_user_chunk_ptr read_user_chunk_fn) -{ - png_debug(1, "in png_set_read_user_chunk_fn"); - if (png_ptr == NULL) - return; - png_ptr->read_user_chunk_fn = read_user_chunk_fn; - png_ptr->user_chunk_ptr = user_chunk_ptr; -} -#endif - -#if defined(PNG_INFO_IMAGE_SUPPORTED) -void PNGAPI -png_set_rows(png_structp png_ptr, png_infop info_ptr, png_bytepp row_pointers) -{ - png_debug1(1, "in %s storage function", "rows"); - - if (png_ptr == NULL || info_ptr == NULL) - return; - - if (info_ptr->row_pointers && (info_ptr->row_pointers != row_pointers)) - png_free_data(png_ptr, info_ptr, PNG_FREE_ROWS, 0); - info_ptr->row_pointers = row_pointers; - if (row_pointers) - info_ptr->valid |= PNG_INFO_IDAT; -} -#endif - -#ifdef PNG_WRITE_SUPPORTED -void PNGAPI -png_set_compression_buffer_size(png_structp png_ptr, - png_uint_32 size) -{ - if (png_ptr == NULL) - return; - png_free(png_ptr, png_ptr->zbuf); - png_ptr->zbuf_size = (png_size_t)size; - png_ptr->zbuf = (png_bytep)png_malloc(png_ptr, size); - png_ptr->zstream.next_out = png_ptr->zbuf; - png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; -} -#endif - -void PNGAPI -png_set_invalid(png_structp png_ptr, png_infop info_ptr, int mask) -{ - if (png_ptr && info_ptr) - info_ptr->valid &= ~mask; -} - - -#ifndef PNG_1_0_X -#ifdef PNG_ASSEMBLER_CODE_SUPPORTED -/* Function was added to libpng 1.2.0 and should always exist by default */ -void PNGAPI -png_set_asm_flags (png_structp png_ptr, png_uint_32 asm_flags) -{ -/* Obsolete as of libpng-1.2.20 and will be removed from libpng-1.4.0 */ - if (png_ptr != NULL) - png_ptr->asm_flags = 0; - asm_flags = asm_flags; /* Quiet the compiler */ -} - -/* This function was added to libpng 1.2.0 */ -void PNGAPI -png_set_mmx_thresholds (png_structp png_ptr, - png_byte mmx_bitdepth_threshold, - png_uint_32 mmx_rowbytes_threshold) -{ -/* Obsolete as of libpng-1.2.20 and will be removed from libpng-1.4.0 */ - if (png_ptr == NULL) - return; - /* Quiet the compiler */ - mmx_bitdepth_threshold = mmx_bitdepth_threshold; - mmx_rowbytes_threshold = mmx_rowbytes_threshold; -} -#endif /* ?PNG_ASSEMBLER_CODE_SUPPORTED */ - -#ifdef PNG_SET_USER_LIMITS_SUPPORTED -/* This function was added to libpng 1.2.6 */ -void PNGAPI -png_set_user_limits (png_structp png_ptr, png_uint_32 user_width_max, - png_uint_32 user_height_max) -{ - /* Images with dimensions larger than these limits will be - * rejected by png_set_IHDR(). To accept any PNG datastream - * regardless of dimensions, set both limits to 0x7ffffffL. - */ - if (png_ptr == NULL) - return; - png_ptr->user_width_max = user_width_max; - png_ptr->user_height_max = user_height_max; -} -#endif /* ?PNG_SET_USER_LIMITS_SUPPORTED */ - -#endif /* ?PNG_1_0_X */ -#endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */ diff --git a/src/libpng/pngtest.c b/src/libpng/pngtest.c deleted file mode 100644 index 39e881d27..000000000 --- a/src/libpng/pngtest.c +++ /dev/null @@ -1,1689 +0,0 @@ - -/* pngtest.c - a simple test program to test libpng - * - * Last changed in libpng 1.2.37 [June 4, 2009] - * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2009 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - * - * This program reads in a PNG image, writes it out again, and then - * compares the two files. If the files are identical, this shows that - * the basic chunk handling, filtering, and (de)compression code is working - * properly. It does not currently test all of the transforms, although - * it probably should. - * - * The program will report "FAIL" in certain legitimate cases: - * 1) when the compression level or filter selection method is changed. - * 2) when the maximum IDAT size (PNG_ZBUF_SIZE in pngconf.h) is not 8192. - * 3) unknown unsafe-to-copy ancillary chunks or unknown critical chunks - * exist in the input file. - * 4) others not listed here... - * In these cases, it is best to check with another tool such as "pngcheck" - * to see what the differences between the two files are. - * - * If a filename is given on the command-line, then this file is used - * for the input, rather than the default "pngtest.png". This allows - * testing a wide variety of files easily. You can also test a number - * of files at once by typing "pngtest -m file1.png file2.png ..." - */ - -#include "png.h" - -#if defined(_WIN32_WCE) -# if _WIN32_WCE < 211 - __error__ (f|w)printf functions are not supported on old WindowsCE.; -# endif -# include -# include -# define READFILE(file, data, length, check) \ - if (ReadFile(file, data, length, &check, NULL)) check = 0 -# define WRITEFILE(file, data, length, check)) \ - if (WriteFile(file, data, length, &check, NULL)) check = 0 -# define FCLOSE(file) CloseHandle(file) -#else -# include -# include -# define READFILE(file, data, length, check) \ - check=(png_size_t)fread(data, (png_size_t)1, length, file) -# define WRITEFILE(file, data, length, check) \ - check=(png_size_t)fwrite(data, (png_size_t)1, length, file) -# define FCLOSE(file) fclose(file) -#endif - -#if defined(PNG_NO_STDIO) -# if defined(_WIN32_WCE) - typedef HANDLE png_FILE_p; -# else - typedef FILE * png_FILE_p; -# endif -#endif - -/* Makes pngtest verbose so we can find problems (needs to be before png.h) */ -#ifndef PNG_DEBUG -# define PNG_DEBUG 0 -#endif - -#if !PNG_DEBUG -# define SINGLE_ROWBUF_ALLOC /* Makes buffer overruns easier to nail */ -#endif - -/* Turn on CPU timing -#define PNGTEST_TIMING -*/ - -#ifdef PNG_NO_FLOATING_POINT_SUPPORTED -#undef PNGTEST_TIMING -#endif - -#ifdef PNGTEST_TIMING -static float t_start, t_stop, t_decode, t_encode, t_misc; -#include -#endif - -#if defined(PNG_TIME_RFC1123_SUPPORTED) -#define PNG_tIME_STRING_LENGTH 29 -static int tIME_chunk_present = 0; -static char tIME_string[PNG_tIME_STRING_LENGTH] = "tIME chunk is not present"; -#endif - -static int verbose = 0; - -int test_one_file PNGARG((PNG_CONST char *inname, PNG_CONST char *outname)); - -#ifdef __TURBOC__ -#include -#endif - -/* Defined so I can write to a file on gui/windowing platforms */ -/* #define STDERR stderr */ -#define STDERR stdout /* For DOS */ - -/* In case a system header (e.g., on AIX) defined jmpbuf */ -#ifdef jmpbuf -# undef jmpbuf -#endif - -/* Define png_jmpbuf() in case we are using a pre-1.0.6 version of libpng */ -#ifndef png_jmpbuf -# define png_jmpbuf(png_ptr) png_ptr->jmpbuf -#endif - -/* Example of using row callbacks to make a simple progress meter */ -static int status_pass = 1; -static int status_dots_requested = 0; -static int status_dots = 1; - -void -#ifdef PNG_1_0_X -PNGAPI -#endif -read_row_callback(png_structp png_ptr, png_uint_32 row_number, int pass); -void -#ifdef PNG_1_0_X -PNGAPI -#endif -read_row_callback(png_structp png_ptr, png_uint_32 row_number, int pass) -{ - if (png_ptr == NULL || row_number > PNG_UINT_31_MAX) - return; - if (status_pass != pass) - { - fprintf(stdout, "\n Pass %d: ", pass); - status_pass = pass; - status_dots = 31; - } - status_dots--; - if (status_dots == 0) - { - fprintf(stdout, "\n "); - status_dots=30; - } - fprintf(stdout, "r"); -} - -void -#ifdef PNG_1_0_X -PNGAPI -#endif -write_row_callback(png_structp png_ptr, png_uint_32 row_number, int pass); -void -#ifdef PNG_1_0_X -PNGAPI -#endif -write_row_callback(png_structp png_ptr, png_uint_32 row_number, int pass) -{ - if (png_ptr == NULL || row_number > PNG_UINT_31_MAX || pass > 7) - return; - fprintf(stdout, "w"); -} - - -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) -/* Example of using user transform callback (we don't transform anything, - * but merely examine the row filters. We set this to 256 rather than - * 5 in case illegal filter values are present.) - */ -static png_uint_32 filters_used[256]; -void -#ifdef PNG_1_0_X -PNGAPI -#endif -count_filters(png_structp png_ptr, png_row_infop row_info, png_bytep data); -void -#ifdef PNG_1_0_X -PNGAPI -#endif -count_filters(png_structp png_ptr, png_row_infop row_info, png_bytep data) -{ - if (png_ptr != NULL && row_info != NULL) - ++filters_used[*(data - 1)]; -} -#endif - -#if defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) -/* Example of using user transform callback (we don't transform anything, - * but merely count the zero samples) - */ - -static png_uint_32 zero_samples; - -void -#ifdef PNG_1_0_X -PNGAPI -#endif -count_zero_samples(png_structp png_ptr, png_row_infop row_info, png_bytep data); -void -#ifdef PNG_1_0_X -PNGAPI -#endif -count_zero_samples(png_structp png_ptr, png_row_infop row_info, png_bytep data) -{ - png_bytep dp = data; - if (png_ptr == NULL)return; - - /* Contents of row_info: - * png_uint_32 width width of row - * png_uint_32 rowbytes number of bytes in row - * png_byte color_type color type of pixels - * png_byte bit_depth bit depth of samples - * png_byte channels number of channels (1-4) - * png_byte pixel_depth bits per pixel (depth*channels) - */ - - /* Counts the number of zero samples (or zero pixels if color_type is 3 */ - - if (row_info->color_type == 0 || row_info->color_type == 3) - { - int pos = 0; - png_uint_32 n, nstop; - for (n = 0, nstop=row_info->width; nbit_depth == 1) - { - if (((*dp << pos++ ) & 0x80) == 0) - zero_samples++; - if (pos == 8) - { - pos = 0; - dp++; - } - } - if (row_info->bit_depth == 2) - { - if (((*dp << (pos+=2)) & 0xc0) == 0) - zero_samples++; - if (pos == 8) - { - pos = 0; - dp++; - } - } - if (row_info->bit_depth == 4) - { - if (((*dp << (pos+=4)) & 0xf0) == 0) - zero_samples++; - if (pos == 8) - { - pos = 0; - dp++; - } - } - if (row_info->bit_depth == 8) - if (*dp++ == 0) - zero_samples++; - if (row_info->bit_depth == 16) - { - if ((*dp | *(dp+1)) == 0) - zero_samples++; - dp+=2; - } - } - } - else /* Other color types */ - { - png_uint_32 n, nstop; - int channel; - int color_channels = row_info->channels; - if (row_info->color_type > 3)color_channels--; - - for (n = 0, nstop=row_info->width; nbit_depth == 8) - if (*dp++ == 0) - zero_samples++; - if (row_info->bit_depth == 16) - { - if ((*dp | *(dp+1)) == 0) - zero_samples++; - dp+=2; - } - } - if (row_info->color_type > 3) - { - dp++; - if (row_info->bit_depth == 16) - dp++; - } - } - } -} -#endif /* PNG_WRITE_USER_TRANSFORM_SUPPORTED */ - -static int wrote_question = 0; - -#if defined(PNG_NO_STDIO) -/* START of code to validate stdio-free compilation */ -/* These copies of the default read/write functions come from pngrio.c and - * pngwio.c. They allow "don't include stdio" testing of the library. - * This is the function that does the actual reading of data. If you are - * not reading from a standard C stream, you should create a replacement - * read_data function and use it at run time with png_set_read_fn(), rather - * than changing the library. - */ - -#ifndef USE_FAR_KEYWORD -static void -pngtest_read_data(png_structp png_ptr, png_bytep data, png_size_t length) -{ - png_size_t check; - - /* fread() returns 0 on error, so it is OK to store this in a png_size_t - * instead of an int, which is what fread() actually returns. - */ - READFILE((png_FILE_p)png_ptr->io_ptr, data, length, check); - - if (check != length) - { - png_error(png_ptr, "Read Error!"); - } -} -#else -/* This is the model-independent version. Since the standard I/O library - can't handle far buffers in the medium and small models, we have to copy - the data. -*/ - -#define NEAR_BUF_SIZE 1024 -#define MIN(a,b) (a <= b ? a : b) - -static void -pngtest_read_data(png_structp png_ptr, png_bytep data, png_size_t length) -{ - int check; - png_byte *n_data; - png_FILE_p io_ptr; - - /* Check if data really is near. If so, use usual code. */ - n_data = (png_byte *)CVT_PTR_NOCHECK(data); - io_ptr = (png_FILE_p)CVT_PTR(png_ptr->io_ptr); - if ((png_bytep)n_data == data) - { - READFILE(io_ptr, n_data, length, check); - } - else - { - png_byte buf[NEAR_BUF_SIZE]; - png_size_t read, remaining, err; - check = 0; - remaining = length; - do - { - read = MIN(NEAR_BUF_SIZE, remaining); - READFILE(io_ptr, buf, 1, err); - png_memcpy(data, buf, read); /* Copy far buffer to near buffer */ - if (err != read) - break; - else - check += err; - data += read; - remaining -= read; - } - while (remaining != 0); - } - if (check != length) - png_error(png_ptr, "read Error"); -} -#endif /* USE_FAR_KEYWORD */ - -#if defined(PNG_WRITE_FLUSH_SUPPORTED) -static void -pngtest_flush(png_structp png_ptr) -{ - /* Do nothing; fflush() is said to be just a waste of energy. */ - png_ptr = png_ptr; /* Stifle compiler warning */ -} -#endif - -/* This is the function that does the actual writing of data. If you are - * not writing to a standard C stream, you should create a replacement - * write_data function and use it at run time with png_set_write_fn(), rather - * than changing the library. - */ -#ifndef USE_FAR_KEYWORD -static void -pngtest_write_data(png_structp png_ptr, png_bytep data, png_size_t length) -{ - png_uint_32 check; - - WRITEFILE((png_FILE_p)png_ptr->io_ptr, data, length, check); - if (check != length) - { - png_error(png_ptr, "Write Error"); - } -} -#else -/* This is the model-independent version. Since the standard I/O library - can't handle far buffers in the medium and small models, we have to copy - the data. -*/ - -#define NEAR_BUF_SIZE 1024 -#define MIN(a,b) (a <= b ? a : b) - -static void -pngtest_write_data(png_structp png_ptr, png_bytep data, png_size_t length) -{ - png_uint_32 check; - png_byte *near_data; /* Needs to be "png_byte *" instead of "png_bytep" */ - png_FILE_p io_ptr; - - /* Check if data really is near. If so, use usual code. */ - near_data = (png_byte *)CVT_PTR_NOCHECK(data); - io_ptr = (png_FILE_p)CVT_PTR(png_ptr->io_ptr); - if ((png_bytep)near_data == data) - { - WRITEFILE(io_ptr, near_data, length, check); - } - else - { - png_byte buf[NEAR_BUF_SIZE]; - png_size_t written, remaining, err; - check = 0; - remaining = length; - do - { - written = MIN(NEAR_BUF_SIZE, remaining); - png_memcpy(buf, data, written); /* Copy far buffer to near buffer */ - WRITEFILE(io_ptr, buf, written, err); - if (err != written) - break; - else - check += err; - data += written; - remaining -= written; - } - while (remaining != 0); - } - if (check != length) - { - png_error(png_ptr, "Write Error"); - } -} -#endif /* USE_FAR_KEYWORD */ - -/* This function is called when there is a warning, but the library thinks - * it can continue anyway. Replacement functions don't have to do anything - * here if you don't want to. In the default configuration, png_ptr is - * not used, but it is passed in case it may be useful. - */ -static void -pngtest_warning(png_structp png_ptr, png_const_charp message) -{ - PNG_CONST char *name = "UNKNOWN (ERROR!)"; - if (png_ptr != NULL && png_ptr->error_ptr != NULL) - name = png_ptr->error_ptr; - fprintf(STDERR, "%s: libpng warning: %s\n", name, message); -} - -/* This is the default error handling function. Note that replacements for - * this function MUST NOT RETURN, or the program will likely crash. This - * function is used by default, or if the program supplies NULL for the - * error function pointer in png_set_error_fn(). - */ -static void -pngtest_error(png_structp png_ptr, png_const_charp message) -{ - pngtest_warning(png_ptr, message); - /* We can return because png_error calls the default handler, which is - * actually OK in this case. - */ -} -#endif /* PNG_NO_STDIO */ -/* END of code to validate stdio-free compilation */ - -/* START of code to validate memory allocation and deallocation */ -#if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG - -/* Allocate memory. For reasonable files, size should never exceed - * 64K. However, zlib may allocate more then 64K if you don't tell - * it not to. See zconf.h and png.h for more information. zlib does - * need to allocate exactly 64K, so whatever you call here must - * have the ability to do that. - * - * This piece of code can be compiled to validate max 64K allocations - * by setting MAXSEG_64K in zlib zconf.h *or* PNG_MAX_MALLOC_64K. - */ -typedef struct memory_information -{ - png_uint_32 size; - png_voidp pointer; - struct memory_information FAR *next; -} memory_information; -typedef memory_information FAR *memory_infop; - -static memory_infop pinformation = NULL; -static int current_allocation = 0; -static int maximum_allocation = 0; -static int total_allocation = 0; -static int num_allocations = 0; - -png_voidp png_debug_malloc PNGARG((png_structp png_ptr, png_uint_32 size)); -void png_debug_free PNGARG((png_structp png_ptr, png_voidp ptr)); - -png_voidp -png_debug_malloc(png_structp png_ptr, png_uint_32 size) -{ - - /* png_malloc has already tested for NULL; png_create_struct calls - * png_debug_malloc directly, with png_ptr == NULL which is OK - */ - - if (size == 0) - return (NULL); - - /* This calls the library allocator twice, once to get the requested - buffer and once to get a new free list entry. */ - { - /* Disable malloc_fn and free_fn */ - memory_infop pinfo; - png_set_mem_fn(png_ptr, NULL, NULL, NULL); - pinfo = (memory_infop)png_malloc(png_ptr, - (png_uint_32)png_sizeof(*pinfo)); - pinfo->size = size; - current_allocation += size; - total_allocation += size; - num_allocations ++; - if (current_allocation > maximum_allocation) - maximum_allocation = current_allocation; - pinfo->pointer = (png_voidp)png_malloc(png_ptr, size); - /* Restore malloc_fn and free_fn */ - png_set_mem_fn(png_ptr, - png_voidp_NULL, (png_malloc_ptr)png_debug_malloc, - (png_free_ptr)png_debug_free); - if (size != 0 && pinfo->pointer == NULL) - { - current_allocation -= size; - total_allocation -= size; - png_error(png_ptr, - "out of memory in pngtest->png_debug_malloc."); - } - pinfo->next = pinformation; - pinformation = pinfo; - /* Make sure the caller isn't assuming zeroed memory. */ - png_memset(pinfo->pointer, 0xdd, pinfo->size); - if (verbose) - printf("png_malloc %lu bytes at %x\n", (unsigned long)size, - pinfo->pointer); - return (png_voidp)(pinfo->pointer); - } -} - -/* Free a pointer. It is removed from the list at the same time. */ -void -png_debug_free(png_structp png_ptr, png_voidp ptr) -{ - if (png_ptr == NULL) - fprintf(STDERR, "NULL pointer to png_debug_free.\n"); - if (ptr == 0) - { -#if 0 /* This happens all the time. */ - fprintf(STDERR, "WARNING: freeing NULL pointer\n"); -#endif - return; - } - - /* Unlink the element from the list. */ - { - memory_infop FAR *ppinfo = &pinformation; - for (;;) - { - memory_infop pinfo = *ppinfo; - if (pinfo->pointer == ptr) - { - *ppinfo = pinfo->next; - current_allocation -= pinfo->size; - if (current_allocation < 0) - fprintf(STDERR, "Duplicate free of memory\n"); - /* We must free the list element too, but first kill - the memory that is to be freed. */ - png_memset(ptr, 0x55, pinfo->size); - png_free_default(png_ptr, pinfo); - pinfo = NULL; - break; - } - if (pinfo->next == NULL) - { - fprintf(STDERR, "Pointer %x not found\n", (unsigned int)ptr); - break; - } - ppinfo = &pinfo->next; - } - } - - /* Finally free the data. */ - if (verbose) - printf("Freeing %x\n", ptr); - png_free_default(png_ptr, ptr); - ptr = NULL; -} -#endif /* PNG_USER_MEM_SUPPORTED && PNG_DEBUG */ -/* END of code to test memory allocation/deallocation */ - - -/* Demonstration of user chunk support of the sTER and vpAg chunks */ -#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) - -/* (sTER is a public chunk not yet known by libpng. vpAg is a private -chunk used in ImageMagick to store "virtual page" size). */ - -static png_uint_32 user_chunk_data[4]; - - /* 0: sTER mode + 1 - * 1: vpAg width - * 2: vpAg height - * 3: vpAg units - */ - -static int read_user_chunk_callback(png_struct *png_ptr, - png_unknown_chunkp chunk) -{ - png_uint_32 - *my_user_chunk_data; - - /* Return one of the following: - * return (-n); chunk had an error - * return (0); did not recognize - * return (n); success - * - * The unknown chunk structure contains the chunk data: - * png_byte name[5]; - * png_byte *data; - * png_size_t size; - * - * Note that libpng has already taken care of the CRC handling. - */ - - if (chunk->name[0] == 115 && chunk->name[1] == 84 && /* s T */ - chunk->name[2] == 69 && chunk->name[3] == 82) /* E R */ - { - /* Found sTER chunk */ - if (chunk->size != 1) - return (-1); /* Error return */ - if (chunk->data[0] != 0 && chunk->data[0] != 1) - return (-1); /* Invalid mode */ - my_user_chunk_data=(png_uint_32 *) png_get_user_chunk_ptr(png_ptr); - my_user_chunk_data[0]=chunk->data[0]+1; - return (1); - } - - if (chunk->name[0] != 118 || chunk->name[1] != 112 || /* v p */ - chunk->name[2] != 65 || chunk->name[3] != 103) /* A g */ - return (0); /* Did not recognize */ - - /* Found ImageMagick vpAg chunk */ - - if (chunk->size != 9) - return (-1); /* Error return */ - - my_user_chunk_data=(png_uint_32 *) png_get_user_chunk_ptr(png_ptr); - - my_user_chunk_data[1]=png_get_uint_31(png_ptr, chunk->data); - my_user_chunk_data[2]=png_get_uint_31(png_ptr, chunk->data + 4); - my_user_chunk_data[3]=(png_uint_32)chunk->data[8]; - - return (1); - -} -#endif -/* END of code to demonstrate user chunk support */ - -/* Test one file */ -int -test_one_file(PNG_CONST char *inname, PNG_CONST char *outname) -{ - static png_FILE_p fpin; - static png_FILE_p fpout; /* "static" prevents setjmp corruption */ - png_structp read_ptr; - png_infop read_info_ptr, end_info_ptr; -#ifdef PNG_WRITE_SUPPORTED - png_structp write_ptr; - png_infop write_info_ptr; - png_infop write_end_info_ptr; -#else - png_structp write_ptr = NULL; - png_infop write_info_ptr = NULL; - png_infop write_end_info_ptr = NULL; -#endif - png_bytep row_buf; - png_uint_32 y; - png_uint_32 width, height; - int num_pass, pass; - int bit_depth, color_type; -#ifdef PNG_SETJMP_SUPPORTED -#ifdef USE_FAR_KEYWORD - jmp_buf jmpbuf; -#endif -#endif - -#if defined(_WIN32_WCE) - TCHAR path[MAX_PATH]; -#endif - char inbuf[256], outbuf[256]; - - row_buf = NULL; - -#if defined(_WIN32_WCE) - MultiByteToWideChar(CP_ACP, 0, inname, -1, path, MAX_PATH); - if ((fpin = CreateFile(path, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL)) == INVALID_HANDLE_VALUE) -#else - if ((fpin = fopen(inname, "rb")) == NULL) -#endif - { - fprintf(STDERR, "Could not find input file %s\n", inname); - return (1); - } - -#if defined(_WIN32_WCE) - MultiByteToWideChar(CP_ACP, 0, outname, -1, path, MAX_PATH); - if ((fpout = CreateFile(path, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL)) == INVALID_HANDLE_VALUE) -#else - if ((fpout = fopen(outname, "wb")) == NULL) -#endif - { - fprintf(STDERR, "Could not open output file %s\n", outname); - FCLOSE(fpin); - return (1); - } - - png_debug(0, "Allocating read and write structures"); -#if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG - read_ptr = - png_create_read_struct_2(PNG_LIBPNG_VER_STRING, png_voidp_NULL, - png_error_ptr_NULL, png_error_ptr_NULL, png_voidp_NULL, - (png_malloc_ptr)png_debug_malloc, (png_free_ptr)png_debug_free); -#else - read_ptr = - png_create_read_struct(PNG_LIBPNG_VER_STRING, png_voidp_NULL, - png_error_ptr_NULL, png_error_ptr_NULL); -#endif -#if defined(PNG_NO_STDIO) - png_set_error_fn(read_ptr, (png_voidp)inname, pngtest_error, - pngtest_warning); -#endif - -#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) - user_chunk_data[0] = 0; - user_chunk_data[1] = 0; - user_chunk_data[2] = 0; - user_chunk_data[3] = 0; - png_set_read_user_chunk_fn(read_ptr, user_chunk_data, - read_user_chunk_callback); - -#endif -#ifdef PNG_WRITE_SUPPORTED -#if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG - write_ptr = - png_create_write_struct_2(PNG_LIBPNG_VER_STRING, png_voidp_NULL, - png_error_ptr_NULL, png_error_ptr_NULL, png_voidp_NULL, - (png_malloc_ptr)png_debug_malloc, (png_free_ptr)png_debug_free); -#else - write_ptr = - png_create_write_struct(PNG_LIBPNG_VER_STRING, png_voidp_NULL, - png_error_ptr_NULL, png_error_ptr_NULL); -#endif -#if defined(PNG_NO_STDIO) - png_set_error_fn(write_ptr, (png_voidp)inname, pngtest_error, - pngtest_warning); -#endif -#endif - png_debug(0, "Allocating read_info, write_info and end_info structures"); - read_info_ptr = png_create_info_struct(read_ptr); - end_info_ptr = png_create_info_struct(read_ptr); -#ifdef PNG_WRITE_SUPPORTED - write_info_ptr = png_create_info_struct(write_ptr); - write_end_info_ptr = png_create_info_struct(write_ptr); -#endif - -#ifdef PNG_SETJMP_SUPPORTED - png_debug(0, "Setting jmpbuf for read struct"); -#ifdef USE_FAR_KEYWORD - if (setjmp(jmpbuf)) -#else - if (setjmp(png_jmpbuf(read_ptr))) -#endif - { - fprintf(STDERR, "%s -> %s: libpng read error\n", inname, outname); - png_free(read_ptr, row_buf); - row_buf = NULL; - png_destroy_read_struct(&read_ptr, &read_info_ptr, &end_info_ptr); -#ifdef PNG_WRITE_SUPPORTED - png_destroy_info_struct(write_ptr, &write_end_info_ptr); - png_destroy_write_struct(&write_ptr, &write_info_ptr); -#endif - FCLOSE(fpin); - FCLOSE(fpout); - return (1); - } -#ifdef USE_FAR_KEYWORD - png_memcpy(png_jmpbuf(read_ptr), jmpbuf, png_sizeof(jmp_buf)); -#endif - -#ifdef PNG_WRITE_SUPPORTED - png_debug(0, "Setting jmpbuf for write struct"); -#ifdef USE_FAR_KEYWORD - if (setjmp(jmpbuf)) -#else - if (setjmp(png_jmpbuf(write_ptr))) -#endif - { - fprintf(STDERR, "%s -> %s: libpng write error\n", inname, outname); - png_destroy_read_struct(&read_ptr, &read_info_ptr, &end_info_ptr); - png_destroy_info_struct(write_ptr, &write_end_info_ptr); -#ifdef PNG_WRITE_SUPPORTED - png_destroy_write_struct(&write_ptr, &write_info_ptr); -#endif - FCLOSE(fpin); - FCLOSE(fpout); - return (1); - } -#ifdef USE_FAR_KEYWORD - png_memcpy(png_jmpbuf(write_ptr), jmpbuf, png_sizeof(jmp_buf)); -#endif -#endif -#endif - - png_debug(0, "Initializing input and output streams"); -#if !defined(PNG_NO_STDIO) - png_init_io(read_ptr, fpin); -# ifdef PNG_WRITE_SUPPORTED - png_init_io(write_ptr, fpout); -# endif -#else - png_set_read_fn(read_ptr, (png_voidp)fpin, pngtest_read_data); -# ifdef PNG_WRITE_SUPPORTED - png_set_write_fn(write_ptr, (png_voidp)fpout, pngtest_write_data, -# if defined(PNG_WRITE_FLUSH_SUPPORTED) - pngtest_flush); -# else - NULL); -# endif -# endif -#endif - if (status_dots_requested == 1) - { -#ifdef PNG_WRITE_SUPPORTED - png_set_write_status_fn(write_ptr, write_row_callback); -#endif - png_set_read_status_fn(read_ptr, read_row_callback); - } - else - { -#ifdef PNG_WRITE_SUPPORTED - png_set_write_status_fn(write_ptr, png_write_status_ptr_NULL); -#endif - png_set_read_status_fn(read_ptr, png_read_status_ptr_NULL); - } - -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) - { - int i; - for (i = 0; i<256; i++) - filters_used[i] = 0; - png_set_read_user_transform_fn(read_ptr, count_filters); - } -#endif -#if defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) - zero_samples = 0; - png_set_write_user_transform_fn(write_ptr, count_zero_samples); -#endif - -#if defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) -# ifndef PNG_HANDLE_CHUNK_ALWAYS -# define PNG_HANDLE_CHUNK_ALWAYS 3 -# endif - png_set_keep_unknown_chunks(read_ptr, PNG_HANDLE_CHUNK_ALWAYS, - png_bytep_NULL, 0); -#endif -#if defined(PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED) -# ifndef PNG_HANDLE_CHUNK_IF_SAFE -# define PNG_HANDLE_CHUNK_IF_SAFE 2 -# endif - png_set_keep_unknown_chunks(write_ptr, PNG_HANDLE_CHUNK_IF_SAFE, - png_bytep_NULL, 0); -#endif - - png_debug(0, "Reading info struct"); - png_read_info(read_ptr, read_info_ptr); - - png_debug(0, "Transferring info struct"); - { - int interlace_type, compression_type, filter_type; - - if (png_get_IHDR(read_ptr, read_info_ptr, &width, &height, &bit_depth, - &color_type, &interlace_type, &compression_type, &filter_type)) - { - png_set_IHDR(write_ptr, write_info_ptr, width, height, bit_depth, -#if defined(PNG_WRITE_INTERLACING_SUPPORTED) - color_type, interlace_type, compression_type, filter_type); -#else - color_type, PNG_INTERLACE_NONE, compression_type, filter_type); -#endif - } - } -#if defined(PNG_FIXED_POINT_SUPPORTED) -#if defined(PNG_cHRM_SUPPORTED) - { - png_fixed_point white_x, white_y, red_x, red_y, green_x, green_y, blue_x, - blue_y; - if (png_get_cHRM_fixed(read_ptr, read_info_ptr, &white_x, &white_y, &red_x, - &red_y, &green_x, &green_y, &blue_x, &blue_y)) - { - png_set_cHRM_fixed(write_ptr, write_info_ptr, white_x, white_y, red_x, - red_y, green_x, green_y, blue_x, blue_y); - } - } -#endif -#if defined(PNG_gAMA_SUPPORTED) - { - png_fixed_point gamma; - - if (png_get_gAMA_fixed(read_ptr, read_info_ptr, &gamma)) - png_set_gAMA_fixed(write_ptr, write_info_ptr, gamma); - } -#endif -#else /* Use floating point versions */ -#if defined(PNG_FLOATING_POINT_SUPPORTED) -#if defined(PNG_cHRM_SUPPORTED) - { - double white_x, white_y, red_x, red_y, green_x, green_y, blue_x, - blue_y; - if (png_get_cHRM(read_ptr, read_info_ptr, &white_x, &white_y, &red_x, - &red_y, &green_x, &green_y, &blue_x, &blue_y)) - { - png_set_cHRM(write_ptr, write_info_ptr, white_x, white_y, red_x, - red_y, green_x, green_y, blue_x, blue_y); - } - } -#endif -#if defined(PNG_gAMA_SUPPORTED) - { - double gamma; - - if (png_get_gAMA(read_ptr, read_info_ptr, &gamma)) - png_set_gAMA(write_ptr, write_info_ptr, gamma); - } -#endif -#endif /* Floating point */ -#endif /* Fixed point */ -#if defined(PNG_iCCP_SUPPORTED) - { - png_charp name; - png_charp profile; - png_uint_32 proflen; - int compression_type; - - if (png_get_iCCP(read_ptr, read_info_ptr, &name, &compression_type, - &profile, &proflen)) - { - png_set_iCCP(write_ptr, write_info_ptr, name, compression_type, - profile, proflen); - } - } -#endif -#if defined(PNG_sRGB_SUPPORTED) - { - int intent; - - if (png_get_sRGB(read_ptr, read_info_ptr, &intent)) - png_set_sRGB(write_ptr, write_info_ptr, intent); - } -#endif - { - png_colorp palette; - int num_palette; - - if (png_get_PLTE(read_ptr, read_info_ptr, &palette, &num_palette)) - png_set_PLTE(write_ptr, write_info_ptr, palette, num_palette); - } -#if defined(PNG_bKGD_SUPPORTED) - { - png_color_16p background; - - if (png_get_bKGD(read_ptr, read_info_ptr, &background)) - { - png_set_bKGD(write_ptr, write_info_ptr, background); - } - } -#endif -#if defined(PNG_hIST_SUPPORTED) - { - png_uint_16p hist; - - if (png_get_hIST(read_ptr, read_info_ptr, &hist)) - png_set_hIST(write_ptr, write_info_ptr, hist); - } -#endif -#if defined(PNG_oFFs_SUPPORTED) - { - png_int_32 offset_x, offset_y; - int unit_type; - - if (png_get_oFFs(read_ptr, read_info_ptr, &offset_x, &offset_y, - &unit_type)) - { - png_set_oFFs(write_ptr, write_info_ptr, offset_x, offset_y, unit_type); - } - } -#endif -#if defined(PNG_pCAL_SUPPORTED) - { - png_charp purpose, units; - png_charpp params; - png_int_32 X0, X1; - int type, nparams; - - if (png_get_pCAL(read_ptr, read_info_ptr, &purpose, &X0, &X1, &type, - &nparams, &units, ¶ms)) - { - png_set_pCAL(write_ptr, write_info_ptr, purpose, X0, X1, type, - nparams, units, params); - } - } -#endif -#if defined(PNG_pHYs_SUPPORTED) - { - png_uint_32 res_x, res_y; - int unit_type; - - if (png_get_pHYs(read_ptr, read_info_ptr, &res_x, &res_y, &unit_type)) - png_set_pHYs(write_ptr, write_info_ptr, res_x, res_y, unit_type); - } -#endif -#if defined(PNG_sBIT_SUPPORTED) - { - png_color_8p sig_bit; - - if (png_get_sBIT(read_ptr, read_info_ptr, &sig_bit)) - png_set_sBIT(write_ptr, write_info_ptr, sig_bit); - } -#endif -#if defined(PNG_sCAL_SUPPORTED) -#ifdef PNG_FLOATING_POINT_SUPPORTED - { - int unit; - double scal_width, scal_height; - - if (png_get_sCAL(read_ptr, read_info_ptr, &unit, &scal_width, - &scal_height)) - { - png_set_sCAL(write_ptr, write_info_ptr, unit, scal_width, scal_height); - } - } -#else -#ifdef PNG_FIXED_POINT_SUPPORTED - { - int unit; - png_charp scal_width, scal_height; - - if (png_get_sCAL_s(read_ptr, read_info_ptr, &unit, &scal_width, - &scal_height)) - { - png_set_sCAL_s(write_ptr, write_info_ptr, unit, scal_width, scal_height); - } - } -#endif -#endif -#endif -#if defined(PNG_TEXT_SUPPORTED) - { - png_textp text_ptr; - int num_text; - - if (png_get_text(read_ptr, read_info_ptr, &text_ptr, &num_text) > 0) - { - png_debug1(0, "Handling %d iTXt/tEXt/zTXt chunks", num_text); - png_set_text(write_ptr, write_info_ptr, text_ptr, num_text); - } - } -#endif -#if defined(PNG_tIME_SUPPORTED) - { - png_timep mod_time; - - if (png_get_tIME(read_ptr, read_info_ptr, &mod_time)) - { - png_set_tIME(write_ptr, write_info_ptr, mod_time); -#if defined(PNG_TIME_RFC1123_SUPPORTED) - /* We have to use png_memcpy instead of "=" because the string - * pointed to by png_convert_to_rfc1123() gets free'ed before - * we use it. - */ - png_memcpy(tIME_string, - png_convert_to_rfc1123(read_ptr, mod_time), - png_sizeof(tIME_string)); - tIME_string[png_sizeof(tIME_string) - 1] = '\0'; - tIME_chunk_present++; -#endif /* PNG_TIME_RFC1123_SUPPORTED */ - } - } -#endif -#if defined(PNG_tRNS_SUPPORTED) - { - png_bytep trans; - int num_trans; - png_color_16p trans_values; - - if (png_get_tRNS(read_ptr, read_info_ptr, &trans, &num_trans, - &trans_values)) - { - int sample_max = (1 << read_info_ptr->bit_depth); - /* libpng doesn't reject a tRNS chunk with out-of-range samples */ - if (!((read_info_ptr->color_type == PNG_COLOR_TYPE_GRAY && - (int)trans_values->gray > sample_max) || - (read_info_ptr->color_type == PNG_COLOR_TYPE_RGB && - ((int)trans_values->red > sample_max || - (int)trans_values->green > sample_max || - (int)trans_values->blue > sample_max)))) - png_set_tRNS(write_ptr, write_info_ptr, trans, num_trans, - trans_values); - } - } -#endif -#if defined(PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED) - { - png_unknown_chunkp unknowns; - int num_unknowns = (int)png_get_unknown_chunks(read_ptr, read_info_ptr, - &unknowns); - if (num_unknowns) - { - png_size_t i; - png_set_unknown_chunks(write_ptr, write_info_ptr, unknowns, - num_unknowns); - /* Copy the locations from the read_info_ptr. The automatically - * generated locations in write_info_ptr are wrong because we - * haven't written anything yet. - */ - for (i = 0; i < (png_size_t)num_unknowns; i++) - png_set_unknown_chunk_location(write_ptr, write_info_ptr, i, - unknowns[i].location); - } - } -#endif - -#ifdef PNG_WRITE_SUPPORTED - png_debug(0, "Writing info struct"); - -/* If we wanted, we could write info in two steps: - * png_write_info_before_PLTE(write_ptr, write_info_ptr); - */ - png_write_info(write_ptr, write_info_ptr); - -#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) - if (user_chunk_data[0] != 0) - { - png_byte png_sTER[5] = {115, 84, 69, 82, '\0'}; - - unsigned char - ster_chunk_data[1]; - - if (verbose) - fprintf(STDERR, "\n stereo mode = %lu\n", - (unsigned long)(user_chunk_data[0] - 1)); - ster_chunk_data[0]=(unsigned char)(user_chunk_data[0] - 1); - png_write_chunk(write_ptr, png_sTER, ster_chunk_data, 1); - } - if (user_chunk_data[1] != 0 || user_chunk_data[2] != 0) - { - png_byte png_vpAg[5] = {118, 112, 65, 103, '\0'}; - - unsigned char - vpag_chunk_data[9]; - - if (verbose) - fprintf(STDERR, " vpAg = %lu x %lu, units = %lu\n", - (unsigned long)user_chunk_data[1], - (unsigned long)user_chunk_data[2], - (unsigned long)user_chunk_data[3]); - png_save_uint_32(vpag_chunk_data, user_chunk_data[1]); - png_save_uint_32(vpag_chunk_data + 4, user_chunk_data[2]); - vpag_chunk_data[8] = (unsigned char)(user_chunk_data[3] & 0xff); - png_write_chunk(write_ptr, png_vpAg, vpag_chunk_data, 9); - } - -#endif -#endif - -#ifdef SINGLE_ROWBUF_ALLOC - png_debug(0, "Allocating row buffer..."); - row_buf = (png_bytep)png_malloc(read_ptr, - png_get_rowbytes(read_ptr, read_info_ptr)); - png_debug1(0, "0x%08lx", (unsigned long)row_buf); -#endif /* SINGLE_ROWBUF_ALLOC */ - png_debug(0, "Writing row data"); - -#if defined(PNG_READ_INTERLACING_SUPPORTED) || \ - defined(PNG_WRITE_INTERLACING_SUPPORTED) - num_pass = png_set_interlace_handling(read_ptr); -# ifdef PNG_WRITE_SUPPORTED - png_set_interlace_handling(write_ptr); -# endif -#else - num_pass = 1; -#endif - -#ifdef PNGTEST_TIMING - t_stop = (float)clock(); - t_misc += (t_stop - t_start); - t_start = t_stop; -#endif - for (pass = 0; pass < num_pass; pass++) - { - png_debug1(0, "Writing row data for pass %d", pass); - for (y = 0; y < height; y++) - { -#ifndef SINGLE_ROWBUF_ALLOC - png_debug2(0, "Allocating row buffer (pass %d, y = %ld)...", pass, y); - row_buf = (png_bytep)png_malloc(read_ptr, - png_get_rowbytes(read_ptr, read_info_ptr)); - png_debug2(0, "0x%08lx (%ld bytes)", (unsigned long)row_buf, - png_get_rowbytes(read_ptr, read_info_ptr)); -#endif /* !SINGLE_ROWBUF_ALLOC */ - png_read_rows(read_ptr, (png_bytepp)&row_buf, png_bytepp_NULL, 1); - -#ifdef PNG_WRITE_SUPPORTED -#ifdef PNGTEST_TIMING - t_stop = (float)clock(); - t_decode += (t_stop - t_start); - t_start = t_stop; -#endif - png_write_rows(write_ptr, (png_bytepp)&row_buf, 1); -#ifdef PNGTEST_TIMING - t_stop = (float)clock(); - t_encode += (t_stop - t_start); - t_start = t_stop; -#endif -#endif /* PNG_WRITE_SUPPORTED */ - -#ifndef SINGLE_ROWBUF_ALLOC - png_debug2(0, "Freeing row buffer (pass %d, y = %ld)", pass, y); - png_free(read_ptr, row_buf); - row_buf = NULL; -#endif /* !SINGLE_ROWBUF_ALLOC */ - } - } - -#if defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) - png_free_data(read_ptr, read_info_ptr, PNG_FREE_UNKN, -1); -#endif -#if defined(PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED) - png_free_data(write_ptr, write_info_ptr, PNG_FREE_UNKN, -1); -#endif - - png_debug(0, "Reading and writing end_info data"); - - png_read_end(read_ptr, end_info_ptr); -#if defined(PNG_TEXT_SUPPORTED) - { - png_textp text_ptr; - int num_text; - - if (png_get_text(read_ptr, end_info_ptr, &text_ptr, &num_text) > 0) - { - png_debug1(0, "Handling %d iTXt/tEXt/zTXt chunks", num_text); - png_set_text(write_ptr, write_end_info_ptr, text_ptr, num_text); - } - } -#endif -#if defined(PNG_tIME_SUPPORTED) - { - png_timep mod_time; - - if (png_get_tIME(read_ptr, end_info_ptr, &mod_time)) - { - png_set_tIME(write_ptr, write_end_info_ptr, mod_time); -#if defined(PNG_TIME_RFC1123_SUPPORTED) - /* We have to use png_memcpy instead of "=" because the string - pointed to by png_convert_to_rfc1123() gets free'ed before - we use it */ - png_memcpy(tIME_string, - png_convert_to_rfc1123(read_ptr, mod_time), - png_sizeof(tIME_string)); - tIME_string[png_sizeof(tIME_string) - 1] = '\0'; - tIME_chunk_present++; -#endif /* PNG_TIME_RFC1123_SUPPORTED */ - } - } -#endif -#if defined(PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED) - { - png_unknown_chunkp unknowns; - int num_unknowns; - num_unknowns = (int)png_get_unknown_chunks(read_ptr, end_info_ptr, - &unknowns); - if (num_unknowns) - { - png_size_t i; - png_set_unknown_chunks(write_ptr, write_end_info_ptr, unknowns, - num_unknowns); - /* Copy the locations from the read_info_ptr. The automatically - * generated locations in write_end_info_ptr are wrong because we - * haven't written the end_info yet. - */ - for (i = 0; i < (png_size_t)num_unknowns; i++) - png_set_unknown_chunk_location(write_ptr, write_end_info_ptr, i, - unknowns[i].location); - } - } -#endif -#ifdef PNG_WRITE_SUPPORTED - png_write_end(write_ptr, write_end_info_ptr); -#endif - -#ifdef PNG_EASY_ACCESS_SUPPORTED - if (verbose) - { - png_uint_32 iwidth, iheight; - iwidth = png_get_image_width(write_ptr, write_info_ptr); - iheight = png_get_image_height(write_ptr, write_info_ptr); - fprintf(STDERR, "\n Image width = %lu, height = %lu\n", - (unsigned long)iwidth, (unsigned long)iheight); - } -#endif - - png_debug(0, "Destroying data structs"); -#ifdef SINGLE_ROWBUF_ALLOC - png_debug(1, "destroying row_buf for read_ptr"); - png_free(read_ptr, row_buf); - row_buf = NULL; -#endif /* SINGLE_ROWBUF_ALLOC */ - png_debug(1, "destroying read_ptr, read_info_ptr, end_info_ptr"); - png_destroy_read_struct(&read_ptr, &read_info_ptr, &end_info_ptr); -#ifdef PNG_WRITE_SUPPORTED - png_debug(1, "destroying write_end_info_ptr"); - png_destroy_info_struct(write_ptr, &write_end_info_ptr); - png_debug(1, "destroying write_ptr, write_info_ptr"); - png_destroy_write_struct(&write_ptr, &write_info_ptr); -#endif - png_debug(0, "Destruction complete."); - - FCLOSE(fpin); - FCLOSE(fpout); - - png_debug(0, "Opening files for comparison"); -#if defined(_WIN32_WCE) - MultiByteToWideChar(CP_ACP, 0, inname, -1, path, MAX_PATH); - if ((fpin = CreateFile(path, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL)) == INVALID_HANDLE_VALUE) -#else - if ((fpin = fopen(inname, "rb")) == NULL) -#endif - { - fprintf(STDERR, "Could not find file %s\n", inname); - return (1); - } - -#if defined(_WIN32_WCE) - MultiByteToWideChar(CP_ACP, 0, outname, -1, path, MAX_PATH); - if ((fpout = CreateFile(path, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL)) == INVALID_HANDLE_VALUE) -#else - if ((fpout = fopen(outname, "rb")) == NULL) -#endif - { - fprintf(STDERR, "Could not find file %s\n", outname); - FCLOSE(fpin); - return (1); - } - - for (;;) - { - png_size_t num_in, num_out; - - READFILE(fpin, inbuf, 1, num_in); - READFILE(fpout, outbuf, 1, num_out); - - if (num_in != num_out) - { - fprintf(STDERR, "\nFiles %s and %s are of a different size\n", - inname, outname); - if (wrote_question == 0) - { - fprintf(STDERR, - " Was %s written with the same maximum IDAT chunk size (%d bytes),", - inname, PNG_ZBUF_SIZE); - fprintf(STDERR, - "\n filtering heuristic (libpng default), compression"); - fprintf(STDERR, - " level (zlib default),\n and zlib version (%s)?\n\n", - ZLIB_VERSION); - wrote_question = 1; - } - FCLOSE(fpin); - FCLOSE(fpout); - return (0); - } - - if (!num_in) - break; - - if (png_memcmp(inbuf, outbuf, num_in)) - { - fprintf(STDERR, "\nFiles %s and %s are different\n", inname, outname); - if (wrote_question == 0) - { - fprintf(STDERR, - " Was %s written with the same maximum IDAT chunk size (%d bytes),", - inname, PNG_ZBUF_SIZE); - fprintf(STDERR, - "\n filtering heuristic (libpng default), compression"); - fprintf(STDERR, - " level (zlib default),\n and zlib version (%s)?\n\n", - ZLIB_VERSION); - wrote_question = 1; - } - FCLOSE(fpin); - FCLOSE(fpout); - return (0); - } - } - - FCLOSE(fpin); - FCLOSE(fpout); - - return (0); -} - -/* Input and output filenames */ -#ifdef RISCOS -static PNG_CONST char *inname = "pngtest/png"; -static PNG_CONST char *outname = "pngout/png"; -#else -static PNG_CONST char *inname = "pngtest.png"; -static PNG_CONST char *outname = "pngout.png"; -#endif - -int -main(int argc, char *argv[]) -{ - int multiple = 0; - int ierror = 0; - - fprintf(STDERR, "\n Testing libpng version %s\n", PNG_LIBPNG_VER_STRING); - fprintf(STDERR, " with zlib version %s\n", ZLIB_VERSION); - fprintf(STDERR, "%s", png_get_copyright(NULL)); - /* Show the version of libpng used in building the library */ - fprintf(STDERR, " library (%lu):%s", - (unsigned long)png_access_version_number(), - png_get_header_version(NULL)); - /* Show the version of libpng used in building the application */ - fprintf(STDERR, " pngtest (%lu):%s", (unsigned long)PNG_LIBPNG_VER, - PNG_HEADER_VERSION_STRING); - fprintf(STDERR, " sizeof(png_struct)=%ld, sizeof(png_info)=%ld\n", - (long)png_sizeof(png_struct), (long)png_sizeof(png_info)); - - /* Do some consistency checking on the memory allocation settings, I'm - * not sure this matters, but it is nice to know, the first of these - * tests should be impossible because of the way the macros are set - * in pngconf.h - */ -#if defined(MAXSEG_64K) && !defined(PNG_MAX_MALLOC_64K) - fprintf(STDERR, " NOTE: Zlib compiled for max 64k, libpng not\n"); -#endif - /* I think the following can happen. */ -#if !defined(MAXSEG_64K) && defined(PNG_MAX_MALLOC_64K) - fprintf(STDERR, " NOTE: libpng compiled for max 64k, zlib not\n"); -#endif - - if (strcmp(png_libpng_ver, PNG_LIBPNG_VER_STRING)) - { - fprintf(STDERR, - "Warning: versions are different between png.h and png.c\n"); - fprintf(STDERR, " png.h version: %s\n", PNG_LIBPNG_VER_STRING); - fprintf(STDERR, " png.c version: %s\n\n", png_libpng_ver); - ++ierror; - } - - if (argc > 1) - { - if (strcmp(argv[1], "-m") == 0) - { - multiple = 1; - status_dots_requested = 0; - } - else if (strcmp(argv[1], "-mv") == 0 || - strcmp(argv[1], "-vm") == 0 ) - { - multiple = 1; - verbose = 1; - status_dots_requested = 1; - } - else if (strcmp(argv[1], "-v") == 0) - { - verbose = 1; - status_dots_requested = 1; - inname = argv[2]; - } - else - { - inname = argv[1]; - status_dots_requested = 0; - } - } - - if (!multiple && argc == 3 + verbose) - outname = argv[2 + verbose]; - - if ((!multiple && argc > 3 + verbose) || (multiple && argc < 2)) - { - fprintf(STDERR, - "usage: %s [infile.png] [outfile.png]\n\t%s -m {infile.png}\n", - argv[0], argv[0]); - fprintf(STDERR, - " reads/writes one PNG file (without -m) or multiple files (-m)\n"); - fprintf(STDERR, - " with -m %s is used as a temporary file\n", outname); - exit(1); - } - - if (multiple) - { - int i; -#if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG - int allocation_now = current_allocation; -#endif - for (i=2; isize, - (unsigned int) pinfo->pointer); - pinfo = pinfo->next; - } - } -#endif - } -#if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG - fprintf(STDERR, " Current memory allocation: %10d bytes\n", - current_allocation); - fprintf(STDERR, " Maximum memory allocation: %10d bytes\n", - maximum_allocation); - fprintf(STDERR, " Total memory allocation: %10d bytes\n", - total_allocation); - fprintf(STDERR, " Number of allocations: %10d\n", - num_allocations); -#endif - } - else - { - int i; - for (i = 0; i<3; ++i) - { - int kerror; -#if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG - int allocation_now = current_allocation; -#endif - if (i == 1) status_dots_requested = 1; - else if (verbose == 0)status_dots_requested = 0; - if (i == 0 || verbose == 1 || ierror != 0) - fprintf(STDERR, "\n Testing %s:", inname); - kerror = test_one_file(inname, outname); - if (kerror == 0) - { - if (verbose == 1 || i == 2) - { -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) - int k; -#endif -#if defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) - fprintf(STDERR, "\n PASS (%lu zero samples)\n", - (unsigned long)zero_samples); -#else - fprintf(STDERR, " PASS\n"); -#endif -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) - for (k = 0; k<256; k++) - if (filters_used[k]) - fprintf(STDERR, " Filter %d was used %lu times\n", - k, - (unsigned long)filters_used[k]); -#endif -#if defined(PNG_TIME_RFC1123_SUPPORTED) - if (tIME_chunk_present != 0) - fprintf(STDERR, " tIME = %s\n", tIME_string); -#endif /* PNG_TIME_RFC1123_SUPPORTED */ - } - } - else - { - if (verbose == 0 && i != 2) - fprintf(STDERR, "\n Testing %s:", inname); - fprintf(STDERR, " FAIL\n"); - ierror += kerror; - } -#if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG - if (allocation_now != current_allocation) - fprintf(STDERR, "MEMORY ERROR: %d bytes lost\n", - current_allocation - allocation_now); - if (current_allocation != 0) - { - memory_infop pinfo = pinformation; - - fprintf(STDERR, "MEMORY ERROR: %d bytes still allocated\n", - current_allocation); - while (pinfo != NULL) - { - fprintf(STDERR, " %lu bytes at %x\n", - (unsigned long)pinfo->size, (unsigned int)pinfo->pointer); - pinfo = pinfo->next; - } - } -#endif - } -#if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG - fprintf(STDERR, " Current memory allocation: %10d bytes\n", - current_allocation); - fprintf(STDERR, " Maximum memory allocation: %10d bytes\n", - maximum_allocation); - fprintf(STDERR, " Total memory allocation: %10d bytes\n", - total_allocation); - fprintf(STDERR, " Number of allocations: %10d\n", - num_allocations); -#endif - } - -#ifdef PNGTEST_TIMING - t_stop = (float)clock(); - t_misc += (t_stop - t_start); - t_start = t_stop; - fprintf(STDERR, " CPU time used = %.3f seconds", - (t_misc+t_decode+t_encode)/(float)CLOCKS_PER_SEC); - fprintf(STDERR, " (decoding %.3f,\n", - t_decode/(float)CLOCKS_PER_SEC); - fprintf(STDERR, " encoding %.3f ,", - t_encode/(float)CLOCKS_PER_SEC); - fprintf(STDERR, " other %.3f seconds)\n\n", - t_misc/(float)CLOCKS_PER_SEC); -#endif - - if (ierror == 0) - fprintf(STDERR, " libpng passes test\n"); - else - fprintf(STDERR, " libpng FAILS test\n"); - return (int)(ierror != 0); -} - -/* Generate a compiler error if there is an old png.h in the search path. */ -typedef version_1_2_37 your_png_h_is_not_version_1_2_37; diff --git a/src/libpng/pngtrans.c b/src/libpng/pngtrans.c deleted file mode 100644 index 6880ce958..000000000 --- a/src/libpng/pngtrans.c +++ /dev/null @@ -1,674 +0,0 @@ - -/* pngtrans.c - transforms the data in a row (used by both readers and writers) - * - * Last changed in libpng 1.2.36 [May 14, 2009] - * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2009 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - */ - -#define PNG_INTERNAL -#include "png.h" -#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) - -#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED) -/* Turn on BGR-to-RGB mapping */ -void PNGAPI -png_set_bgr(png_structp png_ptr) -{ - png_debug(1, "in png_set_bgr"); - if (png_ptr == NULL) - return; - png_ptr->transformations |= PNG_BGR; -} -#endif - -#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED) -/* Turn on 16 bit byte swapping */ -void PNGAPI -png_set_swap(png_structp png_ptr) -{ - png_debug(1, "in png_set_swap"); - if (png_ptr == NULL) - return; - if (png_ptr->bit_depth == 16) - png_ptr->transformations |= PNG_SWAP_BYTES; -} -#endif - -#if defined(PNG_READ_PACK_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED) -/* Turn on pixel packing */ -void PNGAPI -png_set_packing(png_structp png_ptr) -{ - png_debug(1, "in png_set_packing"); - if (png_ptr == NULL) - return; - if (png_ptr->bit_depth < 8) - { - png_ptr->transformations |= PNG_PACK; - png_ptr->usr_bit_depth = 8; - } -} -#endif - -#if defined(PNG_READ_PACKSWAP_SUPPORTED)||defined(PNG_WRITE_PACKSWAP_SUPPORTED) -/* Turn on packed pixel swapping */ -void PNGAPI -png_set_packswap(png_structp png_ptr) -{ - png_debug(1, "in png_set_packswap"); - if (png_ptr == NULL) - return; - if (png_ptr->bit_depth < 8) - png_ptr->transformations |= PNG_PACKSWAP; -} -#endif - -#if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED) -void PNGAPI -png_set_shift(png_structp png_ptr, png_color_8p true_bits) -{ - png_debug(1, "in png_set_shift"); - if (png_ptr == NULL) - return; - png_ptr->transformations |= PNG_SHIFT; - png_ptr->shift = *true_bits; -} -#endif - -#if defined(PNG_READ_INTERLACING_SUPPORTED) || \ - defined(PNG_WRITE_INTERLACING_SUPPORTED) -int PNGAPI -png_set_interlace_handling(png_structp png_ptr) -{ - png_debug(1, "in png_set_interlace handling"); - if (png_ptr && png_ptr->interlaced) - { - png_ptr->transformations |= PNG_INTERLACE; - return (7); - } - - return (1); -} -#endif - -#if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED) -/* Add a filler byte on read, or remove a filler or alpha byte on write. - * The filler type has changed in v0.95 to allow future 2-byte fillers - * for 48-bit input data, as well as to avoid problems with some compilers - * that don't like bytes as parameters. - */ -void PNGAPI -png_set_filler(png_structp png_ptr, png_uint_32 filler, int filler_loc) -{ - png_debug(1, "in png_set_filler"); - if (png_ptr == NULL) - return; - png_ptr->transformations |= PNG_FILLER; - png_ptr->filler = (png_byte)filler; - if (filler_loc == PNG_FILLER_AFTER) - png_ptr->flags |= PNG_FLAG_FILLER_AFTER; - else - png_ptr->flags &= ~PNG_FLAG_FILLER_AFTER; - - /* This should probably go in the "do_read_filler" routine. - * I attempted to do that in libpng-1.0.1a but that caused problems - * so I restored it in libpng-1.0.2a - */ - - if (png_ptr->color_type == PNG_COLOR_TYPE_RGB) - { - png_ptr->usr_channels = 4; - } - - /* Also I added this in libpng-1.0.2a (what happens when we expand - * a less-than-8-bit grayscale to GA? */ - - if (png_ptr->color_type == PNG_COLOR_TYPE_GRAY && png_ptr->bit_depth >= 8) - { - png_ptr->usr_channels = 2; - } -} - -#if !defined(PNG_1_0_X) -/* Added to libpng-1.2.7 */ -void PNGAPI -png_set_add_alpha(png_structp png_ptr, png_uint_32 filler, int filler_loc) -{ - png_debug(1, "in png_set_add_alpha"); - if (png_ptr == NULL) - return; - png_set_filler(png_ptr, filler, filler_loc); - png_ptr->transformations |= PNG_ADD_ALPHA; -} -#endif - -#endif - -#if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) || \ - defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED) -void PNGAPI -png_set_swap_alpha(png_structp png_ptr) -{ - png_debug(1, "in png_set_swap_alpha"); - if (png_ptr == NULL) - return; - png_ptr->transformations |= PNG_SWAP_ALPHA; -} -#endif - -#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) || \ - defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED) -void PNGAPI -png_set_invert_alpha(png_structp png_ptr) -{ - png_debug(1, "in png_set_invert_alpha"); - if (png_ptr == NULL) - return; - png_ptr->transformations |= PNG_INVERT_ALPHA; -} -#endif - -#if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED) -void PNGAPI -png_set_invert_mono(png_structp png_ptr) -{ - png_debug(1, "in png_set_invert_mono"); - if (png_ptr == NULL) - return; - png_ptr->transformations |= PNG_INVERT_MONO; -} - -/* Invert monochrome grayscale data */ -void /* PRIVATE */ -png_do_invert(png_row_infop row_info, png_bytep row) -{ - png_debug(1, "in png_do_invert"); - /* This test removed from libpng version 1.0.13 and 1.2.0: - * if (row_info->bit_depth == 1 && - */ -#if defined(PNG_USELESS_TESTS_SUPPORTED) - if (row == NULL || row_info == NULL) - return; -#endif - if (row_info->color_type == PNG_COLOR_TYPE_GRAY) - { - png_bytep rp = row; - png_uint_32 i; - png_uint_32 istop = row_info->rowbytes; - - for (i = 0; i < istop; i++) - { - *rp = (png_byte)(~(*rp)); - rp++; - } - } - else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA && - row_info->bit_depth == 8) - { - png_bytep rp = row; - png_uint_32 i; - png_uint_32 istop = row_info->rowbytes; - - for (i = 0; i < istop; i+=2) - { - *rp = (png_byte)(~(*rp)); - rp+=2; - } - } - else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA && - row_info->bit_depth == 16) - { - png_bytep rp = row; - png_uint_32 i; - png_uint_32 istop = row_info->rowbytes; - - for (i = 0; i < istop; i+=4) - { - *rp = (png_byte)(~(*rp)); - *(rp+1) = (png_byte)(~(*(rp+1))); - rp+=4; - } - } -} -#endif - -#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED) -/* Swaps byte order on 16 bit depth images */ -void /* PRIVATE */ -png_do_swap(png_row_infop row_info, png_bytep row) -{ - png_debug(1, "in png_do_swap"); - if ( -#if defined(PNG_USELESS_TESTS_SUPPORTED) - row != NULL && row_info != NULL && -#endif - row_info->bit_depth == 16) - { - png_bytep rp = row; - png_uint_32 i; - png_uint_32 istop= row_info->width * row_info->channels; - - for (i = 0; i < istop; i++, rp += 2) - { - png_byte t = *rp; - *rp = *(rp + 1); - *(rp + 1) = t; - } - } -} -#endif - -#if defined(PNG_READ_PACKSWAP_SUPPORTED)||defined(PNG_WRITE_PACKSWAP_SUPPORTED) -static PNG_CONST png_byte onebppswaptable[256] = { - 0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0, - 0x10, 0x90, 0x50, 0xD0, 0x30, 0xB0, 0x70, 0xF0, - 0x08, 0x88, 0x48, 0xC8, 0x28, 0xA8, 0x68, 0xE8, - 0x18, 0x98, 0x58, 0xD8, 0x38, 0xB8, 0x78, 0xF8, - 0x04, 0x84, 0x44, 0xC4, 0x24, 0xA4, 0x64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B, 0x9B, 0x5B, 0xDB, 0x3B, 0xBB, 0x7B, 0xFB, - 0x07, 0x87, 0x47, 0xC7, 0x27, 0xA7, 0x67, 0xE7, - 0x17, 0x97, 0x57, 0xD7, 0x37, 0xB7, 0x77, 0xF7, - 0x0F, 0x8F, 0x4F, 0xCF, 0x2F, 0xAF, 0x6F, 0xEF, - 0x1F, 0x9F, 0x5F, 0xDF, 0x3F, 0xBF, 0x7F, 0xFF -}; - -static PNG_CONST png_byte twobppswaptable[256] = { - 0x00, 0x40, 0x80, 0xC0, 0x10, 0x50, 0x90, 0xD0, - 0x20, 0x60, 0xA0, 0xE0, 0x30, 0x70, 0xB0, 0xF0, - 0x04, 0x44, 0x84, 0xC4, 0x14, 0x54, 0x94, 0xD4, - 0x24, 0x64, 0xA4, 0xE4, 0x34, 0x74, 0xB4, 0xF4, - 0x08, 0x48, 0x88, 0xC8, 0x18, 0x58, 0x98, 0xD8, - 0x28, 0x68, 0xA8, 0xE8, 0x38, 0x78, 0xB8, 0xF8, - 0x0C, 0x4C, 0x8C, 0xCC, 0x1C, 0x5C, 0x9C, 0xDC, - 0x2C, 0x6C, 0xAC, 0xEC, 0x3C, 0x7C, 0xBC, 0xFC, - 0x01, 0x41, 0x81, 0xC1, 0x11, 0x51, 0x91, 0xD1, - 0x21, 0x61, 0xA1, 0xE1, 0x31, 0x71, 0xB1, 0xF1, - 0x05, 0x45, 0x85, 0xC5, 0x15, 0x55, 0x95, 0xD5, - 0x25, 0x65, 0xA5, 0xE5, 0x35, 0x75, 0xB5, 0xF5, - 0x09, 0x49, 0x89, 0xC9, 0x19, 0x59, 0x99, 0xD9, - 0x29, 0x69, 0xA9, 0xE9, 0x39, 0x79, 0xB9, 0xF9, - 0x0D, 0x4D, 0x8D, 0xCD, 0x1D, 0x5D, 0x9D, 0xDD, - 0x2D, 0x6D, 0xAD, 0xED, 0x3D, 0x7D, 0xBD, 0xFD, - 0x02, 0x42, 0x82, 0xC2, 0x12, 0x52, 0x92, 0xD2, - 0x22, 0x62, 0xA2, 0xE2, 0x32, 0x72, 0xB2, 0xF2, - 0x06, 0x46, 0x86, 0xC6, 0x16, 0x56, 0x96, 0xD6, - 0x26, 0x66, 0xA6, 0xE6, 0x36, 0x76, 0xB6, 0xF6, - 0x0A, 0x4A, 0x8A, 0xCA, 0x1A, 0x5A, 0x9A, 0xDA, - 0x2A, 0x6A, 0xAA, 0xEA, 0x3A, 0x7A, 0xBA, 0xFA, - 0x0E, 0x4E, 0x8E, 0xCE, 0x1E, 0x5E, 0x9E, 0xDE, - 0x2E, 0x6E, 0xAE, 0xEE, 0x3E, 0x7E, 0xBE, 0xFE, - 0x03, 0x43, 0x83, 0xC3, 0x13, 0x53, 0x93, 0xD3, - 0x23, 0x63, 0xA3, 0xE3, 0x33, 0x73, 0xB3, 0xF3, - 0x07, 0x47, 0x87, 0xC7, 0x17, 0x57, 0x97, 0xD7, - 0x27, 0x67, 0xA7, 0xE7, 0x37, 0x77, 0xB7, 0xF7, - 0x0B, 0x4B, 0x8B, 0xCB, 0x1B, 0x5B, 0x9B, 0xDB, - 0x2B, 0x6B, 0xAB, 0xEB, 0x3B, 0x7B, 0xBB, 0xFB, - 0x0F, 0x4F, 0x8F, 0xCF, 0x1F, 0x5F, 0x9F, 0xDF, - 0x2F, 0x6F, 0xAF, 0xEF, 0x3F, 0x7F, 0xBF, 0xFF -}; - -static PNG_CONST png_byte fourbppswaptable[256] = { - 0x00, 0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70, - 0x80, 0x90, 0xA0, 0xB0, 0xC0, 0xD0, 0xE0, 0xF0, - 0x01, 0x11, 0x21, 0x31, 0x41, 0x51, 0x61, 0x71, - 0x81, 0x91, 0xA1, 0xB1, 0xC1, 0xD1, 0xE1, 0xF1, - 0x02, 0x12, 0x22, 0x32, 0x42, 0x52, 0x62, 0x72, - 0x82, 0x92, 0xA2, 0xB2, 0xC2, 0xD2, 0xE2, 0xF2, - 0x03, 0x13, 0x23, 0x33, 0x43, 0x53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E, - 0x8E, 0x9E, 0xAE, 0xBE, 0xCE, 0xDE, 0xEE, 0xFE, - 0x0F, 0x1F, 0x2F, 0x3F, 0x4F, 0x5F, 0x6F, 0x7F, - 0x8F, 0x9F, 0xAF, 0xBF, 0xCF, 0xDF, 0xEF, 0xFF -}; - -/* Swaps pixel packing order within bytes */ -void /* PRIVATE */ -png_do_packswap(png_row_infop row_info, png_bytep row) -{ - png_debug(1, "in png_do_packswap"); - if ( -#if defined(PNG_USELESS_TESTS_SUPPORTED) - row != NULL && row_info != NULL && -#endif - row_info->bit_depth < 8) - { - png_bytep rp, end, table; - - end = row + row_info->rowbytes; - - if (row_info->bit_depth == 1) - table = (png_bytep)onebppswaptable; - else if (row_info->bit_depth == 2) - table = (png_bytep)twobppswaptable; - else if (row_info->bit_depth == 4) - table = (png_bytep)fourbppswaptable; - else - return; - - for (rp = row; rp < end; rp++) - *rp = table[*rp]; - } -} -#endif /* PNG_READ_PACKSWAP_SUPPORTED or PNG_WRITE_PACKSWAP_SUPPORTED */ - -#if defined(PNG_WRITE_FILLER_SUPPORTED) || \ - defined(PNG_READ_STRIP_ALPHA_SUPPORTED) -/* Remove filler or alpha byte(s) */ -void /* PRIVATE */ -png_do_strip_filler(png_row_infop row_info, png_bytep row, png_uint_32 flags) -{ - png_debug(1, "in png_do_strip_filler"); -#if defined(PNG_USELESS_TESTS_SUPPORTED) - if (row != NULL && row_info != NULL) -#endif - { - png_bytep sp=row; - png_bytep dp=row; - png_uint_32 row_width=row_info->width; - png_uint_32 i; - - if ((row_info->color_type == PNG_COLOR_TYPE_RGB || - (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA && - (flags & PNG_FLAG_STRIP_ALPHA))) && - row_info->channels == 4) - { - if (row_info->bit_depth == 8) - { - /* This converts from RGBX or RGBA to RGB */ - if (flags & PNG_FLAG_FILLER_AFTER) - { - dp+=3; sp+=4; - for (i = 1; i < row_width; i++) - { - *dp++ = *sp++; - *dp++ = *sp++; - *dp++ = *sp++; - sp++; - } - } - /* This converts from XRGB or ARGB to RGB */ - else - { - for (i = 0; i < row_width; i++) - { - sp++; - *dp++ = *sp++; - *dp++ = *sp++; - *dp++ = *sp++; - } - } - row_info->pixel_depth = 24; - row_info->rowbytes = row_width * 3; - } - else /* if (row_info->bit_depth == 16) */ - { - if (flags & PNG_FLAG_FILLER_AFTER) - { - /* This converts from RRGGBBXX or RRGGBBAA to RRGGBB */ - sp += 8; dp += 6; - for (i = 1; i < row_width; i++) - { - /* This could be (although png_memcpy is probably slower): - png_memcpy(dp, sp, 6); - sp += 8; - dp += 6; - */ - - *dp++ = *sp++; - *dp++ = *sp++; - *dp++ = *sp++; - *dp++ = *sp++; - *dp++ = *sp++; - *dp++ = *sp++; - sp += 2; - } - } - else - { - /* This converts from XXRRGGBB or AARRGGBB to RRGGBB */ - for (i = 0; i < row_width; i++) - { - /* This could be (although png_memcpy is probably slower): - png_memcpy(dp, sp, 6); - sp += 8; - dp += 6; - */ - - sp+=2; - *dp++ = *sp++; - *dp++ = *sp++; - *dp++ = *sp++; - *dp++ = *sp++; - *dp++ = *sp++; - *dp++ = *sp++; - } - } - row_info->pixel_depth = 48; - row_info->rowbytes = row_width * 6; - } - row_info->channels = 3; - } - else if ((row_info->color_type == PNG_COLOR_TYPE_GRAY || - (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA && - (flags & PNG_FLAG_STRIP_ALPHA))) && - row_info->channels == 2) - { - if (row_info->bit_depth == 8) - { - /* This converts from GX or GA to G */ - if (flags & PNG_FLAG_FILLER_AFTER) - { - for (i = 0; i < row_width; i++) - { - *dp++ = *sp++; - sp++; - } - } - /* This converts from XG or AG to G */ - else - { - for (i = 0; i < row_width; i++) - { - sp++; - *dp++ = *sp++; - } - } - row_info->pixel_depth = 8; - row_info->rowbytes = row_width; - } - else /* if (row_info->bit_depth == 16) */ - { - if (flags & PNG_FLAG_FILLER_AFTER) - { - /* This converts from GGXX or GGAA to GG */ - sp += 4; dp += 2; - for (i = 1; i < row_width; i++) - { - *dp++ = *sp++; - *dp++ = *sp++; - sp += 2; - } - } - else - { - /* This converts from XXGG or AAGG to GG */ - for (i = 0; i < row_width; i++) - { - sp += 2; - *dp++ = *sp++; - *dp++ = *sp++; - } - } - row_info->pixel_depth = 16; - row_info->rowbytes = row_width * 2; - } - row_info->channels = 1; - } - if (flags & PNG_FLAG_STRIP_ALPHA) - row_info->color_type &= ~PNG_COLOR_MASK_ALPHA; - } -} -#endif - -#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED) -/* Swaps red and blue bytes within a pixel */ -void /* PRIVATE */ -png_do_bgr(png_row_infop row_info, png_bytep row) -{ - png_debug(1, "in png_do_bgr"); - if ( -#if defined(PNG_USELESS_TESTS_SUPPORTED) - row != NULL && row_info != NULL && -#endif - (row_info->color_type & PNG_COLOR_MASK_COLOR)) - { - png_uint_32 row_width = row_info->width; - if (row_info->bit_depth == 8) - { - if (row_info->color_type == PNG_COLOR_TYPE_RGB) - { - png_bytep rp; - png_uint_32 i; - - for (i = 0, rp = row; i < row_width; i++, rp += 3) - { - png_byte save = *rp; - *rp = *(rp + 2); - *(rp + 2) = save; - } - } - else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) - { - png_bytep rp; - png_uint_32 i; - - for (i = 0, rp = row; i < row_width; i++, rp += 4) - { - png_byte save = *rp; - *rp = *(rp + 2); - *(rp + 2) = save; - } - } - } - else if (row_info->bit_depth == 16) - { - if (row_info->color_type == PNG_COLOR_TYPE_RGB) - { - png_bytep rp; - png_uint_32 i; - - for (i = 0, rp = row; i < row_width; i++, rp += 6) - { - png_byte save = *rp; - *rp = *(rp + 4); - *(rp + 4) = save; - save = *(rp + 1); - *(rp + 1) = *(rp + 5); - *(rp + 5) = save; - } - } - else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) - { - png_bytep rp; - png_uint_32 i; - - for (i = 0, rp = row; i < row_width; i++, rp += 8) - { - png_byte save = *rp; - *rp = *(rp + 4); - *(rp + 4) = save; - save = *(rp + 1); - *(rp + 1) = *(rp + 5); - *(rp + 5) = save; - } - } - } - } -} -#endif /* PNG_READ_BGR_SUPPORTED or PNG_WRITE_BGR_SUPPORTED */ - -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_LEGACY_SUPPORTED) -void PNGAPI -png_set_user_transform_info(png_structp png_ptr, png_voidp - user_transform_ptr, int user_transform_depth, int user_transform_channels) -{ - png_debug(1, "in png_set_user_transform_info"); - if (png_ptr == NULL) - return; -#if defined(PNG_USER_TRANSFORM_PTR_SUPPORTED) - png_ptr->user_transform_ptr = user_transform_ptr; - png_ptr->user_transform_depth = (png_byte)user_transform_depth; - png_ptr->user_transform_channels = (png_byte)user_transform_channels; -#else - if (user_transform_ptr || user_transform_depth || user_transform_channels) - png_warning(png_ptr, - "This version of libpng does not support user transform info"); -#endif -} -#endif - -/* This function returns a pointer to the user_transform_ptr associated with - * the user transform functions. The application should free any memory - * associated with this pointer before png_write_destroy and png_read_destroy - * are called. - */ -png_voidp PNGAPI -png_get_user_transform_ptr(png_structp png_ptr) -{ - if (png_ptr == NULL) - return (NULL); -#if defined(PNG_USER_TRANSFORM_PTR_SUPPORTED) - return ((png_voidp)png_ptr->user_transform_ptr); -#else - return (NULL); -#endif -} -#endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */ diff --git a/src/libpng/pngwio.c b/src/libpng/pngwio.c deleted file mode 100644 index 4ecab7df4..000000000 --- a/src/libpng/pngwio.c +++ /dev/null @@ -1,256 +0,0 @@ - -/* pngwio.c - functions for data output - * - * Last changed in libpng 1.2.37 [June 4, 2009] - * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2009 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - * - * This file provides a location for all output. Users who need - * special handling are expected to write functions that have the same - * arguments as these and perform similar functions, but that possibly - * use different output methods. Note that you shouldn't change these - * functions, but rather write replacement functions and then change - * them at run time with png_set_write_fn(...). - */ - -#define PNG_INTERNAL -#include "png.h" -#ifdef PNG_WRITE_SUPPORTED - -/* Write the data to whatever output you are using. The default routine - * writes to a file pointer. Note that this routine sometimes gets called - * with very small lengths, so you should implement some kind of simple - * buffering if you are using unbuffered writes. This should never be asked - * to write more than 64K on a 16 bit machine. - */ - -void /* PRIVATE */ -png_write_data(png_structp png_ptr, png_bytep data, png_size_t length) -{ - if (png_ptr->write_data_fn != NULL ) - (*(png_ptr->write_data_fn))(png_ptr, data, length); - else - png_error(png_ptr, "Call to NULL write function"); -} - -#if !defined(PNG_NO_STDIO) -/* This is the function that does the actual writing of data. If you are - * not writing to a standard C stream, you should create a replacement - * write_data function and use it at run time with png_set_write_fn(), rather - * than changing the library. - */ -#ifndef USE_FAR_KEYWORD -void PNGAPI -png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length) -{ - png_uint_32 check; - - if (png_ptr == NULL) - return; -#if defined(_WIN32_WCE) - if ( !WriteFile((HANDLE)(png_ptr->io_ptr), data, length, &check, NULL) ) - check = 0; -#else - check = fwrite(data, 1, length, (png_FILE_p)(png_ptr->io_ptr)); -#endif - if (check != length) - png_error(png_ptr, "Write Error"); -} -#else -/* This is the model-independent version. Since the standard I/O library - * can't handle far buffers in the medium and small models, we have to copy - * the data. - */ - -#define NEAR_BUF_SIZE 1024 -#define MIN(a,b) (a <= b ? a : b) - -void PNGAPI -png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length) -{ - png_uint_32 check; - png_byte *near_data; /* Needs to be "png_byte *" instead of "png_bytep" */ - png_FILE_p io_ptr; - - if (png_ptr == NULL) - return; - /* Check if data really is near. If so, use usual code. */ - near_data = (png_byte *)CVT_PTR_NOCHECK(data); - io_ptr = (png_FILE_p)CVT_PTR(png_ptr->io_ptr); - if ((png_bytep)near_data == data) - { -#if defined(_WIN32_WCE) - if ( !WriteFile(io_ptr, near_data, length, &check, NULL) ) - check = 0; -#else - check = fwrite(near_data, 1, length, io_ptr); -#endif - } - else - { - png_byte buf[NEAR_BUF_SIZE]; - png_size_t written, remaining, err; - check = 0; - remaining = length; - do - { - written = MIN(NEAR_BUF_SIZE, remaining); - png_memcpy(buf, data, written); /* Copy far buffer to near buffer */ -#if defined(_WIN32_WCE) - if ( !WriteFile(io_ptr, buf, written, &err, NULL) ) - err = 0; -#else - err = fwrite(buf, 1, written, io_ptr); -#endif - if (err != written) - break; - - else - check += err; - - data += written; - remaining -= written; - } - while (remaining != 0); - } - if (check != length) - png_error(png_ptr, "Write Error"); -} - -#endif -#endif - -/* This function is called to output any data pending writing (normally - * to disk). After png_flush is called, there should be no data pending - * writing in any buffers. - */ -#if defined(PNG_WRITE_FLUSH_SUPPORTED) -void /* PRIVATE */ -png_flush(png_structp png_ptr) -{ - if (png_ptr->output_flush_fn != NULL) - (*(png_ptr->output_flush_fn))(png_ptr); -} - -#if !defined(PNG_NO_STDIO) -void PNGAPI -png_default_flush(png_structp png_ptr) -{ -#if !defined(_WIN32_WCE) - png_FILE_p io_ptr; -#endif - if (png_ptr == NULL) - return; -#if !defined(_WIN32_WCE) - io_ptr = (png_FILE_p)CVT_PTR((png_ptr->io_ptr)); - fflush(io_ptr); -#endif -} -#endif -#endif - -/* This function allows the application to supply new output functions for - * libpng if standard C streams aren't being used. - * - * This function takes as its arguments: - * png_ptr - pointer to a png output data structure - * io_ptr - pointer to user supplied structure containing info about - * the output functions. May be NULL. - * write_data_fn - pointer to a new output function that takes as its - * arguments a pointer to a png_struct, a pointer to - * data to be written, and a 32-bit unsigned int that is - * the number of bytes to be written. The new write - * function should call png_error(png_ptr, "Error msg") - * to exit and output any fatal error messages. May be - * NULL, in which case libpng's default function will - * be used. - * flush_data_fn - pointer to a new flush function that takes as its - * arguments a pointer to a png_struct. After a call to - * the flush function, there should be no data in any buffers - * or pending transmission. If the output method doesn't do - * any buffering of ouput, a function prototype must still be - * supplied although it doesn't have to do anything. If - * PNG_WRITE_FLUSH_SUPPORTED is not defined at libpng compile - * time, output_flush_fn will be ignored, although it must be - * supplied for compatibility. May be NULL, in which case - * libpng's default function will be used, if - * PNG_WRITE_FLUSH_SUPPORTED is defined. This is not - * a good idea if io_ptr does not point to a standard - * *FILE structure. - */ -void PNGAPI -png_set_write_fn(png_structp png_ptr, png_voidp io_ptr, - png_rw_ptr write_data_fn, png_flush_ptr output_flush_fn) -{ - if (png_ptr == NULL) - return; - - png_ptr->io_ptr = io_ptr; - -#if !defined(PNG_NO_STDIO) - if (write_data_fn != NULL) - png_ptr->write_data_fn = write_data_fn; - - else - png_ptr->write_data_fn = png_default_write_data; -#else - png_ptr->write_data_fn = write_data_fn; -#endif - -#if defined(PNG_WRITE_FLUSH_SUPPORTED) -#if !defined(PNG_NO_STDIO) - if (output_flush_fn != NULL) - png_ptr->output_flush_fn = output_flush_fn; - - else - png_ptr->output_flush_fn = png_default_flush; -#else - png_ptr->output_flush_fn = output_flush_fn; -#endif -#endif /* PNG_WRITE_FLUSH_SUPPORTED */ - - /* It is an error to read while writing a png file */ - if (png_ptr->read_data_fn != NULL) - { - png_ptr->read_data_fn = NULL; - png_warning(png_ptr, - "Attempted to set both read_data_fn and write_data_fn in"); - png_warning(png_ptr, - "the same structure. Resetting read_data_fn to NULL."); - } -} - -#if defined(USE_FAR_KEYWORD) -#if defined(_MSC_VER) -void *png_far_to_near(png_structp png_ptr, png_voidp ptr, int check) -{ - void *near_ptr; - void FAR *far_ptr; - FP_OFF(near_ptr) = FP_OFF(ptr); - far_ptr = (void FAR *)near_ptr; - - if (check != 0) - if (FP_SEG(ptr) != FP_SEG(far_ptr)) - png_error(png_ptr, "segment lost in conversion"); - - return(near_ptr); -} -# else -void *png_far_to_near(png_structp png_ptr, png_voidp ptr, int check) -{ - void *near_ptr; - void FAR *far_ptr; - near_ptr = (void FAR *)ptr; - far_ptr = (void FAR *)near_ptr; - - if (check != 0) - if (far_ptr != ptr) - png_error(png_ptr, "segment lost in conversion"); - - return(near_ptr); -} -# endif -# endif -#endif /* PNG_WRITE_SUPPORTED */ diff --git a/src/libpng/pngwrite.c b/src/libpng/pngwrite.c deleted file mode 100644 index 8654083c9..000000000 --- a/src/libpng/pngwrite.c +++ /dev/null @@ -1,1558 +0,0 @@ - -/* pngwrite.c - general routines to write a PNG file - * - * Last changed in libpng 1.2.37 [June 4, 2009] - * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2009 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - */ - -/* Get internal access to png.h */ -#define PNG_INTERNAL -#include "png.h" -#ifdef PNG_WRITE_SUPPORTED - -/* Writes all the PNG information. This is the suggested way to use the - * library. If you have a new chunk to add, make a function to write it, - * and put it in the correct location here. If you want the chunk written - * after the image data, put it in png_write_end(). I strongly encourage - * you to supply a PNG_INFO_ flag, and check info_ptr->valid before writing - * the chunk, as that will keep the code from breaking if you want to just - * write a plain PNG file. If you have long comments, I suggest writing - * them in png_write_end(), and compressing them. - */ -void PNGAPI -png_write_info_before_PLTE(png_structp png_ptr, png_infop info_ptr) -{ - png_debug(1, "in png_write_info_before_PLTE"); - if (png_ptr == NULL || info_ptr == NULL) - return; - if (!(png_ptr->mode & PNG_WROTE_INFO_BEFORE_PLTE)) - { - png_write_sig(png_ptr); /* Write PNG signature */ -#if defined(PNG_MNG_FEATURES_SUPPORTED) - if ((png_ptr->mode&PNG_HAVE_PNG_SIGNATURE)&&(png_ptr->mng_features_permitted)) - { - png_warning(png_ptr, "MNG features are not allowed in a PNG datastream"); - png_ptr->mng_features_permitted=0; - } -#endif - /* Write IHDR information. */ - png_write_IHDR(png_ptr, info_ptr->width, info_ptr->height, - info_ptr->bit_depth, info_ptr->color_type, info_ptr->compression_type, - info_ptr->filter_type, -#if defined(PNG_WRITE_INTERLACING_SUPPORTED) - info_ptr->interlace_type); -#else - 0); -#endif - /* The rest of these check to see if the valid field has the appropriate - * flag set, and if it does, writes the chunk. - */ -#if defined(PNG_WRITE_gAMA_SUPPORTED) - if (info_ptr->valid & PNG_INFO_gAMA) - { -# ifdef PNG_FLOATING_POINT_SUPPORTED - png_write_gAMA(png_ptr, info_ptr->gamma); -#else -#ifdef PNG_FIXED_POINT_SUPPORTED - png_write_gAMA_fixed(png_ptr, info_ptr->int_gamma); -# endif -#endif - } -#endif -#if defined(PNG_WRITE_sRGB_SUPPORTED) - if (info_ptr->valid & PNG_INFO_sRGB) - png_write_sRGB(png_ptr, (int)info_ptr->srgb_intent); -#endif -#if defined(PNG_WRITE_iCCP_SUPPORTED) - if (info_ptr->valid & PNG_INFO_iCCP) - png_write_iCCP(png_ptr, info_ptr->iccp_name, PNG_COMPRESSION_TYPE_BASE, - info_ptr->iccp_profile, (int)info_ptr->iccp_proflen); -#endif -#if defined(PNG_WRITE_sBIT_SUPPORTED) - if (info_ptr->valid & PNG_INFO_sBIT) - png_write_sBIT(png_ptr, &(info_ptr->sig_bit), info_ptr->color_type); -#endif -#if defined(PNG_WRITE_cHRM_SUPPORTED) - if (info_ptr->valid & PNG_INFO_cHRM) - { -#ifdef PNG_FLOATING_POINT_SUPPORTED - png_write_cHRM(png_ptr, - info_ptr->x_white, info_ptr->y_white, - info_ptr->x_red, info_ptr->y_red, - info_ptr->x_green, info_ptr->y_green, - info_ptr->x_blue, info_ptr->y_blue); -#else -# ifdef PNG_FIXED_POINT_SUPPORTED - png_write_cHRM_fixed(png_ptr, - info_ptr->int_x_white, info_ptr->int_y_white, - info_ptr->int_x_red, info_ptr->int_y_red, - info_ptr->int_x_green, info_ptr->int_y_green, - info_ptr->int_x_blue, info_ptr->int_y_blue); -# endif -#endif - } -#endif -#if defined(PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED) - if (info_ptr->unknown_chunks_num) - { - png_unknown_chunk *up; - - png_debug(5, "writing extra chunks"); - - for (up = info_ptr->unknown_chunks; - up < info_ptr->unknown_chunks + info_ptr->unknown_chunks_num; - up++) - { - int keep=png_handle_as_unknown(png_ptr, up->name); - if (keep != PNG_HANDLE_CHUNK_NEVER && - up->location && !(up->location & PNG_HAVE_PLTE) && - !(up->location & PNG_HAVE_IDAT) && - ((up->name[3] & 0x20) || keep == PNG_HANDLE_CHUNK_ALWAYS || - (png_ptr->flags & PNG_FLAG_KEEP_UNSAFE_CHUNKS))) - { - if (up->size == 0) - png_warning(png_ptr, "Writing zero-length unknown chunk"); - png_write_chunk(png_ptr, up->name, up->data, up->size); - } - } - } -#endif - png_ptr->mode |= PNG_WROTE_INFO_BEFORE_PLTE; - } -} - -void PNGAPI -png_write_info(png_structp png_ptr, png_infop info_ptr) -{ -#if defined(PNG_WRITE_TEXT_SUPPORTED) || defined(PNG_WRITE_sPLT_SUPPORTED) - int i; -#endif - - png_debug(1, "in png_write_info"); - - if (png_ptr == NULL || info_ptr == NULL) - return; - - png_write_info_before_PLTE(png_ptr, info_ptr); - - if (info_ptr->valid & PNG_INFO_PLTE) - png_write_PLTE(png_ptr, info_ptr->palette, - (png_uint_32)info_ptr->num_palette); - else if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - png_error(png_ptr, "Valid palette required for paletted images"); - -#if defined(PNG_WRITE_tRNS_SUPPORTED) - if (info_ptr->valid & PNG_INFO_tRNS) - { -#if defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED) - /* Invert the alpha channel (in tRNS) */ - if ((png_ptr->transformations & PNG_INVERT_ALPHA) && - info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - { - int j; - for (j=0; j<(int)info_ptr->num_trans; j++) - info_ptr->trans[j] = (png_byte)(255 - info_ptr->trans[j]); - } -#endif - png_write_tRNS(png_ptr, info_ptr->trans, &(info_ptr->trans_values), - info_ptr->num_trans, info_ptr->color_type); - } -#endif -#if defined(PNG_WRITE_bKGD_SUPPORTED) - if (info_ptr->valid & PNG_INFO_bKGD) - png_write_bKGD(png_ptr, &(info_ptr->background), info_ptr->color_type); -#endif -#if defined(PNG_WRITE_hIST_SUPPORTED) - if (info_ptr->valid & PNG_INFO_hIST) - png_write_hIST(png_ptr, info_ptr->hist, info_ptr->num_palette); -#endif -#if defined(PNG_WRITE_oFFs_SUPPORTED) - if (info_ptr->valid & PNG_INFO_oFFs) - png_write_oFFs(png_ptr, info_ptr->x_offset, info_ptr->y_offset, - info_ptr->offset_unit_type); -#endif -#if defined(PNG_WRITE_pCAL_SUPPORTED) - if (info_ptr->valid & PNG_INFO_pCAL) - png_write_pCAL(png_ptr, info_ptr->pcal_purpose, info_ptr->pcal_X0, - info_ptr->pcal_X1, info_ptr->pcal_type, info_ptr->pcal_nparams, - info_ptr->pcal_units, info_ptr->pcal_params); -#endif - -#if defined(PNG_sCAL_SUPPORTED) - if (info_ptr->valid & PNG_INFO_sCAL) -#if defined(PNG_WRITE_sCAL_SUPPORTED) -#if defined(PNG_FLOATING_POINT_SUPPORTED) && !defined(PNG_NO_STDIO) - png_write_sCAL(png_ptr, (int)info_ptr->scal_unit, - info_ptr->scal_pixel_width, info_ptr->scal_pixel_height); -#else /* !FLOATING_POINT */ -#ifdef PNG_FIXED_POINT_SUPPORTED - png_write_sCAL_s(png_ptr, (int)info_ptr->scal_unit, - info_ptr->scal_s_width, info_ptr->scal_s_height); -#endif /* FIXED_POINT */ -#endif /* FLOATING_POINT */ -#else /* !WRITE_sCAL */ - png_warning(png_ptr, - "png_write_sCAL not supported; sCAL chunk not written."); -#endif /* WRITE_sCAL */ -#endif /* sCAL */ - -#if defined(PNG_WRITE_pHYs_SUPPORTED) - if (info_ptr->valid & PNG_INFO_pHYs) - png_write_pHYs(png_ptr, info_ptr->x_pixels_per_unit, - info_ptr->y_pixels_per_unit, info_ptr->phys_unit_type); -#endif /* pHYs */ - -#if defined(PNG_WRITE_tIME_SUPPORTED) - if (info_ptr->valid & PNG_INFO_tIME) - { - png_write_tIME(png_ptr, &(info_ptr->mod_time)); - png_ptr->mode |= PNG_WROTE_tIME; - } -#endif /* tIME */ - -#if defined(PNG_WRITE_sPLT_SUPPORTED) - if (info_ptr->valid & PNG_INFO_sPLT) - for (i = 0; i < (int)info_ptr->splt_palettes_num; i++) - png_write_sPLT(png_ptr, info_ptr->splt_palettes + i); -#endif /* sPLT */ - -#if defined(PNG_WRITE_TEXT_SUPPORTED) - /* Check to see if we need to write text chunks */ - for (i = 0; i < info_ptr->num_text; i++) - { - png_debug2(2, "Writing header text chunk %d, type %d", i, - info_ptr->text[i].compression); - /* An internationalized chunk? */ - if (info_ptr->text[i].compression > 0) - { -#if defined(PNG_WRITE_iTXt_SUPPORTED) - /* Write international chunk */ - png_write_iTXt(png_ptr, - info_ptr->text[i].compression, - info_ptr->text[i].key, - info_ptr->text[i].lang, - info_ptr->text[i].lang_key, - info_ptr->text[i].text); -#else - png_warning(png_ptr, "Unable to write international text"); -#endif - /* Mark this chunk as written */ - info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_NONE_WR; - } - /* If we want a compressed text chunk */ - else if (info_ptr->text[i].compression == PNG_TEXT_COMPRESSION_zTXt) - { -#if defined(PNG_WRITE_zTXt_SUPPORTED) - /* Write compressed chunk */ - png_write_zTXt(png_ptr, info_ptr->text[i].key, - info_ptr->text[i].text, 0, - info_ptr->text[i].compression); -#else - png_warning(png_ptr, "Unable to write compressed text"); -#endif - /* Mark this chunk as written */ - info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_zTXt_WR; - } - else if (info_ptr->text[i].compression == PNG_TEXT_COMPRESSION_NONE) - { -#if defined(PNG_WRITE_tEXt_SUPPORTED) - /* Write uncompressed chunk */ - png_write_tEXt(png_ptr, info_ptr->text[i].key, - info_ptr->text[i].text, - 0); - /* Mark this chunk as written */ - info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_NONE_WR; -#else - /* Can't get here */ - png_warning(png_ptr, "Unable to write uncompressed text"); -#endif - } - } -#endif /* tEXt */ - -#if defined(PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED) - if (info_ptr->unknown_chunks_num) - { - png_unknown_chunk *up; - - png_debug(5, "writing extra chunks"); - - for (up = info_ptr->unknown_chunks; - up < info_ptr->unknown_chunks + info_ptr->unknown_chunks_num; - up++) - { - int keep=png_handle_as_unknown(png_ptr, up->name); - if (keep != PNG_HANDLE_CHUNK_NEVER && - up->location && (up->location & PNG_HAVE_PLTE) && - !(up->location & PNG_HAVE_IDAT) && - ((up->name[3] & 0x20) || keep == PNG_HANDLE_CHUNK_ALWAYS || - (png_ptr->flags & PNG_FLAG_KEEP_UNSAFE_CHUNKS))) - { - png_write_chunk(png_ptr, up->name, up->data, up->size); - } - } - } -#endif -} - -/* Writes the end of the PNG file. If you don't want to write comments or - * time information, you can pass NULL for info. If you already wrote these - * in png_write_info(), do not write them again here. If you have long - * comments, I suggest writing them here, and compressing them. - */ -void PNGAPI -png_write_end(png_structp png_ptr, png_infop info_ptr) -{ - png_debug(1, "in png_write_end"); - if (png_ptr == NULL) - return; - if (!(png_ptr->mode & PNG_HAVE_IDAT)) - png_error(png_ptr, "No IDATs written into file"); - - /* See if user wants us to write information chunks */ - if (info_ptr != NULL) - { -#if defined(PNG_WRITE_TEXT_SUPPORTED) - int i; /* Local index variable */ -#endif -#if defined(PNG_WRITE_tIME_SUPPORTED) - /* Check to see if user has supplied a time chunk */ - if ((info_ptr->valid & PNG_INFO_tIME) && - !(png_ptr->mode & PNG_WROTE_tIME)) - png_write_tIME(png_ptr, &(info_ptr->mod_time)); -#endif -#if defined(PNG_WRITE_TEXT_SUPPORTED) - /* Loop through comment chunks */ - for (i = 0; i < info_ptr->num_text; i++) - { - png_debug2(2, "Writing trailer text chunk %d, type %d", i, - info_ptr->text[i].compression); - /* An internationalized chunk? */ - if (info_ptr->text[i].compression > 0) - { -#if defined(PNG_WRITE_iTXt_SUPPORTED) - /* Write international chunk */ - png_write_iTXt(png_ptr, - info_ptr->text[i].compression, - info_ptr->text[i].key, - info_ptr->text[i].lang, - info_ptr->text[i].lang_key, - info_ptr->text[i].text); -#else - png_warning(png_ptr, "Unable to write international text"); -#endif - /* Mark this chunk as written */ - info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_NONE_WR; - } - else if (info_ptr->text[i].compression >= PNG_TEXT_COMPRESSION_zTXt) - { -#if defined(PNG_WRITE_zTXt_SUPPORTED) - /* Write compressed chunk */ - png_write_zTXt(png_ptr, info_ptr->text[i].key, - info_ptr->text[i].text, 0, - info_ptr->text[i].compression); -#else - png_warning(png_ptr, "Unable to write compressed text"); -#endif - /* Mark this chunk as written */ - info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_zTXt_WR; - } - else if (info_ptr->text[i].compression == PNG_TEXT_COMPRESSION_NONE) - { -#if defined(PNG_WRITE_tEXt_SUPPORTED) - /* Write uncompressed chunk */ - png_write_tEXt(png_ptr, info_ptr->text[i].key, - info_ptr->text[i].text, 0); -#else - png_warning(png_ptr, "Unable to write uncompressed text"); -#endif - - /* Mark this chunk as written */ - info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_NONE_WR; - } - } -#endif -#if defined(PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED) - if (info_ptr->unknown_chunks_num) - { - png_unknown_chunk *up; - - png_debug(5, "writing extra chunks"); - - for (up = info_ptr->unknown_chunks; - up < info_ptr->unknown_chunks + info_ptr->unknown_chunks_num; - up++) - { - int keep=png_handle_as_unknown(png_ptr, up->name); - if (keep != PNG_HANDLE_CHUNK_NEVER && - up->location && (up->location & PNG_AFTER_IDAT) && - ((up->name[3] & 0x20) || keep == PNG_HANDLE_CHUNK_ALWAYS || - (png_ptr->flags & PNG_FLAG_KEEP_UNSAFE_CHUNKS))) - { - png_write_chunk(png_ptr, up->name, up->data, up->size); - } - } - } -#endif - } - - png_ptr->mode |= PNG_AFTER_IDAT; - - /* Write end of PNG file */ - png_write_IEND(png_ptr); - /* This flush, added in libpng-1.0.8, removed from libpng-1.0.9beta03, - * and restored again in libpng-1.2.30, may cause some applications that - * do not set png_ptr->output_flush_fn to crash. If your application - * experiences a problem, please try building libpng with - * PNG_WRITE_FLUSH_AFTER_IEND_SUPPORTED defined, and report the event to - * png-mng-implement at lists.sf.net . This kludge will be removed - * from libpng-1.4.0. - */ -#if defined(PNG_WRITE_FLUSH_SUPPORTED) && \ - defined(PNG_WRITE_FLUSH_AFTER_IEND_SUPPORTED) - png_flush(png_ptr); -#endif -} - -#if defined(PNG_WRITE_tIME_SUPPORTED) -#if !defined(_WIN32_WCE) -/* "time.h" functions are not supported on WindowsCE */ -void PNGAPI -png_convert_from_struct_tm(png_timep ptime, struct tm FAR * ttime) -{ - png_debug(1, "in png_convert_from_struct_tm"); - ptime->year = (png_uint_16)(1900 + ttime->tm_year); - ptime->month = (png_byte)(ttime->tm_mon + 1); - ptime->day = (png_byte)ttime->tm_mday; - ptime->hour = (png_byte)ttime->tm_hour; - ptime->minute = (png_byte)ttime->tm_min; - ptime->second = (png_byte)ttime->tm_sec; -} - -void PNGAPI -png_convert_from_time_t(png_timep ptime, time_t ttime) -{ - struct tm *tbuf; - - png_debug(1, "in png_convert_from_time_t"); - tbuf = gmtime(&ttime); - png_convert_from_struct_tm(ptime, tbuf); -} -#endif -#endif - -/* Initialize png_ptr structure, and allocate any memory needed */ -png_structp PNGAPI -png_create_write_struct(png_const_charp user_png_ver, png_voidp error_ptr, - png_error_ptr error_fn, png_error_ptr warn_fn) -{ -#ifdef PNG_USER_MEM_SUPPORTED - return (png_create_write_struct_2(user_png_ver, error_ptr, error_fn, - warn_fn, png_voidp_NULL, png_malloc_ptr_NULL, png_free_ptr_NULL)); -} - -/* Alternate initialize png_ptr structure, and allocate any memory needed */ -png_structp PNGAPI -png_create_write_struct_2(png_const_charp user_png_ver, png_voidp error_ptr, - png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr, - png_malloc_ptr malloc_fn, png_free_ptr free_fn) -{ -#endif /* PNG_USER_MEM_SUPPORTED */ -#ifdef PNG_SETJMP_SUPPORTED - volatile -#endif - png_structp png_ptr; -#ifdef PNG_SETJMP_SUPPORTED -#ifdef USE_FAR_KEYWORD - jmp_buf jmpbuf; -#endif -#endif - int i; - png_debug(1, "in png_create_write_struct"); -#ifdef PNG_USER_MEM_SUPPORTED - png_ptr = (png_structp)png_create_struct_2(PNG_STRUCT_PNG, - (png_malloc_ptr)malloc_fn, (png_voidp)mem_ptr); -#else - png_ptr = (png_structp)png_create_struct(PNG_STRUCT_PNG); -#endif /* PNG_USER_MEM_SUPPORTED */ - if (png_ptr == NULL) - return (NULL); - - /* Added at libpng-1.2.6 */ -#ifdef PNG_SET_USER_LIMITS_SUPPORTED - png_ptr->user_width_max=PNG_USER_WIDTH_MAX; - png_ptr->user_height_max=PNG_USER_HEIGHT_MAX; -#endif - -#ifdef PNG_SETJMP_SUPPORTED -#ifdef USE_FAR_KEYWORD - if (setjmp(jmpbuf)) -#else - if (setjmp(png_ptr->jmpbuf)) -#endif - { - png_free(png_ptr, png_ptr->zbuf); - png_ptr->zbuf=NULL; - png_destroy_struct(png_ptr); - return (NULL); - } -#ifdef USE_FAR_KEYWORD - png_memcpy(png_ptr->jmpbuf, jmpbuf, png_sizeof(jmp_buf)); -#endif -#endif - -#ifdef PNG_USER_MEM_SUPPORTED - png_set_mem_fn(png_ptr, mem_ptr, malloc_fn, free_fn); -#endif /* PNG_USER_MEM_SUPPORTED */ - png_set_error_fn(png_ptr, error_ptr, error_fn, warn_fn); - - if (user_png_ver) - { - i=0; - do - { - if (user_png_ver[i] != png_libpng_ver[i]) - png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH; - } while (png_libpng_ver[i++]); - } - - if (png_ptr->flags & PNG_FLAG_LIBRARY_MISMATCH) - { - /* Libpng 0.90 and later are binary incompatible with libpng 0.89, so - * we must recompile any applications that use any older library version. - * For versions after libpng 1.0, we will be compatible, so we need - * only check the first digit. - */ - if (user_png_ver == NULL || user_png_ver[0] != png_libpng_ver[0] || - (user_png_ver[0] == '1' && user_png_ver[2] != png_libpng_ver[2]) || - (user_png_ver[0] == '0' && user_png_ver[2] < '9')) - { -#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE) - char msg[80]; - if (user_png_ver) - { - png_snprintf(msg, 80, - "Application was compiled with png.h from libpng-%.20s", - user_png_ver); - png_warning(png_ptr, msg); - } - png_snprintf(msg, 80, - "Application is running with png.c from libpng-%.20s", - png_libpng_ver); - png_warning(png_ptr, msg); -#endif -#ifdef PNG_ERROR_NUMBERS_SUPPORTED - png_ptr->flags=0; -#endif - png_error(png_ptr, - "Incompatible libpng version in application and library"); - } - } - - /* Initialize zbuf - compression buffer */ - png_ptr->zbuf_size = PNG_ZBUF_SIZE; - png_ptr->zbuf = (png_bytep)png_malloc(png_ptr, - (png_uint_32)png_ptr->zbuf_size); - - png_set_write_fn(png_ptr, png_voidp_NULL, png_rw_ptr_NULL, - png_flush_ptr_NULL); - -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) - png_set_filter_heuristics(png_ptr, PNG_FILTER_HEURISTIC_DEFAULT, - 1, png_doublep_NULL, png_doublep_NULL); -#endif - -#ifdef PNG_SETJMP_SUPPORTED -/* Applications that neglect to set up their own setjmp() and then encounter - a png_error() will longjmp here. Since the jmpbuf is then meaningless we - abort instead of returning. */ -#ifdef USE_FAR_KEYWORD - if (setjmp(jmpbuf)) - PNG_ABORT(); - png_memcpy(png_ptr->jmpbuf, jmpbuf, png_sizeof(jmp_buf)); -#else - if (setjmp(png_ptr->jmpbuf)) - PNG_ABORT(); -#endif -#endif - return (png_ptr); -} - -/* Initialize png_ptr structure, and allocate any memory needed */ -#if defined(PNG_1_0_X) || defined(PNG_1_2_X) -/* Deprecated. */ -#undef png_write_init -void PNGAPI -png_write_init(png_structp png_ptr) -{ - /* We only come here via pre-1.0.7-compiled applications */ - png_write_init_2(png_ptr, "1.0.6 or earlier", 0, 0); -} - -void PNGAPI -png_write_init_2(png_structp png_ptr, png_const_charp user_png_ver, - png_size_t png_struct_size, png_size_t png_info_size) -{ - /* We only come here via pre-1.0.12-compiled applications */ - if (png_ptr == NULL) return; -#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE) - if (png_sizeof(png_struct) > png_struct_size || - png_sizeof(png_info) > png_info_size) - { - char msg[80]; - png_ptr->warning_fn=NULL; - if (user_png_ver) - { - png_snprintf(msg, 80, - "Application was compiled with png.h from libpng-%.20s", - user_png_ver); - png_warning(png_ptr, msg); - } - png_snprintf(msg, 80, - "Application is running with png.c from libpng-%.20s", - png_libpng_ver); - png_warning(png_ptr, msg); - } -#endif - if (png_sizeof(png_struct) > png_struct_size) - { - png_ptr->error_fn=NULL; -#ifdef PNG_ERROR_NUMBERS_SUPPORTED - png_ptr->flags=0; -#endif - png_error(png_ptr, - "The png struct allocated by the application for writing is too small."); - } - if (png_sizeof(png_info) > png_info_size) - { - png_ptr->error_fn=NULL; -#ifdef PNG_ERROR_NUMBERS_SUPPORTED - png_ptr->flags=0; -#endif - png_error(png_ptr, - "The info struct allocated by the application for writing is too small."); - } - png_write_init_3(&png_ptr, user_png_ver, png_struct_size); -} -#endif /* PNG_1_0_X || PNG_1_2_X */ - - -void PNGAPI -png_write_init_3(png_structpp ptr_ptr, png_const_charp user_png_ver, - png_size_t png_struct_size) -{ - png_structp png_ptr=*ptr_ptr; -#ifdef PNG_SETJMP_SUPPORTED - jmp_buf tmp_jmp; /* To save current jump buffer */ -#endif - - int i = 0; - - if (png_ptr == NULL) - return; - - do - { - if (user_png_ver[i] != png_libpng_ver[i]) - { -#ifdef PNG_LEGACY_SUPPORTED - png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH; -#else - png_ptr->warning_fn=NULL; - png_warning(png_ptr, - "Application uses deprecated png_write_init() and should be recompiled."); - break; -#endif - } - } while (png_libpng_ver[i++]); - - png_debug(1, "in png_write_init_3"); - -#ifdef PNG_SETJMP_SUPPORTED - /* Save jump buffer and error functions */ - png_memcpy(tmp_jmp, png_ptr->jmpbuf, png_sizeof(jmp_buf)); -#endif - - if (png_sizeof(png_struct) > png_struct_size) - { - png_destroy_struct(png_ptr); - png_ptr = (png_structp)png_create_struct(PNG_STRUCT_PNG); - *ptr_ptr = png_ptr; - } - - /* Reset all variables to 0 */ - png_memset(png_ptr, 0, png_sizeof(png_struct)); - - /* Added at libpng-1.2.6 */ -#ifdef PNG_SET_USER_LIMITS_SUPPORTED - png_ptr->user_width_max=PNG_USER_WIDTH_MAX; - png_ptr->user_height_max=PNG_USER_HEIGHT_MAX; -#endif - -#ifdef PNG_SETJMP_SUPPORTED - /* Restore jump buffer */ - png_memcpy(png_ptr->jmpbuf, tmp_jmp, png_sizeof(jmp_buf)); -#endif - - png_set_write_fn(png_ptr, png_voidp_NULL, png_rw_ptr_NULL, - png_flush_ptr_NULL); - - /* Initialize zbuf - compression buffer */ - png_ptr->zbuf_size = PNG_ZBUF_SIZE; - png_ptr->zbuf = (png_bytep)png_malloc(png_ptr, - (png_uint_32)png_ptr->zbuf_size); - -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) - png_set_filter_heuristics(png_ptr, PNG_FILTER_HEURISTIC_DEFAULT, - 1, png_doublep_NULL, png_doublep_NULL); -#endif -} - -/* Write a few rows of image data. If the image is interlaced, - * either you will have to write the 7 sub images, or, if you - * have called png_set_interlace_handling(), you will have to - * "write" the image seven times. - */ -void PNGAPI -png_write_rows(png_structp png_ptr, png_bytepp row, - png_uint_32 num_rows) -{ - png_uint_32 i; /* Row counter */ - png_bytepp rp; /* Row pointer */ - - png_debug(1, "in png_write_rows"); - - if (png_ptr == NULL) - return; - - /* Loop through the rows */ - for (i = 0, rp = row; i < num_rows; i++, rp++) - { - png_write_row(png_ptr, *rp); - } -} - -/* Write the image. You only need to call this function once, even - * if you are writing an interlaced image. - */ -void PNGAPI -png_write_image(png_structp png_ptr, png_bytepp image) -{ - png_uint_32 i; /* Row index */ - int pass, num_pass; /* Pass variables */ - png_bytepp rp; /* Points to current row */ - - if (png_ptr == NULL) - return; - - png_debug(1, "in png_write_image"); -#if defined(PNG_WRITE_INTERLACING_SUPPORTED) - /* Initialize interlace handling. If image is not interlaced, - * this will set pass to 1 - */ - num_pass = png_set_interlace_handling(png_ptr); -#else - num_pass = 1; -#endif - /* Loop through passes */ - for (pass = 0; pass < num_pass; pass++) - { - /* Loop through image */ - for (i = 0, rp = image; i < png_ptr->height; i++, rp++) - { - png_write_row(png_ptr, *rp); - } - } -} - -/* Called by user to write a row of image data */ -void PNGAPI -png_write_row(png_structp png_ptr, png_bytep row) -{ - if (png_ptr == NULL) - return; - png_debug2(1, "in png_write_row (row %ld, pass %d)", - png_ptr->row_number, png_ptr->pass); - - /* Initialize transformations and other stuff if first time */ - if (png_ptr->row_number == 0 && png_ptr->pass == 0) - { - /* Make sure we wrote the header info */ - if (!(png_ptr->mode & PNG_WROTE_INFO_BEFORE_PLTE)) - png_error(png_ptr, - "png_write_info was never called before png_write_row."); - - /* Check for transforms that have been set but were defined out */ -#if !defined(PNG_WRITE_INVERT_SUPPORTED) && defined(PNG_READ_INVERT_SUPPORTED) - if (png_ptr->transformations & PNG_INVERT_MONO) - png_warning(png_ptr, "PNG_WRITE_INVERT_SUPPORTED is not defined."); -#endif -#if !defined(PNG_WRITE_FILLER_SUPPORTED) && defined(PNG_READ_FILLER_SUPPORTED) - if (png_ptr->transformations & PNG_FILLER) - png_warning(png_ptr, "PNG_WRITE_FILLER_SUPPORTED is not defined."); -#endif -#if !defined(PNG_WRITE_PACKSWAP_SUPPORTED) && defined(PNG_READ_PACKSWAP_SUPPORTED) - if (png_ptr->transformations & PNG_PACKSWAP) - png_warning(png_ptr, "PNG_WRITE_PACKSWAP_SUPPORTED is not defined."); -#endif -#if !defined(PNG_WRITE_PACK_SUPPORTED) && defined(PNG_READ_PACK_SUPPORTED) - if (png_ptr->transformations & PNG_PACK) - png_warning(png_ptr, "PNG_WRITE_PACK_SUPPORTED is not defined."); -#endif -#if !defined(PNG_WRITE_SHIFT_SUPPORTED) && defined(PNG_READ_SHIFT_SUPPORTED) - if (png_ptr->transformations & PNG_SHIFT) - png_warning(png_ptr, "PNG_WRITE_SHIFT_SUPPORTED is not defined."); -#endif -#if !defined(PNG_WRITE_BGR_SUPPORTED) && defined(PNG_READ_BGR_SUPPORTED) - if (png_ptr->transformations & PNG_BGR) - png_warning(png_ptr, "PNG_WRITE_BGR_SUPPORTED is not defined."); -#endif -#if !defined(PNG_WRITE_SWAP_SUPPORTED) && defined(PNG_READ_SWAP_SUPPORTED) - if (png_ptr->transformations & PNG_SWAP_BYTES) - png_warning(png_ptr, "PNG_WRITE_SWAP_SUPPORTED is not defined."); -#endif - - png_write_start_row(png_ptr); - } - -#if defined(PNG_WRITE_INTERLACING_SUPPORTED) - /* If interlaced and not interested in row, return */ - if (png_ptr->interlaced && (png_ptr->transformations & PNG_INTERLACE)) - { - switch (png_ptr->pass) - { - case 0: - if (png_ptr->row_number & 0x07) - { - png_write_finish_row(png_ptr); - return; - } - break; - case 1: - if ((png_ptr->row_number & 0x07) || png_ptr->width < 5) - { - png_write_finish_row(png_ptr); - return; - } - break; - case 2: - if ((png_ptr->row_number & 0x07) != 4) - { - png_write_finish_row(png_ptr); - return; - } - break; - case 3: - if ((png_ptr->row_number & 0x03) || png_ptr->width < 3) - { - png_write_finish_row(png_ptr); - return; - } - break; - case 4: - if ((png_ptr->row_number & 0x03) != 2) - { - png_write_finish_row(png_ptr); - return; - } - break; - case 5: - if ((png_ptr->row_number & 0x01) || png_ptr->width < 2) - { - png_write_finish_row(png_ptr); - return; - } - break; - case 6: - if (!(png_ptr->row_number & 0x01)) - { - png_write_finish_row(png_ptr); - return; - } - break; - } - } -#endif - - /* Set up row info for transformations */ - png_ptr->row_info.color_type = png_ptr->color_type; - png_ptr->row_info.width = png_ptr->usr_width; - png_ptr->row_info.channels = png_ptr->usr_channels; - png_ptr->row_info.bit_depth = png_ptr->usr_bit_depth; - png_ptr->row_info.pixel_depth = (png_byte)(png_ptr->row_info.bit_depth * - png_ptr->row_info.channels); - - png_ptr->row_info.rowbytes = PNG_ROWBYTES(png_ptr->row_info.pixel_depth, - png_ptr->row_info.width); - - png_debug1(3, "row_info->color_type = %d", png_ptr->row_info.color_type); - png_debug1(3, "row_info->width = %lu", png_ptr->row_info.width); - png_debug1(3, "row_info->channels = %d", png_ptr->row_info.channels); - png_debug1(3, "row_info->bit_depth = %d", png_ptr->row_info.bit_depth); - png_debug1(3, "row_info->pixel_depth = %d", png_ptr->row_info.pixel_depth); - png_debug1(3, "row_info->rowbytes = %lu", png_ptr->row_info.rowbytes); - - /* Copy user's row into buffer, leaving room for filter byte. */ - png_memcpy_check(png_ptr, png_ptr->row_buf + 1, row, - png_ptr->row_info.rowbytes); - -#if defined(PNG_WRITE_INTERLACING_SUPPORTED) - /* Handle interlacing */ - if (png_ptr->interlaced && png_ptr->pass < 6 && - (png_ptr->transformations & PNG_INTERLACE)) - { - png_do_write_interlace(&(png_ptr->row_info), - png_ptr->row_buf + 1, png_ptr->pass); - /* This should always get caught above, but still ... */ - if (!(png_ptr->row_info.width)) - { - png_write_finish_row(png_ptr); - return; - } - } -#endif - - /* Handle other transformations */ - if (png_ptr->transformations) - png_do_write_transformations(png_ptr); - -#if defined(PNG_MNG_FEATURES_SUPPORTED) - /* Write filter_method 64 (intrapixel differencing) only if - * 1. Libpng was compiled with PNG_MNG_FEATURES_SUPPORTED and - * 2. Libpng did not write a PNG signature (this filter_method is only - * used in PNG datastreams that are embedded in MNG datastreams) and - * 3. The application called png_permit_mng_features with a mask that - * included PNG_FLAG_MNG_FILTER_64 and - * 4. The filter_method is 64 and - * 5. The color_type is RGB or RGBA - */ - if ((png_ptr->mng_features_permitted & PNG_FLAG_MNG_FILTER_64) && - (png_ptr->filter_type == PNG_INTRAPIXEL_DIFFERENCING)) - { - /* Intrapixel differencing */ - png_do_write_intrapixel(&(png_ptr->row_info), png_ptr->row_buf + 1); - } -#endif - - /* Find a filter if necessary, filter the row and write it out. */ - png_write_find_filter(png_ptr, &(png_ptr->row_info)); - - if (png_ptr->write_row_fn != NULL) - (*(png_ptr->write_row_fn))(png_ptr, png_ptr->row_number, png_ptr->pass); -} - -#if defined(PNG_WRITE_FLUSH_SUPPORTED) -/* Set the automatic flush interval or 0 to turn flushing off */ -void PNGAPI -png_set_flush(png_structp png_ptr, int nrows) -{ - png_debug(1, "in png_set_flush"); - if (png_ptr == NULL) - return; - png_ptr->flush_dist = (nrows < 0 ? 0 : nrows); -} - -/* Flush the current output buffers now */ -void PNGAPI -png_write_flush(png_structp png_ptr) -{ - int wrote_IDAT; - - png_debug(1, "in png_write_flush"); - if (png_ptr == NULL) - return; - /* We have already written out all of the data */ - if (png_ptr->row_number >= png_ptr->num_rows) - return; - - do - { - int ret; - - /* Compress the data */ - ret = deflate(&png_ptr->zstream, Z_SYNC_FLUSH); - wrote_IDAT = 0; - - /* Check for compression errors */ - if (ret != Z_OK) - { - if (png_ptr->zstream.msg != NULL) - png_error(png_ptr, png_ptr->zstream.msg); - else - png_error(png_ptr, "zlib error"); - } - - if (!(png_ptr->zstream.avail_out)) - { - /* Write the IDAT and reset the zlib output buffer */ - png_write_IDAT(png_ptr, png_ptr->zbuf, - png_ptr->zbuf_size); - png_ptr->zstream.next_out = png_ptr->zbuf; - png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; - wrote_IDAT = 1; - } - } while(wrote_IDAT == 1); - - /* If there is any data left to be output, write it into a new IDAT */ - if (png_ptr->zbuf_size != png_ptr->zstream.avail_out) - { - /* Write the IDAT and reset the zlib output buffer */ - png_write_IDAT(png_ptr, png_ptr->zbuf, - png_ptr->zbuf_size - png_ptr->zstream.avail_out); - png_ptr->zstream.next_out = png_ptr->zbuf; - png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; - } - png_ptr->flush_rows = 0; - png_flush(png_ptr); -} -#endif /* PNG_WRITE_FLUSH_SUPPORTED */ - -/* Free all memory used by the write */ -void PNGAPI -png_destroy_write_struct(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr) -{ - png_structp png_ptr = NULL; - png_infop info_ptr = NULL; -#ifdef PNG_USER_MEM_SUPPORTED - png_free_ptr free_fn = NULL; - png_voidp mem_ptr = NULL; -#endif - - png_debug(1, "in png_destroy_write_struct"); - if (png_ptr_ptr != NULL) - { - png_ptr = *png_ptr_ptr; -#ifdef PNG_USER_MEM_SUPPORTED - free_fn = png_ptr->free_fn; - mem_ptr = png_ptr->mem_ptr; -#endif - } - -#ifdef PNG_USER_MEM_SUPPORTED - if (png_ptr != NULL) - { - free_fn = png_ptr->free_fn; - mem_ptr = png_ptr->mem_ptr; - } -#endif - - if (info_ptr_ptr != NULL) - info_ptr = *info_ptr_ptr; - - if (info_ptr != NULL) - { - if (png_ptr != NULL) - { - png_free_data(png_ptr, info_ptr, PNG_FREE_ALL, -1); - -#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) - if (png_ptr->num_chunk_list) - { - png_free(png_ptr, png_ptr->chunk_list); - png_ptr->chunk_list=NULL; - png_ptr->num_chunk_list = 0; - } -#endif - } - -#ifdef PNG_USER_MEM_SUPPORTED - png_destroy_struct_2((png_voidp)info_ptr, (png_free_ptr)free_fn, - (png_voidp)mem_ptr); -#else - png_destroy_struct((png_voidp)info_ptr); -#endif - *info_ptr_ptr = NULL; - } - - if (png_ptr != NULL) - { - png_write_destroy(png_ptr); -#ifdef PNG_USER_MEM_SUPPORTED - png_destroy_struct_2((png_voidp)png_ptr, (png_free_ptr)free_fn, - (png_voidp)mem_ptr); -#else - png_destroy_struct((png_voidp)png_ptr); -#endif - *png_ptr_ptr = NULL; - } -} - - -/* Free any memory used in png_ptr struct (old method) */ -void /* PRIVATE */ -png_write_destroy(png_structp png_ptr) -{ -#ifdef PNG_SETJMP_SUPPORTED - jmp_buf tmp_jmp; /* Save jump buffer */ -#endif - png_error_ptr error_fn; - png_error_ptr warning_fn; - png_voidp error_ptr; -#ifdef PNG_USER_MEM_SUPPORTED - png_free_ptr free_fn; -#endif - - png_debug(1, "in png_write_destroy"); - /* Free any memory zlib uses */ - deflateEnd(&png_ptr->zstream); - - /* Free our memory. png_free checks NULL for us. */ - png_free(png_ptr, png_ptr->zbuf); - png_free(png_ptr, png_ptr->row_buf); -#ifndef PNG_NO_WRITE_FILTER - png_free(png_ptr, png_ptr->prev_row); - png_free(png_ptr, png_ptr->sub_row); - png_free(png_ptr, png_ptr->up_row); - png_free(png_ptr, png_ptr->avg_row); - png_free(png_ptr, png_ptr->paeth_row); -#endif - -#if defined(PNG_TIME_RFC1123_SUPPORTED) - png_free(png_ptr, png_ptr->time_buffer); -#endif - -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) - png_free(png_ptr, png_ptr->prev_filters); - png_free(png_ptr, png_ptr->filter_weights); - png_free(png_ptr, png_ptr->inv_filter_weights); - png_free(png_ptr, png_ptr->filter_costs); - png_free(png_ptr, png_ptr->inv_filter_costs); -#endif - -#ifdef PNG_SETJMP_SUPPORTED - /* Reset structure */ - png_memcpy(tmp_jmp, png_ptr->jmpbuf, png_sizeof(jmp_buf)); -#endif - - error_fn = png_ptr->error_fn; - warning_fn = png_ptr->warning_fn; - error_ptr = png_ptr->error_ptr; -#ifdef PNG_USER_MEM_SUPPORTED - free_fn = png_ptr->free_fn; -#endif - - png_memset(png_ptr, 0, png_sizeof(png_struct)); - - png_ptr->error_fn = error_fn; - png_ptr->warning_fn = warning_fn; - png_ptr->error_ptr = error_ptr; -#ifdef PNG_USER_MEM_SUPPORTED - png_ptr->free_fn = free_fn; -#endif - -#ifdef PNG_SETJMP_SUPPORTED - png_memcpy(png_ptr->jmpbuf, tmp_jmp, png_sizeof(jmp_buf)); -#endif -} - -/* Allow the application to select one or more row filters to use. */ -void PNGAPI -png_set_filter(png_structp png_ptr, int method, int filters) -{ - png_debug(1, "in png_set_filter"); - if (png_ptr == NULL) - return; -#if defined(PNG_MNG_FEATURES_SUPPORTED) - if ((png_ptr->mng_features_permitted & PNG_FLAG_MNG_FILTER_64) && - (method == PNG_INTRAPIXEL_DIFFERENCING)) - method = PNG_FILTER_TYPE_BASE; -#endif - if (method == PNG_FILTER_TYPE_BASE) - { - switch (filters & (PNG_ALL_FILTERS | 0x07)) - { -#ifndef PNG_NO_WRITE_FILTER - case 5: - case 6: - case 7: png_warning(png_ptr, "Unknown row filter for method 0"); -#endif /* PNG_NO_WRITE_FILTER */ - case PNG_FILTER_VALUE_NONE: - png_ptr->do_filter=PNG_FILTER_NONE; break; -#ifndef PNG_NO_WRITE_FILTER - case PNG_FILTER_VALUE_SUB: - png_ptr->do_filter=PNG_FILTER_SUB; break; - case PNG_FILTER_VALUE_UP: - png_ptr->do_filter=PNG_FILTER_UP; break; - case PNG_FILTER_VALUE_AVG: - png_ptr->do_filter=PNG_FILTER_AVG; break; - case PNG_FILTER_VALUE_PAETH: - png_ptr->do_filter=PNG_FILTER_PAETH; break; - default: png_ptr->do_filter = (png_byte)filters; break; -#else - default: png_warning(png_ptr, "Unknown row filter for method 0"); -#endif /* PNG_NO_WRITE_FILTER */ - } - - /* If we have allocated the row_buf, this means we have already started - * with the image and we should have allocated all of the filter buffers - * that have been selected. If prev_row isn't already allocated, then - * it is too late to start using the filters that need it, since we - * will be missing the data in the previous row. If an application - * wants to start and stop using particular filters during compression, - * it should start out with all of the filters, and then add and - * remove them after the start of compression. - */ - if (png_ptr->row_buf != NULL) - { -#ifndef PNG_NO_WRITE_FILTER - if ((png_ptr->do_filter & PNG_FILTER_SUB) && png_ptr->sub_row == NULL) - { - png_ptr->sub_row = (png_bytep)png_malloc(png_ptr, - (png_ptr->rowbytes + 1)); - png_ptr->sub_row[0] = PNG_FILTER_VALUE_SUB; - } - - if ((png_ptr->do_filter & PNG_FILTER_UP) && png_ptr->up_row == NULL) - { - if (png_ptr->prev_row == NULL) - { - png_warning(png_ptr, "Can't add Up filter after starting"); - png_ptr->do_filter &= ~PNG_FILTER_UP; - } - else - { - png_ptr->up_row = (png_bytep)png_malloc(png_ptr, - (png_ptr->rowbytes + 1)); - png_ptr->up_row[0] = PNG_FILTER_VALUE_UP; - } - } - - if ((png_ptr->do_filter & PNG_FILTER_AVG) && png_ptr->avg_row == NULL) - { - if (png_ptr->prev_row == NULL) - { - png_warning(png_ptr, "Can't add Average filter after starting"); - png_ptr->do_filter &= ~PNG_FILTER_AVG; - } - else - { - png_ptr->avg_row = (png_bytep)png_malloc(png_ptr, - (png_ptr->rowbytes + 1)); - png_ptr->avg_row[0] = PNG_FILTER_VALUE_AVG; - } - } - - if ((png_ptr->do_filter & PNG_FILTER_PAETH) && - png_ptr->paeth_row == NULL) - { - if (png_ptr->prev_row == NULL) - { - png_warning(png_ptr, "Can't add Paeth filter after starting"); - png_ptr->do_filter &= (png_byte)(~PNG_FILTER_PAETH); - } - else - { - png_ptr->paeth_row = (png_bytep)png_malloc(png_ptr, - (png_ptr->rowbytes + 1)); - png_ptr->paeth_row[0] = PNG_FILTER_VALUE_PAETH; - } - } - - if (png_ptr->do_filter == PNG_NO_FILTERS) -#endif /* PNG_NO_WRITE_FILTER */ - png_ptr->do_filter = PNG_FILTER_NONE; - } - } - else - png_error(png_ptr, "Unknown custom filter method"); -} - -/* This allows us to influence the way in which libpng chooses the "best" - * filter for the current scanline. While the "minimum-sum-of-absolute- - * differences metric is relatively fast and effective, there is some - * question as to whether it can be improved upon by trying to keep the - * filtered data going to zlib more consistent, hopefully resulting in - * better compression. - */ -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) /* GRR 970116 */ -void PNGAPI -png_set_filter_heuristics(png_structp png_ptr, int heuristic_method, - int num_weights, png_doublep filter_weights, - png_doublep filter_costs) -{ - int i; - - png_debug(1, "in png_set_filter_heuristics"); - if (png_ptr == NULL) - return; - if (heuristic_method >= PNG_FILTER_HEURISTIC_LAST) - { - png_warning(png_ptr, "Unknown filter heuristic method"); - return; - } - - if (heuristic_method == PNG_FILTER_HEURISTIC_DEFAULT) - { - heuristic_method = PNG_FILTER_HEURISTIC_UNWEIGHTED; - } - - if (num_weights < 0 || filter_weights == NULL || - heuristic_method == PNG_FILTER_HEURISTIC_UNWEIGHTED) - { - num_weights = 0; - } - - png_ptr->num_prev_filters = (png_byte)num_weights; - png_ptr->heuristic_method = (png_byte)heuristic_method; - - if (num_weights > 0) - { - if (png_ptr->prev_filters == NULL) - { - png_ptr->prev_filters = (png_bytep)png_malloc(png_ptr, - (png_uint_32)(png_sizeof(png_byte) * num_weights)); - - /* To make sure that the weighting starts out fairly */ - for (i = 0; i < num_weights; i++) - { - png_ptr->prev_filters[i] = 255; - } - } - - if (png_ptr->filter_weights == NULL) - { - png_ptr->filter_weights = (png_uint_16p)png_malloc(png_ptr, - (png_uint_32)(png_sizeof(png_uint_16) * num_weights)); - - png_ptr->inv_filter_weights = (png_uint_16p)png_malloc(png_ptr, - (png_uint_32)(png_sizeof(png_uint_16) * num_weights)); - for (i = 0; i < num_weights; i++) - { - png_ptr->inv_filter_weights[i] = - png_ptr->filter_weights[i] = PNG_WEIGHT_FACTOR; - } - } - - for (i = 0; i < num_weights; i++) - { - if (filter_weights[i] < 0.0) - { - png_ptr->inv_filter_weights[i] = - png_ptr->filter_weights[i] = PNG_WEIGHT_FACTOR; - } - else - { - png_ptr->inv_filter_weights[i] = - (png_uint_16)((double)PNG_WEIGHT_FACTOR*filter_weights[i]+0.5); - png_ptr->filter_weights[i] = - (png_uint_16)((double)PNG_WEIGHT_FACTOR/filter_weights[i]+0.5); - } - } - } - - /* If, in the future, there are other filter methods, this would - * need to be based on png_ptr->filter. - */ - if (png_ptr->filter_costs == NULL) - { - png_ptr->filter_costs = (png_uint_16p)png_malloc(png_ptr, - (png_uint_32)(png_sizeof(png_uint_16) * PNG_FILTER_VALUE_LAST)); - - png_ptr->inv_filter_costs = (png_uint_16p)png_malloc(png_ptr, - (png_uint_32)(png_sizeof(png_uint_16) * PNG_FILTER_VALUE_LAST)); - - for (i = 0; i < PNG_FILTER_VALUE_LAST; i++) - { - png_ptr->inv_filter_costs[i] = - png_ptr->filter_costs[i] = PNG_COST_FACTOR; - } - } - - /* Here is where we set the relative costs of the different filters. We - * should take the desired compression level into account when setting - * the costs, so that Paeth, for instance, has a high relative cost at low - * compression levels, while it has a lower relative cost at higher - * compression settings. The filter types are in order of increasing - * relative cost, so it would be possible to do this with an algorithm. - */ - for (i = 0; i < PNG_FILTER_VALUE_LAST; i++) - { - if (filter_costs == NULL || filter_costs[i] < 0.0) - { - png_ptr->inv_filter_costs[i] = - png_ptr->filter_costs[i] = PNG_COST_FACTOR; - } - else if (filter_costs[i] >= 1.0) - { - png_ptr->inv_filter_costs[i] = - (png_uint_16)((double)PNG_COST_FACTOR / filter_costs[i] + 0.5); - png_ptr->filter_costs[i] = - (png_uint_16)((double)PNG_COST_FACTOR * filter_costs[i] + 0.5); - } - } -} -#endif /* PNG_WRITE_WEIGHTED_FILTER_SUPPORTED */ - -void PNGAPI -png_set_compression_level(png_structp png_ptr, int level) -{ - png_debug(1, "in png_set_compression_level"); - if (png_ptr == NULL) - return; - png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_LEVEL; - png_ptr->zlib_level = level; -} - -void PNGAPI -png_set_compression_mem_level(png_structp png_ptr, int mem_level) -{ - png_debug(1, "in png_set_compression_mem_level"); - if (png_ptr == NULL) - return; - png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_MEM_LEVEL; - png_ptr->zlib_mem_level = mem_level; -} - -void PNGAPI -png_set_compression_strategy(png_structp png_ptr, int strategy) -{ - png_debug(1, "in png_set_compression_strategy"); - if (png_ptr == NULL) - return; - png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_STRATEGY; - png_ptr->zlib_strategy = strategy; -} - -void PNGAPI -png_set_compression_window_bits(png_structp png_ptr, int window_bits) -{ - if (png_ptr == NULL) - return; - if (window_bits > 15) - png_warning(png_ptr, "Only compression windows <= 32k supported by PNG"); - else if (window_bits < 8) - png_warning(png_ptr, "Only compression windows >= 256 supported by PNG"); -#ifndef WBITS_8_OK - /* Avoid libpng bug with 256-byte windows */ - if (window_bits == 8) - { - png_warning(png_ptr, "Compression window is being reset to 512"); - window_bits=9; - } -#endif - png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_WINDOW_BITS; - png_ptr->zlib_window_bits = window_bits; -} - -void PNGAPI -png_set_compression_method(png_structp png_ptr, int method) -{ - png_debug(1, "in png_set_compression_method"); - if (png_ptr == NULL) - return; - if (method != 8) - png_warning(png_ptr, "Only compression method 8 is supported by PNG"); - png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_METHOD; - png_ptr->zlib_method = method; -} - -void PNGAPI -png_set_write_status_fn(png_structp png_ptr, png_write_status_ptr write_row_fn) -{ - if (png_ptr == NULL) - return; - png_ptr->write_row_fn = write_row_fn; -} - -#if defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) -void PNGAPI -png_set_write_user_transform_fn(png_structp png_ptr, png_user_transform_ptr - write_user_transform_fn) -{ - png_debug(1, "in png_set_write_user_transform_fn"); - if (png_ptr == NULL) - return; - png_ptr->transformations |= PNG_USER_TRANSFORM; - png_ptr->write_user_transform_fn = write_user_transform_fn; -} -#endif - - -#if defined(PNG_INFO_IMAGE_SUPPORTED) -void PNGAPI -png_write_png(png_structp png_ptr, png_infop info_ptr, - int transforms, voidp params) -{ - if (png_ptr == NULL || info_ptr == NULL) - return; -#if defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED) - /* Invert the alpha channel from opacity to transparency */ - if (transforms & PNG_TRANSFORM_INVERT_ALPHA) - png_set_invert_alpha(png_ptr); -#endif - - /* Write the file header information. */ - png_write_info(png_ptr, info_ptr); - - /* ------ these transformations don't touch the info structure ------- */ - -#if defined(PNG_WRITE_INVERT_SUPPORTED) - /* Invert monochrome pixels */ - if (transforms & PNG_TRANSFORM_INVERT_MONO) - png_set_invert_mono(png_ptr); -#endif - -#if defined(PNG_WRITE_SHIFT_SUPPORTED) - /* Shift the pixels up to a legal bit depth and fill in - * as appropriate to correctly scale the image. - */ - if ((transforms & PNG_TRANSFORM_SHIFT) - && (info_ptr->valid & PNG_INFO_sBIT)) - png_set_shift(png_ptr, &info_ptr->sig_bit); -#endif - -#if defined(PNG_WRITE_PACK_SUPPORTED) - /* Pack pixels into bytes */ - if (transforms & PNG_TRANSFORM_PACKING) - png_set_packing(png_ptr); -#endif - -#if defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED) - /* Swap location of alpha bytes from ARGB to RGBA */ - if (transforms & PNG_TRANSFORM_SWAP_ALPHA) - png_set_swap_alpha(png_ptr); -#endif - -#if defined(PNG_WRITE_FILLER_SUPPORTED) - /* Pack XRGB/RGBX/ARGB/RGBA into * RGB (4 channels -> 3 channels) */ - if (transforms & PNG_TRANSFORM_STRIP_FILLER_AFTER) - png_set_filler(png_ptr, 0, PNG_FILLER_AFTER); - else if (transforms & PNG_TRANSFORM_STRIP_FILLER_BEFORE) - png_set_filler(png_ptr, 0, PNG_FILLER_BEFORE); -#endif - -#if defined(PNG_WRITE_BGR_SUPPORTED) - /* Flip BGR pixels to RGB */ - if (transforms & PNG_TRANSFORM_BGR) - png_set_bgr(png_ptr); -#endif - -#if defined(PNG_WRITE_SWAP_SUPPORTED) - /* Swap bytes of 16-bit files to most significant byte first */ - if (transforms & PNG_TRANSFORM_SWAP_ENDIAN) - png_set_swap(png_ptr); -#endif - -#if defined(PNG_WRITE_PACKSWAP_SUPPORTED) - /* Swap bits of 1, 2, 4 bit packed pixel formats */ - if (transforms & PNG_TRANSFORM_PACKSWAP) - png_set_packswap(png_ptr); -#endif - - /* ----------------------- end of transformations ------------------- */ - - /* Write the bits */ - if (info_ptr->valid & PNG_INFO_IDAT) - png_write_image(png_ptr, info_ptr->row_pointers); - - /* It is REQUIRED to call this to finish writing the rest of the file */ - png_write_end(png_ptr, info_ptr); - - transforms = transforms; /* Quiet compiler warnings */ - params = params; -} -#endif -#endif /* PNG_WRITE_SUPPORTED */ diff --git a/src/libpng/pngwtran.c b/src/libpng/pngwtran.c deleted file mode 100644 index afb5ac4c4..000000000 --- a/src/libpng/pngwtran.c +++ /dev/null @@ -1,572 +0,0 @@ - -/* pngwtran.c - transforms the data in a row for PNG writers - * - * Last changed in libpng 1.2.37 [June 4, 2009] - * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2009 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - */ - -#define PNG_INTERNAL -#include "png.h" -#ifdef PNG_WRITE_SUPPORTED - -/* Transform the data according to the user's wishes. The order of - * transformations is significant. - */ -void /* PRIVATE */ -png_do_write_transformations(png_structp png_ptr) -{ - png_debug(1, "in png_do_write_transformations"); - - if (png_ptr == NULL) - return; - -#if defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) - if (png_ptr->transformations & PNG_USER_TRANSFORM) - if (png_ptr->write_user_transform_fn != NULL) - (*(png_ptr->write_user_transform_fn)) /* User write transform function */ - (png_ptr, /* png_ptr */ - &(png_ptr->row_info), /* row_info: */ - /* png_uint_32 width; width of row */ - /* png_uint_32 rowbytes; number of bytes in row */ - /* png_byte color_type; color type of pixels */ - /* png_byte bit_depth; bit depth of samples */ - /* png_byte channels; number of channels (1-4) */ - /* png_byte pixel_depth; bits per pixel (depth*channels) */ - png_ptr->row_buf + 1); /* start of pixel data for row */ -#endif -#if defined(PNG_WRITE_FILLER_SUPPORTED) - if (png_ptr->transformations & PNG_FILLER) - png_do_strip_filler(&(png_ptr->row_info), png_ptr->row_buf + 1, - png_ptr->flags); -#endif -#if defined(PNG_WRITE_PACKSWAP_SUPPORTED) - if (png_ptr->transformations & PNG_PACKSWAP) - png_do_packswap(&(png_ptr->row_info), png_ptr->row_buf + 1); -#endif -#if defined(PNG_WRITE_PACK_SUPPORTED) - if (png_ptr->transformations & PNG_PACK) - png_do_pack(&(png_ptr->row_info), png_ptr->row_buf + 1, - (png_uint_32)png_ptr->bit_depth); -#endif -#if defined(PNG_WRITE_SWAP_SUPPORTED) - if (png_ptr->transformations & PNG_SWAP_BYTES) - png_do_swap(&(png_ptr->row_info), png_ptr->row_buf + 1); -#endif -#if defined(PNG_WRITE_SHIFT_SUPPORTED) - if (png_ptr->transformations & PNG_SHIFT) - png_do_shift(&(png_ptr->row_info), png_ptr->row_buf + 1, - &(png_ptr->shift)); -#endif -#if defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED) - if (png_ptr->transformations & PNG_SWAP_ALPHA) - png_do_write_swap_alpha(&(png_ptr->row_info), png_ptr->row_buf + 1); -#endif -#if defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED) - if (png_ptr->transformations & PNG_INVERT_ALPHA) - png_do_write_invert_alpha(&(png_ptr->row_info), png_ptr->row_buf + 1); -#endif -#if defined(PNG_WRITE_BGR_SUPPORTED) - if (png_ptr->transformations & PNG_BGR) - png_do_bgr(&(png_ptr->row_info), png_ptr->row_buf + 1); -#endif -#if defined(PNG_WRITE_INVERT_SUPPORTED) - if (png_ptr->transformations & PNG_INVERT_MONO) - png_do_invert(&(png_ptr->row_info), png_ptr->row_buf + 1); -#endif -} - -#if defined(PNG_WRITE_PACK_SUPPORTED) -/* Pack pixels into bytes. Pass the true bit depth in bit_depth. The - * row_info bit depth should be 8 (one pixel per byte). The channels - * should be 1 (this only happens on grayscale and paletted images). - */ -void /* PRIVATE */ -png_do_pack(png_row_infop row_info, png_bytep row, png_uint_32 bit_depth) -{ - png_debug(1, "in png_do_pack"); - if (row_info->bit_depth == 8 && -#if defined(PNG_USELESS_TESTS_SUPPORTED) - row != NULL && row_info != NULL && -#endif - row_info->channels == 1) - { - switch ((int)bit_depth) - { - case 1: - { - png_bytep sp, dp; - int mask, v; - png_uint_32 i; - png_uint_32 row_width = row_info->width; - - sp = row; - dp = row; - mask = 0x80; - v = 0; - - for (i = 0; i < row_width; i++) - { - if (*sp != 0) - v |= mask; - sp++; - if (mask > 1) - mask >>= 1; - else - { - mask = 0x80; - *dp = (png_byte)v; - dp++; - v = 0; - } - } - if (mask != 0x80) - *dp = (png_byte)v; - break; - } - case 2: - { - png_bytep sp, dp; - int shift, v; - png_uint_32 i; - png_uint_32 row_width = row_info->width; - - sp = row; - dp = row; - shift = 6; - v = 0; - for (i = 0; i < row_width; i++) - { - png_byte value; - - value = (png_byte)(*sp & 0x03); - v |= (value << shift); - if (shift == 0) - { - shift = 6; - *dp = (png_byte)v; - dp++; - v = 0; - } - else - shift -= 2; - sp++; - } - if (shift != 6) - *dp = (png_byte)v; - break; - } - case 4: - { - png_bytep sp, dp; - int shift, v; - png_uint_32 i; - png_uint_32 row_width = row_info->width; - - sp = row; - dp = row; - shift = 4; - v = 0; - for (i = 0; i < row_width; i++) - { - png_byte value; - - value = (png_byte)(*sp & 0x0f); - v |= (value << shift); - - if (shift == 0) - { - shift = 4; - *dp = (png_byte)v; - dp++; - v = 0; - } - else - shift -= 4; - - sp++; - } - if (shift != 4) - *dp = (png_byte)v; - break; - } - } - row_info->bit_depth = (png_byte)bit_depth; - row_info->pixel_depth = (png_byte)(bit_depth * row_info->channels); - row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth, - row_info->width); - } -} -#endif - -#if defined(PNG_WRITE_SHIFT_SUPPORTED) -/* Shift pixel values to take advantage of whole range. Pass the - * true number of bits in bit_depth. The row should be packed - * according to row_info->bit_depth. Thus, if you had a row of - * bit depth 4, but the pixels only had values from 0 to 7, you - * would pass 3 as bit_depth, and this routine would translate the - * data to 0 to 15. - */ -void /* PRIVATE */ -png_do_shift(png_row_infop row_info, png_bytep row, png_color_8p bit_depth) -{ - png_debug(1, "in png_do_shift"); -#if defined(PNG_USELESS_TESTS_SUPPORTED) - if (row != NULL && row_info != NULL && -#else - if ( -#endif - row_info->color_type != PNG_COLOR_TYPE_PALETTE) - { - int shift_start[4], shift_dec[4]; - int channels = 0; - - if (row_info->color_type & PNG_COLOR_MASK_COLOR) - { - shift_start[channels] = row_info->bit_depth - bit_depth->red; - shift_dec[channels] = bit_depth->red; - channels++; - shift_start[channels] = row_info->bit_depth - bit_depth->green; - shift_dec[channels] = bit_depth->green; - channels++; - shift_start[channels] = row_info->bit_depth - bit_depth->blue; - shift_dec[channels] = bit_depth->blue; - channels++; - } - else - { - shift_start[channels] = row_info->bit_depth - bit_depth->gray; - shift_dec[channels] = bit_depth->gray; - channels++; - } - if (row_info->color_type & PNG_COLOR_MASK_ALPHA) - { - shift_start[channels] = row_info->bit_depth - bit_depth->alpha; - shift_dec[channels] = bit_depth->alpha; - channels++; - } - - /* With low row depths, could only be grayscale, so one channel */ - if (row_info->bit_depth < 8) - { - png_bytep bp = row; - png_uint_32 i; - png_byte mask; - png_uint_32 row_bytes = row_info->rowbytes; - - if (bit_depth->gray == 1 && row_info->bit_depth == 2) - mask = 0x55; - else if (row_info->bit_depth == 4 && bit_depth->gray == 3) - mask = 0x11; - else - mask = 0xff; - - for (i = 0; i < row_bytes; i++, bp++) - { - png_uint_16 v; - int j; - - v = *bp; - *bp = 0; - for (j = shift_start[0]; j > -shift_dec[0]; j -= shift_dec[0]) - { - if (j > 0) - *bp |= (png_byte)((v << j) & 0xff); - else - *bp |= (png_byte)((v >> (-j)) & mask); - } - } - } - else if (row_info->bit_depth == 8) - { - png_bytep bp = row; - png_uint_32 i; - png_uint_32 istop = channels * row_info->width; - - for (i = 0; i < istop; i++, bp++) - { - - png_uint_16 v; - int j; - int c = (int)(i%channels); - - v = *bp; - *bp = 0; - for (j = shift_start[c]; j > -shift_dec[c]; j -= shift_dec[c]) - { - if (j > 0) - *bp |= (png_byte)((v << j) & 0xff); - else - *bp |= (png_byte)((v >> (-j)) & 0xff); - } - } - } - else - { - png_bytep bp; - png_uint_32 i; - png_uint_32 istop = channels * row_info->width; - - for (bp = row, i = 0; i < istop; i++) - { - int c = (int)(i%channels); - png_uint_16 value, v; - int j; - - v = (png_uint_16)(((png_uint_16)(*bp) << 8) + *(bp + 1)); - value = 0; - for (j = shift_start[c]; j > -shift_dec[c]; j -= shift_dec[c]) - { - if (j > 0) - value |= (png_uint_16)((v << j) & (png_uint_16)0xffff); - else - value |= (png_uint_16)((v >> (-j)) & (png_uint_16)0xffff); - } - *bp++ = (png_byte)(value >> 8); - *bp++ = (png_byte)(value & 0xff); - } - } - } -} -#endif - -#if defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED) -void /* PRIVATE */ -png_do_write_swap_alpha(png_row_infop row_info, png_bytep row) -{ - png_debug(1, "in png_do_write_swap_alpha"); -#if defined(PNG_USELESS_TESTS_SUPPORTED) - if (row != NULL && row_info != NULL) -#endif - { - if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) - { - /* This converts from ARGB to RGBA */ - if (row_info->bit_depth == 8) - { - png_bytep sp, dp; - png_uint_32 i; - png_uint_32 row_width = row_info->width; - for (i = 0, sp = dp = row; i < row_width; i++) - { - png_byte save = *(sp++); - *(dp++) = *(sp++); - *(dp++) = *(sp++); - *(dp++) = *(sp++); - *(dp++) = save; - } - } - /* This converts from AARRGGBB to RRGGBBAA */ - else - { - png_bytep sp, dp; - png_uint_32 i; - png_uint_32 row_width = row_info->width; - - for (i = 0, sp = dp = row; i < row_width; i++) - { - png_byte save[2]; - save[0] = *(sp++); - save[1] = *(sp++); - *(dp++) = *(sp++); - *(dp++) = *(sp++); - *(dp++) = *(sp++); - *(dp++) = *(sp++); - *(dp++) = *(sp++); - *(dp++) = *(sp++); - *(dp++) = save[0]; - *(dp++) = save[1]; - } - } - } - else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) - { - /* This converts from AG to GA */ - if (row_info->bit_depth == 8) - { - png_bytep sp, dp; - png_uint_32 i; - png_uint_32 row_width = row_info->width; - - for (i = 0, sp = dp = row; i < row_width; i++) - { - png_byte save = *(sp++); - *(dp++) = *(sp++); - *(dp++) = save; - } - } - /* This converts from AAGG to GGAA */ - else - { - png_bytep sp, dp; - png_uint_32 i; - png_uint_32 row_width = row_info->width; - - for (i = 0, sp = dp = row; i < row_width; i++) - { - png_byte save[2]; - save[0] = *(sp++); - save[1] = *(sp++); - *(dp++) = *(sp++); - *(dp++) = *(sp++); - *(dp++) = save[0]; - *(dp++) = save[1]; - } - } - } - } -} -#endif - -#if defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED) -void /* PRIVATE */ -png_do_write_invert_alpha(png_row_infop row_info, png_bytep row) -{ - png_debug(1, "in png_do_write_invert_alpha"); -#if defined(PNG_USELESS_TESTS_SUPPORTED) - if (row != NULL && row_info != NULL) -#endif - { - if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) - { - /* This inverts the alpha channel in RGBA */ - if (row_info->bit_depth == 8) - { - png_bytep sp, dp; - png_uint_32 i; - png_uint_32 row_width = row_info->width; - for (i = 0, sp = dp = row; i < row_width; i++) - { - /* Does nothing - *(dp++) = *(sp++); - *(dp++) = *(sp++); - *(dp++) = *(sp++); - */ - sp+=3; dp = sp; - *(dp++) = (png_byte)(255 - *(sp++)); - } - } - /* This inverts the alpha channel in RRGGBBAA */ - else - { - png_bytep sp, dp; - png_uint_32 i; - png_uint_32 row_width = row_info->width; - - for (i = 0, sp = dp = row; i < row_width; i++) - { - /* Does nothing - *(dp++) = *(sp++); - *(dp++) = *(sp++); - *(dp++) = *(sp++); - *(dp++) = *(sp++); - *(dp++) = *(sp++); - *(dp++) = *(sp++); - */ - sp+=6; dp = sp; - *(dp++) = (png_byte)(255 - *(sp++)); - *(dp++) = (png_byte)(255 - *(sp++)); - } - } - } - else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) - { - /* This inverts the alpha channel in GA */ - if (row_info->bit_depth == 8) - { - png_bytep sp, dp; - png_uint_32 i; - png_uint_32 row_width = row_info->width; - - for (i = 0, sp = dp = row; i < row_width; i++) - { - *(dp++) = *(sp++); - *(dp++) = (png_byte)(255 - *(sp++)); - } - } - /* This inverts the alpha channel in GGAA */ - else - { - png_bytep sp, dp; - png_uint_32 i; - png_uint_32 row_width = row_info->width; - - for (i = 0, sp = dp = row; i < row_width; i++) - { - /* Does nothing - *(dp++) = *(sp++); - *(dp++) = *(sp++); - */ - sp+=2; dp = sp; - *(dp++) = (png_byte)(255 - *(sp++)); - *(dp++) = (png_byte)(255 - *(sp++)); - } - } - } - } -} -#endif - -#if defined(PNG_MNG_FEATURES_SUPPORTED) -/* Undoes intrapixel differencing */ -void /* PRIVATE */ -png_do_write_intrapixel(png_row_infop row_info, png_bytep row) -{ - png_debug(1, "in png_do_write_intrapixel"); - if ( -#if defined(PNG_USELESS_TESTS_SUPPORTED) - row != NULL && row_info != NULL && -#endif - (row_info->color_type & PNG_COLOR_MASK_COLOR)) - { - int bytes_per_pixel; - png_uint_32 row_width = row_info->width; - if (row_info->bit_depth == 8) - { - png_bytep rp; - png_uint_32 i; - - if (row_info->color_type == PNG_COLOR_TYPE_RGB) - bytes_per_pixel = 3; - else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) - bytes_per_pixel = 4; - else - return; - - for (i = 0, rp = row; i < row_width; i++, rp += bytes_per_pixel) - { - *(rp) = (png_byte)((*rp - *(rp+1))&0xff); - *(rp+2) = (png_byte)((*(rp+2) - *(rp+1))&0xff); - } - } - else if (row_info->bit_depth == 16) - { - png_bytep rp; - png_uint_32 i; - - if (row_info->color_type == PNG_COLOR_TYPE_RGB) - bytes_per_pixel = 6; - else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) - bytes_per_pixel = 8; - else - return; - - for (i = 0, rp = row; i < row_width; i++, rp += bytes_per_pixel) - { - png_uint_32 s0 = (*(rp ) << 8) | *(rp+1); - png_uint_32 s1 = (*(rp+2) << 8) | *(rp+3); - png_uint_32 s2 = (*(rp+4) << 8) | *(rp+5); - png_uint_32 red = (png_uint_32)((s0 - s1) & 0xffffL); - png_uint_32 blue = (png_uint_32)((s2 - s1) & 0xffffL); - *(rp ) = (png_byte)((red >> 8) & 0xff); - *(rp+1) = (png_byte)(red & 0xff); - *(rp+4) = (png_byte)((blue >> 8) & 0xff); - *(rp+5) = (png_byte)(blue & 0xff); - } - } - } -} -#endif /* PNG_MNG_FEATURES_SUPPORTED */ -#endif /* PNG_WRITE_SUPPORTED */ diff --git a/src/libpng/pngwutil.c b/src/libpng/pngwutil.c deleted file mode 100644 index 91d761b62..000000000 --- a/src/libpng/pngwutil.c +++ /dev/null @@ -1,2788 +0,0 @@ - -/* pngwutil.c - utilities to write a PNG file - * - * Last changed in libpng 1.2.36 [June 4, 2009] - * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2009 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - */ - -#define PNG_INTERNAL -#include "png.h" -#ifdef PNG_WRITE_SUPPORTED - -/* Place a 32-bit number into a buffer in PNG byte order. We work - * with unsigned numbers for convenience, although one supported - * ancillary chunk uses signed (two's complement) numbers. - */ -void PNGAPI -png_save_uint_32(png_bytep buf, png_uint_32 i) -{ - buf[0] = (png_byte)((i >> 24) & 0xff); - buf[1] = (png_byte)((i >> 16) & 0xff); - buf[2] = (png_byte)((i >> 8) & 0xff); - buf[3] = (png_byte)(i & 0xff); -} - -/* The png_save_int_32 function assumes integers are stored in two's - * complement format. If this isn't the case, then this routine needs to - * be modified to write data in two's complement format. - */ -void PNGAPI -png_save_int_32(png_bytep buf, png_int_32 i) -{ - buf[0] = (png_byte)((i >> 24) & 0xff); - buf[1] = (png_byte)((i >> 16) & 0xff); - buf[2] = (png_byte)((i >> 8) & 0xff); - buf[3] = (png_byte)(i & 0xff); -} - -/* Place a 16-bit number into a buffer in PNG byte order. - * The parameter is declared unsigned int, not png_uint_16, - * just to avoid potential problems on pre-ANSI C compilers. - */ -void PNGAPI -png_save_uint_16(png_bytep buf, unsigned int i) -{ - buf[0] = (png_byte)((i >> 8) & 0xff); - buf[1] = (png_byte)(i & 0xff); -} - -/* Simple function to write the signature. If we have already written - * the magic bytes of the signature, or more likely, the PNG stream is - * being embedded into another stream and doesn't need its own signature, - * we should call png_set_sig_bytes() to tell libpng how many of the - * bytes have already been written. - */ -void /* PRIVATE */ -png_write_sig(png_structp png_ptr) -{ - png_byte png_signature[8] = {137, 80, 78, 71, 13, 10, 26, 10}; - - /* Write the rest of the 8 byte signature */ - png_write_data(png_ptr, &png_signature[png_ptr->sig_bytes], - (png_size_t)(8 - png_ptr->sig_bytes)); - if (png_ptr->sig_bytes < 3) - png_ptr->mode |= PNG_HAVE_PNG_SIGNATURE; -} - -/* Write a PNG chunk all at once. The type is an array of ASCII characters - * representing the chunk name. The array must be at least 4 bytes in - * length, and does not need to be null terminated. To be safe, pass the - * pre-defined chunk names here, and if you need a new one, define it - * where the others are defined. The length is the length of the data. - * All the data must be present. If that is not possible, use the - * png_write_chunk_start(), png_write_chunk_data(), and png_write_chunk_end() - * functions instead. - */ -void PNGAPI -png_write_chunk(png_structp png_ptr, png_bytep chunk_name, - png_bytep data, png_size_t length) -{ - if (png_ptr == NULL) - return; - png_write_chunk_start(png_ptr, chunk_name, (png_uint_32)length); - png_write_chunk_data(png_ptr, data, (png_size_t)length); - png_write_chunk_end(png_ptr); -} - -/* Write the start of a PNG chunk. The type is the chunk type. - * The total_length is the sum of the lengths of all the data you will be - * passing in png_write_chunk_data(). - */ -void PNGAPI -png_write_chunk_start(png_structp png_ptr, png_bytep chunk_name, - png_uint_32 length) -{ - png_byte buf[8]; - - png_debug2(0, "Writing %s chunk, length = %lu", chunk_name, - (unsigned long)length); - if (png_ptr == NULL) - return; - - /* Write the length and the chunk name */ - png_save_uint_32(buf, length); - png_memcpy(buf + 4, chunk_name, 4); - png_write_data(png_ptr, buf, (png_size_t)8); - /* Put the chunk name into png_ptr->chunk_name */ - png_memcpy(png_ptr->chunk_name, chunk_name, 4); - /* Reset the crc and run it over the chunk name */ - png_reset_crc(png_ptr); - png_calculate_crc(png_ptr, chunk_name, (png_size_t)4); -} - -/* Write the data of a PNG chunk started with png_write_chunk_start(). - * Note that multiple calls to this function are allowed, and that the - * sum of the lengths from these calls *must* add up to the total_length - * given to png_write_chunk_start(). - */ -void PNGAPI -png_write_chunk_data(png_structp png_ptr, png_bytep data, png_size_t length) -{ - /* Write the data, and run the CRC over it */ - if (png_ptr == NULL) - return; - if (data != NULL && length > 0) - { - png_write_data(png_ptr, data, length); - /* Update the CRC after writing the data, - * in case that the user I/O routine alters it. - */ - png_calculate_crc(png_ptr, data, length); - } -} - -/* Finish a chunk started with png_write_chunk_start(). */ -void PNGAPI -png_write_chunk_end(png_structp png_ptr) -{ - png_byte buf[4]; - - if (png_ptr == NULL) return; - - /* Write the crc in a single operation */ - png_save_uint_32(buf, png_ptr->crc); - - png_write_data(png_ptr, buf, (png_size_t)4); -} - -#if defined(PNG_WRITE_TEXT_SUPPORTED) || defined(PNG_WRITE_iCCP_SUPPORTED) -/* This pair of functions encapsulates the operation of (a) compressing a - * text string, and (b) issuing it later as a series of chunk data writes. - * The compression_state structure is shared context for these functions - * set up by the caller in order to make the whole mess thread-safe. - */ - -typedef struct -{ - char *input; /* The uncompressed input data */ - int input_len; /* Its length */ - int num_output_ptr; /* Number of output pointers used */ - int max_output_ptr; /* Size of output_ptr */ - png_charpp output_ptr; /* Array of pointers to output */ -} compression_state; - -/* Compress given text into storage in the png_ptr structure */ -static int /* PRIVATE */ -png_text_compress(png_structp png_ptr, - png_charp text, png_size_t text_len, int compression, - compression_state *comp) -{ - int ret; - - comp->num_output_ptr = 0; - comp->max_output_ptr = 0; - comp->output_ptr = NULL; - comp->input = NULL; - comp->input_len = 0; - - /* We may just want to pass the text right through */ - if (compression == PNG_TEXT_COMPRESSION_NONE) - { - comp->input = text; - comp->input_len = text_len; - return((int)text_len); - } - - if (compression >= PNG_TEXT_COMPRESSION_LAST) - { -#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE) - char msg[50]; - png_snprintf(msg, 50, "Unknown compression type %d", compression); - png_warning(png_ptr, msg); -#else - png_warning(png_ptr, "Unknown compression type"); -#endif - } - - /* We can't write the chunk until we find out how much data we have, - * which means we need to run the compressor first and save the - * output. This shouldn't be a problem, as the vast majority of - * comments should be reasonable, but we will set up an array of - * malloc'd pointers to be sure. - * - * If we knew the application was well behaved, we could simplify this - * greatly by assuming we can always malloc an output buffer large - * enough to hold the compressed text ((1001 * text_len / 1000) + 12) - * and malloc this directly. The only time this would be a bad idea is - * if we can't malloc more than 64K and we have 64K of random input - * data, or if the input string is incredibly large (although this - * wouldn't cause a failure, just a slowdown due to swapping). - */ - - /* Set up the compression buffers */ - png_ptr->zstream.avail_in = (uInt)text_len; - png_ptr->zstream.next_in = (Bytef *)text; - png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; - png_ptr->zstream.next_out = (Bytef *)png_ptr->zbuf; - - /* This is the same compression loop as in png_write_row() */ - do - { - /* Compress the data */ - ret = deflate(&png_ptr->zstream, Z_NO_FLUSH); - if (ret != Z_OK) - { - /* Error */ - if (png_ptr->zstream.msg != NULL) - png_error(png_ptr, png_ptr->zstream.msg); - else - png_error(png_ptr, "zlib error"); - } - /* Check to see if we need more room */ - if (!(png_ptr->zstream.avail_out)) - { - /* Make sure the output array has room */ - if (comp->num_output_ptr >= comp->max_output_ptr) - { - int old_max; - - old_max = comp->max_output_ptr; - comp->max_output_ptr = comp->num_output_ptr + 4; - if (comp->output_ptr != NULL) - { - png_charpp old_ptr; - - old_ptr = comp->output_ptr; - comp->output_ptr = (png_charpp)png_malloc(png_ptr, - (png_uint_32) - (comp->max_output_ptr * png_sizeof(png_charpp))); - png_memcpy(comp->output_ptr, old_ptr, old_max - * png_sizeof(png_charp)); - png_free(png_ptr, old_ptr); - } - else - comp->output_ptr = (png_charpp)png_malloc(png_ptr, - (png_uint_32) - (comp->max_output_ptr * png_sizeof(png_charp))); - } - - /* Save the data */ - comp->output_ptr[comp->num_output_ptr] = - (png_charp)png_malloc(png_ptr, - (png_uint_32)png_ptr->zbuf_size); - png_memcpy(comp->output_ptr[comp->num_output_ptr], png_ptr->zbuf, - png_ptr->zbuf_size); - comp->num_output_ptr++; - - /* and reset the buffer */ - png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; - png_ptr->zstream.next_out = png_ptr->zbuf; - } - /* Continue until we don't have any more to compress */ - } while (png_ptr->zstream.avail_in); - - /* Finish the compression */ - do - { - /* Tell zlib we are finished */ - ret = deflate(&png_ptr->zstream, Z_FINISH); - - if (ret == Z_OK) - { - /* Check to see if we need more room */ - if (!(png_ptr->zstream.avail_out)) - { - /* Check to make sure our output array has room */ - if (comp->num_output_ptr >= comp->max_output_ptr) - { - int old_max; - - old_max = comp->max_output_ptr; - comp->max_output_ptr = comp->num_output_ptr + 4; - if (comp->output_ptr != NULL) - { - png_charpp old_ptr; - - old_ptr = comp->output_ptr; - /* This could be optimized to realloc() */ - comp->output_ptr = (png_charpp)png_malloc(png_ptr, - (png_uint_32)(comp->max_output_ptr * - png_sizeof(png_charp))); - png_memcpy(comp->output_ptr, old_ptr, - old_max * png_sizeof(png_charp)); - png_free(png_ptr, old_ptr); - } - else - comp->output_ptr = (png_charpp)png_malloc(png_ptr, - (png_uint_32)(comp->max_output_ptr * - png_sizeof(png_charp))); - } - - /* Save the data */ - comp->output_ptr[comp->num_output_ptr] = - (png_charp)png_malloc(png_ptr, - (png_uint_32)png_ptr->zbuf_size); - png_memcpy(comp->output_ptr[comp->num_output_ptr], png_ptr->zbuf, - png_ptr->zbuf_size); - comp->num_output_ptr++; - - /* and reset the buffer pointers */ - png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; - png_ptr->zstream.next_out = png_ptr->zbuf; - } - } - else if (ret != Z_STREAM_END) - { - /* We got an error */ - if (png_ptr->zstream.msg != NULL) - png_error(png_ptr, png_ptr->zstream.msg); - else - png_error(png_ptr, "zlib error"); - } - } while (ret != Z_STREAM_END); - - /* Text length is number of buffers plus last buffer */ - text_len = png_ptr->zbuf_size * comp->num_output_ptr; - if (png_ptr->zstream.avail_out < png_ptr->zbuf_size) - text_len += png_ptr->zbuf_size - (png_size_t)png_ptr->zstream.avail_out; - - return((int)text_len); -} - -/* Ship the compressed text out via chunk writes */ -static void /* PRIVATE */ -png_write_compressed_data_out(png_structp png_ptr, compression_state *comp) -{ - int i; - - /* Handle the no-compression case */ - if (comp->input) - { - png_write_chunk_data(png_ptr, (png_bytep)comp->input, - (png_size_t)comp->input_len); - return; - } - - /* Write saved output buffers, if any */ - for (i = 0; i < comp->num_output_ptr; i++) - { - png_write_chunk_data(png_ptr, (png_bytep)comp->output_ptr[i], - (png_size_t)png_ptr->zbuf_size); - png_free(png_ptr, comp->output_ptr[i]); - comp->output_ptr[i]=NULL; - } - if (comp->max_output_ptr != 0) - png_free(png_ptr, comp->output_ptr); - comp->output_ptr=NULL; - /* Write anything left in zbuf */ - if (png_ptr->zstream.avail_out < (png_uint_32)png_ptr->zbuf_size) - png_write_chunk_data(png_ptr, png_ptr->zbuf, - (png_size_t)(png_ptr->zbuf_size - png_ptr->zstream.avail_out)); - - /* Reset zlib for another zTXt/iTXt or image data */ - deflateReset(&png_ptr->zstream); - png_ptr->zstream.data_type = Z_BINARY; -} -#endif - -/* Write the IHDR chunk, and update the png_struct with the necessary - * information. Note that the rest of this code depends upon this - * information being correct. - */ -void /* PRIVATE */ -png_write_IHDR(png_structp png_ptr, png_uint_32 width, png_uint_32 height, - int bit_depth, int color_type, int compression_type, int filter_type, - int interlace_type) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_IHDR; -#endif - int ret; - - png_byte buf[13]; /* Buffer to store the IHDR info */ - - png_debug(1, "in png_write_IHDR"); - /* Check that we have valid input data from the application info */ - switch (color_type) - { - case PNG_COLOR_TYPE_GRAY: - switch (bit_depth) - { - case 1: - case 2: - case 4: - case 8: - case 16: png_ptr->channels = 1; break; - default: png_error(png_ptr, "Invalid bit depth for grayscale image"); - } - break; - case PNG_COLOR_TYPE_RGB: - if (bit_depth != 8 && bit_depth != 16) - png_error(png_ptr, "Invalid bit depth for RGB image"); - png_ptr->channels = 3; - break; - case PNG_COLOR_TYPE_PALETTE: - switch (bit_depth) - { - case 1: - case 2: - case 4: - case 8: png_ptr->channels = 1; break; - default: png_error(png_ptr, "Invalid bit depth for paletted image"); - } - break; - case PNG_COLOR_TYPE_GRAY_ALPHA: - if (bit_depth != 8 && bit_depth != 16) - png_error(png_ptr, "Invalid bit depth for grayscale+alpha image"); - png_ptr->channels = 2; - break; - case PNG_COLOR_TYPE_RGB_ALPHA: - if (bit_depth != 8 && bit_depth != 16) - png_error(png_ptr, "Invalid bit depth for RGBA image"); - png_ptr->channels = 4; - break; - default: - png_error(png_ptr, "Invalid image color type specified"); - } - - if (compression_type != PNG_COMPRESSION_TYPE_BASE) - { - png_warning(png_ptr, "Invalid compression type specified"); - compression_type = PNG_COMPRESSION_TYPE_BASE; - } - - /* Write filter_method 64 (intrapixel differencing) only if - * 1. Libpng was compiled with PNG_MNG_FEATURES_SUPPORTED and - * 2. Libpng did not write a PNG signature (this filter_method is only - * used in PNG datastreams that are embedded in MNG datastreams) and - * 3. The application called png_permit_mng_features with a mask that - * included PNG_FLAG_MNG_FILTER_64 and - * 4. The filter_method is 64 and - * 5. The color_type is RGB or RGBA - */ - if ( -#if defined(PNG_MNG_FEATURES_SUPPORTED) - !((png_ptr->mng_features_permitted & PNG_FLAG_MNG_FILTER_64) && - ((png_ptr->mode&PNG_HAVE_PNG_SIGNATURE) == 0) && - (color_type == PNG_COLOR_TYPE_RGB || - color_type == PNG_COLOR_TYPE_RGB_ALPHA) && - (filter_type == PNG_INTRAPIXEL_DIFFERENCING)) && -#endif - filter_type != PNG_FILTER_TYPE_BASE) - { - png_warning(png_ptr, "Invalid filter type specified"); - filter_type = PNG_FILTER_TYPE_BASE; - } - -#ifdef PNG_WRITE_INTERLACING_SUPPORTED - if (interlace_type != PNG_INTERLACE_NONE && - interlace_type != PNG_INTERLACE_ADAM7) - { - png_warning(png_ptr, "Invalid interlace type specified"); - interlace_type = PNG_INTERLACE_ADAM7; - } -#else - interlace_type=PNG_INTERLACE_NONE; -#endif - - /* Save the relevent information */ - png_ptr->bit_depth = (png_byte)bit_depth; - png_ptr->color_type = (png_byte)color_type; - png_ptr->interlaced = (png_byte)interlace_type; -#if defined(PNG_MNG_FEATURES_SUPPORTED) - png_ptr->filter_type = (png_byte)filter_type; -#endif - png_ptr->compression_type = (png_byte)compression_type; - png_ptr->width = width; - png_ptr->height = height; - - png_ptr->pixel_depth = (png_byte)(bit_depth * png_ptr->channels); - png_ptr->rowbytes = PNG_ROWBYTES(png_ptr->pixel_depth, width); - /* Set the usr info, so any transformations can modify it */ - png_ptr->usr_width = png_ptr->width; - png_ptr->usr_bit_depth = png_ptr->bit_depth; - png_ptr->usr_channels = png_ptr->channels; - - /* Pack the header information into the buffer */ - png_save_uint_32(buf, width); - png_save_uint_32(buf + 4, height); - buf[8] = (png_byte)bit_depth; - buf[9] = (png_byte)color_type; - buf[10] = (png_byte)compression_type; - buf[11] = (png_byte)filter_type; - buf[12] = (png_byte)interlace_type; - - /* Write the chunk */ - png_write_chunk(png_ptr, (png_bytep)png_IHDR, buf, (png_size_t)13); - - /* Initialize zlib with PNG info */ - png_ptr->zstream.zalloc = png_zalloc; - png_ptr->zstream.zfree = png_zfree; - png_ptr->zstream.opaque = (voidpf)png_ptr; - if (!(png_ptr->do_filter)) - { - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE || - png_ptr->bit_depth < 8) - png_ptr->do_filter = PNG_FILTER_NONE; - else - png_ptr->do_filter = PNG_ALL_FILTERS; - } - if (!(png_ptr->flags & PNG_FLAG_ZLIB_CUSTOM_STRATEGY)) - { - if (png_ptr->do_filter != PNG_FILTER_NONE) - png_ptr->zlib_strategy = Z_FILTERED; - else - png_ptr->zlib_strategy = Z_DEFAULT_STRATEGY; - } - if (!(png_ptr->flags & PNG_FLAG_ZLIB_CUSTOM_LEVEL)) - png_ptr->zlib_level = Z_DEFAULT_COMPRESSION; - if (!(png_ptr->flags & PNG_FLAG_ZLIB_CUSTOM_MEM_LEVEL)) - png_ptr->zlib_mem_level = 8; - if (!(png_ptr->flags & PNG_FLAG_ZLIB_CUSTOM_WINDOW_BITS)) - png_ptr->zlib_window_bits = 15; - if (!(png_ptr->flags & PNG_FLAG_ZLIB_CUSTOM_METHOD)) - png_ptr->zlib_method = 8; - ret = deflateInit2(&png_ptr->zstream, png_ptr->zlib_level, - png_ptr->zlib_method, png_ptr->zlib_window_bits, - png_ptr->zlib_mem_level, png_ptr->zlib_strategy); - if (ret != Z_OK) - { - if (ret == Z_VERSION_ERROR) png_error(png_ptr, - "zlib failed to initialize compressor -- version error"); - if (ret == Z_STREAM_ERROR) png_error(png_ptr, - "zlib failed to initialize compressor -- stream error"); - if (ret == Z_MEM_ERROR) png_error(png_ptr, - "zlib failed to initialize compressor -- mem error"); - png_error(png_ptr, "zlib failed to initialize compressor"); - } - png_ptr->zstream.next_out = png_ptr->zbuf; - png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; - /* libpng is not interested in zstream.data_type */ - /* Set it to a predefined value, to avoid its evaluation inside zlib */ - png_ptr->zstream.data_type = Z_BINARY; - - png_ptr->mode = PNG_HAVE_IHDR; -} - -/* Write the palette. We are careful not to trust png_color to be in the - * correct order for PNG, so people can redefine it to any convenient - * structure. - */ -void /* PRIVATE */ -png_write_PLTE(png_structp png_ptr, png_colorp palette, png_uint_32 num_pal) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_PLTE; -#endif - png_uint_32 i; - png_colorp pal_ptr; - png_byte buf[3]; - - png_debug(1, "in png_write_PLTE"); - if (( -#if defined(PNG_MNG_FEATURES_SUPPORTED) - !(png_ptr->mng_features_permitted & PNG_FLAG_MNG_EMPTY_PLTE) && -#endif - num_pal == 0) || num_pal > 256) - { - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - { - png_error(png_ptr, "Invalid number of colors in palette"); - } - else - { - png_warning(png_ptr, "Invalid number of colors in palette"); - return; - } - } - - if (!(png_ptr->color_type&PNG_COLOR_MASK_COLOR)) - { - png_warning(png_ptr, - "Ignoring request to write a PLTE chunk in grayscale PNG"); - return; - } - - png_ptr->num_palette = (png_uint_16)num_pal; - png_debug1(3, "num_palette = %d", png_ptr->num_palette); - - png_write_chunk_start(png_ptr, (png_bytep)png_PLTE, - (png_uint_32)(num_pal * 3)); -#ifndef PNG_NO_POINTER_INDEXING - for (i = 0, pal_ptr = palette; i < num_pal; i++, pal_ptr++) - { - buf[0] = pal_ptr->red; - buf[1] = pal_ptr->green; - buf[2] = pal_ptr->blue; - png_write_chunk_data(png_ptr, buf, (png_size_t)3); - } -#else - /* This is a little slower but some buggy compilers need to do this instead */ - pal_ptr=palette; - for (i = 0; i < num_pal; i++) - { - buf[0] = pal_ptr[i].red; - buf[1] = pal_ptr[i].green; - buf[2] = pal_ptr[i].blue; - png_write_chunk_data(png_ptr, buf, (png_size_t)3); - } -#endif - png_write_chunk_end(png_ptr); - png_ptr->mode |= PNG_HAVE_PLTE; -} - -/* Write an IDAT chunk */ -void /* PRIVATE */ -png_write_IDAT(png_structp png_ptr, png_bytep data, png_size_t length) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_IDAT; -#endif - png_debug(1, "in png_write_IDAT"); - - /* Optimize the CMF field in the zlib stream. */ - /* This hack of the zlib stream is compliant to the stream specification. */ - if (!(png_ptr->mode & PNG_HAVE_IDAT) && - png_ptr->compression_type == PNG_COMPRESSION_TYPE_BASE) - { - unsigned int z_cmf = data[0]; /* zlib compression method and flags */ - if ((z_cmf & 0x0f) == 8 && (z_cmf & 0xf0) <= 0x70) - { - /* Avoid memory underflows and multiplication overflows. - * - * The conditions below are practically always satisfied; - * however, they still must be checked. - */ - if (length >= 2 && - png_ptr->height < 16384 && png_ptr->width < 16384) - { - png_uint_32 uncompressed_idat_size = png_ptr->height * - ((png_ptr->width * - png_ptr->channels * png_ptr->bit_depth + 15) >> 3); - unsigned int z_cinfo = z_cmf >> 4; - unsigned int half_z_window_size = 1 << (z_cinfo + 7); - while (uncompressed_idat_size <= half_z_window_size && - half_z_window_size >= 256) - { - z_cinfo--; - half_z_window_size >>= 1; - } - z_cmf = (z_cmf & 0x0f) | (z_cinfo << 4); - if (data[0] != (png_byte)z_cmf) - { - data[0] = (png_byte)z_cmf; - data[1] &= 0xe0; - data[1] += (png_byte)(0x1f - ((z_cmf << 8) + data[1]) % 0x1f); - } - } - } - else - png_error(png_ptr, - "Invalid zlib compression method or flags in IDAT"); - } - - png_write_chunk(png_ptr, (png_bytep)png_IDAT, data, length); - png_ptr->mode |= PNG_HAVE_IDAT; -} - -/* Write an IEND chunk */ -void /* PRIVATE */ -png_write_IEND(png_structp png_ptr) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_IEND; -#endif - png_debug(1, "in png_write_IEND"); - png_write_chunk(png_ptr, (png_bytep)png_IEND, png_bytep_NULL, - (png_size_t)0); - png_ptr->mode |= PNG_HAVE_IEND; -} - -#if defined(PNG_WRITE_gAMA_SUPPORTED) -/* Write a gAMA chunk */ -#ifdef PNG_FLOATING_POINT_SUPPORTED -void /* PRIVATE */ -png_write_gAMA(png_structp png_ptr, double file_gamma) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_gAMA; -#endif - png_uint_32 igamma; - png_byte buf[4]; - - png_debug(1, "in png_write_gAMA"); - /* file_gamma is saved in 1/100,000ths */ - igamma = (png_uint_32)(file_gamma * 100000.0 + 0.5); - png_save_uint_32(buf, igamma); - png_write_chunk(png_ptr, (png_bytep)png_gAMA, buf, (png_size_t)4); -} -#endif -#ifdef PNG_FIXED_POINT_SUPPORTED -void /* PRIVATE */ -png_write_gAMA_fixed(png_structp png_ptr, png_fixed_point file_gamma) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_gAMA; -#endif - png_byte buf[4]; - - png_debug(1, "in png_write_gAMA"); - /* file_gamma is saved in 1/100,000ths */ - png_save_uint_32(buf, (png_uint_32)file_gamma); - png_write_chunk(png_ptr, (png_bytep)png_gAMA, buf, (png_size_t)4); -} -#endif -#endif - -#if defined(PNG_WRITE_sRGB_SUPPORTED) -/* Write a sRGB chunk */ -void /* PRIVATE */ -png_write_sRGB(png_structp png_ptr, int srgb_intent) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_sRGB; -#endif - png_byte buf[1]; - - png_debug(1, "in png_write_sRGB"); - if (srgb_intent >= PNG_sRGB_INTENT_LAST) - png_warning(png_ptr, - "Invalid sRGB rendering intent specified"); - buf[0]=(png_byte)srgb_intent; - png_write_chunk(png_ptr, (png_bytep)png_sRGB, buf, (png_size_t)1); -} -#endif - -#if defined(PNG_WRITE_iCCP_SUPPORTED) -/* Write an iCCP chunk */ -void /* PRIVATE */ -png_write_iCCP(png_structp png_ptr, png_charp name, int compression_type, - png_charp profile, int profile_len) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_iCCP; -#endif - png_size_t name_len; - png_charp new_name; - compression_state comp; - int embedded_profile_len = 0; - - png_debug(1, "in png_write_iCCP"); - - comp.num_output_ptr = 0; - comp.max_output_ptr = 0; - comp.output_ptr = NULL; - comp.input = NULL; - comp.input_len = 0; - - if ((name_len = png_check_keyword(png_ptr, name, - &new_name)) == 0) - return; - - if (compression_type != PNG_COMPRESSION_TYPE_BASE) - png_warning(png_ptr, "Unknown compression type in iCCP chunk"); - - if (profile == NULL) - profile_len = 0; - - if (profile_len > 3) - embedded_profile_len = - ((*( (png_bytep)profile ))<<24) | - ((*( (png_bytep)profile + 1))<<16) | - ((*( (png_bytep)profile + 2))<< 8) | - ((*( (png_bytep)profile + 3)) ); - - if (profile_len < embedded_profile_len) - { - png_warning(png_ptr, - "Embedded profile length too large in iCCP chunk"); - png_free(png_ptr, new_name); - return; - } - - if (profile_len > embedded_profile_len) - { - png_warning(png_ptr, - "Truncating profile to actual length in iCCP chunk"); - profile_len = embedded_profile_len; - } - - if (profile_len) - profile_len = png_text_compress(png_ptr, profile, - (png_size_t)profile_len, PNG_COMPRESSION_TYPE_BASE, &comp); - - /* Make sure we include the NULL after the name and the compression type */ - png_write_chunk_start(png_ptr, (png_bytep)png_iCCP, - (png_uint_32)(name_len + profile_len + 2)); - new_name[name_len + 1] = 0x00; - png_write_chunk_data(png_ptr, (png_bytep)new_name, - (png_size_t)(name_len + 2)); - - if (profile_len) - png_write_compressed_data_out(png_ptr, &comp); - - png_write_chunk_end(png_ptr); - png_free(png_ptr, new_name); -} -#endif - -#if defined(PNG_WRITE_sPLT_SUPPORTED) -/* Write a sPLT chunk */ -void /* PRIVATE */ -png_write_sPLT(png_structp png_ptr, png_sPLT_tp spalette) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_sPLT; -#endif - png_size_t name_len; - png_charp new_name; - png_byte entrybuf[10]; - int entry_size = (spalette->depth == 8 ? 6 : 10); - int palette_size = entry_size * spalette->nentries; - png_sPLT_entryp ep; -#ifdef PNG_NO_POINTER_INDEXING - int i; -#endif - - png_debug(1, "in png_write_sPLT"); - if ((name_len = png_check_keyword(png_ptr,spalette->name, &new_name))==0) - return; - - /* Make sure we include the NULL after the name */ - png_write_chunk_start(png_ptr, (png_bytep)png_sPLT, - (png_uint_32)(name_len + 2 + palette_size)); - png_write_chunk_data(png_ptr, (png_bytep)new_name, - (png_size_t)(name_len + 1)); - png_write_chunk_data(png_ptr, (png_bytep)&spalette->depth, (png_size_t)1); - - /* Loop through each palette entry, writing appropriately */ -#ifndef PNG_NO_POINTER_INDEXING - for (ep = spalette->entries; epentries + spalette->nentries; ep++) - { - if (spalette->depth == 8) - { - entrybuf[0] = (png_byte)ep->red; - entrybuf[1] = (png_byte)ep->green; - entrybuf[2] = (png_byte)ep->blue; - entrybuf[3] = (png_byte)ep->alpha; - png_save_uint_16(entrybuf + 4, ep->frequency); - } - else - { - png_save_uint_16(entrybuf + 0, ep->red); - png_save_uint_16(entrybuf + 2, ep->green); - png_save_uint_16(entrybuf + 4, ep->blue); - png_save_uint_16(entrybuf + 6, ep->alpha); - png_save_uint_16(entrybuf + 8, ep->frequency); - } - png_write_chunk_data(png_ptr, entrybuf, (png_size_t)entry_size); - } -#else - ep=spalette->entries; - for (i=0; i>spalette->nentries; i++) - { - if (spalette->depth == 8) - { - entrybuf[0] = (png_byte)ep[i].red; - entrybuf[1] = (png_byte)ep[i].green; - entrybuf[2] = (png_byte)ep[i].blue; - entrybuf[3] = (png_byte)ep[i].alpha; - png_save_uint_16(entrybuf + 4, ep[i].frequency); - } - else - { - png_save_uint_16(entrybuf + 0, ep[i].red); - png_save_uint_16(entrybuf + 2, ep[i].green); - png_save_uint_16(entrybuf + 4, ep[i].blue); - png_save_uint_16(entrybuf + 6, ep[i].alpha); - png_save_uint_16(entrybuf + 8, ep[i].frequency); - } - png_write_chunk_data(png_ptr, entrybuf, (png_size_t)entry_size); - } -#endif - - png_write_chunk_end(png_ptr); - png_free(png_ptr, new_name); -} -#endif - -#if defined(PNG_WRITE_sBIT_SUPPORTED) -/* Write the sBIT chunk */ -void /* PRIVATE */ -png_write_sBIT(png_structp png_ptr, png_color_8p sbit, int color_type) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_sBIT; -#endif - png_byte buf[4]; - png_size_t size; - - png_debug(1, "in png_write_sBIT"); - /* Make sure we don't depend upon the order of PNG_COLOR_8 */ - if (color_type & PNG_COLOR_MASK_COLOR) - { - png_byte maxbits; - - maxbits = (png_byte)(color_type==PNG_COLOR_TYPE_PALETTE ? 8 : - png_ptr->usr_bit_depth); - if (sbit->red == 0 || sbit->red > maxbits || - sbit->green == 0 || sbit->green > maxbits || - sbit->blue == 0 || sbit->blue > maxbits) - { - png_warning(png_ptr, "Invalid sBIT depth specified"); - return; - } - buf[0] = sbit->red; - buf[1] = sbit->green; - buf[2] = sbit->blue; - size = 3; - } - else - { - if (sbit->gray == 0 || sbit->gray > png_ptr->usr_bit_depth) - { - png_warning(png_ptr, "Invalid sBIT depth specified"); - return; - } - buf[0] = sbit->gray; - size = 1; - } - - if (color_type & PNG_COLOR_MASK_ALPHA) - { - if (sbit->alpha == 0 || sbit->alpha > png_ptr->usr_bit_depth) - { - png_warning(png_ptr, "Invalid sBIT depth specified"); - return; - } - buf[size++] = sbit->alpha; - } - - png_write_chunk(png_ptr, (png_bytep)png_sBIT, buf, size); -} -#endif - -#if defined(PNG_WRITE_cHRM_SUPPORTED) -/* Write the cHRM chunk */ -#ifdef PNG_FLOATING_POINT_SUPPORTED -void /* PRIVATE */ -png_write_cHRM(png_structp png_ptr, double white_x, double white_y, - double red_x, double red_y, double green_x, double green_y, - double blue_x, double blue_y) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_cHRM; -#endif - png_byte buf[32]; - - png_fixed_point int_white_x, int_white_y, int_red_x, int_red_y, - int_green_x, int_green_y, int_blue_x, int_blue_y; - - png_debug(1, "in png_write_cHRM"); - - int_white_x = (png_uint_32)(white_x * 100000.0 + 0.5); - int_white_y = (png_uint_32)(white_y * 100000.0 + 0.5); - int_red_x = (png_uint_32)(red_x * 100000.0 + 0.5); - int_red_y = (png_uint_32)(red_y * 100000.0 + 0.5); - int_green_x = (png_uint_32)(green_x * 100000.0 + 0.5); - int_green_y = (png_uint_32)(green_y * 100000.0 + 0.5); - int_blue_x = (png_uint_32)(blue_x * 100000.0 + 0.5); - int_blue_y = (png_uint_32)(blue_y * 100000.0 + 0.5); - -#if !defined(PNG_NO_CHECK_cHRM) - if (png_check_cHRM_fixed(png_ptr, int_white_x, int_white_y, - int_red_x, int_red_y, int_green_x, int_green_y, int_blue_x, int_blue_y)) -#endif - { - /* Each value is saved in 1/100,000ths */ - - png_save_uint_32(buf, int_white_x); - png_save_uint_32(buf + 4, int_white_y); - - png_save_uint_32(buf + 8, int_red_x); - png_save_uint_32(buf + 12, int_red_y); - - png_save_uint_32(buf + 16, int_green_x); - png_save_uint_32(buf + 20, int_green_y); - - png_save_uint_32(buf + 24, int_blue_x); - png_save_uint_32(buf + 28, int_blue_y); - - png_write_chunk(png_ptr, (png_bytep)png_cHRM, buf, (png_size_t)32); - } -} -#endif -#ifdef PNG_FIXED_POINT_SUPPORTED -void /* PRIVATE */ -png_write_cHRM_fixed(png_structp png_ptr, png_fixed_point white_x, - png_fixed_point white_y, png_fixed_point red_x, png_fixed_point red_y, - png_fixed_point green_x, png_fixed_point green_y, png_fixed_point blue_x, - png_fixed_point blue_y) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_cHRM; -#endif - png_byte buf[32]; - - png_debug(1, "in png_write_cHRM"); - /* Each value is saved in 1/100,000ths */ -#if !defined(PNG_NO_CHECK_cHRM) - if (png_check_cHRM_fixed(png_ptr, white_x, white_y, red_x, red_y, - green_x, green_y, blue_x, blue_y)) -#endif - { - png_save_uint_32(buf, (png_uint_32)white_x); - png_save_uint_32(buf + 4, (png_uint_32)white_y); - - png_save_uint_32(buf + 8, (png_uint_32)red_x); - png_save_uint_32(buf + 12, (png_uint_32)red_y); - - png_save_uint_32(buf + 16, (png_uint_32)green_x); - png_save_uint_32(buf + 20, (png_uint_32)green_y); - - png_save_uint_32(buf + 24, (png_uint_32)blue_x); - png_save_uint_32(buf + 28, (png_uint_32)blue_y); - - png_write_chunk(png_ptr, (png_bytep)png_cHRM, buf, (png_size_t)32); - } -} -#endif -#endif - -#if defined(PNG_WRITE_tRNS_SUPPORTED) -/* Write the tRNS chunk */ -void /* PRIVATE */ -png_write_tRNS(png_structp png_ptr, png_bytep trans, png_color_16p tran, - int num_trans, int color_type) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_tRNS; -#endif - png_byte buf[6]; - - png_debug(1, "in png_write_tRNS"); - if (color_type == PNG_COLOR_TYPE_PALETTE) - { - if (num_trans <= 0 || num_trans > (int)png_ptr->num_palette) - { - png_warning(png_ptr, "Invalid number of transparent colors specified"); - return; - } - /* Write the chunk out as it is */ - png_write_chunk(png_ptr, (png_bytep)png_tRNS, trans, - (png_size_t)num_trans); - } - else if (color_type == PNG_COLOR_TYPE_GRAY) - { - /* One 16 bit value */ - if (tran->gray >= (1 << png_ptr->bit_depth)) - { - png_warning(png_ptr, - "Ignoring attempt to write tRNS chunk out-of-range for bit_depth"); - return; - } - png_save_uint_16(buf, tran->gray); - png_write_chunk(png_ptr, (png_bytep)png_tRNS, buf, (png_size_t)2); - } - else if (color_type == PNG_COLOR_TYPE_RGB) - { - /* Three 16 bit values */ - png_save_uint_16(buf, tran->red); - png_save_uint_16(buf + 2, tran->green); - png_save_uint_16(buf + 4, tran->blue); - if (png_ptr->bit_depth == 8 && (buf[0] | buf[2] | buf[4])) - { - png_warning(png_ptr, - "Ignoring attempt to write 16-bit tRNS chunk when bit_depth is 8"); - return; - } - png_write_chunk(png_ptr, (png_bytep)png_tRNS, buf, (png_size_t)6); - } - else - { - png_warning(png_ptr, "Can't write tRNS with an alpha channel"); - } -} -#endif - -#if defined(PNG_WRITE_bKGD_SUPPORTED) -/* Write the background chunk */ -void /* PRIVATE */ -png_write_bKGD(png_structp png_ptr, png_color_16p back, int color_type) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_bKGD; -#endif - png_byte buf[6]; - - png_debug(1, "in png_write_bKGD"); - if (color_type == PNG_COLOR_TYPE_PALETTE) - { - if ( -#if defined(PNG_MNG_FEATURES_SUPPORTED) - (png_ptr->num_palette || - (!(png_ptr->mng_features_permitted & PNG_FLAG_MNG_EMPTY_PLTE))) && -#endif - back->index >= png_ptr->num_palette) - { - png_warning(png_ptr, "Invalid background palette index"); - return; - } - buf[0] = back->index; - png_write_chunk(png_ptr, (png_bytep)png_bKGD, buf, (png_size_t)1); - } - else if (color_type & PNG_COLOR_MASK_COLOR) - { - png_save_uint_16(buf, back->red); - png_save_uint_16(buf + 2, back->green); - png_save_uint_16(buf + 4, back->blue); - if (png_ptr->bit_depth == 8 && (buf[0] | buf[2] | buf[4])) - { - png_warning(png_ptr, - "Ignoring attempt to write 16-bit bKGD chunk when bit_depth is 8"); - return; - } - png_write_chunk(png_ptr, (png_bytep)png_bKGD, buf, (png_size_t)6); - } - else - { - if (back->gray >= (1 << png_ptr->bit_depth)) - { - png_warning(png_ptr, - "Ignoring attempt to write bKGD chunk out-of-range for bit_depth"); - return; - } - png_save_uint_16(buf, back->gray); - png_write_chunk(png_ptr, (png_bytep)png_bKGD, buf, (png_size_t)2); - } -} -#endif - -#if defined(PNG_WRITE_hIST_SUPPORTED) -/* Write the histogram */ -void /* PRIVATE */ -png_write_hIST(png_structp png_ptr, png_uint_16p hist, int num_hist) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_hIST; -#endif - int i; - png_byte buf[3]; - - png_debug(1, "in png_write_hIST"); - if (num_hist > (int)png_ptr->num_palette) - { - png_debug2(3, "num_hist = %d, num_palette = %d", num_hist, - png_ptr->num_palette); - png_warning(png_ptr, "Invalid number of histogram entries specified"); - return; - } - - png_write_chunk_start(png_ptr, (png_bytep)png_hIST, - (png_uint_32)(num_hist * 2)); - for (i = 0; i < num_hist; i++) - { - png_save_uint_16(buf, hist[i]); - png_write_chunk_data(png_ptr, buf, (png_size_t)2); - } - png_write_chunk_end(png_ptr); -} -#endif - -#if defined(PNG_WRITE_TEXT_SUPPORTED) || defined(PNG_WRITE_pCAL_SUPPORTED) || \ - defined(PNG_WRITE_iCCP_SUPPORTED) || defined(PNG_WRITE_sPLT_SUPPORTED) -/* Check that the tEXt or zTXt keyword is valid per PNG 1.0 specification, - * and if invalid, correct the keyword rather than discarding the entire - * chunk. The PNG 1.0 specification requires keywords 1-79 characters in - * length, forbids leading or trailing whitespace, multiple internal spaces, - * and the non-break space (0x80) from ISO 8859-1. Returns keyword length. - * - * The new_key is allocated to hold the corrected keyword and must be freed - * by the calling routine. This avoids problems with trying to write to - * static keywords without having to have duplicate copies of the strings. - */ -png_size_t /* PRIVATE */ -png_check_keyword(png_structp png_ptr, png_charp key, png_charpp new_key) -{ - png_size_t key_len; - png_charp kp, dp; - int kflag; - int kwarn=0; - - png_debug(1, "in png_check_keyword"); - *new_key = NULL; - - if (key == NULL || (key_len = png_strlen(key)) == 0) - { - png_warning(png_ptr, "zero length keyword"); - return ((png_size_t)0); - } - - png_debug1(2, "Keyword to be checked is '%s'", key); - - *new_key = (png_charp)png_malloc_warn(png_ptr, (png_uint_32)(key_len + 2)); - if (*new_key == NULL) - { - png_warning(png_ptr, "Out of memory while procesing keyword"); - return ((png_size_t)0); - } - - /* Replace non-printing characters with a blank and print a warning */ - for (kp = key, dp = *new_key; *kp != '\0'; kp++, dp++) - { - if ((png_byte)*kp < 0x20 || - ((png_byte)*kp > 0x7E && (png_byte)*kp < 0xA1)) - { -#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE) - char msg[40]; - - png_snprintf(msg, 40, - "invalid keyword character 0x%02X", (png_byte)*kp); - png_warning(png_ptr, msg); -#else - png_warning(png_ptr, "invalid character in keyword"); -#endif - *dp = ' '; - } - else - { - *dp = *kp; - } - } - *dp = '\0'; - - /* Remove any trailing white space. */ - kp = *new_key + key_len - 1; - if (*kp == ' ') - { - png_warning(png_ptr, "trailing spaces removed from keyword"); - - while (*kp == ' ') - { - *(kp--) = '\0'; - key_len--; - } - } - - /* Remove any leading white space. */ - kp = *new_key; - if (*kp == ' ') - { - png_warning(png_ptr, "leading spaces removed from keyword"); - - while (*kp == ' ') - { - kp++; - key_len--; - } - } - - png_debug1(2, "Checking for multiple internal spaces in '%s'", kp); - - /* Remove multiple internal spaces. */ - for (kflag = 0, dp = *new_key; *kp != '\0'; kp++) - { - if (*kp == ' ' && kflag == 0) - { - *(dp++) = *kp; - kflag = 1; - } - else if (*kp == ' ') - { - key_len--; - kwarn=1; - } - else - { - *(dp++) = *kp; - kflag = 0; - } - } - *dp = '\0'; - if (kwarn) - png_warning(png_ptr, "extra interior spaces removed from keyword"); - - if (key_len == 0) - { - png_free(png_ptr, *new_key); - *new_key=NULL; - png_warning(png_ptr, "Zero length keyword"); - } - - if (key_len > 79) - { - png_warning(png_ptr, "keyword length must be 1 - 79 characters"); - (*new_key)[79] = '\0'; - key_len = 79; - } - - return (key_len); -} -#endif - -#if defined(PNG_WRITE_tEXt_SUPPORTED) -/* Write a tEXt chunk */ -void /* PRIVATE */ -png_write_tEXt(png_structp png_ptr, png_charp key, png_charp text, - png_size_t text_len) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_tEXt; -#endif - png_size_t key_len; - png_charp new_key; - - png_debug(1, "in png_write_tEXt"); - if ((key_len = png_check_keyword(png_ptr, key, &new_key))==0) - return; - - if (text == NULL || *text == '\0') - text_len = 0; - else - text_len = png_strlen(text); - - /* Make sure we include the 0 after the key */ - png_write_chunk_start(png_ptr, (png_bytep)png_tEXt, - (png_uint_32)(key_len + text_len + 1)); - /* - * We leave it to the application to meet PNG-1.0 requirements on the - * contents of the text. PNG-1.0 through PNG-1.2 discourage the use of - * any non-Latin-1 characters except for NEWLINE. ISO PNG will forbid them. - * The NUL character is forbidden by PNG-1.0 through PNG-1.2 and ISO PNG. - */ - png_write_chunk_data(png_ptr, (png_bytep)new_key, - (png_size_t)(key_len + 1)); - if (text_len) - png_write_chunk_data(png_ptr, (png_bytep)text, (png_size_t)text_len); - - png_write_chunk_end(png_ptr); - png_free(png_ptr, new_key); -} -#endif - -#if defined(PNG_WRITE_zTXt_SUPPORTED) -/* Write a compressed text chunk */ -void /* PRIVATE */ -png_write_zTXt(png_structp png_ptr, png_charp key, png_charp text, - png_size_t text_len, int compression) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_zTXt; -#endif - png_size_t key_len; - char buf[1]; - png_charp new_key; - compression_state comp; - - png_debug(1, "in png_write_zTXt"); - - comp.num_output_ptr = 0; - comp.max_output_ptr = 0; - comp.output_ptr = NULL; - comp.input = NULL; - comp.input_len = 0; - - if ((key_len = png_check_keyword(png_ptr, key, &new_key))==0) - { - png_free(png_ptr, new_key); - return; - } - - if (text == NULL || *text == '\0' || compression==PNG_TEXT_COMPRESSION_NONE) - { - png_write_tEXt(png_ptr, new_key, text, (png_size_t)0); - png_free(png_ptr, new_key); - return; - } - - text_len = png_strlen(text); - - /* Compute the compressed data; do it now for the length */ - text_len = png_text_compress(png_ptr, text, text_len, compression, - &comp); - - /* Write start of chunk */ - png_write_chunk_start(png_ptr, (png_bytep)png_zTXt, - (png_uint_32)(key_len+text_len + 2)); - /* Write key */ - png_write_chunk_data(png_ptr, (png_bytep)new_key, - (png_size_t)(key_len + 1)); - png_free(png_ptr, new_key); - - buf[0] = (png_byte)compression; - /* Write compression */ - png_write_chunk_data(png_ptr, (png_bytep)buf, (png_size_t)1); - /* Write the compressed data */ - png_write_compressed_data_out(png_ptr, &comp); - - /* Close the chunk */ - png_write_chunk_end(png_ptr); -} -#endif - -#if defined(PNG_WRITE_iTXt_SUPPORTED) -/* Write an iTXt chunk */ -void /* PRIVATE */ -png_write_iTXt(png_structp png_ptr, int compression, png_charp key, - png_charp lang, png_charp lang_key, png_charp text) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_iTXt; -#endif - png_size_t lang_len, key_len, lang_key_len, text_len; - png_charp new_lang; - png_charp new_key = NULL; - png_byte cbuf[2]; - compression_state comp; - - png_debug(1, "in png_write_iTXt"); - - comp.num_output_ptr = 0; - comp.max_output_ptr = 0; - comp.output_ptr = NULL; - comp.input = NULL; - - if ((key_len = png_check_keyword(png_ptr, key, &new_key))==0) - return; - - if ((lang_len = png_check_keyword(png_ptr, lang, &new_lang))==0) - { - png_warning(png_ptr, "Empty language field in iTXt chunk"); - new_lang = NULL; - lang_len = 0; - } - - if (lang_key == NULL) - lang_key_len = 0; - else - lang_key_len = png_strlen(lang_key); - - if (text == NULL) - text_len = 0; - else - text_len = png_strlen(text); - - /* Compute the compressed data; do it now for the length */ - text_len = png_text_compress(png_ptr, text, text_len, compression-2, - &comp); - - - /* Make sure we include the compression flag, the compression byte, - * and the NULs after the key, lang, and lang_key parts */ - - png_write_chunk_start(png_ptr, (png_bytep)png_iTXt, - (png_uint_32)( - 5 /* comp byte, comp flag, terminators for key, lang and lang_key */ - + key_len - + lang_len - + lang_key_len - + text_len)); - - /* We leave it to the application to meet PNG-1.0 requirements on the - * contents of the text. PNG-1.0 through PNG-1.2 discourage the use of - * any non-Latin-1 characters except for NEWLINE. ISO PNG will forbid them. - * The NUL character is forbidden by PNG-1.0 through PNG-1.2 and ISO PNG. - */ - png_write_chunk_data(png_ptr, (png_bytep)new_key, - (png_size_t)(key_len + 1)); - - /* Set the compression flag */ - if (compression == PNG_ITXT_COMPRESSION_NONE || \ - compression == PNG_TEXT_COMPRESSION_NONE) - cbuf[0] = 0; - else /* compression == PNG_ITXT_COMPRESSION_zTXt */ - cbuf[0] = 1; - /* Set the compression method */ - cbuf[1] = 0; - png_write_chunk_data(png_ptr, cbuf, (png_size_t)2); - - cbuf[0] = 0; - png_write_chunk_data(png_ptr, (new_lang ? (png_bytep)new_lang : cbuf), - (png_size_t)(lang_len + 1)); - png_write_chunk_data(png_ptr, (lang_key ? (png_bytep)lang_key : cbuf), - (png_size_t)(lang_key_len + 1)); - png_write_compressed_data_out(png_ptr, &comp); - - png_write_chunk_end(png_ptr); - png_free(png_ptr, new_key); - png_free(png_ptr, new_lang); -} -#endif - -#if defined(PNG_WRITE_oFFs_SUPPORTED) -/* Write the oFFs chunk */ -void /* PRIVATE */ -png_write_oFFs(png_structp png_ptr, png_int_32 x_offset, png_int_32 y_offset, - int unit_type) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_oFFs; -#endif - png_byte buf[9]; - - png_debug(1, "in png_write_oFFs"); - if (unit_type >= PNG_OFFSET_LAST) - png_warning(png_ptr, "Unrecognized unit type for oFFs chunk"); - - png_save_int_32(buf, x_offset); - png_save_int_32(buf + 4, y_offset); - buf[8] = (png_byte)unit_type; - - png_write_chunk(png_ptr, (png_bytep)png_oFFs, buf, (png_size_t)9); -} -#endif -#if defined(PNG_WRITE_pCAL_SUPPORTED) -/* Write the pCAL chunk (described in the PNG extensions document) */ -void /* PRIVATE */ -png_write_pCAL(png_structp png_ptr, png_charp purpose, png_int_32 X0, - png_int_32 X1, int type, int nparams, png_charp units, png_charpp params) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_pCAL; -#endif - png_size_t purpose_len, units_len, total_len; - png_uint_32p params_len; - png_byte buf[10]; - png_charp new_purpose; - int i; - - png_debug1(1, "in png_write_pCAL (%d parameters)", nparams); - if (type >= PNG_EQUATION_LAST) - png_warning(png_ptr, "Unrecognized equation type for pCAL chunk"); - - purpose_len = png_check_keyword(png_ptr, purpose, &new_purpose) + 1; - png_debug1(3, "pCAL purpose length = %d", (int)purpose_len); - units_len = png_strlen(units) + (nparams == 0 ? 0 : 1); - png_debug1(3, "pCAL units length = %d", (int)units_len); - total_len = purpose_len + units_len + 10; - - params_len = (png_uint_32p)png_malloc(png_ptr, - (png_uint_32)(nparams * png_sizeof(png_uint_32))); - - /* Find the length of each parameter, making sure we don't count the - null terminator for the last parameter. */ - for (i = 0; i < nparams; i++) - { - params_len[i] = png_strlen(params[i]) + (i == nparams - 1 ? 0 : 1); - png_debug2(3, "pCAL parameter %d length = %lu", i, - (unsigned long) params_len[i]); - total_len += (png_size_t)params_len[i]; - } - - png_debug1(3, "pCAL total length = %d", (int)total_len); - png_write_chunk_start(png_ptr, (png_bytep)png_pCAL, (png_uint_32)total_len); - png_write_chunk_data(png_ptr, (png_bytep)new_purpose, - (png_size_t)purpose_len); - png_save_int_32(buf, X0); - png_save_int_32(buf + 4, X1); - buf[8] = (png_byte)type; - buf[9] = (png_byte)nparams; - png_write_chunk_data(png_ptr, buf, (png_size_t)10); - png_write_chunk_data(png_ptr, (png_bytep)units, (png_size_t)units_len); - - png_free(png_ptr, new_purpose); - - for (i = 0; i < nparams; i++) - { - png_write_chunk_data(png_ptr, (png_bytep)params[i], - (png_size_t)params_len[i]); - } - - png_free(png_ptr, params_len); - png_write_chunk_end(png_ptr); -} -#endif - -#if defined(PNG_WRITE_sCAL_SUPPORTED) -/* Write the sCAL chunk */ -#if defined(PNG_FLOATING_POINT_SUPPORTED) && !defined(PNG_NO_STDIO) -void /* PRIVATE */ -png_write_sCAL(png_structp png_ptr, int unit, double width, double height) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_sCAL; -#endif - char buf[64]; - png_size_t total_len; - - png_debug(1, "in png_write_sCAL"); - - buf[0] = (char)unit; -#if defined(_WIN32_WCE) -/* sprintf() function is not supported on WindowsCE */ - { - wchar_t wc_buf[32]; - size_t wc_len; - swprintf(wc_buf, TEXT("%12.12e"), width); - wc_len = wcslen(wc_buf); - WideCharToMultiByte(CP_ACP, 0, wc_buf, -1, buf + 1, wc_len, NULL, NULL); - total_len = wc_len + 2; - swprintf(wc_buf, TEXT("%12.12e"), height); - wc_len = wcslen(wc_buf); - WideCharToMultiByte(CP_ACP, 0, wc_buf, -1, buf + total_len, wc_len, - NULL, NULL); - total_len += wc_len; - } -#else - png_snprintf(buf + 1, 63, "%12.12e", width); - total_len = 1 + png_strlen(buf + 1) + 1; - png_snprintf(buf + total_len, 64-total_len, "%12.12e", height); - total_len += png_strlen(buf + total_len); -#endif - - png_debug1(3, "sCAL total length = %u", (unsigned int)total_len); - png_write_chunk(png_ptr, (png_bytep)png_sCAL, (png_bytep)buf, total_len); -} -#else -#ifdef PNG_FIXED_POINT_SUPPORTED -void /* PRIVATE */ -png_write_sCAL_s(png_structp png_ptr, int unit, png_charp width, - png_charp height) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_sCAL; -#endif - png_byte buf[64]; - png_size_t wlen, hlen, total_len; - - png_debug(1, "in png_write_sCAL_s"); - - wlen = png_strlen(width); - hlen = png_strlen(height); - total_len = wlen + hlen + 2; - if (total_len > 64) - { - png_warning(png_ptr, "Can't write sCAL (buffer too small)"); - return; - } - - buf[0] = (png_byte)unit; - png_memcpy(buf + 1, width, wlen + 1); /* Append the '\0' here */ - png_memcpy(buf + wlen + 2, height, hlen); /* Do NOT append the '\0' here */ - - png_debug1(3, "sCAL total length = %u", (unsigned int)total_len); - png_write_chunk(png_ptr, (png_bytep)png_sCAL, buf, total_len); -} -#endif -#endif -#endif - -#if defined(PNG_WRITE_pHYs_SUPPORTED) -/* Write the pHYs chunk */ -void /* PRIVATE */ -png_write_pHYs(png_structp png_ptr, png_uint_32 x_pixels_per_unit, - png_uint_32 y_pixels_per_unit, - int unit_type) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_pHYs; -#endif - png_byte buf[9]; - - png_debug(1, "in png_write_pHYs"); - if (unit_type >= PNG_RESOLUTION_LAST) - png_warning(png_ptr, "Unrecognized unit type for pHYs chunk"); - - png_save_uint_32(buf, x_pixels_per_unit); - png_save_uint_32(buf + 4, y_pixels_per_unit); - buf[8] = (png_byte)unit_type; - - png_write_chunk(png_ptr, (png_bytep)png_pHYs, buf, (png_size_t)9); -} -#endif - -#if defined(PNG_WRITE_tIME_SUPPORTED) -/* Write the tIME chunk. Use either png_convert_from_struct_tm() - * or png_convert_from_time_t(), or fill in the structure yourself. - */ -void /* PRIVATE */ -png_write_tIME(png_structp png_ptr, png_timep mod_time) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_tIME; -#endif - png_byte buf[7]; - - png_debug(1, "in png_write_tIME"); - if (mod_time->month > 12 || mod_time->month < 1 || - mod_time->day > 31 || mod_time->day < 1 || - mod_time->hour > 23 || mod_time->second > 60) - { - png_warning(png_ptr, "Invalid time specified for tIME chunk"); - return; - } - - png_save_uint_16(buf, mod_time->year); - buf[2] = mod_time->month; - buf[3] = mod_time->day; - buf[4] = mod_time->hour; - buf[5] = mod_time->minute; - buf[6] = mod_time->second; - - png_write_chunk(png_ptr, (png_bytep)png_tIME, buf, (png_size_t)7); -} -#endif - -/* Initializes the row writing capability of libpng */ -void /* PRIVATE */ -png_write_start_row(png_structp png_ptr) -{ -#ifdef PNG_WRITE_INTERLACING_SUPPORTED -#ifdef PNG_USE_LOCAL_ARRAYS - /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */ - - /* Start of interlace block */ - int png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; - - /* Offset to next interlace block */ - int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; - - /* Start of interlace block in the y direction */ - int png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1}; - - /* Offset to next interlace block in the y direction */ - int png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2}; -#endif -#endif - - png_size_t buf_size; - - png_debug(1, "in png_write_start_row"); - buf_size = (png_size_t)(PNG_ROWBYTES( - png_ptr->usr_channels*png_ptr->usr_bit_depth, png_ptr->width) + 1); - - /* Set up row buffer */ - png_ptr->row_buf = (png_bytep)png_malloc(png_ptr, - (png_uint_32)buf_size); - png_ptr->row_buf[0] = PNG_FILTER_VALUE_NONE; - -#ifndef PNG_NO_WRITE_FILTER - /* Set up filtering buffer, if using this filter */ - if (png_ptr->do_filter & PNG_FILTER_SUB) - { - png_ptr->sub_row = (png_bytep)png_malloc(png_ptr, - (png_uint_32)(png_ptr->rowbytes + 1)); - png_ptr->sub_row[0] = PNG_FILTER_VALUE_SUB; - } - - /* We only need to keep the previous row if we are using one of these. */ - if (png_ptr->do_filter & (PNG_FILTER_AVG | PNG_FILTER_UP | PNG_FILTER_PAETH)) - { - /* Set up previous row buffer */ - png_ptr->prev_row = (png_bytep)png_malloc(png_ptr, - (png_uint_32)buf_size); - png_memset(png_ptr->prev_row, 0, buf_size); - - if (png_ptr->do_filter & PNG_FILTER_UP) - { - png_ptr->up_row = (png_bytep)png_malloc(png_ptr, - (png_uint_32)(png_ptr->rowbytes + 1)); - png_ptr->up_row[0] = PNG_FILTER_VALUE_UP; - } - - if (png_ptr->do_filter & PNG_FILTER_AVG) - { - png_ptr->avg_row = (png_bytep)png_malloc(png_ptr, - (png_uint_32)(png_ptr->rowbytes + 1)); - png_ptr->avg_row[0] = PNG_FILTER_VALUE_AVG; - } - - if (png_ptr->do_filter & PNG_FILTER_PAETH) - { - png_ptr->paeth_row = (png_bytep)png_malloc(png_ptr, - (png_uint_32)(png_ptr->rowbytes + 1)); - png_ptr->paeth_row[0] = PNG_FILTER_VALUE_PAETH; - } - } -#endif /* PNG_NO_WRITE_FILTER */ - -#ifdef PNG_WRITE_INTERLACING_SUPPORTED - /* If interlaced, we need to set up width and height of pass */ - if (png_ptr->interlaced) - { - if (!(png_ptr->transformations & PNG_INTERLACE)) - { - png_ptr->num_rows = (png_ptr->height + png_pass_yinc[0] - 1 - - png_pass_ystart[0]) / png_pass_yinc[0]; - png_ptr->usr_width = (png_ptr->width + png_pass_inc[0] - 1 - - png_pass_start[0]) / png_pass_inc[0]; - } - else - { - png_ptr->num_rows = png_ptr->height; - png_ptr->usr_width = png_ptr->width; - } - } - else -#endif - { - png_ptr->num_rows = png_ptr->height; - png_ptr->usr_width = png_ptr->width; - } - png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; - png_ptr->zstream.next_out = png_ptr->zbuf; -} - -/* Internal use only. Called when finished processing a row of data. */ -void /* PRIVATE */ -png_write_finish_row(png_structp png_ptr) -{ -#ifdef PNG_WRITE_INTERLACING_SUPPORTED -#ifdef PNG_USE_LOCAL_ARRAYS - /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */ - - /* Start of interlace block */ - int png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; - - /* Offset to next interlace block */ - int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; - - /* Start of interlace block in the y direction */ - int png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1}; - - /* Offset to next interlace block in the y direction */ - int png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2}; -#endif -#endif - - int ret; - - png_debug(1, "in png_write_finish_row"); - /* Next row */ - png_ptr->row_number++; - - /* See if we are done */ - if (png_ptr->row_number < png_ptr->num_rows) - return; - -#ifdef PNG_WRITE_INTERLACING_SUPPORTED - /* If interlaced, go to next pass */ - if (png_ptr->interlaced) - { - png_ptr->row_number = 0; - if (png_ptr->transformations & PNG_INTERLACE) - { - png_ptr->pass++; - } - else - { - /* Loop until we find a non-zero width or height pass */ - do - { - png_ptr->pass++; - if (png_ptr->pass >= 7) - break; - png_ptr->usr_width = (png_ptr->width + - png_pass_inc[png_ptr->pass] - 1 - - png_pass_start[png_ptr->pass]) / - png_pass_inc[png_ptr->pass]; - png_ptr->num_rows = (png_ptr->height + - png_pass_yinc[png_ptr->pass] - 1 - - png_pass_ystart[png_ptr->pass]) / - png_pass_yinc[png_ptr->pass]; - if (png_ptr->transformations & PNG_INTERLACE) - break; - } while (png_ptr->usr_width == 0 || png_ptr->num_rows == 0); - - } - - /* Reset the row above the image for the next pass */ - if (png_ptr->pass < 7) - { - if (png_ptr->prev_row != NULL) - png_memset(png_ptr->prev_row, 0, - (png_size_t)(PNG_ROWBYTES(png_ptr->usr_channels* - png_ptr->usr_bit_depth, png_ptr->width)) + 1); - return; - } - } -#endif - - /* If we get here, we've just written the last row, so we need - to flush the compressor */ - do - { - /* Tell the compressor we are done */ - ret = deflate(&png_ptr->zstream, Z_FINISH); - /* Check for an error */ - if (ret == Z_OK) - { - /* Check to see if we need more room */ - if (!(png_ptr->zstream.avail_out)) - { - png_write_IDAT(png_ptr, png_ptr->zbuf, png_ptr->zbuf_size); - png_ptr->zstream.next_out = png_ptr->zbuf; - png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; - } - } - else if (ret != Z_STREAM_END) - { - if (png_ptr->zstream.msg != NULL) - png_error(png_ptr, png_ptr->zstream.msg); - else - png_error(png_ptr, "zlib error"); - } - } while (ret != Z_STREAM_END); - - /* Write any extra space */ - if (png_ptr->zstream.avail_out < png_ptr->zbuf_size) - { - png_write_IDAT(png_ptr, png_ptr->zbuf, png_ptr->zbuf_size - - png_ptr->zstream.avail_out); - } - - deflateReset(&png_ptr->zstream); - png_ptr->zstream.data_type = Z_BINARY; -} - -#if defined(PNG_WRITE_INTERLACING_SUPPORTED) -/* Pick out the correct pixels for the interlace pass. - * The basic idea here is to go through the row with a source - * pointer and a destination pointer (sp and dp), and copy the - * correct pixels for the pass. As the row gets compacted, - * sp will always be >= dp, so we should never overwrite anything. - * See the default: case for the easiest code to understand. - */ -void /* PRIVATE */ -png_do_write_interlace(png_row_infop row_info, png_bytep row, int pass) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */ - - /* Start of interlace block */ - int png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; - - /* Offset to next interlace block */ - int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; -#endif - - png_debug(1, "in png_do_write_interlace"); - /* We don't have to do anything on the last pass (6) */ -#if defined(PNG_USELESS_TESTS_SUPPORTED) - if (row != NULL && row_info != NULL && pass < 6) -#else - if (pass < 6) -#endif - { - /* Each pixel depth is handled separately */ - switch (row_info->pixel_depth) - { - case 1: - { - png_bytep sp; - png_bytep dp; - int shift; - int d; - int value; - png_uint_32 i; - png_uint_32 row_width = row_info->width; - - dp = row; - d = 0; - shift = 7; - for (i = png_pass_start[pass]; i < row_width; - i += png_pass_inc[pass]) - { - sp = row + (png_size_t)(i >> 3); - value = (int)(*sp >> (7 - (int)(i & 0x07))) & 0x01; - d |= (value << shift); - - if (shift == 0) - { - shift = 7; - *dp++ = (png_byte)d; - d = 0; - } - else - shift--; - - } - if (shift != 7) - *dp = (png_byte)d; - break; - } - case 2: - { - png_bytep sp; - png_bytep dp; - int shift; - int d; - int value; - png_uint_32 i; - png_uint_32 row_width = row_info->width; - - dp = row; - shift = 6; - d = 0; - for (i = png_pass_start[pass]; i < row_width; - i += png_pass_inc[pass]) - { - sp = row + (png_size_t)(i >> 2); - value = (*sp >> ((3 - (int)(i & 0x03)) << 1)) & 0x03; - d |= (value << shift); - - if (shift == 0) - { - shift = 6; - *dp++ = (png_byte)d; - d = 0; - } - else - shift -= 2; - } - if (shift != 6) - *dp = (png_byte)d; - break; - } - case 4: - { - png_bytep sp; - png_bytep dp; - int shift; - int d; - int value; - png_uint_32 i; - png_uint_32 row_width = row_info->width; - - dp = row; - shift = 4; - d = 0; - for (i = png_pass_start[pass]; i < row_width; - i += png_pass_inc[pass]) - { - sp = row + (png_size_t)(i >> 1); - value = (*sp >> ((1 - (int)(i & 0x01)) << 2)) & 0x0f; - d |= (value << shift); - - if (shift == 0) - { - shift = 4; - *dp++ = (png_byte)d; - d = 0; - } - else - shift -= 4; - } - if (shift != 4) - *dp = (png_byte)d; - break; - } - default: - { - png_bytep sp; - png_bytep dp; - png_uint_32 i; - png_uint_32 row_width = row_info->width; - png_size_t pixel_bytes; - - /* Start at the beginning */ - dp = row; - /* Find out how many bytes each pixel takes up */ - pixel_bytes = (row_info->pixel_depth >> 3); - /* Loop through the row, only looking at the pixels that - matter */ - for (i = png_pass_start[pass]; i < row_width; - i += png_pass_inc[pass]) - { - /* Find out where the original pixel is */ - sp = row + (png_size_t)i * pixel_bytes; - /* Move the pixel */ - if (dp != sp) - png_memcpy(dp, sp, pixel_bytes); - /* Next pixel */ - dp += pixel_bytes; - } - break; - } - } - /* Set new row width */ - row_info->width = (row_info->width + - png_pass_inc[pass] - 1 - - png_pass_start[pass]) / - png_pass_inc[pass]; - row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth, - row_info->width); - } -} -#endif - -/* This filters the row, chooses which filter to use, if it has not already - * been specified by the application, and then writes the row out with the - * chosen filter. - */ -#define PNG_MAXSUM (((png_uint_32)(-1)) >> 1) -#define PNG_HISHIFT 10 -#define PNG_LOMASK ((png_uint_32)0xffffL) -#define PNG_HIMASK ((png_uint_32)(~PNG_LOMASK >> PNG_HISHIFT)) -void /* PRIVATE */ -png_write_find_filter(png_structp png_ptr, png_row_infop row_info) -{ - png_bytep best_row; -#ifndef PNG_NO_WRITE_FILTER - png_bytep prev_row, row_buf; - png_uint_32 mins, bpp; - png_byte filter_to_do = png_ptr->do_filter; - png_uint_32 row_bytes = row_info->rowbytes; -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) - int num_p_filters = (int)png_ptr->num_prev_filters; -#endif - - png_debug(1, "in png_write_find_filter"); - /* Find out how many bytes offset each pixel is */ - bpp = (row_info->pixel_depth + 7) >> 3; - - prev_row = png_ptr->prev_row; -#endif - best_row = png_ptr->row_buf; -#ifndef PNG_NO_WRITE_FILTER - row_buf = best_row; - mins = PNG_MAXSUM; - - /* The prediction method we use is to find which method provides the - * smallest value when summing the absolute values of the distances - * from zero, using anything >= 128 as negative numbers. This is known - * as the "minimum sum of absolute differences" heuristic. Other - * heuristics are the "weighted minimum sum of absolute differences" - * (experimental and can in theory improve compression), and the "zlib - * predictive" method (not implemented yet), which does test compressions - * of lines using different filter methods, and then chooses the - * (series of) filter(s) that give minimum compressed data size (VERY - * computationally expensive). - * - * GRR 980525: consider also - * (1) minimum sum of absolute differences from running average (i.e., - * keep running sum of non-absolute differences & count of bytes) - * [track dispersion, too? restart average if dispersion too large?] - * (1b) minimum sum of absolute differences from sliding average, probably - * with window size <= deflate window (usually 32K) - * (2) minimum sum of squared differences from zero or running average - * (i.e., ~ root-mean-square approach) - */ - - - /* We don't need to test the 'no filter' case if this is the only filter - * that has been chosen, as it doesn't actually do anything to the data. - */ - if ((filter_to_do & PNG_FILTER_NONE) && - filter_to_do != PNG_FILTER_NONE) - { - png_bytep rp; - png_uint_32 sum = 0; - png_uint_32 i; - int v; - - for (i = 0, rp = row_buf + 1; i < row_bytes; i++, rp++) - { - v = *rp; - sum += (v < 128) ? v : 256 - v; - } - -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) - if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED) - { - png_uint_32 sumhi, sumlo; - int j; - sumlo = sum & PNG_LOMASK; - sumhi = (sum >> PNG_HISHIFT) & PNG_HIMASK; /* Gives us some footroom */ - - /* Reduce the sum if we match any of the previous rows */ - for (j = 0; j < num_p_filters; j++) - { - if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_NONE) - { - sumlo = (sumlo * png_ptr->filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - sumhi = (sumhi * png_ptr->filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - } - } - - /* Factor in the cost of this filter (this is here for completeness, - * but it makes no sense to have a "cost" for the NONE filter, as - * it has the minimum possible computational cost - none). - */ - sumlo = (sumlo * png_ptr->filter_costs[PNG_FILTER_VALUE_NONE]) >> - PNG_COST_SHIFT; - sumhi = (sumhi * png_ptr->filter_costs[PNG_FILTER_VALUE_NONE]) >> - PNG_COST_SHIFT; - - if (sumhi > PNG_HIMASK) - sum = PNG_MAXSUM; - else - sum = (sumhi << PNG_HISHIFT) + sumlo; - } -#endif - mins = sum; - } - - /* Sub filter */ - if (filter_to_do == PNG_FILTER_SUB) - /* It's the only filter so no testing is needed */ - { - png_bytep rp, lp, dp; - png_uint_32 i; - for (i = 0, rp = row_buf + 1, dp = png_ptr->sub_row + 1; i < bpp; - i++, rp++, dp++) - { - *dp = *rp; - } - for (lp = row_buf + 1; i < row_bytes; - i++, rp++, lp++, dp++) - { - *dp = (png_byte)(((int)*rp - (int)*lp) & 0xff); - } - best_row = png_ptr->sub_row; - } - - else if (filter_to_do & PNG_FILTER_SUB) - { - png_bytep rp, dp, lp; - png_uint_32 sum = 0, lmins = mins; - png_uint_32 i; - int v; - -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) - /* We temporarily increase the "minimum sum" by the factor we - * would reduce the sum of this filter, so that we can do the - * early exit comparison without scaling the sum each time. - */ - if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED) - { - int j; - png_uint_32 lmhi, lmlo; - lmlo = lmins & PNG_LOMASK; - lmhi = (lmins >> PNG_HISHIFT) & PNG_HIMASK; - - for (j = 0; j < num_p_filters; j++) - { - if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_SUB) - { - lmlo = (lmlo * png_ptr->inv_filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - lmhi = (lmhi * png_ptr->inv_filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - } - } - - lmlo = (lmlo * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_SUB]) >> - PNG_COST_SHIFT; - lmhi = (lmhi * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_SUB]) >> - PNG_COST_SHIFT; - - if (lmhi > PNG_HIMASK) - lmins = PNG_MAXSUM; - else - lmins = (lmhi << PNG_HISHIFT) + lmlo; - } -#endif - - for (i = 0, rp = row_buf + 1, dp = png_ptr->sub_row + 1; i < bpp; - i++, rp++, dp++) - { - v = *dp = *rp; - - sum += (v < 128) ? v : 256 - v; - } - for (lp = row_buf + 1; i < row_bytes; - i++, rp++, lp++, dp++) - { - v = *dp = (png_byte)(((int)*rp - (int)*lp) & 0xff); - - sum += (v < 128) ? v : 256 - v; - - if (sum > lmins) /* We are already worse, don't continue. */ - break; - } - -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) - if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED) - { - int j; - png_uint_32 sumhi, sumlo; - sumlo = sum & PNG_LOMASK; - sumhi = (sum >> PNG_HISHIFT) & PNG_HIMASK; - - for (j = 0; j < num_p_filters; j++) - { - if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_SUB) - { - sumlo = (sumlo * png_ptr->inv_filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - sumhi = (sumhi * png_ptr->inv_filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - } - } - - sumlo = (sumlo * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_SUB]) >> - PNG_COST_SHIFT; - sumhi = (sumhi * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_SUB]) >> - PNG_COST_SHIFT; - - if (sumhi > PNG_HIMASK) - sum = PNG_MAXSUM; - else - sum = (sumhi << PNG_HISHIFT) + sumlo; - } -#endif - - if (sum < mins) - { - mins = sum; - best_row = png_ptr->sub_row; - } - } - - /* Up filter */ - if (filter_to_do == PNG_FILTER_UP) - { - png_bytep rp, dp, pp; - png_uint_32 i; - - for (i = 0, rp = row_buf + 1, dp = png_ptr->up_row + 1, - pp = prev_row + 1; i < row_bytes; - i++, rp++, pp++, dp++) - { - *dp = (png_byte)(((int)*rp - (int)*pp) & 0xff); - } - best_row = png_ptr->up_row; - } - - else if (filter_to_do & PNG_FILTER_UP) - { - png_bytep rp, dp, pp; - png_uint_32 sum = 0, lmins = mins; - png_uint_32 i; - int v; - - -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) - if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED) - { - int j; - png_uint_32 lmhi, lmlo; - lmlo = lmins & PNG_LOMASK; - lmhi = (lmins >> PNG_HISHIFT) & PNG_HIMASK; - - for (j = 0; j < num_p_filters; j++) - { - if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_UP) - { - lmlo = (lmlo * png_ptr->inv_filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - lmhi = (lmhi * png_ptr->inv_filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - } - } - - lmlo = (lmlo * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_UP]) >> - PNG_COST_SHIFT; - lmhi = (lmhi * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_UP]) >> - PNG_COST_SHIFT; - - if (lmhi > PNG_HIMASK) - lmins = PNG_MAXSUM; - else - lmins = (lmhi << PNG_HISHIFT) + lmlo; - } -#endif - - for (i = 0, rp = row_buf + 1, dp = png_ptr->up_row + 1, - pp = prev_row + 1; i < row_bytes; i++) - { - v = *dp++ = (png_byte)(((int)*rp++ - (int)*pp++) & 0xff); - - sum += (v < 128) ? v : 256 - v; - - if (sum > lmins) /* We are already worse, don't continue. */ - break; - } - -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) - if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED) - { - int j; - png_uint_32 sumhi, sumlo; - sumlo = sum & PNG_LOMASK; - sumhi = (sum >> PNG_HISHIFT) & PNG_HIMASK; - - for (j = 0; j < num_p_filters; j++) - { - if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_UP) - { - sumlo = (sumlo * png_ptr->filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - sumhi = (sumhi * png_ptr->filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - } - } - - sumlo = (sumlo * png_ptr->filter_costs[PNG_FILTER_VALUE_UP]) >> - PNG_COST_SHIFT; - sumhi = (sumhi * png_ptr->filter_costs[PNG_FILTER_VALUE_UP]) >> - PNG_COST_SHIFT; - - if (sumhi > PNG_HIMASK) - sum = PNG_MAXSUM; - else - sum = (sumhi << PNG_HISHIFT) + sumlo; - } -#endif - - if (sum < mins) - { - mins = sum; - best_row = png_ptr->up_row; - } - } - - /* Avg filter */ - if (filter_to_do == PNG_FILTER_AVG) - { - png_bytep rp, dp, pp, lp; - png_uint_32 i; - for (i = 0, rp = row_buf + 1, dp = png_ptr->avg_row + 1, - pp = prev_row + 1; i < bpp; i++) - { - *dp++ = (png_byte)(((int)*rp++ - ((int)*pp++ / 2)) & 0xff); - } - for (lp = row_buf + 1; i < row_bytes; i++) - { - *dp++ = (png_byte)(((int)*rp++ - (((int)*pp++ + (int)*lp++) / 2)) - & 0xff); - } - best_row = png_ptr->avg_row; - } - - else if (filter_to_do & PNG_FILTER_AVG) - { - png_bytep rp, dp, pp, lp; - png_uint_32 sum = 0, lmins = mins; - png_uint_32 i; - int v; - -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) - if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED) - { - int j; - png_uint_32 lmhi, lmlo; - lmlo = lmins & PNG_LOMASK; - lmhi = (lmins >> PNG_HISHIFT) & PNG_HIMASK; - - for (j = 0; j < num_p_filters; j++) - { - if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_AVG) - { - lmlo = (lmlo * png_ptr->inv_filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - lmhi = (lmhi * png_ptr->inv_filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - } - } - - lmlo = (lmlo * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_AVG]) >> - PNG_COST_SHIFT; - lmhi = (lmhi * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_AVG]) >> - PNG_COST_SHIFT; - - if (lmhi > PNG_HIMASK) - lmins = PNG_MAXSUM; - else - lmins = (lmhi << PNG_HISHIFT) + lmlo; - } -#endif - - for (i = 0, rp = row_buf + 1, dp = png_ptr->avg_row + 1, - pp = prev_row + 1; i < bpp; i++) - { - v = *dp++ = (png_byte)(((int)*rp++ - ((int)*pp++ / 2)) & 0xff); - - sum += (v < 128) ? v : 256 - v; - } - for (lp = row_buf + 1; i < row_bytes; i++) - { - v = *dp++ = - (png_byte)(((int)*rp++ - (((int)*pp++ + (int)*lp++) / 2)) & 0xff); - - sum += (v < 128) ? v : 256 - v; - - if (sum > lmins) /* We are already worse, don't continue. */ - break; - } - -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) - if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED) - { - int j; - png_uint_32 sumhi, sumlo; - sumlo = sum & PNG_LOMASK; - sumhi = (sum >> PNG_HISHIFT) & PNG_HIMASK; - - for (j = 0; j < num_p_filters; j++) - { - if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_NONE) - { - sumlo = (sumlo * png_ptr->filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - sumhi = (sumhi * png_ptr->filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - } - } - - sumlo = (sumlo * png_ptr->filter_costs[PNG_FILTER_VALUE_AVG]) >> - PNG_COST_SHIFT; - sumhi = (sumhi * png_ptr->filter_costs[PNG_FILTER_VALUE_AVG]) >> - PNG_COST_SHIFT; - - if (sumhi > PNG_HIMASK) - sum = PNG_MAXSUM; - else - sum = (sumhi << PNG_HISHIFT) + sumlo; - } -#endif - - if (sum < mins) - { - mins = sum; - best_row = png_ptr->avg_row; - } - } - - /* Paeth filter */ - if (filter_to_do == PNG_FILTER_PAETH) - { - png_bytep rp, dp, pp, cp, lp; - png_uint_32 i; - for (i = 0, rp = row_buf + 1, dp = png_ptr->paeth_row + 1, - pp = prev_row + 1; i < bpp; i++) - { - *dp++ = (png_byte)(((int)*rp++ - (int)*pp++) & 0xff); - } - - for (lp = row_buf + 1, cp = prev_row + 1; i < row_bytes; i++) - { - int a, b, c, pa, pb, pc, p; - - b = *pp++; - c = *cp++; - a = *lp++; - - p = b - c; - pc = a - c; - -#ifdef PNG_USE_ABS - pa = abs(p); - pb = abs(pc); - pc = abs(p + pc); -#else - pa = p < 0 ? -p : p; - pb = pc < 0 ? -pc : pc; - pc = (p + pc) < 0 ? -(p + pc) : p + pc; -#endif - - p = (pa <= pb && pa <=pc) ? a : (pb <= pc) ? b : c; - - *dp++ = (png_byte)(((int)*rp++ - p) & 0xff); - } - best_row = png_ptr->paeth_row; - } - - else if (filter_to_do & PNG_FILTER_PAETH) - { - png_bytep rp, dp, pp, cp, lp; - png_uint_32 sum = 0, lmins = mins; - png_uint_32 i; - int v; - -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) - if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED) - { - int j; - png_uint_32 lmhi, lmlo; - lmlo = lmins & PNG_LOMASK; - lmhi = (lmins >> PNG_HISHIFT) & PNG_HIMASK; - - for (j = 0; j < num_p_filters; j++) - { - if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_PAETH) - { - lmlo = (lmlo * png_ptr->inv_filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - lmhi = (lmhi * png_ptr->inv_filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - } - } - - lmlo = (lmlo * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_PAETH]) >> - PNG_COST_SHIFT; - lmhi = (lmhi * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_PAETH]) >> - PNG_COST_SHIFT; - - if (lmhi > PNG_HIMASK) - lmins = PNG_MAXSUM; - else - lmins = (lmhi << PNG_HISHIFT) + lmlo; - } -#endif - - for (i = 0, rp = row_buf + 1, dp = png_ptr->paeth_row + 1, - pp = prev_row + 1; i < bpp; i++) - { - v = *dp++ = (png_byte)(((int)*rp++ - (int)*pp++) & 0xff); - - sum += (v < 128) ? v : 256 - v; - } - - for (lp = row_buf + 1, cp = prev_row + 1; i < row_bytes; i++) - { - int a, b, c, pa, pb, pc, p; - - b = *pp++; - c = *cp++; - a = *lp++; - -#ifndef PNG_SLOW_PAETH - p = b - c; - pc = a - c; -#ifdef PNG_USE_ABS - pa = abs(p); - pb = abs(pc); - pc = abs(p + pc); -#else - pa = p < 0 ? -p : p; - pb = pc < 0 ? -pc : pc; - pc = (p + pc) < 0 ? -(p + pc) : p + pc; -#endif - p = (pa <= pb && pa <=pc) ? a : (pb <= pc) ? b : c; -#else /* PNG_SLOW_PAETH */ - p = a + b - c; - pa = abs(p - a); - pb = abs(p - b); - pc = abs(p - c); - if (pa <= pb && pa <= pc) - p = a; - else if (pb <= pc) - p = b; - else - p = c; -#endif /* PNG_SLOW_PAETH */ - - v = *dp++ = (png_byte)(((int)*rp++ - p) & 0xff); - - sum += (v < 128) ? v : 256 - v; - - if (sum > lmins) /* We are already worse, don't continue. */ - break; - } - -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) - if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED) - { - int j; - png_uint_32 sumhi, sumlo; - sumlo = sum & PNG_LOMASK; - sumhi = (sum >> PNG_HISHIFT) & PNG_HIMASK; - - for (j = 0; j < num_p_filters; j++) - { - if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_PAETH) - { - sumlo = (sumlo * png_ptr->filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - sumhi = (sumhi * png_ptr->filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - } - } - - sumlo = (sumlo * png_ptr->filter_costs[PNG_FILTER_VALUE_PAETH]) >> - PNG_COST_SHIFT; - sumhi = (sumhi * png_ptr->filter_costs[PNG_FILTER_VALUE_PAETH]) >> - PNG_COST_SHIFT; - - if (sumhi > PNG_HIMASK) - sum = PNG_MAXSUM; - else - sum = (sumhi << PNG_HISHIFT) + sumlo; - } -#endif - - if (sum < mins) - { - best_row = png_ptr->paeth_row; - } - } -#endif /* PNG_NO_WRITE_FILTER */ - /* Do the actual writing of the filtered row data from the chosen filter. */ - - png_write_filtered_row(png_ptr, best_row); - -#ifndef PNG_NO_WRITE_FILTER -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) - /* Save the type of filter we picked this time for future calculations */ - if (png_ptr->num_prev_filters > 0) - { - int j; - for (j = 1; j < num_p_filters; j++) - { - png_ptr->prev_filters[j] = png_ptr->prev_filters[j - 1]; - } - png_ptr->prev_filters[j] = best_row[0]; - } -#endif -#endif /* PNG_NO_WRITE_FILTER */ -} - - -/* Do the actual writing of a previously filtered row. */ -void /* PRIVATE */ -png_write_filtered_row(png_structp png_ptr, png_bytep filtered_row) -{ - png_debug(1, "in png_write_filtered_row"); - png_debug1(2, "filter = %d", filtered_row[0]); - /* Set up the zlib input buffer */ - - png_ptr->zstream.next_in = filtered_row; - png_ptr->zstream.avail_in = (uInt)png_ptr->row_info.rowbytes + 1; - /* Repeat until we have compressed all the data */ - do - { - int ret; /* Return of zlib */ - - /* Compress the data */ - ret = deflate(&png_ptr->zstream, Z_NO_FLUSH); - /* Check for compression errors */ - if (ret != Z_OK) - { - if (png_ptr->zstream.msg != NULL) - png_error(png_ptr, png_ptr->zstream.msg); - else - png_error(png_ptr, "zlib error"); - } - - /* See if it is time to write another IDAT */ - if (!(png_ptr->zstream.avail_out)) - { - /* Write the IDAT and reset the zlib output buffer */ - png_write_IDAT(png_ptr, png_ptr->zbuf, png_ptr->zbuf_size); - png_ptr->zstream.next_out = png_ptr->zbuf; - png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; - } - /* Repeat until all data has been compressed */ - } while (png_ptr->zstream.avail_in); - - /* Swap the current and previous rows */ - if (png_ptr->prev_row != NULL) - { - png_bytep tptr; - - tptr = png_ptr->prev_row; - png_ptr->prev_row = png_ptr->row_buf; - png_ptr->row_buf = tptr; - } - - /* Finish row - updates counters and flushes zlib if last row */ - png_write_finish_row(png_ptr); - -#if defined(PNG_WRITE_FLUSH_SUPPORTED) - png_ptr->flush_rows++; - - if (png_ptr->flush_dist > 0 && - png_ptr->flush_rows >= png_ptr->flush_dist) - { - png_write_flush(png_ptr); - } -#endif -} -#endif /* PNG_WRITE_SUPPORTED */ diff --git a/src/ui/CmdUI/CmdUI.cpp b/src/ui/CmdUI/CmdUI.cpp deleted file mode 100644 index c1bf6d16d..000000000 --- a/src/ui/CmdUI/CmdUI.cpp +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -// CmdUIDialog.cpp : implementation file -// - -#include "stdafx.h" -#include -#include "CmdUI.h" - -// CCmdUIDialog dialog - -IMPLEMENT_DYNAMIC(CCmdUIDialog, CDialog) - -CCmdUIDialog::CCmdUIDialog() -{ -} - -CCmdUIDialog::CCmdUIDialog(UINT nIDTemplate, CWnd* pParent /*=NULL*/) - : CDialog(nIDTemplate, pParent) -{ -} - -CCmdUIDialog::CCmdUIDialog(LPCTSTR lpszTemplateName, CWnd* pParentWnd) - : CDialog(lpszTemplateName, pParentWnd) -{ -} - -CCmdUIDialog::~CCmdUIDialog() -{ -} - -LRESULT CCmdUIDialog::DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam) -{ - LRESULT ret = __super::DefWindowProc(message, wParam, lParam); - - if(message == WM_INITDIALOG) - { - SendMessage(WM_KICKIDLE); - } - - return(ret); -} - -BEGIN_MESSAGE_MAP(CCmdUIDialog, CDialog) - ON_MESSAGE_VOID(WM_KICKIDLE, OnKickIdle) - ON_WM_INITMENUPOPUP() -END_MESSAGE_MAP() - - -// CCmdUIDialog message handlers - -void CCmdUIDialog::OnKickIdle() -{ - UpdateDialogControls(this, false); - - // TODO: maybe we should send this call to modeless child cdialogs too -} - -// Q242577 - -void CCmdUIDialog::OnInitMenuPopup(CMenu *pPopupMenu, UINT nIndex,BOOL bSysMenu) -{ - ASSERT(pPopupMenu != NULL); - // Check the enabled state of various menu items. - - CCmdUI state; - state.m_pMenu = pPopupMenu; - ASSERT(state.m_pOther == NULL); - ASSERT(state.m_pParentMenu == NULL); - - // Determine if menu is popup in top-level menu and set m_pOther to - // it if so (m_pParentMenu == NULL indicates that it is secondary popup). - HMENU hParentMenu; - if (AfxGetThreadState()->m_hTrackingMenu == pPopupMenu->m_hMenu) - state.m_pParentMenu = pPopupMenu; // Parent == child for tracking popup. - else if ((hParentMenu = ::GetMenu(m_hWnd)) != NULL) - { - CWnd* pParent = this; - // Child windows don't have menus--need to go to the top! - if (pParent != NULL && - (hParentMenu = ::GetMenu(pParent->m_hWnd)) != NULL) - { - int nIndexMax = ::GetMenuItemCount(hParentMenu); - for (int nIndex = 0; nIndex < nIndexMax; nIndex++) - { - if (::GetSubMenu(hParentMenu, nIndex) == pPopupMenu->m_hMenu) - { - // When popup is found, m_pParentMenu is containing menu. - state.m_pParentMenu = CMenu::FromHandle(hParentMenu); - break; - } - } - } - } - - state.m_nIndexMax = pPopupMenu->GetMenuItemCount(); - for (state.m_nIndex = 0; state.m_nIndex < state.m_nIndexMax; - state.m_nIndex++) - { - state.m_nID = pPopupMenu->GetMenuItemID(state.m_nIndex); - if (state.m_nID == 0) - continue; // Menu separator or invalid cmd - ignore it. - - ASSERT(state.m_pOther == NULL); - ASSERT(state.m_pMenu != NULL); - if (state.m_nID == (UINT)-1) - { - // Possibly a popup menu, route to first item of that popup. - state.m_pSubMenu = pPopupMenu->GetSubMenu(state.m_nIndex); - if (state.m_pSubMenu == NULL || - (state.m_nID = state.m_pSubMenu->GetMenuItemID(0)) == 0 || - state.m_nID == (UINT)-1) - { - continue; // First item of popup can't be routed to. - } - state.DoUpdate(this, TRUE); // Popups are never auto disabled. - } - else - { - // Normal menu item. - // Auto enable/disable if frame window has m_bAutoMenuEnable - // set and command is _not_ a system command. - state.m_pSubMenu = NULL; - state.DoUpdate(this, FALSE); - } - - // Adjust for menu deletions and additions. - UINT nCount = pPopupMenu->GetMenuItemCount(); - if (nCount < state.m_nIndexMax) - { - state.m_nIndex -= (state.m_nIndexMax - nCount); - while (state.m_nIndex < nCount && - pPopupMenu->GetMenuItemID(state.m_nIndex) == state.m_nID) - { - state.m_nIndex++; - } - } - state.m_nIndexMax = nCount; - } -} - -// CCmdUIPropertyPage - -IMPLEMENT_DYNAMIC(CCmdUIPropertyPage, CPropertyPage) -CCmdUIPropertyPage::CCmdUIPropertyPage(UINT nIDTemplate, UINT nIDCaption) - : CPropertyPage(nIDTemplate, nIDCaption) -{ -} - -CCmdUIPropertyPage::~CCmdUIPropertyPage() -{ -} - -LRESULT CCmdUIPropertyPage::DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam) -{ - if(message == WM_COMMAND) - { - switch(HIWORD(wParam)) - { - case BN_CLICKED: case CBN_SELCHANGE: case EN_CHANGE: - SetModified(); - default:; - } - } - - LRESULT ret = __super::DefWindowProc(message, wParam, lParam); - - if(message == WM_INITDIALOG) - { - SendMessage(WM_KICKIDLE); - } - - return(ret); -} - -BEGIN_MESSAGE_MAP(CCmdUIPropertyPage, CPropertyPage) - ON_MESSAGE_VOID(WM_KICKIDLE, OnKickIdle) -END_MESSAGE_MAP() - - -// CCmdUIPropertyPage message handlers - -void CCmdUIPropertyPage::OnKickIdle() -{ - UpdateDialogControls(this, false); - - // TODO: maybe we should send this call to modeless child cPropertyPages too -} - diff --git a/src/ui/CmdUI/CmdUI.h b/src/ui/CmdUI/CmdUI.h deleted file mode 100644 index 1f57f574f..000000000 --- a/src/ui/CmdUI/CmdUI.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (C) 2003-2006 Gabest - * http://www.gabest.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#pragma once - -// CCmdUIDialog dialog - -#include - -class CCmdUIDialog : public CDialog -{ - DECLARE_DYNAMIC(CCmdUIDialog) - -public: - CCmdUIDialog(); - CCmdUIDialog(UINT nIDTemplate, CWnd* pParent = NULL); - CCmdUIDialog(LPCTSTR lpszTemplateName, CWnd* pParent = NULL); - virtual ~CCmdUIDialog(); - -protected: - virtual LRESULT DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam); - - DECLARE_MESSAGE_MAP() - -public: - afx_msg void OnKickIdle(); - afx_msg void OnInitMenuPopup(CMenu *pPopupMenu, UINT nIndex,BOOL bSysMenu); -}; - - -// CCmdUIPropertyPage - -class CCmdUIPropertyPage : public CPropertyPage -{ - DECLARE_DYNAMIC(CCmdUIPropertyPage) - -public: - CCmdUIPropertyPage(UINT nIDTemplate, UINT nIDCaption = 0); // standard constructor - virtual ~CCmdUIPropertyPage(); - -protected: - virtual LRESULT DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam); - - DECLARE_MESSAGE_MAP() - -public: - afx_msg void OnKickIdle(); -}; - diff --git a/src/ui/CmdUI/CmdUI.sln b/src/ui/CmdUI/CmdUI.sln deleted file mode 100644 index 7e470283a..000000000 --- a/src/ui/CmdUI/CmdUI.sln +++ /dev/null @@ -1,27 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CmdUI", "CmdUI.vcproj", "{03208025-D5C2-426A-B0FA-251D4338F30C}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Debug Unicode = Debug Unicode - Release = Release - Release Unicode = Release Unicode - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {03208025-D5C2-426A-B0FA-251D4338F30C}.Debug.ActiveCfg = Debug|Win32 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Debug.Build.0 = Debug|Win32 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Debug Unicode.ActiveCfg = Debug Unicode|Win32 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Debug Unicode.Build.0 = Debug Unicode|Win32 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Release.ActiveCfg = Release|Win32 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Release.Build.0 = Release|Win32 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Release Unicode.ActiveCfg = Release Unicode|Win32 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Release Unicode.Build.0 = Release Unicode|Win32 - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/src/ui/CmdUI/CmdUI.vcproj b/src/ui/CmdUI/CmdUI.vcproj deleted file mode 100644 index 4d49eb906..000000000 --- a/src/ui/CmdUI/CmdUI.vcproj +++ /dev/null @@ -1,236 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/ui/CmdUI/CmdUI_vs2005.sln b/src/ui/CmdUI/CmdUI_vs2005.sln deleted file mode 100644 index 25bd8fd2c..000000000 --- a/src/ui/CmdUI/CmdUI_vs2005.sln +++ /dev/null @@ -1,25 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CmdUI", "CmdUI_vs2005.vcproj", "{03208025-D5C2-426A-B0FA-251D4338F30C}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug Unicode|Win32 = Debug Unicode|Win32 - Debug|Win32 = Debug|Win32 - Release Unicode|Win32 = Release Unicode|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {03208025-D5C2-426A-B0FA-251D4338F30C}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Debug|Win32.ActiveCfg = Debug|Win32 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Debug|Win32.Build.0 = Debug|Win32 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Release Unicode|Win32.Build.0 = Release Unicode|Win32 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Release|Win32.ActiveCfg = Release|Win32 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/ui/CmdUI/CmdUI_vs2005.vcproj b/src/ui/CmdUI/CmdUI_vs2005.vcproj deleted file mode 100644 index 7194ccc27..000000000 --- a/src/ui/CmdUI/CmdUI_vs2005.vcproj +++ /dev/null @@ -1,319 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/ui/CmdUI/CmdUI_vs2008.vcproj b/src/ui/CmdUI/CmdUI_vs2008.vcproj deleted file mode 100644 index 17710d8e6..000000000 --- a/src/ui/CmdUI/CmdUI_vs2008.vcproj +++ /dev/null @@ -1,316 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/ui/CmdUI/stdafx.cpp b/src/ui/CmdUI/stdafx.cpp deleted file mode 100644 index ce9b31f47..000000000 --- a/src/ui/CmdUI/stdafx.cpp +++ /dev/null @@ -1,8 +0,0 @@ -// stdafx.cpp : source file that includes just the standard includes -// CmdUI.pch will be the pre-compiled header -// stdafx.obj will contain the pre-compiled type information - -#include "stdafx.h" - -// TODO: reference any additional headers you need in STDAFX.H -// and not in this file diff --git a/src/ui/CmdUI/stdafx.h b/src/ui/CmdUI/stdafx.h deleted file mode 100644 index e8fa7c384..000000000 --- a/src/ui/CmdUI/stdafx.h +++ /dev/null @@ -1,19 +0,0 @@ -// stdafx.h : include file for standard system include files, -// or project specific include files that are used frequently, but -// are changed infrequently -// - -#pragma once - - -#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers -#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit - -#ifndef VC_EXTRALEAN -#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers -#endif - -#include -#include // MFC core and standard components - -// TODO: reference additional headers your program requires here diff --git a/src/ui/ResizableLib/Artistic-License.txt b/src/ui/ResizableLib/Artistic-License.txt deleted file mode 100644 index 803d2293e..000000000 --- a/src/ui/ResizableLib/Artistic-License.txt +++ /dev/null @@ -1,99 +0,0 @@ -The Artistic License - -Preamble - -The intent of this document is to state the conditions under which a Package -may be copied, such that the Copyright Holder maintains some semblance of -artistic control over the development of the package, while giving the users of -the package the right to use and distribute the Package in a more-or-less -customary fashion, plus the right to make reasonable modifications. - -Definitions: - - * "Package" refers to the collection of files distributed by the Copyright - Holder, and derivatives of that collection of files created through textual - modification. - * "Standard Version" refers to such a Package if it has not been modified, - or has been modified in accordance with the wishes of the Copyright Holder. - * "Copyright Holder" is whoever is named in the copyright or copyrights for - the package. - * "You" is you, if you're thinking about copying or distributing this - Package. - * "Reasonable copying fee" is whatever you can justify on the basis of media - cost, duplication charges, time of people involved, and so on. (You will not - be required to justify it to the Copyright Holder, but only to the computing - community at large as a market that must bear the fee.) - * "Freely Available" means that no fee is charged for the item itself, - though there may be fees involved in handling the item. It also means that - recipients of the item may redistribute it under the same conditions they - received it. - -1. You may make and give away verbatim copies of the source form of the - Standard Version of this Package without restriction, provided that you - duplicate all of the original copyright notices and associated disclaimers. - -2. You may apply bug fixes, portability fixes and other modifications derived - from the Public Domain or from the Copyright Holder. A Package modified in such - a way shall still be considered the Standard Version. - -3. You may otherwise modify your copy of this Package in any way, provided - that you insert a prominent notice in each changed file stating how and when you - changed that file, and provided that you do at least ONE of the following: - - a) place your modifications in the Public Domain or otherwise make them - Freely Available, such as by posting said modifications to Usenet or an - equivalent medium, or placing the modifications on a major archive site such - as ftp.uu.net, or by allowing the Copyright Holder to include your - modifications in the Standard Version of the Package. - - b) use the modified Package only within your corporation or - organization. - - c) rename any non-standard executables so the names do not conflict with - standard executables, which must also be provided, and provide a separate - manual page for each non-standard executable that clearly documents how it - differs from the Standard Version. - - d) make other distribution arrangements with the Copyright Holder. - -4. You may distribute the programs of this Package in object code or - executable form, provided that you do at least ONE of the following: - - a) distribute a Standard Version of the executables and library files, - together with instructions (in the manual page or equivalent) on where to get - the Standard Version. - - b) accompany the distribution with the machine-readable source of the - Package with your modifications. - - c) accompany any non-standard executables with their corresponding Standard - Version executables, giving the non-standard executables non-standard names, - and clearly documenting the differences in manual pages (or equivalent), - together with instructions on where to get the Standard Version. - - d) make other distribution arrangements with the Copyright Holder. - -5. You may charge a reasonable copying fee for any distribution of this - Package. You may charge any fee you choose for support of this Package. You may - not charge a fee for this Package itself. However, you may distribute this - Package in aggregate with other (possibly commercial) programs as part of a - larger (possibly commercial) software distribution provided that you do not - advertise this Package as a product of your own. - -6. The scripts and library files supplied as input to or produced as output - from the programs of this Package do not automatically fall under the copyright - of this Package, but belong to whomever generated them, and may be sold - commercially, and may be aggregated with this Package. - -7. C or perl subroutines supplied by you and linked into this Package shall - not be considered part of this Package. - -8. The name of the Copyright Holder may not be used to endorse or promote - products derived from this software without specific prior written - permission. - -9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED - WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF - MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - -The End diff --git a/src/ui/ResizableLib/ResizableDialog.cpp b/src/ui/ResizableLib/ResizableDialog.cpp deleted file mode 100644 index d61d4472b..000000000 --- a/src/ui/ResizableLib/ResizableDialog.cpp +++ /dev/null @@ -1,161 +0,0 @@ -// ResizableDialog.cpp : implementation file -// -///////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) 2000-2002 by Paolo Messina -// (http://www.geocities.com/ppescher - ppescher@yahoo.com) -// -// The contents of this file are subject to the Artistic License (the "License"). -// You may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// http://www.opensource.org/licenses/artistic-license.html -// -// If you find this code useful, credits would be nice! -// -///////////////////////////////////////////////////////////////////////////// - -#include "stdafx.h" -#include "ResizableDialog.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CResizableDialog - -inline void CResizableDialog::PrivateConstruct() -{ - m_bEnableSaveRestore = FALSE; - m_dwGripTempState = 1; -} - -CResizableDialog::CResizableDialog() -{ - PrivateConstruct(); -} - -CResizableDialog::CResizableDialog(UINT nIDTemplate, CWnd* pParentWnd) - : CCmdUIDialog(nIDTemplate, pParentWnd) -{ - PrivateConstruct(); -} - -CResizableDialog::CResizableDialog(LPCTSTR lpszTemplateName, CWnd* pParentWnd) - : CCmdUIDialog(lpszTemplateName, pParentWnd) -{ - PrivateConstruct(); -} - -CResizableDialog::~CResizableDialog() -{ -} - - -BEGIN_MESSAGE_MAP(CResizableDialog, CCmdUIDialog) - //{{AFX_MSG_MAP(CResizableDialog) - ON_WM_GETMINMAXINFO() - ON_WM_SIZE() - ON_WM_DESTROY() - ON_WM_CREATE() - ON_WM_ERASEBKGND() - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - - -///////////////////////////////////////////////////////////////////////////// -// CResizableDialog message handlers - -int CResizableDialog::OnCreate(LPCREATESTRUCT lpCreateStruct) -{ - if (__super::OnCreate(lpCreateStruct) == -1) - return -1; - - // child dialogs don't want resizable border or size grip, - // nor they can handle the min/max size constraints - BOOL bChild = GetStyle() & WS_CHILD; - - if (!bChild) - { - // keep client area - CRect rect; - GetClientRect(&rect); - // set resizable style - ModifyStyle(DS_MODALFRAME, WS_POPUP | WS_THICKFRAME); - // adjust size to reflect new style - ::AdjustWindowRectEx(&rect, GetStyle(), - ::IsMenu(GetMenu()->GetSafeHmenu()), GetExStyle()); - SetWindowPos(NULL, 0, 0, rect.Width(), rect.Height(), SWP_FRAMECHANGED| - SWP_NOMOVE|SWP_NOZORDER|SWP_NOACTIVATE|SWP_NOREPOSITION); - - // set the initial size as the min track size - SetMinTrackSize(rect.Size()); - } - - // create and init the size-grip - if (!CreateSizeGrip(!bChild)) - return -1; - - return 0; -} - -void CResizableDialog::OnDestroy() -{ - if (m_bEnableSaveRestore) - SaveWindowRect(m_sSection, m_bRectOnly); - - // remove child windows - RemoveAllAnchors(); - - __super::OnDestroy(); -} - -void CResizableDialog::OnSize(UINT nType, int cx, int cy) -{ - CWnd::OnSize(nType, cx, cy); - - if (nType == SIZE_MAXHIDE || nType == SIZE_MAXSHOW) - return; // arrangement not needed - - if (nType == SIZE_MAXIMIZED) - HideSizeGrip(&m_dwGripTempState); - else - ShowSizeGrip(&m_dwGripTempState); - - // update grip and layout - UpdateSizeGrip(); - ArrangeLayout(); -} - -void CResizableDialog::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI) -{ - MinMaxInfo(lpMMI); -} - -// NOTE: this must be called after setting the layout -// to have the dialog and its controls displayed properly -void CResizableDialog::EnableSaveRestore(LPCTSTR pszSection, BOOL bRectOnly) -{ - m_sSection = pszSection; - - m_bEnableSaveRestore = TRUE; - m_bRectOnly = bRectOnly; - - // restore immediately - LoadWindowRect(pszSection, bRectOnly); -} - - -BOOL CResizableDialog::OnEraseBkgnd(CDC* pDC) -{ - // Windows XP doesn't like clipping regions ...try this! - EraseBackground(pDC); - return TRUE; - -/* ClipChildren(pDC); // old-method (for safety) - - return CDialog::OnEraseBkgnd(pDC); -*/ -} diff --git a/src/ui/ResizableLib/ResizableDialog.h b/src/ui/ResizableLib/ResizableDialog.h deleted file mode 100644 index 49a016d65..000000000 --- a/src/ui/ResizableLib/ResizableDialog.h +++ /dev/null @@ -1,101 +0,0 @@ -#if !defined(AFX_RESIZABLEDIALOG_H__INCLUDED_) -#define AFX_RESIZABLEDIALOG_H__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - -// ResizableDialog.h : header file -// -///////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) 2000-2002 by Paolo Messina -// (http://www.geocities.com/ppescher - ppescher@yahoo.com) -// -// The contents of this file are subject to the Artistic License (the "License"). -// You may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// http://www.opensource.org/licenses/artistic-license.html -// -// If you find this code useful, credits would be nice! -// -///////////////////////////////////////////////////////////////////////////// - -#include "ResizableLayout.h" -#include "ResizableGrip.h" -#include "ResizableMinMax.h" -#include "ResizableState.h" -#include "..\CmdUI\CmdUI.h" - -///////////////////////////////////////////////////////////////////////////// -// CResizableDialog window - -class CResizableDialog : public CCmdUIDialog, public CResizableLayout, - public CResizableGrip, public CResizableMinMax, - public CResizableState -{ - -// Construction -public: - CResizableDialog(); - CResizableDialog(UINT nIDTemplate, CWnd* pParentWnd = NULL); - CResizableDialog(LPCTSTR lpszTemplateName, CWnd* pParentWnd = NULL); - -// Attributes -private: - // support for temporarily hiding the grip - DWORD m_dwGripTempState; - - // flags - BOOL m_bEnableSaveRestore; - BOOL m_bRectOnly; - - // internal status - CString m_sSection; // section name (identifies a parent window) - -// Operations -public: - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CResizableDialog) - protected: - //}}AFX_VIRTUAL - -// Implementation -public: - virtual ~CResizableDialog(); - -// used internally -private: - void PrivateConstruct(); - -// callable from derived classes -protected: - // section to use in app's profile - void EnableSaveRestore(LPCTSTR pszSection, BOOL bRectOnly = FALSE); - - virtual CWnd* GetResizableWnd() - { - // make the layout know its parent window - return this; - }; - -// Generated message map functions -protected: - //{{AFX_MSG(CResizableDialog) - afx_msg void OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI); - afx_msg void OnSize(UINT nType, int cx, int cy); - afx_msg void OnDestroy(); - afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); - afx_msg BOOL OnEraseBkgnd(CDC* pDC); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; - -///////////////////////////////////////////////////////////////////////////// - -//{{AFX_INSERT_LOCATION}} -// Microsoft Visual C++ will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_RESIZABLEDIALOG_H__INCLUDED_) diff --git a/src/ui/ResizableLib/ResizableGrip.cpp b/src/ui/ResizableLib/ResizableGrip.cpp deleted file mode 100644 index f1464dbb7..000000000 --- a/src/ui/ResizableLib/ResizableGrip.cpp +++ /dev/null @@ -1,310 +0,0 @@ -// ResizableGrip.cpp: implementation of the CResizableGrip class. -// -///////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) 2000-2002 by Paolo Messina -// (http://www.geocities.com/ppescher - ppescher@yahoo.com) -// -// The contents of this file are subject to the Artistic License (the "License"). -// You may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// http://www.opensource.org/licenses/artistic-license.html -// -// If you find this code useful, credits would be nice! -// -///////////////////////////////////////////////////////////////////////////// - -#include "stdafx.h" -#include "ResizableGrip.h" - -#ifdef _DEBUG -#undef THIS_FILE -static char THIS_FILE[]=__FILE__; -#define new DEBUG_NEW -#endif - -////////////////////////////////////////////////////////////////////// -// Construction/Destruction -////////////////////////////////////////////////////////////////////// - -CResizableGrip::CResizableGrip() -{ - m_nShowCount = 0; -} - -CResizableGrip::~CResizableGrip() -{ - -} - -void CResizableGrip::UpdateSizeGrip() -{ - ASSERT(::IsWindow(m_wndGrip.m_hWnd)); - - // size-grip goes bottom right in the client area - // (any right-to-left adjustment should go here) - - RECT rect; - GetResizableWnd()->GetClientRect(&rect); - - rect.left = rect.right - m_wndGrip.m_size.cx; - rect.top = rect.bottom - m_wndGrip.m_size.cy; - - // must stay below other children - m_wndGrip.SetWindowPos(&CWnd::wndBottom, rect.left, rect.top, 0, 0, - SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOREPOSITION - | (IsSizeGripVisible() ? SWP_SHOWWINDOW : SWP_HIDEWINDOW)); -} - -// pbStatus points to a variable, maintained by the caller, that -// holds its visibility status. Initialize the variable with 1 -// to allow to temporarily hide the grip, 0 to allow to -// temporarily show the grip (with respect to the dwMask bit). - -// NB: visibility is effective only after an update - -void CResizableGrip::ShowSizeGrip(DWORD* pStatus, DWORD dwMask /*= 1*/) -{ - ASSERT(pStatus != NULL); - - if (!(*pStatus & dwMask)) - { - m_nShowCount++; - (*pStatus) |= dwMask; - } -} - -void CResizableGrip::HideSizeGrip(DWORD* pStatus, DWORD dwMask /*= 1*/) -{ - ASSERT(pStatus != NULL); - - if (*pStatus & dwMask) - { - m_nShowCount--; - (*pStatus) &= ~dwMask; - } -} - -BOOL CResizableGrip::IsSizeGripVisible() -{ - // NB: visibility is effective only after an update - return (m_nShowCount > 0); -} - -void CResizableGrip::SetSizeGripVisibility(BOOL bVisible) -{ - if (bVisible) - m_nShowCount = 1; - else - m_nShowCount = 0; -} - -BOOL CResizableGrip::SetSizeGripBkMode(int nBkMode) -{ - if (::IsWindow(m_wndGrip.m_hWnd)) - { - if (nBkMode == OPAQUE) - m_wndGrip.SetTransparency(FALSE); - else if (nBkMode == TRANSPARENT) - m_wndGrip.SetTransparency(TRUE); - else - return FALSE; - return TRUE; - } - return FALSE; -} - -void CResizableGrip::SetSizeGripShape(BOOL bTriangular) -{ - m_wndGrip.SetTriangularShape(bTriangular); -} - -BOOL CResizableGrip::CreateSizeGrip(BOOL bVisible /*= TRUE*/, - BOOL bTriangular /*= TRUE*/, BOOL bTransparent /*= FALSE*/) -{ - // create grip - CRect rect(0 , 0, m_wndGrip.m_size.cx, m_wndGrip.m_size.cy); - BOOL bRet = m_wndGrip.Create(WS_CHILD | WS_CLIPSIBLINGS - | SBS_SIZEGRIP, rect, GetResizableWnd(), 0); - - if (bRet) - { - // set options - m_wndGrip.SetTriangularShape(bTriangular); - m_wndGrip.SetTransparency(bTransparent); - SetSizeGripVisibility(bVisible); - - // update position - UpdateSizeGrip(); - } - - return bRet; -} - -///////////////////////////////////////////////////////////////////////////// -// CSizeGrip implementation - -BOOL CResizableGrip::CSizeGrip::IsRTL() -{ - return GetExStyle() & 0x00400000L/*WS_EX_LAYOUTRTL*/; -} - -BOOL CResizableGrip::CSizeGrip::PreCreateWindow(CREATESTRUCT& cs) -{ - // set window size - m_size.cx = GetSystemMetrics(SM_CXVSCROLL); - m_size.cy = GetSystemMetrics(SM_CYHSCROLL); - - cs.cx = m_size.cx; - cs.cy = m_size.cy; - - return CScrollBar::PreCreateWindow(cs); -} - -LRESULT CResizableGrip::CSizeGrip::WindowProc(UINT message, - WPARAM wParam, LPARAM lParam) -{ - switch (message) - { - case WM_GETDLGCODE: - // fix to prevent the control to gain focus, using arrow keys - // (standard grip returns DLGC_WANTARROWS, like any standard scrollbar) - return DLGC_STATIC; - - case WM_NCHITTEST: - // choose proper cursor shape - if (IsRTL()) - return HTBOTTOMLEFT; - else - return HTBOTTOMRIGHT; - break; - - case WM_SETTINGCHANGE: - { - // update grip's size - CSize sizeOld = m_size; - m_size.cx = GetSystemMetrics(SM_CXVSCROLL); - m_size.cy = GetSystemMetrics(SM_CYHSCROLL); - - // resize transparency bitmaps - if (m_bTransparent) - { - CClientDC dc(this); - - // destroy bitmaps - m_bmGrip.DeleteObject(); - m_bmMask.DeleteObject(); - - // re-create bitmaps - m_bmGrip.CreateCompatibleBitmap(&dc, m_size.cx, m_size.cy); - m_bmMask.CreateBitmap(m_size.cx, m_size.cy, 1, 1, NULL); - } - - // re-calc shape - if (m_bTriangular) - SetTriangularShape(m_bTriangular); - - // reposition the grip - CRect rect; - GetWindowRect(rect); - rect.InflateRect(m_size.cx - sizeOld.cx, m_size.cy - sizeOld.cy, 0, 0); - ::MapWindowPoints(NULL, GetParent()->GetSafeHwnd(), (LPPOINT)&rect, 2); - MoveWindow(rect, TRUE); - } - break; - - case WM_DESTROY: - // perform clean up - if (m_bTransparent) - SetTransparency(FALSE); - break; - - case WM_PAINT: - if (m_bTransparent) - { - CPaintDC dc(this); - - // select bitmaps - CBitmap *pOldGrip, *pOldMask; - - pOldGrip = m_dcGrip.SelectObject(&m_bmGrip); - pOldMask = m_dcMask.SelectObject(&m_bmMask); - - // obtain original grip bitmap, make the mask and prepare masked bitmap - CScrollBar::WindowProc(WM_PAINT, (WPARAM)m_dcGrip.GetSafeHdc(), lParam); - m_dcGrip.SetBkColor(m_dcGrip.GetPixel(0, 0)); - m_dcMask.BitBlt(0, 0, m_size.cx, m_size.cy, &m_dcGrip, 0, 0, SRCCOPY); - m_dcGrip.BitBlt(0, 0, m_size.cx, m_size.cy, &m_dcMask, 0, 0, 0x00220326); - - // draw transparently - dc.BitBlt(0, 0, m_size.cx, m_size.cy, &m_dcMask, 0, 0, SRCAND); - dc.BitBlt(0, 0, m_size.cx, m_size.cy, &m_dcGrip, 0, 0, SRCPAINT); - - // unselect bitmaps - m_dcGrip.SelectObject(pOldGrip); - m_dcMask.SelectObject(pOldMask); - - return 0; - } - break; - } - - return CScrollBar::WindowProc(message, wParam, lParam); -} - -void CResizableGrip::CSizeGrip::SetTransparency(BOOL bActivate) -{ - // creates or deletes DCs and Bitmaps used for - // implementing a transparent size grip - - if (bActivate && !m_bTransparent) - { - m_bTransparent = TRUE; - - CClientDC dc(this); - - // create memory DCs and bitmaps - m_dcGrip.CreateCompatibleDC(&dc); - m_bmGrip.CreateCompatibleBitmap(&dc, m_size.cx, m_size.cy); - - m_dcMask.CreateCompatibleDC(&dc); - m_bmMask.CreateBitmap(m_size.cx, m_size.cy, 1, 1, NULL); - } - else if (!bActivate && m_bTransparent) - { - m_bTransparent = FALSE; - - // destroy memory DCs and bitmaps - m_dcGrip.DeleteDC(); - m_bmGrip.DeleteObject(); - - m_dcMask.DeleteDC(); - m_bmMask.DeleteObject(); - } -} - -void CResizableGrip::CSizeGrip::SetTriangularShape(BOOL bEnable) -{ - m_bTriangular = bEnable; - - if (bEnable) - { - // set a triangular window region - CRect rect; - GetWindowRect(rect); - rect.OffsetRect(-rect.TopLeft()); - POINT arrPoints[] = - { - { rect.left, rect.bottom }, - { rect.right, rect.bottom }, - { rect.right, rect.top } - }; - CRgn rgnGrip; - rgnGrip.CreatePolygonRgn(arrPoints, 3, WINDING); - SetWindowRgn((HRGN)rgnGrip.Detach(), IsWindowVisible()); - } - else - { - SetWindowRgn((HRGN)NULL, IsWindowVisible()); - } -} diff --git a/src/ui/ResizableLib/ResizableGrip.h b/src/ui/ResizableLib/ResizableGrip.h deleted file mode 100644 index 0a85514b9..000000000 --- a/src/ui/ResizableLib/ResizableGrip.h +++ /dev/null @@ -1,81 +0,0 @@ -// ResizableGrip.h: interface for the CResizableGrip class. -// -///////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) 2000-2002 by Paolo Messina -// (http://www.geocities.com/ppescher - ppescher@yahoo.com) -// -// The contents of this file are subject to the Artistic License (the "License"). -// You may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// http://www.opensource.org/licenses/artistic-license.html -// -// If you find this code useful, credits would be nice! -// -///////////////////////////////////////////////////////////////////////////// - -#if !defined(AFX_RESIZABLEGRIP_H__INCLUDED_) -#define AFX_RESIZABLEGRIP_H__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - -class CResizableGrip -{ -private: - class CSizeGrip : public CScrollBar - { - public: - CSizeGrip() - { - m_bTransparent = FALSE; - m_bTriangular = FALSE; - m_size.cx = 0; - m_size.cy = 0; - } - - void SetTriangularShape(BOOL bEnable); - void SetTransparency(BOOL bActivate); - - BOOL IsRTL(); // right-to-left layout support - - virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam); - - SIZE m_size; // holds grip size - - protected: - virtual BOOL PreCreateWindow(CREATESTRUCT& cs); - - BOOL m_bTriangular; // triangular shape active - BOOL m_bTransparent; // transparency active - - // memory DCs and bitmaps for transparent grip - CDC m_dcGrip, m_dcMask; - CBitmap m_bmGrip, m_bmMask; - }; - - CSizeGrip m_wndGrip; // grip control - int m_nShowCount; // support for hiding the grip - -protected: - // create a size grip, with options - BOOL CreateSizeGrip(BOOL bVisible = TRUE, - BOOL bTriangular = TRUE, BOOL bTransparent = FALSE); - - BOOL IsSizeGripVisible(); // TRUE if grip is set to be visible - void SetSizeGripVisibility(BOOL bVisible); // set default visibility - void UpdateSizeGrip(); // update the grip's visibility and position - void ShowSizeGrip(DWORD* pStatus, DWORD dwMask = 1); // temp show the size grip - void HideSizeGrip(DWORD* pStatus, DWORD dwMask = 1); // temp hide the size grip - BOOL SetSizeGripBkMode(int nBkMode); // like CDC::SetBkMode - void SetSizeGripShape(BOOL bTriangular); - - virtual CWnd* GetResizableWnd() = 0; - -public: - CResizableGrip(); - virtual ~CResizableGrip(); -}; - -#endif // !defined(AFX_RESIZABLEGRIP_H__INCLUDED_) diff --git a/src/ui/ResizableLib/ResizableLayout.cpp b/src/ui/ResizableLib/ResizableLayout.cpp deleted file mode 100644 index e1aef85f4..000000000 --- a/src/ui/ResizableLib/ResizableLayout.cpp +++ /dev/null @@ -1,518 +0,0 @@ -// ResizableLayout.cpp: implementation of the CResizableLayout class. -// -///////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) 2000-2002 by Paolo Messina -// (http://www.geocities.com/ppescher - ppescher@yahoo.com) -// -// The contents of this file are subject to the Artistic License (the "License"). -// You may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// http://www.opensource.org/licenses/artistic-license.html -// -// If you find this code useful, credits would be nice! -// -///////////////////////////////////////////////////////////////////////////// - -#include "stdafx.h" -#include "commctrl.h" -#include "ResizableLayout.h" -#include "ResizableMsgSupport.inl" - -#ifdef _DEBUG -#undef THIS_FILE -static char THIS_FILE[]=__FILE__; -#define new DEBUG_NEW -#endif - -////////////////////////////////////////////////////////////////////// -// Construction/Destruction -////////////////////////////////////////////////////////////////////// - -// In August 2002 Platform SDK, some guy at MS thought it was time to -// add the missing symbol BS_TYPEMASK, but forgot its original meaning -// and so now he's telling us not to use that symbol because its -// value is likely to change in the future SDK releases, including all -// the BS_* style bits in the mask, not just the button's type as the -// symbol's name suggests. So now we're forced to use another symbol! -#define _BS_TYPEMASK 0x0000000FL - -void CResizableLayout::AddAnchor(HWND hWnd, CSize sizeTypeTL, CSize sizeTypeBR) -{ - CWnd* pParent = GetResizableWnd(); - - // child window must be valid - ASSERT(::IsWindow(hWnd)); - // must be child of parent window -// ASSERT(::IsChild(pParent->GetSafeHwnd(), hWnd)); - // top-left anchor must be valid - ASSERT(sizeTypeTL != NOANCHOR); - - // get control's window class - CString sClassName; - GetClassName(hWnd, sClassName.GetBufferSetLength(MAX_PATH), MAX_PATH); - sClassName.ReleaseBuffer(); - - // get parent window's rect - CRect rectParent; - GetTotalClientRect(&rectParent); - // and child control's rect - CRect rectChild; - ::GetWindowRect(hWnd, &rectChild); - ::MapWindowPoints(NULL, pParent->m_hWnd, (LPPOINT)&rectChild, 2); - - // adjust position, if client area has been scrolled - rectChild.OffsetRect(-rectParent.TopLeft()); - - // go calculate margins - CSize sizeMarginTL, sizeMarginBR; - - if (sizeTypeBR == NOANCHOR) - sizeTypeBR = sizeTypeTL; - - // calculate margin for the top-left corner - - sizeMarginTL.cx = rectChild.left - rectParent.Width() * sizeTypeTL.cx / 100; - sizeMarginTL.cy = rectChild.top - rectParent.Height() * sizeTypeTL.cy / 100; - - // calculate margin for the bottom-right corner - - sizeMarginBR.cx = rectChild.right - rectParent.Width() * sizeTypeBR.cx / 100; - sizeMarginBR.cy = rectChild.bottom - rectParent.Height() * sizeTypeBR.cy / 100; - - // prepare the structure - LayoutInfo layout(hWnd, sizeTypeTL, sizeMarginTL, - sizeTypeBR, sizeMarginBR, sClassName); - - // initialize resize properties (overridable) - InitResizeProperties(layout); - - // must not be already there! - // (this is probably due to a duplicate call to AddAnchor) - POSITION pos; - ASSERT(!m_mapLayout.Lookup(hWnd, pos)); - - // add to the list and the map - pos = m_listLayout.AddTail(layout); - m_mapLayout.SetAt(hWnd, pos); -} - -void CResizableLayout::AddAnchorCallback(UINT nCallbackID) -{ - // one callback control cannot rely upon another callback control's - // size and/or position (they're updated all together at the end) - // it can however use a non-callback control, which is updated before - - // add to the list - LayoutInfo layout; - layout.nCallbackID = nCallbackID; - m_listLayoutCB.AddTail(layout); -} - -BOOL CResizableLayout::ArrangeLayoutCallback(CResizableLayout::LayoutInfo& /*layout*/) -{ - ASSERT(FALSE); - // must be overridden, if callback is used - - return FALSE; // no output data -} - -void CResizableLayout::ArrangeLayout() -{ - // common vars - UINT uFlags; - LayoutInfo layout; - CRect rectParent, rectChild; - GetTotalClientRect(&rectParent); // get parent window's rect - int count = m_listLayout.GetCount(); - int countCB = m_listLayoutCB.GetCount(); - - // reposition child windows - HDWP hdwp = ::BeginDeferWindowPos(count + countCB); - - POSITION pos = m_listLayout.GetHeadPosition(); - while (pos != NULL) - { - // get layout info - layout = m_listLayout.GetNext(pos); - - // calculate new child's position, size and flags for SetWindowPos - CalcNewChildPosition(layout, rectParent, rectChild, uFlags); - - // only if size or position changed - if ((uFlags & (SWP_NOMOVE|SWP_NOSIZE)) != (SWP_NOMOVE|SWP_NOSIZE)) - { - hdwp = ::DeferWindowPos(hdwp, layout.hWnd, NULL, rectChild.left, - rectChild.top, rectChild.Width(), rectChild.Height(), uFlags); - } - } - - // for callback items you may use GetAnchorPosition to know the - // new position and size of a non-callback item after resizing - - pos = m_listLayoutCB.GetHeadPosition(); - while (pos != NULL) - { - // get layout info - layout = m_listLayoutCB.GetNext(pos); - // request layout data - if (!ArrangeLayoutCallback(layout)) - continue; - - // calculate new child's position, size and flags for SetWindowPos - CalcNewChildPosition(layout, rectParent, rectChild, uFlags); - - // only if size or position changed - if ((uFlags & (SWP_NOMOVE|SWP_NOSIZE)) != (SWP_NOMOVE|SWP_NOSIZE)) - { - hdwp = ::DeferWindowPos(hdwp, layout.hWnd, NULL, rectChild.left, - rectChild.top, rectChild.Width(), rectChild.Height(), uFlags); - } - } - - // finally move all the windows at once - ::EndDeferWindowPos(hdwp); -} - -void CResizableLayout::ClipChildWindow(const CResizableLayout::LayoutInfo& layout, - CRgn* pRegion) -{ - // obtain window position - CRect rect; - ::GetWindowRect(layout.hWnd, &rect); - ::MapWindowPoints(NULL, GetResizableWnd()->m_hWnd, (LPPOINT)&rect, 2); - - // use window region if any - CRgn rgn; - rgn.CreateRectRgn(0,0,0,0); - switch (::GetWindowRgn(layout.hWnd, rgn)) - { - case COMPLEXREGION: - case SIMPLEREGION: - rgn.OffsetRgn(rect.TopLeft()); - break; - - default: - rgn.SetRectRgn(&rect); - } - - // get the clipping property - BOOL bClipping = layout.properties.bAskClipping ? - LikesClipping(layout) : layout.properties.bCachedLikesClipping; - - // modify region accordingly - if (bClipping) - pRegion->CombineRgn(pRegion, &rgn, RGN_DIFF); - else - pRegion->CombineRgn(pRegion, &rgn, RGN_OR); -} - -void CResizableLayout::GetClippingRegion(CRgn* pRegion) -{ - CWnd* pWnd = GetResizableWnd(); - - // System's default clipping area is screen's size, - // not enough for max track size, for example: - // if screen is 1024 x 768 and resizing border is 4 pixels, - // maximized size is 1024+4*2=1032 x 768+4*2=776, - // but max track size is 4 pixels bigger 1036 x 780 (don't ask me why!) - // So, if you resize the window to maximum size, the last 4 pixels - // are clipped out by the default clipping region, that gets created - // as soon as you call clipping functions (my guess). - - // reset clipping region to the whole client area - CRect rect; - pWnd->GetClientRect(&rect); - pRegion->CreateRectRgnIndirect(&rect); - - // clip only anchored controls - LayoutInfo layout; - POSITION pos = m_listLayout.GetHeadPosition(); - while (pos != NULL) - { - // get layout info - layout = m_listLayout.GetNext(pos); - - if (::IsWindowVisible(layout.hWnd)) - ClipChildWindow(layout, pRegion); - } - pos = m_listLayoutCB.GetHeadPosition(); - while (pos != NULL) - { - // get layout info - layout = m_listLayoutCB.GetNext(pos); - // request data - if (!ArrangeLayoutCallback(layout)) - continue; - - if (::IsWindowVisible(layout.hWnd)) - ClipChildWindow(layout, pRegion); - } - - // fix for RTL layouts (1 pixel of horz offset) - if (pWnd->GetExStyle() & 0x00400000L/*WS_EX_LAYOUTRTL*/) - pRegion->OffsetRgn(-1,0); -} - -void CResizableLayout::EraseBackground(CDC* pDC) -{ - HWND hWnd = GetResizableWnd()->GetSafeHwnd(); - - // retrieve the background brush - HBRUSH hBrush = NULL; - - // is this a dialog box? - // (using class atom is quickier than using the class name) - ATOM atomWndClass = (ATOM)::GetClassLong(hWnd, GCW_ATOM); - if (atomWndClass == (ATOM)0x8002) - { - // send a message to the dialog box - hBrush = (HBRUSH)::SendMessage(hWnd, WM_CTLCOLORDLG, - (WPARAM)pDC->GetSafeHdc(), (LPARAM)hWnd); - } - else - { - // take the background brush from the window's class - hBrush = (HBRUSH)::GetClassLongPtr(hWnd, GCL_HBRBACKGROUND); - } - - // fill the clipped background - CRgn rgn; - GetClippingRegion(&rgn); - - ::FillRgn(pDC->GetSafeHdc(), rgn, hBrush); -} - -// support legacy code (will disappear in future versions) -void CResizableLayout::ClipChildren(CDC* pDC) -{ - CRgn rgn; - GetClippingRegion(&rgn); - // the clipping region is in device units - rgn.OffsetRgn(-pDC->GetWindowOrg()); - pDC->SelectClipRgn(&rgn); -} - -void CResizableLayout::GetTotalClientRect(LPRECT lpRect) -{ - GetResizableWnd()->GetClientRect(lpRect); -} - -BOOL CResizableLayout::NeedsRefresh(const CResizableLayout::LayoutInfo& layout, - const CRect& rectOld, const CRect& rectNew) -{ - if (layout.bMsgSupport) - { - REFRESHPROPERTY refresh; - refresh.rcOld = rectOld; - refresh.rcNew = rectNew; - if (Send_NeedsRefresh(layout.hWnd, &refresh)) - return refresh.bNeedsRefresh; - } - - int nDiffWidth = (rectNew.Width() - rectOld.Width()); - int nDiffHeight = (rectNew.Height() - rectOld.Height()); - - // is the same size? - if (nDiffWidth == 0 && nDiffHeight == 0) - return FALSE; - - // optimistic, no need to refresh - BOOL bRefresh = FALSE; - - // window classes that need refresh when resized - if (layout.sWndClass == WC_STATIC) - { - DWORD style = ::GetWindowLong(layout.hWnd, GWL_STYLE); - - switch (style & SS_TYPEMASK) - { - case SS_LEFT: - case SS_CENTER: - case SS_RIGHT: - // word-wrapped text - bRefresh = bRefresh || (nDiffWidth != 0); - // vertically centered text - if (style & SS_CENTERIMAGE) - bRefresh = bRefresh || (nDiffHeight != 0); - break; - - case SS_LEFTNOWORDWRAP: - // text with ellipsis - if (style & SS_ELLIPSISMASK) - bRefresh = bRefresh || (nDiffWidth != 0); - // vertically centered text - if (style & SS_CENTERIMAGE) - bRefresh = bRefresh || (nDiffHeight != 0); - break; - - case SS_ENHMETAFILE: - case SS_BITMAP: - case SS_ICON: - // images - case SS_BLACKFRAME: - case SS_GRAYFRAME: - case SS_WHITEFRAME: - case SS_ETCHEDFRAME: - // and frames - bRefresh = TRUE; - break; - } - } - - // window classes that don't redraw client area correctly - // when the hor scroll pos changes due to a resizing - BOOL bHScroll = FALSE; - if (layout.sWndClass == WC_LISTBOX) - bHScroll = TRUE; - - // fix for horizontally scrollable windows - if (bHScroll && (nDiffWidth > 0)) - { - // get max scroll position - SCROLLINFO info; - info.cbSize = sizeof(SCROLLINFO); - info.fMask = SIF_PAGE | SIF_POS | SIF_RANGE; - if (::GetScrollInfo(layout.hWnd, SB_HORZ, &info)) - { - // subtract the page size - info.nMax -= __max(info.nPage-1,0); - } - - // resizing will cause the text to scroll on the right - // because the scrollbar is going beyond the right limit - if ((info.nMax > 0) && (info.nPos + nDiffWidth > info.nMax)) - { - // needs repainting, due to horiz scrolling - bRefresh = TRUE; - } - } - - return bRefresh; -} - -BOOL CResizableLayout::LikesClipping(const CResizableLayout::LayoutInfo& layout) -{ - if (layout.bMsgSupport) - { - CLIPPINGPROPERTY clipping; - if (Send_LikesClipping(layout.hWnd, &clipping)) - return clipping.bLikesClipping; - } - - DWORD style = ::GetWindowLong(layout.hWnd, GWL_STYLE); - - // skip windows that wants background repainted - if (layout.sWndClass == TOOLBARCLASSNAME && (style & TBSTYLE_TRANSPARENT)) - return FALSE; - else if (layout.sWndClass == WC_BUTTON) - { - CRect rect; - switch (style & _BS_TYPEMASK) - { - case BS_GROUPBOX: - return FALSE; - - case BS_OWNERDRAW: - // ownerdraw buttons must return correct hittest code - // to notify their transparency to the system and this library - ::GetWindowRect(layout.hWnd, &rect); - if ( HTTRANSPARENT == ::SendMessage(layout.hWnd, - WM_NCHITTEST, 0, MAKELPARAM(rect.left, rect.top)) ) - return FALSE; - break; - } - return TRUE; - } - else if (layout.sWndClass == WC_STATIC) - { - switch (style & SS_TYPEMASK) - { - case SS_LEFT: - case SS_CENTER: - case SS_RIGHT: - case SS_SIMPLE: - case SS_LEFTNOWORDWRAP: - // text - case SS_BLACKRECT: - case SS_GRAYRECT: - case SS_WHITERECT: - // filled rects - case SS_ETCHEDHORZ: - case SS_ETCHEDVERT: - // etched lines - case SS_BITMAP: - // bitmaps - return TRUE; - break; - - case SS_ICON: - case SS_ENHMETAFILE: - if (style & SS_CENTERIMAGE) - return FALSE; - return TRUE; - break; - - default: - return FALSE; - } - } - - // assume the others like clipping - return TRUE; -} - -void CResizableLayout::CalcNewChildPosition(const CResizableLayout::LayoutInfo& layout, - const CRect &rectParent, CRect &rectChild, UINT& uFlags) -{ - CWnd* pParent = GetResizableWnd(); - - ::GetWindowRect(layout.hWnd, &rectChild); - ::MapWindowPoints(NULL, pParent->m_hWnd, (LPPOINT)&rectChild, 2); - - CRect rectNew; - - // calculate new top-left corner - rectNew.left = layout.sizeMarginTL.cx + rectParent.Width() * layout.sizeTypeTL.cx / 100; - rectNew.top = layout.sizeMarginTL.cy + rectParent.Height() * layout.sizeTypeTL.cy / 100; - - // calculate new bottom-right corner - rectNew.right = layout.sizeMarginBR.cx + rectParent.Width() * layout.sizeTypeBR.cx / 100; - rectNew.bottom = layout.sizeMarginBR.cy + rectParent.Height() * layout.sizeTypeBR.cy / 100; - - // adjust position, if client area has been scrolled - rectNew.OffsetRect(rectParent.TopLeft()); - - // get the refresh property - BOOL bRefresh = layout.properties.bAskRefresh ? - NeedsRefresh(layout, rectChild, rectNew) : layout.properties.bCachedNeedsRefresh; - - // set flags - uFlags = SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREPOSITION; - if (bRefresh) - uFlags |= SWP_NOCOPYBITS; - if (rectNew.TopLeft() == rectChild.TopLeft()) - uFlags |= SWP_NOMOVE; - if (rectNew.Size() == rectChild.Size()) - uFlags |= SWP_NOSIZE; - - // update rect - rectChild = rectNew; -} - -void CResizableLayout::InitResizeProperties(CResizableLayout::LayoutInfo &layout) -{ - // check if custom window supports this library - // (properties must be correctly set by the window) - layout.bMsgSupport = Send_QueryProperties(layout.hWnd, &layout.properties); - - // default properties - if (!layout.bMsgSupport) - { - // clipping property is assumed as static - layout.properties.bAskClipping = FALSE; - layout.properties.bCachedLikesClipping = LikesClipping(layout); - // refresh property is assumed as dynamic - layout.properties.bAskRefresh = TRUE; - } -} diff --git a/src/ui/ResizableLib/ResizableLayout.h b/src/ui/ResizableLib/ResizableLayout.h deleted file mode 100644 index 0d57623db..000000000 --- a/src/ui/ResizableLib/ResizableLayout.h +++ /dev/null @@ -1,196 +0,0 @@ -// ResizableLayout.h: interface for the CResizableLayout class. -// -///////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) 2000-2002 by Paolo Messina -// (http://www.geocities.com/ppescher - ppescher@yahoo.com) -// -// The contents of this file are subject to the Artistic License (the "License"). -// You may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// http://www.opensource.org/licenses/artistic-license.html -// -// If you find this code useful, credits would be nice! -// -///////////////////////////////////////////////////////////////////////////// - -#if !defined(AFX_RESIZABLELAYOUT_H__INCLUDED_) -#define AFX_RESIZABLELAYOUT_H__INCLUDED_ - -#include -#include "ResizableMsgSupport.h" - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - -// useful compatibility constants (the only one required is NOANCHOR) - -const CSize NOANCHOR(-1,-1), - TOP_LEFT(0,0), TOP_CENTER(50,0), TOP_RIGHT(100,0), - MIDDLE_LEFT(0,50), MIDDLE_CENTER(50,50), MIDDLE_RIGHT(100,50), - BOTTOM_LEFT(0,100), BOTTOM_CENTER(50,100), BOTTOM_RIGHT(100,100); - - -class CResizableLayout -{ -protected: - class LayoutInfo - { - public: - HWND hWnd; - UINT nCallbackID; - - CString sWndClass; - - // upper-left corner - SIZE sizeTypeTL; - SIZE sizeMarginTL; - - // bottom-right corner - SIZE sizeTypeBR; - SIZE sizeMarginBR; - - // custom window support - BOOL bMsgSupport; - RESIZEPROPERTIES properties; - - public: - LayoutInfo() : hWnd(NULL), nCallbackID(0), bMsgSupport(FALSE) - { - sizeTypeTL.cx = 0; - sizeTypeTL.cy = 0; - sizeMarginTL.cx = 0; - sizeMarginTL.cy = 0; - sizeTypeBR.cx = 0; - sizeTypeBR.cy = 0; - sizeMarginBR.cx = 0; - sizeMarginBR.cy = 0; - memset(&properties, 0, sizeof properties); - } - - LayoutInfo(HWND hwnd, SIZE tl_t, SIZE tl_m, - SIZE br_t, SIZE br_m, CString classname) - : hWnd(hwnd), nCallbackID(0), - sWndClass(classname), bMsgSupport(FALSE), - sizeTypeTL(tl_t), sizeMarginTL(tl_m), - sizeTypeBR(br_t), sizeMarginBR(br_m) - { - memset(&properties, 0, sizeof properties); - } - }; - -private: - // list of repositionable controls - CMap m_mapLayout; - CList m_listLayout; - CList m_listLayoutCB; - - void ClipChildWindow(const CResizableLayout::LayoutInfo &layout, CRgn* pRegion); - - void CalcNewChildPosition(const CResizableLayout::LayoutInfo &layout, - const CRect &rectParent, CRect &rectChild, UINT& uFlags); - -protected: - // override to initialize resize properties (clipping, refresh) - virtual void InitResizeProperties(CResizableLayout::LayoutInfo& layout); - - // override to specify clipping for unsupported windows - virtual BOOL LikesClipping(const CResizableLayout::LayoutInfo &layout); - - // override to specify refresh for unsupported windows - virtual BOOL NeedsRefresh(const CResizableLayout::LayoutInfo &layout, - const CRect &rectOld, const CRect &rectNew); - - // paint the background on the given DC (for XP theme's compatibility) - void EraseBackground(CDC* pDC); - - // clip out child windows from the given DC (support old code) - void ClipChildren(CDC* pDC); - - // get the clipping region (without clipped child windows) - void GetClippingRegion(CRgn* pRegion); - - // override for scrollable or expanding parent windows - virtual void GetTotalClientRect(LPRECT lpRect); - - // add anchors to a control, given its HWND - void AddAnchor(HWND hWnd, CSize sizeTypeTL, CSize sizeTypeBR = NOANCHOR); - - // add anchors to a control, given its ID - void AddAnchor(UINT nID, CSize sizeTypeTL, CSize sizeTypeBR = NOANCHOR) - { - AddAnchor(::GetDlgItem(GetResizableWnd()->GetSafeHwnd(), nID), - sizeTypeTL, sizeTypeBR); - } - - // add a callback (control ID or HWND is unknown or may change) - void AddAnchorCallback(UINT nCallbackID); - - // get rect of an anchored window, given the parent's client area - BOOL GetAnchorPosition(HWND hWnd, const CRect &rectParent, - CRect &rectChild, UINT* lpFlags = NULL) - { - POSITION pos; - if (!m_mapLayout.Lookup(hWnd, pos)) - return FALSE; - - UINT uTmpFlags; - CalcNewChildPosition(m_listLayout.GetAt(pos), rectParent, rectChild, - (lpFlags != NULL) ? (*lpFlags) : uTmpFlags); - return TRUE; - } - - // get rect of an anchored window, given the parent's client area - BOOL GetAnchorPosition(UINT nID, const CRect &rectParent, - CRect &rectChild, UINT* lpFlags = NULL) - { - return GetAnchorPosition(::GetDlgItem(GetResizableWnd()->GetSafeHwnd(), nID), - rectParent, rectChild, lpFlags); - } - - // remove an anchored control from the layout, given its HWND - BOOL RemoveAnchor(HWND hWnd) - { - POSITION pos; - if (!m_mapLayout.Lookup(hWnd, pos)) - return FALSE; - - m_listLayout.RemoveAt(pos); - return m_mapLayout.RemoveKey(hWnd); - } - - // remove an anchored control from the layout, given its HWND - BOOL RemoveAnchor(UINT nID) - { - return RemoveAnchor(::GetDlgItem(GetResizableWnd()->GetSafeHwnd(), nID)); - } - - // reset layout content - void RemoveAllAnchors() - { - m_mapLayout.RemoveAll(); - m_listLayout.RemoveAll(); - m_listLayoutCB.RemoveAll(); - } - - // adjust children's layout, when parent's size changes - void ArrangeLayout(); - - // override to provide dynamic control's layout info - virtual BOOL ArrangeLayoutCallback(CResizableLayout::LayoutInfo& layout); - - // override to provide the parent window - virtual CWnd* GetResizableWnd() = 0; - -public: - CResizableLayout() { } - - virtual ~CResizableLayout() - { - // just for safety - RemoveAllAnchors(); - } -}; - -#endif // !defined(AFX_RESIZABLELAYOUT_H__INCLUDED_) diff --git a/src/ui/ResizableLib/ResizableLib.sln b/src/ui/ResizableLib/ResizableLib.sln deleted file mode 100644 index d133fa546..000000000 --- a/src/ui/ResizableLib/ResizableLib.sln +++ /dev/null @@ -1,27 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ResizableLib", "ResizableLib.vcproj", "{4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Debug Unicode = Debug Unicode - Release = Release - Release Unicode = Release Unicode - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Debug.ActiveCfg = Debug|Win32 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Debug.Build.0 = Debug|Win32 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Debug Unicode.ActiveCfg = Debug Unicode|Win32 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Debug Unicode.Build.0 = Debug Unicode|Win32 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Release.ActiveCfg = Release|Win32 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Release.Build.0 = Release|Win32 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Release Unicode.ActiveCfg = Release Unicode|Win32 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Release Unicode.Build.0 = Release Unicode|Win32 - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/src/ui/ResizableLib/ResizableLib.vcproj b/src/ui/ResizableLib/ResizableLib.vcproj deleted file mode 100644 index adbe6df7d..000000000 --- a/src/ui/ResizableLib/ResizableLib.vcproj +++ /dev/null @@ -1,281 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/ui/ResizableLib/ResizableLib_vs2005.sln b/src/ui/ResizableLib/ResizableLib_vs2005.sln deleted file mode 100644 index 598d48f34..000000000 --- a/src/ui/ResizableLib/ResizableLib_vs2005.sln +++ /dev/null @@ -1,25 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ResizableLib", "ResizableLib_vs2005.vcproj", "{4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug Unicode|Win32 = Debug Unicode|Win32 - Debug|Win32 = Debug|Win32 - Release Unicode|Win32 = Release Unicode|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Debug|Win32.ActiveCfg = Debug|Win32 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Debug|Win32.Build.0 = Debug|Win32 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Release Unicode|Win32.Build.0 = Release Unicode|Win32 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Release|Win32.ActiveCfg = Release|Win32 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/ui/ResizableLib/ResizableLib_vs2005.vcproj b/src/ui/ResizableLib/ResizableLib_vs2005.vcproj deleted file mode 100644 index fa1f1f215..000000000 --- a/src/ui/ResizableLib/ResizableLib_vs2005.vcproj +++ /dev/null @@ -1,379 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/ui/ResizableLib/ResizableLib_vs2008.vcproj b/src/ui/ResizableLib/ResizableLib_vs2008.vcproj deleted file mode 100644 index 1a8c34332..000000000 --- a/src/ui/ResizableLib/ResizableLib_vs2008.vcproj +++ /dev/null @@ -1,376 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/ui/ResizableLib/ResizableMinMax.cpp b/src/ui/ResizableLib/ResizableMinMax.cpp deleted file mode 100644 index 74e576d99..000000000 --- a/src/ui/ResizableLib/ResizableMinMax.cpp +++ /dev/null @@ -1,95 +0,0 @@ -// ResizableMinMax.cpp: implementation of the CResizableMinMax class. -// -///////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) 2000-2002 by Paolo Messina -// (http://www.geocities.com/ppescher - ppescher@yahoo.com) -// -// The contents of this file are subject to the Artistic License (the "License"). -// You may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// http://www.opensource.org/licenses/artistic-license.html -// -// If you find this code useful, credits would be nice! -// -///////////////////////////////////////////////////////////////////////////// - -#include "stdafx.h" -#include "ResizableMinMax.h" - -#ifdef _DEBUG -#undef THIS_FILE -static char THIS_FILE[]=__FILE__; -#define new DEBUG_NEW -#endif - -////////////////////////////////////////////////////////////////////// -// Construction/Destruction -////////////////////////////////////////////////////////////////////// - -CResizableMinMax::CResizableMinMax() -{ - m_bUseMinTrack = FALSE; - m_bUseMaxTrack = FALSE; - m_bUseMaxRect = FALSE; -} - -CResizableMinMax::~CResizableMinMax() -{ - -} - -void CResizableMinMax::MinMaxInfo(LPMINMAXINFO lpMMI) -{ - if (m_bUseMinTrack) - lpMMI->ptMinTrackSize = m_ptMinTrackSize; - - if (m_bUseMaxTrack) - lpMMI->ptMaxTrackSize = m_ptMaxTrackSize; - - if (m_bUseMaxRect) - { - lpMMI->ptMaxPosition = m_ptMaxPos; - lpMMI->ptMaxSize = m_ptMaxSize; - } -} - -void CResizableMinMax::SetMaximizedRect(const CRect& rc) -{ - m_bUseMaxRect = TRUE; - - m_ptMaxPos = rc.TopLeft(); - m_ptMaxSize.x = rc.Width(); - m_ptMaxSize.y = rc.Height(); -} - -void CResizableMinMax::ResetMaximizedRect() -{ - m_bUseMaxRect = FALSE; -} - -void CResizableMinMax::SetMinTrackSize(const CSize& size) -{ - m_bUseMinTrack = TRUE; - - m_ptMinTrackSize.x = size.cx; - m_ptMinTrackSize.y = size.cy; -} - -void CResizableMinMax::ResetMinTrackSize() -{ - m_bUseMinTrack = FALSE; -} - -void CResizableMinMax::SetMaxTrackSize(const CSize& size) -{ - m_bUseMaxTrack = TRUE; - - m_ptMaxTrackSize.x = size.cx; - m_ptMaxTrackSize.y = size.cy; -} - -void CResizableMinMax::ResetMaxTrackSize() -{ - m_bUseMaxTrack = FALSE; -} diff --git a/src/ui/ResizableLib/ResizableMinMax.h b/src/ui/ResizableLib/ResizableMinMax.h deleted file mode 100644 index 557780323..000000000 --- a/src/ui/ResizableLib/ResizableMinMax.h +++ /dev/null @@ -1,53 +0,0 @@ -// ResizableMinMax.h: interface for the CResizableMinMax class. -// -///////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) 2000-2002 by Paolo Messina -// (http://www.geocities.com/ppescher - ppescher@yahoo.com) -// -// The contents of this file are subject to the Artistic License (the "License"). -// You may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// http://www.opensource.org/licenses/artistic-license.html -// -// If you find this code useful, credits would be nice! -// -///////////////////////////////////////////////////////////////////////////// - -#if !defined(AFX_RESIZABLEMINMAX_H__INCLUDED_) -#define AFX_RESIZABLEMINMAX_H__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - -class CResizableMinMax -{ -// Attributes -private: - // flags - BOOL m_bUseMaxTrack; - BOOL m_bUseMinTrack; - BOOL m_bUseMaxRect; - - POINT m_ptMinTrackSize; // min tracking size - POINT m_ptMaxTrackSize; // max tracking size - POINT m_ptMaxPos; // maximized position - POINT m_ptMaxSize; // maximized size - -public: - CResizableMinMax(); - virtual ~CResizableMinMax(); - -protected: - void MinMaxInfo(LPMINMAXINFO lpMMI); - - void SetMaximizedRect(const CRect& rc); // set window rect when maximized - void ResetMaximizedRect(); // reset to default maximized rect - void SetMinTrackSize(const CSize& size); // set minimum tracking size - void ResetMinTrackSize(); // reset to default minimum tracking size - void SetMaxTrackSize(const CSize& size); // set maximum tracking size - void ResetMaxTrackSize(); // reset to default maximum tracking size -}; - -#endif // !defined(AFX_RESIZABLEMINMAX_H__INCLUDED_) diff --git a/src/ui/ResizableLib/ResizableMsgSupport.h b/src/ui/ResizableLib/ResizableMsgSupport.h deleted file mode 100644 index 68d45fe9f..000000000 --- a/src/ui/ResizableLib/ResizableMsgSupport.h +++ /dev/null @@ -1,61 +0,0 @@ -// ResizableMsgSupport.h: some declarations to support custom resizable wnds -// -///////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) 2000-2002 by Paolo Messina -// (http://www.geocities.com/ppescher - ppescher@yahoo.com) -// -// The contents of this file are subject to the Artistic License (the "License"). -// You may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// http://www.opensource.org/licenses/artistic-license.html -// -// If you find this code useful, credits would be nice! -// -///////////////////////////////////////////////////////////////////////////// - -#if !defined(AFX_RESIZABLEMSGSUPPORT_H__INCLUDED_) -#define AFX_RESIZABLEMSGSUPPORT_H__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - -typedef struct tagRESIZEPROPERTIES -{ - // wether to ask for resizing properties every time - BOOL bAskClipping; - BOOL bAskRefresh; - // otherwise, use the cached properties - BOOL bCachedLikesClipping; - BOOL bCachedNeedsRefresh; - - // initialize with valid data - tagRESIZEPROPERTIES() : bAskClipping(TRUE), bAskRefresh(TRUE) {} - -} RESIZEPROPERTIES, *PRESIZEPROPERTIES, *LPRESIZEPROPERTIES; - - -typedef struct tagCLIPPINGPROPERTY -{ - BOOL bLikesClipping; - - // initialize with valid data - tagCLIPPINGPROPERTY() : bLikesClipping(FALSE) {} - -} CLIPPINGPROPERTY, *PCLIPPINGPROPERTY, *LPCLIPPINGPROPERTY; - - -typedef struct tagREFRESHPROPERTY -{ - BOOL bNeedsRefresh; - RECT rcOld; - RECT rcNew; - - // initialize with valid data - tagREFRESHPROPERTY() : bNeedsRefresh(TRUE) {} - -} REFRESHPROPERTY, *PREFRESHPROPERTY, *LPREFRESHPROPERTY; - - -#endif // !defined(AFX_RESIZABLEMSGSUPPORT_H__INCLUDED_) diff --git a/src/ui/ResizableLib/ResizableMsgSupport.inl b/src/ui/ResizableLib/ResizableMsgSupport.inl deleted file mode 100644 index f8f3b41e8..000000000 --- a/src/ui/ResizableLib/ResizableMsgSupport.inl +++ /dev/null @@ -1,56 +0,0 @@ -// ResizableMsgSupport.inl: some definitions to support custom resizable wnds -// -///////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) 2000-2002 by Paolo Messina -// (http://www.geocities.com/ppescher - ppescher@yahoo.com) -// -// The contents of this file are subject to the Artistic License (the "License"). -// You may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// http://www.opensource.org/licenses/artistic-license.html -// -// If you find this code useful, credits would be nice! -// -///////////////////////////////////////////////////////////////////////////// - - -// registered message to communicate with the library -// (defined so that in the same executable it is initialized only once) -const UINT WMU_RESIZESUPPORT = ::RegisterWindowMessage(_T("WMU_RESIZESUPPORT")); - -// if the message is implemented the returned value must be non-zero -// the default window procedure returns zero for unhandled messages - -// wParam is one of the following RSZSUP_* values, lParam as specified - -#define RSZSUP_QUERYPROPERTIES 101 // lParam = LPRESIZEPROPERTIES - -#define RSZSUP_LIKESCLIPPING 102 // lParam = LPCLIPPINGPROPERTY - -#define RSZSUP_NEEDSREFRESH 103 // lParam = LPREFRESHPROPERTY - - -///////////////////////////////////////////////////////////////////////////// -// utility functions - -inline BOOL Send_QueryProperties(HWND hWnd, LPRESIZEPROPERTIES pResizeProperties) -{ - ASSERT(::IsWindow(hWnd)); - return (0 != SendMessage(hWnd, WMU_RESIZESUPPORT, - RSZSUP_QUERYPROPERTIES, (LPARAM)pResizeProperties)); -} - -inline BOOL Send_LikesClipping(HWND hWnd, LPCLIPPINGPROPERTY pClippingProperty) -{ - ASSERT(::IsWindow(hWnd)); - return (0 != SendMessage(hWnd, WMU_RESIZESUPPORT, - RSZSUP_LIKESCLIPPING, (LPARAM)pClippingProperty)); -} - -inline BOOL Send_NeedsRefresh(HWND hWnd, LPREFRESHPROPERTY pRefreshProperty) -{ - ASSERT(::IsWindow(hWnd)); - return (0 != SendMessage(hWnd, WMU_RESIZESUPPORT, - RSZSUP_NEEDSREFRESH, (LPARAM)pRefreshProperty)); -} diff --git a/src/ui/ResizableLib/ResizablePage.cpp b/src/ui/ResizableLib/ResizablePage.cpp deleted file mode 100644 index 10c49366e..000000000 --- a/src/ui/ResizableLib/ResizablePage.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// ResizablePage.cpp : implementation file -// -///////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) 2000-2002 by Paolo Messina -// (http://www.geocities.com/ppescher - ppescher@yahoo.com) -// -// The contents of this file are subject to the Artistic License (the "License"). -// You may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// http://www.opensource.org/licenses/artistic-license.html -// -// If you find this code useful, credits would be nice! -// -///////////////////////////////////////////////////////////////////////////// - -#include "stdafx.h" -#include "ResizablePage.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CResizablePage - -IMPLEMENT_DYNCREATE(CResizablePage, CPropertyPage) - -CResizablePage::CResizablePage() -{ -} - -CResizablePage::CResizablePage(UINT nIDTemplate, UINT nIDCaption) - : CPropertyPage(nIDTemplate, nIDCaption) -{ -} - -CResizablePage::CResizablePage(LPCTSTR lpszTemplateName, UINT nIDCaption) - : CPropertyPage(lpszTemplateName, nIDCaption) -{ -} - -CResizablePage::~CResizablePage() -{ -} - - -BEGIN_MESSAGE_MAP(CResizablePage, CPropertyPage) - //{{AFX_MSG_MAP(CResizablePage) - ON_WM_SIZE() - ON_WM_ERASEBKGND() - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - - -///////////////////////////////////////////////////////////////////////////// -// CResizablePage message handlers - -void CResizablePage::OnSize(UINT nType, int cx, int cy) -{ - CWnd::OnSize(nType, cx, cy); - - ArrangeLayout(); -} - -BOOL CResizablePage::OnEraseBkgnd(CDC* pDC) -{ - // Windows XP doesn't like clipping regions ...try this! - EraseBackground(pDC); - return TRUE; - -/* ClipChildren(pDC); // old-method (for safety) - - return CPropertyPage::OnEraseBkgnd(pDC); -*/ -} diff --git a/src/ui/ResizableLib/ResizablePage.h b/src/ui/ResizableLib/ResizablePage.h deleted file mode 100644 index 4c8218634..000000000 --- a/src/ui/ResizableLib/ResizablePage.h +++ /dev/null @@ -1,78 +0,0 @@ -#if !defined(AFX_RESIZABLEPAGE_H__INCLUDED_) -#define AFX_RESIZABLEPAGE_H__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - -// ResizablePage.h : header file -// -///////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) 2000-2002 by Paolo Messina -// (http://www.geocities.com/ppescher - ppescher@yahoo.com) -// -// The contents of this file are subject to the Artistic License (the "License"). -// You may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// http://www.opensource.org/licenses/artistic-license.html -// -// If you find this code useful, credits would be nice! -// -///////////////////////////////////////////////////////////////////////////// - -#include "ResizableLayout.h" - - -///////////////////////////////////////////////////////////////////////////// -// CResizablePage window - -class CResizablePage : public CPropertyPage, public CResizableLayout -{ - DECLARE_DYNCREATE(CResizablePage) - -// Construction -public: - CResizablePage(); - CResizablePage(UINT nIDTemplate, UINT nIDCaption = 0); - CResizablePage(LPCTSTR lpszTemplateName, UINT nIDCaption = 0); - -// Attributes -public: - -// Operations -public: - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CResizablePage) - //}}AFX_VIRTUAL - -// Implementation -public: - virtual ~CResizablePage(); - -// callable from derived classes -protected: - - virtual CWnd* GetResizableWnd() - { - // make the layout know its parent window - return this; - }; - -// Generated message map functions -protected: - //{{AFX_MSG(CResizablePage) - afx_msg void OnSize(UINT nType, int cx, int cy); - afx_msg BOOL OnEraseBkgnd(CDC* pDC); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; - -///////////////////////////////////////////////////////////////////////////// - -//{{AFX_INSERT_LOCATION}} -// Microsoft Visual C++ will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_RESIZABLEPAGE_H__INCLUDED_) diff --git a/src/ui/ResizableLib/ResizableSheet.cpp b/src/ui/ResizableLib/ResizableSheet.cpp deleted file mode 100644 index 95ac673a0..000000000 --- a/src/ui/ResizableLib/ResizableSheet.cpp +++ /dev/null @@ -1,355 +0,0 @@ -// ResizableSheet.cpp : implementation file -// -///////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) 2000-2002 by Paolo Messina -// (http://www.geocities.com/ppescher - ppescher@yahoo.com) -// -// The contents of this file are subject to the Artistic License (the "License"). -// You may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// http://www.opensource.org/licenses/artistic-license.html -// -// If you find this code useful, credits would be nice! -// -///////////////////////////////////////////////////////////////////////////// - -#include "stdafx.h" -#include "ResizableSheet.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CResizableSheet - -IMPLEMENT_DYNAMIC(CResizableSheet, CPropertySheet) - -inline void CResizableSheet::PrivateConstruct() -{ - m_bEnableSaveRestore = FALSE; - m_bSavePage = FALSE; - m_dwGripTempState = 1; -} - - -CResizableSheet::CResizableSheet() -{ - PrivateConstruct(); -} - -CResizableSheet::CResizableSheet(UINT nIDCaption, CWnd *pParentWnd, UINT iSelectPage) - : CPropertySheet(nIDCaption, pParentWnd, iSelectPage) -{ - PrivateConstruct(); -} - -CResizableSheet::CResizableSheet(LPCTSTR pszCaption, CWnd *pParentWnd, UINT iSelectPage) - : CPropertySheet(pszCaption, pParentWnd, iSelectPage) -{ - PrivateConstruct(); -} - -CResizableSheet::~CResizableSheet() -{ -} - -BEGIN_MESSAGE_MAP(CResizableSheet, CPropertySheet) - //{{AFX_MSG_MAP(CResizableSheet) - ON_WM_GETMINMAXINFO() - ON_WM_SIZE() - ON_WM_DESTROY() - ON_WM_CREATE() - ON_WM_ERASEBKGND() - //}}AFX_MSG_MAP - ON_NOTIFY_REFLECT_EX(PSN_SETACTIVE, OnPageChanging) -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CResizableSheet message handlers - -int CResizableSheet::OnCreate(LPCREATESTRUCT lpCreateStruct) -{ - if (CPropertySheet::OnCreate(lpCreateStruct) == -1) - return -1; - - // keep client area - CRect rect; - GetClientRect(&rect); - // set resizable style - ModifyStyle(DS_MODALFRAME, WS_POPUP | WS_THICKFRAME); - // adjust size to reflect new style - ::AdjustWindowRectEx(&rect, GetStyle(), - ::IsMenu(GetMenu()->GetSafeHmenu()), GetExStyle()); - SetWindowPos(NULL, 0, 0, rect.Width(), rect.Height(), SWP_FRAMECHANGED| - SWP_NOMOVE|SWP_NOZORDER|SWP_NOACTIVATE|SWP_NOREPOSITION); - - // create and init the size-grip - if (!CreateSizeGrip()) - return -1; - - return 0; -} - -BOOL CResizableSheet::OnInitDialog() -{ - BOOL bResult = CPropertySheet::OnInitDialog(); - - // set the initial size as the min track size - CRect rc; - GetWindowRect(&rc); - SetMinTrackSize(rc.Size()); - - // initialize layout - PresetLayout(); - - // prevent flickering - GetTabControl()->ModifyStyle(0, WS_CLIPSIBLINGS); - - return bResult; -} - -void CResizableSheet::OnDestroy() -{ - if (m_bEnableSaveRestore) - { - SaveWindowRect(m_sSection, m_bRectOnly); - SavePage(); - } - - RemoveAllAnchors(); - - CPropertySheet::OnDestroy(); -} - -// maps an index to a button ID and vice-versa -static UINT _propButtons[] = -{ - IDOK, IDCANCEL, ID_APPLY_NOW, IDHELP, - ID_WIZBACK, ID_WIZNEXT, ID_WIZFINISH -}; -const int _propButtonsCount = sizeof(_propButtons)/sizeof(UINT); - -// horizontal line in wizard mode -#define ID_WIZLINE ID_WIZFINISH+1 - -void CResizableSheet::PresetLayout() -{ - if (IsWizard()) // wizard mode - { - // hide tab control - GetTabControl()->ShowWindow(SW_HIDE); - - AddAnchor(ID_WIZLINE, BOTTOM_LEFT, BOTTOM_RIGHT); - } - else // tab mode - { - AddAnchor(AFX_IDC_TAB_CONTROL, TOP_LEFT, BOTTOM_RIGHT); - } - - // add a callback for active page (which can change at run-time) - AddAnchorCallback(1); - - // use *total* parent size to have correct margins - CRect rectPage, rectSheet; - GetTotalClientRect(&rectSheet); - - GetActivePage()->GetWindowRect(&rectPage); - ::MapWindowPoints(NULL, m_hWnd, (LPPOINT)&rectPage, 2); - - // pre-calculate margins - m_sizePageTL = rectPage.TopLeft() - rectSheet.TopLeft(); - m_sizePageBR = rectPage.BottomRight() - rectSheet.BottomRight(); - - // add all possible buttons, if they exist - for (int i = 0; i < _propButtonsCount; i++) - { - if (NULL != GetDlgItem(_propButtons[i])) - AddAnchor(_propButtons[i], BOTTOM_RIGHT); - } -} - -BOOL CResizableSheet::ArrangeLayoutCallback(LayoutInfo &layout) -{ - if (layout.nCallbackID != 1) // we only added 1 callback - return CResizableLayout::ArrangeLayoutCallback(layout); - - // set layout info for active page - layout.hWnd = (HWND)::SendMessage(m_hWnd, PSM_GETCURRENTPAGEHWND, 0, 0); - if (!::IsWindow(layout.hWnd)) - return FALSE; - - // set margins - if (IsWizard()) // wizard mode - { - // use pre-calculated margins - layout.sizeMarginTL = m_sizePageTL; - layout.sizeMarginBR = m_sizePageBR; - } - else // tab mode - { - CTabCtrl* pTab = GetTabControl(); - ASSERT(pTab != NULL); - - // get tab position after resizing and calc page rect - CRect rectPage, rectSheet; - GetTotalClientRect(&rectSheet); - - VERIFY(GetAnchorPosition(pTab->m_hWnd, rectSheet, rectPage)); - pTab->AdjustRect(FALSE, &rectPage); - - // set margins - layout.sizeMarginTL = rectPage.TopLeft() - rectSheet.TopLeft(); - layout.sizeMarginBR = rectPage.BottomRight() - rectSheet.BottomRight(); - } - - // set anchor types - layout.sizeTypeTL = TOP_LEFT; - layout.sizeTypeBR = BOTTOM_RIGHT; - - // use this layout info - return TRUE; -} - -void CResizableSheet::OnSize(UINT nType, int cx, int cy) -{ - CWnd::OnSize(nType, cx, cy); - - if (nType == SIZE_MAXHIDE || nType == SIZE_MAXSHOW) - return; // arrangement not needed - - if (nType == SIZE_MAXIMIZED) - HideSizeGrip(&m_dwGripTempState); - else - ShowSizeGrip(&m_dwGripTempState); - - // update grip and layout - UpdateSizeGrip(); - ArrangeLayout(); -} - -BOOL CResizableSheet::OnPageChanging(NMHDR* /*pNotifyStruct*/, LRESULT* /*pResult*/) -{ - // update new wizard page - // active page changes after this notification - PostMessage(WM_SIZE); - - return FALSE; // continue routing -} - -BOOL CResizableSheet::OnEraseBkgnd(CDC* pDC) -{ - // Windows XP doesn't like clipping regions ...try this! - EraseBackground(pDC); - return TRUE; - -/* ClipChildren(pDC); // old-method (for safety) - - return CPropertySheet::OnEraseBkgnd(pDC); -*/ -} - -void CResizableSheet::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI) -{ - MinMaxInfo(lpMMI); -} - -// protected members - -int CResizableSheet::GetMinWidth() -{ - CWnd* pWnd = NULL; - CRect rectWnd, rectSheet; - GetTotalClientRect(&rectSheet); - - int max = 0, min = rectSheet.Width(); - // search for leftmost and rightmost button margins - for (int i = 0; i < 7; i++) - { - pWnd = GetDlgItem(_propButtons[i]); - // exclude not present or hidden buttons - if (pWnd == NULL || !(pWnd->GetStyle() & WS_VISIBLE)) - continue; - - // left position is relative to the right border - // of the parent window (negative value) - pWnd->GetWindowRect(&rectWnd); - ::MapWindowPoints(NULL, m_hWnd, (LPPOINT)&rectWnd, 2); - int left = rectSheet.right - rectWnd.left; - int right = rectSheet.right - rectWnd.right; - - if (left > max) - max = left; - if (right < min) - min = right; - } - - // sizing border width - int border = GetSystemMetrics(SM_CXSIZEFRAME); - - // compute total width - return max + min + 2*border; -} - - -// NOTE: this must be called after all the other settings -// to have the window and its controls displayed properly -void CResizableSheet::EnableSaveRestore(LPCTSTR pszSection, BOOL bRectOnly, BOOL bWithPage) -{ - m_sSection = pszSection; - m_bSavePage = bWithPage; - - m_bEnableSaveRestore = TRUE; - m_bRectOnly = bRectOnly; - - // restore immediately - LoadWindowRect(pszSection, bRectOnly); - LoadPage(); -} - -// private memebers - -// used to save/restore active page -// either in the registry or a private .INI file -// depending on your application settings - -#define ACTIVEPAGE _T("ActivePage") - -void CResizableSheet::SavePage() -{ - if (!m_bSavePage) - return; - - // saves active page index, zero (the first) if problems - // cannot use GetActivePage, because it always fails - - CTabCtrl *pTab = GetTabControl(); - int page = 0; - - if (pTab != NULL) - page = pTab->GetCurSel(); - if (page < 0) - page = 0; - - AfxGetApp()->WriteProfileInt(m_sSection, ACTIVEPAGE, page); -} - -void CResizableSheet::LoadPage() -{ - // restore active page, zero (the first) if not found - int page = AfxGetApp()->GetProfileInt(m_sSection, ACTIVEPAGE, 0); - - if (m_bSavePage) - { - SetActivePage(page); - ArrangeLayout(); // needs refresh - } -} - -void CResizableSheet::RefreshLayout() -{ - SendMessage(WM_SIZE); -} diff --git a/src/ui/ResizableLib/ResizableSheet.h b/src/ui/ResizableLib/ResizableSheet.h deleted file mode 100644 index c82a63798..000000000 --- a/src/ui/ResizableLib/ResizableSheet.h +++ /dev/null @@ -1,114 +0,0 @@ -#if !defined(AFX_RESIZABLESHEET_H__INCLUDED_) -#define AFX_RESIZABLESHEET_H__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - -///////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) 2000-2002 by Paolo Messina -// (http://www.geocities.com/ppescher - ppescher@yahoo.com) -// -// The contents of this file are subject to the Artistic License (the "License"). -// You may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// http://www.opensource.org/licenses/artistic-license.html -// -// If you find this code useful, credits would be nice! -// -///////////////////////////////////////////////////////////////////////////// - -#include "ResizableLayout.h" -#include "ResizableGrip.h" -#include "ResizableMinMax.h" -#include "ResizableState.h" - -///////////////////////////////////////////////////////////////////////////// -// ResizableSheet.h : header file -// - -class CResizableSheet : public CPropertySheet, public CResizableLayout, - public CResizableGrip, public CResizableMinMax, - public CResizableState -{ - DECLARE_DYNAMIC(CResizableSheet) - -// Construction -public: - CResizableSheet(); - CResizableSheet(UINT nIDCaption, CWnd *pParentWnd = NULL, UINT iSelectPage = 0); - CResizableSheet(LPCTSTR pszCaption, CWnd *pParentWnd = NULL, UINT iSelectPage = 0); - -// Attributes -private: - // support for temporarily hiding the grip - DWORD m_dwGripTempState; - - // flags - BOOL m_bEnableSaveRestore; - BOOL m_bRectOnly; - BOOL m_bSavePage; - - // layout vars - CSize m_sizePageTL, m_sizePageBR; - - // internal status - CString m_sSection; // section name (identifies a parent window) - -// Operations -public: - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CResizableSheet) - public: - virtual BOOL OnInitDialog(); - //}}AFX_VIRTUAL - protected: - -// Implementation -public: - void RefreshLayout(); - virtual ~CResizableSheet(); - -// used internally -private: - void PresetLayout(); - void PrivateConstruct(); - void SavePage(); - void LoadPage(); - - BOOL IsWizard() { return (m_psh.dwFlags & PSH_WIZARD); } - -// callable from derived classes -protected: - // section to use in app's profile - void EnableSaveRestore(LPCTSTR pszSection, BOOL bRectOnly = FALSE, - BOOL bWithPage = FALSE); - int GetMinWidth(); // minimum width to display all buttons - - - virtual CWnd* GetResizableWnd() - { - // make the layout know its parent window - return this; - }; - -// Generated message map functions -protected: - virtual BOOL ArrangeLayoutCallback(LayoutInfo& layout); - //{{AFX_MSG(CResizableSheet) - afx_msg void OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI); - afx_msg void OnSize(UINT nType, int cx, int cy); - afx_msg void OnDestroy(); - afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); - afx_msg BOOL OnEraseBkgnd(CDC* pDC); - //}}AFX_MSG - afx_msg BOOL OnPageChanging(NMHDR* pNotifyStruct, LRESULT* pResult); - DECLARE_MESSAGE_MAP() -}; - -///////////////////////////////////////////////////////////////////////////// - -#endif // AFX_RESIZABLESHEET_H__INCLUDED_ diff --git a/src/ui/ResizableLib/ResizableState.cpp b/src/ui/ResizableLib/ResizableState.cpp deleted file mode 100644 index be7e05e4c..000000000 --- a/src/ui/ResizableLib/ResizableState.cpp +++ /dev/null @@ -1,111 +0,0 @@ -// ResizableState.cpp: implementation of the CResizableState class. -// -///////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) 2000-2002 by Paolo Messina -// (http://www.geocities.com/ppescher - ppescher@yahoo.com) -// -// The contents of this file are subject to the Artistic License (the "License"). -// You may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// http://www.opensource.org/licenses/artistic-license.html -// -// If you find this code useful, credits would be nice! -// -///////////////////////////////////////////////////////////////////////////// - -#include "stdafx.h" -#include "ResizableState.h" - -#ifdef _DEBUG -#undef THIS_FILE -static char THIS_FILE[]=__FILE__; -#define new DEBUG_NEW -#endif - -////////////////////////////////////////////////////////////////////// -// Construction/Destruction -////////////////////////////////////////////////////////////////////// - -CResizableState::CResizableState() -{ - -} - -CResizableState::~CResizableState() -{ - -} - - -// used to save/restore window's size and position -// either in the registry or a private .INI file -// depending on your application settings - -#define PLACEMENT_ENT _T("WindowPlacement") -#define PLACEMENT_FMT _T("%d,%d,%d,%d,%d,%d") - -BOOL CResizableState::SaveWindowRect(LPCTSTR pszSection, BOOL bRectOnly) -{ - CString data; - WINDOWPLACEMENT wp; - - ZeroMemory(&wp, sizeof(WINDOWPLACEMENT)); - wp.length = sizeof(WINDOWPLACEMENT); - if (!GetResizableWnd()->GetWindowPlacement(&wp)) - return FALSE; - - RECT& rc = wp.rcNormalPosition; // alias - - if (bRectOnly) // save size/pos only (normal state) - { - // use screen coordinates - GetResizableWnd()->GetWindowRect(&rc); - - data.Format(PLACEMENT_FMT, rc.left, rc.top, - rc.right, rc.bottom, SW_NORMAL, 0); - } - else // save also min/max state - { - // use workspace coordinates - data.Format(PLACEMENT_FMT, rc.left, rc.top, - rc.right, rc.bottom, wp.showCmd, wp.flags); - } - - return AfxGetApp()->WriteProfileString(pszSection, PLACEMENT_ENT, data); -} - -BOOL CResizableState::LoadWindowRect(LPCTSTR pszSection, BOOL bRectOnly) -{ - CString data; - WINDOWPLACEMENT wp; - - data = AfxGetApp()->GetProfileString(pszSection, PLACEMENT_ENT); - - if (data.IsEmpty()) // never saved before - return FALSE; - - ZeroMemory(&wp, sizeof(WINDOWPLACEMENT)); - wp.length = sizeof(WINDOWPLACEMENT); - if (!GetResizableWnd()->GetWindowPlacement(&wp)) - return FALSE; - - RECT& rc = wp.rcNormalPosition; // alias - - if (_stscanf(data, PLACEMENT_FMT, &rc.left, &rc.top, - &rc.right, &rc.bottom, &wp.showCmd, &wp.flags) == 6) - { - if (bRectOnly) // restore size/pos only - { - CRect rect(rc); - return GetResizableWnd()->SetWindowPos(NULL, rect.left, rect.top, - rect.Width(), rect.Height(), SWP_NOACTIVATE | SWP_NOZORDER | - SWP_NOREPOSITION); - } - else // restore also min/max state - { - return GetResizableWnd()->SetWindowPlacement(&wp); - } - } - return FALSE; -} diff --git a/src/ui/ResizableLib/ResizableState.h b/src/ui/ResizableLib/ResizableState.h deleted file mode 100644 index 1e5e7c35f..000000000 --- a/src/ui/ResizableLib/ResizableState.h +++ /dev/null @@ -1,38 +0,0 @@ -// ResizableState.h: interface for the CResizableState class. -// -///////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) 2000-2002 by Paolo Messina -// (http://www.geocities.com/ppescher - ppescher@yahoo.com) -// -// The contents of this file are subject to the Artistic License (the "License"). -// You may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// http://www.opensource.org/licenses/artistic-license.html -// -// If you find this code useful, credits would be nice! -// -///////////////////////////////////////////////////////////////////////////// - -#if !defined(AFX_RESIZABLESTATE_H__INCLUDED_) -#define AFX_RESIZABLESTATE_H__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - -class CResizableState -{ -protected: - // non-zero if successful - BOOL LoadWindowRect(LPCTSTR pszSection, BOOL bRectOnly); - BOOL SaveWindowRect(LPCTSTR pszSection, BOOL bRectOnly); - - virtual CWnd* GetResizableWnd() = 0; - -public: - CResizableState(); - virtual ~CResizableState(); -}; - -#endif // !defined(AFX_RESIZABLESTATE_H__INCLUDED_) diff --git a/src/ui/ResizableLib/stdafx.cpp b/src/ui/ResizableLib/stdafx.cpp deleted file mode 100644 index c317ca142..000000000 --- a/src/ui/ResizableLib/stdafx.cpp +++ /dev/null @@ -1,9 +0,0 @@ -// stdafx.cpp : source file that includes just the standard includes -// ResizableLib.pch will be the pre-compiled header -// stdafx.obj will contain the pre-compiled type information - -#include "stdafx.h" - -// TODO: reference any additional headers you need in STDAFX.H -// and not in this file - diff --git a/src/ui/ResizableLib/stdafx.h b/src/ui/ResizableLib/stdafx.h deleted file mode 100644 index 0619dd32c..000000000 --- a/src/ui/ResizableLib/stdafx.h +++ /dev/null @@ -1,21 +0,0 @@ -// stdafx.h : include file for standard system include files, -// or project specific include files that are used frequently, but -// are changed infrequently -// - -#pragma once - - -#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers -#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit - -#ifndef VC_EXTRALEAN -#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers -#endif - -#include -#include // MFC core and standard components -#include -#include - -// TODO: reference additional headers your program requires here diff --git a/src/ui/TreePropSheet/PropPageFrame.cpp b/src/ui/TreePropSheet/PropPageFrame.cpp deleted file mode 100644 index db76d6546..000000000 --- a/src/ui/TreePropSheet/PropPageFrame.cpp +++ /dev/null @@ -1,195 +0,0 @@ -/******************************************************************** -* -* Copyright (c) 2002 Sven Wiegand -* -* You can use this and modify this in any way you want, -* BUT LEAVE THIS HEADER INTACT. -* -* Redistribution is appreciated. -* -* $Workfile:$ -* $Revision: 8 $ -* $Modtime:$ -* $Author: gabest $ -* -* Revision History: -* $History:$ -* -*********************************************************************/ - -#include "stdafx.h" -#include "PropPageFrame.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - - - -namespace TreePropSheet -{ - - -//------------------------------------------------------------------- -// class CPropPageFrame -//------------------------------------------------------------------- - -CPropPageFrame::CPropPageFrame() -: m_bShowCaption(FALSE), - m_nCaptionHeight(0), - m_hCaptionIcon(NULL), - m_dwMsgFormat(DT_CENTER|DT_VCENTER|DT_NOPREFIX|DT_SINGLELINE) -{ -} - - -CPropPageFrame::~CPropPageFrame() -{ -} - - -///////////////////////////////////////////////////////////////////// -// Operations - - -void CPropPageFrame::ShowCaption(BOOL bEnable) -{ - m_bShowCaption = bEnable; - SafeUpdateWindow(CalcCaptionArea()); -} - - -BOOL CPropPageFrame::GetShowCaption() const -{ - return m_bShowCaption; -} - - -void CPropPageFrame::SetCaption(LPCTSTR lpszCaption, HICON hIcon /*= NULL*/) -{ - m_strCaption = lpszCaption; - m_hCaptionIcon = hIcon; - SafeUpdateWindow(CalcCaptionArea()); -} - - -CString CPropPageFrame::GetCaption(HICON *pIcon /* = NULL */) const -{ - if (pIcon) - *pIcon = m_hCaptionIcon; - return m_strCaption; -} - - -void CPropPageFrame::SetCaptionHeight(int nCaptionHeight) -{ - m_nCaptionHeight = nCaptionHeight; - SafeUpdateWindow(CalcCaptionArea()); -} - - -int CPropPageFrame::GetCaptionHeight() const -{ - return m_nCaptionHeight; -} - - -void CPropPageFrame::SetMsgText(LPCTSTR lpszMsg) -{ - m_strMsg = lpszMsg; - SafeUpdateWindow(CalcMsgArea()); -} - - -CString CPropPageFrame::GetMsgText() const -{ - return m_strMsg; -} - - -void CPropPageFrame::SetMsgFormat(DWORD dwFormat) -{ - m_dwMsgFormat = dwFormat; - SafeUpdateWindow(CalcMsgArea()); -} - - -DWORD CPropPageFrame::GetMsgFormat() const -{ - return m_dwMsgFormat; -} - - -///////////////////////////////////////////////////////////////////// -// Overridable implementation helpers - -void CPropPageFrame::Draw(CDC *pDc) -{ - if (GetShowCaption()) - DrawCaption(pDc, CalcCaptionArea(), m_strCaption, m_hCaptionIcon); - DrawMsg(pDc, CalcMsgArea(), m_strMsg, m_dwMsgFormat); -} - - -CRect CPropPageFrame::CalcMsgArea() -{ - ASSERT(IsWindow(GetWnd()->GetSafeHwnd())); - - CRect rectMsg; - GetWnd()->GetClientRect(rectMsg); - if (GetShowCaption()) - rectMsg.top+= GetCaptionHeight(); - - return rectMsg; -} - - -void CPropPageFrame::DrawMsg(CDC *pDc, CRect rect, LPCTSTR lpszMsg, DWORD dwFormat) -{ - CFont *pPrevFont = dynamic_cast(pDc->SelectStockObject(DEFAULT_GUI_FONT)); - int nPrevBkMode = pDc->SetBkMode(TRANSPARENT); - - pDc->DrawText(GetMsgText(), rect, GetMsgFormat()); - - pDc->SetBkMode(nPrevBkMode); - pDc->SelectObject(pPrevFont); -} - - -CRect CPropPageFrame::CalcCaptionArea() -{ - ASSERT(IsWindow(GetWnd()->GetSafeHwnd())); - - CRect rectCaption; - GetWnd()->GetClientRect(rectCaption); - if (!GetShowCaption()) - rectCaption.bottom = rectCaption.top; - else - rectCaption.bottom = rectCaption.top+GetCaptionHeight(); - - return rectCaption; -} - - -void CPropPageFrame::DrawCaption(CDC *pDc, CRect rect, LPCTSTR lpszCaption, HICON hIcon) -{ - // should be implemented by specialized classes -} - - -///////////////////////////////////////////////////////////////////// -// Implementation helpers - -void CPropPageFrame::SafeUpdateWindow(LPCRECT lpRect /* = NULL */) -{ - if (!IsWindow(GetWnd()->GetSafeHwnd())) - return; - - GetWnd()->InvalidateRect(lpRect, TRUE); -} - - - -} //namespace TreePropSheet diff --git a/src/ui/TreePropSheet/PropPageFrame.h b/src/ui/TreePropSheet/PropPageFrame.h deleted file mode 100644 index 9c8c63f5d..000000000 --- a/src/ui/TreePropSheet/PropPageFrame.h +++ /dev/null @@ -1,306 +0,0 @@ -/******************************************************************** -* -* Copyright (c) 2002 Sven Wiegand -* -* You can use this and modify this in any way you want, -* BUT LEAVE THIS HEADER INTACT. -* -* Redistribution is appreciated. -* -* $Workfile:$ -* $Revision: 126 $ -* $Modtime:$ -* $Author: gabest $ -* -* Revision History: -* $History:$ -* -*********************************************************************/ - - -#if !defined(AFX_PROPPAGEFRAME_H__B968548B_F0B4_4C35_85DD_C44242A9D368__INCLUDED_) -#define AFX_PROPPAGEFRAME_H__B968548B_F0B4_4C35_85DD_C44242A9D368__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - - -namespace TreePropSheet -{ - - -/** -An object of an CPropertyPageFrame-derived class is used by -CTreePropSheet to display a frame for the property pages. - -Derived classes have to implement at least the Create() and the -GetWnd() method, which -returns a pointer to the CWnd-obect of the window, that has been -created by the call to the Create() method. An implementation can -provide the CWnd-object by using it as a property or by deriving -from CWnd or a more specialiced class. This way has been choosen -instead of deriving CPropPageFrame from CWnd, to allow derived class -to derive from more specialized classes than CWnd -(i.e. CStatic, etc.). From the WM_PAINT-handler of your derived class -you have to call the Draw()-method. - -Most implementations will also implement the DrawCaption() and -DrawMsg() methods, to provide custom drawing functionality. - -@author Sven Wiegand -*/ -class /*AFX_EXT_CLASS*/ CPropPageFrame -{ -// Construction/Destruction -public: - CPropPageFrame(); - virtual ~CPropPageFrame(); - -// Operations -public: - /** - Has to create a window with the specified properties. - - @param dwWindowStyle - Standard window styles, to apply to the window to create. - @param rect - Position and size of the window to create. - @param pwndParent - Parent window. (Never be NULL). - @param nID - Window id. - - @return - TRUE on success, FALSE otherwise. - */ - virtual BOOL Create(DWORD dwWindowStyle, const RECT &rect, CWnd *pwndParent, UINT nID) = 0; - - /** - Returns a pointer to the window object, that represents the frame. - */ - virtual CWnd* GetWnd() = 0; - - /** - Enables or disables page caption. - - This default implementation calls the SafeUpdateWindow() method - with the caption rectangle, to force it to be redrawn. - */ - virtual void ShowCaption(BOOL bEnable); - - /** - Returns TRUE if captions are enabled, FALSE otherwise. - */ - BOOL GetShowCaption() const; - - /** - Sets the height of the caption in pixels. This value is ignored - until the caption is enabled by ShowCaption(TRUE). - - This default implementation calls the SafeUpdateWindow() method - with the caption rectangle, to force it to be redrawn. - */ - virtual void SetCaptionHeight(int nCaptionHeight); - - /** - Returns the caption height, that has been most recently set by a - call to the SetCaptionHeight() method. - */ - int GetCaptionHeight() const; - - /** - Sets caption text an icon. - - This default implementation calls the SafeUpdateWindow() method - with the caption rectangle, to force it to be redrawn. - - @param lpszCaption - Text to display for the caption. - @param hIcon - Icon to display for the caption. - */ - virtual void SetCaption(LPCTSTR lpszCaption, HICON hIcon = NULL); - - /** - Returns the caption, that has been set most recently using the - SetCaption() method. - - @param pIcon - Pointer to a HICON variable, that should receive the handle of - the currently set icon or NULL, if there is no icon or a NULL - pointer, if the caller is not interested in the icon. - - @return - The text that has been set most recently using the SetCaption() - method. - */ - CString GetCaption(HICON *pIcon = NULL) const; - - /** - Sets the text to display. - - This default implementation calls the SafeUpdateWindow() method - with the message rectangle, to force it to be redrawn. - */ - virtual void SetMsgText(LPCTSTR lpszMsg); - - /** - Returns the text currently displayed. - */ - CString GetMsgText() const; - - /** - Specifies the format to draw the text with, set by SetMsgText(). - - This default implementation calls the SafeUpdateWindow() method - with the message rectangle, to force it to be redrawn. - - @param dwFormat - Combination of the DT_* flags, specified by the Win32 function - DrawText(). - */ - virtual void SetMsgFormat(DWORD dwFormat); - - /** - Returns the format to draw the text with, set by SetMsgText(). - - @see SetMsgFormat() - */ - DWORD GetMsgFormat() const; - -// Overridable implementation helpers -protected: - /** - Draws the whole frame including caption (if enabled) and message. - - This method calculates the rectangles for the message area and - the caption area using the CalcMsgArea() and the CalcCaptionArea() - methods, draws then the caption calling the DrawCaption() method - (only if caption is enabled) and afterwards the message calling - the DrawMsg() method. - - You should call this method from the WM_PAINT-handler of your - derived class. - - @param pDc - Device context to draw in. - */ - virtual void Draw(CDC *pDc); - - /** - Calculates the area, the message, set by SetMsgText() should be - displayed in. The returned rectangle (client coordinates) will be - passed to DrawMsg(). - - This default implementation calls the CalcCaptionArea() method, - substracts the returned rectangle from the client area and returns - the result. - */ - virtual CRect CalcMsgArea(); - - /** - Draws the message with the specified format. - - This default implementation draws the given msg using the specified - properties. - - @param pDc - Device context to draw in. - @param rect - Rectangle to draw the message in. - @param lpszMsg - Message to draw. - @param dwFormat. - Combination of the DT_* flags, specified by the Win32 function - DrawText() to draw the message with. - */ - virtual void DrawMsg(CDC *pDc, CRect rect, LPCTSTR lpszMsg, DWORD dwFormat); - - /** - Calculates the caption area. The caption area is the rectangular - range, the current page's caption should be drawn in. - - The caption can be enabled or disabled using the ShowCaption() - method. This method should return an empty rect, if the caption - is disabled. If the caption is enabled the height of the rect - should be as large, as specified by the latest call to the - SetCaptionHeight() method. - - The rectangle, returned by this method will be passed to the - DrawCaption() method to draw the caption. - - If the caption is enabled currently, this default implementation - returns a rectangle, that has the width of the client area and - the height, specified by the latest call to SetCaptionHeight(), - starting and y-position 0. If the caption is disabled at the - moment, this method returns an empty rectangle with the width of - the client area. - */ - virtual CRect CalcCaptionArea(); - - /** - Draws the caption. - - This default implementation draws nothing. - - @param pDc - Device context to draw in. - @param rect - Rectangle to draw the caption in. - @param lpszCaption - Text to display in the caption. - @param hIcon - Icon to display in the caption. - */ - virtual void DrawCaption(CDC *pDc, CRect rect, LPCTSTR lpszCaption, HICON hIcon); - -// Implementation helpers -protected: - /** - If the m_hWnd property of the CWnd-object returend by GetWnd() - specifies a valid window, this method will invalidate the specified - rectangle, to schedule it for repaint, otherwise the method will - return without doing anything. - - @param lpRect - Pointer to the rectangular area, that should be marked for - repainting or NULL, if the whole client area should be marked - for repainting. - */ - void SafeUpdateWindow(LPCRECT lpRect = NULL); - -// Properties -private: - /** TRUE if the caption should be drawn, FALSE otherwise. */ - BOOL m_bShowCaption; - - /** Height of the caption in pixels, if it is enabled. */ - int m_nCaptionHeight; - - /** Text to display in the caption. */ - CString m_strCaption; - - /** - Icon to display in the caption or NULL if no icon should be - displayed. - */ - HICON m_hCaptionIcon; - - /** Message text to display. */ - CString m_strMsg; - - /** Style to use when drawing the message text m_strMsg. */ - DWORD m_dwMsgFormat; -}; - - -} //namespace TreePropSheet - - -///////////////////////////////////////////////////////////////////////////// - -//{{AFX_INSERT_LOCATION}} -// Microsoft Visual C++ fügt unmittelbar vor der vorhergehenden Zeile zusätzliche Deklarationen ein. - -#endif // AFX_PROPPAGEFRAME_H__B968548B_F0B4_4C35_85DD_C44242A9D368__INCLUDED_ diff --git a/src/ui/TreePropSheet/PropPageFrameDefault.cpp b/src/ui/TreePropSheet/PropPageFrameDefault.cpp deleted file mode 100644 index ce0b59130..000000000 --- a/src/ui/TreePropSheet/PropPageFrameDefault.cpp +++ /dev/null @@ -1,399 +0,0 @@ -/******************************************************************** -* -* Copyright (c) 2002 Sven Wiegand -* -* You can use this and modify this in any way you want, -* BUT LEAVE THIS HEADER INTACT. -* -* Redistribution is appreciated. -* -* $Workfile:$ -* $Revision: 8 $ -* $Modtime:$ -* $Author: gabest $ -* -* Revision History: -* $History:$ -* -*********************************************************************/ - -#include "stdafx.h" -#include "PropPageFrameDefault.h" - - -namespace TreePropSheet -{ - - -//uncomment the following line, if you don't have installed the -//new platform SDK -#define XPSUPPORT - -#ifdef XPSUPPORT -#include -#include -#endif - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -//------------------------------------------------------------------- -// class CThemeLib -//------------------------------------------------------------------- - -#define THEMEAPITYPE(f) typedef HRESULT (__stdcall *_##f) -#define THEMEAPITYPE_(t, f) typedef t (__stdcall *_##f) -#define THEMEAPIPTR(f) _##f m_p##f - -#ifdef XPSUPPORT - #define THEMECALL(f) return (*m_p##f) - #define GETTHEMECALL(f) m_p##f = (_##f)GetProcAddress(m_hThemeLib, #f) -#else - void ThemeDummy(...) {ASSERT(FALSE);} - #define HTHEME void* - #define TABP_PANE 0 - #define THEMECALL(f) return 0; ThemeDummy - #define GETTHEMECALL(f) m_p##f = NULL -#endif - - -/** -Helper class for loading the uxtheme DLL and providing their -functions. - -One global object of this class exists. - -@author Sven Wiegand -*/ -class CThemeLib -{ -// construction/destruction -public: - CThemeLib(); - ~CThemeLib(); - -// operations -public: - /** - Returns TRUE if the call wrappers are available, FALSE otherwise. - */ - BOOL IsAvailable() const; - -// call wrappers -public: - BOOL IsThemeActive() - {THEMECALL(IsThemeActive)();} - - HTHEME OpenThemeData(HWND hwnd, LPCWSTR pszClassList) - {THEMECALL(OpenThemeData)(hwnd, pszClassList);} - - HRESULT CloseThemeData(HTHEME hTheme) - {THEMECALL(CloseThemeData)(hTheme);} - - HRESULT GetThemeBackgroundContentRect(HTHEME hTheme, OPTIONAL HDC hdc, int iPartId, int iStateId, const RECT *pBoundingRect, OUT RECT *pContentRect) - {THEMECALL(GetThemeBackgroundContentRect)(hTheme, hdc, iPartId, iStateId, pBoundingRect, pContentRect);} - - HRESULT DrawThemeBackground(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, OPTIONAL const RECT *pClipRect) - {THEMECALL(DrawThemeBackground)(hTheme, hdc, iPartId, iStateId, pRect, pClipRect);} - -// function pointers -private: -#ifdef XPSUPPORT - THEMEAPITYPE_(BOOL, IsThemeActive)(); - THEMEAPIPTR(IsThemeActive); - - THEMEAPITYPE_(HTHEME, OpenThemeData)(HWND hwnd, LPCWSTR pszClassList); - THEMEAPIPTR(OpenThemeData); - - THEMEAPITYPE(CloseThemeData)(HTHEME hTheme); - THEMEAPIPTR(CloseThemeData); - - THEMEAPITYPE(GetThemeBackgroundContentRect)(HTHEME hTheme, OPTIONAL HDC hdc, int iPartId, int iStateId, const RECT *pBoundingRect, OUT RECT *pContentRect); - THEMEAPIPTR(GetThemeBackgroundContentRect); - - THEMEAPITYPE(DrawThemeBackground)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, OPTIONAL const RECT *pClipRect); - THEMEAPIPTR(DrawThemeBackground); -#endif - -// properties -private: - /** instance handle to the library or NULL. */ - HINSTANCE m_hThemeLib; -}; - -/** -One and only instance of CThemeLib. -*/ -static CThemeLib g_ThemeLib; - - -CThemeLib::CThemeLib() -: m_hThemeLib(NULL) -{ -#ifdef XPSUPPORT - m_hThemeLib = LoadLibrary(_T("uxtheme.dll")); - if (!m_hThemeLib) - return; - - GETTHEMECALL(IsThemeActive); - GETTHEMECALL(OpenThemeData); - GETTHEMECALL(CloseThemeData); - GETTHEMECALL(GetThemeBackgroundContentRect); - GETTHEMECALL(DrawThemeBackground); -#endif -} - - -CThemeLib::~CThemeLib() -{ - if (m_hThemeLib) - FreeLibrary(m_hThemeLib); -} - - -BOOL CThemeLib::IsAvailable() const -{ - return m_hThemeLib!=NULL; -} - - -//------------------------------------------------------------------- -// class CPropPageFrameDefault -//------------------------------------------------------------------- - -BEGIN_MESSAGE_MAP(CPropPageFrameDefault, CWnd) - //{{AFX_MSG_MAP(CPropPageFrameDefault) - ON_WM_PAINT() - ON_WM_ERASEBKGND() - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - - -CPropPageFrameDefault::CPropPageFrameDefault() -{ -} - - -CPropPageFrameDefault::~CPropPageFrameDefault() -{ - if (m_Images.GetSafeHandle()) - m_Images.DeleteImageList(); -} - - -///////////////////////////////////////////////////////////////////// -// Overridings - -BOOL CPropPageFrameDefault::Create(DWORD dwWindowStyle, const RECT &rect, CWnd *pwndParent, UINT nID) -{ - return CWnd::Create( - AfxRegisterWndClass(CS_HREDRAW|CS_VREDRAW, AfxGetApp()->LoadStandardCursor(IDC_ARROW), GetSysColorBrush(COLOR_3DFACE)), - _T("Page Frame"), - dwWindowStyle, rect, pwndParent, nID); -} - -CWnd* CPropPageFrameDefault::GetWnd() -{ - return static_cast(this); -} - -void CPropPageFrameDefault::SetCaption(LPCTSTR lpszCaption, HICON hIcon /*= NULL*/) -{ - CPropPageFrame::SetCaption(lpszCaption, hIcon); - - // build image list - if (m_Images.GetSafeHandle()) - m_Images.DeleteImageList(); - if (hIcon) - { - ICONINFO ii; - if (!GetIconInfo(hIcon, &ii)) - return; - - CBitmap bmMask; - bmMask.Attach(ii.hbmMask); - if (ii.hbmColor) DeleteObject(ii.hbmColor); - - BITMAP bm; - bmMask.GetBitmap(&bm); - - if (!m_Images.Create(bm.bmWidth, bm.bmHeight, ILC_COLOR32|ILC_MASK, 0, 1)) - return; - - if (m_Images.Add(hIcon) == -1) - m_Images.DeleteImageList(); - } -} - -CRect CPropPageFrameDefault::CalcMsgArea() -{ - CRect rect; - GetClientRect(rect); - if (g_ThemeLib.IsAvailable() && g_ThemeLib.IsThemeActive()) - { - HTHEME hTheme = g_ThemeLib.OpenThemeData(m_hWnd, L"Tab"); - if (hTheme) - { - CRect rectContent; - CDC *pDc = GetDC(); - g_ThemeLib.GetThemeBackgroundContentRect(hTheme, pDc->m_hDC, TABP_PANE, 0, rect, rectContent); - ReleaseDC(pDc); - g_ThemeLib.CloseThemeData(hTheme); - - if (GetShowCaption()) - rectContent.top = rect.top+GetCaptionHeight()+1; - rect = rectContent; - } - } - else if (GetShowCaption()) - rect.top+= GetCaptionHeight()+1; - - return rect; -} - - -CRect CPropPageFrameDefault::CalcCaptionArea() -{ - CRect rect; - GetClientRect(rect); - if (g_ThemeLib.IsAvailable() && g_ThemeLib.IsThemeActive()) - { - HTHEME hTheme = g_ThemeLib.OpenThemeData(m_hWnd, L"Tab"); - if (hTheme) - { - CRect rectContent; - CDC *pDc = GetDC(); - g_ThemeLib.GetThemeBackgroundContentRect(hTheme, pDc->m_hDC, TABP_PANE, 0, rect, rectContent); - ReleaseDC(pDc); - g_ThemeLib.CloseThemeData(hTheme); - - if (GetShowCaption()) - rectContent.bottom = rect.top+GetCaptionHeight(); - else - rectContent.bottom = rectContent.top; - - rect = rectContent; - } - } - else - { - if (GetShowCaption()) - rect.bottom = rect.top+GetCaptionHeight(); - else - rect.bottom = rect.top; - } - - return rect; -} - -void CPropPageFrameDefault::DrawCaption(CDC *pDc, CRect rect, LPCTSTR lpszCaption, HICON hIcon) -{ - COLORREF clrLeft = GetSysColor(COLOR_INACTIVECAPTION); - COLORREF clrRight = pDc->GetPixel(rect.right-1, rect.top); - FillGradientRectH(pDc, rect, clrLeft, clrRight); - - // draw icon - if (hIcon && m_Images.GetSafeHandle() && m_Images.GetImageCount() == 1) - { - IMAGEINFO ii; - m_Images.GetImageInfo(0, &ii); - CPoint pt(3, rect.CenterPoint().y - (ii.rcImage.bottom-ii.rcImage.top)/2); - m_Images.Draw(pDc, 0, pt, ILD_TRANSPARENT); - rect.left+= (ii.rcImage.right-ii.rcImage.left) + 3; - } - - // draw text - rect.left+= 2; - - COLORREF clrPrev = pDc->SetTextColor(GetSysColor(COLOR_CAPTIONTEXT)); - int nBkStyle = pDc->SetBkMode(TRANSPARENT); - CFont *pFont = (CFont*)pDc->SelectStockObject(SYSTEM_FONT); - - CFont* pSysFont = pDc->GetCurrentFont(); - LOGFONT lf; - pSysFont->GetLogFont(&lf); - lf.lfHeight = rect.Height(); - lf.lfWidth = 0; - _tcscpy(lf.lfFaceName, _T("Arial")); - CFont f; - f.CreateFontIndirect(&lf); - pDc->SelectObject(&f); - - pDc->DrawText(lpszCaption, rect, DT_LEFT|DT_VCENTER|DT_SINGLELINE|DT_END_ELLIPSIS); - - pDc->SetTextColor(clrPrev); - pDc->SetBkMode(nBkStyle); - pDc->SelectObject(pFont); -} - - -///////////////////////////////////////////////////////////////////// -// Implementation helpers - -void CPropPageFrameDefault::FillGradientRectH(CDC *pDc, const RECT &rect, COLORREF clrLeft, COLORREF clrRight) -{ - // pre calculation - int nSteps = rect.right-rect.left; - int nRRange = GetRValue(clrRight)-GetRValue(clrLeft); - int nGRange = GetGValue(clrRight)-GetGValue(clrLeft); - int nBRange = GetBValue(clrRight)-GetBValue(clrLeft); - - double dRStep = (double)nRRange/(double)nSteps; - double dGStep = (double)nGRange/(double)nSteps; - double dBStep = (double)nBRange/(double)nSteps; - - double dR = (double)GetRValue(clrLeft); - double dG = (double)GetGValue(clrLeft); - double dB = (double)GetBValue(clrLeft); - - CPen *pPrevPen = NULL; - for (int x = rect.left; x <= rect.right; ++x) - { - CPen Pen(PS_SOLID, 1, RGB((BYTE)dR, (BYTE)dG, (BYTE)dB)); - pPrevPen = pDc->SelectObject(&Pen); - pDc->MoveTo(x, rect.top); - pDc->LineTo(x, rect.bottom); - pDc->SelectObject(pPrevPen); - - dR+= dRStep; - dG+= dGStep; - dB+= dBStep; - } -} - - -///////////////////////////////////////////////////////////////////// -// message handlers - -void CPropPageFrameDefault::OnPaint() -{ - CPaintDC dc(this); - Draw(&dc); -} - - -BOOL CPropPageFrameDefault::OnEraseBkgnd(CDC* pDC) -{ - if (g_ThemeLib.IsAvailable() && g_ThemeLib.IsThemeActive()) - { - HTHEME hTheme = g_ThemeLib.OpenThemeData(m_hWnd, L"Tab"); - if (hTheme) - { - CRect rect; - GetClientRect(rect); - g_ThemeLib.DrawThemeBackground(hTheme, pDC->m_hDC, TABP_PANE, 0, rect, NULL); - - g_ThemeLib.CloseThemeData(hTheme); - } - return TRUE; - } - else - { - return CWnd::OnEraseBkgnd(pDC); - } -} - -} //namespace TreePropSheet diff --git a/src/ui/TreePropSheet/PropPageFrameDefault.h b/src/ui/TreePropSheet/PropPageFrameDefault.h deleted file mode 100644 index 0e0523151..000000000 --- a/src/ui/TreePropSheet/PropPageFrameDefault.h +++ /dev/null @@ -1,119 +0,0 @@ -/******************************************************************** -* -* Copyright (c) 2002 Sven Wiegand -* -* You can use this and modify this in any way you want, -* BUT LEAVE THIS HEADER INTACT. -* -* Redistribution is appreciated. -* -* $Workfile:$ -* $Revision: 126 $ -* $Modtime:$ -* $Author: gabest $ -* -* Revision History: -* $History:$ -* -*********************************************************************/ - - -#if !defined(AFX_PROPPAGEFRAMEDEFAULT_H__5C5B7AC9_2DF5_4E8C_8F5E_DE2CC04BBED7__INCLUDED_) -#define AFX_PROPPAGEFRAMEDEFAULT_H__5C5B7AC9_2DF5_4E8C_8F5E_DE2CC04BBED7__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - -#include "PropPageFrame.h" -#include - - -namespace TreePropSheet -{ - - -/** -An implementation of CPropPageFrame, that works well for Windows XP -styled systems and older windows versions (without themes). - -@author Sven Wiegand -*/ -class /*AFX_EXT_CLASS*/ CPropPageFrameDefault : public CWnd, - public CPropPageFrame -{ -// construction/destruction -public: - CPropPageFrameDefault(); - virtual ~CPropPageFrameDefault(); - -// operations -public: - -// overridings -public: - virtual BOOL Create(DWORD dwWindowStyle, const RECT &rect, CWnd *pwndParent, UINT nID); - virtual CWnd* GetWnd(); - virtual void SetCaption(LPCTSTR lpszCaption, HICON hIcon = NULL); - - -protected: - virtual CRect CalcMsgArea(); - virtual CRect CalcCaptionArea(); - virtual void DrawCaption(CDC *pDc, CRect rect, LPCTSTR lpszCaption, HICON hIcon); - -// Implementation helpers -protected: - /** - Fills a rectangular area with a gradient color starting at the left - side with the color clrLeft and ending at the right sight with the - color clrRight. - - @param pDc - Device context to draw the rectangle in. - @param rect - Rectangular area to fill. - @param clrLeft - Color on the left side. - @param clrRight - Color on the right side. - */ - void FillGradientRectH(CDC *pDc, const RECT &rect, COLORREF clrLeft, COLORREF clrRight); - - /** - Returns TRUE if Windows XP theme support is available, FALSE - otherwise. - */ - BOOL ThemeSupport() const; - -protected: - //{{AFX_VIRTUAL(CPropPageFrameDefault) - //}}AFX_VIRTUAL - -// message handlers -protected: - //{{AFX_MSG(CPropPageFrameDefault) - afx_msg void OnPaint(); - afx_msg BOOL OnEraseBkgnd(CDC* pDC); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() - -// attributes -protected: - /** - Image list that contains only the current icon or nothing if there - is no icon. - */ - CImageList m_Images; -}; - - -} //namespace TreePropSheet - - -///////////////////////////////////////////////////////////////////////////// - -//{{AFX_INSERT_LOCATION}} -// Microsoft Visual C++ fügt unmittelbar vor der vorhergehenden Zeile zusätzliche Deklarationen ein. - -#endif // AFX_PROPPAGEFRAMEDEFAULT_H__5C5B7AC9_2DF5_4E8C_8F5E_DE2CC04BBED7__INCLUDED_ diff --git a/src/ui/TreePropSheet/TreePropSheet.cpp b/src/ui/TreePropSheet/TreePropSheet.cpp deleted file mode 100644 index 9c5c9f8ec..000000000 --- a/src/ui/TreePropSheet/TreePropSheet.cpp +++ /dev/null @@ -1,989 +0,0 @@ -/******************************************************************** -* -* Copyright (c) 2002 Sven Wiegand -* -* You can use this and modify this in any way you want, -* BUT LEAVE THIS HEADER INTACT. -* -* Redistribution is appreciated. -* -* $Workfile:$ -* $Revision: 126 $ -* $Modtime:$ -* $Author: gabest $ -* -* Revision History: -* $History:$ -* -*********************************************************************/ - - -#include "stdafx.h" -#include "TreePropSheet.h" -#include "PropPageFrameDefault.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - - - -namespace TreePropSheet -{ - -//------------------------------------------------------------------- -// class CTreePropSheet -//------------------------------------------------------------------- - -BEGIN_MESSAGE_MAP(CTreePropSheet, CPropertySheet) - //{{AFX_MSG_MAP(CTreePropSheet) - ON_WM_DESTROY() - //}}AFX_MSG_MAP - ON_MESSAGE(PSM_ADDPAGE, OnAddPage) - ON_MESSAGE(PSM_REMOVEPAGE, OnRemovePage) - ON_MESSAGE(PSM_SETCURSEL, OnSetCurSel) - ON_MESSAGE(PSM_SETCURSELID, OnSetCurSelId) - ON_MESSAGE(PSM_ISDIALOGMESSAGE, OnIsDialogMessage) - - ON_NOTIFY(TVN_SELCHANGINGA, s_unPageTreeId, OnPageTreeSelChanging) - ON_NOTIFY(TVN_SELCHANGINGW, s_unPageTreeId, OnPageTreeSelChanging) - ON_NOTIFY(TVN_SELCHANGEDA, s_unPageTreeId, OnPageTreeSelChanged) - ON_NOTIFY(TVN_SELCHANGEDW, s_unPageTreeId, OnPageTreeSelChanged) -END_MESSAGE_MAP() - -IMPLEMENT_DYNAMIC(CTreePropSheet, CPropertySheet) - -const UINT CTreePropSheet::s_unPageTreeId = 0x7EEE; - -CTreePropSheet::CTreePropSheet() -: m_bPageTreeSelChangedActive(FALSE), - m_bTreeViewMode(TRUE), - m_bPageCaption(FALSE), - m_bTreeImages(FALSE), - m_nPageTreeWidth(150), - m_pwndPageTree(NULL), - m_pFrame(NULL) -{} - - -CTreePropSheet::CTreePropSheet(UINT nIDCaption, CWnd* pParentWnd, UINT iSelectPage) -: CPropertySheet(nIDCaption, pParentWnd, iSelectPage), - m_bPageTreeSelChangedActive(FALSE), - m_bTreeViewMode(TRUE), - m_bPageCaption(FALSE), - m_bTreeImages(FALSE), - m_nPageTreeWidth(150), - m_pwndPageTree(NULL), - m_pFrame(NULL) -{ -} - - -CTreePropSheet::CTreePropSheet(LPCTSTR pszCaption, CWnd* pParentWnd, UINT iSelectPage) -: CPropertySheet(pszCaption, pParentWnd, iSelectPage), - m_bPageTreeSelChangedActive(FALSE), - m_bTreeViewMode(TRUE), - m_bPageCaption(FALSE), - m_bTreeImages(FALSE), - m_nPageTreeWidth(150), - m_pwndPageTree(NULL), - m_pFrame(NULL) -{ -} - - -CTreePropSheet::~CTreePropSheet() -{ - if(m_Images.GetSafeHandle()) m_Images.DeleteImageList(); - delete m_pwndPageTree, m_pwndPageTree = NULL; - delete m_pFrame, m_pFrame = NULL; -} - -///////////////////////////////////////////////////////////////////// -// Operationen - -BOOL CTreePropSheet::SetTreeViewMode(BOOL bTreeViewMode /* = TRUE */, BOOL bPageCaption /* = FALSE */, BOOL bTreeImages /* = FALSE */) -{ - if (IsWindow(m_hWnd)) - { - // needs to becalled, before the window has been created - ASSERT(FALSE); - return FALSE; - } - - m_bTreeViewMode = bTreeViewMode; - if (m_bTreeViewMode) - { - m_bPageCaption = bPageCaption; - m_bTreeImages = bTreeImages; - } - - return TRUE; -} - - -BOOL CTreePropSheet::SetTreeWidth(int nWidth) -{ - if (IsWindow(m_hWnd)) - { - // needs to be called, before the window is created. - ASSERT(FALSE); - return FALSE; - } - - m_nPageTreeWidth = nWidth; - - return TRUE; -} - - -void CTreePropSheet::SetEmptyPageText(LPCTSTR lpszEmptyPageText) -{ - m_strEmptyPageMessage = lpszEmptyPageText; -} - - -DWORD CTreePropSheet::SetEmptyPageTextFormat(DWORD dwFormat) -{ - DWORD dwPrevFormat = m_pFrame->GetMsgFormat(); - m_pFrame->SetMsgFormat(dwFormat); - return dwPrevFormat; -} - - -BOOL CTreePropSheet::SetTreeDefaultImages(CImageList *pImages) -{ - if (pImages->GetImageCount() != 2) - { - ASSERT(FALSE); - return FALSE; - } - - if (m_DefaultImages.GetSafeHandle()) - m_DefaultImages.DeleteImageList(); - m_DefaultImages.Create(pImages); - - // update, if necessary - if (IsWindow(m_hWnd)) - RefillPageTree(); - - return TRUE; -} - - -BOOL CTreePropSheet::SetTreeDefaultImages(UINT unBitmapID, int cx, COLORREF crMask) -{ - if (m_DefaultImages.GetSafeHandle()) - m_DefaultImages.DeleteImageList(); - if (!m_DefaultImages.Create(unBitmapID, cx, 0, crMask)) - return FALSE; - - if (m_DefaultImages.GetImageCount() != 2) - { - m_DefaultImages.DeleteImageList(); - return FALSE; - } - - return TRUE; -} - - -CTreeCtrl* CTreePropSheet::GetPageTreeControl() -{ - return m_pwndPageTree; -} - - -///////////////////////////////////////////////////////////////////// -// public helpers - -BOOL CTreePropSheet::SetPageIcon(CPropertyPage *pPage, HICON hIcon) -{ - pPage->m_psp.dwFlags|= PSP_USEHICON; - pPage->m_psp.hIcon = hIcon; - return TRUE; -} - - -BOOL CTreePropSheet::SetPageIcon(CPropertyPage *pPage, UINT unIconId) -{ - HICON hIcon = AfxGetApp()->LoadIcon(unIconId); - if (!hIcon) - return FALSE; - - return SetPageIcon(pPage, hIcon); -} - - -BOOL CTreePropSheet::SetPageIcon(CPropertyPage *pPage, CImageList &Images, int nImage) -{ - HICON hIcon = Images.ExtractIcon(nImage); - if (!hIcon) - return FALSE; - - return SetPageIcon(pPage, hIcon); -} - - -BOOL CTreePropSheet::DestroyPageIcon(CPropertyPage *pPage) -{ - if (!pPage || !(pPage->m_psp.dwFlags&PSP_USEHICON) || !pPage->m_psp.hIcon) - return FALSE; - - DestroyIcon(pPage->m_psp.hIcon); - pPage->m_psp.dwFlags&= ~PSP_USEHICON; - pPage->m_psp.hIcon = NULL; - - return TRUE; -} - - -///////////////////////////////////////////////////////////////////// -// Overridable implementation helpers - -CString CTreePropSheet::GenerateEmptyPageMessage(LPCTSTR lpszEmptyPageMessage, LPCTSTR lpszCaption) -{ - CString strMsg; - strMsg.Format(lpszEmptyPageMessage, lpszCaption); - return strMsg; -} - - -CTreeCtrl* CTreePropSheet::CreatePageTreeObject() -{ - return new CTreeCtrl; -} - - -CPropPageFrame* CTreePropSheet::CreatePageFrame() -{ - return new CPropPageFrameDefault; -} - - -///////////////////////////////////////////////////////////////////// -// Implementation helpers - -void CTreePropSheet::MoveChildWindows(int nDx, int nDy) -{ - CWnd *pWnd = GetWindow(GW_CHILD); - while (pWnd) - { - CRect rect; - pWnd->GetWindowRect(rect); - rect.OffsetRect(nDx, nDy); - ScreenToClient(rect); - pWnd->MoveWindow(rect); - - pWnd = pWnd->GetNextWindow(); - } -} - - -void CTreePropSheet::RefillPageTree() -{ - if (!IsWindow(m_hWnd)) - return; - - m_pwndPageTree->DeleteAllItems(); - - CTabCtrl *pTabCtrl = GetTabControl(); - if (!IsWindow(pTabCtrl->GetSafeHwnd())) - { - ASSERT(FALSE); - return; - } - - const int nPageCount = pTabCtrl->GetItemCount(); - - // rebuild image list - if (m_bTreeImages) - { - for (int i = m_Images.GetImageCount()-1; i >= 0; --i) - m_Images.Remove(i); - - // add page images - CImageList *pPageImages = pTabCtrl->GetImageList(); - if (pPageImages) - { - for (int nImage = 0; nImage < pPageImages->GetImageCount(); ++nImage) - { - HICON hIcon = pPageImages->ExtractIcon(nImage); - m_Images.Add(hIcon); - DestroyIcon(hIcon); - } - } - - // add default images - if (m_DefaultImages.GetSafeHandle()) - { - HICON hIcon; - - // add default images - hIcon = m_DefaultImages.ExtractIcon(0); - if (hIcon) - { - m_Images.Add(hIcon); - DestroyIcon(hIcon); - } - hIcon = m_DefaultImages.ExtractIcon(1); - { - m_Images.Add(hIcon); - DestroyIcon(hIcon); - } - } - } - - // insert tree items - for (int nPage = 0; nPage < nPageCount; ++nPage) - { - // Get title and image of the page - CString strPagePath; - - TCITEM ti; - ZeroMemory(&ti, sizeof(ti)); - ti.mask = TCIF_TEXT|TCIF_IMAGE; - ti.cchTextMax = MAX_PATH; - ti.pszText = strPagePath.GetBuffer(ti.cchTextMax); - ASSERT(ti.pszText); - if (!ti.pszText) - return; - - pTabCtrl->GetItem(nPage, &ti); - strPagePath.ReleaseBuffer(); - - // Create an item in the tree for the page - HTREEITEM hItem = CreatePageTreeItem(ti.pszText); - ASSERT(hItem); - if (hItem) - { - m_pwndPageTree->SetItemData(hItem, nPage); - - // set image - if (m_bTreeImages) - { - int nImage = ti.iImage; - if (nImage < 0 || nImage >= m_Images.GetImageCount()) - nImage = m_DefaultImages.GetSafeHandle()? m_Images.GetImageCount()-1 : -1; - - m_pwndPageTree->SetItemImage(hItem, nImage, nImage); - } - } - } -} - - -HTREEITEM CTreePropSheet::CreatePageTreeItem(LPCTSTR lpszPath, HTREEITEM hParent /* = TVI_ROOT */) -{ - CString strPath(lpszPath); - CString strTopMostItem(SplitPageTreePath(strPath)); - - // Check if an item with the given text does already exist - HTREEITEM hItem = NULL; - HTREEITEM hChild = m_pwndPageTree->GetChildItem(hParent); - while (hChild) - { - if (m_pwndPageTree->GetItemText(hChild) == strTopMostItem) - { - hItem = hChild; - break; - } - hChild = m_pwndPageTree->GetNextItem(hChild, TVGN_NEXT); - } - - // If item with that text does not already exist, create a new one - if (!hItem) - { - hItem = m_pwndPageTree->InsertItem(strTopMostItem, hParent); - m_pwndPageTree->SetItemData(hItem, -1); - if (!strPath.IsEmpty() && m_bTreeImages && m_DefaultImages.GetSafeHandle()) - // set folder image - m_pwndPageTree->SetItemImage(hItem, m_Images.GetImageCount()-2, m_Images.GetImageCount()-2); - } - if (!hItem) - { - ASSERT(FALSE); - return NULL; - } - - if (strPath.IsEmpty()) - return hItem; - else - return CreatePageTreeItem(strPath, hItem); -} - - -CString CTreePropSheet::SplitPageTreePath(CString &strRest) -{ - int nSeperatorPos = 0; - while (TRUE) - { - nSeperatorPos = strRest.Find(_T("::"), nSeperatorPos); - if (nSeperatorPos == -1) - { - CString strItem(strRest); - strRest.Empty(); - return strItem; - } - else if (nSeperatorPos>0) - { - // if there is an odd number of backslashes infront of the - // seperator, than do not interpret it as separator - int nBackslashCount = 0; - for (int nPos = nSeperatorPos-1; nPos >= 0 && strRest[nPos]==_T('\\'); --nPos, ++nBackslashCount); - if (nBackslashCount%2 == 0) - break; - else - ++nSeperatorPos; - } - } - - CString strItem(strRest.Left(nSeperatorPos)); - strItem.Replace(_T("\\::"), _T("::")); - strItem.Replace(_T("\\\\"), _T("\\")); - strRest = strRest.Mid(nSeperatorPos+2); - return strItem; -} - - -BOOL CTreePropSheet::KillActiveCurrentPage() -{ - HWND hCurrentPage = PropSheet_GetCurrentPageHwnd(m_hWnd); - if (!IsWindow(hCurrentPage)) - { - ASSERT(FALSE); - return TRUE; - } - - // Check if the current page is really active (if page is invisible - // an virtual empty page is the active one. - if (!::IsWindowVisible(hCurrentPage)) - return TRUE; - - // Try to deactivate current page - PSHNOTIFY pshn; - pshn.hdr.code = PSN_KILLACTIVE; - pshn.hdr.hwndFrom = m_hWnd; - pshn.hdr.idFrom = GetDlgCtrlID(); - pshn.lParam = 0; - if (::SendMessage(hCurrentPage, WM_NOTIFY, pshn.hdr.idFrom, (LPARAM)&pshn)) - // current page does not allow page change - return FALSE; - - // Hide the page - ::ShowWindow(hCurrentPage, SW_HIDE); - - return TRUE; -} - - -HTREEITEM CTreePropSheet::GetPageTreeItem(int nPage, HTREEITEM hRoot /* = TVI_ROOT */) -{ - // Special handling for root case - if (hRoot == TVI_ROOT) - hRoot = m_pwndPageTree->GetNextItem(NULL, TVGN_ROOT); - - // Check parameters - if (nPage < 0 || nPage >= GetPageCount()) - { - ASSERT(FALSE); - return NULL; - } - - if (hRoot == NULL) - { - ASSERT(FALSE); - return NULL; - } - - // we are performing a simple linear search here, because we are - // expecting only little data - HTREEITEM hItem = hRoot; - while (hItem) - { - if ((signed)m_pwndPageTree->GetItemData(hItem) == nPage) - return hItem; - if (m_pwndPageTree->ItemHasChildren(hItem)) - { - HTREEITEM hResult = GetPageTreeItem(nPage, m_pwndPageTree->GetNextItem(hItem, TVGN_CHILD)); - if (hResult) - return hResult; - } - - hItem = m_pwndPageTree->GetNextItem(hItem, TVGN_NEXT); - } - - // we've found nothing, if we arrive here - return hItem; -} - - -BOOL CTreePropSheet::SelectPageTreeItem(int nPage) -{ - HTREEITEM hItem = GetPageTreeItem(nPage); - if (!hItem) - return FALSE; - - return m_pwndPageTree->SelectItem(hItem); -} - - -BOOL CTreePropSheet::SelectCurrentPageTreeItem() -{ - CTabCtrl *pTab = GetTabControl(); - if (!IsWindow(pTab->GetSafeHwnd())) - return FALSE; - - return SelectPageTreeItem(pTab->GetCurSel()); -} - - -void CTreePropSheet::UpdateCaption() -{ - HWND hPage = PropSheet_GetCurrentPageHwnd(GetSafeHwnd()); - BOOL bRealPage = IsWindow(hPage) && ::IsWindowVisible(hPage); - HTREEITEM hItem = m_pwndPageTree->GetSelectedItem(); - if (!hItem) - return; - CString strCaption = m_pwndPageTree->GetItemText(hItem); - - // if empty page, then update empty page message - if (!bRealPage) - m_pFrame->SetMsgText(GenerateEmptyPageMessage(m_strEmptyPageMessage, strCaption)); - - // if no captions are displayed, cancel here - if (!m_pFrame->GetShowCaption()) - return; - - // get tab control, to the the images from - CTabCtrl *pTabCtrl = GetTabControl(); - if (!IsWindow(pTabCtrl->GetSafeHwnd())) - { - ASSERT(FALSE); - return; - } - - if (m_bTreeImages) - { - // get image from tree - int nImage; - m_pwndPageTree->GetItemImage(hItem, nImage, nImage); - HICON hIcon = m_Images.ExtractIcon(nImage); - m_pFrame->SetCaption(strCaption, hIcon); - if (hIcon) - DestroyIcon(hIcon); - } - else if (bRealPage) - { - // get image from hidden (original) tab provided by the original - // implementation - CImageList *pImages = pTabCtrl->GetImageList(); - if (pImages) - { - TCITEM ti; - ZeroMemory(&ti, sizeof(ti)); - ti.mask = TCIF_IMAGE; - - HICON hIcon = NULL; - if (pTabCtrl->GetItem((int)m_pwndPageTree->GetItemData(hItem), &ti)) - hIcon = pImages->ExtractIcon(ti.iImage); - - m_pFrame->SetCaption(strCaption, hIcon); - if (hIcon) - DestroyIcon(hIcon); - } - else - m_pFrame->SetCaption(strCaption); - } - else - m_pFrame->SetCaption(strCaption); -} - - -void CTreePropSheet::ActivatePreviousPage() -{ - if (!IsWindow(m_hWnd)) - return; - - if (!IsWindow(m_pwndPageTree->GetSafeHwnd())) - { - // normal tab property sheet. Simply use page index - int nPageIndex = GetActiveIndex(); - if (nPageIndex<0 || nPageIndex>=GetPageCount()) - return; - - int nPrevIndex = (nPageIndex==0)? GetPageCount()-1 : nPageIndex-1; - SetActivePage(nPrevIndex); - } - else - { - // property sheet with page tree. - // we need a more sophisticated handling here, than simply using - // the page index, because we won't skip empty pages. - // so we have to walk the page tree - HTREEITEM hItem = m_pwndPageTree->GetSelectedItem(); - ASSERT(hItem); - if (!hItem) - return; - - HTREEITEM hPrevItem = NULL; - if (hPrevItem=m_pwndPageTree->GetPrevSiblingItem(hItem)) - { - while (m_pwndPageTree->ItemHasChildren(hPrevItem)) - { - hPrevItem = m_pwndPageTree->GetChildItem(hPrevItem); - while (m_pwndPageTree->GetNextSiblingItem(hPrevItem)) - hPrevItem = m_pwndPageTree->GetNextSiblingItem(hPrevItem); - } - } - else - hPrevItem=m_pwndPageTree->GetParentItem(hItem); - - if (!hPrevItem) - { - // no prev item, so cycle to the last item - hPrevItem = m_pwndPageTree->GetRootItem(); - - while (TRUE) - { - while (m_pwndPageTree->GetNextSiblingItem(hPrevItem)) - hPrevItem = m_pwndPageTree->GetNextSiblingItem(hPrevItem); - - if (m_pwndPageTree->ItemHasChildren(hPrevItem)) - hPrevItem = m_pwndPageTree->GetChildItem(hPrevItem); - else - break; - } - } - - if (hPrevItem) - m_pwndPageTree->SelectItem(hPrevItem); - } -} - - -void CTreePropSheet::ActivateNextPage() -{ - if (!IsWindow(m_hWnd)) - return; - - if (!IsWindow(m_pwndPageTree->GetSafeHwnd())) - { - // normal tab property sheet. Simply use page index - int nPageIndex = GetActiveIndex(); - if (nPageIndex<0 || nPageIndex>=GetPageCount()) - return; - - int nNextIndex = (nPageIndex==GetPageCount()-1)? 0 : nPageIndex+1; - SetActivePage(nNextIndex); - } - else - { - // property sheet with page tree. - // we need a more sophisticated handling here, than simply using - // the page index, because we won't skip empty pages. - // so we have to walk the page tree - HTREEITEM hItem = m_pwndPageTree->GetSelectedItem(); - ASSERT(hItem); - if (!hItem) - return; - - HTREEITEM hNextItem = NULL; - if (hNextItem=m_pwndPageTree->GetChildItem(hItem)) - ; - else if (hNextItem=m_pwndPageTree->GetNextSiblingItem(hItem)) - ; - else if (m_pwndPageTree->GetParentItem(hItem)) - { - while (!hNextItem) - { - hItem = m_pwndPageTree->GetParentItem(hItem); - if (!hItem) - break; - - hNextItem = m_pwndPageTree->GetNextSiblingItem(hItem); - } - } - - if (!hNextItem) - // no next item -- so cycle to the first item - hNextItem = m_pwndPageTree->GetRootItem(); - - if (hNextItem) - m_pwndPageTree->SelectItem(hNextItem); - } -} - - -///////////////////////////////////////////////////////////////////// -// Overridings - -BOOL CTreePropSheet::OnInitDialog() -{ - if (m_bTreeViewMode) - { - // be sure, there are no stacked tabs, because otherwise the - // page caption will be to large in tree view mode - EnableStackedTabs(FALSE); - - // Initialize image list. - if (m_DefaultImages.GetSafeHandle()) - { - IMAGEINFO ii; - m_DefaultImages.GetImageInfo(0, &ii); - if (ii.hbmImage) DeleteObject(ii.hbmImage); - if (ii.hbmMask) DeleteObject(ii.hbmMask); - m_Images.Create(ii.rcImage.right-ii.rcImage.left, ii.rcImage.bottom-ii.rcImage.top, ILC_COLOR32|ILC_MASK, 0, 1); - } - else - m_Images.Create(16, 16, ILC_COLOR32|ILC_MASK, 0, 1); - } - - // perform default implementation - BOOL bResult = __super::OnInitDialog(); - - if (!m_bTreeViewMode) - // stop here, if we would like to use tabs - return bResult; - - // Get tab control... - CTabCtrl *pTab = GetTabControl(); - if (!IsWindow(pTab->GetSafeHwnd())) - { - ASSERT(FALSE); - return bResult; - } - - // ... and hide it - pTab->ShowWindow(SW_HIDE); - pTab->EnableWindow(FALSE); - - // Place another (empty) tab ctrl, to get a frame instead - CRect rectFrame; - pTab->GetWindowRect(rectFrame); - ScreenToClient(rectFrame); - - m_pFrame = CreatePageFrame(); - if (!m_pFrame) - { - ASSERT(FALSE); - AfxThrowMemoryException(); - } - m_pFrame->Create(WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS, rectFrame, this, 0xFFFF); - m_pFrame->ShowCaption(m_bPageCaption); - - // Lets make place for the tree ctrl - const int nTreeWidth = m_nPageTreeWidth; - const int nTreeSpace = 5; - - CRect rectSheet; - GetWindowRect(rectSheet); - rectSheet.right+= nTreeWidth; - SetWindowPos(NULL, -1, -1, rectSheet.Width(), rectSheet.Height(), SWP_NOZORDER|SWP_NOMOVE); - CenterWindow(); - - MoveChildWindows(nTreeWidth, 0); - - // Lets calculate the rectangle for the tree ctrl - CRect rectTree(rectFrame); - rectTree.right = rectTree.left + nTreeWidth - nTreeSpace; - - // calculate caption height - CTabCtrl wndTabCtrl; - wndTabCtrl.Create(WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS, rectFrame, this, 0x1234); - wndTabCtrl.InsertItem(0, _T("")); - CRect rectFrameCaption; - wndTabCtrl.GetItemRect(0, rectFrameCaption); - wndTabCtrl.DestroyWindow(); - m_pFrame->SetCaptionHeight(rectFrameCaption.Height()); - - // if no caption should be displayed, make the window smaller in - // height - if (!m_bPageCaption) - { - // make frame smaller - m_pFrame->GetWnd()->GetWindowRect(rectFrame); - ScreenToClient(rectFrame); - rectFrame.top+= rectFrameCaption.Height(); - m_pFrame->GetWnd()->MoveWindow(rectFrame); - - // move all child windows up - MoveChildWindows(0, -rectFrameCaption.Height()); - - // modify rectangle for the tree ctrl - rectTree.bottom-= rectFrameCaption.Height(); - - // make us smaller - CRect rect; - GetWindowRect(rect); - rect.top+= rectFrameCaption.Height()/2; - rect.bottom-= rectFrameCaption.Height()-rectFrameCaption.Height()/2; -// if (GetParent()) -// GetParent()->ScreenToClient(rect); - MoveWindow(rect); - } - - // finally create tht tree control - const DWORD dwTreeStyle = TVS_SHOWSELALWAYS|TVS_TRACKSELECT|TVS_HASLINES|TVS_LINESATROOT|TVS_HASBUTTONS; - m_pwndPageTree = CreatePageTreeObject(); - if (!m_pwndPageTree) - { - ASSERT(FALSE); - AfxThrowMemoryException(); - } - - // MFC7-support here (Thanks to Rainer Wollgarten) - #if _MFC_VER >= 0x0700 - { - m_pwndPageTree->CreateEx( - WS_EX_CLIENTEDGE|WS_EX_NOPARENTNOTIFY, - WS_TABSTOP|WS_CHILD|WS_VISIBLE|dwTreeStyle, - rectTree, this, s_unPageTreeId); - } - #else - { - m_pwndPageTree->CreateEx( - WS_EX_CLIENTEDGE|WS_EX_NOPARENTNOTIFY, - _T("SysTreeView32"), _T("PageTree"), - WS_TABSTOP|WS_CHILD|WS_VISIBLE|dwTreeStyle, - rectTree, this, s_unPageTreeId); - } - #endif - - if (m_bTreeImages) - { - m_pwndPageTree->SetImageList(&m_Images, TVSIL_NORMAL); - m_pwndPageTree->SetImageList(&m_Images, TVSIL_STATE); - } - - // Fill the tree ctrl - RefillPageTree(); - - // Select item for the current page - if (pTab->GetCurSel() > -1) - SelectPageTreeItem(pTab->GetCurSel()); - - return bResult; -} - - -void CTreePropSheet::OnDestroy() -{ - __super::OnDestroy(); - - if(m_pwndPageTree && m_pwndPageTree->m_hWnd) - m_pwndPageTree->DestroyWindow(); - - if(m_pFrame && m_pFrame->GetWnd()->m_hWnd) - m_pFrame->GetWnd()->DestroyWindow(); -} - - -LRESULT CTreePropSheet::OnAddPage(WPARAM wParam, LPARAM lParam) -{ - LRESULT lResult = DefWindowProc(PSM_ADDPAGE, wParam, lParam); - if (!m_bTreeViewMode) - return lResult; - - RefillPageTree(); - SelectCurrentPageTreeItem(); - - return lResult; -} - - -LRESULT CTreePropSheet::OnRemovePage(WPARAM wParam, LPARAM lParam) -{ - LRESULT lResult = DefWindowProc(PSM_REMOVEPAGE, wParam, lParam); - if (!m_bTreeViewMode) - return lResult; - - RefillPageTree(); - SelectCurrentPageTreeItem(); - - return lResult; -} - - -LRESULT CTreePropSheet::OnSetCurSel(WPARAM wParam, LPARAM lParam) -{ - LRESULT lResult = DefWindowProc(PSM_SETCURSEL, wParam, lParam); - if (!m_bTreeViewMode) - return lResult; - - SelectCurrentPageTreeItem(); - UpdateCaption(); - return lResult; -} - - -LRESULT CTreePropSheet::OnSetCurSelId(WPARAM wParam, LPARAM lParam) -{ - LRESULT lResult = DefWindowProc(PSM_SETCURSEL, wParam, lParam); - if (!m_bTreeViewMode) - return lResult; - - SelectCurrentPageTreeItem(); - UpdateCaption(); - return lResult; -} - - -void CTreePropSheet::OnPageTreeSelChanging(NMHDR *pNotifyStruct, LRESULT *plResult) -{ - *plResult = 0; - if (m_bPageTreeSelChangedActive) - return; - else - m_bPageTreeSelChangedActive = TRUE; - - NMTREEVIEW *pTvn = reinterpret_cast(pNotifyStruct); - int nPage = m_pwndPageTree->GetItemData(pTvn->itemNew.hItem); - BOOL bResult; - if (nPage<0 || (unsigned)nPage>=m_pwndPageTree->GetCount()) - bResult = KillActiveCurrentPage(); - else - bResult = SetActivePage(nPage); - - if (!bResult) - // prevent selection to change - *plResult = TRUE; - - // Set focus to tree ctrl (I guess that's what the user expects) - m_pwndPageTree->SetFocus(); - - m_bPageTreeSelChangedActive = FALSE; - - return; -} - - -void CTreePropSheet::OnPageTreeSelChanged(NMHDR *pNotifyStruct, LRESULT *plResult) -{ - *plResult = 0; - - UpdateCaption(); - - return; -} - - -LRESULT CTreePropSheet::OnIsDialogMessage(WPARAM wParam, LPARAM lParam) -{ - MSG *pMsg = reinterpret_cast(lParam); - if (pMsg->message==WM_KEYDOWN && pMsg->wParam==VK_TAB && GetKeyState(VK_CONTROL)&0x8000) - { - if (GetKeyState(VK_SHIFT)&0x8000) - ActivatePreviousPage(); - else - ActivateNextPage(); - return TRUE; - } - - - return __super::DefWindowProc(PSM_ISDIALOGMESSAGE, wParam, lParam); -} - -} //namespace TreePropSheet diff --git a/src/ui/TreePropSheet/TreePropSheet.h b/src/ui/TreePropSheet/TreePropSheet.h deleted file mode 100644 index ba98a396e..000000000 --- a/src/ui/TreePropSheet/TreePropSheet.h +++ /dev/null @@ -1,483 +0,0 @@ -/******************************************************************** -* -* Copyright (c) 2002 Sven Wiegand -* -* You can use this and modify this in any way you want, -* BUT LEAVE THIS HEADER INTACT. -* -* Redistribution is appreciated. -* -* $Workfile:$ -* $Revision: 126 $ -* $Modtime:$ -* $Author: gabest $ -* -* Revision History: -* $History:$ -* -*********************************************************************/ - - -#if !defined(AFX_TREEPROPSHEET_H__50695CFB_FCE4_4188_ADB4_BF05A5488E41__INCLUDED_) -#define AFX_TREEPROPSHEET_H__50695CFB_FCE4_4188_ADB4_BF05A5488E41__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - -#include "PropPageFrame.h" -#include -#include -#include - -namespace TreePropSheet -{ - -/** -A property sheet, which can use a tree control instead of a tab -control, to give the user access to the different pages. - -You can use it exactly the same way, as a CPropertySheet object. -Simply create CPropertyPage objects and add them via AddPage() to -the sheet. If you would like to use the tree view mode (default), -you can specify the path of the pages in the tree, by their name: -The names of the pages can contain -double colons ("::"), which will specify the path of that page in the -tree control. I.e. if you have three pages with the following names: -1. _T("Appearance::Toolbars") -2. _T("Appearance::Menus") -3. _T("Directories") -the tree would look as follow: -\verbatim -Appearance -| -+-Toolbars -| -+-Menus - -Directories -\endverbatim -If you would like to use a double colon, which should not be -interpreted as a path seperator, prefix it with a backslash ("\\::"). - -To disable tree view mode and use the standard tabbed mode, call -the SetTreeViewMode() method. This also allows you, to enable page -captions and tree images for tree view mode. If you would like to -have images in the tree, but not all of your pages specify images or -there are tree view items, which are not attached to a page (only -parent items for real page items), you have to set default images -using the SetTreeDefaultImages() method -- otherwise their may appear -display errors. - -If the user selects a tree view item, which does not belong to a page, -because it is just a parent item for real page items, no page will -be displayed, instead a message will be displayed, that can be set -via SetEmptyPageText(). - -@author Sven Wiegand -*/ - -class /*AFX_EXT_CLASS*/ CTreePropSheet : public CPropertySheet -{ - DECLARE_DYNAMIC(CTreePropSheet) - -// Construction/Destruction -public: - CTreePropSheet(); - CTreePropSheet(UINT nIDCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0); - CTreePropSheet(LPCTSTR pszCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0); - virtual ~CTreePropSheet(); - -// Operations -public: - /** - Call this method, if you would like to use a tree control to browse - the pages, instead of the tab control. - - This method needs to becalled, before DoModal() or Create(). If the - window has already been created, the method will fail. - - @param bTreeViewMode - Pass TRUE to provide a tree view control instead of a tab control - to browse the pages, pass FALSE to use the normal tab control. - @param bPageCaption - TRUE if a caption should be displayed for each page. The caption - contains the page title and an icon if specified with the page. - Ignored if bTreeViewMode is FALSE. - @param bTreeImages - TRUE if the page icons should be displayed in the page tree, - FALSE if there should be no icons in the page tree. Ignored if - bTreeViewMode is FALSE. If not all of your pages are containing - icons, or if there will be empty pages (parent nodes without a - related page, you need to call SetTreeDefaultImages() to avoid - display errors. - - @return - TRUE on success or FALSE, if the window has already been created. - */ - BOOL SetTreeViewMode(BOOL bTreeViewMode = TRUE, BOOL bPageCaption = FALSE, BOOL bTreeImages = FALSE); - - /** - Specifies the width of the tree control, when the sheet is in tree - view mode. The default value (if this method is not called) is 150 - pixels. - - This method needs to be called, before DoModeal() or Create(). - Otherwise it will fail. - - @param nWidth - The width in pixels for the page tree. - - @return - TRUE on success, FALSE otherwise (if the window has already been - created). - */ - BOOL SetTreeWidth(int nWidth); - - /** - Specifies the text to be drawn on empty pages (pages for tree view - items, that are not related to a page, because they are only - parents for other items). This is only needed in tree view mode. - - The specified text can contains a single "%s" placeholder which - will be replaced with the title of the empty page. - */ - void SetEmptyPageText(LPCTSTR lpszEmptyPageText); - - /** - Allows you to specify, how the empty page message (see - SetEmptyPageText()) should be drawn. - - @param dwFormat - A combination of the DT_* flags available for the Win32-API - function DrawText(), that should be used to draw the text. - The default value is: - \code - DT_CENTER|DT_VCENTER|DT_NOPREFIX|DT_SINGLELINE - \endcode - - @return - The previous format. - */ - DWORD SetEmptyPageTextFormat(DWORD dwFormat); - - //@{ - /** - Defines the images, that should be used for pages without icons and - for empty parent nodes. The list contains exactly to images: - 1. An image that should be used for parent tree nodes, without a - page asignd. - 2. An image that should be used for pages, which are not specifying - any icons. - Standard image size is 16x16 Pixels, but if you call this method - before creating the sheet, the size of image 0 in this list will - be assumed as your preferred image size and all other icons must - have the same size. - - @param pImages - Pointer to an image list with exactly to images, that should be - used as default images. The images are copied to an internal - list, so that the given list can be deleted after this call. - @param unBitmapID - Resource identifier for the bitmap, that contains the default - images. The resource should contain exactly to images. - @param cx - Width of a singe image in pixels. - @param crMask - Color that should be interpreted as transparent. - - @return - TRUE on success, FALSE otherwise. - */ - BOOL SetTreeDefaultImages(CImageList *pImages); - BOOL SetTreeDefaultImages(UINT unBitmapID, int cx, COLORREF crMask); - //@} - - /** - Returns a pointer to the tree control, when the sheet is in - tree view mode, NULL otherwise. - */ - CTreeCtrl* GetPageTreeControl(); - -// Public helpers -public: - //@{ - /** - This helper allows you to easily set the icon of a property page. - - This static method does nothing more, than extracting the specified - image as an icon from the given image list and assign the - icon-handle to the hIcon property of the pages PROPSHEETPAGE - structure (m_psp) and modify the structures flags, so that the - image will be recognized. - - You need to call this method for a page, before adding the page - to a property sheet. - - @important - If you are using the CImageList-version, you are responsible for - destroying the extracted icon with DestroyIcon() or the static - DestroyPageIcon() method. - - @see DestroyPageIcon() - - @param pPage - Property page to set the image for. - @param hIcon - Handle to icon that should be set for the page. - @param unIconId - Ressource identifier for the icon to set. - @param Images - Reference of the image list to extract the icon from. - @param nImage - Zero based index of the image in pImages, that should be used - as an icon. - - @return - TRUE on success, FALSE if an error occured. - */ - static BOOL SetPageIcon(CPropertyPage *pPage, HICON hIcon); - static BOOL SetPageIcon(CPropertyPage *pPage, UINT unIconId); - static BOOL SetPageIcon(CPropertyPage *pPage, CImageList &Images, int nImage); - //@} - - /** - Checks, if the PSP_USEHICON flag is set in the PROPSHEETPAGE struct; - If this is the case, the flag will be removed and the icon - specified by the hIcon attribute of the PROPSHEETPAGE struct will - be destroyed using DestroyIcon(). - - @note - You only have to call DestroyIcon() for icons, that have been - created using CreateIconIndirect() (i.e. used by - CImageList::ExtractIcon()). - - @return - TRUE on success, FALSE if the PSP_USEHICON flag was not set or - if the icon handle was NULL. - */ - static BOOL DestroyPageIcon(CPropertyPage *pPage); - -// Overridable implementation helpers -protected: - /** - Will be called to generate the message, that should be displayed on - an empty page, when the sheet is in tree view mode - - This default implementation simply returns lpszEmptyPageMessage - with the optional "%s" placeholder replaced by lpszCaption. - - @param lpszEmptyPageMessage - The string, set by SetEmptyPageMessage(). This string may contain - a "%s" placeholder. - @param lpszCaption - The title of the empty page. - */ - virtual CString GenerateEmptyPageMessage(LPCTSTR lpszEmptyPageMessage, LPCTSTR lpszCaption); - - /** - Will be called during creation process, to create the CTreeCtrl - object (the object, not the window!). - - Allows you to inject your own CTreeCtrl-derived classes. - - This default implementation simply creates a CTreeCtrl with new - and returns it. - */ - virtual CTreeCtrl* CreatePageTreeObject(); - - /** - Will be called during creation process, to create the object, that - is responsible for drawing the frame around the pages, drawing the - empty page message and the caption. - - Allows you to inject your own CPropPageFrame-derived classes. - - This default implementation simply creates a CPropPageFrameTab with - new and returns it. - */ - virtual CPropPageFrame* CreatePageFrame(); - -// Implementation helpers -protected: - /** - Moves all childs by the specified amount of pixels. - - @param nDx - Pixels to move the childs in horizontal direction (can be - negative). - @param nDy - Pixels to move the childs in vertical direction (can be - negative). - */ - void MoveChildWindows(int nDx, int nDy); - - /** - Refills the tree that contains the entries for the several pages. - */ - void RefillPageTree(); - - /** - Creates the specified path in the page tree and returns the handle - of the most child item created. - - @param lpszPath - Path of the item to create (see description of this class). - @param hParentItem - Handle of the item under which the path should be created or - TVI_ROOT to start from the root. - */ - HTREEITEM CreatePageTreeItem(LPCTSTR lpszPath, HTREEITEM hParent = TVI_ROOT); - - /** - Splits the given path into the topmost item and the rest. See - description of this class for detailed path information. - - I.e. when given the string "Appearance::Toolbars::Customize", the - method will return "Appearance" and after the call strRest will - be "Toolbars::Customize". - */ - CString SplitPageTreePath(CString &strRest); - - /** - Tries to deactivate the current page, and hides it if successfull, - so that an empty page becomes visible. - - @return - TRUE if the current page has been deactivated successfully, - FALSE if the currently active page prevents a page change. - */ - BOOL KillActiveCurrentPage(); - - /** - Returns the page tree item, that representates the specified page - or NULL, if no such icon exists. - - @param nPage - Zero based page index, for which the item to retrieve. - @param hRoot - Item to start the search at or TVI_ROOT to search the whole - tree. - */ - HTREEITEM GetPageTreeItem(int nPage, HTREEITEM hRoot = TVI_ROOT); - - /** - Selects and shows the item, representing the specified page. - - @param nPage - Zero based page index. - - @return - TRUE on success, FALSE if no item does exist for the specified - page. - */ - BOOL SelectPageTreeItem(int nPage); - - /** - Selects and shows the tree item for the currently active page. - - @return - TRUE on success, FALSE if no item exists for the currently active - page or if it was not possible to get information about the - currently active page. - */ - BOOL SelectCurrentPageTreeItem(); - - /** - Updates the caption for the currently selected page (if the caption - is enabled). - */ - void UpdateCaption(); - - /** - Activates the previous page in the page order or the last one, if - the current one is the first. - - This method does never fail. - */ - void ActivatePreviousPage(); - - /** - Activates the next page in the page order or the first one, if the - current one is the last. - - This method does never fail. - */ - void ActivateNextPage(); - -// Overridings -protected: - //{{AFX_VIRTUAL(CTreePropSheet) - public: - virtual BOOL OnInitDialog(); - //}}AFX_VIRTUAL - -// Message handlers -protected: - //{{AFX_MSG(CTreePropSheet) - afx_msg void OnDestroy(); - //}}AFX_MSG - afx_msg LRESULT OnAddPage(WPARAM wParam, LPARAM lParam); - afx_msg LRESULT OnRemovePage(WPARAM wParam, LPARAM lParam); - afx_msg LRESULT OnSetCurSel(WPARAM wParam, LPARAM lParam); - afx_msg LRESULT OnSetCurSelId(WPARAM wParam, LPARAM lParam); - afx_msg LRESULT OnIsDialogMessage(WPARAM wParam, LPARAM lParam); - - afx_msg void OnPageTreeSelChanging(NMHDR *pNotifyStruct, LRESULT *plResult); - afx_msg void OnPageTreeSelChanged(NMHDR *pNotifyStruct, LRESULT *plResult); - DECLARE_MESSAGE_MAP() - -// Properties -private: - /** TRUE if we should use the tree control instead of the tab ctrl. */ - BOOL m_bTreeViewMode; - - /** The tree control */ - CTreeCtrl *m_pwndPageTree; - - /** The frame around the pages */ - CPropPageFrame *m_pFrame; - - /** - TRUE, if a tree item selection by OnPageTreeSelChanged() is - performed currently. - */ - BOOL m_bPageTreeSelChangedActive; - - /** TRUE if a page caption should be displayed, FALSE otherwise. */ - BOOL m_bPageCaption; - - /** TRUE if images should be displayed in the tree. */ - BOOL m_bTreeImages; - - /** Images to be displayed in the tree control. */ - CImageList m_Images; - - /** Default images. */ - CImageList m_DefaultImages; - - /** - Message to be displayed on empty pages. May contain a "%s" - placeholder which will be replaced by the caption of the empty - page. - */ - CString m_strEmptyPageMessage; - - /** The width of the page tree control in pixels. */ - int m_nPageTreeWidth; - -// Static Properties -private: - /** The id of the tree view control, that shows the pages. */ - static const UINT s_unPageTreeId; -}; - - -} //namespace TreePropSheet - -///////////////////////////////////////////////////////////////////////////// - -//{{AFX_INSERT_LOCATION}} -// Microsoft Visual C++ fügt unmittelbar vor der vorhergehenden Zeile zusätzliche Deklarationen ein. - -#endif // AFX_TREEPROPSHEET_H__50695CFB_FCE4_4188_ADB4_BF05A5488E41__INCLUDED_ diff --git a/src/ui/TreePropSheet/TreePropSheet.sln b/src/ui/TreePropSheet/TreePropSheet.sln deleted file mode 100644 index ddaa4f48e..000000000 --- a/src/ui/TreePropSheet/TreePropSheet.sln +++ /dev/null @@ -1,27 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TreePropSheet", "TreePropSheet.vcproj", "{AB494732-EF6D-44D0-BCF8-80FF04858D10}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Debug Unicode = Debug Unicode - Release = Release - Release Unicode = Release Unicode - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Debug.ActiveCfg = Debug|Win32 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Debug.Build.0 = Debug|Win32 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Debug Unicode.ActiveCfg = Debug Unicode|Win32 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Debug Unicode.Build.0 = Debug Unicode|Win32 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Release.ActiveCfg = Release|Win32 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Release.Build.0 = Release|Win32 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Release Unicode.ActiveCfg = Release Unicode|Win32 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Release Unicode.Build.0 = Release Unicode|Win32 - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/src/ui/TreePropSheet/TreePropSheet.vcproj b/src/ui/TreePropSheet/TreePropSheet.vcproj deleted file mode 100644 index efb97df39..000000000 --- a/src/ui/TreePropSheet/TreePropSheet.vcproj +++ /dev/null @@ -1,260 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/ui/TreePropSheet/TreePropSheet_vs2005.sln b/src/ui/TreePropSheet/TreePropSheet_vs2005.sln deleted file mode 100644 index b134ba275..000000000 --- a/src/ui/TreePropSheet/TreePropSheet_vs2005.sln +++ /dev/null @@ -1,25 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TreePropSheet", "TreePropSheet_vs2005.vcproj", "{AB494732-EF6D-44D0-BCF8-80FF04858D10}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug Unicode|Win32 = Debug Unicode|Win32 - Debug|Win32 = Debug|Win32 - Release Unicode|Win32 = Release Unicode|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Debug|Win32.ActiveCfg = Debug|Win32 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Debug|Win32.Build.0 = Debug|Win32 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Release Unicode|Win32.Build.0 = Release Unicode|Win32 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Release|Win32.ActiveCfg = Release|Win32 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/ui/TreePropSheet/TreePropSheet_vs2005.vcproj b/src/ui/TreePropSheet/TreePropSheet_vs2005.vcproj deleted file mode 100644 index 10aa66126..000000000 --- a/src/ui/TreePropSheet/TreePropSheet_vs2005.vcproj +++ /dev/null @@ -1,328 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/ui/TreePropSheet/TreePropSheet_vs2008.vcproj b/src/ui/TreePropSheet/TreePropSheet_vs2008.vcproj deleted file mode 100644 index 9e59acade..000000000 --- a/src/ui/TreePropSheet/TreePropSheet_vs2008.vcproj +++ /dev/null @@ -1,329 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/ui/TreePropSheet/stdafx.cpp b/src/ui/TreePropSheet/stdafx.cpp deleted file mode 100644 index a3364a6bc..000000000 --- a/src/ui/TreePropSheet/stdafx.cpp +++ /dev/null @@ -1,8 +0,0 @@ -// stdafx.cpp : source file that includes just the standard includes -// TreePropSheet.pch will be the pre-compiled header -// stdafx.obj will contain the pre-compiled type information - -#include "stdafx.h" - -// TODO: reference any additional headers you need in STDAFX.H -// and not in this file diff --git a/src/ui/TreePropSheet/stdafx.h b/src/ui/TreePropSheet/stdafx.h deleted file mode 100644 index 58101e98b..000000000 --- a/src/ui/TreePropSheet/stdafx.h +++ /dev/null @@ -1,18 +0,0 @@ -// stdafx.h : include file for standard system include files, -// or project specific include files that are used frequently, but -// are changed infrequently -// - -#pragma once - -#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers -#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit - -#ifndef VC_EXTRALEAN -#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers -#endif - -#include -#include // MFC core and standard components - -// TODO: reference additional headers your program requires here diff --git a/src/ui/sizecbar/scbarcf.cpp b/src/ui/sizecbar/scbarcf.cpp deleted file mode 100644 index 776555c15..000000000 --- a/src/ui/sizecbar/scbarcf.cpp +++ /dev/null @@ -1,234 +0,0 @@ -///////////////////////////////////////////////////////////////////////// -// -// CSizingControlBarCF Version 2.43 -// -// Created: Dec 21, 1998 Last Modified: August 03, 2000 -// -// See the official site at www.datamekanix.com for documentation and -// the latest news. -// -///////////////////////////////////////////////////////////////////////// -// Copyright (C) 1998-2000 by Cristi Posea. All rights reserved. -// -// This code is free for personal and commercial use, providing this -// notice remains intact in the source files and all eventual changes are -// clearly marked with comments. -// -// You must obtain the author's consent before you can include this code -// in a software library. -// -// No warrantee of any kind, express or implied, is included with this -// software; use at your own risk, responsibility for damages (if any) to -// anyone resulting from the use of this software rests entirely with the -// user. -// -// Send bug reports, bug fixes, enhancements, requests, flames, etc. to -// cristi@datamekanix.com or post them at the message board at the site. -///////////////////////////////////////////////////////////////////////// - -#include "stdafx.h" -#include "scbarcf.h" - -///////////////////////////////////////////////////////////////////////// -// CSizingControlBarCF - -IMPLEMENT_DYNAMIC(CSizingControlBarCF, baseCSizingControlBarCF); - -int CALLBACK EnumFontFamProc(ENUMLOGFONT FAR *lpelf, - NEWTEXTMETRIC FAR *lpntm, - int FontType, - LPARAM lParam) -{ - UNUSED_ALWAYS(lpelf); - UNUSED_ALWAYS(lpntm); - UNUSED_ALWAYS(FontType); - UNUSED_ALWAYS(lParam); - - return 0; -} - -CSizingControlBarCF::CSizingControlBarCF() -{ - m_bActive = FALSE; - - CDC dc; - dc.CreateCompatibleDC(NULL); - - m_sFontFace = (::EnumFontFamilies(dc.m_hDC, - _T("Tahoma"), (FONTENUMPROC) EnumFontFamProc, 0) == 0) ? - _T("Tahoma") : _T("Arial"); - - dc.DeleteDC(); - -} - -BEGIN_MESSAGE_MAP(CSizingControlBarCF, baseCSizingControlBarCF) - //{{AFX_MSG_MAP(CSizingControlBarCF) - //}}AFX_MSG_MAP - ON_MESSAGE(WM_SETTEXT, OnSetText) -END_MESSAGE_MAP() - -void CSizingControlBarCF::OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler) -{ - baseCSizingControlBarCF::OnUpdateCmdUI(pTarget, bDisableIfNoHndler); - - if (!HasGripper()) - return; - - BOOL bNeedPaint = FALSE; - - CWnd* pFocus = GetFocus(); - BOOL bActiveOld = m_bActive; - - m_bActive = (pFocus->GetSafeHwnd() && IsChild(pFocus)); - - if (m_bActive != bActiveOld) - bNeedPaint = TRUE; - - if (bNeedPaint) - SendMessage(WM_NCPAINT); -} - -// gradient defines (if not already defined) -#ifndef COLOR_GRADIENTACTIVECAPTION -#define COLOR_GRADIENTACTIVECAPTION 27 -#define COLOR_GRADIENTINACTIVECAPTION 28 -#define SPI_GETGRADIENTCAPTIONS 0x1008 -#endif - -void CSizingControlBarCF::NcPaintGripper(CDC* pDC, CRect rcClient) -{ - if (!HasGripper()) - return; - - // compute the caption rectangle - BOOL bHorz = IsHorzDocked(); - CRect rcGrip = rcClient; - CRect rcBtn = m_biHide.GetRect(); - if (bHorz) - { // right side gripper - rcGrip.left -= m_cyGripper + 1; - rcGrip.right = rcGrip.left + 11; - rcGrip.top = rcBtn.bottom + 3; - } - else - { // gripper at top - rcGrip.top -= m_cyGripper + 1; - rcGrip.bottom = rcGrip.top + 11; - rcGrip.right = rcBtn.left - 3; - } - rcGrip.InflateRect(bHorz ? 1 : 0, bHorz ? 0 : 1); - - // draw the caption background - //CBrush br; - COLORREF clrCptn = m_bActive ? - ::GetSysColor(COLOR_ACTIVECAPTION) : - ::GetSysColor(COLOR_INACTIVECAPTION); - - // query gradient info (usually TRUE for Win98/Win2k) - BOOL bGradient = FALSE; - ::SystemParametersInfo(SPI_GETGRADIENTCAPTIONS, 0, &bGradient, 0); - - if (!bGradient) - pDC->FillSolidRect(&rcGrip, clrCptn); // solid color - else - { - // gradient from left to right or from bottom to top - // get second gradient color (the right end) - COLORREF clrCptnRight = m_bActive ? - ::GetSysColor(COLOR_GRADIENTACTIVECAPTION) : - ::GetSysColor(COLOR_GRADIENTINACTIVECAPTION); - - // this will make 2^6 = 64 fountain steps - int nShift = 6; - int nSteps = 1 << nShift; - - for (int i = 0; i < nSteps; i++) - { - // do a little alpha blending - int nR = (GetRValue(clrCptn) * (nSteps - i) + - GetRValue(clrCptnRight) * i) >> nShift; - int nG = (GetGValue(clrCptn) * (nSteps - i) + - GetGValue(clrCptnRight) * i) >> nShift; - int nB = (GetBValue(clrCptn) * (nSteps - i) + - GetBValue(clrCptnRight) * i) >> nShift; - - COLORREF cr = RGB(nR, nG, nB); - - // then paint with the resulting color - CRect r2 = rcGrip; - if (bHorz) - { - r2.bottom = rcGrip.bottom - - ((i * rcGrip.Height()) >> nShift); - r2.top = rcGrip.bottom - - (((i + 1) * rcGrip.Height()) >> nShift); - if (r2.Height() > 0) - pDC->FillSolidRect(r2, cr); - } - else - { - r2.left = rcGrip.left + - ((i * rcGrip.Width()) >> nShift); - r2.right = rcGrip.left + - (((i + 1) * rcGrip.Width()) >> nShift); - if (r2.Width() > 0) - pDC->FillSolidRect(r2, cr); - } - } - } - - // draw the caption text - first select a font - CFont font; - int ppi = pDC->GetDeviceCaps(LOGPIXELSX); - int pointsize = MulDiv(85, 96, ppi); // 8.5 points at 96 ppi - - LOGFONT lf; - BOOL bFont = font.CreatePointFont(pointsize, m_sFontFace); - if (bFont) - { - // get the text color - COLORREF clrCptnText = m_bActive ? - ::GetSysColor(COLOR_CAPTIONTEXT) : - ::GetSysColor(COLOR_INACTIVECAPTIONTEXT); - - int nOldBkMode = pDC->SetBkMode(TRANSPARENT); - COLORREF clrOldText = pDC->SetTextColor(clrCptnText); - - if (bHorz) - { - // rotate text 90 degrees CCW if horizontally docked - font.GetLogFont(&lf); - font.DeleteObject(); - lf.lfEscapement = 900; - font.CreateFontIndirect(&lf); - } - - CFont* pOldFont = pDC->SelectObject(&font); - CString sTitle; - GetWindowText(sTitle); - - CPoint ptOrg = bHorz ? - CPoint(rcGrip.left - 1, rcGrip.bottom - 3) : - CPoint(rcGrip.left + 3, rcGrip.top - 1); - - pDC->ExtTextOut(ptOrg.x, ptOrg.y, - ETO_CLIPPED, rcGrip, sTitle, NULL); - - pDC->SelectObject(pOldFont); - pDC->SetBkMode(nOldBkMode); - pDC->SetTextColor(clrOldText); - } - - // draw the button - m_biHide.Paint(pDC); -} - -LRESULT CSizingControlBarCF::OnSetText(WPARAM wParam, LPARAM lParam) -{ - LRESULT lResult = baseCSizingControlBarCF::OnSetText(wParam, lParam); - - SendMessage(WM_NCPAINT); - - return lResult; -} diff --git a/src/ui/sizecbar/scbarcf.h b/src/ui/sizecbar/scbarcf.h deleted file mode 100644 index 3fb36bfcf..000000000 --- a/src/ui/sizecbar/scbarcf.h +++ /dev/null @@ -1,78 +0,0 @@ -///////////////////////////////////////////////////////////////////////// -// -// CSizingControlBarCF Version 2.43 -// -// Created: Dec 21, 1998 Last Modified: August 03, 2000 -// -// See the official site at www.datamekanix.com for documentation and -// the latest news. -// -///////////////////////////////////////////////////////////////////////// -// Copyright (C) 1998-2000 by Cristi Posea. All rights reserved. -// -// This code is free for personal and commercial use, providing this -// notice remains intact in the source files and all eventual changes are -// clearly marked with comments. -// -// You must obtain the author's consent before you can include this code -// in a software library. -// -// No warrantee of any kind, express or implied, is included with this -// software; use at your own risk, responsibility for damages (if any) to -// anyone resulting from the use of this software rests entirely with the -// user. -// -// Send bug reports, bug fixes, enhancements, requests, flames, etc. to -// cristi@datamekanix.com or post them at the message board at the site. -///////////////////////////////////////////////////////////////////////// - -#if !defined(__SCBARCF_H__) -#define __SCBARCF_H__ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 -// scbarcf.h : header file -// - -#include "scbarg.h" - -///////////////////////////////////////////////////////////////////////// -// CSizingControlBarCF - -#ifndef baseCSizingControlBarCF -#define baseCSizingControlBarCF CSizingControlBarG -#endif - -class CSizingControlBarCF : public baseCSizingControlBarCF -{ - DECLARE_DYNAMIC(CSizingControlBarCF) - -// Construction -public: - CSizingControlBarCF(); - -// Overridables - virtual void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler); - -// Implementation -protected: - // implementation helpers - virtual void NcPaintGripper(CDC* pDC, CRect rcClient); - -protected: - BOOL m_bActive; // a child has focus - CString m_sFontFace; - -// Generated message map functions -protected: - //{{AFX_MSG(CSizingControlBarCF) - //}}AFX_MSG - afx_msg LRESULT OnSetText(WPARAM wParam, LPARAM lParam); - - DECLARE_MESSAGE_MAP() -}; - -///////////////////////////////////////////////////////////////////////// - -#endif // !defined(__SCBARCF_H__) diff --git a/src/ui/sizecbar/scbarg.cpp b/src/ui/sizecbar/scbarg.cpp deleted file mode 100644 index 982fbddc1..000000000 --- a/src/ui/sizecbar/scbarg.cpp +++ /dev/null @@ -1,242 +0,0 @@ -///////////////////////////////////////////////////////////////////////// -// -// CSizingControlBarG Version 2.43 -// -// Created: Jan 24, 1998 Last Modified: August 03, 2000 -// -// See the official site at www.datamekanix.com for documentation and -// the latest news. -// -///////////////////////////////////////////////////////////////////////// -// Copyright (C) 1998-2000 by Cristi Posea. All rights reserved. -// -// This code is free for personal and commercial use, providing this -// notice remains intact in the source files and all eventual changes are -// clearly marked with comments. -// -// You must obtain the author's consent before you can include this code -// in a software library. -// -// No warrantee of any kind, express or implied, is included with this -// software; use at your own risk, responsibility for damages (if any) to -// anyone resulting from the use of this software rests entirely with the -// user. -// -// Send bug reports, bug fixes, enhancements, requests, flames, etc. to -// cristi@datamekanix.com or post them at the message board at the site. -///////////////////////////////////////////////////////////////////////// - -// sizecbar.cpp : implementation file -// - -#include "stdafx.h" - -#include "scbarg.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////// -// CSizingControlBarG - -IMPLEMENT_DYNAMIC(CSizingControlBarG, baseCSizingControlBarG); - -CSizingControlBarG::CSizingControlBarG() -{ - m_cyGripper = 12; -} - -CSizingControlBarG::~CSizingControlBarG() -{ -} - -BEGIN_MESSAGE_MAP(CSizingControlBarG, baseCSizingControlBarG) - //{{AFX_MSG_MAP(CSizingControlBarG) - ON_WM_NCLBUTTONUP() - ON_WM_NCHITTEST() - //}}AFX_MSG_MAP - ON_MESSAGE(WM_SETTEXT, OnSetText) -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////// -// CSizingControlBarG message handlers - -///////////////////////////////////////////////////////////////////////// -// Mouse Handling -// - -void CSizingControlBarG::OnNcLButtonUp(UINT nHitTest, CPoint point) -{ - if (nHitTest == HTCLOSE) - m_pDockSite->ShowControlBar(this, FALSE, FALSE); // hide - - baseCSizingControlBarG::OnNcLButtonUp(nHitTest, point); -} - -void CSizingControlBarG::NcCalcClient(LPRECT pRc, UINT nDockBarID) -{ - CRect rcBar(pRc); // save the bar rect - - // subtract edges - baseCSizingControlBarG::NcCalcClient(pRc, nDockBarID); - - if (!HasGripper()) - return; - - CRect rc(pRc); // the client rect as calculated by the base class - - BOOL bHorz = (nDockBarID == AFX_IDW_DOCKBAR_TOP) || - (nDockBarID == AFX_IDW_DOCKBAR_BOTTOM); - - if (bHorz) - rc.DeflateRect(m_cyGripper, 0, 0, 0); - else - rc.DeflateRect(0, m_cyGripper, 0, 0); - - // set position for the "x" (hide bar) button - CPoint ptOrgBtn; - if (bHorz) - ptOrgBtn = CPoint(rc.left - 13, rc.top); - else - ptOrgBtn = CPoint(rc.right - 12, rc.top - 13); - - m_biHide.Move(ptOrgBtn - rcBar.TopLeft()); - - *pRc = rc; -} - -void CSizingControlBarG::NcPaintGripper(CDC* pDC, CRect rcClient) -{ - if (!HasGripper()) - return; - - // paints a simple "two raised lines" gripper - // override this if you want a more sophisticated gripper - CRect gripper = rcClient; - CRect rcbtn = m_biHide.GetRect(); - BOOL bHorz = IsHorzDocked(); - - gripper.DeflateRect(1, 1); - if (bHorz) - { // gripper at left - gripper.left -= m_cyGripper; - gripper.right = gripper.left + 3; - gripper.top = rcbtn.bottom + 3; - } - else - { // gripper at top - gripper.top -= m_cyGripper; - gripper.bottom = gripper.top + 3; - gripper.right = rcbtn.left - 3; - } - - pDC->Draw3dRect(gripper, ::GetSysColor(COLOR_BTNHIGHLIGHT), - ::GetSysColor(COLOR_BTNSHADOW)); - - gripper.OffsetRect(bHorz ? 3 : 0, bHorz ? 0 : 3); - - pDC->Draw3dRect(gripper, ::GetSysColor(COLOR_BTNHIGHLIGHT), - ::GetSysColor(COLOR_BTNSHADOW)); - - m_biHide.Paint(pDC); -} - -HITTEST_RET CSizingControlBarG::OnNcHitTest(CPoint point) -{ - CRect rcBar; - GetWindowRect(rcBar); - - LRESULT nRet = baseCSizingControlBarG::OnNcHitTest(point); - if (nRet != HTCLIENT) - return nRet; - - CRect rc = m_biHide.GetRect(); - rc.OffsetRect(rcBar.TopLeft()); - if (rc.PtInRect(point)) - return HTCLOSE; - - return HTCLIENT; -} - -///////////////////////////////////////////////////////////////////////// -// CSizingControlBarG implementation helpers - -void CSizingControlBarG::OnUpdateCmdUI(CFrameWnd* pTarget, - BOOL bDisableIfNoHndler) -{ - UNUSED_ALWAYS(bDisableIfNoHndler); - UNUSED_ALWAYS(pTarget); - - if (!HasGripper()) - return; - - BOOL bNeedPaint = FALSE; - - CPoint pt; - ::GetCursorPos(&pt); - BOOL bHit = (OnNcHitTest(pt) == HTCLOSE); - BOOL bLButtonDown = (::GetKeyState(VK_LBUTTON) < 0); - - BOOL bWasPushed = m_biHide.bPushed; - m_biHide.bPushed = bHit && bLButtonDown; - - BOOL bWasRaised = m_biHide.bRaised; - m_biHide.bRaised = bHit && !bLButtonDown; - - bNeedPaint |= (m_biHide.bPushed ^ bWasPushed) || - (m_biHide.bRaised ^ bWasRaised); - - if (bNeedPaint) - SendMessage(WM_NCPAINT); -} - -///////////////////////////////////////////////////////////////////////// -// CSCBButton - -CSCBButton::CSCBButton() -{ - bRaised = FALSE; - bPushed = FALSE; -} - -void CSCBButton::Paint(CDC* pDC) -{ - CRect rc = GetRect(); - - if (bPushed) - pDC->Draw3dRect(rc, ::GetSysColor(COLOR_BTNSHADOW), - ::GetSysColor(COLOR_BTNHIGHLIGHT)); - else - if (bRaised) - pDC->Draw3dRect(rc, ::GetSysColor(COLOR_BTNHIGHLIGHT), - ::GetSysColor(COLOR_BTNSHADOW)); - - COLORREF clrOldTextColor = pDC->GetTextColor(); - pDC->SetTextColor(::GetSysColor(COLOR_BTNTEXT)); - int nPrevBkMode = pDC->SetBkMode(TRANSPARENT); - CFont font; - int ppi = pDC->GetDeviceCaps(LOGPIXELSX); - int pointsize = MulDiv(60, 96, ppi); // 6 points at 96 ppi - font.CreatePointFont(pointsize, _T("Marlett")); - CFont* oldfont = pDC->SelectObject(&font); - - pDC->TextOut(ptOrg.x + 2, ptOrg.y + 2, CString(_T("r"))); // x-like - - pDC->SelectObject(oldfont); - pDC->SetBkMode(nPrevBkMode); - pDC->SetTextColor(clrOldTextColor); -} - -BOOL CSizingControlBarG::HasGripper() const -{ -#if defined(_SCB_MINIFRAME_CAPTION) || !defined(_SCB_REPLACE_MINIFRAME) - // if the miniframe has a caption, don't display the gripper - if (IsFloating()) - return FALSE; -#endif //_SCB_MINIFRAME_CAPTION - - return TRUE; -} diff --git a/src/ui/sizecbar/scbarg.h b/src/ui/sizecbar/scbarg.h deleted file mode 100644 index 03f1284c8..000000000 --- a/src/ui/sizecbar/scbarg.h +++ /dev/null @@ -1,114 +0,0 @@ -///////////////////////////////////////////////////////////////////////// -// -// CSizingControlBarG Version 2.43 -// -// Created: Jan 24, 1998 Last Modified: August 03, 2000 -// -// See the official site at www.datamekanix.com for documentation and -// the latest news. -// -///////////////////////////////////////////////////////////////////////// -// Copyright (C) 1998-2000 by Cristi Posea. All rights reserved. -// -// This code is free for personal and commercial use, providing this -// notice remains intact in the source files and all eventual changes are -// clearly marked with comments. -// -// You must obtain the author's consent before you can include this code -// in a software library. -// -// No warrantee of any kind, express or implied, is included with this -// software; use at your own risk, responsibility for damages (if any) to -// anyone resulting from the use of this software rests entirely with the -// user. -// -// Send bug reports, bug fixes, enhancements, requests, flames, etc. to -// cristi@datamekanix.com or post them at the message board at the site. -///////////////////////////////////////////////////////////////////////// - -#if !defined(__SCBARG_H__) -#define __SCBARG_H__ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#include "sizecbar.h" - -///////////////////////////////////////////////////////////////////////// -// CSCBButton (button info) helper class - -class CSCBButton -{ -public: - CSCBButton(); - - void Move(CPoint ptTo) {ptOrg = ptTo; }; - CRect GetRect() { return CRect(ptOrg, CSize(11, 11)); }; - void Paint(CDC* pDC); - - BOOL bPushed; - BOOL bRaised; - -protected: - CPoint ptOrg; -}; - -///////////////////////////////////////////////////////////////////////// -// CSizingControlBar control bar - -#ifndef baseCSizingControlBarG -#define baseCSizingControlBarG CSizingControlBar -#endif - -class CSizingControlBarG : public baseCSizingControlBarG -{ - DECLARE_DYNAMIC(CSizingControlBarG); - -// Construction -public: - CSizingControlBarG(); - -// Attributes -public: - virtual BOOL HasGripper() const; - -// Operations -public: - -// Overridables - virtual void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler); - -// Overrides -public: - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CSizingControlBarG) - //}}AFX_VIRTUAL - -// Implementation -public: - virtual ~CSizingControlBarG(); - -protected: - // implementation helpers - virtual void NcPaintGripper(CDC* pDC, CRect rcClient); - virtual void NcCalcClient(LPRECT pRc, UINT nDockBarID); - -protected: - int m_cyGripper; - - CSCBButton m_biHide; - -// Generated message map functions -protected: - //{{AFX_MSG(CSizingControlBarG) - afx_msg HITTEST_RET OnNcHitTest(CPoint point); - afx_msg void OnNcLButtonUp(UINT nHitTest, CPoint point); - //}}AFX_MSG - - DECLARE_MESSAGE_MAP() -}; - -#endif // !defined(__SCBARG_H__) - - diff --git a/src/ui/sizecbar/sizecbar.cpp b/src/ui/sizecbar/sizecbar.cpp deleted file mode 100644 index 3c7ec15d6..000000000 --- a/src/ui/sizecbar/sizecbar.cpp +++ /dev/null @@ -1,1419 +0,0 @@ -///////////////////////////////////////////////////////////////////////// -// -// CSizingControlBar Version 2.43 -// -// Created: Jan 24, 1998 Last Modified: August 03, 2000 -// -// See the official site at www.datamekanix.com for documentation and -// the latest news. -// -///////////////////////////////////////////////////////////////////////// -// Copyright (C) 1998-2000 by Cristi Posea. All rights reserved. -// -// This code is free for personal and commercial use, providing this -// notice remains intact in the source files and all eventual changes are -// clearly marked with comments. -// -// You must obtain the author's consent before you can include this code -// in a software library. -// -// No warrantee of any kind, express or implied, is included with this -// software; use at your own risk, responsibility for damages (if any) to -// anyone resulting from the use of this software rests entirely with the -// user. -// -// Send bug reports, bug fixes, enhancements, requests, flames, etc. to -// cristi@datamekanix.com or post them at the message board at the site. -// -// The sources and a short version of the docs are also available at -// www.codeproject.com . Look for a "Docking Windows" section and check -// the version to be sure you get the latest one ;) -// -// Hint: These classes are intended to be used as base classes. Do not -// simply add your code to these file - instead create a new class -// derived from one of CSizingControlBarXX classes and put there what -// you need. See CMyBar classes in the demo projects for examples. -// Modify this file only to fix bugs, and don't forget to send me a copy. -///////////////////////////////////////////////////////////////////////// -// Acknowledgements: -// o Thanks to Harlan R. Seymour for his continuous support during -// development of this code. -// o Thanks to Dundas Software for the opportunity -// to test this code on real-life applications. -// o Some ideas for the gripper came from the CToolBarEx flat toolbar -// by Joerg Koenig. Thanks, Joerg! -// o Thanks to Robert Wolpow for the code on which CDockContext based -// dialgonal resizing is based. -// o Thanks to the following people for various bug fixes and/or -// enhancements: Chris Maunder, Jakawan Ratiwanich, Udo Schaefer, -// Anatoly Ivasyuk, Peter Hauptmann. -// o And, of course, many thanks to all of you who used this code, -// for the invaluable feedback I received. -///////////////////////////////////////////////////////////////////////// - -// sizecbar.cpp : implementation file -// - -#include "stdafx.h" -#include "sizecbar.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////// -// CSizingControlBar - -IMPLEMENT_DYNAMIC(CSizingControlBar, baseCSizingControlBar); - -CSizingControlBar::CSizingControlBar() -{ - m_szMinHorz = CSize(33, 32); - m_szMinVert = CSize(33, 32); - m_szMinFloat = CSize(37, 32); - m_szHorz = CSize(200, 200); - m_szVert = CSize(200, 200); - m_szFloat = CSize(200, 200); - m_bTracking = FALSE; - m_bKeepSize = FALSE; - m_bParentSizing = FALSE; - m_cxEdge = 5; - m_bDragShowContent = FALSE; - m_nDockBarID = 0; - m_dwSCBStyle = 0; -} - -CSizingControlBar::~CSizingControlBar() -{ -} - -BEGIN_MESSAGE_MAP(CSizingControlBar, baseCSizingControlBar) - //{{AFX_MSG_MAP(CSizingControlBar) - ON_WM_CREATE() - ON_WM_PAINT() - ON_WM_NCPAINT() - ON_WM_NCCALCSIZE() - ON_WM_WINDOWPOSCHANGING() - ON_WM_CAPTURECHANGED() - ON_WM_SETTINGCHANGE() - ON_WM_LBUTTONUP() - ON_WM_MOUSEMOVE() - ON_WM_NCLBUTTONDOWN() - ON_WM_LBUTTONDOWN() - ON_WM_LBUTTONDBLCLK() - ON_WM_RBUTTONDOWN() - ON_WM_NCMOUSEMOVE() - ON_WM_NCHITTEST() - ON_WM_CLOSE() - ON_WM_SIZE() - //}}AFX_MSG_MAP - ON_MESSAGE(WM_SETTEXT, OnSetText) -END_MESSAGE_MAP() - -// old creation method, still here for compatibility reasons -BOOL CSizingControlBar::Create(LPCTSTR lpszWindowName, CWnd* pParentWnd, - CSize sizeDefault, BOOL bHasGripper, - UINT nID, DWORD dwStyle) -{ - UNUSED_ALWAYS(bHasGripper); - - m_szHorz = m_szVert = m_szFloat = sizeDefault; - return Create(lpszWindowName, pParentWnd, nID, dwStyle); -} - -// preffered creation method -BOOL CSizingControlBar::Create(LPCTSTR lpszWindowName, - CWnd* pParentWnd, UINT nID, - DWORD dwStyle) -{ - // must have a parent - ASSERT_VALID(pParentWnd); - // cannot be both fixed and dynamic - // (CBRS_SIZE_DYNAMIC is used for resizng when floating) - ASSERT (!((dwStyle & CBRS_SIZE_FIXED) && - (dwStyle & CBRS_SIZE_DYNAMIC))); - - m_dwStyle = dwStyle & CBRS_ALL; // save the control bar styles - - // register and create the window - skip CControlBar::Create() - CString wndclass = ::AfxRegisterWndClass(CS_DBLCLKS, - ::LoadCursor(NULL, IDC_ARROW), - ::GetSysColorBrush(COLOR_BTNFACE), 0); - - dwStyle &= ~CBRS_ALL; // keep only the generic window styles - dwStyle |= WS_CLIPCHILDREN; // prevents flashing - if (!CWnd::Create(wndclass, lpszWindowName, dwStyle, - CRect(0, 0, 0, 0), pParentWnd, nID)) - return FALSE; - - return TRUE; -} - -///////////////////////////////////////////////////////////////////////// -// CSizingControlBar operations -#if defined(_SCB_REPLACE_MINIFRAME) && !defined(_SCB_MINIFRAME_CAPTION) -void CSizingControlBar::EnableDocking(DWORD dwDockStyle) -{ - // must be CBRS_ALIGN_XXX or CBRS_FLOAT_MULTI only - ASSERT((dwDockStyle & ~(CBRS_ALIGN_ANY|CBRS_FLOAT_MULTI)) == 0); - // cannot have the CBRS_FLOAT_MULTI style - ASSERT((dwDockStyle & CBRS_FLOAT_MULTI) == 0); - // the bar must have CBRS_SIZE_DYNAMIC style - ASSERT((m_dwStyle & CBRS_SIZE_DYNAMIC) != 0); - - m_dwDockStyle = dwDockStyle; - if (m_pDockContext == NULL) - m_pDockContext = new CSCBDockContext(this); - - // permanently wire the bar's owner to its current parent - if (m_hWndOwner == NULL) - m_hWndOwner = ::GetParent(m_hWnd); -} -#endif - -///////////////////////////////////////////////////////////////////////// -// CSizingControlBar message handlers - -int CSizingControlBar::OnCreate(LPCREATESTRUCT lpCreateStruct) -{ - if (baseCSizingControlBar::OnCreate(lpCreateStruct) == -1) - return -1; - - // query SPI_GETDRAGFULLWINDOWS system parameter - // OnSettingChange() will update m_bDragShowContent - m_bDragShowContent = FALSE; - ::SystemParametersInfo(SPI_GETDRAGFULLWINDOWS, 0, - &m_bDragShowContent, 0); - - // uncomment this line if you want raised borders -// m_dwSCBStyle |= SCBS_SHOWEDGES; - - return 0; -} - - -LRESULT CSizingControlBar::OnSetText(WPARAM wParam, LPARAM lParam) -{ - UNUSED_ALWAYS(wParam); - - LRESULT lResult = CWnd::Default(); - - if (IsFloating() && - GetParentFrame()->IsKindOf(RUNTIME_CLASS(CMiniDockFrameWnd))) - { - m_pDockBar->SetWindowText((LPCTSTR) lParam); // update dockbar - GetParentFrame()->DelayRecalcLayout(); // refresh miniframe - } - - return lResult; -} - -const BOOL CSizingControlBar::IsFloating() const -{ - return !IsHorzDocked() && !IsVertDocked(); -} - -const BOOL CSizingControlBar::IsHorzDocked() const -{ - return (m_nDockBarID == AFX_IDW_DOCKBAR_TOP || - m_nDockBarID == AFX_IDW_DOCKBAR_BOTTOM); -} - -const BOOL CSizingControlBar::IsVertDocked() const -{ - return (m_nDockBarID == AFX_IDW_DOCKBAR_LEFT || - m_nDockBarID == AFX_IDW_DOCKBAR_RIGHT); -} - -const BOOL CSizingControlBar::IsSideTracking() const -{ - // don't call this when not tracking - ASSERT(m_bTracking && !IsFloating()); - - return (m_htEdge == HTLEFT || m_htEdge == HTRIGHT) ? - IsHorzDocked() : IsVertDocked(); -} - -CSize CSizingControlBar::CalcFixedLayout(BOOL bStretch, BOOL bHorz) -{ - if (bStretch) // the bar is stretched (is not the child of a dockbar) - if (bHorz) - return CSize(32767, m_szHorz.cy); - else - return CSize(m_szVert.cx, 32767); - - // dirty cast - we need access to protected CDockBar members - CSCBDockBar* pDockBar = (CSCBDockBar*) m_pDockBar; - - // force imediate RecalcDelayShow() for all sizing bars on the row - // with delayShow/delayHide flags set to avoid IsVisible() problems - CSCBArray arrSCBars; - GetRowSizingBars(arrSCBars); - AFX_SIZEPARENTPARAMS layout; - layout.hDWP = pDockBar->m_bLayoutQuery ? - NULL : ::BeginDeferWindowPos(arrSCBars.GetSize()); - for (int i = 0; i < arrSCBars.GetSize(); i++) - if (arrSCBars[i]->m_nStateFlags & (delayHide|delayShow)) - arrSCBars[i]->RecalcDelayShow(&layout); - if (layout.hDWP != NULL) - ::EndDeferWindowPos(layout.hDWP); - - // get available length - CRect rc = pDockBar->m_rectLayout; - if (rc.IsRectEmpty()) - m_pDockSite->GetClientRect(&rc); - int nLengthTotal = bHorz ? rc.Width() + 2 : rc.Height() - 2; - - if (IsVisible() && !IsFloating() && - m_bParentSizing && arrSCBars[0] == this) - if (NegotiateSpace(nLengthTotal, (bHorz != FALSE))) - AlignControlBars(); - - m_bParentSizing = FALSE; - - if (bHorz) - return CSize(max(m_szMinHorz.cx, m_szHorz.cx), - max(m_szMinHorz.cy, m_szHorz.cy)); - - return CSize(max(m_szMinVert.cx, m_szVert.cx), - max(m_szMinVert.cy, m_szVert.cy)); -} - -CSize CSizingControlBar::CalcDynamicLayout(int nLength, DWORD dwMode) -{ - if (dwMode & (LM_HORZDOCK | LM_VERTDOCK)) // docked ? - { - if (nLength == -1) - m_bParentSizing = TRUE; - - return baseCSizingControlBar::CalcDynamicLayout(nLength, dwMode); - } - - if (dwMode & LM_MRUWIDTH) return m_szFloat; - if (dwMode & LM_COMMIT) return m_szFloat; // already committed - -#ifndef _SCB_REPLACE_MINIFRAME - // check for dialgonal resizing hit test - int nHitTest = m_pDockContext->m_nHitTest; - if (IsFloating() && - (nHitTest == HTTOPLEFT || nHitTest == HTBOTTOMLEFT || - nHitTest == HTTOPRIGHT || nHitTest == HTBOTTOMRIGHT)) - { - CPoint ptCursor; - ::GetCursorPos(&ptCursor); - - CRect rFrame, rBar; - GetParentFrame()->GetWindowRect(&rFrame); - GetWindowRect(&rBar); - - if (nHitTest == HTTOPLEFT || nHitTest == HTBOTTOMLEFT) - { - m_szFloat.cx = rFrame.left + rBar.Width() - ptCursor.x; - m_pDockContext->m_rectFrameDragHorz.left = - min(ptCursor.x, rFrame.left + rBar.Width() - m_szMinFloat.cx); - } - - if (nHitTest == HTTOPLEFT || nHitTest == HTTOPRIGHT) - { - m_szFloat.cy = rFrame.top + rBar.Height() - ptCursor.y; - m_pDockContext->m_rectFrameDragHorz.top = - min(ptCursor.y, rFrame.top + rBar.Height() - m_szMinFloat.cy); - } - - if (nHitTest == HTTOPRIGHT || nHitTest == HTBOTTOMRIGHT) - m_szFloat.cx = rBar.Width() + ptCursor.x - rFrame.right; - - if (nHitTest == HTBOTTOMLEFT || nHitTest == HTBOTTOMRIGHT) - m_szFloat.cy = rBar.Height() + ptCursor.y - rFrame.bottom; - } - else -#endif //_SCB_REPLACE_MINIFRAME - ((dwMode & LM_LENGTHY) ? m_szFloat.cy : m_szFloat.cx) = nLength; - - m_szFloat.cx = max(m_szFloat.cx, m_szMinFloat.cx); - m_szFloat.cy = max(m_szFloat.cy, m_szMinFloat.cy); - - return m_szFloat; -} - -void CSizingControlBar::OnWindowPosChanging(WINDOWPOS FAR* lpwndpos) -{ - // force non-client recalc if moved or resized - lpwndpos->flags |= SWP_FRAMECHANGED; - - baseCSizingControlBar::OnWindowPosChanging(lpwndpos); - - // find on which side are we docked - m_nDockBarID = GetParent()->GetDlgCtrlID(); - - if (!IsFloating()) - if (lpwndpos->flags & SWP_SHOWWINDOW) - m_bKeepSize = TRUE; -} - -///////////////////////////////////////////////////////////////////////// -// Mouse Handling -// -void CSizingControlBar::OnLButtonDown(UINT nFlags, CPoint point) -{ - if (m_pDockBar != NULL) - { - // start the drag - ASSERT(m_pDockContext != NULL); - ClientToScreen(&point); - m_pDockContext->StartDrag(point); - } - else - CWnd::OnLButtonDown(nFlags, point); -} - -void CSizingControlBar::OnLButtonDblClk(UINT nFlags, CPoint point) -{ - if (m_pDockBar != NULL) - { - // toggle docking - ASSERT(m_pDockContext != NULL); - m_pDockContext->ToggleDocking(); - } - else - CWnd::OnLButtonDblClk(nFlags, point); -} - -void CSizingControlBar::OnNcLButtonDown(UINT nHitTest, CPoint point) -{ - UNUSED_ALWAYS(point); - - if (m_bTracking || IsFloating()) - return; - - if ((nHitTest >= HTSIZEFIRST) && (nHitTest <= HTSIZELAST)) - StartTracking(nHitTest, point); // sizing edge hit -} - -void CSizingControlBar::OnLButtonUp(UINT nFlags, CPoint point) -{ - if (m_bTracking) - StopTracking(); - - baseCSizingControlBar::OnLButtonUp(nFlags, point); -} - -void CSizingControlBar::OnRButtonDown(UINT nFlags, CPoint point) -{ - if (m_bTracking) - StopTracking(); - - baseCSizingControlBar::OnRButtonDown(nFlags, point); -} - -void CSizingControlBar::OnMouseMove(UINT nFlags, CPoint point) -{ - if (m_bTracking) - { - CPoint ptScreen = point; - ClientToScreen(&ptScreen); - - OnTrackUpdateSize(ptScreen); - } - - baseCSizingControlBar::OnMouseMove(nFlags, point); -} - -void CSizingControlBar::OnCaptureChanged(CWnd *pWnd) -{ - if (m_bTracking && (pWnd != this)) - StopTracking(); - - baseCSizingControlBar::OnCaptureChanged(pWnd); -} - -void CSizingControlBar::OnNcCalcSize(BOOL bCalcValidRects, - NCCALCSIZE_PARAMS FAR* lpncsp) -{ - UNUSED_ALWAYS(bCalcValidRects); - -#ifndef _SCB_REPLACE_MINIFRAME - // Enable diagonal resizing for floating miniframe - if (IsFloating()) - { - CFrameWnd* pFrame = GetParentFrame(); - if (pFrame != NULL && - pFrame->IsKindOf(RUNTIME_CLASS(CMiniFrameWnd))) - { - DWORD dwStyle = ::GetWindowLong(pFrame->m_hWnd, GWL_STYLE); - if ((dwStyle & MFS_4THICKFRAME) != 0) - { - pFrame->ModifyStyle(MFS_4THICKFRAME, 0); // clear - GetParent()->ModifyStyle(0, WS_CLIPCHILDREN); - } - } - } -#endif _SCB_REPLACE_MINIFRAME - - // compute the the client area - m_dwSCBStyle &= ~SCBS_EDGEALL; - - // add resizing edges between bars on the same row - if (!IsFloating() && m_pDockBar != NULL) - { - CSCBArray arrSCBars; - int nThis; - GetRowSizingBars(arrSCBars, nThis); - - BOOL bHorz = IsHorzDocked(); - if (nThis > 0) - m_dwSCBStyle |= bHorz ? SCBS_EDGELEFT : SCBS_EDGETOP; - - if (nThis < arrSCBars.GetUpperBound()) - m_dwSCBStyle |= bHorz ? SCBS_EDGERIGHT : SCBS_EDGEBOTTOM; - } - - NcCalcClient(&lpncsp->rgrc[0], m_nDockBarID); -} - -void CSizingControlBar::NcCalcClient(LPRECT pRc, UINT nDockBarID) -{ - CRect rc(pRc); - - rc.DeflateRect(3, 5, 3, 3); - if (nDockBarID != AFX_IDW_DOCKBAR_FLOAT) - rc.DeflateRect(2, 0, 2, 2); - - switch(nDockBarID) - { - case AFX_IDW_DOCKBAR_TOP: - m_dwSCBStyle |= SCBS_EDGEBOTTOM; - break; - case AFX_IDW_DOCKBAR_BOTTOM: - m_dwSCBStyle |= SCBS_EDGETOP; - break; - case AFX_IDW_DOCKBAR_LEFT: - m_dwSCBStyle |= SCBS_EDGERIGHT; - break; - case AFX_IDW_DOCKBAR_RIGHT: - m_dwSCBStyle |= SCBS_EDGELEFT; - break; - } - - // make room for edges only if they will be painted - if (m_dwSCBStyle & SCBS_SHOWEDGES) - rc.DeflateRect( - (m_dwSCBStyle & SCBS_EDGELEFT) ? m_cxEdge : 0, - (m_dwSCBStyle & SCBS_EDGETOP) ? m_cxEdge : 0, - (m_dwSCBStyle & SCBS_EDGERIGHT) ? m_cxEdge : 0, - (m_dwSCBStyle & SCBS_EDGEBOTTOM) ? m_cxEdge : 0); - - *pRc = rc; -} - -void CSizingControlBar::OnNcPaint() -{ - // get window DC that is clipped to the non-client area - CWindowDC dc(this); - - CRect rcClient, rcBar; - GetClientRect(rcClient); - ClientToScreen(rcClient); - GetWindowRect(rcBar); - rcClient.OffsetRect(-rcBar.TopLeft()); - rcBar.OffsetRect(-rcBar.TopLeft()); - - CDC mdc; - mdc.CreateCompatibleDC(&dc); - - CBitmap bm; - bm.CreateCompatibleBitmap(&dc, rcBar.Width(), rcBar.Height()); - CBitmap* pOldBm = mdc.SelectObject(&bm); - - // draw borders in non-client area - CRect rcDraw = rcBar; - DrawBorders(&mdc, rcDraw); - - // erase the NC background - mdc.FillRect(rcDraw, CBrush::FromHandle( - (HBRUSH) GetClassLong(m_hWnd, GCL_HBRBACKGROUND))); - - if (m_dwSCBStyle & SCBS_SHOWEDGES) - { - CRect rcEdge; // paint the sizing edges - for (int i = 0; i < 4; i++) - if (GetEdgeRect(rcBar, GetEdgeHTCode(i), rcEdge)) - mdc.Draw3dRect(rcEdge, ::GetSysColor(COLOR_BTNHIGHLIGHT), - ::GetSysColor(COLOR_BTNSHADOW)); - } - - NcPaintGripper(&mdc, rcClient); - - // client area is not our bussiness :) - dc.IntersectClipRect(rcBar); - dc.ExcludeClipRect(rcClient); - - dc.BitBlt(0, 0, rcBar.Width(), rcBar.Height(), &mdc, 0, 0, SRCCOPY); - - ReleaseDC(&dc); - - mdc.SelectObject(pOldBm); - bm.DeleteObject(); - mdc.DeleteDC(); -} - -void CSizingControlBar::NcPaintGripper(CDC* pDC, CRect rcClient) -{ - UNUSED_ALWAYS(pDC); - UNUSED_ALWAYS(rcClient); -} - -void CSizingControlBar::OnPaint() -{ - // overridden to skip border painting based on clientrect - CPaintDC dc(this); -} - -HITTEST_RET CSizingControlBar::OnNcHitTest(CPoint point) -{ - CRect rcBar, rcEdge; - GetWindowRect(rcBar); - - if (!IsFloating()) - for (int i = 0; i < 4; i++) - if (GetEdgeRect(rcBar, GetEdgeHTCode(i), rcEdge)) - if (rcEdge.PtInRect(point)) - return GetEdgeHTCode(i); - - return HTCLIENT; -} - -void CSizingControlBar::OnSettingChange(UINT uFlags, LPCTSTR lpszSection) -{ - baseCSizingControlBar::OnSettingChange(uFlags, lpszSection); - - m_bDragShowContent = FALSE; - ::SystemParametersInfo(SPI_GETDRAGFULLWINDOWS, 0, - &m_bDragShowContent, 0); // update -} - -void CSizingControlBar::OnSize(UINT nType, int cx, int cy) -{ - UNUSED_ALWAYS(nType); - - if ((m_dwSCBStyle & SCBS_SIZECHILD) != 0) - { - // automatic child resizing - only one child is allowed - CWnd* pWnd = GetWindow(GW_CHILD); - if (pWnd != NULL) - { - pWnd->MoveWindow(0, 0, cx, cy); - ASSERT(pWnd->GetWindow(GW_HWNDNEXT) == NULL); - } - } -} - -void CSizingControlBar::OnClose() -{ - // do nothing: protection against accidentally destruction by the - // child control (i.e. if user hits Esc in a child editctrl) -} - -///////////////////////////////////////////////////////////////////////// -// CSizingControlBar implementation helpers - -void CSizingControlBar::StartTracking(UINT nHitTest, CPoint point) -{ - SetCapture(); - - // make sure no updates are pending - if (!m_bDragShowContent) - RedrawWindow(NULL, NULL, RDW_ALLCHILDREN | RDW_UPDATENOW); - - m_htEdge = nHitTest; - m_bTracking = TRUE; - - BOOL bHorz = IsHorzDocked(); - BOOL bHorzTracking = m_htEdge == HTLEFT || m_htEdge == HTRIGHT; - - m_nTrackPosOld = bHorzTracking ? point.x : point.y; - - CRect rcBar, rcEdge; - GetWindowRect(rcBar); - GetEdgeRect(rcBar, m_htEdge, rcEdge); - m_nTrackEdgeOfs = m_nTrackPosOld - - (bHorzTracking ? rcEdge.CenterPoint().x : rcEdge.CenterPoint().y); - - CSCBArray arrSCBars; - int nThis; - GetRowSizingBars(arrSCBars, nThis); - - m_nTrackPosMin = m_nTrackPosMax = m_nTrackPosOld; - if (!IsSideTracking()) - { - // calc minwidth as the max minwidth of the sizing bars on row - int nMinWidth = bHorz ? m_szMinHorz.cy : m_szMinVert.cx; - for (int i = 0; i < arrSCBars.GetSize(); i++) - nMinWidth = max(nMinWidth, bHorz ? - arrSCBars[i]->m_szMinHorz.cy : - arrSCBars[i]->m_szMinVert.cx); - int nExcessWidth = (bHorz ? m_szHorz.cy : m_szVert.cx) - nMinWidth; - - // the control bar cannot grow with more than the width of - // remaining client area of the mainframe - CRect rcT; - m_pDockSite->RepositionBars(0, 0xFFFF, AFX_IDW_PANE_FIRST, - reposQuery, &rcT, NULL, TRUE); - int nMaxWidth = bHorz ? rcT.Height() - 2 : rcT.Width() - 2; - - BOOL bTopOrLeft = m_htEdge == HTTOP || m_htEdge == HTLEFT; - - m_nTrackPosMin -= bTopOrLeft ? nMaxWidth : nExcessWidth; - m_nTrackPosMax += bTopOrLeft ? nExcessWidth : nMaxWidth; - } - else - { - // side tracking: - // max size is the actual size plus the amount the other - // sizing bars can be decreased until they reach their minsize - if (m_htEdge == HTBOTTOM || m_htEdge == HTRIGHT) - nThis++; - - for (int i = 0; i < arrSCBars.GetSize(); i++) - { - CSizingControlBar* pBar = arrSCBars[i]; - - int nExcessWidth = bHorz ? - pBar->m_szHorz.cx - pBar->m_szMinHorz.cx : - pBar->m_szVert.cy - pBar->m_szMinVert.cy; - - if (i < nThis) - m_nTrackPosMin -= nExcessWidth; - else - m_nTrackPosMax += nExcessWidth; - } - } - - OnTrackInvertTracker(); // draw tracker -} - -void CSizingControlBar::StopTracking() -{ - OnTrackInvertTracker(); // erase tracker - - m_bTracking = FALSE; - ReleaseCapture(); - - m_pDockSite->DelayRecalcLayout(); -} - -void CSizingControlBar::OnTrackUpdateSize(CPoint& point) -{ - ASSERT(!IsFloating()); - - BOOL bHorzTrack = m_htEdge == HTLEFT || m_htEdge == HTRIGHT; - - int nTrackPos = bHorzTrack ? point.x : point.y; - nTrackPos = max(m_nTrackPosMin, min(m_nTrackPosMax, nTrackPos)); - - int nDelta = nTrackPos - m_nTrackPosOld; - - if (nDelta == 0) - return; // no pos change - - OnTrackInvertTracker(); // erase tracker - - m_nTrackPosOld = nTrackPos; - - BOOL bHorz = IsHorzDocked(); - - CSize sizeNew = bHorz ? m_szHorz : m_szVert; - switch (m_htEdge) - { - case HTLEFT: sizeNew -= CSize(nDelta, 0); break; - case HTTOP: sizeNew -= CSize(0, nDelta); break; - case HTRIGHT: sizeNew += CSize(nDelta, 0); break; - case HTBOTTOM: sizeNew += CSize(0, nDelta); break; - } - - CSCBArray arrSCBars; - int nThis; - GetRowSizingBars(arrSCBars, nThis); - - if (!IsSideTracking()) - for (int i = 0; i < arrSCBars.GetSize(); i++) - { - CSizingControlBar* pBar = arrSCBars[i]; - // make same width (or height) - (bHorz ? pBar->m_szHorz.cy : pBar->m_szVert.cx) = - bHorz ? sizeNew.cy : sizeNew.cx; - } - else - { - int nGrowingBar = nThis; - BOOL bBefore = m_htEdge == HTTOP || m_htEdge == HTLEFT; - if (bBefore && nDelta > 0) - nGrowingBar--; - if (!bBefore && nDelta < 0) - nGrowingBar++; - if (nGrowingBar != nThis) - bBefore = !bBefore; - - // nGrowing is growing - nDelta = abs(nDelta); - CSizingControlBar* pBar = arrSCBars[nGrowingBar]; - (bHorz ? pBar->m_szHorz.cx : pBar->m_szVert.cy) += nDelta; - - // the others are shrinking - int nFirst = bBefore ? nGrowingBar - 1 : nGrowingBar + 1; - int nLimit = bBefore ? -1 : arrSCBars.GetSize(); - - for (int i = nFirst; nDelta != 0 && i != nLimit; i += (bBefore ? -1 : 1)) - { - CSizingControlBar* pBar = arrSCBars[i]; - - int nDeltaT = min(nDelta, - (bHorz ? pBar->m_szHorz.cx : pBar->m_szVert.cy) - - (bHorz ? pBar->m_szMinHorz.cx : pBar->m_szMinVert.cy)); - - (bHorz ? pBar->m_szHorz.cx : pBar->m_szVert.cy) -= nDeltaT; - nDelta -= nDeltaT; - } - } - - OnTrackInvertTracker(); // redraw tracker at new pos - - if (m_bDragShowContent) - m_pDockSite->DelayRecalcLayout(); -} - -void CSizingControlBar::OnTrackInvertTracker() -{ - ASSERT(m_bTracking); - - if (m_bDragShowContent) - return; // don't show tracker if DragFullWindows is on - - BOOL bHorz = IsHorzDocked(); - CRect rc, rcBar, rcDock, rcFrame; - GetWindowRect(rcBar); - m_pDockBar->GetWindowRect(rcDock); - m_pDockSite->GetWindowRect(rcFrame); - VERIFY(GetEdgeRect(rcBar, m_htEdge, rc)); - if (!IsSideTracking()) - rc = bHorz ? - CRect(rcDock.left + 1, rc.top, rcDock.right - 1, rc.bottom) : - CRect(rc.left, rcDock.top + 1, rc.right, rcDock.bottom - 1); - - BOOL bHorzTracking = m_htEdge == HTLEFT || m_htEdge == HTRIGHT; - int nOfs = m_nTrackPosOld - m_nTrackEdgeOfs; - nOfs -= bHorzTracking ? rc.CenterPoint().x : rc.CenterPoint().y; - rc.OffsetRect(bHorzTracking ? nOfs : 0, bHorzTracking ? 0 : nOfs); - rc.OffsetRect(-rcFrame.TopLeft()); - - CDC *pDC = m_pDockSite->GetDCEx(NULL, - DCX_WINDOW | DCX_CACHE | DCX_LOCKWINDOWUPDATE); - CBrush* pBrush = CDC::GetHalftoneBrush(); - CBrush* pBrushOld = pDC->SelectObject(pBrush); - - pDC->PatBlt(rc.left, rc.top, rc.Width(), rc.Height(), PATINVERT); - - pDC->SelectObject(pBrushOld); - m_pDockSite->ReleaseDC(pDC); -} - -BOOL CSizingControlBar::GetEdgeRect(CRect rcWnd, UINT nHitTest, - CRect& rcEdge) -{ - rcEdge = rcWnd; - if (m_dwSCBStyle & SCBS_SHOWEDGES) - rcEdge.DeflateRect(1, 1); - BOOL bHorz = IsHorzDocked(); - - switch (nHitTest) - { - case HTLEFT: - if (!(m_dwSCBStyle & SCBS_EDGELEFT)) return FALSE; - rcEdge.right = rcEdge.left + m_cxEdge; - rcEdge.DeflateRect(0, bHorz ? m_cxEdge: 0); - break; - case HTTOP: - if (!(m_dwSCBStyle & SCBS_EDGETOP)) return FALSE; - rcEdge.bottom = rcEdge.top + m_cxEdge; - rcEdge.DeflateRect(bHorz ? 0 : m_cxEdge, 0); - break; - case HTRIGHT: - if (!(m_dwSCBStyle & SCBS_EDGERIGHT)) return FALSE; - rcEdge.left = rcEdge.right - m_cxEdge; - rcEdge.DeflateRect(0, bHorz ? m_cxEdge: 0); - break; - case HTBOTTOM: - if (!(m_dwSCBStyle & SCBS_EDGEBOTTOM)) return FALSE; - rcEdge.top = rcEdge.bottom - m_cxEdge; - rcEdge.DeflateRect(bHorz ? 0 : m_cxEdge, 0); - break; - default: - ASSERT(FALSE); // invalid hit test code - } - return TRUE; -} - -UINT CSizingControlBar::GetEdgeHTCode(int nEdge) -{ - if (nEdge == 0) return HTLEFT; - if (nEdge == 1) return HTTOP; - if (nEdge == 2) return HTRIGHT; - if (nEdge == 3) return HTBOTTOM; - ASSERT(FALSE); // invalid edge code - return HTNOWHERE; -} - -void CSizingControlBar::GetRowInfo(int& nFirst, int& nLast, int& nThis) -{ - ASSERT_VALID(m_pDockBar); // verify bounds - - nThis = m_pDockBar->FindBar(this); - ASSERT(nThis != -1); - - int i, nBars = m_pDockBar->m_arrBars.GetSize(); - - // find the first and the last bar in row - for (nFirst = -1, i = nThis - 1; i >= 0 && nFirst == -1; i--) - if (m_pDockBar->m_arrBars[i] == NULL) - nFirst = i + 1; - for (nLast = -1, i = nThis + 1; i < nBars && nLast == -1; i++) - if (m_pDockBar->m_arrBars[i] == NULL) - nLast = i - 1; - - ASSERT((nLast != -1) && (nFirst != -1)); -} - -void CSizingControlBar::GetRowSizingBars(CSCBArray& arrSCBars) -{ - int nThis; // dummy - GetRowSizingBars(arrSCBars, nThis); -} - -void CSizingControlBar::GetRowSizingBars(CSCBArray& arrSCBars, int& nThis) -{ - arrSCBars.RemoveAll(); - - int nFirstT, nLastT, nThisT; - GetRowInfo(nFirstT, nLastT, nThisT); - - nThis = -1; - for (int i = nFirstT; i <= nLastT; i++) - { - CSizingControlBar* pBar = - (CSizingControlBar*) m_pDockBar->m_arrBars[i]; - if (HIWORD(pBar) == 0) continue; // placeholder - if (!pBar->IsVisible()) continue; - if (pBar->IsKindOf(RUNTIME_CLASS(CSizingControlBar))) - { - if (pBar == this) - nThis = arrSCBars.GetSize(); - - arrSCBars.Add(pBar); - } - } -} - -BOOL CSizingControlBar::NegotiateSpace(int nLengthTotal, BOOL bHorz) -{ - ASSERT(bHorz == IsHorzDocked()); - - int nFirst, nLast, nThis; - GetRowInfo(nFirst, nLast, nThis); - - int nLengthAvail = nLengthTotal; - int nLengthActual = 0; - int nLengthMin = 2; - int nWidthMax = 0; - CSizingControlBar* pBar; - - for (int i = nFirst; i <= nLast; i++) - { - pBar = (CSizingControlBar*) m_pDockBar->m_arrBars[i]; - if (HIWORD(pBar) == 0) continue; // placeholder - if (!pBar->IsVisible()) continue; - BOOL bIsSizingBar = - pBar->IsKindOf(RUNTIME_CLASS(CSizingControlBar)); - - int nLengthBar; // minimum length of the bar - if (bIsSizingBar) - nLengthBar = bHorz ? pBar->m_szMinHorz.cx - 2 : - pBar->m_szMinVert.cy - 2; - else - { - CRect rcBar; - pBar->GetWindowRect(&rcBar); - nLengthBar = bHorz ? rcBar.Width() - 2 : rcBar.Height() - 2; - } - - nLengthMin += nLengthBar; - if (nLengthMin > nLengthTotal) - { - // split the row after fixed bar - if (i < nThis) - { - m_pDockBar->m_arrBars.InsertAt(i + 1, - (CControlBar*) NULL); - return FALSE; - } - - // only this sizebar remains on the row, adjust it to minsize - if (i == nThis) - { - if (bHorz) - m_szHorz.cx = m_szMinHorz.cx; - else - m_szVert.cy = m_szMinVert.cy; - - return TRUE; // the dockbar will split the row for us - } - - // we have enough bars - go negotiate with them - m_pDockBar->m_arrBars.InsertAt(i, (CControlBar*) NULL); - nLast = i - 1; - break; - } - - if (bIsSizingBar) - { - nLengthActual += bHorz ? pBar->m_szHorz.cx - 2 : - pBar->m_szVert.cy - 2; - nWidthMax = max(nWidthMax, bHorz ? pBar->m_szHorz.cy : - pBar->m_szVert.cx); - } - else - nLengthAvail -= nLengthBar; - } - - CSCBArray arrSCBars; - GetRowSizingBars(arrSCBars); - int nNumBars = arrSCBars.GetSize(); - int nDelta = nLengthAvail - nLengthActual; - - // return faster when there is only one sizing bar per row (this one) - if (nNumBars == 1) - { - ASSERT(arrSCBars[0] == this); - - if (nDelta == 0) - return TRUE; - - m_bKeepSize = FALSE; - (bHorz ? m_szHorz.cx : m_szVert.cy) += nDelta; - - return TRUE; - } - - // make all the bars the same width - for (int i = 0; i < nNumBars; i++) - if (bHorz) - arrSCBars[i]->m_szHorz.cy = nWidthMax; - else - arrSCBars[i]->m_szVert.cx = nWidthMax; - - // distribute the difference between the bars, - // but don't shrink them below their minsizes - while (nDelta != 0) - { - int nDeltaOld = nDelta; - for (int i = 0; i < nNumBars; i++) - { - pBar = arrSCBars[i]; - int nLMin = bHorz ? - pBar->m_szMinHorz.cx : pBar->m_szMinVert.cy; - int nL = bHorz ? pBar->m_szHorz.cx : pBar->m_szVert.cy; - - if ((nL == nLMin) && (nDelta < 0) || // already at min length - pBar->m_bKeepSize) // or wants to keep its size - continue; - - // sign of nDelta - int nDelta2 = (nDelta == 0) ? 0 : ((nDelta < 0) ? -1 : 1); - - (bHorz ? pBar->m_szHorz.cx : pBar->m_szVert.cy) += nDelta2; - nDelta -= nDelta2; - if (nDelta == 0) break; - } - // clear m_bKeepSize flags - if ((nDeltaOld == nDelta) || (nDelta == 0)) - for (int i = 0; i < nNumBars; i++) - arrSCBars[i]->m_bKeepSize = FALSE; - } - - return TRUE; -} - -void CSizingControlBar::AlignControlBars() -{ - int nFirst, nLast, nThis; - GetRowInfo(nFirst, nLast, nThis); - - BOOL bHorz = IsHorzDocked(); - BOOL bNeedRecalc = FALSE; - int nAlign = bHorz ? -2 : 0; - - CRect rc, rcDock; - m_pDockBar->GetWindowRect(&rcDock); - - for (int i = nFirst; i <= nLast; i++) - { - CSizingControlBar* pBar = - (CSizingControlBar*) m_pDockBar->m_arrBars[i]; - if (HIWORD(pBar) == 0) continue; // placeholder - if (!pBar->IsVisible()) continue; - - pBar->GetWindowRect(&rc); - rc.OffsetRect(-rcDock.TopLeft()); - - if (pBar->IsKindOf(RUNTIME_CLASS(CSizingControlBar))) - rc = CRect(rc.TopLeft(), - bHorz ? pBar->m_szHorz : pBar->m_szVert); - - if ((bHorz ? rc.left : rc.top) != nAlign) - { - if (!bHorz) - rc.OffsetRect(0, nAlign - rc.top - 2); - else if (m_nDockBarID == AFX_IDW_DOCKBAR_TOP) - rc.OffsetRect(nAlign - rc.left, -2); - else - rc.OffsetRect(nAlign - rc.left, 0); - pBar->MoveWindow(rc); - bNeedRecalc = TRUE; - } - nAlign += (bHorz ? rc.Width() : rc.Height()) - 2; - } - - if (bNeedRecalc) - m_pDockSite->DelayRecalcLayout(); -} - -void CSizingControlBar::OnUpdateCmdUI(CFrameWnd* pTarget, - BOOL bDisableIfNoHndler) -{ - UNUSED_ALWAYS(bDisableIfNoHndler); - UNUSED_ALWAYS(pTarget); -} - -void CSizingControlBar::LoadState(LPCTSTR lpszProfileName) -{ - ASSERT_VALID(this); - ASSERT(GetSafeHwnd()); // must be called after Create() - -#if defined(_SCB_REPLACE_MINIFRAME) && !defined(_SCB_MINIFRAME_CAPTION) - // compensate the caption miscalculation in CFrameWnd::SetDockState() - CDockState state; - state.LoadState(lpszProfileName); - - UINT nID = GetDlgCtrlID(); - for (int i = 0; i < state.m_arrBarInfo.GetSize(); i++) - { - CControlBarInfo* pInfo = (CControlBarInfo*)state.m_arrBarInfo[i]; - ASSERT(pInfo != NULL); - if (!pInfo->m_bFloating) - continue; - - // this is a floating dockbar - check the ID array - for (int j = 0; j < pInfo->m_arrBarID.GetSize(); j++) - if ((DWORD) pInfo->m_arrBarID[j] == nID) - { - // found this bar - offset origin and save settings - pInfo->m_pointPos.x++; - pInfo->m_pointPos.y += - ::GetSystemMetrics(SM_CYSMCAPTION) + 1; - pInfo->SaveState(lpszProfileName, i); - } - } -#endif //_SCB_REPLACE_MINIFRAME && !_SCB_MINIFRAME_CAPTION - - CWinApp* pApp = AfxGetApp(); - - TCHAR szSection[256]; - wsprintf(szSection, _T("%s-SCBar-%d"), lpszProfileName, - GetDlgCtrlID()); - - m_szHorz.cx = max(m_szMinHorz.cx, (int) pApp->GetProfileInt( - szSection, _T("sizeHorzCX"), m_szHorz.cx)); - m_szHorz.cy = max(m_szMinHorz.cy, (int) pApp->GetProfileInt( - szSection, _T("sizeHorzCY"), m_szHorz.cy)); - - m_szVert.cx = max(m_szMinVert.cx, (int) pApp->GetProfileInt( - szSection, _T("sizeVertCX"), m_szVert.cx)); - m_szVert.cy = max(m_szMinVert.cy, (int) pApp->GetProfileInt( - szSection, _T("sizeVertCY"), m_szVert.cy)); - - m_szFloat.cx = max(m_szMinFloat.cx, (int) pApp->GetProfileInt( - szSection, _T("sizeFloatCX"), m_szFloat.cx)); - m_szFloat.cy = max(m_szMinFloat.cy, (int) pApp->GetProfileInt( - szSection, _T("sizeFloatCY"), m_szFloat.cy)); -} - -void CSizingControlBar::SaveState(LPCTSTR lpszProfileName) -{ - // place your SaveState or GlobalSaveState call in - // CMainFrame's OnClose() or DestroyWindow(), not in OnDestroy() - ASSERT_VALID(this); - ASSERT(GetSafeHwnd()); - - CWinApp* pApp = AfxGetApp(); - - TCHAR szSection[256]; - wsprintf(szSection, _T("%s-SCBar-%d"), lpszProfileName, - GetDlgCtrlID()); - - pApp->WriteProfileInt(szSection, _T("sizeHorzCX"), m_szHorz.cx); - pApp->WriteProfileInt(szSection, _T("sizeHorzCY"), m_szHorz.cy); - - pApp->WriteProfileInt(szSection, _T("sizeVertCX"), m_szVert.cx); - pApp->WriteProfileInt(szSection, _T("sizeVertCY"), m_szVert.cy); - - pApp->WriteProfileInt(szSection, _T("sizeFloatCX"), m_szFloat.cx); - pApp->WriteProfileInt(szSection, _T("sizeFloatCY"), m_szFloat.cy); -} - -void CSizingControlBar::GlobalLoadState(CFrameWnd* pFrame, - LPCTSTR lpszProfileName) -{ - POSITION pos = pFrame->m_listControlBars.GetHeadPosition(); - while (pos != NULL) - { - CSizingControlBar* pBar = - (CSizingControlBar*) pFrame->m_listControlBars.GetNext(pos); - ASSERT(pBar != NULL); - if (pBar->IsKindOf(RUNTIME_CLASS(CSizingControlBar))) - pBar->LoadState(lpszProfileName); - } -} - -void CSizingControlBar::GlobalSaveState(CFrameWnd* pFrame, - LPCTSTR lpszProfileName) -{ - POSITION pos = pFrame->m_listControlBars.GetHeadPosition(); - while (pos != NULL) - { - CSizingControlBar* pBar = - (CSizingControlBar*) pFrame->m_listControlBars.GetNext(pos); - ASSERT(pBar != NULL); - if (pBar->IsKindOf(RUNTIME_CLASS(CSizingControlBar))) - pBar->SaveState(lpszProfileName); - } -} - -#ifdef _SCB_REPLACE_MINIFRAME -#ifndef _SCB_MINIFRAME_CAPTION -///////////////////////////////////////////////////////////////////////////// -// CSCBDockContext Drag Operations - -static void AdjustRectangle(CRect& rect, CPoint pt) -{ - int nXOffset = (pt.x < rect.left) ? (pt.x - rect.left) : - (pt.x > rect.right) ? (pt.x - rect.right) : 0; - int nYOffset = (pt.y < rect.top) ? (pt.y - rect.top) : - (pt.y > rect.bottom) ? (pt.y - rect.bottom) : 0; - rect.OffsetRect(nXOffset, nYOffset); -} - -void CSCBDockContext::StartDrag(CPoint pt) -{ - ASSERT_VALID(m_pBar); - m_bDragging = TRUE; - - InitLoop(); - - ASSERT((m_pBar->m_dwStyle & CBRS_SIZE_DYNAMIC) != 0); - - // get true bar size (including borders) - CRect rect; - m_pBar->GetWindowRect(rect); - m_ptLast = pt; - CSize sizeHorz = m_pBar->CalcDynamicLayout(0, LM_HORZ | LM_HORZDOCK); - CSize sizeVert = m_pBar->CalcDynamicLayout(0, LM_VERTDOCK); - CSize sizeFloat = m_pBar->CalcDynamicLayout(0, LM_HORZ | LM_MRUWIDTH); - - m_rectDragHorz = CRect(rect.TopLeft(), sizeHorz); - m_rectDragVert = CRect(rect.TopLeft(), sizeVert); - - // calculate frame dragging rectangle - m_rectFrameDragHorz = CRect(rect.TopLeft(), sizeFloat); - -#ifdef _MAC - CMiniFrameWnd::CalcBorders(&m_rectFrameDragHorz, - WS_THICKFRAME, WS_EX_FORCESIZEBOX); -#else - CMiniFrameWnd::CalcBorders(&m_rectFrameDragHorz, WS_THICKFRAME); -#endif - m_rectFrameDragHorz.DeflateRect(2, 2); - m_rectFrameDragVert = m_rectFrameDragHorz; - - // adjust rectangles so that point is inside - AdjustRectangle(m_rectDragHorz, pt); - AdjustRectangle(m_rectDragVert, pt); - AdjustRectangle(m_rectFrameDragHorz, pt); - AdjustRectangle(m_rectFrameDragVert, pt); - - // initialize tracking state and enter tracking loop - m_dwOverDockStyle = CanDock(); - Move(pt); // call it here to handle special keys - Track(); -} -#endif //_SCB_MINIFRAME_CAPTION - -///////////////////////////////////////////////////////////////////////////// -// CSCBMiniDockFrameWnd - -IMPLEMENT_DYNCREATE(CSCBMiniDockFrameWnd, baseCSCBMiniDockFrameWnd); - -BEGIN_MESSAGE_MAP(CSCBMiniDockFrameWnd, baseCSCBMiniDockFrameWnd) - //{{AFX_MSG_MAP(CSCBMiniDockFrameWnd) - ON_WM_NCLBUTTONDOWN() - ON_WM_GETMINMAXINFO() - ON_WM_WINDOWPOSCHANGING() - ON_WM_SIZE() - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -BOOL CSCBMiniDockFrameWnd::Create(CWnd* pParent, DWORD dwBarStyle) -{ - // set m_bInRecalcLayout to avoid flashing during creation - // RecalcLayout will be called once something is docked - m_bInRecalcLayout = TRUE; - - DWORD dwStyle = WS_POPUP|WS_CAPTION|WS_SYSMENU|MFS_MOVEFRAME| - MFS_4THICKFRAME|MFS_SYNCACTIVE|MFS_BLOCKSYSMENU| - FWS_SNAPTOBARS; - - if (dwBarStyle & CBRS_SIZE_DYNAMIC) - dwStyle &= ~MFS_MOVEFRAME; - - DWORD dwExStyle = 0; -#ifdef _MAC - if (dwBarStyle & CBRS_SIZE_DYNAMIC) - dwExStyle |= WS_EX_FORCESIZEBOX; - else - dwStyle &= ~(MFS_MOVEFRAME|MFS_4THICKFRAME); -#endif - - if (!CMiniFrameWnd::CreateEx(dwExStyle, - NULL, &afxChNil, dwStyle, rectDefault, pParent)) - { - m_bInRecalcLayout = FALSE; - return FALSE; - } - dwStyle = dwBarStyle & (CBRS_ALIGN_LEFT|CBRS_ALIGN_RIGHT) ? - CBRS_ALIGN_LEFT : CBRS_ALIGN_TOP; - dwStyle |= dwBarStyle & CBRS_FLOAT_MULTI; - CMenu* pSysMenu = GetSystemMenu(FALSE); - //pSysMenu->DeleteMenu(SC_SIZE, MF_BYCOMMAND); - CString strHide; - if (strHide.LoadString(AFX_IDS_HIDE)) - { - pSysMenu->DeleteMenu(SC_CLOSE, MF_BYCOMMAND); - pSysMenu->AppendMenu(MF_STRING|MF_ENABLED, SC_CLOSE, strHide); - } - - // must initially create with parent frame as parent - if (!m_wndDockBar.Create(pParent, WS_CHILD | WS_VISIBLE | dwStyle, - AFX_IDW_DOCKBAR_FLOAT)) - { - m_bInRecalcLayout = FALSE; - return FALSE; - } - - // set parent to CMiniDockFrameWnd - m_wndDockBar.SetParent(this); - m_bInRecalcLayout = FALSE; - - return TRUE; -} - -void CSCBMiniDockFrameWnd::OnNcLButtonDown(UINT nHitTest, CPoint point) -{ - if (nHitTest == HTCAPTION || nHitTest == HTCLOSE) - { - baseCSCBMiniDockFrameWnd::OnNcLButtonDown(nHitTest, point); - return; - } - - if (GetSizingControlBar() != NULL) - CMiniFrameWnd::OnNcLButtonDown(nHitTest, point); - else - baseCSCBMiniDockFrameWnd::OnNcLButtonDown(nHitTest, point); -} - -CSizingControlBar* CSCBMiniDockFrameWnd::GetSizingControlBar() -{ - CWnd* pWnd = GetWindow(GW_CHILD); // get the dockbar - if (pWnd == NULL) - return NULL; - - pWnd = pWnd->GetWindow(GW_CHILD); // get the controlbar - if (pWnd == NULL) - return NULL; - - if (!pWnd->IsKindOf(RUNTIME_CLASS(CSizingControlBar))) - return NULL; - - return (CSizingControlBar*) pWnd; -} - -void CSCBMiniDockFrameWnd::OnSize(UINT nType, int cx, int cy) -{ - CSizingControlBar* pBar = GetSizingControlBar(); - if ((pBar != NULL) && (GetStyle() & MFS_4THICKFRAME) == 0 - && pBar->IsVisible()) - pBar->m_szFloat = CSize(cx + 4, cy + 4); - - baseCSCBMiniDockFrameWnd::OnSize(nType, cx, cy); -} - -void CSCBMiniDockFrameWnd::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI) -{ - baseCSCBMiniDockFrameWnd::OnGetMinMaxInfo(lpMMI); - - CSizingControlBar* pBar = GetSizingControlBar(); - if (pBar != NULL) - { - CRect r(CPoint(0, 0), pBar->m_szMinFloat - CSize(4, 4)); -#ifndef _SCB_MINIFRAME_CAPTION - CMiniFrameWnd::CalcBorders(&r, WS_THICKFRAME); -#else - CMiniFrameWnd::CalcBorders(&r, WS_THICKFRAME|WS_CAPTION); -#endif //_SCB_MINIFRAME_CAPTION - lpMMI->ptMinTrackSize.x = r.Width(); - lpMMI->ptMinTrackSize.y = r.Height(); - - if(pBar->m_bFixedFloat) - { - lpMMI->ptMinTrackSize.x = pBar->m_szFixedFloat.cx; - lpMMI->ptMinTrackSize.y = pBar->m_szFixedFloat.cy; - lpMMI->ptMaxTrackSize.x = pBar->m_szFixedFloat.cx; - lpMMI->ptMaxTrackSize.y = pBar->m_szFixedFloat.cy; - } - } -} - -void CSCBMiniDockFrameWnd::OnWindowPosChanging(WINDOWPOS FAR* lpwndpos) -{ - if ((GetStyle() & MFS_4THICKFRAME) != 0) - { - CSizingControlBar* pBar = GetSizingControlBar(); - if (pBar != NULL) - { - lpwndpos->flags |= SWP_NOSIZE; // don't size this time - // prevents flicker - pBar->m_pDockBar->ModifyStyle(0, WS_CLIPCHILDREN); - // enable diagonal resizing - ModifyStyle(MFS_4THICKFRAME, 0); -#ifndef _SCB_MINIFRAME_CAPTION - // remove caption - ModifyStyle(WS_SYSMENU|WS_CAPTION, 0); -#endif - DelayRecalcLayout(); - pBar->PostMessage(WM_NCPAINT); - } - } - - CMiniFrameWnd::OnWindowPosChanging(lpwndpos); -} - -#endif //_SCB_REPLACE_MINIFRAME diff --git a/src/ui/sizecbar/sizecbar.h b/src/ui/sizecbar/sizecbar.h deleted file mode 100644 index 501e1de31..000000000 --- a/src/ui/sizecbar/sizecbar.h +++ /dev/null @@ -1,250 +0,0 @@ -///////////////////////////////////////////////////////////////////////// -// -// CSizingControlBar Version 2.43 -// -// Created: Jan 24, 1998 Last Modified: August 03, 2000 -// -// See the official site at www.datamekanix.com for documentation and -// the latest news. -// -///////////////////////////////////////////////////////////////////////// -// Copyright (C) 1998-2000 by Cristi Posea. All rights reserved. -// -// This code is free for personal and commercial use, providing this -// notice remains intact in the source files and all eventual changes are -// clearly marked with comments. -// -// You must obtain the author's consent before you can include this code -// in a software library. -// -// No warrantee of any kind, express or implied, is included with this -// software; use at your own risk, responsibility for damages (if any) to -// anyone resulting from the use of this software rests entirely with the -// user. -// -// Send bug reports, bug fixes, enhancements, requests, flames, etc. to -// cristi@datamekanix.com or post them at the message board at the site. -///////////////////////////////////////////////////////////////////////// - -#if !defined(__SIZECBAR_H__) -#define __SIZECBAR_H__ - -#include // for CDockContext -#include // for CTypedPtrArray - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - - -#if defined(_SCB_MINIFRAME_CAPTION) && !defined(_SCB_REPLACE_MINIFRAME) - #error "_SCB_MINIFRAME_CAPTION requires _SCB_REPLACE_MINIFRAME" -#endif - -///////////////////////////////////////////////////////////////////////// -// CSCBDockBar dummy class for access to protected members - -class CSCBDockBar : public CDockBar -{ - friend class CSizingControlBar; -}; - -///////////////////////////////////////////////////////////////////////// -// CSizingControlBar control bar styles - -#define SCBS_EDGELEFT 0x00000001 -#define SCBS_EDGERIGHT 0x00000002 -#define SCBS_EDGETOP 0x00000004 -#define SCBS_EDGEBOTTOM 0x00000008 -#define SCBS_EDGEALL 0x0000000F -#define SCBS_SHOWEDGES 0x00000010 -#define SCBS_SIZECHILD 0x00000020 - -///////////////////////////////////////////////////////////////////////// -// CSizingControlBar control bar - -#ifndef baseCSizingControlBar -#define baseCSizingControlBar CControlBar -#endif - -class CSizingControlBar; -typedef CTypedPtrArray CSCBArray; - -class CSizingControlBar : public baseCSizingControlBar -{ - DECLARE_DYNAMIC(CSizingControlBar); - -// Construction -public: - CSizingControlBar(); - - virtual BOOL Create(LPCTSTR lpszWindowName, CWnd* pParentWnd, - CSize sizeDefault, BOOL bHasGripper, - UINT nID, DWORD dwStyle = WS_CHILD | WS_VISIBLE | CBRS_TOP); - virtual BOOL Create(LPCTSTR lpszWindowName, CWnd* pParentWnd, - UINT nID, DWORD dwStyle = WS_CHILD | WS_VISIBLE | CBRS_TOP); - -// Attributes -public: - const BOOL IsFloating() const; - const BOOL IsHorzDocked() const; - const BOOL IsVertDocked() const; - const BOOL IsSideTracking() const; - const BOOL GetSCBStyle() const {return m_dwSCBStyle;} - -// Operations -public: -#if defined(_SCB_REPLACE_MINIFRAME) && !defined(_SCB_MINIFRAME_CAPTION) - void EnableDocking(DWORD dwDockStyle); -#endif - virtual void LoadState(LPCTSTR lpszProfileName); - virtual void SaveState(LPCTSTR lpszProfileName); - static void GlobalLoadState(CFrameWnd* pFrame, LPCTSTR lpszProfileName); - static void GlobalSaveState(CFrameWnd* pFrame, LPCTSTR lpszProfileName); - void SetSCBStyle(DWORD dwSCBStyle) - {m_dwSCBStyle = (dwSCBStyle & ~SCBS_EDGEALL);} - - void SetHeight(const int nHeight) - { - m_szFloat.cy = m_szHorz.cy = m_szVert.cy = nHeight; - m_pDockSite->DelayRecalcLayout(); - } - - -// Overridables - virtual void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler); - -// Overrides -public: - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CSizingControlBar) - public: - virtual CSize CalcFixedLayout(BOOL bStretch, BOOL bHorz); - virtual CSize CalcDynamicLayout(int nLength, DWORD dwMode); - //}}AFX_VIRTUAL - -// Implementation -public: - virtual ~CSizingControlBar(); - -protected: - // implementation helpers - UINT GetEdgeHTCode(int nEdge); - BOOL GetEdgeRect(CRect rcWnd, UINT nHitTest, CRect& rcEdge); - virtual void StartTracking(UINT nHitTest, CPoint point); - virtual void StopTracking(); - virtual void OnTrackUpdateSize(CPoint& point); - virtual void OnTrackInvertTracker(); - virtual void NcPaintGripper(CDC* pDC, CRect rcClient); - virtual void NcCalcClient(LPRECT pRc, UINT nDockBarID); - - virtual void AlignControlBars(); - void GetRowInfo(int& nFirst, int& nLast, int& nThis); - void GetRowSizingBars(CSCBArray& arrSCBars); - void GetRowSizingBars(CSCBArray& arrSCBars, int& nThis); - BOOL NegotiateSpace(int nLengthTotal, BOOL bHorz); - -protected: - DWORD m_dwSCBStyle; - UINT m_htEdge; - - CSize m_szHorz; - CSize m_szVert; - CSize m_szFloat; - CSize m_szMinHorz; - CSize m_szMinVert; - CSize m_szMinFloat; - int m_nTrackPosMin; - int m_nTrackPosMax; - int m_nTrackPosOld; - int m_nTrackEdgeOfs; - BOOL m_bTracking; - BOOL m_bKeepSize; - BOOL m_bParentSizing; - BOOL m_bDragShowContent; - UINT m_nDockBarID; - int m_cxEdge; - - BOOL m_bFixedFloat; - CSize m_szFixedFloat; - -// Generated message map functions -protected: - //{{AFX_MSG(CSizingControlBar) - afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); - afx_msg void OnNcPaint(); - afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp); - afx_msg HITTEST_RET OnNcHitTest(CPoint point); - afx_msg void OnCaptureChanged(CWnd *pWnd); - afx_msg void OnSettingChange(UINT uFlags, LPCTSTR lpszSection); - afx_msg void OnLButtonUp(UINT nFlags, CPoint point); - afx_msg void OnMouseMove(UINT nFlags, CPoint point); - afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point); - afx_msg void OnLButtonDown(UINT nFlags, CPoint point); - afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point); - afx_msg void OnRButtonDown(UINT nFlags, CPoint point); - afx_msg void OnWindowPosChanging(WINDOWPOS FAR* lpwndpos); - afx_msg void OnPaint(); - afx_msg void OnClose(); - afx_msg void OnSize(UINT nType, int cx, int cy); - //}}AFX_MSG - afx_msg LRESULT OnSetText(WPARAM wParam, LPARAM lParam); - - DECLARE_MESSAGE_MAP() - -#ifdef _SCB_REPLACE_MINIFRAME - friend class CSCBMiniDockFrameWnd; -#endif //_SCB_REPLACE_MINIFRAME -}; - -#ifdef _SCB_REPLACE_MINIFRAME -#ifndef _SCB_MINIFRAME_CAPTION -///////////////////////////////////////////////////////////////////////// -// CSCBDockContext dockcontext - -class CSCBDockContext : public CDockContext -{ -public: -// Construction - CSCBDockContext(CControlBar* pBar) : CDockContext(pBar) {} - -// Drag Operations - virtual void StartDrag(CPoint pt); -}; -#endif //_SCB_MINIFRAME_CAPTION - -///////////////////////////////////////////////////////////////////////// -// CSCBMiniDockFrameWnd miniframe - -#ifndef baseCSCBMiniDockFrameWnd -#define baseCSCBMiniDockFrameWnd CMiniDockFrameWnd -#endif - -class CSCBMiniDockFrameWnd : public baseCSCBMiniDockFrameWnd -{ - DECLARE_DYNCREATE(CSCBMiniDockFrameWnd) - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CSCBMiniDockFrameWnd) - public: - virtual BOOL Create(CWnd* pParent, DWORD dwBarStyle); - //}}AFX_VIRTUAL - -// Implementation -public: - CSizingControlBar* GetSizingControlBar(); - - //{{AFX_MSG(CSCBMiniDockFrameWnd) - afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point); - afx_msg void OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI); - afx_msg void OnWindowPosChanging(WINDOWPOS FAR* lpwndpos); - afx_msg void OnSize(UINT nType, int cx, int cy); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; -#endif //_SCB_REPLACE_MINIFRAME - -#endif // !defined(__SIZECBAR_H__) - - diff --git a/src/ui/sizecbar/sizecbar.sln b/src/ui/sizecbar/sizecbar.sln deleted file mode 100644 index 86888e812..000000000 --- a/src/ui/sizecbar/sizecbar.sln +++ /dev/null @@ -1,27 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sizecbar", "sizecbar.vcproj", "{61E6EB4D-2F1A-443B-94B0-E8200B26E99F}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Debug Unicode = Debug Unicode - Release = Release - Release Unicode = Release Unicode - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Debug.ActiveCfg = Debug|Win32 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Debug.Build.0 = Debug|Win32 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Debug Unicode.ActiveCfg = Debug Unicode|Win32 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Debug Unicode.Build.0 = Debug Unicode|Win32 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Release.ActiveCfg = Release|Win32 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Release.Build.0 = Release|Win32 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Release Unicode.ActiveCfg = Release Unicode|Win32 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Release Unicode.Build.0 = Release Unicode|Win32 - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/src/ui/sizecbar/sizecbar.vcproj b/src/ui/sizecbar/sizecbar.vcproj deleted file mode 100644 index 668b6451c..000000000 --- a/src/ui/sizecbar/sizecbar.vcproj +++ /dev/null @@ -1,255 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/ui/sizecbar/sizecbar_vs2005.sln b/src/ui/sizecbar/sizecbar_vs2005.sln deleted file mode 100644 index 434871d92..000000000 --- a/src/ui/sizecbar/sizecbar_vs2005.sln +++ /dev/null @@ -1,25 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sizecbar", "sizecbar_vs2005.vcproj", "{61E6EB4D-2F1A-443B-94B0-E8200B26E99F}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug Unicode|Win32 = Debug Unicode|Win32 - Debug|Win32 = Debug|Win32 - Release Unicode|Win32 = Release Unicode|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Debug|Win32.ActiveCfg = Debug|Win32 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Debug|Win32.Build.0 = Debug|Win32 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Release Unicode|Win32.Build.0 = Release Unicode|Win32 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Release|Win32.ActiveCfg = Release|Win32 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/ui/sizecbar/sizecbar_vs2005.vcproj b/src/ui/sizecbar/sizecbar_vs2005.vcproj deleted file mode 100644 index 83169d368..000000000 --- a/src/ui/sizecbar/sizecbar_vs2005.vcproj +++ /dev/null @@ -1,338 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/ui/sizecbar/sizecbar_vs2008.vcproj b/src/ui/sizecbar/sizecbar_vs2008.vcproj deleted file mode 100644 index 06b88f16e..000000000 --- a/src/ui/sizecbar/sizecbar_vs2008.vcproj +++ /dev/null @@ -1,329 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/ui/sizecbar/stdafx.cpp b/src/ui/sizecbar/stdafx.cpp deleted file mode 100644 index a700e9aa4..000000000 --- a/src/ui/sizecbar/stdafx.cpp +++ /dev/null @@ -1,8 +0,0 @@ -// stdafx.cpp : source file that includes just the standard includes -// sizecbar.pch will be the pre-compiled header -// stdafx.obj will contain the pre-compiled type information - -#include "stdafx.h" - -// TODO: reference any additional headers you need in STDAFX.H -// and not in this file diff --git a/src/ui/sizecbar/stdafx.h b/src/ui/sizecbar/stdafx.h deleted file mode 100644 index 3f2df5972..000000000 --- a/src/ui/sizecbar/stdafx.h +++ /dev/null @@ -1,24 +0,0 @@ -// stdafx.h : include file for standard system include files, -// or project specific include files that are used frequently, but -// are changed infrequently -// - -#pragma once - -#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers -#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit - -#ifndef VC_EXTRALEAN -#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers -#endif - -#if _MSC_VER >= 1400 // VS2005 changed result of OnNCHitTest -#define HITTEST_RET LRESULT -#else -#define HITTEST_RET UINT -#endif - -#include -#include // MFC core and standard components - -// TODO: reference additional headers your program requires here diff --git a/src/ui/ui.h b/src/ui/ui.h deleted file mode 100644 index dfca00217..000000000 --- a/src/ui/ui.h +++ /dev/null @@ -1,10 +0,0 @@ -#pragma once - -#include "CmdUI\CmdUI.h" -#include "ResizableLib\ResizableDialog.h" -#include "ResizableLib\ResizablePage.h" -#include "ResizableLib\ResizableSheet.h" -#include "sizecbar\sizecbar.h" -#include "sizecbar\scbarcf.h" -#include "sizecbar\scbarg.h" -#include "TreePropSheet\TreePropSheet.h" diff --git a/src/ui/ui.sln b/src/ui/ui.sln deleted file mode 100644 index 88e45311f..000000000 --- a/src/ui/ui.sln +++ /dev/null @@ -1,63 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CmdUI", "CmdUI\CmdUI.vcproj", "{03208025-D5C2-426A-B0FA-251D4338F30C}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ResizableLib", "ResizableLib\ResizableLib.vcproj", "{4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sizecbar", "sizecbar\sizecbar.vcproj", "{61E6EB4D-2F1A-443B-94B0-E8200B26E99F}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TreePropSheet", "TreePropSheet\TreePropSheet.vcproj", "{AB494732-EF6D-44D0-BCF8-80FF04858D10}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Debug Unicode = Debug Unicode - Release = Release - Release Unicode = Release Unicode - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {03208025-D5C2-426A-B0FA-251D4338F30C}.Debug.ActiveCfg = Debug|Win32 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Debug.Build.0 = Debug|Win32 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Debug Unicode.ActiveCfg = Debug Unicode|Win32 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Debug Unicode.Build.0 = Debug Unicode|Win32 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Release.ActiveCfg = Release|Win32 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Release.Build.0 = Release|Win32 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Release Unicode.ActiveCfg = Release Unicode|Win32 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Release Unicode.Build.0 = Release Unicode|Win32 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Debug.ActiveCfg = Debug|Win32 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Debug.Build.0 = Debug|Win32 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Debug Unicode.ActiveCfg = Debug Unicode|Win32 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Debug Unicode.Build.0 = Debug Unicode|Win32 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Release.ActiveCfg = Release|Win32 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Release.Build.0 = Release|Win32 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Release Unicode.ActiveCfg = Release Unicode|Win32 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Release Unicode.Build.0 = Release Unicode|Win32 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Debug.ActiveCfg = Debug|Win32 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Debug.Build.0 = Debug|Win32 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Debug Unicode.ActiveCfg = Debug Unicode|Win32 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Debug Unicode.Build.0 = Debug Unicode|Win32 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Release.ActiveCfg = Release|Win32 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Release.Build.0 = Release|Win32 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Release Unicode.ActiveCfg = Release Unicode|Win32 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Release Unicode.Build.0 = Release Unicode|Win32 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Debug.ActiveCfg = Debug|Win32 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Debug.Build.0 = Debug|Win32 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Debug Unicode.ActiveCfg = Debug Unicode|Win32 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Debug Unicode.Build.0 = Debug Unicode|Win32 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Release.ActiveCfg = Release|Win32 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Release.Build.0 = Release|Win32 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Release Unicode.ActiveCfg = Release Unicode|Win32 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Release Unicode.Build.0 = Release Unicode|Win32 - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/src/ui/ui_vs2005.sln b/src/ui/ui_vs2005.sln deleted file mode 100644 index c522ae290..000000000 --- a/src/ui/ui_vs2005.sln +++ /dev/null @@ -1,55 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CmdUI", "CmdUI\CmdUI_vs2005.vcproj", "{03208025-D5C2-426A-B0FA-251D4338F30C}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ResizableLib", "ResizableLib\ResizableLib_vs2005.vcproj", "{4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sizecbar", "sizecbar\sizecbar_vs2005.vcproj", "{61E6EB4D-2F1A-443B-94B0-E8200B26E99F}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TreePropSheet", "TreePropSheet\TreePropSheet_vs2005.vcproj", "{AB494732-EF6D-44D0-BCF8-80FF04858D10}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug Unicode|Win32 = Debug Unicode|Win32 - Debug|Win32 = Debug|Win32 - Release Unicode|Win32 = Release Unicode|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {03208025-D5C2-426A-B0FA-251D4338F30C}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Debug|Win32.ActiveCfg = Debug|Win32 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Debug|Win32.Build.0 = Debug|Win32 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Release Unicode|Win32.Build.0 = Release Unicode|Win32 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Release|Win32.ActiveCfg = Release|Win32 - {03208025-D5C2-426A-B0FA-251D4338F30C}.Release|Win32.Build.0 = Release|Win32 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Debug|Win32.ActiveCfg = Debug|Win32 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Debug|Win32.Build.0 = Debug|Win32 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Release Unicode|Win32.Build.0 = Release Unicode|Win32 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Release|Win32.ActiveCfg = Release|Win32 - {4CC7AE86-3E0A-430A-BFF4-BF00204CAFB0}.Release|Win32.Build.0 = Release|Win32 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Debug|Win32.ActiveCfg = Debug|Win32 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Debug|Win32.Build.0 = Debug|Win32 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Release Unicode|Win32.Build.0 = Release Unicode|Win32 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Release|Win32.ActiveCfg = Release|Win32 - {61E6EB4D-2F1A-443B-94B0-E8200B26E99F}.Release|Win32.Build.0 = Release|Win32 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Debug|Win32.ActiveCfg = Debug|Win32 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Debug|Win32.Build.0 = Debug|Win32 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Release Unicode|Win32.Build.0 = Release Unicode|Win32 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Release|Win32.ActiveCfg = Release|Win32 - {AB494732-EF6D-44D0-BCF8-80FF04858D10}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/zlib/ChangeLog.txt b/src/zlib/ChangeLog.txt deleted file mode 100644 index 09175304d..000000000 --- a/src/zlib/ChangeLog.txt +++ /dev/null @@ -1,855 +0,0 @@ - - ChangeLog file for zlib - -Changes in 1.2.3 (18 July 2005) -- Apply security vulnerability fixes to contrib/infback9 as well -- Clean up some text files (carriage returns, trailing space) -- Update testzlib, vstudio, masmx64, and masmx86 in contrib [Vollant] - -Changes in 1.2.2.4 (11 July 2005) -- Add inflatePrime() function for starting inflation at bit boundary -- Avoid some Visual C warnings in deflate.c -- Avoid more silly Visual C warnings in inflate.c and inftrees.c for 64-bit - compile -- Fix some spelling errors in comments [Betts] -- Correct inflateInit2() error return documentation in zlib.h -- Added zran.c example of compressed data random access to examples - directory, shows use of inflatePrime() -- Fix cast for assignments to strm->state in inflate.c and infback.c -- Fix zlibCompileFlags() in zutil.c to use 1L for long shifts [Oberhumer] -- Move declarations of gf2 functions to right place in crc32.c [Oberhumer] -- Add cast in trees.c t avoid a warning [Oberhumer] -- Avoid some warnings in fitblk.c, gun.c, gzjoin.c in examples [Oberhumer] -- Update make_vms.com [Zinser] -- Initialize state->write in inflateReset() since copied in inflate_fast() -- Be more strict on incomplete code sets in inflate_table() and increase - ENOUGH and MAXD -- this repairs a possible security vulnerability for - invalid inflate input. Thanks to Tavis Ormandy and Markus Oberhumer for - discovering the vulnerability and providing test cases. -- Add ia64 support to configure for HP-UX [Smith] -- Add error return to gzread() for format or i/o error [Levin] -- Use malloc.h for OS/2 [Necasek] - -Changes in 1.2.2.3 (27 May 2005) -- Replace 1U constants in inflate.c and inftrees.c for 64-bit compile -- Typecast fread() return values in gzio.c [Vollant] -- Remove trailing space in minigzip.c outmode (VC++ can't deal with it) -- Fix crc check bug in gzread() after gzungetc() [Heiner] -- Add the deflateTune() function to adjust internal compression parameters -- Add a fast gzip decompressor, gun.c, to examples (use of inflateBack) -- Remove an incorrect assertion in examples/zpipe.c -- Add C++ wrapper in infback9.h [Donais] -- Fix bug in inflateCopy() when decoding fixed codes -- Note in zlib.h how much deflateSetDictionary() actually uses -- Remove USE_DICT_HEAD in deflate.c (would mess up inflate if used) -- Add _WIN32_WCE to define WIN32 in zconf.in.h [Spencer] -- Don't include stderr.h or errno.h for _WIN32_WCE in zutil.h [Spencer] -- Add gzdirect() function to indicate transparent reads -- Update contrib/minizip [Vollant] -- Fix compilation of deflate.c when both ASMV and FASTEST [Oberhumer] -- Add casts in crc32.c to avoid warnings [Oberhumer] -- Add contrib/masmx64 [Vollant] -- Update contrib/asm586, asm686, masmx86, testzlib, vstudio [Vollant] - -Changes in 1.2.2.2 (30 December 2004) -- Replace structure assignments in deflate.c and inflate.c with zmemcpy to - avoid implicit memcpy calls (portability for no-library compilation) -- Increase sprintf() buffer size in gzdopen() to allow for large numbers -- Add INFLATE_STRICT to check distances against zlib header -- Improve WinCE errno handling and comments [Chang] -- Remove comment about no gzip header processing in FAQ -- Add Z_FIXED strategy option to deflateInit2() to force fixed trees -- Add updated make_vms.com [Coghlan], update README -- Create a new "examples" directory, move gzappend.c there, add zpipe.c, - fitblk.c, gzlog.[ch], gzjoin.c, and zlib_how.html. -- Add FAQ entry and comments in deflate.c on uninitialized memory access -- Add Solaris 9 make options in configure [Gilbert] -- Allow strerror() usage in gzio.c for STDC -- Fix DecompressBuf in contrib/delphi/ZLib.pas [ManChesTer] -- Update contrib/masmx86/inffas32.asm and gvmat32.asm [Vollant] -- Use z_off_t for adler32_combine() and crc32_combine() lengths -- Make adler32() much faster for small len -- Use OS_CODE in deflate() default gzip header - -Changes in 1.2.2.1 (31 October 2004) -- Allow inflateSetDictionary() call for raw inflate -- Fix inflate header crc check bug for file names and comments -- Add deflateSetHeader() and gz_header structure for custom gzip headers -- Add inflateGetheader() to retrieve gzip headers -- Add crc32_combine() and adler32_combine() functions -- Add alloc_func, free_func, in_func, out_func to Z_PREFIX list -- Use zstreamp consistently in zlib.h (inflate_back functions) -- Remove GUNZIP condition from definition of inflate_mode in inflate.h - and in contrib/inflate86/inffast.S [Truta, Anderson] -- Add support for AMD64 in contrib/inflate86/inffas86.c [Anderson] -- Update projects/README.projects and projects/visualc6 [Truta] -- Update win32/DLL_FAQ.txt [Truta] -- Avoid warning under NO_GZCOMPRESS in gzio.c; fix typo [Truta] -- Deprecate Z_ASCII; use Z_TEXT instead [Truta] -- Use a new algorithm for setting strm->data_type in trees.c [Truta] -- Do not define an exit() prototype in zutil.c unless DEBUG defined -- Remove prototype of exit() from zutil.c, example.c, minigzip.c [Truta] -- Add comment in zlib.h for Z_NO_FLUSH parameter to deflate() -- Fix Darwin build version identification [Peterson] - -Changes in 1.2.2 (3 October 2004) -- Update zlib.h comments on gzip in-memory processing -- Set adler to 1 in inflateReset() to support Java test suite [Walles] -- Add contrib/dotzlib [Ravn] -- Update win32/DLL_FAQ.txt [Truta] -- Update contrib/minizip [Vollant] -- Move contrib/visual-basic.txt to old/ [Truta] -- Fix assembler builds in projects/visualc6/ [Truta] - -Changes in 1.2.1.2 (9 September 2004) -- Update INDEX file -- Fix trees.c to update strm->data_type (no one ever noticed!) -- Fix bug in error case in inflate.c, infback.c, and infback9.c [Brown] -- Add "volatile" to crc table flag declaration (for DYNAMIC_CRC_TABLE) -- Add limited multitasking protection to DYNAMIC_CRC_TABLE -- Add NO_vsnprintf for VMS in zutil.h [Mozilla] -- Don't declare strerror() under VMS [Mozilla] -- Add comment to DYNAMIC_CRC_TABLE to use get_crc_table() to initialize -- Update contrib/ada [Anisimkov] -- Update contrib/minizip [Vollant] -- Fix configure to not hardcode directories for Darwin [Peterson] -- Fix gzio.c to not return error on empty files [Brown] -- Fix indentation; update version in contrib/delphi/ZLib.pas and - contrib/pascal/zlibpas.pas [Truta] -- Update mkasm.bat in contrib/masmx86 [Truta] -- Update contrib/untgz [Truta] -- Add projects/README.projects [Truta] -- Add project for MS Visual C++ 6.0 in projects/visualc6 [Cadieux, Truta] -- Update win32/DLL_FAQ.txt [Truta] -- Update list of Z_PREFIX symbols in zconf.h [Randers-Pehrson, Truta] -- Remove an unnecessary assignment to curr in inftrees.c [Truta] -- Add OS/2 to exe builds in configure [Poltorak] -- Remove err dummy parameter in zlib.h [Kientzle] - -Changes in 1.2.1.1 (9 January 2004) -- Update email address in README -- Several FAQ updates -- Fix a big fat bug in inftrees.c that prevented decoding valid - dynamic blocks with only literals and no distance codes -- - Thanks to "Hot Emu" for the bug report and sample file -- Add a note to puff.c on no distance codes case. - -Changes in 1.2.1 (17 November 2003) -- Remove a tab in contrib/gzappend/gzappend.c -- Update some interfaces in contrib for new zlib functions -- Update zlib version number in some contrib entries -- Add Windows CE definition for ptrdiff_t in zutil.h [Mai, Truta] -- Support shared libraries on Hurd and KFreeBSD [Brown] -- Fix error in NO_DIVIDE option of adler32.c - -Changes in 1.2.0.8 (4 November 2003) -- Update version in contrib/delphi/ZLib.pas and contrib/pascal/zlibpas.pas -- Add experimental NO_DIVIDE #define in adler32.c - - Possibly faster on some processors (let me know if it is) -- Correct Z_BLOCK to not return on first inflate call if no wrap -- Fix strm->data_type on inflate() return to correctly indicate EOB -- Add deflatePrime() function for appending in the middle of a byte -- Add contrib/gzappend for an example of appending to a stream -- Update win32/DLL_FAQ.txt [Truta] -- Delete Turbo C comment in README [Truta] -- Improve some indentation in zconf.h [Truta] -- Fix infinite loop on bad input in configure script [Church] -- Fix gzeof() for concatenated gzip files [Johnson] -- Add example to contrib/visual-basic.txt [Michael B.] -- Add -p to mkdir's in Makefile.in [vda] -- Fix configure to properly detect presence or lack of printf functions -- Add AS400 support [Monnerat] -- Add a little Cygwin support [Wilson] - -Changes in 1.2.0.7 (21 September 2003) -- Correct some debug formats in contrib/infback9 -- Cast a type in a debug statement in trees.c -- Change search and replace delimiter in configure from % to # [Beebe] -- Update contrib/untgz to 0.2 with various fixes [Truta] -- Add build support for Amiga [Nikl] -- Remove some directories in old that have been updated to 1.2 -- Add dylib building for Mac OS X in configure and Makefile.in -- Remove old distribution stuff from Makefile -- Update README to point to DLL_FAQ.txt, and add comment on Mac OS X -- Update links in README - -Changes in 1.2.0.6 (13 September 2003) -- Minor FAQ updates -- Update contrib/minizip to 1.00 [Vollant] -- Remove test of gz functions in example.c when GZ_COMPRESS defined [Truta] -- Update POSTINC comment for 68060 [Nikl] -- Add contrib/infback9 with deflate64 decoding (unsupported) -- For MVS define NO_vsnprintf and undefine FAR [van Burik] -- Add pragma for fdopen on MVS [van Burik] - -Changes in 1.2.0.5 (8 September 2003) -- Add OF to inflateBackEnd() declaration in zlib.h -- Remember start when using gzdopen in the middle of a file -- Use internal off_t counters in gz* functions to properly handle seeks -- Perform more rigorous check for distance-too-far in inffast.c -- Add Z_BLOCK flush option to return from inflate at block boundary -- Set strm->data_type on return from inflate - - Indicate bits unused, if at block boundary, and if in last block -- Replace size_t with ptrdiff_t in crc32.c, and check for correct size -- Add condition so old NO_DEFLATE define still works for compatibility -- FAQ update regarding the Windows DLL [Truta] -- INDEX update: add qnx entry, remove aix entry [Truta] -- Install zlib.3 into mandir [Wilson] -- Move contrib/zlib_dll_FAQ.txt to win32/DLL_FAQ.txt; update [Truta] -- Adapt the zlib interface to the new DLL convention guidelines [Truta] -- Introduce ZLIB_WINAPI macro to allow the export of functions using - the WINAPI calling convention, for Visual Basic [Vollant, Truta] -- Update msdos and win32 scripts and makefiles [Truta] -- Export symbols by name, not by ordinal, in win32/zlib.def [Truta] -- Add contrib/ada [Anisimkov] -- Move asm files from contrib/vstudio/vc70_32 to contrib/asm386 [Truta] -- Rename contrib/asm386 to contrib/masmx86 [Truta, Vollant] -- Add contrib/masm686 [Truta] -- Fix offsets in contrib/inflate86 and contrib/masmx86/inffas32.asm - [Truta, Vollant] -- Update contrib/delphi; rename to contrib/pascal; add example [Truta] -- Remove contrib/delphi2; add a new contrib/delphi [Truta] -- Avoid inclusion of the nonstandard in contrib/iostream, - and fix some method prototypes [Truta] -- Fix the ZCR_SEED2 constant to avoid warnings in contrib/minizip - [Truta] -- Avoid the use of backslash (\) in contrib/minizip [Vollant] -- Fix file time handling in contrib/untgz; update makefiles [Truta] -- Update contrib/vstudio/vc70_32 to comply with the new DLL guidelines - [Vollant] -- Remove contrib/vstudio/vc15_16 [Vollant] -- Rename contrib/vstudio/vc70_32 to contrib/vstudio/vc7 [Truta] -- Update README.contrib [Truta] -- Invert the assignment order of match_head and s->prev[...] in - INSERT_STRING [Truta] -- Compare TOO_FAR with 32767 instead of 32768, to avoid 16-bit warnings - [Truta] -- Compare function pointers with 0, not with NULL or Z_NULL [Truta] -- Fix prototype of syncsearch in inflate.c [Truta] -- Introduce ASMINF macro to be enabled when using an ASM implementation - of inflate_fast [Truta] -- Change NO_DEFLATE to NO_GZCOMPRESS [Truta] -- Modify test_gzio in example.c to take a single file name as a - parameter [Truta] -- Exit the example.c program if gzopen fails [Truta] -- Add type casts around strlen in example.c [Truta] -- Remove casting to sizeof in minigzip.c; give a proper type - to the variable compared with SUFFIX_LEN [Truta] -- Update definitions of STDC and STDC99 in zconf.h [Truta] -- Synchronize zconf.h with the new Windows DLL interface [Truta] -- Use SYS16BIT instead of __32BIT__ to distinguish between - 16- and 32-bit platforms [Truta] -- Use far memory allocators in small 16-bit memory models for - Turbo C [Truta] -- Add info about the use of ASMV, ASMINF and ZLIB_WINAPI in - zlibCompileFlags [Truta] -- Cygwin has vsnprintf [Wilson] -- In Windows16, OS_CODE is 0, as in MSDOS [Truta] -- In Cygwin, OS_CODE is 3 (Unix), not 11 (Windows32) [Wilson] - -Changes in 1.2.0.4 (10 August 2003) -- Minor FAQ updates -- Be more strict when checking inflateInit2's windowBits parameter -- Change NO_GUNZIP compile option to NO_GZIP to cover deflate as well -- Add gzip wrapper option to deflateInit2 using windowBits -- Add updated QNX rule in configure and qnx directory [Bonnefoy] -- Make inflate distance-too-far checks more rigorous -- Clean up FAR usage in inflate -- Add casting to sizeof() in gzio.c and minigzip.c - -Changes in 1.2.0.3 (19 July 2003) -- Fix silly error in gzungetc() implementation [Vollant] -- Update contrib/minizip and contrib/vstudio [Vollant] -- Fix printf format in example.c -- Correct cdecl support in zconf.in.h [Anisimkov] -- Minor FAQ updates - -Changes in 1.2.0.2 (13 July 2003) -- Add ZLIB_VERNUM in zlib.h for numerical preprocessor comparisons -- Attempt to avoid warnings in crc32.c for pointer-int conversion -- Add AIX to configure, remove aix directory [Bakker] -- Add some casts to minigzip.c -- Improve checking after insecure sprintf() or vsprintf() calls -- Remove #elif's from crc32.c -- Change leave label to inf_leave in inflate.c and infback.c to avoid - library conflicts -- Remove inflate gzip decoding by default--only enable gzip decoding by - special request for stricter backward compatibility -- Add zlibCompileFlags() function to return compilation information -- More typecasting in deflate.c to avoid warnings -- Remove leading underscore from _Capital #defines [Truta] -- Fix configure to link shared library when testing -- Add some Windows CE target adjustments [Mai] -- Remove #define ZLIB_DLL in zconf.h [Vollant] -- Add zlib.3 [Rodgers] -- Update RFC URL in deflate.c and algorithm.txt [Mai] -- Add zlib_dll_FAQ.txt to contrib [Truta] -- Add UL to some constants [Truta] -- Update minizip and vstudio [Vollant] -- Remove vestigial NEED_DUMMY_RETURN from zconf.in.h -- Expand use of NO_DUMMY_DECL to avoid all dummy structures -- Added iostream3 to contrib [Schwardt] -- Replace rewind() with fseek() for WinCE [Truta] -- Improve setting of zlib format compression level flags - - Report 0 for huffman and rle strategies and for level == 0 or 1 - - Report 2 only for level == 6 -- Only deal with 64K limit when necessary at compile time [Truta] -- Allow TOO_FAR check to be turned off at compile time [Truta] -- Add gzclearerr() function [Souza] -- Add gzungetc() function - -Changes in 1.2.0.1 (17 March 2003) -- Add Z_RLE strategy for run-length encoding [Truta] - - When Z_RLE requested, restrict matches to distance one - - Update zlib.h, minigzip.c, gzopen(), gzdopen() for Z_RLE -- Correct FASTEST compilation to allow level == 0 -- Clean up what gets compiled for FASTEST -- Incorporate changes to zconf.in.h [Vollant] - - Refine detection of Turbo C need for dummy returns - - Refine ZLIB_DLL compilation - - Include additional header file on VMS for off_t typedef -- Try to use _vsnprintf where it supplants vsprintf [Vollant] -- Add some casts in inffast.c -- Enchance comments in zlib.h on what happens if gzprintf() tries to - write more than 4095 bytes before compression -- Remove unused state from inflateBackEnd() -- Remove exit(0) from minigzip.c, example.c -- Get rid of all those darn tabs -- Add "check" target to Makefile.in that does the same thing as "test" -- Add "mostlyclean" and "maintainer-clean" targets to Makefile.in -- Update contrib/inflate86 [Anderson] -- Update contrib/testzlib, contrib/vstudio, contrib/minizip [Vollant] -- Add msdos and win32 directories with makefiles [Truta] -- More additions and improvements to the FAQ - -Changes in 1.2.0 (9 March 2003) -- New and improved inflate code - - About 20% faster - - Does not allocate 32K window unless and until needed - - Automatically detects and decompresses gzip streams - - Raw inflate no longer needs an extra dummy byte at end - - Added inflateBack functions using a callback interface--even faster - than inflate, useful for file utilities (gzip, zip) - - Added inflateCopy() function to record state for random access on - externally generated deflate streams (e.g. in gzip files) - - More readable code (I hope) -- New and improved crc32() - - About 50% faster, thanks to suggestions from Rodney Brown -- Add deflateBound() and compressBound() functions -- Fix memory leak in deflateInit2() -- Permit setting dictionary for raw deflate (for parallel deflate) -- Fix const declaration for gzwrite() -- Check for some malloc() failures in gzio.c -- Fix bug in gzopen() on single-byte file 0x1f -- Fix bug in gzread() on concatenated file with 0x1f at end of buffer - and next buffer doesn't start with 0x8b -- Fix uncompress() to return Z_DATA_ERROR on truncated input -- Free memory at end of example.c -- Remove MAX #define in trees.c (conflicted with some libraries) -- Fix static const's in deflate.c, gzio.c, and zutil.[ch] -- Declare malloc() and free() in gzio.c if STDC not defined -- Use malloc() instead of calloc() in zutil.c if int big enough -- Define STDC for AIX -- Add aix/ with approach for compiling shared library on AIX -- Add HP-UX support for shared libraries in configure -- Add OpenUNIX support for shared libraries in configure -- Use $cc instead of gcc to build shared library -- Make prefix directory if needed when installing -- Correct Macintosh avoidance of typedef Byte in zconf.h -- Correct Turbo C memory allocation when under Linux -- Use libz.a instead of -lz in Makefile (assure use of compiled library) -- Update configure to check for snprintf or vsnprintf functions and their - return value, warn during make if using an insecure function -- Fix configure problem with compile-time knowledge of HAVE_UNISTD_H that - is lost when library is used--resolution is to build new zconf.h -- Documentation improvements (in zlib.h): - - Document raw deflate and inflate - - Update RFCs URL - - Point out that zlib and gzip formats are different - - Note that Z_BUF_ERROR is not fatal - - Document string limit for gzprintf() and possible buffer overflow - - Note requirement on avail_out when flushing - - Note permitted values of flush parameter of inflate() -- Add some FAQs (and even answers) to the FAQ -- Add contrib/inflate86/ for x86 faster inflate -- Add contrib/blast/ for PKWare Data Compression Library decompression -- Add contrib/puff/ simple inflate for deflate format description - -Changes in 1.1.4 (11 March 2002) -- ZFREE was repeated on same allocation on some error conditions. - This creates a security problem described in - http://www.zlib.org/advisory-2002-03-11.txt -- Returned incorrect error (Z_MEM_ERROR) on some invalid data -- Avoid accesses before window for invalid distances with inflate window - less than 32K. -- force windowBits > 8 to avoid a bug in the encoder for a window size - of 256 bytes. (A complete fix will be available in 1.1.5). - -Changes in 1.1.3 (9 July 1998) -- fix "an inflate input buffer bug that shows up on rare but persistent - occasions" (Mark) -- fix gzread and gztell for concatenated .gz files (Didier Le Botlan) -- fix gzseek(..., SEEK_SET) in write mode -- fix crc check after a gzeek (Frank Faubert) -- fix miniunzip when the last entry in a zip file is itself a zip file - (J Lillge) -- add contrib/asm586 and contrib/asm686 (Brian Raiter) - See http://www.muppetlabs.com/~breadbox/software/assembly.html -- add support for Delphi 3 in contrib/delphi (Bob Dellaca) -- add support for C++Builder 3 and Delphi 3 in contrib/delphi2 (Davide Moretti) -- do not exit prematurely in untgz if 0 at start of block (Magnus Holmgren) -- use macro EXTERN instead of extern to support DLL for BeOS (Sander Stoks) -- added a FAQ file - -- Support gzdopen on Mac with Metrowerks (Jason Linhart) -- Do not redefine Byte on Mac (Brad Pettit & Jason Linhart) -- define SEEK_END too if SEEK_SET is not defined (Albert Chin-A-Young) -- avoid some warnings with Borland C (Tom Tanner) -- fix a problem in contrib/minizip/zip.c for 16-bit MSDOS (Gilles Vollant) -- emulate utime() for WIN32 in contrib/untgz (Gilles Vollant) -- allow several arguments to configure (Tim Mooney, Frodo Looijaard) -- use libdir and includedir in Makefile.in (Tim Mooney) -- support shared libraries on OSF1 V4 (Tim Mooney) -- remove so_locations in "make clean" (Tim Mooney) -- fix maketree.c compilation error (Glenn, Mark) -- Python interface to zlib now in Python 1.5 (Jeremy Hylton) -- new Makefile.riscos (Rich Walker) -- initialize static descriptors in trees.c for embedded targets (Nick Smith) -- use "foo-gz" in example.c for RISCOS and VMS (Nick Smith) -- add the OS/2 files in Makefile.in too (Andrew Zabolotny) -- fix fdopen and halloc macros for Microsoft C 6.0 (Tom Lane) -- fix maketree.c to allow clean compilation of inffixed.h (Mark) -- fix parameter check in deflateCopy (Gunther Nikl) -- cleanup trees.c, use compressed_len only in debug mode (Christian Spieler) -- Many portability patches by Christian Spieler: - . zutil.c, zutil.h: added "const" for zmem* - . Make_vms.com: fixed some typos - . Make_vms.com: msdos/Makefile.*: removed zutil.h from some dependency lists - . msdos/Makefile.msc: remove "default rtl link library" info from obj files - . msdos/Makefile.*: use model-dependent name for the built zlib library - . msdos/Makefile.emx, nt/Makefile.emx, nt/Makefile.gcc: - new makefiles, for emx (DOS/OS2), emx&rsxnt and mingw32 (Windows 9x / NT) -- use define instead of typedef for Bytef also for MSC small/medium (Tom Lane) -- replace __far with _far for better portability (Christian Spieler, Tom Lane) -- fix test for errno.h in configure (Tim Newsham) - -Changes in 1.1.2 (19 March 98) -- added contrib/minzip, mini zip and unzip based on zlib (Gilles Vollant) - See http://www.winimage.com/zLibDll/unzip.html -- preinitialize the inflate tables for fixed codes, to make the code - completely thread safe (Mark) -- some simplifications and slight speed-up to the inflate code (Mark) -- fix gzeof on non-compressed files (Allan Schrum) -- add -std1 option in configure for OSF1 to fix gzprintf (Martin Mokrejs) -- use default value of 4K for Z_BUFSIZE for 16-bit MSDOS (Tim Wegner + Glenn) -- added os2/Makefile.def and os2/zlib.def (Andrew Zabolotny) -- add shared lib support for UNIX_SV4.2MP (MATSUURA Takanori) -- do not wrap extern "C" around system includes (Tom Lane) -- mention zlib binding for TCL in README (Andreas Kupries) -- added amiga/Makefile.pup for Amiga powerUP SAS/C PPC (Andreas Kleinert) -- allow "make install prefix=..." even after configure (Glenn Randers-Pehrson) -- allow "configure --prefix $HOME" (Tim Mooney) -- remove warnings in example.c and gzio.c (Glenn Randers-Pehrson) -- move Makefile.sas to amiga/Makefile.sas - -Changes in 1.1.1 (27 Feb 98) -- fix macros _tr_tally_* in deflate.h for debug mode (Glenn Randers-Pehrson) -- remove block truncation heuristic which had very marginal effect for zlib - (smaller lit_bufsize than in gzip 1.2.4) and degraded a little the - compression ratio on some files. This also allows inlining _tr_tally for - matches in deflate_slow. -- added msdos/Makefile.w32 for WIN32 Microsoft Visual C++ (Bob Frazier) - -Changes in 1.1.0 (24 Feb 98) -- do not return STREAM_END prematurely in inflate (John Bowler) -- revert to the zlib 1.0.8 inflate to avoid the gcc 2.8.0 bug (Jeremy Buhler) -- compile with -DFASTEST to get compression code optimized for speed only -- in minigzip, try mmap'ing the input file first (Miguel Albrecht) -- increase size of I/O buffers in minigzip.c and gzio.c (not a big gain - on Sun but significant on HP) - -- add a pointer to experimental unzip library in README (Gilles Vollant) -- initialize variable gcc in configure (Chris Herborth) - -Changes in 1.0.9 (17 Feb 1998) -- added gzputs and gzgets functions -- do not clear eof flag in gzseek (Mark Diekhans) -- fix gzseek for files in transparent mode (Mark Diekhans) -- do not assume that vsprintf returns the number of bytes written (Jens Krinke) -- replace EXPORT with ZEXPORT to avoid conflict with other programs -- added compress2 in zconf.h, zlib.def, zlib.dnt -- new asm code from Gilles Vollant in contrib/asm386 -- simplify the inflate code (Mark): - . Replace ZALLOC's in huft_build() with single ZALLOC in inflate_blocks_new() - . ZALLOC the length list in inflate_trees_fixed() instead of using stack - . ZALLOC the value area for huft_build() instead of using stack - . Simplify Z_FINISH check in inflate() - -- Avoid gcc 2.8.0 comparison bug a little differently than zlib 1.0.8 -- in inftrees.c, avoid cc -O bug on HP (Farshid Elahi) -- in zconf.h move the ZLIB_DLL stuff earlier to avoid problems with - the declaration of FAR (Gilles VOllant) -- install libz.so* with mode 755 (executable) instead of 644 (Marc Lehmann) -- read_buf buf parameter of type Bytef* instead of charf* -- zmemcpy parameters are of type Bytef*, not charf* (Joseph Strout) -- do not redeclare unlink in minigzip.c for WIN32 (John Bowler) -- fix check for presence of directories in "make install" (Ian Willis) - -Changes in 1.0.8 (27 Jan 1998) -- fixed offsets in contrib/asm386/gvmat32.asm (Gilles Vollant) -- fix gzgetc and gzputc for big endian systems (Markus Oberhumer) -- added compress2() to allow setting the compression level -- include sys/types.h to get off_t on some systems (Marc Lehmann & QingLong) -- use constant arrays for the static trees in trees.c instead of computing - them at run time (thanks to Ken Raeburn for this suggestion). To create - trees.h, compile with GEN_TREES_H and run "make test". -- check return code of example in "make test" and display result -- pass minigzip command line options to file_compress -- simplifying code of inflateSync to avoid gcc 2.8 bug - -- support CC="gcc -Wall" in configure -s (QingLong) -- avoid a flush caused by ftell in gzopen for write mode (Ken Raeburn) -- fix test for shared library support to avoid compiler warnings -- zlib.lib -> zlib.dll in msdos/zlib.rc (Gilles Vollant) -- check for TARGET_OS_MAC in addition to MACOS (Brad Pettit) -- do not use fdopen for Metrowerks on Mac (Brad Pettit)) -- add checks for gzputc and gzputc in example.c -- avoid warnings in gzio.c and deflate.c (Andreas Kleinert) -- use const for the CRC table (Ken Raeburn) -- fixed "make uninstall" for shared libraries -- use Tracev instead of Trace in infblock.c -- in example.c use correct compressed length for test_sync -- suppress +vnocompatwarnings in configure for HPUX (not always supported) - -Changes in 1.0.7 (20 Jan 1998) -- fix gzseek which was broken in write mode -- return error for gzseek to negative absolute position -- fix configure for Linux (Chun-Chung Chen) -- increase stack space for MSC (Tim Wegner) -- get_crc_table and inflateSyncPoint are EXPORTed (Gilles Vollant) -- define EXPORTVA for gzprintf (Gilles Vollant) -- added man page zlib.3 (Rick Rodgers) -- for contrib/untgz, fix makedir() and improve Makefile - -- check gzseek in write mode in example.c -- allocate extra buffer for seeks only if gzseek is actually called -- avoid signed/unsigned comparisons (Tim Wegner, Gilles Vollant) -- add inflateSyncPoint in zconf.h -- fix list of exported functions in nt/zlib.dnt and mdsos/zlib.def - -Changes in 1.0.6 (19 Jan 1998) -- add functions gzprintf, gzputc, gzgetc, gztell, gzeof, gzseek, gzrewind and - gzsetparams (thanks to Roland Giersig and Kevin Ruland for some of this code) -- Fix a deflate bug occurring only with compression level 0 (thanks to - Andy Buckler for finding this one). -- In minigzip, pass transparently also the first byte for .Z files. -- return Z_BUF_ERROR instead of Z_OK if output buffer full in uncompress() -- check Z_FINISH in inflate (thanks to Marc Schluper) -- Implement deflateCopy (thanks to Adam Costello) -- make static libraries by default in configure, add --shared option. -- move MSDOS or Windows specific files to directory msdos -- suppress the notion of partial flush to simplify the interface - (but the symbol Z_PARTIAL_FLUSH is kept for compatibility with 1.0.4) -- suppress history buffer provided by application to simplify the interface - (this feature was not implemented anyway in 1.0.4) -- next_in and avail_in must be initialized before calling inflateInit or - inflateInit2 -- add EXPORT in all exported functions (for Windows DLL) -- added Makefile.nt (thanks to Stephen Williams) -- added the unsupported "contrib" directory: - contrib/asm386/ by Gilles Vollant - 386 asm code replacing longest_match(). - contrib/iostream/ by Kevin Ruland - A C++ I/O streams interface to the zlib gz* functions - contrib/iostream2/ by Tyge Løvset - Another C++ I/O streams interface - contrib/untgz/ by "Pedro A. Aranda Guti\irrez" - A very simple tar.gz file extractor using zlib - contrib/visual-basic.txt by Carlos Rios - How to use compress(), uncompress() and the gz* functions from VB. -- pass params -f (filtered data), -h (huffman only), -1 to -9 (compression - level) in minigzip (thanks to Tom Lane) - -- use const for rommable constants in deflate -- added test for gzseek and gztell in example.c -- add undocumented function inflateSyncPoint() (hack for Paul Mackerras) -- add undocumented function zError to convert error code to string - (for Tim Smithers) -- Allow compilation of gzio with -DNO_DEFLATE to avoid the compression code. -- Use default memcpy for Symantec MSDOS compiler. -- Add EXPORT keyword for check_func (needed for Windows DLL) -- add current directory to LD_LIBRARY_PATH for "make test" -- create also a link for libz.so.1 -- added support for FUJITSU UXP/DS (thanks to Toshiaki Nomura) -- use $(SHAREDLIB) instead of libz.so in Makefile.in (for HPUX) -- added -soname for Linux in configure (Chun-Chung Chen, -- assign numbers to the exported functions in zlib.def (for Windows DLL) -- add advice in zlib.h for best usage of deflateSetDictionary -- work around compiler bug on Atari (cast Z_NULL in call of s->checkfn) -- allow compilation with ANSI keywords only enabled for TurboC in large model -- avoid "versionString"[0] (Borland bug) -- add NEED_DUMMY_RETURN for Borland -- use variable z_verbose for tracing in debug mode (L. Peter Deutsch). -- allow compilation with CC -- defined STDC for OS/2 (David Charlap) -- limit external names to 8 chars for MVS (Thomas Lund) -- in minigzip.c, use static buffers only for 16-bit systems -- fix suffix check for "minigzip -d foo.gz" -- do not return an error for the 2nd of two consecutive gzflush() (Felix Lee) -- use _fdopen instead of fdopen for MSC >= 6.0 (Thomas Fanslau) -- added makelcc.bat for lcc-win32 (Tom St Denis) -- in Makefile.dj2, use copy and del instead of install and rm (Frank Donahoe) -- Avoid expanded $Id: ChangeLog.txt 126 2003-11-09 01:53:27Z gabest $. Use "rcs -kb" or "cvs admin -kb" to avoid Id expansion. -- check for unistd.h in configure (for off_t) -- remove useless check parameter in inflate_blocks_free -- avoid useless assignment of s->check to itself in inflate_blocks_new -- do not flush twice in gzclose (thanks to Ken Raeburn) -- rename FOPEN as F_OPEN to avoid clash with /usr/include/sys/file.h -- use NO_ERRNO_H instead of enumeration of operating systems with errno.h -- work around buggy fclose on pipes for HP/UX -- support zlib DLL with BORLAND C++ 5.0 (thanks to Glenn Randers-Pehrson) -- fix configure if CC is already equal to gcc - -Changes in 1.0.5 (3 Jan 98) -- Fix inflate to terminate gracefully when fed corrupted or invalid data -- Use const for rommable constants in inflate -- Eliminate memory leaks on error conditions in inflate -- Removed some vestigial code in inflate -- Update web address in README - -Changes in 1.0.4 (24 Jul 96) -- In very rare conditions, deflate(s, Z_FINISH) could fail to produce an EOF - bit, so the decompressor could decompress all the correct data but went - on to attempt decompressing extra garbage data. This affected minigzip too. -- zlibVersion and gzerror return const char* (needed for DLL) -- port to RISCOS (no fdopen, no multiple dots, no unlink, no fileno) -- use z_error only for DEBUG (avoid problem with DLLs) - -Changes in 1.0.3 (2 Jul 96) -- use z_streamp instead of z_stream *, which is now a far pointer in MSDOS - small and medium models; this makes the library incompatible with previous - versions for these models. (No effect in large model or on other systems.) -- return OK instead of BUF_ERROR if previous deflate call returned with - avail_out as zero but there is nothing to do -- added memcmp for non STDC compilers -- define NO_DUMMY_DECL for more Mac compilers (.h files merged incorrectly) -- define __32BIT__ if __386__ or i386 is defined (pb. with Watcom and SCO) -- better check for 16-bit mode MSC (avoids problem with Symantec) - -Changes in 1.0.2 (23 May 96) -- added Windows DLL support -- added a function zlibVersion (for the DLL support) -- fixed declarations using Bytef in infutil.c (pb with MSDOS medium model) -- Bytef is define's instead of typedef'd only for Borland C -- avoid reading uninitialized memory in example.c -- mention in README that the zlib format is now RFC1950 -- updated Makefile.dj2 -- added algorithm.doc - -Changes in 1.0.1 (20 May 96) [1.0 skipped to avoid confusion] -- fix array overlay in deflate.c which sometimes caused bad compressed data -- fix inflate bug with empty stored block -- fix MSDOS medium model which was broken in 0.99 -- fix deflateParams() which could generated bad compressed data. -- Bytef is define'd instead of typedef'ed (work around Borland bug) -- added an INDEX file -- new makefiles for DJGPP (Makefile.dj2), 32-bit Borland (Makefile.b32), - Watcom (Makefile.wat), Amiga SAS/C (Makefile.sas) -- speed up adler32 for modern machines without auto-increment -- added -ansi for IRIX in configure -- static_init_done in trees.c is an int -- define unlink as delete for VMS -- fix configure for QNX -- add configure branch for SCO and HPUX -- avoid many warnings (unused variables, dead assignments, etc...) -- no fdopen for BeOS -- fix the Watcom fix for 32 bit mode (define FAR as empty) -- removed redefinition of Byte for MKWERKS -- work around an MWKERKS bug (incorrect merge of all .h files) - -Changes in 0.99 (27 Jan 96) -- allow preset dictionary shared between compressor and decompressor -- allow compression level 0 (no compression) -- add deflateParams in zlib.h: allow dynamic change of compression level - and compression strategy. -- test large buffers and deflateParams in example.c -- add optional "configure" to build zlib as a shared library -- suppress Makefile.qnx, use configure instead -- fixed deflate for 64-bit systems (detected on Cray) -- fixed inflate_blocks for 64-bit systems (detected on Alpha) -- declare Z_DEFLATED in zlib.h (possible parameter for deflateInit2) -- always return Z_BUF_ERROR when deflate() has nothing to do -- deflateInit and inflateInit are now macros to allow version checking -- prefix all global functions and types with z_ with -DZ_PREFIX -- make falloc completely reentrant (inftrees.c) -- fixed very unlikely race condition in ct_static_init -- free in reverse order of allocation to help memory manager -- use zlib-1.0/* instead of zlib/* inside the tar.gz -- make zlib warning-free with "gcc -O3 -Wall -Wwrite-strings -Wpointer-arith - -Wconversion -Wstrict-prototypes -Wmissing-prototypes" -- allow gzread on concatenated .gz files -- deflateEnd now returns Z_DATA_ERROR if it was premature -- deflate is finally (?) fully deterministic (no matches beyond end of input) -- Document Z_SYNC_FLUSH -- add uninstall in Makefile -- Check for __cpluplus in zlib.h -- Better test in ct_align for partial flush -- avoid harmless warnings for Borland C++ -- initialize hash_head in deflate.c -- avoid warning on fdopen (gzio.c) for HP cc -Aa -- include stdlib.h for STDC compilers -- include errno.h for Cray -- ignore error if ranlib doesn't exist -- call ranlib twice for NeXTSTEP -- use exec_prefix instead of prefix for libz.a -- renamed ct_* as _tr_* to avoid conflict with applications -- clear z->msg in inflateInit2 before any error return -- initialize opaque in example.c, gzio.c, deflate.c and inflate.c -- fixed typo in zconf.h (_GNUC__ => __GNUC__) -- check for WIN32 in zconf.h and zutil.c (avoid farmalloc in 32-bit mode) -- fix typo in Make_vms.com (f$trnlnm -> f$getsyi) -- in fcalloc, normalize pointer if size > 65520 bytes -- don't use special fcalloc for 32 bit Borland C++ -- use STDC instead of __GO32__ to avoid redeclaring exit, calloc, etc... -- use Z_BINARY instead of BINARY -- document that gzclose after gzdopen will close the file -- allow "a" as mode in gzopen. -- fix error checking in gzread -- allow skipping .gz extra-field on pipes -- added reference to Perl interface in README -- put the crc table in FAR data (I dislike more and more the medium model :) -- added get_crc_table -- added a dimension to all arrays (Borland C can't count). -- workaround Borland C bug in declaration of inflate_codes_new & inflate_fast -- guard against multiple inclusion of *.h (for precompiled header on Mac) -- Watcom C pretends to be Microsoft C small model even in 32 bit mode. -- don't use unsized arrays to avoid silly warnings by Visual C++: - warning C4746: 'inflate_mask' : unsized array treated as '__far' - (what's wrong with far data in far model?). -- define enum out of inflate_blocks_state to allow compilation with C++ - -Changes in 0.95 (16 Aug 95) -- fix MSDOS small and medium model (now easier to adapt to any compiler) -- inlined send_bits -- fix the final (:-) bug for deflate with flush (output was correct but - not completely flushed in rare occasions). -- default window size is same for compression and decompression - (it's now sufficient to set MAX_WBITS in zconf.h). -- voidp -> voidpf and voidnp -> voidp (for consistency with other - typedefs and because voidnp was not near in large model). - -Changes in 0.94 (13 Aug 95) -- support MSDOS medium model -- fix deflate with flush (could sometimes generate bad output) -- fix deflateReset (zlib header was incorrectly suppressed) -- added support for VMS -- allow a compression level in gzopen() -- gzflush now calls fflush -- For deflate with flush, flush even if no more input is provided. -- rename libgz.a as libz.a -- avoid complex expression in infcodes.c triggering Turbo C bug -- work around a problem with gcc on Alpha (in INSERT_STRING) -- don't use inline functions (problem with some gcc versions) -- allow renaming of Byte, uInt, etc... with #define. -- avoid warning about (unused) pointer before start of array in deflate.c -- avoid various warnings in gzio.c, example.c, infblock.c, adler32.c, zutil.c -- avoid reserved word 'new' in trees.c - -Changes in 0.93 (25 June 95) -- temporarily disable inline functions -- make deflate deterministic -- give enough lookahead for PARTIAL_FLUSH -- Set binary mode for stdin/stdout in minigzip.c for OS/2 -- don't even use signed char in inflate (not portable enough) -- fix inflate memory leak for segmented architectures - -Changes in 0.92 (3 May 95) -- don't assume that char is signed (problem on SGI) -- Clear bit buffer when starting a stored block -- no memcpy on Pyramid -- suppressed inftest.c -- optimized fill_window, put longest_match inline for gcc -- optimized inflate on stored blocks. -- untabify all sources to simplify patches - -Changes in 0.91 (2 May 95) -- Default MEM_LEVEL is 8 (not 9 for Unix) as documented in zlib.h -- Document the memory requirements in zconf.h -- added "make install" -- fix sync search logic in inflateSync -- deflate(Z_FULL_FLUSH) now works even if output buffer too short -- after inflateSync, don't scare people with just "lo world" -- added support for DJGPP - -Changes in 0.9 (1 May 95) -- don't assume that zalloc clears the allocated memory (the TurboC bug - was Mark's bug after all :) -- let again gzread copy uncompressed data unchanged (was working in 0.71) -- deflate(Z_FULL_FLUSH), inflateReset and inflateSync are now fully implemented -- added a test of inflateSync in example.c -- moved MAX_WBITS to zconf.h because users might want to change that. -- document explicitly that zalloc(64K) on MSDOS must return a normalized - pointer (zero offset) -- added Makefiles for Microsoft C, Turbo C, Borland C++ -- faster crc32() - -Changes in 0.8 (29 April 95) -- added fast inflate (inffast.c) -- deflate(Z_FINISH) now returns Z_STREAM_END when done. Warning: this - is incompatible with previous versions of zlib which returned Z_OK. -- work around a TurboC compiler bug (bad code for b << 0, see infutil.h) - (actually that was not a compiler bug, see 0.81 above) -- gzread no longer reads one extra byte in certain cases -- In gzio destroy(), don't reference a freed structure -- avoid many warnings for MSDOS -- avoid the ERROR symbol which is used by MS Windows - -Changes in 0.71 (14 April 95) -- Fixed more MSDOS compilation problems :( There is still a bug with - TurboC large model. - -Changes in 0.7 (14 April 95) -- Added full inflate support. -- Simplified the crc32() interface. The pre- and post-conditioning - (one's complement) is now done inside crc32(). WARNING: this is - incompatible with previous versions; see zlib.h for the new usage. - -Changes in 0.61 (12 April 95) -- workaround for a bug in TurboC. example and minigzip now work on MSDOS. - -Changes in 0.6 (11 April 95) -- added minigzip.c -- added gzdopen to reopen a file descriptor as gzFile -- added transparent reading of non-gziped files in gzread. -- fixed bug in gzread (don't read crc as data) -- fixed bug in destroy (gzio.c) (don't return Z_STREAM_END for gzclose). -- don't allocate big arrays in the stack (for MSDOS) -- fix some MSDOS compilation problems - -Changes in 0.5: -- do real compression in deflate.c. Z_PARTIAL_FLUSH is supported but - not yet Z_FULL_FLUSH. -- support decompression but only in a single step (forced Z_FINISH) -- added opaque object for zalloc and zfree. -- added deflateReset and inflateReset -- added a variable zlib_version for consistency checking. -- renamed the 'filter' parameter of deflateInit2 as 'strategy'. - Added Z_FILTERED and Z_HUFFMAN_ONLY constants. - -Changes in 0.4: -- avoid "zip" everywhere, use zlib instead of ziplib. -- suppress Z_BLOCK_FLUSH, interpret Z_PARTIAL_FLUSH as block flush - if compression method == 8. -- added adler32 and crc32 -- renamed deflateOptions as deflateInit2, call one or the other but not both -- added the method parameter for deflateInit2. -- added inflateInit2 -- simplied considerably deflateInit and inflateInit by not supporting - user-provided history buffer. This is supported only in deflateInit2 - and inflateInit2. - -Changes in 0.3: -- prefix all macro names with Z_ -- use Z_FINISH instead of deflateEnd to finish compression. -- added Z_HUFFMAN_ONLY -- added gzerror() diff --git a/src/zlib/Faq.txt b/src/zlib/Faq.txt deleted file mode 100644 index 15d043615..000000000 --- a/src/zlib/Faq.txt +++ /dev/null @@ -1,339 +0,0 @@ - - Frequently Asked Questions about zlib - - -If your question is not there, please check the zlib home page -http://www.zlib.org which may have more recent information. -The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html - - - 1. Is zlib Y2K-compliant? - - Yes. zlib doesn't handle dates. - - 2. Where can I get a Windows DLL version? - - The zlib sources can be compiled without change to produce a DLL. - See the file win32/DLL_FAQ.txt in the zlib distribution. - Pointers to the precompiled DLL are found in the zlib web site at - http://www.zlib.org. - - 3. Where can I get a Visual Basic interface to zlib? - - See - * http://www.dogma.net/markn/articles/zlibtool/zlibtool.htm - * contrib/visual-basic.txt in the zlib distribution - * win32/DLL_FAQ.txt in the zlib distribution - - 4. compress() returns Z_BUF_ERROR. - - Make sure that before the call of compress, the length of the compressed - buffer is equal to the total size of the compressed buffer and not - zero. For Visual Basic, check that this parameter is passed by reference - ("as any"), not by value ("as long"). - - 5. deflate() or inflate() returns Z_BUF_ERROR. - - Before making the call, make sure that avail_in and avail_out are not - zero. When setting the parameter flush equal to Z_FINISH, also make sure - that avail_out is big enough to allow processing all pending input. - Note that a Z_BUF_ERROR is not fatal--another call to deflate() or - inflate() can be made with more input or output space. A Z_BUF_ERROR - may in fact be unavoidable depending on how the functions are used, since - it is not possible to tell whether or not there is more output pending - when strm.avail_out returns with zero. - - 6. Where's the zlib documentation (man pages, etc.)? - - It's in zlib.h for the moment, and Francis S. Lin has converted it to a - web page zlib.html. Volunteers to transform this to Unix-style man pages, - please contact us (zlib@gzip.org). Examples of zlib usage are in the files - example.c and minigzip.c. - - 7. Why don't you use GNU autoconf or libtool or ...? - - Because we would like to keep zlib as a very small and simple - package. zlib is rather portable and doesn't need much configuration. - - 8. I found a bug in zlib. - - Most of the time, such problems are due to an incorrect usage of - zlib. Please try to reproduce the problem with a small program and send - the corresponding source to us at zlib@gzip.org . Do not send - multi-megabyte data files without prior agreement. - - 9. Why do I get "undefined reference to gzputc"? - - If "make test" produces something like - - example.o(.text+0x154): undefined reference to `gzputc' - - check that you don't have old files libz.* in /usr/lib, /usr/local/lib or - /usr/X11R6/lib. Remove any old versions, then do "make install". - -10. I need a Delphi interface to zlib. - - See the contrib/delphi directory in the zlib distribution. - -11. Can zlib handle .zip archives? - - Not by itself, no. See the directory contrib/minizip in the zlib - distribution. - -12. Can zlib handle .Z files? - - No, sorry. You have to spawn an uncompress or gunzip subprocess, or adapt - the code of uncompress on your own. - -13. How can I make a Unix shared library? - - make clean - ./configure -s - make - -14. How do I install a shared zlib library on Unix? - - After the above, then: - - make install - - However, many flavors of Unix come with a shared zlib already installed. - Before going to the trouble of compiling a shared version of zlib and - trying to install it, you may want to check if it's already there! If you - can #include , it's there. The -lz option will probably link to it. - -15. I have a question about OttoPDF. - - We are not the authors of OttoPDF. The real author is on the OttoPDF web - site: Joel Hainley, jhainley@myndkryme.com. - -16. Can zlib decode Flate data in an Adobe PDF file? - - Yes. See http://www.fastio.com/ (ClibPDF), or http://www.pdflib.com/ . - To modify PDF forms, see http://sourceforge.net/projects/acroformtool/ . - -17. Why am I getting this "register_frame_info not found" error on Solaris? - - After installing zlib 1.1.4 on Solaris 2.6, running applications using zlib - generates an error such as: - - ld.so.1: rpm: fatal: relocation error: file /usr/local/lib/libz.so: - symbol __register_frame_info: referenced symbol not found - - The symbol __register_frame_info is not part of zlib, it is generated by - the C compiler (cc or gcc). You must recompile applications using zlib - which have this problem. This problem is specific to Solaris. See - http://www.sunfreeware.com for Solaris versions of zlib and applications - using zlib. - -18. Why does gzip give an error on a file I make with compress/deflate? - - The compress and deflate functions produce data in the zlib format, which - is different and incompatible with the gzip format. The gz* functions in - zlib on the other hand use the gzip format. Both the zlib and gzip - formats use the same compressed data format internally, but have different - headers and trailers around the compressed data. - -19. Ok, so why are there two different formats? - - The gzip format was designed to retain the directory information about - a single file, such as the name and last modification date. The zlib - format on the other hand was designed for in-memory and communication - channel applications, and has a much more compact header and trailer and - uses a faster integrity check than gzip. - -20. Well that's nice, but how do I make a gzip file in memory? - - You can request that deflate write the gzip format instead of the zlib - format using deflateInit2(). You can also request that inflate decode - the gzip format using inflateInit2(). Read zlib.h for more details. - -21. Is zlib thread-safe? - - Yes. However any library routines that zlib uses and any application- - provided memory allocation routines must also be thread-safe. zlib's gz* - functions use stdio library routines, and most of zlib's functions use the - library memory allocation routines by default. zlib's Init functions allow - for the application to provide custom memory allocation routines. - - Of course, you should only operate on any given zlib or gzip stream from a - single thread at a time. - -22. Can I use zlib in my commercial application? - - Yes. Please read the license in zlib.h. - -23. Is zlib under the GNU license? - - No. Please read the license in zlib.h. - -24. The license says that altered source versions must be "plainly marked". So - what exactly do I need to do to meet that requirement? - - You need to change the ZLIB_VERSION and ZLIB_VERNUM #defines in zlib.h. In - particular, the final version number needs to be changed to "f", and an - identification string should be appended to ZLIB_VERSION. Version numbers - x.x.x.f are reserved for modifications to zlib by others than the zlib - maintainers. For example, if the version of the base zlib you are altering - is "1.2.3.4", then in zlib.h you should change ZLIB_VERNUM to 0x123f, and - ZLIB_VERSION to something like "1.2.3.f-zachary-mods-v3". You can also - update the version strings in deflate.c and inftrees.c. - - For altered source distributions, you should also note the origin and - nature of the changes in zlib.h, as well as in ChangeLog and README, along - with the dates of the alterations. The origin should include at least your - name (or your company's name), and an email address to contact for help or - issues with the library. - - Note that distributing a compiled zlib library along with zlib.h and - zconf.h is also a source distribution, and so you should change - ZLIB_VERSION and ZLIB_VERNUM and note the origin and nature of the changes - in zlib.h as you would for a full source distribution. - -25. Will zlib work on a big-endian or little-endian architecture, and can I - exchange compressed data between them? - - Yes and yes. - -26. Will zlib work on a 64-bit machine? - - It should. It has been tested on 64-bit machines, and has no dependence - on any data types being limited to 32-bits in length. If you have any - difficulties, please provide a complete problem report to zlib@gzip.org - -27. Will zlib decompress data from the PKWare Data Compression Library? - - No. The PKWare DCL uses a completely different compressed data format - than does PKZIP and zlib. However, you can look in zlib's contrib/blast - directory for a possible solution to your problem. - -28. Can I access data randomly in a compressed stream? - - No, not without some preparation. If when compressing you periodically - use Z_FULL_FLUSH, carefully write all the pending data at those points, - and keep an index of those locations, then you can start decompression - at those points. You have to be careful to not use Z_FULL_FLUSH too - often, since it can significantly degrade compression. - -29. Does zlib work on MVS, OS/390, CICS, etc.? - - We don't know for sure. We have heard occasional reports of success on - these systems. If you do use it on one of these, please provide us with - a report, instructions, and patches that we can reference when we get - these questions. Thanks. - -30. Is there some simpler, easier to read version of inflate I can look at - to understand the deflate format? - - First off, you should read RFC 1951. Second, yes. Look in zlib's - contrib/puff directory. - -31. Does zlib infringe on any patents? - - As far as we know, no. In fact, that was originally the whole point behind - zlib. Look here for some more information: - - http://www.gzip.org/#faq11 - -32. Can zlib work with greater than 4 GB of data? - - Yes. inflate() and deflate() will process any amount of data correctly. - Each call of inflate() or deflate() is limited to input and output chunks - of the maximum value that can be stored in the compiler's "unsigned int" - type, but there is no limit to the number of chunks. Note however that the - strm.total_in and strm_total_out counters may be limited to 4 GB. These - counters are provided as a convenience and are not used internally by - inflate() or deflate(). The application can easily set up its own counters - updated after each call of inflate() or deflate() to count beyond 4 GB. - compress() and uncompress() may be limited to 4 GB, since they operate in a - single call. gzseek() and gztell() may be limited to 4 GB depending on how - zlib is compiled. See the zlibCompileFlags() function in zlib.h. - - The word "may" appears several times above since there is a 4 GB limit - only if the compiler's "long" type is 32 bits. If the compiler's "long" - type is 64 bits, then the limit is 16 exabytes. - -33. Does zlib have any security vulnerabilities? - - The only one that we are aware of is potentially in gzprintf(). If zlib - is compiled to use sprintf() or vsprintf(), then there is no protection - against a buffer overflow of a 4K string space, other than the caller of - gzprintf() assuring that the output will not exceed 4K. On the other - hand, if zlib is compiled to use snprintf() or vsnprintf(), which should - normally be the case, then there is no vulnerability. The ./configure - script will display warnings if an insecure variation of sprintf() will - be used by gzprintf(). Also the zlibCompileFlags() function will return - information on what variant of sprintf() is used by gzprintf(). - - If you don't have snprintf() or vsnprintf() and would like one, you can - find a portable implementation here: - - http://www.ijs.si/software/snprintf/ - - Note that you should be using the most recent version of zlib. Versions - 1.1.3 and before were subject to a double-free vulnerability. - -34. Is there a Java version of zlib? - - Probably what you want is to use zlib in Java. zlib is already included - as part of the Java SDK in the java.util.zip package. If you really want - a version of zlib written in the Java language, look on the zlib home - page for links: http://www.zlib.org/ - -35. I get this or that compiler or source-code scanner warning when I crank it - up to maximally-pedantic. Can't you guys write proper code? - - Many years ago, we gave up attempting to avoid warnings on every compiler - in the universe. It just got to be a waste of time, and some compilers - were downright silly. So now, we simply make sure that the code always - works. - -36. Valgrind (or some similar memory access checker) says that deflate is - performing a conditional jump that depends on an uninitialized value. - Isn't that a bug? - - No. That is intentional for performance reasons, and the output of - deflate is not affected. This only started showing up recently since - zlib 1.2.x uses malloc() by default for allocations, whereas earlier - versions used calloc(), which zeros out the allocated memory. - -37. Will zlib read the (insert any ancient or arcane format here) compressed - data format? - - Probably not. Look in the comp.compression FAQ for pointers to various - formats and associated software. - -38. How can I encrypt/decrypt zip files with zlib? - - zlib doesn't support encryption. The original PKZIP encryption is very weak - and can be broken with freely available programs. To get strong encryption, - use GnuPG, http://www.gnupg.org/ , which already includes zlib compression. - For PKZIP compatible "encryption", look at http://www.info-zip.org/ - -39. What's the difference between the "gzip" and "deflate" HTTP 1.1 encodings? - - "gzip" is the gzip format, and "deflate" is the zlib format. They should - probably have called the second one "zlib" instead to avoid confusion - with the raw deflate compressed data format. While the HTTP 1.1 RFC 2616 - correctly points to the zlib specification in RFC 1950 for the "deflate" - transfer encoding, there have been reports of servers and browsers that - incorrectly produce or expect raw deflate data per the deflate - specficiation in RFC 1951, most notably Microsoft. So even though the - "deflate" transfer encoding using the zlib format would be the more - efficient approach (and in fact exactly what the zlib format was designed - for), using the "gzip" transfer encoding is probably more reliable due to - an unfortunate choice of name on the part of the HTTP 1.1 authors. - - Bottom line: use the gzip format for HTTP 1.1 encoding. - -40. Does zlib support the new "Deflate64" format introduced by PKWare? - - No. PKWare has apparently decided to keep that format proprietary, since - they have not documented it as they have previous compression formats. - In any case, the compression improvements are so modest compared to other - more modern approaches, that it's not worth the effort to implement. - -41. Can you please sign these lengthy legal documents and fax them back to us - so that we can use your software in our product? - - No. Go away. Shoo. diff --git a/src/zlib/Readme.txt b/src/zlib/Readme.txt deleted file mode 100644 index 80f71ae85..000000000 --- a/src/zlib/Readme.txt +++ /dev/null @@ -1,125 +0,0 @@ -ZLIB DATA COMPRESSION LIBRARY - -zlib 1.2.3 is a general purpose data compression library. All the code is -thread safe. The data format used by the zlib library is described by RFCs -(Request for Comments) 1950 to 1952 in the files -http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format) -and rfc1952.txt (gzip format). These documents are also available in other -formats from ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html - -All functions of the compression library are documented in the file zlib.h -(volunteer to write man pages welcome, contact zlib@gzip.org). A usage example -of the library is given in the file example.c which also tests that the library -is working correctly. Another example is given in the file minigzip.c. The -compression library itself is composed of all source files except example.c and -minigzip.c. - -To compile all files and run the test program, follow the instructions given at -the top of Makefile. In short "make test; make install" should work for most -machines. For Unix: "./configure; make test; make install". For MSDOS, use one -of the special makefiles such as Makefile.msc. For VMS, use make_vms.com. - -Questions about zlib should be sent to , or to Gilles Vollant - for the Windows DLL version. The zlib home page is -http://www.zlib.org or http://www.gzip.org/zlib/ Before reporting a problem, -please check this site to verify that you have the latest version of zlib; -otherwise get the latest version and check whether the problem still exists or -not. - -PLEASE read the zlib FAQ http://www.gzip.org/zlib/zlib_faq.html before asking -for help. - -Mark Nelson wrote an article about zlib for the Jan. 1997 -issue of Dr. Dobb's Journal; a copy of the article is available in -http://dogma.net/markn/articles/zlibtool/zlibtool.htm - -The changes made in version 1.2.3 are documented in the file ChangeLog. - -Unsupported third party contributions are provided in directory "contrib". - -A Java implementation of zlib is available in the Java Development Kit -http://java.sun.com/j2se/1.4.2/docs/api/java/util/zip/package-summary.html -See the zlib home page http://www.zlib.org for details. - -A Perl interface to zlib written by Paul Marquess is in the -CPAN (Comprehensive Perl Archive Network) sites -http://www.cpan.org/modules/by-module/Compress/ - -A Python interface to zlib written by A.M. Kuchling is -available in Python 1.5 and later versions, see -http://www.python.org/doc/lib/module-zlib.html - -A zlib binding for TCL written by Andreas Kupries is -availlable at http://www.oche.de/~akupries/soft/trf/trf_zip.html - -An experimental package to read and write files in .zip format, written on top -of zlib by Gilles Vollant , is available in the -contrib/minizip directory of zlib. - - -Notes for some targets: - -- For Windows DLL versions, please see win32/DLL_FAQ.txt - -- For 64-bit Irix, deflate.c must be compiled without any optimization. With - -O, one libpng test fails. The test works in 32 bit mode (with the -n32 - compiler flag). The compiler bug has been reported to SGI. - -- zlib doesn't work with gcc 2.6.3 on a DEC 3000/300LX under OSF/1 2.1 it works - when compiled with cc. - -- On Digital Unix 4.0D (formely OSF/1) on AlphaServer, the cc option -std1 is - necessary to get gzprintf working correctly. This is done by configure. - -- zlib doesn't work on HP-UX 9.05 with some versions of /bin/cc. It works with - other compilers. Use "make test" to check your compiler. - -- gzdopen is not supported on RISCOS, BEOS and by some Mac compilers. - -- For PalmOs, see http://palmzlib.sourceforge.net/ - -- When building a shared, i.e. dynamic library on Mac OS X, the library must be - installed before testing (do "make install" before "make test"), since the - library location is specified in the library. - - -Acknowledgments: - - The deflate format used by zlib was defined by Phil Katz. The deflate - and zlib specifications were written by L. Peter Deutsch. Thanks to all the - people who reported problems and suggested various improvements in zlib; - they are too numerous to cite here. - -Copyright notice: - - (C) 1995-2004 Jean-loup Gailly and Mark Adler - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - Jean-loup Gailly Mark Adler - jloup@gzip.org madler@alumni.caltech.edu - -If you use the zlib library in a product, we would appreciate *not* -receiving lengthy legal documents to sign. The sources are provided -for free but without warranty of any kind. The library has been -entirely written by Jean-loup Gailly and Mark Adler; it does not -include third-party code. - -If you redistribute modified sources, we would appreciate that you include -in the file ChangeLog history information documenting your changes. Please -read the FAQ for more information on the distribution of modified source -versions. diff --git a/src/zlib/ZLIB.DEF b/src/zlib/ZLIB.DEF deleted file mode 100644 index 3fb7a4070..000000000 --- a/src/zlib/ZLIB.DEF +++ /dev/null @@ -1,46 +0,0 @@ -LIBRARY "zlib" - -DESCRIPTION '"""zlib data compression library"""' - -EXETYPE NT - -SUBSYSTEM WINDOWS - -STUB 'WINSTUB.EXE' - -VERSION 1.14 - -CODE EXECUTE READ - -DATA READ WRITE - -HEAPSIZE 1048576,4096 - -EXPORTS - zlibVersion - deflate - deflateEnd - inflate - inflateEnd - deflateSetDictionary - deflateCopy - deflateReset - deflateParams - inflateSetDictionary - inflateSync - inflateReset - compress - uncompress - gzopen - gzdopen - gzread - gzwrite - gzflush - gzclose - gzerror - adler32 - crc32 - deflateInit_ - inflateInit_ - deflateInit2_ - inflateInit2_ diff --git a/src/zlib/ZLIB.RC b/src/zlib/ZLIB.RC deleted file mode 100644 index 8fcd715be..000000000 --- a/src/zlib/ZLIB.RC +++ /dev/null @@ -1,32 +0,0 @@ -#include - -#define IDR_VERSION1 1 -IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE - FILEVERSION 1,2,3,0 - PRODUCTVERSION 1,2,3,0 - FILEFLAGSMASK VS_FFI_FILEFLAGSMASK - FILEFLAGS 0 - FILEOS VOS_DOS_WINDOWS32 - FILETYPE VFT_DLL - FILESUBTYPE 0 // not used -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904E4" - //language ID = U.S. English, char set = Windows, Multilingual - - BEGIN - VALUE "FileDescription", "zlib data compression library\0" - VALUE "FileVersion", "1.2.3\0" - VALUE "InternalName", "zlib\0" - VALUE "OriginalFilename", "zlib.lib\0" - VALUE "ProductName", "ZLib.DLL\0" - VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0" - VALUE "LegalCopyright", "(C) 1995-2007 Jean-loup Gailly & Mark Adler\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x0409, 1252 - END -END diff --git a/src/zlib/adler32.c b/src/zlib/adler32.c deleted file mode 100644 index f78fbc66d..000000000 --- a/src/zlib/adler32.c +++ /dev/null @@ -1,149 +0,0 @@ -/* adler32.c -- compute the Adler-32 checksum of a data stream - * Copyright (C) 1995-2004 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* @(#) $Id: adler32.c 126 2003-11-09 01:53:27Z gabest $ */ - -#define ZLIB_INTERNAL -#include "zlib.h" - -#define BASE 65521UL /* largest prime smaller than 65536 */ -#define NMAX 5552 -/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */ - -#define DO1(buf,i) {adler += (buf)[i]; sum2 += adler;} -#define DO2(buf,i) DO1(buf,i); DO1(buf,i+1); -#define DO4(buf,i) DO2(buf,i); DO2(buf,i+2); -#define DO8(buf,i) DO4(buf,i); DO4(buf,i+4); -#define DO16(buf) DO8(buf,0); DO8(buf,8); - -/* use NO_DIVIDE if your processor does not do division in hardware */ -#ifdef NO_DIVIDE -# define MOD(a) \ - do { \ - if (a >= (BASE << 16)) a -= (BASE << 16); \ - if (a >= (BASE << 15)) a -= (BASE << 15); \ - if (a >= (BASE << 14)) a -= (BASE << 14); \ - if (a >= (BASE << 13)) a -= (BASE << 13); \ - if (a >= (BASE << 12)) a -= (BASE << 12); \ - if (a >= (BASE << 11)) a -= (BASE << 11); \ - if (a >= (BASE << 10)) a -= (BASE << 10); \ - if (a >= (BASE << 9)) a -= (BASE << 9); \ - if (a >= (BASE << 8)) a -= (BASE << 8); \ - if (a >= (BASE << 7)) a -= (BASE << 7); \ - if (a >= (BASE << 6)) a -= (BASE << 6); \ - if (a >= (BASE << 5)) a -= (BASE << 5); \ - if (a >= (BASE << 4)) a -= (BASE << 4); \ - if (a >= (BASE << 3)) a -= (BASE << 3); \ - if (a >= (BASE << 2)) a -= (BASE << 2); \ - if (a >= (BASE << 1)) a -= (BASE << 1); \ - if (a >= BASE) a -= BASE; \ - } while (0) -# define MOD4(a) \ - do { \ - if (a >= (BASE << 4)) a -= (BASE << 4); \ - if (a >= (BASE << 3)) a -= (BASE << 3); \ - if (a >= (BASE << 2)) a -= (BASE << 2); \ - if (a >= (BASE << 1)) a -= (BASE << 1); \ - if (a >= BASE) a -= BASE; \ - } while (0) -#else -# define MOD(a) a %= BASE -# define MOD4(a) a %= BASE -#endif - -/* ========================================================================= */ -uLong ZEXPORT adler32(adler, buf, len) - uLong adler; - const Bytef *buf; - uInt len; -{ - unsigned long sum2; - unsigned n; - - /* split Adler-32 into component sums */ - sum2 = (adler >> 16) & 0xffff; - adler &= 0xffff; - - /* in case user likes doing a byte at a time, keep it fast */ - if (len == 1) { - adler += buf[0]; - if (adler >= BASE) - adler -= BASE; - sum2 += adler; - if (sum2 >= BASE) - sum2 -= BASE; - return adler | (sum2 << 16); - } - - /* initial Adler-32 value (deferred check for len == 1 speed) */ - if (buf == Z_NULL) - return 1L; - - /* in case short lengths are provided, keep it somewhat fast */ - if (len < 16) { - while (len--) { - adler += *buf++; - sum2 += adler; - } - if (adler >= BASE) - adler -= BASE; - MOD4(sum2); /* only added so many BASE's */ - return adler | (sum2 << 16); - } - - /* do length NMAX blocks -- requires just one modulo operation */ - while (len >= NMAX) { - len -= NMAX; - n = NMAX / 16; /* NMAX is divisible by 16 */ - do { - DO16(buf); /* 16 sums unrolled */ - buf += 16; - } while (--n); - MOD(adler); - MOD(sum2); - } - - /* do remaining bytes (less than NMAX, still just one modulo) */ - if (len) { /* avoid modulos if none remaining */ - while (len >= 16) { - len -= 16; - DO16(buf); - buf += 16; - } - while (len--) { - adler += *buf++; - sum2 += adler; - } - MOD(adler); - MOD(sum2); - } - - /* return recombined sums */ - return adler | (sum2 << 16); -} - -/* ========================================================================= */ -uLong ZEXPORT adler32_combine(adler1, adler2, len2) - uLong adler1; - uLong adler2; - z_off_t len2; -{ - unsigned long sum1; - unsigned long sum2; - unsigned rem; - - /* the derivation of this formula is left as an exercise for the reader */ - rem = (unsigned)(len2 % BASE); - sum1 = adler1 & 0xffff; - sum2 = rem * sum1; - MOD(sum2); - sum1 += (adler2 & 0xffff) + BASE - 1; - sum2 += ((adler1 >> 16) & 0xffff) + ((adler2 >> 16) & 0xffff) + BASE - rem; - if (sum1 > BASE) sum1 -= BASE; - if (sum1 > BASE) sum1 -= BASE; - if (sum2 > (BASE << 1)) sum2 -= (BASE << 1); - if (sum2 > BASE) sum2 -= BASE; - return sum1 | (sum2 << 16); -} diff --git a/src/zlib/algorithm.txt b/src/zlib/algorithm.txt deleted file mode 100644 index 9f6b06808..000000000 --- a/src/zlib/algorithm.txt +++ /dev/null @@ -1,209 +0,0 @@ -1. Compression algorithm (deflate) - -The deflation algorithm used by gzip (also zip and zlib) is a variation of -LZ77 (Lempel-Ziv 1977, see reference below). It finds duplicated strings in -the input data. The second occurrence of a string is replaced by a -pointer to the previous string, in the form of a pair (distance, -length). Distances are limited to 32K bytes, and lengths are limited -to 258 bytes. When a string does not occur anywhere in the previous -32K bytes, it is emitted as a sequence of literal bytes. (In this -description, `string' must be taken as an arbitrary sequence of bytes, -and is not restricted to printable characters.) - -Literals or match lengths are compressed with one Huffman tree, and -match distances are compressed with another tree. The trees are stored -in a compact form at the start of each block. The blocks can have any -size (except that the compressed data for one block must fit in -available memory). A block is terminated when deflate() determines that -it would be useful to start another block with fresh trees. (This is -somewhat similar to the behavior of LZW-based _compress_.) - -Duplicated strings are found using a hash table. All input strings of -length 3 are inserted in the hash table. A hash index is computed for -the next 3 bytes. If the hash chain for this index is not empty, all -strings in the chain are compared with the current input string, and -the longest match is selected. - -The hash chains are searched starting with the most recent strings, to -favor small distances and thus take advantage of the Huffman encoding. -The hash chains are singly linked. There are no deletions from the -hash chains, the algorithm simply discards matches that are too old. - -To avoid a worst-case situation, very long hash chains are arbitrarily -truncated at a certain length, determined by a runtime option (level -parameter of deflateInit). So deflate() does not always find the longest -possible match but generally finds a match which is long enough. - -deflate() also defers the selection of matches with a lazy evaluation -mechanism. After a match of length N has been found, deflate() searches for -a longer match at the next input byte. If a longer match is found, the -previous match is truncated to a length of one (thus producing a single -literal byte) and the process of lazy evaluation begins again. Otherwise, -the original match is kept, and the next match search is attempted only N -steps later. - -The lazy match evaluation is also subject to a runtime parameter. If -the current match is long enough, deflate() reduces the search for a longer -match, thus speeding up the whole process. If compression ratio is more -important than speed, deflate() attempts a complete second search even if -the first match is already long enough. - -The lazy match evaluation is not performed for the fastest compression -modes (level parameter 1 to 3). For these fast modes, new strings -are inserted in the hash table only when no match was found, or -when the match is not too long. This degrades the compression ratio -but saves time since there are both fewer insertions and fewer searches. - - -2. Decompression algorithm (inflate) - -2.1 Introduction - -The key question is how to represent a Huffman code (or any prefix code) so -that you can decode fast. The most important characteristic is that shorter -codes are much more common than longer codes, so pay attention to decoding the -short codes fast, and let the long codes take longer to decode. - -inflate() sets up a first level table that covers some number of bits of -input less than the length of longest code. It gets that many bits from the -stream, and looks it up in the table. The table will tell if the next -code is that many bits or less and how many, and if it is, it will tell -the value, else it will point to the next level table for which inflate() -grabs more bits and tries to decode a longer code. - -How many bits to make the first lookup is a tradeoff between the time it -takes to decode and the time it takes to build the table. If building the -table took no time (and if you had infinite memory), then there would only -be a first level table to cover all the way to the longest code. However, -building the table ends up taking a lot longer for more bits since short -codes are replicated many times in such a table. What inflate() does is -simply to make the number of bits in the first table a variable, and then -to set that variable for the maximum speed. - -For inflate, which has 286 possible codes for the literal/length tree, the size -of the first table is nine bits. Also the distance trees have 30 possible -values, and the size of the first table is six bits. Note that for each of -those cases, the table ended up one bit longer than the ``average'' code -length, i.e. the code length of an approximately flat code which would be a -little more than eight bits for 286 symbols and a little less than five bits -for 30 symbols. - - -2.2 More details on the inflate table lookup - -Ok, you want to know what this cleverly obfuscated inflate tree actually -looks like. You are correct that it's not a Huffman tree. It is simply a -lookup table for the first, let's say, nine bits of a Huffman symbol. The -symbol could be as short as one bit or as long as 15 bits. If a particular -symbol is shorter than nine bits, then that symbol's translation is duplicated -in all those entries that start with that symbol's bits. For example, if the -symbol is four bits, then it's duplicated 32 times in a nine-bit table. If a -symbol is nine bits long, it appears in the table once. - -If the symbol is longer than nine bits, then that entry in the table points -to another similar table for the remaining bits. Again, there are duplicated -entries as needed. The idea is that most of the time the symbol will be short -and there will only be one table look up. (That's whole idea behind data -compression in the first place.) For the less frequent long symbols, there -will be two lookups. If you had a compression method with really long -symbols, you could have as many levels of lookups as is efficient. For -inflate, two is enough. - -So a table entry either points to another table (in which case nine bits in -the above example are gobbled), or it contains the translation for the symbol -and the number of bits to gobble. Then you start again with the next -ungobbled bit. - -You may wonder: why not just have one lookup table for how ever many bits the -longest symbol is? The reason is that if you do that, you end up spending -more time filling in duplicate symbol entries than you do actually decoding. -At least for deflate's output that generates new trees every several 10's of -kbytes. You can imagine that filling in a 2^15 entry table for a 15-bit code -would take too long if you're only decoding several thousand symbols. At the -other extreme, you could make a new table for every bit in the code. In fact, -that's essentially a Huffman tree. But then you spend two much time -traversing the tree while decoding, even for short symbols. - -So the number of bits for the first lookup table is a trade of the time to -fill out the table vs. the time spent looking at the second level and above of -the table. - -Here is an example, scaled down: - -The code being decoded, with 10 symbols, from 1 to 6 bits long: - -A: 0 -B: 10 -C: 1100 -D: 11010 -E: 11011 -F: 11100 -G: 11101 -H: 11110 -I: 111110 -J: 111111 - -Let's make the first table three bits long (eight entries): - -000: A,1 -001: A,1 -010: A,1 -011: A,1 -100: B,2 -101: B,2 -110: -> table X (gobble 3 bits) -111: -> table Y (gobble 3 bits) - -Each entry is what the bits decode as and how many bits that is, i.e. how -many bits to gobble. Or the entry points to another table, with the number of -bits to gobble implicit in the size of the table. - -Table X is two bits long since the longest code starting with 110 is five bits -long: - -00: C,1 -01: C,1 -10: D,2 -11: E,2 - -Table Y is three bits long since the longest code starting with 111 is six -bits long: - -000: F,2 -001: F,2 -010: G,2 -011: G,2 -100: H,2 -101: H,2 -110: I,3 -111: J,3 - -So what we have here are three tables with a total of 20 entries that had to -be constructed. That's compared to 64 entries for a single table. Or -compared to 16 entries for a Huffman tree (six two entry tables and one four -entry table). Assuming that the code ideally represents the probability of -the symbols, it takes on the average 1.25 lookups per symbol. That's compared -to one lookup for the single table, or 1.66 lookups per symbol for the -Huffman tree. - -There, I think that gives you a picture of what's going on. For inflate, the -meaning of a particular symbol is often more than just a letter. It can be a -byte (a "literal"), or it can be either a length or a distance which -indicates a base value and a number of bits to fetch after the code that is -added to the base value. Or it might be the special end-of-block code. The -data structures created in inftrees.c try to encode all that information -compactly in the tables. - - -Jean-loup Gailly Mark Adler -jloup@gzip.org madler@alumni.caltech.edu - - -References: - -[LZ77] Ziv J., Lempel A., ``A Universal Algorithm for Sequential Data -Compression,'' IEEE Transactions on Information Theory, Vol. 23, No. 3, -pp. 337-343. - -``DEFLATE Compressed Data Format Specification'' available in -http://www.ietf.org/rfc/rfc1951.txt diff --git a/src/zlib/compress.c b/src/zlib/compress.c deleted file mode 100644 index 76a22667d..000000000 --- a/src/zlib/compress.c +++ /dev/null @@ -1,79 +0,0 @@ -/* compress.c -- compress a memory buffer - * Copyright (C) 1995-2003 Jean-loup Gailly. - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* @(#) $Id: compress.c 126 2003-11-09 01:53:27Z gabest $ */ - -#define ZLIB_INTERNAL -#include "zlib.h" - -/* =========================================================================== - Compresses the source buffer into the destination buffer. The level - parameter has the same meaning as in deflateInit. sourceLen is the byte - length of the source buffer. Upon entry, destLen is the total size of the - destination buffer, which must be at least 0.1% larger than sourceLen plus - 12 bytes. Upon exit, destLen is the actual size of the compressed buffer. - - compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_BUF_ERROR if there was not enough room in the output buffer, - Z_STREAM_ERROR if the level parameter is invalid. -*/ -int ZEXPORT compress2 (dest, destLen, source, sourceLen, level) - Bytef *dest; - uLongf *destLen; - const Bytef *source; - uLong sourceLen; - int level; -{ - z_stream stream; - int err; - - stream.next_in = (Bytef*)source; - stream.avail_in = (uInt)sourceLen; -#ifdef MAXSEG_64K - /* Check for source > 64K on 16-bit machine: */ - if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR; -#endif - stream.next_out = dest; - stream.avail_out = (uInt)*destLen; - if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR; - - stream.zalloc = (alloc_func)0; - stream.zfree = (free_func)0; - stream.opaque = (voidpf)0; - - err = deflateInit(&stream, level); - if (err != Z_OK) return err; - - err = deflate(&stream, Z_FINISH); - if (err != Z_STREAM_END) { - deflateEnd(&stream); - return err == Z_OK ? Z_BUF_ERROR : err; - } - *destLen = stream.total_out; - - err = deflateEnd(&stream); - return err; -} - -/* =========================================================================== - */ -int ZEXPORT compress (dest, destLen, source, sourceLen) - Bytef *dest; - uLongf *destLen; - const Bytef *source; - uLong sourceLen; -{ - return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION); -} - -/* =========================================================================== - If the default memLevel or windowBits for deflateInit() is changed, then - this function needs to be updated. - */ -uLong ZEXPORT compressBound (sourceLen) - uLong sourceLen; -{ - return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) + 11; -} diff --git a/src/zlib/crc32.c b/src/zlib/crc32.c deleted file mode 100644 index 41b932694..000000000 --- a/src/zlib/crc32.c +++ /dev/null @@ -1,423 +0,0 @@ -/* crc32.c -- compute the CRC-32 of a data stream - * Copyright (C) 1995-2005 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - * - * Thanks to Rodney Brown for his contribution of faster - * CRC methods: exclusive-oring 32 bits of data at a time, and pre-computing - * tables for updating the shift register in one step with three exclusive-ors - * instead of four steps with four exclusive-ors. This results in about a - * factor of two increase in speed on a Power PC G4 (PPC7455) using gcc -O3. - */ - -/* @(#) $Id: crc32.c 126 2003-11-09 01:53:27Z gabest $ */ - -/* - Note on the use of DYNAMIC_CRC_TABLE: there is no mutex or semaphore - protection on the static variables used to control the first-use generation - of the crc tables. Therefore, if you #define DYNAMIC_CRC_TABLE, you should - first call get_crc_table() to initialize the tables before allowing more than - one thread to use crc32(). - */ - -#ifdef MAKECRCH -# include -# ifndef DYNAMIC_CRC_TABLE -# define DYNAMIC_CRC_TABLE -# endif /* !DYNAMIC_CRC_TABLE */ -#endif /* MAKECRCH */ - -#include "zutil.h" /* for STDC and FAR definitions */ - -#define local static - -/* Find a four-byte integer type for crc32_little() and crc32_big(). */ -#ifndef NOBYFOUR -# ifdef STDC /* need ANSI C limits.h to determine sizes */ -# include -# define BYFOUR -# if (UINT_MAX == 0xffffffffUL) - typedef unsigned int u4; -# else -# if (ULONG_MAX == 0xffffffffUL) - typedef unsigned long u4; -# else -# if (USHRT_MAX == 0xffffffffUL) - typedef unsigned short u4; -# else -# undef BYFOUR /* can't find a four-byte integer type! */ -# endif -# endif -# endif -# endif /* STDC */ -#endif /* !NOBYFOUR */ - -/* Definitions for doing the crc four data bytes at a time. */ -#ifdef BYFOUR -# define REV(w) (((w)>>24)+(((w)>>8)&0xff00)+ \ - (((w)&0xff00)<<8)+(((w)&0xff)<<24)) - local unsigned long crc32_little OF((unsigned long, - const unsigned char FAR *, unsigned)); - local unsigned long crc32_big OF((unsigned long, - const unsigned char FAR *, unsigned)); -# define TBLS 8 -#else -# define TBLS 1 -#endif /* BYFOUR */ - -/* Local functions for crc concatenation */ -local unsigned long gf2_matrix_times OF((unsigned long *mat, - unsigned long vec)); -local void gf2_matrix_square OF((unsigned long *square, unsigned long *mat)); - -#ifdef DYNAMIC_CRC_TABLE - -local volatile int crc_table_empty = 1; -local unsigned long FAR crc_table[TBLS][256]; -local void make_crc_table OF((void)); -#ifdef MAKECRCH - local void write_table OF((FILE *, const unsigned long FAR *)); -#endif /* MAKECRCH */ -/* - Generate tables for a byte-wise 32-bit CRC calculation on the polynomial: - x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1. - - Polynomials over GF(2) are represented in binary, one bit per coefficient, - with the lowest powers in the most significant bit. Then adding polynomials - is just exclusive-or, and multiplying a polynomial by x is a right shift by - one. If we call the above polynomial p, and represent a byte as the - polynomial q, also with the lowest power in the most significant bit (so the - byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p, - where a mod b means the remainder after dividing a by b. - - This calculation is done using the shift-register method of multiplying and - taking the remainder. The register is initialized to zero, and for each - incoming bit, x^32 is added mod p to the register if the bit is a one (where - x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by - x (which is shifting right by one and adding x^32 mod p if the bit shifted - out is a one). We start with the highest power (least significant bit) of - q and repeat for all eight bits of q. - - The first table is simply the CRC of all possible eight bit values. This is - all the information needed to generate CRCs on data a byte at a time for all - combinations of CRC register values and incoming bytes. The remaining tables - allow for word-at-a-time CRC calculation for both big-endian and little- - endian machines, where a word is four bytes. -*/ -local void make_crc_table() -{ - unsigned long c; - int n, k; - unsigned long poly; /* polynomial exclusive-or pattern */ - /* terms of polynomial defining this crc (except x^32): */ - static volatile int first = 1; /* flag to limit concurrent making */ - static const unsigned char p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26}; - - /* See if another task is already doing this (not thread-safe, but better - than nothing -- significantly reduces duration of vulnerability in - case the advice about DYNAMIC_CRC_TABLE is ignored) */ - if (first) { - first = 0; - - /* make exclusive-or pattern from polynomial (0xedb88320UL) */ - poly = 0UL; - for (n = 0; n < sizeof(p)/sizeof(unsigned char); n++) - poly |= 1UL << (31 - p[n]); - - /* generate a crc for every 8-bit value */ - for (n = 0; n < 256; n++) { - c = (unsigned long)n; - for (k = 0; k < 8; k++) - c = c & 1 ? poly ^ (c >> 1) : c >> 1; - crc_table[0][n] = c; - } - -#ifdef BYFOUR - /* generate crc for each value followed by one, two, and three zeros, - and then the byte reversal of those as well as the first table */ - for (n = 0; n < 256; n++) { - c = crc_table[0][n]; - crc_table[4][n] = REV(c); - for (k = 1; k < 4; k++) { - c = crc_table[0][c & 0xff] ^ (c >> 8); - crc_table[k][n] = c; - crc_table[k + 4][n] = REV(c); - } - } -#endif /* BYFOUR */ - - crc_table_empty = 0; - } - else { /* not first */ - /* wait for the other guy to finish (not efficient, but rare) */ - while (crc_table_empty) - ; - } - -#ifdef MAKECRCH - /* write out CRC tables to crc32.h */ - { - FILE *out; - - out = fopen("crc32.h", "w"); - if (out == NULL) return; - fprintf(out, "/* crc32.h -- tables for rapid CRC calculation\n"); - fprintf(out, " * Generated automatically by crc32.c\n */\n\n"); - fprintf(out, "local const unsigned long FAR "); - fprintf(out, "crc_table[TBLS][256] =\n{\n {\n"); - write_table(out, crc_table[0]); -# ifdef BYFOUR - fprintf(out, "#ifdef BYFOUR\n"); - for (k = 1; k < 8; k++) { - fprintf(out, " },\n {\n"); - write_table(out, crc_table[k]); - } - fprintf(out, "#endif\n"); -# endif /* BYFOUR */ - fprintf(out, " }\n};\n"); - fclose(out); - } -#endif /* MAKECRCH */ -} - -#ifdef MAKECRCH -local void write_table(out, table) - FILE *out; - const unsigned long FAR *table; -{ - int n; - - for (n = 0; n < 256; n++) - fprintf(out, "%s0x%08lxUL%s", n % 5 ? "" : " ", table[n], - n == 255 ? "\n" : (n % 5 == 4 ? ",\n" : ", ")); -} -#endif /* MAKECRCH */ - -#else /* !DYNAMIC_CRC_TABLE */ -/* ======================================================================== - * Tables of CRC-32s of all single-byte values, made by make_crc_table(). - */ -#include "crc32.h" -#endif /* DYNAMIC_CRC_TABLE */ - -/* ========================================================================= - * This function can be used by asm versions of crc32() - */ -const unsigned long FAR * ZEXPORT get_crc_table() -{ -#ifdef DYNAMIC_CRC_TABLE - if (crc_table_empty) - make_crc_table(); -#endif /* DYNAMIC_CRC_TABLE */ - return (const unsigned long FAR *)crc_table; -} - -/* ========================================================================= */ -#define DO1 crc = crc_table[0][((int)crc ^ (*buf++)) & 0xff] ^ (crc >> 8) -#define DO8 DO1; DO1; DO1; DO1; DO1; DO1; DO1; DO1 - -/* ========================================================================= */ -unsigned long ZEXPORT crc32(crc, buf, len) - unsigned long crc; - const unsigned char FAR *buf; - unsigned len; -{ - if (buf == Z_NULL) return 0UL; - -#ifdef DYNAMIC_CRC_TABLE - if (crc_table_empty) - make_crc_table(); -#endif /* DYNAMIC_CRC_TABLE */ - -#ifdef BYFOUR - if (sizeof(void *) == sizeof(ptrdiff_t)) { - u4 endian; - - endian = 1; - if (*((unsigned char *)(&endian))) - return crc32_little(crc, buf, len); - else - return crc32_big(crc, buf, len); - } -#endif /* BYFOUR */ - crc = crc ^ 0xffffffffUL; - while (len >= 8) { - DO8; - len -= 8; - } - if (len) do { - DO1; - } while (--len); - return crc ^ 0xffffffffUL; -} - -#ifdef BYFOUR - -/* ========================================================================= */ -#define DOLIT4 c ^= *buf4++; \ - c = crc_table[3][c & 0xff] ^ crc_table[2][(c >> 8) & 0xff] ^ \ - crc_table[1][(c >> 16) & 0xff] ^ crc_table[0][c >> 24] -#define DOLIT32 DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4 - -/* ========================================================================= */ -local unsigned long crc32_little(crc, buf, len) - unsigned long crc; - const unsigned char FAR *buf; - unsigned len; -{ - register u4 c; - register const u4 FAR *buf4; - - c = (u4)crc; - c = ~c; - while (len && ((ptrdiff_t)buf & 3)) { - c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8); - len--; - } - - buf4 = (const u4 FAR *)(const void FAR *)buf; - while (len >= 32) { - DOLIT32; - len -= 32; - } - while (len >= 4) { - DOLIT4; - len -= 4; - } - buf = (const unsigned char FAR *)buf4; - - if (len) do { - c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8); - } while (--len); - c = ~c; - return (unsigned long)c; -} - -/* ========================================================================= */ -#define DOBIG4 c ^= *++buf4; \ - c = crc_table[4][c & 0xff] ^ crc_table[5][(c >> 8) & 0xff] ^ \ - crc_table[6][(c >> 16) & 0xff] ^ crc_table[7][c >> 24] -#define DOBIG32 DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4 - -/* ========================================================================= */ -local unsigned long crc32_big(crc, buf, len) - unsigned long crc; - const unsigned char FAR *buf; - unsigned len; -{ - register u4 c; - register const u4 FAR *buf4; - - c = REV((u4)crc); - c = ~c; - while (len && ((ptrdiff_t)buf & 3)) { - c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8); - len--; - } - - buf4 = (const u4 FAR *)(const void FAR *)buf; - buf4--; - while (len >= 32) { - DOBIG32; - len -= 32; - } - while (len >= 4) { - DOBIG4; - len -= 4; - } - buf4++; - buf = (const unsigned char FAR *)buf4; - - if (len) do { - c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8); - } while (--len); - c = ~c; - return (unsigned long)(REV(c)); -} - -#endif /* BYFOUR */ - -#define GF2_DIM 32 /* dimension of GF(2) vectors (length of CRC) */ - -/* ========================================================================= */ -local unsigned long gf2_matrix_times(mat, vec) - unsigned long *mat; - unsigned long vec; -{ - unsigned long sum; - - sum = 0; - while (vec) { - if (vec & 1) - sum ^= *mat; - vec >>= 1; - mat++; - } - return sum; -} - -/* ========================================================================= */ -local void gf2_matrix_square(square, mat) - unsigned long *square; - unsigned long *mat; -{ - int n; - - for (n = 0; n < GF2_DIM; n++) - square[n] = gf2_matrix_times(mat, mat[n]); -} - -/* ========================================================================= */ -uLong ZEXPORT crc32_combine(crc1, crc2, len2) - uLong crc1; - uLong crc2; - z_off_t len2; -{ - int n; - unsigned long row; - unsigned long even[GF2_DIM]; /* even-power-of-two zeros operator */ - unsigned long odd[GF2_DIM]; /* odd-power-of-two zeros operator */ - - /* degenerate case */ - if (len2 == 0) - return crc1; - - /* put operator for one zero bit in odd */ - odd[0] = 0xedb88320L; /* CRC-32 polynomial */ - row = 1; - for (n = 1; n < GF2_DIM; n++) { - odd[n] = row; - row <<= 1; - } - - /* put operator for two zero bits in even */ - gf2_matrix_square(even, odd); - - /* put operator for four zero bits in odd */ - gf2_matrix_square(odd, even); - - /* apply len2 zeros to crc1 (first square will put the operator for one - zero byte, eight zero bits, in even) */ - do { - /* apply zeros operator for this bit of len2 */ - gf2_matrix_square(even, odd); - if (len2 & 1) - crc1 = gf2_matrix_times(even, crc1); - len2 >>= 1; - - /* if no more bits set, then done */ - if (len2 == 0) - break; - - /* another iteration of the loop with odd and even swapped */ - gf2_matrix_square(odd, even); - if (len2 & 1) - crc1 = gf2_matrix_times(odd, crc1); - len2 >>= 1; - - /* if no more bits set, then done */ - } while (len2 != 0); - - /* return combined crc */ - crc1 ^= crc2; - return crc1; -} diff --git a/src/zlib/crc32.h b/src/zlib/crc32.h deleted file mode 100644 index 5de49bc97..000000000 --- a/src/zlib/crc32.h +++ /dev/null @@ -1,441 +0,0 @@ -/* crc32.h -- tables for rapid CRC calculation - * Generated automatically by crc32.c - */ - -local const unsigned long FAR crc_table[TBLS][256] = -{ - { - 0x00000000UL, 0x77073096UL, 0xee0e612cUL, 0x990951baUL, 0x076dc419UL, - 0x706af48fUL, 0xe963a535UL, 0x9e6495a3UL, 0x0edb8832UL, 0x79dcb8a4UL, - 0xe0d5e91eUL, 0x97d2d988UL, 0x09b64c2bUL, 0x7eb17cbdUL, 0xe7b82d07UL, - 0x90bf1d91UL, 0x1db71064UL, 0x6ab020f2UL, 0xf3b97148UL, 0x84be41deUL, - 0x1adad47dUL, 0x6ddde4ebUL, 0xf4d4b551UL, 0x83d385c7UL, 0x136c9856UL, - 0x646ba8c0UL, 0xfd62f97aUL, 0x8a65c9ecUL, 0x14015c4fUL, 0x63066cd9UL, - 0xfa0f3d63UL, 0x8d080df5UL, 0x3b6e20c8UL, 0x4c69105eUL, 0xd56041e4UL, - 0xa2677172UL, 0x3c03e4d1UL, 0x4b04d447UL, 0xd20d85fdUL, 0xa50ab56bUL, - 0x35b5a8faUL, 0x42b2986cUL, 0xdbbbc9d6UL, 0xacbcf940UL, 0x32d86ce3UL, - 0x45df5c75UL, 0xdcd60dcfUL, 0xabd13d59UL, 0x26d930acUL, 0x51de003aUL, - 0xc8d75180UL, 0xbfd06116UL, 0x21b4f4b5UL, 0x56b3c423UL, 0xcfba9599UL, - 0xb8bda50fUL, 0x2802b89eUL, 0x5f058808UL, 0xc60cd9b2UL, 0xb10be924UL, - 0x2f6f7c87UL, 0x58684c11UL, 0xc1611dabUL, 0xb6662d3dUL, 0x76dc4190UL, - 0x01db7106UL, 0x98d220bcUL, 0xefd5102aUL, 0x71b18589UL, 0x06b6b51fUL, - 0x9fbfe4a5UL, 0xe8b8d433UL, 0x7807c9a2UL, 0x0f00f934UL, 0x9609a88eUL, - 0xe10e9818UL, 0x7f6a0dbbUL, 0x086d3d2dUL, 0x91646c97UL, 0xe6635c01UL, - 0x6b6b51f4UL, 0x1c6c6162UL, 0x856530d8UL, 0xf262004eUL, 0x6c0695edUL, - 0x1b01a57bUL, 0x8208f4c1UL, 0xf50fc457UL, 0x65b0d9c6UL, 0x12b7e950UL, - 0x8bbeb8eaUL, 0xfcb9887cUL, 0x62dd1ddfUL, 0x15da2d49UL, 0x8cd37cf3UL, - 0xfbd44c65UL, 0x4db26158UL, 0x3ab551ceUL, 0xa3bc0074UL, 0xd4bb30e2UL, - 0x4adfa541UL, 0x3dd895d7UL, 0xa4d1c46dUL, 0xd3d6f4fbUL, 0x4369e96aUL, - 0x346ed9fcUL, 0xad678846UL, 0xda60b8d0UL, 0x44042d73UL, 0x33031de5UL, - 0xaa0a4c5fUL, 0xdd0d7cc9UL, 0x5005713cUL, 0x270241aaUL, 0xbe0b1010UL, - 0xc90c2086UL, 0x5768b525UL, 0x206f85b3UL, 0xb966d409UL, 0xce61e49fUL, - 0x5edef90eUL, 0x29d9c998UL, 0xb0d09822UL, 0xc7d7a8b4UL, 0x59b33d17UL, - 0x2eb40d81UL, 0xb7bd5c3bUL, 0xc0ba6cadUL, 0xedb88320UL, 0x9abfb3b6UL, - 0x03b6e20cUL, 0x74b1d29aUL, 0xead54739UL, 0x9dd277afUL, 0x04db2615UL, - 0x73dc1683UL, 0xe3630b12UL, 0x94643b84UL, 0x0d6d6a3eUL, 0x7a6a5aa8UL, - 0xe40ecf0bUL, 0x9309ff9dUL, 0x0a00ae27UL, 0x7d079eb1UL, 0xf00f9344UL, - 0x8708a3d2UL, 0x1e01f268UL, 0x6906c2feUL, 0xf762575dUL, 0x806567cbUL, - 0x196c3671UL, 0x6e6b06e7UL, 0xfed41b76UL, 0x89d32be0UL, 0x10da7a5aUL, - 0x67dd4accUL, 0xf9b9df6fUL, 0x8ebeeff9UL, 0x17b7be43UL, 0x60b08ed5UL, - 0xd6d6a3e8UL, 0xa1d1937eUL, 0x38d8c2c4UL, 0x4fdff252UL, 0xd1bb67f1UL, - 0xa6bc5767UL, 0x3fb506ddUL, 0x48b2364bUL, 0xd80d2bdaUL, 0xaf0a1b4cUL, - 0x36034af6UL, 0x41047a60UL, 0xdf60efc3UL, 0xa867df55UL, 0x316e8eefUL, - 0x4669be79UL, 0xcb61b38cUL, 0xbc66831aUL, 0x256fd2a0UL, 0x5268e236UL, - 0xcc0c7795UL, 0xbb0b4703UL, 0x220216b9UL, 0x5505262fUL, 0xc5ba3bbeUL, - 0xb2bd0b28UL, 0x2bb45a92UL, 0x5cb36a04UL, 0xc2d7ffa7UL, 0xb5d0cf31UL, - 0x2cd99e8bUL, 0x5bdeae1dUL, 0x9b64c2b0UL, 0xec63f226UL, 0x756aa39cUL, - 0x026d930aUL, 0x9c0906a9UL, 0xeb0e363fUL, 0x72076785UL, 0x05005713UL, - 0x95bf4a82UL, 0xe2b87a14UL, 0x7bb12baeUL, 0x0cb61b38UL, 0x92d28e9bUL, - 0xe5d5be0dUL, 0x7cdcefb7UL, 0x0bdbdf21UL, 0x86d3d2d4UL, 0xf1d4e242UL, - 0x68ddb3f8UL, 0x1fda836eUL, 0x81be16cdUL, 0xf6b9265bUL, 0x6fb077e1UL, - 0x18b74777UL, 0x88085ae6UL, 0xff0f6a70UL, 0x66063bcaUL, 0x11010b5cUL, - 0x8f659effUL, 0xf862ae69UL, 0x616bffd3UL, 0x166ccf45UL, 0xa00ae278UL, - 0xd70dd2eeUL, 0x4e048354UL, 0x3903b3c2UL, 0xa7672661UL, 0xd06016f7UL, - 0x4969474dUL, 0x3e6e77dbUL, 0xaed16a4aUL, 0xd9d65adcUL, 0x40df0b66UL, - 0x37d83bf0UL, 0xa9bcae53UL, 0xdebb9ec5UL, 0x47b2cf7fUL, 0x30b5ffe9UL, - 0xbdbdf21cUL, 0xcabac28aUL, 0x53b39330UL, 0x24b4a3a6UL, 0xbad03605UL, - 0xcdd70693UL, 0x54de5729UL, 0x23d967bfUL, 0xb3667a2eUL, 0xc4614ab8UL, - 0x5d681b02UL, 0x2a6f2b94UL, 0xb40bbe37UL, 0xc30c8ea1UL, 0x5a05df1bUL, - 0x2d02ef8dUL -#ifdef BYFOUR - }, - { - 0x00000000UL, 0x191b3141UL, 0x32366282UL, 0x2b2d53c3UL, 0x646cc504UL, - 0x7d77f445UL, 0x565aa786UL, 0x4f4196c7UL, 0xc8d98a08UL, 0xd1c2bb49UL, - 0xfaefe88aUL, 0xe3f4d9cbUL, 0xacb54f0cUL, 0xb5ae7e4dUL, 0x9e832d8eUL, - 0x87981ccfUL, 0x4ac21251UL, 0x53d92310UL, 0x78f470d3UL, 0x61ef4192UL, - 0x2eaed755UL, 0x37b5e614UL, 0x1c98b5d7UL, 0x05838496UL, 0x821b9859UL, - 0x9b00a918UL, 0xb02dfadbUL, 0xa936cb9aUL, 0xe6775d5dUL, 0xff6c6c1cUL, - 0xd4413fdfUL, 0xcd5a0e9eUL, 0x958424a2UL, 0x8c9f15e3UL, 0xa7b24620UL, - 0xbea97761UL, 0xf1e8e1a6UL, 0xe8f3d0e7UL, 0xc3de8324UL, 0xdac5b265UL, - 0x5d5daeaaUL, 0x44469febUL, 0x6f6bcc28UL, 0x7670fd69UL, 0x39316baeUL, - 0x202a5aefUL, 0x0b07092cUL, 0x121c386dUL, 0xdf4636f3UL, 0xc65d07b2UL, - 0xed705471UL, 0xf46b6530UL, 0xbb2af3f7UL, 0xa231c2b6UL, 0x891c9175UL, - 0x9007a034UL, 0x179fbcfbUL, 0x0e848dbaUL, 0x25a9de79UL, 0x3cb2ef38UL, - 0x73f379ffUL, 0x6ae848beUL, 0x41c51b7dUL, 0x58de2a3cUL, 0xf0794f05UL, - 0xe9627e44UL, 0xc24f2d87UL, 0xdb541cc6UL, 0x94158a01UL, 0x8d0ebb40UL, - 0xa623e883UL, 0xbf38d9c2UL, 0x38a0c50dUL, 0x21bbf44cUL, 0x0a96a78fUL, - 0x138d96ceUL, 0x5ccc0009UL, 0x45d73148UL, 0x6efa628bUL, 0x77e153caUL, - 0xbabb5d54UL, 0xa3a06c15UL, 0x888d3fd6UL, 0x91960e97UL, 0xded79850UL, - 0xc7cca911UL, 0xece1fad2UL, 0xf5facb93UL, 0x7262d75cUL, 0x6b79e61dUL, - 0x4054b5deUL, 0x594f849fUL, 0x160e1258UL, 0x0f152319UL, 0x243870daUL, - 0x3d23419bUL, 0x65fd6ba7UL, 0x7ce65ae6UL, 0x57cb0925UL, 0x4ed03864UL, - 0x0191aea3UL, 0x188a9fe2UL, 0x33a7cc21UL, 0x2abcfd60UL, 0xad24e1afUL, - 0xb43fd0eeUL, 0x9f12832dUL, 0x8609b26cUL, 0xc94824abUL, 0xd05315eaUL, - 0xfb7e4629UL, 0xe2657768UL, 0x2f3f79f6UL, 0x362448b7UL, 0x1d091b74UL, - 0x04122a35UL, 0x4b53bcf2UL, 0x52488db3UL, 0x7965de70UL, 0x607eef31UL, - 0xe7e6f3feUL, 0xfefdc2bfUL, 0xd5d0917cUL, 0xcccba03dUL, 0x838a36faUL, - 0x9a9107bbUL, 0xb1bc5478UL, 0xa8a76539UL, 0x3b83984bUL, 0x2298a90aUL, - 0x09b5fac9UL, 0x10aecb88UL, 0x5fef5d4fUL, 0x46f46c0eUL, 0x6dd93fcdUL, - 0x74c20e8cUL, 0xf35a1243UL, 0xea412302UL, 0xc16c70c1UL, 0xd8774180UL, - 0x9736d747UL, 0x8e2de606UL, 0xa500b5c5UL, 0xbc1b8484UL, 0x71418a1aUL, - 0x685abb5bUL, 0x4377e898UL, 0x5a6cd9d9UL, 0x152d4f1eUL, 0x0c367e5fUL, - 0x271b2d9cUL, 0x3e001cddUL, 0xb9980012UL, 0xa0833153UL, 0x8bae6290UL, - 0x92b553d1UL, 0xddf4c516UL, 0xc4eff457UL, 0xefc2a794UL, 0xf6d996d5UL, - 0xae07bce9UL, 0xb71c8da8UL, 0x9c31de6bUL, 0x852aef2aUL, 0xca6b79edUL, - 0xd37048acUL, 0xf85d1b6fUL, 0xe1462a2eUL, 0x66de36e1UL, 0x7fc507a0UL, - 0x54e85463UL, 0x4df36522UL, 0x02b2f3e5UL, 0x1ba9c2a4UL, 0x30849167UL, - 0x299fa026UL, 0xe4c5aeb8UL, 0xfdde9ff9UL, 0xd6f3cc3aUL, 0xcfe8fd7bUL, - 0x80a96bbcUL, 0x99b25afdUL, 0xb29f093eUL, 0xab84387fUL, 0x2c1c24b0UL, - 0x350715f1UL, 0x1e2a4632UL, 0x07317773UL, 0x4870e1b4UL, 0x516bd0f5UL, - 0x7a468336UL, 0x635db277UL, 0xcbfad74eUL, 0xd2e1e60fUL, 0xf9ccb5ccUL, - 0xe0d7848dUL, 0xaf96124aUL, 0xb68d230bUL, 0x9da070c8UL, 0x84bb4189UL, - 0x03235d46UL, 0x1a386c07UL, 0x31153fc4UL, 0x280e0e85UL, 0x674f9842UL, - 0x7e54a903UL, 0x5579fac0UL, 0x4c62cb81UL, 0x8138c51fUL, 0x9823f45eUL, - 0xb30ea79dUL, 0xaa1596dcUL, 0xe554001bUL, 0xfc4f315aUL, 0xd7626299UL, - 0xce7953d8UL, 0x49e14f17UL, 0x50fa7e56UL, 0x7bd72d95UL, 0x62cc1cd4UL, - 0x2d8d8a13UL, 0x3496bb52UL, 0x1fbbe891UL, 0x06a0d9d0UL, 0x5e7ef3ecUL, - 0x4765c2adUL, 0x6c48916eUL, 0x7553a02fUL, 0x3a1236e8UL, 0x230907a9UL, - 0x0824546aUL, 0x113f652bUL, 0x96a779e4UL, 0x8fbc48a5UL, 0xa4911b66UL, - 0xbd8a2a27UL, 0xf2cbbce0UL, 0xebd08da1UL, 0xc0fdde62UL, 0xd9e6ef23UL, - 0x14bce1bdUL, 0x0da7d0fcUL, 0x268a833fUL, 0x3f91b27eUL, 0x70d024b9UL, - 0x69cb15f8UL, 0x42e6463bUL, 0x5bfd777aUL, 0xdc656bb5UL, 0xc57e5af4UL, - 0xee530937UL, 0xf7483876UL, 0xb809aeb1UL, 0xa1129ff0UL, 0x8a3fcc33UL, - 0x9324fd72UL - }, - { - 0x00000000UL, 0x01c26a37UL, 0x0384d46eUL, 0x0246be59UL, 0x0709a8dcUL, - 0x06cbc2ebUL, 0x048d7cb2UL, 0x054f1685UL, 0x0e1351b8UL, 0x0fd13b8fUL, - 0x0d9785d6UL, 0x0c55efe1UL, 0x091af964UL, 0x08d89353UL, 0x0a9e2d0aUL, - 0x0b5c473dUL, 0x1c26a370UL, 0x1de4c947UL, 0x1fa2771eUL, 0x1e601d29UL, - 0x1b2f0bacUL, 0x1aed619bUL, 0x18abdfc2UL, 0x1969b5f5UL, 0x1235f2c8UL, - 0x13f798ffUL, 0x11b126a6UL, 0x10734c91UL, 0x153c5a14UL, 0x14fe3023UL, - 0x16b88e7aUL, 0x177ae44dUL, 0x384d46e0UL, 0x398f2cd7UL, 0x3bc9928eUL, - 0x3a0bf8b9UL, 0x3f44ee3cUL, 0x3e86840bUL, 0x3cc03a52UL, 0x3d025065UL, - 0x365e1758UL, 0x379c7d6fUL, 0x35dac336UL, 0x3418a901UL, 0x3157bf84UL, - 0x3095d5b3UL, 0x32d36beaUL, 0x331101ddUL, 0x246be590UL, 0x25a98fa7UL, - 0x27ef31feUL, 0x262d5bc9UL, 0x23624d4cUL, 0x22a0277bUL, 0x20e69922UL, - 0x2124f315UL, 0x2a78b428UL, 0x2bbade1fUL, 0x29fc6046UL, 0x283e0a71UL, - 0x2d711cf4UL, 0x2cb376c3UL, 0x2ef5c89aUL, 0x2f37a2adUL, 0x709a8dc0UL, - 0x7158e7f7UL, 0x731e59aeUL, 0x72dc3399UL, 0x7793251cUL, 0x76514f2bUL, - 0x7417f172UL, 0x75d59b45UL, 0x7e89dc78UL, 0x7f4bb64fUL, 0x7d0d0816UL, - 0x7ccf6221UL, 0x798074a4UL, 0x78421e93UL, 0x7a04a0caUL, 0x7bc6cafdUL, - 0x6cbc2eb0UL, 0x6d7e4487UL, 0x6f38fadeUL, 0x6efa90e9UL, 0x6bb5866cUL, - 0x6a77ec5bUL, 0x68315202UL, 0x69f33835UL, 0x62af7f08UL, 0x636d153fUL, - 0x612bab66UL, 0x60e9c151UL, 0x65a6d7d4UL, 0x6464bde3UL, 0x662203baUL, - 0x67e0698dUL, 0x48d7cb20UL, 0x4915a117UL, 0x4b531f4eUL, 0x4a917579UL, - 0x4fde63fcUL, 0x4e1c09cbUL, 0x4c5ab792UL, 0x4d98dda5UL, 0x46c49a98UL, - 0x4706f0afUL, 0x45404ef6UL, 0x448224c1UL, 0x41cd3244UL, 0x400f5873UL, - 0x4249e62aUL, 0x438b8c1dUL, 0x54f16850UL, 0x55330267UL, 0x5775bc3eUL, - 0x56b7d609UL, 0x53f8c08cUL, 0x523aaabbUL, 0x507c14e2UL, 0x51be7ed5UL, - 0x5ae239e8UL, 0x5b2053dfUL, 0x5966ed86UL, 0x58a487b1UL, 0x5deb9134UL, - 0x5c29fb03UL, 0x5e6f455aUL, 0x5fad2f6dUL, 0xe1351b80UL, 0xe0f771b7UL, - 0xe2b1cfeeUL, 0xe373a5d9UL, 0xe63cb35cUL, 0xe7fed96bUL, 0xe5b86732UL, - 0xe47a0d05UL, 0xef264a38UL, 0xeee4200fUL, 0xeca29e56UL, 0xed60f461UL, - 0xe82fe2e4UL, 0xe9ed88d3UL, 0xebab368aUL, 0xea695cbdUL, 0xfd13b8f0UL, - 0xfcd1d2c7UL, 0xfe976c9eUL, 0xff5506a9UL, 0xfa1a102cUL, 0xfbd87a1bUL, - 0xf99ec442UL, 0xf85cae75UL, 0xf300e948UL, 0xf2c2837fUL, 0xf0843d26UL, - 0xf1465711UL, 0xf4094194UL, 0xf5cb2ba3UL, 0xf78d95faUL, 0xf64fffcdUL, - 0xd9785d60UL, 0xd8ba3757UL, 0xdafc890eUL, 0xdb3ee339UL, 0xde71f5bcUL, - 0xdfb39f8bUL, 0xddf521d2UL, 0xdc374be5UL, 0xd76b0cd8UL, 0xd6a966efUL, - 0xd4efd8b6UL, 0xd52db281UL, 0xd062a404UL, 0xd1a0ce33UL, 0xd3e6706aUL, - 0xd2241a5dUL, 0xc55efe10UL, 0xc49c9427UL, 0xc6da2a7eUL, 0xc7184049UL, - 0xc25756ccUL, 0xc3953cfbUL, 0xc1d382a2UL, 0xc011e895UL, 0xcb4dafa8UL, - 0xca8fc59fUL, 0xc8c97bc6UL, 0xc90b11f1UL, 0xcc440774UL, 0xcd866d43UL, - 0xcfc0d31aUL, 0xce02b92dUL, 0x91af9640UL, 0x906dfc77UL, 0x922b422eUL, - 0x93e92819UL, 0x96a63e9cUL, 0x976454abUL, 0x9522eaf2UL, 0x94e080c5UL, - 0x9fbcc7f8UL, 0x9e7eadcfUL, 0x9c381396UL, 0x9dfa79a1UL, 0x98b56f24UL, - 0x99770513UL, 0x9b31bb4aUL, 0x9af3d17dUL, 0x8d893530UL, 0x8c4b5f07UL, - 0x8e0de15eUL, 0x8fcf8b69UL, 0x8a809decUL, 0x8b42f7dbUL, 0x89044982UL, - 0x88c623b5UL, 0x839a6488UL, 0x82580ebfUL, 0x801eb0e6UL, 0x81dcdad1UL, - 0x8493cc54UL, 0x8551a663UL, 0x8717183aUL, 0x86d5720dUL, 0xa9e2d0a0UL, - 0xa820ba97UL, 0xaa6604ceUL, 0xaba46ef9UL, 0xaeeb787cUL, 0xaf29124bUL, - 0xad6fac12UL, 0xacadc625UL, 0xa7f18118UL, 0xa633eb2fUL, 0xa4755576UL, - 0xa5b73f41UL, 0xa0f829c4UL, 0xa13a43f3UL, 0xa37cfdaaUL, 0xa2be979dUL, - 0xb5c473d0UL, 0xb40619e7UL, 0xb640a7beUL, 0xb782cd89UL, 0xb2cddb0cUL, - 0xb30fb13bUL, 0xb1490f62UL, 0xb08b6555UL, 0xbbd72268UL, 0xba15485fUL, - 0xb853f606UL, 0xb9919c31UL, 0xbcde8ab4UL, 0xbd1ce083UL, 0xbf5a5edaUL, - 0xbe9834edUL - }, - { - 0x00000000UL, 0xb8bc6765UL, 0xaa09c88bUL, 0x12b5afeeUL, 0x8f629757UL, - 0x37def032UL, 0x256b5fdcUL, 0x9dd738b9UL, 0xc5b428efUL, 0x7d084f8aUL, - 0x6fbde064UL, 0xd7018701UL, 0x4ad6bfb8UL, 0xf26ad8ddUL, 0xe0df7733UL, - 0x58631056UL, 0x5019579fUL, 0xe8a530faUL, 0xfa109f14UL, 0x42acf871UL, - 0xdf7bc0c8UL, 0x67c7a7adUL, 0x75720843UL, 0xcdce6f26UL, 0x95ad7f70UL, - 0x2d111815UL, 0x3fa4b7fbUL, 0x8718d09eUL, 0x1acfe827UL, 0xa2738f42UL, - 0xb0c620acUL, 0x087a47c9UL, 0xa032af3eUL, 0x188ec85bUL, 0x0a3b67b5UL, - 0xb28700d0UL, 0x2f503869UL, 0x97ec5f0cUL, 0x8559f0e2UL, 0x3de59787UL, - 0x658687d1UL, 0xdd3ae0b4UL, 0xcf8f4f5aUL, 0x7733283fUL, 0xeae41086UL, - 0x525877e3UL, 0x40edd80dUL, 0xf851bf68UL, 0xf02bf8a1UL, 0x48979fc4UL, - 0x5a22302aUL, 0xe29e574fUL, 0x7f496ff6UL, 0xc7f50893UL, 0xd540a77dUL, - 0x6dfcc018UL, 0x359fd04eUL, 0x8d23b72bUL, 0x9f9618c5UL, 0x272a7fa0UL, - 0xbafd4719UL, 0x0241207cUL, 0x10f48f92UL, 0xa848e8f7UL, 0x9b14583dUL, - 0x23a83f58UL, 0x311d90b6UL, 0x89a1f7d3UL, 0x1476cf6aUL, 0xaccaa80fUL, - 0xbe7f07e1UL, 0x06c36084UL, 0x5ea070d2UL, 0xe61c17b7UL, 0xf4a9b859UL, - 0x4c15df3cUL, 0xd1c2e785UL, 0x697e80e0UL, 0x7bcb2f0eUL, 0xc377486bUL, - 0xcb0d0fa2UL, 0x73b168c7UL, 0x6104c729UL, 0xd9b8a04cUL, 0x446f98f5UL, - 0xfcd3ff90UL, 0xee66507eUL, 0x56da371bUL, 0x0eb9274dUL, 0xb6054028UL, - 0xa4b0efc6UL, 0x1c0c88a3UL, 0x81dbb01aUL, 0x3967d77fUL, 0x2bd27891UL, - 0x936e1ff4UL, 0x3b26f703UL, 0x839a9066UL, 0x912f3f88UL, 0x299358edUL, - 0xb4446054UL, 0x0cf80731UL, 0x1e4da8dfUL, 0xa6f1cfbaUL, 0xfe92dfecUL, - 0x462eb889UL, 0x549b1767UL, 0xec277002UL, 0x71f048bbUL, 0xc94c2fdeUL, - 0xdbf98030UL, 0x6345e755UL, 0x6b3fa09cUL, 0xd383c7f9UL, 0xc1366817UL, - 0x798a0f72UL, 0xe45d37cbUL, 0x5ce150aeUL, 0x4e54ff40UL, 0xf6e89825UL, - 0xae8b8873UL, 0x1637ef16UL, 0x048240f8UL, 0xbc3e279dUL, 0x21e91f24UL, - 0x99557841UL, 0x8be0d7afUL, 0x335cb0caUL, 0xed59b63bUL, 0x55e5d15eUL, - 0x47507eb0UL, 0xffec19d5UL, 0x623b216cUL, 0xda874609UL, 0xc832e9e7UL, - 0x708e8e82UL, 0x28ed9ed4UL, 0x9051f9b1UL, 0x82e4565fUL, 0x3a58313aUL, - 0xa78f0983UL, 0x1f336ee6UL, 0x0d86c108UL, 0xb53aa66dUL, 0xbd40e1a4UL, - 0x05fc86c1UL, 0x1749292fUL, 0xaff54e4aUL, 0x322276f3UL, 0x8a9e1196UL, - 0x982bbe78UL, 0x2097d91dUL, 0x78f4c94bUL, 0xc048ae2eUL, 0xd2fd01c0UL, - 0x6a4166a5UL, 0xf7965e1cUL, 0x4f2a3979UL, 0x5d9f9697UL, 0xe523f1f2UL, - 0x4d6b1905UL, 0xf5d77e60UL, 0xe762d18eUL, 0x5fdeb6ebUL, 0xc2098e52UL, - 0x7ab5e937UL, 0x680046d9UL, 0xd0bc21bcUL, 0x88df31eaUL, 0x3063568fUL, - 0x22d6f961UL, 0x9a6a9e04UL, 0x07bda6bdUL, 0xbf01c1d8UL, 0xadb46e36UL, - 0x15080953UL, 0x1d724e9aUL, 0xa5ce29ffUL, 0xb77b8611UL, 0x0fc7e174UL, - 0x9210d9cdUL, 0x2aacbea8UL, 0x38191146UL, 0x80a57623UL, 0xd8c66675UL, - 0x607a0110UL, 0x72cfaefeUL, 0xca73c99bUL, 0x57a4f122UL, 0xef189647UL, - 0xfdad39a9UL, 0x45115eccUL, 0x764dee06UL, 0xcef18963UL, 0xdc44268dUL, - 0x64f841e8UL, 0xf92f7951UL, 0x41931e34UL, 0x5326b1daUL, 0xeb9ad6bfUL, - 0xb3f9c6e9UL, 0x0b45a18cUL, 0x19f00e62UL, 0xa14c6907UL, 0x3c9b51beUL, - 0x842736dbUL, 0x96929935UL, 0x2e2efe50UL, 0x2654b999UL, 0x9ee8defcUL, - 0x8c5d7112UL, 0x34e11677UL, 0xa9362eceUL, 0x118a49abUL, 0x033fe645UL, - 0xbb838120UL, 0xe3e09176UL, 0x5b5cf613UL, 0x49e959fdUL, 0xf1553e98UL, - 0x6c820621UL, 0xd43e6144UL, 0xc68bceaaUL, 0x7e37a9cfUL, 0xd67f4138UL, - 0x6ec3265dUL, 0x7c7689b3UL, 0xc4caeed6UL, 0x591dd66fUL, 0xe1a1b10aUL, - 0xf3141ee4UL, 0x4ba87981UL, 0x13cb69d7UL, 0xab770eb2UL, 0xb9c2a15cUL, - 0x017ec639UL, 0x9ca9fe80UL, 0x241599e5UL, 0x36a0360bUL, 0x8e1c516eUL, - 0x866616a7UL, 0x3eda71c2UL, 0x2c6fde2cUL, 0x94d3b949UL, 0x090481f0UL, - 0xb1b8e695UL, 0xa30d497bUL, 0x1bb12e1eUL, 0x43d23e48UL, 0xfb6e592dUL, - 0xe9dbf6c3UL, 0x516791a6UL, 0xccb0a91fUL, 0x740cce7aUL, 0x66b96194UL, - 0xde0506f1UL - }, - { - 0x00000000UL, 0x96300777UL, 0x2c610eeeUL, 0xba510999UL, 0x19c46d07UL, - 0x8ff46a70UL, 0x35a563e9UL, 0xa395649eUL, 0x3288db0eUL, 0xa4b8dc79UL, - 0x1ee9d5e0UL, 0x88d9d297UL, 0x2b4cb609UL, 0xbd7cb17eUL, 0x072db8e7UL, - 0x911dbf90UL, 0x6410b71dUL, 0xf220b06aUL, 0x4871b9f3UL, 0xde41be84UL, - 0x7dd4da1aUL, 0xebe4dd6dUL, 0x51b5d4f4UL, 0xc785d383UL, 0x56986c13UL, - 0xc0a86b64UL, 0x7af962fdUL, 0xecc9658aUL, 0x4f5c0114UL, 0xd96c0663UL, - 0x633d0ffaUL, 0xf50d088dUL, 0xc8206e3bUL, 0x5e10694cUL, 0xe44160d5UL, - 0x727167a2UL, 0xd1e4033cUL, 0x47d4044bUL, 0xfd850dd2UL, 0x6bb50aa5UL, - 0xfaa8b535UL, 0x6c98b242UL, 0xd6c9bbdbUL, 0x40f9bcacUL, 0xe36cd832UL, - 0x755cdf45UL, 0xcf0dd6dcUL, 0x593dd1abUL, 0xac30d926UL, 0x3a00de51UL, - 0x8051d7c8UL, 0x1661d0bfUL, 0xb5f4b421UL, 0x23c4b356UL, 0x9995bacfUL, - 0x0fa5bdb8UL, 0x9eb80228UL, 0x0888055fUL, 0xb2d90cc6UL, 0x24e90bb1UL, - 0x877c6f2fUL, 0x114c6858UL, 0xab1d61c1UL, 0x3d2d66b6UL, 0x9041dc76UL, - 0x0671db01UL, 0xbc20d298UL, 0x2a10d5efUL, 0x8985b171UL, 0x1fb5b606UL, - 0xa5e4bf9fUL, 0x33d4b8e8UL, 0xa2c90778UL, 0x34f9000fUL, 0x8ea80996UL, - 0x18980ee1UL, 0xbb0d6a7fUL, 0x2d3d6d08UL, 0x976c6491UL, 0x015c63e6UL, - 0xf4516b6bUL, 0x62616c1cUL, 0xd8306585UL, 0x4e0062f2UL, 0xed95066cUL, - 0x7ba5011bUL, 0xc1f40882UL, 0x57c40ff5UL, 0xc6d9b065UL, 0x50e9b712UL, - 0xeab8be8bUL, 0x7c88b9fcUL, 0xdf1ddd62UL, 0x492dda15UL, 0xf37cd38cUL, - 0x654cd4fbUL, 0x5861b24dUL, 0xce51b53aUL, 0x7400bca3UL, 0xe230bbd4UL, - 0x41a5df4aUL, 0xd795d83dUL, 0x6dc4d1a4UL, 0xfbf4d6d3UL, 0x6ae96943UL, - 0xfcd96e34UL, 0x468867adUL, 0xd0b860daUL, 0x732d0444UL, 0xe51d0333UL, - 0x5f4c0aaaUL, 0xc97c0dddUL, 0x3c710550UL, 0xaa410227UL, 0x10100bbeUL, - 0x86200cc9UL, 0x25b56857UL, 0xb3856f20UL, 0x09d466b9UL, 0x9fe461ceUL, - 0x0ef9de5eUL, 0x98c9d929UL, 0x2298d0b0UL, 0xb4a8d7c7UL, 0x173db359UL, - 0x810db42eUL, 0x3b5cbdb7UL, 0xad6cbac0UL, 0x2083b8edUL, 0xb6b3bf9aUL, - 0x0ce2b603UL, 0x9ad2b174UL, 0x3947d5eaUL, 0xaf77d29dUL, 0x1526db04UL, - 0x8316dc73UL, 0x120b63e3UL, 0x843b6494UL, 0x3e6a6d0dUL, 0xa85a6a7aUL, - 0x0bcf0ee4UL, 0x9dff0993UL, 0x27ae000aUL, 0xb19e077dUL, 0x44930ff0UL, - 0xd2a30887UL, 0x68f2011eUL, 0xfec20669UL, 0x5d5762f7UL, 0xcb676580UL, - 0x71366c19UL, 0xe7066b6eUL, 0x761bd4feUL, 0xe02bd389UL, 0x5a7ada10UL, - 0xcc4add67UL, 0x6fdfb9f9UL, 0xf9efbe8eUL, 0x43beb717UL, 0xd58eb060UL, - 0xe8a3d6d6UL, 0x7e93d1a1UL, 0xc4c2d838UL, 0x52f2df4fUL, 0xf167bbd1UL, - 0x6757bca6UL, 0xdd06b53fUL, 0x4b36b248UL, 0xda2b0dd8UL, 0x4c1b0aafUL, - 0xf64a0336UL, 0x607a0441UL, 0xc3ef60dfUL, 0x55df67a8UL, 0xef8e6e31UL, - 0x79be6946UL, 0x8cb361cbUL, 0x1a8366bcUL, 0xa0d26f25UL, 0x36e26852UL, - 0x95770cccUL, 0x03470bbbUL, 0xb9160222UL, 0x2f260555UL, 0xbe3bbac5UL, - 0x280bbdb2UL, 0x925ab42bUL, 0x046ab35cUL, 0xa7ffd7c2UL, 0x31cfd0b5UL, - 0x8b9ed92cUL, 0x1daede5bUL, 0xb0c2649bUL, 0x26f263ecUL, 0x9ca36a75UL, - 0x0a936d02UL, 0xa906099cUL, 0x3f360eebUL, 0x85670772UL, 0x13570005UL, - 0x824abf95UL, 0x147ab8e2UL, 0xae2bb17bUL, 0x381bb60cUL, 0x9b8ed292UL, - 0x0dbed5e5UL, 0xb7efdc7cUL, 0x21dfdb0bUL, 0xd4d2d386UL, 0x42e2d4f1UL, - 0xf8b3dd68UL, 0x6e83da1fUL, 0xcd16be81UL, 0x5b26b9f6UL, 0xe177b06fUL, - 0x7747b718UL, 0xe65a0888UL, 0x706a0fffUL, 0xca3b0666UL, 0x5c0b0111UL, - 0xff9e658fUL, 0x69ae62f8UL, 0xd3ff6b61UL, 0x45cf6c16UL, 0x78e20aa0UL, - 0xeed20dd7UL, 0x5483044eUL, 0xc2b30339UL, 0x612667a7UL, 0xf71660d0UL, - 0x4d476949UL, 0xdb776e3eUL, 0x4a6ad1aeUL, 0xdc5ad6d9UL, 0x660bdf40UL, - 0xf03bd837UL, 0x53aebca9UL, 0xc59ebbdeUL, 0x7fcfb247UL, 0xe9ffb530UL, - 0x1cf2bdbdUL, 0x8ac2bacaUL, 0x3093b353UL, 0xa6a3b424UL, 0x0536d0baUL, - 0x9306d7cdUL, 0x2957de54UL, 0xbf67d923UL, 0x2e7a66b3UL, 0xb84a61c4UL, - 0x021b685dUL, 0x942b6f2aUL, 0x37be0bb4UL, 0xa18e0cc3UL, 0x1bdf055aUL, - 0x8def022dUL - }, - { - 0x00000000UL, 0x41311b19UL, 0x82623632UL, 0xc3532d2bUL, 0x04c56c64UL, - 0x45f4777dUL, 0x86a75a56UL, 0xc796414fUL, 0x088ad9c8UL, 0x49bbc2d1UL, - 0x8ae8effaUL, 0xcbd9f4e3UL, 0x0c4fb5acUL, 0x4d7eaeb5UL, 0x8e2d839eUL, - 0xcf1c9887UL, 0x5112c24aUL, 0x1023d953UL, 0xd370f478UL, 0x9241ef61UL, - 0x55d7ae2eUL, 0x14e6b537UL, 0xd7b5981cUL, 0x96848305UL, 0x59981b82UL, - 0x18a9009bUL, 0xdbfa2db0UL, 0x9acb36a9UL, 0x5d5d77e6UL, 0x1c6c6cffUL, - 0xdf3f41d4UL, 0x9e0e5acdUL, 0xa2248495UL, 0xe3159f8cUL, 0x2046b2a7UL, - 0x6177a9beUL, 0xa6e1e8f1UL, 0xe7d0f3e8UL, 0x2483dec3UL, 0x65b2c5daUL, - 0xaaae5d5dUL, 0xeb9f4644UL, 0x28cc6b6fUL, 0x69fd7076UL, 0xae6b3139UL, - 0xef5a2a20UL, 0x2c09070bUL, 0x6d381c12UL, 0xf33646dfUL, 0xb2075dc6UL, - 0x715470edUL, 0x30656bf4UL, 0xf7f32abbUL, 0xb6c231a2UL, 0x75911c89UL, - 0x34a00790UL, 0xfbbc9f17UL, 0xba8d840eUL, 0x79dea925UL, 0x38efb23cUL, - 0xff79f373UL, 0xbe48e86aUL, 0x7d1bc541UL, 0x3c2ade58UL, 0x054f79f0UL, - 0x447e62e9UL, 0x872d4fc2UL, 0xc61c54dbUL, 0x018a1594UL, 0x40bb0e8dUL, - 0x83e823a6UL, 0xc2d938bfUL, 0x0dc5a038UL, 0x4cf4bb21UL, 0x8fa7960aUL, - 0xce968d13UL, 0x0900cc5cUL, 0x4831d745UL, 0x8b62fa6eUL, 0xca53e177UL, - 0x545dbbbaUL, 0x156ca0a3UL, 0xd63f8d88UL, 0x970e9691UL, 0x5098d7deUL, - 0x11a9ccc7UL, 0xd2fae1ecUL, 0x93cbfaf5UL, 0x5cd76272UL, 0x1de6796bUL, - 0xdeb55440UL, 0x9f844f59UL, 0x58120e16UL, 0x1923150fUL, 0xda703824UL, - 0x9b41233dUL, 0xa76bfd65UL, 0xe65ae67cUL, 0x2509cb57UL, 0x6438d04eUL, - 0xa3ae9101UL, 0xe29f8a18UL, 0x21cca733UL, 0x60fdbc2aUL, 0xafe124adUL, - 0xeed03fb4UL, 0x2d83129fUL, 0x6cb20986UL, 0xab2448c9UL, 0xea1553d0UL, - 0x29467efbUL, 0x687765e2UL, 0xf6793f2fUL, 0xb7482436UL, 0x741b091dUL, - 0x352a1204UL, 0xf2bc534bUL, 0xb38d4852UL, 0x70de6579UL, 0x31ef7e60UL, - 0xfef3e6e7UL, 0xbfc2fdfeUL, 0x7c91d0d5UL, 0x3da0cbccUL, 0xfa368a83UL, - 0xbb07919aUL, 0x7854bcb1UL, 0x3965a7a8UL, 0x4b98833bUL, 0x0aa99822UL, - 0xc9fab509UL, 0x88cbae10UL, 0x4f5def5fUL, 0x0e6cf446UL, 0xcd3fd96dUL, - 0x8c0ec274UL, 0x43125af3UL, 0x022341eaUL, 0xc1706cc1UL, 0x804177d8UL, - 0x47d73697UL, 0x06e62d8eUL, 0xc5b500a5UL, 0x84841bbcUL, 0x1a8a4171UL, - 0x5bbb5a68UL, 0x98e87743UL, 0xd9d96c5aUL, 0x1e4f2d15UL, 0x5f7e360cUL, - 0x9c2d1b27UL, 0xdd1c003eUL, 0x120098b9UL, 0x533183a0UL, 0x9062ae8bUL, - 0xd153b592UL, 0x16c5f4ddUL, 0x57f4efc4UL, 0x94a7c2efUL, 0xd596d9f6UL, - 0xe9bc07aeUL, 0xa88d1cb7UL, 0x6bde319cUL, 0x2aef2a85UL, 0xed796bcaUL, - 0xac4870d3UL, 0x6f1b5df8UL, 0x2e2a46e1UL, 0xe136de66UL, 0xa007c57fUL, - 0x6354e854UL, 0x2265f34dUL, 0xe5f3b202UL, 0xa4c2a91bUL, 0x67918430UL, - 0x26a09f29UL, 0xb8aec5e4UL, 0xf99fdefdUL, 0x3accf3d6UL, 0x7bfde8cfUL, - 0xbc6ba980UL, 0xfd5ab299UL, 0x3e099fb2UL, 0x7f3884abUL, 0xb0241c2cUL, - 0xf1150735UL, 0x32462a1eUL, 0x73773107UL, 0xb4e17048UL, 0xf5d06b51UL, - 0x3683467aUL, 0x77b25d63UL, 0x4ed7facbUL, 0x0fe6e1d2UL, 0xccb5ccf9UL, - 0x8d84d7e0UL, 0x4a1296afUL, 0x0b238db6UL, 0xc870a09dUL, 0x8941bb84UL, - 0x465d2303UL, 0x076c381aUL, 0xc43f1531UL, 0x850e0e28UL, 0x42984f67UL, - 0x03a9547eUL, 0xc0fa7955UL, 0x81cb624cUL, 0x1fc53881UL, 0x5ef42398UL, - 0x9da70eb3UL, 0xdc9615aaUL, 0x1b0054e5UL, 0x5a314ffcUL, 0x996262d7UL, - 0xd85379ceUL, 0x174fe149UL, 0x567efa50UL, 0x952dd77bUL, 0xd41ccc62UL, - 0x138a8d2dUL, 0x52bb9634UL, 0x91e8bb1fUL, 0xd0d9a006UL, 0xecf37e5eUL, - 0xadc26547UL, 0x6e91486cUL, 0x2fa05375UL, 0xe836123aUL, 0xa9070923UL, - 0x6a542408UL, 0x2b653f11UL, 0xe479a796UL, 0xa548bc8fUL, 0x661b91a4UL, - 0x272a8abdUL, 0xe0bccbf2UL, 0xa18dd0ebUL, 0x62defdc0UL, 0x23efe6d9UL, - 0xbde1bc14UL, 0xfcd0a70dUL, 0x3f838a26UL, 0x7eb2913fUL, 0xb924d070UL, - 0xf815cb69UL, 0x3b46e642UL, 0x7a77fd5bUL, 0xb56b65dcUL, 0xf45a7ec5UL, - 0x370953eeUL, 0x763848f7UL, 0xb1ae09b8UL, 0xf09f12a1UL, 0x33cc3f8aUL, - 0x72fd2493UL - }, - { - 0x00000000UL, 0x376ac201UL, 0x6ed48403UL, 0x59be4602UL, 0xdca80907UL, - 0xebc2cb06UL, 0xb27c8d04UL, 0x85164f05UL, 0xb851130eUL, 0x8f3bd10fUL, - 0xd685970dUL, 0xe1ef550cUL, 0x64f91a09UL, 0x5393d808UL, 0x0a2d9e0aUL, - 0x3d475c0bUL, 0x70a3261cUL, 0x47c9e41dUL, 0x1e77a21fUL, 0x291d601eUL, - 0xac0b2f1bUL, 0x9b61ed1aUL, 0xc2dfab18UL, 0xf5b56919UL, 0xc8f23512UL, - 0xff98f713UL, 0xa626b111UL, 0x914c7310UL, 0x145a3c15UL, 0x2330fe14UL, - 0x7a8eb816UL, 0x4de47a17UL, 0xe0464d38UL, 0xd72c8f39UL, 0x8e92c93bUL, - 0xb9f80b3aUL, 0x3cee443fUL, 0x0b84863eUL, 0x523ac03cUL, 0x6550023dUL, - 0x58175e36UL, 0x6f7d9c37UL, 0x36c3da35UL, 0x01a91834UL, 0x84bf5731UL, - 0xb3d59530UL, 0xea6bd332UL, 0xdd011133UL, 0x90e56b24UL, 0xa78fa925UL, - 0xfe31ef27UL, 0xc95b2d26UL, 0x4c4d6223UL, 0x7b27a022UL, 0x2299e620UL, - 0x15f32421UL, 0x28b4782aUL, 0x1fdeba2bUL, 0x4660fc29UL, 0x710a3e28UL, - 0xf41c712dUL, 0xc376b32cUL, 0x9ac8f52eUL, 0xada2372fUL, 0xc08d9a70UL, - 0xf7e75871UL, 0xae591e73UL, 0x9933dc72UL, 0x1c259377UL, 0x2b4f5176UL, - 0x72f11774UL, 0x459bd575UL, 0x78dc897eUL, 0x4fb64b7fUL, 0x16080d7dUL, - 0x2162cf7cUL, 0xa4748079UL, 0x931e4278UL, 0xcaa0047aUL, 0xfdcac67bUL, - 0xb02ebc6cUL, 0x87447e6dUL, 0xdefa386fUL, 0xe990fa6eUL, 0x6c86b56bUL, - 0x5bec776aUL, 0x02523168UL, 0x3538f369UL, 0x087faf62UL, 0x3f156d63UL, - 0x66ab2b61UL, 0x51c1e960UL, 0xd4d7a665UL, 0xe3bd6464UL, 0xba032266UL, - 0x8d69e067UL, 0x20cbd748UL, 0x17a11549UL, 0x4e1f534bUL, 0x7975914aUL, - 0xfc63de4fUL, 0xcb091c4eUL, 0x92b75a4cUL, 0xa5dd984dUL, 0x989ac446UL, - 0xaff00647UL, 0xf64e4045UL, 0xc1248244UL, 0x4432cd41UL, 0x73580f40UL, - 0x2ae64942UL, 0x1d8c8b43UL, 0x5068f154UL, 0x67023355UL, 0x3ebc7557UL, - 0x09d6b756UL, 0x8cc0f853UL, 0xbbaa3a52UL, 0xe2147c50UL, 0xd57ebe51UL, - 0xe839e25aUL, 0xdf53205bUL, 0x86ed6659UL, 0xb187a458UL, 0x3491eb5dUL, - 0x03fb295cUL, 0x5a456f5eUL, 0x6d2fad5fUL, 0x801b35e1UL, 0xb771f7e0UL, - 0xeecfb1e2UL, 0xd9a573e3UL, 0x5cb33ce6UL, 0x6bd9fee7UL, 0x3267b8e5UL, - 0x050d7ae4UL, 0x384a26efUL, 0x0f20e4eeUL, 0x569ea2ecUL, 0x61f460edUL, - 0xe4e22fe8UL, 0xd388ede9UL, 0x8a36abebUL, 0xbd5c69eaUL, 0xf0b813fdUL, - 0xc7d2d1fcUL, 0x9e6c97feUL, 0xa90655ffUL, 0x2c101afaUL, 0x1b7ad8fbUL, - 0x42c49ef9UL, 0x75ae5cf8UL, 0x48e900f3UL, 0x7f83c2f2UL, 0x263d84f0UL, - 0x115746f1UL, 0x944109f4UL, 0xa32bcbf5UL, 0xfa958df7UL, 0xcdff4ff6UL, - 0x605d78d9UL, 0x5737bad8UL, 0x0e89fcdaUL, 0x39e33edbUL, 0xbcf571deUL, - 0x8b9fb3dfUL, 0xd221f5ddUL, 0xe54b37dcUL, 0xd80c6bd7UL, 0xef66a9d6UL, - 0xb6d8efd4UL, 0x81b22dd5UL, 0x04a462d0UL, 0x33cea0d1UL, 0x6a70e6d3UL, - 0x5d1a24d2UL, 0x10fe5ec5UL, 0x27949cc4UL, 0x7e2adac6UL, 0x494018c7UL, - 0xcc5657c2UL, 0xfb3c95c3UL, 0xa282d3c1UL, 0x95e811c0UL, 0xa8af4dcbUL, - 0x9fc58fcaUL, 0xc67bc9c8UL, 0xf1110bc9UL, 0x740744ccUL, 0x436d86cdUL, - 0x1ad3c0cfUL, 0x2db902ceUL, 0x4096af91UL, 0x77fc6d90UL, 0x2e422b92UL, - 0x1928e993UL, 0x9c3ea696UL, 0xab546497UL, 0xf2ea2295UL, 0xc580e094UL, - 0xf8c7bc9fUL, 0xcfad7e9eUL, 0x9613389cUL, 0xa179fa9dUL, 0x246fb598UL, - 0x13057799UL, 0x4abb319bUL, 0x7dd1f39aUL, 0x3035898dUL, 0x075f4b8cUL, - 0x5ee10d8eUL, 0x698bcf8fUL, 0xec9d808aUL, 0xdbf7428bUL, 0x82490489UL, - 0xb523c688UL, 0x88649a83UL, 0xbf0e5882UL, 0xe6b01e80UL, 0xd1dadc81UL, - 0x54cc9384UL, 0x63a65185UL, 0x3a181787UL, 0x0d72d586UL, 0xa0d0e2a9UL, - 0x97ba20a8UL, 0xce0466aaUL, 0xf96ea4abUL, 0x7c78ebaeUL, 0x4b1229afUL, - 0x12ac6fadUL, 0x25c6adacUL, 0x1881f1a7UL, 0x2feb33a6UL, 0x765575a4UL, - 0x413fb7a5UL, 0xc429f8a0UL, 0xf3433aa1UL, 0xaafd7ca3UL, 0x9d97bea2UL, - 0xd073c4b5UL, 0xe71906b4UL, 0xbea740b6UL, 0x89cd82b7UL, 0x0cdbcdb2UL, - 0x3bb10fb3UL, 0x620f49b1UL, 0x55658bb0UL, 0x6822d7bbUL, 0x5f4815baUL, - 0x06f653b8UL, 0x319c91b9UL, 0xb48adebcUL, 0x83e01cbdUL, 0xda5e5abfUL, - 0xed3498beUL - }, - { - 0x00000000UL, 0x6567bcb8UL, 0x8bc809aaUL, 0xeeafb512UL, 0x5797628fUL, - 0x32f0de37UL, 0xdc5f6b25UL, 0xb938d79dUL, 0xef28b4c5UL, 0x8a4f087dUL, - 0x64e0bd6fUL, 0x018701d7UL, 0xb8bfd64aUL, 0xddd86af2UL, 0x3377dfe0UL, - 0x56106358UL, 0x9f571950UL, 0xfa30a5e8UL, 0x149f10faUL, 0x71f8ac42UL, - 0xc8c07bdfUL, 0xada7c767UL, 0x43087275UL, 0x266fcecdUL, 0x707fad95UL, - 0x1518112dUL, 0xfbb7a43fUL, 0x9ed01887UL, 0x27e8cf1aUL, 0x428f73a2UL, - 0xac20c6b0UL, 0xc9477a08UL, 0x3eaf32a0UL, 0x5bc88e18UL, 0xb5673b0aUL, - 0xd00087b2UL, 0x6938502fUL, 0x0c5fec97UL, 0xe2f05985UL, 0x8797e53dUL, - 0xd1878665UL, 0xb4e03addUL, 0x5a4f8fcfUL, 0x3f283377UL, 0x8610e4eaUL, - 0xe3775852UL, 0x0dd8ed40UL, 0x68bf51f8UL, 0xa1f82bf0UL, 0xc49f9748UL, - 0x2a30225aUL, 0x4f579ee2UL, 0xf66f497fUL, 0x9308f5c7UL, 0x7da740d5UL, - 0x18c0fc6dUL, 0x4ed09f35UL, 0x2bb7238dUL, 0xc518969fUL, 0xa07f2a27UL, - 0x1947fdbaUL, 0x7c204102UL, 0x928ff410UL, 0xf7e848a8UL, 0x3d58149bUL, - 0x583fa823UL, 0xb6901d31UL, 0xd3f7a189UL, 0x6acf7614UL, 0x0fa8caacUL, - 0xe1077fbeUL, 0x8460c306UL, 0xd270a05eUL, 0xb7171ce6UL, 0x59b8a9f4UL, - 0x3cdf154cUL, 0x85e7c2d1UL, 0xe0807e69UL, 0x0e2fcb7bUL, 0x6b4877c3UL, - 0xa20f0dcbUL, 0xc768b173UL, 0x29c70461UL, 0x4ca0b8d9UL, 0xf5986f44UL, - 0x90ffd3fcUL, 0x7e5066eeUL, 0x1b37da56UL, 0x4d27b90eUL, 0x284005b6UL, - 0xc6efb0a4UL, 0xa3880c1cUL, 0x1ab0db81UL, 0x7fd76739UL, 0x9178d22bUL, - 0xf41f6e93UL, 0x03f7263bUL, 0x66909a83UL, 0x883f2f91UL, 0xed589329UL, - 0x546044b4UL, 0x3107f80cUL, 0xdfa84d1eUL, 0xbacff1a6UL, 0xecdf92feUL, - 0x89b82e46UL, 0x67179b54UL, 0x027027ecUL, 0xbb48f071UL, 0xde2f4cc9UL, - 0x3080f9dbUL, 0x55e74563UL, 0x9ca03f6bUL, 0xf9c783d3UL, 0x176836c1UL, - 0x720f8a79UL, 0xcb375de4UL, 0xae50e15cUL, 0x40ff544eUL, 0x2598e8f6UL, - 0x73888baeUL, 0x16ef3716UL, 0xf8408204UL, 0x9d273ebcUL, 0x241fe921UL, - 0x41785599UL, 0xafd7e08bUL, 0xcab05c33UL, 0x3bb659edUL, 0x5ed1e555UL, - 0xb07e5047UL, 0xd519ecffUL, 0x6c213b62UL, 0x094687daUL, 0xe7e932c8UL, - 0x828e8e70UL, 0xd49eed28UL, 0xb1f95190UL, 0x5f56e482UL, 0x3a31583aUL, - 0x83098fa7UL, 0xe66e331fUL, 0x08c1860dUL, 0x6da63ab5UL, 0xa4e140bdUL, - 0xc186fc05UL, 0x2f294917UL, 0x4a4ef5afUL, 0xf3762232UL, 0x96119e8aUL, - 0x78be2b98UL, 0x1dd99720UL, 0x4bc9f478UL, 0x2eae48c0UL, 0xc001fdd2UL, - 0xa566416aUL, 0x1c5e96f7UL, 0x79392a4fUL, 0x97969f5dUL, 0xf2f123e5UL, - 0x05196b4dUL, 0x607ed7f5UL, 0x8ed162e7UL, 0xebb6de5fUL, 0x528e09c2UL, - 0x37e9b57aUL, 0xd9460068UL, 0xbc21bcd0UL, 0xea31df88UL, 0x8f566330UL, - 0x61f9d622UL, 0x049e6a9aUL, 0xbda6bd07UL, 0xd8c101bfUL, 0x366eb4adUL, - 0x53090815UL, 0x9a4e721dUL, 0xff29cea5UL, 0x11867bb7UL, 0x74e1c70fUL, - 0xcdd91092UL, 0xa8beac2aUL, 0x46111938UL, 0x2376a580UL, 0x7566c6d8UL, - 0x10017a60UL, 0xfeaecf72UL, 0x9bc973caUL, 0x22f1a457UL, 0x479618efUL, - 0xa939adfdUL, 0xcc5e1145UL, 0x06ee4d76UL, 0x6389f1ceUL, 0x8d2644dcUL, - 0xe841f864UL, 0x51792ff9UL, 0x341e9341UL, 0xdab12653UL, 0xbfd69aebUL, - 0xe9c6f9b3UL, 0x8ca1450bUL, 0x620ef019UL, 0x07694ca1UL, 0xbe519b3cUL, - 0xdb362784UL, 0x35999296UL, 0x50fe2e2eUL, 0x99b95426UL, 0xfcdee89eUL, - 0x12715d8cUL, 0x7716e134UL, 0xce2e36a9UL, 0xab498a11UL, 0x45e63f03UL, - 0x208183bbUL, 0x7691e0e3UL, 0x13f65c5bUL, 0xfd59e949UL, 0x983e55f1UL, - 0x2106826cUL, 0x44613ed4UL, 0xaace8bc6UL, 0xcfa9377eUL, 0x38417fd6UL, - 0x5d26c36eUL, 0xb389767cUL, 0xd6eecac4UL, 0x6fd61d59UL, 0x0ab1a1e1UL, - 0xe41e14f3UL, 0x8179a84bUL, 0xd769cb13UL, 0xb20e77abUL, 0x5ca1c2b9UL, - 0x39c67e01UL, 0x80fea99cUL, 0xe5991524UL, 0x0b36a036UL, 0x6e511c8eUL, - 0xa7166686UL, 0xc271da3eUL, 0x2cde6f2cUL, 0x49b9d394UL, 0xf0810409UL, - 0x95e6b8b1UL, 0x7b490da3UL, 0x1e2eb11bUL, 0x483ed243UL, 0x2d596efbUL, - 0xc3f6dbe9UL, 0xa6916751UL, 0x1fa9b0ccUL, 0x7ace0c74UL, 0x9461b966UL, - 0xf10605deUL -#endif - } -}; diff --git a/src/zlib/deflate.c b/src/zlib/deflate.c deleted file mode 100644 index b6f3fcde7..000000000 --- a/src/zlib/deflate.c +++ /dev/null @@ -1,1736 +0,0 @@ -/* deflate.c -- compress data using the deflation algorithm - * Copyright (C) 1995-2005 Jean-loup Gailly. - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* - * ALGORITHM - * - * The "deflation" process depends on being able to identify portions - * of the input text which are identical to earlier input (within a - * sliding window trailing behind the input currently being processed). - * - * The most straightforward technique turns out to be the fastest for - * most input files: try all possible matches and select the longest. - * The key feature of this algorithm is that insertions into the string - * dictionary are very simple and thus fast, and deletions are avoided - * completely. Insertions are performed at each input character, whereas - * string matches are performed only when the previous match ends. So it - * is preferable to spend more time in matches to allow very fast string - * insertions and avoid deletions. The matching algorithm for small - * strings is inspired from that of Rabin & Karp. A brute force approach - * is used to find longer strings when a small match has been found. - * A similar algorithm is used in comic (by Jan-Mark Wams) and freeze - * (by Leonid Broukhis). - * A previous version of this file used a more sophisticated algorithm - * (by Fiala and Greene) which is guaranteed to run in linear amortized - * time, but has a larger average cost, uses more memory and is patented. - * However the F&G algorithm may be faster for some highly redundant - * files if the parameter max_chain_length (described below) is too large. - * - * ACKNOWLEDGEMENTS - * - * The idea of lazy evaluation of matches is due to Jan-Mark Wams, and - * I found it in 'freeze' written by Leonid Broukhis. - * Thanks to many people for bug reports and testing. - * - * REFERENCES - * - * Deutsch, L.P.,"DEFLATE Compressed Data Format Specification". - * Available in http://www.ietf.org/rfc/rfc1951.txt - * - * A description of the Rabin and Karp algorithm is given in the book - * "Algorithms" by R. Sedgewick, Addison-Wesley, p252. - * - * Fiala,E.R., and Greene,D.H. - * Data Compression with Finite Windows, Comm.ACM, 32,4 (1989) 490-595 - * - */ - -/* @(#) $Id: deflate.c 126 2003-11-09 01:53:27Z gabest $ */ - -#include "deflate.h" - -const char deflate_copyright[] = - " deflate 1.2.3 Copyright 1995-2005 Jean-loup Gailly "; -/* - If you use the zlib library in a product, an acknowledgment is welcome - in the documentation of your product. If for some reason you cannot - include such an acknowledgment, I would appreciate that you keep this - copyright string in the executable of your product. - */ - -/* =========================================================================== - * Function prototypes. - */ -typedef enum { - need_more, /* block not completed, need more input or more output */ - block_done, /* block flush performed */ - finish_started, /* finish started, need only more output at next deflate */ - finish_done /* finish done, accept no more input or output */ -} block_state; - -typedef block_state (*compress_func) OF((deflate_state *s, int flush)); -/* Compression function. Returns the block state after the call. */ - -local void fill_window OF((deflate_state *s)); -local block_state deflate_stored OF((deflate_state *s, int flush)); -local block_state deflate_fast OF((deflate_state *s, int flush)); -#ifndef FASTEST -local block_state deflate_slow OF((deflate_state *s, int flush)); -#endif -local void lm_init OF((deflate_state *s)); -local void putShortMSB OF((deflate_state *s, uInt b)); -local void flush_pending OF((z_streamp strm)); -local int read_buf OF((z_streamp strm, Bytef *buf, unsigned size)); -#ifndef FASTEST -#ifdef ASMV - void match_init OF((void)); /* asm code initialization */ - uInt longest_match OF((deflate_state *s, IPos cur_match)); -#else -local uInt longest_match OF((deflate_state *s, IPos cur_match)); -#endif -#endif -local uInt longest_match_fast OF((deflate_state *s, IPos cur_match)); - -#ifdef DEBUG -local void check_match OF((deflate_state *s, IPos start, IPos match, - int length)); -#endif - -/* =========================================================================== - * Local data - */ - -#define NIL 0 -/* Tail of hash chains */ - -#ifndef TOO_FAR -# define TOO_FAR 4096 -#endif -/* Matches of length 3 are discarded if their distance exceeds TOO_FAR */ - -#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1) -/* Minimum amount of lookahead, except at the end of the input file. - * See deflate.c for comments about the MIN_MATCH+1. - */ - -/* Values for max_lazy_match, good_match and max_chain_length, depending on - * the desired pack level (0..9). The values given below have been tuned to - * exclude worst case performance for pathological files. Better values may be - * found for specific files. - */ -typedef struct config_s { - ush good_length; /* reduce lazy search above this match length */ - ush max_lazy; /* do not perform lazy search above this match length */ - ush nice_length; /* quit search above this match length */ - ush max_chain; - compress_func func; -} config; - -#ifdef FASTEST -local const config configuration_table[2] = { -/* good lazy nice chain */ -/* 0 */ {0, 0, 0, 0, deflate_stored}, /* store only */ -/* 1 */ {4, 4, 8, 4, deflate_fast}}; /* max speed, no lazy matches */ -#else -local const config configuration_table[10] = { -/* good lazy nice chain */ -/* 0 */ {0, 0, 0, 0, deflate_stored}, /* store only */ -/* 1 */ {4, 4, 8, 4, deflate_fast}, /* max speed, no lazy matches */ -/* 2 */ {4, 5, 16, 8, deflate_fast}, -/* 3 */ {4, 6, 32, 32, deflate_fast}, - -/* 4 */ {4, 4, 16, 16, deflate_slow}, /* lazy matches */ -/* 5 */ {8, 16, 32, 32, deflate_slow}, -/* 6 */ {8, 16, 128, 128, deflate_slow}, -/* 7 */ {8, 32, 128, 256, deflate_slow}, -/* 8 */ {32, 128, 258, 1024, deflate_slow}, -/* 9 */ {32, 258, 258, 4096, deflate_slow}}; /* max compression */ -#endif - -/* Note: the deflate() code requires max_lazy >= MIN_MATCH and max_chain >= 4 - * For deflate_fast() (levels <= 3) good is ignored and lazy has a different - * meaning. - */ - -#define EQUAL 0 -/* result of memcmp for equal strings */ - -#ifndef NO_DUMMY_DECL -struct static_tree_desc_s {int dummy;}; /* for buggy compilers */ -#endif - -/* =========================================================================== - * Update a hash value with the given input byte - * IN assertion: all calls to to UPDATE_HASH are made with consecutive - * input characters, so that a running hash key can be computed from the - * previous key instead of complete recalculation each time. - */ -#define UPDATE_HASH(s,h,c) (h = (((h)<hash_shift) ^ (c)) & s->hash_mask) - - -/* =========================================================================== - * Insert string str in the dictionary and set match_head to the previous head - * of the hash chain (the most recent string with same hash key). Return - * the previous length of the hash chain. - * If this file is compiled with -DFASTEST, the compression level is forced - * to 1, and no hash chains are maintained. - * IN assertion: all calls to to INSERT_STRING are made with consecutive - * input characters and the first MIN_MATCH bytes of str are valid - * (except for the last MIN_MATCH-1 bytes of the input file). - */ -#ifdef FASTEST -#define INSERT_STRING(s, str, match_head) \ - (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \ - match_head = s->head[s->ins_h], \ - s->head[s->ins_h] = (Pos)(str)) -#else -#define INSERT_STRING(s, str, match_head) \ - (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \ - match_head = s->prev[(str) & s->w_mask] = s->head[s->ins_h], \ - s->head[s->ins_h] = (Pos)(str)) -#endif - -/* =========================================================================== - * Initialize the hash table (avoiding 64K overflow for 16 bit systems). - * prev[] will be initialized on the fly. - */ -#define CLEAR_HASH(s) \ - s->head[s->hash_size-1] = NIL; \ - zmemzero((Bytef *)s->head, (unsigned)(s->hash_size-1)*sizeof(*s->head)); - -/* ========================================================================= */ -int ZEXPORT deflateInit_(strm, level, version, stream_size) - z_streamp strm; - int level; - const char *version; - int stream_size; -{ - return deflateInit2_(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, - Z_DEFAULT_STRATEGY, version, stream_size); - /* To do: ignore strm->next_in if we use it as window */ -} - -/* ========================================================================= */ -int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, - version, stream_size) - z_streamp strm; - int level; - int method; - int windowBits; - int memLevel; - int strategy; - const char *version; - int stream_size; -{ - deflate_state *s; - int wrap = 1; - static const char my_version[] = ZLIB_VERSION; - - ushf *overlay; - /* We overlay pending_buf and d_buf+l_buf. This works since the average - * output size for (length,distance) codes is <= 24 bits. - */ - - if (version == Z_NULL || version[0] != my_version[0] || - stream_size != sizeof(z_stream)) { - return Z_VERSION_ERROR; - } - if (strm == Z_NULL) return Z_STREAM_ERROR; - - strm->msg = Z_NULL; - if (strm->zalloc == (alloc_func)0) { - strm->zalloc = zcalloc; - strm->opaque = (voidpf)0; - } - if (strm->zfree == (free_func)0) strm->zfree = zcfree; - -#ifdef FASTEST - if (level != 0) level = 1; -#else - if (level == Z_DEFAULT_COMPRESSION) level = 6; -#endif - - if (windowBits < 0) { /* suppress zlib wrapper */ - wrap = 0; - windowBits = -windowBits; - } -#ifdef GZIP - else if (windowBits > 15) { - wrap = 2; /* write gzip wrapper instead */ - windowBits -= 16; - } -#endif - if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED || - windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || - strategy < 0 || strategy > Z_FIXED) { - return Z_STREAM_ERROR; - } - if (windowBits == 8) windowBits = 9; /* until 256-byte window bug fixed */ - s = (deflate_state *) ZALLOC(strm, 1, sizeof(deflate_state)); - if (s == Z_NULL) return Z_MEM_ERROR; - strm->state = (struct internal_state FAR *)s; - s->strm = strm; - - s->wrap = wrap; - s->gzhead = Z_NULL; - s->w_bits = windowBits; - s->w_size = 1 << s->w_bits; - s->w_mask = s->w_size - 1; - - s->hash_bits = memLevel + 7; - s->hash_size = 1 << s->hash_bits; - s->hash_mask = s->hash_size - 1; - s->hash_shift = ((s->hash_bits+MIN_MATCH-1)/MIN_MATCH); - - s->window = (Bytef *) ZALLOC(strm, s->w_size, 2*sizeof(Byte)); - s->prev = (Posf *) ZALLOC(strm, s->w_size, sizeof(Pos)); - s->head = (Posf *) ZALLOC(strm, s->hash_size, sizeof(Pos)); - - s->lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */ - - overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2); - s->pending_buf = (uchf *) overlay; - s->pending_buf_size = (ulg)s->lit_bufsize * (sizeof(ush)+2L); - - if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL || - s->pending_buf == Z_NULL) { - s->status = FINISH_STATE; - strm->msg = (char*)ERR_MSG(Z_MEM_ERROR); - deflateEnd (strm); - return Z_MEM_ERROR; - } - s->d_buf = overlay + s->lit_bufsize/sizeof(ush); - s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize; - - s->level = level; - s->strategy = strategy; - s->method = (Byte)method; - - return deflateReset(strm); -} - -/* ========================================================================= */ -int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength) - z_streamp strm; - const Bytef *dictionary; - uInt dictLength; -{ - deflate_state *s; - uInt length = dictLength; - uInt n; - IPos hash_head = 0; - - if (strm == Z_NULL || strm->state == Z_NULL || dictionary == Z_NULL || - strm->state->wrap == 2 || - (strm->state->wrap == 1 && strm->state->status != INIT_STATE)) - return Z_STREAM_ERROR; - - s = strm->state; - if (s->wrap) - strm->adler = adler32(strm->adler, dictionary, dictLength); - - if (length < MIN_MATCH) return Z_OK; - if (length > MAX_DIST(s)) { - length = MAX_DIST(s); - dictionary += dictLength - length; /* use the tail of the dictionary */ - } - zmemcpy(s->window, dictionary, length); - s->strstart = length; - s->block_start = (long)length; - - /* Insert all strings in the hash table (except for the last two bytes). - * s->lookahead stays null, so s->ins_h will be recomputed at the next - * call of fill_window. - */ - s->ins_h = s->window[0]; - UPDATE_HASH(s, s->ins_h, s->window[1]); - for (n = 0; n <= length - MIN_MATCH; n++) { - INSERT_STRING(s, n, hash_head); - } - if (hash_head) hash_head = 0; /* to make compiler happy */ - return Z_OK; -} - -/* ========================================================================= */ -int ZEXPORT deflateReset (strm) - z_streamp strm; -{ - deflate_state *s; - - if (strm == Z_NULL || strm->state == Z_NULL || - strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0) { - return Z_STREAM_ERROR; - } - - strm->total_in = strm->total_out = 0; - strm->msg = Z_NULL; /* use zfree if we ever allocate msg dynamically */ - strm->data_type = Z_UNKNOWN; - - s = (deflate_state *)strm->state; - s->pending = 0; - s->pending_out = s->pending_buf; - - if (s->wrap < 0) { - s->wrap = -s->wrap; /* was made negative by deflate(..., Z_FINISH); */ - } - s->status = s->wrap ? INIT_STATE : BUSY_STATE; - strm->adler = -#ifdef GZIP - s->wrap == 2 ? crc32(0L, Z_NULL, 0) : -#endif - adler32(0L, Z_NULL, 0); - s->last_flush = Z_NO_FLUSH; - - _tr_init(s); - lm_init(s); - - return Z_OK; -} - -/* ========================================================================= */ -int ZEXPORT deflateSetHeader (strm, head) - z_streamp strm; - gz_headerp head; -{ - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - if (strm->state->wrap != 2) return Z_STREAM_ERROR; - strm->state->gzhead = head; - return Z_OK; -} - -/* ========================================================================= */ -int ZEXPORT deflatePrime (strm, bits, value) - z_streamp strm; - int bits; - int value; -{ - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - strm->state->bi_valid = bits; - strm->state->bi_buf = (ush)(value & ((1 << bits) - 1)); - return Z_OK; -} - -/* ========================================================================= */ -int ZEXPORT deflateParams(strm, level, strategy) - z_streamp strm; - int level; - int strategy; -{ - deflate_state *s; - compress_func func; - int err = Z_OK; - - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - s = strm->state; - -#ifdef FASTEST - if (level != 0) level = 1; -#else - if (level == Z_DEFAULT_COMPRESSION) level = 6; -#endif - if (level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED) { - return Z_STREAM_ERROR; - } - func = configuration_table[s->level].func; - - if (func != configuration_table[level].func && strm->total_in != 0) { - /* Flush the last buffer: */ - err = deflate(strm, Z_PARTIAL_FLUSH); - } - if (s->level != level) { - s->level = level; - s->max_lazy_match = configuration_table[level].max_lazy; - s->good_match = configuration_table[level].good_length; - s->nice_match = configuration_table[level].nice_length; - s->max_chain_length = configuration_table[level].max_chain; - } - s->strategy = strategy; - return err; -} - -/* ========================================================================= */ -int ZEXPORT deflateTune(strm, good_length, max_lazy, nice_length, max_chain) - z_streamp strm; - int good_length; - int max_lazy; - int nice_length; - int max_chain; -{ - deflate_state *s; - - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - s = strm->state; - s->good_match = good_length; - s->max_lazy_match = max_lazy; - s->nice_match = nice_length; - s->max_chain_length = max_chain; - return Z_OK; -} - -/* ========================================================================= - * For the default windowBits of 15 and memLevel of 8, this function returns - * a close to exact, as well as small, upper bound on the compressed size. - * They are coded as constants here for a reason--if the #define's are - * changed, then this function needs to be changed as well. The return - * value for 15 and 8 only works for those exact settings. - * - * For any setting other than those defaults for windowBits and memLevel, - * the value returned is a conservative worst case for the maximum expansion - * resulting from using fixed blocks instead of stored blocks, which deflate - * can emit on compressed data for some combinations of the parameters. - * - * This function could be more sophisticated to provide closer upper bounds - * for every combination of windowBits and memLevel, as well as wrap. - * But even the conservative upper bound of about 14% expansion does not - * seem onerous for output buffer allocation. - */ -uLong ZEXPORT deflateBound(strm, sourceLen) - z_streamp strm; - uLong sourceLen; -{ - deflate_state *s; - uLong destLen; - - /* conservative upper bound */ - destLen = sourceLen + - ((sourceLen + 7) >> 3) + ((sourceLen + 63) >> 6) + 11; - - /* if can't get parameters, return conservative bound */ - if (strm == Z_NULL || strm->state == Z_NULL) - return destLen; - - /* if not default parameters, return conservative bound */ - s = strm->state; - if (s->w_bits != 15 || s->hash_bits != 8 + 7) - return destLen; - - /* default settings: return tight bound for that case */ - return compressBound(sourceLen); -} - -/* ========================================================================= - * Put a short in the pending buffer. The 16-bit value is put in MSB order. - * IN assertion: the stream state is correct and there is enough room in - * pending_buf. - */ -local void putShortMSB (s, b) - deflate_state *s; - uInt b; -{ - put_byte(s, (Byte)(b >> 8)); - put_byte(s, (Byte)(b & 0xff)); -} - -/* ========================================================================= - * Flush as much pending output as possible. All deflate() output goes - * through this function so some applications may wish to modify it - * to avoid allocating a large strm->next_out buffer and copying into it. - * (See also read_buf()). - */ -local void flush_pending(strm) - z_streamp strm; -{ - unsigned len = strm->state->pending; - - if (len > strm->avail_out) len = strm->avail_out; - if (len == 0) return; - - zmemcpy(strm->next_out, strm->state->pending_out, len); - strm->next_out += len; - strm->state->pending_out += len; - strm->total_out += len; - strm->avail_out -= len; - strm->state->pending -= len; - if (strm->state->pending == 0) { - strm->state->pending_out = strm->state->pending_buf; - } -} - -/* ========================================================================= */ -int ZEXPORT deflate (strm, flush) - z_streamp strm; - int flush; -{ - int old_flush; /* value of flush param for previous deflate call */ - deflate_state *s; - - if (strm == Z_NULL || strm->state == Z_NULL || - flush > Z_FINISH || flush < 0) { - return Z_STREAM_ERROR; - } - s = strm->state; - - if (strm->next_out == Z_NULL || - (strm->next_in == Z_NULL && strm->avail_in != 0) || - (s->status == FINISH_STATE && flush != Z_FINISH)) { - ERR_RETURN(strm, Z_STREAM_ERROR); - } - if (strm->avail_out == 0) ERR_RETURN(strm, Z_BUF_ERROR); - - s->strm = strm; /* just in case */ - old_flush = s->last_flush; - s->last_flush = flush; - - /* Write the header */ - if (s->status == INIT_STATE) { -#ifdef GZIP - if (s->wrap == 2) { - strm->adler = crc32(0L, Z_NULL, 0); - put_byte(s, 31); - put_byte(s, 139); - put_byte(s, 8); - if (s->gzhead == NULL) { - put_byte(s, 0); - put_byte(s, 0); - put_byte(s, 0); - put_byte(s, 0); - put_byte(s, 0); - put_byte(s, s->level == 9 ? 2 : - (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ? - 4 : 0)); - put_byte(s, OS_CODE); - s->status = BUSY_STATE; - } - else { - put_byte(s, (s->gzhead->text ? 1 : 0) + - (s->gzhead->hcrc ? 2 : 0) + - (s->gzhead->extra == Z_NULL ? 0 : 4) + - (s->gzhead->name == Z_NULL ? 0 : 8) + - (s->gzhead->comment == Z_NULL ? 0 : 16) - ); - put_byte(s, (Byte)(s->gzhead->time & 0xff)); - put_byte(s, (Byte)((s->gzhead->time >> 8) & 0xff)); - put_byte(s, (Byte)((s->gzhead->time >> 16) & 0xff)); - put_byte(s, (Byte)((s->gzhead->time >> 24) & 0xff)); - put_byte(s, s->level == 9 ? 2 : - (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ? - 4 : 0)); - put_byte(s, s->gzhead->os & 0xff); - if (s->gzhead->extra != NULL) { - put_byte(s, s->gzhead->extra_len & 0xff); - put_byte(s, (s->gzhead->extra_len >> 8) & 0xff); - } - if (s->gzhead->hcrc) - strm->adler = crc32(strm->adler, s->pending_buf, - s->pending); - s->gzindex = 0; - s->status = EXTRA_STATE; - } - } - else -#endif - { - uInt header = (Z_DEFLATED + ((s->w_bits-8)<<4)) << 8; - uInt level_flags; - - if (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2) - level_flags = 0; - else if (s->level < 6) - level_flags = 1; - else if (s->level == 6) - level_flags = 2; - else - level_flags = 3; - header |= (level_flags << 6); - if (s->strstart != 0) header |= PRESET_DICT; - header += 31 - (header % 31); - - s->status = BUSY_STATE; - putShortMSB(s, header); - - /* Save the adler32 of the preset dictionary: */ - if (s->strstart != 0) { - putShortMSB(s, (uInt)(strm->adler >> 16)); - putShortMSB(s, (uInt)(strm->adler & 0xffff)); - } - strm->adler = adler32(0L, Z_NULL, 0); - } - } -#ifdef GZIP - if (s->status == EXTRA_STATE) { - if (s->gzhead->extra != NULL) { - uInt beg = s->pending; /* start of bytes to update crc */ - - while (s->gzindex < (s->gzhead->extra_len & 0xffff)) { - if (s->pending == s->pending_buf_size) { - if (s->gzhead->hcrc && s->pending > beg) - strm->adler = crc32(strm->adler, s->pending_buf + beg, - s->pending - beg); - flush_pending(strm); - beg = s->pending; - if (s->pending == s->pending_buf_size) - break; - } - put_byte(s, s->gzhead->extra[s->gzindex]); - s->gzindex++; - } - if (s->gzhead->hcrc && s->pending > beg) - strm->adler = crc32(strm->adler, s->pending_buf + beg, - s->pending - beg); - if (s->gzindex == s->gzhead->extra_len) { - s->gzindex = 0; - s->status = NAME_STATE; - } - } - else - s->status = NAME_STATE; - } - if (s->status == NAME_STATE) { - if (s->gzhead->name != NULL) { - uInt beg = s->pending; /* start of bytes to update crc */ - int val; - - do { - if (s->pending == s->pending_buf_size) { - if (s->gzhead->hcrc && s->pending > beg) - strm->adler = crc32(strm->adler, s->pending_buf + beg, - s->pending - beg); - flush_pending(strm); - beg = s->pending; - if (s->pending == s->pending_buf_size) { - val = 1; - break; - } - } - val = s->gzhead->name[s->gzindex++]; - put_byte(s, val); - } while (val != 0); - if (s->gzhead->hcrc && s->pending > beg) - strm->adler = crc32(strm->adler, s->pending_buf + beg, - s->pending - beg); - if (val == 0) { - s->gzindex = 0; - s->status = COMMENT_STATE; - } - } - else - s->status = COMMENT_STATE; - } - if (s->status == COMMENT_STATE) { - if (s->gzhead->comment != NULL) { - uInt beg = s->pending; /* start of bytes to update crc */ - int val; - - do { - if (s->pending == s->pending_buf_size) { - if (s->gzhead->hcrc && s->pending > beg) - strm->adler = crc32(strm->adler, s->pending_buf + beg, - s->pending - beg); - flush_pending(strm); - beg = s->pending; - if (s->pending == s->pending_buf_size) { - val = 1; - break; - } - } - val = s->gzhead->comment[s->gzindex++]; - put_byte(s, val); - } while (val != 0); - if (s->gzhead->hcrc && s->pending > beg) - strm->adler = crc32(strm->adler, s->pending_buf + beg, - s->pending - beg); - if (val == 0) - s->status = HCRC_STATE; - } - else - s->status = HCRC_STATE; - } - if (s->status == HCRC_STATE) { - if (s->gzhead->hcrc) { - if (s->pending + 2 > s->pending_buf_size) - flush_pending(strm); - if (s->pending + 2 <= s->pending_buf_size) { - put_byte(s, (Byte)(strm->adler & 0xff)); - put_byte(s, (Byte)((strm->adler >> 8) & 0xff)); - strm->adler = crc32(0L, Z_NULL, 0); - s->status = BUSY_STATE; - } - } - else - s->status = BUSY_STATE; - } -#endif - - /* Flush as much pending output as possible */ - if (s->pending != 0) { - flush_pending(strm); - if (strm->avail_out == 0) { - /* Since avail_out is 0, deflate will be called again with - * more output space, but possibly with both pending and - * avail_in equal to zero. There won't be anything to do, - * but this is not an error situation so make sure we - * return OK instead of BUF_ERROR at next call of deflate: - */ - s->last_flush = -1; - return Z_OK; - } - - /* Make sure there is something to do and avoid duplicate consecutive - * flushes. For repeated and useless calls with Z_FINISH, we keep - * returning Z_STREAM_END instead of Z_BUF_ERROR. - */ - } else if (strm->avail_in == 0 && flush <= old_flush && - flush != Z_FINISH) { - ERR_RETURN(strm, Z_BUF_ERROR); - } - - /* User must not provide more input after the first FINISH: */ - if (s->status == FINISH_STATE && strm->avail_in != 0) { - ERR_RETURN(strm, Z_BUF_ERROR); - } - - /* Start a new block or continue the current one. - */ - if (strm->avail_in != 0 || s->lookahead != 0 || - (flush != Z_NO_FLUSH && s->status != FINISH_STATE)) { - block_state bstate; - - bstate = (*(configuration_table[s->level].func))(s, flush); - - if (bstate == finish_started || bstate == finish_done) { - s->status = FINISH_STATE; - } - if (bstate == need_more || bstate == finish_started) { - if (strm->avail_out == 0) { - s->last_flush = -1; /* avoid BUF_ERROR next call, see above */ - } - return Z_OK; - /* If flush != Z_NO_FLUSH && avail_out == 0, the next call - * of deflate should use the same flush parameter to make sure - * that the flush is complete. So we don't have to output an - * empty block here, this will be done at next call. This also - * ensures that for a very small output buffer, we emit at most - * one empty block. - */ - } - if (bstate == block_done) { - if (flush == Z_PARTIAL_FLUSH) { - _tr_align(s); - } else { /* FULL_FLUSH or SYNC_FLUSH */ - _tr_stored_block(s, (char*)0, 0L, 0); - /* For a full flush, this empty block will be recognized - * as a special marker by inflate_sync(). - */ - if (flush == Z_FULL_FLUSH) { - CLEAR_HASH(s); /* forget history */ - } - } - flush_pending(strm); - if (strm->avail_out == 0) { - s->last_flush = -1; /* avoid BUF_ERROR at next call, see above */ - return Z_OK; - } - } - } - Assert(strm->avail_out > 0, "bug2"); - - if (flush != Z_FINISH) return Z_OK; - if (s->wrap <= 0) return Z_STREAM_END; - - /* Write the trailer */ -#ifdef GZIP - if (s->wrap == 2) { - put_byte(s, (Byte)(strm->adler & 0xff)); - put_byte(s, (Byte)((strm->adler >> 8) & 0xff)); - put_byte(s, (Byte)((strm->adler >> 16) & 0xff)); - put_byte(s, (Byte)((strm->adler >> 24) & 0xff)); - put_byte(s, (Byte)(strm->total_in & 0xff)); - put_byte(s, (Byte)((strm->total_in >> 8) & 0xff)); - put_byte(s, (Byte)((strm->total_in >> 16) & 0xff)); - put_byte(s, (Byte)((strm->total_in >> 24) & 0xff)); - } - else -#endif - { - putShortMSB(s, (uInt)(strm->adler >> 16)); - putShortMSB(s, (uInt)(strm->adler & 0xffff)); - } - flush_pending(strm); - /* If avail_out is zero, the application will call deflate again - * to flush the rest. - */ - if (s->wrap > 0) s->wrap = -s->wrap; /* write the trailer only once! */ - return s->pending != 0 ? Z_OK : Z_STREAM_END; -} - -/* ========================================================================= */ -int ZEXPORT deflateEnd (strm) - z_streamp strm; -{ - int status; - - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - - status = strm->state->status; - if (status != INIT_STATE && - status != EXTRA_STATE && - status != NAME_STATE && - status != COMMENT_STATE && - status != HCRC_STATE && - status != BUSY_STATE && - status != FINISH_STATE) { - return Z_STREAM_ERROR; - } - - /* Deallocate in reverse order of allocations: */ - TRY_FREE(strm, strm->state->pending_buf); - TRY_FREE(strm, strm->state->head); - TRY_FREE(strm, strm->state->prev); - TRY_FREE(strm, strm->state->window); - - ZFREE(strm, strm->state); - strm->state = Z_NULL; - - return status == BUSY_STATE ? Z_DATA_ERROR : Z_OK; -} - -/* ========================================================================= - * Copy the source state to the destination state. - * To simplify the source, this is not supported for 16-bit MSDOS (which - * doesn't have enough memory anyway to duplicate compression states). - */ -int ZEXPORT deflateCopy (dest, source) - z_streamp dest; - z_streamp source; -{ -#ifdef MAXSEG_64K - return Z_STREAM_ERROR; -#else - deflate_state *ds; - deflate_state *ss; - ushf *overlay; - - - if (source == Z_NULL || dest == Z_NULL || source->state == Z_NULL) { - return Z_STREAM_ERROR; - } - - ss = source->state; - - zmemcpy(dest, source, sizeof(z_stream)); - - ds = (deflate_state *) ZALLOC(dest, 1, sizeof(deflate_state)); - if (ds == Z_NULL) return Z_MEM_ERROR; - dest->state = (struct internal_state FAR *) ds; - zmemcpy(ds, ss, sizeof(deflate_state)); - ds->strm = dest; - - ds->window = (Bytef *) ZALLOC(dest, ds->w_size, 2*sizeof(Byte)); - ds->prev = (Posf *) ZALLOC(dest, ds->w_size, sizeof(Pos)); - ds->head = (Posf *) ZALLOC(dest, ds->hash_size, sizeof(Pos)); - overlay = (ushf *) ZALLOC(dest, ds->lit_bufsize, sizeof(ush)+2); - ds->pending_buf = (uchf *) overlay; - - if (ds->window == Z_NULL || ds->prev == Z_NULL || ds->head == Z_NULL || - ds->pending_buf == Z_NULL) { - deflateEnd (dest); - return Z_MEM_ERROR; - } - /* following zmemcpy do not work for 16-bit MSDOS */ - zmemcpy(ds->window, ss->window, ds->w_size * 2 * sizeof(Byte)); - zmemcpy(ds->prev, ss->prev, ds->w_size * sizeof(Pos)); - zmemcpy(ds->head, ss->head, ds->hash_size * sizeof(Pos)); - zmemcpy(ds->pending_buf, ss->pending_buf, (uInt)ds->pending_buf_size); - - ds->pending_out = ds->pending_buf + (ss->pending_out - ss->pending_buf); - ds->d_buf = overlay + ds->lit_bufsize/sizeof(ush); - ds->l_buf = ds->pending_buf + (1+sizeof(ush))*ds->lit_bufsize; - - ds->l_desc.dyn_tree = ds->dyn_ltree; - ds->d_desc.dyn_tree = ds->dyn_dtree; - ds->bl_desc.dyn_tree = ds->bl_tree; - - return Z_OK; -#endif /* MAXSEG_64K */ -} - -/* =========================================================================== - * Read a new buffer from the current input stream, update the adler32 - * and total number of bytes read. All deflate() input goes through - * this function so some applications may wish to modify it to avoid - * allocating a large strm->next_in buffer and copying from it. - * (See also flush_pending()). - */ -local int read_buf(strm, buf, size) - z_streamp strm; - Bytef *buf; - unsigned size; -{ - unsigned len = strm->avail_in; - - if (len > size) len = size; - if (len == 0) return 0; - - strm->avail_in -= len; - - if (strm->state->wrap == 1) { - strm->adler = adler32(strm->adler, strm->next_in, len); - } -#ifdef GZIP - else if (strm->state->wrap == 2) { - strm->adler = crc32(strm->adler, strm->next_in, len); - } -#endif - zmemcpy(buf, strm->next_in, len); - strm->next_in += len; - strm->total_in += len; - - return (int)len; -} - -/* =========================================================================== - * Initialize the "longest match" routines for a new zlib stream - */ -local void lm_init (s) - deflate_state *s; -{ - s->window_size = (ulg)2L*s->w_size; - - CLEAR_HASH(s); - - /* Set the default configuration parameters: - */ - s->max_lazy_match = configuration_table[s->level].max_lazy; - s->good_match = configuration_table[s->level].good_length; - s->nice_match = configuration_table[s->level].nice_length; - s->max_chain_length = configuration_table[s->level].max_chain; - - s->strstart = 0; - s->block_start = 0L; - s->lookahead = 0; - s->match_length = s->prev_length = MIN_MATCH-1; - s->match_available = 0; - s->ins_h = 0; -#ifndef FASTEST -#ifdef ASMV - match_init(); /* initialize the asm code */ -#endif -#endif -} - -#ifndef FASTEST -/* =========================================================================== - * Set match_start to the longest match starting at the given string and - * return its length. Matches shorter or equal to prev_length are discarded, - * in which case the result is equal to prev_length and match_start is - * garbage. - * IN assertions: cur_match is the head of the hash chain for the current - * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1 - * OUT assertion: the match length is not greater than s->lookahead. - */ -#ifndef ASMV -/* For 80x86 and 680x0, an optimized version will be provided in match.asm or - * match.S. The code will be functionally equivalent. - */ -local uInt longest_match(s, cur_match) - deflate_state *s; - IPos cur_match; /* current match */ -{ - unsigned chain_length = s->max_chain_length;/* max hash chain length */ - register Bytef *scan = s->window + s->strstart; /* current string */ - register Bytef *match; /* matched string */ - register int len; /* length of current match */ - int best_len = s->prev_length; /* best match length so far */ - int nice_match = s->nice_match; /* stop if match long enough */ - IPos limit = s->strstart > (IPos)MAX_DIST(s) ? - s->strstart - (IPos)MAX_DIST(s) : NIL; - /* Stop when cur_match becomes <= limit. To simplify the code, - * we prevent matches with the string of window index 0. - */ - Posf *prev = s->prev; - uInt wmask = s->w_mask; - -#ifdef UNALIGNED_OK - /* Compare two bytes at a time. Note: this is not always beneficial. - * Try with and without -DUNALIGNED_OK to check. - */ - register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1; - register ush scan_start = *(ushf*)scan; - register ush scan_end = *(ushf*)(scan+best_len-1); -#else - register Bytef *strend = s->window + s->strstart + MAX_MATCH; - register Byte scan_end1 = scan[best_len-1]; - register Byte scan_end = scan[best_len]; -#endif - - /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16. - * It is easy to get rid of this optimization if necessary. - */ - Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever"); - - /* Do not waste too much time if we already have a good match: */ - if (s->prev_length >= s->good_match) { - chain_length >>= 2; - } - /* Do not look for matches beyond the end of the input. This is necessary - * to make deflate deterministic. - */ - if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead; - - Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead"); - - do { - Assert(cur_match < s->strstart, "no future"); - match = s->window + cur_match; - - /* Skip to next match if the match length cannot increase - * or if the match length is less than 2. Note that the checks below - * for insufficient lookahead only occur occasionally for performance - * reasons. Therefore uninitialized memory will be accessed, and - * conditional jumps will be made that depend on those values. - * However the length of the match is limited to the lookahead, so - * the output of deflate is not affected by the uninitialized values. - */ -#if (defined(UNALIGNED_OK) && MAX_MATCH == 258) - /* This code assumes sizeof(unsigned short) == 2. Do not use - * UNALIGNED_OK if your compiler uses a different size. - */ - if (*(ushf*)(match+best_len-1) != scan_end || - *(ushf*)match != scan_start) continue; - - /* It is not necessary to compare scan[2] and match[2] since they are - * always equal when the other bytes match, given that the hash keys - * are equal and that HASH_BITS >= 8. Compare 2 bytes at a time at - * strstart+3, +5, ... up to strstart+257. We check for insufficient - * lookahead only every 4th comparison; the 128th check will be made - * at strstart+257. If MAX_MATCH-2 is not a multiple of 8, it is - * necessary to put more guard bytes at the end of the window, or - * to check more often for insufficient lookahead. - */ - Assert(scan[2] == match[2], "scan[2]?"); - scan++, match++; - do { - } while (*(ushf*)(scan+=2) == *(ushf*)(match+=2) && - *(ushf*)(scan+=2) == *(ushf*)(match+=2) && - *(ushf*)(scan+=2) == *(ushf*)(match+=2) && - *(ushf*)(scan+=2) == *(ushf*)(match+=2) && - scan < strend); - /* The funny "do {}" generates better code on most compilers */ - - /* Here, scan <= window+strstart+257 */ - Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); - if (*scan == *match) scan++; - - len = (MAX_MATCH - 1) - (int)(strend-scan); - scan = strend - (MAX_MATCH-1); - -#else /* UNALIGNED_OK */ - - if (match[best_len] != scan_end || - match[best_len-1] != scan_end1 || - *match != *scan || - *++match != scan[1]) continue; - - /* The check at best_len-1 can be removed because it will be made - * again later. (This heuristic is not always a win.) - * It is not necessary to compare scan[2] and match[2] since they - * are always equal when the other bytes match, given that - * the hash keys are equal and that HASH_BITS >= 8. - */ - scan += 2, match++; - Assert(*scan == *match, "match[2]?"); - - /* We check for insufficient lookahead only every 8th comparison; - * the 256th check will be made at strstart+258. - */ - do { - } while (*++scan == *++match && *++scan == *++match && - *++scan == *++match && *++scan == *++match && - *++scan == *++match && *++scan == *++match && - *++scan == *++match && *++scan == *++match && - scan < strend); - - Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); - - len = MAX_MATCH - (int)(strend - scan); - scan = strend - MAX_MATCH; - -#endif /* UNALIGNED_OK */ - - if (len > best_len) { - s->match_start = cur_match; - best_len = len; - if (len >= nice_match) break; -#ifdef UNALIGNED_OK - scan_end = *(ushf*)(scan+best_len-1); -#else - scan_end1 = scan[best_len-1]; - scan_end = scan[best_len]; -#endif - } - } while ((cur_match = prev[cur_match & wmask]) > limit - && --chain_length != 0); - - if ((uInt)best_len <= s->lookahead) return (uInt)best_len; - return s->lookahead; -} -#endif /* ASMV */ -#endif /* FASTEST */ - -/* --------------------------------------------------------------------------- - * Optimized version for level == 1 or strategy == Z_RLE only - */ -local uInt longest_match_fast(s, cur_match) - deflate_state *s; - IPos cur_match; /* current match */ -{ - register Bytef *scan = s->window + s->strstart; /* current string */ - register Bytef *match; /* matched string */ - register int len; /* length of current match */ - register Bytef *strend = s->window + s->strstart + MAX_MATCH; - - /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16. - * It is easy to get rid of this optimization if necessary. - */ - Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever"); - - Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead"); - - Assert(cur_match < s->strstart, "no future"); - - match = s->window + cur_match; - - /* Return failure if the match length is less than 2: - */ - if (match[0] != scan[0] || match[1] != scan[1]) return MIN_MATCH-1; - - /* The check at best_len-1 can be removed because it will be made - * again later. (This heuristic is not always a win.) - * It is not necessary to compare scan[2] and match[2] since they - * are always equal when the other bytes match, given that - * the hash keys are equal and that HASH_BITS >= 8. - */ - scan += 2, match += 2; - Assert(*scan == *match, "match[2]?"); - - /* We check for insufficient lookahead only every 8th comparison; - * the 256th check will be made at strstart+258. - */ - do { - } while (*++scan == *++match && *++scan == *++match && - *++scan == *++match && *++scan == *++match && - *++scan == *++match && *++scan == *++match && - *++scan == *++match && *++scan == *++match && - scan < strend); - - Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); - - len = MAX_MATCH - (int)(strend - scan); - - if (len < MIN_MATCH) return MIN_MATCH - 1; - - s->match_start = cur_match; - return (uInt)len <= s->lookahead ? (uInt)len : s->lookahead; -} - -#ifdef DEBUG -/* =========================================================================== - * Check that the match at match_start is indeed a match. - */ -local void check_match(s, start, match, length) - deflate_state *s; - IPos start, match; - int length; -{ - /* check that the match is indeed a match */ - if (zmemcmp(s->window + match, - s->window + start, length) != EQUAL) { - fprintf(stderr, " start %u, match %u, length %d\n", - start, match, length); - do { - fprintf(stderr, "%c%c", s->window[match++], s->window[start++]); - } while (--length != 0); - z_error("invalid match"); - } - if (z_verbose > 1) { - fprintf(stderr,"\\[%d,%d]", start-match, length); - do { putc(s->window[start++], stderr); } while (--length != 0); - } -} -#else -# define check_match(s, start, match, length) -#endif /* DEBUG */ - -/* =========================================================================== - * Fill the window when the lookahead becomes insufficient. - * Updates strstart and lookahead. - * - * IN assertion: lookahead < MIN_LOOKAHEAD - * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD - * At least one byte has been read, or avail_in == 0; reads are - * performed for at least two bytes (required for the zip translate_eol - * option -- not supported here). - */ -local void fill_window(s) - deflate_state *s; -{ - register unsigned n, m; - register Posf *p; - unsigned more; /* Amount of free space at the end of the window. */ - uInt wsize = s->w_size; - - do { - more = (unsigned)(s->window_size -(ulg)s->lookahead -(ulg)s->strstart); - - /* Deal with !@#$% 64K limit: */ - if (sizeof(int) <= 2) { - if (more == 0 && s->strstart == 0 && s->lookahead == 0) { - more = wsize; - - } else if (more == (unsigned)(-1)) { - /* Very unlikely, but possible on 16 bit machine if - * strstart == 0 && lookahead == 1 (input done a byte at time) - */ - more--; - } - } - - /* If the window is almost full and there is insufficient lookahead, - * move the upper half to the lower one to make room in the upper half. - */ - if (s->strstart >= wsize+MAX_DIST(s)) { - - zmemcpy(s->window, s->window+wsize, (unsigned)wsize); - s->match_start -= wsize; - s->strstart -= wsize; /* we now have strstart >= MAX_DIST */ - s->block_start -= (long) wsize; - - /* Slide the hash table (could be avoided with 32 bit values - at the expense of memory usage). We slide even when level == 0 - to keep the hash table consistent if we switch back to level > 0 - later. (Using level 0 permanently is not an optimal usage of - zlib, so we don't care about this pathological case.) - */ - /* %%% avoid this when Z_RLE */ - n = s->hash_size; - p = &s->head[n]; - do { - m = *--p; - *p = (Pos)(m >= wsize ? m-wsize : NIL); - } while (--n); - - n = wsize; -#ifndef FASTEST - p = &s->prev[n]; - do { - m = *--p; - *p = (Pos)(m >= wsize ? m-wsize : NIL); - /* If n is not on any hash chain, prev[n] is garbage but - * its value will never be used. - */ - } while (--n); -#endif - more += wsize; - } - if (s->strm->avail_in == 0) return; - - /* If there was no sliding: - * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 && - * more == window_size - lookahead - strstart - * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1) - * => more >= window_size - 2*WSIZE + 2 - * In the BIG_MEM or MMAP case (not yet supported), - * window_size == input_size + MIN_LOOKAHEAD && - * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD. - * Otherwise, window_size == 2*WSIZE so more >= 2. - * If there was sliding, more >= WSIZE. So in all cases, more >= 2. - */ - Assert(more >= 2, "more < 2"); - - n = read_buf(s->strm, s->window + s->strstart + s->lookahead, more); - s->lookahead += n; - - /* Initialize the hash value now that we have some input: */ - if (s->lookahead >= MIN_MATCH) { - s->ins_h = s->window[s->strstart]; - UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]); -#if MIN_MATCH != 3 - Call UPDATE_HASH() MIN_MATCH-3 more times -#endif - } - /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage, - * but this is not important since only literal bytes will be emitted. - */ - - } while (s->lookahead < MIN_LOOKAHEAD && s->strm->avail_in != 0); -} - -/* =========================================================================== - * Flush the current block, with given end-of-file flag. - * IN assertion: strstart is set to the end of the current match. - */ -#define FLUSH_BLOCK_ONLY(s, eof) { \ - _tr_flush_block(s, (s->block_start >= 0L ? \ - (charf *)&s->window[(unsigned)s->block_start] : \ - (charf *)Z_NULL), \ - (ulg)((long)s->strstart - s->block_start), \ - (eof)); \ - s->block_start = s->strstart; \ - flush_pending(s->strm); \ - Tracev((stderr,"[FLUSH]")); \ -} - -/* Same but force premature exit if necessary. */ -#define FLUSH_BLOCK(s, eof) { \ - FLUSH_BLOCK_ONLY(s, eof); \ - if (s->strm->avail_out == 0) return (eof) ? finish_started : need_more; \ -} - -/* =========================================================================== - * Copy without compression as much as possible from the input stream, return - * the current block state. - * This function does not insert new strings in the dictionary since - * uncompressible data is probably not useful. This function is used - * only for the level=0 compression option. - * NOTE: this function should be optimized to avoid extra copying from - * window to pending_buf. - */ -local block_state deflate_stored(s, flush) - deflate_state *s; - int flush; -{ - /* Stored blocks are limited to 0xffff bytes, pending_buf is limited - * to pending_buf_size, and each stored block has a 5 byte header: - */ - ulg max_block_size = 0xffff; - ulg max_start; - - if (max_block_size > s->pending_buf_size - 5) { - max_block_size = s->pending_buf_size - 5; - } - - /* Copy as much as possible from input to output: */ - for (;;) { - /* Fill the window as much as possible: */ - if (s->lookahead <= 1) { - - Assert(s->strstart < s->w_size+MAX_DIST(s) || - s->block_start >= (long)s->w_size, "slide too late"); - - fill_window(s); - if (s->lookahead == 0 && flush == Z_NO_FLUSH) return need_more; - - if (s->lookahead == 0) break; /* flush the current block */ - } - Assert(s->block_start >= 0L, "block gone"); - - s->strstart += s->lookahead; - s->lookahead = 0; - - /* Emit a stored block if pending_buf will be full: */ - max_start = s->block_start + max_block_size; - if (s->strstart == 0 || (ulg)s->strstart >= max_start) { - /* strstart == 0 is possible when wraparound on 16-bit machine */ - s->lookahead = (uInt)(s->strstart - max_start); - s->strstart = (uInt)max_start; - FLUSH_BLOCK(s, 0); - } - /* Flush if we may have to slide, otherwise block_start may become - * negative and the data will be gone: - */ - if (s->strstart - (uInt)s->block_start >= MAX_DIST(s)) { - FLUSH_BLOCK(s, 0); - } - } - FLUSH_BLOCK(s, flush == Z_FINISH); - return flush == Z_FINISH ? finish_done : block_done; -} - -/* =========================================================================== - * Compress as much as possible from the input stream, return the current - * block state. - * This function does not perform lazy evaluation of matches and inserts - * new strings in the dictionary only for unmatched strings or for short - * matches. It is used only for the fast compression options. - */ -local block_state deflate_fast(s, flush) - deflate_state *s; - int flush; -{ - IPos hash_head = NIL; /* head of the hash chain */ - int bflush; /* set if current block must be flushed */ - - for (;;) { - /* Make sure that we always have enough lookahead, except - * at the end of the input file. We need MAX_MATCH bytes - * for the next match, plus MIN_MATCH bytes to insert the - * string following the next match. - */ - if (s->lookahead < MIN_LOOKAHEAD) { - fill_window(s); - if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) { - return need_more; - } - if (s->lookahead == 0) break; /* flush the current block */ - } - - /* Insert the string window[strstart .. strstart+2] in the - * dictionary, and set hash_head to the head of the hash chain: - */ - if (s->lookahead >= MIN_MATCH) { - INSERT_STRING(s, s->strstart, hash_head); - } - - /* Find the longest match, discarding those <= prev_length. - * At this point we have always match_length < MIN_MATCH - */ - if (hash_head != NIL && s->strstart - hash_head <= MAX_DIST(s)) { - /* To simplify the code, we prevent matches with the string - * of window index 0 (in particular we have to avoid a match - * of the string with itself at the start of the input file). - */ -#ifdef FASTEST - if ((s->strategy != Z_HUFFMAN_ONLY && s->strategy != Z_RLE) || - (s->strategy == Z_RLE && s->strstart - hash_head == 1)) { - s->match_length = longest_match_fast (s, hash_head); - } -#else - if (s->strategy != Z_HUFFMAN_ONLY && s->strategy != Z_RLE) { - s->match_length = longest_match (s, hash_head); - } else if (s->strategy == Z_RLE && s->strstart - hash_head == 1) { - s->match_length = longest_match_fast (s, hash_head); - } -#endif - /* longest_match() or longest_match_fast() sets match_start */ - } - if (s->match_length >= MIN_MATCH) { - check_match(s, s->strstart, s->match_start, s->match_length); - - _tr_tally_dist(s, s->strstart - s->match_start, - s->match_length - MIN_MATCH, bflush); - - s->lookahead -= s->match_length; - - /* Insert new strings in the hash table only if the match length - * is not too large. This saves time but degrades compression. - */ -#ifndef FASTEST - if (s->match_length <= s->max_insert_length && - s->lookahead >= MIN_MATCH) { - s->match_length--; /* string at strstart already in table */ - do { - s->strstart++; - INSERT_STRING(s, s->strstart, hash_head); - /* strstart never exceeds WSIZE-MAX_MATCH, so there are - * always MIN_MATCH bytes ahead. - */ - } while (--s->match_length != 0); - s->strstart++; - } else -#endif - { - s->strstart += s->match_length; - s->match_length = 0; - s->ins_h = s->window[s->strstart]; - UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]); -#if MIN_MATCH != 3 - Call UPDATE_HASH() MIN_MATCH-3 more times -#endif - /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not - * matter since it will be recomputed at next deflate call. - */ - } - } else { - /* No match, output a literal byte */ - Tracevv((stderr,"%c", s->window[s->strstart])); - _tr_tally_lit (s, s->window[s->strstart], bflush); - s->lookahead--; - s->strstart++; - } - if (bflush) FLUSH_BLOCK(s, 0); - } - FLUSH_BLOCK(s, flush == Z_FINISH); - return flush == Z_FINISH ? finish_done : block_done; -} - -#ifndef FASTEST -/* =========================================================================== - * Same as above, but achieves better compression. We use a lazy - * evaluation for matches: a match is finally adopted only if there is - * no better match at the next window position. - */ -local block_state deflate_slow(s, flush) - deflate_state *s; - int flush; -{ - IPos hash_head = NIL; /* head of hash chain */ - int bflush; /* set if current block must be flushed */ - - /* Process the input block. */ - for (;;) { - /* Make sure that we always have enough lookahead, except - * at the end of the input file. We need MAX_MATCH bytes - * for the next match, plus MIN_MATCH bytes to insert the - * string following the next match. - */ - if (s->lookahead < MIN_LOOKAHEAD) { - fill_window(s); - if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) { - return need_more; - } - if (s->lookahead == 0) break; /* flush the current block */ - } - - /* Insert the string window[strstart .. strstart+2] in the - * dictionary, and set hash_head to the head of the hash chain: - */ - if (s->lookahead >= MIN_MATCH) { - INSERT_STRING(s, s->strstart, hash_head); - } - - /* Find the longest match, discarding those <= prev_length. - */ - s->prev_length = s->match_length, s->prev_match = s->match_start; - s->match_length = MIN_MATCH-1; - - if (hash_head != NIL && s->prev_length < s->max_lazy_match && - s->strstart - hash_head <= MAX_DIST(s)) { - /* To simplify the code, we prevent matches with the string - * of window index 0 (in particular we have to avoid a match - * of the string with itself at the start of the input file). - */ - if (s->strategy != Z_HUFFMAN_ONLY && s->strategy != Z_RLE) { - s->match_length = longest_match (s, hash_head); - } else if (s->strategy == Z_RLE && s->strstart - hash_head == 1) { - s->match_length = longest_match_fast (s, hash_head); - } - /* longest_match() or longest_match_fast() sets match_start */ - - if (s->match_length <= 5 && (s->strategy == Z_FILTERED -#if TOO_FAR <= 32767 - || (s->match_length == MIN_MATCH && - s->strstart - s->match_start > TOO_FAR) -#endif - )) { - - /* If prev_match is also MIN_MATCH, match_start is garbage - * but we will ignore the current match anyway. - */ - s->match_length = MIN_MATCH-1; - } - } - /* If there was a match at the previous step and the current - * match is not better, output the previous match: - */ - if (s->prev_length >= MIN_MATCH && s->match_length <= s->prev_length) { - uInt max_insert = s->strstart + s->lookahead - MIN_MATCH; - /* Do not insert strings in hash table beyond this. */ - - check_match(s, s->strstart-1, s->prev_match, s->prev_length); - - _tr_tally_dist(s, s->strstart -1 - s->prev_match, - s->prev_length - MIN_MATCH, bflush); - - /* Insert in hash table all strings up to the end of the match. - * strstart-1 and strstart are already inserted. If there is not - * enough lookahead, the last two strings are not inserted in - * the hash table. - */ - s->lookahead -= s->prev_length-1; - s->prev_length -= 2; - do { - if (++s->strstart <= max_insert) { - INSERT_STRING(s, s->strstart, hash_head); - } - } while (--s->prev_length != 0); - s->match_available = 0; - s->match_length = MIN_MATCH-1; - s->strstart++; - - if (bflush) FLUSH_BLOCK(s, 0); - - } else if (s->match_available) { - /* If there was no match at the previous position, output a - * single literal. If there was a match but the current match - * is longer, truncate the previous match to a single literal. - */ - Tracevv((stderr,"%c", s->window[s->strstart-1])); - _tr_tally_lit(s, s->window[s->strstart-1], bflush); - if (bflush) { - FLUSH_BLOCK_ONLY(s, 0); - } - s->strstart++; - s->lookahead--; - if (s->strm->avail_out == 0) return need_more; - } else { - /* There is no previous match to compare with, wait for - * the next step to decide. - */ - s->match_available = 1; - s->strstart++; - s->lookahead--; - } - } - Assert (flush != Z_NO_FLUSH, "no flush?"); - if (s->match_available) { - Tracevv((stderr,"%c", s->window[s->strstart-1])); - _tr_tally_lit(s, s->window[s->strstart-1], bflush); - s->match_available = 0; - } - FLUSH_BLOCK(s, flush == Z_FINISH); - return flush == Z_FINISH ? finish_done : block_done; -} -#endif /* FASTEST */ - -#if 0 -/* =========================================================================== - * For Z_RLE, simply look for runs of bytes, generate matches only of distance - * one. Do not maintain a hash table. (It will be regenerated if this run of - * deflate switches away from Z_RLE.) - */ -local block_state deflate_rle(s, flush) - deflate_state *s; - int flush; -{ - int bflush; /* set if current block must be flushed */ - uInt run; /* length of run */ - uInt max; /* maximum length of run */ - uInt prev; /* byte at distance one to match */ - Bytef *scan; /* scan for end of run */ - - for (;;) { - /* Make sure that we always have enough lookahead, except - * at the end of the input file. We need MAX_MATCH bytes - * for the longest encodable run. - */ - if (s->lookahead < MAX_MATCH) { - fill_window(s); - if (s->lookahead < MAX_MATCH && flush == Z_NO_FLUSH) { - return need_more; - } - if (s->lookahead == 0) break; /* flush the current block */ - } - - /* See how many times the previous byte repeats */ - run = 0; - if (s->strstart > 0) { /* if there is a previous byte, that is */ - max = s->lookahead < MAX_MATCH ? s->lookahead : MAX_MATCH; - scan = s->window + s->strstart - 1; - prev = *scan++; - do { - if (*scan++ != prev) - break; - } while (++run < max); - } - - /* Emit match if have run of MIN_MATCH or longer, else emit literal */ - if (run >= MIN_MATCH) { - check_match(s, s->strstart, s->strstart - 1, run); - _tr_tally_dist(s, 1, run - MIN_MATCH, bflush); - s->lookahead -= run; - s->strstart += run; - } else { - /* No match, output a literal byte */ - Tracevv((stderr,"%c", s->window[s->strstart])); - _tr_tally_lit (s, s->window[s->strstart], bflush); - s->lookahead--; - s->strstart++; - } - if (bflush) FLUSH_BLOCK(s, 0); - } - FLUSH_BLOCK(s, flush == Z_FINISH); - return flush == Z_FINISH ? finish_done : block_done; -} -#endif diff --git a/src/zlib/deflate.h b/src/zlib/deflate.h deleted file mode 100644 index a40649436..000000000 --- a/src/zlib/deflate.h +++ /dev/null @@ -1,331 +0,0 @@ -/* deflate.h -- internal compression state - * Copyright (C) 1995-2004 Jean-loup Gailly - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* WARNING: this file should *not* be used by applications. It is - part of the implementation of the compression library and is - subject to change. Applications should only use zlib.h. - */ - -/* @(#) $Id: deflate.h 126 2003-11-09 01:53:27Z gabest $ */ - -#ifndef DEFLATE_H -#define DEFLATE_H - -#include "zutil.h" - -/* define NO_GZIP when compiling if you want to disable gzip header and - trailer creation by deflate(). NO_GZIP would be used to avoid linking in - the crc code when it is not needed. For shared libraries, gzip encoding - should be left enabled. */ -#ifndef NO_GZIP -# define GZIP -#endif - -/* =========================================================================== - * Internal compression state. - */ - -#define LENGTH_CODES 29 -/* number of length codes, not counting the special END_BLOCK code */ - -#define LITERALS 256 -/* number of literal bytes 0..255 */ - -#define L_CODES (LITERALS+1+LENGTH_CODES) -/* number of Literal or Length codes, including the END_BLOCK code */ - -#define D_CODES 30 -/* number of distance codes */ - -#define BL_CODES 19 -/* number of codes used to transfer the bit lengths */ - -#define HEAP_SIZE (2*L_CODES+1) -/* maximum heap size */ - -#define MAX_BITS 15 -/* All codes must not exceed MAX_BITS bits */ - -#define INIT_STATE 42 -#define EXTRA_STATE 69 -#define NAME_STATE 73 -#define COMMENT_STATE 91 -#define HCRC_STATE 103 -#define BUSY_STATE 113 -#define FINISH_STATE 666 -/* Stream status */ - - -/* Data structure describing a single value and its code string. */ -typedef struct ct_data_s { - union { - ush freq; /* frequency count */ - ush code; /* bit string */ - } fc; - union { - ush dad; /* father node in Huffman tree */ - ush len; /* length of bit string */ - } dl; -} FAR ct_data; - -#define Freq fc.freq -#define Code fc.code -#define Dad dl.dad -#define Len dl.len - -typedef struct static_tree_desc_s static_tree_desc; - -typedef struct tree_desc_s { - ct_data *dyn_tree; /* the dynamic tree */ - int max_code; /* largest code with non zero frequency */ - static_tree_desc *stat_desc; /* the corresponding static tree */ -} FAR tree_desc; - -typedef ush Pos; -typedef Pos FAR Posf; -typedef unsigned IPos; - -/* A Pos is an index in the character window. We use short instead of int to - * save space in the various tables. IPos is used only for parameter passing. - */ - -typedef struct internal_state { - z_streamp strm; /* pointer back to this zlib stream */ - int status; /* as the name implies */ - Bytef *pending_buf; /* output still pending */ - ulg pending_buf_size; /* size of pending_buf */ - Bytef *pending_out; /* next pending byte to output to the stream */ - uInt pending; /* nb of bytes in the pending buffer */ - int wrap; /* bit 0 true for zlib, bit 1 true for gzip */ - gz_headerp gzhead; /* gzip header information to write */ - uInt gzindex; /* where in extra, name, or comment */ - Byte method; /* STORED (for zip only) or DEFLATED */ - int last_flush; /* value of flush param for previous deflate call */ - - /* used by deflate.c: */ - - uInt w_size; /* LZ77 window size (32K by default) */ - uInt w_bits; /* log2(w_size) (8..16) */ - uInt w_mask; /* w_size - 1 */ - - Bytef *window; - /* Sliding window. Input bytes are read into the second half of the window, - * and move to the first half later to keep a dictionary of at least wSize - * bytes. With this organization, matches are limited to a distance of - * wSize-MAX_MATCH bytes, but this ensures that IO is always - * performed with a length multiple of the block size. Also, it limits - * the window size to 64K, which is quite useful on MSDOS. - * To do: use the user input buffer as sliding window. - */ - - ulg window_size; - /* Actual size of window: 2*wSize, except when the user input buffer - * is directly used as sliding window. - */ - - Posf *prev; - /* Link to older string with same hash index. To limit the size of this - * array to 64K, this link is maintained only for the last 32K strings. - * An index in this array is thus a window index modulo 32K. - */ - - Posf *head; /* Heads of the hash chains or NIL. */ - - uInt ins_h; /* hash index of string to be inserted */ - uInt hash_size; /* number of elements in hash table */ - uInt hash_bits; /* log2(hash_size) */ - uInt hash_mask; /* hash_size-1 */ - - uInt hash_shift; - /* Number of bits by which ins_h must be shifted at each input - * step. It must be such that after MIN_MATCH steps, the oldest - * byte no longer takes part in the hash key, that is: - * hash_shift * MIN_MATCH >= hash_bits - */ - - long block_start; - /* Window position at the beginning of the current output block. Gets - * negative when the window is moved backwards. - */ - - uInt match_length; /* length of best match */ - IPos prev_match; /* previous match */ - int match_available; /* set if previous match exists */ - uInt strstart; /* start of string to insert */ - uInt match_start; /* start of matching string */ - uInt lookahead; /* number of valid bytes ahead in window */ - - uInt prev_length; - /* Length of the best match at previous step. Matches not greater than this - * are discarded. This is used in the lazy match evaluation. - */ - - uInt max_chain_length; - /* To speed up deflation, hash chains are never searched beyond this - * length. A higher limit improves compression ratio but degrades the - * speed. - */ - - uInt max_lazy_match; - /* Attempt to find a better match only when the current match is strictly - * smaller than this value. This mechanism is used only for compression - * levels >= 4. - */ -# define max_insert_length max_lazy_match - /* Insert new strings in the hash table only if the match length is not - * greater than this length. This saves time but degrades compression. - * max_insert_length is used only for compression levels <= 3. - */ - - int level; /* compression level (1..9) */ - int strategy; /* favor or force Huffman coding*/ - - uInt good_match; - /* Use a faster search when the previous match is longer than this */ - - int nice_match; /* Stop searching when current match exceeds this */ - - /* used by trees.c: */ - /* Didn't use ct_data typedef below to supress compiler warning */ - struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */ - struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */ - struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */ - - struct tree_desc_s l_desc; /* desc. for literal tree */ - struct tree_desc_s d_desc; /* desc. for distance tree */ - struct tree_desc_s bl_desc; /* desc. for bit length tree */ - - ush bl_count[MAX_BITS+1]; - /* number of codes at each bit length for an optimal tree */ - - int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */ - int heap_len; /* number of elements in the heap */ - int heap_max; /* element of largest frequency */ - /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used. - * The same heap array is used to build all trees. - */ - - uch depth[2*L_CODES+1]; - /* Depth of each subtree used as tie breaker for trees of equal frequency - */ - - uchf *l_buf; /* buffer for literals or lengths */ - - uInt lit_bufsize; - /* Size of match buffer for literals/lengths. There are 4 reasons for - * limiting lit_bufsize to 64K: - * - frequencies can be kept in 16 bit counters - * - if compression is not successful for the first block, all input - * data is still in the window so we can still emit a stored block even - * when input comes from standard input. (This can also be done for - * all blocks if lit_bufsize is not greater than 32K.) - * - if compression is not successful for a file smaller than 64K, we can - * even emit a stored file instead of a stored block (saving 5 bytes). - * This is applicable only for zip (not gzip or zlib). - * - creating new Huffman trees less frequently may not provide fast - * adaptation to changes in the input data statistics. (Take for - * example a binary file with poorly compressible code followed by - * a highly compressible string table.) Smaller buffer sizes give - * fast adaptation but have of course the overhead of transmitting - * trees more frequently. - * - I can't count above 4 - */ - - uInt last_lit; /* running index in l_buf */ - - ushf *d_buf; - /* Buffer for distances. To simplify the code, d_buf and l_buf have - * the same number of elements. To use different lengths, an extra flag - * array would be necessary. - */ - - ulg opt_len; /* bit length of current block with optimal trees */ - ulg static_len; /* bit length of current block with static trees */ - uInt matches; /* number of string matches in current block */ - int last_eob_len; /* bit length of EOB code for last block */ - -#ifdef DEBUG - ulg compressed_len; /* total bit length of compressed file mod 2^32 */ - ulg bits_sent; /* bit length of compressed data sent mod 2^32 */ -#endif - - ush bi_buf; - /* Output buffer. bits are inserted starting at the bottom (least - * significant bits). - */ - int bi_valid; - /* Number of valid bits in bi_buf. All bits above the last valid bit - * are always zero. - */ - -} FAR deflate_state; - -/* Output a byte on the stream. - * IN assertion: there is enough room in pending_buf. - */ -#define put_byte(s, c) {s->pending_buf[s->pending++] = (c);} - - -#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1) -/* Minimum amount of lookahead, except at the end of the input file. - * See deflate.c for comments about the MIN_MATCH+1. - */ - -#define MAX_DIST(s) ((s)->w_size-MIN_LOOKAHEAD) -/* In order to simplify the code, particularly on 16 bit machines, match - * distances are limited to MAX_DIST instead of WSIZE. - */ - - /* in trees.c */ -void _tr_init OF((deflate_state *s)); -int _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc)); -void _tr_flush_block OF((deflate_state *s, charf *buf, ulg stored_len, - int eof)); -void _tr_align OF((deflate_state *s)); -void _tr_stored_block OF((deflate_state *s, charf *buf, ulg stored_len, - int eof)); - -#define d_code(dist) \ - ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)]) -/* Mapping from a distance to a distance code. dist is the distance - 1 and - * must not have side effects. _dist_code[256] and _dist_code[257] are never - * used. - */ - -#ifndef DEBUG -/* Inline versions of _tr_tally for speed: */ - -#if defined(GEN_TREES_H) || !defined(STDC) - extern uch _length_code[]; - extern uch _dist_code[]; -#else - extern const uch _length_code[]; - extern const uch _dist_code[]; -#endif - -# define _tr_tally_lit(s, c, flush) \ - { uch cc = (c); \ - s->d_buf[s->last_lit] = 0; \ - s->l_buf[s->last_lit++] = cc; \ - s->dyn_ltree[cc].Freq++; \ - flush = (s->last_lit == s->lit_bufsize-1); \ - } -# define _tr_tally_dist(s, distance, length, flush) \ - { uch len = (length); \ - ush dist = (distance); \ - s->d_buf[s->last_lit] = dist; \ - s->l_buf[s->last_lit++] = len; \ - dist--; \ - s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \ - s->dyn_dtree[d_code(dist)].Freq++; \ - flush = (s->last_lit == s->lit_bufsize-1); \ - } -#else -# define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c) -# define _tr_tally_dist(s, distance, length, flush) \ - flush = _tr_tally(s, distance, length) -#endif - -#endif /* DEFLATE_H */ diff --git a/src/zlib/gzio.c b/src/zlib/gzio.c deleted file mode 100644 index 67ed8eeeb..000000000 --- a/src/zlib/gzio.c +++ /dev/null @@ -1,1026 +0,0 @@ -/* gzio.c -- IO on .gz files - * Copyright (C) 1995-2005 Jean-loup Gailly. - * For conditions of distribution and use, see copyright notice in zlib.h - * - * Compile this file with -DNO_GZCOMPRESS to avoid the compression code. - */ - -/* @(#) $Id: gzio.c 126 2003-11-09 01:53:27Z gabest $ */ - -#include - -#include "zutil.h" - -#ifdef NO_DEFLATE /* for compatibility with old definition */ -# define NO_GZCOMPRESS -#endif - -#ifndef NO_DUMMY_DECL -struct internal_state {int dummy;}; /* for buggy compilers */ -#endif - -#ifndef Z_BUFSIZE -# ifdef MAXSEG_64K -# define Z_BUFSIZE 4096 /* minimize memory usage for 16-bit DOS */ -# else -# define Z_BUFSIZE 16384 -# endif -#endif -#ifndef Z_PRINTF_BUFSIZE -# define Z_PRINTF_BUFSIZE 4096 -#endif - -#ifdef __MVS__ -# pragma map (fdopen , "\174\174FDOPEN") - FILE *fdopen(int, const char *); -#endif - -#ifndef STDC -extern voidp malloc OF((uInt size)); -extern void free OF((voidpf ptr)); -#endif - -#define ALLOC(size) malloc(size) -#define TRYFREE(p) {if (p) free(p);} - -static int const gz_magic[2] = {0x1f, 0x8b}; /* gzip magic header */ - -/* gzip flag byte */ -#define ASCII_FLAG 0x01 /* bit 0 set: file probably ascii text */ -#define HEAD_CRC 0x02 /* bit 1 set: header CRC present */ -#define EXTRA_FIELD 0x04 /* bit 2 set: extra field present */ -#define ORIG_NAME 0x08 /* bit 3 set: original file name present */ -#define COMMENT 0x10 /* bit 4 set: file comment present */ -#define RESERVED 0xE0 /* bits 5..7: reserved */ - -typedef struct gz_stream { - z_stream stream; - int z_err; /* error code for last stream operation */ - int z_eof; /* set if end of input file */ - FILE *file; /* .gz file */ - Byte *inbuf; /* input buffer */ - Byte *outbuf; /* output buffer */ - uLong crc; /* crc32 of uncompressed data */ - char *msg; /* error message */ - char *path; /* path name for debugging only */ - int transparent; /* 1 if input file is not a .gz file */ - char mode; /* 'w' or 'r' */ - z_off_t start; /* start of compressed data in file (header skipped) */ - z_off_t in; /* bytes into deflate or inflate */ - z_off_t out; /* bytes out of deflate or inflate */ - int back; /* one character push-back */ - int last; /* true if push-back is last character */ -} gz_stream; - - -local gzFile gz_open OF((const char *path, const char *mode, int fd)); -local int do_flush OF((gzFile file, int flush)); -local int get_byte OF((gz_stream *s)); -local void check_header OF((gz_stream *s)); -local int destroy OF((gz_stream *s)); -local void putLong OF((FILE *file, uLong x)); -local uLong getLong OF((gz_stream *s)); - -/* =========================================================================== - Opens a gzip (.gz) file for reading or writing. The mode parameter - is as in fopen ("rb" or "wb"). The file is given either by file descriptor - or path name (if fd == -1). - gz_open returns NULL if the file could not be opened or if there was - insufficient memory to allocate the (de)compression state; errno - can be checked to distinguish the two cases (if errno is zero, the - zlib error is Z_MEM_ERROR). -*/ -local gzFile gz_open (path, mode, fd) - const char *path; - const char *mode; - int fd; -{ - int err; - int level = Z_DEFAULT_COMPRESSION; /* compression level */ - int strategy = Z_DEFAULT_STRATEGY; /* compression strategy */ - char *p = (char*)mode; - gz_stream *s; - char fmode[80]; /* copy of mode, without the compression level */ - char *m = fmode; - - if (!path || !mode) return Z_NULL; - - s = (gz_stream *)ALLOC(sizeof(gz_stream)); - if (!s) return Z_NULL; - - s->stream.zalloc = (alloc_func)0; - s->stream.zfree = (free_func)0; - s->stream.opaque = (voidpf)0; - s->stream.next_in = s->inbuf = Z_NULL; - s->stream.next_out = s->outbuf = Z_NULL; - s->stream.avail_in = s->stream.avail_out = 0; - s->file = NULL; - s->z_err = Z_OK; - s->z_eof = 0; - s->in = 0; - s->out = 0; - s->back = EOF; - s->crc = crc32(0L, Z_NULL, 0); - s->msg = NULL; - s->transparent = 0; - - s->path = (char*)ALLOC(strlen(path)+1); - if (s->path == NULL) { - return destroy(s), (gzFile)Z_NULL; - } - strcpy(s->path, path); /* do this early for debugging */ - - s->mode = '\0'; - do { - if (*p == 'r') s->mode = 'r'; - if (*p == 'w' || *p == 'a') s->mode = 'w'; - if (*p >= '0' && *p <= '9') { - level = *p - '0'; - } else if (*p == 'f') { - strategy = Z_FILTERED; - } else if (*p == 'h') { - strategy = Z_HUFFMAN_ONLY; - } else if (*p == 'R') { - strategy = Z_RLE; - } else { - *m++ = *p; /* copy the mode */ - } - } while (*p++ && m != fmode + sizeof(fmode)); - if (s->mode == '\0') return destroy(s), (gzFile)Z_NULL; - - if (s->mode == 'w') { -#ifdef NO_GZCOMPRESS - err = Z_STREAM_ERROR; -#else - err = deflateInit2(&(s->stream), level, - Z_DEFLATED, -MAX_WBITS, DEF_MEM_LEVEL, strategy); - /* windowBits is passed < 0 to suppress zlib header */ - - s->stream.next_out = s->outbuf = (Byte*)ALLOC(Z_BUFSIZE); -#endif - if (err != Z_OK || s->outbuf == Z_NULL) { - return destroy(s), (gzFile)Z_NULL; - } - } else { - s->stream.next_in = s->inbuf = (Byte*)ALLOC(Z_BUFSIZE); - - err = inflateInit2(&(s->stream), -MAX_WBITS); - /* windowBits is passed < 0 to tell that there is no zlib header. - * Note that in this case inflate *requires* an extra "dummy" byte - * after the compressed stream in order to complete decompression and - * return Z_STREAM_END. Here the gzip CRC32 ensures that 4 bytes are - * present after the compressed stream. - */ - if (err != Z_OK || s->inbuf == Z_NULL) { - return destroy(s), (gzFile)Z_NULL; - } - } - s->stream.avail_out = Z_BUFSIZE; - - errno = 0; - s->file = fd < 0 ? F_OPEN(path, fmode) : (FILE*)fdopen(fd, fmode); - - if (s->file == NULL) { - return destroy(s), (gzFile)Z_NULL; - } - if (s->mode == 'w') { - /* Write a very simple .gz header: - */ - fprintf(s->file, "%c%c%c%c%c%c%c%c%c%c", gz_magic[0], gz_magic[1], - Z_DEFLATED, 0 /*flags*/, 0,0,0,0 /*time*/, 0 /*xflags*/, OS_CODE); - s->start = 10L; - /* We use 10L instead of ftell(s->file) to because ftell causes an - * fflush on some systems. This version of the library doesn't use - * start anyway in write mode, so this initialization is not - * necessary. - */ - } else { - check_header(s); /* skip the .gz header */ - s->start = ftell(s->file) - s->stream.avail_in; - } - - return (gzFile)s; -} - -/* =========================================================================== - Opens a gzip (.gz) file for reading or writing. -*/ -gzFile ZEXPORT gzopen (path, mode) - const char *path; - const char *mode; -{ - return gz_open (path, mode, -1); -} - -/* =========================================================================== - Associate a gzFile with the file descriptor fd. fd is not dup'ed here - to mimic the behavio(u)r of fdopen. -*/ -gzFile ZEXPORT gzdopen (fd, mode) - int fd; - const char *mode; -{ - char name[46]; /* allow for up to 128-bit integers */ - - if (fd < 0) return (gzFile)Z_NULL; - sprintf(name, "", fd); /* for debugging */ - - return gz_open (name, mode, fd); -} - -/* =========================================================================== - * Update the compression level and strategy - */ -int ZEXPORT gzsetparams (file, level, strategy) - gzFile file; - int level; - int strategy; -{ - gz_stream *s = (gz_stream*)file; - - if (s == NULL || s->mode != 'w') return Z_STREAM_ERROR; - - /* Make room to allow flushing */ - if (s->stream.avail_out == 0) { - - s->stream.next_out = s->outbuf; - if (fwrite(s->outbuf, 1, Z_BUFSIZE, s->file) != Z_BUFSIZE) { - s->z_err = Z_ERRNO; - } - s->stream.avail_out = Z_BUFSIZE; - } - - return deflateParams (&(s->stream), level, strategy); -} - -/* =========================================================================== - Read a byte from a gz_stream; update next_in and avail_in. Return EOF - for end of file. - IN assertion: the stream s has been sucessfully opened for reading. -*/ -local int get_byte(s) - gz_stream *s; -{ - if (s->z_eof) return EOF; - if (s->stream.avail_in == 0) { - errno = 0; - s->stream.avail_in = (uInt)fread(s->inbuf, 1, Z_BUFSIZE, s->file); - if (s->stream.avail_in == 0) { - s->z_eof = 1; - if (ferror(s->file)) s->z_err = Z_ERRNO; - return EOF; - } - s->stream.next_in = s->inbuf; - } - s->stream.avail_in--; - return *(s->stream.next_in)++; -} - -/* =========================================================================== - Check the gzip header of a gz_stream opened for reading. Set the stream - mode to transparent if the gzip magic header is not present; set s->err - to Z_DATA_ERROR if the magic header is present but the rest of the header - is incorrect. - IN assertion: the stream s has already been created sucessfully; - s->stream.avail_in is zero for the first time, but may be non-zero - for concatenated .gz files. -*/ -local void check_header(s) - gz_stream *s; -{ - int method; /* method byte */ - int flags; /* flags byte */ - uInt len; - int c; - - /* Assure two bytes in the buffer so we can peek ahead -- handle case - where first byte of header is at the end of the buffer after the last - gzip segment */ - len = s->stream.avail_in; - if (len < 2) { - if (len) s->inbuf[0] = s->stream.next_in[0]; - errno = 0; - len = (uInt)fread(s->inbuf + len, 1, Z_BUFSIZE >> len, s->file); - if (len == 0 && ferror(s->file)) s->z_err = Z_ERRNO; - s->stream.avail_in += len; - s->stream.next_in = s->inbuf; - if (s->stream.avail_in < 2) { - s->transparent = s->stream.avail_in; - return; - } - } - - /* Peek ahead to check the gzip magic header */ - if (s->stream.next_in[0] != gz_magic[0] || - s->stream.next_in[1] != gz_magic[1]) { - s->transparent = 1; - return; - } - s->stream.avail_in -= 2; - s->stream.next_in += 2; - - /* Check the rest of the gzip header */ - method = get_byte(s); - flags = get_byte(s); - if (method != Z_DEFLATED || (flags & RESERVED) != 0) { - s->z_err = Z_DATA_ERROR; - return; - } - - /* Discard time, xflags and OS code: */ - for (len = 0; len < 6; len++) (void)get_byte(s); - - if ((flags & EXTRA_FIELD) != 0) { /* skip the extra field */ - len = (uInt)get_byte(s); - len += ((uInt)get_byte(s))<<8; - /* len is garbage if EOF but the loop below will quit anyway */ - while (len-- != 0 && get_byte(s) != EOF) ; - } - if ((flags & ORIG_NAME) != 0) { /* skip the original file name */ - while ((c = get_byte(s)) != 0 && c != EOF) ; - } - if ((flags & COMMENT) != 0) { /* skip the .gz file comment */ - while ((c = get_byte(s)) != 0 && c != EOF) ; - } - if ((flags & HEAD_CRC) != 0) { /* skip the header crc */ - for (len = 0; len < 2; len++) (void)get_byte(s); - } - s->z_err = s->z_eof ? Z_DATA_ERROR : Z_OK; -} - - /* =========================================================================== - * Cleanup then free the given gz_stream. Return a zlib error code. - Try freeing in the reverse order of allocations. - */ -local int destroy (s) - gz_stream *s; -{ - int err = Z_OK; - - if (!s) return Z_STREAM_ERROR; - - TRYFREE(s->msg); - - if (s->stream.state != NULL) { - if (s->mode == 'w') { -#ifdef NO_GZCOMPRESS - err = Z_STREAM_ERROR; -#else - err = deflateEnd(&(s->stream)); -#endif - } else if (s->mode == 'r') { - err = inflateEnd(&(s->stream)); - } - } - if (s->file != NULL && fclose(s->file)) { -#ifdef ESPIPE - if (errno != ESPIPE) /* fclose is broken for pipes in HP/UX */ -#endif - err = Z_ERRNO; - } - if (s->z_err < 0) err = s->z_err; - - TRYFREE(s->inbuf); - TRYFREE(s->outbuf); - TRYFREE(s->path); - TRYFREE(s); - return err; -} - -/* =========================================================================== - Reads the given number of uncompressed bytes from the compressed file. - gzread returns the number of bytes actually read (0 for end of file). -*/ -int ZEXPORT gzread (file, buf, len) - gzFile file; - voidp buf; - unsigned len; -{ - gz_stream *s = (gz_stream*)file; - Bytef *start = (Bytef*)buf; /* starting point for crc computation */ - Byte *next_out; /* == stream.next_out but not forced far (for MSDOS) */ - - if (s == NULL || s->mode != 'r') return Z_STREAM_ERROR; - - if (s->z_err == Z_DATA_ERROR || s->z_err == Z_ERRNO) return -1; - if (s->z_err == Z_STREAM_END) return 0; /* EOF */ - - next_out = (Byte*)buf; - s->stream.next_out = (Bytef*)buf; - s->stream.avail_out = len; - - if (s->stream.avail_out && s->back != EOF) { - *next_out++ = s->back; - s->stream.next_out++; - s->stream.avail_out--; - s->back = EOF; - s->out++; - start++; - if (s->last) { - s->z_err = Z_STREAM_END; - return 1; - } - } - - while (s->stream.avail_out != 0) { - - if (s->transparent) { - /* Copy first the lookahead bytes: */ - uInt n = s->stream.avail_in; - if (n > s->stream.avail_out) n = s->stream.avail_out; - if (n > 0) { - zmemcpy(s->stream.next_out, s->stream.next_in, n); - next_out += n; - s->stream.next_out = next_out; - s->stream.next_in += n; - s->stream.avail_out -= n; - s->stream.avail_in -= n; - } - if (s->stream.avail_out > 0) { - s->stream.avail_out -= - (uInt)fread(next_out, 1, s->stream.avail_out, s->file); - } - len -= s->stream.avail_out; - s->in += len; - s->out += len; - if (len == 0) s->z_eof = 1; - return (int)len; - } - if (s->stream.avail_in == 0 && !s->z_eof) { - - errno = 0; - s->stream.avail_in = (uInt)fread(s->inbuf, 1, Z_BUFSIZE, s->file); - if (s->stream.avail_in == 0) { - s->z_eof = 1; - if (ferror(s->file)) { - s->z_err = Z_ERRNO; - break; - } - } - s->stream.next_in = s->inbuf; - } - s->in += s->stream.avail_in; - s->out += s->stream.avail_out; - s->z_err = inflate(&(s->stream), Z_NO_FLUSH); - s->in -= s->stream.avail_in; - s->out -= s->stream.avail_out; - - if (s->z_err == Z_STREAM_END) { - /* Check CRC and original size */ - s->crc = crc32(s->crc, start, (uInt)(s->stream.next_out - start)); - start = s->stream.next_out; - - if (getLong(s) != s->crc) { - s->z_err = Z_DATA_ERROR; - } else { - (void)getLong(s); - /* The uncompressed length returned by above getlong() may be - * different from s->out in case of concatenated .gz files. - * Check for such files: - */ - check_header(s); - if (s->z_err == Z_OK) { - inflateReset(&(s->stream)); - s->crc = crc32(0L, Z_NULL, 0); - } - } - } - if (s->z_err != Z_OK || s->z_eof) break; - } - s->crc = crc32(s->crc, start, (uInt)(s->stream.next_out - start)); - - if (len == s->stream.avail_out && - (s->z_err == Z_DATA_ERROR || s->z_err == Z_ERRNO)) - return -1; - return (int)(len - s->stream.avail_out); -} - - -/* =========================================================================== - Reads one byte from the compressed file. gzgetc returns this byte - or -1 in case of end of file or error. -*/ -int ZEXPORT gzgetc(file) - gzFile file; -{ - unsigned char c; - - return gzread(file, &c, 1) == 1 ? c : -1; -} - - -/* =========================================================================== - Push one byte back onto the stream. -*/ -int ZEXPORT gzungetc(c, file) - int c; - gzFile file; -{ - gz_stream *s = (gz_stream*)file; - - if (s == NULL || s->mode != 'r' || c == EOF || s->back != EOF) return EOF; - s->back = c; - s->out--; - s->last = (s->z_err == Z_STREAM_END); - if (s->last) s->z_err = Z_OK; - s->z_eof = 0; - return c; -} - - -/* =========================================================================== - Reads bytes from the compressed file until len-1 characters are - read, or a newline character is read and transferred to buf, or an - end-of-file condition is encountered. The string is then terminated - with a null character. - gzgets returns buf, or Z_NULL in case of error. - - The current implementation is not optimized at all. -*/ -char * ZEXPORT gzgets(file, buf, len) - gzFile file; - char *buf; - int len; -{ - char *b = buf; - if (buf == Z_NULL || len <= 0) return Z_NULL; - - while (--len > 0 && gzread(file, buf, 1) == 1 && *buf++ != '\n') ; - *buf = '\0'; - return b == buf && len > 0 ? Z_NULL : b; -} - - -#ifndef NO_GZCOMPRESS -/* =========================================================================== - Writes the given number of uncompressed bytes into the compressed file. - gzwrite returns the number of bytes actually written (0 in case of error). -*/ -int ZEXPORT gzwrite (file, buf, len) - gzFile file; - voidpc buf; - unsigned len; -{ - gz_stream *s = (gz_stream*)file; - - if (s == NULL || s->mode != 'w') return Z_STREAM_ERROR; - - s->stream.next_in = (Bytef*)buf; - s->stream.avail_in = len; - - while (s->stream.avail_in != 0) { - - if (s->stream.avail_out == 0) { - - s->stream.next_out = s->outbuf; - if (fwrite(s->outbuf, 1, Z_BUFSIZE, s->file) != Z_BUFSIZE) { - s->z_err = Z_ERRNO; - break; - } - s->stream.avail_out = Z_BUFSIZE; - } - s->in += s->stream.avail_in; - s->out += s->stream.avail_out; - s->z_err = deflate(&(s->stream), Z_NO_FLUSH); - s->in -= s->stream.avail_in; - s->out -= s->stream.avail_out; - if (s->z_err != Z_OK) break; - } - s->crc = crc32(s->crc, (const Bytef *)buf, len); - - return (int)(len - s->stream.avail_in); -} - - -/* =========================================================================== - Converts, formats, and writes the args to the compressed file under - control of the format string, as in fprintf. gzprintf returns the number of - uncompressed bytes actually written (0 in case of error). -*/ -#ifdef STDC -#include - -int ZEXPORTVA gzprintf (gzFile file, const char *format, /* args */ ...) -{ - char buf[Z_PRINTF_BUFSIZE]; - va_list va; - int len; - - buf[sizeof(buf) - 1] = 0; - va_start(va, format); -#ifdef NO_vsnprintf -# ifdef HAS_vsprintf_void - (void)vsprintf(buf, format, va); - va_end(va); - for (len = 0; len < sizeof(buf); len++) - if (buf[len] == 0) break; -# else - len = vsprintf(buf, format, va); - va_end(va); -# endif -#else -# ifdef HAS_vsnprintf_void - (void)vsnprintf(buf, sizeof(buf), format, va); - va_end(va); - len = strlen(buf); -# else - len = vsnprintf(buf, sizeof(buf), format, va); - va_end(va); -# endif -#endif - if (len <= 0 || len >= (int)sizeof(buf) || buf[sizeof(buf) - 1] != 0) - return 0; - return gzwrite(file, buf, (unsigned)len); -} -#else /* not ANSI C */ - -int ZEXPORTVA gzprintf (file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, - a11, a12, a13, a14, a15, a16, a17, a18, a19, a20) - gzFile file; - const char *format; - int a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, - a11, a12, a13, a14, a15, a16, a17, a18, a19, a20; -{ - char buf[Z_PRINTF_BUFSIZE]; - int len; - - buf[sizeof(buf) - 1] = 0; -#ifdef NO_snprintf -# ifdef HAS_sprintf_void - sprintf(buf, format, a1, a2, a3, a4, a5, a6, a7, a8, - a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20); - for (len = 0; len < sizeof(buf); len++) - if (buf[len] == 0) break; -# else - len = sprintf(buf, format, a1, a2, a3, a4, a5, a6, a7, a8, - a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20); -# endif -#else -# ifdef HAS_snprintf_void - snprintf(buf, sizeof(buf), format, a1, a2, a3, a4, a5, a6, a7, a8, - a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20); - len = strlen(buf); -# else - len = snprintf(buf, sizeof(buf), format, a1, a2, a3, a4, a5, a6, a7, a8, - a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20); -# endif -#endif - if (len <= 0 || len >= sizeof(buf) || buf[sizeof(buf) - 1] != 0) - return 0; - return gzwrite(file, buf, len); -} -#endif - -/* =========================================================================== - Writes c, converted to an unsigned char, into the compressed file. - gzputc returns the value that was written, or -1 in case of error. -*/ -int ZEXPORT gzputc(file, c) - gzFile file; - int c; -{ - unsigned char cc = (unsigned char) c; /* required for big endian systems */ - - return gzwrite(file, &cc, 1) == 1 ? (int)cc : -1; -} - - -/* =========================================================================== - Writes the given null-terminated string to the compressed file, excluding - the terminating null character. - gzputs returns the number of characters written, or -1 in case of error. -*/ -int ZEXPORT gzputs(file, s) - gzFile file; - const char *s; -{ - return gzwrite(file, (char*)s, (unsigned)strlen(s)); -} - - -/* =========================================================================== - Flushes all pending output into the compressed file. The parameter - flush is as in the deflate() function. -*/ -local int do_flush (file, flush) - gzFile file; - int flush; -{ - uInt len; - int done = 0; - gz_stream *s = (gz_stream*)file; - - if (s == NULL || s->mode != 'w') return Z_STREAM_ERROR; - - s->stream.avail_in = 0; /* should be zero already anyway */ - - for (;;) { - len = Z_BUFSIZE - s->stream.avail_out; - - if (len != 0) { - if ((uInt)fwrite(s->outbuf, 1, len, s->file) != len) { - s->z_err = Z_ERRNO; - return Z_ERRNO; - } - s->stream.next_out = s->outbuf; - s->stream.avail_out = Z_BUFSIZE; - } - if (done) break; - s->out += s->stream.avail_out; - s->z_err = deflate(&(s->stream), flush); - s->out -= s->stream.avail_out; - - /* Ignore the second of two consecutive flushes: */ - if (len == 0 && s->z_err == Z_BUF_ERROR) s->z_err = Z_OK; - - /* deflate has finished flushing only when it hasn't used up - * all the available space in the output buffer: - */ - done = (s->stream.avail_out != 0 || s->z_err == Z_STREAM_END); - - if (s->z_err != Z_OK && s->z_err != Z_STREAM_END) break; - } - return s->z_err == Z_STREAM_END ? Z_OK : s->z_err; -} - -int ZEXPORT gzflush (file, flush) - gzFile file; - int flush; -{ - gz_stream *s = (gz_stream*)file; - int err = do_flush (file, flush); - - if (err) return err; - fflush(s->file); - return s->z_err == Z_STREAM_END ? Z_OK : s->z_err; -} -#endif /* NO_GZCOMPRESS */ - -/* =========================================================================== - Sets the starting position for the next gzread or gzwrite on the given - compressed file. The offset represents a number of bytes in the - gzseek returns the resulting offset location as measured in bytes from - the beginning of the uncompressed stream, or -1 in case of error. - SEEK_END is not implemented, returns error. - In this version of the library, gzseek can be extremely slow. -*/ -z_off_t ZEXPORT gzseek (file, offset, whence) - gzFile file; - z_off_t offset; - int whence; -{ - gz_stream *s = (gz_stream*)file; - - if (s == NULL || whence == SEEK_END || - s->z_err == Z_ERRNO || s->z_err == Z_DATA_ERROR) { - return -1L; - } - - if (s->mode == 'w') { -#ifdef NO_GZCOMPRESS - return -1L; -#else - if (whence == SEEK_SET) { - offset -= s->in; - } - if (offset < 0) return -1L; - - /* At this point, offset is the number of zero bytes to write. */ - if (s->inbuf == Z_NULL) { - s->inbuf = (Byte*)ALLOC(Z_BUFSIZE); /* for seeking */ - if (s->inbuf == Z_NULL) return -1L; - zmemzero(s->inbuf, Z_BUFSIZE); - } - while (offset > 0) { - uInt size = Z_BUFSIZE; - if (offset < Z_BUFSIZE) size = (uInt)offset; - - size = gzwrite(file, s->inbuf, size); - if (size == 0) return -1L; - - offset -= size; - } - return s->in; -#endif - } - /* Rest of function is for reading only */ - - /* compute absolute position */ - if (whence == SEEK_CUR) { - offset += s->out; - } - if (offset < 0) return -1L; - - if (s->transparent) { - /* map to fseek */ - s->back = EOF; - s->stream.avail_in = 0; - s->stream.next_in = s->inbuf; - if (fseek(s->file, offset, SEEK_SET) < 0) return -1L; - - s->in = s->out = offset; - return offset; - } - - /* For a negative seek, rewind and use positive seek */ - if (offset >= s->out) { - offset -= s->out; - } else if (gzrewind(file) < 0) { - return -1L; - } - /* offset is now the number of bytes to skip. */ - - if (offset != 0 && s->outbuf == Z_NULL) { - s->outbuf = (Byte*)ALLOC(Z_BUFSIZE); - if (s->outbuf == Z_NULL) return -1L; - } - if (offset && s->back != EOF) { - s->back = EOF; - s->out++; - offset--; - if (s->last) s->z_err = Z_STREAM_END; - } - while (offset > 0) { - int size = Z_BUFSIZE; - if (offset < Z_BUFSIZE) size = (int)offset; - - size = gzread(file, s->outbuf, (uInt)size); - if (size <= 0) return -1L; - offset -= size; - } - return s->out; -} - -/* =========================================================================== - Rewinds input file. -*/ -int ZEXPORT gzrewind (file) - gzFile file; -{ - gz_stream *s = (gz_stream*)file; - - if (s == NULL || s->mode != 'r') return -1; - - s->z_err = Z_OK; - s->z_eof = 0; - s->back = EOF; - s->stream.avail_in = 0; - s->stream.next_in = s->inbuf; - s->crc = crc32(0L, Z_NULL, 0); - if (!s->transparent) (void)inflateReset(&s->stream); - s->in = 0; - s->out = 0; - return fseek(s->file, s->start, SEEK_SET); -} - -/* =========================================================================== - Returns the starting position for the next gzread or gzwrite on the - given compressed file. This position represents a number of bytes in the - uncompressed data stream. -*/ -z_off_t ZEXPORT gztell (file) - gzFile file; -{ - return gzseek(file, 0L, SEEK_CUR); -} - -/* =========================================================================== - Returns 1 when EOF has previously been detected reading the given - input stream, otherwise zero. -*/ -int ZEXPORT gzeof (file) - gzFile file; -{ - gz_stream *s = (gz_stream*)file; - - /* With concatenated compressed files that can have embedded - * crc trailers, z_eof is no longer the only/best indicator of EOF - * on a gz_stream. Handle end-of-stream error explicitly here. - */ - if (s == NULL || s->mode != 'r') return 0; - if (s->z_eof) return 1; - return s->z_err == Z_STREAM_END; -} - -/* =========================================================================== - Returns 1 if reading and doing so transparently, otherwise zero. -*/ -int ZEXPORT gzdirect (file) - gzFile file; -{ - gz_stream *s = (gz_stream*)file; - - if (s == NULL || s->mode != 'r') return 0; - return s->transparent; -} - -/* =========================================================================== - Outputs a long in LSB order to the given file -*/ -local void putLong (file, x) - FILE *file; - uLong x; -{ - int n; - for (n = 0; n < 4; n++) { - fputc((int)(x & 0xff), file); - x >>= 8; - } -} - -/* =========================================================================== - Reads a long in LSB order from the given gz_stream. Sets z_err in case - of error. -*/ -local uLong getLong (s) - gz_stream *s; -{ - uLong x = (uLong)get_byte(s); - int c; - - x += ((uLong)get_byte(s))<<8; - x += ((uLong)get_byte(s))<<16; - c = get_byte(s); - if (c == EOF) s->z_err = Z_DATA_ERROR; - x += ((uLong)c)<<24; - return x; -} - -/* =========================================================================== - Flushes all pending output if necessary, closes the compressed file - and deallocates all the (de)compression state. -*/ -int ZEXPORT gzclose (file) - gzFile file; -{ - gz_stream *s = (gz_stream*)file; - - if (s == NULL) return Z_STREAM_ERROR; - - if (s->mode == 'w') { -#ifdef NO_GZCOMPRESS - return Z_STREAM_ERROR; -#else - if (do_flush (file, Z_FINISH) != Z_OK) - return destroy((gz_stream*)file); - - putLong (s->file, s->crc); - putLong (s->file, (uLong)(s->in & 0xffffffff)); -#endif - } - return destroy((gz_stream*)file); -} - -#ifdef STDC -# define zstrerror(errnum) strerror(errnum) -#else -# define zstrerror(errnum) "" -#endif - -/* =========================================================================== - Returns the error message for the last error which occurred on the - given compressed file. errnum is set to zlib error number. If an - error occurred in the file system and not in the compression library, - errnum is set to Z_ERRNO and the application may consult errno - to get the exact error code. -*/ -const char * ZEXPORT gzerror (file, errnum) - gzFile file; - int *errnum; -{ - char *m; - gz_stream *s = (gz_stream*)file; - - if (s == NULL) { - *errnum = Z_STREAM_ERROR; - return (const char*)ERR_MSG(Z_STREAM_ERROR); - } - *errnum = s->z_err; - if (*errnum == Z_OK) return (const char*)""; - - m = (char*)(*errnum == Z_ERRNO ? zstrerror(errno) : s->stream.msg); - - if (m == NULL || *m == '\0') m = (char*)ERR_MSG(s->z_err); - - TRYFREE(s->msg); - s->msg = (char*)ALLOC(strlen(s->path) + strlen(m) + 3); - if (s->msg == Z_NULL) return (const char*)ERR_MSG(Z_MEM_ERROR); - strcpy(s->msg, s->path); - strcat(s->msg, ": "); - strcat(s->msg, m); - return (const char*)s->msg; -} - -/* =========================================================================== - Clear the error and end-of-file flags, and do the same for the real file. -*/ -void ZEXPORT gzclearerr (file) - gzFile file; -{ - gz_stream *s = (gz_stream*)file; - - if (s == NULL) return; - if (s->z_err != Z_STREAM_END) s->z_err = Z_OK; - s->z_eof = 0; - clearerr(s->file); -} diff --git a/src/zlib/infback.c b/src/zlib/infback.c deleted file mode 100644 index 1e03e1bab..000000000 --- a/src/zlib/infback.c +++ /dev/null @@ -1,623 +0,0 @@ -/* infback.c -- inflate using a call-back interface - * Copyright (C) 1995-2005 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* - This code is largely copied from inflate.c. Normally either infback.o or - inflate.o would be linked into an application--not both. The interface - with inffast.c is retained so that optimized assembler-coded versions of - inflate_fast() can be used with either inflate.c or infback.c. - */ - -#include "zutil.h" -#include "inftrees.h" -#include "inflate.h" -#include "inffast.h" - -/* function prototypes */ -local void fixedtables OF((struct inflate_state FAR *state)); - -/* - strm provides memory allocation functions in zalloc and zfree, or - Z_NULL to use the library memory allocation functions. - - windowBits is in the range 8..15, and window is a user-supplied - window and output buffer that is 2**windowBits bytes. - */ -int ZEXPORT inflateBackInit_(strm, windowBits, window, version, stream_size) -z_streamp strm; -int windowBits; -unsigned char FAR *window; -const char *version; -int stream_size; -{ - struct inflate_state FAR *state; - - if (version == Z_NULL || version[0] != ZLIB_VERSION[0] || - stream_size != (int)(sizeof(z_stream))) - return Z_VERSION_ERROR; - if (strm == Z_NULL || window == Z_NULL || - windowBits < 8 || windowBits > 15) - return Z_STREAM_ERROR; - strm->msg = Z_NULL; /* in case we return an error */ - if (strm->zalloc == (alloc_func)0) { - strm->zalloc = zcalloc; - strm->opaque = (voidpf)0; - } - if (strm->zfree == (free_func)0) strm->zfree = zcfree; - state = (struct inflate_state FAR *)ZALLOC(strm, 1, - sizeof(struct inflate_state)); - if (state == Z_NULL) return Z_MEM_ERROR; - Tracev((stderr, "inflate: allocated\n")); - strm->state = (struct internal_state FAR *)state; - state->dmax = 32768U; - state->wbits = windowBits; - state->wsize = 1U << windowBits; - state->window = window; - state->write = 0; - state->whave = 0; - return Z_OK; -} - -/* - Return state with length and distance decoding tables and index sizes set to - fixed code decoding. Normally this returns fixed tables from inffixed.h. - If BUILDFIXED is defined, then instead this routine builds the tables the - first time it's called, and returns those tables the first time and - thereafter. This reduces the size of the code by about 2K bytes, in - exchange for a little execution time. However, BUILDFIXED should not be - used for threaded applications, since the rewriting of the tables and virgin - may not be thread-safe. - */ -local void fixedtables(state) -struct inflate_state FAR *state; -{ -#ifdef BUILDFIXED - static int virgin = 1; - static code *lenfix, *distfix; - static code fixed[544]; - - /* build fixed huffman tables if first call (may not be thread safe) */ - if (virgin) { - unsigned sym, bits; - static code *next; - - /* literal/length table */ - sym = 0; - while (sym < 144) state->lens[sym++] = 8; - while (sym < 256) state->lens[sym++] = 9; - while (sym < 280) state->lens[sym++] = 7; - while (sym < 288) state->lens[sym++] = 8; - next = fixed; - lenfix = next; - bits = 9; - inflate_table(LENS, state->lens, 288, &(next), &(bits), state->work); - - /* distance table */ - sym = 0; - while (sym < 32) state->lens[sym++] = 5; - distfix = next; - bits = 5; - inflate_table(DISTS, state->lens, 32, &(next), &(bits), state->work); - - /* do this just once */ - virgin = 0; - } -#else /* !BUILDFIXED */ -# include "inffixed.h" -#endif /* BUILDFIXED */ - state->lencode = lenfix; - state->lenbits = 9; - state->distcode = distfix; - state->distbits = 5; -} - -/* Macros for inflateBack(): */ - -/* Load returned state from inflate_fast() */ -#define LOAD() \ - do { \ - put = strm->next_out; \ - left = strm->avail_out; \ - next = strm->next_in; \ - have = strm->avail_in; \ - hold = state->hold; \ - bits = state->bits; \ - } while (0) - -/* Set state from registers for inflate_fast() */ -#define RESTORE() \ - do { \ - strm->next_out = put; \ - strm->avail_out = left; \ - strm->next_in = next; \ - strm->avail_in = have; \ - state->hold = hold; \ - state->bits = bits; \ - } while (0) - -/* Clear the input bit accumulator */ -#define INITBITS() \ - do { \ - hold = 0; \ - bits = 0; \ - } while (0) - -/* Assure that some input is available. If input is requested, but denied, - then return a Z_BUF_ERROR from inflateBack(). */ -#define PULL() \ - do { \ - if (have == 0) { \ - have = in(in_desc, &next); \ - if (have == 0) { \ - next = Z_NULL; \ - ret = Z_BUF_ERROR; \ - goto inf_leave; \ - } \ - } \ - } while (0) - -/* Get a byte of input into the bit accumulator, or return from inflateBack() - with an error if there is no input available. */ -#define PULLBYTE() \ - do { \ - PULL(); \ - have--; \ - hold += (unsigned long)(*next++) << bits; \ - bits += 8; \ - } while (0) - -/* Assure that there are at least n bits in the bit accumulator. If there is - not enough available input to do that, then return from inflateBack() with - an error. */ -#define NEEDBITS(n) \ - do { \ - while (bits < (unsigned)(n)) \ - PULLBYTE(); \ - } while (0) - -/* Return the low n bits of the bit accumulator (n < 16) */ -#define BITS(n) \ - ((unsigned)hold & ((1U << (n)) - 1)) - -/* Remove n bits from the bit accumulator */ -#define DROPBITS(n) \ - do { \ - hold >>= (n); \ - bits -= (unsigned)(n); \ - } while (0) - -/* Remove zero to seven bits as needed to go to a byte boundary */ -#define BYTEBITS() \ - do { \ - hold >>= bits & 7; \ - bits -= bits & 7; \ - } while (0) - -/* Assure that some output space is available, by writing out the window - if it's full. If the write fails, return from inflateBack() with a - Z_BUF_ERROR. */ -#define ROOM() \ - do { \ - if (left == 0) { \ - put = state->window; \ - left = state->wsize; \ - state->whave = left; \ - if (out(out_desc, put, left)) { \ - ret = Z_BUF_ERROR; \ - goto inf_leave; \ - } \ - } \ - } while (0) - -/* - strm provides the memory allocation functions and window buffer on input, - and provides information on the unused input on return. For Z_DATA_ERROR - returns, strm will also provide an error message. - - in() and out() are the call-back input and output functions. When - inflateBack() needs more input, it calls in(). When inflateBack() has - filled the window with output, or when it completes with data in the - window, it calls out() to write out the data. The application must not - change the provided input until in() is called again or inflateBack() - returns. The application must not change the window/output buffer until - inflateBack() returns. - - in() and out() are called with a descriptor parameter provided in the - inflateBack() call. This parameter can be a structure that provides the - information required to do the read or write, as well as accumulated - information on the input and output such as totals and check values. - - in() should return zero on failure. out() should return non-zero on - failure. If either in() or out() fails, than inflateBack() returns a - Z_BUF_ERROR. strm->next_in can be checked for Z_NULL to see whether it - was in() or out() that caused in the error. Otherwise, inflateBack() - returns Z_STREAM_END on success, Z_DATA_ERROR for an deflate format - error, or Z_MEM_ERROR if it could not allocate memory for the state. - inflateBack() can also return Z_STREAM_ERROR if the input parameters - are not correct, i.e. strm is Z_NULL or the state was not initialized. - */ -int ZEXPORT inflateBack(strm, in, in_desc, out, out_desc) -z_streamp strm; -in_func in; -void FAR *in_desc; -out_func out; -void FAR *out_desc; -{ - struct inflate_state FAR *state; - unsigned char FAR *next; /* next input */ - unsigned char FAR *put; /* next output */ - unsigned have, left; /* available input and output */ - unsigned long hold; /* bit buffer */ - unsigned bits; /* bits in bit buffer */ - unsigned copy; /* number of stored or match bytes to copy */ - unsigned char FAR *from; /* where to copy match bytes from */ - code this; /* current decoding table entry */ - code last; /* parent table entry */ - unsigned len; /* length to copy for repeats, bits to drop */ - int ret; /* return code */ - static const unsigned short order[19] = /* permutation of code lengths */ - {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; - - /* Check that the strm exists and that the state was initialized */ - if (strm == Z_NULL || strm->state == Z_NULL) - return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; - - /* Reset the state */ - strm->msg = Z_NULL; - state->mode = TYPE; - state->last = 0; - state->whave = 0; - next = strm->next_in; - have = next != Z_NULL ? strm->avail_in : 0; - hold = 0; - bits = 0; - put = state->window; - left = state->wsize; - - /* Inflate until end of block marked as last */ - for (;;) - switch (state->mode) { - case TYPE: - /* determine and dispatch block type */ - if (state->last) { - BYTEBITS(); - state->mode = DONE; - break; - } - NEEDBITS(3); - state->last = BITS(1); - DROPBITS(1); - switch (BITS(2)) { - case 0: /* stored block */ - Tracev((stderr, "inflate: stored block%s\n", - state->last ? " (last)" : "")); - state->mode = STORED; - break; - case 1: /* fixed block */ - fixedtables(state); - Tracev((stderr, "inflate: fixed codes block%s\n", - state->last ? " (last)" : "")); - state->mode = LEN; /* decode codes */ - break; - case 2: /* dynamic block */ - Tracev((stderr, "inflate: dynamic codes block%s\n", - state->last ? " (last)" : "")); - state->mode = TABLE; - break; - case 3: - strm->msg = (char *)"invalid block type"; - state->mode = BAD; - } - DROPBITS(2); - break; - - case STORED: - /* get and verify stored block length */ - BYTEBITS(); /* go to byte boundary */ - NEEDBITS(32); - if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) { - strm->msg = (char *)"invalid stored block lengths"; - state->mode = BAD; - break; - } - state->length = (unsigned)hold & 0xffff; - Tracev((stderr, "inflate: stored length %u\n", - state->length)); - INITBITS(); - - /* copy stored block from input to output */ - while (state->length != 0) { - copy = state->length; - PULL(); - ROOM(); - if (copy > have) copy = have; - if (copy > left) copy = left; - zmemcpy(put, next, copy); - have -= copy; - next += copy; - left -= copy; - put += copy; - state->length -= copy; - } - Tracev((stderr, "inflate: stored end\n")); - state->mode = TYPE; - break; - - case TABLE: - /* get dynamic table entries descriptor */ - NEEDBITS(14); - state->nlen = BITS(5) + 257; - DROPBITS(5); - state->ndist = BITS(5) + 1; - DROPBITS(5); - state->ncode = BITS(4) + 4; - DROPBITS(4); -#ifndef PKZIP_BUG_WORKAROUND - if (state->nlen > 286 || state->ndist > 30) { - strm->msg = (char *)"too many length or distance symbols"; - state->mode = BAD; - break; - } -#endif - Tracev((stderr, "inflate: table sizes ok\n")); - - /* get code length code lengths (not a typo) */ - state->have = 0; - while (state->have < state->ncode) { - NEEDBITS(3); - state->lens[order[state->have++]] = (unsigned short)BITS(3); - DROPBITS(3); - } - while (state->have < 19) - state->lens[order[state->have++]] = 0; - state->next = state->codes; - state->lencode = (code const FAR *)(state->next); - state->lenbits = 7; - ret = inflate_table(CODES, state->lens, 19, &(state->next), - &(state->lenbits), state->work); - if (ret) { - strm->msg = (char *)"invalid code lengths set"; - state->mode = BAD; - break; - } - Tracev((stderr, "inflate: code lengths ok\n")); - - /* get length and distance code code lengths */ - state->have = 0; - while (state->have < state->nlen + state->ndist) { - for (;;) { - this = state->lencode[BITS(state->lenbits)]; - if ((unsigned)(this.bits) <= bits) break; - PULLBYTE(); - } - if (this.val < 16) { - NEEDBITS(this.bits); - DROPBITS(this.bits); - state->lens[state->have++] = this.val; - } - else { - if (this.val == 16) { - NEEDBITS(this.bits + 2); - DROPBITS(this.bits); - if (state->have == 0) { - strm->msg = (char *)"invalid bit length repeat"; - state->mode = BAD; - break; - } - len = (unsigned)(state->lens[state->have - 1]); - copy = 3 + BITS(2); - DROPBITS(2); - } - else if (this.val == 17) { - NEEDBITS(this.bits + 3); - DROPBITS(this.bits); - len = 0; - copy = 3 + BITS(3); - DROPBITS(3); - } - else { - NEEDBITS(this.bits + 7); - DROPBITS(this.bits); - len = 0; - copy = 11 + BITS(7); - DROPBITS(7); - } - if (state->have + copy > state->nlen + state->ndist) { - strm->msg = (char *)"invalid bit length repeat"; - state->mode = BAD; - break; - } - while (copy--) - state->lens[state->have++] = (unsigned short)len; - } - } - - /* handle error breaks in while */ - if (state->mode == BAD) break; - - /* build code tables */ - state->next = state->codes; - state->lencode = (code const FAR *)(state->next); - state->lenbits = 9; - ret = inflate_table(LENS, state->lens, state->nlen, &(state->next), - &(state->lenbits), state->work); - if (ret) { - strm->msg = (char *)"invalid literal/lengths set"; - state->mode = BAD; - break; - } - state->distcode = (code const FAR *)(state->next); - state->distbits = 6; - ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist, - &(state->next), &(state->distbits), state->work); - if (ret) { - strm->msg = (char *)"invalid distances set"; - state->mode = BAD; - break; - } - Tracev((stderr, "inflate: codes ok\n")); - state->mode = LEN; - - case LEN: - /* use inflate_fast() if we have enough input and output */ - if (have >= 6 && left >= 258) { - RESTORE(); - if (state->whave < state->wsize) - state->whave = state->wsize - left; - inflate_fast(strm, state->wsize); - LOAD(); - break; - } - - /* get a literal, length, or end-of-block code */ - for (;;) { - this = state->lencode[BITS(state->lenbits)]; - if ((unsigned)(this.bits) <= bits) break; - PULLBYTE(); - } - if (this.op && (this.op & 0xf0) == 0) { - last = this; - for (;;) { - this = state->lencode[last.val + - (BITS(last.bits + last.op) >> last.bits)]; - if ((unsigned)(last.bits + this.bits) <= bits) break; - PULLBYTE(); - } - DROPBITS(last.bits); - } - DROPBITS(this.bits); - state->length = (unsigned)this.val; - - /* process literal */ - if (this.op == 0) { - Tracevv((stderr, this.val >= 0x20 && this.val < 0x7f ? - "inflate: literal '%c'\n" : - "inflate: literal 0x%02x\n", this.val)); - ROOM(); - *put++ = (unsigned char)(state->length); - left--; - state->mode = LEN; - break; - } - - /* process end of block */ - if (this.op & 32) { - Tracevv((stderr, "inflate: end of block\n")); - state->mode = TYPE; - break; - } - - /* invalid code */ - if (this.op & 64) { - strm->msg = (char *)"invalid literal/length code"; - state->mode = BAD; - break; - } - - /* length code -- get extra bits, if any */ - state->extra = (unsigned)(this.op) & 15; - if (state->extra != 0) { - NEEDBITS(state->extra); - state->length += BITS(state->extra); - DROPBITS(state->extra); - } - Tracevv((stderr, "inflate: length %u\n", state->length)); - - /* get distance code */ - for (;;) { - this = state->distcode[BITS(state->distbits)]; - if ((unsigned)(this.bits) <= bits) break; - PULLBYTE(); - } - if ((this.op & 0xf0) == 0) { - last = this; - for (;;) { - this = state->distcode[last.val + - (BITS(last.bits + last.op) >> last.bits)]; - if ((unsigned)(last.bits + this.bits) <= bits) break; - PULLBYTE(); - } - DROPBITS(last.bits); - } - DROPBITS(this.bits); - if (this.op & 64) { - strm->msg = (char *)"invalid distance code"; - state->mode = BAD; - break; - } - state->offset = (unsigned)this.val; - - /* get distance extra bits, if any */ - state->extra = (unsigned)(this.op) & 15; - if (state->extra != 0) { - NEEDBITS(state->extra); - state->offset += BITS(state->extra); - DROPBITS(state->extra); - } - if (state->offset > state->wsize - (state->whave < state->wsize ? - left : 0)) { - strm->msg = (char *)"invalid distance too far back"; - state->mode = BAD; - break; - } - Tracevv((stderr, "inflate: distance %u\n", state->offset)); - - /* copy match from window to output */ - do { - ROOM(); - copy = state->wsize - state->offset; - if (copy < left) { - from = put + copy; - copy = left - copy; - } - else { - from = put - state->offset; - copy = left; - } - if (copy > state->length) copy = state->length; - state->length -= copy; - left -= copy; - do { - *put++ = *from++; - } while (--copy); - } while (state->length != 0); - break; - - case DONE: - /* inflate stream terminated properly -- write leftover output */ - ret = Z_STREAM_END; - if (left < state->wsize) { - if (out(out_desc, state->window, state->wsize - left)) - ret = Z_BUF_ERROR; - } - goto inf_leave; - - case BAD: - ret = Z_DATA_ERROR; - goto inf_leave; - - default: /* can't happen, but makes compilers happy */ - ret = Z_STREAM_ERROR; - goto inf_leave; - } - - /* Return unused input */ - inf_leave: - strm->next_in = next; - strm->avail_in = have; - return ret; -} - -int ZEXPORT inflateBackEnd(strm) -z_streamp strm; -{ - if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0) - return Z_STREAM_ERROR; - ZFREE(strm, strm->state); - strm->state = Z_NULL; - Tracev((stderr, "inflate: end\n")); - return Z_OK; -} diff --git a/src/zlib/inffast.c b/src/zlib/inffast.c deleted file mode 100644 index fa31cad90..000000000 --- a/src/zlib/inffast.c +++ /dev/null @@ -1,318 +0,0 @@ -/* inffast.c -- fast decoding - * Copyright (C) 1995-2004 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -#include "zutil.h" -#include "inftrees.h" -#include "inflate.h" -#include "inffast.h" - -#ifndef ASMINF - -/* Allow machine dependent optimization for post-increment or pre-increment. - Based on testing to date, - Pre-increment preferred for: - - PowerPC G3 (Adler) - - MIPS R5000 (Randers-Pehrson) - Post-increment preferred for: - - none - No measurable difference: - - Pentium III (Anderson) - - M68060 (Nikl) - */ -#ifdef POSTINC -# define OFF 0 -# define PUP(a) *(a)++ -#else -# define OFF 1 -# define PUP(a) *++(a) -#endif - -/* - Decode literal, length, and distance codes and write out the resulting - literal and match bytes until either not enough input or output is - available, an end-of-block is encountered, or a data error is encountered. - When large enough input and output buffers are supplied to inflate(), for - example, a 16K input buffer and a 64K output buffer, more than 95% of the - inflate execution time is spent in this routine. - - Entry assumptions: - - state->mode == LEN - strm->avail_in >= 6 - strm->avail_out >= 258 - start >= strm->avail_out - state->bits < 8 - - On return, state->mode is one of: - - LEN -- ran out of enough output space or enough available input - TYPE -- reached end of block code, inflate() to interpret next block - BAD -- error in block data - - Notes: - - - The maximum input bits used by a length/distance pair is 15 bits for the - length code, 5 bits for the length extra, 15 bits for the distance code, - and 13 bits for the distance extra. This totals 48 bits, or six bytes. - Therefore if strm->avail_in >= 6, then there is enough input to avoid - checking for available input while decoding. - - - The maximum bytes that a single length/distance pair can output is 258 - bytes, which is the maximum length that can be coded. inflate_fast() - requires strm->avail_out >= 258 for each loop to avoid checking for - output space. - */ -void inflate_fast(strm, start) -z_streamp strm; -unsigned start; /* inflate()'s starting value for strm->avail_out */ -{ - struct inflate_state FAR *state; - unsigned char FAR *in; /* local strm->next_in */ - unsigned char FAR *last; /* while in < last, enough input available */ - unsigned char FAR *out; /* local strm->next_out */ - unsigned char FAR *beg; /* inflate()'s initial strm->next_out */ - unsigned char FAR *end; /* while out < end, enough space available */ -#ifdef INFLATE_STRICT - unsigned dmax; /* maximum distance from zlib header */ -#endif - unsigned wsize; /* window size or zero if not using window */ - unsigned whave; /* valid bytes in the window */ - unsigned write; /* window write index */ - unsigned char FAR *window; /* allocated sliding window, if wsize != 0 */ - unsigned long hold; /* local strm->hold */ - unsigned bits; /* local strm->bits */ - code const FAR *lcode; /* local strm->lencode */ - code const FAR *dcode; /* local strm->distcode */ - unsigned lmask; /* mask for first level of length codes */ - unsigned dmask; /* mask for first level of distance codes */ - code this; /* retrieved table entry */ - unsigned op; /* code bits, operation, extra bits, or */ - /* window position, window bytes to copy */ - unsigned len; /* match length, unused bytes */ - unsigned dist; /* match distance */ - unsigned char FAR *from; /* where to copy match from */ - - /* copy state to local variables */ - state = (struct inflate_state FAR *)strm->state; - in = strm->next_in - OFF; - last = in + (strm->avail_in - 5); - out = strm->next_out - OFF; - beg = out - (start - strm->avail_out); - end = out + (strm->avail_out - 257); -#ifdef INFLATE_STRICT - dmax = state->dmax; -#endif - wsize = state->wsize; - whave = state->whave; - write = state->write; - window = state->window; - hold = state->hold; - bits = state->bits; - lcode = state->lencode; - dcode = state->distcode; - lmask = (1U << state->lenbits) - 1; - dmask = (1U << state->distbits) - 1; - - /* decode literals and length/distances until end-of-block or not enough - input data or output space */ - do { - if (bits < 15) { - hold += (unsigned long)(PUP(in)) << bits; - bits += 8; - hold += (unsigned long)(PUP(in)) << bits; - bits += 8; - } - this = lcode[hold & lmask]; - dolen: - op = (unsigned)(this.bits); - hold >>= op; - bits -= op; - op = (unsigned)(this.op); - if (op == 0) { /* literal */ - Tracevv((stderr, this.val >= 0x20 && this.val < 0x7f ? - "inflate: literal '%c'\n" : - "inflate: literal 0x%02x\n", this.val)); - PUP(out) = (unsigned char)(this.val); - } - else if (op & 16) { /* length base */ - len = (unsigned)(this.val); - op &= 15; /* number of extra bits */ - if (op) { - if (bits < op) { - hold += (unsigned long)(PUP(in)) << bits; - bits += 8; - } - len += (unsigned)hold & ((1U << op) - 1); - hold >>= op; - bits -= op; - } - Tracevv((stderr, "inflate: length %u\n", len)); - if (bits < 15) { - hold += (unsigned long)(PUP(in)) << bits; - bits += 8; - hold += (unsigned long)(PUP(in)) << bits; - bits += 8; - } - this = dcode[hold & dmask]; - dodist: - op = (unsigned)(this.bits); - hold >>= op; - bits -= op; - op = (unsigned)(this.op); - if (op & 16) { /* distance base */ - dist = (unsigned)(this.val); - op &= 15; /* number of extra bits */ - if (bits < op) { - hold += (unsigned long)(PUP(in)) << bits; - bits += 8; - if (bits < op) { - hold += (unsigned long)(PUP(in)) << bits; - bits += 8; - } - } - dist += (unsigned)hold & ((1U << op) - 1); -#ifdef INFLATE_STRICT - if (dist > dmax) { - strm->msg = (char *)"invalid distance too far back"; - state->mode = BAD; - break; - } -#endif - hold >>= op; - bits -= op; - Tracevv((stderr, "inflate: distance %u\n", dist)); - op = (unsigned)(out - beg); /* max distance in output */ - if (dist > op) { /* see if copy from window */ - op = dist - op; /* distance back in window */ - if (op > whave) { - strm->msg = (char *)"invalid distance too far back"; - state->mode = BAD; - break; - } - from = window - OFF; - if (write == 0) { /* very common case */ - from += wsize - op; - if (op < len) { /* some from window */ - len -= op; - do { - PUP(out) = PUP(from); - } while (--op); - from = out - dist; /* rest from output */ - } - } - else if (write < op) { /* wrap around window */ - from += wsize + write - op; - op -= write; - if (op < len) { /* some from end of window */ - len -= op; - do { - PUP(out) = PUP(from); - } while (--op); - from = window - OFF; - if (write < len) { /* some from start of window */ - op = write; - len -= op; - do { - PUP(out) = PUP(from); - } while (--op); - from = out - dist; /* rest from output */ - } - } - } - else { /* contiguous in window */ - from += write - op; - if (op < len) { /* some from window */ - len -= op; - do { - PUP(out) = PUP(from); - } while (--op); - from = out - dist; /* rest from output */ - } - } - while (len > 2) { - PUP(out) = PUP(from); - PUP(out) = PUP(from); - PUP(out) = PUP(from); - len -= 3; - } - if (len) { - PUP(out) = PUP(from); - if (len > 1) - PUP(out) = PUP(from); - } - } - else { - from = out - dist; /* copy direct from output */ - do { /* minimum length is three */ - PUP(out) = PUP(from); - PUP(out) = PUP(from); - PUP(out) = PUP(from); - len -= 3; - } while (len > 2); - if (len) { - PUP(out) = PUP(from); - if (len > 1) - PUP(out) = PUP(from); - } - } - } - else if ((op & 64) == 0) { /* 2nd level distance code */ - this = dcode[this.val + (hold & ((1U << op) - 1))]; - goto dodist; - } - else { - strm->msg = (char *)"invalid distance code"; - state->mode = BAD; - break; - } - } - else if ((op & 64) == 0) { /* 2nd level length code */ - this = lcode[this.val + (hold & ((1U << op) - 1))]; - goto dolen; - } - else if (op & 32) { /* end-of-block */ - Tracevv((stderr, "inflate: end of block\n")); - state->mode = TYPE; - break; - } - else { - strm->msg = (char *)"invalid literal/length code"; - state->mode = BAD; - break; - } - } while (in < last && out < end); - - /* return unused bytes (on entry, bits < 8, so in won't go too far back) */ - len = bits >> 3; - in -= len; - bits -= len << 3; - hold &= (1U << bits) - 1; - - /* update state and return */ - strm->next_in = in + OFF; - strm->next_out = out + OFF; - strm->avail_in = (unsigned)(in < last ? 5 + (last - in) : 5 - (in - last)); - strm->avail_out = (unsigned)(out < end ? - 257 + (end - out) : 257 - (out - end)); - state->hold = hold; - state->bits = bits; - return; -} - -/* - inflate_fast() speedups that turned out slower (on a PowerPC G3 750CXe): - - Using bit fields for code structure - - Different op definition to avoid & for extra bits (do & for table bits) - - Three separate decoding do-loops for direct, window, and write == 0 - - Special case for distance > 1 copies to do overlapped load and store copy - - Explicit branch predictions (based on measured branch probabilities) - - Deferring match copy and interspersed it with decoding subsequent codes - - Swapping literal/length else - - Swapping window/direct else - - Larger unrolled copy loops (three is about right) - - Moving len -= 3 statement into middle of loop - */ - -#endif /* !ASMINF */ diff --git a/src/zlib/inffast.h b/src/zlib/inffast.h deleted file mode 100644 index 614fa7877..000000000 --- a/src/zlib/inffast.h +++ /dev/null @@ -1,11 +0,0 @@ -/* inffast.h -- header to use inffast.c - * Copyright (C) 1995-2003 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* WARNING: this file should *not* be used by applications. It is - part of the implementation of the compression library and is - subject to change. Applications should only use zlib.h. - */ - -void inflate_fast OF((z_streamp strm, unsigned start)); diff --git a/src/zlib/inffixed.h b/src/zlib/inffixed.h deleted file mode 100644 index 423d5c5b5..000000000 --- a/src/zlib/inffixed.h +++ /dev/null @@ -1,94 +0,0 @@ - /* inffixed.h -- table for decoding fixed codes - * Generated automatically by makefixed(). - */ - - /* WARNING: this file should *not* be used by applications. It - is part of the implementation of the compression library and - is subject to change. Applications should only use zlib.h. - */ - - static const code lenfix[512] = { - {96,7,0},{0,8,80},{0,8,16},{20,8,115},{18,7,31},{0,8,112},{0,8,48}, - {0,9,192},{16,7,10},{0,8,96},{0,8,32},{0,9,160},{0,8,0},{0,8,128}, - {0,8,64},{0,9,224},{16,7,6},{0,8,88},{0,8,24},{0,9,144},{19,7,59}, - {0,8,120},{0,8,56},{0,9,208},{17,7,17},{0,8,104},{0,8,40},{0,9,176}, - {0,8,8},{0,8,136},{0,8,72},{0,9,240},{16,7,4},{0,8,84},{0,8,20}, - {21,8,227},{19,7,43},{0,8,116},{0,8,52},{0,9,200},{17,7,13},{0,8,100}, - {0,8,36},{0,9,168},{0,8,4},{0,8,132},{0,8,68},{0,9,232},{16,7,8}, - {0,8,92},{0,8,28},{0,9,152},{20,7,83},{0,8,124},{0,8,60},{0,9,216}, - {18,7,23},{0,8,108},{0,8,44},{0,9,184},{0,8,12},{0,8,140},{0,8,76}, - {0,9,248},{16,7,3},{0,8,82},{0,8,18},{21,8,163},{19,7,35},{0,8,114}, - {0,8,50},{0,9,196},{17,7,11},{0,8,98},{0,8,34},{0,9,164},{0,8,2}, - {0,8,130},{0,8,66},{0,9,228},{16,7,7},{0,8,90},{0,8,26},{0,9,148}, - {20,7,67},{0,8,122},{0,8,58},{0,9,212},{18,7,19},{0,8,106},{0,8,42}, - {0,9,180},{0,8,10},{0,8,138},{0,8,74},{0,9,244},{16,7,5},{0,8,86}, - {0,8,22},{64,8,0},{19,7,51},{0,8,118},{0,8,54},{0,9,204},{17,7,15}, - {0,8,102},{0,8,38},{0,9,172},{0,8,6},{0,8,134},{0,8,70},{0,9,236}, - {16,7,9},{0,8,94},{0,8,30},{0,9,156},{20,7,99},{0,8,126},{0,8,62}, - {0,9,220},{18,7,27},{0,8,110},{0,8,46},{0,9,188},{0,8,14},{0,8,142}, - {0,8,78},{0,9,252},{96,7,0},{0,8,81},{0,8,17},{21,8,131},{18,7,31}, - {0,8,113},{0,8,49},{0,9,194},{16,7,10},{0,8,97},{0,8,33},{0,9,162}, - {0,8,1},{0,8,129},{0,8,65},{0,9,226},{16,7,6},{0,8,89},{0,8,25}, - {0,9,146},{19,7,59},{0,8,121},{0,8,57},{0,9,210},{17,7,17},{0,8,105}, - {0,8,41},{0,9,178},{0,8,9},{0,8,137},{0,8,73},{0,9,242},{16,7,4}, - {0,8,85},{0,8,21},{16,8,258},{19,7,43},{0,8,117},{0,8,53},{0,9,202}, - {17,7,13},{0,8,101},{0,8,37},{0,9,170},{0,8,5},{0,8,133},{0,8,69}, - {0,9,234},{16,7,8},{0,8,93},{0,8,29},{0,9,154},{20,7,83},{0,8,125}, - {0,8,61},{0,9,218},{18,7,23},{0,8,109},{0,8,45},{0,9,186},{0,8,13}, - {0,8,141},{0,8,77},{0,9,250},{16,7,3},{0,8,83},{0,8,19},{21,8,195}, - {19,7,35},{0,8,115},{0,8,51},{0,9,198},{17,7,11},{0,8,99},{0,8,35}, - {0,9,166},{0,8,3},{0,8,131},{0,8,67},{0,9,230},{16,7,7},{0,8,91}, - {0,8,27},{0,9,150},{20,7,67},{0,8,123},{0,8,59},{0,9,214},{18,7,19}, - {0,8,107},{0,8,43},{0,9,182},{0,8,11},{0,8,139},{0,8,75},{0,9,246}, - {16,7,5},{0,8,87},{0,8,23},{64,8,0},{19,7,51},{0,8,119},{0,8,55}, - {0,9,206},{17,7,15},{0,8,103},{0,8,39},{0,9,174},{0,8,7},{0,8,135}, - {0,8,71},{0,9,238},{16,7,9},{0,8,95},{0,8,31},{0,9,158},{20,7,99}, - {0,8,127},{0,8,63},{0,9,222},{18,7,27},{0,8,111},{0,8,47},{0,9,190}, - {0,8,15},{0,8,143},{0,8,79},{0,9,254},{96,7,0},{0,8,80},{0,8,16}, - {20,8,115},{18,7,31},{0,8,112},{0,8,48},{0,9,193},{16,7,10},{0,8,96}, - {0,8,32},{0,9,161},{0,8,0},{0,8,128},{0,8,64},{0,9,225},{16,7,6}, - {0,8,88},{0,8,24},{0,9,145},{19,7,59},{0,8,120},{0,8,56},{0,9,209}, - {17,7,17},{0,8,104},{0,8,40},{0,9,177},{0,8,8},{0,8,136},{0,8,72}, - {0,9,241},{16,7,4},{0,8,84},{0,8,20},{21,8,227},{19,7,43},{0,8,116}, - {0,8,52},{0,9,201},{17,7,13},{0,8,100},{0,8,36},{0,9,169},{0,8,4}, - {0,8,132},{0,8,68},{0,9,233},{16,7,8},{0,8,92},{0,8,28},{0,9,153}, - {20,7,83},{0,8,124},{0,8,60},{0,9,217},{18,7,23},{0,8,108},{0,8,44}, - {0,9,185},{0,8,12},{0,8,140},{0,8,76},{0,9,249},{16,7,3},{0,8,82}, - {0,8,18},{21,8,163},{19,7,35},{0,8,114},{0,8,50},{0,9,197},{17,7,11}, - {0,8,98},{0,8,34},{0,9,165},{0,8,2},{0,8,130},{0,8,66},{0,9,229}, - {16,7,7},{0,8,90},{0,8,26},{0,9,149},{20,7,67},{0,8,122},{0,8,58}, - {0,9,213},{18,7,19},{0,8,106},{0,8,42},{0,9,181},{0,8,10},{0,8,138}, - {0,8,74},{0,9,245},{16,7,5},{0,8,86},{0,8,22},{64,8,0},{19,7,51}, - {0,8,118},{0,8,54},{0,9,205},{17,7,15},{0,8,102},{0,8,38},{0,9,173}, - {0,8,6},{0,8,134},{0,8,70},{0,9,237},{16,7,9},{0,8,94},{0,8,30}, - {0,9,157},{20,7,99},{0,8,126},{0,8,62},{0,9,221},{18,7,27},{0,8,110}, - {0,8,46},{0,9,189},{0,8,14},{0,8,142},{0,8,78},{0,9,253},{96,7,0}, - {0,8,81},{0,8,17},{21,8,131},{18,7,31},{0,8,113},{0,8,49},{0,9,195}, - {16,7,10},{0,8,97},{0,8,33},{0,9,163},{0,8,1},{0,8,129},{0,8,65}, - {0,9,227},{16,7,6},{0,8,89},{0,8,25},{0,9,147},{19,7,59},{0,8,121}, - {0,8,57},{0,9,211},{17,7,17},{0,8,105},{0,8,41},{0,9,179},{0,8,9}, - {0,8,137},{0,8,73},{0,9,243},{16,7,4},{0,8,85},{0,8,21},{16,8,258}, - {19,7,43},{0,8,117},{0,8,53},{0,9,203},{17,7,13},{0,8,101},{0,8,37}, - {0,9,171},{0,8,5},{0,8,133},{0,8,69},{0,9,235},{16,7,8},{0,8,93}, - {0,8,29},{0,9,155},{20,7,83},{0,8,125},{0,8,61},{0,9,219},{18,7,23}, - {0,8,109},{0,8,45},{0,9,187},{0,8,13},{0,8,141},{0,8,77},{0,9,251}, - {16,7,3},{0,8,83},{0,8,19},{21,8,195},{19,7,35},{0,8,115},{0,8,51}, - {0,9,199},{17,7,11},{0,8,99},{0,8,35},{0,9,167},{0,8,3},{0,8,131}, - {0,8,67},{0,9,231},{16,7,7},{0,8,91},{0,8,27},{0,9,151},{20,7,67}, - {0,8,123},{0,8,59},{0,9,215},{18,7,19},{0,8,107},{0,8,43},{0,9,183}, - {0,8,11},{0,8,139},{0,8,75},{0,9,247},{16,7,5},{0,8,87},{0,8,23}, - {64,8,0},{19,7,51},{0,8,119},{0,8,55},{0,9,207},{17,7,15},{0,8,103}, - {0,8,39},{0,9,175},{0,8,7},{0,8,135},{0,8,71},{0,9,239},{16,7,9}, - {0,8,95},{0,8,31},{0,9,159},{20,7,99},{0,8,127},{0,8,63},{0,9,223}, - {18,7,27},{0,8,111},{0,8,47},{0,9,191},{0,8,15},{0,8,143},{0,8,79}, - {0,9,255} - }; - - static const code distfix[32] = { - {16,5,1},{23,5,257},{19,5,17},{27,5,4097},{17,5,5},{25,5,1025}, - {21,5,65},{29,5,16385},{16,5,3},{24,5,513},{20,5,33},{28,5,8193}, - {18,5,9},{26,5,2049},{22,5,129},{64,5,0},{16,5,2},{23,5,385}, - {19,5,25},{27,5,6145},{17,5,7},{25,5,1537},{21,5,97},{29,5,24577}, - {16,5,4},{24,5,769},{20,5,49},{28,5,12289},{18,5,13},{26,5,3073}, - {22,5,193},{64,5,0} - }; diff --git a/src/zlib/inflate.c b/src/zlib/inflate.c deleted file mode 100644 index 33ea90292..000000000 --- a/src/zlib/inflate.c +++ /dev/null @@ -1,1368 +0,0 @@ -/* inflate.c -- zlib decompression - * Copyright (C) 1995-2005 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* - * Change history: - * - * 1.2.beta0 24 Nov 2002 - * - First version -- complete rewrite of inflate to simplify code, avoid - * creation of window when not needed, minimize use of window when it is - * needed, make inffast.c even faster, implement gzip decoding, and to - * improve code readability and style over the previous zlib inflate code - * - * 1.2.beta1 25 Nov 2002 - * - Use pointers for available input and output checking in inffast.c - * - Remove input and output counters in inffast.c - * - Change inffast.c entry and loop from avail_in >= 7 to >= 6 - * - Remove unnecessary second byte pull from length extra in inffast.c - * - Unroll direct copy to three copies per loop in inffast.c - * - * 1.2.beta2 4 Dec 2002 - * - Change external routine names to reduce potential conflicts - * - Correct filename to inffixed.h for fixed tables in inflate.c - * - Make hbuf[] unsigned char to match parameter type in inflate.c - * - Change strm->next_out[-state->offset] to *(strm->next_out - state->offset) - * to avoid negation problem on Alphas (64 bit) in inflate.c - * - * 1.2.beta3 22 Dec 2002 - * - Add comments on state->bits assertion in inffast.c - * - Add comments on op field in inftrees.h - * - Fix bug in reuse of allocated window after inflateReset() - * - Remove bit fields--back to byte structure for speed - * - Remove distance extra == 0 check in inflate_fast()--only helps for lengths - * - Change post-increments to pre-increments in inflate_fast(), PPC biased? - * - Add compile time option, POSTINC, to use post-increments instead (Intel?) - * - Make MATCH copy in inflate() much faster for when inflate_fast() not used - * - Use local copies of stream next and avail values, as well as local bit - * buffer and bit count in inflate()--for speed when inflate_fast() not used - * - * 1.2.beta4 1 Jan 2003 - * - Split ptr - 257 statements in inflate_table() to avoid compiler warnings - * - Move a comment on output buffer sizes from inffast.c to inflate.c - * - Add comments in inffast.c to introduce the inflate_fast() routine - * - Rearrange window copies in inflate_fast() for speed and simplification - * - Unroll last copy for window match in inflate_fast() - * - Use local copies of window variables in inflate_fast() for speed - * - Pull out common write == 0 case for speed in inflate_fast() - * - Make op and len in inflate_fast() unsigned for consistency - * - Add FAR to lcode and dcode declarations in inflate_fast() - * - Simplified bad distance check in inflate_fast() - * - Added inflateBackInit(), inflateBack(), and inflateBackEnd() in new - * source file infback.c to provide a call-back interface to inflate for - * programs like gzip and unzip -- uses window as output buffer to avoid - * window copying - * - * 1.2.beta5 1 Jan 2003 - * - Improved inflateBack() interface to allow the caller to provide initial - * input in strm. - * - Fixed stored blocks bug in inflateBack() - * - * 1.2.beta6 4 Jan 2003 - * - Added comments in inffast.c on effectiveness of POSTINC - * - Typecasting all around to reduce compiler warnings - * - Changed loops from while (1) or do {} while (1) to for (;;), again to - * make compilers happy - * - Changed type of window in inflateBackInit() to unsigned char * - * - * 1.2.beta7 27 Jan 2003 - * - Changed many types to unsigned or unsigned short to avoid warnings - * - Added inflateCopy() function - * - * 1.2.0 9 Mar 2003 - * - Changed inflateBack() interface to provide separate opaque descriptors - * for the in() and out() functions - * - Changed inflateBack() argument and in_func typedef to swap the length - * and buffer address return values for the input function - * - Check next_in and next_out for Z_NULL on entry to inflate() - * - * The history for versions after 1.2.0 are in ChangeLog in zlib distribution. - */ - -#include "zutil.h" -#include "inftrees.h" -#include "inflate.h" -#include "inffast.h" - -#ifdef MAKEFIXED -# ifndef BUILDFIXED -# define BUILDFIXED -# endif -#endif - -/* function prototypes */ -local void fixedtables OF((struct inflate_state FAR *state)); -local int updatewindow OF((z_streamp strm, unsigned out)); -#ifdef BUILDFIXED - void makefixed OF((void)); -#endif -local unsigned syncsearch OF((unsigned FAR *have, unsigned char FAR *buf, - unsigned len)); - -int ZEXPORT inflateReset(strm) -z_streamp strm; -{ - struct inflate_state FAR *state; - - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; - strm->total_in = strm->total_out = state->total = 0; - strm->msg = Z_NULL; - strm->adler = 1; /* to support ill-conceived Java test suite */ - state->mode = HEAD; - state->last = 0; - state->havedict = 0; - state->dmax = 32768U; - state->head = Z_NULL; - state->wsize = 0; - state->whave = 0; - state->write = 0; - state->hold = 0; - state->bits = 0; - state->lencode = state->distcode = state->next = state->codes; - Tracev((stderr, "inflate: reset\n")); - return Z_OK; -} - -int ZEXPORT inflatePrime(strm, bits, value) -z_streamp strm; -int bits; -int value; -{ - struct inflate_state FAR *state; - - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; - if (bits > 16 || state->bits + bits > 32) return Z_STREAM_ERROR; - value &= (1L << bits) - 1; - state->hold += value << state->bits; - state->bits += bits; - return Z_OK; -} - -int ZEXPORT inflateInit2_(strm, windowBits, version, stream_size) -z_streamp strm; -int windowBits; -const char *version; -int stream_size; -{ - struct inflate_state FAR *state; - - if (version == Z_NULL || version[0] != ZLIB_VERSION[0] || - stream_size != (int)(sizeof(z_stream))) - return Z_VERSION_ERROR; - if (strm == Z_NULL) return Z_STREAM_ERROR; - strm->msg = Z_NULL; /* in case we return an error */ - if (strm->zalloc == (alloc_func)0) { - strm->zalloc = zcalloc; - strm->opaque = (voidpf)0; - } - if (strm->zfree == (free_func)0) strm->zfree = zcfree; - state = (struct inflate_state FAR *) - ZALLOC(strm, 1, sizeof(struct inflate_state)); - if (state == Z_NULL) return Z_MEM_ERROR; - Tracev((stderr, "inflate: allocated\n")); - strm->state = (struct internal_state FAR *)state; - if (windowBits < 0) { - state->wrap = 0; - windowBits = -windowBits; - } - else { - state->wrap = (windowBits >> 4) + 1; -#ifdef GUNZIP - if (windowBits < 48) windowBits &= 15; -#endif - } - if (windowBits < 8 || windowBits > 15) { - ZFREE(strm, state); - strm->state = Z_NULL; - return Z_STREAM_ERROR; - } - state->wbits = (unsigned)windowBits; - state->window = Z_NULL; - return inflateReset(strm); -} - -int ZEXPORT inflateInit_(strm, version, stream_size) -z_streamp strm; -const char *version; -int stream_size; -{ - return inflateInit2_(strm, DEF_WBITS, version, stream_size); -} - -/* - Return state with length and distance decoding tables and index sizes set to - fixed code decoding. Normally this returns fixed tables from inffixed.h. - If BUILDFIXED is defined, then instead this routine builds the tables the - first time it's called, and returns those tables the first time and - thereafter. This reduces the size of the code by about 2K bytes, in - exchange for a little execution time. However, BUILDFIXED should not be - used for threaded applications, since the rewriting of the tables and virgin - may not be thread-safe. - */ -local void fixedtables(state) -struct inflate_state FAR *state; -{ -#ifdef BUILDFIXED - static int virgin = 1; - static code *lenfix, *distfix; - static code fixed[544]; - - /* build fixed huffman tables if first call (may not be thread safe) */ - if (virgin) { - unsigned sym, bits; - static code *next; - - /* literal/length table */ - sym = 0; - while (sym < 144) state->lens[sym++] = 8; - while (sym < 256) state->lens[sym++] = 9; - while (sym < 280) state->lens[sym++] = 7; - while (sym < 288) state->lens[sym++] = 8; - next = fixed; - lenfix = next; - bits = 9; - inflate_table(LENS, state->lens, 288, &(next), &(bits), state->work); - - /* distance table */ - sym = 0; - while (sym < 32) state->lens[sym++] = 5; - distfix = next; - bits = 5; - inflate_table(DISTS, state->lens, 32, &(next), &(bits), state->work); - - /* do this just once */ - virgin = 0; - } -#else /* !BUILDFIXED */ -# include "inffixed.h" -#endif /* BUILDFIXED */ - state->lencode = lenfix; - state->lenbits = 9; - state->distcode = distfix; - state->distbits = 5; -} - -#ifdef MAKEFIXED -#include - -/* - Write out the inffixed.h that is #include'd above. Defining MAKEFIXED also - defines BUILDFIXED, so the tables are built on the fly. makefixed() writes - those tables to stdout, which would be piped to inffixed.h. A small program - can simply call makefixed to do this: - - void makefixed(void); - - int main(void) - { - makefixed(); - return 0; - } - - Then that can be linked with zlib built with MAKEFIXED defined and run: - - a.out > inffixed.h - */ -void makefixed() -{ - unsigned low, size; - struct inflate_state state; - - fixedtables(&state); - puts(" /* inffixed.h -- table for decoding fixed codes"); - puts(" * Generated automatically by makefixed()."); - puts(" */"); - puts(""); - puts(" /* WARNING: this file should *not* be used by applications."); - puts(" It is part of the implementation of this library and is"); - puts(" subject to change. Applications should only use zlib.h."); - puts(" */"); - puts(""); - size = 1U << 9; - printf(" static const code lenfix[%u] = {", size); - low = 0; - for (;;) { - if ((low % 7) == 0) printf("\n "); - printf("{%u,%u,%d}", state.lencode[low].op, state.lencode[low].bits, - state.lencode[low].val); - if (++low == size) break; - putchar(','); - } - puts("\n };"); - size = 1U << 5; - printf("\n static const code distfix[%u] = {", size); - low = 0; - for (;;) { - if ((low % 6) == 0) printf("\n "); - printf("{%u,%u,%d}", state.distcode[low].op, state.distcode[low].bits, - state.distcode[low].val); - if (++low == size) break; - putchar(','); - } - puts("\n };"); -} -#endif /* MAKEFIXED */ - -/* - Update the window with the last wsize (normally 32K) bytes written before - returning. If window does not exist yet, create it. This is only called - when a window is already in use, or when output has been written during this - inflate call, but the end of the deflate stream has not been reached yet. - It is also called to create a window for dictionary data when a dictionary - is loaded. - - Providing output buffers larger than 32K to inflate() should provide a speed - advantage, since only the last 32K of output is copied to the sliding window - upon return from inflate(), and since all distances after the first 32K of - output will fall in the output data, making match copies simpler and faster. - The advantage may be dependent on the size of the processor's data caches. - */ -local int updatewindow(strm, out) -z_streamp strm; -unsigned out; -{ - struct inflate_state FAR *state; - unsigned copy, dist; - - state = (struct inflate_state FAR *)strm->state; - - /* if it hasn't been done already, allocate space for the window */ - if (state->window == Z_NULL) { - state->window = (unsigned char FAR *) - ZALLOC(strm, 1U << state->wbits, - sizeof(unsigned char)); - if (state->window == Z_NULL) return 1; - } - - /* if window not in use yet, initialize */ - if (state->wsize == 0) { - state->wsize = 1U << state->wbits; - state->write = 0; - state->whave = 0; - } - - /* copy state->wsize or less output bytes into the circular window */ - copy = out - strm->avail_out; - if (copy >= state->wsize) { - zmemcpy(state->window, strm->next_out - state->wsize, state->wsize); - state->write = 0; - state->whave = state->wsize; - } - else { - dist = state->wsize - state->write; - if (dist > copy) dist = copy; - zmemcpy(state->window + state->write, strm->next_out - copy, dist); - copy -= dist; - if (copy) { - zmemcpy(state->window, strm->next_out - copy, copy); - state->write = copy; - state->whave = state->wsize; - } - else { - state->write += dist; - if (state->write == state->wsize) state->write = 0; - if (state->whave < state->wsize) state->whave += dist; - } - } - return 0; -} - -/* Macros for inflate(): */ - -/* check function to use adler32() for zlib or crc32() for gzip */ -#ifdef GUNZIP -# define UPDATE(check, buf, len) \ - (state->flags ? crc32(check, buf, len) : adler32(check, buf, len)) -#else -# define UPDATE(check, buf, len) adler32(check, buf, len) -#endif - -/* check macros for header crc */ -#ifdef GUNZIP -# define CRC2(check, word) \ - do { \ - hbuf[0] = (unsigned char)(word); \ - hbuf[1] = (unsigned char)((word) >> 8); \ - check = crc32(check, hbuf, 2); \ - } while (0) - -# define CRC4(check, word) \ - do { \ - hbuf[0] = (unsigned char)(word); \ - hbuf[1] = (unsigned char)((word) >> 8); \ - hbuf[2] = (unsigned char)((word) >> 16); \ - hbuf[3] = (unsigned char)((word) >> 24); \ - check = crc32(check, hbuf, 4); \ - } while (0) -#endif - -/* Load registers with state in inflate() for speed */ -#define LOAD() \ - do { \ - put = strm->next_out; \ - left = strm->avail_out; \ - next = strm->next_in; \ - have = strm->avail_in; \ - hold = state->hold; \ - bits = state->bits; \ - } while (0) - -/* Restore state from registers in inflate() */ -#define RESTORE() \ - do { \ - strm->next_out = put; \ - strm->avail_out = left; \ - strm->next_in = next; \ - strm->avail_in = have; \ - state->hold = hold; \ - state->bits = bits; \ - } while (0) - -/* Clear the input bit accumulator */ -#define INITBITS() \ - do { \ - hold = 0; \ - bits = 0; \ - } while (0) - -/* Get a byte of input into the bit accumulator, or return from inflate() - if there is no input available. */ -#define PULLBYTE() \ - do { \ - if (have == 0) goto inf_leave; \ - have--; \ - hold += (unsigned long)(*next++) << bits; \ - bits += 8; \ - } while (0) - -/* Assure that there are at least n bits in the bit accumulator. If there is - not enough available input to do that, then return from inflate(). */ -#define NEEDBITS(n) \ - do { \ - while (bits < (unsigned)(n)) \ - PULLBYTE(); \ - } while (0) - -/* Return the low n bits of the bit accumulator (n < 16) */ -#define BITS(n) \ - ((unsigned)hold & ((1U << (n)) - 1)) - -/* Remove n bits from the bit accumulator */ -#define DROPBITS(n) \ - do { \ - hold >>= (n); \ - bits -= (unsigned)(n); \ - } while (0) - -/* Remove zero to seven bits as needed to go to a byte boundary */ -#define BYTEBITS() \ - do { \ - hold >>= bits & 7; \ - bits -= bits & 7; \ - } while (0) - -/* Reverse the bytes in a 32-bit value */ -#define REVERSE(q) \ - ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \ - (((q) & 0xff00) << 8) + (((q) & 0xff) << 24)) - -/* - inflate() uses a state machine to process as much input data and generate as - much output data as possible before returning. The state machine is - structured roughly as follows: - - for (;;) switch (state) { - ... - case STATEn: - if (not enough input data or output space to make progress) - return; - ... make progress ... - state = STATEm; - break; - ... - } - - so when inflate() is called again, the same case is attempted again, and - if the appropriate resources are provided, the machine proceeds to the - next state. The NEEDBITS() macro is usually the way the state evaluates - whether it can proceed or should return. NEEDBITS() does the return if - the requested bits are not available. The typical use of the BITS macros - is: - - NEEDBITS(n); - ... do something with BITS(n) ... - DROPBITS(n); - - where NEEDBITS(n) either returns from inflate() if there isn't enough - input left to load n bits into the accumulator, or it continues. BITS(n) - gives the low n bits in the accumulator. When done, DROPBITS(n) drops - the low n bits off the accumulator. INITBITS() clears the accumulator - and sets the number of available bits to zero. BYTEBITS() discards just - enough bits to put the accumulator on a byte boundary. After BYTEBITS() - and a NEEDBITS(8), then BITS(8) would return the next byte in the stream. - - NEEDBITS(n) uses PULLBYTE() to get an available byte of input, or to return - if there is no input available. The decoding of variable length codes uses - PULLBYTE() directly in order to pull just enough bytes to decode the next - code, and no more. - - Some states loop until they get enough input, making sure that enough - state information is maintained to continue the loop where it left off - if NEEDBITS() returns in the loop. For example, want, need, and keep - would all have to actually be part of the saved state in case NEEDBITS() - returns: - - case STATEw: - while (want < need) { - NEEDBITS(n); - keep[want++] = BITS(n); - DROPBITS(n); - } - state = STATEx; - case STATEx: - - As shown above, if the next state is also the next case, then the break - is omitted. - - A state may also return if there is not enough output space available to - complete that state. Those states are copying stored data, writing a - literal byte, and copying a matching string. - - When returning, a "goto inf_leave" is used to update the total counters, - update the check value, and determine whether any progress has been made - during that inflate() call in order to return the proper return code. - Progress is defined as a change in either strm->avail_in or strm->avail_out. - When there is a window, goto inf_leave will update the window with the last - output written. If a goto inf_leave occurs in the middle of decompression - and there is no window currently, goto inf_leave will create one and copy - output to the window for the next call of inflate(). - - In this implementation, the flush parameter of inflate() only affects the - return code (per zlib.h). inflate() always writes as much as possible to - strm->next_out, given the space available and the provided input--the effect - documented in zlib.h of Z_SYNC_FLUSH. Furthermore, inflate() always defers - the allocation of and copying into a sliding window until necessary, which - provides the effect documented in zlib.h for Z_FINISH when the entire input - stream available. So the only thing the flush parameter actually does is: - when flush is set to Z_FINISH, inflate() cannot return Z_OK. Instead it - will return Z_BUF_ERROR if it has not reached the end of the stream. - */ - -int ZEXPORT inflate(strm, flush) -z_streamp strm; -int flush; -{ - struct inflate_state FAR *state; - unsigned char FAR *next; /* next input */ - unsigned char FAR *put; /* next output */ - unsigned have, left; /* available input and output */ - unsigned long hold; /* bit buffer */ - unsigned bits; /* bits in bit buffer */ - unsigned in, out; /* save starting available input and output */ - unsigned copy; /* number of stored or match bytes to copy */ - unsigned char FAR *from; /* where to copy match bytes from */ - code this; /* current decoding table entry */ - code last; /* parent table entry */ - unsigned len; /* length to copy for repeats, bits to drop */ - int ret; /* return code */ -#ifdef GUNZIP - unsigned char hbuf[4]; /* buffer for gzip header crc calculation */ -#endif - static const unsigned short order[19] = /* permutation of code lengths */ - {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; - - if (strm == Z_NULL || strm->state == Z_NULL || strm->next_out == Z_NULL || - (strm->next_in == Z_NULL && strm->avail_in != 0)) - return Z_STREAM_ERROR; - - state = (struct inflate_state FAR *)strm->state; - if (state->mode == TYPE) state->mode = TYPEDO; /* skip check */ - LOAD(); - in = have; - out = left; - ret = Z_OK; - for (;;) - switch (state->mode) { - case HEAD: - if (state->wrap == 0) { - state->mode = TYPEDO; - break; - } - NEEDBITS(16); -#ifdef GUNZIP - if ((state->wrap & 2) && hold == 0x8b1f) { /* gzip header */ - state->check = crc32(0L, Z_NULL, 0); - CRC2(state->check, hold); - INITBITS(); - state->mode = FLAGS; - break; - } - state->flags = 0; /* expect zlib header */ - if (state->head != Z_NULL) - state->head->done = -1; - if (!(state->wrap & 1) || /* check if zlib header allowed */ -#else - if ( -#endif - ((BITS(8) << 8) + (hold >> 8)) % 31) { - strm->msg = (char *)"incorrect header check"; - state->mode = BAD; - break; - } - if (BITS(4) != Z_DEFLATED) { - strm->msg = (char *)"unknown compression method"; - state->mode = BAD; - break; - } - DROPBITS(4); - len = BITS(4) + 8; - if (len > state->wbits) { - strm->msg = (char *)"invalid window size"; - state->mode = BAD; - break; - } - state->dmax = 1U << len; - Tracev((stderr, "inflate: zlib header ok\n")); - strm->adler = state->check = adler32(0L, Z_NULL, 0); - state->mode = hold & 0x200 ? DICTID : TYPE; - INITBITS(); - break; -#ifdef GUNZIP - case FLAGS: - NEEDBITS(16); - state->flags = (int)(hold); - if ((state->flags & 0xff) != Z_DEFLATED) { - strm->msg = (char *)"unknown compression method"; - state->mode = BAD; - break; - } - if (state->flags & 0xe000) { - strm->msg = (char *)"unknown header flags set"; - state->mode = BAD; - break; - } - if (state->head != Z_NULL) - state->head->text = (int)((hold >> 8) & 1); - if (state->flags & 0x0200) CRC2(state->check, hold); - INITBITS(); - state->mode = TIME; - case TIME: - NEEDBITS(32); - if (state->head != Z_NULL) - state->head->time = hold; - if (state->flags & 0x0200) CRC4(state->check, hold); - INITBITS(); - state->mode = OS; - case OS: - NEEDBITS(16); - if (state->head != Z_NULL) { - state->head->xflags = (int)(hold & 0xff); - state->head->os = (int)(hold >> 8); - } - if (state->flags & 0x0200) CRC2(state->check, hold); - INITBITS(); - state->mode = EXLEN; - case EXLEN: - if (state->flags & 0x0400) { - NEEDBITS(16); - state->length = (unsigned)(hold); - if (state->head != Z_NULL) - state->head->extra_len = (unsigned)hold; - if (state->flags & 0x0200) CRC2(state->check, hold); - INITBITS(); - } - else if (state->head != Z_NULL) - state->head->extra = Z_NULL; - state->mode = EXTRA; - case EXTRA: - if (state->flags & 0x0400) { - copy = state->length; - if (copy > have) copy = have; - if (copy) { - if (state->head != Z_NULL && - state->head->extra != Z_NULL) { - len = state->head->extra_len - state->length; - zmemcpy(state->head->extra + len, next, - len + copy > state->head->extra_max ? - state->head->extra_max - len : copy); - } - if (state->flags & 0x0200) - state->check = crc32(state->check, next, copy); - have -= copy; - next += copy; - state->length -= copy; - } - if (state->length) goto inf_leave; - } - state->length = 0; - state->mode = NAME; - case NAME: - if (state->flags & 0x0800) { - if (have == 0) goto inf_leave; - copy = 0; - do { - len = (unsigned)(next[copy++]); - if (state->head != Z_NULL && - state->head->name != Z_NULL && - state->length < state->head->name_max) - state->head->name[state->length++] = len; - } while (len && copy < have); - if (state->flags & 0x0200) - state->check = crc32(state->check, next, copy); - have -= copy; - next += copy; - if (len) goto inf_leave; - } - else if (state->head != Z_NULL) - state->head->name = Z_NULL; - state->length = 0; - state->mode = COMMENT; - case COMMENT: - if (state->flags & 0x1000) { - if (have == 0) goto inf_leave; - copy = 0; - do { - len = (unsigned)(next[copy++]); - if (state->head != Z_NULL && - state->head->comment != Z_NULL && - state->length < state->head->comm_max) - state->head->comment[state->length++] = len; - } while (len && copy < have); - if (state->flags & 0x0200) - state->check = crc32(state->check, next, copy); - have -= copy; - next += copy; - if (len) goto inf_leave; - } - else if (state->head != Z_NULL) - state->head->comment = Z_NULL; - state->mode = HCRC; - case HCRC: - if (state->flags & 0x0200) { - NEEDBITS(16); - if (hold != (state->check & 0xffff)) { - strm->msg = (char *)"header crc mismatch"; - state->mode = BAD; - break; - } - INITBITS(); - } - if (state->head != Z_NULL) { - state->head->hcrc = (int)((state->flags >> 9) & 1); - state->head->done = 1; - } - strm->adler = state->check = crc32(0L, Z_NULL, 0); - state->mode = TYPE; - break; -#endif - case DICTID: - NEEDBITS(32); - strm->adler = state->check = REVERSE(hold); - INITBITS(); - state->mode = DICT; - case DICT: - if (state->havedict == 0) { - RESTORE(); - return Z_NEED_DICT; - } - strm->adler = state->check = adler32(0L, Z_NULL, 0); - state->mode = TYPE; - case TYPE: - if (flush == Z_BLOCK) goto inf_leave; - case TYPEDO: - if (state->last) { - BYTEBITS(); - state->mode = CHECK; - break; - } - NEEDBITS(3); - state->last = BITS(1); - DROPBITS(1); - switch (BITS(2)) { - case 0: /* stored block */ - Tracev((stderr, "inflate: stored block%s\n", - state->last ? " (last)" : "")); - state->mode = STORED; - break; - case 1: /* fixed block */ - fixedtables(state); - Tracev((stderr, "inflate: fixed codes block%s\n", - state->last ? " (last)" : "")); - state->mode = LEN; /* decode codes */ - break; - case 2: /* dynamic block */ - Tracev((stderr, "inflate: dynamic codes block%s\n", - state->last ? " (last)" : "")); - state->mode = TABLE; - break; - case 3: - strm->msg = (char *)"invalid block type"; - state->mode = BAD; - } - DROPBITS(2); - break; - case STORED: - BYTEBITS(); /* go to byte boundary */ - NEEDBITS(32); - if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) { - strm->msg = (char *)"invalid stored block lengths"; - state->mode = BAD; - break; - } - state->length = (unsigned)hold & 0xffff; - Tracev((stderr, "inflate: stored length %u\n", - state->length)); - INITBITS(); - state->mode = COPY; - case COPY: - copy = state->length; - if (copy) { - if (copy > have) copy = have; - if (copy > left) copy = left; - if (copy == 0) goto inf_leave; - zmemcpy(put, next, copy); - have -= copy; - next += copy; - left -= copy; - put += copy; - state->length -= copy; - break; - } - Tracev((stderr, "inflate: stored end\n")); - state->mode = TYPE; - break; - case TABLE: - NEEDBITS(14); - state->nlen = BITS(5) + 257; - DROPBITS(5); - state->ndist = BITS(5) + 1; - DROPBITS(5); - state->ncode = BITS(4) + 4; - DROPBITS(4); -#ifndef PKZIP_BUG_WORKAROUND - if (state->nlen > 286 || state->ndist > 30) { - strm->msg = (char *)"too many length or distance symbols"; - state->mode = BAD; - break; - } -#endif - Tracev((stderr, "inflate: table sizes ok\n")); - state->have = 0; - state->mode = LENLENS; - case LENLENS: - while (state->have < state->ncode) { - NEEDBITS(3); - state->lens[order[state->have++]] = (unsigned short)BITS(3); - DROPBITS(3); - } - while (state->have < 19) - state->lens[order[state->have++]] = 0; - state->next = state->codes; - state->lencode = (code const FAR *)(state->next); - state->lenbits = 7; - ret = inflate_table(CODES, state->lens, 19, &(state->next), - &(state->lenbits), state->work); - if (ret) { - strm->msg = (char *)"invalid code lengths set"; - state->mode = BAD; - break; - } - Tracev((stderr, "inflate: code lengths ok\n")); - state->have = 0; - state->mode = CODELENS; - case CODELENS: - while (state->have < state->nlen + state->ndist) { - for (;;) { - this = state->lencode[BITS(state->lenbits)]; - if ((unsigned)(this.bits) <= bits) break; - PULLBYTE(); - } - if (this.val < 16) { - NEEDBITS(this.bits); - DROPBITS(this.bits); - state->lens[state->have++] = this.val; - } - else { - if (this.val == 16) { - NEEDBITS(this.bits + 2); - DROPBITS(this.bits); - if (state->have == 0) { - strm->msg = (char *)"invalid bit length repeat"; - state->mode = BAD; - break; - } - len = state->lens[state->have - 1]; - copy = 3 + BITS(2); - DROPBITS(2); - } - else if (this.val == 17) { - NEEDBITS(this.bits + 3); - DROPBITS(this.bits); - len = 0; - copy = 3 + BITS(3); - DROPBITS(3); - } - else { - NEEDBITS(this.bits + 7); - DROPBITS(this.bits); - len = 0; - copy = 11 + BITS(7); - DROPBITS(7); - } - if (state->have + copy > state->nlen + state->ndist) { - strm->msg = (char *)"invalid bit length repeat"; - state->mode = BAD; - break; - } - while (copy--) - state->lens[state->have++] = (unsigned short)len; - } - } - - /* handle error breaks in while */ - if (state->mode == BAD) break; - - /* build code tables */ - state->next = state->codes; - state->lencode = (code const FAR *)(state->next); - state->lenbits = 9; - ret = inflate_table(LENS, state->lens, state->nlen, &(state->next), - &(state->lenbits), state->work); - if (ret) { - strm->msg = (char *)"invalid literal/lengths set"; - state->mode = BAD; - break; - } - state->distcode = (code const FAR *)(state->next); - state->distbits = 6; - ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist, - &(state->next), &(state->distbits), state->work); - if (ret) { - strm->msg = (char *)"invalid distances set"; - state->mode = BAD; - break; - } - Tracev((stderr, "inflate: codes ok\n")); - state->mode = LEN; - case LEN: - if (have >= 6 && left >= 258) { - RESTORE(); - inflate_fast(strm, out); - LOAD(); - break; - } - for (;;) { - this = state->lencode[BITS(state->lenbits)]; - if ((unsigned)(this.bits) <= bits) break; - PULLBYTE(); - } - if (this.op && (this.op & 0xf0) == 0) { - last = this; - for (;;) { - this = state->lencode[last.val + - (BITS(last.bits + last.op) >> last.bits)]; - if ((unsigned)(last.bits + this.bits) <= bits) break; - PULLBYTE(); - } - DROPBITS(last.bits); - } - DROPBITS(this.bits); - state->length = (unsigned)this.val; - if ((int)(this.op) == 0) { - Tracevv((stderr, this.val >= 0x20 && this.val < 0x7f ? - "inflate: literal '%c'\n" : - "inflate: literal 0x%02x\n", this.val)); - state->mode = LIT; - break; - } - if (this.op & 32) { - Tracevv((stderr, "inflate: end of block\n")); - state->mode = TYPE; - break; - } - if (this.op & 64) { - strm->msg = (char *)"invalid literal/length code"; - state->mode = BAD; - break; - } - state->extra = (unsigned)(this.op) & 15; - state->mode = LENEXT; - case LENEXT: - if (state->extra) { - NEEDBITS(state->extra); - state->length += BITS(state->extra); - DROPBITS(state->extra); - } - Tracevv((stderr, "inflate: length %u\n", state->length)); - state->mode = DIST; - case DIST: - for (;;) { - this = state->distcode[BITS(state->distbits)]; - if ((unsigned)(this.bits) <= bits) break; - PULLBYTE(); - } - if ((this.op & 0xf0) == 0) { - last = this; - for (;;) { - this = state->distcode[last.val + - (BITS(last.bits + last.op) >> last.bits)]; - if ((unsigned)(last.bits + this.bits) <= bits) break; - PULLBYTE(); - } - DROPBITS(last.bits); - } - DROPBITS(this.bits); - if (this.op & 64) { - strm->msg = (char *)"invalid distance code"; - state->mode = BAD; - break; - } - state->offset = (unsigned)this.val; - state->extra = (unsigned)(this.op) & 15; - state->mode = DISTEXT; - case DISTEXT: - if (state->extra) { - NEEDBITS(state->extra); - state->offset += BITS(state->extra); - DROPBITS(state->extra); - } -#ifdef INFLATE_STRICT - if (state->offset > state->dmax) { - strm->msg = (char *)"invalid distance too far back"; - state->mode = BAD; - break; - } -#endif - if (state->offset > state->whave + out - left) { - strm->msg = (char *)"invalid distance too far back"; - state->mode = BAD; - break; - } - Tracevv((stderr, "inflate: distance %u\n", state->offset)); - state->mode = MATCH; - case MATCH: - if (left == 0) goto inf_leave; - copy = out - left; - if (state->offset > copy) { /* copy from window */ - copy = state->offset - copy; - if (copy > state->write) { - copy -= state->write; - from = state->window + (state->wsize - copy); - } - else - from = state->window + (state->write - copy); - if (copy > state->length) copy = state->length; - } - else { /* copy from output */ - from = put - state->offset; - copy = state->length; - } - if (copy > left) copy = left; - left -= copy; - state->length -= copy; - do { - *put++ = *from++; - } while (--copy); - if (state->length == 0) state->mode = LEN; - break; - case LIT: - if (left == 0) goto inf_leave; - *put++ = (unsigned char)(state->length); - left--; - state->mode = LEN; - break; - case CHECK: - if (state->wrap) { - NEEDBITS(32); - out -= left; - strm->total_out += out; - state->total += out; - if (out) - strm->adler = state->check = - UPDATE(state->check, put - out, out); - out = left; - if (( -#ifdef GUNZIP - state->flags ? hold : -#endif - REVERSE(hold)) != state->check) { - strm->msg = (char *)"incorrect data check"; - state->mode = BAD; - break; - } - INITBITS(); - Tracev((stderr, "inflate: check matches trailer\n")); - } -#ifdef GUNZIP - state->mode = LENGTH; - case LENGTH: - if (state->wrap && state->flags) { - NEEDBITS(32); - if (hold != (state->total & 0xffffffffUL)) { - strm->msg = (char *)"incorrect length check"; - state->mode = BAD; - break; - } - INITBITS(); - Tracev((stderr, "inflate: length matches trailer\n")); - } -#endif - state->mode = DONE; - case DONE: - ret = Z_STREAM_END; - goto inf_leave; - case BAD: - ret = Z_DATA_ERROR; - goto inf_leave; - case MEM: - return Z_MEM_ERROR; - case SYNC: - default: - return Z_STREAM_ERROR; - } - - /* - Return from inflate(), updating the total counts and the check value. - If there was no progress during the inflate() call, return a buffer - error. Call updatewindow() to create and/or update the window state. - Note: a memory error from inflate() is non-recoverable. - */ - inf_leave: - RESTORE(); - if (state->wsize || (state->mode < CHECK && out != strm->avail_out)) - if (updatewindow(strm, out)) { - state->mode = MEM; - return Z_MEM_ERROR; - } - in -= strm->avail_in; - out -= strm->avail_out; - strm->total_in += in; - strm->total_out += out; - state->total += out; - if (state->wrap && out) - strm->adler = state->check = - UPDATE(state->check, strm->next_out - out, out); - strm->data_type = state->bits + (state->last ? 64 : 0) + - (state->mode == TYPE ? 128 : 0); - if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK) - ret = Z_BUF_ERROR; - return ret; -} - -int ZEXPORT inflateEnd(strm) -z_streamp strm; -{ - struct inflate_state FAR *state; - if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0) - return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; - if (state->window != Z_NULL) ZFREE(strm, state->window); - ZFREE(strm, strm->state); - strm->state = Z_NULL; - Tracev((stderr, "inflate: end\n")); - return Z_OK; -} - -int ZEXPORT inflateSetDictionary(strm, dictionary, dictLength) -z_streamp strm; -const Bytef *dictionary; -uInt dictLength; -{ - struct inflate_state FAR *state; - unsigned long id; - - /* check state */ - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; - if (state->wrap != 0 && state->mode != DICT) - return Z_STREAM_ERROR; - - /* check for correct dictionary id */ - if (state->mode == DICT) { - id = adler32(0L, Z_NULL, 0); - id = adler32(id, dictionary, dictLength); - if (id != state->check) - return Z_DATA_ERROR; - } - - /* copy dictionary to window */ - if (updatewindow(strm, strm->avail_out)) { - state->mode = MEM; - return Z_MEM_ERROR; - } - if (dictLength > state->wsize) { - zmemcpy(state->window, dictionary + dictLength - state->wsize, - state->wsize); - state->whave = state->wsize; - } - else { - zmemcpy(state->window + state->wsize - dictLength, dictionary, - dictLength); - state->whave = dictLength; - } - state->havedict = 1; - Tracev((stderr, "inflate: dictionary set\n")); - return Z_OK; -} - -int ZEXPORT inflateGetHeader(strm, head) -z_streamp strm; -gz_headerp head; -{ - struct inflate_state FAR *state; - - /* check state */ - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; - if ((state->wrap & 2) == 0) return Z_STREAM_ERROR; - - /* save header structure */ - state->head = head; - head->done = 0; - return Z_OK; -} - -/* - Search buf[0..len-1] for the pattern: 0, 0, 0xff, 0xff. Return when found - or when out of input. When called, *have is the number of pattern bytes - found in order so far, in 0..3. On return *have is updated to the new - state. If on return *have equals four, then the pattern was found and the - return value is how many bytes were read including the last byte of the - pattern. If *have is less than four, then the pattern has not been found - yet and the return value is len. In the latter case, syncsearch() can be - called again with more data and the *have state. *have is initialized to - zero for the first call. - */ -local unsigned syncsearch(have, buf, len) -unsigned FAR *have; -unsigned char FAR *buf; -unsigned len; -{ - unsigned got; - unsigned next; - - got = *have; - next = 0; - while (next < len && got < 4) { - if ((int)(buf[next]) == (got < 2 ? 0 : 0xff)) - got++; - else if (buf[next]) - got = 0; - else - got = 4 - got; - next++; - } - *have = got; - return next; -} - -int ZEXPORT inflateSync(strm) -z_streamp strm; -{ - unsigned len; /* number of bytes to look at or looked at */ - unsigned long in, out; /* temporary to save total_in and total_out */ - unsigned char buf[4]; /* to restore bit buffer to byte string */ - struct inflate_state FAR *state; - - /* check parameters */ - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; - if (strm->avail_in == 0 && state->bits < 8) return Z_BUF_ERROR; - - /* if first time, start search in bit buffer */ - if (state->mode != SYNC) { - state->mode = SYNC; - state->hold <<= state->bits & 7; - state->bits -= state->bits & 7; - len = 0; - while (state->bits >= 8) { - buf[len++] = (unsigned char)(state->hold); - state->hold >>= 8; - state->bits -= 8; - } - state->have = 0; - syncsearch(&(state->have), buf, len); - } - - /* search available input */ - len = syncsearch(&(state->have), strm->next_in, strm->avail_in); - strm->avail_in -= len; - strm->next_in += len; - strm->total_in += len; - - /* return no joy or set up to restart inflate() on a new block */ - if (state->have != 4) return Z_DATA_ERROR; - in = strm->total_in; out = strm->total_out; - inflateReset(strm); - strm->total_in = in; strm->total_out = out; - state->mode = TYPE; - return Z_OK; -} - -/* - Returns true if inflate is currently at the end of a block generated by - Z_SYNC_FLUSH or Z_FULL_FLUSH. This function is used by one PPP - implementation to provide an additional safety check. PPP uses - Z_SYNC_FLUSH but removes the length bytes of the resulting empty stored - block. When decompressing, PPP checks that at the end of input packet, - inflate is waiting for these length bytes. - */ -int ZEXPORT inflateSyncPoint(strm) -z_streamp strm; -{ - struct inflate_state FAR *state; - - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; - return state->mode == STORED && state->bits == 0; -} - -int ZEXPORT inflateCopy(dest, source) -z_streamp dest; -z_streamp source; -{ - struct inflate_state FAR *state; - struct inflate_state FAR *copy; - unsigned char FAR *window; - unsigned wsize; - - /* check input */ - if (dest == Z_NULL || source == Z_NULL || source->state == Z_NULL || - source->zalloc == (alloc_func)0 || source->zfree == (free_func)0) - return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)source->state; - - /* allocate space */ - copy = (struct inflate_state FAR *) - ZALLOC(source, 1, sizeof(struct inflate_state)); - if (copy == Z_NULL) return Z_MEM_ERROR; - window = Z_NULL; - if (state->window != Z_NULL) { - window = (unsigned char FAR *) - ZALLOC(source, 1U << state->wbits, sizeof(unsigned char)); - if (window == Z_NULL) { - ZFREE(source, copy); - return Z_MEM_ERROR; - } - } - - /* copy state */ - zmemcpy(dest, source, sizeof(z_stream)); - zmemcpy(copy, state, sizeof(struct inflate_state)); - if (state->lencode >= state->codes && - state->lencode <= state->codes + ENOUGH - 1) { - copy->lencode = copy->codes + (state->lencode - state->codes); - copy->distcode = copy->codes + (state->distcode - state->codes); - } - copy->next = copy->codes + (state->next - state->codes); - if (window != Z_NULL) { - wsize = 1U << state->wbits; - zmemcpy(window, state->window, wsize); - } - copy->window = window; - dest->state = (struct internal_state FAR *)copy; - return Z_OK; -} diff --git a/src/zlib/inflate.h b/src/zlib/inflate.h deleted file mode 100644 index fbbc87143..000000000 --- a/src/zlib/inflate.h +++ /dev/null @@ -1,115 +0,0 @@ -/* inflate.h -- internal inflate state definition - * Copyright (C) 1995-2004 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* WARNING: this file should *not* be used by applications. It is - part of the implementation of the compression library and is - subject to change. Applications should only use zlib.h. - */ - -/* define NO_GZIP when compiling if you want to disable gzip header and - trailer decoding by inflate(). NO_GZIP would be used to avoid linking in - the crc code when it is not needed. For shared libraries, gzip decoding - should be left enabled. */ -#ifndef NO_GZIP -# define GUNZIP -#endif - -/* Possible inflate modes between inflate() calls */ -typedef enum { - HEAD, /* i: waiting for magic header */ - FLAGS, /* i: waiting for method and flags (gzip) */ - TIME, /* i: waiting for modification time (gzip) */ - OS, /* i: waiting for extra flags and operating system (gzip) */ - EXLEN, /* i: waiting for extra length (gzip) */ - EXTRA, /* i: waiting for extra bytes (gzip) */ - NAME, /* i: waiting for end of file name (gzip) */ - COMMENT, /* i: waiting for end of comment (gzip) */ - HCRC, /* i: waiting for header crc (gzip) */ - DICTID, /* i: waiting for dictionary check value */ - DICT, /* waiting for inflateSetDictionary() call */ - TYPE, /* i: waiting for type bits, including last-flag bit */ - TYPEDO, /* i: same, but skip check to exit inflate on new block */ - STORED, /* i: waiting for stored size (length and complement) */ - COPY, /* i/o: waiting for input or output to copy stored block */ - TABLE, /* i: waiting for dynamic block table lengths */ - LENLENS, /* i: waiting for code length code lengths */ - CODELENS, /* i: waiting for length/lit and distance code lengths */ - LEN, /* i: waiting for length/lit code */ - LENEXT, /* i: waiting for length extra bits */ - DIST, /* i: waiting for distance code */ - DISTEXT, /* i: waiting for distance extra bits */ - MATCH, /* o: waiting for output space to copy string */ - LIT, /* o: waiting for output space to write literal */ - CHECK, /* i: waiting for 32-bit check value */ - LENGTH, /* i: waiting for 32-bit length (gzip) */ - DONE, /* finished check, done -- remain here until reset */ - BAD, /* got a data error -- remain here until reset */ - MEM, /* got an inflate() memory error -- remain here until reset */ - SYNC /* looking for synchronization bytes to restart inflate() */ -} inflate_mode; - -/* - State transitions between above modes - - - (most modes can go to the BAD or MEM mode -- not shown for clarity) - - Process header: - HEAD -> (gzip) or (zlib) - (gzip) -> FLAGS -> TIME -> OS -> EXLEN -> EXTRA -> NAME - NAME -> COMMENT -> HCRC -> TYPE - (zlib) -> DICTID or TYPE - DICTID -> DICT -> TYPE - Read deflate blocks: - TYPE -> STORED or TABLE or LEN or CHECK - STORED -> COPY -> TYPE - TABLE -> LENLENS -> CODELENS -> LEN - Read deflate codes: - LEN -> LENEXT or LIT or TYPE - LENEXT -> DIST -> DISTEXT -> MATCH -> LEN - LIT -> LEN - Process trailer: - CHECK -> LENGTH -> DONE - */ - -/* state maintained between inflate() calls. Approximately 7K bytes. */ -struct inflate_state { - inflate_mode mode; /* current inflate mode */ - int last; /* true if processing last block */ - int wrap; /* bit 0 true for zlib, bit 1 true for gzip */ - int havedict; /* true if dictionary provided */ - int flags; /* gzip header method and flags (0 if zlib) */ - unsigned dmax; /* zlib header max distance (INFLATE_STRICT) */ - unsigned long check; /* protected copy of check value */ - unsigned long total; /* protected copy of output count */ - gz_headerp head; /* where to save gzip header information */ - /* sliding window */ - unsigned wbits; /* log base 2 of requested window size */ - unsigned wsize; /* window size or zero if not using window */ - unsigned whave; /* valid bytes in the window */ - unsigned write; /* window write index */ - unsigned char FAR *window; /* allocated sliding window, if needed */ - /* bit accumulator */ - unsigned long hold; /* input bit accumulator */ - unsigned bits; /* number of bits in "in" */ - /* for string and stored block copying */ - unsigned length; /* literal or length of data to copy */ - unsigned offset; /* distance back to copy string from */ - /* for table and code decoding */ - unsigned extra; /* extra bits needed */ - /* fixed and dynamic code tables */ - code const FAR *lencode; /* starting table for length/literal codes */ - code const FAR *distcode; /* starting table for distance codes */ - unsigned lenbits; /* index bits for lencode */ - unsigned distbits; /* index bits for distcode */ - /* dynamic table building */ - unsigned ncode; /* number of code length code lengths */ - unsigned nlen; /* number of length code lengths */ - unsigned ndist; /* number of distance code lengths */ - unsigned have; /* number of code lengths in lens[] */ - code FAR *next; /* next available space in codes[] */ - unsigned short lens[320]; /* temporary storage for code lengths */ - unsigned short work[288]; /* work area for code table building */ - code codes[ENOUGH]; /* space for code tables */ -}; diff --git a/src/zlib/inftrees.c b/src/zlib/inftrees.c deleted file mode 100644 index 38ded81c3..000000000 --- a/src/zlib/inftrees.c +++ /dev/null @@ -1,329 +0,0 @@ -/* inftrees.c -- generate Huffman trees for efficient decoding - * Copyright (C) 1995-2005 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -#include "zutil.h" -#include "inftrees.h" - -#define MAXBITS 15 - -const char inflate_copyright[] = - " inflate 1.2.3 Copyright 1995-2005 Mark Adler "; -/* - If you use the zlib library in a product, an acknowledgment is welcome - in the documentation of your product. If for some reason you cannot - include such an acknowledgment, I would appreciate that you keep this - copyright string in the executable of your product. - */ - -/* - Build a set of tables to decode the provided canonical Huffman code. - The code lengths are lens[0..codes-1]. The result starts at *table, - whose indices are 0..2^bits-1. work is a writable array of at least - lens shorts, which is used as a work area. type is the type of code - to be generated, CODES, LENS, or DISTS. On return, zero is success, - -1 is an invalid code, and +1 means that ENOUGH isn't enough. table - on return points to the next available entry's address. bits is the - requested root table index bits, and on return it is the actual root - table index bits. It will differ if the request is greater than the - longest code or if it is less than the shortest code. - */ -int inflate_table(type, lens, codes, table, bits, work) -codetype type; -unsigned short FAR *lens; -unsigned codes; -code FAR * FAR *table; -unsigned FAR *bits; -unsigned short FAR *work; -{ - unsigned len; /* a code's length in bits */ - unsigned sym; /* index of code symbols */ - unsigned min, max; /* minimum and maximum code lengths */ - unsigned root; /* number of index bits for root table */ - unsigned curr; /* number of index bits for current table */ - unsigned drop; /* code bits to drop for sub-table */ - int left; /* number of prefix codes available */ - unsigned used; /* code entries in table used */ - unsigned huff; /* Huffman code */ - unsigned incr; /* for incrementing code, index */ - unsigned fill; /* index for replicating entries */ - unsigned low; /* low bits for current root entry */ - unsigned mask; /* mask for low root bits */ - code this; /* table entry for duplication */ - code FAR *next; /* next available space in table */ - const unsigned short FAR *base; /* base value table to use */ - const unsigned short FAR *extra; /* extra bits table to use */ - int end; /* use base and extra for symbol > end */ - unsigned short count[MAXBITS+1]; /* number of codes of each length */ - unsigned short offs[MAXBITS+1]; /* offsets in table for each length */ - static const unsigned short lbase[31] = { /* Length codes 257..285 base */ - 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, - 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; - static const unsigned short lext[31] = { /* Length codes 257..285 extra */ - 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, - 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 201, 196}; - static const unsigned short dbase[32] = { /* Distance codes 0..29 base */ - 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, - 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, - 8193, 12289, 16385, 24577, 0, 0}; - static const unsigned short dext[32] = { /* Distance codes 0..29 extra */ - 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, - 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, - 28, 28, 29, 29, 64, 64}; - - /* - Process a set of code lengths to create a canonical Huffman code. The - code lengths are lens[0..codes-1]. Each length corresponds to the - symbols 0..codes-1. The Huffman code is generated by first sorting the - symbols by length from short to long, and retaining the symbol order - for codes with equal lengths. Then the code starts with all zero bits - for the first code of the shortest length, and the codes are integer - increments for the same length, and zeros are appended as the length - increases. For the deflate format, these bits are stored backwards - from their more natural integer increment ordering, and so when the - decoding tables are built in the large loop below, the integer codes - are incremented backwards. - - This routine assumes, but does not check, that all of the entries in - lens[] are in the range 0..MAXBITS. The caller must assure this. - 1..MAXBITS is interpreted as that code length. zero means that that - symbol does not occur in this code. - - The codes are sorted by computing a count of codes for each length, - creating from that a table of starting indices for each length in the - sorted table, and then entering the symbols in order in the sorted - table. The sorted table is work[], with that space being provided by - the caller. - - The length counts are used for other purposes as well, i.e. finding - the minimum and maximum length codes, determining if there are any - codes at all, checking for a valid set of lengths, and looking ahead - at length counts to determine sub-table sizes when building the - decoding tables. - */ - - /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */ - for (len = 0; len <= MAXBITS; len++) - count[len] = 0; - for (sym = 0; sym < codes; sym++) - count[lens[sym]]++; - - /* bound code lengths, force root to be within code lengths */ - root = *bits; - for (max = MAXBITS; max >= 1; max--) - if (count[max] != 0) break; - if (root > max) root = max; - if (max == 0) { /* no symbols to code at all */ - this.op = (unsigned char)64; /* invalid code marker */ - this.bits = (unsigned char)1; - this.val = (unsigned short)0; - *(*table)++ = this; /* make a table to force an error */ - *(*table)++ = this; - *bits = 1; - return 0; /* no symbols, but wait for decoding to report error */ - } - for (min = 1; min <= MAXBITS; min++) - if (count[min] != 0) break; - if (root < min) root = min; - - /* check for an over-subscribed or incomplete set of lengths */ - left = 1; - for (len = 1; len <= MAXBITS; len++) { - left <<= 1; - left -= count[len]; - if (left < 0) return -1; /* over-subscribed */ - } - if (left > 0 && (type == CODES || max != 1)) - return -1; /* incomplete set */ - - /* generate offsets into symbol table for each length for sorting */ - offs[1] = 0; - for (len = 1; len < MAXBITS; len++) - offs[len + 1] = offs[len] + count[len]; - - /* sort symbols by length, by symbol order within each length */ - for (sym = 0; sym < codes; sym++) - if (lens[sym] != 0) work[offs[lens[sym]]++] = (unsigned short)sym; - - /* - Create and fill in decoding tables. In this loop, the table being - filled is at next and has curr index bits. The code being used is huff - with length len. That code is converted to an index by dropping drop - bits off of the bottom. For codes where len is less than drop + curr, - those top drop + curr - len bits are incremented through all values to - fill the table with replicated entries. - - root is the number of index bits for the root table. When len exceeds - root, sub-tables are created pointed to by the root entry with an index - of the low root bits of huff. This is saved in low to check for when a - new sub-table should be started. drop is zero when the root table is - being filled, and drop is root when sub-tables are being filled. - - When a new sub-table is needed, it is necessary to look ahead in the - code lengths to determine what size sub-table is needed. The length - counts are used for this, and so count[] is decremented as codes are - entered in the tables. - - used keeps track of how many table entries have been allocated from the - provided *table space. It is checked when a LENS table is being made - against the space in *table, ENOUGH, minus the maximum space needed by - the worst case distance code, MAXD. This should never happen, but the - sufficiency of ENOUGH has not been proven exhaustively, hence the check. - This assumes that when type == LENS, bits == 9. - - sym increments through all symbols, and the loop terminates when - all codes of length max, i.e. all codes, have been processed. This - routine permits incomplete codes, so another loop after this one fills - in the rest of the decoding tables with invalid code markers. - */ - - /* set up for code type */ - switch (type) { - case CODES: - base = extra = work; /* dummy value--not used */ - end = 19; - break; - case LENS: - base = lbase; - base -= 257; - extra = lext; - extra -= 257; - end = 256; - break; - default: /* DISTS */ - base = dbase; - extra = dext; - end = -1; - } - - /* initialize state for loop */ - huff = 0; /* starting code */ - sym = 0; /* starting code symbol */ - len = min; /* starting code length */ - next = *table; /* current table to fill in */ - curr = root; /* current table index bits */ - drop = 0; /* current bits to drop from code for index */ - low = (unsigned)(-1); /* trigger new sub-table when len > root */ - used = 1U << root; /* use root table entries */ - mask = used - 1; /* mask for comparing low */ - - /* check available table space */ - if (type == LENS && used >= ENOUGH - MAXD) - return 1; - - /* process all codes and make table entries */ - for (;;) { - /* create table entry */ - this.bits = (unsigned char)(len - drop); - if ((int)(work[sym]) < end) { - this.op = (unsigned char)0; - this.val = work[sym]; - } - else if ((int)(work[sym]) > end) { - this.op = (unsigned char)(extra[work[sym]]); - this.val = base[work[sym]]; - } - else { - this.op = (unsigned char)(32 + 64); /* end of block */ - this.val = 0; - } - - /* replicate for those indices with low len bits equal to huff */ - incr = 1U << (len - drop); - fill = 1U << curr; - min = fill; /* save offset to next table */ - do { - fill -= incr; - next[(huff >> drop) + fill] = this; - } while (fill != 0); - - /* backwards increment the len-bit code huff */ - incr = 1U << (len - 1); - while (huff & incr) - incr >>= 1; - if (incr != 0) { - huff &= incr - 1; - huff += incr; - } - else - huff = 0; - - /* go to next symbol, update count, len */ - sym++; - if (--(count[len]) == 0) { - if (len == max) break; - len = lens[work[sym]]; - } - - /* create new sub-table if needed */ - if (len > root && (huff & mask) != low) { - /* if first time, transition to sub-tables */ - if (drop == 0) - drop = root; - - /* increment past last table */ - next += min; /* here min is 1 << curr */ - - /* determine length of next table */ - curr = len - drop; - left = (int)(1 << curr); - while (curr + drop < max) { - left -= count[curr + drop]; - if (left <= 0) break; - curr++; - left <<= 1; - } - - /* check for enough space */ - used += 1U << curr; - if (type == LENS && used >= ENOUGH - MAXD) - return 1; - - /* point entry in root table to sub-table */ - low = huff & mask; - (*table)[low].op = (unsigned char)curr; - (*table)[low].bits = (unsigned char)root; - (*table)[low].val = (unsigned short)(next - *table); - } - } - - /* - Fill in rest of table for incomplete codes. This loop is similar to the - loop above in incrementing huff for table indices. It is assumed that - len is equal to curr + drop, so there is no loop needed to increment - through high index bits. When the current sub-table is filled, the loop - drops back to the root table to fill in any remaining entries there. - */ - this.op = (unsigned char)64; /* invalid code marker */ - this.bits = (unsigned char)(len - drop); - this.val = (unsigned short)0; - while (huff != 0) { - /* when done with sub-table, drop back to root table */ - if (drop != 0 && (huff & mask) != low) { - drop = 0; - len = root; - next = *table; - this.bits = (unsigned char)len; - } - - /* put invalid code marker in table */ - next[huff >> drop] = this; - - /* backwards increment the len-bit code huff */ - incr = 1U << (len - 1); - while (huff & incr) - incr >>= 1; - if (incr != 0) { - huff &= incr - 1; - huff += incr; - } - else - huff = 0; - } - - /* set return parameters */ - *table += used; - *bits = root; - return 0; -} diff --git a/src/zlib/inftrees.h b/src/zlib/inftrees.h deleted file mode 100644 index dc0fd567e..000000000 --- a/src/zlib/inftrees.h +++ /dev/null @@ -1,55 +0,0 @@ -/* inftrees.h -- header to use inftrees.c - * Copyright (C) 1995-2005 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* WARNING: this file should *not* be used by applications. It is - part of the implementation of the compression library and is - subject to change. Applications should only use zlib.h. - */ - -/* Structure for decoding tables. Each entry provides either the - information needed to do the operation requested by the code that - indexed that table entry, or it provides a pointer to another - table that indexes more bits of the code. op indicates whether - the entry is a pointer to another table, a literal, a length or - distance, an end-of-block, or an invalid code. For a table - pointer, the low four bits of op is the number of index bits of - that table. For a length or distance, the low four bits of op - is the number of extra bits to get after the code. bits is - the number of bits in this code or part of the code to drop off - of the bit buffer. val is the actual byte to output in the case - of a literal, the base length or distance, or the offset from - the current table to the next table. Each entry is four bytes. */ -typedef struct { - unsigned char op; /* operation, extra bits, table bits */ - unsigned char bits; /* bits in this part of the code */ - unsigned short val; /* offset in table or code value */ -} code; - -/* op values as set by inflate_table(): - 00000000 - literal - 0000tttt - table link, tttt != 0 is the number of table index bits - 0001eeee - length or distance, eeee is the number of extra bits - 01100000 - end of block - 01000000 - invalid code - */ - -/* Maximum size of dynamic tree. The maximum found in a long but non- - exhaustive search was 1444 code structures (852 for length/literals - and 592 for distances, the latter actually the result of an - exhaustive search). The true maximum is not known, but the value - below is more than safe. */ -#define ENOUGH 2048 -#define MAXD 592 - -/* Type of code to build for inftable() */ -typedef enum { - CODES, - LENS, - DISTS -} codetype; - -extern int inflate_table OF((codetype type, unsigned short FAR *lens, - unsigned codes, code FAR * FAR *table, - unsigned FAR *bits, unsigned short FAR *work)); diff --git a/src/zlib/minigzip.c b/src/zlib/minigzip.c deleted file mode 100644 index 0b46d84a4..000000000 --- a/src/zlib/minigzip.c +++ /dev/null @@ -1,322 +0,0 @@ -/* minigzip.c -- simulate gzip using the zlib compression library - * Copyright (C) 1995-2005 Jean-loup Gailly. - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* - * minigzip is a minimal implementation of the gzip utility. This is - * only an example of using zlib and isn't meant to replace the - * full-featured gzip. No attempt is made to deal with file systems - * limiting names to 14 or 8+3 characters, etc... Error checking is - * very limited. So use minigzip only for testing; use gzip for the - * real thing. On MSDOS, use only on file names without extension - * or in pipe mode. - */ - -/* @(#) $Id: minigzip.c 126 2003-11-09 01:53:27Z gabest $ */ - -#include -#include "zlib.h" - -#ifdef STDC -# include -# include -#endif - -#ifdef USE_MMAP -# include -# include -# include -#endif - -#if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(__CYGWIN__) -# include -# include -# define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY) -#else -# define SET_BINARY_MODE(file) -#endif - -#ifdef VMS -# define unlink delete -# define GZ_SUFFIX "-gz" -#endif -#ifdef RISCOS -# define unlink remove -# define GZ_SUFFIX "-gz" -# define fileno(file) file->__file -#endif -#if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os -# include /* for fileno */ -#endif - -#ifndef WIN32 /* unlink already in stdio.h for WIN32 */ - extern int unlink OF((const char *)); -#endif - -#ifndef GZ_SUFFIX -# define GZ_SUFFIX ".gz" -#endif -#define SUFFIX_LEN (sizeof(GZ_SUFFIX)-1) - -#define BUFLEN 16384 -#define MAX_NAME_LEN 1024 - -#ifdef MAXSEG_64K -# define local static - /* Needed for systems with limitation on stack size. */ -#else -# define local -#endif - -char *prog; - -void error OF((const char *msg)); -void gz_compress OF((FILE *in, gzFile out)); -#ifdef USE_MMAP -int gz_compress_mmap OF((FILE *in, gzFile out)); -#endif -void gz_uncompress OF((gzFile in, FILE *out)); -void file_compress OF((char *file, char *mode)); -void file_uncompress OF((char *file)); -int main OF((int argc, char *argv[])); - -/* =========================================================================== - * Display error message and exit - */ -void error(msg) - const char *msg; -{ - fprintf(stderr, "%s: %s\n", prog, msg); - exit(1); -} - -/* =========================================================================== - * Compress input to output then close both files. - */ - -void gz_compress(in, out) - FILE *in; - gzFile out; -{ - local char buf[BUFLEN]; - int len; - int err; - -#ifdef USE_MMAP - /* Try first compressing with mmap. If mmap fails (minigzip used in a - * pipe), use the normal fread loop. - */ - if (gz_compress_mmap(in, out) == Z_OK) return; -#endif - for (;;) { - len = (int)fread(buf, 1, sizeof(buf), in); - if (ferror(in)) { - perror("fread"); - exit(1); - } - if (len == 0) break; - - if (gzwrite(out, buf, (unsigned)len) != len) error(gzerror(out, &err)); - } - fclose(in); - if (gzclose(out) != Z_OK) error("failed gzclose"); -} - -#ifdef USE_MMAP /* MMAP version, Miguel Albrecht */ - -/* Try compressing the input file at once using mmap. Return Z_OK if - * if success, Z_ERRNO otherwise. - */ -int gz_compress_mmap(in, out) - FILE *in; - gzFile out; -{ - int len; - int err; - int ifd = fileno(in); - caddr_t buf; /* mmap'ed buffer for the entire input file */ - off_t buf_len; /* length of the input file */ - struct stat sb; - - /* Determine the size of the file, needed for mmap: */ - if (fstat(ifd, &sb) < 0) return Z_ERRNO; - buf_len = sb.st_size; - if (buf_len <= 0) return Z_ERRNO; - - /* Now do the actual mmap: */ - buf = mmap((caddr_t) 0, buf_len, PROT_READ, MAP_SHARED, ifd, (off_t)0); - if (buf == (caddr_t)(-1)) return Z_ERRNO; - - /* Compress the whole file at once: */ - len = gzwrite(out, (char *)buf, (unsigned)buf_len); - - if (len != (int)buf_len) error(gzerror(out, &err)); - - munmap(buf, buf_len); - fclose(in); - if (gzclose(out) != Z_OK) error("failed gzclose"); - return Z_OK; -} -#endif /* USE_MMAP */ - -/* =========================================================================== - * Uncompress input to output then close both files. - */ -void gz_uncompress(in, out) - gzFile in; - FILE *out; -{ - local char buf[BUFLEN]; - int len; - int err; - - for (;;) { - len = gzread(in, buf, sizeof(buf)); - if (len < 0) error (gzerror(in, &err)); - if (len == 0) break; - - if ((int)fwrite(buf, 1, (unsigned)len, out) != len) { - error("failed fwrite"); - } - } - if (fclose(out)) error("failed fclose"); - - if (gzclose(in) != Z_OK) error("failed gzclose"); -} - - -/* =========================================================================== - * Compress the given file: create a corresponding .gz file and remove the - * original. - */ -void file_compress(file, mode) - char *file; - char *mode; -{ - local char outfile[MAX_NAME_LEN]; - FILE *in; - gzFile out; - - strcpy(outfile, file); - strcat(outfile, GZ_SUFFIX); - - in = fopen(file, "rb"); - if (in == NULL) { - perror(file); - exit(1); - } - out = gzopen(outfile, mode); - if (out == NULL) { - fprintf(stderr, "%s: can't gzopen %s\n", prog, outfile); - exit(1); - } - gz_compress(in, out); - - unlink(file); -} - - -/* =========================================================================== - * Uncompress the given file and remove the original. - */ -void file_uncompress(file) - char *file; -{ - local char buf[MAX_NAME_LEN]; - char *infile, *outfile; - FILE *out; - gzFile in; - uInt len = (uInt)strlen(file); - - strcpy(buf, file); - - if (len > SUFFIX_LEN && strcmp(file+len-SUFFIX_LEN, GZ_SUFFIX) == 0) { - infile = file; - outfile = buf; - outfile[len-3] = '\0'; - } else { - outfile = file; - infile = buf; - strcat(infile, GZ_SUFFIX); - } - in = gzopen(infile, "rb"); - if (in == NULL) { - fprintf(stderr, "%s: can't gzopen %s\n", prog, infile); - exit(1); - } - out = fopen(outfile, "wb"); - if (out == NULL) { - perror(file); - exit(1); - } - - gz_uncompress(in, out); - - unlink(infile); -} - - -/* =========================================================================== - * Usage: minigzip [-d] [-f] [-h] [-r] [-1 to -9] [files...] - * -d : decompress - * -f : compress with Z_FILTERED - * -h : compress with Z_HUFFMAN_ONLY - * -r : compress with Z_RLE - * -1 to -9 : compression level - */ - -int main(argc, argv) - int argc; - char *argv[]; -{ - int uncompr = 0; - gzFile file; - char outmode[20]; - - strcpy(outmode, "wb6 "); - - prog = argv[0]; - argc--, argv++; - - while (argc > 0) { - if (strcmp(*argv, "-d") == 0) - uncompr = 1; - else if (strcmp(*argv, "-f") == 0) - outmode[3] = 'f'; - else if (strcmp(*argv, "-h") == 0) - outmode[3] = 'h'; - else if (strcmp(*argv, "-r") == 0) - outmode[3] = 'R'; - else if ((*argv)[0] == '-' && (*argv)[1] >= '1' && (*argv)[1] <= '9' && - (*argv)[2] == 0) - outmode[2] = (*argv)[1]; - else - break; - argc--, argv++; - } - if (outmode[3] == ' ') - outmode[3] = 0; - if (argc == 0) { - SET_BINARY_MODE(stdin); - SET_BINARY_MODE(stdout); - if (uncompr) { - file = gzdopen(fileno(stdin), "rb"); - if (file == NULL) error("can't gzdopen stdin"); - gz_uncompress(file, stdout); - } else { - file = gzdopen(fileno(stdout), outmode); - if (file == NULL) error("can't gzdopen stdout"); - gz_compress(stdin, file); - } - } else { - do { - if (uncompr) { - file_uncompress(*argv); - } else { - file_compress(*argv, outmode); - } - } while (argv++, --argc); - } - return 0; -} diff --git a/src/zlib/trees.c b/src/zlib/trees.c deleted file mode 100644 index d90394536..000000000 --- a/src/zlib/trees.c +++ /dev/null @@ -1,1219 +0,0 @@ -/* trees.c -- output deflated data using Huffman coding - * Copyright (C) 1995-2005 Jean-loup Gailly - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* - * ALGORITHM - * - * The "deflation" process uses several Huffman trees. The more - * common source values are represented by shorter bit sequences. - * - * Each code tree is stored in a compressed form which is itself - * a Huffman encoding of the lengths of all the code strings (in - * ascending order by source values). The actual code strings are - * reconstructed from the lengths in the inflate process, as described - * in the deflate specification. - * - * REFERENCES - * - * Deutsch, L.P.,"'Deflate' Compressed Data Format Specification". - * Available in ftp.uu.net:/pub/archiving/zip/doc/deflate-1.1.doc - * - * Storer, James A. - * Data Compression: Methods and Theory, pp. 49-50. - * Computer Science Press, 1988. ISBN 0-7167-8156-5. - * - * Sedgewick, R. - * Algorithms, p290. - * Addison-Wesley, 1983. ISBN 0-201-06672-6. - */ - -/* @(#) $Id: trees.c 126 2003-11-09 01:53:27Z gabest $ */ - -/* #define GEN_TREES_H */ - -#include "deflate.h" - -#ifdef DEBUG -# include -#endif - -/* =========================================================================== - * Constants - */ - -#define MAX_BL_BITS 7 -/* Bit length codes must not exceed MAX_BL_BITS bits */ - -#define END_BLOCK 256 -/* end of block literal code */ - -#define REP_3_6 16 -/* repeat previous bit length 3-6 times (2 bits of repeat count) */ - -#define REPZ_3_10 17 -/* repeat a zero length 3-10 times (3 bits of repeat count) */ - -#define REPZ_11_138 18 -/* repeat a zero length 11-138 times (7 bits of repeat count) */ - -local const int extra_lbits[LENGTH_CODES] /* extra bits for each length code */ - = {0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0}; - -local const int extra_dbits[D_CODES] /* extra bits for each distance code */ - = {0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13}; - -local const int extra_blbits[BL_CODES]/* extra bits for each bit length code */ - = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7}; - -local const uch bl_order[BL_CODES] - = {16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15}; -/* The lengths of the bit length codes are sent in order of decreasing - * probability, to avoid transmitting the lengths for unused bit length codes. - */ - -#define Buf_size (8 * 2*sizeof(char)) -/* Number of bits used within bi_buf. (bi_buf might be implemented on - * more than 16 bits on some systems.) - */ - -/* =========================================================================== - * Local data. These are initialized only once. - */ - -#define DIST_CODE_LEN 512 /* see definition of array dist_code below */ - -#if defined(GEN_TREES_H) || !defined(STDC) -/* non ANSI compilers may not accept trees.h */ - -local ct_data static_ltree[L_CODES+2]; -/* The static literal tree. Since the bit lengths are imposed, there is no - * need for the L_CODES extra codes used during heap construction. However - * The codes 286 and 287 are needed to build a canonical tree (see _tr_init - * below). - */ - -local ct_data static_dtree[D_CODES]; -/* The static distance tree. (Actually a trivial tree since all codes use - * 5 bits.) - */ - -uch _dist_code[DIST_CODE_LEN]; -/* Distance codes. The first 256 values correspond to the distances - * 3 .. 258, the last 256 values correspond to the top 8 bits of - * the 15 bit distances. - */ - -uch _length_code[MAX_MATCH-MIN_MATCH+1]; -/* length code for each normalized match length (0 == MIN_MATCH) */ - -local int base_length[LENGTH_CODES]; -/* First normalized length for each code (0 = MIN_MATCH) */ - -local int base_dist[D_CODES]; -/* First normalized distance for each code (0 = distance of 1) */ - -#else -# include "trees.h" -#endif /* GEN_TREES_H */ - -struct static_tree_desc_s { - const ct_data *static_tree; /* static tree or NULL */ - const intf *extra_bits; /* extra bits for each code or NULL */ - int extra_base; /* base index for extra_bits */ - int elems; /* max number of elements in the tree */ - int max_length; /* max bit length for the codes */ -}; - -local static_tree_desc static_l_desc = -{static_ltree, extra_lbits, LITERALS+1, L_CODES, MAX_BITS}; - -local static_tree_desc static_d_desc = -{static_dtree, extra_dbits, 0, D_CODES, MAX_BITS}; - -local static_tree_desc static_bl_desc = -{(const ct_data *)0, extra_blbits, 0, BL_CODES, MAX_BL_BITS}; - -/* =========================================================================== - * Local (static) routines in this file. - */ - -local void tr_static_init OF((void)); -local void init_block OF((deflate_state *s)); -local void pqdownheap OF((deflate_state *s, ct_data *tree, int k)); -local void gen_bitlen OF((deflate_state *s, tree_desc *desc)); -local void gen_codes OF((ct_data *tree, int max_code, ushf *bl_count)); -local void build_tree OF((deflate_state *s, tree_desc *desc)); -local void scan_tree OF((deflate_state *s, ct_data *tree, int max_code)); -local void send_tree OF((deflate_state *s, ct_data *tree, int max_code)); -local int build_bl_tree OF((deflate_state *s)); -local void send_all_trees OF((deflate_state *s, int lcodes, int dcodes, - int blcodes)); -local void compress_block OF((deflate_state *s, ct_data *ltree, - ct_data *dtree)); -local void set_data_type OF((deflate_state *s)); -local unsigned bi_reverse OF((unsigned value, int length)); -local void bi_windup OF((deflate_state *s)); -local void bi_flush OF((deflate_state *s)); -local void copy_block OF((deflate_state *s, charf *buf, unsigned len, - int header)); - -#ifdef GEN_TREES_H -local void gen_trees_header OF((void)); -#endif - -#ifndef DEBUG -# define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len) - /* Send a code of the given tree. c and tree must not have side effects */ - -#else /* DEBUG */ -# define send_code(s, c, tree) \ - { if (z_verbose>2) fprintf(stderr,"\ncd %3d ",(c)); \ - send_bits(s, tree[c].Code, tree[c].Len); } -#endif - -/* =========================================================================== - * Output a short LSB first on the stream. - * IN assertion: there is enough room in pendingBuf. - */ -#define put_short(s, w) { \ - put_byte(s, (uch)((w) & 0xff)); \ - put_byte(s, (uch)((ush)(w) >> 8)); \ -} - -/* =========================================================================== - * Send a value on a given number of bits. - * IN assertion: length <= 16 and value fits in length bits. - */ -#ifdef DEBUG -local void send_bits OF((deflate_state *s, int value, int length)); - -local void send_bits(s, value, length) - deflate_state *s; - int value; /* value to send */ - int length; /* number of bits */ -{ - Tracevv((stderr," l %2d v %4x ", length, value)); - Assert(length > 0 && length <= 15, "invalid length"); - s->bits_sent += (ulg)length; - - /* If not enough room in bi_buf, use (valid) bits from bi_buf and - * (16 - bi_valid) bits from value, leaving (width - (16-bi_valid)) - * unused bits in value. - */ - if (s->bi_valid > (int)Buf_size - length) { - s->bi_buf |= (value << s->bi_valid); - put_short(s, s->bi_buf); - s->bi_buf = (ush)value >> (Buf_size - s->bi_valid); - s->bi_valid += length - Buf_size; - } else { - s->bi_buf |= value << s->bi_valid; - s->bi_valid += length; - } -} -#else /* !DEBUG */ - -#define send_bits(s, value, length) \ -{ int len = length;\ - if (s->bi_valid > (int)Buf_size - len) {\ - int val = value;\ - s->bi_buf |= (val << s->bi_valid);\ - put_short(s, s->bi_buf);\ - s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\ - s->bi_valid += len - Buf_size;\ - } else {\ - s->bi_buf |= (value) << s->bi_valid;\ - s->bi_valid += len;\ - }\ -} -#endif /* DEBUG */ - - -/* the arguments must not have side effects */ - -/* =========================================================================== - * Initialize the various 'constant' tables. - */ -local void tr_static_init() -{ -#if defined(GEN_TREES_H) || !defined(STDC) - static int static_init_done = 0; - int n; /* iterates over tree elements */ - int bits; /* bit counter */ - int length; /* length value */ - int code; /* code value */ - int dist; /* distance index */ - ush bl_count[MAX_BITS+1]; - /* number of codes at each bit length for an optimal tree */ - - if (static_init_done) return; - - /* For some embedded targets, global variables are not initialized: */ - static_l_desc.static_tree = static_ltree; - static_l_desc.extra_bits = extra_lbits; - static_d_desc.static_tree = static_dtree; - static_d_desc.extra_bits = extra_dbits; - static_bl_desc.extra_bits = extra_blbits; - - /* Initialize the mapping length (0..255) -> length code (0..28) */ - length = 0; - for (code = 0; code < LENGTH_CODES-1; code++) { - base_length[code] = length; - for (n = 0; n < (1< dist code (0..29) */ - dist = 0; - for (code = 0 ; code < 16; code++) { - base_dist[code] = dist; - for (n = 0; n < (1<>= 7; /* from now on, all distances are divided by 128 */ - for ( ; code < D_CODES; code++) { - base_dist[code] = dist << 7; - for (n = 0; n < (1<<(extra_dbits[code]-7)); n++) { - _dist_code[256 + dist++] = (uch)code; - } - } - Assert (dist == 256, "tr_static_init: 256+dist != 512"); - - /* Construct the codes of the static literal tree */ - for (bits = 0; bits <= MAX_BITS; bits++) bl_count[bits] = 0; - n = 0; - while (n <= 143) static_ltree[n++].Len = 8, bl_count[8]++; - while (n <= 255) static_ltree[n++].Len = 9, bl_count[9]++; - while (n <= 279) static_ltree[n++].Len = 7, bl_count[7]++; - while (n <= 287) static_ltree[n++].Len = 8, bl_count[8]++; - /* Codes 286 and 287 do not exist, but we must include them in the - * tree construction to get a canonical Huffman tree (longest code - * all ones) - */ - gen_codes((ct_data *)static_ltree, L_CODES+1, bl_count); - - /* The static distance tree is trivial: */ - for (n = 0; n < D_CODES; n++) { - static_dtree[n].Len = 5; - static_dtree[n].Code = bi_reverse((unsigned)n, 5); - } - static_init_done = 1; - -# ifdef GEN_TREES_H - gen_trees_header(); -# endif -#endif /* defined(GEN_TREES_H) || !defined(STDC) */ -} - -/* =========================================================================== - * Genererate the file trees.h describing the static trees. - */ -#ifdef GEN_TREES_H -# ifndef DEBUG -# include -# endif - -# define SEPARATOR(i, last, width) \ - ((i) == (last)? "\n};\n\n" : \ - ((i) % (width) == (width)-1 ? ",\n" : ", ")) - -void gen_trees_header() -{ - FILE *header = fopen("trees.h", "w"); - int i; - - Assert (header != NULL, "Can't open trees.h"); - fprintf(header, - "/* header created automatically with -DGEN_TREES_H */\n\n"); - - fprintf(header, "local const ct_data static_ltree[L_CODES+2] = {\n"); - for (i = 0; i < L_CODES+2; i++) { - fprintf(header, "{{%3u},{%3u}}%s", static_ltree[i].Code, - static_ltree[i].Len, SEPARATOR(i, L_CODES+1, 5)); - } - - fprintf(header, "local const ct_data static_dtree[D_CODES] = {\n"); - for (i = 0; i < D_CODES; i++) { - fprintf(header, "{{%2u},{%2u}}%s", static_dtree[i].Code, - static_dtree[i].Len, SEPARATOR(i, D_CODES-1, 5)); - } - - fprintf(header, "const uch _dist_code[DIST_CODE_LEN] = {\n"); - for (i = 0; i < DIST_CODE_LEN; i++) { - fprintf(header, "%2u%s", _dist_code[i], - SEPARATOR(i, DIST_CODE_LEN-1, 20)); - } - - fprintf(header, "const uch _length_code[MAX_MATCH-MIN_MATCH+1]= {\n"); - for (i = 0; i < MAX_MATCH-MIN_MATCH+1; i++) { - fprintf(header, "%2u%s", _length_code[i], - SEPARATOR(i, MAX_MATCH-MIN_MATCH, 20)); - } - - fprintf(header, "local const int base_length[LENGTH_CODES] = {\n"); - for (i = 0; i < LENGTH_CODES; i++) { - fprintf(header, "%1u%s", base_length[i], - SEPARATOR(i, LENGTH_CODES-1, 20)); - } - - fprintf(header, "local const int base_dist[D_CODES] = {\n"); - for (i = 0; i < D_CODES; i++) { - fprintf(header, "%5u%s", base_dist[i], - SEPARATOR(i, D_CODES-1, 10)); - } - - fclose(header); -} -#endif /* GEN_TREES_H */ - -/* =========================================================================== - * Initialize the tree data structures for a new zlib stream. - */ -void _tr_init(s) - deflate_state *s; -{ - tr_static_init(); - - s->l_desc.dyn_tree = s->dyn_ltree; - s->l_desc.stat_desc = &static_l_desc; - - s->d_desc.dyn_tree = s->dyn_dtree; - s->d_desc.stat_desc = &static_d_desc; - - s->bl_desc.dyn_tree = s->bl_tree; - s->bl_desc.stat_desc = &static_bl_desc; - - s->bi_buf = 0; - s->bi_valid = 0; - s->last_eob_len = 8; /* enough lookahead for inflate */ -#ifdef DEBUG - s->compressed_len = 0L; - s->bits_sent = 0L; -#endif - - /* Initialize the first block of the first file: */ - init_block(s); -} - -/* =========================================================================== - * Initialize a new block. - */ -local void init_block(s) - deflate_state *s; -{ - int n; /* iterates over tree elements */ - - /* Initialize the trees. */ - for (n = 0; n < L_CODES; n++) s->dyn_ltree[n].Freq = 0; - for (n = 0; n < D_CODES; n++) s->dyn_dtree[n].Freq = 0; - for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0; - - s->dyn_ltree[END_BLOCK].Freq = 1; - s->opt_len = s->static_len = 0L; - s->last_lit = s->matches = 0; -} - -#define SMALLEST 1 -/* Index within the heap array of least frequent node in the Huffman tree */ - - -/* =========================================================================== - * Remove the smallest element from the heap and recreate the heap with - * one less element. Updates heap and heap_len. - */ -#define pqremove(s, tree, top) \ -{\ - top = s->heap[SMALLEST]; \ - s->heap[SMALLEST] = s->heap[s->heap_len--]; \ - pqdownheap(s, tree, SMALLEST); \ -} - -/* =========================================================================== - * Compares to subtrees, using the tree depth as tie breaker when - * the subtrees have equal frequency. This minimizes the worst case length. - */ -#define smaller(tree, n, m, depth) \ - (tree[n].Freq < tree[m].Freq || \ - (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m])) - -/* =========================================================================== - * Restore the heap property by moving down the tree starting at node k, - * exchanging a node with the smallest of its two sons if necessary, stopping - * when the heap property is re-established (each father smaller than its - * two sons). - */ -local void pqdownheap(s, tree, k) - deflate_state *s; - ct_data *tree; /* the tree to restore */ - int k; /* node to move down */ -{ - int v = s->heap[k]; - int j = k << 1; /* left son of k */ - while (j <= s->heap_len) { - /* Set j to the smallest of the two sons: */ - if (j < s->heap_len && - smaller(tree, s->heap[j+1], s->heap[j], s->depth)) { - j++; - } - /* Exit if v is smaller than both sons */ - if (smaller(tree, v, s->heap[j], s->depth)) break; - - /* Exchange v with the smallest son */ - s->heap[k] = s->heap[j]; k = j; - - /* And continue down the tree, setting j to the left son of k */ - j <<= 1; - } - s->heap[k] = v; -} - -/* =========================================================================== - * Compute the optimal bit lengths for a tree and update the total bit length - * for the current block. - * IN assertion: the fields freq and dad are set, heap[heap_max] and - * above are the tree nodes sorted by increasing frequency. - * OUT assertions: the field len is set to the optimal bit length, the - * array bl_count contains the frequencies for each bit length. - * The length opt_len is updated; static_len is also updated if stree is - * not null. - */ -local void gen_bitlen(s, desc) - deflate_state *s; - tree_desc *desc; /* the tree descriptor */ -{ - ct_data *tree = desc->dyn_tree; - int max_code = desc->max_code; - const ct_data *stree = desc->stat_desc->static_tree; - const intf *extra = desc->stat_desc->extra_bits; - int base = desc->stat_desc->extra_base; - int max_length = desc->stat_desc->max_length; - int h; /* heap index */ - int n, m; /* iterate over the tree elements */ - int bits; /* bit length */ - int xbits; /* extra bits */ - ush f; /* frequency */ - int overflow = 0; /* number of elements with bit length too large */ - - for (bits = 0; bits <= MAX_BITS; bits++) s->bl_count[bits] = 0; - - /* In a first pass, compute the optimal bit lengths (which may - * overflow in the case of the bit length tree). - */ - tree[s->heap[s->heap_max]].Len = 0; /* root of the heap */ - - for (h = s->heap_max+1; h < HEAP_SIZE; h++) { - n = s->heap[h]; - bits = tree[tree[n].Dad].Len + 1; - if (bits > max_length) bits = max_length, overflow++; - tree[n].Len = (ush)bits; - /* We overwrite tree[n].Dad which is no longer needed */ - - if (n > max_code) continue; /* not a leaf node */ - - s->bl_count[bits]++; - xbits = 0; - if (n >= base) xbits = extra[n-base]; - f = tree[n].Freq; - s->opt_len += (ulg)f * (bits + xbits); - if (stree) s->static_len += (ulg)f * (stree[n].Len + xbits); - } - if (overflow == 0) return; - - Trace((stderr,"\nbit length overflow\n")); - /* This happens for example on obj2 and pic of the Calgary corpus */ - - /* Find the first bit length which could increase: */ - do { - bits = max_length-1; - while (s->bl_count[bits] == 0) bits--; - s->bl_count[bits]--; /* move one leaf down the tree */ - s->bl_count[bits+1] += 2; /* move one overflow item as its brother */ - s->bl_count[max_length]--; - /* The brother of the overflow item also moves one step up, - * but this does not affect bl_count[max_length] - */ - overflow -= 2; - } while (overflow > 0); - - /* Now recompute all bit lengths, scanning in increasing frequency. - * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all - * lengths instead of fixing only the wrong ones. This idea is taken - * from 'ar' written by Haruhiko Okumura.) - */ - for (bits = max_length; bits != 0; bits--) { - n = s->bl_count[bits]; - while (n != 0) { - m = s->heap[--h]; - if (m > max_code) continue; - if ((unsigned) tree[m].Len != (unsigned) bits) { - Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits)); - s->opt_len += ((long)bits - (long)tree[m].Len) - *(long)tree[m].Freq; - tree[m].Len = (ush)bits; - } - n--; - } - } -} - -/* =========================================================================== - * Generate the codes for a given tree and bit counts (which need not be - * optimal). - * IN assertion: the array bl_count contains the bit length statistics for - * the given tree and the field len is set for all tree elements. - * OUT assertion: the field code is set for all tree elements of non - * zero code length. - */ -local void gen_codes (tree, max_code, bl_count) - ct_data *tree; /* the tree to decorate */ - int max_code; /* largest code with non zero frequency */ - ushf *bl_count; /* number of codes at each bit length */ -{ - ush next_code[MAX_BITS+1]; /* next code value for each bit length */ - ush code = 0; /* running code value */ - int bits; /* bit index */ - int n; /* code index */ - - /* The distribution counts are first used to generate the code values - * without bit reversal. - */ - for (bits = 1; bits <= MAX_BITS; bits++) { - next_code[bits] = code = (code + bl_count[bits-1]) << 1; - } - /* Check that the bit counts in bl_count are consistent. The last code - * must be all ones. - */ - Assert (code + bl_count[MAX_BITS]-1 == (1<dyn_tree; - const ct_data *stree = desc->stat_desc->static_tree; - int elems = desc->stat_desc->elems; - int n, m; /* iterate over heap elements */ - int max_code = -1; /* largest code with non zero frequency */ - int node; /* new node being created */ - - /* Construct the initial heap, with least frequent element in - * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1]. - * heap[0] is not used. - */ - s->heap_len = 0, s->heap_max = HEAP_SIZE; - - for (n = 0; n < elems; n++) { - if (tree[n].Freq != 0) { - s->heap[++(s->heap_len)] = max_code = n; - s->depth[n] = 0; - } else { - tree[n].Len = 0; - } - } - - /* The pkzip format requires that at least one distance code exists, - * and that at least one bit should be sent even if there is only one - * possible code. So to avoid special checks later on we force at least - * two codes of non zero frequency. - */ - while (s->heap_len < 2) { - node = s->heap[++(s->heap_len)] = (max_code < 2 ? ++max_code : 0); - tree[node].Freq = 1; - s->depth[node] = 0; - s->opt_len--; if (stree) s->static_len -= stree[node].Len; - /* node is 0 or 1 so it does not have extra bits */ - } - desc->max_code = max_code; - - /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree, - * establish sub-heaps of increasing lengths: - */ - for (n = s->heap_len/2; n >= 1; n--) pqdownheap(s, tree, n); - - /* Construct the Huffman tree by repeatedly combining the least two - * frequent nodes. - */ - node = elems; /* next internal node of the tree */ - do { - pqremove(s, tree, n); /* n = node of least frequency */ - m = s->heap[SMALLEST]; /* m = node of next least frequency */ - - s->heap[--(s->heap_max)] = n; /* keep the nodes sorted by frequency */ - s->heap[--(s->heap_max)] = m; - - /* Create a new node father of n and m */ - tree[node].Freq = tree[n].Freq + tree[m].Freq; - s->depth[node] = (uch)((s->depth[n] >= s->depth[m] ? - s->depth[n] : s->depth[m]) + 1); - tree[n].Dad = tree[m].Dad = (ush)node; -#ifdef DUMP_BL_TREE - if (tree == s->bl_tree) { - fprintf(stderr,"\nnode %d(%d), sons %d(%d) %d(%d)", - node, tree[node].Freq, n, tree[n].Freq, m, tree[m].Freq); - } -#endif - /* and insert the new node in the heap */ - s->heap[SMALLEST] = node++; - pqdownheap(s, tree, SMALLEST); - - } while (s->heap_len >= 2); - - s->heap[--(s->heap_max)] = s->heap[SMALLEST]; - - /* At this point, the fields freq and dad are set. We can now - * generate the bit lengths. - */ - gen_bitlen(s, (tree_desc *)desc); - - /* The field len is now set, we can generate the bit codes */ - gen_codes ((ct_data *)tree, max_code, s->bl_count); -} - -/* =========================================================================== - * Scan a literal or distance tree to determine the frequencies of the codes - * in the bit length tree. - */ -local void scan_tree (s, tree, max_code) - deflate_state *s; - ct_data *tree; /* the tree to be scanned */ - int max_code; /* and its largest code of non zero frequency */ -{ - int n; /* iterates over all tree elements */ - int prevlen = -1; /* last emitted length */ - int curlen; /* length of current code */ - int nextlen = tree[0].Len; /* length of next code */ - int count = 0; /* repeat count of the current code */ - int max_count = 7; /* max repeat count */ - int min_count = 4; /* min repeat count */ - - if (nextlen == 0) max_count = 138, min_count = 3; - tree[max_code+1].Len = (ush)0xffff; /* guard */ - - for (n = 0; n <= max_code; n++) { - curlen = nextlen; nextlen = tree[n+1].Len; - if (++count < max_count && curlen == nextlen) { - continue; - } else if (count < min_count) { - s->bl_tree[curlen].Freq += count; - } else if (curlen != 0) { - if (curlen != prevlen) s->bl_tree[curlen].Freq++; - s->bl_tree[REP_3_6].Freq++; - } else if (count <= 10) { - s->bl_tree[REPZ_3_10].Freq++; - } else { - s->bl_tree[REPZ_11_138].Freq++; - } - count = 0; prevlen = curlen; - if (nextlen == 0) { - max_count = 138, min_count = 3; - } else if (curlen == nextlen) { - max_count = 6, min_count = 3; - } else { - max_count = 7, min_count = 4; - } - } -} - -/* =========================================================================== - * Send a literal or distance tree in compressed form, using the codes in - * bl_tree. - */ -local void send_tree (s, tree, max_code) - deflate_state *s; - ct_data *tree; /* the tree to be scanned */ - int max_code; /* and its largest code of non zero frequency */ -{ - int n; /* iterates over all tree elements */ - int prevlen = -1; /* last emitted length */ - int curlen; /* length of current code */ - int nextlen = tree[0].Len; /* length of next code */ - int count = 0; /* repeat count of the current code */ - int max_count = 7; /* max repeat count */ - int min_count = 4; /* min repeat count */ - - /* tree[max_code+1].Len = -1; */ /* guard already set */ - if (nextlen == 0) max_count = 138, min_count = 3; - - for (n = 0; n <= max_code; n++) { - curlen = nextlen; nextlen = tree[n+1].Len; - if (++count < max_count && curlen == nextlen) { - continue; - } else if (count < min_count) { - do { send_code(s, curlen, s->bl_tree); } while (--count != 0); - - } else if (curlen != 0) { - if (curlen != prevlen) { - send_code(s, curlen, s->bl_tree); count--; - } - Assert(count >= 3 && count <= 6, " 3_6?"); - send_code(s, REP_3_6, s->bl_tree); send_bits(s, count-3, 2); - - } else if (count <= 10) { - send_code(s, REPZ_3_10, s->bl_tree); send_bits(s, count-3, 3); - - } else { - send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, count-11, 7); - } - count = 0; prevlen = curlen; - if (nextlen == 0) { - max_count = 138, min_count = 3; - } else if (curlen == nextlen) { - max_count = 6, min_count = 3; - } else { - max_count = 7, min_count = 4; - } - } -} - -/* =========================================================================== - * Construct the Huffman tree for the bit lengths and return the index in - * bl_order of the last bit length code to send. - */ -local int build_bl_tree(s) - deflate_state *s; -{ - int max_blindex; /* index of last bit length code of non zero freq */ - - /* Determine the bit length frequencies for literal and distance trees */ - scan_tree(s, (ct_data *)s->dyn_ltree, s->l_desc.max_code); - scan_tree(s, (ct_data *)s->dyn_dtree, s->d_desc.max_code); - - /* Build the bit length tree: */ - build_tree(s, (tree_desc *)(&(s->bl_desc))); - /* opt_len now includes the length of the tree representations, except - * the lengths of the bit lengths codes and the 5+5+4 bits for the counts. - */ - - /* Determine the number of bit length codes to send. The pkzip format - * requires that at least 4 bit length codes be sent. (appnote.txt says - * 3 but the actual value used is 4.) - */ - for (max_blindex = BL_CODES-1; max_blindex >= 3; max_blindex--) { - if (s->bl_tree[bl_order[max_blindex]].Len != 0) break; - } - /* Update opt_len to include the bit length tree and counts */ - s->opt_len += 3*(max_blindex+1) + 5+5+4; - Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld", - s->opt_len, s->static_len)); - - return max_blindex; -} - -/* =========================================================================== - * Send the header for a block using dynamic Huffman trees: the counts, the - * lengths of the bit length codes, the literal tree and the distance tree. - * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4. - */ -local void send_all_trees(s, lcodes, dcodes, blcodes) - deflate_state *s; - int lcodes, dcodes, blcodes; /* number of codes for each tree */ -{ - int rank; /* index in bl_order */ - - Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes"); - Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES, - "too many codes"); - Tracev((stderr, "\nbl counts: ")); - send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */ - send_bits(s, dcodes-1, 5); - send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */ - for (rank = 0; rank < blcodes; rank++) { - Tracev((stderr, "\nbl code %2d ", bl_order[rank])); - send_bits(s, s->bl_tree[bl_order[rank]].Len, 3); - } - Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent)); - - send_tree(s, (ct_data *)s->dyn_ltree, lcodes-1); /* literal tree */ - Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent)); - - send_tree(s, (ct_data *)s->dyn_dtree, dcodes-1); /* distance tree */ - Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent)); -} - -/* =========================================================================== - * Send a stored block - */ -void _tr_stored_block(s, buf, stored_len, eof) - deflate_state *s; - charf *buf; /* input block */ - ulg stored_len; /* length of input block */ - int eof; /* true if this is the last block for a file */ -{ - send_bits(s, (STORED_BLOCK<<1)+eof, 3); /* send block type */ -#ifdef DEBUG - s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L; - s->compressed_len += (stored_len + 4) << 3; -#endif - copy_block(s, buf, (unsigned)stored_len, 1); /* with header */ -} - -/* =========================================================================== - * Send one empty static block to give enough lookahead for inflate. - * This takes 10 bits, of which 7 may remain in the bit buffer. - * The current inflate code requires 9 bits of lookahead. If the - * last two codes for the previous block (real code plus EOB) were coded - * on 5 bits or less, inflate may have only 5+3 bits of lookahead to decode - * the last real code. In this case we send two empty static blocks instead - * of one. (There are no problems if the previous block is stored or fixed.) - * To simplify the code, we assume the worst case of last real code encoded - * on one bit only. - */ -void _tr_align(s) - deflate_state *s; -{ - send_bits(s, STATIC_TREES<<1, 3); - send_code(s, END_BLOCK, static_ltree); -#ifdef DEBUG - s->compressed_len += 10L; /* 3 for block type, 7 for EOB */ -#endif - bi_flush(s); - /* Of the 10 bits for the empty block, we have already sent - * (10 - bi_valid) bits. The lookahead for the last real code (before - * the EOB of the previous block) was thus at least one plus the length - * of the EOB plus what we have just sent of the empty static block. - */ - if (1 + s->last_eob_len + 10 - s->bi_valid < 9) { - send_bits(s, STATIC_TREES<<1, 3); - send_code(s, END_BLOCK, static_ltree); -#ifdef DEBUG - s->compressed_len += 10L; -#endif - bi_flush(s); - } - s->last_eob_len = 7; -} - -/* =========================================================================== - * Determine the best encoding for the current block: dynamic trees, static - * trees or store, and output the encoded block to the zip file. - */ -void _tr_flush_block(s, buf, stored_len, eof) - deflate_state *s; - charf *buf; /* input block, or NULL if too old */ - ulg stored_len; /* length of input block */ - int eof; /* true if this is the last block for a file */ -{ - ulg opt_lenb, static_lenb; /* opt_len and static_len in bytes */ - int max_blindex = 0; /* index of last bit length code of non zero freq */ - - /* Build the Huffman trees unless a stored block is forced */ - if (s->level > 0) { - - /* Check if the file is binary or text */ - if (stored_len > 0 && s->strm->data_type == Z_UNKNOWN) - set_data_type(s); - - /* Construct the literal and distance trees */ - build_tree(s, (tree_desc *)(&(s->l_desc))); - Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len, - s->static_len)); - - build_tree(s, (tree_desc *)(&(s->d_desc))); - Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len, - s->static_len)); - /* At this point, opt_len and static_len are the total bit lengths of - * the compressed block data, excluding the tree representations. - */ - - /* Build the bit length tree for the above two trees, and get the index - * in bl_order of the last bit length code to send. - */ - max_blindex = build_bl_tree(s); - - /* Determine the best encoding. Compute the block lengths in bytes. */ - opt_lenb = (s->opt_len+3+7)>>3; - static_lenb = (s->static_len+3+7)>>3; - - Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ", - opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len, - s->last_lit)); - - if (static_lenb <= opt_lenb) opt_lenb = static_lenb; - - } else { - Assert(buf != (char*)0, "lost buf"); - opt_lenb = static_lenb = stored_len + 5; /* force a stored block */ - } - -#ifdef FORCE_STORED - if (buf != (char*)0) { /* force stored block */ -#else - if (stored_len+4 <= opt_lenb && buf != (char*)0) { - /* 4: two words for the lengths */ -#endif - /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE. - * Otherwise we can't have processed more than WSIZE input bytes since - * the last block flush, because compression would have been - * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to - * transform a block into a stored block. - */ - _tr_stored_block(s, buf, stored_len, eof); - -#ifdef FORCE_STATIC - } else if (static_lenb >= 0) { /* force static trees */ -#else - } else if (s->strategy == Z_FIXED || static_lenb == opt_lenb) { -#endif - send_bits(s, (STATIC_TREES<<1)+eof, 3); - compress_block(s, (ct_data *)static_ltree, (ct_data *)static_dtree); -#ifdef DEBUG - s->compressed_len += 3 + s->static_len; -#endif - } else { - send_bits(s, (DYN_TREES<<1)+eof, 3); - send_all_trees(s, s->l_desc.max_code+1, s->d_desc.max_code+1, - max_blindex+1); - compress_block(s, (ct_data *)s->dyn_ltree, (ct_data *)s->dyn_dtree); -#ifdef DEBUG - s->compressed_len += 3 + s->opt_len; -#endif - } - Assert (s->compressed_len == s->bits_sent, "bad compressed size"); - /* The above check is made mod 2^32, for files larger than 512 MB - * and uLong implemented on 32 bits. - */ - init_block(s); - - if (eof) { - bi_windup(s); -#ifdef DEBUG - s->compressed_len += 7; /* align on byte boundary */ -#endif - } - Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3, - s->compressed_len-7*eof)); -} - -/* =========================================================================== - * Save the match info and tally the frequency counts. Return true if - * the current block must be flushed. - */ -int _tr_tally (s, dist, lc) - deflate_state *s; - unsigned dist; /* distance of matched string */ - unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */ -{ - s->d_buf[s->last_lit] = (ush)dist; - s->l_buf[s->last_lit++] = (uch)lc; - if (dist == 0) { - /* lc is the unmatched char */ - s->dyn_ltree[lc].Freq++; - } else { - s->matches++; - /* Here, lc is the match length - MIN_MATCH */ - dist--; /* dist = match distance - 1 */ - Assert((ush)dist < (ush)MAX_DIST(s) && - (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) && - (ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match"); - - s->dyn_ltree[_length_code[lc]+LITERALS+1].Freq++; - s->dyn_dtree[d_code(dist)].Freq++; - } - -#ifdef TRUNCATE_BLOCK - /* Try to guess if it is profitable to stop the current block here */ - if ((s->last_lit & 0x1fff) == 0 && s->level > 2) { - /* Compute an upper bound for the compressed length */ - ulg out_length = (ulg)s->last_lit*8L; - ulg in_length = (ulg)((long)s->strstart - s->block_start); - int dcode; - for (dcode = 0; dcode < D_CODES; dcode++) { - out_length += (ulg)s->dyn_dtree[dcode].Freq * - (5L+extra_dbits[dcode]); - } - out_length >>= 3; - Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ", - s->last_lit, in_length, out_length, - 100L - out_length*100L/in_length)); - if (s->matches < s->last_lit/2 && out_length < in_length/2) return 1; - } -#endif - return (s->last_lit == s->lit_bufsize-1); - /* We avoid equality with lit_bufsize because of wraparound at 64K - * on 16 bit machines and because stored blocks are restricted to - * 64K-1 bytes. - */ -} - -/* =========================================================================== - * Send the block data compressed using the given Huffman trees - */ -local void compress_block(s, ltree, dtree) - deflate_state *s; - ct_data *ltree; /* literal tree */ - ct_data *dtree; /* distance tree */ -{ - unsigned dist; /* distance of matched string */ - int lc; /* match length or unmatched char (if dist == 0) */ - unsigned lx = 0; /* running index in l_buf */ - unsigned code; /* the code to send */ - int extra; /* number of extra bits to send */ - - if (s->last_lit != 0) do { - dist = s->d_buf[lx]; - lc = s->l_buf[lx++]; - if (dist == 0) { - send_code(s, lc, ltree); /* send a literal byte */ - Tracecv(isgraph(lc), (stderr," '%c' ", lc)); - } else { - /* Here, lc is the match length - MIN_MATCH */ - code = _length_code[lc]; - send_code(s, code+LITERALS+1, ltree); /* send the length code */ - extra = extra_lbits[code]; - if (extra != 0) { - lc -= base_length[code]; - send_bits(s, lc, extra); /* send the extra length bits */ - } - dist--; /* dist is now the match distance - 1 */ - code = d_code(dist); - Assert (code < D_CODES, "bad d_code"); - - send_code(s, code, dtree); /* send the distance code */ - extra = extra_dbits[code]; - if (extra != 0) { - dist -= base_dist[code]; - send_bits(s, dist, extra); /* send the extra distance bits */ - } - } /* literal or match pair ? */ - - /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */ - Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx, - "pendingBuf overflow"); - - } while (lx < s->last_lit); - - send_code(s, END_BLOCK, ltree); - s->last_eob_len = ltree[END_BLOCK].Len; -} - -/* =========================================================================== - * Set the data type to BINARY or TEXT, using a crude approximation: - * set it to Z_TEXT if all symbols are either printable characters (33 to 255) - * or white spaces (9 to 13, or 32); or set it to Z_BINARY otherwise. - * IN assertion: the fields Freq of dyn_ltree are set. - */ -local void set_data_type(s) - deflate_state *s; -{ - int n; - - for (n = 0; n < 9; n++) - if (s->dyn_ltree[n].Freq != 0) - break; - if (n == 9) - for (n = 14; n < 32; n++) - if (s->dyn_ltree[n].Freq != 0) - break; - s->strm->data_type = (n == 32) ? Z_TEXT : Z_BINARY; -} - -/* =========================================================================== - * Reverse the first len bits of a code, using straightforward code (a faster - * method would use a table) - * IN assertion: 1 <= len <= 15 - */ -local unsigned bi_reverse(code, len) - unsigned code; /* the value to invert */ - int len; /* its bit length */ -{ - register unsigned res = 0; - do { - res |= code & 1; - code >>= 1, res <<= 1; - } while (--len > 0); - return res >> 1; -} - -/* =========================================================================== - * Flush the bit buffer, keeping at most 7 bits in it. - */ -local void bi_flush(s) - deflate_state *s; -{ - if (s->bi_valid == 16) { - put_short(s, s->bi_buf); - s->bi_buf = 0; - s->bi_valid = 0; - } else if (s->bi_valid >= 8) { - put_byte(s, (Byte)s->bi_buf); - s->bi_buf >>= 8; - s->bi_valid -= 8; - } -} - -/* =========================================================================== - * Flush the bit buffer and align the output on a byte boundary - */ -local void bi_windup(s) - deflate_state *s; -{ - if (s->bi_valid > 8) { - put_short(s, s->bi_buf); - } else if (s->bi_valid > 0) { - put_byte(s, (Byte)s->bi_buf); - } - s->bi_buf = 0; - s->bi_valid = 0; -#ifdef DEBUG - s->bits_sent = (s->bits_sent+7) & ~7; -#endif -} - -/* =========================================================================== - * Copy a stored block, storing first the length and its - * one's complement if requested. - */ -local void copy_block(s, buf, len, header) - deflate_state *s; - charf *buf; /* the input data */ - unsigned len; /* its length */ - int header; /* true if block header must be written */ -{ - bi_windup(s); /* align on byte boundary */ - s->last_eob_len = 8; /* enough lookahead for inflate */ - - if (header) { - put_short(s, (ush)len); - put_short(s, (ush)~len); -#ifdef DEBUG - s->bits_sent += 2*16; -#endif - } -#ifdef DEBUG - s->bits_sent += (ulg)len<<3; -#endif - while (len--) { - put_byte(s, *buf++); - } -} diff --git a/src/zlib/trees.h b/src/zlib/trees.h deleted file mode 100644 index 1ca868b84..000000000 --- a/src/zlib/trees.h +++ /dev/null @@ -1,128 +0,0 @@ -/* header created automatically with -DGEN_TREES_H */ - -local const ct_data static_ltree[L_CODES+2] = { -{{ 12},{ 8}}, {{140},{ 8}}, {{ 76},{ 8}}, {{204},{ 8}}, {{ 44},{ 8}}, -{{172},{ 8}}, {{108},{ 8}}, {{236},{ 8}}, {{ 28},{ 8}}, {{156},{ 8}}, -{{ 92},{ 8}}, {{220},{ 8}}, {{ 60},{ 8}}, {{188},{ 8}}, {{124},{ 8}}, -{{252},{ 8}}, {{ 2},{ 8}}, {{130},{ 8}}, {{ 66},{ 8}}, {{194},{ 8}}, -{{ 34},{ 8}}, {{162},{ 8}}, {{ 98},{ 8}}, {{226},{ 8}}, {{ 18},{ 8}}, -{{146},{ 8}}, {{ 82},{ 8}}, {{210},{ 8}}, {{ 50},{ 8}}, {{178},{ 8}}, -{{114},{ 8}}, {{242},{ 8}}, {{ 10},{ 8}}, {{138},{ 8}}, {{ 74},{ 8}}, -{{202},{ 8}}, {{ 42},{ 8}}, {{170},{ 8}}, {{106},{ 8}}, {{234},{ 8}}, -{{ 26},{ 8}}, {{154},{ 8}}, {{ 90},{ 8}}, {{218},{ 8}}, {{ 58},{ 8}}, -{{186},{ 8}}, {{122},{ 8}}, {{250},{ 8}}, {{ 6},{ 8}}, {{134},{ 8}}, -{{ 70},{ 8}}, {{198},{ 8}}, {{ 38},{ 8}}, {{166},{ 8}}, {{102},{ 8}}, -{{230},{ 8}}, {{ 22},{ 8}}, {{150},{ 8}}, {{ 86},{ 8}}, {{214},{ 8}}, -{{ 54},{ 8}}, {{182},{ 8}}, {{118},{ 8}}, {{246},{ 8}}, {{ 14},{ 8}}, -{{142},{ 8}}, {{ 78},{ 8}}, {{206},{ 8}}, {{ 46},{ 8}}, {{174},{ 8}}, -{{110},{ 8}}, {{238},{ 8}}, {{ 30},{ 8}}, {{158},{ 8}}, {{ 94},{ 8}}, -{{222},{ 8}}, {{ 62},{ 8}}, {{190},{ 8}}, {{126},{ 8}}, {{254},{ 8}}, -{{ 1},{ 8}}, {{129},{ 8}}, {{ 65},{ 8}}, {{193},{ 8}}, {{ 33},{ 8}}, -{{161},{ 8}}, {{ 97},{ 8}}, {{225},{ 8}}, {{ 17},{ 8}}, {{145},{ 8}}, -{{ 81},{ 8}}, {{209},{ 8}}, {{ 49},{ 8}}, {{177},{ 8}}, {{113},{ 8}}, -{{241},{ 8}}, {{ 9},{ 8}}, {{137},{ 8}}, {{ 73},{ 8}}, {{201},{ 8}}, -{{ 41},{ 8}}, {{169},{ 8}}, {{105},{ 8}}, {{233},{ 8}}, {{ 25},{ 8}}, -{{153},{ 8}}, {{ 89},{ 8}}, {{217},{ 8}}, {{ 57},{ 8}}, {{185},{ 8}}, -{{121},{ 8}}, {{249},{ 8}}, {{ 5},{ 8}}, {{133},{ 8}}, {{ 69},{ 8}}, -{{197},{ 8}}, {{ 37},{ 8}}, {{165},{ 8}}, {{101},{ 8}}, {{229},{ 8}}, -{{ 21},{ 8}}, {{149},{ 8}}, {{ 85},{ 8}}, {{213},{ 8}}, {{ 53},{ 8}}, -{{181},{ 8}}, {{117},{ 8}}, {{245},{ 8}}, {{ 13},{ 8}}, {{141},{ 8}}, -{{ 77},{ 8}}, {{205},{ 8}}, {{ 45},{ 8}}, {{173},{ 8}}, {{109},{ 8}}, -{{237},{ 8}}, {{ 29},{ 8}}, {{157},{ 8}}, {{ 93},{ 8}}, {{221},{ 8}}, -{{ 61},{ 8}}, {{189},{ 8}}, {{125},{ 8}}, {{253},{ 8}}, {{ 19},{ 9}}, -{{275},{ 9}}, {{147},{ 9}}, {{403},{ 9}}, {{ 83},{ 9}}, {{339},{ 9}}, -{{211},{ 9}}, {{467},{ 9}}, {{ 51},{ 9}}, {{307},{ 9}}, {{179},{ 9}}, -{{435},{ 9}}, {{115},{ 9}}, {{371},{ 9}}, {{243},{ 9}}, {{499},{ 9}}, -{{ 11},{ 9}}, {{267},{ 9}}, {{139},{ 9}}, {{395},{ 9}}, {{ 75},{ 9}}, -{{331},{ 9}}, {{203},{ 9}}, {{459},{ 9}}, {{ 43},{ 9}}, {{299},{ 9}}, -{{171},{ 9}}, {{427},{ 9}}, {{107},{ 9}}, {{363},{ 9}}, {{235},{ 9}}, -{{491},{ 9}}, {{ 27},{ 9}}, {{283},{ 9}}, {{155},{ 9}}, {{411},{ 9}}, -{{ 91},{ 9}}, {{347},{ 9}}, {{219},{ 9}}, {{475},{ 9}}, {{ 59},{ 9}}, -{{315},{ 9}}, {{187},{ 9}}, {{443},{ 9}}, {{123},{ 9}}, {{379},{ 9}}, -{{251},{ 9}}, {{507},{ 9}}, {{ 7},{ 9}}, {{263},{ 9}}, {{135},{ 9}}, -{{391},{ 9}}, {{ 71},{ 9}}, {{327},{ 9}}, {{199},{ 9}}, {{455},{ 9}}, -{{ 39},{ 9}}, {{295},{ 9}}, {{167},{ 9}}, {{423},{ 9}}, {{103},{ 9}}, -{{359},{ 9}}, {{231},{ 9}}, {{487},{ 9}}, {{ 23},{ 9}}, {{279},{ 9}}, -{{151},{ 9}}, {{407},{ 9}}, {{ 87},{ 9}}, {{343},{ 9}}, {{215},{ 9}}, -{{471},{ 9}}, {{ 55},{ 9}}, {{311},{ 9}}, {{183},{ 9}}, {{439},{ 9}}, -{{119},{ 9}}, {{375},{ 9}}, {{247},{ 9}}, {{503},{ 9}}, {{ 15},{ 9}}, -{{271},{ 9}}, {{143},{ 9}}, {{399},{ 9}}, {{ 79},{ 9}}, {{335},{ 9}}, -{{207},{ 9}}, {{463},{ 9}}, {{ 47},{ 9}}, {{303},{ 9}}, {{175},{ 9}}, -{{431},{ 9}}, {{111},{ 9}}, {{367},{ 9}}, {{239},{ 9}}, {{495},{ 9}}, -{{ 31},{ 9}}, {{287},{ 9}}, {{159},{ 9}}, {{415},{ 9}}, {{ 95},{ 9}}, -{{351},{ 9}}, {{223},{ 9}}, {{479},{ 9}}, {{ 63},{ 9}}, {{319},{ 9}}, -{{191},{ 9}}, {{447},{ 9}}, {{127},{ 9}}, {{383},{ 9}}, {{255},{ 9}}, -{{511},{ 9}}, {{ 0},{ 7}}, {{ 64},{ 7}}, {{ 32},{ 7}}, {{ 96},{ 7}}, -{{ 16},{ 7}}, {{ 80},{ 7}}, {{ 48},{ 7}}, {{112},{ 7}}, {{ 8},{ 7}}, -{{ 72},{ 7}}, {{ 40},{ 7}}, {{104},{ 7}}, {{ 24},{ 7}}, {{ 88},{ 7}}, -{{ 56},{ 7}}, {{120},{ 7}}, {{ 4},{ 7}}, {{ 68},{ 7}}, {{ 36},{ 7}}, -{{100},{ 7}}, {{ 20},{ 7}}, {{ 84},{ 7}}, {{ 52},{ 7}}, {{116},{ 7}}, -{{ 3},{ 8}}, {{131},{ 8}}, {{ 67},{ 8}}, {{195},{ 8}}, {{ 35},{ 8}}, -{{163},{ 8}}, {{ 99},{ 8}}, {{227},{ 8}} -}; - -local const ct_data static_dtree[D_CODES] = { -{{ 0},{ 5}}, {{16},{ 5}}, {{ 8},{ 5}}, {{24},{ 5}}, {{ 4},{ 5}}, -{{20},{ 5}}, {{12},{ 5}}, {{28},{ 5}}, {{ 2},{ 5}}, {{18},{ 5}}, -{{10},{ 5}}, {{26},{ 5}}, {{ 6},{ 5}}, {{22},{ 5}}, {{14},{ 5}}, -{{30},{ 5}}, {{ 1},{ 5}}, {{17},{ 5}}, {{ 9},{ 5}}, {{25},{ 5}}, -{{ 5},{ 5}}, {{21},{ 5}}, {{13},{ 5}}, {{29},{ 5}}, {{ 3},{ 5}}, -{{19},{ 5}}, {{11},{ 5}}, {{27},{ 5}}, {{ 7},{ 5}}, {{23},{ 5}} -}; - -const uch _dist_code[DIST_CODE_LEN] = { - 0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, - 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, -10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, -11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, -12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, -13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, -13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, -14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, -14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, -14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, -15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, -15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, -15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 16, 17, -18, 18, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, -23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, -26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, -26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, -27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, -27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, -29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, -29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, -29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29 -}; - -const uch _length_code[MAX_MATCH-MIN_MATCH+1]= { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, -13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, -17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, -19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, -21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, -22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, -23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, -25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, -26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, -26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, -27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28 -}; - -local const int base_length[LENGTH_CODES] = { -0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56, -64, 80, 96, 112, 128, 160, 192, 224, 0 -}; - -local const int base_dist[D_CODES] = { - 0, 1, 2, 3, 4, 6, 8, 12, 16, 24, - 32, 48, 64, 96, 128, 192, 256, 384, 512, 768, - 1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384, 24576 -}; - diff --git a/src/zlib/uncompr.c b/src/zlib/uncompr.c deleted file mode 100644 index c0839164c..000000000 --- a/src/zlib/uncompr.c +++ /dev/null @@ -1,61 +0,0 @@ -/* uncompr.c -- decompress a memory buffer - * Copyright (C) 1995-2003 Jean-loup Gailly. - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* @(#) $Id: uncompr.c 126 2003-11-09 01:53:27Z gabest $ */ - -#define ZLIB_INTERNAL -#include "zlib.h" - -/* =========================================================================== - Decompresses the source buffer into the destination buffer. sourceLen is - the byte length of the source buffer. Upon entry, destLen is the total - size of the destination buffer, which must be large enough to hold the - entire uncompressed data. (The size of the uncompressed data must have - been saved previously by the compressor and transmitted to the decompressor - by some mechanism outside the scope of this compression library.) - Upon exit, destLen is the actual size of the compressed buffer. - This function can be used to decompress a whole file at once if the - input file is mmap'ed. - - uncompress returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_BUF_ERROR if there was not enough room in the output - buffer, or Z_DATA_ERROR if the input data was corrupted. -*/ -int ZEXPORT uncompress (dest, destLen, source, sourceLen) - Bytef *dest; - uLongf *destLen; - const Bytef *source; - uLong sourceLen; -{ - z_stream stream; - int err; - - stream.next_in = (Bytef*)source; - stream.avail_in = (uInt)sourceLen; - /* Check for source > 64K on 16-bit machine: */ - if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR; - - stream.next_out = dest; - stream.avail_out = (uInt)*destLen; - if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR; - - stream.zalloc = (alloc_func)0; - stream.zfree = (free_func)0; - - err = inflateInit(&stream); - if (err != Z_OK) return err; - - err = inflate(&stream, Z_FINISH); - if (err != Z_STREAM_END) { - inflateEnd(&stream); - if (err == Z_NEED_DICT || (err == Z_BUF_ERROR && stream.avail_in == 0)) - return Z_DATA_ERROR; - return err; - } - *destLen = stream.total_out; - - err = inflateEnd(&stream); - return err; -} diff --git a/src/zlib/zconf.h b/src/zlib/zconf.h deleted file mode 100644 index 4e25dfe6e..000000000 --- a/src/zlib/zconf.h +++ /dev/null @@ -1,333 +0,0 @@ -/* zconf.h -- configuration of the zlib compression library - * Copyright (C) 1995-2005 Jean-loup Gailly. - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* @(#) $Id: zconf.h 147 2004-01-04 23:55:18Z gabest $ */ - -#ifndef ZCONF_H -#define ZCONF_H - - -/* - * If you *really* need a unique prefix for all types and library functions, - * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. - */ -#ifdef Z_PREFIX -# define deflateInit_ z_deflateInit_ -# define deflate z_deflate -# define deflateEnd z_deflateEnd -# define inflateInit_ z_inflateInit_ -# define inflate z_inflate -# define inflateEnd z_inflateEnd -# define deflateInit2_ z_deflateInit2_ -# define deflateSetDictionary z_deflateSetDictionary -# define deflateCopy z_deflateCopy -# define deflateReset z_deflateReset -# define deflateParams z_deflateParams -# define deflateBound z_deflateBound -# define deflatePrime z_deflatePrime -# define inflateInit2_ z_inflateInit2_ -# define inflateSetDictionary z_inflateSetDictionary -# define inflateSync z_inflateSync -# define inflateSyncPoint z_inflateSyncPoint -# define inflateCopy z_inflateCopy -# define inflateReset z_inflateReset -# define inflateBack z_inflateBack -# define inflateBackEnd z_inflateBackEnd -# define compress z_compress -# define compress2 z_compress2 -# define compressBound z_compressBound -# define uncompress z_uncompress -# define adler32 z_adler32 -# define crc32 z_crc32 -# define get_crc_table z_get_crc_table -# define zError z_zError - -# define alloc_func z_alloc_func -# define free_func z_free_func -# define in_func z_in_func -# define out_func z_out_func -# define Byte z_Byte -# define uInt z_uInt -# define uLong z_uLong -# define Bytef z_Bytef -# define charf z_charf -# define intf z_intf -# define uIntf z_uIntf -# define uLongf z_uLongf -# define voidpf z_voidpf -# define voidp z_voidp -#endif - -#if defined(__MSDOS__) && !defined(MSDOS) -# define MSDOS -#endif -#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) -# define OS2 -#endif -#if defined(_WINDOWS) && !defined(WINDOWS) -# define WINDOWS -#endif -#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) -# ifndef WIN32 -# define WIN32 -# endif -#endif -#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) -# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) -# ifndef SYS16BIT -# define SYS16BIT -# endif -# endif -#endif - -/* - * Compile with -DMAXSEG_64K if the alloc function cannot allocate more - * than 64k bytes at a time (needed on systems with 16-bit int). - */ -#ifdef SYS16BIT -# define MAXSEG_64K -#endif -#ifdef MSDOS -# define UNALIGNED_OK -#endif - -#ifdef __STDC_VERSION__ -# ifndef STDC -# define STDC -# endif -# if __STDC_VERSION__ >= 199901L -# ifndef STDC99 -# define STDC99 -# endif -# endif -#endif -#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) -# define STDC -#endif -#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) -# define STDC -#endif -#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) -# define STDC -#endif -#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) -# define STDC -#endif - -#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ -# define STDC -#endif - -#ifndef STDC -# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ -# define const /* note: need a more gentle solution here */ -# endif -#endif - -/* Some Mac compilers merge all .h files incorrectly: */ -#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__) -# define NO_DUMMY_DECL -#endif - -/* Maximum value for memLevel in deflateInit2 */ -#ifndef MAX_MEM_LEVEL -# ifdef MAXSEG_64K -# define MAX_MEM_LEVEL 8 -# else -# define MAX_MEM_LEVEL 9 -# endif -#endif - -/* Maximum value for windowBits in deflateInit2 and inflateInit2. - * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files - * created by gzip. (Files created by minigzip can still be extracted by - * gzip.) - */ -#ifndef MAX_WBITS -# define MAX_WBITS 15 /* 32K LZ77 window */ -#endif - -/* The memory requirements for deflate are (in bytes): - (1 << (windowBits+2)) + (1 << (memLevel+9)) - that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) - plus a few kilobytes for small objects. For example, if you want to reduce - the default memory requirements from 256K to 128K, compile with - make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" - Of course this will generally degrade compression (there's no free lunch). - - The memory requirements for inflate are (in bytes) 1 << windowBits - that is, 32K for windowBits=15 (default value) plus a few kilobytes - for small objects. -*/ - - /* Type declarations */ - -#ifndef OF /* function prototypes */ -# ifdef STDC -# define OF(args) args -# else -# define OF(args) () -# endif -#endif - -/* The following definitions for FAR are needed only for MSDOS mixed - * model programming (small or medium model with some far allocations). - * This was tested only with MSC; for other MSDOS compilers you may have - * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, - * just define FAR to be empty. - */ -#ifdef SYS16BIT -# if defined(M_I86SM) || defined(M_I86MM) - /* MSC small or medium model */ -# define SMALL_MEDIUM -# ifdef _MSC_VER -# define FAR _far -# else -# define FAR far -# endif -# endif -# if (defined(__SMALL__) || defined(__MEDIUM__)) - /* Turbo C small or medium model */ -# define SMALL_MEDIUM -# ifdef __BORLANDC__ -# define FAR _far -# else -# define FAR far -# endif -# endif -#endif - -#if defined(WINDOWS) || defined(WIN32) - /* If building or using zlib as a DLL, define ZLIB_DLL. - * This is not mandatory, but it offers a little performance increase. - */ -# ifdef ZLIB_DLL -# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) -# ifdef ZLIB_INTERNAL -# define ZEXTERN extern __declspec(dllexport) -# else -# define ZEXTERN extern __declspec(dllimport) -# endif -# endif -# endif /* ZLIB_DLL */ - /* If building or using zlib with the WINAPI/WINAPIV calling convention, - * define ZLIB_WINAPI. - * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. - */ -# ifdef ZLIB_WINAPI -# ifdef FAR -# undef FAR -# endif -# include - /* No need for _export, use ZLIB.DEF instead. */ - /* For complete Windows compatibility, use WINAPI, not __stdcall. */ -# define ZEXPORT WINAPI -# ifdef WIN32 -# define ZEXPORTVA WINAPIV -# else -# define ZEXPORTVA FAR CDECL -# endif -# endif -#endif - -#if defined (__BEOS__) -# ifdef ZLIB_DLL -# ifdef ZLIB_INTERNAL -# define ZEXPORT __declspec(dllexport) -# define ZEXPORTVA __declspec(dllexport) -# else -# define ZEXPORT __declspec(dllimport) -# define ZEXPORTVA __declspec(dllimport) -# endif -# endif -#endif - -#ifndef ZEXTERN -# define ZEXTERN extern -#endif -#ifndef ZEXPORT -# define ZEXPORT -#endif -#ifndef ZEXPORTVA -# define ZEXPORTVA -#endif - -#ifndef FAR -# define FAR -#endif - -#if !defined(__MACTYPES__) -typedef unsigned char Byte; /* 8 bits */ -#endif -typedef unsigned int uInt; /* 16 bits or more */ -typedef unsigned long uLong; /* 32 bits or more */ - -#ifdef SMALL_MEDIUM - /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ -# define Bytef Byte FAR -#else - typedef Byte FAR Bytef; -#endif -typedef char FAR charf; -typedef int FAR intf; -typedef uInt FAR uIntf; -typedef uLong FAR uLongf; - -#ifdef STDC - typedef void const *voidpc; - typedef void FAR *voidpf; - typedef void *voidp; -#else - typedef Byte const *voidpc; - typedef Byte FAR *voidpf; - typedef Byte *voidp; -#endif - -#if 0 /* HAVE_UNISTD_H -- this line is updated by ./configure */ -# include /* for off_t */ -# include /* for SEEK_* and off_t */ -# ifdef VMS -# include /* for off_t */ -# endif -# define z_off_t off_t -#endif -#ifndef SEEK_SET -# define SEEK_SET 0 /* Seek from beginning of file. */ -# define SEEK_CUR 1 /* Seek from current position. */ -# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ -#endif -#ifndef z_off_t -# define z_off_t long -#endif - -#if defined(__OS400__) -# define NO_vsnprintf -#endif - -#if defined(__MVS__) -# define NO_vsnprintf -# ifdef FAR -# undef FAR -# endif -#endif - -/* MVS linker does not support external names larger than 8 bytes */ -#if defined(__MVS__) -# pragma map(deflateInit_,"DEIN") -# pragma map(deflateInit2_,"DEIN2") -# pragma map(deflateEnd,"DEEND") -# pragma map(deflateBound,"DEBND") -# pragma map(inflateInit_,"ININ") -# pragma map(inflateInit2_,"ININ2") -# pragma map(inflateEnd,"INEND") -# pragma map(inflateSync,"INSY") -# pragma map(inflateSetDictionary,"INSEDI") -# pragma map(compressBound,"CMBND") -# pragma map(inflate_table,"INTABL") -# pragma map(inflate_fast,"INFA") -# pragma map(inflate_copyright,"INCOPY") -#endif - -#endif /* ZCONF_H */ diff --git a/src/zlib/zlib.h b/src/zlib/zlib.h deleted file mode 100644 index 62d0e4675..000000000 --- a/src/zlib/zlib.h +++ /dev/null @@ -1,1357 +0,0 @@ -/* zlib.h -- interface of the 'zlib' general purpose compression library - version 1.2.3, July 18th, 2005 - - Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - Jean-loup Gailly Mark Adler - jloup@gzip.org madler@alumni.caltech.edu - - - The data format used by the zlib library is described by RFCs (Request for - Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt - (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format). -*/ - -#ifndef ZLIB_H -#define ZLIB_H - -#include "zconf.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define ZLIB_VERSION "1.2.3" -#define ZLIB_VERNUM 0x1230 - -/* - The 'zlib' compression library provides in-memory compression and - decompression functions, including integrity checks of the uncompressed - data. This version of the library supports only one compression method - (deflation) but other algorithms will be added later and will have the same - stream interface. - - Compression can be done in a single step if the buffers are large - enough (for example if an input file is mmap'ed), or can be done by - repeated calls of the compression function. In the latter case, the - application must provide more input and/or consume the output - (providing more output space) before each call. - - The compressed data format used by default by the in-memory functions is - the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped - around a deflate stream, which is itself documented in RFC 1951. - - The library also supports reading and writing files in gzip (.gz) format - with an interface similar to that of stdio using the functions that start - with "gz". The gzip format is different from the zlib format. gzip is a - gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. - - This library can optionally read and write gzip streams in memory as well. - - The zlib format was designed to be compact and fast for use in memory - and on communications channels. The gzip format was designed for single- - file compression on file systems, has a larger header than zlib to maintain - directory information, and uses a different, slower check method than zlib. - - The library does not install any signal handler. The decoder checks - the consistency of the compressed data, so the library should never - crash even in case of corrupted input. -*/ - -typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size)); -typedef void (*free_func) OF((voidpf opaque, voidpf address)); - -struct internal_state; - -typedef struct z_stream_s { - Bytef *next_in; /* next input byte */ - uInt avail_in; /* number of bytes available at next_in */ - uLong total_in; /* total nb of input bytes read so far */ - - Bytef *next_out; /* next output byte should be put there */ - uInt avail_out; /* remaining free space at next_out */ - uLong total_out; /* total nb of bytes output so far */ - - char *msg; /* last error message, NULL if no error */ - struct internal_state FAR *state; /* not visible by applications */ - - alloc_func zalloc; /* used to allocate the internal state */ - free_func zfree; /* used to free the internal state */ - voidpf opaque; /* private data object passed to zalloc and zfree */ - - int data_type; /* best guess about the data type: binary or text */ - uLong adler; /* adler32 value of the uncompressed data */ - uLong reserved; /* reserved for future use */ -} z_stream; - -typedef z_stream FAR *z_streamp; - -/* - gzip header information passed to and from zlib routines. See RFC 1952 - for more details on the meanings of these fields. -*/ -typedef struct gz_header_s { - int text; /* true if compressed data believed to be text */ - uLong time; /* modification time */ - int xflags; /* extra flags (not used when writing a gzip file) */ - int os; /* operating system */ - Bytef *extra; /* pointer to extra field or Z_NULL if none */ - uInt extra_len; /* extra field length (valid if extra != Z_NULL) */ - uInt extra_max; /* space at extra (only when reading header) */ - Bytef *name; /* pointer to zero-terminated file name or Z_NULL */ - uInt name_max; /* space at name (only when reading header) */ - Bytef *comment; /* pointer to zero-terminated comment or Z_NULL */ - uInt comm_max; /* space at comment (only when reading header) */ - int hcrc; /* true if there was or will be a header crc */ - int done; /* true when done reading gzip header (not used - when writing a gzip file) */ -} gz_header; - -typedef gz_header FAR *gz_headerp; - -/* - The application must update next_in and avail_in when avail_in has - dropped to zero. It must update next_out and avail_out when avail_out - has dropped to zero. The application must initialize zalloc, zfree and - opaque before calling the init function. All other fields are set by the - compression library and must not be updated by the application. - - The opaque value provided by the application will be passed as the first - parameter for calls of zalloc and zfree. This can be useful for custom - memory management. The compression library attaches no meaning to the - opaque value. - - zalloc must return Z_NULL if there is not enough memory for the object. - If zlib is used in a multi-threaded application, zalloc and zfree must be - thread safe. - - On 16-bit systems, the functions zalloc and zfree must be able to allocate - exactly 65536 bytes, but will not be required to allocate more than this - if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, - pointers returned by zalloc for objects of exactly 65536 bytes *must* - have their offset normalized to zero. The default allocation function - provided by this library ensures this (see zutil.c). To reduce memory - requirements and avoid any allocation of 64K objects, at the expense of - compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h). - - The fields total_in and total_out can be used for statistics or - progress reports. After compression, total_in holds the total size of - the uncompressed data and may be saved for use in the decompressor - (particularly if the decompressor wants to decompress everything in - a single step). -*/ - - /* constants */ - -#define Z_NO_FLUSH 0 -#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */ -#define Z_SYNC_FLUSH 2 -#define Z_FULL_FLUSH 3 -#define Z_FINISH 4 -#define Z_BLOCK 5 -/* Allowed flush values; see deflate() and inflate() below for details */ - -#define Z_OK 0 -#define Z_STREAM_END 1 -#define Z_NEED_DICT 2 -#define Z_ERRNO (-1) -#define Z_STREAM_ERROR (-2) -#define Z_DATA_ERROR (-3) -#define Z_MEM_ERROR (-4) -#define Z_BUF_ERROR (-5) -#define Z_VERSION_ERROR (-6) -/* Return codes for the compression/decompression functions. Negative - * values are errors, positive values are used for special but normal events. - */ - -#define Z_NO_COMPRESSION 0 -#define Z_BEST_SPEED 1 -#define Z_BEST_COMPRESSION 9 -#define Z_DEFAULT_COMPRESSION (-1) -/* compression levels */ - -#define Z_FILTERED 1 -#define Z_HUFFMAN_ONLY 2 -#define Z_RLE 3 -#define Z_FIXED 4 -#define Z_DEFAULT_STRATEGY 0 -/* compression strategy; see deflateInit2() below for details */ - -#define Z_BINARY 0 -#define Z_TEXT 1 -#define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */ -#define Z_UNKNOWN 2 -/* Possible values of the data_type field (though see inflate()) */ - -#define Z_DEFLATED 8 -/* The deflate compression method (the only one supported in this version) */ - -#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ - -#define zlib_version zlibVersion() -/* for compatibility with versions < 1.0.2 */ - - /* basic functions */ - -ZEXTERN const char * ZEXPORT zlibVersion OF((void)); -/* The application can compare zlibVersion and ZLIB_VERSION for consistency. - If the first character differs, the library code actually used is - not compatible with the zlib.h header file used by the application. - This check is automatically made by deflateInit and inflateInit. - */ - -/* -ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); - - Initializes the internal stream state for compression. The fields - zalloc, zfree and opaque must be initialized before by the caller. - If zalloc and zfree are set to Z_NULL, deflateInit updates them to - use default allocation functions. - - The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: - 1 gives best speed, 9 gives best compression, 0 gives no compression at - all (the input data is simply copied a block at a time). - Z_DEFAULT_COMPRESSION requests a default compromise between speed and - compression (currently equivalent to level 6). - - deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_STREAM_ERROR if level is not a valid compression level, - Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible - with the version assumed by the caller (ZLIB_VERSION). - msg is set to null if there is no error message. deflateInit does not - perform any compression: this will be done by deflate(). -*/ - - -ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); -/* - deflate compresses as much data as possible, and stops when the input - buffer becomes empty or the output buffer becomes full. It may introduce some - output latency (reading input without producing any output) except when - forced to flush. - - The detailed semantics are as follows. deflate performs one or both of the - following actions: - - - Compress more input starting at next_in and update next_in and avail_in - accordingly. If not all input can be processed (because there is not - enough room in the output buffer), next_in and avail_in are updated and - processing will resume at this point for the next call of deflate(). - - - Provide more output starting at next_out and update next_out and avail_out - accordingly. This action is forced if the parameter flush is non zero. - Forcing flush frequently degrades the compression ratio, so this parameter - should be set only when necessary (in interactive applications). - Some output may be provided even if flush is not set. - - Before the call of deflate(), the application should ensure that at least - one of the actions is possible, by providing more input and/or consuming - more output, and updating avail_in or avail_out accordingly; avail_out - should never be zero before the call. The application can consume the - compressed output when it wants, for example when the output buffer is full - (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK - and with zero avail_out, it must be called again after making room in the - output buffer because there might be more output pending. - - Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to - decide how much data to accumualte before producing output, in order to - maximize compression. - - If the parameter flush is set to Z_SYNC_FLUSH, all pending output is - flushed to the output buffer and the output is aligned on a byte boundary, so - that the decompressor can get all input data available so far. (In particular - avail_in is zero after the call if enough output space has been provided - before the call.) Flushing may degrade compression for some compression - algorithms and so it should be used only when necessary. - - If flush is set to Z_FULL_FLUSH, all output is flushed as with - Z_SYNC_FLUSH, and the compression state is reset so that decompression can - restart from this point if previous compressed data has been damaged or if - random access is desired. Using Z_FULL_FLUSH too often can seriously degrade - compression. - - If deflate returns with avail_out == 0, this function must be called again - with the same value of the flush parameter and more output space (updated - avail_out), until the flush is complete (deflate returns with non-zero - avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that - avail_out is greater than six to avoid repeated flush markers due to - avail_out == 0 on return. - - If the parameter flush is set to Z_FINISH, pending input is processed, - pending output is flushed and deflate returns with Z_STREAM_END if there - was enough output space; if deflate returns with Z_OK, this function must be - called again with Z_FINISH and more output space (updated avail_out) but no - more input data, until it returns with Z_STREAM_END or an error. After - deflate has returned Z_STREAM_END, the only possible operations on the - stream are deflateReset or deflateEnd. - - Z_FINISH can be used immediately after deflateInit if all the compression - is to be done in a single step. In this case, avail_out must be at least - the value returned by deflateBound (see below). If deflate does not return - Z_STREAM_END, then it must be called again as described above. - - deflate() sets strm->adler to the adler32 checksum of all input read - so far (that is, total_in bytes). - - deflate() may update strm->data_type if it can make a good guess about - the input data type (Z_BINARY or Z_TEXT). In doubt, the data is considered - binary. This field is only for information purposes and does not affect - the compression algorithm in any manner. - - deflate() returns Z_OK if some progress has been made (more input - processed or more output produced), Z_STREAM_END if all input has been - consumed and all output has been produced (only when flush is set to - Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example - if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible - (for example avail_in or avail_out was zero). Note that Z_BUF_ERROR is not - fatal, and deflate() can be called again with more input and more output - space to continue compressing. -*/ - - -ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)); -/* - All dynamically allocated data structures for this stream are freed. - This function discards any unprocessed input and does not flush any - pending output. - - deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the - stream state was inconsistent, Z_DATA_ERROR if the stream was freed - prematurely (some input or output was discarded). In the error case, - msg may be set but then points to a static string (which must not be - deallocated). -*/ - - -/* -ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); - - Initializes the internal stream state for decompression. The fields - next_in, avail_in, zalloc, zfree and opaque must be initialized before by - the caller. If next_in is not Z_NULL and avail_in is large enough (the exact - value depends on the compression method), inflateInit determines the - compression method from the zlib header and allocates all data structures - accordingly; otherwise the allocation will be deferred to the first call of - inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to - use default allocation functions. - - inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_VERSION_ERROR if the zlib library version is incompatible with the - version assumed by the caller. msg is set to null if there is no error - message. inflateInit does not perform any decompression apart from reading - the zlib header if present: this will be done by inflate(). (So next_in and - avail_in may be modified, but next_out and avail_out are unchanged.) -*/ - - -ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); -/* - inflate decompresses as much data as possible, and stops when the input - buffer becomes empty or the output buffer becomes full. It may introduce - some output latency (reading input without producing any output) except when - forced to flush. - - The detailed semantics are as follows. inflate performs one or both of the - following actions: - - - Decompress more input starting at next_in and update next_in and avail_in - accordingly. If not all input can be processed (because there is not - enough room in the output buffer), next_in is updated and processing - will resume at this point for the next call of inflate(). - - - Provide more output starting at next_out and update next_out and avail_out - accordingly. inflate() provides as much output as possible, until there - is no more input data or no more space in the output buffer (see below - about the flush parameter). - - Before the call of inflate(), the application should ensure that at least - one of the actions is possible, by providing more input and/or consuming - more output, and updating the next_* and avail_* values accordingly. - The application can consume the uncompressed output when it wants, for - example when the output buffer is full (avail_out == 0), or after each - call of inflate(). If inflate returns Z_OK and with zero avail_out, it - must be called again after making room in the output buffer because there - might be more output pending. - - The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, - Z_FINISH, or Z_BLOCK. Z_SYNC_FLUSH requests that inflate() flush as much - output as possible to the output buffer. Z_BLOCK requests that inflate() stop - if and when it gets to the next deflate block boundary. When decoding the - zlib or gzip format, this will cause inflate() to return immediately after - the header and before the first block. When doing a raw inflate, inflate() - will go ahead and process the first block, and will return when it gets to - the end of that block, or when it runs out of data. - - The Z_BLOCK option assists in appending to or combining deflate streams. - Also to assist in this, on return inflate() will set strm->data_type to the - number of unused bits in the last byte taken from strm->next_in, plus 64 - if inflate() is currently decoding the last block in the deflate stream, - plus 128 if inflate() returned immediately after decoding an end-of-block - code or decoding the complete header up to just before the first byte of the - deflate stream. The end-of-block will not be indicated until all of the - uncompressed data from that block has been written to strm->next_out. The - number of unused bits may in general be greater than seven, except when - bit 7 of data_type is set, in which case the number of unused bits will be - less than eight. - - inflate() should normally be called until it returns Z_STREAM_END or an - error. However if all decompression is to be performed in a single step - (a single call of inflate), the parameter flush should be set to - Z_FINISH. In this case all pending input is processed and all pending - output is flushed; avail_out must be large enough to hold all the - uncompressed data. (The size of the uncompressed data may have been saved - by the compressor for this purpose.) The next operation on this stream must - be inflateEnd to deallocate the decompression state. The use of Z_FINISH - is never required, but can be used to inform inflate that a faster approach - may be used for the single inflate() call. - - In this implementation, inflate() always flushes as much output as - possible to the output buffer, and always uses the faster approach on the - first call. So the only effect of the flush parameter in this implementation - is on the return value of inflate(), as noted below, or when it returns early - because Z_BLOCK is used. - - If a preset dictionary is needed after this call (see inflateSetDictionary - below), inflate sets strm->adler to the adler32 checksum of the dictionary - chosen by the compressor and returns Z_NEED_DICT; otherwise it sets - strm->adler to the adler32 checksum of all output produced so far (that is, - total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described - below. At the end of the stream, inflate() checks that its computed adler32 - checksum is equal to that saved by the compressor and returns Z_STREAM_END - only if the checksum is correct. - - inflate() will decompress and check either zlib-wrapped or gzip-wrapped - deflate data. The header type is detected automatically. Any information - contained in the gzip header is not retained, so applications that need that - information should instead use raw inflate, see inflateInit2() below, or - inflateBack() and perform their own processing of the gzip header and - trailer. - - inflate() returns Z_OK if some progress has been made (more input processed - or more output produced), Z_STREAM_END if the end of the compressed data has - been reached and all uncompressed output has been produced, Z_NEED_DICT if a - preset dictionary is needed at this point, Z_DATA_ERROR if the input data was - corrupted (input stream not conforming to the zlib format or incorrect check - value), Z_STREAM_ERROR if the stream structure was inconsistent (for example - if next_in or next_out was NULL), Z_MEM_ERROR if there was not enough memory, - Z_BUF_ERROR if no progress is possible or if there was not enough room in the - output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and - inflate() can be called again with more input and more output space to - continue decompressing. If Z_DATA_ERROR is returned, the application may then - call inflateSync() to look for a good compression block if a partial recovery - of the data is desired. -*/ - - -ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); -/* - All dynamically allocated data structures for this stream are freed. - This function discards any unprocessed input and does not flush any - pending output. - - inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state - was inconsistent. In the error case, msg may be set but then points to a - static string (which must not be deallocated). -*/ - - /* Advanced functions */ - -/* - The following functions are needed only in some special applications. -*/ - -/* -ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, - int level, - int method, - int windowBits, - int memLevel, - int strategy)); - - This is another version of deflateInit with more compression options. The - fields next_in, zalloc, zfree and opaque must be initialized before by - the caller. - - The method parameter is the compression method. It must be Z_DEFLATED in - this version of the library. - - The windowBits parameter is the base two logarithm of the window size - (the size of the history buffer). It should be in the range 8..15 for this - version of the library. Larger values of this parameter result in better - compression at the expense of memory usage. The default value is 15 if - deflateInit is used instead. - - windowBits can also be -8..-15 for raw deflate. In this case, -windowBits - determines the window size. deflate() will then generate raw deflate data - with no zlib header or trailer, and will not compute an adler32 check value. - - windowBits can also be greater than 15 for optional gzip encoding. Add - 16 to windowBits to write a simple gzip header and trailer around the - compressed data instead of a zlib wrapper. The gzip header will have no - file name, no extra data, no comment, no modification time (set to zero), - no header crc, and the operating system will be set to 255 (unknown). If a - gzip stream is being written, strm->adler is a crc32 instead of an adler32. - - The memLevel parameter specifies how much memory should be allocated - for the internal compression state. memLevel=1 uses minimum memory but - is slow and reduces compression ratio; memLevel=9 uses maximum memory - for optimal speed. The default value is 8. See zconf.h for total memory - usage as a function of windowBits and memLevel. - - The strategy parameter is used to tune the compression algorithm. Use the - value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a - filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no - string match), or Z_RLE to limit match distances to one (run-length - encoding). Filtered data consists mostly of small values with a somewhat - random distribution. In this case, the compression algorithm is tuned to - compress them better. The effect of Z_FILTERED is to force more Huffman - coding and less string matching; it is somewhat intermediate between - Z_DEFAULT and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as fast as - Z_HUFFMAN_ONLY, but give better compression for PNG image data. The strategy - parameter only affects the compression ratio but not the correctness of the - compressed output even if it is not set appropriately. Z_FIXED prevents the - use of dynamic Huffman codes, allowing for a simpler decoder for special - applications. - - deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid - method). msg is set to null if there is no error message. deflateInit2 does - not perform any compression: this will be done by deflate(). -*/ - -ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, - const Bytef *dictionary, - uInt dictLength)); -/* - Initializes the compression dictionary from the given byte sequence - without producing any compressed output. This function must be called - immediately after deflateInit, deflateInit2 or deflateReset, before any - call of deflate. The compressor and decompressor must use exactly the same - dictionary (see inflateSetDictionary). - - The dictionary should consist of strings (byte sequences) that are likely - to be encountered later in the data to be compressed, with the most commonly - used strings preferably put towards the end of the dictionary. Using a - dictionary is most useful when the data to be compressed is short and can be - predicted with good accuracy; the data can then be compressed better than - with the default empty dictionary. - - Depending on the size of the compression data structures selected by - deflateInit or deflateInit2, a part of the dictionary may in effect be - discarded, for example if the dictionary is larger than the window size in - deflate or deflate2. Thus the strings most likely to be useful should be - put at the end of the dictionary, not at the front. In addition, the - current implementation of deflate will use at most the window size minus - 262 bytes of the provided dictionary. - - Upon return of this function, strm->adler is set to the adler32 value - of the dictionary; the decompressor may later use this value to determine - which dictionary has been used by the compressor. (The adler32 value - applies to the whole dictionary even if only a subset of the dictionary is - actually used by the compressor.) If a raw deflate was requested, then the - adler32 value is not computed and strm->adler is not set. - - deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a - parameter is invalid (such as NULL dictionary) or the stream state is - inconsistent (for example if deflate has already been called for this stream - or if the compression method is bsort). deflateSetDictionary does not - perform any compression: this will be done by deflate(). -*/ - -ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, - z_streamp source)); -/* - Sets the destination stream as a complete copy of the source stream. - - This function can be useful when several compression strategies will be - tried, for example when there are several ways of pre-processing the input - data with a filter. The streams that will be discarded should then be freed - by calling deflateEnd. Note that deflateCopy duplicates the internal - compression state which can be quite large, so this strategy is slow and - can consume lots of memory. - - deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_STREAM_ERROR if the source stream state was inconsistent - (such as zalloc being NULL). msg is left unchanged in both source and - destination. -*/ - -ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm)); -/* - This function is equivalent to deflateEnd followed by deflateInit, - but does not free and reallocate all the internal compression state. - The stream will keep the same compression level and any other attributes - that may have been set by deflateInit2. - - deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent (such as zalloc or state being NULL). -*/ - -ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, - int level, - int strategy)); -/* - Dynamically update the compression level and compression strategy. The - interpretation of level and strategy is as in deflateInit2. This can be - used to switch between compression and straight copy of the input data, or - to switch to a different kind of input data requiring a different - strategy. If the compression level is changed, the input available so far - is compressed with the old level (and may be flushed); the new level will - take effect only at the next call of deflate(). - - Before the call of deflateParams, the stream state must be set as for - a call of deflate(), since the currently available input may have to - be compressed and flushed. In particular, strm->avail_out must be non-zero. - - deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source - stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR - if strm->avail_out was zero. -*/ - -ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm, - int good_length, - int max_lazy, - int nice_length, - int max_chain)); -/* - Fine tune deflate's internal compression parameters. This should only be - used by someone who understands the algorithm used by zlib's deflate for - searching for the best matching string, and even then only by the most - fanatic optimizer trying to squeeze out the last compressed bit for their - specific input data. Read the deflate.c source code for the meaning of the - max_lazy, good_length, nice_length, and max_chain parameters. - - deflateTune() can be called after deflateInit() or deflateInit2(), and - returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream. - */ - -ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm, - uLong sourceLen)); -/* - deflateBound() returns an upper bound on the compressed size after - deflation of sourceLen bytes. It must be called after deflateInit() - or deflateInit2(). This would be used to allocate an output buffer - for deflation in a single pass, and so would be called before deflate(). -*/ - -ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm, - int bits, - int value)); -/* - deflatePrime() inserts bits in the deflate output stream. The intent - is that this function is used to start off the deflate output with the - bits leftover from a previous deflate stream when appending to it. As such, - this function can only be used for raw deflate, and must be used before the - first deflate() call after a deflateInit2() or deflateReset(). bits must be - less than or equal to 16, and that many of the least significant bits of - value will be inserted in the output. - - deflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm, - gz_headerp head)); -/* - deflateSetHeader() provides gzip header information for when a gzip - stream is requested by deflateInit2(). deflateSetHeader() may be called - after deflateInit2() or deflateReset() and before the first call of - deflate(). The text, time, os, extra field, name, and comment information - in the provided gz_header structure are written to the gzip header (xflag is - ignored -- the extra flags are set according to the compression level). The - caller must assure that, if not Z_NULL, name and comment are terminated with - a zero byte, and that if extra is not Z_NULL, that extra_len bytes are - available there. If hcrc is true, a gzip header crc is included. Note that - the current versions of the command-line version of gzip (up through version - 1.3.x) do not support header crc's, and will report that it is a "multi-part - gzip file" and give up. - - If deflateSetHeader is not used, the default gzip header has text false, - the time set to zero, and os set to 255, with no extra, name, or comment - fields. The gzip header is returned to the default state by deflateReset(). - - deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -/* -ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, - int windowBits)); - - This is another version of inflateInit with an extra parameter. The - fields next_in, avail_in, zalloc, zfree and opaque must be initialized - before by the caller. - - The windowBits parameter is the base two logarithm of the maximum window - size (the size of the history buffer). It should be in the range 8..15 for - this version of the library. The default value is 15 if inflateInit is used - instead. windowBits must be greater than or equal to the windowBits value - provided to deflateInit2() while compressing, or it must be equal to 15 if - deflateInit2() was not used. If a compressed stream with a larger window - size is given as input, inflate() will return with the error code - Z_DATA_ERROR instead of trying to allocate a larger window. - - windowBits can also be -8..-15 for raw inflate. In this case, -windowBits - determines the window size. inflate() will then process raw deflate data, - not looking for a zlib or gzip header, not generating a check value, and not - looking for any check values for comparison at the end of the stream. This - is for use with other formats that use the deflate compressed data format - such as zip. Those formats provide their own check values. If a custom - format is developed using the raw deflate format for compressed data, it is - recommended that a check value such as an adler32 or a crc32 be applied to - the uncompressed data as is done in the zlib, gzip, and zip formats. For - most applications, the zlib format should be used as is. Note that comments - above on the use in deflateInit2() applies to the magnitude of windowBits. - - windowBits can also be greater than 15 for optional gzip decoding. Add - 32 to windowBits to enable zlib and gzip decoding with automatic header - detection, or add 16 to decode only the gzip format (the zlib format will - return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is - a crc32 instead of an adler32. - - inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_STREAM_ERROR if a parameter is invalid (such as a null strm). msg - is set to null if there is no error message. inflateInit2 does not perform - any decompression apart from reading the zlib header if present: this will - be done by inflate(). (So next_in and avail_in may be modified, but next_out - and avail_out are unchanged.) -*/ - -ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, - const Bytef *dictionary, - uInt dictLength)); -/* - Initializes the decompression dictionary from the given uncompressed byte - sequence. This function must be called immediately after a call of inflate, - if that call returned Z_NEED_DICT. The dictionary chosen by the compressor - can be determined from the adler32 value returned by that call of inflate. - The compressor and decompressor must use exactly the same dictionary (see - deflateSetDictionary). For raw inflate, this function can be called - immediately after inflateInit2() or inflateReset() and before any call of - inflate() to set the dictionary. The application must insure that the - dictionary that was used for compression is provided. - - inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a - parameter is invalid (such as NULL dictionary) or the stream state is - inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the - expected one (incorrect adler32 value). inflateSetDictionary does not - perform any decompression: this will be done by subsequent calls of - inflate(). -*/ - -ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); -/* - Skips invalid compressed data until a full flush point (see above the - description of deflate with Z_FULL_FLUSH) can be found, or until all - available input is skipped. No output is provided. - - inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR - if no more input was provided, Z_DATA_ERROR if no flush point has been found, - or Z_STREAM_ERROR if the stream structure was inconsistent. In the success - case, the application may save the current current value of total_in which - indicates where valid compressed data was found. In the error case, the - application may repeatedly call inflateSync, providing more input each time, - until success or end of the input data. -*/ - -ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest, - z_streamp source)); -/* - Sets the destination stream as a complete copy of the source stream. - - This function can be useful when randomly accessing a large stream. The - first pass through the stream can periodically record the inflate state, - allowing restarting inflate at those points when randomly accessing the - stream. - - inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_STREAM_ERROR if the source stream state was inconsistent - (such as zalloc being NULL). msg is left unchanged in both source and - destination. -*/ - -ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm)); -/* - This function is equivalent to inflateEnd followed by inflateInit, - but does not free and reallocate all the internal decompression state. - The stream will keep attributes that may have been set by inflateInit2. - - inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent (such as zalloc or state being NULL). -*/ - -ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm, - int bits, - int value)); -/* - This function inserts bits in the inflate input stream. The intent is - that this function is used to start inflating at a bit position in the - middle of a byte. The provided bits will be used before any bytes are used - from next_in. This function should only be used with raw inflate, and - should be used before the first inflate() call after inflateInit2() or - inflateReset(). bits must be less than or equal to 16, and that many of the - least significant bits of value will be inserted in the input. - - inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm, - gz_headerp head)); -/* - inflateGetHeader() requests that gzip header information be stored in the - provided gz_header structure. inflateGetHeader() may be called after - inflateInit2() or inflateReset(), and before the first call of inflate(). - As inflate() processes the gzip stream, head->done is zero until the header - is completed, at which time head->done is set to one. If a zlib stream is - being decoded, then head->done is set to -1 to indicate that there will be - no gzip header information forthcoming. Note that Z_BLOCK can be used to - force inflate() to return immediately after header processing is complete - and before any actual data is decompressed. - - The text, time, xflags, and os fields are filled in with the gzip header - contents. hcrc is set to true if there is a header CRC. (The header CRC - was valid if done is set to one.) If extra is not Z_NULL, then extra_max - contains the maximum number of bytes to write to extra. Once done is true, - extra_len contains the actual extra field length, and extra contains the - extra field, or that field truncated if extra_max is less than extra_len. - If name is not Z_NULL, then up to name_max characters are written there, - terminated with a zero unless the length is greater than name_max. If - comment is not Z_NULL, then up to comm_max characters are written there, - terminated with a zero unless the length is greater than comm_max. When - any of extra, name, or comment are not Z_NULL and the respective field is - not present in the header, then that field is set to Z_NULL to signal its - absence. This allows the use of deflateSetHeader() with the returned - structure to duplicate the header. However if those fields are set to - allocated memory, then the application will need to save those pointers - elsewhere so that they can be eventually freed. - - If inflateGetHeader is not used, then the header information is simply - discarded. The header is always checked for validity, including the header - CRC if present. inflateReset() will reset the process to discard the header - information. The application would need to call inflateGetHeader() again to - retrieve the header from the next gzip stream. - - inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -/* -ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, - unsigned char FAR *window)); - - Initialize the internal stream state for decompression using inflateBack() - calls. The fields zalloc, zfree and opaque in strm must be initialized - before the call. If zalloc and zfree are Z_NULL, then the default library- - derived memory allocation routines are used. windowBits is the base two - logarithm of the window size, in the range 8..15. window is a caller - supplied buffer of that size. Except for special applications where it is - assured that deflate was used with small window sizes, windowBits must be 15 - and a 32K byte window must be supplied to be able to decompress general - deflate streams. - - See inflateBack() for the usage of these routines. - - inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of - the paramaters are invalid, Z_MEM_ERROR if the internal state could not - be allocated, or Z_VERSION_ERROR if the version of the library does not - match the version of the header file. -*/ - -typedef unsigned (*in_func) OF((void FAR *, unsigned char FAR * FAR *)); -typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned)); - -ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm, - in_func in, void FAR *in_desc, - out_func out, void FAR *out_desc)); -/* - inflateBack() does a raw inflate with a single call using a call-back - interface for input and output. This is more efficient than inflate() for - file i/o applications in that it avoids copying between the output and the - sliding window by simply making the window itself the output buffer. This - function trusts the application to not change the output buffer passed by - the output function, at least until inflateBack() returns. - - inflateBackInit() must be called first to allocate the internal state - and to initialize the state with the user-provided window buffer. - inflateBack() may then be used multiple times to inflate a complete, raw - deflate stream with each call. inflateBackEnd() is then called to free - the allocated state. - - A raw deflate stream is one with no zlib or gzip header or trailer. - This routine would normally be used in a utility that reads zip or gzip - files and writes out uncompressed files. The utility would decode the - header and process the trailer on its own, hence this routine expects - only the raw deflate stream to decompress. This is different from the - normal behavior of inflate(), which expects either a zlib or gzip header and - trailer around the deflate stream. - - inflateBack() uses two subroutines supplied by the caller that are then - called by inflateBack() for input and output. inflateBack() calls those - routines until it reads a complete deflate stream and writes out all of the - uncompressed data, or until it encounters an error. The function's - parameters and return types are defined above in the in_func and out_func - typedefs. inflateBack() will call in(in_desc, &buf) which should return the - number of bytes of provided input, and a pointer to that input in buf. If - there is no input available, in() must return zero--buf is ignored in that - case--and inflateBack() will return a buffer error. inflateBack() will call - out(out_desc, buf, len) to write the uncompressed data buf[0..len-1]. out() - should return zero on success, or non-zero on failure. If out() returns - non-zero, inflateBack() will return with an error. Neither in() nor out() - are permitted to change the contents of the window provided to - inflateBackInit(), which is also the buffer that out() uses to write from. - The length written by out() will be at most the window size. Any non-zero - amount of input may be provided by in(). - - For convenience, inflateBack() can be provided input on the first call by - setting strm->next_in and strm->avail_in. If that input is exhausted, then - in() will be called. Therefore strm->next_in must be initialized before - calling inflateBack(). If strm->next_in is Z_NULL, then in() will be called - immediately for input. If strm->next_in is not Z_NULL, then strm->avail_in - must also be initialized, and then if strm->avail_in is not zero, input will - initially be taken from strm->next_in[0 .. strm->avail_in - 1]. - - The in_desc and out_desc parameters of inflateBack() is passed as the - first parameter of in() and out() respectively when they are called. These - descriptors can be optionally used to pass any information that the caller- - supplied in() and out() functions need to do their job. - - On return, inflateBack() will set strm->next_in and strm->avail_in to - pass back any unused input that was provided by the last in() call. The - return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR - if in() or out() returned an error, Z_DATA_ERROR if there was a format - error in the deflate stream (in which case strm->msg is set to indicate the - nature of the error), or Z_STREAM_ERROR if the stream was not properly - initialized. In the case of Z_BUF_ERROR, an input or output error can be - distinguished using strm->next_in which will be Z_NULL only if in() returned - an error. If strm->next is not Z_NULL, then the Z_BUF_ERROR was due to - out() returning non-zero. (in() will always be called before out(), so - strm->next_in is assured to be defined if out() returns non-zero.) Note - that inflateBack() cannot return Z_OK. -*/ - -ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm)); -/* - All memory allocated by inflateBackInit() is freed. - - inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream - state was inconsistent. -*/ - -ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void)); -/* Return flags indicating compile-time options. - - Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other: - 1.0: size of uInt - 3.2: size of uLong - 5.4: size of voidpf (pointer) - 7.6: size of z_off_t - - Compiler, assembler, and debug options: - 8: DEBUG - 9: ASMV or ASMINF -- use ASM code - 10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention - 11: 0 (reserved) - - One-time table building (smaller code, but not thread-safe if true): - 12: BUILDFIXED -- build static block decoding tables when needed - 13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed - 14,15: 0 (reserved) - - Library content (indicates missing functionality): - 16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking - deflate code when not needed) - 17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect - and decode gzip streams (to avoid linking crc code) - 18-19: 0 (reserved) - - Operation variations (changes in library functionality): - 20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate - 21: FASTEST -- deflate algorithm with only one, lowest compression level - 22,23: 0 (reserved) - - The sprintf variant used by gzprintf (zero is best): - 24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format - 25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure! - 26: 0 = returns value, 1 = void -- 1 means inferred string length returned - - Remainder: - 27-31: 0 (reserved) - */ - - - /* utility functions */ - -/* - The following utility functions are implemented on top of the - basic stream-oriented functions. To simplify the interface, some - default options are assumed (compression level and memory usage, - standard memory allocation functions). The source code of these - utility functions can easily be modified if you need special options. -*/ - -ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen)); -/* - Compresses the source buffer into the destination buffer. sourceLen is - the byte length of the source buffer. Upon entry, destLen is the total - size of the destination buffer, which must be at least the value returned - by compressBound(sourceLen). Upon exit, destLen is the actual size of the - compressed buffer. - This function can be used to compress a whole file at once if the - input file is mmap'ed. - compress returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_BUF_ERROR if there was not enough room in the output - buffer. -*/ - -ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen, - int level)); -/* - Compresses the source buffer into the destination buffer. The level - parameter has the same meaning as in deflateInit. sourceLen is the byte - length of the source buffer. Upon entry, destLen is the total size of the - destination buffer, which must be at least the value returned by - compressBound(sourceLen). Upon exit, destLen is the actual size of the - compressed buffer. - - compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_BUF_ERROR if there was not enough room in the output buffer, - Z_STREAM_ERROR if the level parameter is invalid. -*/ - -ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen)); -/* - compressBound() returns an upper bound on the compressed size after - compress() or compress2() on sourceLen bytes. It would be used before - a compress() or compress2() call to allocate the destination buffer. -*/ - -ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen)); -/* - Decompresses the source buffer into the destination buffer. sourceLen is - the byte length of the source buffer. Upon entry, destLen is the total - size of the destination buffer, which must be large enough to hold the - entire uncompressed data. (The size of the uncompressed data must have - been saved previously by the compressor and transmitted to the decompressor - by some mechanism outside the scope of this compression library.) - Upon exit, destLen is the actual size of the compressed buffer. - This function can be used to decompress a whole file at once if the - input file is mmap'ed. - - uncompress returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_BUF_ERROR if there was not enough room in the output - buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete. -*/ - - -typedef voidp gzFile; - -ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); -/* - Opens a gzip (.gz) file for reading or writing. The mode parameter - is as in fopen ("rb" or "wb") but can also include a compression level - ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for - Huffman only compression as in "wb1h", or 'R' for run-length encoding - as in "wb1R". (See the description of deflateInit2 for more information - about the strategy parameter.) - - gzopen can be used to read a file which is not in gzip format; in this - case gzread will directly read from the file without decompression. - - gzopen returns NULL if the file could not be opened or if there was - insufficient memory to allocate the (de)compression state; errno - can be checked to distinguish the two cases (if errno is zero, the - zlib error is Z_MEM_ERROR). */ - -ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode)); -/* - gzdopen() associates a gzFile with the file descriptor fd. File - descriptors are obtained from calls like open, dup, creat, pipe or - fileno (in the file has been previously opened with fopen). - The mode parameter is as in gzopen. - The next call of gzclose on the returned gzFile will also close the - file descriptor fd, just like fclose(fdopen(fd), mode) closes the file - descriptor fd. If you want to keep fd open, use gzdopen(dup(fd), mode). - gzdopen returns NULL if there was insufficient memory to allocate - the (de)compression state. -*/ - -ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)); -/* - Dynamically update the compression level or strategy. See the description - of deflateInit2 for the meaning of these parameters. - gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not - opened for writing. -*/ - -ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); -/* - Reads the given number of uncompressed bytes from the compressed file. - If the input file was not in gzip format, gzread copies the given number - of bytes into the buffer. - gzread returns the number of uncompressed bytes actually read (0 for - end of file, -1 for error). */ - -ZEXTERN int ZEXPORT gzwrite OF((gzFile file, - voidpc buf, unsigned len)); -/* - Writes the given number of uncompressed bytes into the compressed file. - gzwrite returns the number of uncompressed bytes actually written - (0 in case of error). -*/ - -ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...)); -/* - Converts, formats, and writes the args to the compressed file under - control of the format string, as in fprintf. gzprintf returns the number of - uncompressed bytes actually written (0 in case of error). The number of - uncompressed bytes written is limited to 4095. The caller should assure that - this limit is not exceeded. If it is exceeded, then gzprintf() will return - return an error (0) with nothing written. In this case, there may also be a - buffer overflow with unpredictable consequences, which is possible only if - zlib was compiled with the insecure functions sprintf() or vsprintf() - because the secure snprintf() or vsnprintf() functions were not available. -*/ - -ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s)); -/* - Writes the given null-terminated string to the compressed file, excluding - the terminating null character. - gzputs returns the number of characters written, or -1 in case of error. -*/ - -ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len)); -/* - Reads bytes from the compressed file until len-1 characters are read, or - a newline character is read and transferred to buf, or an end-of-file - condition is encountered. The string is then terminated with a null - character. - gzgets returns buf, or Z_NULL in case of error. -*/ - -ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); -/* - Writes c, converted to an unsigned char, into the compressed file. - gzputc returns the value that was written, or -1 in case of error. -*/ - -ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); -/* - Reads one byte from the compressed file. gzgetc returns this byte - or -1 in case of end of file or error. -*/ - -ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file)); -/* - Push one character back onto the stream to be read again later. - Only one character of push-back is allowed. gzungetc() returns the - character pushed, or -1 on failure. gzungetc() will fail if a - character has been pushed but not read yet, or if c is -1. The pushed - character will be discarded if the stream is repositioned with gzseek() - or gzrewind(). -*/ - -ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); -/* - Flushes all pending output into the compressed file. The parameter - flush is as in the deflate() function. The return value is the zlib - error number (see function gzerror below). gzflush returns Z_OK if - the flush parameter is Z_FINISH and all output could be flushed. - gzflush should be called only when strictly necessary because it can - degrade compression. -*/ - -ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file, - z_off_t offset, int whence)); -/* - Sets the starting position for the next gzread or gzwrite on the - given compressed file. The offset represents a number of bytes in the - uncompressed data stream. The whence parameter is defined as in lseek(2); - the value SEEK_END is not supported. - If the file is opened for reading, this function is emulated but can be - extremely slow. If the file is opened for writing, only forward seeks are - supported; gzseek then compresses a sequence of zeroes up to the new - starting position. - - gzseek returns the resulting offset location as measured in bytes from - the beginning of the uncompressed stream, or -1 in case of error, in - particular if the file is opened for writing and the new starting position - would be before the current position. -*/ - -ZEXTERN int ZEXPORT gzrewind OF((gzFile file)); -/* - Rewinds the given file. This function is supported only for reading. - - gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET) -*/ - -ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file)); -/* - Returns the starting position for the next gzread or gzwrite on the - given compressed file. This position represents a number of bytes in the - uncompressed data stream. - - gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR) -*/ - -ZEXTERN int ZEXPORT gzeof OF((gzFile file)); -/* - Returns 1 when EOF has previously been detected reading the given - input stream, otherwise zero. -*/ - -ZEXTERN int ZEXPORT gzdirect OF((gzFile file)); -/* - Returns 1 if file is being read directly without decompression, otherwise - zero. -*/ - -ZEXTERN int ZEXPORT gzclose OF((gzFile file)); -/* - Flushes all pending output if necessary, closes the compressed file - and deallocates all the (de)compression state. The return value is the zlib - error number (see function gzerror below). -*/ - -ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum)); -/* - Returns the error message for the last error which occurred on the - given compressed file. errnum is set to zlib error number. If an - error occurred in the file system and not in the compression library, - errnum is set to Z_ERRNO and the application may consult errno - to get the exact error code. -*/ - -ZEXTERN void ZEXPORT gzclearerr OF((gzFile file)); -/* - Clears the error and end-of-file flags for file. This is analogous to the - clearerr() function in stdio. This is useful for continuing to read a gzip - file that is being written concurrently. -*/ - - /* checksum functions */ - -/* - These functions are not related to compression but are exported - anyway because they might be useful in applications using the - compression library. -*/ - -ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); -/* - Update a running Adler-32 checksum with the bytes buf[0..len-1] and - return the updated checksum. If buf is NULL, this function returns - the required initial value for the checksum. - An Adler-32 checksum is almost as reliable as a CRC32 but can be computed - much faster. Usage example: - - uLong adler = adler32(0L, Z_NULL, 0); - - while (read_buffer(buffer, length) != EOF) { - adler = adler32(adler, buffer, length); - } - if (adler != original_adler) error(); -*/ - -ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2, - z_off_t len2)); -/* - Combine two Adler-32 checksums into one. For two sequences of bytes, seq1 - and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for - each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of - seq1 and seq2 concatenated, requiring only adler1, adler2, and len2. -*/ - -ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); -/* - Update a running CRC-32 with the bytes buf[0..len-1] and return the - updated CRC-32. If buf is NULL, this function returns the required initial - value for the for the crc. Pre- and post-conditioning (one's complement) is - performed within this function so it shouldn't be done by the application. - Usage example: - - uLong crc = crc32(0L, Z_NULL, 0); - - while (read_buffer(buffer, length) != EOF) { - crc = crc32(crc, buffer, length); - } - if (crc != original_crc) error(); -*/ - -ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2)); - -/* - Combine two CRC-32 check values into one. For two sequences of bytes, - seq1 and seq2 with lengths len1 and len2, CRC-32 check values were - calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32 - check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and - len2. -*/ - - - /* various hacks, don't look :) */ - -/* deflateInit and inflateInit are macros to allow checking the zlib version - * and the compiler's view of z_stream: - */ -ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method, - int windowBits, int memLevel, - int strategy, const char *version, - int stream_size)); -ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits, - unsigned char FAR *window, - const char *version, - int stream_size)); -#define deflateInit(strm, level) \ - deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) -#define inflateInit(strm) \ - inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) -#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ - deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ - (strategy), ZLIB_VERSION, sizeof(z_stream)) -#define inflateInit2(strm, windowBits) \ - inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) -#define inflateBackInit(strm, windowBits, window) \ - inflateBackInit_((strm), (windowBits), (window), \ - ZLIB_VERSION, sizeof(z_stream)) - - -#if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL) - struct internal_state {int dummy;}; /* hack for buggy compilers */ -#endif - -ZEXTERN const char * ZEXPORT zError OF((int)); -ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp z)); -ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void)); - -#ifdef __cplusplus -} -#endif - -#endif /* ZLIB_H */ diff --git a/src/zlib/zlib.sln b/src/zlib/zlib.sln deleted file mode 100644 index 8cb011cba..000000000 --- a/src/zlib/zlib.sln +++ /dev/null @@ -1,21 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib", "zlib.vcproj", "{935D4133-E17F-446E-A1D5-1ECB9EF68789}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Release = Release - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {935D4133-E17F-446E-A1D5-1ECB9EF68789}.Debug.ActiveCfg = Debug|Win32 - {935D4133-E17F-446E-A1D5-1ECB9EF68789}.Debug.Build.0 = Debug|Win32 - {935D4133-E17F-446E-A1D5-1ECB9EF68789}.Release.ActiveCfg = Release|Win32 - {935D4133-E17F-446E-A1D5-1ECB9EF68789}.Release.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/src/zlib/zlib.vcproj b/src/zlib/zlib.vcproj deleted file mode 100644 index 13838f0cb..000000000 --- a/src/zlib/zlib.vcproj +++ /dev/null @@ -1,200 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/zlib/zlib_vs2005.sln b/src/zlib/zlib_vs2005.sln deleted file mode 100644 index 18243d62e..000000000 --- a/src/zlib/zlib_vs2005.sln +++ /dev/null @@ -1,19 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib", "zlib_vs2005.vcproj", "{935D4133-E17F-446E-A1D5-1ECB9EF68789}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {935D4133-E17F-446E-A1D5-1ECB9EF68789}.Debug|Win32.ActiveCfg = Debug|Win32 - {935D4133-E17F-446E-A1D5-1ECB9EF68789}.Debug|Win32.Build.0 = Debug|Win32 - {935D4133-E17F-446E-A1D5-1ECB9EF68789}.Release|Win32.ActiveCfg = Release|Win32 - {935D4133-E17F-446E-A1D5-1ECB9EF68789}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/zlib/zlib_vs2005.vcproj b/src/zlib/zlib_vs2005.vcproj deleted file mode 100644 index 1014dafde..000000000 --- a/src/zlib/zlib_vs2005.vcproj +++ /dev/null @@ -1,240 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/zlib/zlib_vs2008.vcproj b/src/zlib/zlib_vs2008.vcproj deleted file mode 100644 index 9c9d71686..000000000 --- a/src/zlib/zlib_vs2008.vcproj +++ /dev/null @@ -1,241 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/zlib/zutil.c b/src/zlib/zutil.c deleted file mode 100644 index d0c9a619a..000000000 --- a/src/zlib/zutil.c +++ /dev/null @@ -1,318 +0,0 @@ -/* zutil.c -- target dependent utility functions for the compression library - * Copyright (C) 1995-2005 Jean-loup Gailly. - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* @(#) $Id: zutil.c 126 2003-11-09 01:53:27Z gabest $ */ - -#include "zutil.h" - -#ifndef NO_DUMMY_DECL -struct internal_state {int dummy;}; /* for buggy compilers */ -#endif - -const char * const z_errmsg[10] = { -"need dictionary", /* Z_NEED_DICT 2 */ -"stream end", /* Z_STREAM_END 1 */ -"", /* Z_OK 0 */ -"file error", /* Z_ERRNO (-1) */ -"stream error", /* Z_STREAM_ERROR (-2) */ -"data error", /* Z_DATA_ERROR (-3) */ -"insufficient memory", /* Z_MEM_ERROR (-4) */ -"buffer error", /* Z_BUF_ERROR (-5) */ -"incompatible version",/* Z_VERSION_ERROR (-6) */ -""}; - - -const char * ZEXPORT zlibVersion() -{ - return ZLIB_VERSION; -} - -uLong ZEXPORT zlibCompileFlags() -{ - uLong flags; - - flags = 0; - switch (sizeof(uInt)) { - case 2: break; - case 4: flags += 1; break; - case 8: flags += 2; break; - default: flags += 3; - } - switch (sizeof(uLong)) { - case 2: break; - case 4: flags += 1 << 2; break; - case 8: flags += 2 << 2; break; - default: flags += 3 << 2; - } - switch (sizeof(voidpf)) { - case 2: break; - case 4: flags += 1 << 4; break; - case 8: flags += 2 << 4; break; - default: flags += 3 << 4; - } - switch (sizeof(z_off_t)) { - case 2: break; - case 4: flags += 1 << 6; break; - case 8: flags += 2 << 6; break; - default: flags += 3 << 6; - } -#ifdef DEBUG - flags += 1 << 8; -#endif -#if defined(ASMV) || defined(ASMINF) - flags += 1 << 9; -#endif -#ifdef ZLIB_WINAPI - flags += 1 << 10; -#endif -#ifdef BUILDFIXED - flags += 1 << 12; -#endif -#ifdef DYNAMIC_CRC_TABLE - flags += 1 << 13; -#endif -#ifdef NO_GZCOMPRESS - flags += 1L << 16; -#endif -#ifdef NO_GZIP - flags += 1L << 17; -#endif -#ifdef PKZIP_BUG_WORKAROUND - flags += 1L << 20; -#endif -#ifdef FASTEST - flags += 1L << 21; -#endif -#ifdef STDC -# ifdef NO_vsnprintf - flags += 1L << 25; -# ifdef HAS_vsprintf_void - flags += 1L << 26; -# endif -# else -# ifdef HAS_vsnprintf_void - flags += 1L << 26; -# endif -# endif -#else - flags += 1L << 24; -# ifdef NO_snprintf - flags += 1L << 25; -# ifdef HAS_sprintf_void - flags += 1L << 26; -# endif -# else -# ifdef HAS_snprintf_void - flags += 1L << 26; -# endif -# endif -#endif - return flags; -} - -#ifdef DEBUG - -# ifndef verbose -# define verbose 0 -# endif -int z_verbose = verbose; - -void z_error (m) - char *m; -{ - fprintf(stderr, "%s\n", m); - exit(1); -} -#endif - -/* exported to allow conversion of error code to string for compress() and - * uncompress() - */ -const char * ZEXPORT zError(err) - int err; -{ - return ERR_MSG(err); -} - -#if defined(_WIN32_WCE) - /* The Microsoft C Run-Time Library for Windows CE doesn't have - * errno. We define it as a global variable to simplify porting. - * Its value is always 0 and should not be used. - */ - int errno = 0; -#endif - -#ifndef HAVE_MEMCPY - -void zmemcpy(dest, source, len) - Bytef* dest; - const Bytef* source; - uInt len; -{ - if (len == 0) return; - do { - *dest++ = *source++; /* ??? to be unrolled */ - } while (--len != 0); -} - -int zmemcmp(s1, s2, len) - const Bytef* s1; - const Bytef* s2; - uInt len; -{ - uInt j; - - for (j = 0; j < len; j++) { - if (s1[j] != s2[j]) return 2*(s1[j] > s2[j])-1; - } - return 0; -} - -void zmemzero(dest, len) - Bytef* dest; - uInt len; -{ - if (len == 0) return; - do { - *dest++ = 0; /* ??? to be unrolled */ - } while (--len != 0); -} -#endif - - -#ifdef SYS16BIT - -#ifdef __TURBOC__ -/* Turbo C in 16-bit mode */ - -# define MY_ZCALLOC - -/* Turbo C malloc() does not allow dynamic allocation of 64K bytes - * and farmalloc(64K) returns a pointer with an offset of 8, so we - * must fix the pointer. Warning: the pointer must be put back to its - * original form in order to free it, use zcfree(). - */ - -#define MAX_PTR 10 -/* 10*64K = 640K */ - -local int next_ptr = 0; - -typedef struct ptr_table_s { - voidpf org_ptr; - voidpf new_ptr; -} ptr_table; - -local ptr_table table[MAX_PTR]; -/* This table is used to remember the original form of pointers - * to large buffers (64K). Such pointers are normalized with a zero offset. - * Since MSDOS is not a preemptive multitasking OS, this table is not - * protected from concurrent access. This hack doesn't work anyway on - * a protected system like OS/2. Use Microsoft C instead. - */ - -voidpf zcalloc (voidpf opaque, unsigned items, unsigned size) -{ - voidpf buf = opaque; /* just to make some compilers happy */ - ulg bsize = (ulg)items*size; - - /* If we allocate less than 65520 bytes, we assume that farmalloc - * will return a usable pointer which doesn't have to be normalized. - */ - if (bsize < 65520L) { - buf = farmalloc(bsize); - if (*(ush*)&buf != 0) return buf; - } else { - buf = farmalloc(bsize + 16L); - } - if (buf == NULL || next_ptr >= MAX_PTR) return NULL; - table[next_ptr].org_ptr = buf; - - /* Normalize the pointer to seg:0 */ - *((ush*)&buf+1) += ((ush)((uch*)buf-0) + 15) >> 4; - *(ush*)&buf = 0; - table[next_ptr++].new_ptr = buf; - return buf; -} - -void zcfree (voidpf opaque, voidpf ptr) -{ - int n; - if (*(ush*)&ptr != 0) { /* object < 64K */ - farfree(ptr); - return; - } - /* Find the original pointer */ - for (n = 0; n < next_ptr; n++) { - if (ptr != table[n].new_ptr) continue; - - farfree(table[n].org_ptr); - while (++n < next_ptr) { - table[n-1] = table[n]; - } - next_ptr--; - return; - } - ptr = opaque; /* just to make some compilers happy */ - Assert(0, "zcfree: ptr not found"); -} - -#endif /* __TURBOC__ */ - - -#ifdef M_I86 -/* Microsoft C in 16-bit mode */ - -# define MY_ZCALLOC - -#if (!defined(_MSC_VER) || (_MSC_VER <= 600)) -# define _halloc halloc -# define _hfree hfree -#endif - -voidpf zcalloc (voidpf opaque, unsigned items, unsigned size) -{ - if (opaque) opaque = 0; /* to make compiler happy */ - return _halloc((long)items, size); -} - -void zcfree (voidpf opaque, voidpf ptr) -{ - if (opaque) opaque = 0; /* to make compiler happy */ - _hfree(ptr); -} - -#endif /* M_I86 */ - -#endif /* SYS16BIT */ - - -#ifndef MY_ZCALLOC /* Any system without a special alloc function */ - -#ifndef STDC -extern voidp malloc OF((uInt size)); -extern voidp calloc OF((uInt items, uInt size)); -extern void free OF((voidpf ptr)); -#endif - -voidpf zcalloc (opaque, items, size) - voidpf opaque; - unsigned items; - unsigned size; -{ - if (opaque) items += size - size; /* make compiler happy */ - return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) : - (voidpf)calloc(items, size); -} - -void zcfree (opaque, ptr) - voidpf opaque; - voidpf ptr; -{ - free(ptr); - if (opaque) return; /* make compiler happy */ -} - -#endif /* MY_ZCALLOC */ diff --git a/src/zlib/zutil.h b/src/zlib/zutil.h deleted file mode 100644 index e0e192c8d..000000000 --- a/src/zlib/zutil.h +++ /dev/null @@ -1,269 +0,0 @@ -/* zutil.h -- internal interface and configuration of the compression library - * Copyright (C) 1995-2005 Jean-loup Gailly. - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* WARNING: this file should *not* be used by applications. It is - part of the implementation of the compression library and is - subject to change. Applications should only use zlib.h. - */ - -/* @(#) $Id: zutil.h 126 2003-11-09 01:53:27Z gabest $ */ - -#ifndef ZUTIL_H -#define ZUTIL_H - -#define ZLIB_INTERNAL -#include "zlib.h" - -#ifdef STDC -# ifndef _WIN32_WCE -# include -# endif -# include -# include -#endif -#ifdef NO_ERRNO_H -# ifdef _WIN32_WCE - /* The Microsoft C Run-Time Library for Windows CE doesn't have - * errno. We define it as a global variable to simplify porting. - * Its value is always 0 and should not be used. We rename it to - * avoid conflict with other libraries that use the same workaround. - */ -# define errno z_errno -# endif - extern int errno; -#else -# ifndef _WIN32_WCE -# include -# endif -#endif - -#ifndef local -# define local static -#endif -/* compile with -Dlocal if your debugger can't find static symbols */ - -typedef unsigned char uch; -typedef uch FAR uchf; -typedef unsigned short ush; -typedef ush FAR ushf; -typedef unsigned long ulg; - -extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ -/* (size given to avoid silly warnings with Visual C++) */ - -#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)] - -#define ERR_RETURN(strm,err) \ - return (strm->msg = (char*)ERR_MSG(err), (err)) -/* To be used only when the state is known to be valid */ - - /* common constants */ - -#ifndef DEF_WBITS -# define DEF_WBITS MAX_WBITS -#endif -/* default windowBits for decompression. MAX_WBITS is for compression only */ - -#if MAX_MEM_LEVEL >= 8 -# define DEF_MEM_LEVEL 8 -#else -# define DEF_MEM_LEVEL MAX_MEM_LEVEL -#endif -/* default memLevel */ - -#define STORED_BLOCK 0 -#define STATIC_TREES 1 -#define DYN_TREES 2 -/* The three kinds of block type */ - -#define MIN_MATCH 3 -#define MAX_MATCH 258 -/* The minimum and maximum match lengths */ - -#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */ - - /* target dependencies */ - -#if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32)) -# define OS_CODE 0x00 -# if defined(__TURBOC__) || defined(__BORLANDC__) -# if(__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__)) - /* Allow compilation with ANSI keywords only enabled */ - void _Cdecl farfree( void *block ); - void *_Cdecl farmalloc( unsigned long nbytes ); -# else -# include -# endif -# else /* MSC or DJGPP */ -# include -# endif -#endif - -#ifdef AMIGA -# define OS_CODE 0x01 -#endif - -#if defined(VAXC) || defined(VMS) -# define OS_CODE 0x02 -# define F_OPEN(name, mode) \ - fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512") -#endif - -#if defined(ATARI) || defined(atarist) -# define OS_CODE 0x05 -#endif - -#ifdef OS2 -# define OS_CODE 0x06 -# ifdef M_I86 - #include -# endif -#endif - -#if defined(MACOS) || defined(TARGET_OS_MAC) -# define OS_CODE 0x07 -# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os -# include /* for fdopen */ -# else -# ifndef fdopen -# define fdopen(fd,mode) NULL /* No fdopen() */ -# endif -# endif -#endif - -#ifdef TOPS20 -# define OS_CODE 0x0a -#endif - -#ifdef WIN32 -# ifndef __CYGWIN__ /* Cygwin is Unix, not Win32 */ -# define OS_CODE 0x0b -# endif -#endif - -#ifdef __50SERIES /* Prime/PRIMOS */ -# define OS_CODE 0x0f -#endif - -#if defined(_BEOS_) || defined(RISCOS) -# define fdopen(fd,mode) NULL /* No fdopen() */ -#endif - -#if (defined(_MSC_VER) && (_MSC_VER > 600)) -# if defined(_WIN32_WCE) -# define fdopen(fd,mode) NULL /* No fdopen() */ -# ifndef _PTRDIFF_T_DEFINED - typedef int ptrdiff_t; -# define _PTRDIFF_T_DEFINED -# endif -# else -# define fdopen(fd,type) _fdopen(fd,type) -# endif -#endif - - /* common defaults */ - -#ifndef OS_CODE -# define OS_CODE 0x03 /* assume Unix */ -#endif - -#ifndef F_OPEN -# define F_OPEN(name, mode) fopen((name), (mode)) -#endif - - /* functions */ - -#if defined(STDC99) || (defined(__TURBOC__) && __TURBOC__ >= 0x550) -# ifndef HAVE_VSNPRINTF -# define HAVE_VSNPRINTF -# endif -#endif -#if defined(__CYGWIN__) -# ifndef HAVE_VSNPRINTF -# define HAVE_VSNPRINTF -# endif -#endif -#ifndef HAVE_VSNPRINTF -# ifdef MSDOS - /* vsnprintf may exist on some MS-DOS compilers (DJGPP?), - but for now we just assume it doesn't. */ -# define NO_vsnprintf -# endif -# ifdef __TURBOC__ -# define NO_vsnprintf -# endif -# ifdef WIN32 - /* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */ -# if !defined(vsnprintf) && !defined(NO_vsnprintf) -# define vsnprintf _vsnprintf -# endif -# endif -# ifdef __SASC -# define NO_vsnprintf -# endif -#endif -#ifdef VMS -# define NO_vsnprintf -#endif - -#if defined(pyr) -# define NO_MEMCPY -#endif -#if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__) - /* Use our own functions for small and medium model with MSC <= 5.0. - * You may have to use the same strategy for Borland C (untested). - * The __SC__ check is for Symantec. - */ -# define NO_MEMCPY -#endif -#if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY) -# define HAVE_MEMCPY -#endif -#ifdef HAVE_MEMCPY -# ifdef SMALL_MEDIUM /* MSDOS small or medium model */ -# define zmemcpy _fmemcpy -# define zmemcmp _fmemcmp -# define zmemzero(dest, len) _fmemset(dest, 0, len) -# else -# define zmemcpy memcpy -# define zmemcmp memcmp -# define zmemzero(dest, len) memset(dest, 0, len) -# endif -#else - extern void zmemcpy OF((Bytef* dest, const Bytef* source, uInt len)); - extern int zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len)); - extern void zmemzero OF((Bytef* dest, uInt len)); -#endif - -/* Diagnostic functions */ -#ifdef DEBUG -# include - extern int z_verbose; - extern void z_error OF((char *m)); -# define Assert(cond,msg) {if(!(cond)) z_error(msg);} -# define Trace(x) {if (z_verbose>=0) fprintf x ;} -# define Tracev(x) {if (z_verbose>0) fprintf x ;} -# define Tracevv(x) {if (z_verbose>1) fprintf x ;} -# define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;} -# define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;} -#else -# define Assert(cond,msg) -# define Trace(x) -# define Tracev(x) -# define Tracevv(x) -# define Tracec(c,x) -# define Tracecv(c,x) -#endif - - -voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size)); -void zcfree OF((voidpf opaque, voidpf ptr)); - -#define ZALLOC(strm, items, size) \ - (*((strm)->zalloc))((strm)->opaque, (items), (size)) -#define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr)) -#define TRY_FREE(s, p) {if (p) ZFREE(s, p);} - -#endif /* ZUTIL_H */