2002-11-01 10:15:51 -06:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2005-09-07 11:51:02 -05:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2002-11-01 10:15:51 -06:00
|
|
|
*
|
2005-09-07 11:51:02 -05:00
|
|
|
* $RCSfile: hi_display.cxx,v $
|
2002-11-01 10:15:51 -06:00
|
|
|
*
|
2007-11-02 10:39:16 -05:00
|
|
|
* $Revision: 1.6 $
|
2002-11-01 10:15:51 -06:00
|
|
|
*
|
2007-11-02 10:39:16 -05:00
|
|
|
* last change: $Author: hr $ $Date: 2007-11-02 16:39:16 $
|
2002-11-01 10:15:51 -06:00
|
|
|
*
|
2005-09-07 11:51:02 -05:00
|
|
|
* The Contents of this file are made available subject to
|
|
|
|
* the terms of GNU Lesser General Public License Version 2.1.
|
2002-11-01 10:15:51 -06:00
|
|
|
*
|
|
|
|
*
|
2005-09-07 11:51:02 -05:00
|
|
|
* GNU Lesser General Public License Version 2.1
|
|
|
|
* =============================================
|
|
|
|
* Copyright 2005 by Sun Microsystems, Inc.
|
|
|
|
* 901 San Antonio Road, Palo Alto, CA 94303, USA
|
2002-11-01 10:15:51 -06:00
|
|
|
*
|
2005-09-07 11:51:02 -05:00
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License version 2.1, as published by the Free Software Foundation.
|
2002-11-01 10:15:51 -06:00
|
|
|
*
|
2005-09-07 11:51:02 -05:00
|
|
|
* This library 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
|
|
|
|
* Lesser General Public License for more details.
|
2002-11-01 10:15:51 -06:00
|
|
|
*
|
2005-09-07 11:51:02 -05:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
|
|
* MA 02111-1307 USA
|
2002-11-01 10:15:51 -06:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
#include <precomp.h>
|
|
|
|
#include <idl/hi_display.hxx>
|
|
|
|
|
|
|
|
|
|
|
|
// NOT FULLY DEFINED SERVICES
|
2005-03-23 02:02:00 -06:00
|
|
|
#include <cosv/file.hxx>
|
2002-11-01 10:15:51 -06:00
|
|
|
#include <ary/idl/i_ce.hxx>
|
|
|
|
#include <ary/idl/i_module.hxx>
|
2007-11-02 10:39:16 -05:00
|
|
|
#include <ary/getncast.hxx>
|
2002-11-01 10:15:51 -06:00
|
|
|
#include <toolkit/out_tree.hxx>
|
2005-03-23 02:02:00 -06:00
|
|
|
#include <cfrstd.hxx>
|
2002-11-01 10:15:51 -06:00
|
|
|
#include "hi_ary.hxx"
|
|
|
|
#include "hi_env.hxx"
|
|
|
|
#include "hi_main.hxx"
|
|
|
|
|
|
|
|
|
2005-03-23 02:02:00 -06:00
|
|
|
extern const String C_sCssFilename_Idl;
|
|
|
|
|
|
|
|
|
2002-11-01 10:15:51 -06:00
|
|
|
inline bool
|
|
|
|
HtmlDisplay_Idl::IsModule( const ary::idl::CodeEntity & i_ce ) const
|
|
|
|
{
|
2007-11-02 10:39:16 -05:00
|
|
|
return ary::is_type<ary::idl::Module>(i_ce);
|
2002-11-01 10:15:51 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
inline const ary::idl::Module &
|
|
|
|
HtmlDisplay_Idl::Module_Cast( const ary::idl::CodeEntity & i_ce ) const
|
|
|
|
{
|
2007-11-02 10:39:16 -05:00
|
|
|
return ary::ary_cast<ary::idl::Module>(i_ce);
|
2002-11-01 10:15:51 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HtmlDisplay_Idl::HtmlDisplay_Idl()
|
|
|
|
: pCurPageEnv(),
|
|
|
|
pMainDisplay()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
HtmlDisplay_Idl::~HtmlDisplay_Idl()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
HtmlDisplay_Idl::do_Run( const char * i_sOutputDirectory,
|
|
|
|
const ary::idl::Gate & i_rAryGate,
|
|
|
|
const display::CorporateFrame & i_rLayout )
|
|
|
|
{
|
|
|
|
SetRunData( i_sOutputDirectory, i_rAryGate, i_rLayout );
|
|
|
|
|
|
|
|
Create_StartFile();
|
2005-03-23 02:02:00 -06:00
|
|
|
Create_CssFile();
|
2002-11-01 10:15:51 -06:00
|
|
|
Create_FilesInNameTree();
|
|
|
|
Create_IndexFiles();
|
|
|
|
Create_FilesInProjectTree();
|
|
|
|
Create_PackageList();
|
|
|
|
Create_HelpFile();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
HtmlDisplay_Idl::SetRunData( const char * i_sOutputDirectory,
|
|
|
|
const ary::idl::Gate & i_rAryGate,
|
|
|
|
const display::CorporateFrame & i_rLayout )
|
|
|
|
{
|
|
|
|
csv::ploc::Path aOutputDir( i_sOutputDirectory, true );
|
|
|
|
pCurPageEnv = new HtmlEnvironment_Idl( aOutputDir, i_rAryGate, i_rLayout );
|
|
|
|
pMainDisplay = new MainDisplay_Idl(*pCurPageEnv);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
HtmlDisplay_Idl::Create_StartFile()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
HtmlDisplay_Idl::Create_FilesInNameTree()
|
|
|
|
{
|
|
|
|
Cout() << "\nCreate files in subtree namespaces ..." << Endl();
|
|
|
|
|
|
|
|
const ary::idl::Module &
|
|
|
|
rGlobalNamespace = pCurPageEnv->Data().GlobalNamespace();
|
|
|
|
pCurPageEnv->Goto_Directory( pCurPageEnv->OutputTree().NamesRoot(), true );
|
|
|
|
|
|
|
|
RecursiveDisplay_Module(rGlobalNamespace);
|
|
|
|
|
|
|
|
Cout() << "... done." << Endl();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
HtmlDisplay_Idl::Create_IndexFiles()
|
|
|
|
{
|
|
|
|
Cout() << "\nCreate files in subtree index ..." << Endl();
|
|
|
|
pCurPageEnv->Goto_Directory( pCurPageEnv->OutputTree().IndexRoot(), true );
|
|
|
|
pMainDisplay->WriteGlobalIndices();
|
|
|
|
Cout() << "... done.\n" << Endl();
|
|
|
|
}
|
|
|
|
|
|
|
|
typedef ary::Dyn_StdConstIterator<ary::idl::Ce_id> Dyn_CeIterator;
|
|
|
|
typedef ary::StdConstIterator<ary::idl::Ce_id> CeIterator;
|
|
|
|
|
|
|
|
void
|
|
|
|
HtmlDisplay_Idl::RecursiveDisplay_Module( const ary::idl::Module & i_module )
|
|
|
|
{
|
2007-11-02 10:39:16 -05:00
|
|
|
i_module.Accept(*pMainDisplay);
|
2002-11-01 10:15:51 -06:00
|
|
|
|
2007-11-02 10:39:16 -05:00
|
|
|
Dyn_CeIterator
|
|
|
|
aMembers;
|
2002-11-01 10:15:51 -06:00
|
|
|
i_module.Get_Names(aMembers);
|
|
|
|
|
|
|
|
for ( CeIterator & iter = *aMembers;
|
|
|
|
iter;
|
|
|
|
++iter )
|
|
|
|
{
|
|
|
|
const ary::idl::CodeEntity &
|
|
|
|
rCe = pCurPageEnv->Data().Find_Ce(*iter);
|
|
|
|
|
|
|
|
if ( NOT IsModule(rCe) )
|
2007-11-02 10:39:16 -05:00
|
|
|
rCe.Accept(*pMainDisplay);
|
2002-11-01 10:15:51 -06:00
|
|
|
else
|
|
|
|
{
|
|
|
|
pCurPageEnv->Goto_DirectoryLevelDown( rCe.LocalName(), true );
|
|
|
|
RecursiveDisplay_Module( Module_Cast(rCe) );
|
|
|
|
pCurPageEnv->Goto_DirectoryLevelUp();
|
|
|
|
}
|
|
|
|
} // end for
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
HtmlDisplay_Idl::Create_FilesInProjectTree()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
HtmlDisplay_Idl::Create_PackageList()
|
|
|
|
{
|
|
|
|
#if 0
|
|
|
|
Cout() << "\nCreate package list ..." << std::flush;
|
|
|
|
|
|
|
|
pCurPageEnv->CurPosition() = pCurPageEnv->OutputTree().Root();
|
|
|
|
|
|
|
|
// KORR
|
|
|
|
// ...
|
|
|
|
|
|
|
|
Cout() << " done." << Endl();
|
|
|
|
#endif // 0
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
HtmlDisplay_Idl::Create_HelpFile()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2005-03-23 02:02:00 -06:00
|
|
|
void
|
|
|
|
HtmlDisplay_Idl::Create_CssFile()
|
|
|
|
{
|
|
|
|
Cout() << "\nCreate css file ..." << Endl();
|
|
|
|
|
|
|
|
pCurPageEnv->Goto_Directory( pCurPageEnv->OutputTree().Root(), true );
|
|
|
|
pCurPageEnv->Set_CurFile( C_sCssFilename_Idl );
|
|
|
|
|
|
|
|
StreamLock
|
|
|
|
slCurFilePath(700);
|
|
|
|
pCurPageEnv->Get_CurFilePath(slCurFilePath());
|
2002-11-01 10:15:51 -06:00
|
|
|
|
2005-03-23 02:02:00 -06:00
|
|
|
csv::File
|
|
|
|
aCssFile(slCurFilePath().c_str(), csv::CFM_CREATE);
|
|
|
|
csv::OpenCloseGuard
|
|
|
|
aOpenGuard(aCssFile);
|
|
|
|
if (NOT aOpenGuard)
|
|
|
|
{
|
|
|
|
Cerr() << "Can't create file " << slCurFilePath().c_str() << "." << Endl();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
aCssFile.write("/* Autodoc css file for IDL documentation */\n\n\n");
|
|
|
|
aCssFile.write(pCurPageEnv->Layout().CssStyle());
|
|
|
|
aCssFile.write("\n\n\n");
|
|
|
|
aCssFile.write(pCurPageEnv->Layout().CssStylesExplanation());
|
|
|
|
}
|