Skip to content

Commit

Permalink
Move ide_impl into XRay::Editor namespace (https://github.com/Xottab-…
Browse files Browse the repository at this point in the history
  • Loading branch information
Xottab-DUTY committed Nov 5, 2017
1 parent c761fed commit 7252c9a
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 26 deletions.
6 changes: 3 additions & 3 deletions src/editors/xrWeatherEditor/entry_point.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ private ref class window_ide_final : public editor::window_ide
private:
void on_idle(System::Object ^ sender, System::EventArgs ^ event_args)
{
ide_impl* impl = dynamic_cast<ide_impl*>(m_ide);
XRay::Editor::ide_impl* impl = dynamic_cast<XRay::Editor::ide_impl*>(m_ide);
impl->on_idle_start();

MSG message;
Expand All @@ -58,12 +58,12 @@ private ref class window_ide_final : public editor::window_ide
}
};

ide_impl* g_ide = nullptr;
XRay::Editor::ide_impl* g_ide = nullptr;

static void initialize_impl(XRay::Editor::ide_base*& ide, XRay::Editor::engine_base* engine)
{
VERIFY(!g_ide);
g_ide = new ide_impl(engine);
g_ide = new XRay::Editor::ide_impl(engine);
ide = g_ide;
g_ide->window(gcnew window_ide_final(ide, engine));
}
Expand Down
21 changes: 16 additions & 5 deletions src/editors/xrWeatherEditor/ide_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,16 @@

using editor::window_ide;

ide_impl::ide_impl(XRay::Editor::engine_base* engine) : m_engine(engine), m_window(nullptr), m_paused(false), m_in_idle(false) {}
namespace XRay
{
namespace Editor
{
ide_impl::ide_impl(engine_base* engine) : m_engine(engine), m_window(nullptr), m_paused(false), m_in_idle(false) {}
ide_impl::~ide_impl() {}

void ide_impl::window(window_ide ^ window) { m_window = window; }
window_ide ^ ide_impl::window() { return (m_window); }

void ide_impl::on_idle_start()
{
VERIFY(!m_in_idle);
Expand Down Expand Up @@ -55,8 +61,8 @@ void ide_impl::on_load_finished()
}

void ide_impl::pause() { m_window->view().pause(); }
XRay::Editor::property_holder_base* ide_impl::create_property_holder(
LPCSTR display_name, XRay::Editor::property_holder_collection* collection, XRay::Editor::property_holder_holder* holder)
property_holder_base* ide_impl::create_property_holder(
LPCSTR display_name, property_holder_collection* collection, property_holder_holder* holder)
{
return (new ::property_holder(m_engine, display_name, collection, holder));
}
Expand All @@ -82,8 +88,13 @@ void ide_impl::environment_weathers(property_holder* property_holder)
}

void ide_impl::weather_editor_setup(weathers_getter_type const& weathers_getter,
weathers_size_getter_type const& weathers_size_getter, frames_getter_type const& frames_getter,
frames_size_getter_type const& frames_size_getter)
weathers_size_getter_type const& weathers_size_getter, frames_getter_type const& frames_getter,
frames_size_getter_type const& frames_size_getter)
{
m_window->weather_editor().weathers_ids(weathers_getter, weathers_size_getter, frames_getter, frames_size_getter);
}
}
}



29 changes: 14 additions & 15 deletions src/editors/xrWeatherEditor/ide_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,24 @@

#include <vcclr.h>

namespace XRay
{
namespace Editor
{
class engine_base;
} //namespace Editor
} //namespace XRay

namespace editor
{
ref class window_ide;
}

class ide_impl : public XRay::Editor::ide_base
namespace XRay
{
namespace Editor
{
class engine_base;
class ide_impl : public ide_base
{
public:
typedef editor::window_ide window_ide;
typedef XRay::Editor::property_holder_base property_holder;
typedef property_holder_base property_holder;

public:
ide_impl(XRay::Editor::engine_base* engine);
ide_impl(engine_base* engine);
virtual ~ide_impl();
void window(window_ide ^ window);
window_ide ^ window();
Expand All @@ -56,19 +53,21 @@ class ide_impl : public XRay::Editor::ide_base

public:
virtual property_holder* create_property_holder(
LPCSTR display_name, XRay::Editor::property_holder_collection* collection, XRay::Editor::property_holder_holder* holder);
LPCSTR display_name, property_holder_collection* collection, property_holder_holder* holder);
virtual void destroy(property_holder*& property_holder);
virtual void environment_levels(property_holder* property_holder);
virtual void environment_weathers(property_holder* property_holder);
virtual void weather_editor_setup(weathers_getter_type const& weathers_getter,
weathers_size_getter_type const& weathers_size_getter, frames_getter_type const& frames_getter,
frames_size_getter_type const& frames_size_getter);
weathers_size_getter_type const& weathers_size_getter, frames_getter_type const& frames_getter,
frames_size_getter_type const& frames_size_getter);

private:
XRay::Editor::engine_base* m_engine;
engine_base* m_engine;
gcroot<window_ide ^> m_window;
bool m_paused;
bool m_in_idle;
}; // class ide
} //namespace Editor
} //namespace XRay

#endif // ifndef IDE_IMPL_HPP_INCLUDED
2 changes: 1 addition & 1 deletion src/editors/xrWeatherEditor/property_collection_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ using System::ComponentModel::Design::CollectionEditor;
typedef PropertyBag::PropertySpecDescriptor PropertySpecDescriptor;

#pragma unmanaged
extern ide_impl* g_ide;
extern XRay::Editor::ide_impl* g_ide;
#pragma managed

property_collection_editor::property_collection_editor(Type ^ type) : inherited(type) {}
Expand Down
8 changes: 7 additions & 1 deletion src/editors/xrWeatherEditor/property_container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,14 @@ using System::String;
using System::Collections::ArrayList;

#pragma unmanaged
namespace XRay
{
namespace Editor
{
class ide_impl;
extern ide_impl* g_ide;
}
}
extern XRay::Editor::ide_impl* g_ide;
#pragma managed

property_container::property_container(property_holder* holder, property_container_holder ^ container_holder)
Expand Down
2 changes: 1 addition & 1 deletion src/editors/xrWeatherEditor/window_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ Void window_view::window_view_KeyUp(System::Object ^ sender, System::Windows::Fo

Void window_view::window_view_Paint(System::Object ^ sender, System::Windows::Forms::PaintEventArgs ^ e)
{
if (dynamic_cast<ide_impl&>(m_ide->ide()).idle())
if (dynamic_cast<XRay::Editor::ide_impl&>(m_ide->ide()).idle())
return;

m_engine->on_idle();
Expand Down

0 comments on commit 7252c9a

Please sign in to comment.