TempleOSCDV4.03.ISO
This commit is contained in:
1 parent
1541d7328d
commit
0f1a4a5d65
115 files changed
+5618
-4863
No files matched your search
+36
-19
@@ -29,22 +29,33 @@ public Bool DocUnlock(CDoc *doc)
|
||||
|
||||
Bool IsEditableText(CDocEntry *doc_e)
|
||||
{
|
||||
if (doc_e->type_u8==DOCT_TEXT&&!(doc_e->de_flags&DOCEG1_DONT_EDIT))
|
||||
if (doc_e->type_u8==DOCT_TEXT&&!(doc_e->de_flags&DOCEG_DONT_EDIT))
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
CDocEntry *DocEntryNew(CDoc *doc,CDocEntry *doc_ce,U8 *tag)
|
||||
{
|
||||
CDocEntry *DocEntryNewBase(CDoc *doc,I64 type,I64 de_flags=0,
|
||||
I64 x=0,I64 y=0,I64 page_line_num=0)
|
||||
{//See also $LK,"MAllocIdentical",A="FF:::/Adam/DolDoc/DocRecalc.CPP,MAllocIdentical"$ and $MA-X+PU,"CDocEntry",LM="F(\"sizeof(CDocEntry)\");View;"$.
|
||||
CDocEntry *result=CAlloc(sizeof(CDocEntryBase),doc->mem_task);
|
||||
result->type=doc_ce->type;
|
||||
result->de_flags=doc_ce->de_flags;
|
||||
result->tag=tag;
|
||||
result->max_col=StrLen(tag);
|
||||
result->x=doc_ce->x;
|
||||
result->y=doc_ce->y;
|
||||
result->page_line_num=doc_ce->page_line_num;
|
||||
result->type=type;
|
||||
result->de_flags=de_flags|doldoc.dft_de_flags[type.u8[0]];
|
||||
result->x=x;
|
||||
result->y=y;
|
||||
result->page_line_num=page_line_num;
|
||||
return result;
|
||||
}
|
||||
|
||||
CDocEntry *DocEntryNewTag(CDoc *doc,CDocEntry *doc_ce,U8 *tag)
|
||||
{
|
||||
I64 l=StrLen(tag);
|
||||
CDocEntry *result=DocEntryNewBase(doc,doc_ce->type,doc_ce->de_flags,
|
||||
doc_ce->x,doc_ce->y,doc_ce->page_line_num);
|
||||
result->de_flags=doc_ce->de_flags; //Override
|
||||
result->max_col=l;
|
||||
result->tag=MAlloc(l+1,doc->mem_task);
|
||||
MemCpy(result->tag,tag,l+1);
|
||||
MemCpy(&result->settings,&doc_ce->settings,sizeof(CDocSettings));
|
||||
return result;
|
||||
}
|
||||
@@ -59,20 +70,22 @@ public U0 DocEntryDel(CDoc *doc,CDocEntry *doc_e)
|
||||
QueRem(doc_e);
|
||||
if (doc_e->de_flags & DOCEF_TAG)
|
||||
Free(doc_e->tag);
|
||||
if (doc_e->de_flags & DOCEF_LEFT_MACRO)
|
||||
Free(doc_e->left_macro);
|
||||
if (doc_e->de_flags & DOCEF_RIGHT_MACRO)
|
||||
Free(doc_e->right_macro);
|
||||
if (doc_e->de_flags & DOCEF_AUX_STR)
|
||||
Free(doc_e->aux_str);
|
||||
if (doc_e->de_flags & DOCEF_DEFINE)
|
||||
Free(doc_e->define_str);
|
||||
if (doc_e->de_flags & DOCEF_HTML_LINK)
|
||||
Free(doc_e->html_link);
|
||||
if (doc_e->de_flags & DOCEF_LEFT_MACRO)
|
||||
Free(doc_e->left_macro);
|
||||
if (doc_e->de_flags & DOCEF_RIGHT_MACRO)
|
||||
Free(doc_e->right_macro);
|
||||
if (doc_e->de_flags & DOCEF_BIN_PTR_LINK)
|
||||
Free(doc_e->bin_ptr_link);
|
||||
if (doc_e->de_flags & DOCEF_HAS_BIN)
|
||||
DocBinDel(doc,doc_e->bin_data);
|
||||
if (doc_e->de_flags & DOCEF_REMALLOC_DATA)
|
||||
Free(doc_e->data);
|
||||
Free(doc_e);
|
||||
}
|
||||
}
|
||||
@@ -90,12 +103,14 @@ public I64 DocEntrySize(CDoc *,CDocEntry *doc_e)
|
||||
result+=MSize2(doc_e->define_str);
|
||||
if (doc_e->de_flags & DOCEF_HTML_LINK)
|
||||
result+=MSize2(doc_e->html_link);
|
||||
if (doc_e->de_flags & DOCEF_BIN_PTR_LINK)
|
||||
result+=MSize2(doc_e->bin_ptr_link);
|
||||
if (doc_e->de_flags & DOCEF_LEFT_MACRO)
|
||||
result+=MSize2(doc_e->left_macro);
|
||||
if (doc_e->de_flags & DOCEF_RIGHT_MACRO)
|
||||
result+=MSize2(doc_e->right_macro);
|
||||
if (doc_e->de_flags & DOCEF_BIN_PTR_LINK)
|
||||
result+=MSize2(doc_e->bin_ptr_link);
|
||||
if (doc_e->de_flags & DOCEF_REMALLOC_DATA)
|
||||
result+=MSize2(doc_e->data);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -134,12 +149,12 @@ public CDocEntry *DocEntryCopy(CDoc *doc,CDocEntry *doc_e)
|
||||
doc_ne->define_str=MAllocIdentical(doc_e->define_str,task);
|
||||
if (doc_e->de_flags & DOCEF_HTML_LINK)
|
||||
doc_ne->html_link=MAllocIdentical(doc_e->html_link,task);
|
||||
if (doc_e->de_flags & DOCEF_BIN_PTR_LINK)
|
||||
doc_ne->bin_ptr_link=MAllocIdentical(doc_e->bin_ptr_link,task);
|
||||
if (doc_e->de_flags & DOCEF_LEFT_MACRO)
|
||||
doc_ne->left_macro=MAllocIdentical(doc_e->left_macro,task);
|
||||
if (doc_e->de_flags & DOCEF_RIGHT_MACRO)
|
||||
doc_ne->right_macro=MAllocIdentical(doc_e->right_macro,task);
|
||||
if (doc_e->de_flags & DOCEF_BIN_PTR_LINK)
|
||||
doc_ne->bin_ptr_link=MAllocIdentical(doc_e->bin_ptr_link,task);
|
||||
if (doc_e->de_flags & DOCEF_HAS_BIN) {
|
||||
tempb=MAllocIdentical(doc_e->bin_data,task);
|
||||
tempb->data=MAllocIdentical(doc_e->bin_data->data,task);
|
||||
@@ -152,6 +167,8 @@ public CDocEntry *DocEntryCopy(CDoc *doc,CDocEntry *doc_e)
|
||||
tempb->tag=NULL;
|
||||
QueIns(tempb,doc->bin_root.last);
|
||||
}
|
||||
if (doc_e->de_flags & DOCEF_REMALLOC_DATA)
|
||||
doc_ne->data=MAllocIdentical(doc_e->data,task);
|
||||
return doc_ne;
|
||||
}
|
||||
|
||||
@@ -195,7 +212,7 @@ public U0 DocInsEntry(CDoc *doc,CDocEntry *doc_e)
|
||||
DOCEF_HTML_LINK|DOCEF_BIN_PTR_LINK)) &&
|
||||
doc->cur_col<doc_ce->max_col) {
|
||||
dst=doc_ce->tag+doc->cur_col;
|
||||
doc_ne=DocEntryNew(doc,doc_ce,StrNew(dst,doc->mem_task));
|
||||
doc_ne=DocEntryNewTag(doc,doc_ce,dst);
|
||||
*dst=0;
|
||||
doc_ne->type=DOCT_TEXT|doc_ce->type&0xFFFFFF00;
|
||||
doc_ce->max_col=doc->cur_col;
|
||||
|
||||
Reference in new issue
Block a user