diff options
author | initial.commit <initial.commit@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-07-26 23:55:29 +0000 |
---|---|---|
committer | initial.commit <initial.commit@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-07-26 23:55:29 +0000 |
commit | 09911bf300f1a419907a9412154760efd0b7abc3 (patch) | |
tree | f131325fb4e2ad12c6d3504ab75b16dd92facfed /chrome/test/activex_test_control | |
parent | 586acc5fe142f498261f52c66862fa417c3d52d2 (diff) | |
download | chromium_src-09911bf300f1a419907a9412154760efd0b7abc3.zip chromium_src-09911bf300f1a419907a9412154760efd0b7abc3.tar.gz chromium_src-09911bf300f1a419907a9412154760efd0b7abc3.tar.bz2 |
Add chrome to the repository.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/activex_test_control')
-rw-r--r-- | chrome/test/activex_test_control/SConscript | 93 | ||||
-rw-r--r-- | chrome/test/activex_test_control/activex_test_control.cc | 74 | ||||
-rw-r--r-- | chrome/test/activex_test_control/activex_test_control.def | 9 | ||||
-rw-r--r-- | chrome/test/activex_test_control/activex_test_control.idl | 108 | ||||
-rw-r--r-- | chrome/test/activex_test_control/activex_test_control.rc | 128 | ||||
-rw-r--r-- | chrome/test/activex_test_control/activex_test_control.rgs | 11 | ||||
-rw-r--r-- | chrome/test/activex_test_control/activex_test_control.vcproj | 193 | ||||
-rw-r--r-- | chrome/test/activex_test_control/activex_test_control.vsprops | 26 | ||||
-rw-r--r-- | chrome/test/activex_test_control/chrome_test_control.bmp | bin | 0 -> 246 bytes | |||
-rw-r--r-- | chrome/test/activex_test_control/chrome_test_control.cc | 59 | ||||
-rw-r--r-- | chrome/test/activex_test_control/chrome_test_control.h | 286 | ||||
-rw-r--r-- | chrome/test/activex_test_control/chrome_test_control.rgs | 34 | ||||
-rw-r--r-- | chrome/test/activex_test_control/chrome_test_control_cp.h | 42 | ||||
-rw-r--r-- | chrome/test/activex_test_control/resource.h | 19 |
14 files changed, 1082 insertions, 0 deletions
diff --git a/chrome/test/activex_test_control/SConscript b/chrome/test/activex_test_control/SConscript new file mode 100644 index 0000000..6f459c1 --- /dev/null +++ b/chrome/test/activex_test_control/SConscript @@ -0,0 +1,93 @@ +# Copyright 2008, Google Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Import('env')
+
+env = env.Clone()
+
+
+env.Prepend(
+ CPPPATH = [
+ '.',
+ '#/..',
+ ],
+ LINKFLAGS = [
+ '/INCREMENTAL',
+
+ '/MANIFEST',
+ '/DELAYLOAD:"dwmapi.dll"',
+ '/DELAYLOAD:"uxtheme.dll"',
+ '/MACHINE:X86',
+ '/FIXED:No',
+
+ '/safeseh',
+ '/dynamicbase',
+ '/ignore:4199',
+ '/nxcompat',
+
+ '/DEBUG',
+ ],
+ LIBS = [
+ 'wininet.lib',
+ 'version.lib',
+ 'msimg32.lib',
+ 'ws2_32.lib',
+ 'usp10.lib',
+ 'psapi.lib',
+ 'comsuppw.lib',
+ 'kernel32.lib',
+ 'user32.lib',
+ 'gdi32.lib',
+ 'winspool.lib',
+ 'comdlg32.lib',
+ 'advapi32.lib',
+ 'shell32.lib',
+ 'ole32.lib',
+ 'oleaut32.lib',
+ 'uuid.lib',
+ 'odbc32.lib',
+ 'odbccp32.lib',
+
+ 'DelayImp.lib',
+ ],
+)
+
+env.TypeLibrary('activex_test_control.idl')
+
+input_files = [
+ 'activex_test_control.cc',
+ 'activex_test_control.def',
+ 'chrome_test_control.cc',
+]
+
+dll = env.SharedLibrary(['activex_test_control', 'activex_test_control.lib'],
+ input_files)
+
+i = env.Install('$TARGET_ROOT', dll)
+env.Alias('chrome', i)
diff --git a/chrome/test/activex_test_control/activex_test_control.cc b/chrome/test/activex_test_control/activex_test_control.cc new file mode 100644 index 0000000..829cb9a --- /dev/null +++ b/chrome/test/activex_test_control/activex_test_control.cc @@ -0,0 +1,74 @@ +// Copyright 2008, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include <atlbase.h> +#include <atlcom.h> + +#include "activex_test_control.h" +#include "activex_test_control_i.c" +#include "chrome/test/activex_test_control/resource.h" + +class ActiveXTestControllModule + : public CAtlDllModuleT<ActiveXTestControllModule> { + public: + DECLARE_LIBID(LIBID_activex_test_controlLib) + DECLARE_REGISTRY_APPID_RESOURCEID(IDR_ACTIVEX_TEST_CONTROL, + "{CDBC0D94-AFF6-4918-90A9-7967179A77D8}") +}; + +ActiveXTestControllModule g_atlmodule; + +// DLL Entry Point +extern "C" BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, + LPVOID reserved) { + return g_atlmodule.DllMain(reason, reserved); +} + +// Used to determine whether the DLL can be unloaded by OLE +STDAPI DllCanUnloadNow(void) { + return g_atlmodule.DllCanUnloadNow(); +} + +// Returns a class factory to create an object of the requested type +STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv) { + return g_atlmodule.DllGetClassObject(rclsid, riid, ppv); +} + +// DllRegisterServer - Adds entries to the system registry +STDAPI DllRegisterServer(void) { + // registers object, typelib and all interfaces in typelib + HRESULT hr = g_atlmodule.DllRegisterServer(); + return hr; +} + +// DllUnregisterServer - Removes entries from the system registry +STDAPI DllUnregisterServer(void) { + HRESULT hr = g_atlmodule.DllUnregisterServer(); + return hr; +} diff --git a/chrome/test/activex_test_control/activex_test_control.def b/chrome/test/activex_test_control/activex_test_control.def new file mode 100644 index 0000000..b006b57 --- /dev/null +++ b/chrome/test/activex_test_control/activex_test_control.def @@ -0,0 +1,9 @@ +; activex_test_control.def : Declares the module parameters. + +LIBRARY "activex_test_control.DLL" + +EXPORTS + DllCanUnloadNow PRIVATE + DllGetClassObject PRIVATE + DllRegisterServer PRIVATE + DllUnregisterServer PRIVATE diff --git a/chrome/test/activex_test_control/activex_test_control.idl b/chrome/test/activex_test_control/activex_test_control.idl new file mode 100644 index 0000000..04a2f42 --- /dev/null +++ b/chrome/test/activex_test_control/activex_test_control.idl @@ -0,0 +1,108 @@ +// Copyright 2008, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// This file will be processed by the MIDL tool to +// produce the type library (activex_test_control.tlb) and marshalling code. + +#include "olectl.h" +import "oaidl.idl"; +import "ocidl.idl"; + +[ + object, + uuid(9AC37249-E247-4B82-AC1E-0917737528E9), + dual, + nonextensible, + helpstring("IChromeTestControl Interface"), + pointer_default(unique) +] +interface IChromeTestControl : IDispatch{ + [propput, bindable, requestedit, id(DISPID_BACKCOLOR)] + HRESULT BackColor([in]OLE_COLOR clr); + [propget, bindable, requestedit, id(DISPID_BACKCOLOR)] + HRESULT BackColor([out,retval]OLE_COLOR* pclr); + [propput, bindable, requestedit, id(DISPID_BORDERCOLOR)] + HRESULT BorderColor([in]OLE_COLOR clr); + [propget, bindable, requestedit, id(DISPID_BORDERCOLOR)] + HRESULT BorderColor([out, retval]OLE_COLOR* pclr); + [propput, bindable, requestedit, id(DISPID_FORECOLOR)] + HRESULT ForeColor([in]OLE_COLOR clr); + [propget, bindable, requestedit, id(DISPID_FORECOLOR)] + HRESULT ForeColor([out,retval]OLE_COLOR* pclr); + [propput, bindable, requestedit, id(DISPID_CAPTION)] + HRESULT Caption([in]BSTR strCaption); + [propget, bindable, requestedit, id(DISPID_CAPTION)] + HRESULT Caption([out,retval]BSTR* pstrCaption); + [propget, id(1), helpstring("property StringProp")] HRESULT StringProp([out, retval] BSTR* pVal); + [propput, id(1), helpstring("property StringProp")] HRESULT StringProp([in] BSTR newVal); + [propget, id(2), helpstring("property LongProp")] HRESULT LongProp([out, retval] LONG* pVal); + [propput, id(2), helpstring("property LongProp")] HRESULT LongProp([in] LONG newVal); + [propget, id(3), helpstring("property DoubleProp")] HRESULT DoubleProp([out, retval] DOUBLE* pVal); + [propput, id(3), helpstring("property DoubleProp")] HRESULT DoubleProp([in] DOUBLE newVal); + [propget, id(4), helpstring("property BoolProp")] HRESULT BoolProp([out, retval] VARIANT_BOOL* pVal); + [propput, id(4), helpstring("property BoolProp")] HRESULT BoolProp([in] VARIANT_BOOL newVal); + [propget, id(5), helpstring("property ByteProp")] HRESULT ByteProp([out, retval] BYTE* pVal); + [propput, id(5), helpstring("property ByteProp")] HRESULT ByteProp([in] BYTE newVal); + [propget, id(6), helpstring("property FloatProp")] HRESULT FloatProp([out, retval] FLOAT* pVal); + [propput, id(6), helpstring("property FloatProp")] HRESULT FloatProp([in] FLOAT newVal); + [id(7), helpstring("method BigSetMethod")] HRESULT BigSetMethodRet([in] BSTR string_param, [in] BYTE byte_param, [in] FLOAT float_param, [in] VARIANT_BOOL bool_param, [out,retval] BSTR* ret); + [id(8), helpstring("method SetByte")] HRESULT SetByte([in] BYTE val); + [id(9), helpstring("method SetByteRet")] HRESULT SetByteRet([in] BYTE byte_param, [out,retval] BYTE* ret); + [id(10), helpstring("method SetStringRet")] HRESULT SetStringRet([in] BSTR val, [out,retval] BSTR* ret); + [id(11), helpstring("method GetCookie")] HRESULT GetCookie([out,retval] BSTR* cookie); +}; + +[ + uuid(83D767F4-5C4F-4ACA-B0E8-928C54845C33), + version(1.0), + helpstring("activex_test_control 1.0 Type Library") +] +library activex_test_controlLib +{ + importlib("stdole2.tlb"); + [ + uuid(EF88DE01-35AF-463F-9802-1BF908F48696), + helpstring("_IChromeTestControlEvents Interface") + ] + dispinterface _IChromeTestControlEvents + { + properties: + methods: + }; + [ + uuid(4E174456-5EE6-494D-B6F2-2B52898A620E), + control, + helpstring("ChromeTestControl Class") + ] + coclass ChromeTestControl + { + [default] interface IChromeTestControl; + [default, source] dispinterface _IChromeTestControlEvents; + }; +}; diff --git a/chrome/test/activex_test_control/activex_test_control.rc b/chrome/test/activex_test_control/activex_test_control.rc new file mode 100644 index 0000000..e6046bd --- /dev/null +++ b/chrome/test/activex_test_control/activex_test_control.rc @@ -0,0 +1,128 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "winres.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 ""winres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "1 TYPELIB ""activex_test_control.tlb""\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,0,0,1 + PRODUCTVERSION 1,0,0,1 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904e4" + BEGIN + VALUE "CompanyName", "Google Inc." + VALUE "FileDescription", "ActiveX Test Control" + VALUE "FileVersion", "1.0.0.1" + VALUE "LegalCopyright", "Google Inc. All rights reserved." + VALUE "InternalName", "activex_test_control.dll" + VALUE "OriginalFilename", "activex_test_control.dll" + VALUE "ProductName", "Google Chrome" + VALUE "ProductVersion", "1.0.0.1" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1252 + END +END + + +///////////////////////////////////////////////////////////////////////////// +// +// REGISTRY +// + +IDR_ACTIVEX_TEST_CONTROL REGISTRY "activex_test_control.rgs" +IDR_CHROMETESTCONTROL REGISTRY "chrome_test_control.rgs" + +///////////////////////////////////////////////////////////////////////////// +// +// Bitmap +// + +IDB_CHROMETESTCONTROL BITMAP "chrome_test_control.bmp" + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE +BEGIN + IDS_PROJNAME "activex_test_control" +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// +1 TYPELIB "activex_test_control.tlb" + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/chrome/test/activex_test_control/activex_test_control.rgs b/chrome/test/activex_test_control/activex_test_control.rgs new file mode 100644 index 0000000..2873a48 --- /dev/null +++ b/chrome/test/activex_test_control/activex_test_control.rgs @@ -0,0 +1,11 @@ +HKCR +{ + NoRemove AppID + { + '%APPID%' = s 'activex_test_control' + 'activex_test_control.DLL' + { + val AppID = s '%APPID%' + } + } +} diff --git a/chrome/test/activex_test_control/activex_test_control.vcproj b/chrome/test/activex_test_control/activex_test_control.vcproj new file mode 100644 index 0000000..b40d9b3e --- /dev/null +++ b/chrome/test/activex_test_control/activex_test_control.vcproj @@ -0,0 +1,193 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="8.00" + Name="activex_test_control" + ProjectGUID="{414D4D24-5D65-498B-A33F-3A29AD3CDEDC}" + RootNamespace="activex_test_control" + Keyword="AtlProj" + > + <Platforms> + <Platform + Name="Win32" + /> + </Platforms> + <ToolFiles> + </ToolFiles> + <Configurations> + <Configuration + Name="Debug|Win32" + ConfigurationType="2" + InheritedPropertySheets=".\activex_test_control.vsprops;$(SolutionDir)..\build\debug.vsprops" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCWebDeploymentTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Release|Win32" + ConfigurationType="2" + InheritedPropertySheets=".\activex_test_control.vsprops;$(SolutionDir)..\build\release.vsprops" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCWebDeploymentTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <Filter + Name="resource" + > + <File + RelativePath=".\activex_test_control.rc" + > + </File> + <File + RelativePath=".\activex_test_control.rgs" + > + </File> + <File + RelativePath=".\chrome_test_control.bmp" + > + </File> + <File + RelativePath=".\chrome_test_control.rgs" + > + </File> + </Filter> + <File + RelativePath=".\activex_test_control.cc" + > + </File> + <File + RelativePath=".\activex_test_control.def" + > + </File> + <File + RelativePath=".\activex_test_control.idl" + > + </File> + <File + RelativePath=".\chrome_test_control.cc" + > + </File> + <File + RelativePath=".\chrome_test_control.h" + > + </File> + <File + RelativePath=".\chrome_test_control_cp.h" + > + </File> + <File + RelativePath=".\resource.h" + > + </File> + </Files> + <Globals> + </Globals> +</VisualStudioProject> diff --git a/chrome/test/activex_test_control/activex_test_control.vsprops b/chrome/test/activex_test_control/activex_test_control.vsprops new file mode 100644 index 0000000..d873ddf --- /dev/null +++ b/chrome/test/activex_test_control/activex_test_control.vsprops @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioPropertySheet + ProjectType="Visual C++" + Version="8.00" + Name="activex_test_control" + InheritedPropertySheets="$(SolutionDir)..\build\common.vsprops" + UseOfATL="1" + ATLMinimizesCRunTimeLibraryUsage="false" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="$(IntDir)" + /> + <Tool + Name="VCLinkerTool" + RegisterOutput="false" + IgnoreImportLibrary="true" + AdditionalDependencies="comsuppw.lib" + OutputFile="$(OutDir)\activex_test_control.dll" + ModuleDefinitionFile=".\activex_test_control.def" + /> + <Tool + Name="VCResourceCompilerTool" + AdditionalIncludeDirectories="$(IntDir)" + /> +</VisualStudioPropertySheet> diff --git a/chrome/test/activex_test_control/chrome_test_control.bmp b/chrome/test/activex_test_control/chrome_test_control.bmp Binary files differnew file mode 100644 index 0000000..1229764 --- /dev/null +++ b/chrome/test/activex_test_control/chrome_test_control.bmp diff --git a/chrome/test/activex_test_control/chrome_test_control.cc b/chrome/test/activex_test_control/chrome_test_control.cc new file mode 100644 index 0000000..5b0655c --- /dev/null +++ b/chrome/test/activex_test_control/chrome_test_control.cc @@ -0,0 +1,59 @@ +// Copyright 2008, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "chrome/test/activex_test_control/chrome_test_control.h" + +// CChromeTestControl +HRESULT ChromeTestControl::OnDraw(ATL_DRAWINFO& di) { + RECT& rc = *(RECT*)di.prcBounds; + // Set Clip region to the rectangle specified by di.prcBounds + HRGN rgn_old = NULL; + if (GetClipRgn(di.hdcDraw, rgn_old) != 1) + rgn_old = NULL; + bool select_old_rgn = false; + + HRGN rgn_new = CreateRectRgn(rc.left, rc.top, rc.right, rc.bottom); + + if (rgn_new != NULL) + select_old_rgn = (SelectClipRgn(di.hdcDraw, rgn_new) != ERROR); + + Rectangle(di.hdcDraw, rc.left, rc.top, rc.right, rc.bottom); + SetTextAlign(di.hdcDraw, TA_CENTER|TA_BASELINE); + LPCTSTR pszText = _T("ATL 8.0 : ChromeTestControl"); + TextOut(di.hdcDraw, + (rc.left + rc.right) / 2, + (rc.top + rc.bottom) / 2, + pszText, + lstrlen(pszText)); + + if (select_old_rgn) + SelectClipRgn(di.hdcDraw, rgn_old); + + return S_OK; +} diff --git a/chrome/test/activex_test_control/chrome_test_control.h b/chrome/test/activex_test_control/chrome_test_control.h new file mode 100644 index 0000000..e923307 --- /dev/null +++ b/chrome/test/activex_test_control/chrome_test_control.h @@ -0,0 +1,286 @@ +// Copyright 2008, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CHROME_TEST_ACTIVEX_TEST_CONTROL_CHROME_TEST_CONTROL_H__ +#define CHROME_TEST_ACTIVEX_TEST_CONTROL_CHROME_TEST_CONTROL_H__ + +#include <atlbase.h> +#include <atlcom.h> +#include <atlctl.h> +#include <comutil.h> +#include "activex_test_control.h" +#include "chrome/test/activex_test_control/chrome_test_control_cp.h" +#include "chrome/test/activex_test_control/resource.h" + +// ChromeTestControl +class ATL_NO_VTABLE ChromeTestControl + : public CComObjectRootEx<CComSingleThreadModel>, + public CStockPropImpl<ChromeTestControl, IChromeTestControl>, + public IPersistStreamInitImpl<ChromeTestControl>, + public IOleControlImpl<ChromeTestControl>, + public IOleObjectImpl<ChromeTestControl>, + public IOleInPlaceActiveObjectImpl<ChromeTestControl>, + public IViewObjectExImpl<ChromeTestControl>, + public IOleInPlaceObjectWindowlessImpl<ChromeTestControl>, + public ISupportErrorInfo, + public IConnectionPointContainerImpl<ChromeTestControl>, + public CProxy_IChromeTestControlEvents<ChromeTestControl>, + public IObjectWithSiteImpl<ChromeTestControl>, + public IServiceProviderImpl<ChromeTestControl>, + public IPersistStorageImpl<ChromeTestControl>, + public ISpecifyPropertyPagesImpl<ChromeTestControl>, + public IQuickActivateImpl<ChromeTestControl>, + public IDataObjectImpl<ChromeTestControl>, + public IProvideClassInfo2Impl<&CLSID_ChromeTestControl, + &__uuidof(_IChromeTestControlEvents), &LIBID_activex_test_controlLib>, + public IPropertyNotifySinkCP<ChromeTestControl>, + public IObjectSafetyImpl<ChromeTestControl, + INTERFACESAFE_FOR_UNTRUSTED_CALLER | + INTERFACESAFE_FOR_UNTRUSTED_DATA>, + public CComCoClass<ChromeTestControl, &CLSID_ChromeTestControl>, + public CComControl<ChromeTestControl> { + public: + ChromeTestControl() { + } + +DECLARE_OLEMISC_STATUS(OLEMISC_RECOMPOSEONRESIZE | + OLEMISC_CANTLINKINSIDE | + OLEMISC_INSIDEOUT | + OLEMISC_ACTIVATEWHENVISIBLE | + OLEMISC_SETCLIENTSITEFIRST) + +DECLARE_REGISTRY_RESOURCEID(IDR_CHROMETESTCONTROL) + +BEGIN_COM_MAP(ChromeTestControl) + COM_INTERFACE_ENTRY(IChromeTestControl) + COM_INTERFACE_ENTRY(IDispatch) + COM_INTERFACE_ENTRY(IViewObjectEx) + COM_INTERFACE_ENTRY(IViewObject2) + COM_INTERFACE_ENTRY(IViewObject) + COM_INTERFACE_ENTRY(IOleInPlaceObjectWindowless) + COM_INTERFACE_ENTRY(IOleInPlaceObject) + COM_INTERFACE_ENTRY2(IOleWindow, IOleInPlaceObjectWindowless) + COM_INTERFACE_ENTRY(IOleInPlaceActiveObject) + COM_INTERFACE_ENTRY(IOleControl) + COM_INTERFACE_ENTRY(IOleObject) + COM_INTERFACE_ENTRY(IPersistStreamInit) + COM_INTERFACE_ENTRY2(IPersist, IPersistStreamInit) + COM_INTERFACE_ENTRY(ISupportErrorInfo) + COM_INTERFACE_ENTRY(IConnectionPointContainer) + COM_INTERFACE_ENTRY(ISpecifyPropertyPages) + COM_INTERFACE_ENTRY(IQuickActivate) + COM_INTERFACE_ENTRY(IPersistStorage) + COM_INTERFACE_ENTRY(IDataObject) + COM_INTERFACE_ENTRY(IProvideClassInfo) + COM_INTERFACE_ENTRY(IProvideClassInfo2) + COM_INTERFACE_ENTRY(IObjectWithSite) + COM_INTERFACE_ENTRY(IServiceProvider) + COM_INTERFACE_ENTRY_IID(IID_IObjectSafety, IObjectSafety) +END_COM_MAP() + +BEGIN_PROP_MAP(ChromeTestControl) + PROP_DATA_ENTRY("_cx", m_sizeExtent.cx, VT_UI4) + PROP_DATA_ENTRY("_cy", m_sizeExtent.cy, VT_UI4) + PROP_ENTRY("BackColor", DISPID_BACKCOLOR, CLSID_StockColorPage) + PROP_ENTRY("BorderColor", DISPID_BORDERCOLOR, CLSID_StockColorPage) + PROP_ENTRY("Caption", DISPID_CAPTION, CLSID_NULL) + PROP_ENTRY("ForeColor", DISPID_FORECOLOR, CLSID_StockColorPage) + // Example entries + // PROP_ENTRY("Property Description", dispid, clsid) + // PROP_PAGE(CLSID_StockColorPage) +END_PROP_MAP() + +BEGIN_CONNECTION_POINT_MAP(ChromeTestControl) + CONNECTION_POINT_ENTRY(IID_IPropertyNotifySink) + CONNECTION_POINT_ENTRY(__uuidof(_IChromeTestControlEvents)) +END_CONNECTION_POINT_MAP() + +BEGIN_MSG_MAP(ChromeTestControl) + CHAIN_MSG_MAP(CComControl<ChromeTestControl>) + DEFAULT_REFLECTION_HANDLER() +END_MSG_MAP() + + // ISupportsErrorInfo + STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid) { + static const IID* arr[] = { + &IID_IChromeTestControl, + }; + + for (int i=0; i<sizeof(arr)/sizeof(arr[0]); i++) { + if (InlineIsEqualGUID(*arr[i], riid)) + return S_OK; + } + return S_FALSE; + } + + // IViewObjectEx + DECLARE_VIEW_STATUS(VIEWSTATUS_SOLIDBKGND | VIEWSTATUS_OPAQUE) + +// IChromeTestControl + public: + HRESULT OnDraw(ATL_DRAWINFO& di); + + void OnBackColorChanged() { + ATLTRACE(_T("OnBackColorChanged\n")); + } + void OnBorderColorChanged() { + ATLTRACE(_T("OnBorderColorChanged\n")); + } + void OnCaptionChanged() { + ATLTRACE(_T("OnCaptionChanged\n")); + } + void OnForeColorChanged() { + ATLTRACE(_T("OnForeColorChanged\n")); + } + STDMETHOD(_InternalQueryService)(REFGUID guidService, REFIID riid, + void** ppvObject) { + return E_NOTIMPL; + } + + DECLARE_PROTECT_FINAL_CONSTRUCT() + + HRESULT FinalConstruct() { + return S_OK; + } + + void FinalRelease() { + } + + STDMETHOD(get_StringProp)(BSTR* val) { + *val = string_prop_.copy(); + return S_OK; + } + + STDMETHOD(put_StringProp)(BSTR val) { + string_prop_ = val; + return S_OK; + } + STDMETHOD(get_LongProp)(LONG* val) { + *val = long_prop_; + return S_OK; + } + + STDMETHOD(put_LongProp)(LONG val) { + long_prop_ = val; + return S_OK; + } + STDMETHOD(get_DoubleProp)(DOUBLE* val) { + *val = double_prop_; + return S_OK; + } + + STDMETHOD(put_DoubleProp)(DOUBLE val) { + double_prop_ = val; + return S_OK; + } + + STDMETHOD(get_BoolProp)(VARIANT_BOOL* val) { + *val = bool_prop_; + return S_OK; + } + + STDMETHOD(put_BoolProp)(VARIANT_BOOL val) { + bool_prop_ = val; + return S_OK; + } + + STDMETHOD(get_ByteProp)(BYTE* val) { + *val = byte_prop_; + return S_OK; + } + + STDMETHOD(put_ByteProp)(BYTE val) { + byte_prop_ = val; + return S_OK; + } + + STDMETHOD(get_FloatProp)(FLOAT* val) { + *val = float_prop_; + return S_OK; + } + + STDMETHOD(put_FloatProp)(FLOAT val) { + float_prop_ = val; + return S_OK; + } + + STDMETHOD(SetByte)(BYTE val) { + byte_prop_ = val; + return S_OK; + } + STDMETHOD(SetByteRet)(BYTE val, BYTE* ret) { + byte_prop_ = val; + *ret = val; + return S_OK; + } + STDMETHOD(SetStringRet)(BSTR val, BSTR* ret) { + string_prop_ = val; + *ret = string_prop_.copy(); + return S_OK; + } + STDMETHOD(BigSetMethodRet)(BSTR string_param, BYTE byte_param, + FLOAT float_param, VARIANT_BOOL bool_param, + BSTR* ret) { + string_prop_ = string_param; + byte_prop_ = byte_param; + float_prop_ = float_param; + bool_prop_ = bool_param; + *ret = SysAllocString(string_param); + return S_OK; + } + STDMETHOD(GetCookie)(BSTR* cookie) { + CComPtr<IOleContainer> container; + m_spClientSite->GetContainer(&container); + CComQIPtr<IHTMLDocument2> doc = container; + if (doc == NULL) { + *cookie = SysAllocString(L"Bad"); + return S_FALSE; + } else { + return doc->get_cookie(cookie); + } + } + + // These varialbes are used by CStockPropImpl invisibly and they have to be + // be public to be accessible. + OLE_COLOR m_clrBackColor; + OLE_COLOR m_clrBorderColor; + CComBSTR m_bstrCaption; + OLE_COLOR m_clrForeColor; + private: + _bstr_t string_prop_; + LONG long_prop_; + DOUBLE double_prop_; + VARIANT_BOOL bool_prop_; + BYTE byte_prop_; + FLOAT float_prop_; +}; + +OBJECT_ENTRY_AUTO(__uuidof(ChromeTestControl), ChromeTestControl) + +#endif // #ifndef CHROME_TEST_ACTIVEX_TEST_CONTROL_CHROME_TEST_CONTROL_H__ diff --git a/chrome/test/activex_test_control/chrome_test_control.rgs b/chrome/test/activex_test_control/chrome_test_control.rgs new file mode 100644 index 0000000..9e327bc --- /dev/null +++ b/chrome/test/activex_test_control/chrome_test_control.rgs @@ -0,0 +1,34 @@ +HKCR +{ + activex_test_control.ChromeTestContro.1 = s 'ChromeTestControl Class' + { + CLSID = s '{4E174456-5EE6-494D-B6F2-2B52898A620E}' + } + activex_test_control.ChromeTestControl = s 'ChromeTestControl Class' + { + CLSID = s '{4E174456-5EE6-494D-B6F2-2B52898A620E}' + CurVer = s 'activex_test_control.ChromeTestContro.1' + } + NoRemove CLSID + { + ForceRemove {4E174456-5EE6-494D-B6F2-2B52898A620E} = s 'ChromeTestControl Class' + { + ProgID = s 'activex_test_control.ChromeTestContro.1' + VersionIndependentProgID = s 'activex_test_control.ChromeTestControl' + ForceRemove 'Programmable' + InprocServer32 = s '%MODULE%' + { + val ThreadingModel = s 'Apartment' + } + val AppID = s '%APPID%' + ForceRemove 'Control' + ForceRemove 'ToolboxBitmap32' = s '%MODULE%, 102' + 'MiscStatus' = s '0' + { + '1' = s '%OLEMISC%' + } + 'TypeLib' = s '{83D767F4-5C4F-4ACA-B0E8-928C54845C33}' + 'Version' = s '1.0' + } + } +} diff --git a/chrome/test/activex_test_control/chrome_test_control_cp.h b/chrome/test/activex_test_control/chrome_test_control_cp.h new file mode 100644 index 0000000..734b326 --- /dev/null +++ b/chrome/test/activex_test_control/chrome_test_control_cp.h @@ -0,0 +1,42 @@ +// Copyright 2008, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CHROME_TEST_ACTIVEX_TEST_CONTROL_CHROME_TEST_CONTROL_CP_H__ +#define CHROME_TEST_ACTIVEX_TEST_CONTROL_CHROME_TEST_CONTROL_CP_H__ + + +template <class T> +class CProxy_IChromeTestControlEvents + : public IConnectionPointImpl<T, &__uuidof(_IChromeTestControlEvents), + CComDynamicUnkArray> { + //Warning this class will be regenerated by the wizard. + public: +}; + +#endif // #ifndef CHROME_TEST_ACTIVEX_TEST_CONTROL_CHROME_TEST_CONTROL_CP_H__ diff --git a/chrome/test/activex_test_control/resource.h b/chrome/test/activex_test_control/resource.h new file mode 100644 index 0000000..fc3cd4e --- /dev/null +++ b/chrome/test/activex_test_control/resource.h @@ -0,0 +1,19 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by activex_test_control.rc +// +#define IDS_PROJNAME 100 +#define IDR_ACTIVEX_TEST_CONTROL 101 +#define IDB_CHROMETESTCONTROL 102 +#define IDR_CHROMETESTCONTROL 103 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 201 +#define _APS_NEXT_COMMAND_VALUE 32768 +#define _APS_NEXT_CONTROL_VALUE 201 +#define _APS_NEXT_SYMED_VALUE 104 +#endif +#endif |