Skip to content

Commit

Permalink
move ide_base and engine_base to XRay::Editor namespace(https://githu…
Browse files Browse the repository at this point in the history
  • Loading branch information
Xottab-DUTY committed Nov 5, 2017
1 parent 8ea3ddb commit c761fed
Show file tree
Hide file tree
Showing 25 changed files with 129 additions and 120 deletions.
16 changes: 6 additions & 10 deletions src/Include/editor/engine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ namespace XRay
namespace Editor
{
class property_holder_base;
}
}

namespace editor
{
class engine_base
{
public:
Expand All @@ -40,6 +35,7 @@ class engine_base
// weather
virtual void weather(LPCSTR value) = 0;
virtual LPCSTR weather() = 0;

// weather frame
virtual void current_weather_frame(LPCSTR frame_id) = 0;
virtual LPCSTR current_weather_frame() = 0;
Expand All @@ -50,9 +46,9 @@ class engine_base
virtual void track_weather(float const& time) = 0;
virtual float track_weather() = 0;

virtual XRay::Editor::property_holder_base* current_frame_property_holder() = 0;
virtual XRay::Editor::property_holder_base* blend_frame_property_holder() = 0;
virtual XRay::Editor::property_holder_base* target_frame_property_holder() = 0;
virtual property_holder_base* current_frame_property_holder() = 0;
virtual property_holder_base* blend_frame_property_holder() = 0;
virtual property_holder_base* target_frame_property_holder() = 0;

virtual void weather_paused(bool const& value) = 0;
virtual bool weather_paused() = 0;
Expand All @@ -76,7 +72,7 @@ class engine_base
virtual char const* weather_current_time() const = 0;
virtual void weather_current_time(char const*) = 0;
}; // class engine

} // namespace editor
} // namespace Editor
} // namespace XRay

#endif // ifndef EDITOR_ENGINE_HPP_INCLUDED
27 changes: 11 additions & 16 deletions src/Include/editor/ide.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ namespace Editor
class property_holder_base;
class property_holder_collection;
class property_holder_holder;
}
}

namespace editor
{
class ide_base
{
public:
Expand All @@ -30,23 +26,22 @@ class ide_base
virtual void on_load_finished() = 0;
virtual void pause() = 0;

public:
virtual XRay::Editor::property_holder_base* create_property_holder(
LPCSTR display_name, XRay::Editor::property_holder_collection* collection = 0, XRay::Editor::property_holder_holder* holder = 0) = 0;
virtual void destroy(XRay::Editor::property_holder_base*& property_holder) = 0;
virtual void environment_levels(XRay::Editor::property_holder_base* property_holder) = 0;
virtual void environment_weathers(XRay::Editor::property_holder_base* property_holder) = 0;
virtual property_holder_base* create_property_holder(
LPCSTR display_name, property_holder_collection* collection = nullptr, property_holder_holder* holder = nullptr) = 0;

virtual void destroy(property_holder_base*& property_holder) = 0;
virtual void environment_levels(property_holder_base* property_holder) = 0;
virtual void environment_weathers(property_holder_base* property_holder) = 0;

public:
typedef fastdelegate::FastDelegate0<LPCSTR const*> weathers_getter_type;
typedef fastdelegate::FastDelegate0<u32> weathers_size_getter_type;
typedef fastdelegate::FastDelegate1<LPCSTR, LPCSTR const*> frames_getter_type;
typedef fastdelegate::FastDelegate1<LPCSTR, u32> frames_size_getter_type;
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) = 0;
}; // class ide

} // namespace editor
weathers_size_getter_type const& weathers_size_getter, frames_getter_type const& frames_getter,
frames_size_getter_type const& frames_size_getter) = 0;
};
}
}

#endif // ifndef EDITOR_IDE_HPP_INCLUDED
17 changes: 5 additions & 12 deletions src/Include/editor/interfaces.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,13 @@ namespace Editor
class ide_base;
class engine_base;

using initialize_function_ptr = void(*)(ide_base*&, engine_base*);
using finalize_function_ptr = void(*)(ide_base*&);

// XXX: is __cdecl needed?
using initialize_function_ptr = void(__cdecl*)(ide_base*&, engine_base*);
using finalize_function_ptr = void(__cdecl*)(ide_base*&);
//typedef void(__cdecl* initialize_function_ptr)(ide_base*&, engine_base*);
//typedef void(__cdecl* finalize_function_ptr)(ide_base*&);
}
}

namespace editor
{
class ide_base;
class engine_base;

typedef void(__cdecl* initialize_function_ptr)(ide_base*&, engine_base*);
typedef void(__cdecl* finalize_function_ptr)(ide_base*&);

} // namespace editor

#endif // ifndef EDITOR_INTERFACES_HPP_INCLUDED
8 changes: 4 additions & 4 deletions src/editors/xrWeatherEditor/entry_point.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
private ref class window_ide_final : public editor::window_ide
{
public:
window_ide_final(editor::ide_base*& ide, editor::engine_base* engine) : editor::window_ide(engine)
window_ide_final(XRay::Editor::ide_base*& ide, XRay::Editor::engine_base* engine) : editor::window_ide(engine)
{
m_ide = ide;
Application::Idle += gcnew System::EventHandler(this, &window_ide_final::on_idle);
Expand Down Expand Up @@ -60,7 +60,7 @@ private ref class window_ide_final : public editor::window_ide

ide_impl* g_ide = nullptr;

static void initialize_impl(editor::ide_base*& ide, editor::engine_base* engine)
static void initialize_impl(XRay::Editor::ide_base*& ide, XRay::Editor::engine_base* engine)
{
VERIFY(!g_ide);
g_ide = new ide_impl(engine);
Expand All @@ -73,13 +73,13 @@ static void initialize_impl(editor::ide_base*& ide, editor::engine_base* engine)
WINOLEAPI CoInitializeEx(IN LPVOID pvReserved, IN DWORD dwCoInit);
#pragma comment(lib, "ole32.lib")

extern "C" __declspec(dllexport) void initialize(editor::ide_base*& ide, editor::engine_base* engine)
extern "C" __declspec(dllexport) void initialize(XRay::Editor::ide_base*& ide, XRay::Editor::engine_base* engine)
{
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
initialize_impl(ide, engine);
}

extern "C" __declspec(dllexport) void finalize(editor::ide_base*& ide)
extern "C" __declspec(dllexport) void finalize(XRay::Editor::ide_base*& ide)
{
delete (ide);
ide = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion src/editors/xrWeatherEditor/ide_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

using editor::window_ide;

ide_impl::ide_impl(editor::engine_base* engine) : m_engine(engine), m_window(nullptr), m_paused(false), m_in_idle(false) {}
ide_impl::ide_impl(XRay::Editor::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); }
Expand Down
18 changes: 12 additions & 6 deletions src/editors/xrWeatherEditor/ide_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,27 @@

#include <vcclr.h>

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

namespace editor
{
ref class window_ide;
class engine_base;
class property_holder_holder;
} // namespace editor
}

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

public:
ide_impl(editor::engine_base* engine);
ide_impl(XRay::Editor::engine_base* engine);
virtual ~ide_impl();
void window(window_ide ^ window);
window_ide ^ window();
Expand All @@ -59,7 +65,7 @@ class ide_impl : public editor::ide_base
frames_size_getter_type const& frames_size_getter);

private:
editor::engine_base* m_engine;
XRay::Editor::engine_base* m_engine;
gcroot<window_ide ^> m_window;
bool m_paused;
bool m_in_idle;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

using System::String;

property_file_name_value_shared_str::property_file_name_value_shared_str(editor::engine_base* engine, shared_str& value,
property_file_name_value_shared_str::property_file_name_value_shared_str(XRay::Editor::engine_base* engine, shared_str& value,
System::String ^ DefaultExt_, System::String ^ Filter_, System::String ^ InitialDirectory_, System::String ^ Title_,
bool remove_extension)
: inherited(engine, value), DefaultExt(DefaultExt_), Filter(Filter_), InitialDirectory(InitialDirectory_),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@
#include "property_string_shared_str.hpp"
#include "property_file_name_value_base.hpp"

public
ref class property_file_name_value_shared_str : public property_string_shared_str, public property_file_name_value_base
public ref class property_file_name_value_shared_str : public property_string_shared_str, public property_file_name_value_base
{
private:
typedef property_string_shared_str inherited;

public:
property_file_name_value_shared_str(editor::engine_base* engine, shared_str& value, System::String ^ DefaultExt_,
property_file_name_value_shared_str(XRay::Editor::engine_base* engine, shared_str& value, System::String ^ DefaultExt_,
System::String ^ Filter_, System::String ^ InitialDirectory_, System::String ^ Title_, bool remove_extension);

virtual System::String ^ default_extension();
Expand Down
5 changes: 2 additions & 3 deletions src/editors/xrWeatherEditor/property_holder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@
using Flobbster::Windows::Forms::PropertySpec;
using System::String;
using XRay::Editor::property_holder_collection;
using editor::engine_base;
using XRay::Editor::property_holder_holder;

typedef property_holder::collection_type collection_type;

property_holder::property_holder(editor::engine_base* engine, LPCSTR display_name, property_holder_collection* collection,
property_holder::property_holder(XRay::Editor::engine_base* engine, LPCSTR display_name, property_holder_collection* collection,
XRay::Editor::property_holder_holder* holder)
: m_engine(engine), m_display_name(to_string(display_name)), m_collection(collection), m_holder(holder),
m_disposing(false)
Expand Down Expand Up @@ -53,7 +52,7 @@ void property_holder::on_dispose()
}

property_container ^ property_holder::container() { return (m_container); }
engine_base& property_holder::engine()
XRay::Editor::engine_base& property_holder::engine()
{
VERIFY(m_engine);
return (*m_engine);
Expand Down
17 changes: 11 additions & 6 deletions src/editors/xrWeatherEditor/property_holder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,28 @@
ref class property_container;
ref class property_holder_converter;


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


class property_holder : public XRay::Editor::property_holder_base
{
public:
property_holder(editor::engine_base* engine, LPCSTR display_name, XRay::Editor::property_holder_collection* collection,
property_holder(XRay::Editor::engine_base* engine, LPCSTR display_name, XRay::Editor::property_holder_collection* collection,
XRay::Editor::property_holder_holder* holder);
virtual ~property_holder();
void on_dispose();
property_container ^ container();
editor::engine_base& engine();
XRay::Editor::engine_base& engine();

public:
virtual XRay::Editor::property_holder_holder* holder();
Expand Down Expand Up @@ -209,7 +214,7 @@ class property_holder : public XRay::Editor::property_holder_base
gcroot<property_container ^> m_container;
gcroot<System::String ^> m_display_name;
collection_type* m_collection;
editor::engine_base* m_engine;
XRay::Editor::engine_base* m_engine;
XRay::Editor::property_holder_holder* m_holder;
bool m_disposing;
}; // class property_holder
Expand Down
2 changes: 1 addition & 1 deletion src/editors/xrWeatherEditor/property_string_shared_str.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "property_string_shared_str.hpp"
#include "engine_include.hpp"

property_string_shared_str::property_string_shared_str(editor::engine_base* engine, shared_str& value)
property_string_shared_str::property_string_shared_str(XRay::Editor::engine_base* engine, shared_str& value)
: m_engine(engine), m_value(&value)
{
}
Expand Down
12 changes: 7 additions & 5 deletions src/editors/xrWeatherEditor/property_string_shared_str.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,25 @@

#include "property_holder_include.hpp"

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

public
ref class property_string_shared_str : public XRay::SdkControls::IProperty
public ref class property_string_shared_str : public XRay::SdkControls::IProperty
{
public:
property_string_shared_str(editor::engine_base* engine, shared_str& value);
property_string_shared_str(XRay::Editor::engine_base* engine, shared_str& value);
virtual ~property_string_shared_str();
!property_string_shared_str();
virtual System::Object ^ GetValue();
virtual void SetValue(System::Object ^ object);

private:
editor::engine_base* m_engine;
XRay::Editor::engine_base* m_engine;
shared_str* m_value;
}; // ref class property_string_shared_str

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "property_string_values_value_shared_str.hpp"

property_string_values_value_shared_str::property_string_values_value_shared_str(
editor::engine_base* engine, shared_str& value, LPCSTR const* values, u32 const& value_count)
XRay::Editor::engine_base* engine, shared_str& value, LPCSTR const* values, u32 const& value_count)
: inherited(engine, value), m_collection(gcnew collection_type())
{
for (u32 i = 0; i < value_count; ++i)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
#include "property_string_shared_str.hpp"
#include "property_string_values_value_base.hpp"

public
ref class property_string_values_value_shared_str : public property_string_shared_str,
public property_string_values_value_base
public ref class property_string_values_value_shared_str
: public property_string_shared_str,
public property_string_values_value_base
{
private:
typedef property_string_shared_str inherited;
typedef property_string_values_value_base::collection_type collection_type;

public:
property_string_values_value_shared_str(
editor::engine_base* engine, shared_str& value, LPCSTR const* values, u32 const& value_count);
XRay::Editor::engine_base* engine, shared_str& value, LPCSTR const* values, u32 const& value_count);

virtual collection_type ^ values() { return m_collection; };

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

typedef property_string_values_value_shared_str_getter::collection_type collection_type;

property_string_values_value_shared_str_getter::property_string_values_value_shared_str_getter(editor::engine_base* engine,
property_string_values_value_shared_str_getter::property_string_values_value_shared_str_getter(XRay::Editor::engine_base* engine,
shared_str& value, string_collection_getter_type const& collection_getter,
string_collection_size_getter_type const& collection_size_getter)
: inherited(engine, value), m_collection_getter(new string_collection_getter_type(collection_getter)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
#include "property_string_shared_str.hpp"
#include "property_string_values_value_base.hpp"

public
ref class property_string_values_value_shared_str_getter : public property_string_shared_str,
public property_string_values_value_base
public ref class property_string_values_value_shared_str_getter
: public property_string_shared_str,
public property_string_values_value_base
{
private:
typedef property_string_shared_str inherited;
Expand All @@ -27,7 +27,7 @@ ref class property_string_values_value_shared_str_getter : public property_strin
typedef XRay::Editor::property_holder_base::string_collection_size_getter_type string_collection_size_getter_type;

public:
property_string_values_value_shared_str_getter(editor::engine_base* engine, shared_str& value,
property_string_values_value_shared_str_getter(XRay::Editor::engine_base* engine, shared_str& value,
string_collection_getter_type const& collection_getter,
string_collection_size_getter_type const& collection_size_getter);
virtual ~property_string_values_value_shared_str_getter();
Expand Down
Loading

0 comments on commit c761fed

Please sign in to comment.