本文整理汇总了C++中KWindowInfo::visibleIconNameWithState方法的典型用法代码示例。如果您正苦于以下问题:C++ KWindowInfo::visibleIconNameWithState方法的具体用法?C++ KWindowInfo::visibleIconNameWithState怎么用?C++ KWindowInfo::visibleIconNameWithState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KWindowInfo
的用法示例。
在下文中一共展示了KWindowInfo::visibleIconNameWithState方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
//-----------------------------------------------------------------------------
// Get all the tasks
//FIXME
QList<WId> daisy::getAllTasks()
{
m_activetasks.clear();m_attentionwindow.clear();showedTasks.clear();
QList<WId> taskDict = KWindowSystem::windows();
m_activewindow = -1;m_startingwindow = -1;m_closingwindow = -1;
Plasma::ToolTipContent toolTipData;toolTipData.setAutohide(false);
QString str;QString widclass_tmp;total_taskpreviews=0;
//THUMBNAILS
if ( m_taskpreviews && m_type == QString("standard_dock") )
{
for (int i = 0; i < m_max_taskpreviews; ++i)
{m_taskicons[i]->setGeometry( QRect(-10000, -10000, 0, 0) );}
}
if (m_showtooltips_l)clearToolTipContent();
QList<WId>::ConstIterator it;
for (it = taskDict.begin(); it != taskDict.end(); ++it )
{
KWindowInfo taskInfo = KWindowSystem::windowInfo( *it, NET::WMName | NET::WMVisibleName | NET::WMVisibleIconName | NET::WMState | NET::XAWMState | NET::WMDesktop | NET::WMWindowType, NET::WM2WindowClass );
TaskPtr task_tmp = TaskManager::TaskManager::self()->findTask( *it );
if ( task_tmp && *it == KWindowSystem::activeWindow() )
{m_focusedWindow = *it;}
//THUMBNAILS
if ( m_taskpreviews && m_type == QString("standard_dock") && task_tmp )
{
if ( !m_showtaskoflauncher && ( m_alias.indexOf( taskInfo.windowClassName() ) != -1 || m_alias.indexOf( QString(taskInfo.windowClassClass().toLower()) ) != -1 ) )
{}
else if ( total_taskpreviews<m_max_taskpreviews )
{
createTaskThumbnail(task_tmp, total_taskpreviews);
total_taskpreviews++;
showedTasks << *it;
}
}
if ( m_alias.indexOf( taskInfo.windowClassName() ) != -1 || m_alias.indexOf( QString(taskInfo.windowClassClass().toLower()) ) != -1 )
{
if ( m_alias.indexOf( taskInfo.windowClassName() ) != -1 )
widclass_tmp = QString( taskInfo.windowClassName() );
else
widclass_tmp = QString(taskInfo.windowClassClass().toLower());
//ATTENTION
checkAttention( taskInfo, widclass_tmp );
m_activetasks << m_alias.indexOf( widclass_tmp );
if ( *it == KWindowSystem::activeWindow() )
m_activewindow = m_alias.indexOf( widclass_tmp );
//TOLLTIPS
if (m_showtooltips_l)
{
str.clear();QString desk_name = KWindowSystem::desktopName( taskInfo.desktop() );
int win_count = m_activetasks.count( m_alias.indexOf( widclass_tmp ) );
if ( win_count == 1 )
{
if (taskInfo.desktop() != -1)
{str.append( desk_name );str.insert( 0, i18n("On ") );}
else str.insert( 0, i18n("On all desktops") );
toolTipData.setMainText( taskInfo.visibleIconNameWithState() );
toolTipData.setSubText( str );
}
else
{
str.setNum( win_count );str.append( i18n(" instances") );
toolTipData.setMainText( widclass_tmp );
toolTipData.setSubText( str );
}
if ( m_tiptype == "thumbnail" )
{
#if (KDE_VERSION_MINOR < 3)
toolTipData.setWindowToPreview(*it);
#else
toolTipData.setWindowsToPreview( matchAllTasks( widclass_tmp, 4 ) );
#endif
}
if ( m_tiptype == "thumbnail" || m_tiptype == "icon" )
//.........这里部分代码省略.........
示例2: windowChanged
//-----------------------------------------------------------------------------
// Window changed
//FIXME Signal is emited 4 times?
void daisy::windowChanged(WId id, const unsigned long* properties )
{
QString widclass_tmp;
Plasma::ToolTipContent toolTipData;toolTipData.setAutohide(false);
KWindowInfo taskInfo = KWindowSystem::windowInfo( id, NET::WMName | NET::WMVisibleName | NET::WMVisibleIconName | NET::WMState | NET::XAWMState | NET::WMDesktop, NET::WM2WindowClass );
TaskPtr task_tmp = TaskManager::TaskManager::self()->findTask( id );
if ( m_alias.indexOf( taskInfo.windowClassName() ) != -1 || m_alias.indexOf( QString(taskInfo.windowClassClass().toLower()) ) != -1 )
{
if ( m_alias.indexOf( taskInfo.windowClassName() ) != -1 )
{widclass_tmp = QString( taskInfo.windowClassName() );}
else
{widclass_tmp = QString(taskInfo.windowClassClass().toLower());}
//ATTENTION
checkAttention( taskInfo, widclass_tmp );
if (m_showtooltips_l)
{
int win_count = m_activetasks.count( m_alias.indexOf( widclass_tmp ) );
QString str;QString desk_name = KWindowSystem::desktopName( taskInfo.desktop() );
if ( win_count == 1 )
{
if (taskInfo.desktop() != -1)
{str.append( desk_name );str.insert( 0, i18n("On ") );}
else str.insert( 0, i18n("On all desktops") );
toolTipData.setMainText( taskInfo.visibleIconNameWithState() );
toolTipData.setSubText( str );
}
else
{
str.setNum( win_count );str.append( i18n(" instances") );
toolTipData.setMainText( widclass_tmp );
toolTipData.setSubText( str );
}
if ( m_tiptype == "thumbnail" )
{
#if (KDE_VERSION_MINOR < 3)
toolTipData.setWindowToPreview(id);
#else
toolTipData.setWindowsToPreview( matchAllTasks( widclass_tmp, 4 ) );
#endif
}
if ( m_tiptype == "thumbnail" || m_tiptype == "icon" )
toolTipData.setImage( task_tmp->icon(32, 32, true) );
Plasma::ToolTipManager::self()->setContent(m_widgets[m_alias.indexOf( widclass_tmp )], toolTipData);
}
if ( m_taskpreviews && m_type == QString("standard_dock") && showedTasks.indexOf( id )!=-1 )
{
if (m_showtooltips_l && task_tmp)
{Plasma::ToolTipManager::self()->setContent(m_taskicons[showedTasks.indexOf( id )], toolTipData);}
if(properties[ NETWinInfo::PROTOCOLS ] & NET::WMIcon)
{
m_uti_tmr->stop();
m_toupwid = id;
m_uti_tmr->start();
}
}
}
}