Ejemplo n.º 1
0
void SkosSerializer::serializeStatemetsToFile(
  const QString &p_fileName,
  const Soprano::RdfSerialization &p_fileType)
{ 
  const Soprano::Serializer* serializer =
    Soprano::PluginManager::instance()->discoverSerializerForSerialization( 
      p_fileType);
  QFile l_outputFile(p_fileName);
  l_outputFile.open(QIODevice::WriteOnly);
  QTextStream l_stream(&l_outputFile);
  Soprano::Model* sopranoModel = Soprano::createModel();
  sopranoModel->addStatements(m_statements);
  serializer->serialize(sopranoModel->listStatements(), 
                        l_stream, 
                        p_fileType);
}
Ejemplo n.º 2
0
bool gui::create(const astring &_name) {
	static ge::screen::info sl_screen;
	m_screen_ID = spawn(sl_screen);
	//
	astring l_file = astring("data/gui/") + _name + ".swf";
	std::fstream l_stream(l_file.data()/*, std::ios_base::in|std::ios_base::binary*/);
	if(l_stream.good()) {
		swf::tagstream l_tags(l_stream);
		if(l_tags.good()) {
			swf::RECORDHEADER l_tag;
			while(true) {
				l_tags >> l_tag;
				if(l_tag.type == swf::tag::End) break;
				l_tags.skip(l_tag.length);
			}
			uint a = 0;
		}
Ejemplo n.º 3
0
void Widget::m_Set_Over()
{
    if (m_score_num > m_record_num)
    {
        m_record_num = m_score_num;
        QFile l_file("Config.txt");
        if (l_file.open(QIODevice::ReadWrite))
        {
            l_file.resize(0);
            QTextStream l_stream(&l_file);
            l_stream<<m_record_num;
            l_file.close();
            m_Set_Label_Content();
        }
    }
    if (m_timer.isActive())
        m_timer.stop();
}
Ejemplo n.º 4
0
void Widget::m_Layout_Right_Frame()
{
    m_record_num = 0;
    m_score_num = 0;
    m_spd_num = 0;
    m_time_num = 0;
    //Read Config
    QFile l_file("Config.txt");
    if (l_file.open(QIODevice::ReadWrite))
    {
        QTextStream l_stream(&l_file);
        m_record_num = l_stream.readLine().toInt();
        l_file.close();
    }
    m_record = new QLabel();
    m_score = new QLabel();
    m_sped = new QLabel();
    m_time = new QLabel();
    //Set Label Content
    m_Set_Label_Content();

    //Layout All the Labels
    QVBoxLayout *l_layout = new QVBoxLayout();
    l_layout->addWidget(m_record);
    l_layout->addWidget(m_score);
    l_layout->addWidget(m_sped);
    l_layout->addWidget(m_time);
    l_layout->addWidget(new QLabel("W: Up"));
    l_layout->addWidget(new QLabel("S: Down"));
    l_layout->addWidget(new QLabel("A: Left"));
    l_layout->addWidget(new QLabel("D: Right"));
    l_layout->addWidget(new QLabel("P: Pause/Start"));
    l_layout->addWidget(new QLabel("R: Replay"));
    l_layout->setMargin(5);
    l_layout->setSpacing(20);
    m_right_frame.setLayout(l_layout);
    QPalette l_palette = m_right_frame.palette();
    m_right_frame.setAutoFillBackground(true);
    l_palette.setColor(QPalette::Window, QColor(48, 100, 100));
    l_palette.setColor(QPalette::WindowText, QColor(0, 0, 0, 200));
    m_right_frame.setPalette(l_palette);
    m_right_frame.setFixedSize(100, 500);
}
Ejemplo n.º 5
0
void Widget::m_Set_Start()
{
    if (m_score_num > m_record_num)
    {
        m_record_num = m_score_num;
        QFile l_file("Config.txt");
        if (l_file.open(QIODevice::ReadWrite))
        {
            QTextStream l_stream(&l_file);
            m_record_num = l_stream.readLine().toInt();
            l_file.close();
        }
    }
    m_score_num = 0;
    m_spd_num = 0;
    m_time_num = 0;
    if (!m_timer.isActive())
        m_timer.start(1000);
}