TempleOSCDV4.03.ISO
This commit is contained in:
1 parent
1541d7328d
commit
0f1a4a5d65
115 files changed
+5618
-4863
No files matched your search
@@ -0,0 +1,107 @@
|
||||
U8 *BlogLocalDir(CDate cdt=0)
|
||||
{
|
||||
static U8 dir[STR_LEN];
|
||||
CDateStruct ds;
|
||||
if (!cdt) cdt=Now+local_time_offset;
|
||||
Date2Struct(&ds,cdt);
|
||||
StrPrint(dir,"::/Home/Web/" PERSONAL_INITIALS "/Blog/%d%Z",
|
||||
ds.year,ds.mon-1,"ST_MONTHS");
|
||||
if (!FileFind(dir,,FUF_JUST_DIRS))
|
||||
MkDir(dir);
|
||||
return dir;
|
||||
}
|
||||
|
||||
U8 *BlogLocalFile(CDate cdt=0)
|
||||
{
|
||||
static U8 file[STR_LEN];
|
||||
CDateStruct ds;
|
||||
if (!cdt) cdt=Now+local_time_offset;
|
||||
Date2Struct(&ds,cdt);
|
||||
StrPrint(file,"%s/" PERSONAL_INITIALS "%02d%02d%02d.TXT.Z",
|
||||
BlogLocalDir(cdt),ds.year%100,ds.mon,ds.day_of_mon);
|
||||
return file;
|
||||
}
|
||||
|
||||
U8 *BlogWebDir(CDate cdt=0)
|
||||
{
|
||||
static U8 dir[STR_LEN];
|
||||
CDateStruct ds;
|
||||
if (!cdt) cdt=Now+local_time_offset;
|
||||
Date2Struct(&ds,cdt);
|
||||
StrPrint(dir,PERSONAL_WEB "/Home/Web/" PERSONAL_INITIALS "/Blog/%d%Z",
|
||||
ds.year,ds.mon-1,"ST_MONTHS");
|
||||
return dir;
|
||||
}
|
||||
|
||||
U8 *BlogWebFile(CDate cdt=0)
|
||||
{
|
||||
static U8 file[STR_LEN];
|
||||
CDateStruct ds;
|
||||
if (!cdt) cdt=Now+local_time_offset;
|
||||
Date2Struct(&ds,cdt);
|
||||
StrPrint(file,"%s/" PERSONAL_INITIALS "%02d%02d%02d.TXT.Z",
|
||||
BlogWebDir(cdt),ds.year%100,ds.mon,ds.day_of_mon);
|
||||
return file;
|
||||
}
|
||||
|
||||
public U8 *FileNameNumNext(U8 *files_find_mask,U8 *fmt)
|
||||
{
|
||||
CDirEntry *tempde=FilesFind(files_find_mask);
|
||||
U8 *result=MStrPrint(fmt,FileCnt(tempde));
|
||||
DirTreeDel(tempde);
|
||||
return result;
|
||||
}
|
||||
|
||||
U0 BlogDCImgWrite(CDC *dc,CDate cdt=0)
|
||||
{
|
||||
U8 file_mask[STR_LEN],file_name[STR_LEN],*st1,*st2;
|
||||
if (!cdt) cdt=Now+local_time_offset;
|
||||
StrPrint(file_mask,"%s/Img*",BlogLocalDir(cdt));
|
||||
StrPrint(file_name,"%s/Img%%03d.BMP",BlogLocalDir(cdt));
|
||||
st1=FileNameNumNext(file_mask,file_name);
|
||||
st2=MStrPrint("http://www.templeos.org/Wb%s",st1+2);
|
||||
BMPWrite(st1,dc);
|
||||
Free(st1);
|
||||
"$$HC,\"<img src=\\\"%s\\\" width=\\\"%d\\\" "
|
||||
"height=\\\"%d\\\" alt=\\\"\\\">\"$$\n",st2,dc->width,dc->height;
|
||||
Free(st2);
|
||||
}
|
||||
|
||||
U0 BlogScreenShot()
|
||||
{
|
||||
Bool old_cursor=DocCursor;
|
||||
CDC *dc1,*dc2;
|
||||
U8 *old_fp_draw_input_ptr=gr.fp_draw_input_ptr;
|
||||
gr.fp_draw_input_ptr=NULL;
|
||||
WinMgrSync(2);
|
||||
dc1=DCScreenCapture;
|
||||
dc2=DCExtract(dc1,0,FONT_HEIGHT,GR_WIDTH-1,GR_HEIGHT-1);
|
||||
BlogDCImgWrite(dc2);
|
||||
gr.fp_draw_input_ptr=old_fp_draw_input_ptr;
|
||||
DCDel(dc1);
|
||||
DCDel(dc2);
|
||||
DocCursor(old_cursor);
|
||||
}
|
||||
|
||||
public U0 MakeWebSitePartial()
|
||||
{
|
||||
FreshenWebDir("/Home/Web");
|
||||
FreshenWebDir("/Home/Web/" PERSONAL_INITIALS);
|
||||
FreshenWebDir(BlogLocalDir+2);
|
||||
Drv('C');
|
||||
}
|
||||
|
||||
U0 Blog()
|
||||
{
|
||||
if (!FileFind(BlogLocalFile,,FUF_JUST_FILES))
|
||||
Copy("::/Home/Downloads/Blog/DailyBlogHeader.TXT.Z",BlogLocalFile);
|
||||
WinMax;
|
||||
AutoComplete;
|
||||
Msg(MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN|SCF_CTRL);
|
||||
Msg(MSG_KEY_DOWN_UP,0,SC_F6|SCF_ALT);
|
||||
Msg(MSG_KEY_DOWN_UP,'\n',0);
|
||||
if (Ed(BlogLocalFile,EDF_WAS_WRITE)) {
|
||||
Copy(BlogLocalFile,"::Home/Web/" PERSONAL_INITIALS "/DailyBlog.TXT.Z");
|
||||
MakeWebSitePartial;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user