Windows QPA plugin: Use member initialization
Use C++ 11 member initialization in value-type structs. Task-number: QTBUG-51673 Change-Id: I668389b4a0ad1d862a505b740d67357cb9c2a3dc Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
This commit is contained in:
parent
39fc377bf1
commit
9ef93fa153
@ -149,8 +149,7 @@ static void cleanClipboardPostRoutine()
|
||||
|
||||
QWindowsClipboard *QWindowsClipboard::m_instance = 0;
|
||||
|
||||
QWindowsClipboard::QWindowsClipboard() :
|
||||
m_data(0), m_clipboardViewer(0), m_nextClipboardViewer(0), m_formatListenerRegistered(false)
|
||||
QWindowsClipboard::QWindowsClipboard()
|
||||
{
|
||||
QWindowsClipboard::m_instance = this;
|
||||
qAddPostRoutine(cleanClipboardPostRoutine);
|
||||
|
@ -83,10 +83,10 @@ private:
|
||||
static QWindowsClipboard *m_instance;
|
||||
|
||||
QWindowsClipboardRetrievalMimeData m_retrievalData;
|
||||
QWindowsOleDataObject *m_data;
|
||||
HWND m_clipboardViewer;
|
||||
HWND m_nextClipboardViewer;
|
||||
bool m_formatListenerRegistered;
|
||||
QWindowsOleDataObject *m_data = nullptr;
|
||||
HWND m_clipboardViewer = 0;
|
||||
HWND m_nextClipboardViewer = 0;
|
||||
bool m_formatListenerRegistered = false;
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -165,15 +165,6 @@ static bool enableNonClientDpiScaling(HWND hwnd)
|
||||
\internal
|
||||
\ingroup qt-lighthouse-win
|
||||
*/
|
||||
QWindowsUser32DLL::QWindowsUser32DLL() :
|
||||
isTouchWindow(0),
|
||||
registerTouchWindow(0), unregisterTouchWindow(0),
|
||||
getTouchInputInfo(0), closeTouchInputHandle(0), setProcessDPIAware(0),
|
||||
addClipboardFormatListener(0), removeClipboardFormatListener(0),
|
||||
getDisplayAutoRotationPreferences(0), setDisplayAutoRotationPreferences(0),
|
||||
enableNonClientDpiScaling(0), getWindowDpiAwarenessContext(0), getAwarenessFromDpiAwarenessContext(0)
|
||||
{
|
||||
}
|
||||
|
||||
void QWindowsUser32DLL::init()
|
||||
{
|
||||
@ -206,13 +197,6 @@ bool QWindowsUser32DLL::initTouch()
|
||||
return isTouchWindow && registerTouchWindow && unregisterTouchWindow && getTouchInputInfo && closeTouchInputHandle;
|
||||
}
|
||||
|
||||
QWindowsShcoreDLL::QWindowsShcoreDLL()
|
||||
: getProcessDpiAwareness(0)
|
||||
, setProcessDpiAwareness(0)
|
||||
, getDpiForMonitor(0)
|
||||
{
|
||||
}
|
||||
|
||||
void QWindowsShcoreDLL::init()
|
||||
{
|
||||
if (QOperatingSystemVersion::current() < QOperatingSystemVersion::Windows8_1)
|
||||
@ -241,14 +225,13 @@ QWindowsContext *QWindowsContext::m_instance = 0;
|
||||
typedef QHash<HWND, QWindowsWindow *> HandleBaseWindowHash;
|
||||
|
||||
struct QWindowsContextPrivate {
|
||||
|
||||
QWindowsContextPrivate();
|
||||
|
||||
unsigned m_systemInfo;
|
||||
unsigned m_systemInfo = 0;
|
||||
QSet<QString> m_registeredWindowClassNames;
|
||||
HandleBaseWindowHash m_windows;
|
||||
HDC m_displayContext;
|
||||
int m_defaultDPI;
|
||||
HDC m_displayContext = 0;
|
||||
int m_defaultDPI = 96;
|
||||
QWindowsKeyMapper m_keyMapper;
|
||||
QWindowsMouseHandler m_mouseHandler;
|
||||
QWindowsMimeConverter m_mimeConverter;
|
||||
@ -259,15 +242,13 @@ struct QWindowsContextPrivate {
|
||||
#endif
|
||||
const HRESULT m_oleInitializeResult;
|
||||
const QByteArray m_eventType;
|
||||
QWindow *m_lastActiveWindow;
|
||||
bool m_asyncExpose;
|
||||
QWindow *m_lastActiveWindow = nullptr;
|
||||
bool m_asyncExpose = false;
|
||||
};
|
||||
|
||||
QWindowsContextPrivate::QWindowsContextPrivate()
|
||||
: m_systemInfo(0)
|
||||
, m_oleInitializeResult(OleInitialize(NULL))
|
||||
: m_oleInitializeResult(OleInitialize(NULL))
|
||||
, m_eventType(QByteArrayLiteral("windows_generic_MSG"))
|
||||
, m_lastActiveWindow(0), m_asyncExpose(0)
|
||||
{
|
||||
QWindowsContext::user32dll.init();
|
||||
QWindowsContext::shcoredll.init();
|
||||
|
@ -80,7 +80,6 @@ class QTouchDevice;
|
||||
|
||||
struct QWindowsUser32DLL
|
||||
{
|
||||
QWindowsUser32DLL();
|
||||
inline void init();
|
||||
inline bool initTouch();
|
||||
|
||||
@ -99,32 +98,31 @@ struct QWindowsUser32DLL
|
||||
typedef int (WINAPI *GetAwarenessFromDpiAwarenessContext)(int);
|
||||
|
||||
// Touch functions from Windows 7 onwards (also for use with Q_CC_MSVC).
|
||||
IsTouchWindow isTouchWindow;
|
||||
RegisterTouchWindow registerTouchWindow;
|
||||
UnregisterTouchWindow unregisterTouchWindow;
|
||||
GetTouchInputInfo getTouchInputInfo;
|
||||
CloseTouchInputHandle closeTouchInputHandle;
|
||||
IsTouchWindow isTouchWindow = nullptr;
|
||||
RegisterTouchWindow registerTouchWindow = nullptr;
|
||||
UnregisterTouchWindow unregisterTouchWindow = nullptr;
|
||||
GetTouchInputInfo getTouchInputInfo = nullptr;
|
||||
CloseTouchInputHandle closeTouchInputHandle = nullptr;
|
||||
|
||||
// Windows Vista onwards
|
||||
SetProcessDPIAware setProcessDPIAware;
|
||||
SetProcessDPIAware setProcessDPIAware = nullptr;
|
||||
|
||||
// Clipboard listeners are present on Windows Vista onwards
|
||||
// but missing in MinGW 4.9 stub libs. Can be removed in MinGW 5.
|
||||
AddClipboardFormatListener addClipboardFormatListener;
|
||||
RemoveClipboardFormatListener removeClipboardFormatListener;
|
||||
AddClipboardFormatListener addClipboardFormatListener = nullptr;
|
||||
RemoveClipboardFormatListener removeClipboardFormatListener = nullptr;
|
||||
|
||||
// Rotation API
|
||||
GetDisplayAutoRotationPreferences getDisplayAutoRotationPreferences;
|
||||
SetDisplayAutoRotationPreferences setDisplayAutoRotationPreferences;
|
||||
GetDisplayAutoRotationPreferences getDisplayAutoRotationPreferences = nullptr;
|
||||
SetDisplayAutoRotationPreferences setDisplayAutoRotationPreferences = nullptr;
|
||||
|
||||
EnableNonClientDpiScaling enableNonClientDpiScaling;
|
||||
GetWindowDpiAwarenessContext getWindowDpiAwarenessContext;
|
||||
GetAwarenessFromDpiAwarenessContext getAwarenessFromDpiAwarenessContext;
|
||||
EnableNonClientDpiScaling enableNonClientDpiScaling = nullptr;
|
||||
GetWindowDpiAwarenessContext getWindowDpiAwarenessContext = nullptr;
|
||||
GetAwarenessFromDpiAwarenessContext getAwarenessFromDpiAwarenessContext = nullptr;
|
||||
};
|
||||
|
||||
// Shell scaling library (Windows 8.1 onwards)
|
||||
struct QWindowsShcoreDLL {
|
||||
QWindowsShcoreDLL();
|
||||
void init();
|
||||
inline bool isValid() const { return getProcessDpiAwareness && setProcessDpiAwareness && getDpiForMonitor; }
|
||||
|
||||
@ -132,9 +130,9 @@ struct QWindowsShcoreDLL {
|
||||
typedef HRESULT (WINAPI *SetProcessDpiAwareness)(int);
|
||||
typedef HRESULT (WINAPI *GetDpiForMonitor)(HMONITOR,int,UINT *,UINT *);
|
||||
|
||||
GetProcessDpiAwareness getProcessDpiAwareness;
|
||||
SetProcessDpiAwareness setProcessDpiAwareness;
|
||||
GetDpiForMonitor getDpiForMonitor;
|
||||
GetProcessDpiAwareness getProcessDpiAwareness = nullptr;
|
||||
SetProcessDpiAwareness setProcessDpiAwareness = nullptr;
|
||||
GetDpiForMonitor getDpiForMonitor = nullptr;
|
||||
};
|
||||
|
||||
class QWindowsContext
|
||||
|
@ -211,15 +211,6 @@ private:
|
||||
\ingroup qt-lighthouse-win
|
||||
*/
|
||||
|
||||
template <class BaseClass>
|
||||
QWindowsDialogHelperBase<BaseClass>::QWindowsDialogHelperBase() :
|
||||
m_nativeDialog(0),
|
||||
m_ownerWindow(0),
|
||||
m_timerId(0),
|
||||
m_thread(0)
|
||||
{
|
||||
}
|
||||
|
||||
template <class BaseClass>
|
||||
void QWindowsDialogHelperBase<BaseClass>::cleanupThread()
|
||||
{
|
||||
@ -549,11 +540,11 @@ public:
|
||||
IFACEMETHODIMP OnOverwrite(IFileDialog *, IShellItem *, FDE_OVERWRITE_RESPONSE *) { return S_OK; }
|
||||
|
||||
QWindowsNativeFileDialogEventHandler(QWindowsNativeFileDialogBase *nativeFileDialog) :
|
||||
m_ref(1), m_nativeFileDialog(nativeFileDialog) {}
|
||||
m_nativeFileDialog(nativeFileDialog) {}
|
||||
virtual ~QWindowsNativeFileDialogEventHandler() {}
|
||||
|
||||
private:
|
||||
long m_ref;
|
||||
long m_ref = 1;
|
||||
QWindowsNativeFileDialogBase *m_nativeFileDialog;
|
||||
};
|
||||
|
||||
@ -641,19 +632,18 @@ protected:
|
||||
QWindowsFileDialogSharedData &data() { return m_data; }
|
||||
|
||||
private:
|
||||
IFileDialog *m_fileDialog;
|
||||
IFileDialogEvents *m_dialogEvents;
|
||||
DWORD m_cookie;
|
||||
IFileDialog *m_fileDialog = nullptr;
|
||||
IFileDialogEvents *m_dialogEvents = nullptr;
|
||||
DWORD m_cookie = 0;
|
||||
QStringList m_nameFilters;
|
||||
bool m_hideFiltersDetails;
|
||||
bool m_hasDefaultSuffix;
|
||||
bool m_hideFiltersDetails = false;
|
||||
bool m_hasDefaultSuffix = false;
|
||||
QWindowsFileDialogSharedData m_data;
|
||||
QString m_title;
|
||||
};
|
||||
|
||||
QWindowsNativeFileDialogBase::QWindowsNativeFileDialogBase(const QWindowsFileDialogSharedData &data) :
|
||||
m_fileDialog(0), m_dialogEvents(0), m_cookie(0), m_hideFiltersDetails(false),
|
||||
m_hasDefaultSuffix(false), m_data(data)
|
||||
m_data(data)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -78,7 +78,7 @@ public:
|
||||
virtual bool supportsNonModalDialog(const QWindow * /* parent */ = 0) const { return true; }
|
||||
|
||||
protected:
|
||||
QWindowsDialogHelperBase();
|
||||
QWindowsDialogHelperBase() {}
|
||||
QWindowsNativeDialogBase *nativeDialog() const;
|
||||
inline bool hasNativeDialog() const { return m_nativeDialog; }
|
||||
void timerEvent(QTimerEvent *) Q_DECL_OVERRIDE;
|
||||
@ -91,9 +91,9 @@ private:
|
||||
void cleanupThread();
|
||||
|
||||
QWindowsNativeDialogBasePtr m_nativeDialog;
|
||||
HWND m_ownerWindow;
|
||||
int m_timerId;
|
||||
QThread *m_thread;
|
||||
HWND m_ownerWindow = 0;
|
||||
int m_timerId = 0;
|
||||
QThread *m_thread = nullptr;
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -494,8 +494,7 @@ QWindowsOleDropSource::GiveFeedback(DWORD dwEffect)
|
||||
\ingroup qt-lighthouse-win
|
||||
*/
|
||||
|
||||
QWindowsOleDropTarget::QWindowsOleDropTarget(QWindow *w) :
|
||||
m_refs(1), m_window(w), m_chosenEffect(0), m_lastKeyState(0)
|
||||
QWindowsOleDropTarget::QWindowsOleDropTarget(QWindow *w) : m_window(w)
|
||||
{
|
||||
qCDebug(lcQpaMime) << __FUNCTION__ << this << w;
|
||||
}
|
||||
@ -687,10 +686,7 @@ QWindowsOleDropTarget::Drop(LPDATAOBJECT pDataObj, DWORD grfKeyState,
|
||||
|
||||
bool QWindowsDrag::m_canceled = false;
|
||||
|
||||
QWindowsDrag::QWindowsDrag() :
|
||||
m_dropDataObject(0), m_cachedDropTargetHelper(0)
|
||||
{
|
||||
}
|
||||
QWindowsDrag::QWindowsDrag() = default;
|
||||
|
||||
QWindowsDrag::~QWindowsDrag()
|
||||
{
|
||||
|
@ -77,12 +77,12 @@ public:
|
||||
private:
|
||||
void handleDrag(QWindow *window, DWORD grfKeyState, const QPoint &, LPDWORD pdwEffect);
|
||||
|
||||
ULONG m_refs;
|
||||
ULONG m_refs = 1;
|
||||
QWindow *const m_window;
|
||||
QRect m_answerRect;
|
||||
QPoint m_lastPoint;
|
||||
DWORD m_chosenEffect;
|
||||
DWORD m_lastKeyState;
|
||||
DWORD m_chosenEffect = 0;
|
||||
DWORD m_lastKeyState = 0;
|
||||
};
|
||||
|
||||
class QWindowsDrag : public QPlatformDrag
|
||||
@ -110,9 +110,9 @@ private:
|
||||
static bool m_canceled;
|
||||
|
||||
QWindowsDropMimeData m_dropData;
|
||||
IDataObject *m_dropDataObject;
|
||||
IDataObject *m_dropDataObject = nullptr;
|
||||
|
||||
IDropTargetHelper* m_cachedDropTargetHelper;
|
||||
IDropTargetHelper* m_cachedDropTargetHelper = nullptr;
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -384,8 +384,6 @@ QWindowsEGLContext::QWindowsEGLContext(QWindowsEGLStaticContext *staticContext,
|
||||
QPlatformOpenGLContext *share)
|
||||
: m_staticContext(staticContext)
|
||||
, m_eglDisplay(staticContext->display())
|
||||
, m_api(EGL_OPENGL_ES_API)
|
||||
, m_swapInterval(-1)
|
||||
{
|
||||
if (!m_staticContext)
|
||||
return;
|
||||
|
@ -167,8 +167,8 @@ private:
|
||||
EGLDisplay m_eglDisplay;
|
||||
EGLConfig m_eglConfig;
|
||||
QSurfaceFormat m_format;
|
||||
EGLenum m_api;
|
||||
int m_swapInterval;
|
||||
EGLenum m_api = EGL_OPENGL_ES_API;
|
||||
int m_swapInterval = -1;
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -825,13 +825,6 @@ static inline QOpenGLContextData createDummyWindowOpenGLContextData()
|
||||
\ingroup qt-lighthouse-win
|
||||
*/
|
||||
|
||||
QWindowsOpenGLContextFormat::QWindowsOpenGLContextFormat() :
|
||||
profile(QSurfaceFormat::NoProfile),
|
||||
version(0),
|
||||
options(0)
|
||||
{
|
||||
}
|
||||
|
||||
QWindowsOpenGLContextFormat QWindowsOpenGLContextFormat::current()
|
||||
{
|
||||
QWindowsOpenGLContextFormat result;
|
||||
|
@ -72,24 +72,23 @@ struct QWindowsOpenGLAdditionalFormat
|
||||
struct QOpenGLContextData
|
||||
{
|
||||
QOpenGLContextData(HGLRC r, HWND h, HDC d) : renderingContext(r), hwnd(h), hdc(d) {}
|
||||
QOpenGLContextData() : renderingContext(0), hwnd(0), hdc(0) {}
|
||||
QOpenGLContextData() {}
|
||||
|
||||
HGLRC renderingContext;
|
||||
HWND hwnd;
|
||||
HDC hdc;
|
||||
HGLRC renderingContext = 0;
|
||||
HWND hwnd = 0;
|
||||
HDC hdc = 0;
|
||||
};
|
||||
|
||||
class QOpenGLStaticContext;
|
||||
|
||||
struct QWindowsOpenGLContextFormat
|
||||
{
|
||||
QWindowsOpenGLContextFormat();
|
||||
static QWindowsOpenGLContextFormat current();
|
||||
void apply(QSurfaceFormat *format) const;
|
||||
|
||||
QSurfaceFormat::OpenGLContextProfile profile;
|
||||
int version; //! majorVersion<<8 + minorVersion
|
||||
QSurfaceFormat::FormatOptions options;
|
||||
QSurfaceFormat::OpenGLContextProfile profile = QSurfaceFormat::NoProfile;
|
||||
int version = 0; //! majorVersion<<8 + minorVersion
|
||||
QSurfaceFormat::FormatOptions options = 0;
|
||||
};
|
||||
|
||||
#ifndef QT_NO_DEBUG_STREAM
|
||||
|
@ -166,15 +166,8 @@ Q_CORE_EXPORT QLocale qt_localeFromLCID(LCID id); // from qlocale_win.cpp
|
||||
|
||||
HIMC QWindowsInputContext::m_defaultContext = 0;
|
||||
|
||||
QWindowsInputContext::CompositionContext::CompositionContext() :
|
||||
hwnd(0), haveCaret(false), position(0), isComposing(false),
|
||||
factor(1)
|
||||
{
|
||||
}
|
||||
|
||||
QWindowsInputContext::QWindowsInputContext() :
|
||||
m_WM_MSIME_MOUSE(RegisterWindowMessage(L"MSIMEMouseOperation")),
|
||||
m_endCompositionRecursionGuard(false),
|
||||
m_languageId(currentInputLanguageId()),
|
||||
m_locale(qt_localeFromLCID(m_languageId))
|
||||
{
|
||||
|
@ -57,15 +57,13 @@ class QWindowsInputContext : public QPlatformInputContext
|
||||
|
||||
struct CompositionContext
|
||||
{
|
||||
CompositionContext();
|
||||
|
||||
HWND hwnd;
|
||||
bool haveCaret;
|
||||
HWND hwnd = 0;
|
||||
bool haveCaret = false;
|
||||
QString composition;
|
||||
int position;
|
||||
bool isComposing;
|
||||
int position = 0;
|
||||
bool isComposing = false;
|
||||
QPointer<QObject> focusObject;
|
||||
qreal factor;
|
||||
qreal factor = 1;
|
||||
};
|
||||
public:
|
||||
explicit QWindowsInputContext();
|
||||
@ -104,7 +102,7 @@ private:
|
||||
const DWORD m_WM_MSIME_MOUSE;
|
||||
static HIMC m_defaultContext;
|
||||
CompositionContext m_compositionContext;
|
||||
bool m_endCompositionRecursionGuard;
|
||||
bool m_endCompositionRecursionGuard = false;
|
||||
LCID m_languageId;
|
||||
QLocale m_locale;
|
||||
};
|
||||
|
@ -128,9 +128,9 @@ struct QWindowsIntegrationPrivate
|
||||
explicit QWindowsIntegrationPrivate(const QStringList ¶mList);
|
||||
~QWindowsIntegrationPrivate();
|
||||
|
||||
unsigned m_options;
|
||||
unsigned m_options = 0;
|
||||
QWindowsContext m_context;
|
||||
QPlatformFontDatabase *m_fontDatabase;
|
||||
QPlatformFontDatabase *m_fontDatabase = nullptr;
|
||||
#ifndef QT_NO_CLIPBOARD
|
||||
QWindowsClipboard m_clipboard;
|
||||
# ifndef QT_NO_DRAGANDDROP
|
||||
@ -208,8 +208,6 @@ static inline unsigned parseOptions(const QStringList ¶mList,
|
||||
}
|
||||
|
||||
QWindowsIntegrationPrivate::QWindowsIntegrationPrivate(const QStringList ¶mList)
|
||||
: m_options(0)
|
||||
, m_fontDatabase(0)
|
||||
{
|
||||
Q_INIT_RESOURCE(openglblacklists);
|
||||
|
||||
|
@ -144,13 +144,11 @@ struct KeyRecord {
|
||||
static const int QT_MAX_KEY_RECORDINGS = 64; // User has LOTS of fingers...
|
||||
struct KeyRecorder
|
||||
{
|
||||
KeyRecorder() : nrecs(0) {}
|
||||
|
||||
inline KeyRecord *findKey(int code, bool remove);
|
||||
inline void storeKey(int code, int ascii, int state, const QString& text);
|
||||
inline void clearKeys();
|
||||
|
||||
int nrecs;
|
||||
int nrecs = 0;
|
||||
KeyRecord deleted_record; // A copy of last entry removed from records[]
|
||||
KeyRecord records[QT_MAX_KEY_RECORDINGS];
|
||||
};
|
||||
|
@ -1496,9 +1496,7 @@ QString QLastResortMimes::mimeForFormat(const FORMATETC &formatetc) const
|
||||
\sa QWindowsMime
|
||||
*/
|
||||
|
||||
QWindowsMimeConverter::QWindowsMimeConverter() : m_internalMimeCount(0)
|
||||
{
|
||||
}
|
||||
QWindowsMimeConverter::QWindowsMimeConverter() = default;
|
||||
|
||||
QWindowsMimeConverter::~QWindowsMimeConverter()
|
||||
{
|
||||
|
@ -96,7 +96,7 @@ private:
|
||||
void ensureInitialized() const;
|
||||
|
||||
mutable QList<QWindowsMime *> m_mimes;
|
||||
mutable int m_internalMimeCount;
|
||||
mutable int m_internalMimeCount = 0;
|
||||
};
|
||||
|
||||
#ifndef QT_NO_DEBUG_STREAM
|
||||
|
@ -185,14 +185,7 @@ static inline QTouchDevice *createTouchDevice()
|
||||
\ingroup qt-lighthouse-win
|
||||
*/
|
||||
|
||||
QWindowsMouseHandler::QWindowsMouseHandler() :
|
||||
m_windowUnderMouse(0),
|
||||
m_trackedWindow(0),
|
||||
m_touchDevice(Q_NULLPTR),
|
||||
m_leftButtonDown(false),
|
||||
m_previousCaptureWindow(0)
|
||||
{
|
||||
}
|
||||
QWindowsMouseHandler::QWindowsMouseHandler() = default;
|
||||
|
||||
QTouchDevice *QWindowsMouseHandler::ensureTouchDevice()
|
||||
{
|
||||
|
@ -74,9 +74,8 @@ QT_BEGIN_NAMESPACE
|
||||
*/
|
||||
|
||||
QWindowsOleDataObject::QWindowsOleDataObject(QMimeData *mimeData) :
|
||||
m_refs(1), data(mimeData),
|
||||
CF_PERFORMEDDROPEFFECT(RegisterClipboardFormat(CFSTR_PERFORMEDDROPEFFECT)),
|
||||
performedEffect(DROPEFFECT_NONE)
|
||||
data(mimeData),
|
||||
CF_PERFORMEDDROPEFFECT(RegisterClipboardFormat(CFSTR_PERFORMEDDROPEFFECT))
|
||||
{
|
||||
qCDebug(lcQpaMime) << __FUNCTION__ << mimeData->formats();
|
||||
}
|
||||
@ -267,8 +266,7 @@ QWindowsOleDataObject::EnumDAdvise(LPENUMSTATDATA FAR*)
|
||||
\ingroup qt-lighthouse-win
|
||||
*/
|
||||
|
||||
QWindowsOleEnumFmtEtc::QWindowsOleEnumFmtEtc(const QVector<FORMATETC> &fmtetcs) :
|
||||
m_dwRefs(1), m_nIndex(0), m_isNull(false)
|
||||
QWindowsOleEnumFmtEtc::QWindowsOleEnumFmtEtc(const QVector<FORMATETC> &fmtetcs)
|
||||
{
|
||||
if (QWindowsContext::verbose > 1)
|
||||
qCDebug(lcQpaMime) << __FUNCTION__ << fmtetcs;
|
||||
@ -285,8 +283,7 @@ QWindowsOleEnumFmtEtc::QWindowsOleEnumFmtEtc(const QVector<FORMATETC> &fmtetcs)
|
||||
}
|
||||
}
|
||||
|
||||
QWindowsOleEnumFmtEtc::QWindowsOleEnumFmtEtc(const QVector<LPFORMATETC> &lpfmtetcs) :
|
||||
m_dwRefs(1), m_nIndex(0), m_isNull(false)
|
||||
QWindowsOleEnumFmtEtc::QWindowsOleEnumFmtEtc(const QVector<LPFORMATETC> &lpfmtetcs)
|
||||
{
|
||||
if (QWindowsContext::verbose > 1)
|
||||
qCDebug(lcQpaMime) << __FUNCTION__;
|
||||
|
@ -82,10 +82,10 @@ public:
|
||||
STDMETHOD(EnumDAdvise)(LPENUMSTATDATA FAR* ppenumAdvise);
|
||||
|
||||
private:
|
||||
ULONG m_refs;
|
||||
ULONG m_refs = 1;
|
||||
QPointer<QMimeData> data;
|
||||
int CF_PERFORMEDDROPEFFECT;
|
||||
DWORD performedEffect;
|
||||
const int CF_PERFORMEDDROPEFFECT;
|
||||
DWORD performedEffect = DROPEFFECT_NONE;
|
||||
};
|
||||
|
||||
class QWindowsOleEnumFmtEtc : public IEnumFORMATETC
|
||||
@ -111,10 +111,10 @@ public:
|
||||
private:
|
||||
bool copyFormatEtc(LPFORMATETC dest, const FORMATETC *src) const;
|
||||
|
||||
ULONG m_dwRefs;
|
||||
ULONG m_nIndex;
|
||||
ULONG m_dwRefs = 1;
|
||||
ULONG m_nIndex = 0;
|
||||
QVector<LPFORMATETC> m_lpfmtetcs;
|
||||
bool m_isNull;
|
||||
bool m_isNull = false;
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -51,16 +51,14 @@ class QVariant;
|
||||
|
||||
struct GpuDescription
|
||||
{
|
||||
GpuDescription() : vendorId(0), deviceId(0), revision(0), subSysId(0) {}
|
||||
|
||||
static GpuDescription detect();
|
||||
QString toString() const;
|
||||
QVariant toVariant() const;
|
||||
|
||||
uint vendorId;
|
||||
uint deviceId;
|
||||
uint revision;
|
||||
uint subSysId;
|
||||
uint vendorId = 0;
|
||||
uint deviceId = 0;
|
||||
uint revision = 0;
|
||||
uint subSysId = 0;
|
||||
QVersionNumber driverVersion;
|
||||
QByteArray driverName;
|
||||
QByteArray description;
|
||||
|
@ -56,13 +56,6 @@
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
QWindowsScreenData::QWindowsScreenData() :
|
||||
dpi(96, 96), depth(32), format(QImage::Format_ARGB32_Premultiplied),
|
||||
flags(VirtualDesktop), orientation(Qt::LandscapeOrientation),
|
||||
refreshRateHz(60)
|
||||
{
|
||||
}
|
||||
|
||||
static inline QDpi deviceDPI(HDC hdc)
|
||||
{
|
||||
return QDpi(GetDeviceCaps(hdc, LOGPIXELSX), GetDeviceCaps(hdc, LOGPIXELSY));
|
||||
@ -407,10 +400,7 @@ QPlatformScreen::SubpixelAntialiasingType QWindowsScreen::subpixelAntialiasingTy
|
||||
\ingroup qt-lighthouse-win
|
||||
*/
|
||||
|
||||
QWindowsScreenManager::QWindowsScreenManager() :
|
||||
m_lastDepth(-1), m_lastHorizontalResolution(0), m_lastVerticalResolution(0)
|
||||
{
|
||||
}
|
||||
QWindowsScreenManager::QWindowsScreenManager() = default;
|
||||
|
||||
/*!
|
||||
\brief Triggers synchronization of screens (WM_DISPLAYCHANGE).
|
||||
|
@ -59,18 +59,16 @@ struct QWindowsScreenData
|
||||
LockScreen = 0x4 // Temporary screen existing during user change, etc.
|
||||
};
|
||||
|
||||
QWindowsScreenData();
|
||||
|
||||
QRect geometry;
|
||||
QRect availableGeometry;
|
||||
QDpi dpi;
|
||||
QDpi dpi{96, 96};
|
||||
QSizeF physicalSizeMM;
|
||||
int depth;
|
||||
QImage::Format format;
|
||||
unsigned flags;
|
||||
int depth = 32;
|
||||
QImage::Format format = QImage::Format_ARGB32_Premultiplied;
|
||||
unsigned flags = VirtualDesktop;
|
||||
QString name;
|
||||
Qt::ScreenOrientation orientation;
|
||||
qreal refreshRateHz;
|
||||
Qt::ScreenOrientation orientation = Qt::LandscapeOrientation;
|
||||
qreal refreshRateHz = 60;
|
||||
};
|
||||
|
||||
class QWindowsScreen : public QPlatformScreen
|
||||
@ -140,9 +138,9 @@ private:
|
||||
void removeScreen(int index);
|
||||
|
||||
WindowsScreenList m_screens;
|
||||
int m_lastDepth;
|
||||
WORD m_lastHorizontalResolution;
|
||||
WORD m_lastVerticalResolution;
|
||||
int m_lastDepth = -1;
|
||||
WORD m_lastHorizontalResolution = 0;
|
||||
WORD m_lastVerticalResolution = 0;
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -44,9 +44,6 @@ QT_BEGIN_NAMESPACE
|
||||
|
||||
QWindowsSessionManager::QWindowsSessionManager(const QString &id, const QString &key)
|
||||
: QPlatformSessionManager(id, key)
|
||||
, m_isActive(false)
|
||||
, m_blockUserInput(false)
|
||||
, m_canceled(false)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -75,9 +75,9 @@ public:
|
||||
bool isActive() const { return m_isActive;}
|
||||
|
||||
private:
|
||||
bool m_isActive;
|
||||
bool m_blockUserInput;
|
||||
bool m_canceled;
|
||||
bool m_isActive = false;
|
||||
bool m_blockUserInput = false;
|
||||
bool m_canceled = false;
|
||||
|
||||
Q_DISABLE_COPY(QWindowsSessionManager)
|
||||
};
|
||||
|
@ -57,9 +57,6 @@ class QRect;
|
||||
|
||||
struct QWindowsWinTab32DLL
|
||||
{
|
||||
QWindowsWinTab32DLL() : wTOpen(0), wTClose(0), wTInfo(0), wTEnable(0), wTOverlap(0), wTPacketsGet(0), wTGet(0),
|
||||
wTQueueSizeGet(0), wTQueueSizeSet(0) {}
|
||||
|
||||
bool init();
|
||||
|
||||
typedef HCTX (API *PtrWTOpen)(HWND, LPLOGCONTEXT, BOOL);
|
||||
@ -72,15 +69,15 @@ struct QWindowsWinTab32DLL
|
||||
typedef int (API *PtrWTQueueSizeGet)(HCTX);
|
||||
typedef BOOL (API *PtrWTQueueSizeSet)(HCTX, int);
|
||||
|
||||
PtrWTOpen wTOpen;
|
||||
PtrWTClose wTClose;
|
||||
PtrWTInfo wTInfo;
|
||||
PtrWTEnable wTEnable;
|
||||
PtrWTOverlap wTOverlap;
|
||||
PtrWTPacketsGet wTPacketsGet;
|
||||
PtrWTGet wTGet;
|
||||
PtrWTQueueSizeGet wTQueueSizeGet;
|
||||
PtrWTQueueSizeSet wTQueueSizeSet;
|
||||
PtrWTOpen wTOpen = nullptr;
|
||||
PtrWTClose wTClose = nullptr;
|
||||
PtrWTInfo wTInfo = nullptr;
|
||||
PtrWTEnable wTEnable = nullptr;
|
||||
PtrWTOverlap wTOverlap = nullptr;
|
||||
PtrWTPacketsGet wTPacketsGet = nullptr;
|
||||
PtrWTGet wTGet = nullptr;
|
||||
PtrWTQueueSizeGet wTQueueSizeGet = nullptr;
|
||||
PtrWTQueueSizeSet wTQueueSizeSet = nullptr;
|
||||
};
|
||||
|
||||
struct QWindowsTabletDeviceData
|
||||
|
@ -977,9 +977,7 @@ QWindowCreationContext::QWindowCreationContext(const QWindow *w,
|
||||
DWORD style_, DWORD exStyle_) :
|
||||
geometryHint(w, cm), window(w), style(style_), exStyle(exStyle_),
|
||||
requestedGeometry(geometry), obtainedGeometry(geometry),
|
||||
margins(QWindowsGeometryHint::frame(style, exStyle)), customMargins(cm),
|
||||
frameX(CW_USEDEFAULT), frameY(CW_USEDEFAULT),
|
||||
frameWidth(CW_USEDEFAULT), frameHeight(CW_USEDEFAULT)
|
||||
margins(QWindowsGeometryHint::frame(style, exStyle)), customMargins(cm)
|
||||
{
|
||||
// Geometry of toplevels does not consider window frames.
|
||||
// TODO: No concept of WA_wasMoved yet that would indicate a
|
||||
@ -1032,17 +1030,8 @@ QWindowCreationContext::QWindowCreationContext(const QWindow *w,
|
||||
QWindowsWindow::QWindowsWindow(QWindow *aWindow, const QWindowsWindowData &data) :
|
||||
QWindowsBaseWindow(aWindow),
|
||||
m_data(data),
|
||||
m_flags(WithinCreate),
|
||||
m_hdc(0),
|
||||
m_windowState(Qt::WindowNoState),
|
||||
m_opacity(1.0),
|
||||
m_cursor(new CursorHandle),
|
||||
m_dropTarget(0),
|
||||
m_savedStyle(0),
|
||||
m_format(aWindow->requestedFormat()),
|
||||
m_iconSmall(0),
|
||||
m_iconBig(0),
|
||||
m_surface(0)
|
||||
m_format(aWindow->requestedFormat())
|
||||
{
|
||||
// Clear the creation context as the window can be found in QWindowsContext's map.
|
||||
QWindowsContext::instance()->setWindowCreationContext(QSharedPointer<QWindowCreationContext>());
|
||||
|
@ -89,22 +89,20 @@ struct QWindowCreationContext
|
||||
QRect obtainedGeometry;
|
||||
QMargins margins;
|
||||
QMargins customMargins; // User-defined, additional frame for WM_NCCALCSIZE
|
||||
int frameX; // Passed on to CreateWindowEx(), including frame.
|
||||
int frameY;
|
||||
int frameWidth;
|
||||
int frameHeight;
|
||||
int frameX = CW_USEDEFAULT; // Passed on to CreateWindowEx(), including frame.
|
||||
int frameY = CW_USEDEFAULT;
|
||||
int frameWidth = CW_USEDEFAULT;
|
||||
int frameHeight = CW_USEDEFAULT;
|
||||
};
|
||||
|
||||
struct QWindowsWindowData
|
||||
{
|
||||
QWindowsWindowData() : hwnd(0), embedded(false) {}
|
||||
|
||||
Qt::WindowFlags flags;
|
||||
QRect geometry;
|
||||
QMargins frame; // Do not use directly for windows, see FrameDirty.
|
||||
QMargins customMargins; // User-defined, additional frame for NCCALCSIZE
|
||||
HWND hwnd;
|
||||
bool embedded;
|
||||
HWND hwnd = 0;
|
||||
bool embedded = false;
|
||||
|
||||
static QWindowsWindowData create(const QWindow *w,
|
||||
const QWindowsWindowData ¶meters,
|
||||
@ -335,20 +333,20 @@ private:
|
||||
void fireExpose(const QRegion ®ion, bool force=false);
|
||||
|
||||
mutable QWindowsWindowData m_data;
|
||||
mutable unsigned m_flags;
|
||||
HDC m_hdc;
|
||||
Qt::WindowState m_windowState;
|
||||
qreal m_opacity;
|
||||
mutable unsigned m_flags = WithinCreate;
|
||||
HDC m_hdc = 0;
|
||||
Qt::WindowState m_windowState = Qt::WindowNoState;
|
||||
qreal m_opacity = 1;
|
||||
#ifndef QT_NO_CURSOR
|
||||
CursorHandlePtr m_cursor;
|
||||
#endif
|
||||
QWindowsOleDropTarget *m_dropTarget;
|
||||
unsigned m_savedStyle;
|
||||
QWindowsOleDropTarget *m_dropTarget = nullptr;
|
||||
unsigned m_savedStyle = 0;
|
||||
QRect m_savedFrameGeometry;
|
||||
const QSurfaceFormat m_format;
|
||||
HICON m_iconSmall;
|
||||
HICON m_iconBig;
|
||||
void *m_surface;
|
||||
HICON m_iconSmall = 0;
|
||||
HICON m_iconBig = 0;
|
||||
void *m_surface = nullptr;
|
||||
};
|
||||
|
||||
#ifndef QT_NO_DEBUG_STREAM
|
||||
|
Loading…
Reference in New Issue
Block a user