当前位置: 首页>>代码示例>>C++>>正文


C++ KWindowInfo::geometry方法代码示例

本文整理汇总了C++中KWindowInfo::geometry方法的典型用法代码示例。如果您正苦于以下问题:C++ KWindowInfo::geometry方法的具体用法?C++ KWindowInfo::geometry怎么用?C++ KWindowInfo::geometry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在KWindowInfo的用法示例。


在下文中一共展示了KWindowInfo::geometry方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: mouseMoveEvent

void TitleWidget::mouseMoveEvent(QGraphicsSceneMouseEvent* event)
{
    Plasma::IconWidget::mouseMoveEvent(event);
    if (m_drag && (event->buttons() & Qt::LeftButton))
    {
        WId wid = KWindowSystem::activeWindow();
        if (wid) {
            XUngrabPointer(QX11Info::display(), QX11Info::appTime());
            NETRootInfo rootInfo(QX11Info::display(), NET::WMMoveResize);
            KWindowInfo info = KWindowSystem::windowInfo(wid, NET::WMGeometry);
            int x;
            int y;
            QPointF p = event->screenPos();
            if (p.x() > info.geometry().x() && p.x() < info.geometry().x() + info.geometry().width())
                x = p.x();
            else
                x = info.geometry().x();
            if (p.y() > info.geometry().y() && p.y() < info.geometry().y() + info.geometry().height())
                y = p.y();
            else
                y = info.geometry().y();
            rootInfo.moveResizeRequest( wid, x, y, NET::Move);
        }

    }
}
开发者ID:wengxt,项目名称:yawc,代码行数:26,代码来源:titlewidget.cpp

示例2: KHelpMenu

KlipperPopup::KlipperPopup( History* history )
    : m_dirty( true ),
      m_textForEmptyHistory( i18n( "<empty clipboard>" ) ),
      m_textForNoMatch( i18n( "<no matches>" ) ),
      m_history( history ),
      m_helpMenu( new KHelpMenu( this, Klipper::aboutData(), false ) ),
      m_popupProxy( 0 ),
      m_filterWidget( 0 ),
      m_filterWidgetAction( 0 ),
      m_nHistoryItems( 0 )
{
    KWindowInfo windowInfo = KWindowSystem::windowInfo( winId(), NET::WMGeometry );
    QRect geometry = windowInfo.geometry();
    QRect screen = KGlobalSettings::desktopGeometry(geometry.center());
    int menuHeight = ( screen.height() ) * 3/4;
    int menuWidth = ( screen.width() )  * 1/3;

    m_popupProxy = new PopupProxy( this, menuHeight, menuWidth );

    connect( this, SIGNAL(aboutToShow()), SLOT(slotAboutToShow()) );
}
开发者ID:aarontc,项目名称:kde-workspace,代码行数:21,代码来源:klipperpopup.cpp

示例3: foreach

void
KWD::Decorator::handleWindowAdded (WId id)
{
    QMap <WId, KWD::Window *>::ConstIterator it;
    KWD::Window				     *client = 0;
    WId					     select, frame = 0;
    WId					     oframe = 0, iframe = 0;
    KWD::Window::Type			     type = KWD::Window::Normal;
    QWidgetList				     widgets;
    QRect                                    geometry;

    /* avoid adding any of our own top level windows */
    foreach (QWidget *widget, QApplication::topLevelWidgets ()) {
        if (widget->winId () == id)
	    return;
    }

    if (KWD::readWindowProperty (id, Atoms::switchSelectWindow,
				 (long *) &select))
    {
	if (!mSwitcher)
            mSwitcher = new Switcher (mCompositeWindow, id);
        if (mSwitcher->xid () != id)
        {
            delete mSwitcher;
            mSwitcher = new Switcher (mCompositeWindow, id);
        }

	geometry = mSwitcher->geometry ();
	frame = None;
    }
    else
    {
        KWindowInfo wInfo;

        KWD::trapXError ();
        wInfo = KWindowSystem::windowInfo (id, NET::WMGeometry);
        if (KWD::popXError ())
            return;

        if (!wInfo.valid ())
            return;

        KWD::readWindowProperty (id, Atoms::netInputFrameWindow, (long *) &iframe);
        KWD::readWindowProperty (id, Atoms::netOutputFrameWindow, (long *) &oframe);

        geometry = wInfo.geometry ();

        wInfo = KWindowSystem::windowInfo (id, NET::WMWindowType, 0);

	switch (wInfo.windowType (~0)) {
	case NET::Normal:
	case NET::Dialog:
	case NET::Toolbar:
	case NET::Menu:
	case NET::Utility:
	case NET::Splash:
	case NET::Unknown:
	    /* decorate these window types */
	    break;
	default:
	    return;
	}

	if (iframe)
	{
	    type = KWD::Window::Normal;
	    frame = iframe;
	}
	else
	{
	    type = KWD::Window::Normal2D;
	    frame = oframe;
	}
    }

    KWD::trapXError ();
    XSelectInput (QX11Info::display (), id,
		  StructureNotifyMask | PropertyChangeMask);
    KWD::popXError ();

    if (frame)
    {
	XWindowAttributes attr;
	KWD::trapXError ();
	XGetWindowAttributes (QX11Info::display (), frame, &attr);
	if (KWD::popXError ())
	    frame = None;
    }
    if (frame)
    {
	if (!mClients.contains (id))
	{
	    client = new KWD::Window (mCompositeWindow, id, frame, type,
				      geometry);

	    mClients.insert (id, client);
	    mFrames.insert (frame, client);
	}
	else
//.........这里部分代码省略.........
开发者ID:adrianobalani,项目名称:compiz-2,代码行数:101,代码来源:decorator.cpp


注:本文中的KWindowInfo::geometry方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。