src/gui/kernel/qapplication_x11.cpp File Reference

#include "qplatformdefs.h"
#include "qcolormap.h"
#include "qdesktopwidget.h"
#include "qapplication.h"
#include "qapplication_p.h"
#include "qcursor.h"
#include "qwidget.h"
#include "qbitarray.h"
#include "qpainter.h"
#include "qfile.h"
#include "qpixmapcache.h"
#include "qdatetime.h"
#include "qtextcodec.h"
#include "qdatastream.h"
#include "qbuffer.h"
#include "qsocketnotifier.h"
#include "qsessionmanager.h"
#include "qclipboard.h"
#include "qwhatsthis.h"
#include "qsettings.h"
#include "qstylefactory.h"
#include "qfileinfo.h"
#include "qhash.h"
#include "qevent.h"
#include "qevent_p.h"
#include "qvarlengtharray.h"
#include "qdebug.h"
#include <private/qunicodetables_p.h>
#include <private/qcrashhandler_p.h>
#include <private/qcolor_p.h>
#include <private/qcursor_p.h>
#include "qstyle.h"
#include "qmetaobject.h"
#include "qguieventdispatcher_glib_p.h"
#include "qeventdispatcher_x11_p.h"
#include <private/qpaintengine_x11_p.h>
#include <private/qkeymapper_p.h>
#include "qinputcontext.h"
#include "qinputcontextfactory.h"
#include <X11/extensions/Xfixes.h>
#include "qt_x11_p.h"
#include "qx11info_x11.h"
#include <X11/keysymdef.h>
#include <X11/extensions/XI.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <locale.h>
#include "qwidget_p.h"
#include <private/qbackingstore_p.h>
#include <X11/SM/SMlib.h>
#include "qapplication_x11.moc"

Include dependency graph for qapplication_x11.cpp:

Go to the source code of this file.

Classes

class  QETWidget
struct  PaintEventInfo
class  QSessionManagerPrivate
class  QSmSocketReceiver
struct  QT_smcConn

Defines

#define XK_MISCELLANY

Functions

static void qt_detect_broken_window_manager ()
void qt_desktopwidget_update_workarea ()
QTabletDeviceDataListqt_tablet_devices ()
static bool qt_x11EventFilter (XEvent *ev)
bool qt_check_clipboard_sentinel ()
bool qt_check_selection_sentinel ()
static void qt_save_rootinfo ()
Q_GUI_EXPORT bool qt_try_modal (QWidget *, XEvent *)
static int qt_x_errhandler (Display *dpy, XErrorEvent *err)
static int qt_xio_errhandler (Display *)
static void qt_x11_create_intern_atoms ()
Q_GUI_EXPORT void qt_x11_apply_settings_in_all_apps ()
static void qt_set_input_encoding ()
static void qt_set_x11_resources (const char *font=0, const char *fg=0, const char *bg=0, const char *button=0)
static void qt_get_net_supported ()
bool qt_net_supports (Atom atom)
static void qt_get_net_virtual_roots ()
static void qt_net_update_user_time (QWidget *tlw)
static void qt_check_focus_model ()
static bool isXInputSupported (Display *dpy)
static void getXDefault (const char *group, const char *key, int *val)
static void getXDefault (const char *group, const char *key, double *val)
static void getXDefault (const char *group, const char *key, bool *val)
void qt_init (QApplicationPrivate *priv, int, Display *display, Qt::HANDLE visual, Qt::HANDLE colormap)
void qt_cleanup ()
void qt_updated_rootinfo ()
bool qt_wstate_iconified (WId winid)
bool qt_nograb ()
void qt_x11_enforce_cursor (QWidget *w)
void qPRCreate (const QWidget *widget, Window oldwin)
void qPRCleanup (QWidget *widget)
static QETWidgetqPRFindWidget (Window oldwin)
static Qt::MouseButtons translateMouseButtons (int s)
static Bool isPaintOrScrollDoneEvent (Display *, XEvent *ev, XPointer a)
static bool translateBySips (QWidget *that, QRect &paintRect)
bool qt_sendSpontaneousEvent (QObject *receiver, QEvent *event)
static void resetSmState ()
static void sm_setProperty (const char *name, const char *type, int num_vals, SmPropValue *vals)
static void sm_saveYourselfCallback (SmcConn smcConn, SmPointer clientData, int saveType, Bool shutdown, int interactStyle, Bool fast)
static void sm_saveYourselfPhase2Callback (SmcConn smcConn, SmPointer clientData)
static void sm_dieCallback (SmcConn smcConn, SmPointer clientData)
static void sm_shutdownCancelledCallback (SmcConn smcConn, SmPointer clientData)
static void sm_saveCompleteCallback (SmcConn smcConn, SmPointer clientData)
static void sm_interactCallback (SmcConn smcConn, SmPointer clientData)
static void sm_performSaveYourself (QSessionManagerPrivate *)
static void sm_setProperty (const QString &name, const QString &value)
static void sm_setProperty (const QString &name, const QStringList &value)

Variables

static const char * x11_atomnames
Q_GUI_EXPORT QX11Dataqt_x11Data = 0
static const char * appName = 0
static const char * appClass = 0
static const char * appFont = 0
static const char * appBGCol = 0
static const char * appFGCol = 0
static const char * appBTNCol = 0
static const char * mwGeometry = 0
static const char * mwTitle = 0
char * qt_ximServer = 0
static bool appSync = false
static bool app_save_rootinfo = false
static bool app_do_modal = false
static Window curWin = 0
bool qt_broken_wm = false
uchar qt_alt_mask = 0
uchar qt_meta_mask = 0
uchar qt_super_mask = 0
uchar qt_hyper_mask = 0
uchar qt_mode_switch_mask = 0
bool qt_use_rtl_extensions = false
static Window mouseActWindow = 0
static Qt::MouseButton mouseButtonPressed = Qt::NoButton
static Qt::MouseButtons mouseButtonState = Qt::NoButton
static Time mouseButtonPressTime = 0
static short mouseXPos
static short mouseYPos
static short mouseGlobalXPos
static short mouseGlobalYPos
QWidgetListqt_modal_stack
static Window pressed_window = XNone
static bool replayPopupMouseEvent = false
static bool popupGrabOk
bool qt_sm_blockUserInput = false
bool qt_reuse_double_buffer = true
Q_GUI_EXPORT int qt_xfocusout_grab_counter = 0
bool qt_tabletChokeMouse
int qt_ximComposingKeycode = 0
QTextCodecqt_input_mapper = 0
QWidgetqt_button_down = 0
static QWidgetqt_popup_down = 0
bool qt_xdnd_dragging
bool qt_is_gui_used
bool qt_app_has_font
static int(*) original_x_errhandler (Display *dpy, XErrorEvent *)
static int(*) original_xio_errhandler (Display *dpy)
static QWidgetMapperwPRmapper = 0
static int openPopupCount = 0
static SmcConn smcConnection = 0
static bool sm_interactionActive
static bool sm_smActive
static int sm_interactStyle
static int sm_saveType
static bool sm_cancel
static bool sm_waitingForInteraction
static bool sm_isshutdown
static bool sm_phase2
static bool sm_in_phase2
static QSmSocketReceiversm_receiver = 0


Define Documentation

#define XK_MISCELLANY

Definition at line 86 of file qapplication_x11.cpp.


Function Documentation

static void getXDefault ( const char *  group,
const char *  key,
bool *  val 
) [static]

Definition at line 1201 of file qapplication_x11.cpp.

References c, and X11.

01202 {
01203     char *str = XGetDefault(X11->display, group, key);
01204     if (str) {
01205         char c = str[0];
01206         if (isupper((int)c))
01207             c = tolower(c);
01208         if (c == 't' || c == 'y' || c == '1')
01209             *val = true;
01210         else if (c == 'f' || c == 'n' || c == '0')
01211             *val = false;
01212         if (c == 'o') {
01213             c = str[1];
01214             if (isupper((int)c))
01215                 c = tolower(c);
01216             if (c == 'n')
01217                 *val = true;
01218             if (c == 'f')
01219                 *val = false;
01220         }
01221     }
01222 }

static void getXDefault ( const char *  group,
const char *  key,
double *  val 
) [static]

Definition at line 1190 of file qapplication_x11.cpp.

References X11.

01191 {
01192     char *str = XGetDefault(X11->display, group, key);
01193     if (str) {
01194         char *end = 0;
01195         double v = strtod(str, &end);
01196         if (str != end)
01197             *val = v;
01198     }
01199 }

static void getXDefault ( const char *  group,
const char *  key,
int *  val 
) [static]

Definition at line 1179 of file qapplication_x11.cpp.

References X11.

01180 {
01181     char *str = XGetDefault(X11->display, group, key);
01182     if (str) {
01183         char *end = 0;
01184         int v = strtol(str, &end, 0);
01185         if (str != end)
01186             *val = v;
01187     }
01188 }

static Bool isPaintOrScrollDoneEvent ( Display ,
XEvent *  ev,
XPointer  a 
) [static]

Definition at line 4144 of file qapplication_x11.cpp.

References ATOM, and info.

Referenced by QETWidget::translateConfigEvent(), and QETWidget::translatePaintEvent().

04145 {
04146     PaintEventInfo *info = (PaintEventInfo *)a;
04147     if (ev->type == Expose || ev->type == GraphicsExpose
04148       ||    ev->type == ClientMessage
04149          && ev->xclient.message_type == ATOM(_QT_SCROLL_DONE))
04150     {
04151         if (ev->xexpose.window == info->window)
04152             return True;
04153     }
04154     return False;
04155 }

static bool isXInputSupported ( Display dpy  )  [static]

Definition at line 1157 of file qapplication_x11.cpp.

References version, and X11.

01158 {
01159     Bool exists;
01160     XExtensionVersion *version;
01161     exists = XQueryExtension(dpy, "XInputExtension", &X11->xinput_major,
01162                              &X11->xinput_eventbase, &X11->xinput_errorbase);
01163     if (!exists)
01164         return false;
01165     version = XGetExtensionVersion(dpy, "XInputExtension");
01166     if (!version || version == reinterpret_cast<XExtensionVersion *>(NoSuchExtension))
01167         return false;
01168 
01169     XFree(version);
01170     return true;
01171 }

void qPRCleanup ( QWidget widget  ) 

Definition at line 2429 of file qapplication_x11.cpp.

References QHash< Key, T >::constBegin(), QHash< Key, T >::constEnd(), key, QHash< Key, T >::remove(), QWidget::setAttribute(), QHash< Key, T >::size(), QWidget::testAttribute(), Qt::WA_WState_Reparented, and wPRmapper.

Referenced by QWidget::destroy().

02430 {
02431     QETWidget *etw = static_cast<QETWidget *>(const_cast<QWidget *>(widget));
02432     if (!(wPRmapper && widget->testAttribute(Qt::WA_WState_Reparented)))
02433         return;                                        // not a reparented widget
02434     for (QWidgetMapper::ConstIterator it = wPRmapper->constBegin(); it != wPRmapper->constEnd(); ++it) {
02435         QWidget *w = *it;
02436         int key = it.key();
02437         if (w == etw) {                       // found widget
02438             etw->setAttribute(Qt::WA_WState_Reparented, false); // clear flag
02439             wPRmapper->remove(key);// old window no longer needed
02440             if (wPRmapper->size() == 0) {        // became empty
02441                 delete wPRmapper;                // then reset alt mapper
02442                 wPRmapper = 0;
02443             }
02444             return;
02445         }
02446     }
02447 }

Here is the call graph for this function:

void qPRCreate ( const QWidget widget,
Window  oldwin 
)

Definition at line 2419 of file qapplication_x11.cpp.

References QHash< Key, T >::insert(), w, Qt::WA_WState_Reparented, and wPRmapper.

Referenced by QWidgetPrivate::setParent_sys().

02420 {                                                // QWidget::reparent mechanism
02421     if (!wPRmapper)
02422         wPRmapper = new QWidgetMapper;
02423 
02424     QETWidget *w = static_cast<QETWidget *>(const_cast<QWidget *>(widget));
02425     wPRmapper->insert((int)oldwin, w);        // add old window to mapper
02426     w->setAttribute(Qt::WA_WState_Reparented);        // set reparented flag
02427 }

Here is the call graph for this function:

static QETWidget* qPRFindWidget ( Window  oldwin  )  [static]

Definition at line 2449 of file qapplication_x11.cpp.

References QHash< Key, T >::value(), and wPRmapper.

02450 {
02451     return wPRmapper ? (QETWidget*)wPRmapper->value((int)oldwin, 0) : 0;
02452 }

Here is the call graph for this function:

bool qt_check_clipboard_sentinel (  ) 

Definition at line 1274 of file qclipboard_x11.cpp.

References ATOM, QClipboardData::clear(), QApplication::clipboard(), clipboardData(), QApplication::desktop(), QWidget::internalWinId(), owner, pending_clipboard_changed, pending_timer_id, QDesktopWidget::screen(), QObject::startTimer(), Success, waiting_for_data, and X11.

01275 {
01276     bool doIt = true;
01277     if (owner) {
01278         Window *owners;
01279         Atom actualType;
01280         int actualFormat;
01281         unsigned long nitems, bytesLeft;
01282 
01283         if (XGetWindowProperty(X11->display,
01284                                QApplication::desktop()->screen(0)->internalWinId(),
01285                                ATOM(_QT_CLIPBOARD_SENTINEL), 0, 2, False, XA_WINDOW,
01286                                &actualType, &actualFormat, &nitems, &bytesLeft,
01287                                (unsigned char **) &owners) == Success) {
01288             if (actualType == XA_WINDOW && actualFormat == 32 && nitems == 2) {
01289                 Window win = owner->internalWinId();
01290                 if (owners[0] == win || owners[1] == win)
01291                     doIt = false;
01292             }
01293 
01294             XFree(owners);
01295         }
01296     }
01297 
01298     if (doIt) {
01299         if (waiting_for_data) {
01300             pending_clipboard_changed = true;
01301             if (! pending_timer_id)
01302                 pending_timer_id = QApplication::clipboard()->startTimer(0);
01303             doIt = false;
01304         } else {
01305             clipboardData()->clear();
01306         }
01307     }
01308 
01309     return doIt;
01310 }

Here is the call graph for this function:

static void qt_check_focus_model (  )  [static]

Definition at line 1145 of file qapplication_x11.cpp.

References QX11Data::FM_Other, QX11Data::FM_PointerRoot, X11, and XNone.

01146 {
01147     Window fw = XNone;
01148     int unused;
01149     XGetInputFocus(X11->display, &fw, &unused);
01150     if (fw == PointerRoot)
01151         X11->focus_model = QX11Data::FM_PointerRoot;
01152     else
01153         X11->focus_model = QX11Data::FM_Other;
01154 }

bool qt_check_selection_sentinel (  ) 

Definition at line 1223 of file qclipboard_x11.cpp.

References ATOM, QClipboardData::clear(), QApplication::clipboard(), QApplication::desktop(), QWidget::internalWinId(), owner, pending_selection_changed, pending_timer_id, QDesktopWidget::screen(), selectionData(), QObject::startTimer(), Success, waiting_for_data, and X11.

01224 {
01225     bool doIt = true;
01226     if (owner) {
01227         /*
01228           Since the X selection mechanism cannot give any signal when
01229           the selection has changed, we emulate it (for Qt processes) here.
01230           The notification should be ignored in case of either
01231           a) This is the process that did setData (because setData()
01232           then has already emitted dataChanged())
01233           b) This is the process that owned the selection when dataChanged()
01234           was called (because we have then received a SelectionClear event,
01235           and have already emitted dataChanged() as a result of that)
01236         */
01237 
01238         Window* owners;
01239         Atom actualType;
01240         int actualFormat;
01241         ulong nitems;
01242         ulong bytesLeft;
01243 
01244         if (XGetWindowProperty(X11->display,
01245                                QApplication::desktop()->screen(0)->internalWinId(),
01246                                ATOM(_QT_SELECTION_SENTINEL), 0, 2, False, XA_WINDOW,
01247                                &actualType, &actualFormat, &nitems,
01248                                &bytesLeft, (unsigned char**)&owners) == Success) {
01249             if (actualType == XA_WINDOW && actualFormat == 32 && nitems == 2) {
01250                 Window win = owner->internalWinId();
01251                 if (owners[0] == win || owners[1] == win)
01252                     doIt = false;
01253             }
01254 
01255             XFree(owners);
01256         }
01257     }
01258 
01259     if (doIt) {
01260         if (waiting_for_data) {
01261             pending_selection_changed = true;
01262             if (! pending_timer_id)
01263                 pending_timer_id = QApplication::clipboard()->startTimer(0);
01264             doIt = false;
01265         } else {
01266             selectionData()->clear();
01267         }
01268     }
01269 
01270     return doIt;
01271 }

Here is the call graph for this function:

void qt_cleanup (  ) 

Definition at line 1991 of file qapplication_x11.cpp.

References app_save_rootinfo, appClass, QList< T >::at(), QCursorData::cleanup(), QColormap::cleanup(), QFont::cleanup(), QPixmapCache::clear(), QApplicationPrivate::inputContext, original_x_errhandler, original_xio_errhandler, qt_save_rootinfo(), qt_tablet_devices(), QList< T >::size(), and X11.

Referenced by QApplication::~QApplication().

01992 {
01993     if (app_save_rootinfo)                        // root window must keep state
01994         qt_save_rootinfo();
01995 
01996     if (qt_is_gui_used) {
01997         QPixmapCache::clear();
01998         QCursorData::cleanup();
01999         QFont::cleanup();
02000         QColormap::cleanup();
02001     }
02002 
02003 #ifndef QT_NO_XRENDER
02004     for (int i = 0; i < X11->solid_fill_count; ++i) {
02005         if (X11->solid_fills[i].picture)
02006             XRenderFreePicture(X11->display, X11->solid_fills[i].picture);
02007     }
02008     for (int i = 0; i < X11->pattern_fill_count; ++i) {
02009         if (X11->pattern_fills[i].picture)
02010             XRenderFreePicture(X11->display, X11->pattern_fills[i].picture);
02011     }
02012 #endif
02013 #if !defined (QT_NO_TABLET)
02014     QTabletDeviceDataList *devices = qt_tablet_devices();
02015     for (int i = 0; i < devices->size(); ++i)
02016         XCloseDevice(X11->display, (XDevice*)devices->at(i).device);
02017 #endif
02018 
02019 #if !defined(QT_NO_IM)
02020     delete QApplicationPrivate::inputContext;
02021     QApplicationPrivate::inputContext = 0;
02022 #endif
02023 
02024     // Reset the error handlers
02025     XSetErrorHandler(original_x_errhandler);
02026     XSetIOErrorHandler(original_xio_errhandler);
02027 
02028     if (qt_is_gui_used && !X11->foreignDisplay)
02029         XCloseDisplay(X11->display);                // close X display
02030     X11->display = 0;
02031 
02032     delete [] X11->screens;
02033 
02034     if (X11->foreignDisplay) {
02035         delete [] (char *)appName;
02036         appName = 0;
02037     }
02038 
02039     delete [] (char *)appClass;
02040     appClass = 0;
02041 
02042     if (X11->net_supported_list)
02043         delete [] X11->net_supported_list;
02044     X11->net_supported_list = 0;
02045 
02046     if (X11->net_virtual_root_list)
02047         delete [] X11->net_virtual_root_list;
02048     X11->net_virtual_root_list = 0;
02049 
02050     delete X11;
02051     X11 = 0;
02052 }

Here is the call graph for this function:

void qt_desktopwidget_update_workarea (  ) 

Definition at line 40 of file qdesktopwidget_x11.cpp.

References qt_desktopwidget_workarea_dirty.

00041 {
00042     qt_desktopwidget_workarea_dirty = true;
00043 }

static void qt_detect_broken_window_manager (  )  [static]

Definition at line 997 of file qapplication_x11.cpp.

References QX11Info::appRootWindow(), ATOM, data, qt_broken_wm, Success, type, and X11.

00998 {
00999     Atom type;
01000     int format;
01001     ulong nitems, after;
01002     uchar *data = 0;
01003 
01004     // look for SGI's 4Dwm
01005     int e = XGetWindowProperty(X11->display, QX11Info::appRootWindow(),
01006                                ATOM(_SGI_DESKS_MANAGER), 0, 1, False, XA_WINDOW,
01007                                &type, &format, &nitems, &after, &data);
01008     if (data)
01009         XFree(data);
01010 
01011     if (e == Success && type == XA_WINDOW && format == 32 && nitems == 1 && after == 0) {
01012         // detected SGI 4Dwm
01013         qt_broken_wm = true;
01014     }
01015 }

Here is the call graph for this function:

static void qt_get_net_supported (  )  [static]

Definition at line 1019 of file qapplication_x11.cpp.

References a, QX11Info::appRootWindow(), ATOM, buffer, QBuffer::buffer(), data, QBuffer::open(), Success, type, QIODevice::write(), QIODevice::WriteOnly, and X11.

01020 {
01021     Atom type;
01022     int format;
01023     long offset = 0;
01024     unsigned long nitems, after;
01025     unsigned char *data = 0;
01026 
01027     int e = XGetWindowProperty(X11->display, QX11Info::appRootWindow(),
01028                                ATOM(_NET_SUPPORTED), 0, 0,
01029                                False, XA_ATOM, &type, &format, &nitems, &after, &data);
01030     if (data)
01031         XFree(data);
01032 
01033     if (X11->net_supported_list)
01034         delete [] X11->net_supported_list;
01035     X11->net_supported_list = 0;
01036 
01037     if (e == Success && type == XA_ATOM && format == 32) {
01038         QBuffer ts;
01039         ts.open(QIODevice::WriteOnly);
01040 
01041         while (after > 0) {
01042             XGetWindowProperty(X11->display, QX11Info::appRootWindow(),
01043                                ATOM(_NET_SUPPORTED), offset, 1024,
01044                                False, XA_ATOM, &type, &format, &nitems, &after, &data);
01045 
01046             if (type == XA_ATOM && format == 32) {
01047                 ts.write(reinterpret_cast<char *>(data), nitems * sizeof(long));
01048                 offset += nitems;
01049             } else
01050                 after = 0;
01051             if (data)
01052                 XFree(data);
01053         }
01054 
01055         // compute nitems
01056         QByteArray buffer(ts.buffer());
01057         nitems = buffer.size() / sizeof(Atom);
01058         X11->net_supported_list = new Atom[nitems + 1];
01059         Atom *a = (Atom *) buffer.data();
01060         uint i;
01061         for (i = 0; i < nitems; i++)
01062             X11->net_supported_list[i] = a[i];
01063         X11->net_supported_list[nitems] = 0;
01064     }
01065 }

Here is the call graph for this function:

static void qt_get_net_virtual_roots (  )  [static]

Definition at line 1087 of file qapplication_x11.cpp.

References a, QX11Info::appRootWindow(), ATOM, buffer, QBuffer::buffer(), data, QBuffer::open(), qt_net_supports(), Success, type, QIODevice::write(), QIODevice::WriteOnly, and X11.

01088 {
01089     if (X11->net_virtual_root_list)
01090         delete [] X11->net_virtual_root_list;
01091     X11->net_virtual_root_list = 0;
01092 
01093     if (!qt_net_supports(ATOM(_NET_VIRTUAL_ROOTS)))
01094         return;
01095 
01096     Atom type;
01097     int format;
01098     long offset = 0;
01099     unsigned long nitems, after;
01100     unsigned char *data;
01101 
01102     int e = XGetWindowProperty(X11->display, QX11Info::appRootWindow(),
01103                                ATOM(_NET_VIRTUAL_ROOTS), 0, 0,
01104                                False, XA_ATOM, &type, &format, &nitems, &after, &data);
01105     if (data)
01106         XFree(data);
01107 
01108     if (e == Success && type == XA_ATOM && format == 32) {
01109         QBuffer ts;
01110         ts.open(QIODevice::WriteOnly);
01111 
01112         while (after > 0) {
01113             XGetWindowProperty(X11->display, QX11Info::appRootWindow(),
01114                                ATOM(_NET_VIRTUAL_ROOTS), offset, 1024,
01115                                False, XA_ATOM, &type, &format, &nitems, &after, &data);
01116 
01117             if (type == XA_ATOM && format == 32) {
01118                 ts.write(reinterpret_cast<char *>(data), nitems * 4);
01119                 offset += nitems;
01120             } else
01121                 after = 0;
01122             if (data)
01123                 XFree(data);
01124         }
01125 
01126         // compute nitems
01127         QByteArray buffer(ts.buffer());
01128         nitems = buffer.size() / sizeof(Window);
01129         X11->net_virtual_root_list = new Window[nitems + 1];
01130         Window *a = (Window *) buffer.data();
01131         uint i;
01132         for (i = 0; i < nitems; i++)
01133             X11->net_virtual_root_list[i] = a[i];
01134         X11->net_virtual_root_list[nitems] = 0;
01135     }
01136 }

Here is the call graph for this function:

void qt_init ( QApplicationPrivate priv,
int  ,
Display display = 0,
Qt::HANDLE  visual = 0,
Qt::HANDLE  colormap = 0 
)

Definition at line 1229 of file qapplication_x11.cpp.

References appClass, appName, p, priv(), QByteArray::qstrdup(), and X11.

01231 {
01232     X11 = new QX11Data;
01233     X11->display = display;
01234     X11->displayName = 0;
01235     X11->foreignDisplay = (display != 0);
01236     X11->focus_model = -1;
01237 
01238     // RANDR
01239     X11->use_xrandr = false;
01240     X11->xrandr_major = 0;
01241     X11->xrandr_eventbase = 0;
01242     X11->xrandr_errorbase = 0;
01243 
01244     // RENDER
01245     X11->use_xrender = false;
01246     X11->xrender_major = 0;
01247     X11->xrender_version = 0;
01248 
01249     // XFIXES
01250     X11->use_xfixes = false;
01251     X11->xfixes_major = 0;
01252     X11->xfixes_eventbase = 0;
01253     X11->xfixes_errorbase = 0;
01254 
01255     // XInputExtension
01256     X11->use_xinput = false;
01257     X11->xinput_major = 0;
01258     X11->xinput_eventbase = 0;
01259     X11->xinput_errorbase = 0;
01260 
01261     X11->sip_serial = 0;
01262     X11->net_supported_list = 0;
01263     X11->net_virtual_root_list = 0;
01264     X11->wm_client_leader = 0;
01265     X11->screens = 0;
01266     X11->screenCount = 0;
01267     X11->time = CurrentTime;
01268     X11->userTime = CurrentTime;
01269     X11->ignore_badwindow = false;
01270     X11->seen_badwindow = false;
01271 
01272     X11->motifdnd_active = false;
01273 
01274     X11->default_im = QLatin1String("imsw-multi");
01275     priv->inputContext = 0;
01276 
01277     // colormap control
01278     X11->visual_class = -1;
01279     X11->visual_id = -1;
01280     X11->color_count = 0;
01281     X11->custom_cmap = false;
01282 
01283     // outside visual/colormap
01284     X11->visual = reinterpret_cast<Visual *>(visual);
01285     X11->colormap = colormap;
01286 
01287 #ifndef QT_NO_XRENDER
01288     memset(X11->solid_fills, 0, sizeof(X11->solid_fills));
01289     for (int i = 0; i < X11->solid_fill_count; ++i)
01290         X11->solid_fills[i].screen = -1;
01291     memset(X11->pattern_fills, 0, sizeof(X11->pattern_fills));
01292     for (int i = 0; i < X11->pattern_fill_count; ++i)
01293         X11->pattern_fills[i].screen = -1;
01294 #endif
01295 
01296     X11->startupId = 0;
01297 
01298     int argc = priv->argc;
01299     char **argv = priv->argv;
01300 
01301     if (X11->display) {
01302         // Qt part of other application
01303 
01304         // Set application name and class
01305         appName = qstrdup("Qt-subapplication");
01306         char *app_class = 0;
01307         if (argv) {
01308             const char* p = strrchr(argv[0], '/');
01309             app_class = qstrdup(p ? p + 1 : argv[0]);
01310             if (app_class[0])
01311                 app_class[0] = toupper(app_class[0]);
01312         }
01313         appClass = app_class;
01314     } else {
01315         // Qt controls everything (default)
01316 
01317         // Set application name and class
01318         char *app_class = 0;
01319         if (argv && argv[0]) {
01320             const char *p = strrchr(argv[0], '/');
01321             appName = p ? p + 1 : argv[0];
01322             app_class = qstrdup(appName);
01323             if (app_class[0])
01324                 app_class[0] = toupper(app_class[0]);
01325         }
01326         appClass = app_class;
01327     }
01328 
01329     // Install default error handlers
01330     original_x_errhandler = XSetErrorHandler(qt_x_errhandler);
01331     original_xio_errhandler = XSetIOErrorHandler(qt_xio_errhandler);
01332 
01333     // Get command line params
01334     int j = argc ? 1 : 0;
01335     for (int i=1; i<argc; i++) {
01336         if (argv[i] && *argv[i] != '-') {
01337             argv[j++] = argv[i];
01338             continue;
01339         }
01340         QByteArray arg(argv[i]);
01341         if (arg == "-display") {
01342             if (++i < argc && !X11->display)
01343                 X11->displayName = argv[i];
01344         } else if (arg == "-fn" || arg == "-font") {
01345             if (++i < argc)
01346                 appFont = argv[i];
01347         } else if (arg == "-bg" || arg == "-background") {
01348             if (++i < argc)
01349                 appBGCol = argv[i];
01350         } else if (arg == "-btn" || arg == "-button") {
01351             if (++i < argc)
01352                 appBTNCol = argv[i];
01353         } else if (arg == "-fg" || arg == "-foreground") {
01354             if (++i < argc)
01355                 appFGCol = argv[i];
01356         } else if (arg == "-name") {
01357             if (++i < argc)
01358                 appName = argv[i];
01359         } else if (arg == "-title") {
01360             if (++i < argc)
01361                 mwTitle = argv[i];
01362         } else if (arg == "-geometry") {
01363             if (++i < argc)
01364                 mwGeometry = argv[i];
01365         } else if (arg == "-im") {
01366             if (++i < argc)
01367                 qt_ximServer = argv[i];
01368 #if 0
01369         } else if (arg == "-noxim") {
01370             noxim=true;
01371 #endif
01372         } else if (arg == "-ncols") {   // xv and netscape use this name
01373             if (++i < argc)
01374                 X11->color_count = qMax(0,atoi(argv[i]));
01375         } else if (arg == "-visual") {  // xv and netscape use this name
01376             if (++i < argc && !X11->visual) {
01377                 QString s = QString::fromLocal8Bit(argv[i]).toLower();
01378                 if (s == QLatin1String("staticgray"))
01379                     X11->visual_class = StaticGray;
01380                 else if (s == QLatin1String("grayscale"))
01381                     X11->visual_class = XGrayScale;
01382                 else if (s == QLatin1String("staticcolor"))
01383                     X11->visual_class = StaticColor;
01384                 else if (s == QLatin1String("pseudocolor"))
01385                     X11->visual_class = PseudoColor;
01386                 else if (s == QLatin1String("truecolor"))
01387                     X11->visual_class = TrueColor;
01388                 else if (s == QLatin1String("directcolor"))
01389                     X11->visual_class = DirectColor;
01390                 else
01391                     X11->visual_id = static_cast<int>(strtol(argv[i], 0, 0));
01392             }
01393 #ifndef QT_NO_XIM
01394         } else if (arg == "-inputstyle") {
01395             if (++i < argc) {
01396                 QString s = QString::fromLocal8Bit(argv[i]).toLower();
01397                 if (s == QLatin1String("onthespot"))
01398                     qt_xim_preferred_style = XIMPreeditCallbacks |
01399                                              XIMStatusNothing;
01400                 else if (s == QLatin1String("overthespot"))
01401                     qt_xim_preferred_style = XIMPreeditPosition |
01402                                              XIMStatusNothing;
01403                 else if (s == QLatin1String("offthespot"))
01404                     qt_xim_preferred_style = XIMPreeditArea |
01405                                              XIMStatusArea;
01406                 else if (s == QLatin1String("root"))
01407                     qt_xim_preferred_style = XIMPreeditNothing |
01408                                              XIMStatusNothing;
01409             }
01410 #endif
01411         } else if (arg == "-cmap") {    // xv uses this name
01412             if (!X11->colormap)
01413                 X11->custom_cmap = true;
01414         }
01415 #if defined(QT_DEBUG)
01416         else if (arg == "-sync")
01417             appSync = !appSync;
01418         else if (arg == "-nograb")
01419             appNoGrab = !appNoGrab;
01420         else if (arg == "-dograb")
01421             appDoGrab = !appDoGrab;
01422 #endif
01423         else
01424             argv[j++] = argv[i];
01425     }
01426 
01427     priv->argc = j;
01428 
01429 #if defined(QT_DEBUG) && defined(Q_OS_LINUX)
01430     if (!appNoGrab && !appDoGrab) {
01431         QString s;
01432         s.sprintf("/proc/%d/cmdline", getppid());
01433         QFile f(s);
01434         if (f.open(QIODevice::ReadOnly)) {
01435             s.clear();
01436             char c;
01437             while (f.getChar(&c) && c) {
01438                 if (c == '/')
01439                     s.clear();
01440                 else
01441                     s += QLatin1Char(c);
01442             }
01443             if (s == QLatin1String("gdb")) {
01444                 appNoGrab = true;
01445                 qDebug("Qt: gdb: -nograb added to command-line options.\n"
01446                        "\t Use the -dograb option to enforce grabbing.");
01447             }
01448             f.close();
01449         }
01450     }
01451 #endif
01452 
01453     // Connect to X server
01454     if (qt_is_gui_used && !X11->display) {
01455         if ((X11->display = XOpenDisplay(X11->displayName)) == 0) {
01456             qWarning("%s: cannot connect to X server %s", appName,
01457                      XDisplayName(X11->displayName));
01458             QApplicationPrivate::reset_instance_pointer();
01459             exit(1);
01460         }
01461 
01462         if (appSync)                                // if "-sync" argument
01463             XSynchronize(X11->display, true);
01464     }
01465 
01466     // Common code, regardless of whether display is foreign.
01467 
01468     // Get X parameters
01469 
01470     if (qt_is_gui_used) {
01471         X11->defaultScreen = DefaultScreen(X11->display);
01472         X11->screenCount = ScreenCount(X11->display);
01473 
01474         X11->screens = new QX11InfoData[X11->screenCount];
01475 
01476         for (int s = 0; s < X11->screenCount; s++) {
01477             QX11InfoData *screen = X11->screens + s;
01478             screen->ref = 1; // ensures it doesn't get deleted
01479             screen->screen = s;
01480             screen->dpiX = (DisplayWidth(X11->display, s) * 254 + DisplayWidthMM(X11->display, s)*5)
01481                            / (DisplayWidthMM(X11->display, s)*10);
01482             screen->dpiY = (DisplayHeight(X11->display, s) * 254 + DisplayHeightMM(X11->display, s)*5)
01483                            / (DisplayHeightMM(X11->display, s)*10);
01484         }
01485 
01486         QColormap::initialize();
01487 
01488         // Support protocols
01489         X11->xdndSetup();
01490 
01491         // Finally create all atoms
01492         qt_x11_create_intern_atoms();
01493 
01494         // look for broken window managers
01495         qt_detect_broken_window_manager();
01496 
01497         // initialize NET lists
01498         qt_get_net_supported();
01499         qt_get_net_virtual_roots();
01500 
01501 #ifndef QT_NO_XRANDR
01502         // See if XRandR is supported on the connected display
01503         if (XQueryExtension(X11->display, "RANDR", &X11->xrandr_major,
01504                             &X11->xrandr_eventbase, &X11->xrandr_errorbase)
01505             && XRRQueryExtension(X11->display, &X11->xrandr_eventbase, &X11->xrandr_errorbase)) {
01506             // XRandR is supported
01507             X11->use_xrandr = true;
01508         }
01509 #endif // QT_NO_XRANDR
01510 
01511 #ifndef QT_NO_XRENDER
01512         int xrender_eventbase,  xrender_errorbase;
01513         // See if XRender is supported on the connected display
01514         if (XQueryExtension(X11->display, "RENDER", &X11->xrender_major,
01515                             &xrender_eventbase, &xrender_errorbase)
01516             && XRenderQueryExtension(X11->display, &xrender_eventbase,
01517                                      &xrender_errorbase)) {
01518             // XRender is supported, let's see if we have a PictFormat for the
01519             // default visual
01520             XRenderPictFormat *format =
01521                 XRenderFindVisualFormat(X11->display,
01522                                         (Visual *) QX11Info::appVisual(X11->defaultScreen));
01523             // Check the version as well - we need v0.4 or higher
01524             int major = 0;
01525             int minor = 0;
01526             XRenderQueryVersion(X11->display, &major, &minor);
01527             if (qgetenv("QT_X11_NO_XRENDER").isNull() && format != 0) {
01528                 X11->use_xrender = (major >= 0 && minor >= 5);
01529                 X11->xrender_version = major*100+minor;
01530                 // workaround for broken XServer on Ubuntu Breezy (6.8 compiled with 7.0
01531                 // protocol headers)
01532                 if (X11->xrender_version == 10
01533                     && VendorRelease(X11->display) < 60900000
01534                     && QByteArray(ServerVendor(X11->display)).contains("X.Org"))
01535                     X11->xrender_version = 9;
01536             }
01537         }
01538 #endif // QT_NO_XRENDER
01539 
01540 #ifndef QT_NO_XFIXES
01541         // See if Xfixes is supported on the connected display
01542         if (XQueryExtension(X11->display, "XFIXES", &X11->xfixes_major,
01543                             &X11->xfixes_eventbase, &X11->xfixes_errorbase)
01544             && XFixesQueryExtension(X11->display, &X11->xfixes_eventbase,
01545                                     &X11->xfixes_errorbase)) {
01546             // Xfixes is supported.
01547             // Note: the XFixes protocol version is negotiated using QueryVersion.
01548             // We supply the highest version we support, the X server replies with
01549             // the highest version it supports, but no higher than the version we
01550             // asked for. The version sent back is the protocol version the X server
01551             // will use to talk us. If this call is removed, the behavior of the
01552             // X server when it receives an XFixes request is undefined.
01553             int major = 3;
01554             int minor = 0;
01555             XFixesQueryVersion(X11->display, &major, &minor);
01556             X11->use_xfixes = (major >= 2);
01557             X11->xfixes_major = major;
01558         }
01559 #endif // QT_NO_XFIXES
01560 
01561         X11->has_fontconfig = false;
01562 #if !defined(QT_NO_FONTCONFIG)
01563         if (qgetenv("QT_X11_NO_FONTCONFIG").isNull())
01564             X11->has_fontconfig = FcInit();
01565 
01566         int dpi = 0;
01567         getXDefault("Xft", FC_DPI, &dpi);
01568         if (dpi) {
01569             for (int s = 0; s < ScreenCount(X11->display); ++s) {
01570                 QX11Info::setAppDpiX(s, dpi);
01571                 QX11Info::setAppDpiY(s, dpi);
01572             }
01573         }
01574         X11->fc_scale = 1.;
01575         getXDefault("Xft", FC_SCALE, &X11->fc_scale);
01576         for (int s = 0; s < ScreenCount(X11->display); ++s) {
01577             int subpixel = FC_RGBA_UNKNOWN;
01578 #if RENDER_MAJOR > 0 || RENDER_MINOR >= 6
01579             if (X11->use_xrender) {
01580                 int rsp = XRenderQuerySubpixelOrder(X11->display, s);
01581                 switch (rsp) {
01582                 default:
01583                 case SubPixelUnknown:
01584                     subpixel = FC_RGBA_UNKNOWN;
01585                     break;
01586                 case SubPixelHorizontalRGB:
01587                     subpixel = FC_RGBA_RGB;
01588                     break;
01589                 case SubPixelHorizontalBGR:
01590                     subpixel = FC_RGBA_BGR;
01591                     break;
01592                 case SubPixelVerticalRGB:
01593                     subpixel = FC_RGBA_VRGB;
01594                     break;
01595                 case SubPixelVerticalBGR:
01596                     subpixel = FC_RGBA_VBGR;
01597                     break;
01598                 case SubPixelNone:
01599                     subpixel = FC_RGBA_NONE;
01600                     break;
01601                 }
01602             }
01603 #endif
01604             getXDefault("Xft", FC_RGBA, &subpixel);
01605             X11->screens[s].subpixel = subpixel;
01606         }
01607         X11->fc_antialias = true;
01608         getXDefault("Xft", FC_ANTIALIAS, &X11->fc_antialias);
01609 #ifdef FC_HINT_STYLE
01610         getXDefault("Xft", FC_HINT_STYLE, &X11->fc_hint_style);
01611 #endif
01612 #if 0
01613         // ###### these are implemented by Xft, not sure we need them
01614         getXDefault("Xft", FC_AUTOHINT, &X11->fc_autohint);
01615         getXDefault("Xft", FC_HINTING, &X11->fc_autohint);
01616         getXDefault("Xft", FC_MINSPACE, &X11->fc_autohint);
01617 #endif
01618 #endif // QT_NO_XRENDER
01619 
01620         // initialize key mapper
01621         QKeyMapper::changeKeyboard();
01622 
01623 #ifndef QT_NO_XKB
01624         if (qt_keymapper_private()->useXKB) {
01625             // If XKB is detected, set the GrabsUseXKBState option so input method
01626             // compositions continue to work (ie. deadkeys)
01627             unsigned int state = XkbPCF_GrabsUseXKBStateMask;
01628             (void) XkbSetPerClientControls(X11->display, state, &state);
01629         }
01630 #endif // QT_NO_XKB
01631 
01632         // Misc. initialization
01633 #if 0 //disabled for now..
01634         QSegfaultHandler::initialize(priv->argv, priv->argc);
01635 #endif
01636         QFont::initialize();
01637         QCursorData::initialize();
01638     }
01639 
01640     if(qt_is_gui_used) {
01641         qApp->setObjectName(QString::fromLocal8Bit(appName));
01642 
01643         int screen;
01644         for (screen = 0; screen < X11->screenCount; ++screen) {
01645             XSelectInput(X11->display, QX11Info::appRootWindow(screen),
01646                          KeymapStateMask | EnterWindowMask | LeaveWindowMask | PropertyChangeMask);
01647 
01648 #ifndef QT_NO_XRANDR
01649             if (X11->use_xrandr)
01650                 XRRSelectInput(X11->display, QX11Info::appRootWindow(screen), True);
01651 #endif // QT_NO_XRANDR
01652         }
01653     }
01654 
01655     if (qt_is_gui_used) {
01656         // Attempt to determine the current running X11 Desktop Enviornment
01657         // Use dbus if/when we can, but fall back to using windowManagerName() for now
01658 
01659         X11->desktopEnvironment = DE_UNKNOWN;
01660 
01661         // See if the current window manager is using the freedesktop.org spec to give its name
01662         Window windowManagerWindow = XNone;
01663         Atom typeReturned;
01664         int formatReturned;
01665         unsigned long nitemsReturned;
01666         unsigned long unused;
01667         unsigned char *data = 0;
01668         if (XGetWindowProperty(QX11Info::display(), QX11Info::appRootWindow(),
01669                            ATOM(_NET_SUPPORTING_WM_CHECK),
01670                            0, 1024, False, XA_WINDOW, &typeReturned,
01671                            &formatReturned, &nitemsReturned, &unused, &data)
01672               == Success) {
01673             if (typeReturned == XA_WINDOW && formatReturned == 32)
01674                 windowManagerWindow = *((Window*) data);
01675             if (data)
01676                 XFree(data);
01677 
01678             if (windowManagerWindow != XNone) {
01679                 QString wmName;
01680                 Atom utf8atom = ATOM(UTF8_STRING);
01681                 if (XGetWindowProperty(QX11Info::display(), windowManagerWindow, ATOM(_NET_WM_NAME),
01682                                        0, 1024, False, utf8atom, &typeReturned,
01683                                        &formatReturned, &nitemsReturned, &unused, &data)
01684                     == Success) {
01685                     if (typeReturned == utf8atom && formatReturned == 8)
01686                         wmName = QString::fromUtf8((const char*)data);
01687                     if (data)
01688                         XFree(data);
01689                     if (wmName == QLatin1String("KWin"))
01690                         X11->desktopEnvironment = DE_KDE;
01691                     if (wmName == QLatin1String("Metacity"))
01692                         X11->desktopEnvironment = DE_GNOME;
01693                 }
01694             }
01695         }
01696 
01697         // Running a different/newer/older window manager?  Try some other things
01698         if (X11->desktopEnvironment == DE_UNKNOWN){
01699             Atom type;
01700             int format;
01701             unsigned long length, after;
01702             uchar *data = 0;
01703 
01704             if (XGetWindowProperty(X11->display, QX11Info::appRootWindow(), ATOM(DTWM_IS_RUNNING),
01705                                    0, 1, False, AnyPropertyType, &type, &format, &length,
01706                                    &after, &data) == Success && length) {
01707                 // DTWM is running, meaning most likely CDE is running...
01708                 X11->desktopEnvironment = DE_CDE;
01709             } else if (XGetWindowProperty(X11->display, QX11Info::appRootWindow(),
01710                                           ATOM(GNOME_BACKGROUND_PROPERTIES), 0, 1, False, AnyPropertyType,
01711                                           &type, &format, &length, &after, &data) == Success && length) {
01712                 X11->desktopEnvironment = DE_GNOME;
01713             } else if ((XGetWindowProperty(X11->display, QX11Info::appRootWindow(), ATOM(KDE_FULL_SESSION),
01714                                            0, 1, False, AnyPropertyType, &type, &format, &length, &after, &data) == Success
01715                         && length)
01716                        || (XGetWindowProperty(X11->display, QX11Info::appRootWindow(), ATOM(KWIN_RUNNING),
01717                                               0, 1, False, AnyPropertyType, &type, &format, &length,
01718                                               &after, &data) == Success
01719                            && length)
01720                        || (XGetWindowProperty(X11->display, QX11Info::appRootWindow(), ATOM(KWM_RUNNING),
01721                                               0, 1, False, AnyPropertyType, &type, &format, &length,
01722                                               &after, &data) == Success && length)) {
01723                 X11->desktopEnvironment = DE_KDE;
01724             }
01725             if (data)
01726                 XFree((char *)data);
01727         }
01728 
01729         qt_set_input_encoding();
01730 
01731         qt_set_x11_resources(appFont, appFGCol, appBGCol, appBTNCol);
01732 
01733         // be smart about the size of the default font. most X servers have helvetica
01734         // 12 point available at 2 resolutions:
01735         //     75dpi (12 pixels) and 100dpi (17 pixels).
01736         // At 95 DPI, a 12 point font should be 16 pixels tall - in which case a 17
01737         // pixel font is a closer match than a 12 pixel font
01738         int ptsz = (X11->use_xrender
01739                     ? 9
01740                     : (int) (((QX11Info::appDpiY() >= 95 ? 17. : 12.) *
01741                               72. / (float) QX11Info::appDpiY()) + 0.5));
01742 
01743         if (!qt_app_has_font) {
01744             QFont f(X11->has_fontconfig ? QLatin1String("Sans Serif") : QLatin1String("Helvetica"),
01745                     ptsz);
01746             QApplication::setFont(f);
01747         }
01748 
01749 #if !defined (QT_NO_TABLET)
01750         if (isXInputSupported(X11->display)) {
01751             int ndev,
01752                 i,
01753                 j;
01754             bool gotStylus,
01755                 gotEraser;
01756             XDeviceInfo *devices, *devs;
01757             XInputClassInfo *ip;
01758             XAnyClassPtr any;
01759             XValuatorInfoPtr v;
01760             XAxisInfoPtr a;
01761             XDevice *dev;
01762 
01763 #if !defined(Q_OS_IRIX)
01764             // XFree86 divides a stylus and eraser into 2 devices, so we must do for both...
01765             const QString XFREENAMESTYLUS = QLatin1String("stylus");
01766             const QString XFREENAMEPEN = QLatin1String("pen");
01767             const QString XFREENAMEERASER = QLatin1String("eraser");
01768 #endif
01769 
01770             devices = XListInputDevices(X11->display, &ndev);
01771             if (!devices) {
01772                 qWarning("QApplication: Failed to get list of devices");
01773                 ndev = -1;
01774             }
01775             QTabletEvent::TabletDevice deviceType;
01776             dev = 0;
01777             for (devs = devices, i = 0; i < ndev; i++, devs++) {
01778                 gotStylus = false;
01779                 gotEraser = false;
01780 
01781                 QString devName = QString::fromLocal8Bit(devs->name).toLower();
01782 #if defined(Q_OS_IRIX)
01783                 if (devName == QLatin1String(WACOM_NAME)) {
01784                     deviceType = QTabletEvent::Stylus;
01785                     gotStylus = true;
01786                 }
01787 #else
01788                 if (devName.startsWith(XFREENAMEPEN)
01789                     || devName.startsWith(XFREENAMESTYLUS)) {
01790                     deviceType = QTabletEvent::Stylus;
01791                     gotStylus = true;
01792                 } else if (devName.startsWith(XFREENAMEERASER)) {
01793                     deviceType = QTabletEvent::XFreeEraser;
01794                     gotEraser = true;
01795                 }
01796 #endif
01797 
01798                 if (gotStylus || gotEraser) {
01799                     dev = XOpenDevice(X11->display, devs->id);
01800 
01801                     if (!dev)
01802                         continue;
01803 
01804                     QTabletDeviceData device_data;
01805                     device_data.deviceType = deviceType;
01806                     device_data.eventCount = 0;
01807                     device_data.device = dev;
01808                     device_data.xinput_motion = -1;
01809                     device_data.xinput_key_press = -1;
01810                     device_data.xinput_key_release = -1;
01811                     device_data.xinput_button_press = -1;
01812                     device_data.xinput_button_release = -1;
01813                     device_data.xinput_proximity_in = -1;
01814                     device_data.xinput_proximity_out = -1;
01815 
01816                     if (dev->num_classes > 0) {
01817                         for (ip = dev->classes, j = 0; j < devs->num_classes;
01818                              ip++, j++) {
01819                             switch (ip->input_class) {
01820                             case KeyClass:
01821                                 DeviceKeyPress(dev, device_data.xinput_key_press,
01822                                                device_data.eventList[device_data.eventCount]);
01823                                 if (device_data.eventList[device_data.eventCount])
01824                                     ++device_data.eventCount;
01825                                 DeviceKeyRelease(dev, device_data.xinput_key_release,
01826                                                  device_data.eventList[device_data.eventCount]);
01827                                 if (device_data.eventList[device_data.eventCount])
01828                                     ++device_data.eventCount;
01829                                 break;
01830                             case ButtonClass:
01831                                 DeviceButtonPress(dev, device_data.xinput_button_press,
01832                                                   device_data.eventList[device_data.eventCount]);
01833                                 if (device_data.eventList[device_data.eventCount])
01834                                     ++device_data.eventCount;
01835                                 DeviceButtonRelease(dev, device_data.xinput_button_release,
01836                                                     device_data.eventList[device_data.eventCount]);
01837                                 if (device_data.eventList[device_data.eventCount])
01838                                     ++device_data.eventCount;
01839                                 break;
01840                             case ValuatorClass:
01841                                 // I'm only going to be interested in motion when the
01842                                 // stylus is already down anyway!
01843                                 DeviceMotionNotify(dev, device_data.xinput_motion,
01844                                                    device_data.eventList[device_data.eventCount]);
01845                                 if (device_data.eventList[device_data.eventCount])
01846                                     ++device_data.eventCount;
01847                                 ProximityIn(dev, device_data.xinput_proximity_in, device_data.eventList[device_data.eventCount]);
01848                                 if (device_data.eventList[device_data.eventCount])
01849                                     ++device_data.eventCount;
01850                                 ProximityOut(dev, device_data.xinput_proximity_out, device_data.eventList[device_data.eventCount]);
01851                                 if (device_data.eventList[device_data.eventCount])
01852                                     ++device_data.eventCount;
01853                             default:
01854                                 break;
01855                             }
01856                         }
01857                     }
01858 
01859                     // get the min/max value for pressure!
01860                     any = (XAnyClassPtr) (devs->inputclassinfo);
01861                     for (j = 0; j < devs->num_classes; j++) {
01862                         if (any->c_class == ValuatorClass) {
01863                             v = (XValuatorInfoPtr) any;
01864                             a = (XAxisInfoPtr) ((char *) v +
01865                                                 sizeof (XValuatorInfo));
01866 #if defined (Q_OS_IRIX)
01867                             // I'm not exaclty wild about this, but the
01868                             // dimensions of the tablet are more relevant here
01869                             // than the min and max values from the axis
01870                             // (actually it seems to be 2/3 or what is in the
01871                             // axis.  So we'll try to parse it from this
01872                             // string. --tws
01873                             char returnString[SGIDeviceRtrnLen];
01874                             int tmp;
01875                             if (XSGIMiscQueryExtension(X11->display, &tmp, &tmp)
01876                                 && XSGIDeviceQuery(X11->display, devs->id,
01877                                                    "dimensions", returnString)) {
01878                                 QString str = QLatin1String(returnString);
01879                                 int comma = str.indexOf(',');
01880                                 device_data.minX = 0;
01881                                 device_data.minY = 0;
01882                                 device_data.maxX = str.left(comma).toInt();
01883                                 device_data.maxY = str.mid(comma + 1).toInt();
01884                             } else {
01885                                 device_data.minX = a[WAC_XCOORD_I].min_value;
01886                                 device_data.maxX = a[WAC_XCOORD_I].max_value;
01887                                 device_data.minY = a[WAC_YCOORD_I].min_value;
01888                                 device_data.maxY = a[WAC_YCOORD_I].max_value;
01889                             }
01890                             device_data.minPressure = a[WAC_PRESSURE_I].min_value;
01891                             device_data.maxPressure = a[WAC_PRESSURE_I].max_value;
01892                             device_data.minTanPressure = a[WAC_TAN_PRESSURE_I].min_value;
01893                             device_data.maxTanPressure = a[WAC_TAN_PRESSURE_I].max_value;
01894                             device_data.minZ = a[WAC_ZCOORD_I].min_value;
01895                             device_data.maxZ = a[WAC_ZCOORD_I].max_value;
01896 #else
01897                             device_data.minX = a[0].min_value;
01898                             device_data.maxX = a[0].max_value;
01899                             device_data.minY = a[1].min_value;
01900                             device_data.maxY = a[1].max_value;
01901                             device_data.minPressure = a[2].min_value;
01902                             device_data.maxPressure = a[2].max_value;
01903                             device_data.minTanPressure = 0;
01904                             device_data.maxTanPressure = 0;
01905                             device_data.minZ = 0;
01906                             device_data.maxZ = 0;
01907 #endif
01908 
01909                             // got the max pressure no need to go further...
01910                             break;
01911                         }
01912                         any = (XAnyClassPtr) ((char *) any + any->length);
01913                     } // end of for loop
01914 
01915                     tablet_devices()->append(device_data);
01916                 } // if (gotStylus || gotEraser)
01917             }
01918             XFreeDeviceList(devices);
01919         }
01920 #endif // QT_NO_TABLET
01921 
01922         X11->startupId = getenv("DESKTOP_STARTUP_ID");
01923         putenv(strdup("DESKTOP_STARTUP_ID="));
01924 
01925    } else {
01926         // read some non-GUI settings when not using the X server...
01927 
01928         if (QApplication::desktopSettingsAware()) {
01929             QSettings settings(QSettings::UserScope, QLatin1String("Trolltech"));
01930             settings.beginGroup(QLatin1String("Qt"));
01931 
01932             // read library (ie. plugin) path list
01933             QString libpathkey = QString(QLatin1String("%1.%2/libraryPath"))
01934                                  .arg(QT_VERSION >> 16)
01935                                  .arg((QT_VERSION & 0xff00) >> 8);
01936             QStringList pathlist =
01937                 settings.value(libpathkey).toString().split(QLatin1Char(':'));
01938             if (! pathlist.isEmpty()) {
01939                 QStringList::ConstIterator it = pathlist.constBegin();
01940                 while (it != pathlist.constEnd())
01941                     QApplication::addLibraryPath(*it++);
01942             }
01943 
01944             QString defaultcodec = settings.value(QLatin1String("defaultCodec"),
01945                                                   QVariant(QLatin1String("none"))).toString();
01946             if (defaultcodec != QLatin1String("none")) {
01947                 QTextCodec *codec = QTextCodec::codecForName(defaultcodec.toLatin1());
01948                 if (codec)
01949                     QTextCodec::setCodecForTr(codec);
01950             }
01951 
01952             settings.endGroup(); // Qt
01953         }
01954     }
01955 }

Here is the call graph for this function:

bool qt_net_supports ( Atom  atom  ) 

Definition at line 1068 of file qapplication_x11.cpp.

References X11.

Referenced by QDialog::adjustPosition(), QDesktopWidget::availableGeometry(), QWidgetPrivate::create_sys(), qt_get_net_virtual_roots(), QWidgetPrivate::setGeometry_sys(), QWidget::setWindowState(), QWidgetPrivate::show_sys(), QETWidget::translateConfigEvent(), QETWidget::translatePropertyEvent(), and QWidgetPrivate::updateFrameStrut().

01069 {
01070     if (! X11->net_supported_list)
01071         return false;
01072 
01073     bool supported = false;
01074     int i = 0;
01075     while (X11->net_supported_list[i] != 0) {
01076         if (X11->net_supported_list[i++] == atom) {
01077             supported = true;
01078             break;
01079         }
01080     }
01081 
01082     return supported;
01083 }

static void qt_net_update_user_time ( QWidget tlw  )  [static]

Definition at line 1138 of file qapplication_x11.cpp.

References ATOM, QWidget::internalWinId(), QWidget::testAttribute(), Qt::WA_WState_Created, and X11.

01139 {
01140     Q_ASSERT(tlw->testAttribute(Qt::WA_WState_Created));
01141     XChangeProperty(X11->display, tlw->internalWinId(), ATOM(_NET_WM_USER_TIME),
01142                     XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &X11->userTime, 1);
01143 }

Here is the call graph for this function:

bool qt_nograb (  ) 

Definition at line 2121 of file qapplication_x11.cpp.

Referenced by QApplicationPrivate::closePopup(), QWidget::grabKeyboard(), QWidget::grabMouse(), QApplicationPrivate::openPopup(), QWidget::releaseKeyboard(), and QWidget::releaseMouse().

02122 {
02123 #if defined(QT_DEBUG)
02124     return appNoGrab;
02125 #else
02126     return false;
02127 #endif
02128 }

void qt_save_rootinfo (  )  [static]

Definition at line 2059 of file qapplication_x11.cpp.

References QX11Info::appRootWindow(), ATOM, Success, and X11.

Referenced by qt_cleanup().

02060 {
02061     Atom type;
02062     int format;
02063     unsigned long length, after;
02064     uchar *data = 0;
02065 
02066     if (ATOM(_XSETROOT_ID)) {                        // kill old pixmap
02067         if (XGetWindowProperty(X11->display, QX11Info::appRootWindow(),
02068                                  ATOM(_XSETROOT_ID), 0, 1,
02069                                  True, AnyPropertyType, &type, &format,
02070                                  &length, &after, &data) == Success) {
02071             if (type == XA_PIXMAP && format == 32 && length == 1 &&
02072                  after == 0 && data) {
02073                 XKillClient(X11->display, *((Pixmap*)data));
02074             }
02075             Pixmap dummy = XCreatePixmap(X11->display, QX11Info::appRootWindow(),
02076                                           1, 1, 1);
02077             XChangeProperty(X11->display, QX11Info::appRootWindow(),
02078                              ATOM(_XSETROOT_ID), XA_PIXMAP, 32,
02079                              PropModeReplace, (uchar *)&dummy, 1);
02080             XSetCloseDownMode(X11->display, RetainPermanent);
02081         }
02082     }
02083     if (data)
02084         XFree((char *)data);
02085 }

Here is the call graph for this function:

bool qt_sendSpontaneousEvent ( QObject receiver,
QEvent event 
)

Definition at line 4185 of file qapplication_x11.cpp.

References QCoreApplication::sendSpontaneousEvent().

Referenced by QKeyMapper::changeKeyboard(), QWidgetPrivate::drawWidget(), and QKeyMapper::sendKeyEvent().

04186 {
04187     return QCoreApplication::sendSpontaneousEvent(receiver, event);
04188 }

Here is the call graph for this function:

static void qt_set_input_encoding (  )  [static]

Definition at line 719 of file qapplication_x11.cpp.

References QX11Info::appRootWindow(), ATOM, QTextCodec::codecForLocale(), QTextCodec::codecForName(), data, QTextCodec::mibEnum(), QByteArray::qstricmp(), qt_input_mapper, Success, type, X11, and XNone.

00720 {
00721     Atom type;
00722     int format;
00723     ulong  nitems, after = 1;
00724     const char *data = 0;
00725 
00726     int e = XGetWindowProperty(X11->display, QX11Info::appRootWindow(),
00727                                 ATOM(_QT_INPUT_ENCODING), 0, 1024,
00728                                 False, XA_STRING, &type, &format, &nitems,
00729                                 &after, (unsigned char**)&data);
00730     if (e != Success || !nitems || type == XNone) {
00731         // Always use the locale codec, since we have no examples of non-local
00732         // XIMs, and since we cannot get a sensible answer about the encoding
00733         // from the XIM.
00734         qt_input_mapper = QTextCodec::codecForLocale();
00735 
00736     } else {
00737         if (!qstricmp(data, "locale"))
00738             qt_input_mapper = QTextCodec::codecForLocale();
00739         else
00740             qt_input_mapper = QTextCodec::codecForName(data);
00741         // make sure we have an input codec
00742         if(!qt_input_mapper)
00743             qt_input_mapper = QTextCodec::codecForName("ISO 8859-1");
00744     }
00745     if (qt_input_mapper && qt_input_mapper->mibEnum() == 11) // 8859-8
00746         qt_input_mapper = QTextCodec::codecForName("ISO 8859-8-I");
00747     if(data)
00748         XFree((char *)data);
00749 }

Here is the call graph for this function:

static void qt_set_x11_resources ( const char *  font = 0,
const char *  fg = 0,
const char *  bg = 0,
const char *  button = 0 
) [static]

Definition at line 753 of file qapplication_x11.cpp.

References QPalette::Active, QColor::alpha, appClass, QX11Info::appDpiY(), appName, QX11Info::appRootWindow(), QString::at(), ATOM, base, QColor::blue, QPalette::Button, QStringList::contains(), QColor::dark(), Qt::darkBlue, data, QApplication::desktopSettingsAware(), QPalette::Disabled, QApplication::font(), QString::fromLatin1(), QString::fromLocal8Bit(), QColor::getHsv(), QColor::green, QPalette::Highlight, QPalette::HighlightedText, QColor::hue, QString::indexOf(), QString::isEmpty(), QUnicodeTables::isSpace(), QColor::isValid(), key, l, QString::left(), QString::length(), QColor::light(), QString::mid(), QFontInfo::pixelSize(), QFontInfo::pointSize(), qRound(), qt_app_has_font, QFontInfo::rawMode(), QColor::red, QString::right(), s, QApplication::setEffectEnabled(), QApplication::setFont(), QColor::setHsv(), QApplicationPrivate::setSystemPalette(), QString::simplified(), QString::split(), QApplication::style(), QApplicationPrivate::sys_pal, QString::toLower(), QString::trimmed(), type, Qt::UI_AnimateCombo, Qt::UI_AnimateMenu, Qt::UI_AnimateToolBox, Qt::UI_AnimateTooltip, Qt::UI_FadeMenu, Qt::UI_FadeTooltip, Qt::UI_General, value, QColor::value, Qt::white, QPalette::Window, QPalette::WindowText, X11, and XNone.

00755 {
00756 
00757     QString resFont, resFG, resBG, resEF, sysFont, selectBackground, selectForeground;
00758 
00759     QApplication::setEffectEnabled(Qt::UI_General, false);
00760     QApplication::setEffectEnabled(Qt::UI_AnimateMenu, false);
00761     QApplication::setEffectEnabled(Qt::UI_FadeMenu, false);
00762     QApplication::setEffectEnabled(Qt::UI_AnimateCombo, false);
00763     QApplication::setEffectEnabled(Qt::UI_AnimateTooltip, false);
00764     QApplication::setEffectEnabled(Qt::UI_FadeTooltip, false);
00765     QApplication::setEffectEnabled(Qt::UI_AnimateToolBox, false);
00766 
00767     bool paletteAlreadySet = false;
00768     if (QApplication::desktopSettingsAware()) {
00769         // first, read from settings
00770         QApplicationPrivate::x11_apply_settings();
00771 
00772         // the call to QApplication::style() below creates the system
00773         // palette, which breaks the logic after the RESOURCE_MANAGER
00774         // loop... so I have to save this value to be able to use it later
00775         paletteAlreadySet = (QApplicationPrivate::sys_pal != 0);
00776 
00777         // second, parse the RESOURCE_MANAGER property
00778         int format;
00779         ulong  nitems, after = 1;
00780         QString res;
00781         long offset = 0;
00782         Atom type = XNone;
00783 
00784         while (after > 0) {
00785             uchar *data = 0;
00786             XGetWindowProperty(X11->display, QX11Info::appRootWindow(0),
00787                                ATOM(RESOURCE_MANAGER),
00788                                offset, 8192, False, AnyPropertyType,
00789                                &type, &format, &nitems, &after,
00790                                &data);
00791             if (type == XA_STRING)
00792                 res += QString::fromLatin1((char*)data);
00793             else
00794                 res += QString::fromLocal8Bit((char*)data);
00795             offset += 2048; // offset is in 32bit quantities... 8192/4 == 2048
00796             if (data)
00797                 XFree((char *)data);
00798         }
00799 
00800         QString key, value;
00801         int l = 0, r;
00802         QString apn = QString::fromLocal8Bit(appName);
00803         QString apc = QString::fromLocal8Bit(appClass);
00804         int apnl = apn.length();
00805         int apcl = apc.length();
00806         int resl = res.length();
00807 
00808         while (l < resl) {
00809             r = res.indexOf(QLatin1Char('\n'), l);
00810             if (r < 0)
00811                 r = resl;
00812             while (QUnicodeTables::isSpace(res.at(l)))
00813                 l++;
00814             bool mine = false;
00815             QChar sc = res.at(l + 1);
00816             if (res.at(l) == QLatin1Char('*') &&
00817                 (sc == QLatin1Char('f') || sc == QLatin1Char('b') || sc == QLatin1Char('g') ||
00818                  sc == QLatin1Char('F') || sc == QLatin1Char('B') || sc == QLatin1Char('G') ||
00819                  sc == QLatin1Char('s') || sc == QLatin1Char('S')
00820                  // capital T only, since we're looking for "Text.selectSomething"
00821                  || sc == QLatin1Char('T'))) {
00822                 // OPTIMIZED, since we only want "*[fbgsT].."
00823                 QString item = res.mid(l, r - l).simplified();
00824                 int i = item.indexOf(QLatin1Char(':'));
00825                 key = item.left(i).trimmed().mid(1).toLower();
00826                 value = item.right(item.length() - i - 1).trimmed();
00827                 mine = true;
00828             } else if (apnl && res.at(l) == apn.at(0) || (appClass && apcl && res.at(l) == apc.at(0))) {
00829                 if (res.mid(l,apnl) == apn && (res.at(l+apnl) == QLatin1Char('.')
00830                                                || res.at(l+apnl) == QLatin1Char('*'))) {
00831                     QString item = res.mid(l, r - l).simplified();
00832                     int i = item.indexOf(QLatin1Char(':'));
00833                     key = item.left(i).trimmed().mid(apnl+1).toLower();
00834                     value = item.right(item.length() - i - 1).trimmed();
00835                     mine = true;
00836                 } else if (res.mid(l,apcl) == apc && (res.at(l+apcl) == QLatin1Char('.')
00837                                                       || res.at(l+apcl) == QLatin1Char('*'))) {
00838                     QString item = res.mid(l, r - l).simplified();
00839                     int i = item.indexOf(QLatin1Char(':'));
00840                     key = item.left(i).trimmed().mid(apcl+1).toLower();
00841                     value = item.right(item.length() - i - 1).trimmed();
00842                     mine = true;
00843                 }
00844             }
00845 
00846             if (mine) {
00847                 if (!font && key == QLatin1String("systemfont"))
00848                     sysFont = value.left(value.lastIndexOf(QLatin1Char(':')));
00849                 if (!font && key == QLatin1String("font"))
00850                     resFont = value;
00851                 else if (!fg && !paletteAlreadySet) {
00852                     if (key == QLatin1String("foreground"))
00853                         resFG = value;
00854                     else if (!bg && key == QLatin1String("background"))
00855                         resBG = value;
00856                     else if (key == QLatin1String("text.selectbackground")) {
00857                         selectBackground = value;
00858                     } else if (key == QLatin1String("text.selectforeground")) {
00859                         selectForeground = value;
00860                     }
00861                 } else if (key == QLatin1String("guieffects"))
00862                     resEF = value;
00863                 // NOTE: if you add more, change the [fbg] stuff above
00864             }
00865 
00866             l = r + 1;
00867         }
00868     }
00869     if (!sysFont.isEmpty())
00870         resFont = sysFont;
00871     if (resFont.isEmpty())
00872         resFont = QString::fromLocal8Bit(font);
00873     if (resFG.isEmpty())
00874         resFG = QString::fromLocal8Bit(fg);
00875     if (resBG.isEmpty())
00876         resBG = QString::fromLocal8Bit(bg);
00877     if (!qt_app_has_font && !resFont.isEmpty()) { // set application font
00878         QFont fnt;
00879         fnt.setRawName(resFont);
00880 
00881         // the font we get may actually be an alias for another font,
00882         // so we reset the application font to the real font info.
00883         if (! fnt.exactMatch()) {
00884             QFontInfo fontinfo(fnt);
00885             fnt.setFamily(fontinfo.family());
00886             fnt.setRawMode(fontinfo.rawMode());
00887 
00888             if (! fnt.rawMode()) {
00889                 fnt.setItalic(fontinfo.italic());
00890                 fnt.setWeight(fontinfo.weight());
00891                 fnt.setUnderline(fontinfo.underline());
00892                 fnt.setStrikeOut(fontinfo.strikeOut());
00893                 fnt.setStyleHint(fontinfo.styleHint());
00894 
00895                 if (fnt.pointSize() <= 0 && fnt.pixelSize() <= 0) {
00896                     // size is all wrong... fix it
00897                     qreal pointSize = fontinfo.pixelSize() * 72. / (float) QX11Info::appDpiY();
00898                     if (pointSize <= 0)
00899                         pointSize = 12;
00900                     fnt.setPointSize(qRound(pointSize));
00901                 }
00902             }
00903         }
00904 
00905         if (fnt != QApplication::font()) {
00906             QApplication::setFont(fnt);
00907         }
00908     }
00909 
00910     if ((button || !resBG.isEmpty() || !resFG.isEmpty())) {// set app colors
00911         (void) QApplication::style();  // trigger creation of application style and system palettes
00912         QColor btn;
00913         QColor bg;
00914         QColor fg;
00915         if (!resBG.isEmpty())
00916             bg = QColor(resBG);
00917         if (!bg.isValid())
00918             bg = QApplicationPrivate::sys_pal->color(QPalette::Active, QPalette::Window);
00919 
00920         if (!resFG.isEmpty())
00921             fg = QColor(resFG);
00922         if (!fg.isValid())
00923             fg = QApplicationPrivate::sys_pal->color(QPalette::Active, QPalette::WindowText);
00924 
00925         if (button)
00926             btn = QColor(QString::fromLocal8Bit(button));
00927         else if (!resBG.isEmpty())
00928             btn = bg;
00929         if (!btn.isValid())
00930             btn = QApplicationPrivate::sys_pal->color(QPalette::Active, QPalette::Button);
00931 
00932         int h,s,v;
00933         fg.getHsv(&h,&s,&v);
00934         QColor base = Qt::white;
00935         bool bright_mode = false;
00936         if (v >= 255-50) {
00937             base = btn.dark(150);
00938             bright_mode = true;
00939         }
00940 
00941         QPalette pal(fg, btn, btn.light(), btn.dark(), btn.dark(150), fg, Qt::white, base, bg);
00942         QColor disabled((fg.red()   + btn.red())  / 2,
00943                         (fg.green() + btn.green())/ 2,
00944                         (fg.blue()  + btn.blue()) / 2);
00945         pal.setColorGroup(QPalette::Disabled, disabled, btn, btn.light(125),
00946                           btn.dark(), btn.dark(150), disabled, Qt::white, Qt::white, bg);
00947 
00948         QColor highlight, highlightText;
00949         if (!selectBackground.isEmpty() && !selectForeground.isEmpty()) {
00950             highlight = QColor(selectBackground);
00951             highlightText = QColor(selectForeground);
00952         }
00953 
00954         if (highlight.isValid() && highlightText.isValid()) {
00955             pal.setColor(QPalette::Highlight, highlight);
00956             pal.setColor(QPalette::HighlightedText, highlightText);
00957 
00958             // calculate disabled colors by removing saturation
00959             highlight.setHsv(highlight.hue(), 0, highlight.value(), highlight.alpha());
00960             highlightText.setHsv(highlightText.hue(), 0, highlightText.value(), highlightText.alpha());
00961             pal.setColor(QPalette::Disabled, QPalette::Highlight, highlight);
00962             pal.setColor(QPalette::Disabled, QPalette::HighlightedText, highlightText);
00963         } else if (bright_mode) {
00964             pal.setColor(QPalette::HighlightedText, base);
00965             pal.setColor(QPalette::Highlight, Qt::white);
00966             pal.setColor(QPalette::Disabled, QPalette::HighlightedText, base);
00967             pal.setColor(QPalette::Disabled, QPalette::Highlight, Qt::white);
00968         } else {
00969             pal.setColor(QPalette::HighlightedText, Qt::white);
00970             pal.setColor(QPalette::Highlight, Qt::darkBlue);
00971             pal.setColor(QPalette::Disabled, QPalette::HighlightedText, Qt::white);
00972             pal.setColor(QPalette::Disabled, QPalette::Highlight, Qt::darkBlue);
00973         }
00974 
00975         QApplicationPrivate::setSystemPalette(pal);
00976     }
00977 
00978     if (!resEF.isEmpty()) {
00979         QStringList effects = resEF.split(QLatin1Char(' '));
00980         QApplication::setEffectEnabled(Qt::UI_General, effects.contains(QLatin1String("general")));
00981         QApplication::setEffectEnabled(Qt::UI_AnimateMenu,
00982                                        effects.contains(QLatin1String("animatemenu")));
00983         QApplication::setEffectEnabled(Qt::UI_FadeMenu,
00984                                        effects.contains(QLatin1String("fademenu")));
00985         QApplication::setEffectEnabled(Qt::UI_AnimateCombo,
00986                                        effects.contains(QLatin1String("animatecombo")));
00987         QApplication::setEffectEnabled(Qt::UI_AnimateTooltip,
00988                                        effects.contains(QLatin1String("animatetooltip")));
00989         QApplication::setEffectEnabled(Qt::UI_FadeTooltip,
00990                                        effects.contains(QLatin1String("fadetooltip")));
00991         QApplication::setEffectEnabled(Qt::UI_AnimateToolBox,
00992                                        effects.contains(QLatin1String("animatetoolbox")));
00993     }
00994 }

Here is the call graph for this function:

QTabletDeviceDataList* qt_tablet_devices (  ) 

Definition at line 314 of file qapplication_x11.cpp.

Referenced by QWidgetPrivate::create_sys(), qt_cleanup(), and QETWidget::translateMouseEvent().

00315 {
00316     return tablet_devices();
00317 }

bool qt_try_modal ( QWidget ,
XEvent *   
)

Definition at line 3156 of file qapplication_x11.cpp.

References qt_button_down, qt_xdnd_dragging, QApplicationPrivate::tryModalHelper(), XKeyPress, and XKeyRelease.

03157 {
03158     if (qt_xdnd_dragging) {
03159         // allow mouse events while DnD is active
03160         switch (event->type) {
03161         case ButtonPress:
03162         case ButtonRelease:
03163         case MotionNotify:
03164             return true;
03165         default:
03166             break;
03167         }
03168     }
03169 
03170     // allow mouse release events to be sent to widgets that have been pressed
03171     if (event->type == ButtonRelease && widget == qt_button_down)
03172         return true;
03173 
03174     if (QApplicationPrivate::tryModalHelper(widget))
03175         return true;
03176 
03177     // disallow mouse/key events
03178     switch (event->type) {
03179     case ButtonPress:
03180     case ButtonRelease:
03181     case MotionNotify:
03182     case XKeyPress:
03183     case XKeyRelease:
03184     case EnterNotify:
03185     case LeaveNotify:
03186     case ClientMessage:
03187         return false;
03188     default:
03189         break;
03190     }
03191 
03192     return true;
03193 }

Here is the call graph for this function:

void qt_updated_rootinfo (  ) 

Definition at line 2087 of file qapplication_x11.cpp.

References app_save_rootinfo.

02088 {
02089     app_save_rootinfo = true;
02090 }

bool qt_wstate_iconified ( WId  winid  ) 

Definition at line 2092 of file qapplication_x11.cpp.

References ATOM, Success, and X11.

02093 {
02094     Atom type;
02095     int format;
02096     unsigned long length, after;
02097     uchar *data = 0;
02098     int r = XGetWindowProperty(X11->display, winid, ATOM(WM_STATE), 0, 2,
02099                                  False, AnyPropertyType, &type, &format,
02100                                  &length, &after, &data);
02101     bool iconic = false;
02102     if (r == Success && data && format == 32) {
02103         // quint32 *wstate = (quint32*)data;
02104         unsigned long *wstate = (unsigned long *) data;
02105         iconic = (*wstate == IconicState);
02106         XFree((char *)data);
02107     }
02108     return iconic;
02109 }

Q_GUI_EXPORT void qt_x11_apply_settings_in_all_apps (  ) 

Definition at line 505 of file qapplication_x11.cpp.

References QX11Info::appRootWindow(), ATOM, QDateTime::currentDateTime(), QByteArray::data(), QX11Info::display(), s, QByteArray::size(), and QIODevice::WriteOnly.

Referenced by MainWindow::fileSave().

00506 {
00507     QByteArray stamp;
00508     QDataStream s(&stamp, QIODevice::WriteOnly);
00509     s << QDateTime::currentDateTime();
00510 
00511     XChangeProperty(QX11Info::display(), QX11Info::appRootWindow(0),
00512                     ATOM(_QT_SETTINGS_TIMESTAMP), ATOM(_QT_SETTINGS_TIMESTAMP), 8,
00513                     PropModeReplace, (unsigned char *)stamp.data(), stamp.size());
00514 }

Here is the call graph for this function:

static void qt_x11_create_intern_atoms (  )  [static]

Definition at line 477 of file qapplication_x11.cpp.

References i, QX11Data::NAtoms, QX11Data::NPredefinedAtoms, ptr, X11, and x11_atomnames.

00478 {
00479     const char *names[QX11Data::NAtoms];
00480     const char *ptr = x11_atomnames;
00481 
00482     int i = 0;
00483     while (*ptr) {
00484         names[i++] = ptr;
00485         while (*ptr)
00486             ++ptr;
00487         ++ptr;
00488     }
00489 
00490     Q_ASSERT(i == QX11Data::NPredefinedAtoms);
00491 
00492     QByteArray settings_atom_name("_QT_SETTINGS_TIMESTAMP_");
00493     settings_atom_name += XDisplayName(X11->displayName);
00494     names[i++] = settings_atom_name;
00495 
00496     Q_ASSERT(i == QX11Data::NAtoms);
00497 #if defined(XlibSpecificationRelease) && (XlibSpecificationRelease >= 6)
00498     XInternAtoms(X11->display, (char **)names, i, False, X11->atoms);
00499 #else
00500     for (i = 0; i < QX11Data::NAtoms; ++i)
00501         X11->atoms[i] = XInternAtom(X11->display, (char *)names[i], False);
00502 #endif
00503 }

void qt_x11_enforce_cursor ( QWidget w  ) 

Definition at line 268 of file qwidget_x11.cpp.

References QApplication::overrideCursor(), w, Qt::WA_SetCursor, Qt::WA_WState_Created, X11, and XNone.

Referenced by QWidgetPrivate::create_sys(), QApplication::restoreOverrideCursor(), QWidgetPrivate::setCursor_sys(), QWidgetPrivate::setEnabled_helper(), QApplication::setOverrideCursor(), and QWidgetPrivate::unsetCursor_sys().

00269 {
00270     if (!w->testAttribute(Qt::WA_WState_Created))
00271         return;
00272     if (w->testAttribute(Qt::WA_SetCursor)) {
00273         QCursor *oc = QApplication::overrideCursor();
00274         if (oc) {
00275             XDefineCursor(X11->display, w->internalWinId(), oc->handle());
00276         } else if (w->isEnabled()) {
00277             XDefineCursor(X11->display, w->internalWinId(), w->cursor().handle());
00278         } else {
00279             // enforce the windows behavior of clearing the cursor on
00280             // disabled widgets
00281             XDefineCursor(X11->display, w->internalWinId(), XNone);
00282         }
00283     } else {
00284         XDefineCursor(X11->display, w->internalWinId(), XNone);
00285     }
00286 }

Here is the call graph for this function:

static bool qt_x11EventFilter ( XEvent *  ev  )  [static]

Definition at line 322 of file qapplication_x11.cpp.

References qApp.

Referenced by QETWidget::translateConfigEvent(), QETWidget::translateMouseEvent(), and QETWidget::translatePaintEvent().

00323 {
00324     long unused;
00325     if (qApp->filterEvent(ev, &unused))
00326         return true;
00327     return qApp->x11EventFilter(ev);
00328 }

static int qt_x_errhandler ( Display dpy,
XErrorEvent *  err 
) [static]

Definition at line 394 of file qapplication_x11.cpp.

References buffer, QByteArray::qsnprintf(), qWarning(), and X11.

00395 {
00396     if (err->error_code == BadWindow) {
00397         X11->seen_badwindow = true;
00398         if (err->request_code == 25 /* X_SendEvent */ && X11->xdndHandleBadwindow())
00399             return 0;
00400         if (X11->ignore_badwindow)
00401             return 0;
00402     } else if (err->request_code == X11->xinput_major
00403                 && err->error_code == (X11->xinput_errorbase + XI_BadDevice)
00404                 && err->minor_code == 3 /* X_OpenDevice */) {
00405         return 0;
00406     } else if (err->error_code == BadMatch && err->request_code == 42 /* X_SetInputFocus */) {
00407         return 0;
00408     }
00409 
00410     char errstr[256];
00411     XGetErrorText( dpy, err->error_code, errstr, 256 );
00412     char buffer[256];
00413     char request_str[256];
00414     qsnprintf(buffer, 256, "%d", err->request_code);
00415     XGetErrorDatabaseText(dpy, "XRequest", buffer, "", request_str, 256);
00416     if (err->request_code < 128) {
00417         // X error for a normal protocol request
00418         qWarning( "X Error: %s %d\n"
00419                   "  Major opcode: %d (%s)\n"
00420                   "  Resource id:  0x%lx",
00421                   errstr, err->error_code,
00422                   err->request_code,
00423                   request_str,
00424                   err->resourceid );
00425     } else {
00426         // X error for an extension request
00427         const char *extensionName = 0;
00428         if (err->request_code == X11->xrender_major)
00429             extensionName = "RENDER";
00430         else if (err->request_code == X11->xrandr_major)
00431             extensionName = "RANDR";
00432         else if (err->request_code == X11->xinput_major)
00433             extensionName = "XInputExtension";
00434 
00435         char minor_str[256];
00436         if (extensionName) {
00437             qsnprintf(buffer, 256, "%s.%d", extensionName, err->minor_code);
00438             XGetErrorDatabaseText(dpy, "XRequest", buffer, "", minor_str, 256);
00439         } else {
00440             extensionName = "Uknown extension";
00441             qsnprintf(minor_str, 256, "Unknown request");
00442         }
00443         qWarning( "X Error: %s %d\n"
00444                   "  Extension:    %d (%s)\n"
00445                   "  Minor opcode: %d (%s)\n"
00446                   "  Resource id:  0x%lx",
00447                   errstr, err->error_code,
00448                   err->request_code,
00449                   extensionName,
00450                   err->minor_code,
00451                   minor_str,
00452                   err->resourceid );
00453     }
00454 
00455     // ### we really should distinguish between severe, non-severe and
00456     // ### application specific errors
00457 
00458     return 0;
00459 }

Here is the call graph for this function:

static int qt_xio_errhandler ( Display  )  [static]

Definition at line 462 of file qapplication_x11.cpp.

References appName, and qWarning().

00463 {
00464     qWarning("%s: Fatal IO error: client killed", appName);
00465     QApplicationPrivate::reset_instance_pointer();
00466     exit(1);
00467     //### give the application a chance for a proper shutdown instead,
00468     //### exit(1) doesn't help.
00469     return 0;
00470 }

Here is the call graph for this function:

static void resetSmState (  )  [static]

Definition at line 4604 of file qapplication_x11.cpp.

References qt_sm_blockUserInput.

Referenced by QSessionManager::QSessionManager(), sm_dieCallback(), sm_saveCompleteCallback(), sm_saveYourselfCallback(), and sm_shutdownCancelledCallback().

04605 {
04606 //    sm_waitingForPhase2 = false; ### never used?!?
04607     sm_waitingForInteraction = false;
04608     sm_interactionActive = false;
04609     sm_interactStyle = SmInteractStyleNone;
04610     sm_smActive = false;
04611     qt_sm_blockUserInput = false;
04612     sm_isshutdown = false;
04613 //    sm_shouldbefast = false; ### never used?!?
04614     sm_phase2 = false;
04615     sm_in_phase2 = false;
04616 }

static void sm_dieCallback ( SmcConn  smcConn,
SmPointer  clientData 
) [static]

Definition at line 4786 of file qapplication_x11.cpp.

References qApp, QEvent::Quit, resetSmState(), and QCoreApplication::sendEvent().

Referenced by QSessionManager::QSessionManager().

04787 {
04788     if (smcConn != smcConnection)
04789         return;
04790     resetSmState();
04791     QEvent quitEvent(QEvent::Quit);
04792     QApplication::sendEvent(qApp, &quitEvent);
04793 }

Here is the call graph for this function:

static void sm_interactCallback ( SmcConn  smcConn,
SmPointer  clientData 
) [static]

Definition at line 4811 of file qapplication_x11.cpp.

Referenced by QSessionManager::allowsErrorInteraction(), and QSessionManager::allowsInteraction().

04812 {
04813     if (smcConn != smcConnection)
04814         return;
04815     if (sm_waitingForInteraction)
04816         ((QSessionManagerPrivate *) clientData)->eventLoop->exit();
04817 }

static void sm_performSaveYourself ( QSessionManagerPrivate  )  [static]

Definition at line 4696 of file qapplication_x11.cpp.

References QSessionManager::allowsErrorInteraction(), QX11Info::appClass(), QList< T >::at(), buf, QSessionManager::discardCommand(), QString::fromLatin1(), int, QList< T >::isEmpty(), QString::number(), qApp, qAppName(), QByteArray::qstricmp(), qt_sm_blockUserInput, QSessionManager::restartCommand(), QSessionManager::restartHint(), QSessionManagerPrivate::sessionId, QSessionManagerPrivate::sessionKey, QSessionManager::setDiscardCommand(), QSessionManager::setRestartCommand(), QSessionManagerPrivate::sm, sm_saveYourselfPhase2Callback(), sm_setProperty(), and value.

Referenced by sm_saveYourselfCallback(), and sm_saveYourselfPhase2Callback().

04697 {
04698     if (sm_isshutdown)
04699         qt_sm_blockUserInput = true;
04700 
04701     QSessionManager* sm = smd->sm;
04702 
04703     // generate a new session key
04704     timeval tv;
04705     gettimeofday(&tv, 0);
04706     smd->sessionKey  = QString::number(qulonglong(tv.tv_sec)) + QLatin1Char('_') + QString::number(qulonglong(tv.tv_usec));
04707 
04708     QStringList arguments = qApp->arguments();
04709     QString argument0 = arguments.isEmpty() ? qApp->applicationFilePath() : arguments.at(0);
04710 
04711     // tell the session manager about our program in best POSIX style
04712     sm_setProperty(QString::fromLatin1(SmProgram), argument0);
04713     // tell the session manager about our user as well.
04714     struct passwd *entryPtr = 0;
04715 #if !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS)
04716     QVarLengthArray<char, 1024> buf(sysconf(_SC_GETPW_R_SIZE_MAX));
04717     struct passwd entry;
04718     getpwuid_r(geteuid(), &entry, buf.data(), buf.size(), &entryPtr);
04719 #else
04720     entryPtr = getpwuid(geteuid());
04721 #endif
04722     if (entryPtr)
04723         sm_setProperty(QString::fromLatin1(SmUserID), QString::fromLatin1(entryPtr->pw_name));
04724 
04725     // generate a restart and discard command that makes sense
04726     QStringList restart;
04727     restart  << argument0 << QLatin1String("-session")
04728              << smd->sessionId + QLatin1Char('_') + smd->sessionKey;
04729     if (qstricmp(appName, QX11Info::appClass()) != 0)
04730         restart << QLatin1String("-name") << qAppName();
04731     sm->setRestartCommand(restart);
04732     QStringList discard;
04733     sm->setDiscardCommand(discard);
04734 
04735     switch (sm_saveType) {
04736     case SmSaveBoth:
04737         qApp->commitData(*sm);
04738         if (sm_isshutdown && sm_cancel)
04739             break; // we cancelled the shutdown, no need to save state
04740     // fall through
04741     case SmSaveLocal:
04742         qApp->saveState(*sm);
04743         break;
04744     case SmSaveGlobal:
04745         qApp->commitData(*sm);
04746         break;
04747     default:
04748         break;
04749     }
04750 
04751     if (sm_phase2 && !sm_in_phase2) {
04752         SmcRequestSaveYourselfPhase2(smcConnection, sm_saveYourselfPhase2Callback, (SmPointer*) smd);
04753         qt_sm_blockUserInput = false;
04754     }
04755     else {
04756         // close eventual interaction monitors and cancel the
04757         // shutdown, if required. Note that we can only cancel when
04758         // performing a shutdown, it does not work for checkpoints
04759         if (sm_interactionActive) {
04760             SmcInteractDone(smcConnection, sm_isshutdown && sm_cancel);
04761             sm_interactionActive = false;
04762         }
04763         else if (sm_cancel && sm_isshutdown) {
04764             if (sm->allowsErrorInteraction()) {
04765                 SmcInteractDone(smcConnection, True);
04766                 sm_interactionActive = false;
04767             }
04768         }
04769 
04770         // set restart and discard command in session manager
04771         sm_setProperty(QString::fromLatin1(SmRestartCommand), sm->restartCommand());
04772         sm_setProperty(QString::fromLatin1(SmDiscardCommand), sm->discardCommand());
04773 
04774         // set the restart hint
04775         SmPropValue prop;
04776         prop.length = sizeof(int);
04777         int value = sm->restartHint();
04778         prop.value = (SmPointer) &value;
04779         sm_setProperty(SmRestartStyleHint, SmCARD8, 1, &prop);
04780 
04781         // we are done
04782         SmcSaveYourselfDone(smcConnection, !sm_cancel);
04783     }
04784 }

Here is the call graph for this function:

static void sm_saveCompleteCallback ( SmcConn  smcConn,
SmPointer  clientData 
) [static]

Definition at line 4804 of file qapplication_x11.cpp.

References resetSmState().

Referenced by QSessionManager::QSessionManager().

04805 {
04806     if (smcConn != smcConnection)
04807         return;
04808     resetSmState();
04809 }

Here is the call graph for this function:

static void sm_saveYourselfCallback ( SmcConn  smcConn,
SmPointer  clientData,
int  saveType,
Bool  shutdown,
int  interactStyle,
Bool  fast 
) [static]

Definition at line 4673 of file qapplication_x11.cpp.

References resetSmState(), and sm_performSaveYourself().

Referenced by QSessionManager::QSessionManager().

04675 {
04676     if (smcConn != smcConnection)
04677         return;
04678     sm_cancel = false;
04679     sm_smActive = true;
04680     sm_isshutdown = shutdown;
04681     sm_saveType = saveType;
04682     sm_interactStyle = interactStyle;
04683 //    sm_shouldbefast = fast; ### never used?!?
04684 
04685     // ugly workaround for broken libSM. libSM should do that _before_
04686     // actually invoking the callback in sm_process.c
04687     ((QT_smcConn*)smcConn)->save_yourself_in_progress = true;
04688     if (sm_isshutdown)
04689         ((QT_smcConn*)smcConn)->shutdown_in_progress = true;
04690 
04691     sm_performSaveYourself((QSessionManagerPrivate*) clientData);
04692     if (!sm_isshutdown) // we cannot expect a confirmation message in that case
04693         resetSmState();
04694 }

Here is the call graph for this function:

static void sm_saveYourselfPhase2Callback ( SmcConn  smcConn,
SmPointer  clientData 
) [static]

Definition at line 4819 of file qapplication_x11.cpp.

References sm_performSaveYourself().

Referenced by sm_performSaveYourself().

04820 {
04821     if (smcConn != smcConnection)
04822         return;
04823     sm_in_phase2 = true;
04824     sm_performSaveYourself((QSessionManagerPrivate*) clientData);
04825 }

Here is the call graph for this function:

static void sm_setProperty ( const QString name,
const QStringList value 
) [static]

Definition at line 4651 of file qapplication_x11.cpp.

References QList< T >::append(), QByteArray::data(), QList< T >::last(), name, sm_setProperty(), and value.

04652 {
04653     SmPropValue *prop = new SmPropValue[value.count()];
04654     int count = 0;
04655     QList<QByteArray> vl;
04656     for (QStringList::ConstIterator it = value.begin(); it != value.end(); ++it) {
04657       prop[count].length = (*it).length();
04658       vl.append((*it).toUtf8());
04659       prop[count].value = (char*)vl.last().data();
04660       ++count;
04661     }
04662     sm_setProperty(name.toLatin1().data(), SmLISTofARRAY8, count, prop);
04663     delete [] prop;
04664 }

Here is the call graph for this function:

static void sm_setProperty ( const QString name,
const QString value 
) [static]

Definition at line 4642 of file qapplication_x11.cpp.

References QByteArray::constData(), QByteArray::length(), name, sm_setProperty(), and value.

04643 {
04644     QByteArray v = value.toUtf8();
04645     SmPropValue prop;
04646     prop.length = v.length();
04647     prop.value = (SmPointer) v.constData();
04648     sm_setProperty(name.toLatin1().data(), SmARRAY8, 1, &prop);
04649 }

Here is the call graph for this function:

static void sm_setProperty ( const char *  name,
const char *  type,
int  num_vals,
SmPropValue *  vals 
) [static]

Definition at line 4621 of file qapplication_x11.cpp.

References props.

Referenced by QSessionManager::setManagerProperty(), sm_performSaveYourself(), and sm_setProperty().

04623 {
04624     if (num_vals) {
04625       SmProp prop;
04626       prop.name = (char*)name;
04627       prop.type = (char*)type;
04628       prop.num_vals = num_vals;
04629       prop.vals = vals;
04630 
04631       SmProp* props[1];
04632       props[0] = &prop;
04633       SmcSetProperties(smcConnection, 1, props);
04634     }
04635     else {
04636       char* names[1];
04637       names[0] = (char*) name;
04638       SmcDeleteProperties(smcConnection, 1, names);
04639     }
04640 }

static void sm_shutdownCancelledCallback ( SmcConn  smcConn,
SmPointer  clientData 
) [static]

Definition at line 4795 of file qapplication_x11.cpp.

References resetSmState().

Referenced by QSessionManager::QSessionManager().

04796 {
04797     if (smcConn != smcConnection)
04798         return;
04799     if (sm_waitingForInteraction)
04800         ((QSessionManagerPrivate *) clientData)->eventLoop->exit();
04801     resetSmState();
04802 }

Here is the call graph for this function:

static bool translateBySips ( QWidget that,
QRect paintRect 
) [static]

Definition at line 4164 of file qapplication_x11.cpp.

References QRect::translate(), and X11.

Referenced by QETWidget::translatePaintEvent().

04165 {
04166     int dx=0, dy=0;
04167     int sips=0;
04168     for (int i = 0; i < X11->sip_list.size(); ++i) {
04169         const QX11Data::ScrollInProgress &sip = X11->sip_list.at(i);
04170         if (sip.scrolled_widget == that) {
04171             if (sips) {
04172                 dx += sip.dx;
04173                 dy += sip.dy;
04174             }
04175             sips++;
04176         }
04177     }
04178     if (sips > 1) {
04179         paintRect.translate(dx, dy);
04180         return true;
04181     }
04182     return false;
04183 }

Here is the call graph for this function:

static Qt::MouseButtons translateMouseButtons ( int  s  )  [static]

Definition at line 3323 of file qapplication_x11.cpp.

References Qt::LeftButton, Qt::MidButton, and Qt::RightButton.

Referenced by QETWidget::translateMouseEvent().

03324 {
03325     Qt::MouseButtons ret = 0;
03326     if (s & Button1Mask)
03327         ret |= Qt::LeftButton;
03328     if (s & Button2Mask)
03329         ret |= Qt::MidButton;
03330     if (s & Button3Mask)
03331         ret |= Qt::RightButton;
03332     return ret;
03333 }


Variable Documentation

bool app_do_modal = false [static]

Definition at line 267 of file qapplication_x11.cpp.

Referenced by QApplicationPrivate::enterModal_sys(), QApplicationPrivate::leaveModal_sys(), and QApplicationPrivate::modalState().

bool app_save_rootinfo = false [static]

Definition at line 266 of file qapplication_x11.cpp.

Referenced by qt_cleanup(), and qt_updated_rootinfo().

const char* appBGCol = 0 [static]

Definition at line 252 of file qapplication_x11.cpp.

const char* appBTNCol = 0 [static]

Definition at line 254 of file qapplication_x11.cpp.

const char* appClass = 0 [static]

Definition at line 250 of file qapplication_x11.cpp.

Referenced by QX11Info::appClass(), qt_cleanup(), qt_init(), and qt_set_x11_resources().

const char* appFGCol = 0 [static]

Definition at line 253 of file qapplication_x11.cpp.

const char* appFont = 0 [static]

Definition at line 251 of file qapplication_x11.cpp.

const char* appName = 0 [static]

Definition at line 249 of file qapplication_x11.cpp.

Referenced by QWidgetPrivate::create_sys(), qt_init(), qt_set_x11_resources(), qt_xio_errhandler(), and Main::updateStatus().

bool appSync = false [static]

Definition at line 261 of file qapplication_x11.cpp.

Window curWin = 0 [static]

Definition at line 268 of file qapplication_x11.cpp.

Referenced by QApplicationPrivate::enterModal_sys(), and QApplicationPrivate::leaveModal_sys().

Window mouseActWindow = 0 [static]

Definition at line 290 of file qapplication_x11.cpp.

Referenced by QETWidget::translateMouseEvent().

Qt::MouseButton mouseButtonPressed = Qt::NoButton [static]

Definition at line 291 of file qapplication_x11.cpp.

Referenced by QETWidget::translateMouseEvent().

Time mouseButtonPressTime = 0 [static]

Definition at line 293 of file qapplication_x11.cpp.

Referenced by QApplicationPrivate::closePopup(), and QETWidget::translateMouseEvent().

Qt::MouseButtons mouseButtonState = Qt::NoButton [static]

Definition at line 292 of file qapplication_x11.cpp.

Referenced by QETWidget::translateMouseEvent().

short mouseGlobalXPos [static]

Definition at line 295 of file qapplication_x11.cpp.

Referenced by QApplicationPrivate::closePopup(), and QETWidget::translateMouseEvent().

short mouseGlobalYPos [static]

Definition at line 295 of file qapplication_x11.cpp.

Referenced by QApplicationPrivate::closePopup(), and QETWidget::translateMouseEvent().

short mouseXPos [static]

Definition at line 294 of file qapplication_x11.cpp.

Referenced by QETWidget::translateMouseEvent().

short mouseYPos [static]

Definition at line 294 of file qapplication_x11.cpp.

Referenced by QETWidget::translateMouseEvent().

const char* mwGeometry = 0 [static]

Definition at line 255 of file qapplication_x11.cpp.

const char* mwTitle = 0 [static]

Definition at line 256 of file qapplication_x11.cpp.

int openPopupCount = 0 [static]

Definition at line 3211 of file qapplication_x11.cpp.

int(*) original_x_errhandler(Display *dpy, XErrorEvent *) [static]

Definition at line 391 of file qapplication_x11.cpp.

Referenced by qt_cleanup().

int(*) original_xio_errhandler(Display *dpy) [static]

Definition at line 392 of file qapplication_x11.cpp.

Referenced by qt_cleanup().

bool popupGrabOk [static]

Definition at line 304 of file qapplication_x11.cpp.

Referenced by QApplicationPrivate::closePopup(), and QApplicationPrivate::openPopup().

Window pressed_window = XNone [static]

Definition at line 300 of file qapplication_x11.cpp.

uchar qt_alt_mask = 0

Definition at line 281 of file qapplication_x11.cpp.

Referenced by QKeyMapperPrivate::clearMappings(), and QX11Data::translateModifiers().

bool qt_app_has_font

Definition at line 363 of file qapplication.cpp.

Referenced by qt_set_x11_resources(), QApplication::setFont(), and QApplication::~QApplication().

bool qt_broken_wm = false

Definition at line 271 of file qapplication_x11.cpp.

Referenced by qt_detect_broken_window_manager(), and QWidgetPrivate::setGeometry_sys().

QWidget* qt_button_down = 0

Definition at line 342 of file qapplication_x11.cpp.

Referenced by QApplicationPrivate::closePopup(), QWidgetPrivate::deactivateWidgetCleanup(), qt_try_modal(), and QETWidget::translateMouseEvent().

uchar qt_hyper_mask = 0

Definition at line 284 of file qapplication_x11.cpp.

Referenced by QKeyMapperPrivate::clearMappings(), and translateKeySym().

QTextCodec* qt_input_mapper = 0

Definition at line 334 of file qapplication_x11.cpp.

Referenced by qt_set_input_encoding(), translateKeySym(), and QXIMInputContext::x11FilterEvent().

bool qt_is_gui_used

Definition at line 375 of file qapplication.cpp.

uchar qt_meta_mask = 0

Definition at line 282 of file qapplication_x11.cpp.

Referenced by QKeyMapperPrivate::clearMappings(), translateKeySym(), and QX11Data::translateModifiers().

QWidgetList* qt_modal_stack

Definition at line 423 of file qapplication.cpp.

Referenced by QApplication::activeModalWidget(), QApplicationPrivate::enterModal_sys(), QApplicationPrivate::isBlockedByModal(), and QApplicationPrivate::leaveModal_sys().

uchar qt_mode_switch_mask = 0

Definition at line 285 of file qapplication_x11.cpp.

Referenced by QKeyMapperPrivate::clearMappings(), and QX11Data::translateModifiers().

QWidget* qt_popup_down = 0 [static]

Definition at line 343 of file qapplication_x11.cpp.

Referenced by QApplicationPrivate::closePopup(), and QETWidget::translateMouseEvent().

bool qt_reuse_double_buffer = true

Definition at line 308 of file qapplication_x11.cpp.

bool qt_sm_blockUserInput = false

Definition at line 306 of file qapplication_x11.cpp.

Referenced by QSessionManager::allowsErrorInteraction(), QSessionManager::allowsInteraction(), QSessionManager::release(), resetSmState(), sm_performSaveYourself(), and QETWidget::translateMouseEvent().

uchar qt_super_mask = 0

Definition at line 283 of file qapplication_x11.cpp.

Referenced by QKeyMapperPrivate::clearMappings(), and translateKeySym().

bool qt_tabletChokeMouse

Definition at line 397 of file qapplication.cpp.

Referenced by QApplication::notify(), and QETWidget::translateMouseEvent().

bool qt_use_rtl_extensions = false

Definition at line 288 of file qapplication_x11.cpp.

Referenced by QLineEdit::createStandardContextMenu(), and QKeyMapperPrivate::translateKeyEventInternal().

Q_GUI_EXPORT QX11Data* qt_x11Data = 0

Definition at line 244 of file qapplication_x11.cpp.

Referenced by QX11Data::badwindow(), QX11Data::ignoreBadwindow(), and x11Time().

bool qt_xdnd_dragging

Definition at line 209 of file qdnd_x11.cpp.

Referenced by QDragManager::cancel(), QDragManager::drag(), QDragManager::drop(), qt_try_modal(), and QETWidget::translateMouseEvent().

Q_GUI_EXPORT int qt_xfocusout_grab_counter = 0

Definition at line 310 of file qapplication_x11.cpp.

int qt_ximComposingKeycode = 0

Definition at line 333 of file qapplication_x11.cpp.

Referenced by QKeyMapperPrivate::translateKeyEventInternal(), and QXIMInputContext::x11FilterEvent().

char* qt_ximServer = 0

Definition at line 257 of file qapplication_x11.cpp.

Referenced by QXIMInputContext::QXIMInputContext().

bool replayPopupMouseEvent = false [static]

Definition at line 303 of file qapplication_x11.cpp.

Referenced by QApplicationPrivate::closePopup(), and QETWidget::translateMouseEvent().

bool sm_cancel [static]

Definition at line 4582 of file qapplication_x11.cpp.

bool sm_in_phase2 [static]

Definition at line 4588 of file qapplication_x11.cpp.

bool sm_interactionActive [static]

Definition at line 4578 of file qapplication_x11.cpp.

int sm_interactStyle [static]

Definition at line 4580 of file qapplication_x11.cpp.

bool sm_isshutdown [static]

Definition at line 4585 of file qapplication_x11.cpp.

bool sm_phase2 [static]

Definition at line 4587 of file qapplication_x11.cpp.

QSmSocketReceiver* sm_receiver = 0 [static]

Definition at line 4590 of file qapplication_x11.cpp.

Referenced by QSessionManager::QSessionManager(), and QSessionManager::~QSessionManager().

int sm_saveType [static]

Definition at line 4581 of file qapplication_x11.cpp.

bool sm_smActive [static]

Definition at line 4579 of file qapplication_x11.cpp.

bool sm_waitingForInteraction [static]

Definition at line 4584 of file qapplication_x11.cpp.

SmcConn smcConnection = 0 [static]

Definition at line 4577 of file qapplication_x11.cpp.

QWidgetMapper* wPRmapper = 0 [static]

Definition at line 2417 of file qapplication_x11.cpp.

Referenced by qPRCleanup(), qPRCreate(), and qPRFindWidget().

const char* x11_atomnames [static]

Definition at line 120 of file qapplication_x11.cpp.

Referenced by qt_x11_create_intern_atoms().


Generated on Thu Mar 15 13:25:28 2007 for Qt 4.2 User's Guide by  doxygen 1.5.1