// Copyright 1999 (c) by Perforce Software, Inc. All rights reserved. // // p4wDiffsPane: // The Diffs pane. // ------------------------------------- // Includes // #include <p4wp4.h> #include "p4wStrBuf.h" #include "p4wHtml.h" #include "p4wDiffsPane.h" // ------------------------------------- // Constructors and destructor. // p4wDiffsPane::p4wDiffsPane(p4wView & ParentView, p4wRequest & Request) : p4wPane(ParentView, Request), fSeenBegin(0), fSeenOpened(0), fInPre(0), fFunctionCount(0) { fFirstErrorOnly = 0; } p4wDiffsPane::~p4wDiffsPane() { } // ------------------------------------- // Overrides for spec panes. // void p4wDiffsPane::Begin() { // // Only process ::Begin() once. if( !fSeenOpened || fSeenBegin ) return; // // Begin the pane. fSeenBegin = 1; p4wHtml htm; htm.comment( "BEGIN DIFFS PANE" ); htm.beginTable( "0", "100%" ); fRequest << htm; } void p4wDiffsPane::Render(StrDict * varList) { // // Only called with opened: get the files to diff StrPtr *action = varList->GetVar("action"); StrPtr *val = varList->GetVar("depotFile"); // Store files that we will diff later if( *action == "edit" ) { FileList.Put()->Set( *val ); } } void p4wDiffsPane::RenderInfo(char *data, char level) { // // Render the header for the upcoming diff p4wHtml htm; if( fInPre ) { htm.endUnformatted(); htm.endCol(); htm.endTRow(); fInPre = 0; } htm.beginTRow(); htm.beginCol( NULL, NULL, NULL, NULL, "#cccccc" ); htm.text( p4wStrBuf().EscapeHTML(StrRef(data), Unicode()).Text(), "b" ); htm.endCol(); htm.endTRow(); htm.beginTRow(); htm.beginCol(); htm.beginUnformatted(); fRequest << htm; fInPre = 1; } void p4wDiffsPane::RenderText(char *data) { // // If page content limit in bytes has been exceeded, don't // generate this entry if( PageLimitExceeded() ) return; // // Render the diff output fRequest << p4wStrBuf().EscapeHTML(StrRef(data), Unicode()); } void p4wDiffsPane::End() { // // First End() call signals transition from opened to diff output if( !fSeenOpened ) { fSeenOpened = 1; return; } // // Only process ::End() after we have seen all of the functions. if( fFunctionCount && --fFunctionCount ) return; // // End the pane. p4wHtml htm; if( fInPre ) { htm.endUnformatted(); fInPre = 0; } htm.endCol(); htm.endTRow(); htm.endTable(); htm.comment( "END DIFFS PANE" ); fRequest << htm; } // // DiffsPane-specification functions. void p4wDiffsPane::AdditionalFunction() { fFunctionCount++; } void p4wDiffsPane::RenderError(char *data, int escapeHTML) { fSeenOpened = 1; Begin(); RenderErrorTbl( data, escapeHTML ); }
# | 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/p4wDiffsPane.cpp | |||||
#1 | 8914 | Matt Attaway | Initial add of the P4Web source code |