static ReturnType 
 callTrampoline (TAR& obj, TOOL& tool)
   {
     // cast down to real implementation type
     CHECK (INSTANCEOF (TOOLImpl, &tool));
     TOOLImpl& toolObj = static_cast<TOOLImpl&> (tool);
     
     // trigger (compile time) overload resolution
     // based on concrete type, then dispatch the call.
     // Note this may cause obj to be upcasted.
     return toolObj.treat (obj);
   }
示例#2
0
void ScheduleDialog::initTimingWidget()
{
    graph_ = new BlockGraph(project_);
    blocks_ = graph_->blocks();

    // remove all MuxModel nodes from list
    QValueList<BlockNode*>::Iterator it;
    for (it = blocks_.begin(); it != blocks_.end(); ++it) {
        if (INSTANCEOF((*it)->model(), MuxModel)) {
            it = blocks_.remove(it);
        }
    }

    timingTable = new QTable(0, 4, topWidget, "timingWidget");
    timingTable->horizontalHeader()->setLabel(0, tr( "Block" ));
    timingTable->horizontalHeader()->setLabel(1, tr( "Runtime" ));
    timingTable->horizontalHeader()->setLabel(2, tr( "Clock" ));
    timingTable->horizontalHeader()->setLabel(3, tr( "Offset" ));

    timingTable->setSelectionMode(QTable::SingleRow);
    timingTable->setReadOnly(false);
    timingTable->setFocusStyle(QTable::FollowStyle);
    timingTable->setRowMovingEnabled(false);

    connect(timingTable, SIGNAL(valueChanged(int, int)),
            this, SLOT(modelChanged(int,int)));

    for (it = blocks_.begin(); it != blocks_.end(); ++it) {
        fillTimingTable(*it);
    }

    topLayout->addWidget(timingTable);

    rightWidget_ = new QWidget(topWidget);
    rightLayout_ = new QVBoxLayout(rightWidget_);
    topLayout->addWidget(rightWidget_);

    QPushButton *upPushButton_
        = new PixmapButton(QPixmap(Util::findIcon("1uparrow.png")),
                           rightWidget_);
    connect(upPushButton_, SIGNAL(clicked()), this, SLOT(moveRowUp()));

    QPushButton *downPushButton_
        = new PixmapButton(QPixmap(Util::findIcon("1downarrow.png")),
                          rightWidget_);
    connect(downPushButton_, SIGNAL(clicked()), this, SLOT(moveRowDown()));

    rightLayout_->addStretch(1);
    rightLayout_->addWidget(upPushButton_);
    rightLayout_->addWidget(downPushButton_);
    rightLayout_->addStretch(1);
}
示例#3
0
int FontManager::addFont(std::string fontName, int defaultSize ) {
    TTF_Font *f = 0;
    std::string *fullFile = 0;
    fullFile = INSTANCEOF(FileManager).searchFile(fontName);

    if (fullFile != 0) {
        f = TTF_OpenFont(fullFile->c_str(),defaultSize);
        delete fullFile;

        if (f != 0) {
            fonts->push_back(f);
            return fonts->size()-1;
        }
    }

    delete fullFile;

    return -1;

}
示例#4
0
void LibraryWindow::selectionChanged(QListViewItem *item)
{
    // enable change type menu only for library items
    popupMenu_->setItemEnabled(1, INSTANCEOF(item,LibraryListViewItem));
}