/*** fInitFileMac - Initialize macros associated with a file * * Sets the curfile family of macros, and attempts to read any extension- * specific section from tools.ini. * * Input: * pFileNew = File to set information for * * Output: * Returns TRUE if TOOLS.INI section found, else FALSE * *************************************************************************/ flagType fInitFileMac ( PFILE pFileNew ) { char fbuf[ 512 ]; strcpy (fbuf, pFileNew->pName); FmtAssign ("curFile:=\"%s\"", DoubleSlashes (fbuf)); filename (pFileNew->pName, fbuf); FmtAssign ("curFileNam:=\"%s\"", fbuf); if (!extention (pFileNew->pName, fbuf)) { fbuf[0] = '.'; fbuf[1] = '\0'; } FmtAssign ("curFileExt:=\"%s\"", fbuf); return InitExt (fbuf); }
void DrawSdk::Image::Write(CharArray *pArray, bool bUseFullImagePath) { if (pArray == NULL) return; _TCHAR *tszMove = _T(""); static _TCHAR tszBelongs[100]; tszBelongs[0] = 0; if (m_bDndMoveable) { tszMove = _T(" move=\"true\""); _stprintf(tszBelongs, _T(" belongs=\"%d\""), m_iBelongsKey); } static _TCHAR tszVisibility[100]; tszVisibility[0] = 0; if (HasVisibility()) _stprintf(tszVisibility, _T(" visible=\"%s\""), GetVisibility()); static _TCHAR tszEscapedPath[MAX_PATH * 2]; ZeroMemory(tszEscapedPath, MAX_PATH * 2); if (bUseFullImagePath) DoubleSlashes(imageName_, tszEscapedPath); _TCHAR *tszOutputName = bUseFullImagePath ? tszEscapedPath : imagePrefix_; static _TCHAR tszTotal[1500]; tszTotal[0] = 0; _stprintf(tszTotal, _T("<IMAGE x=\"%d\" y=\"%d\" width=\"%d\" height=\"%d\" xf=\"%.2f\" yf=\"%.2f\" widthf=\"%.2f\" heightf=\"%.2f\" fname=\"%s\"%s%s%s></IMAGE>\n"), (int)x_, (int)y_, (int)width_, (int)height_, x_, y_, width_, height_, tszOutputName, tszMove, tszBelongs, tszVisibility); pArray->AppendData(tszTotal); }