Nightly update (ISO SHA-1 f3615ad)
This commit is contained in:
1 parent
b97fa7c00e
commit
aa53888517
20 files changed
+366
-235
No files matched your search
@@ -858,19 +858,36 @@ public I64 GrPutChar(CDC *dc=gr.dc,I64 x,I64 y,U8 ch)
|
||||
|
||||
I64 GrPutS(CDC *dc=gr.dc,I64 x,I64 y,U8 *_s)
|
||||
{//Use $LK,"GrPrint",A="MN:GrPrint"$()
|
||||
I64 x0,ch,res;
|
||||
I64 x0,sx=0,sy=0,res;
|
||||
if (!_s) return 0;
|
||||
x0=x;
|
||||
res=0;
|
||||
while (ch=*_s++) {
|
||||
if (ch=='\n') {
|
||||
while (*_s) {
|
||||
if (*_s=='\n') {
|
||||
x=x0;
|
||||
y+=FONT_HEIGHT;
|
||||
} else if (ch=='\t')
|
||||
_s++;
|
||||
} else if (*_s=='\t') {
|
||||
x=x0+CeilU64(x-x0+FONT_WIDTH,8*FONT_WIDTH);
|
||||
else {
|
||||
res+=GrPutChar(dc,x,y,ch);
|
||||
_s++;
|
||||
} else if (*_s(U32 *)=='$$SY,') {
|
||||
if (_s[4]=='-') {
|
||||
_s++;
|
||||
sy='0'-_s[4];
|
||||
} else
|
||||
sy=_s[4]-'0';
|
||||
_s+=6;
|
||||
} else if (*_s(U32 *)=='$$SX,') {
|
||||
if (_s[4]=='-') {
|
||||
_s++;
|
||||
sx='0'-_s[4];
|
||||
} else
|
||||
sx=_s[4]-'0';
|
||||
_s+=6;
|
||||
} else {
|
||||
res+=GrPutChar(dc,x+sx,y+sy,*_s);
|
||||
x+=FONT_WIDTH;
|
||||
_s++;
|
||||
}
|
||||
}
|
||||
return res;
|
||||
@@ -878,20 +895,36 @@ I64 GrPutS(CDC *dc=gr.dc,I64 x,I64 y,U8 *_s)
|
||||
|
||||
I64 GrVPutS(CDC *dc=gr.dc,I64 x,I64 y,U8 *_s)
|
||||
{//Vertical Text. Use $LK,"GrVPrint",A="MN:GrVPrint"$()
|
||||
I64 y0,res;
|
||||
I64 y0,sx=0,sy=0,res;
|
||||
U8 buf[2];
|
||||
if (!_s) return 0;
|
||||
y0=y;
|
||||
res=0;
|
||||
|
||||
buf[1]=0;
|
||||
while (*buf=*_s++) {
|
||||
if (*buf=='\n') {
|
||||
while (*_s) {
|
||||
if (*_s=='\n') {
|
||||
y=y0;
|
||||
x+=FONT_WIDTH;
|
||||
} else if (*buf=='\t')
|
||||
_s++;
|
||||
} else if (*_s=='\t') {
|
||||
y=y0+CeilU64(y-y0+FONT_HEIGHT,8*FONT_HEIGHT);
|
||||
else {
|
||||
_s++;
|
||||
} else if (*_s(U32 *)=='$$SY,') {
|
||||
if (_s[4]=='-') {
|
||||
_s++;
|
||||
sx='0'-_s[4];
|
||||
} else
|
||||
sx=_s[4]-'0';
|
||||
_s+=6;
|
||||
} else if (*_s(U32 *)=='$$SX,') {
|
||||
if (_s[4]=='-') {
|
||||
_s++;
|
||||
sy='0'-_s[4];
|
||||
} else
|
||||
sy=_s[4]-'0';
|
||||
_s+=6;
|
||||
} else {
|
||||
*buf=*_s++;
|
||||
res+=GrPutS(dc,x,y,buf);
|
||||
y+=FONT_HEIGHT;
|
||||
}
|
||||
|
||||
@@ -3,3 +3,6 @@ extern U8 *GrBitMap4ToBitMap8(U8 *dst,U8 *src,I64 src_size,I64 bkcolor);
|
||||
extern I64 GrBlot3(CDC *dc,I64 x1,I64 y1,I64 z1,CDC *img);
|
||||
extern I64 *Mat4x4New(I64 *src,CTask *mem_task=NULL);
|
||||
extern U8 *SpriteQue2Sprite(CSprite *head,I64 *_size=NULL);
|
||||
extern CSprite *SpriteSetSettings(CDC *dc=NULL,CSprite *head,I64 elem_num,
|
||||
I64 x=0,I64 y=0,CColorROPU32 *_color=NULL,I64 *_width=NULL,
|
||||
I64 *_xx=NULL,I64 *_yy=NULL);
|
||||
@@ -23,6 +23,7 @@ Cd(__DIR__);;
|
||||
#include "SpriteMesh"
|
||||
#include "SpriteBitMap"
|
||||
#include "SpriteCode"
|
||||
#include "SpriteSideBar"
|
||||
#include "SpriteEd"
|
||||
#include "SpriteMain"
|
||||
|
||||
|
||||
@@ -575,105 +575,6 @@ I64 SpriteQueSelAll(CSprite *head,Bool val=TRUE)
|
||||
return res;
|
||||
}
|
||||
|
||||
CSprite *SpriteSideBar2SpriteQue(CDoc *doc,CSprite *head,I64 *_cur_elem_num)
|
||||
{//For the side-bar
|
||||
CSprite *res=CAlloc(sizeof(CSprite)),*tmpg;
|
||||
CDocEntry *doc_e=doc->head.next;
|
||||
Bool found=FALSE;
|
||||
I64 num=0;
|
||||
QueInit(res);
|
||||
while (doc_e!=doc) {
|
||||
if (doc_e->type_u8==DOCT_MENU_VAL && doc_e->left_exp>=0) {
|
||||
tmpg=SpriteSetSettings(,head,doc_e->left_exp);
|
||||
if (tmpg!=head) {
|
||||
tmpg=MAllocIdent(tmpg);
|
||||
BEqu(&tmpg->type,SPf_SEL,Bt(&doc_e->type,DOCEt_SEL));
|
||||
if (*_cur_elem_num==doc_e->left_exp) {
|
||||
*_cur_elem_num=num;
|
||||
found=TRUE;
|
||||
}
|
||||
QueIns(tmpg,res->last);
|
||||
num++;
|
||||
}
|
||||
}
|
||||
doc_e=doc_e->next;
|
||||
}
|
||||
if (!found)
|
||||
*_cur_elem_num=num;
|
||||
QueDel(head);
|
||||
Free(head);
|
||||
return res;
|
||||
}
|
||||
|
||||
U0 SpriteSideBarPickNew(CDoc *doc,CSprite *head,I64 old_num)
|
||||
{
|
||||
CSprite *tmpg;
|
||||
CDocEntry *doc_cur_e=NULL,*doc_e;
|
||||
I64 cur_elem_num=0;
|
||||
U8 *st;
|
||||
DocPrint(doc,"$$PURPLE$$$$TX+CX,\"Sprite SideBar\"$$\n"
|
||||
"$$LK+PU+CX,\"Click for Help\","
|
||||
"A=\"FI:::/Doc/SpriteSideBar.DD.Z\"$$\n\n");
|
||||
tmpg=head->next;
|
||||
while (tmpg!=head) {
|
||||
st=SpriteElem2Summary(tmpg);
|
||||
if (cur_elem_num==old_num) {
|
||||
DocPrint(doc,"$$LTRED$$");
|
||||
doc_e=doc_cur_e=DocPrint(doc,"$$MU-UL,\"%Q\",LE=%d$$\n",st,cur_elem_num++);
|
||||
} else {
|
||||
DocPrint(doc,"$$LTBLUE$$");
|
||||
doc_e=DocPrint(doc,"$$MU-UL,\"%$$Q\",LE=%d$$\n",st,cur_elem_num++);
|
||||
}
|
||||
BEqu(&doc_e->de_flags,DOCEf_SEL,Bt(&tmpg->type,&SPf_SEL));
|
||||
BEqu(&doc_e->type,DOCEt_SEL,Bt(&tmpg->type,SPf_SEL));
|
||||
Free(st);
|
||||
tmpg=tmpg->next;
|
||||
}
|
||||
if (cur_elem_num==old_num) {
|
||||
DocPrint(doc,"$$LTRED$$");
|
||||
doc_cur_e=DocPrint(doc,"$$MU-UL,\"END\",LE=%d$$\n",cur_elem_num);
|
||||
} else {
|
||||
DocPrint(doc,"$$LTBLUE$$");
|
||||
DocPrint(doc,"$$MU-UL,\"END\",LE=%d$$\n",cur_elem_num);
|
||||
}
|
||||
if (doc_cur_e)
|
||||
doc->cur_entry=doc_cur_e;
|
||||
}
|
||||
|
||||
U0 SpriteSideBarTask2(CTask *grand_parent)
|
||||
{
|
||||
I64 w,h;
|
||||
CTask *parent=Fs->parent_task,*pu_task;
|
||||
while (TRUE) {
|
||||
pu_task=grand_parent->popup_task;
|
||||
if (TaskValidate(pu_task)) {
|
||||
w=parent->win_right-parent->win_left;
|
||||
WinHorz(pu_task->win_right+2,pu_task->win_right+2+w,parent);
|
||||
h=parent->win_bottom-parent->win_top;
|
||||
WinVert(pu_task->win_top,pu_task->win_top+h,parent);
|
||||
}
|
||||
Refresh;
|
||||
}
|
||||
}
|
||||
|
||||
U0 SpriteSideBarTask(CTask *parent,CSprite **_head,I64 *_cur_elem_num)
|
||||
{
|
||||
CDocEntry *doc_e;
|
||||
CDoc *doc=DocPut;
|
||||
Spawn(&SpriteSideBarTask2,parent,"CSpriteTask",,Fs);
|
||||
doc->flags|=DOCF_SIZE_MIN|DOCF_FORM;
|
||||
while (TRUE) {
|
||||
SpriteSideBarPickNew(doc,*_head,*_cur_elem_num);
|
||||
DocHighlightCursor(,doc);
|
||||
View;
|
||||
doc_e=doc->cur_entry;
|
||||
if (doc_e->type_u8==DOCT_MENU_VAL)
|
||||
*_cur_elem_num=doc_e->left_exp;
|
||||
*_head=SpriteSideBar2SpriteQue(doc,*_head,_cur_elem_num);
|
||||
DocClear(doc);
|
||||
}
|
||||
}
|
||||
|
||||
Bool SpriteEdText(CSprite **_head,I64 *_cur_elem_num)
|
||||
{
|
||||
Bool res;
|
||||
|
||||
@@ -159,7 +159,7 @@ public U8 *SpriteElem2Summary(CSprite *tmpg)
|
||||
case SPT_TEXT:
|
||||
case SPT_TEXT_BOX:
|
||||
case SPT_TEXT_DIAMOND:
|
||||
CatPrint(buf," %d,%d:%-16tQ",tmpg->ps.x1,tmpg->ps.y1,tmpg->ps.st);
|
||||
CatPrint(buf," %d,%d:%-16t$$Q",tmpg->ps.x1,tmpg->ps.y1,tmpg->ps.st);
|
||||
break;
|
||||
case SPT_POLYLINE:
|
||||
case SPT_POLYPT:
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
#help_index "Graphics/Sprite;Sprites"
|
||||
|
||||
CSprite *SpriteSideBar2SpriteQue(CDoc *doc,CSprite *head,I64 *_cur_elem_num)
|
||||
{//For the side-bar
|
||||
CSprite *res=CAlloc(sizeof(CSprite)),*tmpg;
|
||||
CDocEntry *doc_e=doc->head.next;
|
||||
Bool found=FALSE;
|
||||
I64 num=0;
|
||||
QueInit(res);
|
||||
while (doc_e!=doc) {
|
||||
if (doc_e->type_u8==DOCT_MENU_VAL && doc_e->left_exp>=0) {
|
||||
tmpg=SpriteSetSettings(,head,doc_e->left_exp);
|
||||
if (tmpg!=head) {
|
||||
tmpg=MAllocIdent(tmpg);
|
||||
BEqu(&tmpg->type,SPf_SEL,Bt(&doc_e->type,DOCEt_SEL));
|
||||
if (*_cur_elem_num==doc_e->left_exp) {
|
||||
*_cur_elem_num=num;
|
||||
found=TRUE;
|
||||
}
|
||||
QueIns(tmpg,res->last);
|
||||
num++;
|
||||
}
|
||||
}
|
||||
doc_e=doc_e->next;
|
||||
}
|
||||
if (!found)
|
||||
*_cur_elem_num=num;
|
||||
QueDel(head);
|
||||
Free(head);
|
||||
return res;
|
||||
}
|
||||
|
||||
U0 SpriteSideBarPickNew(CDoc *doc,CSprite *head,I64 old_num)
|
||||
{
|
||||
CSprite *tmpg;
|
||||
CDocEntry *doc_cur_e=NULL,*doc_e;
|
||||
I64 cur_elem_num=0;
|
||||
U8 *st;
|
||||
DocPrint(doc,"$$PURPLE$$$$TX+CX,\"Sprite SideBar\"$$\n"
|
||||
"$$LK+PU+CX,\"Click for Help\","
|
||||
"A=\"FI:::/Doc/SpriteSideBar.DD.Z\"$$\n\n");
|
||||
tmpg=head->next;
|
||||
while (tmpg!=head) {
|
||||
st=SpriteElem2Summary(tmpg);
|
||||
if (cur_elem_num==old_num)
|
||||
doc_cur_e=doc_e=
|
||||
DocPrint(doc,"$$LTRED$$$$MU-UL,\"%$$Q\",LE=%d$$\n",st,cur_elem_num++);
|
||||
else
|
||||
doc_e=DocPrint(doc,"$$LTBLUE$$$$MU-UL,\"%$$Q\",LE=%d$$\n",st,cur_elem_num++);
|
||||
BEqu(&doc_e->de_flags,DOCEf_SEL,Bt(&tmpg->type,&SPf_SEL));
|
||||
BEqu(&doc_e->type,DOCEt_SEL,Bt(&tmpg->type,SPf_SEL));
|
||||
Free(st);
|
||||
tmpg=tmpg->next;
|
||||
}
|
||||
if (cur_elem_num==old_num)
|
||||
doc_cur_e=DocPrint(doc,"$$LTRED$$$$MU-UL,\"END\",LE=%d$$\n",cur_elem_num);
|
||||
else
|
||||
DocPrint(doc,"$$LTBLUE$$$$MU-UL,\"END\",LE=%d$$\n",cur_elem_num);
|
||||
if (doc_cur_e)
|
||||
doc->cur_entry=doc_cur_e;
|
||||
}
|
||||
|
||||
U0 SpriteSideBarTask2(CTask *grand_parent)
|
||||
{
|
||||
I64 w,h;
|
||||
CTask *parent=Fs->parent_task,*pu_task;
|
||||
while (TRUE) {
|
||||
pu_task=grand_parent->popup_task;
|
||||
if (TaskValidate(pu_task)) {
|
||||
w=parent->win_right-parent->win_left;
|
||||
WinHorz(pu_task->win_right+2,pu_task->win_right+2+w,parent);
|
||||
h=parent->win_bottom-parent->win_top;
|
||||
WinVert(pu_task->win_top,pu_task->win_top+h,parent);
|
||||
}
|
||||
Refresh;
|
||||
}
|
||||
}
|
||||
|
||||
U0 SpriteSideBarTask(CTask *parent,CSprite **_head,I64 *_cur_elem_num)
|
||||
{
|
||||
CDocEntry *doc_e;
|
||||
CDoc *doc=DocPut;
|
||||
Spawn(&SpriteSideBarTask2,parent,"CSpriteTask",,Fs);
|
||||
doc->flags|=DOCF_SIZE_MIN|DOCF_FORM;
|
||||
while (TRUE) {
|
||||
SpriteSideBarPickNew(doc,*_head,*_cur_elem_num);
|
||||
DocHighlightCursor(,doc);
|
||||
View;
|
||||
doc_e=doc->cur_entry;
|
||||
if (doc_e->type_u8==DOCT_MENU_VAL)
|
||||
*_cur_elem_num=doc_e->left_exp;
|
||||
*_head=SpriteSideBar2SpriteQue(doc,*_head,_cur_elem_num);
|
||||
DocClear(doc);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user