本文整理汇总了C++中qt_xdisplay函数的典型用法代码示例。如果您正苦于以下问题:C++ qt_xdisplay函数的具体用法?C++ qt_xdisplay怎么用?C++ qt_xdisplay使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了qt_xdisplay函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: setUpdatesEnabled
void apbar::place_clients(void)
{
WINDOW *cur;
int twidth=2; // total width
for(cur = ap.first(); cur != NULL; cur = ap.next())
twidth += cur->width+4;
twidth -= 2;
setUpdatesEnabled(FALSE);
setFixedWidth(twidth);
if(! twidth)
{
setUpdatesEnabled(TRUE);
return;
}
int cx = 2;
for(cur = ap.first(); cur != NULL; cur = ap.next())
{
XMoveWindow(qt_xdisplay(), cur->w, cx, 0);
XWindowAttributes attr;
if(XGetWindowAttributes(qt_xdisplay(), cur->w, &attr))
{
XMapWindow(qt_xdisplay(), cur->w);
XRaiseWindow(qt_xdisplay(), cur->w);
}
cx += cur->width+4;
}
setUpdatesEnabled(TRUE);
}
开发者ID:nic0lae,项目名称:freebsddistro,代码行数:33,代码来源:apbar.cpp
示例2: 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
示例3: if
bool KKeyNative::init(const KKey &key)
{
// Get any extra mods required by the sym.
// E.g., XK_Plus requires SHIFT on the en layout.
m_sym = key.sym();
uint modExtra = KKeyServer::Sym(m_sym).getModsRequired();
// Get the X modifier equivalent.
if(!m_sym || !KKeyServer::modToModX(key.modFlags() | modExtra, m_mod))
{
m_sym = m_mod = 0;
m_code = 0;
return false;
}
// XKeysymToKeycode returns the wrong keycode for XK_Print and XK_Break.
// Specifically, it returns the code for SysReq instead of Print
// Only do this for the default Xorg layout, other keycode mappings
// (e.g. evdev) don't need or want it.
if(m_sym == XK_Print && !(m_mod & Mod1Mask) && XKeycodeToKeysym(qt_xdisplay(), 111, 0) == XK_Print)
m_code = 111; // code for Print
else if(m_sym == XK_Break || ((m_sym == XK_Pause && (m_mod & ControlMask)) && XKeycodeToKeysym(qt_xdisplay(), 114, 0) == XK_Pause))
m_code = 114;
else
m_code = XKeysymToKeycode(qt_xdisplay(), m_sym);
if(!m_code && m_sym)
kdDebug(125) << "Couldn't get code for sym" << endl;
// Now get the true sym formed by the modifiers
// E.g., Shift+Equal => Plus on the en layout.
if(key.modFlags() && ((m_sym < XK_Home || m_sym > XK_Begin) && m_sym != XK_Insert && m_sym != XK_Delete))
KKeyServer::codeXToSym(m_code, m_mod, m_sym);
return true;
}
开发者ID:serghei,项目名称:kde3-kdelibs,代码行数:34,代码来源:kkeynative_x11.cpp
示例4: qt_xdnd_handle_selection_request
void qt_xdnd_handle_selection_request( const XSelectionRequestEvent * req )
{
if ( !req )
return;
XEvent evt;
evt.xselection.type = SelectionNotify;
evt.xselection.display = req->display;
evt.xselection.requestor = req->requestor;
evt.xselection.selection = req->selection;
evt.xselection.target = req->target;
evt.xselection.property = None;
evt.xselection.time = req->time;
const char* format = qt_xdnd_atom_to_str( req->target );
if ( format && qt_xdnd_source_object &&
qt_xdnd_source_object->provides( format ) ) {
QByteArray a = qt_xdnd_source_object->encodedData(format);
XChangeProperty ( qt_xdisplay(), req->requestor, req->property,
req->target, 8, PropModeReplace,
(unsigned char *)a.data(), a.size() );
evt.xselection.property = req->property;
}
// ### this can die if req->requestor crashes at the wrong
// ### moment
XSendEvent( qt_xdisplay(), req->requestor, False, 0, &evt );
}
开发者ID:kthxbyte,项目名称:Qt1.45-Linaro,代码行数:25,代码来源:qdnd_x11.cpp
示例5: 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
示例6: kickerconf
// FINISHED - set defaults...
void Kaptan::accept()
{
// Kicker değişkenlerini ayarlayalım...
// - İkonların üzerine gelince büyüme efektini aç...
KConfig kickerconf("kickerrc", false, false);
kickerconf.setGroup("buttons");
kickerconf.writeEntry("EnableIconZoom", true);
kickerconf.sync();
// Kicker'ı DCOP ile dürtelim ki yeni ayarları yüklesin
if (!kapp->dcopClient()->isAttached())
kapp->dcopClient()->attach();
QByteArray data;
QCString appname;
if (DefaultScreen(qt_xdisplay()) == 0)
appname = "kicker";
else
appname.sprintf("kicker-screen-%d", DefaultScreen(qt_xdisplay()));
kapp->dcopClient()->send( appname, "kicker", "configure()", data );
// KDE değişkenlerini ayarlayalım...
// - Düğmeler üzerinde simgeleri görünsün
// - Combo'lar açılırken efektli açılsın
// - Renk şeması lipstikwhite olsun
KGlobal::config()->setGroup("KDE");
KGlobal::config()->writeEntry("ShowIconsOnPushButtons", true,true, true);
KGlobal::config()->writeEntry("EffectAnimateCombo", true, true, true);
KGlobal::config()->writeEntry("colorScheme", "lipstikwhite.kcsrc", true, true, true);
KGlobal::config()->sync();
exit(0);
}
开发者ID:Tayyib,项目名称:uludag,代码行数:35,代码来源:kaptan.cpp
示例7: winId
/*!
For internal use only.
*/
void QNPWidget::setWindow(bool delold)
{
saveWId = winId(); // ### Don't need this anymore
create((WId)pi->window, FALSE, delold);
if ( delold ) {
// Make sure they get a show()
clearWState( WState_Visible );
}
#ifdef _WS_X11_
Widget w = XtWindowToWidget (qt_xdisplay(), pi->window);
XtAddEventHandler(w, EnterWindowMask, FALSE, enter_event_handler, pi);
XtAddEventHandler(w, LeaveWindowMask, FALSE, leave_event_handler, pi);
Pixmap bgpm=0;
XColor col;
XtVaGetValues(w,
XtNbackground, &col.pixel,
XtNbackgroundPixmap, &bgpm,
0, 0);
XQueryColor(qt_xdisplay(), x11Colormap(), &col);
setBackgroundColor(QColor(col.red >> 8, col.green >> 8, col.blue >> 8));
if (bgpm) {
// ### Need an under-the-hood function here, or we have to
// ### rewrite lots of code from QPixmap::convertToImage().
// ### Doesn't matter yet, because Netscape doesn't ever set
// ### the background image of the window it gives us.
}
#endif
createNewWindowsForAllChildren(this);
setGeometry( pi->x, pi->y, pi->width, pi->height );
}
开发者ID:opieproject,项目名称:qte-opie,代码行数:38,代码来源:qnp.cpp
示例8: debug
void KStart::applyStyle(Window w) {
if (window)
KWM::prepareForSwallowing(w);
if (desktop >= 0) {
if (KWM::desktop(w) != desktop)
KWM::moveToDesktop(w, desktop);
}
if (maximize) {
debug("do maximize");
KWM::doMaximize(w, true);
}
if (iconify)
KWM::setIconify(w, true);
if (sticky) {
KWM::setSticky(w, true);
}
if (decoration != KWM::normalDecoration) {
KWM::setDecoration(w, decoration);
if (decoration & KWM::staysOnTop )
XRaiseWindow( qt_xdisplay(), w);
}
XSync(qt_xdisplay(), False);
if (window) {
XMapWindow(qt_xdisplay(), w);
XSync(qt_xdisplay(), False);
}
if (activate)
KWM::activate(w);
XSync(qt_xdisplay(), False);
}
开发者ID:kthxbyte,项目名称:KDE1-Linaro,代码行数:31,代码来源:kstart.C
示例9: XRRSetScreenConfig
bool RandRScreen::applyProposed()
{
// kdDebug() << k_funcinfo << " size " << (SizeID)proposedSize() << ", rotation " << proposedRotation() << ", refresh " <<
// refreshRateIndexToHz(proposedSize(), proposedRefreshRate()) << endl;
Status status;
if(proposedRefreshRate() < 0)
status = XRRSetScreenConfig(qt_xdisplay(), d->config, DefaultRootWindow(qt_xdisplay()), (SizeID)proposedSize(), (Rotation)proposedRotation(),
CurrentTime);
else
{
if(refreshRateIndexToHz(proposedSize(), proposedRefreshRate()) <= 0)
{
m_proposedRefreshRate = 0;
}
status = XRRSetScreenConfigAndRate(qt_xdisplay(), d->config, DefaultRootWindow(qt_xdisplay()), (SizeID)proposedSize(),
(Rotation)proposedRotation(), refreshRateIndexToHz(proposedSize(), proposedRefreshRate()), CurrentTime);
}
// kdDebug() << "New size: " << WidthOfScreen(ScreenOfDisplay(QPaintDevice::x11AppDisplay(), screen)) << ", " <<
// HeightOfScreen(ScreenOfDisplay(QPaintDevice::x11AppDisplay(), screen)) << endl;
if(status == RRSetConfigSuccess)
{
m_currentSize = m_proposedSize;
m_currentRotation = m_proposedRotation;
m_currentRefreshRate = m_proposedRefreshRate;
return true;
}
return false;
}
开发者ID:serghei,项目名称:kde3-kdebase,代码行数:33,代码来源:randr.cpp
示例10: XInternAtom
QRect KWM::geometry(Window w, bool including_frame){
static Atom a = 0;
if (!a)
a = XInternAtom(qt_xdisplay(), "KWM_WIN_FRAME_GEOMETRY", False);
QRect result;
if (including_frame){
if (getQRectProperty(w, a, result))
return result;
}
XWindowAttributes attr;
if (XGetWindowAttributes(qt_xdisplay(), w, &attr)){
if (getQRectProperty(w, a, result)){
result.setWidth(attr.width);
result.setHeight(attr.height);
}
else{
int x, y;
Window child;
XTranslateCoordinates(qt_xdisplay(),
w, qt_xrootwin(),
0, 0, &x, &y, &child);
result.setRect(x, y, attr.width, attr.height);
}
}
return result;
}
开发者ID:kthxbyte,项目名称:KDE1-Linaro,代码行数:26,代码来源:kwm.cpp
示例11: XRRFreeScreenConfigInfo
void RandRScreen::loadSettings()
{
if(d->config)
XRRFreeScreenConfigInfo(d->config);
d->config = XRRGetScreenInfo(qt_xdisplay(), RootWindow(qt_xdisplay(), m_screen));
Q_ASSERT(d->config);
Rotation rotation;
m_currentSize = m_proposedSize = XRRConfigCurrentConfiguration(d->config, &rotation);
m_currentRotation = m_proposedRotation = rotation;
m_pixelSizes.clear();
m_mmSizes.clear();
int numSizes;
XRRScreenSize *sizes = XRRSizes(qt_xdisplay(), m_screen, &numSizes);
for(int i = 0; i < numSizes; i++)
{
m_pixelSizes.append(QSize(sizes[i].width, sizes[i].height));
m_mmSizes.append(QSize(sizes[i].mwidth, sizes[i].mheight));
}
m_rotations = XRRRotations(qt_xdisplay(), m_screen, &rotation);
m_currentRefreshRate = m_proposedRefreshRate = refreshRateHzToIndex(m_currentSize, XRRConfigCurrentRate(d->config));
}
开发者ID:serghei,项目名称:kde3-kdebase,代码行数:26,代码来源:randr.cpp
示例12: DefaultScreen
Atom KWinSelectionOwner::make_selection_atom(int screen_P)
{
if(screen_P < 0)
screen_P = DefaultScreen(qt_xdisplay());
char tmp[30];
sprintf(tmp, "WM_S%d", screen_P);
return XInternAtom(qt_xdisplay(), tmp, False);
}
开发者ID:serghei,项目名称:kde3-kdebase,代码行数:8,代码来源:utils.cpp
示例13: ungrabXServer
void ungrabXServer()
{
assert(server_grab_count > 0);
if(--server_grab_count == 0)
{
XUngrabServer(qt_xdisplay());
XFlush(qt_xdisplay());
Notify::sendPendingEvents();
}
}
开发者ID:serghei,项目名称:kde3-kdebase,代码行数:10,代码来源:utils.cpp
示例14: init
void Shape::init()
{
kwin_shape_version = 0;
int dummy;
if(!XShapeQueryExtension(qt_xdisplay(), &kwin_shape_event, &dummy))
return;
int major, minor;
if(!XShapeQueryVersion(qt_xdisplay(), &major, &minor))
return;
kwin_shape_version = major * 0x10 + minor;
}
开发者ID:serghei,项目名称:kde3-kdebase,代码行数:11,代码来源:utils.cpp
注:本文中的qt_xdisplay函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论