You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
(7) |
Apr
(5) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
---|
From: Kim Gr?s. <kim...@us...> - 2004-04-27 20:06:14
|
Update of /cvsroot/ieqabar/ieqabar/src/ieqacmd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22295/src/ieqacmd Added Files: ieqacmd.vcproj Log Message: - First check-in - Requires that genx, opensp and tidylib are located in ..\..\ - they're currently available from http://ieqabar.sf.net/temp/ieqabar-dep.zip (we'll look into that later) --- NEW FILE: ieqacmd.vcproj --- <?xml version="1.0" encoding="Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" Version="7.10" Name="ieqacmd" ProjectGUID="{7768B969-A0A1-4222-A958-E6F9F0E0F75F}" Keyword="Win32Proj"> <Platforms> <Platform Name="Win32"/> </Platforms> <Configurations> <Configuration Name="Debug|Win32" OutputDirectory="Debug" IntermediateDirectory="Debug" ConfigurationType="1" CharacterSet="2"> <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="..\include;..\library;D:\cvs\sourceforge\ieqabar\genx;D:\cvs\sourceforge\ieqabar\tidylib;D:\cvs\sourceforge\ieqabar\opensp\include;D:\cvs\sourceforge\ieqabar\opensp\generic" PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE" MinimalRebuild="TRUE" BasicRuntimeChecks="3" RuntimeLibrary="5" UsePrecompiledHeader="3" WarningLevel="3" Detect64BitPortabilityProblems="TRUE" DebugInformationFormat="4"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLinkerTool" AdditionalDependencies="..\..\genx\genx-d.lib ..\..\tidylib\tidylib-d.lib ..\..\opensp\osp15d.lib" OutputFile="$(OutDir)/ieqacmd.exe" LinkIncremental="2" GenerateDebugInformation="TRUE" ProgramDatabaseFile="$(OutDir)/ieqacmd.pdb" SubSystem="1" TargetMachine="1"/> <Tool Name="VCMIDLTool"/> <Tool Name="VCPostBuildEventTool"/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> <Tool Name="VCXMLDataGeneratorTool"/> <Tool Name="VCWebDeploymentTool"/> <Tool Name="VCManagedWrapperGeneratorTool"/> <Tool Name="VCAuxiliaryManagedWrapperGeneratorTool"/> </Configuration> <Configuration Name="Release|Win32" OutputDirectory="Release" IntermediateDirectory="Release" ConfigurationType="1" CharacterSet="2"> <Tool Name="VCCLCompilerTool" AdditionalIncludeDirectories="..\include;..\library;D:\cvs\sourceforge\ieqabar\genx;D:\cvs\sourceforge\ieqabar\tidylib;D:\cvs\sourceforge\ieqabar\opensp\include;D:\cvs\sourceforge\ieqabar\opensp\generic" PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" RuntimeLibrary="4" UsePrecompiledHeader="3" WarningLevel="3" Detect64BitPortabilityProblems="TRUE" DebugInformationFormat="3"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLinkerTool" AdditionalDependencies="..\..\genx\genx-r.lib ..\..\tidylib\tidylib-r.lib ..\..\opensp\osp151.lib" OutputFile="$(OutDir)/ieqacmd.exe" LinkIncremental="1" GenerateDebugInformation="TRUE" SubSystem="1" OptimizeReferences="2" EnableCOMDATFolding="2" TargetMachine="1"/> <Tool Name="VCMIDLTool"/> <Tool Name="VCPostBuildEventTool"/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> <Tool Name="VCXMLDataGeneratorTool"/> <Tool Name="VCWebDeploymentTool"/> <Tool Name="VCManagedWrapperGeneratorTool"/> <Tool Name="VCAuxiliaryManagedWrapperGeneratorTool"/> </Configuration> </Configurations> <References> </References> <Files> <Filter Name="Source Files" Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx" UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"> <File RelativePath=".\IEQACmd.cxx"> <FileConfiguration Name="Debug|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0"/> </FileConfiguration> <FileConfiguration Name="Release|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0"/> </FileConfiguration> </File> </Filter> <Filter Name="Common Files" Filter=""> <File RelativePath="..\library\Doctypes.cxx"> <FileConfiguration Name="Debug|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0"/> </FileConfiguration> <FileConfiguration Name="Release|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0"/> </FileConfiguration> </File> <File RelativePath="..\library\Doctypes.hxx"> </File> <File RelativePath="..\library\Helper.cxx"> <FileConfiguration Name="Debug|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0"/> </FileConfiguration> <FileConfiguration Name="Release|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0"/> </FileConfiguration> </File> <File RelativePath="..\library\Helper.hxx"> </File> <File RelativePath="..\library\IEDocument.cxx"> <FileConfiguration Name="Debug|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0"/> </FileConfiguration> <FileConfiguration Name="Release|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0"/> </FileConfiguration> </File> <File RelativePath="..\library\IEDocument.hxx"> </File> <File RelativePath="..\library\IEQA.cxx"> <FileConfiguration Name="Debug|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0"/> </FileConfiguration> <FileConfiguration Name="Release|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0"/> </FileConfiguration> </File> <File RelativePath="..\include\IEQA.hxx"> </File> <File RelativePath="..\library\IEQABase.hxx"> </File> <File RelativePath="..\library\Message.cxx"> <FileConfiguration Name="Debug|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0"/> </FileConfiguration> <FileConfiguration Name="Release|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0"/> </FileConfiguration> </File> <File RelativePath="..\library\Message.hxx"> </File> <File RelativePath="..\library\XmlWriter.cxx"> <FileConfiguration Name="Debug|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0"/> </FileConfiguration> <FileConfiguration Name="Release|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0"/> </FileConfiguration> </File> <File RelativePath="..\library\XmlWriter.hxx"> </File> </Filter> <Filter Name="Tidy Wrapper" Filter=""> <File RelativePath="..\library\HTMLTidy.cxx"> <FileConfiguration Name="Debug|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0"/> </FileConfiguration> <FileConfiguration Name="Release|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0"/> </FileConfiguration> </File> <File RelativePath="..\library\HTMLTidy.hxx"> </File> </Filter> <Filter Name="OpenSP Wrapper" Filter=""> <File RelativePath="..\library\OpenSP.cxx"> <FileConfiguration Name="Debug|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0"/> </FileConfiguration> <FileConfiguration Name="Release|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="0"/> </FileConfiguration> </File> <File RelativePath="..\library\OpenSP.hxx"> </File> </Filter> </Files> <Globals> </Globals> </VisualStudioProject> |
From: Bj?rn H?h. <hoe...@us...> - 2004-04-18 14:12:39
|
Update of /cvsroot/ieqabar/ieqabar/src/library In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18391 Modified Files: OpenSP.cxx Log Message: fix for memory leak Index: OpenSP.cxx =================================================================== RCS file: /cvsroot/ieqabar/ieqabar/src/library/OpenSP.cxx,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- OpenSP.cxx 17 Apr 2004 22:38:04 -0000 1.5 +++ OpenSP.cxx 18 Apr 2004 14:12:29 -0000 1.6 @@ -193,6 +193,9 @@ // launch the processor /* unsigned nErrors = */ egp->run(*this); + // egp no longer needed + delete egp; + // lock the temporary file again tempFile.HandsOn(); |
From: Bj?rn H?h. <hoe...@us...> - 2004-04-17 22:38:25
|
Update of /cvsroot/ieqabar/ieqabar/src/library In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31808/library Modified Files: IEDocument.cxx IEDocument.hxx IEQA.cxx OpenSP.cxx OpenSP.hxx Log Message: improved structure for library interfaces Index: IEDocument.cxx =================================================================== RCS file: /cvsroot/ieqabar/ieqabar/src/library/IEDocument.cxx,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- IEDocument.cxx 20 Mar 2004 00:28:36 -0000 1.1 +++ IEDocument.cxx 17 Apr 2004 22:38:04 -0000 1.2 @@ -15,6 +15,8 @@ m_Location = location; m_SourceCode = NULL; m_SourceCodeLen = 0; + + m_isXHTML = (XmlDecl() || XHTMLNamespace()); } IEDocument::~IEDocument() @@ -26,6 +28,10 @@ m_pDispatch.Release(); } +BOOL IEDocument::IsXHTML() +{ + return m_isXHTML; +} BSTR IEDocument::DocumentCharset() { Index: IEQA.cxx =================================================================== RCS file: /cvsroot/ieqabar/ieqabar/src/library/IEQA.cxx,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- IEQA.cxx 25 Mar 2004 13:51:37 -0000 1.2 +++ IEQA.cxx 17 Apr 2004 22:38:04 -0000 1.3 @@ -18,88 +18,150 @@ m_htmlCatalog = htmlCat; m_xmlCatalog = xmlCat; + + m_htmlVersion = NULL; + + m_orep = NULL; + m_trep = NULL; + + // todo: check whether new succeeded? + m_osp = new OpenSPReporter(m_htmlCatalog, m_xmlCatalog); + + // todo: check whether new succeeded? + m_tidy = new TidyReporter(); + + m_doc = NULL; + m_when = 0; } IEQA::~IEQA() { + if (m_osp) + delete m_osp; + + if (m_tidy) + delete m_tidy; + + if (m_trep) + delete m_trep; + + if (m_orep) + delete m_orep; } -BOOL IEQA::processDocument(LPWSTR location, IDispatch *pDispatch, FILE* file, LPCSTR stylesheet) +LPWSTR IEQA::htmlVersion() { - assert( location != NULL ); - assert( pDispatch != NULL ); - // todo: check file? + return m_htmlVersion; +} - BOOL success = FALSE; - LARGE_INTEGER liFreq, liBefore, liAfter; +BOOL IEQA::hasErrors() +{ + if (!m_orep) + return FALSE; - QueryPerformanceFrequency(&liFreq); - QueryPerformanceCounter(&liBefore); + for (INT i = 0; i < m_orep->m_messages.GetSize(); ++i) + if (m_orep->m_messages[i]->m_severity > 1) + return TRUE; + return FALSE; +} + +BOOL IEQA::writeXML(FILE* file, LPCSTR stylesheet) +{ + BOOL success; + + // todo: check file? + + // todo: check if new succeeded? XmlWriter* w = new XmlWriter(file); if (stylesheet) w->XmlStyleSheet(stylesheet); w->StartElement("Document"); - w->AddAttribute("when", (UINT)time(NULL)); + w->AddAttribute("when", m_when); - IEDocument doc(location, pDispatch); - BSTR bstrDoctype = doc.DocTypeDecl(); + LinesList lines; + m_trep->LinesToList(&lines); + m_orep->LinesToList(&lines); + + m_doc->ToXmlWriter(w, &lines, 1, 1); + m_tidy->doctypeToXmlWriter(w); + + m_orep->ToXmlWriter(w); + m_trep->ToXmlWriter(w); + + w->EndElement(); /* Document */ + w->EndDocument(); + + if (w->Success()) + success = TRUE; + + delete w; + + return success; +} + +BOOL IEQA::processDocument(LPWSTR location, IDispatch *pDispatch) +{ + assert( location != NULL ); + assert( pDispatch != NULL ); + + // memorize when document was processed + m_when = (UINT)time(NULL); + + if (m_doc) + delete m_doc; + + if (m_trep) + delete m_trep; + + if (m_orep) + delete m_orep; + + // todo: check if new succeeded? + m_trep = new TidyReport(); + + // todo: check if new succeeded? + m_orep = new OpenSPReport(); + + // todo: check if new succeeded? + m_doc = new IEDocument(location, pDispatch); + + BSTR bstrDoctype = m_doc->DocTypeDecl(); UINT nSourceCodeLen = 0; - LPCSTR sourceCode = doc.SourceCode(&nSourceCodeLen); + LPCSTR sourceCode = m_doc->SourceCode(&nSourceCodeLen); DocumentType* doctype = NULL; // try to recognize the document type declaration doctype = LookupDoctypeFromDecl(bstrDoctype); - if (!doctype && (doc.XmlDecl() || doc.XHTMLNamespace())) + if (!doctype && m_doc->IsXHTML()) { // fall back to XHTML 1.0 Transitional doctype = LookupDoctypeFromVers(X10T); + m_htmlVersion = L"XHTML"; } else if (!doctype) { // fall back to HTML 4.01 Transitional doctype = LookupDoctypeFromVers(H41T); + m_htmlVersion = L"HTML"; + } + else + { + m_htmlVersion = doctype->name; } assert( doctype != NULL ); - TidyReporter tidy; - OpenSPReporter openSP(m_htmlCatalog, m_xmlCatalog); - - TidyReport tidyReport; - OpenSPReport openSPreport; UINT offset = 0; UINT length = 0; // ... - tidy.parseForDoctype(sourceCode, &offset, &length); - tidy.processDocument(sourceCode, &tidyReport); - openSP.processDocument(sourceCode, nSourceCodeLen, offset, length, doctype, &openSPreport); - - LinesList lines; - tidyReport.LinesToList(&lines); - openSPreport.LinesToList(&lines); - - doc.ToXmlWriter(w, &lines, 1, 1); - tidy.doctypeToXmlWriter(w); - - openSPreport.ToXmlWriter(w); - tidyReport.ToXmlWriter(w); - - QueryPerformanceCounter(&liAfter); - w->Element("took", GetDuration(liBefore, liAfter, liFreq)); - - w->EndElement(); /* Document */ - w->EndDocument(); - - if (w->Success()) - success = TRUE; - - delete w; - - return success; + m_tidy->parseForDoctype(sourceCode, &offset, &length); + m_tidy->processDocument(sourceCode, m_trep); + m_osp->processDocument(sourceCode, nSourceCodeLen, offset, length, doctype, m_orep); -} \ No newline at end of file + return TRUE; +} Index: OpenSP.hxx =================================================================== RCS file: /cvsroot/ieqabar/ieqabar/src/library/OpenSP.hxx,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- OpenSP.hxx 20 Mar 2004 00:28:36 -0000 1.1 +++ OpenSP.hxx 17 Apr 2004 22:38:04 -0000 1.2 @@ -38,7 +38,6 @@ OpenSPReport* processDocument(LPCSTR oldDoc, UINT oldDocSize, UINT offset, UINT oldDeclSize, DocumentType* newDecl, OpenSPReport* r); private: - ParserEventGeneratorKit m_kit; OpenSPReport* m_report; LPCSTR m_tempFileName; Index: OpenSP.cxx =================================================================== RCS file: /cvsroot/ieqabar/ieqabar/src/library/OpenSP.cxx,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- OpenSP.cxx 25 Mar 2004 13:44:41 -0000 1.4 +++ OpenSP.cxx 17 Apr 2004 22:38:04 -0000 1.5 @@ -51,6 +51,7 @@ ) { CAtlTemporaryFile tempFile; + ParserEventGeneratorKit pegKit; LPSTR newDoc; LPSTR newDecl; UINT newDocSize; @@ -94,10 +95,10 @@ // additional warnings for uncommon SGML constructs if (m_minTag) - m_kit.setOption(ParserEventGeneratorKit::enableWarning, "min-tag"); + pegKit.setOption(ParserEventGeneratorKit::enableWarning, "min-tag"); // register the proper catalog - m_kit.setOption(ParserEventGeneratorKit::addCatalog, m_htmlCatalog); + pegKit.setOption(ParserEventGeneratorKit::addCatalog, m_htmlCatalog); } else /* IsXHTML */ { @@ -125,10 +126,10 @@ newDeclSize = sprintf(newDecl, format, (LPCSTR)publid, (LPCSTR)systid); // XML specific warnings (todo: that should be errors?) - m_kit.setOption(ParserEventGeneratorKit::enableWarning, "xml"); + pegKit.setOption(ParserEventGeneratorKit::enableWarning, "xml"); // register the proper catalog - m_kit.setOption(ParserEventGeneratorKit::addCatalog, m_xmlCatalog); + pegKit.setOption(ParserEventGeneratorKit::addCatalog, m_xmlCatalog); } // determine size of new document string @@ -184,7 +185,7 @@ m_report = r; // create a new event generator - EventGenerator *egp = m_kit.makeEventGenerator(1, (char*const*)&m_tempFileName); + EventGenerator *egp = pegKit.makeEventGenerator(1, (char*const*)&m_tempFileName); // do not output messages to stdout egp->inhibitMessages(true); Index: IEDocument.hxx =================================================================== RCS file: /cvsroot/ieqabar/ieqabar/src/library/IEDocument.hxx,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- IEDocument.hxx 20 Mar 2004 00:28:36 -0000 1.1 +++ IEDocument.hxx 17 Apr 2004 22:38:04 -0000 1.2 @@ -23,12 +23,14 @@ BSTR DocumentCharset(); BOOL XmlDecl(); BOOL ToXmlWriter(XmlWriter* w, LinesList *lines, UINT nLinesBefore, UINT nLinesAfter); + BOOL IsXHTML(); private: CComPtr<IDispatch> m_pDispatch; LPCSTR m_SourceCode; LPCWSTR m_Location; UINT m_SourceCodeLen; + BOOL m_isXHTML; }; #endif /* __IEDOCUMENT_HXX__ */ |
From: Bj?rn H?h. <hoe...@us...> - 2004-04-17 22:38:24
|
Update of /cvsroot/ieqabar/ieqabar/src/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31808/include Modified Files: IEQA.hxx Log Message: improved structure for library interfaces Index: IEQA.hxx =================================================================== RCS file: /cvsroot/ieqabar/ieqabar/src/include/IEQA.hxx,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- IEQA.hxx 25 Mar 2004 14:13:26 -0000 1.1 +++ IEQA.hxx 17 Apr 2004 22:38:04 -0000 1.2 @@ -9,16 +9,37 @@ #include <atlbase.h> +class TidyReport; +class TidyReporter; +class OpenSPReport; +class OpenSPReporter; +class IEDocument; + class IEQA { public: IEQA(LPCSTR htmlCat, LPCSTR xmlCat); ~IEQA(); - BOOL processDocument(LPWSTR location, IDispatch *pDispatch, FILE* file, LPCSTR stylesheet = NULL); + BOOL processDocument(LPWSTR location, IDispatch *pDispatch); + + BOOL writeXML(FILE* file, LPCSTR stylesheet = NULL); + LPWSTR htmlVersion(); + BOOL hasErrors(); private: - LPCSTR m_htmlCatalog; - LPCSTR m_xmlCatalog; + OpenSPReport* m_orep; + TidyReport* m_trep; + + OpenSPReporter* m_osp; + TidyReporter* m_tidy; + + IEDocument* m_doc; + + LPCSTR m_htmlCatalog; + LPCSTR m_xmlCatalog; + + UINT m_when; + LPWSTR m_htmlVersion; }; #endif /* __IEQA_HXX__ */ \ No newline at end of file |
From: Bj?rn H?h. <hoe...@us...> - 2004-04-17 22:38:13
|
Update of /cvsroot/ieqabar/ieqabar/src/ieqacmd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31808/ieqacmd Modified Files: IEQACmd.cxx Log Message: improved structure for library interfaces Index: IEQACmd.cxx =================================================================== RCS file: /cvsroot/ieqabar/ieqabar/src/ieqacmd/IEQACmd.cxx,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- IEQACmd.cxx 25 Mar 2004 14:14:23 -0000 1.1 +++ IEQACmd.cxx 17 Apr 2004 22:38:03 -0000 1.2 @@ -9,6 +9,7 @@ #include <exdispid.h> #include <atlcom.h> #include <atlhost.h> +#include <stdio.h> class CMain; class CEventSink; @@ -228,7 +229,8 @@ /////////////////////////////////////////////////////////////////////// IEQA* qa = new IEQA("c:/dtd/dtd/sgml.soc", "c:/dtd/dtd/xml.soc"); - BOOL success = qa->processDocument(CA2W(m_URI), m_pDispatch, stdout); + BOOL success = qa->processDocument(CA2W(m_URI), m_pDispatch); + success = qa->writeXML(stdout); delete qa; |
From: Bj?rn H?h. <hoe...@us...> - 2004-03-25 14:25:11
|
Update of /cvsroot/ieqabar/ieqabar/src/ieqacmd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9342 Added Files: IEQACmd.cxx Log Message: initial import --- NEW FILE: IEQACmd.cxx --- // IEQACmd.cxx -- ... // // (c) 2004 Bjoern Hoehrmann et al., see ... // // $Id: IEQACmd.cxx,v 1.1 2004/03/25 14:14:23 hoehrmann Exp $ #include "IEQA.hxx" #include <atlbase.h> #include <exdispid.h> #include <atlcom.h> #include <atlhost.h> class CMain; class CEventSink; ////////////////////////////////////////////////////////////////// // CEventSink ////////////////////////////////////////////////////////////////// class CEventSink : public CComObjectRootEx <CComSingleThreadModel>, public IDispatch { public: CEventSink() : m_pMain(NULL), m_done(FALSE) {} public: BEGIN_COM_MAP(CEventSink) COM_INTERFACE_ENTRY(IDispatch) COM_INTERFACE_ENTRY_IID(DIID_DWebBrowserEvents2, IDispatch) END_COM_MAP() STDMETHOD(GetTypeInfoCount)(UINT* pctinfo); STDMETHOD(GetTypeInfo)(UINT itinfo, LCID lcid, ITypeInfo** pptinfo); STDMETHOD(GetIDsOfNames)(REFIID riid, LPOLESTR* rgszNames, UINT cNames, LCID lcid, DISPID* rgdispid); STDMETHOD(Invoke)(DISPID dispid, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS* pdispparams, VARIANT* pvarResult, EXCEPINFO* pexcepinfo, UINT* puArgErr); public: CMain* m_pMain; BOOL m_done; }; ////////////////////////////////////////////////////////////////// // CMain ////////////////////////////////////////////////////////////////// class CMain : public CWindowImpl <CMain> { public: CMain() : m_dwCookie(0) { } public: BEGIN_MSG_MAP(CMainWindow) MESSAGE_HANDLER(WM_CREATE, OnCreate) MESSAGE_HANDLER(WM_SIZE, OnSize) MESSAGE_HANDLER(WM_DESTROY, OnDestroy) END_MSG_MAP() public: LRESULT OnCreate (UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnSize (UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnDestroy (UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); public: void ProcessDocument(IDispatch* pdisp, VARIANT* purl); public: LPCSTR m_URI; protected: CComPtr<IUnknown> m_pWebBrowserUnk; CComPtr<IWebBrowser2> m_pWebBrowser; CComObject<CEventSink>* m_pEventSink; CComPtr<IDispatch> m_pDispatch; HWND m_hwndWebBrowser; DWORD m_dwCookie; }; ////////////////////////////////////////////////////////////////// // Implementation of CEventSink ////////////////////////////////////////////////////////////////// STDMETHODIMP CEventSink::GetTypeInfoCount(UINT* pctinfo) { return E_NOTIMPL; } STDMETHODIMP CEventSink::GetTypeInfo(UINT itinfo, LCID lcid, ITypeInfo** pptinfo) { return E_NOTIMPL; } STDMETHODIMP CEventSink::GetIDsOfNames(REFIID riid, LPOLESTR* rgszNames, UINT cNames, LCID lcid, DISPID* rgdispid) { return E_NOTIMPL; } STDMETHODIMP CEventSink::Invoke(DISPID dispid, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS* pdispparams, VARIANT* pvarResult, EXCEPINFO* pexcepinfo, UINT* puArgErr) { if (dispid != DISPID_DOCUMENTCOMPLETE) return S_OK; if (pdispparams->cArgs != 2) return S_OK; if (pdispparams->rgvarg[0].vt != (VT_VARIANT | VT_BYREF)) return S_OK; if (pdispparams->rgvarg[1].vt != VT_DISPATCH) return S_OK; if (m_done) return S_OK; m_pMain->ProcessDocument(pdispparams->rgvarg[1].pdispVal, pdispparams->rgvarg[0].pvarVal); m_done = TRUE; m_pMain->PostMessage(WM_CLOSE); return S_OK; } ////////////////////////////////////////////////////////////////// // Implementation of CMain Messages ////////////////////////////////////////////////////////////////// LRESULT CMain::OnCreate(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { HRESULT hr; RECT old; IUnknown * pUnk = NULL; GetClientRect(&old); m_hwndWebBrowser = ::CreateWindow(_T(ATLAXWIN_CLASS), m_URI, /*WS_POPUP|*/WS_CHILD|WS_DISABLED, old.top, old.left, old.right, old.bottom, m_hWnd, NULL, ::GetModuleHandle(NULL), NULL); hr = AtlAxGetControl(m_hwndWebBrowser, &m_pWebBrowserUnk); if (FAILED(hr)) return 1; if (m_pWebBrowserUnk == NULL) return 1; hr = m_pWebBrowserUnk->QueryInterface(IID_IWebBrowser2, (void**)&m_pWebBrowser); if (FAILED(hr)) return 1; hr = CComObject<CEventSink>::CreateInstance(&m_pEventSink); if (FAILED(hr)) return 1; m_pEventSink->m_pMain = this; hr = AtlAdvise(m_pWebBrowserUnk, m_pEventSink->GetUnknown(), DIID_DWebBrowserEvents2, &m_dwCookie); if (FAILED(hr)) return 1; return 0; } LRESULT CMain::OnSize(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { if (m_hwndWebBrowser != NULL) ::MoveWindow(m_hwndWebBrowser, 0, 0, LOWORD(lParam), HIWORD(lParam), TRUE); return 0; } LRESULT CMain::OnDestroy(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { HRESULT hr; if (m_dwCookie != 0) hr = AtlUnadvise(m_pWebBrowserUnk, DIID_DWebBrowserEvents2, m_dwCookie); m_pWebBrowser.Release(); m_pWebBrowserUnk.Release(); PostQuitMessage(0); return 0; } ////////////////////////////////////////////////////////////////// // Implementation of CMain::ProcessDocument ////////////////////////////////////////////////////////////////// void CMain::ProcessDocument(IDispatch* pdisp, VARIANT* purl) { IDispatch* pWebBrowserDisp = NULL; HRESULT hr; hr = m_pWebBrowser->get_Document(&m_pDispatch); if (FAILED(hr)) return; hr = m_pWebBrowserUnk->QueryInterface(IID_IDispatch, (void**)&pWebBrowserDisp); if (FAILED(hr)) return; #if 0 if (pWebBrowserDisp != pdisp) { pWebBrowserDisp->Release(); return; } #endif /////////////////////////////////////////////////////////////////////// IEQA* qa = new IEQA("c:/dtd/dtd/sgml.soc", "c:/dtd/dtd/xml.soc"); BOOL success = qa->processDocument(CA2W(m_URI), m_pDispatch, stdout); delete qa; /////////////////////////////////////////////////////////////////////// if (m_pDispatch) m_pDispatch.Release(); } static const GUID myGUID = { 0x594dc3a5, 0x36da, 0x43f1, { 0x87, 0xc6, 0x41, 0x38, 0xd5, 0x34, 0x63, 0xbe } }; static CComModule _Main; int main (int argc, char *argv[]) { #if 0 SetEnvironmentVariable("SP_CHARSET_FIXED", "0"); SetEnvironmentVariable("SP_ENCODING", "UTF-8"); SetEnvironmentVariable("SP_BCTF", "UTF-8"); _putenv("SP_CHARSET_FIXED=0"); _putenv("SP_ENCODING=UTF-8"); _putenv("SP_BCTF=UTF-8"); #endif HRESULT hr = _Main.Init(NULL, ::GetModuleHandle(NULL), &myGUID); if (FAILED(hr)) return EXIT_FAILURE; if (!AtlAxWinInit()) return EXIT_FAILURE; CMain MainWnd; MainWnd.m_URI = argv[1]; RECT rcMain = { 0, 0, 800, 600 }; MainWnd.Create(NULL, rcMain, _T("IEQACMD"), WS_POPUP); MSG msg; while (GetMessage(&msg, NULL, 0, 0)) { TranslateMessage(&msg); DispatchMessage(&msg); } _Main.Term(); return EXIT_SUCCESS; } |
From: Bj?rn H?h. <hoe...@us...> - 2004-03-25 14:24:17
|
Update of /cvsroot/ieqabar/ieqabar/src/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9113 Added Files: IEQA.hxx Log Message: initial import --- NEW FILE: IEQA.hxx --- // IEQA.hxx -- ... // // (c) 2004 Bjoern Hoehrmann et al., see ... // // $Id: IEQA.hxx,v 1.1 2004/03/25 14:13:26 hoehrmann Exp $ #ifndef __IEQA_HXX__ #define __IEQA_HXX__ #include <atlbase.h> class IEQA { public: IEQA(LPCSTR htmlCat, LPCSTR xmlCat); ~IEQA(); BOOL processDocument(LPWSTR location, IDispatch *pDispatch, FILE* file, LPCSTR stylesheet = NULL); private: LPCSTR m_htmlCatalog; LPCSTR m_xmlCatalog; }; #endif /* __IEQA_HXX__ */ |
From: Bj?rn H?h. <hoe...@us...> - 2004-03-25 14:02:24
|
Update of /cvsroot/ieqabar/ieqabar/src/library In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4516 Modified Files: IEQA.cxx Log Message: adding comment header Index: IEQA.cxx =================================================================== RCS file: /cvsroot/ieqabar/ieqabar/src/library/IEQA.cxx,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- IEQA.cxx 25 Mar 2004 13:47:56 -0000 1.1 +++ IEQA.cxx 25 Mar 2004 13:51:37 -0000 1.2 @@ -1,3 +1,9 @@ +// IEQA.cxx -- ... +// +// (c) 2004 Bjoern Hoehrmann et al., see ... +// +// $Id$ + #include "IEQA.hxx" #include "IEQABase.hxx" #include "OpenSP.hxx" |
From: Bj?rn H?h. <hoe...@us...> - 2004-03-25 13:58:43
|
Update of /cvsroot/ieqabar/ieqabar/src/library In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3736 Added Files: IEQA.cxx IEQABase.hxx Log Message: initial import --- NEW FILE: IEQA.cxx --- #include "IEQA.hxx" #include "IEQABase.hxx" #include "OpenSP.hxx" #include "HTMLTidy.hxx" #include "IEDocument.hxx" #include <time.h> IEQA::IEQA(LPCSTR htmlCat, LPCSTR xmlCat) { assert( htmlCat != NULL ); assert( xmlCat != NULL ); m_htmlCatalog = htmlCat; m_xmlCatalog = xmlCat; } IEQA::~IEQA() { } BOOL IEQA::processDocument(LPWSTR location, IDispatch *pDispatch, FILE* file, LPCSTR stylesheet) { assert( location != NULL ); assert( pDispatch != NULL ); // todo: check file? BOOL success = FALSE; LARGE_INTEGER liFreq, liBefore, liAfter; QueryPerformanceFrequency(&liFreq); QueryPerformanceCounter(&liBefore); XmlWriter* w = new XmlWriter(file); if (stylesheet) w->XmlStyleSheet(stylesheet); w->StartElement("Document"); w->AddAttribute("when", (UINT)time(NULL)); IEDocument doc(location, pDispatch); BSTR bstrDoctype = doc.DocTypeDecl(); UINT nSourceCodeLen = 0; LPCSTR sourceCode = doc.SourceCode(&nSourceCodeLen); DocumentType* doctype = NULL; // try to recognize the document type declaration doctype = LookupDoctypeFromDecl(bstrDoctype); if (!doctype && (doc.XmlDecl() || doc.XHTMLNamespace())) { // fall back to XHTML 1.0 Transitional doctype = LookupDoctypeFromVers(X10T); } else if (!doctype) { // fall back to HTML 4.01 Transitional doctype = LookupDoctypeFromVers(H41T); } assert( doctype != NULL ); TidyReporter tidy; OpenSPReporter openSP(m_htmlCatalog, m_xmlCatalog); TidyReport tidyReport; OpenSPReport openSPreport; UINT offset = 0; UINT length = 0; // ... tidy.parseForDoctype(sourceCode, &offset, &length); tidy.processDocument(sourceCode, &tidyReport); openSP.processDocument(sourceCode, nSourceCodeLen, offset, length, doctype, &openSPreport); LinesList lines; tidyReport.LinesToList(&lines); openSPreport.LinesToList(&lines); doc.ToXmlWriter(w, &lines, 1, 1); tidy.doctypeToXmlWriter(w); openSPreport.ToXmlWriter(w); tidyReport.ToXmlWriter(w); QueryPerformanceCounter(&liAfter); w->Element("took", GetDuration(liBefore, liAfter, liFreq)); w->EndElement(); /* Document */ w->EndDocument(); if (w->Success()) success = TRUE; delete w; return success; } --- NEW FILE: IEQABase.hxx --- // IEQABase.hxx -- ... // // (c) 2004 Bjoern Hoehrmann et al., see ... // // $Id: IEQABase.hxx,v 1.1 2004/03/25 13:47:56 hoehrmann Exp $ #ifndef __IEQABASE_HXX__ #define __IEQABASE_HXX__ #include <windows.h> #include <atlbase.h> #include <atlfile.h> #include <mshtml.h> #include <mlang.h> #include <assert.h> #include <stdlib.h> #include <string.h> class XmlWriter; typedef CSimpleArray<UINT> LinesList; #include "Message.hxx" #include "Helper.hxx" #include "XmlWriter.hxx" #include "Doctypes.hxx" #endif /* __IEQABASE_HXX__ */ |
From: Bj?rn H?h. <hoe...@us...> - 2004-03-25 13:55:59
|
Update of /cvsroot/ieqabar/ieqabar/src/library In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3132 Modified Files: XmlWriter.cxx XmlWriter.hxx Log Message: Make output FILE* configurable Index: XmlWriter.hxx =================================================================== RCS file: /cvsroot/ieqabar/ieqabar/src/library/XmlWriter.hxx,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- XmlWriter.hxx 20 Mar 2004 00:28:36 -0000 1.1 +++ XmlWriter.hxx 25 Mar 2004 13:45:10 -0000 1.2 @@ -9,12 +9,12 @@ #include "IEQABase.hxx" -#include "genx/genx.h" +#include "genx.h" class XmlWriter { public: - XmlWriter(void); + XmlWriter(FILE* file); ~XmlWriter(); void XmlStyleSheet(LPCSTR href, LPCSTR type = "text/xsl"); Index: XmlWriter.cxx =================================================================== RCS file: /cvsroot/ieqabar/ieqabar/src/library/XmlWriter.cxx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- XmlWriter.cxx 20 Mar 2004 06:22:37 -0000 1.3 +++ XmlWriter.cxx 25 Mar 2004 13:45:10 -0000 1.4 @@ -8,13 +8,13 @@ #define ITOA_MAX 33 -XmlWriter::XmlWriter(void) +XmlWriter::XmlWriter(FILE* file) { // todo: use genxSender to write to string m_piTarget = NULL; m_piData = NULL; m_w = genxNew(NULL, NULL, NULL); - m_status = genxStartDocFile(m_w, stdout); + m_status = genxStartDocFile(m_w, file); } XmlWriter::~XmlWriter() |
From: Bj?rn H?h. <hoe...@us...> - 2004-03-25 13:55:31
|
Update of /cvsroot/ieqabar/ieqabar/src/library In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2968 Modified Files: OpenSP.cxx Log Message: Properly report warnings as warnings Index: OpenSP.cxx =================================================================== RCS file: /cvsroot/ieqabar/ieqabar/src/library/OpenSP.cxx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- OpenSP.cxx 20 Mar 2004 06:56:12 -0000 1.3 +++ OpenSP.cxx 25 Mar 2004 13:44:41 -0000 1.4 @@ -241,6 +241,7 @@ // file.html:1:1:E: character "\n" is not allowed in the ... // /////////////////////////////////////////////////////////////// + LPWSTR mstr; CA2W wurl(m_tempFileName); UINT nWurlLen = (UINT)wcslen(wurl); @@ -363,6 +364,16 @@ // terminate the string emsg[size] = 0; + // change severity for warnings that are reported as errors + if (wcscmp(emsg, L"empty start-tag") == 0 + || wcscmp(emsg, L"empty end-tag") == 0 + || wcscmp(emsg, L"NET-enabling start-tag requires SHORTTAG YES") == 0 + || wcscmp(emsg, L"unclosed start-tag requires SHORTTAG YES") == 0 + || wcscmp(emsg, L"unclosed end-tag requires SHORTTAG YES") == 0) + { + nSeverity = 1; + } + // add the message to the report m_report->m_messages.Add(new Message(line, column, nSeverity, emsg)); @@ -372,4 +383,3 @@ // free the message text, Message() creates its own copy CoTaskMemFree(emsg); } - |
From: Bj?rn H?h. <hoe...@us...> - 2004-03-20 07:06:10
|
Update of /cvsroot/ieqabar/ieqabar/src/library In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10881 Modified Files: Doctypes.cxx HTMLTidy.cxx Helper.cxx OpenSP.cxx Log Message: completing intro header Index: Helper.cxx =================================================================== RCS file: /cvsroot/ieqabar/ieqabar/src/library/Helper.cxx,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Helper.cxx 20 Mar 2004 00:28:36 -0000 1.1 +++ Helper.cxx 20 Mar 2004 06:56:12 -0000 1.2 @@ -1,4 +1,4 @@ -// Helper.cxx -- ... +// Helper.cxx -- Helper routines // // (c) 2004 Bjoern Hoehrmann et al., see ... // Index: Doctypes.cxx =================================================================== RCS file: /cvsroot/ieqabar/ieqabar/src/library/Doctypes.cxx,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Doctypes.cxx 20 Mar 2004 06:33:06 -0000 1.2 +++ Doctypes.cxx 20 Mar 2004 06:56:12 -0000 1.3 @@ -1,4 +1,4 @@ -// Doctypes.cxx -- ... +// Doctypes.cxx -- Document Type Declarations // // (c) 2004 Bjoern Hoehrmann et al., see ... // Index: HTMLTidy.cxx =================================================================== RCS file: /cvsroot/ieqabar/ieqabar/src/library/HTMLTidy.cxx,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- HTMLTidy.cxx 20 Mar 2004 06:30:31 -0000 1.2 +++ HTMLTidy.cxx 20 Mar 2004 06:56:12 -0000 1.3 @@ -1,4 +1,4 @@ -// HTMLTidy.cxx -- ... +// HTMLTidy.cxx -- Wrapper for HTML Tidy // // (c) 2004 Bjoern Hoehrmann et al., see ... // Index: OpenSP.cxx =================================================================== RCS file: /cvsroot/ieqabar/ieqabar/src/library/OpenSP.cxx,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- OpenSP.cxx 20 Mar 2004 06:37:59 -0000 1.2 +++ OpenSP.cxx 20 Mar 2004 06:56:12 -0000 1.3 @@ -1,4 +1,4 @@ -// OpenSP.cxx -- ... +// OpenSP.cxx -- Wrapper for OpenSP // // (c) 2004 Bjoern Hoehrmann et al., see ... // |