示例#1
0
void SkDisplayEvent::dumpEvent(SkAnimateMaker* maker) {
    dumpBase(maker);
    SkString str;
    SkDump::GetEnumString(SkType_EventKind, kind, &str);
    SkDebugf("kind=\"%s\" ", str.c_str());
    if (kind == SkDisplayEvent::kKeyPress || kind == SkDisplayEvent::kKeyPressUp) {
        if (code >= 0)
            SkDump::GetEnumString(SkType_EventCode, code, &str);
        else
            str.set("none");
        SkDebugf("code=\"%s\" ", str.c_str());
    }
    if (kind == SkDisplayEvent::kKeyChar) {
        if (fMax != (SkKey) -1 && fMax != code)
            SkDebugf("keys=\"%c - %c\" ", code, fMax);
        else
            SkDebugf("key=\"%c\" ", code);
    }
    if (fTarget != NULL) {
        SkDebugf("target=\"%s\" ", fTarget->id);
    }
    if (kind >= SkDisplayEvent::kMouseDown && kind <= SkDisplayEvent::kMouseUp) {
        SkDebugf("x=\"%g\" y=\"%g\" ", SkScalarToFloat(x), SkScalarToFloat(y));
    }
    if (disable)
        SkDebugf("disable=\"true\" ");
    SkDebugf("/>\n");
}
示例#2
0
void SkDrawPaint::dump(SkAnimateMaker* maker) {
    dumpBase(maker);
    dumpAttrs(maker);
    bool closedYet = false;
    SkDisplayList::fIndent +=4;
    //should i say if (maskFilter && ...?
    if (maskFilter != (SkDrawMaskFilter*)-1) {
        SkDebugf(">\n");
        maskFilter->dump(maker);
        closedYet = true;
    }
    if (pathEffect != (SkDrawPathEffect*) -1) {
        if (closedYet == false) {
            SkDebugf(">\n");
            closedYet = true;
        }
        pathEffect->dump(maker);
    }
    if (fOwnsTypeface) {
        if (closedYet == false) {
            SkDebugf(">\n");
            closedYet = true;
        }
        typeface->dump(maker);
    }
    SkDisplayList::fIndent -= 4;
    dumpChildren(maker, closedYet);
}
示例#3
0
static void dumpDirect(         // DUMP DIRECT BASE
    BASE_CLASS* dbase,          // - direct base
    void * _di )             // - dump information
{
    DUMP_INFO* di = _di;
    dumpBase( dbase, di, "Direct Base:" );
}
示例#4
0
void SkDrawTo::dump(SkAnimateMaker* maker) {
    dumpBase(maker);
    dumpAttrs(maker);
    if (use)
        SkDebugf("use=\"%s\" ", use->id);
    dumpDrawables(maker);
}
示例#5
0
void SkDisplayRandom::dump(SkAnimateMaker* maker) {
    dumpBase(maker);
    SkDebugf("min=\"%g\" ", SkScalarToFloat(min));
    SkDebugf("max=\"%g\" ", SkScalarToFloat(max));
    SkDebugf("blend=\"%g\" ", SkScalarToFloat(blend));
    SkDebugf("/>\n");
}
示例#6
0
static void dumpVirtual(        // DUMP VIRTUAL BASE
    BASE_CLASS* vbase,          // - virtual base
    void * _di )             // - dump information
{
    DUMP_INFO* di = _di;
    dumpBase( vbase, di, "Virtual Base:" );
}
void SkDrawMatrix::dump(SkAnimateMaker* maker) {
    dumpBase(maker);
    if (fMatrix.isIdentity()) {
        SkDebugf("matrix=\"identity\"/>\n");
        return;
    }
    SkScalar result;
    result = fMatrix[SkMatrix::kMScaleX];
    if (result != SK_Scalar1)
        SkDebugf("sx=\"%g\" ", SkScalarToFloat(result));
    result = fMatrix.getScaleY();
    if (result != SK_Scalar1)
        SkDebugf("sy=\"%g\" ", SkScalarToFloat(result));
    result = fMatrix.getSkewX();
    if (result)
        SkDebugf("skew-x=\"%g\" ", SkScalarToFloat(result));
    result = fMatrix.getSkewY();
    if (result)
        SkDebugf("skew-y=\"%g\" ", SkScalarToFloat(result));
    result = fMatrix.getTranslateX();
    if (result)
        SkDebugf("tx=\"%g\" ", SkScalarToFloat(result));
    result = fMatrix.getTranslateY();
    if (result)
        SkDebugf("ty=\"%g\" ", SkScalarToFloat(result));
    result = SkPerspToScalar(fMatrix.getPerspX());
    if (result)
        SkDebugf("perspect-x=\"%g\" ", SkScalarToFloat(result));
    result = SkPerspToScalar(fMatrix.getPerspY());
    if (result)
        SkDebugf("perspect-y=\"%g\" ", SkScalarToFloat(result));
    SkDebugf("/>\n");
}
示例#8
0
void SkDisplayable::dump(SkAnimateMaker* maker) {
    dumpBase(maker);
#if SK_USE_CONDENSED_INFO == 0
    this->dumpAttrs(maker);
    this->dumpChildren(maker);
#endif
}
示例#9
0
void SkGroup::dump(SkAnimateMaker* maker) {
    dumpBase(maker);
    if (condition.size() > 0)
        SkDebugf("condition=\"%s\" ", condition.c_str());
    if (enableCondition.size() > 0)
        SkDebugf("enableCondition=\"%s\" ", enableCondition.c_str());
    dumpDrawables(maker);
}
示例#10
0
void SkDisplayMovie::dump(SkAnimateMaker* maker) {
    dumpBase(maker);
    SkDebugf("src=\"%s\"/>\n",  src.c_str());
    SkAnimateMaker* movieMaker = fMovie.fMaker;
    SkDisplayList::fIndent += 4;
    movieMaker->fDisplayList.dumpInner(movieMaker);
    SkDisplayList::fIndent -= 4;
    dumpEnd(maker);
}
示例#11
0
void SkSaveLayer::dump(SkAnimateMaker* maker)
{
    dumpBase(maker);
    //would dump enabled be defined but not debug?
#ifdef SK_DEBUG
    if (paint)
        SkDebugf("paint=\"%s\" ", paint->id);
    if (bounds)
        SkDebugf("bounds=\"%s\" ", bounds->id);
#endif
    dumpDrawables(maker);
}
void SkDisplayRandom::dump(SkAnimateMaker* maker) {
    dumpBase(maker);
#ifdef SK_CAN_USE_FLOAT
    SkDebugf("min=\"%g\" ", SkScalarToFloat(min));
    SkDebugf("max=\"%g\" ", SkScalarToFloat(max));
    SkDebugf("blend=\"%g\" ", SkScalarToFloat(blend));    
#else
    SkDebugf("min=\"%x\" ", min);
    SkDebugf("max=\"%x\" ", max);
    SkDebugf("blend=\"%x\" ", blend);    
#endif
    SkDebugf("/>\n");
}
示例#13
0
void SkApply::dump(SkAnimateMaker* maker) {
    dumpBase(maker);
    if (dynamicScope.isEmpty() == false)
        SkDebugf("dynamicScope=\"%s\" ", dynamicScope.c_str());
    if (dontDraw)
        SkDebugf("dontDraw=\"true\" ");
    if (begin != 0) //perhaps we want this no matter what?
        SkDebugf("begin=\"%g\" ", (float) begin/1000.0f);   //is this correct?
    if (interval != (SkMSec) -1)
        SkDebugf("interval=\"%g\" ", (float) interval/1000.0f);
    if (steps != -1)
        SkDebugf("steps=\"%d\" ", steps);
    if (restore)
        SkDebugf("restore=\"true\" ");
    if (transition == kTransition_reverse)
        SkDebugf("transition=\"reverse\" ");
    if (mode == kMode_immediate) {
        SkDebugf("mode=\"immediate\" ");
    }
    else if (mode == kMode_create) {
        SkDebugf("mode=\"create\" ");
    }
    bool closedYet = false;
    SkDisplayList::fIndent += 4;
    int save = SkDisplayList::fDumpIndex;
    if (scope) {
        if (closedYet == false) {
            SkDebugf(">\n");
            closedYet = true;
        }
        scope->dump(maker);
    }
    int index;
//  if (fActive) {
        for (index = 0; index < fAnimators.count(); index++) {
            if (closedYet == false) {
                SkDebugf(">\n");
                closedYet = true;
            }
            SkAnimateBase* animator = fAnimators[index];
            animator->dump(maker);
//      }
    }
    SkDisplayList::fIndent -= 4;
    SkDisplayList::fDumpIndex = save;
    if (closedYet)
        dumpEnd(maker);
    else
        SkDebugf("/>\n");
}
示例#14
0
void SkAdd::dump(SkAnimateMaker* maker) {
    dumpBase(maker);
    dumpAttrs(maker);
    if (where)
        SkDebugf("where=\"%s\" ", where->id);
    if (mode == kMode_immediate)
        SkDebugf("mode=\"immediate\" ");
    SkDebugf(">\n");
    SkDisplayList::fIndent += 4;
    int save = SkDisplayList::fDumpIndex;
    if (use)    //just in case
        use->dump(maker);
    SkDisplayList::fIndent -= 4;
    SkDisplayList::fDumpIndex = save;
    dumpEnd(maker);
}
示例#15
0
void SkDrawPath::dump(SkAnimateMaker* maker) {
    dumpBase(maker);
    dumpAttrs(maker);
    bool closedYet = false;
    SkDisplayList::fIndent += 4;
    for(SkPathPart** part = fParts.begin(); part < fParts.end(); part++) {
        if (closedYet == false) {
            SkDebugf(">\n");
            closedYet = true;
        }
        (*part)->dump(maker);
    }
    SkDisplayList::fIndent -= 4;
    if (closedYet)
        dumpEnd(maker);
    else
        SkDebugf("/>\n");
}
示例#16
0
void SkDrawBitmap::dump(SkAnimateMaker* maker) {
    dumpBase(maker);
    dumpAttrs(maker);
    if (fColorSet)
        SkDebugf("erase=\"argb(%d,%d,%d,%d)\" ", SkColorGetA(fColor)/255, SkColorGetR(fColor),
            SkColorGetG(fColor), SkColorGetB(fColor));
    if (rowBytes > 0)
        SkDebugf("rowBytes=\"%d\" ", rowBytes);
    const char* formatName;
    switch (format) {
        case 0: formatName = "none"; break;
        case 1: formatName = "A8"; break;
        case 2: formatName = "Index8"; break;
        case 3: formatName = "RGB16"; break;
        case 4: formatName = "RGB32"; break;
    }
    SkDebugf("format=\"%s\" />\n", formatName);
}
示例#17
0
bool SkGroup::ifCondition(SkAnimateMaker& maker, SkDrawable* drawable,
        SkString& conditionString) {
    if (conditionString.size() == 0)
        return true;
    int32_t result;
    bool success = SkAnimatorScript::EvaluateInt(maker, this, conditionString.c_str(), &result);
#ifdef SK_DUMP_ENABLED
    if (maker.fDumpGConditions) {
        SkDebugf("group: ");
        dumpBase(&maker);
        SkDebugf("condition=%s ", conditionString.c_str());
        if (success == false)
            SkDebugf("(script failed)\n");
        else
            SkDebugf("success=%s\n", result != 0 ? "true" : "false");
    }
#endif
    return success && result != 0;
}
示例#18
0
void SkAnimateBase::dump(SkAnimateMaker* maker) {
    dumpBase(maker);
    if (target.size() > 0)
        SkDebugf("target=\"%s\" ", target.c_str());
    else if (fTarget && strcmp(fTarget->id, ""))
        SkDebugf("target=\"%s\" ", fTarget->id);
    if (lval.size() > 0)
        SkDebugf("lval=\"%s\" ", lval.c_str());
    if (field.size() > 0)
        SkDebugf("field=\"%s\" ", field.c_str());
    else if (fFieldInfo)
        SkDebugf("field=\"%s\" ", fFieldInfo->fName);
    if (formula.size() > 0)
        SkDebugf("formula=\"%s\" ", formula.c_str());
    else {
        if (from.size() > 0)
            SkDebugf("from=\"%s\" ", from.c_str());
        SkDebugf("to=\"%s\" ", to.c_str());
    }
    if (begin != 0) {
        SkDebugf("begin=\"%g\" ", SkScalarToFloat(SkScalarDiv(begin,1000)));
    }
}
示例#19
0
void SkDisplayBoolean::dump(SkAnimateMaker* maker){
    dumpBase(maker);
    SkDebugf("value=\"%s\" />\n", value ? "true" : "false");
}
示例#20
0
void SkDisplayFloat::dump(SkAnimateMaker* maker) {
    dumpBase(maker);
    SkDebugf("value=\"%g\" />\n", SkScalarToFloat(value));
}
bool
aBackup::exportData(const QString& rcfile, const QString &archfile, bool withTemplates )
{
	QDir dir;
	int prg=0;
	int totalSteps=10;
        QString temp;
	QString tmpDirName;
	QString srcDirName;
	QStringList templatesName;

#ifndef _Windows
	temp = getenv("TMPDIR");
	if(temp=="" || temp.isEmpty())
		temp = P_tmpdir;
#else
	temp = getenv("TEMP");
#endif
	tmpDirName = QString(temp+"/%1").arg(QDateTime::currentDateTime().toTime_t());
	tmpDirName = QDir::convertSeparators(tmpDirName);
	//printf("copy name = %s\n",tmpDirName.ascii());
	if(!dir.mkdir(tmpDirName))
	{
		setLastError(tr("Can't create directory %s").arg(tmpDirName));
		aLog::print(aLog::Error, tr("aBackup create temporary directory"));
		return true;
	}
	else
	{
		aLog::print(aLog::Debug, tr("aBackup create temporary directory %1").arg(tmpDirName));

	}
	if(!dir.mkdir(tmpDirName+"/META-INF"))
	{
		setLastError(tr("Can't create directory %s").arg(tmpDirName+"/META-INF"));
		aLog::print(aLog::Error, tr("aBackup create temporary directory"));
		cleanupTmpFiles(tmpDirName, &templatesName);
		return true;
	}
	else
	{
		aLog::print(aLog::Debug, tr("aBackup create temporary directory %1").arg(tmpDirName+"/META-INF"));
	}
	aCfg cfg;
	// create copy of metadata
	if(cfg.readrc( rcfile ))
	{
		setLastError(tr("Invalid resource file"));
		aLog::print(aLog::Error, tr("aBackup invalid *.rc file"));
		cleanupTmpFiles(tmpDirName, &templatesName);
		return true;
	}
	else
	{
		aLog::print(aLog::Debug, tr("aBackup valid *.rc file"));
	}
	qApp->processEvents();

	if(withTemplates)
	{
		srcDirName = QDir::convertSeparators(cfg.rc.value("workdir"));
		aLog::print(aLog::Debug, tr("aBackup workdir=%1").arg(srcDirName));
		dir.setPath(srcDirName);
		templatesName = dir.entryList("templ_*.odt;templ_*.ods");
		for(uint i=0; i<templatesName.count(); i++)
		{
			//ayTests::print2log("f:\\ERROR.log", "aBackup", tmpDirName + "/templates/"+templatesName[i]);
			aLog::print(aLog::Debug, tr("aBackup template %1 %2").arg(i).arg(tmpDirName + "/templates/"+templatesName[i]));
//			file.remove();
		}
	}


	emit(progress(++prg,totalSteps));
	if(cfg.write( tmpDirName+"/busines-schema.cfg" ))
	{
		setLastError(tr("Can't write resource file"));
		aLog::print(aLog::Error, tr("aBackup write %1 file").arg(tmpDirName+"/busines-schema.cfg"));
		cleanupTmpFiles(tmpDirName, &templatesName);
		return true;
	}
	else
	{
		aLog::print(aLog::Debug, tr("aBackup write %1 file").arg(tmpDirName+"/busines-schema.cfg"));

	}
	qApp->processEvents();
	emit(progress(++prg,totalSteps));
	// create dump
	if(dumpBase(rcfile,tmpDirName, prg, totalSteps )==true)
	{
		cleanupTmpFiles(tmpDirName, &templatesName);
		aLog::print(aLog::Error, tr("aBackup dump base error"));
		return true;
	}
	else
	{
		aLog::print(aLog::Debug, tr("aBackup bump base"));
	}

	if(writeXml(QDir::convertSeparators(tmpDirName+"/META-INF/manifest.xml"), createManifest(templatesName))==true)
	{
		setLastError(tr("Can't write file META-INF/manifest.xml"));
		aLog::print(aLog::Error, tr("aBackup write manifest.xml"));
		cleanupTmpFiles(tmpDirName, &templatesName);
		return true;
	}
	else
	{
		aLog::print(aLog::Debug, tr("aBackup write manifest.xml"));
	}
//	printf("%s\n",(createManifest(templatesName)).toString().ascii());
	if(withTemplates)
	{
		QString destNamePref = tmpDirName + "/templates";
		dir.mkdir(destNamePref);
		bool res = false;
		for(uint i=0; i<templatesName.count(); i++)
		{
//				printf("copy %s to %s\n", QString(srcDirName+"/"+templatesName[i]).ascii(), QString(destNamePref+"/"+templatesName[i]).ascii());
			if(!aService::copyFile(QDir::convertSeparators(srcDirName+"/"+templatesName[i]), QDir::convertSeparators(destNamePref+"/"+templatesName[i]), true))
			{
				setLastError(tr("Can't copy template file"));
				res&=true;
			}

		}
	}

	if(zipArchive(archfile + ".bsa", tmpDirName)==true)
	{
//		setLastError(tr("Can't zip archive"));
		cleanupTmpFiles(tmpDirName, &templatesName);
		aLog::print(aLog::Error, tr("aBackup zip archive"));
		return true;
	}
	else
	{
		aLog::print(aLog::Debug, tr("aBackup zip archive"));
	}
	// remove files and directories
	cleanupTmpFiles(tmpDirName, &templatesName);
	emit (progress(++prg,totalSteps));
	setLastError(tr("Data export done without errors"));
	aLog::print(aLog::Debug, tr("aBackup export data ok"));

	return false;
}
示例#22
0
void SkDrawRect::dump(SkAnimateMaker* maker) {
    dumpBase(maker);
    SkDebugf("left=\"%g\" top=\"%g\" right=\"%g\" bottom=\"%g\" />\n",
        SkScalarToFloat(fRect.fLeft), SkScalarToFloat(fRect.fTop), SkScalarToFloat(fRect.fRight),
        SkScalarToFloat(fRect.fBottom));
}
示例#23
0
void SkDrawColor::dump(SkAnimateMaker* maker) {
    dumpBase(maker);
    SkDebugf("alpha=\"%d\" red=\"%d\" green=\"%d\" blue=\"%d\" />\n",  
        SkColorGetA(color)/255, SkColorGetR(color),
        SkColorGetG(color), SkColorGetB(color));
}
示例#24
0
void SkDisplayInt::dump(SkAnimateMaker* maker){
    dumpBase(maker);
    SkDebugf("value=\"%d\" />\n", value);
}