// // Copyright 2000 Perforce Software. All rights reserved. // // This file is part of Perforce - the FAST SCM System. // // p4wThumbnailPane: renders print data using mime type for content type #include <p4wp4.h> #include "p4wStrBuf.h" #include "p4wHtml.h" #include "p4wI18n.h" #include "p4wPane.h" #include "p4wThumbnailPane.h" #include "base64.h" p4wThumbnailPane::p4wThumbnailPane( p4wView & ParentView, p4wRequest & Request ) : p4wMimeContentPane( ParentView, Request ), fSeenData(0) { } p4wThumbnailPane::~p4wThumbnailPane() { } void p4wThumbnailPane::RenderBinary(char *data, int len) { // // Output binary data (via p4 print). Generate http // content type for this page only if we can resolve the // content type by examining the file suffix. if( !fSeenData ) { RenderHeaderIfMapped( 0 ); // need to add ", 0, 0, 0" if caching ++fSeenData; #ifdef MSIE_FINALLY_GETS_ITS_CACHING_SO_THAT_IT_IS_FASTER_THAN_REREADING if (!strstr(fRequest.GetHTTPVersion().Text(), "1.0")) { p4wHtml htm; htm.CacheControl(86400, 1); fRequest << htm; } #endif } fRequest.Write( data, len ); } void p4wThumbnailPane::Render( StrDict * varList ) { StrPtr * attr_thumb = varList->GetVar( "attr-thumb" ); if (attr_thumb) { StrBuf bindata; char *p = bindata.Alloc((attr_thumb->Length() + 1)/2 + 2); int lgth = DecodeBase16(attr_thumb->Text(), attr_thumb->Length(), p); RenderBinary(p, lgth); } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 12234 | Matt Attaway |
Rejigger P4Web project in preparation for official sunsetting The bin directory contains the last official builds of P4Web from the Perforce download site. P4Web is soon to be completely sunsetted; these builds are here for folks who don't want to build their own. To better handle the archived builds the source code has been moved into a separate src directory. |
||
//guest/perforce_software/p4web/Panes/p4wThumbnailPane.cpp | |||||
#1 | 8914 | Matt Attaway | Initial add of the P4Web source code |