// Emacs style mode select   -*- C++ -*-
//-----------------------------------------------------------------------------
//
// $Id: fab38aa2e8d0a8ba5203537b7a87dd4a58876d0c $
//
// Copyright (C) 2006-2026 by The Odamex Team.
//
// This program 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.
//
// This program 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.
//
// DESCRIPTION:
//  wxWidgets-specific fixes and workarounds that apply to different platforms
//  that this program runs under
//
//-----------------------------------------------------------------------------

#pragma once

#include "odalaunch.h"

#include <wx/frame.h>
#include <wx/icon.h>
#include <wx/string.h>

#ifdef __forceinline
#define forceinline __forceinline
#else
#define forceinline inline
#endif

// All
wxString OdaGetInstallDir();

// Windows
void OdaMswFixTitlebarIcon(WXWidget Handle, wxIcon MainIcon);
void OdaMswStopFlashingWindow(WXWidget Handle);

// OSX
void OdaMacRemoveFileMenu(wxFrame* parent);

//
// clamp
//
// Clamps the value of in to the range min, max
//
#ifdef clamp
#undef clamp
#endif
template<class T>
forceinline T clamp(const T in, const T min, const T max)
{
	return in <= min ? min : in >= max ? max : in;
}
