/* Copyright (C) 2026 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* 0 A.D. is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with 0 A.D. If not, see .
*/
#include "precompiled.h"
#include "ScenarioEditor.h"
#include "tools/atlas/AtlasObject/AtlasObject.h"
#include "tools/atlas/AtlasUI/CustomControls/Buttons/ToolButton.h"
#include "tools/atlas/AtlasUI/CustomControls/Canvas/Canvas.h"
#include "tools/atlas/AtlasUI/CustomControls/FileHistory/FileHistory.h"
#include "tools/atlas/AtlasUI/CustomControls/HighResTimer/HighResTimer.h"
#include "tools/atlas/AtlasUI/CustomControls/MapDialog/MapDialog.h"
#include "tools/atlas/AtlasUI/General/AtlasWindowCommandProc.h"
#include "tools/atlas/AtlasUI/General/Datafile.h"
#include "tools/atlas/AtlasUI/General/Observable.h"
#include "tools/atlas/AtlasUI/Misc/DLLInterface.h"
#include "tools/atlas/AtlasUI/Misc/KeyMap.h"
#include "tools/atlas/AtlasUI/ScenarioEditor/SectionLayout.h"
#include "tools/atlas/AtlasUI/ScenarioEditor/Tools/Common/MiscState.h"
#include "tools/atlas/AtlasUI/ScenarioEditor/Tools/Common/ObjectSettings.h"
#include "tools/atlas/AtlasUI/ScenarioEditor/Tools/Common/Tools.h"
#include "tools/atlas/GameInterface/MessagePasser.h"
#include "tools/atlas/GameInterface/Messages.h"
#include "tools/atlas/GameInterface/Shareable.h"
#include "tools/atlas/GameInterface/SharedTypes.h"
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
class wxInputStream;
class wxWindow;
#include
static HighResTimer g_Timer;
/**
* wxWidgets only registers the double click on mousedown.
*/
static int g_Clicks = 1;
using namespace AtlasMessage;
enum TIMER_TYPE
{
TIMER_TOOL,
TIMER_RENDER
};
const int TIMER_TOOL_INTERVAL = 16;
const int TIMER_RENDER_INTERVAL = 16;
const int TIMER_RENDER_SLOW_INTERVAL = 200;
// This records the last activity on the WX side.
double last_wx_user_activity = 0.0;
//////////////////////////////////////////////////////////////////////////
// GL functions exported from DLL, and called by game (in a separate
// thread to the standard wx one)
ATLASDLLIMPEXP void Atlas_GLSetCurrent(void* canvas)
{
static_cast