1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-10-06 09:17:07 +02:00

Formatting with clang 15

This commit is contained in:
Elias Steurer 2023-01-21 11:12:04 +01:00
parent 8ba7c62f1b
commit 9cfc4bb154
13 changed files with 91 additions and 65 deletions

View File

@ -4,9 +4,12 @@
#include "HelpersCommon.h"
#define AUTO_GETTER(type, name) \
public: \
CheapestType<type>::type_def MAKE_GETTER_NAME(name)() const { return m_##name; }
#define AUTO_GETTER(type, name) \
public: \
CheapestType<type>::type_def MAKE_GETTER_NAME(name)() const \
{ \
return m_##name; \
}
#define AUTO_SETTER(type, name) \
public: \

View File

@ -14,9 +14,12 @@ public: \
} \
}
#define CONST_GETTER(type, name) \
public: \
const type& MAKE_GETTER_NAME(name)() const { return m_##name; }
#define CONST_GETTER(type, name) \
public: \
const type& MAKE_GETTER_NAME(name)() const \
{ \
return m_##name; \
}
#define W_CREF_PROPERTY(type, name) \
protected: \

View File

@ -56,11 +56,14 @@ private:
CppListType m_items;
};
#define LIST_PROPERTY(TYPE, NAME) \
private: \
Q_PROPERTY(QQmlListProperty<TYPE> NAME READ MAKE_GETTER_NAME(NAME) CONSTANT) \
public: \
const QQmlSmartListWrapper<TYPE>& MAKE_GETTER_NAME(NAME)() const { return m_##NAME; } \
\
private: \
#define LIST_PROPERTY(TYPE, NAME) \
private: \
Q_PROPERTY(QQmlListProperty<TYPE> NAME READ MAKE_GETTER_NAME(NAME) CONSTANT) \
public: \
const QQmlSmartListWrapper<TYPE>& MAKE_GETTER_NAME(NAME)() const \
{ \
return m_##NAME; \
} \
\
private: \
QQmlSmartListWrapper<TYPE> m_##NAME;

View File

@ -4,9 +4,12 @@
#include "HelpersCommon.h"
#define PROP_GETTER(type, name) \
public: \
type MAKE_GETTER_NAME(name)() const { return m_##name; }
#define PROP_GETTER(type, name) \
public: \
type MAKE_GETTER_NAME(name)() const \
{ \
return m_##name; \
}
#define PROP_SETTER(type, name) \
public: \

View File

@ -5,9 +5,12 @@
#include "HelpersCommon.h"
#define PTR_GETTER(type, name) \
public: \
type* MAKE_GETTER_NAME(name)() const { return m_##name; }
#define PTR_GETTER(type, name) \
public: \
type* MAKE_GETTER_NAME(name)() const \
{ \
return m_##name; \
}
#define PTR_SETTER(type, name) \
public: \
@ -19,9 +22,12 @@ public: \
} \
}
#define SMART_PTR_GETTER(type, name) \
public: \
type* MAKE_GETTER_NAME(name)() const { return m_##name.get(); }
#define SMART_PTR_GETTER(type, name) \
public: \
type* MAKE_GETTER_NAME(name)() const \
{ \
return m_##name.get(); \
}
#define SMART_PTR_SETTER(type, name) \
public: \

View File

@ -4,20 +4,20 @@
#include <QDateTime>
#include <QDebug>
#include <QObject>
#include <QDir>
#include <QFileInfo>
#include <QJsonArray>
#include <QJsonObject>
#include <QMetaEnum>
#include <QObject>
#include <QQmlEngine>
#include <QString>
#include <QUrl>
#include <QDir>
#include <QVariant>
#include <QVariantList>
#include <QQmlEngine>
#include <QFileInfo>
#include "ScreenPlayUtil/util.h"
#include "ScreenPlayUtil/PropertyHelpers.h"
#include "ScreenPlayUtil/util.h"
/*!
\class ProjectFile

View File

@ -68,12 +68,9 @@ BaseWindow::ExitCode BaseWindow::setup()
// directly without an running ScreenPlay
if (!debugMode()) {
m_sdk = std::make_unique<ScreenPlaySDK>(appID(), QVariant::fromValue(type()).toString());
// QObject::connect(m_sdk.get(), &ScreenPlaySDK::sdkDisconnected, this, [this]() {
// destroyThis();
// });
connect(sdk(), &ScreenPlaySDK::sdkDisconnected, this, &BaseWindow::destroyThis);
connect(sdk(), &ScreenPlaySDK::incommingMessage, this, &BaseWindow::messageReceived);
connect(sdk(), &ScreenPlaySDK::replaceWallpaper, this, &BaseWindow::replaceWallpaper);
connect(m_sdk.get(), &ScreenPlaySDK::sdkDisconnected, this, &BaseWindow::destroyThis);
connect(m_sdk.get(), &ScreenPlaySDK::incommingMessage, this, &BaseWindow::messageReceived);
connect(m_sdk.get(), &ScreenPlaySDK::replaceWallpaper, this, &BaseWindow::replaceWallpaper);
sdk()->start();
}

View File

@ -24,8 +24,8 @@ int main(int argc, char* argv[])
// If we start with only one argument (path, appID, type),
// it means we want to test a single widget
if (argumentList.length() == 1) {
WidgetWindow spwmw("test", "appid", "qmlWidget", { 100, 100 }, true);
//WidgetWindow spwmw("C:/Program Files (x86)/Steam/steamapps/workshop/content/672870/2136442401", "appid", "qmlWidget", { 0, 0 }, true);
WidgetWindow spwmw("test", "appid", "qmlWidget", { 100, 100 }, true);
// WidgetWindow spwmw("C:/Program Files (x86)/Steam/steamapps/workshop/content/672870/2136442401", "appid", "qmlWidget", { 0, 0 }, true);
return app.exec();
}

View File

@ -40,10 +40,10 @@ WidgetWindow::WidgetWindow(
"Error: only enums");
Qt::WindowFlags flags = m_window.flags();
if(QSysInfo::productType() == "macos") {
if (QSysInfo::productType() == "macos") {
// Setting it as a SlashScreen causes the window to hide on focus lost
m_window.setFlags(flags | Qt::FramelessWindowHint | Qt::NoDropShadowWindowHint );
} else if(QSysInfo::productType() == "windows") {
m_window.setFlags(flags | Qt::FramelessWindowHint | Qt::NoDropShadowWindowHint);
} else if (QSysInfo::productType() == "windows") {
// Must be splash screen to not show up in the taskbar
m_window.setFlags(flags | Qt::FramelessWindowHint | Qt::NoDropShadowWindowHint | Qt::BypassWindowManagerHint | Qt::SplashScreen);
}
@ -220,4 +220,3 @@ void WidgetWindow::setupLiveReloading()
QObject::connect(&m_liveReloadLimiter, &QTimer::timeout, this, reloadQMLLambda);
m_fileSystemWatcher.addPaths({ projectPath() });
}

View File

@ -364,9 +364,9 @@ STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR(ISteamInventory*, SteamGameServerInve
// results transition from "Pending" to "OK" or an error state. There will
// always be exactly one callback per handle.
struct SteamInventoryResultReady_t {
enum { k_iCallback = k_iSteamInventoryCallbacks + 0 };
SteamInventoryResult_t m_handle;
EResult m_result;
enum { k_iCallback = k_iSteamInventoryCallbacks + 0 };
SteamInventoryResult_t m_handle;
EResult m_result;
};
// SteamInventoryFullUpdate_t callbacks are triggered when GetAllItems
@ -377,8 +377,8 @@ struct SteamInventoryResultReady_t {
// The normal ResultReady callback will still be triggered immediately
// afterwards; this is an additional notification for your convenience.
struct SteamInventoryFullUpdate_t {
enum { k_iCallback = k_iSteamInventoryCallbacks + 1 };
SteamInventoryResult_t m_handle;
enum { k_iCallback = k_iSteamInventoryCallbacks + 1 };
SteamInventoryResult_t m_handle;
};
// A SteamInventoryDefinitionUpdate_t callback is triggered whenever
@ -386,31 +386,31 @@ struct SteamInventoryFullUpdate_t {
// LoadItemDefinitions() or any other async request which required
// a definition update in order to process results from the server.
struct SteamInventoryDefinitionUpdate_t {
enum { k_iCallback = k_iSteamInventoryCallbacks + 2 };
enum { k_iCallback = k_iSteamInventoryCallbacks + 2 };
};
// Returned
struct SteamInventoryEligiblePromoItemDefIDs_t {
enum { k_iCallback = k_iSteamInventoryCallbacks + 3 };
EResult m_result;
CSteamID m_steamID;
int m_numEligiblePromoItemDefs;
bool m_bCachedData; // indicates that the data was retrieved from the cache and not the server
enum { k_iCallback = k_iSteamInventoryCallbacks + 3 };
EResult m_result;
CSteamID m_steamID;
int m_numEligiblePromoItemDefs;
bool m_bCachedData; // indicates that the data was retrieved from the cache and not the server
};
// Triggered from StartPurchase call
struct SteamInventoryStartPurchaseResult_t {
enum { k_iCallback = k_iSteamInventoryCallbacks + 4 };
EResult m_result;
uint64 m_ulOrderID;
uint64 m_ulTransID;
enum { k_iCallback = k_iSteamInventoryCallbacks + 4 };
EResult m_result;
uint64 m_ulOrderID;
uint64 m_ulTransID;
};
// Triggered from RequestPrices
struct SteamInventoryRequestPricesResult_t {
enum { k_iCallback = k_iSteamInventoryCallbacks + 5 };
EResult m_result;
char m_rgchCurrency[4];
enum { k_iCallback = k_iSteamInventoryCallbacks + 5 };
EResult m_result;
char m_rgchCurrency[4];
};
#pragma pack(pop)

View File

@ -31,7 +31,10 @@ S_API void* S_CALLTYPE SteamInternal_FindOrCreateGameServerInterface(HSteamUser
// struct { void (*pFn)(void* pCtx); uintptr_t counter; void *ptr; }
// Do not change layout or add non-pointer aligned data!
#define STEAM_DEFINE_INTERFACE_ACCESSOR(type, name, expr, kind, version) \
inline void S_CALLTYPE SteamInternal_Init_##name(type* p) { *p = (type)(expr); } \
inline void S_CALLTYPE SteamInternal_Init_##name(type* p) \
{ \
*p = (type)(expr); \
} \
STEAM_CLANG_ATTR("interface_accessor_kind:" kind ";interface_accessor_version:" version ";") \
inline type name() \
{ \
@ -66,9 +69,18 @@ S_API void S_CALLTYPE SteamAPI_UnregisterCallResult(class CCallbackBase* pCallba
#define _STEAM_CALLBACK_SELECT(X, Y) _STEAM_CALLBACK_HELPER X Y
#define _STEAM_CALLBACK_3(extra_code, thisclass, func, param) \
struct CCallbackInternal_##func : private CCallbackImpl<sizeof(param)> { \
CCallbackInternal_##func() { extra_code SteamAPI_RegisterCallback(this, param::k_iCallback); } \
CCallbackInternal_##func(const CCallbackInternal_##func&) { extra_code SteamAPI_RegisterCallback(this, param::k_iCallback); } \
CCallbackInternal_##func& operator=(const CCallbackInternal_##func&) { return *this; } \
CCallbackInternal_##func() \
{ \
extra_code SteamAPI_RegisterCallback(this, param::k_iCallback); \
} \
CCallbackInternal_##func(const CCallbackInternal_##func&) \
{ \
extra_code SteamAPI_RegisterCallback(this, param::k_iCallback); \
} \
CCallbackInternal_##func& operator=(const CCallbackInternal_##func&) \
{ \
return *this; \
} \
\
private: \
virtual void Run(void* pvParam) \

View File

@ -86,8 +86,8 @@ void InstalledListModel::append(const QString& projectJsonFilePath)
using namespace ScreenPlay;
ProjectFile projectFile;
projectFile.projectJsonFilePath = QFileInfo(projectJsonFilePath);
if(!projectFile.init()){
qWarning() << "Invalid project at "<< projectJsonFilePath;
if (!projectFile.init()) {
qWarning() << "Invalid project at " << projectJsonFilePath;
return;
}
m_screenPlayFiles.append(std::move(projectFile));

View File

@ -19,9 +19,9 @@
#include <QVariant>
#include <QVariantList>
#include <QVector>
#include <vector>
#include <QtConcurrent/QtConcurrent>
#include <QtQml>
#include <vector>
#include "ScreenPlayUtil/projectfile.h"