diff --git a/GtkTest/GtkTest.csproj b/GtkTest/GtkTest.csproj
index fccb509e..c03009c2 100644
--- a/GtkTest/GtkTest.csproj
+++ b/GtkTest/GtkTest.csproj
@@ -37,6 +37,8 @@
prompt
true
false
+ 4
+ false
bin\x86\Release\
@@ -45,6 +47,9 @@
false
false
false
+ none
+ 4
+ false
diff --git a/WpfTest/WpfTest.csproj b/WpfTest/WpfTest.csproj
index b7825a0e..ee89f8f2 100644
--- a/WpfTest/WpfTest.csproj
+++ b/WpfTest/WpfTest.csproj
@@ -2,7 +2,7 @@
Debug
- x86
+ AnyCPU
8.0.30703
2.0
{E41F4448-15C3-4E95-B310-FD333FDF5D2F}
@@ -10,7 +10,6 @@
Properties
WpfTest
WpfTest
- v4.0
Client
512
@@ -24,6 +23,8 @@
false
false
false
+ 4
+ false
bin\Release\
@@ -33,6 +34,7 @@
AnyCPU
prompt
true
+ 4
true
@@ -44,6 +46,8 @@
false
false
false
+ 4
+ false
bin\x86\Release\
@@ -55,6 +59,7 @@
true
true
true
+ 4
diff --git a/Xwt.sln b/Xwt.sln
index 377b478a..41c88cc4 100644
--- a/Xwt.sln
+++ b/Xwt.sln
@@ -24,23 +24,12 @@ Global
Win-Debug|Any CPU = Win-Debug|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {92494904-35FA-4DC9-BDE9-3A3E87AC49D3}.Mac-Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {92494904-35FA-4DC9-BDE9-3A3E87AC49D3}.Mac-Debug|Any CPU.Build.0 = Debug|Any CPU
- {92494904-35FA-4DC9-BDE9-3A3E87AC49D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {92494904-35FA-4DC9-BDE9-3A3E87AC49D3}.Release|Any CPU.Build.0 = Release|Any CPU
- {92494904-35FA-4DC9-BDE9-3A3E87AC49D3}.Win-Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {92494904-35FA-4DC9-BDE9-3A3E87AC49D3}.Win-Debug|Any CPU.Build.0 = Debug|Any CPU
- {C3887A93-B2BD-4097-8E2F-3A063EFF32FD}.Mac-Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {C3887A93-B2BD-4097-8E2F-3A063EFF32FD}.Mac-Debug|Any CPU.Build.0 = Debug|Any CPU
- {C3887A93-B2BD-4097-8E2F-3A063EFF32FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {C3887A93-B2BD-4097-8E2F-3A063EFF32FD}.Release|Any CPU.Build.0 = Release|Any CPU
- {C3887A93-B2BD-4097-8E2F-3A063EFF32FD}.Win-Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {C3887A93-B2BD-4097-8E2F-3A063EFF32FD}.Win-Debug|Any CPU.Build.0 = Debug|Any CPU
- {B7C1673E-5124-4BE5-8D21-EC8B12F85B6B}.Mac-Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {B7C1673E-5124-4BE5-8D21-EC8B12F85B6B}.Mac-Debug|Any CPU.Build.0 = Debug|Any CPU
- {B7C1673E-5124-4BE5-8D21-EC8B12F85B6B}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {B7C1673E-5124-4BE5-8D21-EC8B12F85B6B}.Release|Any CPU.Build.0 = Release|Any CPU
- {B7C1673E-5124-4BE5-8D21-EC8B12F85B6B}.Win-Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {0AF50CE4-E455-4A9D-92AD-711CBD068A55}.Mac-Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {0AF50CE4-E455-4A9D-92AD-711CBD068A55}.Mac-Debug|Any CPU.Build.0 = Debug|Any CPU
+ {0AF50CE4-E455-4A9D-92AD-711CBD068A55}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {0AF50CE4-E455-4A9D-92AD-711CBD068A55}.Release|Any CPU.Build.0 = Release|Any CPU
+ {0AF50CE4-E455-4A9D-92AD-711CBD068A55}.Win-Debug|Any CPU.ActiveCfg = Debug|x86
+ {0AF50CE4-E455-4A9D-92AD-711CBD068A55}.Win-Debug|Any CPU.Build.0 = Debug|x86
{2B7FF081-FE53-42F7-9D5D-D4B38E548F94}.Mac-Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2B7FF081-FE53-42F7-9D5D-D4B38E548F94}.Mac-Debug|Any CPU.Build.0 = Debug|Any CPU
{2B7FF081-FE53-42F7-9D5D-D4B38E548F94}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -53,14 +42,26 @@ Global
{88C04B85-B69B-47B4-AB9F-64F6DD4E0897}.Release|Any CPU.Build.0 = Release|Any CPU
{88C04B85-B69B-47B4-AB9F-64F6DD4E0897}.Win-Debug|Any CPU.ActiveCfg = Debug|Any CPU
{88C04B85-B69B-47B4-AB9F-64F6DD4E0897}.Win-Debug|Any CPU.Build.0 = Debug|Any CPU
- {0AF50CE4-E455-4A9D-92AD-711CBD068A55}.Mac-Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {0AF50CE4-E455-4A9D-92AD-711CBD068A55}.Mac-Debug|Any CPU.Build.0 = Debug|Any CPU
- {0AF50CE4-E455-4A9D-92AD-711CBD068A55}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {0AF50CE4-E455-4A9D-92AD-711CBD068A55}.Release|Any CPU.Build.0 = Release|Any CPU
- {0AF50CE4-E455-4A9D-92AD-711CBD068A55}.Win-Debug|Any CPU.ActiveCfg = Debug|x86
- {0AF50CE4-E455-4A9D-92AD-711CBD068A55}.Win-Debug|Any CPU.Build.0 = Debug|x86
+ {92494904-35FA-4DC9-BDE9-3A3E87AC49D3}.Mac-Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {92494904-35FA-4DC9-BDE9-3A3E87AC49D3}.Mac-Debug|Any CPU.Build.0 = Debug|Any CPU
+ {92494904-35FA-4DC9-BDE9-3A3E87AC49D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {92494904-35FA-4DC9-BDE9-3A3E87AC49D3}.Release|Any CPU.Build.0 = Release|Any CPU
+ {92494904-35FA-4DC9-BDE9-3A3E87AC49D3}.Win-Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {92494904-35FA-4DC9-BDE9-3A3E87AC49D3}.Win-Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B7C1673E-5124-4BE5-8D21-EC8B12F85B6B}.Mac-Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {B7C1673E-5124-4BE5-8D21-EC8B12F85B6B}.Mac-Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B7C1673E-5124-4BE5-8D21-EC8B12F85B6B}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {B7C1673E-5124-4BE5-8D21-EC8B12F85B6B}.Release|Any CPU.Build.0 = Release|Any CPU
+ {B7C1673E-5124-4BE5-8D21-EC8B12F85B6B}.Win-Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {C3887A93-B2BD-4097-8E2F-3A063EFF32FD}.Mac-Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {C3887A93-B2BD-4097-8E2F-3A063EFF32FD}.Mac-Debug|Any CPU.Build.0 = Debug|Any CPU
+ {C3887A93-B2BD-4097-8E2F-3A063EFF32FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {C3887A93-B2BD-4097-8E2F-3A063EFF32FD}.Release|Any CPU.Build.0 = Release|Any CPU
+ {C3887A93-B2BD-4097-8E2F-3A063EFF32FD}.Win-Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {C3887A93-B2BD-4097-8E2F-3A063EFF32FD}.Win-Debug|Any CPU.Build.0 = Debug|Any CPU
{C93D746E-1586-4D4F-B411-BF5A966E6A08}.Mac-Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C93D746E-1586-4D4F-B411-BF5A966E6A08}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {C93D746E-1586-4D4F-B411-BF5A966E6A08}.Release|Any CPU.Build.0 = Release|Any CPU
{C93D746E-1586-4D4F-B411-BF5A966E6A08}.Win-Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C93D746E-1586-4D4F-B411-BF5A966E6A08}.Win-Debug|Any CPU.Build.0 = Debug|Any CPU
{E41F4448-15C3-4E95-B310-FD333FDF5D2F}.Mac-Debug|Any CPU.ActiveCfg = Debug|Any CPU
@@ -69,9 +70,6 @@ Global
{E41F4448-15C3-4E95-B310-FD333FDF5D2F}.Win-Debug|Any CPU.ActiveCfg = Debug|x86
{E41F4448-15C3-4E95-B310-FD333FDF5D2F}.Win-Debug|Any CPU.Build.0 = Debug|x86
EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
StartupItem = GtkTest\GtkTest.csproj
Policies = $0
@@ -84,4 +82,7 @@ Global
$3.Text = @\n${FileName}\n \nAuthor:\n ${AuthorName} <${AuthorEmail}>\n\nCopyright (c) ${Year} ${CopyrightHolder}\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the "Software"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.
$3.IncludeInNewFiles = True
EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
EndGlobal
diff --git a/Xwt/Xwt.Backends/BackendHost.cs b/Xwt/Xwt.Backends/BackendHost.cs
index 4b6e9de0..ae50489e 100644
--- a/Xwt/Xwt.Backends/BackendHost.cs
+++ b/Xwt/Xwt.Backends/BackendHost.cs
@@ -29,20 +29,20 @@ using Xwt.Engine;
namespace Xwt.Backends
{
- public class BackendHost: BackendHost
+ public class BackendHost: BackendHost where B:IBackend
{
public BackendHost ()
{
}
- protected BackendHost (IBackend backend): base (backend)
- {
- }
-
public new T Parent {
get { return (T)base.Parent; }
set { base.Parent = value; }
}
+
+ public new B Backend {
+ get { return (B)base.Backend; }
+ }
}
public class BackendHost
@@ -56,7 +56,7 @@ namespace Xwt.Backends
{
}
- protected BackendHost (IBackend backend)
+ public void SetCustomBackend (IBackend backend)
{
this.backend = backend;
usingCustomBackend = true;
@@ -115,11 +115,6 @@ namespace Xwt.Backends
}
}
- protected static void MapEvent (object eventId, Type type, string methodName)
- {
- EventUtil.MapEvent (eventId, type, methodName);
- }
-
public void OnBeforeEventAdd (object eventId, Delegate eventDelegate)
{
if (eventDelegate == null && !DefaultEnabledEvents.Contains (eventId))
diff --git a/Xwt/Xwt.Engine/WidgetRegistry.cs b/Xwt/Xwt.Engine/WidgetRegistry.cs
index d97cbece..42431710 100755
--- a/Xwt/Xwt.Engine/WidgetRegistry.cs
+++ b/Xwt/Xwt.Engine/WidgetRegistry.cs
@@ -93,16 +93,9 @@ namespace Xwt.Backends
class NativeWindowFrame: WindowFrame
{
- IWindowFrameBackend backend;
-
public NativeWindowFrame (IWindowFrameBackend backend)
{
- this.backend = backend;
- }
-
- protected override WindowBackendHost CreateBackendHost ()
- {
- return new WindowBackendHost (backend);
+ BackendHost.SetCustomBackend (backend);
}
}
diff --git a/Xwt/Xwt/Box.cs b/Xwt/Xwt/Box.cs
index ae8f386d..edcc0640 100755
--- a/Xwt/Xwt/Box.cs
+++ b/Xwt/Xwt/Box.cs
@@ -63,7 +63,7 @@ namespace Xwt
}
}
- protected override Widget.WidgetBackendHost CreateBackendHost ()
+ protected override BackendHost CreateBackendHost ()
{
return new WidgetBackendHost ();
}
diff --git a/Xwt/Xwt/Button.cs b/Xwt/Xwt/Button.cs
index 1d689fdd..cecd21a7 100755
--- a/Xwt/Xwt/Button.cs
+++ b/Xwt/Xwt/Button.cs
@@ -78,7 +78,7 @@ namespace Xwt
Image = img;
}
- protected override Widget.WidgetBackendHost CreateBackendHost ()
+ protected override BackendHost CreateBackendHost ()
{
return new WidgetBackendHost ();
}
diff --git a/Xwt/Xwt/Canvas.cs b/Xwt/Xwt/Canvas.cs
index fe056e19..80adb019 100644
--- a/Xwt/Xwt/Canvas.cs
+++ b/Xwt/Xwt/Canvas.cs
@@ -213,7 +213,7 @@ namespace Xwt
return Rectangle.Zero;
}
- protected override Widget.WidgetBackendHost CreateBackendHost ()
+ protected override BackendHost CreateBackendHost ()
{
return new WidgetBackendHost ();
}
diff --git a/Xwt/Xwt/CheckBox.cs b/Xwt/Xwt/CheckBox.cs
index 38aa1ee3..3df0d50e 100644
--- a/Xwt/Xwt/CheckBox.cs
+++ b/Xwt/Xwt/CheckBox.cs
@@ -62,7 +62,7 @@ namespace Xwt
Label = label;
}
- protected override Widget.WidgetBackendHost CreateBackendHost ()
+ protected override BackendHost CreateBackendHost ()
{
return new WidgetBackendHost ();
}
diff --git a/Xwt/Xwt/ComboBox.cs b/Xwt/Xwt/ComboBox.cs
index 87465b1a..82dd245b 100644
--- a/Xwt/Xwt/ComboBox.cs
+++ b/Xwt/Xwt/ComboBox.cs
@@ -66,7 +66,7 @@ namespace Xwt
views = new CellViewCollection ((ICellContainer)BackendHost);
}
- protected override Widget.WidgetBackendHost CreateBackendHost ()
+ protected override BackendHost CreateBackendHost ()
{
return new WidgetBackendHost ();
}
diff --git a/Xwt/Xwt/ComboBoxEntry.cs b/Xwt/Xwt/ComboBoxEntry.cs
index fb56ed0a..6a3ffa54 100644
--- a/Xwt/Xwt/ComboBoxEntry.cs
+++ b/Xwt/Xwt/ComboBoxEntry.cs
@@ -47,7 +47,7 @@ namespace Xwt
entry = new CustomComboTextEntry (Backend.TextEntryBackend);
}
- protected override Widget.WidgetBackendHost CreateBackendHost ()
+ protected override BackendHost CreateBackendHost ()
{
return new WidgetBackendHost ();
}
diff --git a/Xwt/Xwt/Dialog.cs b/Xwt/Xwt/Dialog.cs
index 5702ae97..91b9b4b7 100644
--- a/Xwt/Xwt/Dialog.cs
+++ b/Xwt/Xwt/Dialog.cs
@@ -69,7 +69,7 @@ namespace Xwt
}
}
- protected override WindowFrame.WindowBackendHost CreateBackendHost ()
+ protected override BackendHost CreateBackendHost ()
{
return new WindowBackendHost ();
}
diff --git a/Xwt/Xwt/FileDialog.cs b/Xwt/Xwt/FileDialog.cs
index ec53bdc3..068ade85 100644
--- a/Xwt/Xwt/FileDialog.cs
+++ b/Xwt/Xwt/FileDialog.cs
@@ -41,11 +41,12 @@ namespace Xwt
string fileName;
string[] fileNames = new string[0];
- BackendHost backendHost = new BackendHost ();
+ BackendHost backendHost;
internal FileDialog ()
{
filters = new FileDialogFilterCollection (AddRemoveItem);
+ backendHost = new BackendHost ();
backendHost.Parent = this;
}
@@ -55,7 +56,7 @@ namespace Xwt
}
IFileDialogBackend Backend {
- get { return (IFileDialogBackend) backendHost.Backend; }
+ get { return backendHost.Backend; }
}
void AddRemoveItem (FileDialogFilter filter, bool added)
diff --git a/Xwt/Xwt/Frame.cs b/Xwt/Xwt/Frame.cs
index 50f757cf..18f747aa 100644
--- a/Xwt/Xwt/Frame.cs
+++ b/Xwt/Xwt/Frame.cs
@@ -55,7 +55,7 @@ namespace Xwt
}
}
- protected override Widget.WidgetBackendHost CreateBackendHost ()
+ protected override BackendHost CreateBackendHost ()
{
return new WidgetBackendHost ();
}
diff --git a/Xwt/Xwt/ListBox.cs b/Xwt/Xwt/ListBox.cs
index ebeee48f..eae2b4e8 100644
--- a/Xwt/Xwt/ListBox.cs
+++ b/Xwt/Xwt/ListBox.cs
@@ -67,7 +67,7 @@ namespace Xwt
views = new CellViewCollection ((ICellContainer)BackendHost);
}
- protected override Widget.WidgetBackendHost CreateBackendHost ()
+ protected override BackendHost CreateBackendHost ()
{
return new WidgetBackendHost ();
}
diff --git a/Xwt/Xwt/ListStore.cs b/Xwt/Xwt/ListStore.cs
index f32f702d..0070cb58 100644
--- a/Xwt/Xwt/ListStore.cs
+++ b/Xwt/Xwt/ListStore.cs
@@ -35,15 +35,12 @@ namespace Xwt
{
DataField[] fields;
- class ListStoreBackendHost: BackendHost
+ class ListStoreBackendHost: BackendHost
{
- protected override IBackend OnCreateBackend ()
+ protected override void OnBackendCreated ()
{
- IBackend b = base.OnCreateBackend ();
- if (b == null)
- b = new DefaultListStoreBackend ();
- ((IListStoreBackend)b).Initialize (Parent.fields.Select (f => f.FieldType).ToArray ());
- return b;
+ Backend.Initialize (Parent.fields.Select (f => f.FieldType).ToArray ());
+ base.OnBackendCreated ();
}
}
diff --git a/Xwt/Xwt/ListView.cs b/Xwt/Xwt/ListView.cs
index 0d4a8768..26063de9 100644
--- a/Xwt/Xwt/ListView.cs
+++ b/Xwt/Xwt/ListView.cs
@@ -71,7 +71,7 @@ namespace Xwt
VerticalScrollPolicy = HorizontalScrollPolicy = ScrollPolicy.Automatic;
}
- protected override Widget.WidgetBackendHost CreateBackendHost ()
+ protected override BackendHost CreateBackendHost ()
{
return new WidgetBackendHost ();
}
diff --git a/Xwt/Xwt/MenuButton.cs b/Xwt/Xwt/MenuButton.cs
index 73951dbe..9d887bcc 100644
--- a/Xwt/Xwt/MenuButton.cs
+++ b/Xwt/Xwt/MenuButton.cs
@@ -65,7 +65,7 @@ namespace Xwt
Image = img;
}
- protected override Widget.WidgetBackendHost CreateBackendHost ()
+ protected override BackendHost CreateBackendHost ()
{
return new WidgetBackendHost ();
}
diff --git a/Xwt/Xwt/MenuItem.cs b/Xwt/Xwt/MenuItem.cs
index 224fa8fb..7a6ef47a 100644
--- a/Xwt/Xwt/MenuItem.cs
+++ b/Xwt/Xwt/MenuItem.cs
@@ -38,12 +38,12 @@ namespace Xwt
EventHandler clicked;
Image image;
- protected class MenuItemBackendHost: BackendHost