summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowswindowclassdescription.h
blob: 78d99b4c52503017a1689fac75dc106309d158d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright (C) 2025 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only

#ifndef QWINDOWSWINDOWCLASSDESCRIPTION_H
#define QWINDOWSWINDOWCLASSDESCRIPTION_H

#include "qtwindowsglobal.h"

#include <QtCore/qstring.h>

QT_BEGIN_NAMESPACE

class QWindow;

struct QWindowsWindowClassDescription
{
    static QWindowsWindowClassDescription fromName(QString name, WNDPROC procedure);
    static QWindowsWindowClassDescription fromWindow(const QWindow *window, WNDPROC procedure);

    QString name;
    WNDPROC procedure{ DefWindowProc };
    unsigned int style{ 0 };
    HBRUSH brush{ nullptr };
    bool hasIcon{ false };
    bool shouldAddPrefix{ true };

private:
    static QString classNameSuffix(Qt::WindowFlags type, unsigned int style, bool hasIcon);
    static bool computeHasIcon(Qt::WindowFlags flags, Qt::WindowFlags type);

    friend QDebug operator<<(QDebug dbg, const QWindowsWindowClassDescription &description);
};

QT_END_NAMESPACE

#endif // QWINDOWSWINDOWCLASSDESCRIPTION_H