CEXPORT void* FactoryBuilder(const char* name) { if (!buildFactory) initFactory(); if (!buildFactory) return NULL; return buildFactory(name); }
MCFCore::MCFI* mcfFactory() { if (!buildFactory) initFactory(); if (!buildFactory) return NULL; void* temp = buildFactory(MCF_FACTORY); return static_cast<MCFCore::MCFI*>(temp); }
void dataGraphApplicationMain() { initFactory(&dataGraphFactory, dataGraphOnTimer); Sheet *winDataGraph = prepareSheet(); prepareWindowSheetGraph(winDataGraph); loadWindowSheet(winDataGraph); (*dataGraphProcess).mainWindow = winDataGraph; while(TRUE) { dataGraphFactory.deselectButton(&dataGraphFactory); dataGraphFactory.doProcessEvent(&dataGraphFactory); } }
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(); }
void calculatorApplicationMain() { initFactory(&calculatorFactory, calculatorOnTimer); Sheet *winCalculator = prepareSheet(); prepareWindowSheetCal(winCalculator); loadWindowSheet(winCalculator); (*calculatorProcess).mainWindow = winCalculator; while (TRUE) { calculatorFactory.deselectButton(&calculatorFactory); calculatorFactory.doProcessEvent(&calculatorFactory); } }
void mathematicsApplicationMain() { initFactory(&mathematicsFactory, mathematicsOnTimer); Sheet *winMathematics = prepareSheet(); prepareWindowSheetMath(winMathematics); loadWindowSheet(winMathematics); (*mathematicsProcess).mainWindow = winMathematics; while(TRUE) { mathematicsFactory.deselectButton(&mathematicsFactory); mathematicsFactory.doProcessEvent(&mathematicsFactory); } }
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); }