RenderController::RenderController( RenderContextPtr renderContext )
    : renderContext_( renderContext )
    , displayGroupRenderer_( new DisplayGroupRenderer( renderContext ))
    , syncQuit_( false )
    , syncDisplayGroup_( boost::make_shared<DisplayGroup>( QSize( )))
    , syncOptions_( boost::make_shared<Options>( ))
{
    syncDisplayGroup_.setCallback( boost::bind(
                                       &DisplayGroupRenderer::setDisplayGroup,
                                       displayGroupRenderer_.get(), _1 ));

    MarkerRenderer& markers = renderContext_->getScene().getMarkersRenderer();
    syncMarkers_.setCallback( boost::bind( &MarkerRenderer::setMarkers,
                                           &markers, _1 ));

    syncOptions_.setCallback( boost::bind( &RenderController::setRenderOptions,
                                          this, _1 ));

    connect( displayGroupRenderer_.get(),
             SIGNAL( windowAdded( QmlWindowPtr )),
             &pixelStreamUpdater_, SLOT( onWindowAdded( QmlWindowPtr )));

    connect( displayGroupRenderer_.get(),
             SIGNAL( windowRemoved( QmlWindowPtr )),
             &pixelStreamUpdater_, SLOT( onWindowRemoved( QmlWindowPtr )));
}
Example #2
0
LxQtTaskGroup::LxQtTaskGroup(const QString &groupName, QIcon icon, ILxQtPanelPlugin * plugin, LxQtTaskBar *parent)
    : LxQtTaskButton(0, parent, parent),
    mGroupName(groupName),
    mPopup(new LxQtGroupPopup(this)),
    mPlugin(plugin),
    mPreventPopup(false)
{
    Q_ASSERT(parent);

    setObjectName(groupName);
    setText(groupName);
    setIcon(icon);

    connect(this, SIGNAL(clicked(bool)), this, SLOT(onClicked(bool)));
    connect(KWindowSystem::self(), SIGNAL(currentDesktopChanged(int)), this, SLOT(onDesktopChanged(int)));
    connect(KWindowSystem::self(), SIGNAL(windowRemoved(WId)), this, SLOT(onWindowRemoved(WId)));
    connect(KWindowSystem::self(), SIGNAL(activeWindowChanged(WId)), this, SLOT(onActiveWindowChanged(WId)));
}
WindowListModel::WindowListModel( WId kdevWinId, QObject* parent):
    QAbstractListModel(parent),
    m_kdevWinId(kdevWinId)
{
    KWindowSystem *kws = KWindowSystem::self();
    
//     QList<WId> winList = kws->windows();
//     
//     QList<WId>::ConstIterator it;
//     QList<WId>::ConstIterator end = KWindowSystem::windows().end();
//     for ( it = KWindowSystem::windows().begin(); it != end; ++it )
//     {
//         KWindowInfo kwi = kws->windowInfo(*it, NET::WMName | NET::WMVisibleName | NET::WMVisibleIconName | NET::WMWindowType);
//         
//         if( kwi.windowType(NET::NormalMask) == NET::Normal ) {
//             m_winList.append( kwi );
// //             qDebug() << "Adding window " << kwi.visibleName() << "(" << kwi.win() << ")";
//         }
//     }
    
    connect( kws, SIGNAL(windowAdded(WId)), this, SLOT(onWindowAdded(WId)));
    connect( kws, SIGNAL(windowRemoved(WId)), this, SLOT(onWindowRemoved(WId)));
    connect( kws, SIGNAL(windowChanged(WId,uint)), this, SLOT(onWindowChanged(WId,uint)) );
}