#include "SaveLoad.h"
 
#include <GG/Button.h>
#include <GG/BrowseInfoWnd.h>
#include <GG/TextControl.h>
#include <GG/DropDownList.h>
#include <GG/DynamicGraphic.h>
#include <GG/Edit.h>
#include <GG/Layout.h>
#include <GG/Menu.h>
#include <GG/MultiEdit.h>
#include <GG/Scroll.h>
#include <GG/Slider.h>
#include <GG/Spin.h>
#include <GG/StaticGraphic.h>
#include <GG/StyleFactory.h>

#include <boost/serialization/list.hpp>
#include <boost/serialization/map.hpp>
#include <boost/serialization/set.hpp>
#include <boost/serialization/vector.hpp>
#include <boost/serialization/export.hpp>

#include <fstream>

BOOST_CLASS_EXPORT(GG::Wnd)
BOOST_CLASS_EXPORT(GG::BrowseInfoWnd)
BOOST_CLASS_EXPORT(GG::TextBoxBrowseInfoWnd)
BOOST_CLASS_EXPORT(GG::DropDownList)
BOOST_CLASS_EXPORT(GG::DynamicGraphic)
BOOST_CLASS_EXPORT(GG::Edit)
BOOST_CLASS_EXPORT(GG::Font)
BOOST_CLASS_EXPORT(GG::Layout)
BOOST_CLASS_EXPORT(GG::ListBox)
BOOST_CLASS_EXPORT(GG::ListBox::Row)
BOOST_CLASS_EXPORT(GG::MenuBar)
BOOST_CLASS_EXPORT(GG::MultiEdit)
BOOST_CLASS_EXPORT(GG::Scroll)
BOOST_CLASS_EXPORT(GG::Slider)
BOOST_CLASS_EXPORT_GUID(GG::Spin<int>, "GG::Spin_int_")
BOOST_CLASS_EXPORT_GUID(GG::Spin<double>, "GG::Spin_double_")
BOOST_CLASS_EXPORT(GG::StaticGraphic)
BOOST_CLASS_EXPORT(GG::TextControl)
BOOST_CLASS_EXPORT(GG::Button)
BOOST_CLASS_EXPORT(GG::StateButton)
BOOST_CLASS_EXPORT(GG::StyleFactory)
BOOST_CLASS_EXPORT(GG::RadioButtonGroup)

void SaveWnd(const GG::Wnd* wnd, const std::string& name, boost::archive::xml_oarchive& ar)
{
    ar & boost::serialization::make_nvp(name.c_str(), wnd);
}

void LoadWnd(GG::Wnd*& wnd, const std::string& name, boost::archive::xml_iarchive& ar)
{
    ar & boost::serialization::make_nvp(name.c_str(), wnd);
}
