version 1.66, 2008/03/20 13:51:22
|
version 1.67, 2008/03/26 10:34:05
|
Line 325 void CreateTemplate(Document doc, char *
|
Line 325 void CreateTemplate(Document doc, char *
|
t = LookForXTigerTemplate(templatePath); |
t = LookForXTigerTemplate(templatePath); |
t->doc = doc; |
t->doc = doc; |
Template_PrepareTemplate(t); |
Template_PrepareTemplate(t); |
DocumentMeta[doc]->isTemplate = TRUE; |
// DocumentTypes[doc] = docTemplate; |
// DocumentTypes[doc] = docTemplate; |
t->state |= templloaded|templTemplate; |
t->isLoaded = TRUE; |
|
|
|
#ifdef AMAYA_DEBUG |
#ifdef AMAYA_DEBUG |
DumpAllDeclarations(); |
DumpAllDeclarations(); |
Line 457 void InstantiateTemplate_callback (int n
|
Line 456 void InstantiateTemplate_callback (int n
|
#endif /* TEMPLATES */ |
#endif /* TEMPLATES */ |
} |
} |
|
|
/*---------------------------------------------------------------------- |
///*---------------------------------------------------------------------- |
----------------------------------------------------------------------*/ |
// ----------------------------------------------------------------------*/ |
void InstantiateTemplate (Document doc, char *templatename, char *docname, |
//void InstantiateTemplate (Document doc, char *templatename, char *docname, |
DocumentType docType, ThotBool loaded) |
// DocumentType docType, ThotBool loaded) |
{ |
//{ |
#ifdef TEMPLATES |
//#ifdef TEMPLATES |
if (!loaded) |
// if (!loaded) |
{ |
// { |
// Create the callback context |
// // Create the callback context |
InstantiateCtxt *ctx = (InstantiateCtxt *)TtaGetMemory (sizeof (InstantiateCtxt)); |
// InstantiateCtxt *ctx = (InstantiateCtxt *)TtaGetMemory (sizeof (InstantiateCtxt)); |
ctx->templatePath = TtaStrdup (templatename); |
// ctx->templatePath = TtaStrdup (templatename); |
ctx->instancePath = TtaStrdup (docname); |
// ctx->instancePath = TtaStrdup (docname); |
ctx->schemaName = GetSchemaFromDocType(docType); |
// ctx->schemaName = GetSchemaFromDocType(docType); |
ctx->doc = doc; |
// ctx->doc = doc; |
ctx->docType = docType; |
// ctx->docType = docType; |
|
// |
GetAmayaDoc (templatename, NULL, doc, doc, CE_MAKEBOOK, FALSE, |
// GetAmayaDoc (templatename, NULL, doc, doc, CE_MAKEBOOK, FALSE, |
(void (*)(int, int, char*, char*, char*, |
// (void (*)(int, int, char*, char*, char*, |
const AHTHeaders*, void*)) InstantiateTemplate_callback, |
// const AHTHeaders*, void*)) InstantiateTemplate_callback, |
(void *) ctx); |
// (void *) ctx); |
} |
// } |
else |
// else |
{ |
// { |
DoInstanceTemplate (templatename); |
// DoInstanceTemplate (templatename); |
CreateInstance (templatename, docname, doc); |
// CreateInstance (templatename, docname, doc); |
} |
// } |
#endif /* TEMPLATES */ |
//#endif /* TEMPLATES */ |
} |
//} |
|
|
/*---------------------------------------------------------------------- |
/*---------------------------------------------------------------------- |
InstantiateAttribute |
InstantiateAttribute |
Line 791 void Template_FixAccessRight (XTigerTemp
|
Line 790 void Template_FixAccessRight (XTigerTemp
|
char currentType[MAX_LENGTH]; |
char currentType[MAX_LENGTH]; |
Declaration decl; |
Declaration decl; |
|
|
// DumpElementPath(el); |
|
|
|
if (t && el && doc) |
if (t && el && doc) |
{ |
{ |
elType = TtaGetElementType(el); |
elType = TtaGetElementType(el); |
Line 1145 static void ParseTemplate (XTigerTemplat
|
Line 1142 static void ParseTemplate (XTigerTemplat
|
/* if this use element is not empty, don't do anything: it is |
/* if this use element is not empty, don't do anything: it is |
supposed to contain a valid instance. This should be |
supposed to contain a valid instance. This should be |
checked, though */ |
checked, though */ |
if (DocumentMeta[doc] && DocumentMeta[doc]->isTemplate) |
if (IsTemplateDocument(doc) && ! IsTemplateInstanceDocument(doc)) |
// add the initial indicator |
// add the initial indicator |
AddPromptIndicator (el, doc); |
AddPromptIndicator (el, doc); |
|
|