/**************************************************************************//** \brief Initializes command handler. \param None. \return None. ******************************************************************************/ void appInitCmdHandler(void) { resetQueue(&appBusyCmdQueue); resetQueue(&appFreeCmdQueue); for (uint8_t i = 0; i < ARRAY_SIZE(appCmdBuffers); i++) { putQueueElem(&appFreeCmdQueue, &appCmdBuffers[i].next); } }
QT_BEGIN_NAMESPACE QT_CANVAS3D_BEGIN_NAMESPACE /*! * The CanvasGlCommandQueue is used to store OpenGL commands until we can execute them under * correct context in the renderer thread. * * The commands are all preallocated in a single block. The counter m_queuedCount indicates * how many commands from the beginning are actually used at any given time. * * The command data is copied for execution when GUI thread is blocked, so no extra synchronization * is needed for that. */ CanvasGlCommandQueue::CanvasGlCommandQueue(int initialSize, int maxSize, QObject *parent) : QObject(parent), m_maxSize(maxSize), m_size(0), m_queuedCount(0), m_nextResourceId(1), m_resourceIdOverflow(false), m_clearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT) { resetQueue(initialSize); }
int main(int argc, char *argv[]) { if (getuid()!=0) { string args; for (int i=0; i<argc; i++) { args+=(string) argv[i] + " "; } return system("kdesu " + args); } setlocale(LC_ALL, ""); bindtextdomain( "installpkg-ng", "/usr/share/locale"); textdomain("installpkg-ng"); QApplication app(argc, argv); QTranslator translator; translator.load("/usr/share/mpkg/pkgmanager_ru"); app.installTranslator(&translator); MainWindow mw; QObject::connect(mw.ui.selectAllButton, SIGNAL(clicked()), &mw, SLOT(selectAll())); QObject::connect(mw.ui.deselectAllButton, SIGNAL(clicked()), &mw, SLOT(deselectAll())); QObject::connect(mw.ui.actionQuit, SIGNAL(triggered()), &mw, SLOT(quitApp())); QObject::connect(mw.ui.quitButton, SIGNAL(clicked()), &mw, SLOT(quitApp())); QObject::connect(mw.ui.applyButton, SIGNAL(clicked()), &mw, SLOT(commitChanges())); QObject::connect(mw.ui.actionAbout, SIGNAL(triggered()), &mw, SLOT(showAbout())); QObject::connect(mw.ui.actionReset_changes, SIGNAL(triggered()), &mw, SLOT(resetChanges())); QObject::connect(mw.ui.actionReset_all_queue, SIGNAL(triggered()), &mw, SLOT(resetQueue())); QObject::connect(mw.ui.actionPreferences, SIGNAL(triggered()), &mw, SLOT(showPreferences())); QObject::connect(mw.ui.actionAdd_remove_repositories, SIGNAL(triggered()), &mw, SLOT(showAddRemoveRepositories())); QObject::connect(mw.ui.actionClean_cache, SIGNAL(triggered()), &mw, SLOT(cleanCache())); QObject::connect(mw.ui.actionShow_installed, SIGNAL(triggered()), &mw, SLOT(applyPackageFilter())); QObject::connect(mw.ui.actionShow_deprecated, SIGNAL(triggered()), &mw, SLOT(applyPackageFilter())); QObject::connect(mw.ui.actionShow_available, SIGNAL(triggered()), &mw, SLOT(applyPackageFilter())); QObject::connect(mw.ui.actionShow_queue, SIGNAL(triggered()), &mw, SLOT(applyPackageFilter())); QObject::connect(mw.ui.actionShow_configexist, SIGNAL(triggered()), &mw, SLOT(applyPackageFilter())); QObject::connect(mw.ui.actionShow_unavailable, SIGNAL(triggered()), &mw, SLOT(applyPackageFilter())); QObject::connect(mw.ui.actionCore_settings, SIGNAL(triggered()), &mw, SLOT(showCoreSettings())); QObject::connect(mw.ui.actionUpdate_data, SIGNAL(triggered()), &mw, SLOT(updateData())); QObject::connect(mw.ui.packageTable, SIGNAL(itemSelectionChanged()), &mw, SLOT(showPackageInfo())); QObject::connect(mw.ui.quickPackageSearchEdit, SIGNAL(textEdited(const QString &)), &mw, SLOT(applyPackageFilter())); int ret = app.exec(); return ret; }
void color(Point start, int col){ push(start); while (queueIsNotEmpty) { Point curr = pop(); pointInMap(curr) = col; int i; for (i = 0; i < MOVCOUNT; i++) { Point next = nextPoint(curr, i); if (isValidPoint(next) && pointInMap(next) == SPOT) { push(next); } } } resetQueue(); }
uint32 SumQueue::restart(uint32 maxLBD, float limMax) { ++nRestart; if (upCfl >= upForce) { double avg = upCfl / double(nRestart); double gLbd= globalAvgLbd(); bool sx = samples >= upForce; upCfl = 0; nRestart = 0; if (avg >= 16000.0) { lim += 0.1f; upForce = 16000; } else if (sx) { lim += 0.05f; upForce = std::max(uint32(16000), upForce-10000); } else if (avg >= 4000.0) { lim += 0.05f; } else if (avg >= 1000.0) { upForce += 10000u; } else if (lim > limMax) { lim -= 0.05f; } if ((gLbd > maxLBD)==lbd){ dynamicRestarts(limMax, !lbd); } } resetQueue(); return upForce; }