Example #1
0
bool QuartzHandler::reset(unsigned long changed)
{
    quartz_initialized = false;
    freePixmaps();
    readConfig();
    createPixmaps();
    quartz_initialized = true;

    // Do we need to "hit the wooden hammer" ?
    bool needHardReset = true;
    if(changed & SettingColors)
    {
        needHardReset = false;
    }
    else if(changed & SettingButtons)
    {
        // handled by KCommonDecoration
        needHardReset = false;
    }

    if(needHardReset)
    {
        return true;
    }
    else
    {
        resetDecorations(changed);
        return false;
    }
    return true;
}
Example #2
0
QuartzHandler::QuartzHandler()
{
    quartz_initialized = false;
    readConfig();
    createPixmaps();
    quartz_initialized = true;
}
Example #3
0
Pixmap PixmapCycler::next()
{
    // The first time, call the createPixmaps() function 
    // implemented by the derived class to create the pixmaps
    
    if ( _current == INVALID )
    {
	createPixmaps();
	_current = 0;    // Initialize to the first pixmap
    }
    
    // If the counter is larger than the index of the 
    // last pixmap, roll it over and restart with zero
    
    if ( _current >= _numPixmaps )
	_current = 0;
    
    // Return the current pixmap and increment the counter
    
    return _pixmapList[_current++];
}
Example #4
0
void Waveform::initialize(const QAudioFormat &format, qint64 audioBufferSize, qint64 windowDurationUs)
{
    WAVEFORM_DEBUG << "Waveform::initialize"
                   << "audioBufferSize" << audioBufferSize
                   << "windowDurationUs" << windowDurationUs;

    reset();

    m_format = format;

    // Calculate tile size
    m_tileLength = audioBufferSize;

    // Calculate window size
    m_windowLength = audioLength(m_format, windowDurationUs);

    // Calculate number of tiles required
    int nTiles;
    if (m_tileLength > m_windowLength) {
        nTiles = 2;
    } else {
        nTiles = m_windowLength / m_tileLength + 1;
        if (m_windowLength % m_tileLength)
            ++nTiles;
    }

    WAVEFORM_DEBUG << "Waveform::initialize"
                   << "tileLength" << m_tileLength
                   << "windowLength" << m_windowLength
                   << "nTiles" << nTiles;

    m_pixmaps.fill(0, nTiles);
    m_tiles.resize(nTiles);

    createPixmaps(rect().size());

    m_active = true;
}
Example #5
0
void Waveform::resizeEvent(QResizeEvent *event)
{
    if (event->size() != event->oldSize())
        createPixmaps(event->size());
}