示例#1
0
int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    app.setOrganizationName("Innovators");
    app.setApplicationName("TrollEdit");
    app.setStartDragDistance(app.startDragDistance() * 2);

    // set splashScreen
    QPixmap pixmap(":/splash");
    QSplashScreen splashScreen(pixmap,Qt::WindowStaysOnTopHint);

    // find the directory of the program
    QFileInfo program(argv[0]);
    QString path = QApplication::applicationDirPath();

    MainWindow w(path);
    w.setWindowOpacity(0);

    // Load config from config_app.lua
    lua_State *L = w.getLuaState();
    luaL_openlibs(L);
    int width, height; QString style;
    QDir dir = QDir(path + CONFIG_DIR);
    //QFileInfoList configs = dir.entryInfoList(QStringList("*.lua"), QDir::Files | QDir::NoSymLinks);
    QFileInfo configFile(dir.absolutePath()+ QDir::separator() + "config_app.lua");

    window = reinterpret_cast<MainWindow*>(&w);
    lua_register(L, "setstyle", setstyle);
    loadConfig(L, qPrintable(configFile.absoluteFilePath()), &width, &height, &style);

    qDebug() << configFile.absoluteFilePath() << "width: " << width << " height: " << height << "\n style: " << style;
    //window size
    w.resize(width, height);
    
    //CSS style
    //w.setStyleSheet(style);

    //w.setStyleSheet();
    splashScreen.show();
 
    w.setWindowIcon (QIcon(":/icon16"));
    w.show();

    QTimer::singleShot(2000, &splashScreen, SLOT(close()));
    QTimer::singleShot(1000, &w, SLOT(wInit()));
    // open all files given as parameters

    //    w.newFile();
    //    w.open("../input/in.c"); // TEMP
    
    // open all files given as parameters
    for (int i = 1; i < argc; i++)
        w.open(argv[i]);

    return app.exec();
}
示例#2
0
文件: spkitest1.c 项目: d11/MCECTL
int main()
{
  wPDS *pds;
  wFA *fa, *fa_pre;
  wPath *p;
  wSemiring sr = { &nullfn,&nullfn,NULL,&null,&null,NULL,&eqfn,NULL,NULL };
		/* extend, combine, diff, one, zero, q-one, eq, ref, deref */
  wSemiring *s = &sr;
  wIdent k_x,k_h,k_aids,k_im,k_alice;
  wIdent y_patient, y_square, y_bsquare;
  wIdent final_state;

  wInit();

  k_x = wIdentCreate("KX");
  k_h = wIdentCreate("KH");
  k_aids = wIdentCreate("KH-AIDS");
  k_im = wIdentCreate("KH-IM");
  k_alice = wIdentCreate("Alice");

  y_patient = wIdentCreate("patient");
  y_square = wIdentCreate("square");
  y_bsquare = wIdentCreate("b_square");

  final_state = wIdentCreate("__accepting_state__");

  pds = wPDSCreate(s);

  wPDSInsert(pds, k_x, y_square, k_h, y_patient, y_bsquare, NULL);
  wPDSInsert(pds, k_h, y_patient, k_im, y_patient, 0, NULL);
  wPDSInsert(pds, k_h, y_patient, k_aids, y_patient, 0, NULL);
  wPDSInsert(pds, k_im, y_patient, k_alice, 0, 0, NULL);
  wPDSInsert(pds, k_aids, y_patient, k_alice, 0, 0, NULL);

  fa = wFACreate(s);
  wFAInsert(fa,k_alice, y_square , final_state, NULL, NULL);
  wFAInsert(fa,k_alice, y_bsquare , final_state, NULL, NULL);

  print_automaton(fa,"before");
  fa_pre = wPrestar(pds,fa,TRACE_YES);
  print_automaton(fa_pre,"after");

  printf("trace example:\n");
  p = wPathCreate(fa_pre,wFAFind(fa_pre,k_x,y_square,final_state),NULL);
  print_trace(fa_pre,p);

  wPDSDelete(pds);
  wFADelete(fa);
  wFADelete(fa_pre);
  wFinish();

  return 0;
} /** end of main **/
示例#3
0
文件: main.cpp 项目: brathm/TrollEdit
int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    app.setOrganizationName("Innovators");
    app.setApplicationName("TrollEdit");
    app.setStartDragDistance(app.startDragDistance() * 2);

    // set splashScreen
    QPixmap pixmap(":/splash");
    QSplashScreen splashScreen(pixmap,Qt::WindowStaysOnTopHint);

    // find the directory of the program
    QFileInfo program(argv[0]);
    QString path = QApplication::applicationDirPath();

    MainWindow w(path);

    w.setWindowOpacity(0);

    splashScreen.show();
 
    w.setWindowIcon (QIcon(":/icon16"));
    w.show();

    QTimer::singleShot(2000, &splashScreen, SLOT(close()));
    QTimer::singleShot(1000, &w, SLOT(wInit()));
    // open all files given as parameters

    //    w.newFile();
    //    w.open("../input/in.c"); // TEMP
    
    // open all files given as parameters
    for (int i = 1; i < argc; i++)
        w.open(argv[i]);

    return app.exec();
}