mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-06-16 05:13:58 -07:00
Fix most headers in gui
Make include-what-you-use happy with most of the files in source/gui and fix what needs to be fixed after including missing compile flags. Ref: #8086 Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This commit is contained in:
parent
2b5830e82a
commit
461ff6c20c
34 changed files with 319 additions and 81 deletions
|
|
@ -19,41 +19,62 @@
|
|||
|
||||
#include "CGUI.h"
|
||||
|
||||
#include "GUIObjectEventBroadcaster.h"
|
||||
|
||||
#include "graphics/Canvas2D.h"
|
||||
#include "graphics/Color.h"
|
||||
#include "gui/CGUISetting.h"
|
||||
#include "gui/CGUISprite.h"
|
||||
#include "gui/GUIObjectEventBroadcaster.h"
|
||||
#include "gui/IGUIScrollBar.h"
|
||||
#include "gui/ObjectBases/IGUIObject.h"
|
||||
#include "gui/ObjectTypes/CGUIDummyObject.h"
|
||||
#include "gui/ObjectTypes/CTooltip.h"
|
||||
#include "gui/Scripting/JSInterface_GUIProxy.h"
|
||||
#include "gui/Scripting/ScriptFunctions.h"
|
||||
#include "gui/SettingTypes/CGUISize.h"
|
||||
#include "i18n/L10n.h"
|
||||
#include "lib/bits.h"
|
||||
#include "lib/debug.h"
|
||||
#include "lib/external_libraries/libsdl.h"
|
||||
#include "lib/file/vfs/vfs_util.h"
|
||||
#include "lib/input.h"
|
||||
#include "lib/sysdep/sysdep.h"
|
||||
#include "lib/path.h"
|
||||
#include "lib/timer.h"
|
||||
#include "lib/utf8.h"
|
||||
#include "maths/Size2D.h"
|
||||
#include "ps/CLogger.h"
|
||||
#include "ps/Errors.h"
|
||||
#include "ps/Filesystem.h"
|
||||
#include "ps/GameSetup/Config.h"
|
||||
#include "ps/Globals.h"
|
||||
#include "ps/Hotkey.h"
|
||||
#include "ps/Profile.h"
|
||||
#include "ps/Pyrogenesis.h"
|
||||
#include "ps/VideoMode.h"
|
||||
#include "ps/XMB/XMBData.h"
|
||||
#include "ps/XML/Xeromyces.h"
|
||||
#include "renderer/backend/Sampler.h"
|
||||
#include "scriptinterface/FunctionWrapper.h"
|
||||
#include "scriptinterface/Object.h"
|
||||
#include "scriptinterface/Promises.h"
|
||||
#include "scriptinterface/ScriptContext.h"
|
||||
#include "scriptinterface/ScriptExceptions.h"
|
||||
#include "scriptinterface/ScriptInterface.h"
|
||||
#include "scriptinterface/ScriptRequest.h"
|
||||
|
||||
#include <string>
|
||||
#include <algorithm>
|
||||
#include <js/CallAndConstruct.h>
|
||||
#if MSC_VERSION
|
||||
# pragma warning(push, 1)
|
||||
#endif
|
||||
#include <js/Promise.h>
|
||||
#if MSC_VERSION
|
||||
# pragma warning(pop)
|
||||
#endif
|
||||
#include <js/ValueArray.h>
|
||||
#include <optional>
|
||||
#include <SDL_events.h>
|
||||
#include <SDL_mouse.h>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
#include <unordered_map>
|
||||
#include <unordered_set>
|
||||
#include <utility>
|
||||
|
||||
const double SELECT_DBLCLICK_RATE = 0.5;
|
||||
const u32 MAX_OBJECT_DEPTH = 100; // Max number of nesting for GUI includes. Used to detect recursive inclusion
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
#define INCLUDED_CGUI
|
||||
|
||||
#include "gui/GUITooltip.h"
|
||||
#include "gui/IGUIScrollBar.h"
|
||||
#include "gui/SGUIIcon.h"
|
||||
#include "gui/SGUIMessage.h"
|
||||
#include "gui/SGUIStyle.h"
|
||||
|
|
@ -38,8 +39,10 @@
|
|||
#include "scriptinterface/ModuleLoader.h"
|
||||
#include "scriptinterface/StructuredClone.h"
|
||||
|
||||
#include <iterator>
|
||||
#include <js/RootingAPI.h>
|
||||
#include <js/TypeDecls.h>
|
||||
#include <js/Value.h>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
|
|
@ -47,7 +50,6 @@
|
|||
#include <string_view>
|
||||
#include <unordered_map>
|
||||
#include <unordered_set>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
class CCanvas2D;
|
||||
|
|
@ -63,11 +65,9 @@ class ScriptRequest;
|
|||
class XMBData;
|
||||
class XMBElement;
|
||||
namespace JS { class HandleValueArray; }
|
||||
namespace JS { class Value; }
|
||||
namespace js { class BaseProxyHandler; }
|
||||
struct SDL_Event_;
|
||||
struct SGUIImageEffects;
|
||||
struct SGUIScrollBarStyle;
|
||||
|
||||
extern const double SELECT_DBLCLICK_RATE;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2024 Wildfire Games.
|
||||
/* Copyright (C) 2025 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
|
|
@ -22,16 +22,23 @@
|
|||
#include "gui/CGUI.h"
|
||||
#include "gui/CGUISprite.h"
|
||||
#include "gui/ObjectBases/IGUIObject.h"
|
||||
#include "gui/SettingTypes/CGUIColor.h"
|
||||
#include "gui/SettingTypes/CGUIList.h"
|
||||
#include "gui/SettingTypes/CGUISeries.h"
|
||||
#include "gui/SettingTypes/CGUISize.h"
|
||||
#include "gui/SettingTypes/CGUIString.h"
|
||||
#include "gui/SettingTypes/EAlign.h"
|
||||
#include "gui/SettingTypes/EScrollOrientation.h"
|
||||
#include "lib/types.h"
|
||||
#include "maths/Vector2D.h"
|
||||
#include "ps/CLogger.h"
|
||||
#include "ps/CStr.h"
|
||||
#include "scriptinterface/ScriptConversions.h"
|
||||
|
||||
#include <js/RootingAPI.h>
|
||||
|
||||
enum class EAlign;
|
||||
enum class EScrollOrientation;
|
||||
enum class EVAlign;
|
||||
struct CColor;
|
||||
|
||||
IGUISetting::IGUISetting(const CStr& name, IGUIObject* owner) : m_Object(*owner), m_Name(name)
|
||||
{
|
||||
m_Object.RegisterSetting(m_Name, this);
|
||||
|
|
|
|||
|
|
@ -20,25 +20,50 @@
|
|||
#include "GUIManager.h"
|
||||
|
||||
#include "gui/CGUI.h"
|
||||
#include "gui/SGUIMessage.h"
|
||||
#include "lib/debug.h"
|
||||
#include "lib/file/vfs/vfs_util.h"
|
||||
#include "lib/timer.h"
|
||||
#include "lobby/IXmppClient.h"
|
||||
#include "lib/utf8.h"
|
||||
#include "ps/CLogger.h"
|
||||
#include "ps/Errors.h"
|
||||
#include "ps/Filesystem.h"
|
||||
#include "ps/GameSetup/Config.h"
|
||||
#include "ps/Profile.h"
|
||||
#include "ps/Profiler2.h"
|
||||
#include "ps/VideoMode.h"
|
||||
#include "ps/XMB/XMBData.h"
|
||||
#include "ps/XML/Xeromyces.h"
|
||||
#include "ps/containers/StaticVector.h"
|
||||
#include "scriptinterface/FunctionWrapper.h"
|
||||
#include "scriptinterface/Object.h"
|
||||
#include "scriptinterface/Promises.h"
|
||||
#include "scriptinterface/ScriptContext.h"
|
||||
#include "scriptinterface/ScriptConversions.h"
|
||||
#include "scriptinterface/ScriptInterface.h"
|
||||
#include "scriptinterface/ScriptRequest.h"
|
||||
#include "scriptinterface/StructuredClone.h"
|
||||
#include "simulation2/system/ParamNode.h"
|
||||
|
||||
#include "js/Equality.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <iterator>
|
||||
#include <js/Equality.h>
|
||||
#include <js/GCVector.h>
|
||||
#if MSC_VERSION
|
||||
# pragma warning(push, 1)
|
||||
#endif
|
||||
#include <js/Promise.h>
|
||||
#if MSC_VERSION
|
||||
# pragma warning(pop)
|
||||
#endif
|
||||
#include <js/PropertyAndElement.h>
|
||||
#include <js/RootingAPI.h>
|
||||
#include <js/String.h>
|
||||
#include <js/Symbol.h>
|
||||
#include <js/Value.h>
|
||||
#include <js/ValueArray.h>
|
||||
#include <stdexcept>
|
||||
#include <tuple>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
namespace
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2024 Wildfire Games.
|
||||
/* Copyright (C) 2025 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
|
|
@ -36,6 +36,13 @@
|
|||
#include "gui/ObjectTypes/CText.h"
|
||||
#include "gui/ObjectTypes/CTooltip.h"
|
||||
#include "gui/Scripting/JSInterface_GUIProxy.h"
|
||||
#include "ps/CStr.h"
|
||||
|
||||
#include <memory>
|
||||
#include <unordered_map>
|
||||
#include <utility>
|
||||
|
||||
class IGUIObject;
|
||||
|
||||
void CGUI::AddObjectTypes()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -24,14 +24,19 @@
|
|||
#include "gui/CGUI.h"
|
||||
#include "gui/CGUISprite.h"
|
||||
#include "gui/SettingTypes/CGUIColor.h"
|
||||
#include "gui/SettingTypes/CGUISize.h"
|
||||
#include "i18n/L10n.h"
|
||||
#include "lib/tex/tex.h"
|
||||
#include "lib/file/vfs/vfs_path.h"
|
||||
#include "lib/path.h"
|
||||
#include "lib/utf8.h"
|
||||
#include "maths/Vector2D.h"
|
||||
#include "ps/CLogger.h"
|
||||
#include "ps/CStrInternStatic.h"
|
||||
#include "ps/Filesystem.h"
|
||||
#include "ps/CStr.h"
|
||||
#include "renderer/Renderer.h"
|
||||
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
using namespace GUIRenderer;
|
||||
|
||||
DrawCalls::DrawCalls()
|
||||
|
|
|
|||
|
|
@ -18,10 +18,21 @@
|
|||
#include "precompiled.h"
|
||||
|
||||
#include "gui/CGUI.h"
|
||||
#include "gui/CGUISprite.h"
|
||||
#include "gui/SettingTypes/CGUIColor.h"
|
||||
#include "gui/SettingTypes/CGUISize.h"
|
||||
#include "gui/SettingTypes/CGUIString.h"
|
||||
#include "gui/SettingTypes/EAlign.h"
|
||||
#include "gui/SettingTypes/EScrollOrientation.h"
|
||||
#include "lib/types.h"
|
||||
#include "maths/Rect.h"
|
||||
#include "maths/Size2D.h"
|
||||
#include "maths/Vector2D.h"
|
||||
#include "ps/CLogger.h"
|
||||
#include "ps/CStr.h"
|
||||
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
class CGUIList;
|
||||
class CGUISeries;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2021 Wildfire Games.
|
||||
/* Copyright (C) 2025 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
|
|
@ -20,10 +20,15 @@
|
|||
#include "GUITooltip.h"
|
||||
|
||||
#include "gui/CGUI.h"
|
||||
#include "gui/ObjectBases/IGUIObject.h"
|
||||
#include "gui/ObjectTypes/CTooltip.h"
|
||||
#include "lib/debug.h"
|
||||
#include "lib/timer.h"
|
||||
#include "lib/types.h"
|
||||
#include "ps/CLogger.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
/*
|
||||
Tooltips:
|
||||
When holding the mouse stationary over an object for some amount of time,
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@
|
|||
#include "js/Conversions.h"
|
||||
#include "lib/debug.h"
|
||||
#include "lib/secure_crt.h"
|
||||
#include "maths/Size2D.h"
|
||||
#include "maths/Vector2D.h"
|
||||
#include "ps/CLogger.h"
|
||||
#include "ps/Profiler2.h"
|
||||
|
|
@ -46,6 +47,7 @@
|
|||
#include <js/SourceText.h>
|
||||
#include <js/TracingAPI.h>
|
||||
#include <js/Value.h>
|
||||
#include <js/ValueArray.h>
|
||||
#include <jsapi.h>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@
|
|||
#include <js/RootingAPI.h>
|
||||
#include <js/TypeDecls.h>
|
||||
#include <js/Value.h>
|
||||
#include <js/ValueArray.h>
|
||||
#include <memory>
|
||||
#include <stddef.h>
|
||||
#include <string>
|
||||
|
|
|
|||
|
|
@ -17,22 +17,39 @@
|
|||
|
||||
#include "precompiled.h"
|
||||
|
||||
#include "scriptinterface/ScriptConversions.h"
|
||||
|
||||
#include "gui/CGUISprite.h"
|
||||
#include "gui/ObjectBases/IGUIObject.h"
|
||||
#include "gui/Scripting/JSInterface_GUIProxy.h"
|
||||
#include "gui/SettingTypes/CGUIColor.h"
|
||||
#include "gui/SettingTypes/CGUIList.h"
|
||||
#include "gui/SettingTypes/CGUISeries.h"
|
||||
#include "gui/SettingTypes/CGUIString.h"
|
||||
#include "gui/SettingTypes/EAlign.h"
|
||||
#include "gui/SettingTypes/EScrollOrientation.h"
|
||||
#include "lib/code_generation.h"
|
||||
#include "lib/external_libraries/libsdl.h"
|
||||
#include "maths/Rect.h"
|
||||
#include "maths/Size2D.h"
|
||||
#include "maths/Vector2D.h"
|
||||
#include "ps/CLogger.h"
|
||||
#include "ps/Hotkey.h"
|
||||
#include "scriptinterface/Object.h"
|
||||
#include "scriptinterface/ScriptConversions.h"
|
||||
#include "scriptinterface/ScriptExceptions.h"
|
||||
#include "scriptinterface/ScriptRequest.h"
|
||||
|
||||
#include <js/CallArgs.h>
|
||||
#include <js/PropertyAndElement.h>
|
||||
#include <js/RootingAPI.h>
|
||||
#include <js/TypeDecls.h>
|
||||
#include <js/Value.h>
|
||||
#include <jsapi.h>
|
||||
#include <SDL_events.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
struct CColor;
|
||||
|
||||
#define SET(obj, name, value) STMT(JS::RootedValue v_(rq.cx); Script::ToJSVal(rq, &v_, (value)); JS_SetProperty(rq.cx, obj, (name), v_))
|
||||
// ignore JS_SetProperty return value, because errors should be impossible
|
||||
|
|
|
|||
|
|
@ -19,19 +19,36 @@
|
|||
|
||||
#include "JSInterface_CGUISize.h"
|
||||
|
||||
#include "ps/CStr.h"
|
||||
#include "gui/CGUI.h"
|
||||
#include "gui/CGUISetting.h"
|
||||
#include "gui/ObjectBases/IGUIObject.h"
|
||||
#include "gui/SettingTypes/CGUISize.h"
|
||||
#include "gui/Scripting/JSInterface_GUISize.h"
|
||||
#include "gui/SettingTypes/CGUISize.h"
|
||||
#include "lib/code_generation.h"
|
||||
#include "lib/types.h"
|
||||
#include "maths/Rect.h"
|
||||
#include "ps/CLogger.h"
|
||||
#include "ps/CStr.h"
|
||||
#include "scriptinterface/Object.h"
|
||||
#include "scriptinterface/ScriptConversions.h"
|
||||
#include "scriptinterface/ScriptInterface.h"
|
||||
#include "scriptinterface/ScriptForward.h"
|
||||
#include "scriptinterface/ScriptRequest.h"
|
||||
#include "scriptinterface/ScriptTypes.h"
|
||||
|
||||
#include <fmt/format.h>
|
||||
#include <js/CallArgs.h>
|
||||
#include <js/Class.h>
|
||||
#include <js/Conversions.h>
|
||||
#include <js/Object.h>
|
||||
#include <js/PropertyAndElement.h>
|
||||
#include <js/PropertyDescriptor.h>
|
||||
#include <js/PropertySpec.h>
|
||||
#include <js/RootingAPI.h>
|
||||
#include <js/TypeDecls.h>
|
||||
#include <js/Value.h>
|
||||
#include <jsapi.h>
|
||||
#include <string>
|
||||
struct JSContext;
|
||||
|
||||
namespace
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2024 Wildfire Games.
|
||||
/* Copyright (C) 2025 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
|
|
@ -21,12 +21,16 @@
|
|||
|
||||
#include "gui/CGUI.h"
|
||||
#include "gui/GUIManager.h"
|
||||
#include "gui/ObjectBases/IGUIObject.h"
|
||||
#include "ps/GameSetup/Config.h"
|
||||
#include "ps/VideoMode.h"
|
||||
#include "scriptinterface/FunctionWrapper.h"
|
||||
#include "scriptinterface/ScriptInterface.h"
|
||||
#include "scriptinterface/StructuredClone.h"
|
||||
#include "simulation2/system/ParamNode.h"
|
||||
#include <js/PropertyAndElement.h>
|
||||
#include <js/RootingAPI.h>
|
||||
#include <js/TypeDecls.h>
|
||||
#include <js/Value.h>
|
||||
#include <string>
|
||||
|
||||
namespace JSI_GUIManager
|
||||
{
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
#include "precompiled.h"
|
||||
|
||||
#include "JSInterface_GUIProxy.h"
|
||||
#include "JSInterface_GUIProxy_impl.h"
|
||||
|
||||
#include "gui/ObjectBases/IGUIObject.h"
|
||||
|
|
@ -26,6 +27,11 @@
|
|||
#include "gui/ObjectTypes/CScrollPanel.h"
|
||||
#include "gui/ObjectTypes/CText.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
class CGUIString;
|
||||
class ScriptRequest;
|
||||
|
||||
// Called for every specialization - adds the common interface.
|
||||
template<>
|
||||
void JSI_GUIProxy<IGUIObject>::CreateFunctions(const ScriptRequest& rq, GUIProxyProps* cache)
|
||||
|
|
|
|||
|
|
@ -19,16 +19,25 @@
|
|||
#define INCLUDED_JSI_GUIPROXY
|
||||
|
||||
#include "gui/ObjectBases/IGUIObject.h"
|
||||
#include "lib/sysdep/compiler.h"
|
||||
#include "scriptinterface/ScriptExtraHeaders.h"
|
||||
|
||||
#include <iterator>
|
||||
#include <js/GCVector.h>
|
||||
#include <js/Id.h>
|
||||
#include <js/Proxy.h>
|
||||
#include <js/RootingAPI.h>
|
||||
#include <js/TypeDecls.h>
|
||||
#include <js/Value.h>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
class JSFunction;
|
||||
class JSObject;
|
||||
class ScriptInterface;
|
||||
class ScriptRequest;
|
||||
|
||||
template <typename T>
|
||||
class JSI_GUIProxy;
|
||||
namespace JS { class CallArgs; }
|
||||
|
||||
// See JSI_GuiProxy below
|
||||
#if GCC_VERSION
|
||||
|
|
|
|||
|
|
@ -20,16 +20,37 @@
|
|||
#include "JSInterface_GUIProxy.h"
|
||||
|
||||
#include "gui/CGUI.h"
|
||||
#include "gui/CGUISetting.h"
|
||||
#include "gui/ObjectBases/IGUIObject.h"
|
||||
#include "ps/CLogger.h"
|
||||
#include "ps/CStr.h"
|
||||
#include "scriptinterface/FunctionWrapper.h"
|
||||
#include "scriptinterface/Object.h"
|
||||
#include "scriptinterface/ScriptConversions.h"
|
||||
#include "scriptinterface/ScriptExtraHeaders.h"
|
||||
#include "scriptinterface/ScriptRequest.h"
|
||||
|
||||
#include <js/CallAndConstruct.h>
|
||||
#include <js/CallArgs.h>
|
||||
#include <js/Class.h>
|
||||
#include <js/Object.h>
|
||||
#include <js/Proxy.h>
|
||||
#include <js/RootingAPI.h>
|
||||
#include <js/TypeDecls.h>
|
||||
#include <js/Value.h>
|
||||
#include <js/friend/ErrorMessages.h>
|
||||
#include <jsapi.h>
|
||||
#include <jspubtd.h>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <cstddef>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <type_traits>
|
||||
#include <unordered_map>
|
||||
#include <utility>
|
||||
|
||||
class JSObject;
|
||||
class ScriptInterface;
|
||||
|
||||
#ifndef INCLUDED_JSI_GUIPROXY_IMP
|
||||
#define INCLUDED_JSI_GUIPROXY_IMP
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2024 Wildfire Games.
|
||||
/* Copyright (C) 2025 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
|
|
@ -20,8 +20,20 @@
|
|||
#include "JSInterface_GUISize.h"
|
||||
|
||||
#include "ps/CStr.h"
|
||||
#include "scriptinterface/ScriptInterface.h"
|
||||
#include "scriptinterface/Object.h"
|
||||
#include "scriptinterface/ScriptConversions.h"
|
||||
#include "scriptinterface/ScriptInterface.h"
|
||||
#include "scriptinterface/ScriptRequest.h"
|
||||
|
||||
#include <js/CallArgs.h>
|
||||
#include <js/Class.h>
|
||||
#include <js/PropertyAndElement.h>
|
||||
#include <js/RootingAPI.h>
|
||||
#include <js/TypeDecls.h>
|
||||
#include <js/Value.h>
|
||||
#include <string>
|
||||
|
||||
struct JSContext;
|
||||
|
||||
JSClass JSI_GUISize::JSI_class = {
|
||||
"GUISize", 0, &JSI_GUISize::JSI_classops
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2021 Wildfire Games.
|
||||
/* Copyright (C) 2025 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
|
|
@ -18,10 +18,19 @@
|
|||
#ifndef INCLUDED_JSI_GUISIZE
|
||||
#define INCLUDED_JSI_GUISIZE
|
||||
|
||||
|
||||
#include "lib/types.h"
|
||||
#include "ps/CStr.h"
|
||||
#include "scriptinterface/ScriptForward.h"
|
||||
#include "scriptinterface/ScriptTypes.h"
|
||||
|
||||
#include <js/PropertySpec.h>
|
||||
|
||||
class ScriptInterface;
|
||||
namespace JS { class Value; }
|
||||
struct JSClass;
|
||||
struct JSClassOps;
|
||||
struct JSContext;
|
||||
|
||||
namespace JSI_GUISize
|
||||
{
|
||||
extern JSClass JSI_class;
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@
|
|||
#include "ps/scripting/JSInterface_VFS.h"
|
||||
#include "ps/scripting/JSInterface_VisualReplay.h"
|
||||
#include "renderer/scripting/JSInterface_Renderer.h"
|
||||
#include "scriptinterface/ScriptInterface.h"
|
||||
#include "scriptinterface/ScriptRequest.h"
|
||||
#include "simulation2/scripting/JSInterface_Simulation.h"
|
||||
#include "soundmanager/scripting/JSInterface_Sound.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -20,9 +20,9 @@
|
|||
|
||||
#include "graphics/Color.h"
|
||||
#include "lib/code_annotation.h"
|
||||
#include "ps/CStrForward.h"
|
||||
|
||||
class CGUI;
|
||||
class CStr8;
|
||||
|
||||
/**
|
||||
* Same as the CColor class, but this one can also parse colors predefined in the GUI page (such as "yellow").
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2023 Wildfire Games.
|
||||
/* Copyright (C) 2025 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
|
|
@ -23,6 +23,8 @@
|
|||
#include "gui/ObjectBases/IGUIObject.h"
|
||||
#include "scriptinterface/ScriptConversions.h"
|
||||
|
||||
#include <js/RootingAPI.h>
|
||||
|
||||
bool CGUIHotkey::DoFromString(const CStrW& value)
|
||||
{
|
||||
m_Object.GetGUI().UnsetObjectHotkey(&m_Object, m_Setting);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2023 Wildfire Games.
|
||||
/* Copyright (C) 2025 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
|
|
@ -19,11 +19,12 @@
|
|||
#define INCLUDED_CGUIHOTKEY
|
||||
|
||||
#include "gui/CGUISetting.h"
|
||||
#include "scriptinterface/ScriptForward.h"
|
||||
#include "lib/code_annotation.h"
|
||||
#include "ps/CStr.h"
|
||||
|
||||
#include <js/TypeDecls.h>
|
||||
|
||||
class IGUIObject;
|
||||
class ScriptRequest;
|
||||
|
||||
/**
|
||||
* Manages a hotkey setting for a GUI object.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2019 Wildfire Games.
|
||||
/* Copyright (C) 2025 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
|
|
@ -19,6 +19,7 @@
|
|||
#define INCLUDED_CGUILIST
|
||||
|
||||
#include "gui/SettingTypes/CGUIString.h"
|
||||
#include "lib/code_annotation.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
|
|
|
|||
|
|
@ -19,11 +19,8 @@
|
|||
|
||||
#include "CGUISize.h"
|
||||
|
||||
#include "gui/Scripting/JSInterface_GUISize.h"
|
||||
#include "ps/CLogger.h"
|
||||
#include "ps/CStr.h"
|
||||
#include "scriptinterface/Object.h"
|
||||
#include "scriptinterface/ScriptInterface.h"
|
||||
|
||||
CGUISize::CGUISize()
|
||||
: pixel(), percent()
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@
|
|||
#define INCLUDED_CGUISIZE
|
||||
|
||||
#include "maths/Rect.h"
|
||||
#include "ps/CStrForward.h"
|
||||
#include "scriptinterface/ScriptForward.h"
|
||||
|
||||
class CStr8;
|
||||
|
||||
/**
|
||||
* This class represents a rectangle relative to a parent rectangle
|
||||
|
|
|
|||
|
|
@ -21,13 +21,21 @@
|
|||
|
||||
#include "graphics/FontMetrics.h"
|
||||
#include "gui/CGUI.h"
|
||||
#include "gui/CGUISprite.h"
|
||||
#include "gui/ObjectBases/IGUIObject.h"
|
||||
#include "gui/SGUIIcon.h"
|
||||
#include "lib/debug.h"
|
||||
#include "lib/types.h"
|
||||
#include "lib/utf8.h"
|
||||
#include "maths/Rect.h"
|
||||
#include "ps/CLogger.h"
|
||||
#include "ps/CStrIntern.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <cstdlib>
|
||||
#include <utility>
|
||||
|
||||
struct CGUIColor;
|
||||
|
||||
// List of word delimiter bounds
|
||||
// The list contains ranges of word delimiters. The odd indexed chars are the start
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2022 Wildfire Games.
|
||||
/* Copyright (C) 2025 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
|
|
@ -19,13 +19,18 @@
|
|||
#define INCLUDED_CGUISTRING
|
||||
|
||||
#include "gui/CGUIText.h"
|
||||
#include "ps/CStrIntern.h"
|
||||
#include "lib/code_annotation.h"
|
||||
#include "maths/Size2D.h"
|
||||
#include "ps/CStr.h"
|
||||
|
||||
#include <array>
|
||||
#include <list>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
class CGUI;
|
||||
class CStrIntern;
|
||||
class IGUIObject;
|
||||
|
||||
/**
|
||||
* String class, substitute for CStr, but that parses
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2023 Wildfire Games.
|
||||
/* Copyright (C) 2025 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
|
|
@ -20,19 +20,28 @@
|
|||
#include "MouseEventMask.h"
|
||||
|
||||
#include "gui/CGUISetting.h"
|
||||
#include "lib/file/vfs/vfs.h"
|
||||
#include "lib/file/vfs/vfs_path.h"
|
||||
#include "lib/path.h"
|
||||
#include "lib/status.h"
|
||||
#include "lib/tex/tex.h"
|
||||
#include "lib/types.h"
|
||||
#include "maths/Rect.h"
|
||||
#include "maths/Vector2D.h"
|
||||
#include "ps/Filesystem.h"
|
||||
#include "ps/CacheLoader.h"
|
||||
#include "ps/CLogger.h"
|
||||
#include "ps/CStr.h"
|
||||
#include "ps/CacheLoader.h"
|
||||
#include "ps/Filesystem.h"
|
||||
#include "scriptinterface/ScriptConversions.h"
|
||||
|
||||
#include <cmath>
|
||||
#include <cstddef>
|
||||
#include <js/RootingAPI.h>
|
||||
#include <string_view>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
class IGUIObject;
|
||||
class IGUISetting;
|
||||
|
||||
namespace
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2023 Wildfire Games.
|
||||
/* Copyright (C) 2025 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
|
|
@ -19,15 +19,15 @@
|
|||
#define INCLUDED_GUI_MOUSE_EVENT_MASK
|
||||
|
||||
#include "gui/CGUISetting.h"
|
||||
#include "ps/CStr.h"
|
||||
#include "lib/code_annotation.h"
|
||||
|
||||
#include <string>
|
||||
#include <js/TypeDecls.h>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
class CRect;
|
||||
class CVector2D;
|
||||
class IGUIObject;
|
||||
class ScriptRequest;
|
||||
|
||||
/**
|
||||
* A custom shape that changes the object's "over-ability", and thus where one can click on it.
|
||||
|
|
|
|||
|
|
@ -17,14 +17,20 @@
|
|||
|
||||
#include "lib/self_test.h"
|
||||
|
||||
#include "graphics/FontManager.h"
|
||||
#include "graphics/FontMetrics.h"
|
||||
#include "gui/CGUI.h"
|
||||
#include "gui/CGUIText.h"
|
||||
#include "gui/SettingTypes/CGUIString.h"
|
||||
#include "gui/SettingTypes/EAlign.h"
|
||||
#include "i18n/L10n.h"
|
||||
#include "lib/file/file_system.h"
|
||||
#include "lib/file/vfs/vfs.h"
|
||||
#include "lib/path.h"
|
||||
#include "maths/Size2D.h"
|
||||
#include "maths/Vector2D.h"
|
||||
#include "ps/CLogger.h"
|
||||
#include "ps/CStr.h"
|
||||
#include "ps/CStrIntern.h"
|
||||
#include "ps/ConfigDB.h"
|
||||
#include "ps/Filesystem.h"
|
||||
#include "ps/ProfileViewer.h"
|
||||
|
|
@ -35,7 +41,10 @@
|
|||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
class TestCGUIText : public CxxTest::TestSuite
|
||||
{
|
||||
|
|
|
|||
|
|
@ -17,33 +17,37 @@
|
|||
|
||||
#include "lib/self_test.h"
|
||||
|
||||
#include "graphics/FontManager.h"
|
||||
#include "graphics/FontMetrics.h"
|
||||
#include "gui/CGUI.h"
|
||||
#include "gui/CGUISetting.h"
|
||||
#include "gui/CGUIText.h"
|
||||
#include "gui/ObjectBases/IGUIObject.h"
|
||||
#include "gui/Scripting/JSInterface_CGUISize.h"
|
||||
#include "gui/Scripting/JSInterface_GUIProxy.h"
|
||||
#include "gui/SettingTypes/CGUISize.h"
|
||||
#include "gui/SettingTypes/CGUIString.h"
|
||||
#include "i18n/L10n.h"
|
||||
#include "lib/file/file_system.h"
|
||||
#include "lib/file/vfs/vfs.h"
|
||||
#include "lib/path.h"
|
||||
#include "maths/Rect.h"
|
||||
#include "ps/CLogger.h"
|
||||
#include "ps/CStr.h"
|
||||
#include "ps/ConfigDB.h"
|
||||
#include "ps/Filesystem.h"
|
||||
#include "ps/ProfileViewer.h"
|
||||
#include "ps/VideoMode.h"
|
||||
#include "ps/XML/Xeromyces.h"
|
||||
#include "renderer/Renderer.h"
|
||||
#include "scriptinterface/Object.h"
|
||||
#include "scriptinterface/ScriptContext.h"
|
||||
#include "scriptinterface/ScriptInterface.h"
|
||||
#include "scriptinterface/ScriptRequest.h"
|
||||
#include "scriptinterface/ModuleLoader.h"
|
||||
|
||||
#include <js/PropertyAndElement.h>
|
||||
#include <js/PropertyDescriptor.h>
|
||||
#include <js/RootingAPI.h>
|
||||
#include <js/TypeDecls.h>
|
||||
#include <js/Value.h>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
class TestGUISetting : public CxxTest::TestSuite
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2024 Wildfire Games.
|
||||
/* Copyright (C) 2025 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
|
|
@ -21,20 +21,38 @@
|
|||
|
||||
#include "gui/CGUI.h"
|
||||
#include "lib/external_libraries/libsdl.h"
|
||||
#include "lib/file/file_system.h"
|
||||
#include "lib/file/vfs/vfs.h"
|
||||
#include "lib/input.h"
|
||||
#include "lib/path.h"
|
||||
#include "lib/sysdep/compiler.h"
|
||||
#include "ps/CLogger.h"
|
||||
#include "ps/CStr.h"
|
||||
#include "ps/ConfigDB.h"
|
||||
#include "ps/Filesystem.h"
|
||||
#include "ps/GameSetup/GameSetup.h"
|
||||
#include "ps/Hotkey.h"
|
||||
#include "ps/XML/Xeromyces.h"
|
||||
#include "scriptinterface/FunctionWrapper.h"
|
||||
#include "scriptinterface/ScriptContext.h"
|
||||
#include "scriptinterface/ScriptRequest.h"
|
||||
#include "scriptinterface/ScriptInterface.h"
|
||||
#include "scriptinterface/StructuredClone.h"
|
||||
#include "scriptinterface/Object.h"
|
||||
#include "scriptinterface/ScriptConversions.h"
|
||||
#include "scriptinterface/ScriptInterface.h"
|
||||
#include "scriptinterface/ScriptRequest.h"
|
||||
#include "scriptinterface/StructuredClone.h"
|
||||
|
||||
#include <array>
|
||||
#include <js/CallArgs.h>
|
||||
#include <js/PropertyAndElement.h>
|
||||
#include <js/RootingAPI.h>
|
||||
#include <js/TypeDecls.h>
|
||||
#include <js/Value.h>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <SDL_events.h>
|
||||
#include <SDL_scancode.h>
|
||||
#include <stdexcept>
|
||||
#include <tuple>
|
||||
#include <variant>
|
||||
|
||||
#if MSC_VERSION
|
||||
# pragma warning(push, 1)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2021 Wildfire Games.
|
||||
/* Copyright (C) 2025 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
|
|
@ -17,9 +17,13 @@
|
|||
|
||||
#include "lib/self_test.h"
|
||||
|
||||
#include "gui/SettingTypes/CGUISize.h"
|
||||
#include "gui/CGUI.h"
|
||||
#include "gui/SettingTypes/CGUISize.h"
|
||||
#include "maths/Rect.h"
|
||||
#include "maths/Size2D.h"
|
||||
#include "maths/Vector2D.h"
|
||||
#include "ps/CLogger.h"
|
||||
#include "ps/CStr.h"
|
||||
|
||||
class TestGuiParseString : public CxxTest::TestSuite
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
#ifndef INCLUDED_SCRIPTCONVERSIONS
|
||||
#define INCLUDED_SCRIPTCONVERSIONS
|
||||
|
||||
#include "lib/debug.h"
|
||||
#include "ScriptRequest.h"
|
||||
#include "ScriptExceptions.h"
|
||||
#include "ScriptExtraHeaders.h" // for typed arrays
|
||||
|
|
|
|||
Loading…
Reference in a new issue