Name: csapi-widget-application
Summary: Tizen widget application API for C#
-Version: 1.0.2
+Version: 1.0.3
Release: 1
Group: Development/Libraries
License: Apache-2.0
# C# API Requires
BuildRequires: csapi-tizen-nuget
BuildRequires: csapi-application-nuget
+BuildRequires: elm-sharp-nuget
%define Assemblies Tizen.Applications.WidgetApplication
<Compile Include="Tizen.Applications\WidgetBase.cs" />\r
<Compile Include="Tizen.Applications.CoreBackend\WidgetCoreBackend.cs" />\r
<Compile Include="Tizen.Applications\WidgetType.cs" />\r
+ <Compile Include="Tizen.Applications\WidgetWindow.cs" />\r
</ItemGroup>\r
<ItemGroup>\r
<None Include="Tizen.Applications.WidgetApplication.Net45.project.json" />\r
<None Include="Tizen.Applications.WidgetApplication.nuspec" />\r
<None Include="Tizen.Applications.WidgetApplication.snk" />\r
</ItemGroup>\r
- <ItemGroup>\r
- <CodeAnalysisDictionary Include="CustomDictionary.xml" />\r
- </ItemGroup>\r
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.\r
Other similar extension points exist, see Microsoft.Common.targets.\r
<Target Name="AfterBuild">\r
</Target>\r
-->\r
-</Project>\r
+</Project>
\ No newline at end of file
{
"dependencies": {
"Tizen": "1.0.2",
- "Tizen.Applications": "1.0.2"
+ "Tizen.Applications": "1.0.3",
+ "ElmSharp": "1.1.0-*"
},
"frameworks": {
"net45": {}
<Compile Include="Tizen.Applications\WidgetBase.cs" />\r
<Compile Include="Tizen.Applications.CoreBackend\WidgetCoreBackend.cs" />\r
<Compile Include="Tizen.Applications\WidgetType.cs" />\r
+ <Compile Include="Tizen.Applications\WidgetWindow.cs" />\r
</ItemGroup>\r
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.\r
<_FullFrameworkReferenceAssemblyPaths>$(MSBuildThisFileDirectory)</_FullFrameworkReferenceAssemblyPaths>\r
<AutoUnifyAssemblyReferences>true</AutoUnifyAssemblyReferences>\r
</PropertyGroup>\r
-</Project>\r
+</Project>
\ No newline at end of file
<dependencies>
<dependency id="Tizen" version="1.0.2" />
<dependency id="Tizen.Applications" version="1.0.2" />
+ <dependency id="ElmSharp" version="1.0.14" />
</dependencies>
</metadata>
<files>
-{
- "dependencies": {
- "NETStandard.Library": "1.6.0",
- "Tizen": "1.0.2",
- "Tizen.Applications": "1.0.2",
- },
- "frameworks": {
- "netstandard1.3": {}
- }
-}
+{\r
+ "dependencies": {\r
+ "NETStandard.Library": "1.6.0",\r
+ "Tizen": "1.0.2",\r
+ "Tizen.Applications": "1.0.3",\r
+ "ElmSharp": "1.1.0-*"\r
+ },\r
+ "frameworks": {\r
+ "netstandard1.3": {}\r
+ }\r
+}\r
* limitations under the License.
*/
+using ElmSharp;
using System;
namespace Tizen.Applications
protected static readonly string LogTag = typeof(WidgetBase).Namespace;
/// <summary>
+ /// Window object for this widget instance.
+ /// It wii be created after OnCreate method is invoked.
+ /// </summary>
+ protected Widget Window;
+
+ /// <summary>
/// Delete type
/// </summary>
public enum WidgetDestroyType
IntPtr win;
Interop.Widget.GetWin(Handle, out win);
-
- OnPreCreate(win, w, h);
+ Window = new WidgetWindow(win);
+ Window.Resize(w, h);
+ Window.Show();
}
/// <summary>
{
}
- /// <summary>
- /// Overrides this method if want to handle behavior before OnCreate() is completed.
- /// <param name="w">The pixel value for widget width</param>
- /// <param name="h">The pixel value for widget height</param>
- /// </summary>
- protected virtual void OnPreCreate(IntPtr window, int w, int h)
- {
- }
}
}
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using ElmSharp;
+using System;
+using System.Collections.Generic;
+
+namespace Tizen.Applications
+{
+ internal class WidgetWindow : Widget
+ {
+ private IntPtr _handle;
+
+ internal WidgetWindow(IntPtr handle) : base()
+ {
+ _handle = handle;
+ Realize(null);
+ }
+
+ protected override IntPtr CreateHandle(EvasObject parent)
+ {
+ return _handle;
+ }
+
+ }
+}
+