LatvianAlphabet::LatvianAlphabet() { addSymbol(AA_macron); addSymbol(a_macron); addSymbol(CC_inv_roof); addSymbol(c_inv_roof); addSymbol(EE_macron); addSymbol(e_macron); addSymbol(GG_bottom_accent); addSymbol(LATVIAN_g); addSymbol(II_macron); addSymbol(i_macron); addSymbol(KK_bottom_accent); addSymbol(k_bottom_accent); addSymbol(LL_bottom_accent); addSymbol(l_bottom_accent); addSymbol(NN_bottom_accent); addSymbol(n_bottom_accent); addSymbol(SS_inv_roof_baltic); addSymbol(s_inv_roof_baltic); addSymbol(UU_macron); addSymbol(u_macron); addSymbol(ZZ_inv_roof_baltic); addSymbol(z_inv_roof_baltic); removeSymbol('Q'); removeSymbol('q'); removeSymbol('W'); removeSymbol('w'); removeSymbol('X'); removeSymbol('x'); removeSymbol('Y'); removeSymbol('y'); }
//------------------------------------------------------------------------------ // Clears all symbols from our master symbol table //------------------------------------------------------------------------------ bool SymbolLoader::clearLoader() { bool ok = false; for (int idx = 1; idx <= MAX_SYMBOLS; idx++) { removeSymbol(idx); } return ok; }
void MusicBar::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) { if(m_cursor == 0){ return; } if(m_cursorIdx != -1){ removeSymbol(m_cursorIdx); updateLayout(); m_cursorIdx = -1; m_insertSymbol->setVisible(false); m_stemDrawer->update(m_stemDrawer->boundingRect()); } m_symbolLayout->setGeometry(m_rect); }
void MusicBar::setInsertSymbolFromCursor() { /*! @todo There has to be something to get all Embellishments, or else * this code has to be modified for every new Embellishmet */ int t_insSymType = 0; if(m_insertSymbol != 0){ t_insSymType = m_insertSymbol->type(); } if(m_cursor != 0){ int type = m_cursor->type(); switch(type){ case MelodyNoteType: { const MelodyNote *note = qgraphicsitem_cast<const MelodyNote *>(m_cursor); m_insertSymbol = new MelodyNote(note->pitchList(), note->pen(), note->pitch(), note->length()->length()); m_insertSymbol->setVisible(true); break; } case DoublingType: { const Doubling *dbl = qgraphicsitem_cast<const Doubling *>(m_cursor); m_insertSymbol = new Doubling(dbl->pitchList(), dbl->pen()); break; } case SingleGraceType: { const SingleGrace *grace = qgraphicsitem_cast<const SingleGrace *>(m_cursor); m_insertSymbol = new SingleGrace(grace->pitchList(), grace->pen()); break; } case GripType: { const Grip *grip = qgraphicsitem_cast<const Grip *>(m_cursor); m_insertSymbol = new Grip(grip->pitchList(), grip->pen()); } } m_insertSymbol->setHovermode(true); m_insertSymbol->setFlags(QGraphicsItem::ItemIsFocusable); m_insertSymbol->setFocus(Qt::MouseFocusReason); } else { if(m_cursorIdx != -1){ removeSymbol(m_cursorIdx); updateLayout(); m_cursorIdx = -1; m_stemDrawer->update(m_stemDrawer->boundingRect()); } if(m_insertSymbol != 0){ delete m_insertSymbol; m_insertSymbol = 0; } } }
void ModuleLinkerPass::deleteAllSymbolsExceptThese( const StringVector& symbolsToKeep) { StringSet keptSymbols(symbolsToKeep.begin(), symbolsToKeep.end()); auto symbols = getAllSymbols(_linkedModule); for(auto symbol = symbols.begin(); symbol != symbols.end(); ++symbol) { if(keptSymbols.count(*symbol) != 0) continue; removeSymbol(_linkedModule, *symbol); } }
BulgarAlphabet::BulgarAlphabet() { // В Болгарском нет трех русских букв removeSymbol(r_EE_2dot); removeSymbol(r_e_2dot); removeSymbol(0xDB); // Ы in cp1251 removeSymbol(0xFB); // ы removeSymbol(0xDD); // Э in cp1251 removeSymbol(0xFD); // э }
void Diamond::initialize( InstanceIDPool &symbolIdPool ) { if( line.valid() ) { removeSymbol( line.get() ); line = NULL; } int symbolID = symbolIdPool.getAvailableID(); if( symbolID > 0xffff ) { std::cerr << "In Diamond::initialize - no more available symbol IDs\n"; symbolIdPool.relenquishID( symbolID ); return; } line = new SymbolLine; line->addImplementation( new SerializableSymbolLine( line.get(), outgoingMessage ) ); line->setID( symbolID ); line->setState( Symbol::Visible ); line->setSurfaceID( SURFACE_ID ); line->setColor( Vect4( 0.5, 0.7, 1.0, 1.0 ) ); line->setFlashDutyCyclePercentage( 100 ); line->setPosition( randFloat( SURFACE_MIN_U, SURFACE_MAX_U ), randFloat( SURFACE_MIN_V, SURFACE_MAX_V ) ); // line->setRotation( randFloat( 0.0, 360.0 ) ); line->setRotation( 0.0 ); line->setPrimitiveType( SymbolLine::LineLoop ); /* line->addVertex( -0.07, 0.0 ); line->addVertex( 0.0, -0.04 ); line->addVertex( 0.07, 0.0 ); line->addVertex( 0.0, 0.04 );*/ line->addVertex( -0.05, 0.0 ); line->addVertex( 0.0, -0.05 ); line->addVertex( 0.05, 0.0 ); line->addVertex( 0.0, 0.05 ); addSymbol( line.get() ); velocity.Set( randFloat( -1.0, 1.0 ), randFloat( -1.0, 1.0 ) ); rotationalVelocity = randFloat( -90.0, 90.0 ); }
void MusicBar::keyPressEvent(QKeyEvent *event) { //qDebug() << "MusicBar Key press event"; if(event->key() == Qt::Key_Delete){ for(int i=0; i<m_symbols.size(); i++){ Symbol *t_sym = m_symbols.at(i); if(t_sym->hasFocus()){ removeSymbol(i); delete t_sym; } } updateLayout(); } else { event->ignore(); } }
void MusicBar::hoverMoveEvent(QGraphicsSceneHoverEvent *event) { if(m_cursor == 0){ return; } if(!spaceForSymbol(m_insertSymbol)){ return; } if(m_insertSymbol->hasPitch()){ m_insertSymbol->setPitch(m_pitchList->pitchForPos(event->pos().y())); m_insertSymbol->update(); m_stemDrawer->updateStems(); } QGraphicsLayoutItem *t_item = 0; for(int i=0; i<m_symbolLayout->count(); i++) { t_item = m_symbolLayout->itemAt(i); if((t_item->geometry().x() <= event->pos().x()) && (event->pos().x() <= t_item->geometry().x()+ t_item->geometry().width()) ){ if(m_cursorIdx == -1){ //no gap yet m_cursorIdx = i; insert(i, m_insertSymbol); } else { //gap already there ... if(i != m_cursorIdx){ removeSymbol(m_cursorIdx); m_insertSymbol->disconnect(); insert(i, m_insertSymbol); m_cursorIdx = i; update(m_rect); } } } } //Symbols in bar, no insert symbol is shown and cursor ahead of last symbol if(m_symbols.count() != 0 && m_cursorIdx == -1 && m_symbols.last()->geometry().right() <= event->pos().x()){ insert(m_symbols.count(), m_insertSymbol); m_cursorIdx = m_symbols.count()-1; } }
void QgsStyleManagerDialog::removeItem() { bool changed = false; if ( currentItemType() < 3 ) { changed = removeSymbol(); } else if ( currentItemType() == 3 ) { changed = removeColorRamp(); } else { Q_ASSERT( 0 && "not implemented" ); } if ( changed ) { populateList(); populateTypes(); } }
TurkishAlphabet::TurkishAlphabet() { // Турецкие лиги, отличные от западноевропейских addSymbol(liga_TM_turkish); addSymbol(liga_CC_turkish); addSymbol(liga_CR_turkish); addSymbol(liga_bull_turkish); // Турецкие буквы, отличные от западноевропейских addSymbol(GG_semicircle); addSymbol(g_semicircle); addSymbol(II_dot_accent); addSymbol(i_sans_accent); addSymbol(SS_bottom_accent_turkish); addSymbol(s_bottom_accent_turkish); removeSymbol('Q'); removeSymbol('q'); removeSymbol('W'); removeSymbol('w'); removeSymbol('X'); removeSymbol('x'); }
int main() { symbolEntry head, entry1, entry2, entry3; strcpy(head.name,"func0"); strcpy(entry1.name, "func1"); strcpy(entry2.name, "func2"); strcpy(entry3.name, "func3"); head.type = 'T'; entry1.type = 'U'; entry2.type = 'D'; entry3.type = 't'; head.next = NULL; entry1.next = NULL; entry2.next = NULL; entry3.next = NULL; symbolEntry *pHead = &head; symbolEntry *pEntry1 = &entry1; symbolEntry *pEntry2 = &entry2; symbolEntry *pEntry3 = &entry3; //printf("count before add: %d\n", size); append(pEntry1, pHead); int sizeBeforeContains = count(pHead); printf("count before contains: %d\n", sizeBeforeContains); if (contains2("func1", pHead)) { printf("contains test 1 pass\n"); printf("count after test 1 pass: %d\n", count(pHead)); } else { printf("contains test 1 fail\n"); printf("count after test 1 fail: %d\n", count(pHead)); } append(pEntry2, pHead); if (contains("func2", pHead)){ printf("contains test 2 pass\n"); printf("count after test 2 pass: %d\n", count(pHead)); } else { printf("contains test 2 fail\n"); printf("count after test 2 fail: %d\n", count(pHead)); } if (!contains("hello", pHead)) { printf("contains test for non-contained item passed\n"); printf("count after contains test for non-contained item passed: %d\n", count(pHead)); } else { printf("contains test for non-contained item fail\n"); printf("count after test for non-contained item fail: %d\n", count(pHead)); } char theType = getSymbolType(entry2.name, pHead); if (theType == 'D') { printf("Get Symbol Type test 1 passed\n"); } else { printf("Get Symbol Type test 1 failed\n"); } char newType = 'T'; updateSymbolType(entry2.name, pHead, newType); if (entry2.type == 'T') { printf("Update Symbol Type test 1 pass\n"); } else { printf("update Symbol Type test 1 failed\n"); } char def = getSymbolType(entry2.name, pHead); if (def == 'T') { printf("Get Symbol Type test 2 passed\n"); } else { printf("Get Symbol Type test 2 failed\n"); } printf("print list test: \n"); printf("-----------------------\n"); printList(pHead); printf("Count before remove: %d\n", count(pHead)); printf("removing symbol foo()...\n"); removeSymbol(pEntry2, pHead); int newCount = count(pHead); printf("count after remove: %d\n", newCount); printf("list after remove: \n"); printf("-------------------------\n"); printList(pHead); return 0; }
void Pinwheel::initialize( InstanceIDPool &symbolIdPool ) { if( line.valid() ) { removeSymbol( line.get() ); line = NULL; } int symbolID = symbolIdPool.getAvailableID(); if( symbolID > 0xffff ) { std::cerr << "In Pinwheel::initialize - no more available symbol IDs\n"; symbolIdPool.relenquishID( symbolID ); return; } int childSymbolID = symbolIdPool.getAvailableID(); if( childSymbolID > 0xffff ) { std::cerr << "In Pinwheel::initialize - no more available symbol IDs\n"; symbolIdPool.relenquishID( childSymbolID ); return; } line = new SymbolLine; line->addImplementation( new SerializableSymbolLine( line.get(), outgoingMessage ) ); line->setID( symbolID ); line->setState( Symbol::Visible ); line->setSurfaceID( SURFACE_ID ); line->setColor( Vect4( 0.8, 0.0, 1.0, 1.0 ) ); line->setFlashDutyCyclePercentage( 100 ); line->setPosition( randFloat( SURFACE_MIN_U, SURFACE_MAX_U ), randFloat( SURFACE_MIN_V, SURFACE_MAX_V ) ); line->setRotation( randFloat( 0.0, 360.0 ) ); line->setPrimitiveType( SymbolLine::LineLoop ); line->addVertex( 0.05, -0.05 ); line->addVertex( 0.0, -0.05 ); line->addVertex( 0.0, 0.05 ); line->addVertex( -0.05, 0.05 ); SymbolLine *childLine = new SymbolLine; childLine->addImplementation( new SerializableSymbolLine( childLine, outgoingMessage ) ); childLine->setID( childSymbolID ); childLine->setState( Symbol::Visible ); childLine->setSurfaceID( SURFACE_ID ); childLine->setInheritColor( true ); childLine->setFlashDutyCyclePercentage( 100 ); childLine->setPosition( 0, 0 ); childLine->setRotation( 90 ); childLine->setPrimitiveType( SymbolLine::LineLoop ); childLine->addVertex( 0.05, -0.05 ); childLine->addVertex( 0.0, -0.05 ); childLine->addVertex( 0.0, 0.05 ); childLine->addVertex( -0.05, 0.05 ); childLine->setParent( true, symbolID, line.get() ); line->addSymbol( childLine ); addSymbol( line.get() ); velocity.Set( randFloat( -1.0, 1.0 ), randFloat( -1.0, 1.0 ) ); // clockwise versus counter-clockwise if( randBool() ) { rotationalVelocity *= -1.0f; line->setScale( -1.0f, 1.0f ); } }