// -*- C++ -*-
#ifndef _Sketch_h_
#define _Sketch_h_

#include <GG/Menu.h>
#include <GG/PluginInterface.h>
#include <GG/SDL/SDLGUI.h>

namespace GG {
    class Layout;
    class WndEditor;
}
class Dialog;
class Workspace;

class SketchApp : public SDLGUI
{
public:
    SketchApp();

    virtual void Enter2DMode();
    virtual void Exit2DMode();

    GG::Wnd* Clone(GG::Wnd* wnd);
    int NewWndIndex();

    void CreateWnd(const std::string& wnd_type_str, const GG::Pt& pt);

    static SketchApp* GetSketchApp();

private:
    virtual void GLInit();
    virtual void Initialize();
    virtual void FinalCleanup();

    void New();
    void Open();
    void Save();
    void SaveAs();
    void Export();
    void SetFilename(const std::string& str, std::string& filename);
    void InsertWnd(int type);
    void InsertWnd(int type, const GG::Pt& pt);
    void SetPlugin(int plugin_idx);
    const GG::PluginInterface& CurrentPlugin();

    GG::Layout* m_layout;
    GG::MenuBar* m_menu_bar;
    GG::MenuItem m_new_wnd_menu;
    GG::WndEditor* m_wnd_editor;
    Workspace* m_workspace;
    Dialog* m_dialog;
    std::string m_open_filename;
    std::string m_export_base_filename;

    std::vector<boost::shared_ptr<GG::PluginInterface> > m_plugins;
    int m_current_plugin_idx;
    std::set<std::string> m_wnd_names;
    int m_total_num_wnds;
};

#endif // _Sketch_h_
