Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/kernel/qapplication.cpp

    r769 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    6666#include "qdebug.h"
    6767#include "private/qgraphicssystemfactory_p.h"
     68#include "private/qgraphicssystem_p.h"
    6869#include "private/qstylesheetstyle_p.h"
    6970#include "private/qstyle_p.h"
     
    7172#include <QtGui/qgraphicsproxywidget.h>
    7273
     74#ifdef QT_GRAPHICSSYSTEM_RUNTIME
     75#include "private/qgraphicssystem_runtime_p.h"
     76#endif
     77
    7378#include "qinputcontext.h"
    7479#include "qkeymapper_p.h"
     
    7883#endif
    7984
    80 #if defined(Q_WS_X11) || defined(Q_WS_S60)
     85#if defined(Q_WS_X11) || defined(Q_OS_SYMBIAN)
    8186#include "qinputcontextfactory.h"
    8287#endif
     
    9095
    9196#include <stdlib.h>
     97
     98#if defined(Q_WS_X11) && !defined(QT_NO_EGL)
     99#include <link.h>
     100#endif
    92101
    93102#include "qapplication_p.h"
     
    123132{
    124133#if defined(Q_WS_WINCE)
     134    Q_INIT_RESOURCE_EXTERN(qstyle_wince)
    125135    Q_INIT_RESOURCE(qstyle_wince);
    126136#elif defined(Q_OS_SYMBIAN)
     137    Q_INIT_RESOURCE_EXTERN(qstyle_s60)
    127138    Q_INIT_RESOURCE(qstyle_s60);
    128139#else
     140    Q_INIT_RESOURCE_EXTERN(qstyle)
    129141    Q_INIT_RESOURCE(qstyle);
    130142#endif
    131 
     143    Q_INIT_RESOURCE_EXTERN(qmessagebox)
    132144    Q_INIT_RESOURCE(qmessagebox);
    133145#if !defined(QT_NO_PRINTDIALOG)
     146    Q_INIT_RESOURCE_EXTERN(qprintdialog)
    134147    Q_INIT_RESOURCE(qprintdialog);
    135148#endif
     
    139152QT_BEGIN_NAMESPACE
    140153
    141 Q_DECL_IMPORT extern void qt_call_post_routines();
     154Q_CORE_EXPORT void qt_call_post_routines();
    142155
    143156int QApplicationPrivate::app_compile_version = 0x040000; //we don't know exactly, but it's at least 4.0.0
     
    182195#endif
    183196
     197#ifndef QT_NO_GESTURES
    184198    gestureManager = 0;
    185199    gestureWidget = 0;
     200#endif // QT_NO_GESTURES
     201
     202#if defined(Q_WS_X11) || defined(Q_WS_WIN)
     203    move_cursor = 0;
     204    copy_cursor = 0;
     205    link_cursor = 0;
     206#endif
     207#if defined(Q_WS_WIN)
     208    ignore_cursor = 0;
     209#endif
    186210
    187211    if (!self)
     
    432456QGraphicsSystem *QApplicationPrivate::graphics_system = 0; // default graphics system
    433457QString QApplicationPrivate::graphics_system_name;         // graphics system id - for delayed initialization
     458bool QApplicationPrivate::runtime_graphics_system = false;
    434459
    435460Q_GLOBAL_STATIC(QMutex, applicationFontMutex)
     
    455480int qt_antialiasing_threshold = -1;
    456481static int drag_time = 500;
     482#ifndef QT_GUI_DRAG_DISTANCE
     483#define QT_GUI_DRAG_DISTANCE 4
     484#endif
    457485#ifdef Q_OS_SYMBIAN
    458486// The screens are a bit too small to for your thumb when using only 4 pixels drag distance.
    459 static int drag_distance = 8;
     487static int drag_distance = 12; //XXX move to qplatformdefs.h
    460488#else
    461 static int drag_distance = 4;
     489static int drag_distance = QT_GUI_DRAG_DISTANCE;
    462490#endif
    463491static Qt::LayoutDirection layout_direction = Qt::LeftToRight;
     
    472500bool QApplicationPrivate::widgetCount = false;
    473501bool QApplicationPrivate::load_testability = false;
     502QString QApplicationPrivate::qmljs_debug_arguments;
    474503#ifdef QT_KEYPAD_NAVIGATION
    475504#  ifdef Q_OS_SYMBIAN
     
    488517    if (!widget)
    489518        return false;
    490 #if defined(Q_WS_MAC) // Fake alien behavior on the Mac :)
    491     return !widget->isWindow() && widget->window()->testAttribute(Qt::WA_DontShowOnScreen);
    492 #elif defined(Q_WS_QWS)
     519#if defined(Q_WS_QWS)
    493520    return !widget->isWindow()
    494521# ifdef Q_BACKINGSTORE_SUBSURFACES
     
    545572        if (arg == "-qdevel" || arg == "-qdebug") {
    546573            // obsolete argument
     574        } else if (arg.indexOf("-qmljsdebugger=", 0) != -1) {
     575            qmljs_debug_arguments = QString::fromLocal8Bit(arg.right(arg.length() - 15));
    547576        } else if (arg.indexOf("-style=", 0) != -1) {
    548577            s = QString::fromLocal8Bit(arg.right(arg.length() - 7).toLower());
     
    650679        \o  -graphicssystem, sets the backend to be used for on-screen widgets
    651680            and QPixmaps. Available options are \c{raster} and \c{opengl}.
     681        \o  -qmljsdebugger=, activates the QML/JS debugger with a specified port.
     682            The value must be of format port:1234[,block], where block is optional
     683            and will make the application wait until a debugger connects to it.
    652684    \endlist
    653685
     
    658690            that is shown.
    659691        \o  -fn or \c -font \e font, defines the application font. The font
    660             should be specified using an X logical font description.
     692            should be specified using an X logical font description. Note that
     693            this option is ignored when Qt is built with fontconfig support enabled.
    661694        \o  -bg or \c -background \e color, sets the default background color
    662695            and an application palette (light and dark shades are calculated).
     
    684717    \endlist
    685718
     719    \section1 X11 Notes
     720
     721    If QApplication fails to open the X11 display, it will terminate
     722    the process. This behavior is consistent with most X11
     723    applications.
     724
    686725    \sa arguments()
    687726*/
     
    752791{ Q_D(QApplication); d->construct();  QApplicationPrivate::app_compile_version = _internal;}
    753792
     793#if defined(Q_WS_X11) && !defined(QT_NO_EGL)
     794static int qt_matchLibraryName(dl_phdr_info *info, size_t, void *data)
     795{
     796    const char *name = static_cast<const char *>(data);
     797    return strstr(info->dlpi_name, name) != 0;
     798}
     799#endif
    754800
    755801/*!
     
    766812    qt_is_gui_used = (qt_appType != QApplication::Tty);
    767813    process_cmdline();
     814    // the environment variable has the lowest precedence of runtime graphicssystem switches
     815    if (graphics_system_name.isEmpty())
     816        graphics_system_name = QString::fromLocal8Bit(qgetenv("QT_GRAPHICSSYSTEM"));
     817
     818#if defined(Q_WS_X11) && !defined(QT_NO_EGL)
     819    if (graphics_system_name.isEmpty()) {
     820        bool linksWithMeeGoTouch = dl_iterate_phdr(qt_matchLibraryName, const_cast<char *>("libmeegotouchcore"));
     821        bool linksWithMeeGoGraphicsSystemHelper = dl_iterate_phdr(qt_matchLibraryName, const_cast<char *>("libQtMeeGoGraphicsSystemHelper"));
     822
     823        if (linksWithMeeGoTouch && !linksWithMeeGoGraphicsSystemHelper) {
     824            qWarning("Running non-meego graphics system enabled  MeeGo touch, forcing native graphicssystem\n");
     825            graphics_system_name = QLatin1String("native");
     826        }
     827    }
     828#endif
     829
    768830    // Must be called before initialize()
    769831    qt_init(this, qt_appType
     
    778840    extern void qt_gui_eval_init(uint);
    779841    qt_gui_eval_init(application_type);
     842#endif
     843
     844#if defined(Q_OS_SYMBIAN) && !defined(QT_NO_SYSTEMLOCALE)
     845    symbianInit();
    780846#endif
    781847
     
    786852            typedef void (*TasInitialize)(void);
    787853            TasInitialize initFunction = (TasInitialize)testLib.resolve("qt_testability_init");
     854#ifdef Q_OS_SYMBIAN
     855            // resolving method by name does not work on Symbian OS so need to use ordinal
     856            if(!initFunction) {
     857                initFunction = (TasInitialize)testLib.resolve("1");           
     858            }
     859#endif
    788860            if (initFunction) {
    789861                initFunction();
     
    879951
    880952extern void qInitDrawhelperAsm();
     953extern void qInitImageConversions();
    881954extern int qRegisterGuiVariant();
    882955extern int qUnregisterGuiVariant();
     
    9361009    // Set up which span functions should be used in raster engine...
    9371010    qInitDrawhelperAsm();
     1011    // and QImage conversion functions
     1012    qInitImageConversions();
    9381013
    9391014#ifndef QT_NO_WHEELEVENT
     
    10281103    QApplicationPrivate::is_app_closing = true;
    10291104    QApplicationPrivate::is_app_running = false;
    1030 
    1031     delete qt_desktopWidget;
    1032     qt_desktopWidget = 0;
    1033 
    1034 #ifndef QT_NO_CLIPBOARD
    1035     delete qt_clipboard;
    1036     qt_clipboard = 0;
    1037 #endif
    10381105
    10391106    delete QWidgetPrivate::mapper;
     
    10521119    }
    10531120
     1121    delete qt_desktopWidget;
     1122    qt_desktopWidget = 0;
     1123
     1124#ifndef QT_NO_CLIPBOARD
     1125    delete qt_clipboard;
     1126    qt_clipboard = 0;
     1127#endif
     1128
     1129#if defined(Q_WS_X11) || defined(Q_WS_WIN)
     1130    delete d->move_cursor; d->move_cursor = 0;
     1131    delete d->copy_cursor; d->copy_cursor = 0;
     1132    delete d->link_cursor; d->link_cursor = 0;
     1133#endif
     1134#if defined(Q_WS_WIN)
     1135    delete d->ignore_cursor; d->ignore_cursor = 0;
     1136#endif
     1137
    10541138    delete QApplicationPrivate::app_pal;
    10551139    QApplicationPrivate::app_pal = 0;
     
    10751159    delete QApplicationPrivate::app_icon;
    10761160    QApplicationPrivate::app_icon = 0;
     1161    delete QApplicationPrivate::graphics_system;
     1162    QApplicationPrivate::graphics_system = 0;
    10771163#ifndef QT_NO_CURSOR
    10781164    d->cursor_list.clear();
     
    13471433        //
    13481434        QString style;
    1349         if (!QApplicationPrivate::styleOverride.isEmpty())
     1435#ifdef QT_BUILD_INTERNAL
     1436        QString envStyle = QString::fromLocal8Bit(qgetenv("QT_STYLE_OVERRIDE"));
     1437#else
     1438        QString envStyle;
     1439#endif
     1440        if (!QApplicationPrivate::styleOverride.isEmpty()) {
    13501441            style = QApplicationPrivate::styleOverride;
    1351         else
     1442        } else if (!envStyle.isEmpty()) {
     1443            style = envStyle;
     1444        } else {
    13521445            style = QApplicationPrivate::desktopStyleKey();
     1446        }
    13531447
    13541448        QStyle *&app_style = QApplicationPrivate::app_style;
     
    15331627    \c{"raster"} and \c{"opengl"}.
    15341628
    1535     This function call overrides both the application commandline
    1536     \c{-graphicssystem} switch and the configure \c{-graphicssystem} switch.
    1537 
    1538     \warning This function must be called before the QApplication constructor
     1629    There are several ways to set the graphics backend, in order of decreasing
     1630    precedence:
     1631    \list
     1632        \o the application commandline \c{-graphicssystem} switch
     1633        \o QApplication::setGraphicsSystem()
     1634        \o the QT_GRAPHICSSYSTEM environment variable
     1635        \o the Qt configure \c{-graphicssystem} switch
     1636    \endlist
     1637    If the highest precedence switch sets an invalid name, the error will be
     1638    ignored and the default backend will be used.
     1639
     1640    \warning This function is only effective before the QApplication constructor
    15391641    is called.
    15401642
     
    15441646void QApplication::setGraphicsSystem(const QString &system)
    15451647{
    1546     QApplicationPrivate::graphics_system_name = system;
     1648#ifdef QT_GRAPHICSSYSTEM_RUNTIME
     1649    if (QApplicationPrivate::graphics_system_name == QLatin1String("runtime")) {
     1650        QRuntimeGraphicsSystem *r =
     1651                static_cast<QRuntimeGraphicsSystem *>(QApplicationPrivate::graphics_system);
     1652        r->setGraphicsSystem(system);
     1653    } else
     1654#endif
     1655        QApplicationPrivate::graphics_system_name = system;
    15471656}
    15481657
     
    21972306    bool did_close = true;
    21982307    QWidget *w;
    2199     while((w = activeModalWidget()) && did_close) {
    2200         if(!w->isVisible())
     2308    while ((w = activeModalWidget()) && did_close) {
     2309        if (!w->isVisible() || w->data->is_closing)
    22012310            break;
    22022311        did_close = w->close();
     
    22052314    for (int i = 0; did_close && i < list.size(); ++i) {
    22062315        w = list.at(i);
    2207         if (w->isVisible() && w->windowType() != Qt::Desktop) {
     2316        if (w->isVisible()
     2317            && w->windowType() != Qt::Desktop
     2318            && !w->data->is_closing) {
    22082319            did_close = w->close();
    22092320            list = QApplication::topLevelWidgets();
     
    22942405                         " and Arabic) to get proper widget layout.") == QLatin1String("RTL"));
    22952406}
     2407#if defined(Q_WS_MAC)
     2408static const char *application_menu_strings[] = {
     2409    QT_TRANSLATE_NOOP("MAC_APPLICATION_MENU","Services"),
     2410    QT_TRANSLATE_NOOP("MAC_APPLICATION_MENU","Hide %1"),
     2411    QT_TRANSLATE_NOOP("MAC_APPLICATION_MENU","Hide Others"),
     2412    QT_TRANSLATE_NOOP("MAC_APPLICATION_MENU","Show All"),
     2413    QT_TRANSLATE_NOOP("MAC_APPLICATION_MENU","Preferences..."),
     2414    QT_TRANSLATE_NOOP("MAC_APPLICATION_MENU","Quit %1"),
     2415    QT_TRANSLATE_NOOP("MAC_APPLICATION_MENU","About %1")
     2416    };
     2417QString qt_mac_applicationmenu_string(int type)
     2418{
     2419    QString menuString = QString::fromLatin1(application_menu_strings[type]);
     2420    QString translated = qApp->translate("QMenuBar", application_menu_strings[type]);
     2421    if (translated != menuString)
     2422        return translated;
     2423    else
     2424        return qApp->translate("MAC_APPLICATION_MENU",
     2425                               application_menu_strings[type]);
     2426}
     2427#endif
    22962428#endif
    22972429
     
    23222454        setLayoutDirection(qt_detectRTLLanguage()?Qt::RightToLeft:Qt::LeftToRight);
    23232455#endif
     2456#if defined(QT_MAC_USE_COCOA)
     2457        qt_mac_post_retranslateAppMenu();
     2458#endif
    23242459        QWidgetList list = topLevelWidgets();
    23252460        for (int i = 0; i < list.size(); ++i) {
     
    23282463                postEvent(w, new QEvent(QEvent::LanguageChange));
    23292464        }
     2465#ifndef Q_OS_WIN
     2466    } else if (e->type() == QEvent::LocaleChange) {
     2467        // on Windows the event propagation is taken care by the
     2468        // WM_SETTINGCHANGE event handler.
     2469        QWidgetList list = topLevelWidgets();
     2470        for (int i = 0; i < list.size(); ++i) {
     2471            QWidget *w = list.at(i);
     2472            if (!(w->windowType() == Qt::Desktop)) {
     2473                if (!w->testAttribute(Qt::WA_SetLocale))
     2474                    w->d_func()->setLocale_helper(QLocale(), true);
     2475            }
     2476        }
     2477#endif
    23302478    } else if (e->type() == QEvent::Timer) {
    23312479        QTimerEvent *te = static_cast<QTimerEvent*>(e);
     
    24562604    }
    24572605
     2606#ifdef QT_MAC_USE_COCOA
     2607    // In case the user clicked on a child window, we need to
     2608    // reestablish the stacking order of the window so
     2609    // it pops in front of other child windows in cocoa:
     2610    qt_cocoaStackChildWindowOnTopOfOtherChildren(window);
     2611#endif
     2612
    24582613    for(int i = 0; i < toBeDeactivated.size(); ++i) {
    24592614        QWidget *w = toBeDeactivated.at(i);
     
    26902845#elif defined(Q_WS_X11)
    26912846            qt_x11_enforce_cursor(cursorWidget, true);
    2692 #elif defined(Q_WS_S60)
     2847#elif defined(Q_OS_SYMBIAN)
    26932848            qt_symbian_set_cursor(cursorWidget, true);
    26942849#elif defined(Q_WS_PM)
     
    29983153}
    29993154
    3000 #if defined(Q_WS_WIN) || defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_WS_PM)
     3155#if defined(Q_WS_WIN) || defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_WS_MAC) || defined(Q_WS_PM)
    30013156/*
    30023157    This function should only be called when the widget changes visibility, i.e.
     
    30583213#endif // QT_NO_CURSOR
    30593214}
    3060 #endif // Q_WS_WIN || Q_WS_PM || Q_WS_X11
     3215#endif // Q_WS_WIN || Q_WS_X11 || Q_WS_MAC || Q_WS_PM
    30613216
    30623217/*!
     
    34653620void QApplication::setLayoutDirection(Qt::LayoutDirection direction)
    34663621{
    3467     if (layout_direction == direction)
     3622    if (layout_direction == direction || direction == Qt::LayoutDirectionAuto)
    34683623        return;
    34693624
     
    36413796    }
    36423797
     3798#ifndef QT_NO_GESTURES
    36433799    // walk through parents and check for gestures
    36443800    if (d->gestureManager) {
     
    36853841        }
    36863842    }
    3687 
     3843#endif // QT_NO_GESTURES
    36883844
    36893845    // User input and window activation makes tooltips sleep
     
    41904346        break;
    41914347
     4348#ifndef QT_NO_GESTURES
    41924349    case QEvent::NativeGesture:
    41934350    {
     
    42434400                    for (int i = 0; i < gestures.size(); ++i) {
    42444401                        QGesture *g = gestures.at(i);
    4245                         if ((res && eventAccepted) || (!eventAccepted && ge.isAccepted(g))) {
     4402                        // Ignore res [event return value] because handling of multiple gestures
     4403                        // packed into a single QEvent depends on not consuming the event
     4404                        if (eventAccepted || ge.isAccepted(g)) {
    42464405                            // if the gesture was accepted, mark the target widget for it
    42474406                            gestureEvent->d_func()->targetWidgets[g->gestureType()] = w;
    42484407                            gestureEvent->setAccepted(g, true);
    4249                         } else if (!eventAccepted && !ge.isAccepted(g)) {
     4408                        } else {
    42504409                            // if the gesture was explicitly ignored by the application,
    42514410                            // put it back so a parent can get it
     
    42684427        break;
    42694428    }
     4429#endif // QT_NO_GESTURES
    42704430    default:
    42714431        res = d->notify_helper(receiver, e);
     
    52095369*/
    52105370
     5371#ifndef QT_NO_IM
    52115372// ************************************************************************
    52125373// Input Method support
     
    52175378    with \a inputContext.
    52185379
     5380    Qt takes ownership of the given \a inputContext.
     5381
    52195382    \sa inputContext()
    52205383*/
     
    52225385{
    52235386#ifndef QT_NO_IM
    5224     Q_D(QApplication);
    5225     Q_UNUSED(d);// only static members being used.
     5387    if (inputContext == QApplicationPrivate::inputContext)
     5388        return;
    52265389    if (!inputContext) {
    52275390        qWarning("QApplication::setInputContext: called with 0 input context");
    52285391        return;
    52295392    }
    5230     delete d->inputContext;
    5231     d->inputContext = inputContext;
     5393    delete QApplicationPrivate::inputContext;
     5394    QApplicationPrivate::inputContext = inputContext;
     5395    QApplicationPrivate::inputContext->setParent(this);
    52325396#endif
    52335397}
     
    52565420        that->d_func()->inputContext = qic;
    52575421    }
    5258 #elif defined(Q_WS_S60)
     5422#elif defined(Q_OS_SYMBIAN)
    52595423    if (!d->inputContext) {
    52605424        QApplication *that = const_cast<QApplication *>(this);
    5261         that->d_func()->inputContext = QInputContextFactory::create(QString::fromLatin1("coefep"), that);
     5425        const QStringList keys = QInputContextFactory::keys();
     5426        // Try hbim and coefep first, then try others.
     5427        if (keys.contains(QLatin1String("hbim"))) {
     5428            that->d_func()->inputContext = QInputContextFactory::create(QLatin1String("hbim"), that);
     5429        } else if (keys.contains(QLatin1String("coefep"))) {
     5430            that->d_func()->inputContext = QInputContextFactory::create(QLatin1String("coefep"), that);
     5431        } else {
     5432            for (int c = 0; c < keys.size() && !d->inputContext; ++c) {
     5433                that->d_func()->inputContext = QInputContextFactory::create(keys[c], that);
     5434            }
     5435        }
    52625436    }
    52635437#endif
     
    52675441#endif
    52685442}
     5443#endif // QT_NO_IM
    52695444
    52705445//Returns the current platform used by keyBindings
     
    56945869}
    56955870
     5871#ifndef QT_NO_GESTURES
    56965872QGestureManager* QGestureManager::instance()
    56975873{
    5698     QApplicationPrivate *qAppPriv = QApplicationPrivate::instance();
    5699     if (!qAppPriv->gestureManager)
    5700         qAppPriv->gestureManager = new QGestureManager(qApp);
    5701     return qAppPriv->gestureManager;
     5874    if (QApplicationPrivate *qAppPriv = QApplicationPrivate::instance()) {
     5875        if (!qAppPriv->gestureManager)
     5876            qAppPriv->gestureManager = new QGestureManager(qApp);
     5877        return qAppPriv->gestureManager;
     5878    }
     5879    return 0;
     5880}
     5881#endif // QT_NO_GESTURES
     5882
     5883// These pixmaps approximate the images in the Windows User Interface Guidelines.
     5884
     5885// XPM
     5886
     5887static const char * const move_xpm[] = {
     5888"11 20 3 1",
     5889".        c None",
     5890#if defined(Q_WS_WIN)
     5891"a        c #000000",
     5892"X        c #FFFFFF", // Windows cursor is traditionally white
     5893#else
     5894"a        c #FFFFFF",
     5895"X        c #000000", // X11 cursor is traditionally black
     5896#endif
     5897"aa.........",
     5898"aXa........",
     5899"aXXa.......",
     5900"aXXXa......",
     5901"aXXXXa.....",
     5902"aXXXXXa....",
     5903"aXXXXXXa...",
     5904"aXXXXXXXa..",
     5905"aXXXXXXXXa.",
     5906"aXXXXXXXXXa",
     5907"aXXXXXXaaaa",
     5908"aXXXaXXa...",
     5909"aXXaaXXa...",
     5910"aXa..aXXa..",
     5911"aa...aXXa..",
     5912"a.....aXXa.",
     5913"......aXXa.",
     5914".......aXXa",
     5915".......aXXa",
     5916"........aa."};
     5917
     5918#ifdef Q_WS_WIN
     5919/* XPM */
     5920static const char * const ignore_xpm[] = {
     5921"24 30 3 1",
     5922".        c None",
     5923"a        c #000000",
     5924"X        c #FFFFFF",
     5925"aa......................",
     5926"aXa.....................",
     5927"aXXa....................",
     5928"aXXXa...................",
     5929"aXXXXa..................",
     5930"aXXXXXa.................",
     5931"aXXXXXXa................",
     5932"aXXXXXXXa...............",
     5933"aXXXXXXXXa..............",
     5934"aXXXXXXXXXa.............",
     5935"aXXXXXXaaaa.............",
     5936"aXXXaXXa................",
     5937"aXXaaXXa................",
     5938"aXa..aXXa...............",
     5939"aa...aXXa...............",
     5940"a.....aXXa..............",
     5941"......aXXa.....XXXX.....",
     5942".......aXXa..XXaaaaXX...",
     5943".......aXXa.XaaaaaaaaX..",
     5944"........aa.XaaaXXXXaaaX.",
     5945"...........XaaaaX..XaaX.",
     5946"..........XaaXaaaX..XaaX",
     5947"..........XaaXXaaaX.XaaX",
     5948"..........XaaX.XaaaXXaaX",
     5949"..........XaaX..XaaaXaaX",
     5950"...........XaaX..XaaaaX.",
     5951"...........XaaaXXXXaaaX.",
     5952"............XaaaaaaaaX..",
     5953".............XXaaaaXX...",
     5954"...............XXXX....."};
     5955#endif
     5956
     5957/* XPM */
     5958static const char * const copy_xpm[] = {
     5959"24 30 3 1",
     5960".        c None",
     5961"a        c #000000",
     5962"X        c #FFFFFF",
     5963#if defined(Q_WS_WIN) // Windows cursor is traditionally white
     5964"aa......................",
     5965"aXa.....................",
     5966"aXXa....................",
     5967"aXXXa...................",
     5968"aXXXXa..................",
     5969"aXXXXXa.................",
     5970"aXXXXXXa................",
     5971"aXXXXXXXa...............",
     5972"aXXXXXXXXa..............",
     5973"aXXXXXXXXXa.............",
     5974"aXXXXXXaaaa.............",
     5975"aXXXaXXa................",
     5976"aXXaaXXa................",
     5977"aXa..aXXa...............",
     5978"aa...aXXa...............",
     5979"a.....aXXa..............",
     5980"......aXXa..............",
     5981".......aXXa.............",
     5982".......aXXa.............",
     5983"........aa...aaaaaaaaaaa",
     5984#else
     5985"XX......................",
     5986"XaX.....................",
     5987"XaaX....................",
     5988"XaaaX...................",
     5989"XaaaaX..................",
     5990"XaaaaaX.................",
     5991"XaaaaaaX................",
     5992"XaaaaaaaX...............",
     5993"XaaaaaaaaX..............",
     5994"XaaaaaaaaaX.............",
     5995"XaaaaaaXXXX.............",
     5996"XaaaXaaX................",
     5997"XaaXXaaX................",
     5998"XaX..XaaX...............",
     5999"XX...XaaX...............",
     6000"X.....XaaX..............",
     6001"......XaaX..............",
     6002".......XaaX.............",
     6003".......XaaX.............",
     6004"........XX...aaaaaaaaaaa",
     6005#endif
     6006".............aXXXXXXXXXa",
     6007".............aXXXXXXXXXa",
     6008".............aXXXXaXXXXa",
     6009".............aXXXXaXXXXa",
     6010".............aXXaaaaaXXa",
     6011".............aXXXXaXXXXa",
     6012".............aXXXXaXXXXa",
     6013".............aXXXXXXXXXa",
     6014".............aXXXXXXXXXa",
     6015".............aaaaaaaaaaa"};
     6016
     6017/* XPM */
     6018static const char * const link_xpm[] = {
     6019"24 30 3 1",
     6020".        c None",
     6021"a        c #000000",
     6022"X        c #FFFFFF",
     6023#if defined(Q_WS_WIN) // Windows cursor is traditionally white
     6024"aa......................",
     6025"aXa.....................",
     6026"aXXa....................",
     6027"aXXXa...................",
     6028"aXXXXa..................",
     6029"aXXXXXa.................",
     6030"aXXXXXXa................",
     6031"aXXXXXXXa...............",
     6032"aXXXXXXXXa..............",
     6033"aXXXXXXXXXa.............",
     6034"aXXXXXXaaaa.............",
     6035"aXXXaXXa................",
     6036"aXXaaXXa................",
     6037"aXa..aXXa...............",
     6038"aa...aXXa...............",
     6039"a.....aXXa..............",
     6040"......aXXa..............",
     6041".......aXXa.............",
     6042".......aXXa.............",
     6043"........aa...aaaaaaaaaaa",
     6044#else
     6045"XX......................",
     6046"XaX.....................",
     6047"XaaX....................",
     6048"XaaaX...................",
     6049"XaaaaX..................",
     6050"XaaaaaX.................",
     6051"XaaaaaaX................",
     6052"XaaaaaaaX...............",
     6053"XaaaaaaaaX..............",
     6054"XaaaaaaaaaX.............",
     6055"XaaaaaaXXXX.............",
     6056"XaaaXaaX................",
     6057"XaaXXaaX................",
     6058"XaX..XaaX...............",
     6059"XX...XaaX...............",
     6060"X.....XaaX..............",
     6061"......XaaX..............",
     6062".......XaaX.............",
     6063".......XaaX.............",
     6064"........XX...aaaaaaaaaaa",
     6065#endif
     6066".............aXXXXXXXXXa",
     6067".............aXXXaaaaXXa",
     6068".............aXXXXaaaXXa",
     6069".............aXXXaaaaXXa",
     6070".............aXXaaaXaXXa",
     6071".............aXXaaXXXXXa",
     6072".............aXXaXXXXXXa",
     6073".............aXXXaXXXXXa",
     6074".............aXXXXXXXXXa",
     6075".............aaaaaaaaaaa"};
     6076
     6077QPixmap QApplicationPrivate::getPixmapCursor(Qt::CursorShape cshape)
     6078{
     6079#if defined(Q_WS_X11) || defined(Q_WS_WIN)
     6080    if (!move_cursor) {
     6081        move_cursor = new QPixmap((const char **)move_xpm);
     6082        copy_cursor = new QPixmap((const char **)copy_xpm);
     6083        link_cursor = new QPixmap((const char **)link_xpm);
     6084#ifdef Q_WS_WIN
     6085        ignore_cursor = new QPixmap((const char **)ignore_xpm);
     6086#endif
     6087    }
     6088
     6089    switch (cshape) {
     6090    case Qt::DragMoveCursor:
     6091        return *move_cursor;
     6092    case Qt::DragCopyCursor:
     6093        return *copy_cursor;
     6094    case Qt::DragLinkCursor:
     6095        return *link_cursor;
     6096#ifdef Q_WS_WIN
     6097    case Qt::ForbiddenCursor:
     6098        return *ignore_cursor;
     6099#endif
     6100    default:
     6101        break;
     6102    }
     6103#endif
     6104    return QPixmap();
     6105}
     6106
     6107QString QApplicationPrivate::qmljsDebugArgumentsString()
     6108{
     6109    return qmljs_debug_arguments;
    57026110}
    57036111
Note: See TracChangeset for help on using the changeset viewer.