コード例 #1
0
ファイル: CCAcc.cpp プロジェクト: BackupTheBerlios/sems-svn
void CCAcc::invoke(const string& method, const AmArg& args, AmArg& ret)
{
    if(method == "getCredit"){
      assertArgCStr(args.get(0));
      ret.push(getCredit(args.get(0).asCStr()));
    } else if(method == "subtractCredit"){
      assertArgCStr(args.get(0));
      assertArgInt(args.get(1));
      ret.push(subtractCredit(args.get(0).asCStr(),
			      args.get(1).asInt()));	
    } else if(method == "addCredit"){
      assertArgCStr(args.get(0));
      assertArgInt(args.get(1));
      ret.push(addCredit(args.get(0).asCStr(),
			 args.get(1).asInt()));	
    } else if(method == "setCredit"){
      assertArgCStr(args.get(0));
      assertArgInt(args.get(1));
      ret.push(setCredit(args.get(0).asCStr(),
			 args.get(1).asInt()));	
    } else if(method == "_list"){
      ret.push("getCredit");
      ret.push("subtractCredit");
      ret.push("setCredit");
      ret.push("addCredit");
    }
    else
	throw AmDynInvoke::NotImplemented(method);
}
コード例 #2
0
ファイル: StateLevel.cpp プロジェクト: Smeky/TestTD
void StateLevel::msgEnemyDied( Message* msg ) {
    Entity entity = getMsgValue<Entity>( msg );

    if( entity ) {
        // Todo: Handle enemy's death
        // Temp: Add enemy-value in credits
        addCredit( 5 );

        ENTITY_MANAGER.delEntity( entity );
    }
}
コード例 #3
0
ファイル: main.cpp プロジェクト: KDE/kronometer
int main (int argc, char **argv)
{
    KLocalizedString::setApplicationDomain("kronometer");

    QApplication app {argc, argv};

    KCrash::initialize();

    auto aboutData = KAboutData {
        QStringLiteral("kronometer"),   // componentName
        i18nc("KAboutData display name", "Kronometer"),
        QStringLiteral(KRONOMETER_VERSION_STRING),
        i18n("Kronometer is a simple stopwatch application"), // shortDescription
        KAboutLicense::GPL_V2,    // licenseType
        i18n("Copyright (C) 2014-2016 Elvis Angelaccio"),    // copyrightStatement
        {},  // otherText
        QStringLiteral("http://aelog.org/kronometer")   // homePageAddress
    };

    aboutData.addAuthor(
        i18n("Elvis Angelaccio"),
        i18n("Maintainer"),
        QStringLiteral("*****@*****.**"),
        QStringLiteral("http://aelog.org")
    );

    aboutData.addCredit(
        i18n("Ken Vermette"),
        i18n("Kronometer icon"),
        QStringLiteral("*****@*****.**")
    );

    KAboutData::setApplicationData(aboutData);

    app.setApplicationName(aboutData.componentName());
    app.setApplicationDisplayName(aboutData.displayName());
    app.setOrganizationDomain(aboutData.organizationDomain());
    app.setApplicationVersion(aboutData.version());
    app.setWindowIcon(QIcon::fromTheme(QStringLiteral("kronometer")));

    // Make sure that the local data directory is available.
    auto appdata = QFileInfo {QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation)};
    if (not appdata.exists()) {
        auto dir = QDir {appdata.absolutePath()};
        dir.mkdir(appdata.fileName());
    }

    auto window = new MainWindow {};
    window->show();

    return app.exec();
}
コード例 #4
0
ファイル: ScreamTx.cpp プロジェクト: francisyyan/scream
/*
* RTP packet transmitted
*/
gfloat ScreamTx::addTransmitted(guint64 time_us,
    guint32 ssrc,
    gint size,
    guint16 seqNr) {
        if (!isInitialized) 
            initialize(time_us);

        int k = 0;
        int ix = -1;
        while (k < kMaxTxPackets) {
            if (txPackets[k].isUsed == FALSE) {
                ix = k;
                break;
            }
            k++;
        }
        if (ix == -1) {
            /*
            * If you end up here then it is necessary to increase
            * kMaxTxPackets
            */
            ix = 0;
            cerr << "Max number of txPackets allocated" << endl;
        }
        txPackets[ix].timestamp = (guint32) (time_us/1000);
        txPackets[ix].timeTx_us = time_us;
        txPackets[ix].ssrc = ssrc;
        txPackets[ix].size = size;
        txPackets[ix].seqNr = seqNr;
        txPackets[ix].isUsed = TRUE;

        Stream* stream = getStream(ssrc);
        stream->bytesTransmitted += size;
        lastTransmitT_us = time_us;
        /*
        * Add credit to unserved streams
        */
        addCredit(time_us, stream, size);
        /*
        * Reduce used credit for served stream
        */
        subtractCredit(time_us, stream, size);
        /*
        * compute paceInterval, we assume a min bw of 50kbps and a min tp of 1ms
        * for stable operation
        * this function implements the packet pacing
        */
        gfloat paceInterval = kMinPaceInterval;
        pacingBitrate = MAX(kMinimumBandwidth,cwnd * 8.0f / MAX(0.001f,getSRtt()));
        gfloat tp = (size * 8.0f) / pacingBitrate;
        if (owdFractionAvg > 0.1f && kEnablePacketPacing) {
            paceInterval = MAX(kMinPaceInterval,tp);
        }
        if (kBypassTxSheduling) {
            paceInterval = 0.0;
        }
        guint64 paceInterval_us = (guint64) (paceInterval*1000000);

        /*
        * Update MSS and cwndMin
        */
        mss = MAX(mss, size);
        cwndMin = 2 * mss;

        /*
        * Determine when next RTP packet can be transmitted
        */
        nextTransmitT_us = time_us + paceInterval_us;

        return paceInterval;
}
コード例 #5
0
KexiAboutData::KexiAboutData()
 : KAboutData(
        "kexi",
        KEXI_APP_NAME,
        Kexi::fullVersionString(),
        xi18n(description),
        KAboutLicense::LGPL_V2,
        xi18n("© 2002-%1, The Kexi Team", QLatin1String(CALLIGRA_YEAR)),
        xi18n("This software is developed by Kexi Team - an international group "
              "of independent developers. They form a part of the Calligra Project."),
        "http://www.calligra.org/kexi",
        "*****@*****.**"
    )
{
    setOrganizationDomain("kde.org"); // right dbus prefix == org.kde.

    // authors sorted by last nontrivial contribution date * size
    addAuthor(
        xi18n("Jarosław Staniek"), xi18n("Project maintainer & developer, overall design"), "*****@*****.**");
    addAuthor(
        xi18n("OpenOffice Polska LLC"), xi18n("Sponsoring and support (employer of Jarosław Staniek in 2003-2007)"), "*****@*****.**");
    addAuthor(
        xi18n("Adam Pigg"), xi18n("PostgreSQL database driver, Migration and Reporting modules, numerous bug fixes"), "*****@*****.**");
    addAuthor(
        xi18n("Radosław Wicik"), xi18n("Map elements for forms and reports, map flake shape"), "*****@*****.**");
    addAuthor(
        xi18n("Wojciech Kosowicz"), xi18n("Features and bug fixes"), "*****@*****.**");
    addAuthor(
        xi18n("Roman Shtemberko"), xi18n("Features and bug fixes"), "*****@*****.**");
    addAuthor(
        xi18n("Dimitrios T. Tanis"), xi18n("Users Manual for Kexi 2, main window improvements, numerous bug reports"),  "*****@*****.**");
    addAuthor(
        xi18n("Oleg Kukharchuk"), xi18n("Several form widgets, porting to Qt 4, stabilization"), "*****@*****.**");
    addAuthor(
        xi18n("Shreya Pandit"), xi18n("Web elements for forms and reports"), "*****@*****.**");
    addAuthor(
        xi18n("Sebastian Sauer"), xi18n("Scripting module (KROSS), Python language bindings, design"), "*****@*****.**");
    addAuthor(
        xi18n("Lorenzo Villani"), xi18n("Web Forms module"), "*****@*****.**");
    addAuthor(
        xi18n("Sharan Rao"), xi18n("Sybase/MS SQL Server/ODBC database drivers, xBase migration plugin, improvements for KexiDB"), "*****@*****.**");
    addAuthor(
        xi18n("Cédric Pasteur"), xi18n("First version of Property Editor and Form Designer"), "*****@*****.**");
    addAuthor(
        xi18n("Martin Ellis"), xi18n("Contributions for MySQL and KexiDB, fixes, Migration module, MS Access file format support"), "*****@*****.**");
    addAuthor(
        xi18n("Julia Sanchez-Simon"), xi18n("Oracle database driver"), "*****@*****.**");
    addAuthor(
        xi18n("Christian Nitschkowski"), xi18n("Graphics effects, helper dialogs"), "*****@*****.**");
    addAuthor(
        xi18n("Matt Rogers"), xi18n("ODBC database driver"), "*****@*****.**");
    addAuthor(
        xi18n("Lucijan Busch"), xi18n("Former project maintainer & developer"), "*****@*****.**");
    addAuthor(
        xi18n("Peter Simonsson"), xi18n("Former developer"), "*****@*****.**");
    addAuthor(
        xi18n("Joseph Wenninger"), xi18n("Original Form Designer, original user interface & much more"), "*****@*****.**");
    addAuthor(
        xi18n("Seth Kurzenberg"), xi18n("CQL++, SQL assistance"),  "*****@*****.**");
    addAuthor(
        xi18n("Laurent Montel"), xi18n("Original code cleanings"), "*****@*****.**");
    addAuthor(
        xi18n("Till Busch"), xi18n("Bugfixes, original Table Widget"), "*****@*****.**");

    addCredit(
        xi18n("Ian Balchin"), xi18n("Numerous bug reports and tests, handbook improvements"), "*****@*****.**");
    addCredit(
        xi18n("Robert Leleu"), xi18n("Numerous bug reports and tests"), "*****@*****.**");
    addCredit(
        xi18n("Friedrich W. H. Kossebau"), xi18n("Bug fixes, build system improvements, code cleanups"), "*****@*****.**");
    addCredit(
        xi18n("Boudewijn Rempt"), xi18n("Code cleanups"), "*****@*****.**");
    addCredit(
        xi18n("David Faure"), xi18n("Code cleanups"), "*****@*****.**");
    addCredit(
        xi18n("Daniel Molkentin"), xi18n("Initial design improvements"),  "*****@*****.**");
    addCredit(
        xi18n("Kristof Borrey"), xi18n("Icons and user interface research"), "*****@*****.**");
    addCredit(
        xi18n("Tomas Krassnig"), xi18n("Coffee sponsoring"), "*****@*****.**");
    addCredit(
        xi18n("Paweł Wirecki / OpenOffice Polska"), xi18n("Numerous bug reports, usability tests, technical support"));

    setTranslator(
        xi18nc("NAME OF TRANSLATORS", "Your names"), xi18nc("EMAIL OF TRANSLATORS", "Your emails"));
}