예제 #1
0
DataEngineScript *loadScriptEngine(const QString &language, DataEngine *dataEngine, const QVariantList &args)
{
    DataEngineScript *engine =
        static_cast<DataEngineScript *>(loadEngine(language, Types::DataEngineComponent, dataEngine, args));

    if (engine) {
        engine->setDataEngine(dataEngine);
    }

    return engine;
}
예제 #2
0
AppletScript *loadScriptEngine(const QString &language, Applet *applet, const QVariantList &args)
{
    AppletScript *engine =
        static_cast<AppletScript *>(loadEngine(language, Types::AppletComponent, applet, args));

    if (engine) {
        engine->setApplet(applet);
    }

    return engine;
}
예제 #3
0
QFontEngine *qt_load_font_engine_win(const QFontDef &request)
{
    // From qfont.cpp
    extern int qt_defaultDpi();

    QFontCache::Key key(request, QUnicodeTables::Common);
    QFontEngine *fe = QFontCache::instance()->findEngine(key);
    if (fe != 0)
        return fe;
    else
        return loadEngine(QUnicodeTables::Common, request, 0, qt_defaultDpi(), false, 0,
                          QStringList());
}
예제 #4
0
QT_BEGIN_NAMESPACE


// ------------------------------------------------------------------
// Multi XLFD engine
// ------------------------------------------------------------------

QFontEngineMultiXLFD::QFontEngineMultiXLFD(const QFontDef &r, const QList<int> &l, int s)
    : QFontEngineMulti(l.size()), encodings(l), screen(s), request(r)
{
    loadEngine(0);
    fontDef = engines[0]->fontDef;
}
예제 #5
0
EngineController::EngineController()
        : m_engine( 0 )
        , m_voidEngine( 0 )
        , m_delayTime( 0 )
        , m_muteVolume( 0 )
        , m_xFadeThisTrack( false )
        , m_timer( new QTimer( this ) )
        , m_playFailureCount( 0 )
        , m_lastFm( false )
        , m_positionOffset( 0 )
        , m_lastPositionOffset( 0 )
{
    m_voidEngine = m_engine = static_cast<EngineBase*>( loadEngine( "void-engine" ) );

    connect( m_timer, SIGNAL( timeout() ), SLOT( slotMainTimer() ) );
}
예제 #6
0
static QFontEngine *loadWin(const QFontPrivate *d, int script, const QFontDef &req)
{
    // list of families to try
    QStringList family_list = familyList(req);

    const char *stylehint = styleHint(d->request);
    if (stylehint)
        family_list << QLatin1String(stylehint);

    // append the default fallback font for the specified script
    // family_list << ... ; ###########

    // add the default family
    QString defaultFamily = QApplication::font().family();
    if (! family_list.contains(defaultFamily))
        family_list << defaultFamily;

    // add QFont::defaultFamily() to the list, for compatibility with
    // previous versions
    family_list << QApplication::font().defaultFamily();

    // null family means find the first font matching the specified script
    family_list << QString();

    QtFontDesc desc;
    QFontEngine *fe = 0;
    QList<int> blacklistedFamilies;

    while (!fe) {
        for (int i = 0; i < family_list.size(); ++i) {
            QString family, foundry;
            parseFontName(family_list.at(i), foundry, family);
            FM_DEBUG("loadWin: >>>>>>>>>>>>>>trying to match '%s'", family.toLatin1().data());
            QT_PREPEND_NAMESPACE(match)(script, req, family, foundry, -1, &desc, blacklistedFamilies);
            if (desc.family)
                break;
        }
        if (!desc.family)
            break;
        fe = loadEngine(script, req, d->hdc, d->dpi, d->rawMode, &desc, family_list);
        if (!fe)
            blacklistedFamilies.append(desc.familyIndex);
    }
    return fe;
}
예제 #7
0
arxstatus_t ARXClientTest::init()
{
    mCamRend[0] = new ARXImgRenderer();
    mCamRend[1] = new ARXImgRenderer();
    if (mCamRend[0] == NULL || mCamRend[1] == NULL) {
        ARX_PRINT(ARX_ZONE_ERROR, "Failed to allocate camera renderer!");
        return NOMEMORY;
    }

    mPropL = new TestPropListener(&mDoneEvt);
    if (mPropL == NULL) {
        ARX_PRINT(ARX_ZONE_ERROR, "Failed to create a test property listener!");
        return FAILED;
    }

    mArx = ARAccelerator::create(mPropL, mUseDVP);
    if (mArx == NULL) {
        ARX_PRINT(ARX_ZONE_ERROR, "Failed to create an instance of AR Accelerator!");
        return FAILED;
    }

    arxstatus_t ret = loadEngine();
    if (ret != NOERROR) {
        ARX_PRINT(ARX_ZONE_ERROR, "Failed to load ARX engine!");
        return ret;
    }

    ret = mCamRend[0]->init(mCamWidth, mCamHeight, 0, 0, BUFF_CAMOUT, mArx, false);
    if (mEnableSec) {
        ret = mCamRend[1]->init(mSecCamWidth, mSecCamHeight, mCamWidth, 0, BUFF_CAMOUT2, mArx, true, mComputeBufOut);
    }

    ret = mArx->setProperty(PROP_CAM_ID, mCamId);
    ret = mArx->setProperty(PROP_CAM_FPS, mCamFPS);
    ret = mArx->setProperty(PROP_CAM_MAIN_MIRROR, mCamMirror);
    ret = mArx->setProperty(PROP_CAM_SEC_MIRROR, mSecCamMirror);

    return ret;
}
예제 #8
0
/*!
    \internal
*/
QFontEngine *
QFontDatabase::findFont(int script, const QFontPrivate *fp,
                        const QFontDef &request)
{
    QMutexLocker locker(fontDatabaseMutex());
    const int force_encoding_id = -1;

    if (!privateDb()->count)
        initializeDb();

    QFontEngine *engine;
    QFontCache::Key key(request, script);
    engine = QFontCache::instance()->findEngine(key);
    if (engine) {
        qDebug() << "Cache hit level 1";
        return engine;
    }

    QString family_name, foundry_name;

    parseFontName(request.family, foundry_name, family_name);
    if (qt_enable_test_font && request.family == QLatin1String("__Qt__Box__Engine__")) {
        engine =new QTestFontEngine(request.pixelSize);
        engine->fontDef = request;
    }

    QtFontDesc desc;
    match(script, request, family_name, foundry_name, force_encoding_id, &desc);
    if (desc.family != 0 && desc.foundry != 0 && desc.style != 0) {
        engine = loadEngine(script, request, desc.family, desc.foundry, desc.style, desc.size);
    } else {
        FM_DEBUG("  NO MATCH FOUND\n");
    }

    if (engine) {
        initFontDef(desc, request, &engine->fontDef);

        if (fp) {
            QFontDef def = request;
            if (def.family.isEmpty()) {
                def.family = fp->request.family;
                def.family = def.family.left(def.family.indexOf(QLatin1Char(',')));
            }
        }
    }

    if (!engine) {
        if (!request.family.isEmpty()) {
            QStringList fallbacks = fallbackFamilies(request.family,QFont::Style(request.style),QFont::StyleHint(request.styleHint),QUnicodeTables::Script(script));
            for (int i = 0; i < fallbacks.size(); i++) {
                QFontDef def = request;
                def.family = fallbacks.at(i);
                QFontCache::Key key(def,script);
                engine = QFontCache::instance()->findEngine(key);
                if (!engine) {
                    QtFontDesc desc;
                    match(script, def, def.family, QLatin1String(""), 0, &desc);
                    if (desc.family == 0 && desc.foundry == 0 && desc.style == 0) {
                        continue;
                    }
                    engine = loadEngine(script, def, desc.family, desc.foundry, desc.style, desc.size);
                    if (engine) {
                        initFontDef(desc, def, &engine->fontDef);
                        break;
                    }
                }
            }
        }

        if (!engine)
            engine = new QFontEngineBox(request.pixelSize);

        FM_DEBUG("returning box engine");
    }

    if (fp && fp->dpi > 0) {
        engine->fontDef.pointSize = qreal(double((engine->fontDef.pixelSize * 72) / fp->dpi));
    } else {
        engine->fontDef.pointSize = request.pointSize;
    }
    return engine;
}
예제 #9
0
void ChessScript::doLoadEngine(bool isFirst, QString filename)
{
    emit loadEngine(isFirst, filename);
    yield.wait(&mtx);
}
예제 #10
0
void TcDatabase::loadEngine()
{
    loadEngine(m_engineFile);
}