• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ qt_xrootwin函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中qt_xrootwin函数的典型用法代码示例。如果您正苦于以下问题:C++ qt_xrootwin函数的具体用法?C++ qt_xrootwin怎么用?C++ qt_xrootwin使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: XInternAtom

void KWM::unregisterSoundEvent(const QString &event){
  static Atom a = 0;
  if (!a)
    a = XInternAtom(qt_xdisplay(), "KDE_UNREGISTER_SOUND_EVENT", False);

  XEvent ev;
  int status;
  long mask;
  memset(&ev, 0, sizeof(ev));
  ev.xclient.type = ClientMessage;
  ev.xclient.window = qt_xrootwin();
  ev.xclient.message_type = a;
  ev.xclient.format = 8;

  int i;
  const char* s = event.data();
  for (i=0;i<19 && s[i];i++)
    ev.xclient.data.b[i]=s[i];

  mask = SubstructureRedirectMask;

  status = XSendEvent(qt_xdisplay(),
		      qt_xrootwin(),
		      False, mask, &ev);
}
开发者ID:kthxbyte,项目名称:KDE1-Linaro,代码行数:25,代码来源:kwm.cpp


示例2: debug

bool KGlobalAccel::grabKey( uint keysym, uint mod ) {
	// Most of this comes from kpanel/main.C
	// Copyright (C) 1996,97 Matthias Ettrich
	static int NumLockMask = 0;
	
	debug("KGlobalAccel::grabKey");
	
	if (!XKeysymToKeycode(qt_xdisplay(), keysym)) return false; 
	if (!NumLockMask){
		XModifierKeymap* xmk = XGetModifierMapping(qt_xdisplay());
		int i;
		for (i=0; i<8; i++){
		   if (xmk->modifiermap[xmk->max_keypermod * i] == 
		   		XKeysymToKeycode(qt_xdisplay(), XK_Num_Lock))
		   			NumLockMask = (1<<i); 
		}
	}

	grabFailed = false;

	// We wan't to catch only our own errors
	XSync(qt_xdisplay(),0);
	XErrorHandler savedErrorHandler=XSetErrorHandler(XGrabErrorHandler);
	
	debug("Will grab key and variants with keyboard locks: %d, %d", keysym, mod);

	XGrabKey(qt_xdisplay(),
		XKeysymToKeycode(qt_xdisplay(), keysym), mod,
		qt_xrootwin(), True,
		GrabModeAsync, GrabModeSync);
	XGrabKey(qt_xdisplay(),
		XKeysymToKeycode(qt_xdisplay(), keysym), mod | LockMask,
		qt_xrootwin(), True,
		GrabModeAsync, GrabModeSync);
	XGrabKey(qt_xdisplay(),
		XKeysymToKeycode(qt_xdisplay(), keysym), mod | NumLockMask,
		qt_xrootwin(), True,
		GrabModeAsync, GrabModeSync);
	XGrabKey(qt_xdisplay(),
		XKeysymToKeycode(qt_xdisplay(), keysym), mod | LockMask | NumLockMask,
		qt_xrootwin(), True,
		GrabModeAsync, GrabModeSync);

	XSync(qt_xdisplay(),0);
	XSetErrorHandler(savedErrorHandler);
	
	debug("       grabbed");
	
	if (grabFailed) {
		// FIXME: ungrab all successfull grabs!
		//warning("Global grab failed!");
   		return false;
	}
	return true;
}
开发者ID:kthxbyte,项目名称:KDE1-Linaro,代码行数:55,代码来源:kglobalaccel.cpp


示例3: KApplication

Application::Application() : KApplication(), owner(screen_number)
{
    KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
    if(!config()->isImmutable() && args->isSet("lock"))
    {
        config()->setReadOnly(true);
        config()->reparseConfiguration();
    }

    if(screen_number == -1)
        screen_number = DefaultScreen(qt_xdisplay());

    if(!owner.claim(args->isSet("replace"), true))
    {
        fputs(i18n("kwin: unable to claim manager selection, another wm running? (try using --replace)\n").local8Bit(), stderr);
        ::exit(1);
    }
    connect(&owner, SIGNAL(lostOwnership()), SLOT(lostSelection()));

    // if there was already kwin running, it saved its configuration after loosing the selection -> reread
    config()->reparseConfiguration();

    initting = TRUE; // startup....

    // install X11 error handler
    XSetErrorHandler(x11ErrorHandler);

    // check  whether another windowmanager is running
    XSelectInput(qt_xdisplay(), qt_xrootwin(), SubstructureRedirectMask);
    syncX(); // trigger error now

    options = new Options;
    atoms = new Atoms;

    // create workspace.
    (void)new Workspace(isSessionRestored());

    syncX(); // trigger possible errors, there's still a chance to abort

    DCOPRef ref("kded", "kded");
    ref.send("unloadModule", QCString("kdetrayproxy"));

    initting = FALSE; // startup done, we are up and running now.

    dcopClient()->send("ksplash", "", "upAndRunning(QString)", QString("wm started"));
    XEvent e;
    e.xclient.type = ClientMessage;
    e.xclient.message_type = XInternAtom(qt_xdisplay(), "_KDE_SPLASH_PROGRESS", False);
    e.xclient.display = qt_xdisplay();
    e.xclient.window = qt_xrootwin();
    e.xclient.format = 8;
    strcpy(e.xclient.data.b, "wm started");
    XSendEvent(qt_xdisplay(), qt_xrootwin(), False, SubstructureNotifyMask, &e);
}
开发者ID:serghei,项目名称:kde3-kdebase,代码行数:54,代码来源:main.cpp


示例4: info

void TaskManager::windowAdded(WId w )
{
  NETWinInfo info(qt_xdisplay(),  w, qt_xrootwin(),
                  NET::WMWindowType | NET::WMPid | NET::WMState );
  #ifdef KDE_3_2
  NET::WindowType windowType = info.windowType(NET_ALL_TYPES_MASK);
  #else
  NET::WindowType windowType = info.windowType();
  #endif
  // ignore NET::Tool and other special window types
  if (windowType != NET::Normal && windowType != NET::Override
      && windowType != NET::Unknown && windowType != NET::Dialog)
    return;
  // ignore windows that want to be ignored by the taskbar
  if ((info.state() & NET::SkipTaskbar) != 0)
  {
      _skiptaskbar_windows.push_front( w ); // remember them though
    return;
  }

  Window transient_for_tmp;
  if (XGetTransientForHint(qt_xdisplay(), (Window) w, &transient_for_tmp))
  {
    WId transient_for = (WId) transient_for_tmp;

    // check if it's transient for a skiptaskbar window
    if (_skiptaskbar_windows.contains(transient_for))
      return;

    // lets see if this is a transient for an existing task
    if (transient_for != qt_xrootwin() && transient_for != 0 )
    {
      Task* t = findTask(transient_for);
      if (t)
      {
        if (t->window() != w)
        {
          t->addTransient(w);
          // kdDebug() << "TM: Transient " << w << " added for Task: " << t->window() << endl;
        }
        return;
      }
    }
  }
  Task* t = new Task(w, this);
  _tasks.append(t);

  // kdDebug() << "TM: Task added for WId: " << w << endl;
  emit taskAdded(t);
}
开发者ID:serghei,项目名称:kde3-kdeutils,代码行数:50,代码来源:taskmanager.cpp


示例5: hidden_win

void winlist::hidden_win(void)
{
	Window w1,w2,*wins;
	uint nwins;

	if(XQueryTree(qt_xdisplay(), qt_xrootwin(), &w1, &w2, &wins, &nwins) == 0 || ! nwins)
		return;

	xwindow *win;
	int dwidth = QApplication::desktop()->width();

	for(win = clients.first(); win != NULL; win = clients.next())
	{
		if(win->isVisible() && win->x() <= dwidth && win->x() >= 0 && isobscured(win, wins, nwins))
		{
			win->raise();
			XFree(wins);
			return;
		}	
	}

	if(qapp::is_tileddesk())
	{
		for(win = clients.first(); win != NULL; win = clients.next())
		{
			if(win->isVisible() &&  win->x() <= dwidth && win->x() >= 0 && ! win->is_tiled() && isbottom(win, wins, nwins))
			{
				win->raise();
				XFree(wins);
				return;
			}
		}
	}
	XFree(wins);
}
开发者ID:nic0lae,项目名称:freebsddistro,代码行数:35,代码来源:winlist.cpp


示例6: getrunprocs

void getrunprocs(void)  // get already running clients
{
	Window w,w1,w2,*wins;
	uint nwins,cwin;
	XWindowAttributes attr;

	if(XQueryTree(qt_xdisplay(), qt_xrootwin(), &w1, &w2, &wins, &nwins) == 0 || ! nwins)
		return;
	
	bool surgent = defaults::starturgent;
	defaults::starturgent = FALSE;

	for(cwin=0; cwin < nwins; cwin++)
	{
		w = wins[cwin];
		
		if(w == qapp::tb->winId())
			continue;

		XGetWindowAttributes(qt_xdisplay(), w, &attr);

		if(attr.map_state == IsViewable && ! attr.override_redirect)
			qapp::run_client(w);
	}
	XSync(qt_xdisplay(), FALSE);
	defaults::starturgent = surgent;
}
开发者ID:nic0lae,项目名称:freebsddistro,代码行数:27,代码来源:main.cpp


示例7: inf

void ShowDesktop::slotWindowAdded(WId w)
{
    if(!m_showingDesktop)
    {
        return;
    }

    NETWinInfo inf(qt_xdisplay(), w, qt_xrootwin(), NET::XAWMState | NET::WMWindowType);
    NET::WindowType windowType = inf.windowType(NET::AllTypesMask);

    if((windowType == NET::Normal || windowType == NET::Unknown) && inf.mappingState() == NET::Visible)
    {
        KConfig kwincfg("kwinrc", true); // see in kwin
        kwincfg.setGroup("Windows");
        if(kwincfg.readBoolEntry("ShowDesktopIsMinimizeAll", false))
        {
            m_iconifiedList.clear();
            m_showingDesktop = false;
            emit desktopShown(false);
        }
        else
        {
            m_activeWindow = w;
            showDesktop(false);
        }
    }
}
开发者ID:serghei,项目名称:kde3-kdebase,代码行数:27,代码来源:showdesktop.cpp


示例8: XKeysymToKeycode

GlobalKey::GlobalKey(CommandDef *cmd)
{
    m_key = QAccel::stringToKey(cmd->accel);
    m_state = 0;
    if (m_key & Qt::SHIFT) {
        m_key &= ~Qt::SHIFT;
        m_state |= 1;
    }
    if (m_key & Qt::CTRL) {
        m_key &= ~Qt::CTRL;
        m_state |= 4;
    }
    if (m_key & Qt::ALT) {
        m_key &= ~Qt::ALT;
        m_state |= 8;
    }
    m_key &= ~Qt::UNICODE_ACCEL;
    for (const TransKey *t = g_rgQtToSymX; t->x_key; t++) {
        if (t->qt_key == m_key) {
            m_key = t->x_key;
            break;
        }
    }
    m_key = XKeysymToKeycode( qt_xdisplay(), m_key);
    XSync( qt_xdisplay(), 0 );
    XErrorHandler savedErrorHandler = XSetErrorHandler(XGrabErrorHandler);
    XGrabKey( qt_xdisplay(), m_key, m_state,
              qt_xrootwin(), True, GrabModeAsync, GrabModeSync);
    XSync( qt_xdisplay(), 0 );
    XSetErrorHandler( savedErrorHandler );
}
开发者ID:BackupTheBerlios,项目名称:sim-im-svn,代码行数:31,代码来源:shortcuts.cpp


示例9: ni

void Task::toDesktop(int desk)
{
  NETWinInfo ni(qt_xdisplay(), _win, qt_xrootwin(), NET::WMDesktop);
  if (desk == 0)
  {
#ifdef KDE_3_2
    if (_info.onAllDesktops())
    {
        ni.setDesktop(kwin_module->currentDesktop());
        KWin::forceActiveWindow(_win);
    }
#else
    if (_info.onAllDesktops)
    {
        ni.setDesktop(kwin_module->currentDesktop());
        KWin::setActiveWindow(_win);
    }
#endif
    else
        ni.setDesktop(NETWinInfo::OnAllDesktops);
    return;
  }
  ni.setDesktop(desk);
  if (desk == kwin_module->currentDesktop())
#ifdef KDE_3_2
    KWin::forceActiveWindow(_win);
#else
    KWin::setActiveWindow(_win);
#endif
}
开发者ID:serghei,项目名称:kde3-kdeutils,代码行数:30,代码来源:taskmanager.cpp


示例10: ksp

void servercontroller::saveSessionConfig()
{
    QDictIterator<KSircProcess> ksp(proc_list);
    for (; ksp.current(); ++ksp ) {
	ChannelSessionInfoList channels;

	QDictIterator<KSircMessageReceiver> ksm(ksp.current()->getWindowList());
	for (; ksm.current(); ++ksm )
	    if(ksm.currentKey()[0] != '!') { // Ignore !ksm's (system created)
		ChannelSessionInfo sessionInfo;

		sessionInfo.name = ksm.currentKey();
		sessionInfo.port = ksp.current()->serverPort();
		KSircTopLevel *topLev = dynamic_cast<KSircTopLevel *>( ksm.current() );
		if ( topLev && topLev->isTopLevel() ) {
#ifdef Q_WS_X11
		    NETWinInfo winInfo( qt_xdisplay(), topLev->winId(), qt_xrootwin(), NET::WMDesktop );
		    sessionInfo.desktop = winInfo.desktop();
#endif
		}

		channels << sessionInfo;
	    }

	if ( !channels.isEmpty() )
	    m_sessionConfig[ ksp.currentKey() ] = channels;
    }
}
开发者ID:serghei,项目名称:kde3-kdenetwork,代码行数:28,代码来源:servercontroller.cpp


示例11:

bool RKWardApplication::x11EventFilter (XEvent *e) {
	if (detect_x11_creations) {
		if (e->type == CreateNotify) {
			if (e->xcreatewindow.parent == qt_xrootwin ()) {
				KWin::WindowInfo info = KWin::windowInfo (e->xcreatewindow.window);
				// at this point, we used to check, whether this window has some name or another. This heuristic allowed to sieve out helper windows of the window manager. However, since R 2.8.0, sometimes the window is mapped, before it has been give a name.
				// Now we rely on the fact (we hope it *is* a fact), that the device window is always the first one created.
				if ((info.windowType (0xFFFF) != 0) && (!created_window)) {
					created_window = e->xcreatewindow.window;
					return true;
				}
			} else {
				RK_ASSERT (false);
			}
		}
	}

	if (e->type == PropertyNotify) {
		if (e->xproperty.atom == wm_name_property) {
			if (name_watchers_list.contains (e->xproperty.window)) {
				KWin::WindowInfo wininfo = KWin::windowInfo (e->xproperty.window);
				name_watchers_list[e->xproperty.window]->setCaption (wininfo.name ());
				return true;
			}
		}
	}

	return KApplication::x11EventFilter (e);
}
开发者ID:svn2github,项目名称:rkward-svn-mirror,代码行数:29,代码来源:rkwardapplication.cpp


示例12: qt_xrootwin

void RegionGrabber::initGrabber()
{
  pixmap = QPixmap::grabWindow( qt_xrootwin() );
  setPaletteBackgroundPixmap( pixmap );

  QDesktopWidget desktopWidget;
  QRect desktopSize;
  if ( desktopWidget.isVirtualDesktop() )
    desktopSize = desktopWidget.geometry();
  else
    desktopSize = desktopWidget.screenGeometry( qt_xrootwin() );

  setGeometry( desktopSize );
  showFullScreen();

  QApplication::setOverrideCursor( crossCursor );
}
开发者ID:serghei,项目名称:kde3-kdegraphics,代码行数:17,代码来源:regiongrabber.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ qtss_printf函数代码示例发布时间:2022-05-30
下一篇:
C++ qt_xdisplay函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap