本文整理汇总了C++中kwin::WindowInfo::win方法的典型用法代码示例。如果您正苦于以下问题:C++ WindowInfo::win方法的具体用法?C++ WindowInfo::win怎么用?C++ WindowInfo::win使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kwin::WindowInfo
的用法示例。
在下文中一共展示了WindowInfo::win方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: showAgain
void Window::showAgain() {
mLineEdit->clear();
mView->clear();
updateWindowInfoList();
WindowInfoList::ConstIterator
it = mWindowInfoList.begin(),
end = mWindowInfoList.end();
for (; it!=end; ++it) {
KWin::WindowInfo info = *it;
QListViewItem* item = new QListViewItem(mView, info.visibleName());
QPixmap pix = KWin::icon(info.win(), 16, 16, true);
item->setPixmap(0, pix);
}
if (!mWindowInfoList.empty()) {
mView->setSelected(mView->firstChild(), true);
}
QRect rect = QApplication::desktop()->availableGeometry();
int width = mView->columnWidth(0) + 30;
int height = 300;
move(
rect.left() + (rect.width() - width) / 2,
rect.top() + (rect.height() - height) / 2
);
resize(width, height);
show();
KWin::forceActiveWindow(winId());
}
示例2: switchToWindow
void Window::switchToWindow(QListViewItem* item) {
QString itemName = item->text(0);
WindowInfoList::ConstIterator
it = mWindowInfoList.begin(),
end = mWindowInfoList.end();
for (; it!=end; ++it) {
KWin::WindowInfo info = *it;
if (info.visibleName() == itemName) {
hide();
KWin::forceActiveWindow(info.win());
return;
}
}
}
示例3: mousePressEvent
void Desktop::mousePressEvent( QMouseEvent * ev)
{
bool showWindows= KPagerConfigDialog::m_showWindows;
if (ev->button()==LeftButton){
pressPos = ev->pos();
}
else if ((ev->button()==MidButton)&&(showWindows))
startDrag(ev->pos());
else if (ev->button()==RightButton) {
QPoint pos;
KWin::WindowInfo *info = windowAtPosition(ev->pos(), &pos);
if ( info && showWindows )
pager()->showPopupMenu(info->win(), mapToGlobal(ev->pos()));
else
pager()->showPopupMenu(0, mapToGlobal(ev->pos()));
}
}
示例4: setTargetWindow
void KSysTrayCmd::setTargetWindow( const KWin::WindowInfo &info )
{
disconnect( kwinmodule, SIGNAL(windowAdded(WId)), this, SLOT(windowAdded(WId)) );
connect( kwinmodule, SIGNAL(windowChanged(WId)), SLOT(windowChanged(WId)) );
win = info.win();
KWin::setSystemTrayWindowFor( winId(), win );
refresh();
show();
if ( isVisible )
KWin::activateWindow( win );
else
hideWindow();
// Always on top ?
if (onTop)
{
KWin::setState(win, NET::StaysOnTop);
}
}
示例5: mouseReleaseEvent
void Desktop::mouseReleaseEvent( QMouseEvent *ev )
{
/** Note that mouseReleaseEvent is not called when releasing the mouse
to drop a window in this desktop */
if (ev->button()==LeftButton)
{
bool showWindows= KPagerConfigDialog::m_showWindows;
QPoint pos;
KWin::setCurrentDesktop(m_desk);
if (showWindows)
{
KWin::WindowInfo *info = windowAtPosition(ev->pos(), &pos);
if (info)
{
KWin::forceActiveWindow(info->win());
// if ( static_cast<WindowDrawMode>( KPagerConfigDialog::m_windowDrawMode ) == Pixmap )
// m_windowPixmapsDirty.replace(info->win,true);
}
}
}
}
示例6: init
void KWindowListMenu::init()
{
int i, d;
i = 0;
int nd = twin_module->numberOfDesktops();
int cd = twin_module->currentDesktop();
WId active_window = twin_module->activeWindow();
// Make sure the popup is not too wide, otherwise clicking in the middle of kdesktop
// wouldn't leave any place for the popup, and release would activate some menu entry.
int maxwidth = kapp->desktop()->screenGeometry( this ).width() / 2 - 100;
clear();
map.clear();
int unclutter = insertItem( i18n("Unclutter Windows"),
this, TQT_SLOT( slotUnclutterWindows() ) );
int cascade = insertItem( i18n("Cascade Windows"),
this, TQT_SLOT( slotCascadeWindows() ) );
// if we only have one desktop we won't be showing titles, so put a separator in
if (nd == 1)
{
insertSeparator();
}
TQValueList<KWin::WindowInfo> windows;
for (TQValueList<WId>::ConstIterator it = twin_module->windows().begin();
it != twin_module->windows().end(); ++it) {
windows.append( KWin::windowInfo( *it, NET::WMDesktop ));
}
bool show_all_desktops_group = ( nd > 1 );
for (d = 1; d <= nd + (show_all_desktops_group ? 1 : 0); d++) {
bool on_all_desktops = ( d > nd );
int items = 0;
if (!active_window && d == cd)
setItemChecked(1000 + d, true);
NameSortedInfoList list;
list.setAutoDelete(true);
for (TQValueList<KWin::WindowInfo>::ConstIterator it = windows.begin();
it != windows.end(); ++it) {
if (((*it).desktop() == d) || (on_all_desktops && (*it).onAllDesktops())
|| (!show_all_desktops_group && (*it).onAllDesktops())) {
list.inSort(new KWin::WindowInfo( (*it).win(),
NET::WMVisibleName | NET::WMState | NET::XAWMState | NET::WMWindowType,
NET::WM2GroupLeader | NET::WM2TransientFor ));
}
}
for (KWin::WindowInfo* info = list.first(); info; info = list.next(), ++i)
{
TQString itemText = KStringHandler::cPixelSqueeze(info->visibleNameWithState(), fontMetrics(), maxwidth);
NET::WindowType windowType = info->windowType( NET::NormalMask | NET::DesktopMask
| NET::DockMask | NET::ToolbarMask | NET::MenuMask | NET::DialogMask
| NET::OverrideMask | NET::TopMenuMask | NET::UtilityMask | NET::SplashMask );
if ( (windowType == NET::Normal || windowType == NET::Unknown
|| (windowType == NET::Dialog && standaloneDialog( info, list )))
&& !(info->state() & NET::SkipTaskbar) ) {
TQPixmap pm = KWin::icon(info->win(), 16, 16, true );
items++;
// ok, we have items on this desktop, let's show the title
if ( items == 1 && nd > 1 )
{
if( !on_all_desktops )
insertTitle(twin_module->desktopName( d ), 1000 + d);
else
insertTitle(i18n("On All Desktops"), 2000 );
}
// Avoid creating unwanted accelerators.
itemText.replace('&', TQString::fromLatin1("&&"));
insertItem( pm, itemText, i);
map.insert(i, info->win());
if (info->win() == active_window)
setItemChecked(i, true);
}
}
if (d == cd)
{
setItemEnabled(unclutter, items > 0);
setItemEnabled(cascade, items > 0);
}
}
// no windows?
if (i == 0)
{
if (nd > 1)
{
// because we don't have any titles, nor a separator
insertSeparator();
}
//.........这里部分代码省略.........