home *** CD-ROM | disk | FTP | other *** search
-
- /*
- * This file was generated by the SOM Compiler.
- * Generated using:
- * SOM incremental update: 10.9
- */
-
-
- #ifndef lint
- static char *sccsid = "%Z% %I% %W% %G% %U% [%H% %T%] (c)IBM Corp. 1992";
- #endif
-
- /*
- * This class is adapted from the book
- * Class Construction in C and C++, Object Oriented Fundamentals
- * by Roger Sessions, Copyright (c) 1992 Prentice Hall.
- * Reprinted with permission.
- */
- #include "msgid.h"
- #include "nlsutil.h"
-
- #define envProcessor_Class_Source
- #if defined(_WIN32)
- #include "statcls.h"
- #endif
-
- #include <stdlib.h>
-
- #include "helper.h"
- #include "tpword.h"
- #include "page.h"
-
- #include "txtep.h"
- #include "header.h"
- #include "footer.h"
- #include "ipep.h"
- #include "blep.h"
-
- #include "ep.ih"
-
- /* ************************************************************ */
- /*
- * Used to initialize a new environment from an
- * existing environment.
- */
-
- SOM_Scope void SOMLINK epInit1(envProcessor * somSelf,
- envProcessor * lastEnv)
- {
- envProcessorData *somThis = envProcessorGetData(somSelf);
- envProcessorMethodDebug("envProcessor", "epInit1");
-
- _previousEnv = lastEnv;
- _thisFile = _epGetFileMgr(_previousEnv);
- _thisPage = _epGetPage(_previousEnv);
-
- }
-
- /* ************************************************************ */
- /*
- * Defines what it means to process a given
- * environment. This method MUST be overridden in
- * derived classes.
- */
-
- SOM_Scope void SOMLINK epProcessEnvironment(envProcessor * somSelf)
- {
- envProcessorData *somThis = envProcessorGetData(somSelf);
- envProcessorMethodDebug("envProcessor", "epProcessEnvironment");
- shouldHaveOverridden(somSelf, "epProcessEnvironment");
- }
-
- /* ************************************************************ */
- /*
- * Defines what steps need to be taken at the start
- * of this environment.
- */
-
- SOM_Scope void SOMLINK epStartUpNewEnvironment(envProcessor * somSelf,
- TPWord * envName)
- {
- envProcessorData *somThis = envProcessorGetData(somSelf);
- envProcessor *nextEnv;
- envProcessorMethodDebug("envProcessor", "epStartUpNewEnvironment");
-
- if (_match(envName, "[[standard_text]]")) {
- nextEnv = txtEnvProcessorNew();
- _epInit1(nextEnv, somSelf);
- }
- else if (_match(envName, "[[header]]")) {
- nextEnv = headerNew();
- _epInit1(nextEnv, somSelf);
- }
- else if (_match(envName, "[[footer]]")) {
- nextEnv = footerNew();
- _epInit1(nextEnv, somSelf);
- }
- else if (_match(envName, "[[standard_text]]")) {
- nextEnv = txtEnvProcessorNew();
- _epInit1(nextEnv, somSelf);
- }
- else if (_match(envName, "[[indent_paragraphs]]")) {
- nextEnv = indentedParagraphsNew();
- _epInit1(nextEnv, somSelf);
- }
- else if (_match(envName, "[[bulleted_list]]")) {
- nextEnv = bulletedListNew();
- _epInit1(nextEnv, somSelf);
- }
- else {
- printf(NlsMsgGet(UnknownEnvironmentId));
- _print(envName, stdout);
- exit(2);
- }
-
- _epPrepareForNewEnvironment(somSelf);
- _epProcessEnvironment(nextEnv);
- _somFree(nextEnv);
- }
-
- /* ************************************************************ */
- /*
- * Defines what steps need to be taken to initialize
- * a given environment.
- */
-
- SOM_Scope void SOMLINK epInitializeEnvironment(envProcessor * somSelf)
- {
- envProcessorData *somThis = envProcessorGetData(somSelf);
- envProcessorMethodDebug("envProcessor", "epInitializeEnvironment");
- }
-
- /* ************************************************************ */
- /*
- * Defines what steps need to be taken to shutdown this
- * environment.
- */
-
- SOM_Scope void SOMLINK epShutdownEnvironment(envProcessor * somSelf)
- {
- envProcessorData *somThis = envProcessorGetData(somSelf);
- envProcessorMethodDebug("envProcessor", "epShutdownEnvironment");
- }
-
- /* ************************************************************ */
- /*
- * Defines what steps this environment should take as it
- * prepares to transfer control to a new environment.
- */
-
- SOM_Scope void SOMLINK epPrepareForNewEnvironment(envProcessor * somSelf)
- {
- envProcessorData *somThis = envProcessorGetData(somSelf);
- envProcessorMethodDebug("envProcessor", "epPrepareForNewEnvironment");
- }
-
- /* ************************************************************ */
- /*
- * Get the indentation for a new paragraph for this environment.
- */
-
- SOM_Scope long SOMLINK epGetParagraphIndentation(envProcessor *somSelf)
- {
- envProcessorData *somThis = envProcessorGetData(somSelf);
- envProcessorMethodDebug("envProcessor", "epGetParagraphIndentation");
- return (0);
- }
-
- /* ************************************************************ */
- /*
- * Get the indentation for a new line for this environment.
- */
-
- SOM_Scope long SOMLINK epGetLineIndentation(envProcessor *somSelf)
- {
- envProcessorData *somThis = envProcessorGetData(somSelf);
- envProcessorMethodDebug("envProcessor", "epGetLineIndentation");
- return (0);
- }
-
- /* ************************************************************ */
- SOM_Scope page *SOMLINK epGetPage(envProcessor * somSelf)
- {
- envProcessorData *somThis = envProcessorGetData(somSelf);
- envProcessorMethodDebug("envProcessor", "epGetPage");
- return _thisPage;
- }
-
- /* ************************************************************ */
- SOM_Scope fileMgr *SOMLINK epGetFileMgr(envProcessor * somSelf)
- {
- envProcessorData *somThis = envProcessorGetData(somSelf);
- envProcessorMethodDebug("envProcessor", "epGetFileMgr");
- return _thisFile;
- }
-
- /* ************************************************************ */
- SOM_Scope envProcessor *SOMLINK epGetPreviousEnv(envProcessor * somSelf)
- {
- envProcessorData *somThis = envProcessorGetData(somSelf);
- envProcessorMethodDebug("envProcessor", "epGetPreviousEnv");
- return _previousEnv;
- }
-
- /* ************************************************************ */
- SOM_Scope string SOMLINK epGetClassName(envProcessor *somSelf)
- {
- envProcessorData *somThis = envProcessorGetData(somSelf);
- static char *myClass = "envProcessor";
- envProcessorMethodDebug("envProcessor", "epGetClassName");
- return myClass;
- }
-
- /* ************************************************************ */
- SOM_Scope void SOMLINK epSetPage(envProcessor * somSelf,
- page * newPage)
- {
- envProcessorData *somThis = envProcessorGetData(somSelf);
- envProcessorMethodDebug("envProcessor", "epSetPage");
- _thisPage = newPage;
- }
-
- /* ************************************************************ */
- SOM_Scope void SOMLINK epSetFileMgr(envProcessor * somSelf,
- fileMgr * newFileMgr)
- {
- envProcessorData *somThis = envProcessorGetData(somSelf);
- envProcessorMethodDebug("envProcessor", "epSetFileMgr");
- _thisFile = newFileMgr;
- }
-
- /* ************************************************************ */
- SOM_Scope void SOMLINK somInit(envProcessor * somSelf)
- {
- envProcessorData *somThis = envProcessorGetData(somSelf);
- envProcessorMethodDebug("envProcessor", "somInit");
-
- parent_somInit(somSelf);
- _previousEnv = 0;
- _thisFile = 0;
- _thisPage = 0;
- }
-
- /* ************************************************************ */
- SOM_Scope void SOMLINK somUninit(envProcessor * somSelf)
- {
- envProcessorData *somThis = envProcessorGetData(somSelf);
- envProcessorMethodDebug("envProcessor", "somUninit");
-
- if (!_previousEnv) {
- _somFree(_thisFile);
- _somFree(_thisPage);
- printf("\n"); /* Last line feed for document. */
- }
- parent_somUninit(somSelf);
- }
-
- /* ************************************************************ */
-
- /*
- * SOM_Scope void SOMLINK somDumpSelfInt(envProcessor * somSelf,
- * int level)
- */
-
- /*
- * The prototype for somDumpSelfInt was replaced by the following prototype:
- */
- SOM_Scope void SOMLINK somDumpSelfInt(envProcessor *somSelf,
- long level)
- {
- envProcessorData *somThis = envProcessorGetData(somSelf);
- envProcessorMethodDebug("envProcessor", "somDumpSelfInt");
-
- parent_somDumpSelfInt(somSelf, level);
- }
-