diff options
Diffstat (limited to 'o3d/documentation')
21 files changed, 2842 insertions, 0 deletions
diff --git a/o3d/documentation/Doxyfile b/o3d/documentation/Doxyfile new file mode 100644 index 0000000..b4e98e2 --- /dev/null +++ b/o3d/documentation/Doxyfile @@ -0,0 +1,293 @@ +# Doxyfile 1.5.7.1 + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +DOXYFILE_ENCODING = UTF-8 +PROJECT_NAME = O3D +PROJECT_NUMBER = +OUTPUT_DIRECTORY = scons-out/docs/obj/documentation +CREATE_SUBDIRS = NO +OUTPUT_LANGUAGE = English +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = YES +FULL_PATH_NAMES = NO +STRIP_FROM_PATH = "C:/Documents and Settings/rlp/" +STRIP_FROM_INC_PATH = +SHORT_NAMES = NO +JAVADOC_AUTOBRIEF = YES +QT_AUTOBRIEF = NO +MULTILINE_CPP_IS_BRIEF = NO +INHERIT_DOCS = YES +SEPARATE_MEMBER_PAGES = NO +TAB_SIZE = 8 +ALIASES = +OPTIMIZE_OUTPUT_FOR_C = NO +OPTIMIZE_OUTPUT_JAVA = YES +OPTIMIZE_FOR_FORTRAN = NO +OPTIMIZE_OUTPUT_VHDL = NO +BUILTIN_STL_SUPPORT = NO +CPP_CLI_SUPPORT = NO +SIP_SUPPORT = NO +IDL_PROPERTY_SUPPORT = YES +DISTRIBUTE_GROUP_DOC = NO +SUBGROUPING = YES +TYPEDEF_HIDES_STRUCT = NO +SYMBOL_CACHE_SIZE = 0 +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- +EXTRACT_ALL = NO +EXTRACT_PRIVATE = NO +EXTRACT_STATIC = NO +EXTRACT_LOCAL_CLASSES = YES +EXTRACT_LOCAL_METHODS = NO +EXTRACT_ANON_NSPACES = NO +HIDE_UNDOC_MEMBERS = YES +HIDE_UNDOC_CLASSES = YES +HIDE_FRIEND_COMPOUNDS = NO +HIDE_IN_BODY_DOCS = NO +INTERNAL_DOCS = NO +CASE_SENSE_NAMES = NO +HIDE_SCOPE_NAMES = NO +SHOW_INCLUDE_FILES = NO +INLINE_INFO = YES +SORT_MEMBER_DOCS = YES +SORT_BRIEF_DOCS = NO +SORT_GROUP_NAMES = NO +SORT_BY_SCOPE_NAME = YES +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +GENERATE_DEPRECATEDLIST= YES +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +SHOW_USED_FILES = NO +SHOW_DIRECTORIES = NO +SHOW_FILES = NO +SHOW_NAMESPACES = YES +FILE_VERSION_FILTER = +LAYOUT_FILE = documentation/DoxygenLayout.xml +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = NO +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_IF_DOC_ERROR = YES +WARN_NO_PARAMDOC = NO +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = scons-out/docs/obj/documentation +INPUT_ENCODING = UTF-8 +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.c++ \ + *.d \ + *.java \ + *.ii \ + *.ixx \ + *.ipp \ + *.i++ \ + *.inl \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ \ + *.idl \ + *.odl \ + *.cs \ + *.php \ + *.php3 \ + *.inc \ + *.m \ + *.mm \ + *.dox \ + *.py \ + *.f90 \ + *.f \ + *.vhd \ + *.vhdl +RECURSIVE = NO +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXCLUDE_SYMBOLS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = * +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_PATTERNS = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = NO +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = YES +REFERENCED_BY_RELATION = NO +REFERENCES_RELATION = NO +REFERENCES_LINK_SOURCE = YES +USE_HTAGS = NO +VERBATIM_HEADERS = NO +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = NO +COLS_IN_ALPHA_INDEX = 5 +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = html +HTML_FILE_EXTENSION = .html +HTML_HEADER = documentation/header.html +HTML_FOOTER = documentation/footer.html +HTML_STYLESHEET = documentation/stylesheet.css +HTML_ALIGN_MEMBERS = NO +HTML_DYNAMIC_SECTIONS = NO +GENERATE_DOCSET = NO +DOCSET_FEEDNAME = "Doxygen generated docs" +DOCSET_BUNDLE_ID = org.doxygen.Project +GENERATE_HTMLHELP = NO +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +CHM_INDEX_ENCODING = +BINARY_TOC = NO +TOC_EXPAND = NO +GENERATE_QHP = NO +QCH_FILE = +QHP_NAMESPACE = org.doxygen.Project +QHP_VIRTUAL_FOLDER = doc +QHG_LOCATION = +DISABLE_INDEX = NO +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = NONE +TREEVIEW_WIDTH = 251 +FORMULA_FONTSIZE = 10 +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = YES +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = NO +PAPER_TYPE = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = YES +USE_PDFLATEX = YES +LATEX_BATCHMODE = NO +LATEX_HIDE_INDICES = NO +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = NO +RTF_OUTPUT = rtf +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = NO +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_LINKS = NO +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- +GENERATE_XML = NO +XML_OUTPUT = xml +XML_SCHEMA = +XML_DTD = +XML_PROGRAMLISTING = YES +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- +GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = YES +PERLMOD_MAKEVAR_PREFIX = +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = NO +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- +TAGFILES = +GENERATE_TAGFILE = +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +PERL_PATH = /usr/bin/perl +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +CLASS_DIAGRAMS = NO +MSCGEN_PATH = +HIDE_UNDOC_RELATIONS = YES +HAVE_DOT = NO +DOT_FONTNAME = FreeSans +DOT_FONTSIZE = 10 +DOT_FONTPATH = +CLASS_GRAPH = YES +COLLABORATION_GRAPH = NO +GROUP_GRAPHS = NO +UML_LOOK = NO +TEMPLATE_RELATIONS = NO +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +CALL_GRAPH = NO +CALLER_GRAPH = NO +GRAPHICAL_HIERARCHY = YES +DIRECTORY_GRAPH = YES +DOT_IMAGE_FORMAT = png +DOT_PATH = +DOTFILE_DIRS = +DOT_GRAPH_MAX_NODES = 50 +MAX_DOT_GRAPH_DEPTH = 1000 +DOT_TRANSPARENT = YES +DOT_MULTI_TARGETS = NO +GENERATE_LEGEND = YES +DOT_CLEANUP = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- +SEARCHENGINE = NO diff --git a/o3d/documentation/DoxygenLayout.xml b/o3d/documentation/DoxygenLayout.xml new file mode 100644 index 0000000..53ba75e --- /dev/null +++ b/o3d/documentation/DoxygenLayout.xml @@ -0,0 +1,182 @@ +<doxygenlayout version="1.0"> + <!-- Navigation index tabs for HTML output --> + <navindex> + <tab type="mainpage" visible="yes" title=""/> + <tab type="pages" visible="yes" title=""/> + <tab type="modules" visible="yes" title=""/> + <tab type="namespaces" visible="yes" title=""> + <tab type="namespaces" visible="yes" title=""/> + <tab type="namespacemembers" visible="yes" title=""/> + </tab> + <tab type="classes" visible="yes" title=""> + <tab type="classes" visible="yes" title=""/> + <tab type="classindex" visible="$ALPHABETICAL_INDEX" title=""/> + <tab type="hierarchy" visible="yes" title=""/> + <tab type="classmembers" visible="yes" title=""/> + </tab> + <tab type="files" visible="yes" title=""> + <tab type="files" visible="yes" title=""/> + <tab type="globals" visible="yes" title=""/> + </tab> + <tab type="dirs" visible="yes" title=""/> + <tab type="examples" visible="yes" title=""/> + </navindex> + + <!-- Layout definition for a class page --> + <class> + <briefdescription visible="yes"/> + <includes visible="$SHOW_INCLUDE_FILES"/> + <inheritancegraph visible="$CLASS_GRAPH"/> + <allmemberslink visible="yes"/> + <collaborationgraph visible="$COLLABORATION_GRAPH"/> + <detaileddescription title=""/> + <memberdecl> + <membergroups visible="yes"/> + <nestedclasses visible="yes" title=""/> + <publictypes title=""/> + <publicslots title=""/> + <signals title=""/> + <publicmethods title=""/> + <publicstaticmethods title=""/> + <publicattributes title=""/> + <publicstaticattributes title=""/> + <protectedtypes title=""/> + <protectedslots title=""/> + <protectedmethods title=""/> + <protectedstaticmethods title=""/> + <protectedattributes title=""/> + <protectedstaticattributes title=""/> + <packagetypes title=""/> + <packagemethods title=""/> + <packagestaticmethods title=""/> + <packageattributes title=""/> + <packagestaticattributes title=""/> + <properties title=""/> + <events title=""/> + <privatetypes title=""/> + <privateslots title=""/> + <privatemethods title=""/> + <privatestaticmethods title=""/> + <privateattributes title=""/> + <privatestaticattributes title=""/> + <friends title=""/> + <related title="" subtitle=""/> + </memberdecl> + <memberdef> + <typedefs title=""/> + <enums title=""/> + <constructors title=""/> + <functions title=""/> + <related title=""/> + <variables title=""/> + <properties title=""/> + <events title=""/> + </memberdef> + <usedfiles visible="$SHOW_USED_FILES"/> + <authorsection visible="yes"/> + </class> + + <!-- Layout definition for a namespace page --> + <namespace> + <briefdescription visible="yes"/> + <memberdecl> + <nestednamespaces visible="yes" title=""/> + <classes visible="yes" title=""/> + <membergroups visible="yes"/> + <typedefs title=""/> + <enums title=""/> + <functions title=""/> + <variables title=""/> + </memberdecl> + <detaileddescription title=""/> + <memberdef> + <typedefs title=""/> + <enums title=""/> + <functions title=""/> + <variables title=""/> + </memberdef> + <authorsection visible="yes"/> + </namespace> + + <!-- Layout definition for a file page --> + <file> + <briefdescription visible="yes"/> + <includes visible="$SHOW_INCLUDE_FILES"/> + <includegraph visible="$INCLUDE_GRAPH"/> + <includedbygraph visible="$INCLUDED_BY_GRAPH"/> + <sourcelink visible="yes"/> + <memberdecl> + <classes visible="yes" title=""/> + <namespaces visible="yes" title=""/> + <defines title=""/> + <typedefs title=""/> + <enums title=""/> + <functions title=""/> + <variables title=""/> + </memberdecl> + <detaileddescription title=""/> + <memberdef> + <defines title=""/> + <typedefs title=""/> + <enums title=""/> + <functions title=""/> + <variables title=""/> + </memberdef> + <authorsection/> + </file> + + <!-- Layout definition for a group page --> + <group> + <briefdescription visible="yes"/> + <groupgraph visible="$GROUP_GRAPHS"/> + <memberdecl> + <classes visible="yes" title=""/> + <namespaces visible="yes" title=""/> + <dirs visible="yes" title=""/> + <nestedgroups visible="yes" title=""/> + <files visible="yes" title=""/> + <defines title=""/> + <typedefs title=""/> + <enums title=""/> + <enumvalues title=""/> + <functions title=""/> + <variables title=""/> + <signals title=""/> + <publicslots title=""/> + <protectedslots title=""/> + <privateslots title=""/> + <events title=""/> + <properties title=""/> + <friends title=""/> + </memberdecl> + <detaileddescription title=""/> + <memberdef> + <pagedocs/> + <defines title=""/> + <typedefs title=""/> + <enums title=""/> + <enumvalues title=""/> + <functions title=""/> + <variables title=""/> + <signals title=""/> + <publicslots title=""/> + <protectedslots title=""/> + <privateslots title=""/> + <events title=""/> + <properties title=""/> + <friends title=""/> + </memberdef> + <authorsection visible="yes"/> + </group> + + <!-- Layout definition for a directory page --> + <directory> + <briefdescription visible="yes"/> + <directorygraph visible="yes"/> + <memberdecl> + <dirs visible="yes"/> + <files visible="yes"/> + </memberdecl> + <detaileddescription title=""/> + </directory> +</doxygenlayout> diff --git a/o3d/documentation/build.scons b/o3d/documentation/build.scons new file mode 100644 index 0000000..39f325f --- /dev/null +++ b/o3d/documentation/build.scons @@ -0,0 +1,130 @@ +# Copyright 2009, 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 glob +import os.path +import subprocess +Import('env') +env.SConscript('$SCONSTRUCT_DIR/plugin/idl_list.scons') +env.SConscript('$SCONSTRUCT_DIR/samples/o3djs/js_list.scons') +Import('O3D_IDL_SOURCES') +Import('O3D_JS_SOURCES') + +env.Replace( + EZT_FORMATTER = 'documentation/ezt_formatter.py', + CLASS_TREE_GEN = 'documentation/classtree.py', + JSDOC_DIR = '$SCONSTRUCT_DIR/documentation', + JSDOC_EZT_TEMPLATE_DIR = '$JSDOC_DIR/jsdoc-toolkit-templates/', + JSDOC_JAR = '$JSDOCTOOLKIT_DIR/jsrun.jar', + PYTHONPATH = ['$NIXYSA_DIR', + '$GFLAGS_DIR/python', + '$PLY_DIR'] +) + +# Build documentation +IDL_DIR = "$SCONSTRUCT_DIR/plugin/" +LOCAL_IDL_SOURCES = [IDL_DIR + i for i in O3D_IDL_SOURCES] +JS_DIR = '$SCONSTRUCT_DIR/samples/o3djs/' +LOCAL_JS_SOURCES = [JS_DIR + i for i in O3D_JS_SOURCES] + +def IdlDocsEmitter(target, source, env): + bases = [os.path.splitext(s.name)[0] for s in source] + targets = [target[0].dir.abspath + "/%s.$IDL_GENERATE_EXT" % b for b in bases] + return targets, source + +AUTOGEN_ARGS = ['$NIXYSA_DIR/codegen.py', + '--binding-module=o3d:plugin/o3d_binding.py', + '--generate=$IDL_GENERATE', + '--output-dir=${TARGET.dir}'] +if ARGUMENTS.get('force-docs', False): + AUTOGEN_ARGS += ['--force-docs'] +AUTOGEN_ARGS += ['$SOURCES'] + +JSDOCS_CMD = ' '.join([ + '$JAVA_EXE', + '-Djsdoc.dir=$JSDOCTOOLKIT_DIR', + '-jar $JSDOC_JAR', + '$JSDOCTOOLKIT_DIR/app/run.js', + '-v', + '-t=$JSDOC_EZT_TEMPLATE_DIR/', + '-d=${TARGET.dir}', + ' '.join(LOCAL_JS_SOURCES)]) + +def TouchAll(target=None, source=None, env=None): + for i in target: + if not os.path.exists(i.path): + open(i.path, 'wb').close() + +env["BUILDERS"]["IdlDocs"] = Builder(action=[env.Python(AUTOGEN_ARGS), + Action(TouchAll)], + emitter=IdlDocsEmitter) + +doxy_inputs = [] +doxy_inputs += env.IdlDocs( + 'dummy', LOCAL_IDL_SOURCES, + IDL_GENERATE='jsheader', + IDL_GENERATE_EXT='h') + +def EZTStep(target=None, source=None, env=None): + dir = env.Dir('$OBJ_ROOT/documentation/html') + html_files = glob.glob(dir.path + os.sep + '*.html') + for file in html_files: + ret = env.Execute(env.Python(['$EZT_FORMATTER', file])) + if ret > 0: + return ret + return 0 + +def ClassTreeStep(target=None, source=None, env=None): + dir = env.Dir('$OBJ_ROOT/documentation/html') + return env.Execute(env.Python(['$CLASS_TREE_GEN', dir.path])) + +env.Command( + 'html/doxygen.png', doxy_inputs, + ['$DOXYGEN documentation/Doxyfile', + Action(EZTStep), + Action(ClassTreeStep), + Touch('$TARGET')], +) + +env["BUILDERS"]["JSDocs"] = Builder(action=JSDOCS_CMD) + +# index.ezt is a file that the jsdoctoolkit happens to build. +# Putting it in jsdocs means that will be our target dir for the rest +# of the files. +env.JSDocs('html/jsdocs/classtree.html', LOCAL_JS_SOURCES + + ['$JSDOC_EZT_TEMPLATE_DIR/annotated.tmpl', + '$JSDOC_EZT_TEMPLATE_DIR/class.tmpl', + '$JSDOC_EZT_TEMPLATE_DIR/classtree.tmpl', + '$JSDOC_EZT_TEMPLATE_DIR/filelist.tmpl', + '$JSDOC_EZT_TEMPLATE_DIR/members.tmpl', + '$JSDOC_EZT_TEMPLATE_DIR/namespaces.tmpl', + '$JSDOC_EZT_TEMPLATE_DIR/publish.js', + '$JSDOC_EZT_TEMPLATE_DIR/static/header.html', + '$JSDOC_EZT_TEMPLATE_DIR/static/footer.html']) diff --git a/o3d/documentation/classtree.bat b/o3d/documentation/classtree.bat new file mode 100644 index 0000000..f15bbe8 --- /dev/null +++ b/o3d/documentation/classtree.bat @@ -0,0 +1,33 @@ +@echo OFF +REM Copyright 2009, Google Inc. +REM All rights reserved. +REM +REM Redistribution and use in source and binary forms, with or without +REM modification, are permitted provided that the following conditions are +REM met: +REM +REM * Redistributions of source code must retain the above copyright +REM notice, this list of conditions and the following disclaimer. +REM * Redistributions in binary form must reproduce the above +REM copyright notice, this list of conditions and the following disclaimer +REM in the documentation and/or other materials provided with the +REM distribution. +REM * Neither the name of Google Inc. nor the names of its +REM contributors may be used to endorse or promote products derived from +REM this software without specific prior written permission. +REM +REM THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +REM "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +REM LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +REM A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +REM OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +REM SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +REM LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +REM DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +REM THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +REM (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +REM OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +set PYTHONDIR=%~dp0..\..\third_party\python_24 +call %PYTHONDIR%\setup_env.bat +%PYTHONDIR%\python.exe %~dp0\classtree.py %* diff --git a/o3d/documentation/classtree.py b/o3d/documentation/classtree.py new file mode 100644 index 0000000..36308e5 --- /dev/null +++ b/o3d/documentation/classtree.py @@ -0,0 +1,166 @@ +#!/usr/bin/python2.4 +# Copyright 2009, 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. + + +"""Creates unordered list of classes and packages.""" + + +import os.path +import re +import sys + +# Special regular expressions for search and replace +list_item_string = ('<a class="el" href="([a-zA-Z0-9_]*.html)">' + '([a-zA-Z0-9\.]*)</a></td>') +LIST_ITEM = re.compile(list_item_string) + + +def HyphenateWord(original_word, max_length, join_str='-'): + """Breaks a word at max_length with hyphens. + + If the word is still too long (i.e., length > 2*max_length), the word will + be split again. The word will be split at word breaks defined by a + switch from lowercase to uppercase. The function will attempt to break at + the closest switch before the max_length number of letters. If there is no + upper case letter before the max_length, the original word will be returned. + If max_length is 0 the original word will be returned. + + Args: + original_word: the word to break. + max_length: maximum length in chars for any piece of the word. + join_str: characters to join the hyphenated parts with, defaults to '-' + Returns: + the hyphenated word. + """ + word_list = [] + while len(original_word) > max_length: + for i in range(max_length, -1, -1): + if original_word[i].isupper(): + word_list += [original_word[:i]] + original_word = original_word[i:] + break + if i == 0: + # There was no uppercase letter found so we don't break and just + # return the original word + return original_word + + word_list += [original_word] + + return join_str.join(word_list) + + +def CreateListItems(input_html_file, max_length, html_directory): + """Creates html for a list of items based on the input html file. + + Args: + input_html_file: file to extract list items from. + max_length: maximum length for sidebar entry. + html_directory: relative html path for linked files. + Returns: + item_list: a list representing the new html. + """ + infile = open(input_html_file, 'r') + lines_list = infile.readlines() + infile.close() + + item_list = [' <ul>\n'] + format_string = (' <li><a href="%s%s">%s</a></li>\n') + heading_format_string = (' <li><font class="sidebar-heading">%s' + '</font></li>\n') + + previous_package = '' + for line in lines_list: + match = re.search(LIST_ITEM, line) + if match: + split_name = match.group(2).split('.') + short_name = HyphenateWord(split_name[-1], max_length, '-<br>') + package = '.'.join(split_name[:-1]) + if package != previous_package: + item_list += [heading_format_string % package] + previous_package = package + item_list += [format_string % (html_directory, match.group(1), + short_name)] + + item_list += [' </ul>\n'] + + return item_list + + +def CreateClassTreeHtmlFile(classtree_items, directory, html_directory): + """Creates classtree.html file which has item lists based on class structure. + + The html file is only the lists and no surrounding html (body tag, etc.) as + it is meant to be inserted into ezt html. + + Args: + classtree_items: list of header-filename pairs to create list from. + directory: location of the input html files to CreateListItems. + html_directory: relative html path for linked files. + """ + # Open file to write + filename = os.path.join(directory, 'classtree.html') + outfile = open(filename, 'w') + + originals_directory = os.path.join(directory, 'original_html') + + output_list = ['<ul>\n'] + for ct_item in classtree_items: + output_list += [' <li><a href="%s' % html_directory] + output_list += ['%s">%s</a>\n' % (ct_item[1], ct_item[0])] + full_file_name = os.path.join(originals_directory, ct_item[1]) + output_list += CreateListItems(full_file_name, 16, html_directory) + output_list += [' </li>\n'] + output_list += ['</ul>\n'] + + outfile.writelines(output_list) + outfile.close() + + +def main(): + usage_string = 'This script generates an html list of the classes and ' + usage_string += 'packages. The output file is called classtree.html. If no ' + usage_string += 'directory is specified, . is used as a default\n' + usage_string += 'Usage: classtree.py <directory>' + + print usage_string + + # Specify the default directory + directory = '.' + if len(sys.argv) > 1: + directory = sys.argv[1] + #create classtree items + classtree_items = [('Packages', 'namespaces.html'), + ('Classes', 'annotated.html')] + # create the class tree + CreateClassTreeHtmlFile(classtree_items, directory, + '/apis/o3d/docs/reference/') + +if __name__ == '__main__': + main() diff --git a/o3d/documentation/ezt_formatter.bat b/o3d/documentation/ezt_formatter.bat new file mode 100644 index 0000000..bd0b99e --- /dev/null +++ b/o3d/documentation/ezt_formatter.bat @@ -0,0 +1,33 @@ +@echo OFF +REM Copyright 2009, Google Inc. +REM All rights reserved. +REM +REM Redistribution and use in source and binary forms, with or without +REM modification, are permitted provided that the following conditions are +REM met: +REM +REM * Redistributions of source code must retain the above copyright +REM notice, this list of conditions and the following disclaimer. +REM * Redistributions in binary form must reproduce the above +REM copyright notice, this list of conditions and the following disclaimer +REM in the documentation and/or other materials provided with the +REM distribution. +REM * Neither the name of Google Inc. nor the names of its +REM contributors may be used to endorse or promote products derived from +REM this software without specific prior written permission. +REM +REM THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +REM "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +REM LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +REM A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +REM OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +REM SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +REM LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +REM DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +REM THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +REM (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +REM OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +set PYTHONDIR=%~dp0..\..\third_party\python_24 +call %PYTHONDIR%\setup_env.bat +%PYTHONDIR%\python.exe %~dp0\ezt_formatter.py %* diff --git a/o3d/documentation/ezt_formatter.py b/o3d/documentation/ezt_formatter.py new file mode 100644 index 0000000..feccdf4 --- /dev/null +++ b/o3d/documentation/ezt_formatter.py @@ -0,0 +1,351 @@ +#!/usr/bin/python2.4 +# Copyright 2009, 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. + + +"""HTML formatter for ezt docs.""" + + +import os +import os.path +import re +import shutil +import sys + + +class DoxygenJavascriptifier(object): + """Convert C++ documentation into Javascript style. + + Documentation may be automatically generated using doxygen. However, + doxygen only outputs C++ formatted documentation, that is it uses C++ + conventions for specifying many items even if the java option is selected in + the configuration file. + + In order to make the documentation look like Javascript documentation, + additional corrections must be made which this class takes care of. + + Since doxygen allows you to name functions and class whatever you wish, this + class assumes that you have already chosen to name them with standard + Javascript conventions (such as camel-case) and therefore does not try to + correct that. + + Though many of the replacements are simply eliminated, they are left as + individual items in the dictionary for clarity. + + Attributes: + cpp_to_js: a list of c++ to javascript replacement tuples + static_function_regex: regular expression describing a static function + declaration + """ + + global_function_tag = '[<a class="doxygen-global">global function</a>]' + static_function2_regex = re.compile(r'<li>(.*)static(.*)$') + cpp_to_js = [(re.compile(r'::'), '.'), + (re.compile(r'\[pure\]'), ''), + (re.compile(r'\[pure virtual\]'), ''), + (re.compile(r'\[virtual\]'), ''), + (re.compile(r'\[protected\]'), ''), + (re.compile(r'\[static\]'), global_function_tag), + (re.compile(r'\[explicit\]'), ''), + (re.compile(r'\bvirtual\b'), ''), + (re.compile(r'\bpure\b'), ''), + (re.compile(r'\bprotected\b'), ''), + (re.compile(r'\bvoid\b'), ''), + (re.compile(r'\bunsigned\b'), ''), + (re.compile(r'\bstatic\b'), ''), + (re.compile(r'\bStatic\b'), 'Global'), + (re.compile(r'\bint\b'), 'Number'), + (re.compile(r'\bfloat\b'), 'Number'), + (re.compile(r'\bNULL\b'), 'null'), + (re.compile(r'=0'), ''), + # Replace "std.vector<class_name>" with "Array" since vectors + # don't exist in Javascript. There is no type for Array in + # Javascript. + (re.compile(r'std.vector<[\w\s<>"/.=+]*>'), 'Array'), + # Remove mention of Vectormath.Aos namespace since it is + # invisible to Javascript. + (re.compile(r'Vectormath.Aos.Vector3'), 'Vector3'), + (re.compile(r'Vectormath.Aos.Vector4'), 'Vector4'), + (re.compile(r'Vectormath.Aos.Point3'), 'Point3'), + (re.compile(r'Vectormath.Aos.Matrix4'), 'Matrix4'), + (re.compile(r'Vectormath.Aos.Quat'), 'Quat'), + (re.compile(r'\bconst\b'), '')] + + def Javascriptify(self, lines_list): + """Replaces C++-style items with more Javascript-like ones. + + This includes removing many identifiers such as pure, virtual, protected, + static and explicit which are not used in Javascript and replacing + notation such as '::' with its corresponding Javascript equivalent, + '.' in this case. + + Args: + lines_list: the list of lines to correct. + Returns: + the corrected lines in javascript format. + """ + for index, line in enumerate(lines_list): + line = self.LabelStaticAsGlobal(line) + for cpp_expression, js_expression in self.cpp_to_js: + line = re.sub(cpp_expression, js_expression, line) + lines_list[index] = line + return lines_list + + def LabelStaticAsGlobal(self, line): + """If a function is static, we indicate it is a global function. + + Since static does not make sense for Javascript we refer to these + functions as global. To designate global function, we place a + [global function] tag after the function declaration. Doxygen by + default leaves the static descriptor in front of the function so + this function looks for the descriptor, removes it and puts the + tag at the end. + + Args: + line: the line to correct. + Returns: + the corrected line. + """ + match = re.search(self.static_function2_regex, line) + if match is not None: + line = '<li>%s%s %s\n' % (match.group(1), match.group(2), + self.global_function_tag) + return line + + +class EZTFormatter(object): + """This class converts doxygen output into ezt ready files. + + When doxygen outputs files, it contains its own formatting such as adding + navigation tabs to the top of each page. This class contains several + functions for stripping down doxygen output and formatting doxygen output + to be easily parsed by ezt. + + This class assumes that any header/footer boilerplate code (that is code + added by the user rather than doxygen at the start or end of a file) is + indicated by special indicator strings surrounding it. Namely at the + start of boilerplate code: 'BOILERPLATE - DO NOT EDIT THIS BLOCK' and + at the end of boilerplate code: 'END OF BOILERPLATE'. + + Attributes: + content_start_regex: regular expression for end of boilerplate code + content_end_regex: regular expression for start of boilerplate code + div_regex: regular expression of html div + div_end_regex: regular expression of closing html div + navigation_regex: regular expression indicating doxygen navigation tabs + html_suffix_regex: regular expression html file suffix + current_directory: location of files being worked on + originals_directory: directory to store copies of original html files + modifiers: list of functions to apply to files passed in + """ + content_start_regex = re.compile('END OF BOILERPLATE') + content_end_regex = re.compile('BOILERPLATE - DO NOT EDIT THIS BLOCK') + div_regex = re.compile('<div(.*)>') + div_end_regex = re.compile('</div>') + navigation_regex = re.compile('<div class=\"tabs\"(.*)>') + html_suffix_regex = re.compile('\.html$') + + def __init__(self, current_directory): + + self.current_directory = current_directory + self.originals_directory = os.path.join(current_directory, 'original_html') + if not os.path.exists(self.originals_directory): + os.mkdir(self.originals_directory) + self.modifiers = [] + + def RegisterModifier(self, modifier): + """Adds the modifier function to the list of modifier functions. + + Args: + modifier: the function modifies a list of strings of code + """ + self.modifiers += [modifier] + + def MakeBackupCopy(self, input_file): + """Makes backup copy of input_file by copying to originals directory. + + Args: + input_file: basename of file to backup. + """ + shutil.copy(os.path.join(self.current_directory, input_file), + self.originals_directory) + + def PerformFunctionsOnFile(self, input_file): + """Opens a file as a list, modifies the list and writes to same file. + + Args: + input_file: the file being operated on. + """ + infile = open(input_file, 'r') + lines_list = infile.readlines() + infile.close() + + for function in self.modifiers: + lines_list = function(lines_list) + + outfile = open(input_file, 'w') + outfile.writelines(lines_list) + outfile.close() + + def FixBrackets(self, lines_list): + """Adjust brackets to be ezt style. + + Fix the brackets such that any open bracket '[' becomes '[[]' in order to + not conflict with the brackets ezt uses as special characters. + + EZT uses boilerplate code at the beginning and end of each file. When + editing a file, however, we don't want to touch the boilerplate code. + We can look for special indicators through regular expressions of + where the content lies between the boilerplate sections and then only + apply the desired function line by line to the html between those + sections. + + This is a destructive operation and will write over the input file. + + Args: + lines_list: the file to fix broken into lines. + Returns: + the lines_list with correctly formatted brackets. + """ + outside_boilerplate = False + for index, line in enumerate(lines_list): + if self.content_end_regex.search(line) and outside_boilerplate: + # We've reached the end of content; return our work + return lines_list + elif self.content_start_regex.search(line): + # We've found the start of real content, end of boilerplate + outside_boilerplate = True + elif outside_boilerplate: + # Inside real content; fix brackets + lines_list[index] = line.replace('[', '[[]') + else: + pass # Inside boilerplate. + return lines_list + + def RemoveNavigation(self, lines_list): + """Remove html defining navigation tabs. + + This function removes the lines between the <div class ="tabs">...</div> + which will eliminate the navigation tabs Doxygen outputs at the top of + its documentation. These are extraneous for Google's codesite which + produces its own navigation using the ezt templates. + + Nested <div>'s are handled, but it currently expects no more than one + <div>...</div> set per line. + + This is a destructive operation and will write over the input file. + + Args: + lines_list: the lines of the file to fix. + Returns: + the lines_list reformatted to not include tabs div set. + """ + start_index = -1 + div_queue = [] + start_end_pairs = {} + for index, line in enumerate(lines_list): + # Start by looking for the start of the navigation section + if self.navigation_regex.search(line): + start_index = index + if self.div_regex.search(line): + if start_index > -1: + div_queue.append(index) + if self.div_end_regex.search(line): + if start_index > -1: + # If we pop our start_index, we have found the matching </div> + # to our <div class="tabs"> + if div_queue.pop() == start_index: + start_end_pairs[start_index] = index + start_index = -1 + + # Delete the offending lines + keys = start_end_pairs.keys() + keys.sort() + keys.reverse() + for k in keys: + del lines_list[k:start_end_pairs[k]+1] + return lines_list + + def RenameFiles(self, input_file): + """Fix file suffixes from .html to .ezt. + + This will also backup original html files to the originals directory. + + This operation will overwrite the previous ezt file. + + NOTE: If the originals directory is not a directory, the file will + be overwritten. + + Args: + input_file: the file to fix. + """ + # If the file does not end in .html, we do not want to continue + if self.html_suffix_regex.search(input_file): + new_name = re.sub(self.html_suffix_regex, '.ezt', input_file) + shutil.copy(input_file, self.originals_directory) + # Rename file. If file exists, rename will not overwrite, and produce + # OSError. So delete the old file first in that case. + try: + os.rename(input_file, new_name) + except OSError: + os.remove(new_name) + os.rename(input_file, new_name) + + +def main(): + usage_string = ('This script is meant to convert .html files into .ezt files ' + 'in addition to eliminating any C++-style notations and ' + 'replacing them with their Javascript-style counter parts.\n' + 'Note: This will write over existing files as well as nuke ' + 'any associated directories such as "original_html" located ' + 'in the same directory as the first argument\n' + 'Usage: ezt_formatter.py <html_file(s)>') + + files = sys.argv[1:] + if not files: + # We have no files, so return, showing usage + print usage_string + return + + # current_directory should be the same for all files + current_directory = os.path.dirname(files[0]) + formatter = EZTFormatter(current_directory) + dj = DoxygenJavascriptifier() + formatter.RegisterModifier(formatter.RemoveNavigation) + formatter.RegisterModifier(dj.Javascriptify) + formatter.RegisterModifier(formatter.FixBrackets) + + for f in files: + formatter.PerformFunctionsOnFile(f) + formatter.RenameFiles(f) + + formatter.MakeBackupCopy('stylesheet.css') + +if __name__ == '__main__': + main() diff --git a/o3d/documentation/ezt_formatter_test.py b/o3d/documentation/ezt_formatter_test.py new file mode 100644 index 0000000..7d0ece6 --- /dev/null +++ b/o3d/documentation/ezt_formatter_test.py @@ -0,0 +1,197 @@ +#!/usr/bin/python2.4 +# Copyright 2009, 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. + + +"""Test for ezt_formatter.""" + + +import os +import os.path +import ezt_formatter +import unittest + +class EZTFormatterUnitTest(unittest.TestCase): + def setUp(self): + self.formatter = ezt_formatter.EZTFormatter('.') + self.java = ezt_formatter.DoxygenJavascriptifier() + + def tearDown(self): + os.rmdir(self.formatter.originals_directory) + + def CreateContentList(self, inner_content): + content = ['[BOILERPLATE - DO NOT EDIT THIS BLOCK]'] + content += ['[END OF BOILERPLATE]'] + content += inner_content + content += ['[BOILERPLATE - DO NOT EDIT THIS BLOCK]'] + content += ['[END OF BOILERPLATE]'] + return content + + def testJavascriptify(self): + # test numbers + content = ['int myInt()'] + content += ['myFloat(float f);'] + java_content = self.java.Javascriptify(content) + self.assertTrue(java_content[0] == 'Number myInt()') + self.assertTrue(java_content[1] == 'myFloat(Number f);') + # test non-javascript tags + content = ['pure test::myVar [pure virtual] Static'] + content += ['const void testFunction() [virtual] [pure]'] + content += ['testing [explicit]'] + content += ['virtual [protected] test;'] + content += ['static unsigned int function();'] + content += ['const float testing::test()=0'] + content += ['protected testing() [pure]'] + content += ['[pure]'] + java_content = self.java.Javascriptify(content) + self.assertTrue(java_content[0] == ' test.myVar Global') + self.assertTrue(java_content[1] == ' testFunction() ') + self.assertTrue(java_content[2] == 'testing ') + self.assertTrue(java_content[3] == ' test;') + self.assertTrue(java_content[4] == ' Number function();') + self.assertTrue(java_content[5] == ' Number testing.test()') + self.assertTrue(java_content[6] == ' testing() ') + self.assertFalse(java_content[7]) + # test static tag + content = ['myTestFunction() [static]'] + java_content = self.java.Javascriptify(content) + self.assertTrue(java_content[0] == ('myTestFunction() [<a class="doxygen-' + 'global">global function</a>]')) + # test null + content = ['return NULL;'] + java_content = self.java.Javascriptify(content) + self.assertTrue(java_content[0] == 'return null;') + # test Array + content = ['std.vector<test::arrayType> myArray'] + java_content = self.java.Javascriptify(content) + self.assertTrue(java_content[0] == 'Array myArray') + + def testJavascriptifyGlobal(self): + content = '<li>static test' + java_content = self.java.LabelStaticAsGlobal(content) + self.assertTrue(java_content == ('<li> test [<a class="doxygen-global">' + 'global function</a>]\n')) + content = '<li>abcdefg static myFunction(abc)<br>' + java_content = self.java.LabelStaticAsGlobal(content) + self.assertTrue(java_content == ('<li>abcdefg myFunction(abc)<br> [<a ' + 'class="doxygen-global">global function' + '</a>]\n')) + content = 'static abcde' + java_content = self.java.LabelStaticAsGlobal(content) + self.assertTrue(java_content == content) + + def testBackupCopy(self): + test_file = 'test_backup_file' + open(test_file, 'w') + self.formatter.MakeBackupCopy(test_file) + test_file_backup = os.path.join(self.formatter.originals_directory, + test_file) + self.assertTrue(os.path.exists(test_file)) + self.assertTrue(os.path.exists(test_file_backup)) + os.remove(test_file) + os.remove(test_file_backup) + + def testPerformFunctionsOnFile(self): + def ReplaceTest(lines_list): + new_lines_list = [] + for line in lines_list: + new_lines_list += [line.replace('test', 'pass')] + return new_lines_list + + test_file = 'test_file' + lines = ['test\n'] * 20 + outfile = open(test_file, 'w') + outfile.writelines(lines) + outfile.close() + + self.formatter.RegisterModifier(ReplaceTest) + self.formatter.PerformFunctionsOnFile(test_file) + + infile = open(test_file, 'r') + infile_lines = infile.readlines() + infile.close() + for in_line in infile_lines: + self.assertTrue(in_line == 'pass\n') + os.remove(test_file) + + def testRemoveNavigation(self): + content = ['<div class="test">'] + content += ['<div>'] + content += ['<div>'] + content += ['<div class="tabs" name="additional information to parse">'] + content += ['<div>'] + content += ['miscellaneous tab information'] + content += ['</div>'] + content += ['</div>'] + content += ['</div>'] + content += ['</div>'] + content += ['</div>'] + fixed_content = self.formatter.RemoveNavigation(content) + self.assertTrue(len(fixed_content) == 6) + self.assertTrue(fixed_content[0] == '<div class="test">') + self.assertTrue(fixed_content[1] == '<div>') + self.assertTrue(fixed_content[2] == '<div>') + self.assertTrue(fixed_content[3] == '</div>') + self.assertTrue(fixed_content[4] == '</div>') + self.assertTrue(fixed_content[5] == '</div>') + + def testFixBrackets(self): + content = ['test1'] + content += ['test2[]'] + content += ['test[3]'] + content += ['test[[4]]'] + content = self.CreateContentList(content) + fixed_content = self.formatter.FixBrackets(content) + self.assertTrue(fixed_content[2] == 'test1') + self.assertTrue(fixed_content[3] == 'test2[[]]') + self.assertTrue(fixed_content[4] == 'test[[]3]') + self.assertTrue(fixed_content[5] == 'test[[][[]4]]') + + def testRenameFiles(self): + html_file = 'test.html' + ezt_file = 'test.ezt' + open(html_file, 'w') + self.formatter.RenameFiles(html_file) + self.assertFalse(os.path.exists(html_file)) + self.assertTrue(os.path.exists(ezt_file)) + originals_html_file = os.path.join(self.formatter.originals_directory, + html_file) + self.assertTrue(originals_html_file) + # test functionality when file already exists + open(html_file, 'w') + self.formatter.RenameFiles(html_file) + self.assertFalse(os.path.exists(html_file)) + self.assertTrue(os.path.exists(ezt_file)) + self.assertTrue(originals_html_file) + os.remove(originals_html_file) + os.remove(ezt_file) + + +if __name__ == '__main__': + unittest.main() diff --git a/o3d/documentation/ezt_formatter_unittest.bat b/o3d/documentation/ezt_formatter_unittest.bat new file mode 100644 index 0000000..da0494c3d --- /dev/null +++ b/o3d/documentation/ezt_formatter_unittest.bat @@ -0,0 +1,33 @@ +@echo OFF +REM Copyright 2009, Google Inc. +REM All rights reserved. +REM +REM Redistribution and use in source and binary forms, with or without +REM modification, are permitted provided that the following conditions are +REM met: +REM +REM * Redistributions of source code must retain the above copyright +REM notice, this list of conditions and the following disclaimer. +REM * Redistributions in binary form must reproduce the above +REM copyright notice, this list of conditions and the following disclaimer +REM in the documentation and/or other materials provided with the +REM distribution. +REM * Neither the name of Google Inc. nor the names of its +REM contributors may be used to endorse or promote products derived from +REM this software without specific prior written permission. +REM +REM THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +REM "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +REM LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +REM A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +REM OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +REM SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +REM LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +REM DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +REM THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +REM (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +REM OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +set PYTHONDIR=%~dp0..\..\third_party\python_24 +call %PYTHONDIR%\setup_env.bat +%PYTHONDIR%\python.exe %~dp0\ezt_formatter_test.py %* diff --git a/o3d/documentation/footer.html b/o3d/documentation/footer.html new file mode 100644 index 0000000..bbdaf4d --- /dev/null +++ b/o3d/documentation/footer.html @@ -0,0 +1,10 @@ +</div><!-- end doxygen-ref --> +[## BOILERPLATE - DO NOT EDIT THIS BLOCK ##] +[#] </div><!-- end gc-pagecontent --> +[#] </div><!-- end gooey wrapper --> +[#] +[#] [include "/_common_page_footer.ezt"] +[#] +[#] </body> +[#]</html> +[## END OF BOILERPLATE ##] diff --git a/o3d/documentation/header.html b/o3d/documentation/header.html new file mode 100644 index 0000000..73347e5 --- /dev/null +++ b/o3d/documentation/header.html @@ -0,0 +1,29 @@ +[include "/apis/o3d/_local_variables.ezt"] [# the _local_variables.ezt file should be at the root of your document hierarchy ] +[define section]docs[end] [# this should almost always be "docs," if the file lives in the "Docs" section (top nav). Otherwise, it's "home," "articles," "download," or "terms" ] +[define page_title]O3D API[end] [# this is the title for only this page ] + +[## BOILERPLATE - DO NOT EDIT THIS BLOCK - VERSION 1.66 ##] +[#]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> +[#]<html> +[#] <head> +[#] [include "/apis/_common_head_elements.ezt"] +[#] <link href="/css/semantic_headers.css" rel="stylesheet" type="text/css" /> +[#] <link href="stylesheet.css" rel="stylesheet" type="text/css"> +[#] <link href="tabs.css" rel="stylesheet" type="text/css"> +[#] </head> +[#] +[#] <body class="gc-documentation"> +[#] +[#] [define content_section]#gc-pagecontent[end] +[#] [define navigation_section]#gc-toc[end] +[#] [include "/_common_page_header.ezt"] +[#] <div class="g-section g-tpl-170"> +[#] +[#] <div class="g-unit g-first" id="gc-toc"> +[#] [include toc_path] +[#] <a class="hidden" href="#gc-topnav-anchor">More [title] resource links</a> +[#] </div> +[#] +[#] <div class="g-unit" id="gc-pagecontent"> +[## END OF BOILERPLATE ##] +<div id="doxygen-ref"> diff --git a/o3d/documentation/jsdoc-toolkit-templates/annotated.tmpl b/o3d/documentation/jsdoc-toolkit-templates/annotated.tmpl new file mode 100644 index 0000000..1388e67 --- /dev/null +++ b/o3d/documentation/jsdoc-toolkit-templates/annotated.tmpl @@ -0,0 +1,27 @@ +<!-- ============================== header ================================= --> +<!-- begin static/header.html --> +{+include("static/header.html")+} +<!-- end static/header.html --> + +<div id="doxygen-ref"> +<!-- Genreated by jsdoctoolkit 2.1.0 --> +<div class="navigation" id="top"> +</div> + +<h1>Class List</h1> +Here are the classes, structs, unions and interfaces with brief descriptions: + +<table> + {! var allClasses = data.filter(function($){return !$.isNamespace}).sort(makeSortby("alias")); !} + <for each="thisClass" in="allClasses"> + <tr><td class="indexkey"><a class="el" href="{+getLinkToClassByAlias(thisClass.alias)+}">{+thisClass.alias+}</a></td><td class="indexvalue"></td></tr> + </for> +</table> + +</div><!-- end contents --> +</div><!-- end doxygen-ref --> + +<!-- ============================== footer ================================= --> +<!-- begin static/footer.html --> +{+include("static/footer.html")+} +<!-- end static/footer.html --> diff --git a/o3d/documentation/jsdoc-toolkit-templates/class.tmpl b/o3d/documentation/jsdoc-toolkit-templates/class.tmpl new file mode 100644 index 0000000..6d1b338 --- /dev/null +++ b/o3d/documentation/jsdoc-toolkit-templates/class.tmpl @@ -0,0 +1,294 @@ +{! +thisClass = data; +!} + +<!-- ============================== header ================================= --> + <!-- begin static/header.html --> + {+include("static/header.html")+} + <!-- end static/header.html --> + +<div id="doxygen-ref"> +<!-- Genreated by jsdoctoolkit 2.1.0 --> +<div class="navigation" id="top"> + <div class="navpath">{+getHierarchicalLinksToClassByAlias(thisClass.alias,'el')+}</div> +</div> + +<div class="contents"> +<h1>{+thisClass.alias+} <if test="thisClass.isNamespace">Module</if><if test="!thisClass.isNamespace">Class</if> Reference</h1> +<if test="thisClass.inheritsFrom.length"> + Inherits <a class="el" href="{+getLinkToClassByAlias(thisClass.inheritsFrom[0])+}">{+thisClass.inheritsFrom[0]+}</a> +</if> +<p/> + +<p/> +<a href="{+getLinkToClassMembersByAlias(thisClass.alias)+}">List of all members.</a> +<hr/> +<a name="_details"></a> +<h2>Detailed Description</h2> +<if test="thisClass.classDesc">{+sanitizeForEZT(thisClass.classDesc)+}</if> +<if test="!thisClass.classDesc">{+sanitizeForEZT(thisClass.desc)+}</if> + +<if test="thisClass.srcFile.length"> +<h2>Source</h2> +<a name="_source" href="http://code.google.com/p/o3d/source/browse/trunk/samples/{+getSourcePath(thisClass)+}">{+getSourcePath(thisClass)+}</a> +</if> + +<!-- =========== SEE ALSO =========== --> +<if test="data.see.length"> + <h2>See Also</h2> + <ul> + <for each="seeAlso" in="data.see"> + <li> + {+linkifyTypeSpec(seeAlso)+} + </li> + </for> + </ul> +</if> + +<!-- =========== SEE ALSO =========== --> + +<!-- ========== CONSTRUCTOR SUMMARY ============== --> +<if test="!data.isPrivate && !data.isBuiltin() && !data.isNamespace && data.is('CONSTRUCTOR')"> + <h2>Constructor</h2> + <ul> + <li><a class="el" href="{+data.name+}">{+data.alias+}</a><if test="data.classType != 'Namespace '">{+ makeSignature(data.params) +}</if></li> + </ul> +</if> + +<!-- ========== METHOD SUMMARY =========== --> +<if test="thisClass.methods.length"> + {! var ownMethods = data.methods.sort(makeSortby("name")); !} + <if test="ownMethods.length"> + <h2>Public Member Functions</h2> + <ul> + <for each="method" in="ownMethods"> + <if test="!method.isPrivate"> + <li> + <if test="method.isStatic||!method.memberOf"><static> </if> + <if test="method.type.length">{+linkifyTypeSpec(method.type)+} </if> + <a class="el" href="#{+method.name+}">{+method.name+}</a>{+makeSignature(method.params)+} + </li> + </if> + </for> + </ul> + </if> +</if> + +<!-- =========== FIELD SUMMARY =========== --> +<if test="data.properties.length"> + {! var ownProperties = data.properties.sort(makeSortby("name")); !} + <if test="ownProperties.length"> + <h2>Public Properties</h2> + <ul> + <for each="property" in="ownProperties"> + <if test="!property.isPrivate"> + <li> + <if test="property.isStatic||!property.memberOf"><static> </if> + {+linkifyTypeSpec(getPropertyType(property))+} + <a class="el" href="#{+property.name+}">{+property.name+}</a> + </li> + </if> + </for> + </ul> + </if> +</if> + +<!-- =========== END FIELD SUMMARY =========== --> + +<!-- ========== CONSTRUCTOR DETAIL ============== --> +<if test="!data.isPrivate && !data.isBuiltin() && !data.isNamespace && data.is('CONSTRUCTOR')"> + <hr/> + <h2>Constructor</h2> + <a class="anchor" name="{+data.name+}"></a> + <div class="memitem"> + <div class="memproto"> + <table class="memname"> + <if test="data.params && data.params.length"> + {! + var tempCSS = "memname"; + var tempName = data.alias; + var tempParen = "("; + var tempEnd = data.params.length > 1 ? "" : ")" + !} + <for each="param" in="data.params"> + <tr> + <td class="{+tempCSS+}">{+tempName+}</td> + <td>{+tempParen+}</td> + <td class="paramtype">{+linkifyTypeSpec(param.type)+}</td> + <td class="paramname"><em>{+param.name+}</em></td> + <td><if test="$param_last">)</if></td> + <td></td> + </tr> + {! + tempCSS = "paramkey"; + tempName = ""; + tempParen = ""; + !} + </for> + </if> + <if test="!data.params || data.params.length == 0"> + <tr> + <td class="memname">{+data.alias+}</td> + <td>(</td> + <td class="paramtype"></td> + <td class="paramname"></td> + <td>)</td> + <td></td> + </tr> + </if> + </table> + </div> + + <div class="memdoc"> + <p/> + {+sanitizeForEZT(data.desc)+} + <if test="data.params && data.params.length"> + <dl compact><dt><b>Parameters:</b></dt> + <dd> + <table border="0" cellspacing="2" cellpadding="0"> + <for each="param" in="data.params"> + <tr><td valign="top"></td><td valign="top"><em>{+param.name+}</em></td><td>{+sanitizeForEZT(param.desc)+}</td></tr> + </for> + </table> + </dd> + </dl> + </if> + </div> + + </div> +</if> + +<!-- =========== METHOD DETAIL ============== --> +<if test="defined(ownMethods) && ownMethods.length"> + <hr/> + <h2>Member Function Documentation</h2> + <for each="member" in="ownMethods"> + <if test="!member.isPrivate"> + <a class="anchor" name="{+member.name+}"></a> + <div class="memitem"> + <div class="memproto"> + <table class="memname"> + {! var tempInherited = member.memberOf == thisClass.alias ? "" : "[[]inherited]"; !} + <if test="member.params && member.params.length"> + {! + var tempCSS = "memname"; + var tempName = linkifyTypeSpec(member.type)+" "+member.memberOf+"."+member.name; + var tempParen = "("; + var tempEnd = member.params.length > 1 ? "" : ")" + !} + <for each="param" in="member.params"> + <tr> + <td class="{+tempCSS+}">{+tempName+}</td> + <td>{+tempParen+}</td> + <td class="paramtype">{+linkifyTypeSpec(param.type)+}</td> + <td class="paramname"><em>{+param.name+}</em></td> + <td><if test="$param_last">)</if></td> + <td><if test="$param_last">{+tempInherited+}</if></td> + </tr> + {! + tempCSS = "paramkey"; + tempName = ""; + tempParen = ""; + !} + </for> + </if> + <if test="!member.params || member.params.length == 0"> + <tr> + <td class="memname">{+member.memberOf+"."+member.name+}</td> + <td>(</td> + <td class="paramtype"></td> + <td class="paramname"></td> + <td>)</td> + <td>{+tempInherited+}</td> + </tr> + </if> + </table> + </div> + + <div class="memdoc"> + <p/> + {+sanitizeForEZT(member.desc)+} + <if test="member.params && member.params.length"> + <dl compact><dt><b>Parameters:</b></dt> + <dd> + <table border="0" cellspacing="2" cellpadding="0"> + <for each="param" in="member.params"> + <tr><td valign="top"></td><td valign="top"><em>{+param.name+}</em></td><td>{+sanitizeForEZT(param.desc)+}</td></tr> + </for> + </table> + </dd> + </dl> + </if> + <if test="member.type && member.type.length"> + <dl class="return" compact><dt><b>Returns:</b></dt> + <dd> + {+linkifyTypeSpec(member.type)+}.<if test="member.returns && member.returns.length">{+sanitizeForEZT(member.returns[0].desc)+}</if> + </dd> + </if> + </div> + + <if test="member.see.length"> + <dl compact><td><b>See Also:</b></dt> + <dd><ul> + <for each="seeAlso" in="member.see"> + <li> + {+linkifyTypeSpec(seeAlso)+} + </li> + </for> + </ul></dd> + </dl> + </if> + + </div> + </if> + </for> +</if> + +<!-- =========== PROPERTY DETAIL ============== --> + +<if test="defined(ownProperties) && ownProperties.length"> + <hr/> + <h2>Member Property Documentation</h2> + <for each="property" in="ownProperties"> + <if test="!property.isPrivate"> + <a class="anchor" name="{+property.name+}"></a> + <div class="memitem"> + <div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">{+linkifyTypeSpec(getPropertyType(property))+} {+property.memberOf+"."+property.name+}</td> + </tr> + </table> + </div> + + <div class="memdoc"> + <p/> + {+sanitizeForEZT(property.desc)+} + </div> + + <if test="property.see.length"> + <dl compact><td><b>See Also:</b></dt> + <dd><ul> + <for each="seeAlso" in="property.see"> + <li> + {+linkifyTypeSpec(seeAlso)+} + </li> + </for> + </ul></dd> + </dl> + </if> + + </div> + </if> + </for> +</if> + +</div><!-- end contents --> +</div><!-- end doxygen-ref --> + +<!-- ============================== footer ================================= --> + <!-- begin static/footer.html --> + {+include("static/footer.html")+} + <!-- end static/footer.html --> + + diff --git a/o3d/documentation/jsdoc-toolkit-templates/classtree.tmpl b/o3d/documentation/jsdoc-toolkit-templates/classtree.tmpl new file mode 100644 index 0000000..85b1435 --- /dev/null +++ b/o3d/documentation/jsdoc-toolkit-templates/classtree.tmpl @@ -0,0 +1,19 @@ +<ul> + <li><a href="/apis/o3d/docs/reference/jsdocs/namespaces.html">Modules</a> + <ul> + {! var allNamespaces = data.filter(function($){return $.isNamespace}).sort(makeSortby("alias")); !} + <for each="thisClass" in="allNamespaces"> + <li><a href="/apis/o3d/docs/reference/jsdocs/{+getLinkToClassByAlias(thisClass.alias)+}">{+thisClass.name+}</a></li> + </for> + </ul> + </li> + <li><a href="/apis/o3d/docs/reference/jsdocs/annotated.html">Classes</a> + <ul> + {! var allClasses = data.filter(function($){return !$.isNamespace}).sort(makeSortby("alias")); !} + <for each="thisClass" in="allClasses"> + <li><a href="/apis/o3d/docs/reference/jsdocs/{+getLinkToClassByAlias(thisClass.alias)+}">{+thisClass.name+}</a></li> + </for> + </ul> + </li> +</ul> + diff --git a/o3d/documentation/jsdoc-toolkit-templates/filelist.tmpl b/o3d/documentation/jsdoc-toolkit-templates/filelist.tmpl new file mode 100644 index 0000000..5be3659 --- /dev/null +++ b/o3d/documentation/jsdoc-toolkit-templates/filelist.tmpl @@ -0,0 +1,7 @@ +<ul> + {! var allFiles = data.filter(function($){return $.is('FILE')}).sort(makeSortby("alias")); !} + <for each="thisFile" in="allFiles"> + <li><a href="[path_to_samples]{+getSourcePath(thisFile)+}">{+getSourcePath(thisFile)+}</a></li> + </for> +</ul> + diff --git a/o3d/documentation/jsdoc-toolkit-templates/members.tmpl b/o3d/documentation/jsdoc-toolkit-templates/members.tmpl new file mode 100644 index 0000000..8a37abf --- /dev/null +++ b/o3d/documentation/jsdoc-toolkit-templates/members.tmpl @@ -0,0 +1,65 @@ +{! +thisClass = data; +!} + +<!-- ============================== header ================================= --> + <!-- begin static/header.html --> + {+include("static/header.html")+} + <!-- end static/header.html --> + +<div id="doxygen-ref"> +<!-- Genreated by jsdoctoolkit 2.1.0 --> +<div class="navigation" id="top"> +</div> + +<div class="contents"> +<h1>{+thisClass.alias+} Member List</h1> +This is the complete list of members for +<a class="el" href="{+getLinkToClassByAlias(thisClass.alias)+}">{+thisClass.alias+}</a>, including all inherited members. +<p/> +<table> + +<!-- ========== CONSTRUCTOR SUMMARY ============== --> +<if test="!data.isPrivate && !data.isBuiltin() && !data.isNamespace && data.is('CONSTRUCTOR')"> +<tr class="memlist"><td><a class="el" href="{+getLinkToClassByAlias(thisClass.alias)+}#{+data.name+}">{+data.alias+}</a><if test="data.classType != 'Namespace '">{+ makeSignature(data.params) +}</if></td><td><a class="el" href="{+getLinkToClassByAlias(thisClass.memberOf)+}">{+thisClass.memberOf+}</a></td><td></td></tr> +</if> + +<!-- ========== METHOD SUMMARY =========== --> +<if test="thisClass.methods.length"> + {! var ownMethods = data.methods.sort(makeSortby("name")); !} + <if test="ownMethods.length"> + <for each="method" in="ownMethods"> + <if test="!method.isPrivate"> + <tr class="memlist"><td><a class="el" href="{+getLinkToClassByAlias(thisClass.alias)+}#{+method.name+}">{+method.name+}</a>{+ makeSignature(method.params) +}</td><td><a class="el" href="{+getLinkToClassByAlias(method.memberOf)+}">{+method.memberOf+}</a></td><td></td></tr> + </if> + </for> + </if> +</if> + +<!-- =========== FIELD SUMMARY =========== --> +<if test="data.properties.length"> + {! var ownProperties = data.properties.sort(makeSortby("name")); !} + <if test="ownProperties.length"> + <for each="property" in="ownProperties"> + <if test="!property.isPrivate"> + <tr class="memlist"><td><a class="el" href="{+getLinkToClassByAlias(thisClass.alias)+}#{+property.name+}">{+property.name+}</a></td><td><a class="el" href="{+getLinkToClassByAlias(property.memberOf)+}">{+property.memberOf+}</a></td><td></td></tr> + </if> + </for> + </if> +</if> + +</table> + + +<!-- =========== END FIELD SUMMARY =========== --> + +</div><!-- end contents --> +</div><!-- end doxygen-ref --> + +<!-- ============================== footer ================================= --> + <!-- begin static/footer.html --> + {+include("static/footer.html")+} + <!-- end static/footer.html --> + + + diff --git a/o3d/documentation/jsdoc-toolkit-templates/namespaces.tmpl b/o3d/documentation/jsdoc-toolkit-templates/namespaces.tmpl new file mode 100644 index 0000000..c7d5891 --- /dev/null +++ b/o3d/documentation/jsdoc-toolkit-templates/namespaces.tmpl @@ -0,0 +1,27 @@ +<!-- ============================== header ================================= --> +<!-- begin static/header.html --> +{+include("static/header.html")+} +<!-- end static/header.html --> + +<div id="doxygen-ref"> +<!-- Genreated by jsdoctoolkit 2.1.0 --> +<div class="navigation" id="top"> +</div> + +<h1>Module List</h1> +Here are the modules with brief descriptions: + +<table> + {! var allClasses = data.filter(function($){return $.isNamespace}).sort(makeSortby("alias")); !} + <for each="thisClass" in="allClasses"> + <tr><td class="indexkey"><a class="el" href="{+getLinkToClassByAlias(thisClass.alias)+}">{+thisClass.alias+}</a></td><td class="indexvalue"></td></tr> + </for> +</table> + +</div><!-- end contents --> +</div><!-- end doxygen-ref --> + +<!-- ============================== footer ================================= --> +<!-- begin static/footer.html --> +{+include("static/footer.html")+} +<!-- end static/footer.html --> diff --git a/o3d/documentation/jsdoc-toolkit-templates/publish.js b/o3d/documentation/jsdoc-toolkit-templates/publish.js new file mode 100644 index 0000000..1890434 --- /dev/null +++ b/o3d/documentation/jsdoc-toolkit-templates/publish.js @@ -0,0 +1,675 @@ +/* + * Copyright 2009, 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. + */ + + +/** + * @fileoverview The jsdoctoolkit loads this file and calls publish() + */ + + +var g_symbolSet; // so we can look stuff up below. +var g_filePrefix; +var g_validJSDOCTypes = { + 'number': true, + 'Number': true, + 'object': true, + 'Object': true, + '*': true, + '...': true, + 'string': true, + 'String': true, + 'void': true, + 'undefined': true}; +var g_unknownTypes = { }; + +/** + * Called automatically by JsDoc Toolkit. + * @param {SymbolSet} symbolSet Set of all symbols in all files. + */ +function publish(symbolSet) { + publish.conf = { // trailing slash expected for dirs + ext: '.ezt', + outDir: JSDOC.opt.d || SYS.pwd + '../out/jsdoc/', + templatesDir: JSDOC.opt.t || SYS.pwd + '../templates/jsdoc/', + symbolsDir: '', + prefix: 'js_1_0_'}; + publish.conf.srcDir = publish.conf.outDir + 'src/' + publish.conf.htmlDir = publish.conf.outDir + 'original_html/' + + // is source output is suppressed, just display the links to the source file + if (JSDOC.opt.s && defined(Link) && Link.prototype._makeSrcLink) { + Link.prototype._makeSrcLink = function(srcFilePath) { + return '<' + srcFilePath + '>'; + } + } + + // create the folders and subfolders to hold the output + IO.mkPath((publish.conf.htmlDir).split('/')); + + // used to allow Link to check the details of things being linked to + Link.symbolSet = symbolSet; + Link.base = '../'; + + // used to allow other parts of this module to access database of symbols + // and the file prefix. + g_symbolSet = symbolSet; + g_filePrefix = publish.conf.prefix; + + // create the required templates + try { + var templatesDir = publish.conf.templatesDir; + var classTemplate = new JSDOC.JsPlate(templatesDir + 'class.tmpl'); + var membersTemplate = new JSDOC.JsPlate(templatesDir + 'members.tmpl'); + var classTreeTemplate = new JSDOC.JsPlate(templatesDir + 'classtree.tmpl'); + var fileListTemplate = new JSDOC.JsPlate(templatesDir + 'filelist.tmpl'); + var annotatedTemplate = new JSDOC.JsPlate(templatesDir + 'annotated.tmpl'); + var namespacesTemplate = new JSDOC.JsPlate(templatesDir + + 'namespaces.tmpl'); + } catch(e) { + print('Couldn\'t create the required templates: ' + e); + quit(); + } + + // some ustility filters + function hasNoParent($) {return ($.memberOf == '')} + function isaFile($) {return ($.is('FILE'))} + function isaClass($) {return ($.is('CONSTRUCTOR') || $.isNamespace)} + + // get an array version of the symbolset, useful for filtering + var symbols = symbolSet.toArray(); + + // create the hilited source code files + if (false) { + var files = JSDOC.opt.srcFiles; + for (var i = 0, l = files.length; i < l; i++) { + var file = files[i]; + makeSrcFile(file, publish.conf.srcDir); + } + } + + // get a list of all the classes in the symbolset + var classes = symbols.filter(isaClass).sort(makeSortby('alias')); + + // create each of the class pages + for (var i = 0, l = classes.length; i < l; i++) { + var symbol = classes[i]; + g_unknownTypes = { }; + + symbol.events = symbol.getEvents(); // 1 order matters + symbol.methods = symbol.getMethods(); // 2 + + print('Generating docs for: ' + symbol.alias); + // Comment these lines in to see what data is available to the templates. + //print('----------------------------------------------------------------'); + //dumpObject(symbol, 5); + + // <a href='symbol.source'>symbol.filename</a> + symbol.source = symbol.srcFile; // This is used as a link to the source + symbol.filename = symbol.srcFile; // This is display as the link. + + var output = ''; + output = classTemplate.process(symbol); + + IO.saveFile(publish.conf.outDir, + (publish.conf.prefix + symbol.alias + + '_ref' + publish.conf.ext).toLowerCase(), + output); + IO.saveFile(publish.conf.htmlDir, + (publish.conf.prefix + symbol.alias + + '_ref.html').toLowerCase(), + output); + + var output = ''; + output = membersTemplate.process(symbol); + IO.saveFile(publish.conf.outDir, + (publish.conf.prefix + symbol.alias + + '_members' + publish.conf.ext).toLowerCase(), + output); + IO.saveFile(publish.conf.htmlDir, + (publish.conf.prefix + symbol.alias + + '_members.html').toLowerCase(), + output); + } + + var classTree = classTreeTemplate.process(classes); + IO.saveFile(publish.conf.outDir, 'classtree.html', classTree); + + var fileList = fileListTemplate.process(symbols); + IO.saveFile(publish.conf.outDir, 'filelist.html', fileList); + + var annotated = annotatedTemplate.process(classes); + IO.saveFile(publish.conf.outDir, 'annotated' + publish.conf.ext, annotated); + IO.saveFile(publish.conf.htmlDir, 'annotated.html', annotated); + + var namespaces = namespacesTemplate.process(classes); + IO.saveFile(publish.conf.outDir, 'namespaces' + publish.conf.ext, namespaces); + IO.saveFile(publish.conf.htmlDir, 'namespaces.html', namespaces); +} + + +/** + * Gets just the first sentence (up to a full stop). + * Should not break on dotted variable names. + * @param {string} desc Description to extract summary from. + * @return {string} summary. + */ +function summarize(desc) { + if (typeof desc != 'undefined') + return desc.match(/([\w\W]+?\.)[^a-z0-9_$]/i) ? RegExp.$1 : desc; +} + +/** + * Makes a symbol sorter by some attribute. + * @param {string} attribute to sort by. + * @return {number} sorter result. + */ +function makeSortby(attribute) { + return function(a, b) { + if (a[attribute] != undefined && b[attribute] != undefined) { + a = a[attribute].toLowerCase(); + b = b[attribute].toLowerCase(); + if (a < b) return -1; + if (a > b) return 1; + return 0; + } + } +} + +/** + * Pull in the contents of an external file at the given path. + * @param {string} path Path of file relative to template directory. + * @return {string} contents of file. + */ +function include(path) { + var path = publish.conf.templatesDir + path; + return IO.readFile(path); +} + +/** + * Turns a raw source file into a code-hilited page in the docs. + * @param {string} path Path to source. + * @param {string} srcDir path to place to store hilited page. + * @param {string} opt_name to name output file. + * + */ +function makeSrcFile(path, srcDir, opt_name) { + if (JSDOC.opt.s) return; + + if (!opt_name) { + opt_name = path.replace(/\.\.?[\\\/]/g, '').replace(/[\\\/]/g, '_'); + opt_name = opt_name.replace(/\:/g, '_'); + } + + var src = {path: path, name: opt_name, charset: IO.encoding, hilited: ''}; + + if (defined(JSDOC.PluginManager)) { + JSDOC.PluginManager.run('onPublishSrc', src); + } + + if (src.hilited) { + IO.saveFile(srcDir, opt_name + publish.conf.ext, src.hilited); + } +} + +/** + * Builds output for displaying function parameters. + * @param {Array} params Array of function params. + * @return {string} string in format '(param1, param2)'. + */ +function makeSignature(params) { + if (!params) return '()'; + var signature = '(' + + params.filter( + function($) { + return $.name.indexOf('.') == -1; // don't show config params in signature + } + ).map( + function($) { + return $.name; + } + ).join(', ') + ')'; + return signature; +} + +/** + * Find symbol {@link ...} strings in text and turn into html links. + * @param {string} str String to modify. + * @return {string} modifed string. + */ +function resolveLinks(str) { + str = str.replace(/\{@link ([^} ]+) ?\}/gi, + function(match, symbolName) { + return new Link().toSymbol(symbolName); + } + ); + + return str; +} + +/** + * Make link from symbol. + * @param {Object} symbol Symbol from class database. + * @param {string} opt_extra extra suffix to add before '.html'. + * @return {string} url to symbol. + */ +function getLinkToSymbol(symbol, opt_extra) { + if (symbol.is('CONSTRUCTOR') || symbol.isNamespace) { + return (g_filePrefix + symbol.alias + (opt_extra || '_ref') + + '.html').toLowerCase(); + } else { + var parentSymbol = getSymbol(symbol.memberOf); + return (g_filePrefix + parentSymbol.alias + (opt_extra || '_ref') + + '.html').toLowerCase() + '#' + symbol.name; + } +} + +/** + * Given a class alias, returns a link to its reference page + * @param {string} classAlias Fully qualified name of class. + * @return {string} url to class. + */ +function getLinkToClassByAlias(classAlias) { + var symbol = getSymbol(classAlias); + if (!symbol) { + throw Error('no documentation for "' + classAlias + '"'); + } + return getLinkToSymbol(symbol); +} + +/** + * Given a class alias, returns a link to its member reference page + * @param {string} classAlias Fully qualified name of class. + * @return {string} url to class in members file. + */ +function getLinkToClassMembersByAlias(classAlias) { + var symbol = getSymbol(classAlias); + return getLinkToSymbol(symbol, '_members'); +} + +/** + * Given a class alias like o3djs.namespace.function returns an HTML string + * with a link to each part (o3djs, namespace, function) + * @param {string} classAlias Fully qualified alias of class. + * @param {string} opt_cssClassId css class Id to put in class="" instead links. + * @return {string} html with links to each class and parent. + */ +function getHierarchicalLinksToClassByAlias(classAlias, opt_cssClassId) { + var parts = classAlias.split('.'); + var name = ''; + var html = ''; + var delim = ''; + var classId = ''; + if (opt_cssClassId) { + classId = ' class="' + opt_cssClassId + '"'; + } + for (var pp = 0; pp < parts.length; ++pp) { + var part = parts[pp]; + name = name + delim + part; + link = getLinkToClassByAlias(name); + html = html + delim + '<a' + classId + + ' href="' + link + '">' + part + '</a>'; + delim = '.'; + } + return html; +} + +/** + * Dumps a javascript object. + * + * @param {Object} obj Object to dump. + * @param {number} depth Depth to dump (0 = forever). + * @param {string} opt_prefix Prefix to put before each line. + */ +function dumpObject(obj, depth, opt_prefix) { + opt_prefix = opt_prefix || ''; + --depth; + for (var prop in obj) { + if (typeof obj[prop] != 'function') { + dumpWithPrefix(prop + ' : ' + obj[prop], opt_prefix); + if (depth != 0) { + dumpObject(obj[prop], depth, opt_prefix + ' '); + } + } + } +} + +/** + * Dumps a string, putting a prefix before each line + * @param {string} str String to dump. + * @param {string} prefix Prefix to put before each line. + */ +function dumpWithPrefix(str, prefix) { + var parts = str.split('\n'); + for (var pp = 0; pp < parts.length; ++pp) { + print(prefix + parts[pp]); + } +} + +/** + * gets the type of a property. + * @param {!object} property Property object. + * @return {string} type of property. + */ +function getPropertyType(property) { + if (property.type.length > 0) { + return property.type; + } else { + var tag = property.comment.getTag('type'); + if (tag.length > 0) { + return tag[0].type; + } else { + return 'undefined'; + } + } +} + +/** + * Converts [ to [[] for ezt files. + * Also converts '\n\n' to <br/></br> + * @param {string} str to sanitize. + * @return {string} Sanitized string. + */ +function sanitizeForEZT(str) { + return str.replace(/\[/g, '[[]').replace(/\n\n/g, '<br/><br/>'); +} + +/** + * Check if string starts with another string. + * @param {string} str String to check. + * @param {string} prefix Prefix to check for. + * @return {boolean} True if str starts with prefix. + */ +function startsWith(str, prefix) { + return str.substring(0, prefix.length) === prefix; +} + +/** + * Check if string ends with another string. + * @param {string} str String to check. + * @param {string} suffix Suffix to check for. + * @return {boolean} True if str ends with suffix. + */ +function endsWith(str, suffix) { + return str.substring(str.length - suffix.length) === suffix; +} + +/** + * Converts a camelCase name to underscore as in TypeOfFruit becomes + * type_of_fruit. + * @param {string} str CamelCase string. + * @return {string} underscorified str. + */ +function camelCaseToUnderscore(str) { + function toUnderscore(match) { + return '_' + match.toLowerCase(); + } + return str[0].toLowerCase() + + str.substring(1).replace(/[A-Z]/g, toUnderscore); +} + +/** + * Prints a warning about an unknown type only once. + * @param {string} type Type specification. + */ +function reportUnknownType(type) { + if (!g_unknownTypes[type]) { + g_unknownTypes[type] = true; + print ('WARNING: reference to unknown type: "' + type + '"'); + } +} + +/** + * Gets index of closing character. + * @param {string} str string to search. + * @param {number} startIndex index to start searching at. Must be an opening + * character. + * @return {number} Index of closing character or (-1) if not found. + */ +function getIndexOfClosingCharacter(str, startIndex) { + var openCloseMap = { + '(': ')', + '<': '>', + '[': ']', + '{': '}'}; + var closeMap = { + ')': true, + '>': true, + ']': true, + '}': true, + }; + var stack = []; + if (!openCloseMap[str[startIndex]]) { + throw 'startIndex does not point to opening character.'; + } + var endIndex = str.length; + while (startIndex < endIndex) { + var c = str[startIndex]; + var closing = openCloseMap[c]; + if (closing) { + stack.unshift(closing); + } else { + closing = closeMap[c]; + if (closing) { + var expect = stack.shift() + if (c != expect) { + return -1; + } + if (stack.length == 0) { + return startIndex; + } + } + } + ++startIndex; + } + return -1; +} + +/** + * Converts a reference to a single JSDOC type specification to an html link. + * @param {string} str to linkify. + * @return {string} linkified string. + */ +function linkifySingleType(type) { + var not = ''; + var equals = ''; + // Remove ! if it exists. + if (type[0] == '!') { + not = '!' + type = type.substring(1); + } + if (endsWith(type, '=')) { + equals = '='; + type = type.substring(0, type.length - 1); + } + + var link = type; + + // Check for array wrapper. + if (startsWith(type, 'Array.<')) { + var closingAngle = getIndexOfClosingCharacter(type, 6); + if (closingAngle < 0) { + print ('WARNING: Unmatched "<" in Array type : ' + type); + } else { + link = 'Array.<' + + linkifySingleType(type.substring(7, closingAngle)) + '>'; + } + } else if (startsWith(type, 'function(')) { + var closingParen = getIndexOfClosingCharacter(type, 8); + if (closingParen < 0) { + print ('WARNING: Unmatched "(" in function type : ' + type); + } else { + var end = type.substring(closingParen + 1); + if (!startsWith(end, ': ')) { + print ('WARNING: Malformed return specification on function. Must be' + + ' "function(args): type" including the space after the colon.'); + } else { + var args = type.substring(9, closingParen).split(/ *, */); + var output = ''; + for (var ii = 0; ii < args.length; ++ii) { + if (ii > 0) { + output += ', '; + } + output += linkifyTypeSpec(args[ii]); + } + link = 'function(' + output + '): ' + linkifyTypeSpec(end.substring(2)); + } + } + } else if (type.indexOf(':') >= 0) { // check for records. + var elements = type.split(/\s*,\s*/); + var output = '{'; + for (var ii = 0; ii < elements.length; ++ii) { + if (ii > 0) { + output += ', '; + } + var element = elements[ii]; + var colon = element.indexOf(': '); + if (colon < 0) { + print ("WARNING: Malformed record specification. Format must be " + + "{id1: type1, id2: type2, ...}."); + output += element; + } else { + var name = element.substring(0, colon); + var subType = element.substring(colon + 2); + output += name + ': ' + linkifyTypeSpec(subType) + } + } + link = output + '}'; + } else { + var symbol = getSymbol(type); + if (symbol) { + link = '<a class="el" href="' + getLinkToSymbol(symbol) + '">' + + type + '</a>'; + } else if (startsWith(type, 'o3d.')) { + // TODO: remove this hack, make nixysa generate JSDOC js + // files instead of C++ headers and pass those into + // jsdoctoolkit. + reportUnknownType(type); + link = '<a class="el" href="../classo3d_1_1_' + + camelCaseToUnderscore(type.substring(4)) + '.html">' + + type + '</a>'; + } else { + // See if the symbol is a property or field. + var period = type.lastIndexOf('.'); + if (period >= 0 && type != '...') { + var subType = type.substring(0, period); + symbol = getSymbol(subType); + if (symbol) { + var field = type.substring(period + 1); + link = '<a class="el" href="' + getLinkToSymbol(symbol) + '#' + + field + '">' + type + '</a>'; + } else { + if (subType[0] == '?') { + subType = subType.substring(1); + } + if (!g_validJSDOCTypes[subType]) { + reportUnknownType(type); + } + } + } + } + } + + return not + link + equals; +} + +/** + * Fix function specs. + * The jsdoctoolkit wrongly converts ',' to | as in 'function(a, b)' to + * 'function(a|b)' and '{id1: type1, id2: type2}' to '{id1: type1|id2: type2}' + * so we need to put those back here (or fix jsdoctoolkit, the proper solution). + * @param {string} str JSDOC type specification string . + * @return {string} str with '|' converted back to ', ' unless the specification + * starts with '(' and ends with ')'. That's not a very good check beacuse + * you could 'function((string|number)) and this would fail to do the right + * thing. + * + */ +function fixSpecCommas(str) { + // TODO: This is really a complete hack and we should fix the + // jsdoctoolkit. + if (startsWith(str, '(') && endsWith(str, ')')) { + return str; + } else { + return str.replace(/\|/g, ', '); + } +} + +/** + * Converts a JSDOC type specification into html links. For example + * '(!o3djs.math.Vector3|!O3D.math.Vector4)' would change to + * '(!<a href="??">o3djs.math.Vector3</a> + * |!<a href="??">o3djs.math.Vector4</a>)'. + * @param {string} str to linkify. + * @return {string} linkified string. + */ +function linkifyTypeSpec(str) { + var output = ''; + if (str) { + var fixed = fixSpecCommas(str); + // TODO: needs to split outside of parens and angle brackets. + if (startsWith(fixed, '(') && endsWith(fixed, ')')) { + var types = fixed.substring(1, fixed.length - 1).split('|'); + output += '('; + for (var tt = 0; tt < types.length; ++tt) { + if (tt > 0) { + output += '|'; + } + output += linkifySingleType(types[tt]); + } + output += ')'; + } else { + output += linkifySingleType(fixed); + } + } + return output; +} + +/** + * Gets a symbol for a type. + * This is here mostly for debugging so you can insert a print before or after + * each call to g_symbolSet.getSymbol. + * @param {string} type fully qualified type. + * @return {Symbol} The symbol object for the type or null if not found. + */ +function getSymbol(type) { + return g_symbolSet.getSymbol(type); +} + +/** + * Gets the source path for a symbol starting from 'o3djs/' + * @param {!Symbol} symbol The symbol to get the source name for. + * @return {string} The name of the source file. + */ +function getSourcePath(symbol) { + var path = symbol.srcFile.replace(/\\/g, '/'); + var index = path.indexOf('/o3djs/'); + return path.substring(index + 1); +} diff --git a/o3d/documentation/jsdoc-toolkit-templates/static/footer.html b/o3d/documentation/jsdoc-toolkit-templates/static/footer.html new file mode 100644 index 0000000..031bf6d --- /dev/null +++ b/o3d/documentation/jsdoc-toolkit-templates/static/footer.html @@ -0,0 +1,10 @@ +[## BOILERPLATE - DO NOT EDIT THIS BLOCK ##] +[#] </div><!-- end gc-pagecontent --> +[#] </div><!-- end gooey wrapper --> +[#] +[#] [include "/_common_page_footer.ezt"] +[#] +[#] </body> +[#]</html> +[## END OF BOILERPLATE ##] + diff --git a/o3d/documentation/jsdoc-toolkit-templates/static/header.html b/o3d/documentation/jsdoc-toolkit-templates/static/header.html new file mode 100644 index 0000000..e1b67bc --- /dev/null +++ b/o3d/documentation/jsdoc-toolkit-templates/static/header.html @@ -0,0 +1,28 @@ +[include "/apis/o3d/_local_variables.ezt"] [# the _local_variables.ezt file should be at the root of your document hierarchy ] +[define section]docs[end] [# this should almost always be "docs," if the file lives in the "Docs" section (top nav). Otherwise, it's "home," "articles," "download," or "terms" ] +[define page_title]O3D API[end] [# this is the title for only this page ] + +[## BOILERPLATE - DO NOT EDIT THIS BLOCK - VERSION 1.66 ##] +[#]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> +[#]<html> +[#] <head> +[#] [include "/apis/_common_head_elements.ezt"] +[#] <link href="/css/semantic_headers.css" rel="stylesheet" type="text/css" /> +[#] <link href="../stylesheet.css" rel="stylesheet" type="text/css"> +[#] <link href="../tabs.css" rel="stylesheet" type="text/css"> +[#] </head> +[#] +[#] <body class="gc-documentation"> +[#] +[#] [define content_section]#gc-pagecontent[end] +[#] [define navigation_section]#gc-toc[end] +[#] [include "/_common_page_header.ezt"] +[#] <div class="g-section g-tpl-170"> +[#] +[#] <div class="g-unit g-first" id="gc-toc"> +[#] [include toc_path] +[#] <a class="hidden" href="#gc-topnav-anchor">More [title] resource links</a> +[#] </div> +[#] +[#] <div class="g-unit" id="gc-pagecontent"> +[## END OF BOILERPLATE ##] diff --git a/o3d/documentation/stylesheet.css b/o3d/documentation/stylesheet.css new file mode 100644 index 0000000..be09224 --- /dev/null +++ b/o3d/documentation/stylesheet.css @@ -0,0 +1,233 @@ +/* + * Based off the Doxygen generated template stylesheet and trimmed/edited to + * remove items that would conflict with codesite or other overlying + * stylesheets while maintaining the desired look and feel. + * + * The #doxygen-ref is an id tag which encompasses code generated by doxygen + * and allows override of standard html tags while not affecting the rest + * of the page such as sidebars. + */ + +A.qindex { + text-decoration: none; + font-weight: bold; + color: #1A419D; +} +A.qindex:visited { + text-decoration: none; + font-weight: bold; + color: #1A419D +} +A.qindex:hover { + text-decoration: none; + background-color: #ddf; +} +A.qindexHL { + text-decoration: none; + font-weight: bold; + background-color: #66c; + color: #fff; + border: 1px double #9295C2; +} +A.qindexHL:hover, +A.qindexHL:visited { + text-decoration: none; + background-color: #66c; + color: #fff; +} +A.el { + text-decoration: none; + font-weight: bold; +} +A.elRef { + font-weight: bold; +} +A.code:link, +A.code:visited { + text-decoration: none; + font-weight: normal; + color: #00F; +} +A.codeRef:link, +A.codeRef:visited { + font-weight: normal; + color: #00F; +} +A:hover { + text-decoration: none; + background-color: #f2f2ff; +} +DL.el { + margin-left: -1cm; +} +.fragment { + font-family: Fixed, monospace; + font-size: 95%; +} +PRE.fragment { + border: 1px solid #CCC; + background-color: #f5f5f5; + margin: 4px 8px 4px 2px + padding: 4px 6px; +} +DIV.ah { + background-color: black; + font-weight: bold; + color: #fff; + margin-bottom: 3px; + margin-top: 3px +} +TD.md { + background-color: #e1e1e4; + font-weight: bold; + border: none; +} +TD.mdPrefix { + background-color: #e1e1e4; + color: #606060; + font-size: 80%; + border: none; +} +TD.mdname1 { + background-color: #e1e1e4; + font-weight: bold; + color: #602020; + border: none; +} +.memitem { + padding: 4px; + background-color: #ffff; +} +.memname { + background-color: #e1e1e4; + white-space: nowrap; + font-weight: bold; +} +.memdoc{ + padding-left: 10px; +} +#doxygen-ref div.memproto td { + background-color: #e1e1e4; +} +.memproto { + background-color: #e1e1e4; + width: 100%; + border-width: 1px; + border-style: solid; + border-color: #e1e1f4; + font-weight: bold; + -moz-border-radius: 8px 8px 8px 8px; +} +.paramkey { + text-align: right; +} +.paramtype { + white-space: nowrap; +} +.paramname { + color: #602020; + font-style: italic; + white-space: nowrap; +} +DIV.groupHeader { + margin: 12px 16px 6px auto; + font-weight: bold; +} +DIV.groupText { + margin-left: 16px; + font-style: italic; + font-size: 90%; +} +TR.memlist { + background-color: #f0f0f0; +} +P.formulaDsp { + text-align: center; +} +IMG.formulaInl { + vertical-align: middle; +} +SPAN.keyword, +SPAN.keywordflow { + color: #008000; +} +SPAN.keywordtyp { + color: #604020; +} +SPAN.comment { + color: #800000; +} +SPAN.preprocessor { + color: #806020; +} +SPAN.stringliteral { + color: #002080; +} +SPAN.charliteral { + color: #008080; +} +.mdTable { + background-color: #e1e1e4; + border: none; + padding: 0; +} +.mdRow { + padding: 8px 10px; + border: none; +} +.mdescLeft, +.mdescRight { + padding: 0 8px 4px 8px; + font-size: 80%; + font-style: italic; + background-color: #FAFAFA; + border: 1px none #E0E0E0; + margin: 0; +} +.search { + color: #039; + font-weight: bold; +} +FORM.search { + margin: 0 auto; +} +INPUT.search { + font-size: 75%; + color: #000080; + font-weight: normal; + background-color: #e8eef2; +} +TD.tiny{ + font-size: 75%; +} +#doxygen-ref HR { + height: 1px; + border: none; + border-top: 1px solid black; +} +#doxygen-ref table, +#doxygen-ref td, +#doxygen-ref tr { + border:none; +} +#doxygen-ref .contents H1 { + text-align: center; + background-color: #ffffff; + border: 0; +} +#doxygen-ref H2 { + margin-left: 0; + margin-bottom: 5px; +} +#doxygen-ref CAPTION { + font-weight: bold; +} +.memdoc { + padding-left: 30px; +} +.memitem { + border-top:1px solid #E5ECF9; +} +.doxygen-global { + background-color: #ffcc66; +}
\ No newline at end of file |