Exemplo n.º 1
0
	CEXPORT void* FactoryBuilder(const char* name)
	{
		if (!buildFactory)
			initFactory();

		if (!buildFactory)
			return NULL;

		return buildFactory(name);
	}
Exemplo n.º 2
0
MCFCore::MCFI* mcfFactory()
{
    if (!buildFactory)
		initFactory();

	if (!buildFactory)
        return NULL;

    void* temp = buildFactory(MCF_FACTORY);

    return static_cast<MCFCore::MCFI*>(temp);
}
Exemplo n.º 3
0
void dataGraphApplicationMain()
{
	initFactory(&dataGraphFactory, dataGraphOnTimer);
	
	Sheet *winDataGraph = prepareSheet();
    prepareWindowSheetGraph(winDataGraph);
    loadWindowSheet(winDataGraph);
	(*dataGraphProcess).mainWindow = winDataGraph;

	while(TRUE) {
		dataGraphFactory.deselectButton(&dataGraphFactory);
		dataGraphFactory.doProcessEvent(&dataGraphFactory);
	}
}
Exemplo n.º 4
0
QPropertiesView::QPropertiesView()
   : m_rootEditor( NULL )
{
   // setup the UI
   m_layout = new QVBoxLayout( this );
   m_layout->setAlignment( Qt::AlignTop );
   m_layout->setSpacing(0);
   m_layout->setMargin(0);

   setFrameStyle( QFrame::NoFrame );

   // setup editor factories
   initFactory();
}
Exemplo n.º 5
0
void calculatorApplicationMain()
{
	initFactory(&calculatorFactory, calculatorOnTimer);
	
	Sheet *winCalculator = prepareSheet();
    prepareWindowSheetCal(winCalculator);
    loadWindowSheet(winCalculator);
	(*calculatorProcess).mainWindow = winCalculator;

	while (TRUE) {
		calculatorFactory.deselectButton(&calculatorFactory);
		calculatorFactory.doProcessEvent(&calculatorFactory);
	}
}
Exemplo n.º 6
0
void mathematicsApplicationMain()
{
	initFactory(&mathematicsFactory, mathematicsOnTimer);
	
	Sheet *winMathematics = prepareSheet();
    prepareWindowSheetMath(winMathematics);
    loadWindowSheet(winMathematics);
	(*mathematicsProcess).mainWindow = winMathematics;

	while(TRUE) {
		mathematicsFactory.deselectButton(&mathematicsFactory);
		mathematicsFactory.doProcessEvent(&mathematicsFactory);
	}
}
Exemplo n.º 7
0
void bz2CompressFile(const char* src, const char* dest)
{
	if (!g_hBZ2 && !initFactory())
		return;

	UTIL::FS::FileHandle srcFH(src, UTIL::FS::FILE_READ);
	UTIL::FS::FileHandle destFH(dest, UTIL::FS::FILE_WRITE);

	uint64 tot = 0;
	uint64 fileSize = UTIL::FS::getFileSize(UTIL::FS::PathWithFile(src));

	bz_stream* bzs = new bz_stream;
	bzs->bzalloc = NULL;
	bzs->bzfree = NULL;
	bzs->opaque = NULL;

	int32 res = pBZ2_bzCompressInit(bzs, 9, 0, 0);

	if (res != BZ_OK)
	    throw gcException(ERR_BZ2DFAIL);

	size_t buffSize = 512*1024;
	char *inBuff = new char[buffSize];
	char *outBuff = new char[buffSize];

	bool endFile = false;
	

	do
	{
		uint32 readSize = buffSize;
		if (fileSize - tot < buffSize)
		{
			readSize = fileSize - tot;
			endFile = true;
		}

		if (readSize == 0)
			break;

		bzs->next_in = inBuff;
		bzs->avail_in = readSize;

		srcFH.read(inBuff, readSize);
		tot += readSize;
		
		int32 res = BZ_OK;

		do
		{
			bzs->next_out = outBuff;
			bzs->avail_out = buffSize;

			if (endFile)
				res = pBZ2_bzCompress(bzs, BZ_FINISH);
			else
				res = pBZ2_bzCompress(bzs, BZ_RUN);

			uint32 done = buffSize - bzs->avail_out;

			if (done > 0)
				destFH.write(outBuff, done);
		}
		while (endFile && res != BZ_STREAM_END || bzs->avail_in > 0);
	}
	while (res != BZ_STREAM_END);

	pBZ2_bzCompressEnd(bzs);
	safe_delete(bzs);
}