Added Unreal Engine plugin to UniversalEditor GTK Engine

This commit is contained in:
Michael Becker 2014-07-09 17:41:43 -04:00
parent 0f93571a9d
commit 8bac18906b
6 changed files with 81 additions and 301 deletions

View File

@ -58,8 +58,8 @@
<ItemGroup>
<Compile Include="gtk-gui\generated.cs" />
<Compile Include="AssemblyInfo.cs" />
<Compile Include="Editors\UnrealPackageEditor.cs" />
<Compile Include="gtk-gui\UniversalEditor.Engines.GTK.Plugins.UnrealEngine.UnrealPackageEditor.cs" />
<Compile Include="Editors\UnrealPackageEditor.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>

View File

@ -14,6 +14,58 @@ namespace Stetic
}
}
internal class BinContainer
{
private Gtk.Widget child;
private Gtk.UIManager uimanager;
public static BinContainer Attach (Gtk.Bin bin)
{
BinContainer bc = new BinContainer ();
bin.SizeRequested += new Gtk.SizeRequestedHandler (bc.OnSizeRequested);
bin.SizeAllocated += new Gtk.SizeAllocatedHandler (bc.OnSizeAllocated);
bin.Added += new Gtk.AddedHandler (bc.OnAdded);
return bc;
}
private void OnSizeRequested (object sender, Gtk.SizeRequestedArgs args)
{
if ((this.child != null)) {
args.Requisition = this.child.SizeRequest ();
}
}
private void OnSizeAllocated (object sender, Gtk.SizeAllocatedArgs args)
{
if ((this.child != null)) {
this.child.Allocation = args.Allocation;
}
}
private void OnAdded (object sender, Gtk.AddedArgs args)
{
this.child = args.Widget;
}
public void SetUiManager (Gtk.UIManager uim)
{
this.uimanager = uim;
this.child.Realized += new System.EventHandler (this.OnRealized);
}
private void OnRealized (object sender, System.EventArgs args)
{
if ((this.uimanager != null)) {
Gtk.Widget w;
w = this.child.Toplevel;
if (((w != null) && typeof(Gtk.Window).IsInstanceOfType (w))) {
((Gtk.Window)(w)).AddAccelGroup (this.uimanager.AccelGroup);
this.uimanager = null;
}
}
}
}
internal class ActionGroups
{
public static Gtk.ActionGroup GetActionGroup (System.Type type)

View File

@ -8,4 +8,11 @@
<widget-library name="glade-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<widget-library name="../bin/Debug/UniversalEditor.Engines.GTK.Plugins.UnrealEngine.dll" internal="true" />
</import>
<widget class="Gtk.Bin" id="UniversalEditor.Engines.GTK.Plugins.UnrealEngine.UnrealPackageEditor" design-size="300 300">
<property name="MemberName" />
<property name="Visible">False</property>
<child>
<placeholder />
</child>
</widget>
</stetic-interface>

View File

@ -4,7 +4,7 @@ using UniversalEditor.UserInterface;
namespace UniversalEditor.Engines.GTK
{
[System.ComponentModel.ToolboxItem(true)]
public abstract partial class Editor : Gtk.Bin, IEditorImplementation
public partial class Editor : Gtk.Bin, IEditorImplementation
{
public Editor ()
{
@ -15,16 +15,29 @@ namespace UniversalEditor.Engines.GTK
public event ToolboxItemEventHandler ToolboxItemAdded;
public event ToolboxItemEventHandler ToolboxItemSelected;
public abstract void Copy ();
public abstract void Paste ();
public abstract void Delete ();
public virtual void Copy ()
{
}
public virtual void Paste ()
{
}
public virtual void Delete ()
{
}
public abstract void Undo ();
public abstract void Redo ();
public virtual void Undo ()
{
}
public virtual void Redo ()
{
}
public abstract bool SelectToolboxItem (ToolboxItem item);
public virtual bool SelectToolboxItem (ToolboxItem item)
{
return false;
}
public abstract string Title { get; }
public virtual string Title { get { return String.Empty; } }
private ObjectModelReference.ObjectModelReferenceCollection mvarSupportedObjectModels = new ObjectModelReference.ObjectModelReferenceCollection();
public ObjectModelReference.ObjectModelReferenceCollection SupportedObjectModels { get { return mvarSupportedObjectModels; } }

View File

@ -14,58 +14,6 @@ namespace Stetic
}
}
internal class BinContainer
{
private Gtk.Widget child;
private Gtk.UIManager uimanager;
public static BinContainer Attach (Gtk.Bin bin)
{
BinContainer bc = new BinContainer ();
bin.SizeRequested += new Gtk.SizeRequestedHandler (bc.OnSizeRequested);
bin.SizeAllocated += new Gtk.SizeAllocatedHandler (bc.OnSizeAllocated);
bin.Added += new Gtk.AddedHandler (bc.OnAdded);
return bc;
}
private void OnSizeRequested (object sender, Gtk.SizeRequestedArgs args)
{
if ((this.child != null)) {
args.Requisition = this.child.SizeRequest ();
}
}
private void OnSizeAllocated (object sender, Gtk.SizeAllocatedArgs args)
{
if ((this.child != null)) {
this.child.Allocation = args.Allocation;
}
}
private void OnAdded (object sender, Gtk.AddedArgs args)
{
this.child = args.Widget;
}
public void SetUiManager (Gtk.UIManager uim)
{
this.uimanager = uim;
this.child.Realized += new System.EventHandler (this.OnRealized);
}
private void OnRealized (object sender, System.EventArgs args)
{
if ((this.uimanager != null)) {
Gtk.Widget w;
w = this.child.Toplevel;
if (((w != null) && typeof(Gtk.Window).IsInstanceOfType (w))) {
((Gtk.Window)(w)).AddAccelGroup (this.uimanager.AccelGroup);
this.uimanager = null;
}
}
}
}
internal class ActionGroups
{
public static Gtk.ActionGroup GetActionGroup (System.Type type)

View File

@ -8,244 +8,4 @@
<widget-library name="glade-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<widget-library name="../../../../Output/Debug/UniversalEditor.Environments.GTK.dll" internal="true" />
</import>
<widget class="Gtk.Window" id="UniversalEditor.Engines.GTK.MainWindow" design-size="400 299">
<action-group name="Default">
<action id="FileAction">
<property name="Type">Action</property>
<property name="Label" translatable="yes">_File</property>
<property name="ShortLabel" translatable="yes">_File</property>
</action>
<action id="FileNew">
<property name="Type">Action</property>
<property name="Label" translatable="yes">_New</property>
<property name="ShortLabel" translatable="yes">_New</property>
</action>
<action id="FileNewDocument">
<property name="Type">Action</property>
<property name="Label" translatable="yes">_Document...</property>
<property name="ShortLabel" translatable="yes">_Document...</property>
</action>
<action id="FileNewProject">
<property name="Type">Action</property>
<property name="Label" translatable="yes">_Project...</property>
<property name="ShortLabel" translatable="yes">_Project...</property>
</action>
<action id="FileOpen">
<property name="Type">Action</property>
<property name="Label" translatable="yes">_Open</property>
<property name="ShortLabel" translatable="yes">_Open</property>
</action>
<action id="FileOpenDocument">
<property name="Type">Action</property>
<property name="Label" translatable="yes">_Document...</property>
<property name="ShortLabel" translatable="yes">_Document...</property>
</action>
<action id="FileOpenProject">
<property name="Type">Action</property>
<property name="Label" translatable="yes">_Project...</property>
<property name="ShortLabel" translatable="yes">_Project...</property>
</action>
<action id="CloseAction">
<property name="Type">Action</property>
<property name="Label" translatable="yes">_Close</property>
<property name="ShortLabel" translatable="yes">_Close</property>
</action>
<action id="DocumentAction">
<property name="Type">Action</property>
<property name="Label" translatable="yes">_Document</property>
<property name="ShortLabel" translatable="yes">_Document</property>
</action>
<action id="ProjectAction">
<property name="Type">Action</property>
<property name="Label" translatable="yes">_Project</property>
<property name="ShortLabel" translatable="yes">_Project</property>
</action>
<action id="WindowAction">
<property name="Type">Action</property>
<property name="Label" translatable="yes">_Window</property>
<property name="ShortLabel" translatable="yes">_Window</property>
</action>
<action id="quitAction">
<property name="Type">Action</property>
<property name="Label" translatable="yes">_Quit</property>
<property name="ShortLabel" translatable="yes">_Quit</property>
<property name="StockId">gtk-quit</property>
</action>
<action id="EditAction">
<property name="Type">Action</property>
<property name="Label" translatable="yes">_Edit</property>
<property name="ShortLabel" translatable="yes">_Edit</property>
</action>
<action id="CutAction">
<property name="Type">Action</property>
<property name="Label" translatable="yes">Cu_t</property>
<property name="ShortLabel" translatable="yes">Cu_t</property>
</action>
</action-group>
<property name="MemberName" />
<property name="Title" translatable="yes">Universal Editor</property>
<property name="WindowPosition">CenterOnParent</property>
<signal name="DeleteEvent" handler="OnDeleteEvent" />
<child>
<widget class="Gtk.VBox" id="vbox1">
<property name="MemberName" />
<property name="Spacing">6</property>
<child>
<widget class="Gtk.MenuBar" id="menubar1">
<property name="MemberName" />
<node name="menubar1" type="Menubar" />
</widget>
<packing>
<property name="Position">0</property>
<property name="AutoSize">True</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
</packing>
</child>
<child>
<widget class="Gtk.Toolbar" id="toolbar1">
<property name="MemberName" />
<property name="ShowArrow">False</property>
<node name="toolbar1" type="Toolbar" />
</widget>
<packing>
<property name="Position">1</property>
<property name="AutoSize">True</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
</packing>
</child>
<child>
<widget class="Gtk.Notebook" id="tbsTabs">
<property name="MemberName" />
<property name="CanFocus">True</property>
<property name="CurrentPage">-1</property>
</widget>
<packing>
<property name="Position">2</property>
<property name="AutoSize">False</property>
</packing>
</child>
<child>
<widget class="Gtk.Statusbar" id="statusbar1">
<property name="MemberName" />
<property name="Spacing">6</property>
<property name="HasResizeGrip">False</property>
<child>
<widget class="Gtk.Label" id="lblStatus">
<property name="MemberName" />
<property name="Xalign">0</property>
<property name="LabelProp" translatable="yes">Ready</property>
</widget>
<packing>
<property name="Position">0</property>
<property name="AutoSize">False</property>
</packing>
</child>
</widget>
<packing>
<property name="Position">3</property>
<property name="AutoSize">True</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
</packing>
</child>
</widget>
</child>
</widget>
<widget class="Gtk.Bin" id="UniversalEditor.Engines.GTK.Editor" design-size="300 300">
<property name="MemberName" />
<property name="Visible">False</property>
<child>
<placeholder />
</child>
</widget>
<widget class="Gtk.Dialog" id="UniversalEditor.Engines.GTK.Dialogs.CreateDocumentDialog" design-size="400 300">
<property name="MemberName" />
<property name="Title" translatable="yes">Create Document</property>
<property name="WindowPosition">CenterOnParent</property>
<property name="Buttons">2</property>
<property name="HelpButton">False</property>
<child internal-child="VBox">
<widget class="Gtk.VBox" id="dialog1_VBox">
<property name="MemberName" />
<property name="BorderWidth">2</property>
<child>
<widget class="Gtk.HPaned" id="hpaned1">
<property name="MemberName" />
<property name="CanFocus">True</property>
<property name="Position">154</property>
<child>
<widget class="Gtk.ScrolledWindow" id="GtkScrolledWindow">
<property name="MemberName" />
<property name="ShadowType">In</property>
<child>
<widget class="Gtk.TreeView" id="tvDocumentTypes">
<property name="MemberName" />
<property name="CanFocus">True</property>
<property name="ShowScrollbars">True</property>
</widget>
</child>
</widget>
<packing>
<property name="Resize">False</property>
</packing>
</child>
<child>
<widget class="Gtk.IconView" id="lvDocumentTemplates">
<property name="MemberName" />
<property name="CanFocus">True</property>
</widget>
</child>
</widget>
<packing>
<property name="Position">0</property>
<property name="AutoSize">True</property>
</packing>
</child>
</widget>
</child>
<child internal-child="ActionArea">
<widget class="Gtk.HButtonBox" id="dialog1_ActionArea">
<property name="MemberName" />
<property name="Spacing">10</property>
<property name="BorderWidth">5</property>
<property name="Size">2</property>
<property name="LayoutStyle">End</property>
<child>
<widget class="Gtk.Button" id="buttonCancel">
<property name="MemberName" />
<property name="CanDefault">True</property>
<property name="CanFocus">True</property>
<property name="UseStock">True</property>
<property name="Type">StockItem</property>
<property name="StockId">gtk-cancel</property>
<property name="ResponseId">-6</property>
<property name="label">gtk-cancel</property>
</widget>
<packing>
<property name="Expand">False</property>
<property name="Fill">False</property>
</packing>
</child>
<child>
<widget class="Gtk.Button" id="buttonOk">
<property name="MemberName" />
<property name="CanDefault">True</property>
<property name="CanFocus">True</property>
<property name="UseStock">True</property>
<property name="Type">StockItem</property>
<property name="StockId">gtk-ok</property>
<property name="ResponseId">-5</property>
<property name="label">gtk-ok</property>
</widget>
<packing>
<property name="Position">1</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
</packing>
</child>
</widget>
</child>
</widget>
</stetic-interface>