Skip to content

Commit

Permalink
Fix xrWeatherEditor compilation
Browse files Browse the repository at this point in the history
Can't compile because of namespace conflict
  • Loading branch information
Xottab-DUTY committed Nov 10, 2017
1 parent b66390d commit 58e998c
Show file tree
Hide file tree
Showing 19 changed files with 131 additions and 143 deletions.
3 changes: 1 addition & 2 deletions src/editors/xrWeatherEditor/AssemblyInfo.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include "pch.hpp"

using namespace System;
using namespace System::Reflection;
using namespace System::Runtime::CompilerServices;
using namespace System::Runtime::InteropServices;
Expand Down Expand Up @@ -35,6 +34,6 @@ using namespace System::Security::Permissions;

[assembly:ComVisible(false)];

[assembly:CLSCompliantAttribute(true)];
[assembly:System::CLSCompliantAttribute(true)];

[assembly:SecurityPermission(SecurityAction::RequestMinimum, UnmanagedCode = true)];
12 changes: 5 additions & 7 deletions src/editors/xrWeatherEditor/entry_point.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
#include "pch.hpp"

#pragma unmanaged
#include <windows.h>
#include "Common/xr_impexp_macros.h"
#pragma managed(push, off)
#include "Include/editor/engine.hpp"
#include "ide_impl.hpp"
#pragma managed
#pragma managed(pop)

#include "window_ide.h"

Expand All @@ -21,18 +19,18 @@ private ref class window_ide_final : public editor::window_ide
window_ide_final(ide_base*& ide, engine_base* engine) : editor::window_ide(engine)
{
m_ide = ide;
Application::Idle += gcnew System::EventHandler(this, &window_ide_final::on_idle);
System::Windows::Forms::Application::Idle += gcnew System::EventHandler(this, &window_ide_final::on_idle);
}

~window_ide_final()
{
Application::Idle -= gcnew System::EventHandler(this, &window_ide_final::on_idle);
System::Windows::Forms::Application::Idle -= gcnew System::EventHandler(this, &window_ide_final::on_idle);
m_engine = nullptr;
m_ide = nullptr;
}

protected:
virtual void WndProc(Message % m) override
virtual void WndProc(System::Windows::Forms::Message % m) override
{
LONG_PTR result;
#ifdef XR_X64
Expand Down
1 change: 0 additions & 1 deletion src/editors/xrWeatherEditor/ide_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#define IDE_IMPL_HPP_INCLUDED

#pragma unmanaged
#include <windows.h>
#include "xrCore/fastdelegate.h"
#include <utility>
#include "include/editor/ide.hpp"
Expand Down
6 changes: 4 additions & 2 deletions src/editors/xrWeatherEditor/pch.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@

#pragma once

#pragma managed(push, off)
#include "Common/Platform.hpp"
#include "xrCommon/inlining_macros.h"
#pragma managed(pop)

#ifdef DEBUG
#define VERIFY(expression) \
Expand All @@ -35,9 +37,9 @@ typedef unsigned int u32;
typedef char const* LPCSTR;
typedef char* LPSTR;

#pragma unmanaged
#pragma managed(push, off)
#include <malloc.h>
#pragma managed
#pragma managed(pop)

#include <stdlib.h>
#include <vcclr.h>
Expand Down
3 changes: 1 addition & 2 deletions src/editors/xrWeatherEditor/property_collection_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ property_collection_editor::CollectionForm ^ property_collection_editor::CreateC
return (m_collection_form);
}

Object ^
property_collection_editor::EditValue(ITypeDescriptorContext ^ context, IServiceProvider ^ provider, Object ^ value)
Object^ property_collection_editor::EditValue(ITypeDescriptorContext ^ context, System::IServiceProvider ^ provider, Object ^ value)
{
if (!m_collection_form || !m_collection_form->Visible)
return (inherited::EditValue(context, provider, value));
Expand Down
7 changes: 2 additions & 5 deletions src/editors/xrWeatherEditor/property_collection_editor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
// Description : collection property editor implementation class
////////////////////////////////////////////////////////////////////////////

#ifndef PROPERTY_COLLECTION_EDITOR_HPP_INCLUDED
#define PROPERTY_COLLECTION_EDITOR_HPP_INCLUDED
#pragma once

ref class property_collection;
ref class property_container;
Expand All @@ -25,7 +24,7 @@ public ref class property_collection_editor : public System::ComponentModel::Des

public:
property_collection_editor(Type ^ type);
virtual Object ^ EditValue(ITypeDescriptorContext ^ context, IServiceProvider ^ provider, Object ^ value) override;
virtual Object ^ EditValue(ITypeDescriptorContext ^ context, System::IServiceProvider ^ provider, Object ^ value) override;

protected:
virtual Type ^ CreateCollectionItemType() override;
Expand All @@ -39,5 +38,3 @@ public ref class property_collection_editor : public System::ComponentModel::Des
private:
CollectionForm ^ m_collection_form;
}; // ref class property_collection_editor

#endif // ifndef PROPERTY_COLLECTION_EDITOR_HPP_INCLUDED
14 changes: 7 additions & 7 deletions src/editors/xrWeatherEditor/window_ide.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,18 @@ window_weather_editor % window_ide::weather_editor()
return (*m_weather_editor);
}

Void window_ide::window_ide_SizeChanged(System::Object ^ sender, System::EventArgs ^ e)
System::Void window_ide::window_ide_SizeChanged(System::Object ^ sender, System::EventArgs ^ e)
{
if (WindowState == System::Windows::Forms::FormWindowState::Maximized)
return;

if (WindowState == System::Windows::Forms::FormWindowState::Minimized)
return;

m_window_rectangle = gcnew Drawing::Rectangle(Location, Size);
m_window_rectangle = gcnew System::Drawing::Rectangle(Location, Size);
}

Void window_ide::window_ide_LocationChanged(System::Object ^ sender, System::EventArgs ^ e)
System::Void window_ide::window_ide_LocationChanged(System::Object ^ sender, System::EventArgs ^ e)
{
m_view->window_view_LocationChanged(sender, e);

Expand All @@ -91,20 +91,20 @@ Void window_ide::window_ide_LocationChanged(System::Object ^ sender, System::Eve
if (WindowState == System::Windows::Forms::FormWindowState::Minimized)
return;

m_window_rectangle = gcnew Drawing::Rectangle(Location, Size);
m_window_rectangle = gcnew System::Drawing::Rectangle(Location, Size);
}

Void window_ide::window_ide_Activated(System::Object ^ sender, System::EventArgs ^ e)
System::Void window_ide::window_ide_Activated(System::Object ^ sender, System::EventArgs ^ e)
{
m_view->window_view_Activated(sender, e);
}

Void window_ide::window_ide_Deactivate(System::Object ^ sender, System::EventArgs ^ e)
System::Void window_ide::window_ide_Deactivate(System::Object ^ sender, System::EventArgs ^ e)
{
m_view->window_view_Deactivate(sender, e);
}

Void window_ide::window_ide_FormClosing(System::Object ^ sender, System::Windows::Forms::FormClosingEventArgs ^ e)
System::Void window_ide::window_ide_FormClosing(System::Object ^ sender, System::Windows::Forms::FormClosingEventArgs ^ e)
{
e->Cancel = true;
save_on_exit();
Expand Down
13 changes: 6 additions & 7 deletions src/editors/xrWeatherEditor/window_ide.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#pragma once

using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
//using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;

Expand Down Expand Up @@ -156,10 +155,10 @@ public ref class window_ide : public System::Windows::Forms::Form
WeifenLuo::WinFormsUI::IDockContent ^ reload_content(System::String ^ persist_string);

private:
Void window_ide_SizeChanged(System::Object ^ sender, System::EventArgs ^ e);
Void window_ide_LocationChanged(System::Object ^ sender, System::EventArgs ^ e);
Void window_ide_FormClosing(System::Object ^ sender, System::Windows::Forms::FormClosingEventArgs ^ e);
Void window_ide_Activated(System::Object ^ sender, System::EventArgs ^ e);
Void window_ide_Deactivate(System::Object ^ sender, System::EventArgs ^ e);
System::Void window_ide_SizeChanged(System::Object ^ sender, System::EventArgs ^ e);
System::Void window_ide_LocationChanged(System::Object ^ sender, System::EventArgs ^ e);
System::Void window_ide_FormClosing(System::Object ^ sender, System::Windows::Forms::FormClosingEventArgs ^ e);
System::Void window_ide_Activated(System::Object ^ sender, System::EventArgs ^ e);
System::Void window_ide_Deactivate(System::Object ^ sender, System::EventArgs ^ e);
};
}
8 changes: 4 additions & 4 deletions src/editors/xrWeatherEditor/window_ide_serialize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ using Microsoft::Win32::RegistryValueKind;
#define PRODUCT_NAME "S.T.A.L.K.E.R.: CLear Sky"

template <typename T>
inline static T registry_value(RegistryKey ^ key, String ^ value_id, const T& default_value)
inline static T registry_value(RegistryKey ^ key, System::String ^ value_id, const T& default_value)
{
array<String ^> ^ names = key->GetValueNames();
array<System::String ^> ^ names = key->GetValueNames();
if (names->IndexOf(names, value_id) >= 0)
return ((T)key->GetValue(value_id));

Expand Down Expand Up @@ -116,7 +116,7 @@ void window_ide::load_on_create()
Width = 800;
Height = 600;

m_window_rectangle = gcnew Drawing::Rectangle(Location, Size);
m_window_rectangle = gcnew System::Drawing::Rectangle(Location, Size);

RegistryKey ^ product = base_registry_key();
VERIFY(product);
Expand All @@ -139,7 +139,7 @@ void window_ide::load_on_create()
position->Close();
}

m_window_rectangle = gcnew Drawing::Rectangle(Location, Size);
m_window_rectangle = gcnew System::Drawing::Rectangle(Location, Size);

switch ((int)registry_value(ide, "window_state", 2))
{
Expand Down
2 changes: 1 addition & 1 deletion src/editors/xrWeatherEditor/window_levels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

using editor::window_levels;

Void window_levels::window_levels_Leave(System::Object ^ sender, System::EventArgs ^ e)
System::Void window_levels::window_levels_Leave(System::Object ^ sender, System::EventArgs ^ e)
{
m_ide->view().property_grid(PropertyGrid);
}
3 changes: 1 addition & 2 deletions src/editors/xrWeatherEditor/window_levels.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#pragma once

using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
Expand Down Expand Up @@ -99,7 +98,7 @@ ref class window_levels : public WeifenLuo::WinFormsUI::DockContent
public:
inline ::PropertyGrid ^ property_grid() { return this->PropertyGrid; }

private : Void window_levels_Leave(System::Object ^ sender, System::EventArgs ^ e);
private : System::Void window_levels_Leave(System::Object ^ sender, System::EventArgs ^ e);
}; // ref class window_levels

} // namespace editor
2 changes: 1 addition & 1 deletion src/editors/xrWeatherEditor/window_tree_values.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ ref class NodeSorter : public IComparer
}
}; // ref class NodeSorter

void window_tree_values::values(property_string_values_value_base::collection_type ^ values, String ^ current_value)
void window_tree_values::values(property_string_values_value_base::collection_type ^ values, System::String ^ current_value)
{
TextBox->Text = current_value;
Result = current_value;
Expand Down
11 changes: 5 additions & 6 deletions src/editors/xrWeatherEditor/window_tree_values.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

#include "property_string_values_value_base.hpp"

using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
Expand Down Expand Up @@ -297,15 +296,15 @@ ref class window_tree_values : public System::Windows::Forms::Form
typedef property_string_values_value_base::collection_type collection_type;

public:
void values(collection_type ^ values, String ^ current_value);
void values(collection_type ^ values, System::String ^ current_value);

public:
System::String ^ Result;

private:
Void TreeView_AfterCollapse(Object ^ sender, TreeViewEventArgs ^ e);
Void TreeView_AfterExpand(Object ^ sender, TreeViewEventArgs ^ e);
Void TreeView_MouseClick(Object ^ sender, MouseEventArgs ^ e);
Void TreeView_MouseDoubleClick(Object ^ sender, MouseEventArgs ^ e);
System::Void TreeView_AfterCollapse(Object ^ sender, TreeViewEventArgs ^ e);
System::Void TreeView_AfterExpand(Object ^ sender, TreeViewEventArgs ^ e);
System::Void TreeView_MouseClick(Object ^ sender, MouseEventArgs ^ e);
System::Void TreeView_MouseDoubleClick(Object ^ sender, MouseEventArgs ^ e);
};
}
Loading

0 comments on commit 58e998c

Please sign in to comment.