Fix ImageLoading to use new smart callbacks
authorWonYoung Choi <wy80.choi@samsung.com>
Thu, 20 Oct 2016 13:43:58 +0000 (22:43 +0900)
committerWonYoung Choi <wy80.choi@samsung.com>
Thu, 20 Oct 2016 13:57:17 +0000 (22:57 +0900)
New start callbacks for Image were introduced.
Fix these smart callbacks ("load,ready", "load,error") are used
instead of "preloaded" evas callback.

Change-Id: Ia78fb25f29f926045f2ef4c5aa2d457ff9821ff8

24 files changed:
.editorconfig [new file with mode: 0644]
.gitattributes [new file with mode: 0644]
packaging/elm-sharp.spec
src/ElmSharp/ElmSharp.Net45.csproj
src/ElmSharp/ElmSharp.csproj
src/ElmSharp/ElmSharp/Image.cs
src/ElmSharp/Interop/Interop.Elementary.Image.cs
test/ElmSharp.Test/ElmSharp.Test.csproj
test/ElmSharp.Test/TC/ImageTest1.cs
test/ElmSharp.Test/res/TED/app_icn_ted.png [new file with mode: 0755]
test/ElmSharp.Test/res/TED/large/a.jpg [new file with mode: 0755]
test/ElmSharp.Test/res/TED/large/b.jpg [new file with mode: 0755]
test/ElmSharp.Test/res/TED/large/c.jpg [new file with mode: 0755]
test/ElmSharp.Test/res/TED/large/d.jpg [new file with mode: 0755]
test/ElmSharp.Test/res/TED/large/e.jpg [new file with mode: 0755]
test/ElmSharp.Test/res/TED/large/f.jpg [new file with mode: 0755]
test/ElmSharp.Test/res/TED/large/g.jpg [new file with mode: 0755]
test/ElmSharp.Test/res/TED/thumbnail/a.jpg [new file with mode: 0755]
test/ElmSharp.Test/res/TED/thumbnail/b.jpg [new file with mode: 0755]
test/ElmSharp.Test/res/TED/thumbnail/c.jpg [new file with mode: 0755]
test/ElmSharp.Test/res/TED/thumbnail/d.jpg [new file with mode: 0755]
test/ElmSharp.Test/res/TED/thumbnail/e.jpg [new file with mode: 0755]
test/ElmSharp.Test/res/TED/thumbnail/f.jpg [new file with mode: 0755]
test/ElmSharp.Test/res/TED/thumbnail/g.jpg [new file with mode: 0755]

diff --git a/.editorconfig b/.editorconfig
new file mode 100644 (file)
index 0000000..ed9502e
--- /dev/null
@@ -0,0 +1,8 @@
+root = true
+
+[*]
+end_of_line = lf
+
+[*.{cs,xaml}]
+indent_style = space
+indent_size = 4
diff --git a/.gitattributes b/.gitattributes
new file mode 100644 (file)
index 0000000..3400ba9
--- /dev/null
@@ -0,0 +1,14 @@
+# Set default behaviour, in case users don't have core.autocrlf set.
+* text=auto
+
+# Explicitly declare text files we want to always be normalized and converted 
+# to native line endings on checkout.
+*.cs text
+
+# Declare files that will always have CRLF line endings on checkout.
+*.sln text eol=crlf
+
+# Denote all files that are truly binary and should not be modified.
+*.png binary
+*.jpg binary
+*.jpeg binary
\ No newline at end of file
index 89d5e41..34587e6 100644 (file)
@@ -8,7 +8,7 @@
 
 Name:       elm-sharp
 Summary:    C# Binding for Elementary
-Version:    1.0.8
+Version:    1.0.9
 Release:    1
 Group:      Development/Libraries
 License:    Apache-2.0
index ebea12d..4da7745 100644 (file)
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
-  <PropertyGroup>\r
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
-    <ProjectGuid>{657E0754-FAF0-42B9-B9F5-45868826758E}</ProjectGuid>\r
-    <OutputType>Library</OutputType>\r
-    <AppDesignerFolder>Properties</AppDesignerFolder>\r
-    <RootNamespace>ElmSharp</RootNamespace>\r
-    <AssemblyName>ElmSharp</AssemblyName>\r
-    <FileAlignment>512</FileAlignment>\r
-    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
-  </PropertyGroup>\r
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
-    <DebugSymbols>true</DebugSymbols>\r
-    <DebugType>full</DebugType>\r
-    <Optimize>true</Optimize>\r
-    <OutputPath>bin\Debug\Net45\</OutputPath>\r
-    <DefineConstants>DEBUG;TRACE</DefineConstants>\r
-    <ErrorReport>prompt</ErrorReport>\r
-    <WarningLevel>4</WarningLevel>\r
-    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\r
-  </PropertyGroup>\r
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
-    <DebugType>pdbonly</DebugType>\r
-    <Optimize>true</Optimize>\r
-    <OutputPath>bin\Release\Net45\</OutputPath>\r
-    <DefineConstants>TRACE</DefineConstants>\r
-    <ErrorReport>prompt</ErrorReport>\r
-    <WarningLevel>4</WarningLevel>\r
-    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
-    <SignAssembly>true</SignAssembly>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
-    <AssemblyOriginatorKeyFile>ElmSharp.snk</AssemblyOriginatorKeyFile>\r
-  </PropertyGroup>\r
-  <ItemGroup>\r
-    <Reference Include="System" />\r
-    <Reference Include="System.Core" />\r
-    <Reference Include="System.Xml.Linq" />\r
-    <Reference Include="System.Data.DataSetExtensions" />\r
-    <Reference Include="Microsoft.CSharp" />\r
-    <Reference Include="System.Data" />\r
-    <Reference Include="System.Net.Http" />\r
-    <Reference Include="System.Xml" />\r
-  </ItemGroup>\r
-  <ItemGroup>\r
-    <Compile Include="ElmSharp\Background.cs" />\r
-    <Compile Include="ElmSharp\Box.cs" />\r
-    <Compile Include="ElmSharp\Button.cs" />\r
-    <Compile Include="ElmSharp\Calendar.cs" />\r
-    <Compile Include="ElmSharp\Check.cs" />\r
-    <Compile Include="ElmSharp\CheckStateChangedEventArgs.cs" />\r
-    <Compile Include="ElmSharp\Color.cs" />\r
-    <Compile Include="ElmSharp\ColorChangedEventArgs.cs" />\r
-    <Compile Include="ElmSharp\ColorSelector.cs" />\r
-    <Compile Include="ElmSharp\Conformant.cs" />\r
-    <Compile Include="ElmSharp\Container.cs" />\r
-    <Compile Include="ElmSharp\ContextPopup.cs" />\r
-    <Compile Include="ElmSharp\ContextPopupItem.cs" />\r
-    <Compile Include="ElmSharp\DateChangedEventArgs.cs" />\r
-    <Compile Include="ElmSharp\DateTimeSelector.cs" />\r
-    <Compile Include="ElmSharp\DisplayedMonthChangedEventArgs.cs" />\r
-    <Compile Include="ElmSharp\EcoreAnimator.cs" />\r
-    <Compile Include="ElmSharp\EcoreMainloop.cs" />\r
-    <Compile Include="ElmSharp\EcoreSynchronizationContext.cs" />\r
-    <Compile Include="ElmSharp\EdjeObject.cs" />\r
-    <Compile Include="ElmSharp\Elementary.cs" />\r
-    <Compile Include="ElmSharp\ElmScrollConfig.cs" />\r
-    <Compile Include="ElmSharp\Entry.cs" />\r
-    <Compile Include="ElmSharp\EvasKeyEventArgs.cs" />\r
-    <Compile Include="ElmSharp\EvasMap.cs" />\r
-    <Compile Include="ElmSharp\EvasObject.cs" />\r
-    <Compile Include="ElmSharp\GenGrid.cs" />\r
-    <Compile Include="ElmSharp\GenGridItem.cs" />\r
-    <Compile Include="ElmSharp\GenItem.cs" />\r
-    <Compile Include="ElmSharp\GenItemClass.cs" />\r
-    <Compile Include="ElmSharp\GenList.cs" />\r
-    <Compile Include="ElmSharp\GenListItem.cs" />\r
-    <Compile Include="ElmSharp\GestureLayer.cs" />\r
-    <Compile Include="ElmSharp\Icon.cs" />\r
-    <Compile Include="ElmSharp\Image.cs" />\r
-    <Compile Include="ElmSharp\Index.cs" />\r
-    <Compile Include="ElmSharp\IndexItem.cs" />\r
-    <Compile Include="ElmSharp\ItemObject.cs" />\r
-    <Compile Include="ElmSharp\Label.cs" />\r
-    <Compile Include="ElmSharp\Layout.cs" />\r
-    <Compile Include="ElmSharp\List.cs" />\r
-    <Compile Include="ElmSharp\ListItem.cs" />\r
-    <Compile Include="ElmSharp\Naviframe.cs" />\r
-    <Compile Include="ElmSharp\NaviItem.cs" />\r
-    <Compile Include="ElmSharp\Panel.cs" />\r
-    <Compile Include="ElmSharp\Panes.cs" />\r
-    <Compile Include="ElmSharp\Point.cs" />\r
-    <Compile Include="ElmSharp\Point3D.cs" />\r
-    <Compile Include="ElmSharp\Polygon.cs" />\r
-    <Compile Include="ElmSharp\Popup.cs" />\r
-    <Compile Include="ElmSharp\PopupItem.cs" />\r
-    <Compile Include="ElmSharp\ProgressBar.cs" />\r
-    <Compile Include="ElmSharp\Radio.cs" />\r
-    <Compile Include="ElmSharp\Rect.cs" />\r
-    <Compile Include="ElmSharp\Rectangle.cs" />\r
-    <Compile Include="ElmSharp\Scroller.cs" />\r
-    <Compile Include="ElmSharp\Size.cs" />\r
-    <Compile Include="ElmSharp\Slider.cs" />\r
-    <Compile Include="ElmSharp\Spinner.cs" />\r
-    <Compile Include="ElmSharp\Table.cs" />\r
-    <Compile Include="ElmSharp\Toolbar.cs" />\r
-    <Compile Include="ElmSharp\ToolbarItem.cs" />\r
-    <Compile Include="ElmSharp\Widget.cs" />\r
-    <Compile Include="ElmSharp\Window.cs" />\r
-    <Compile Include="ElmSharp\WrapType.cs" />\r
-    <Compile Include="Interop\Interop.Ecore.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.Bg.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.Box.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.Button.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.CalendarView.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.ColorPicker.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.CtxPopup.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.DateTimePicker.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.Entry.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.GenGridView.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.GenListView.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.GestureLayer.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.Image.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.Index.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.Label.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.List.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.Naviframe.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.Panel.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.Panes.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.Popup.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.ProgressBar.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.ScrollView.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.Slider.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.Spinner.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.Table.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.Toolbar.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.Win.cs" />\r
-    <Compile Include="Interop\Interop.Eo.cs" />\r
-    <Compile Include="Interop\Interop.Evas.cs" />\r
-    <Compile Include="Interop\Interop.Evas.Image.cs" />\r
-    <Compile Include="Interop\Interop.EvasObjectEvent.cs" />\r
-    <Compile Include="Interop\Interop.Libc.cs" />\r
-    <Compile Include="Interop\Interop.Libraries.cs" />\r
-    <Compile Include="Interop\Interop.SmartEvent.cs" />\r
-    <Compile Include="Properties\AssemblyInfo.cs" />\r
-  </ItemGroup>\r
-  <ItemGroup>\r
-    <None Include="ElmSharp.Net45.project.json" />\r
-    <None Include="ElmSharp.nuspec" />\r
-    <None Include="ElmSharp.snk" />\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="BeforeBuild">\r
-  </Target>\r
-  <Target Name="AfterBuild">\r
-  </Target>\r
-  -->\r
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{657E0754-FAF0-42B9-B9F5-45868826758E}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>ElmSharp</RootNamespace>
+    <AssemblyName>ElmSharp</AssemblyName>
+    <FileAlignment>512</FileAlignment>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Debug\Net45\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\Net45\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+  </PropertyGroup>
+  <PropertyGroup>
+    <SignAssembly>true</SignAssembly>
+  </PropertyGroup>
+  <PropertyGroup>
+    <AssemblyOriginatorKeyFile>ElmSharp.snk</AssemblyOriginatorKeyFile>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="ElmSharp\Background.cs" />
+    <Compile Include="ElmSharp\Box.cs" />
+    <Compile Include="ElmSharp\Button.cs" />
+    <Compile Include="ElmSharp\Calendar.cs" />
+    <Compile Include="ElmSharp\Check.cs" />
+    <Compile Include="ElmSharp\CheckStateChangedEventArgs.cs" />
+    <Compile Include="ElmSharp\Color.cs" />
+    <Compile Include="ElmSharp\ColorChangedEventArgs.cs" />
+    <Compile Include="ElmSharp\ColorSelector.cs" />
+    <Compile Include="ElmSharp\Conformant.cs" />
+    <Compile Include="ElmSharp\Container.cs" />
+    <Compile Include="ElmSharp\ContextPopup.cs" />
+    <Compile Include="ElmSharp\ContextPopupItem.cs" />
+    <Compile Include="ElmSharp\DateChangedEventArgs.cs" />
+    <Compile Include="ElmSharp\DateTimeSelector.cs" />
+    <Compile Include="ElmSharp\DisplayedMonthChangedEventArgs.cs" />
+    <Compile Include="ElmSharp\EcoreAnimator.cs" />
+    <Compile Include="ElmSharp\EcoreMainloop.cs" />
+    <Compile Include="ElmSharp\EcoreSynchronizationContext.cs" />
+    <Compile Include="ElmSharp\EdjeObject.cs" />
+    <Compile Include="ElmSharp\Elementary.cs" />
+    <Compile Include="ElmSharp\ElmScrollConfig.cs" />
+    <Compile Include="ElmSharp\Entry.cs" />
+    <Compile Include="ElmSharp\EvasKeyEventArgs.cs" />
+    <Compile Include="ElmSharp\EvasMap.cs" />
+    <Compile Include="ElmSharp\EvasObject.cs" />
+    <Compile Include="ElmSharp\GenGrid.cs" />
+    <Compile Include="ElmSharp\GenGridItem.cs" />
+    <Compile Include="ElmSharp\GenItem.cs" />
+    <Compile Include="ElmSharp\GenItemClass.cs" />
+    <Compile Include="ElmSharp\GenList.cs" />
+    <Compile Include="ElmSharp\GenListItem.cs" />
+    <Compile Include="ElmSharp\GestureLayer.cs" />
+    <Compile Include="ElmSharp\Icon.cs" />
+    <Compile Include="ElmSharp\Image.cs" />
+    <Compile Include="ElmSharp\Index.cs" />
+    <Compile Include="ElmSharp\IndexItem.cs" />
+    <Compile Include="ElmSharp\ItemObject.cs" />
+    <Compile Include="ElmSharp\Label.cs" />
+    <Compile Include="ElmSharp\Layout.cs" />
+    <Compile Include="ElmSharp\List.cs" />
+    <Compile Include="ElmSharp\ListItem.cs" />
+    <Compile Include="ElmSharp\Naviframe.cs" />
+    <Compile Include="ElmSharp\NaviItem.cs" />
+    <Compile Include="ElmSharp\Panel.cs" />
+    <Compile Include="ElmSharp\Panes.cs" />
+    <Compile Include="ElmSharp\Point.cs" />
+    <Compile Include="ElmSharp\Point3D.cs" />
+    <Compile Include="ElmSharp\Polygon.cs" />
+    <Compile Include="ElmSharp\Popup.cs" />
+    <Compile Include="ElmSharp\PopupItem.cs" />
+    <Compile Include="ElmSharp\ProgressBar.cs" />
+    <Compile Include="ElmSharp\Radio.cs" />
+    <Compile Include="ElmSharp\Rect.cs" />
+    <Compile Include="ElmSharp\Rectangle.cs" />
+    <Compile Include="ElmSharp\Scroller.cs" />
+    <Compile Include="ElmSharp\Size.cs" />
+    <Compile Include="ElmSharp\Slider.cs" />
+    <Compile Include="ElmSharp\Spinner.cs" />
+    <Compile Include="ElmSharp\Table.cs" />
+    <Compile Include="ElmSharp\Toolbar.cs" />
+    <Compile Include="ElmSharp\ToolbarItem.cs" />
+    <Compile Include="ElmSharp\Widget.cs" />
+    <Compile Include="ElmSharp\Window.cs" />
+    <Compile Include="ElmSharp\WrapType.cs" />
+    <Compile Include="Interop\Interop.Ecore.cs" />
+    <Compile Include="Interop\Interop.Elementary.Bg.cs" />
+    <Compile Include="Interop\Interop.Elementary.Box.cs" />
+    <Compile Include="Interop\Interop.Elementary.Button.cs" />
+    <Compile Include="Interop\Interop.Elementary.CalendarView.cs" />
+    <Compile Include="Interop\Interop.Elementary.ColorPicker.cs" />
+    <Compile Include="Interop\Interop.Elementary.cs" />
+    <Compile Include="Interop\Interop.Elementary.CtxPopup.cs" />
+    <Compile Include="Interop\Interop.Elementary.DateTimePicker.cs" />
+    <Compile Include="Interop\Interop.Elementary.Entry.cs" />
+    <Compile Include="Interop\Interop.Elementary.GenGridView.cs" />
+    <Compile Include="Interop\Interop.Elementary.GenListView.cs" />
+    <Compile Include="Interop\Interop.Elementary.GestureLayer.cs" />
+    <Compile Include="Interop\Interop.Elementary.Image.cs" />
+    <Compile Include="Interop\Interop.Elementary.Index.cs" />
+    <Compile Include="Interop\Interop.Elementary.Label.cs" />
+    <Compile Include="Interop\Interop.Elementary.List.cs" />
+    <Compile Include="Interop\Interop.Elementary.Naviframe.cs" />
+    <Compile Include="Interop\Interop.Elementary.Panel.cs" />
+    <Compile Include="Interop\Interop.Elementary.Panes.cs" />
+    <Compile Include="Interop\Interop.Elementary.Popup.cs" />
+    <Compile Include="Interop\Interop.Elementary.ProgressBar.cs" />
+    <Compile Include="Interop\Interop.Elementary.ScrollView.cs" />
+    <Compile Include="Interop\Interop.Elementary.Slider.cs" />
+    <Compile Include="Interop\Interop.Elementary.Spinner.cs" />
+    <Compile Include="Interop\Interop.Elementary.Table.cs" />
+    <Compile Include="Interop\Interop.Elementary.Toolbar.cs" />
+    <Compile Include="Interop\Interop.Elementary.Win.cs" />
+    <Compile Include="Interop\Interop.Eo.cs" />
+    <Compile Include="Interop\Interop.Evas.cs" />
+    <Compile Include="Interop\Interop.Evas.Image.cs" />
+    <Compile Include="Interop\Interop.EvasObjectEvent.cs" />
+    <Compile Include="Interop\Interop.Libc.cs" />
+    <Compile Include="Interop\Interop.Libraries.cs" />
+    <Compile Include="Interop\Interop.SmartEvent.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="ElmSharp.Net45.project.json" />
+    <None Include="ElmSharp.nuspec" />
+    <None Include="ElmSharp.snk" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
 </Project>
\ No newline at end of file
index bf21751..848a2e1 100644 (file)
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
-  <PropertyGroup>\r
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
-    <ProjectGuid>{7B15AF72-70CC-11E6-AE37-EB727F0BD84E}</ProjectGuid>\r
-    <OutputType>Library</OutputType>\r
-    <AppDesignerFolder>Properties</AppDesignerFolder>\r
-    <RootNamespace>ElmSharp</RootNamespace>\r
-    <AssemblyName>ElmSharp</AssemblyName>\r
-    <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
-    <TargetFrameworkIdentifier>.NETStandard</TargetFrameworkIdentifier>\r
-    <TargetFrameworkVersion>v1.3</TargetFrameworkVersion>\r
-    <NuGetTargetMoniker>.NETStandard,Version=v1.3</NuGetTargetMoniker>\r
-    <AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>\r
-    <NoStdLib>true</NoStdLib>\r
-    <NoWarn>$(NoWarn);1701;1702</NoWarn>\r
-  </PropertyGroup>\r
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
-    <DebugSymbols>true</DebugSymbols>\r
-    <DebugType>full</DebugType>\r
-    <Optimize>true</Optimize>\r
-    <OutputPath>bin\Debug\</OutputPath>\r
-    <DefineConstants>DEBUG;TRACE</DefineConstants>\r
-    <ErrorReport>prompt</ErrorReport>\r
-    <WarningLevel>4</WarningLevel>\r
-    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\r
-  </PropertyGroup>\r
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
-    <DebugType>pdbonly</DebugType>\r
-    <Optimize>true</Optimize>\r
-    <OutputPath>bin\Release\</OutputPath>\r
-    <DefineConstants>TRACE</DefineConstants>\r
-    <ErrorReport>prompt</ErrorReport>\r
-    <WarningLevel>4</WarningLevel>\r
-    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
-    <SignAssembly>true</SignAssembly>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
-    <AssemblyOriginatorKeyFile>ElmSharp.snk</AssemblyOriginatorKeyFile>\r
-  </PropertyGroup>\r
-  <ItemGroup>\r
-    <Compile Include="ElmSharp\Background.cs" />\r
-    <Compile Include="ElmSharp\Box.cs" />\r
-    <Compile Include="ElmSharp\Button.cs" />\r
-    <Compile Include="ElmSharp\Calendar.cs" />\r
-    <Compile Include="ElmSharp\Check.cs" />\r
-    <Compile Include="ElmSharp\CheckStateChangedEventArgs.cs" />\r
-    <Compile Include="ElmSharp\Color.cs" />\r
-    <Compile Include="ElmSharp\ColorChangedEventArgs.cs" />\r
-    <Compile Include="ElmSharp\ColorSelector.cs" />\r
-    <Compile Include="ElmSharp\Conformant.cs" />\r
-    <Compile Include="ElmSharp\Container.cs" />\r
-    <Compile Include="ElmSharp\ContextPopup.cs" />\r
-    <Compile Include="ElmSharp\ContextPopupItem.cs" />\r
-    <Compile Include="ElmSharp\DateChangedEventArgs.cs" />\r
-    <Compile Include="ElmSharp\DateTimeSelector.cs" />\r
-    <Compile Include="ElmSharp\DisplayedMonthChangedEventArgs.cs" />\r
-    <Compile Include="ElmSharp\EcoreAnimator.cs" />\r
-    <Compile Include="ElmSharp\EcoreMainloop.cs" />\r
-    <Compile Include="ElmSharp\EcoreSynchronizationContext.cs" />\r
-    <Compile Include="ElmSharp\EdjeObject.cs" />\r
-    <Compile Include="ElmSharp\ElmScrollConfig.cs" />\r
-    <Compile Include="ElmSharp\Elementary.cs" />\r
-    <Compile Include="ElmSharp\Entry.cs" />\r
-    <Compile Include="ElmSharp\EvasKeyEventArgs.cs" />\r
-    <Compile Include="ElmSharp\EvasMap.cs" />\r
-    <Compile Include="ElmSharp\EvasObject.cs" />\r
-    <Compile Include="ElmSharp\GenGrid.cs" />\r
-    <Compile Include="ElmSharp\GenGridItem.cs" />\r
-    <Compile Include="ElmSharp\GenItem.cs" />\r
-    <Compile Include="ElmSharp\GenItemClass.cs" />\r
-    <Compile Include="ElmSharp\GenList.cs" />\r
-    <Compile Include="ElmSharp\GenListItem.cs" />\r
-    <Compile Include="ElmSharp\GestureLayer.cs" />\r
-    <Compile Include="ElmSharp\Icon.cs" />\r
-    <Compile Include="ElmSharp\Image.cs" />\r
-    <Compile Include="ElmSharp\Index.cs" />\r
-    <Compile Include="ElmSharp\IndexItem.cs" />\r
-    <Compile Include="ElmSharp\ItemObject.cs" />\r
-    <Compile Include="ElmSharp\Label.cs" />\r
-    <Compile Include="ElmSharp\Layout.cs" />\r
-    <Compile Include="ElmSharp\List.cs" />\r
-    <Compile Include="ElmSharp\ListItem.cs" />\r
-    <Compile Include="ElmSharp\Naviframe.cs" />\r
-    <Compile Include="ElmSharp\NaviItem.cs" />\r
-    <Compile Include="ElmSharp\Panel.cs" />\r
-    <Compile Include="ElmSharp\Panes.cs" />\r
-    <Compile Include="ElmSharp\Point.cs" />\r
-    <Compile Include="ElmSharp\Point3D.cs" />\r
-    <Compile Include="ElmSharp\Polygon.cs" />\r
-    <Compile Include="ElmSharp\Popup.cs" />\r
-    <Compile Include="ElmSharp\PopupItem.cs" />\r
-    <Compile Include="ElmSharp\ProgressBar.cs" />\r
-    <Compile Include="ElmSharp\Radio.cs" />\r
-    <Compile Include="ElmSharp\Rect.cs" />\r
-    <Compile Include="ElmSharp\Rectangle.cs" />\r
-    <Compile Include="ElmSharp\Scroller.cs" />\r
-    <Compile Include="ElmSharp\Size.cs" />\r
-    <Compile Include="ElmSharp\Slider.cs" />\r
-    <Compile Include="ElmSharp\Spinner.cs" />\r
-    <Compile Include="ElmSharp\Table.cs" />\r
-    <Compile Include="ElmSharp\Toolbar.cs" />\r
-    <Compile Include="ElmSharp\ToolbarItem.cs" />\r
-    <Compile Include="ElmSharp\Widget.cs" />\r
-    <Compile Include="ElmSharp\Window.cs" />\r
-    <Compile Include="ElmSharp\WrapType.cs" />\r
-    <Compile Include="Interop\Interop.Eo.cs" />\r
-    <Compile Include="Interop\Interop.Ecore.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.Bg.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.Box.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.Button.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.CalendarView.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.ColorPicker.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.CtxPopup.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.DateTimePicker.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.Entry.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.GenGridView.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.GenListView.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.GestureLayer.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.Image.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.Index.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.Label.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.List.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.Naviframe.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.Panel.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.Panes.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.Popup.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.ProgressBar.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.ScrollView.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.Slider.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.Spinner.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.Table.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.Toolbar.cs" />\r
-    <Compile Include="Interop\Interop.Elementary.Win.cs" />\r
-    <Compile Include="Interop\Interop.Evas.cs" />\r
-    <Compile Include="Interop\Interop.Evas.Image.cs" />\r
-    <Compile Include="Interop\Interop.EvasObjectEvent.cs" />\r
-    <Compile Include="Interop\Interop.Libc.cs" />\r
-    <Compile Include="Interop\Interop.Libraries.cs" />\r
-    <Compile Include="Interop\Interop.SmartEvent.cs" />\r
-    <Compile Include="Properties\AssemblyInfo.cs" />\r
-  </ItemGroup>\r
-  <ItemGroup>\r
-    <None Include="ElmSharp.nuspec" />\r
-    <None Include="ElmSharp.project.json" />\r
-    <None Include="ElmSharp.snk" />\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="BeforeBuild">\r
-  </Target>\r
-  <Target Name="AfterBuild">\r
-  </Target>\r
-  -->\r
-  <PropertyGroup>\r
-    <!-- https://github.com/dotnet/corefxlab/tree/master/samples/NetCoreSample and\r
-       https://docs.microsoft.com/en-us/dotnet/articles/core/tutorials/target-dotnetcore-with-msbuild\r
-    -->\r
-    <!-- We don't use any of MSBuild's resolution logic for resolving the framework, so just set these two\r
-       properties to any folder that exists to skip the GetReferenceAssemblyPaths task (not target) and\r
-       to prevent it from outputting a warning (MSB3644).\r
-    -->\r
-    <_TargetFrameworkDirectories>$(MSBuildThisFileDirectory)</_TargetFrameworkDirectories>\r
-    <_FullFrameworkReferenceAssemblyPaths>$(MSBuildThisFileDirectory)</_FullFrameworkReferenceAssemblyPaths>\r
-    <AutoUnifyAssemblyReferences>true</AutoUnifyAssemblyReferences>\r
-  </PropertyGroup>\r
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{7B15AF72-70CC-11E6-AE37-EB727F0BD84E}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>ElmSharp</RootNamespace>
+    <AssemblyName>ElmSharp</AssemblyName>
+    <FileAlignment>512</FileAlignment>
+  </PropertyGroup>
+  <PropertyGroup>
+    <TargetFrameworkIdentifier>.NETStandard</TargetFrameworkIdentifier>
+    <TargetFrameworkVersion>v1.3</TargetFrameworkVersion>
+    <NuGetTargetMoniker>.NETStandard,Version=v1.3</NuGetTargetMoniker>
+    <AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>
+    <NoStdLib>true</NoStdLib>
+    <NoWarn>$(NoWarn);1701;1702</NoWarn>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+  </PropertyGroup>
+  <PropertyGroup>
+    <SignAssembly>true</SignAssembly>
+  </PropertyGroup>
+  <PropertyGroup>
+    <AssemblyOriginatorKeyFile>ElmSharp.snk</AssemblyOriginatorKeyFile>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="ElmSharp\Background.cs" />
+    <Compile Include="ElmSharp\Box.cs" />
+    <Compile Include="ElmSharp\Button.cs" />
+    <Compile Include="ElmSharp\Calendar.cs" />
+    <Compile Include="ElmSharp\Check.cs" />
+    <Compile Include="ElmSharp\CheckStateChangedEventArgs.cs" />
+    <Compile Include="ElmSharp\Color.cs" />
+    <Compile Include="ElmSharp\ColorChangedEventArgs.cs" />
+    <Compile Include="ElmSharp\ColorSelector.cs" />
+    <Compile Include="ElmSharp\Conformant.cs" />
+    <Compile Include="ElmSharp\Container.cs" />
+    <Compile Include="ElmSharp\ContextPopup.cs" />
+    <Compile Include="ElmSharp\ContextPopupItem.cs" />
+    <Compile Include="ElmSharp\DateChangedEventArgs.cs" />
+    <Compile Include="ElmSharp\DateTimeSelector.cs" />
+    <Compile Include="ElmSharp\DisplayedMonthChangedEventArgs.cs" />
+    <Compile Include="ElmSharp\EcoreAnimator.cs" />
+    <Compile Include="ElmSharp\EcoreMainloop.cs" />
+    <Compile Include="ElmSharp\EcoreSynchronizationContext.cs" />
+    <Compile Include="ElmSharp\EdjeObject.cs" />
+    <Compile Include="ElmSharp\ElmScrollConfig.cs" />
+    <Compile Include="ElmSharp\Elementary.cs" />
+    <Compile Include="ElmSharp\Entry.cs" />
+    <Compile Include="ElmSharp\EvasKeyEventArgs.cs" />
+    <Compile Include="ElmSharp\EvasMap.cs" />
+    <Compile Include="ElmSharp\EvasObject.cs" />
+    <Compile Include="ElmSharp\GenGrid.cs" />
+    <Compile Include="ElmSharp\GenGridItem.cs" />
+    <Compile Include="ElmSharp\GenItem.cs" />
+    <Compile Include="ElmSharp\GenItemClass.cs" />
+    <Compile Include="ElmSharp\GenList.cs" />
+    <Compile Include="ElmSharp\GenListItem.cs" />
+    <Compile Include="ElmSharp\GestureLayer.cs" />
+    <Compile Include="ElmSharp\Icon.cs" />
+    <Compile Include="ElmSharp\Image.cs" />
+    <Compile Include="ElmSharp\Index.cs" />
+    <Compile Include="ElmSharp\IndexItem.cs" />
+    <Compile Include="ElmSharp\ItemObject.cs" />
+    <Compile Include="ElmSharp\Label.cs" />
+    <Compile Include="ElmSharp\Layout.cs" />
+    <Compile Include="ElmSharp\List.cs" />
+    <Compile Include="ElmSharp\ListItem.cs" />
+    <Compile Include="ElmSharp\Naviframe.cs" />
+    <Compile Include="ElmSharp\NaviItem.cs" />
+    <Compile Include="ElmSharp\Panel.cs" />
+    <Compile Include="ElmSharp\Panes.cs" />
+    <Compile Include="ElmSharp\Point.cs" />
+    <Compile Include="ElmSharp\Point3D.cs" />
+    <Compile Include="ElmSharp\Polygon.cs" />
+    <Compile Include="ElmSharp\Popup.cs" />
+    <Compile Include="ElmSharp\PopupItem.cs" />
+    <Compile Include="ElmSharp\ProgressBar.cs" />
+    <Compile Include="ElmSharp\Radio.cs" />
+    <Compile Include="ElmSharp\Rect.cs" />
+    <Compile Include="ElmSharp\Rectangle.cs" />
+    <Compile Include="ElmSharp\Scroller.cs" />
+    <Compile Include="ElmSharp\Size.cs" />
+    <Compile Include="ElmSharp\Slider.cs" />
+    <Compile Include="ElmSharp\Spinner.cs" />
+    <Compile Include="ElmSharp\Table.cs" />
+    <Compile Include="ElmSharp\Toolbar.cs" />
+    <Compile Include="ElmSharp\ToolbarItem.cs" />
+    <Compile Include="ElmSharp\Widget.cs" />
+    <Compile Include="ElmSharp\Window.cs" />
+    <Compile Include="ElmSharp\WrapType.cs" />
+    <Compile Include="Interop\Interop.Eo.cs" />
+    <Compile Include="Interop\Interop.Ecore.cs" />
+    <Compile Include="Interop\Interop.Elementary.Bg.cs" />
+    <Compile Include="Interop\Interop.Elementary.Box.cs" />
+    <Compile Include="Interop\Interop.Elementary.Button.cs" />
+    <Compile Include="Interop\Interop.Elementary.CalendarView.cs" />
+    <Compile Include="Interop\Interop.Elementary.ColorPicker.cs" />
+    <Compile Include="Interop\Interop.Elementary.cs" />
+    <Compile Include="Interop\Interop.Elementary.CtxPopup.cs" />
+    <Compile Include="Interop\Interop.Elementary.DateTimePicker.cs" />
+    <Compile Include="Interop\Interop.Elementary.Entry.cs" />
+    <Compile Include="Interop\Interop.Elementary.GenGridView.cs" />
+    <Compile Include="Interop\Interop.Elementary.GenListView.cs" />
+    <Compile Include="Interop\Interop.Elementary.GestureLayer.cs" />
+    <Compile Include="Interop\Interop.Elementary.Image.cs" />
+    <Compile Include="Interop\Interop.Elementary.Index.cs" />
+    <Compile Include="Interop\Interop.Elementary.Label.cs" />
+    <Compile Include="Interop\Interop.Elementary.List.cs" />
+    <Compile Include="Interop\Interop.Elementary.Naviframe.cs" />
+    <Compile Include="Interop\Interop.Elementary.Panel.cs" />
+    <Compile Include="Interop\Interop.Elementary.Panes.cs" />
+    <Compile Include="Interop\Interop.Elementary.Popup.cs" />
+    <Compile Include="Interop\Interop.Elementary.ProgressBar.cs" />
+    <Compile Include="Interop\Interop.Elementary.ScrollView.cs" />
+    <Compile Include="Interop\Interop.Elementary.Slider.cs" />
+    <Compile Include="Interop\Interop.Elementary.Spinner.cs" />
+    <Compile Include="Interop\Interop.Elementary.Table.cs" />
+    <Compile Include="Interop\Interop.Elementary.Toolbar.cs" />
+    <Compile Include="Interop\Interop.Elementary.Win.cs" />
+    <Compile Include="Interop\Interop.Evas.cs" />
+    <Compile Include="Interop\Interop.Evas.Image.cs" />
+    <Compile Include="Interop\Interop.EvasObjectEvent.cs" />
+    <Compile Include="Interop\Interop.Libc.cs" />
+    <Compile Include="Interop\Interop.Libraries.cs" />
+    <Compile Include="Interop\Interop.SmartEvent.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="ElmSharp.nuspec" />
+    <None Include="ElmSharp.project.json" />
+    <None Include="ElmSharp.snk" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+  <PropertyGroup>
+    <!-- https://github.com/dotnet/corefxlab/tree/master/samples/NetCoreSample and
+       https://docs.microsoft.com/en-us/dotnet/articles/core/tutorials/target-dotnetcore-with-msbuild
+    -->
+    <!-- We don't use any of MSBuild's resolution logic for resolving the framework, so just set these two
+       properties to any folder that exists to skip the GetReferenceAssemblyPaths task (not target) and
+       to prevent it from outputting a warning (MSB3644).
+    -->
+    <_TargetFrameworkDirectories>$(MSBuildThisFileDirectory)</_TargetFrameworkDirectories>
+    <_FullFrameworkReferenceAssemblyPaths>$(MSBuildThisFileDirectory)</_FullFrameworkReferenceAssemblyPaths>
+    <AutoUnifyAssemblyReferences>true</AutoUnifyAssemblyReferences>
+  </PropertyGroup>
 </Project>
\ No newline at end of file
index d90cd49..20b13e9 100644 (file)
@@ -14,10 +14,7 @@ namespace ElmSharp
         public Image(EvasObject parent) : base(parent)
         {
             _clicked = new Interop.SmartEvent(this, Handle, "clicked");
-            _clicked.On += (s, e) =>
-            {
-                Clicked?.Invoke(this, EventArgs.Empty);
-            };
+            _clicked.On += (s, e) => Clicked?.Invoke(this, EventArgs.Empty);
         }
 
         public event EventHandler Clicked;
@@ -193,7 +190,6 @@ namespace ElmSharp
             }
         }
 
-
         public ImageOrientation Orientation
         {
             get
@@ -206,44 +202,65 @@ namespace ElmSharp
             }
         }
 
-        public void Load(string file)
+        public bool Load(string file)
         {
+            if (file == null)
+                throw new ArgumentNullException("file");
+
+            Interop.Elementary.elm_image_async_open_set(Handle, false);
             Interop.Elementary.elm_image_preload_disabled_set(Handle, true);
-            bool ret = Interop.Elementary.elm_image_file_set(Handle, file, null);
-            if (!ret)
-            {
-                throw new InvalidOperationException("Failed to set file to Image");
-            }
+            return Interop.Elementary.elm_image_file_set(Handle, file, null);
+        }
 
-            LoadingCompleted?.Invoke(this, EventArgs.Empty);
+        public bool Load(Uri uri)
+        {
+            if (uri == null)
+                throw new ArgumentNullException("uri");
+
+            return Load(uri.IsFile ? uri.LocalPath : uri.AbsoluteUri);
         }
-       
+
         [CLSCompliant(false)]
-        public unsafe void Load(byte* img, long size)
+        [Obsolete("This method will be removed. Use Load(Stream stream) instead.")]
+        public unsafe bool Load(byte* img, long size)
         {
-            bool ret = Interop.Elementary.elm_image_memfile_set(Handle, img, size, IntPtr.Zero, IntPtr.Zero);
-            if (!ret)
-            {
-                throw new InvalidOperationException("Failed to set memory buffer to Image");
-            }
+            if (img == null)
+                throw new ArgumentNullException("img");
 
-            LoadingCompleted?.Invoke(this, EventArgs.Empty);
+            Interop.Elementary.elm_image_async_open_set(Handle, false);
+            Interop.Elementary.elm_image_preload_disabled_set(Handle, true);
+            return Interop.Elementary.elm_image_memfile_set(Handle, img, size, IntPtr.Zero, IntPtr.Zero);
         }
 
-        public void LoadAsync(Uri uri)
+        public bool Load(Stream stream)
         {
-            if (uri.IsFile)
-                LoadFromFileAsync(uri.LocalPath);
-            else
-                LoadFromUriAsync(uri.AbsoluteUri);
+            if (stream == null)
+                throw new ArgumentNullException("stream");
+
+            Interop.Elementary.elm_image_async_open_set(Handle, false);
+            Interop.Elementary.elm_image_preload_disabled_set(Handle, true);
+            MemoryStream memstream = new MemoryStream();
+            stream.CopyTo(memstream);
+            unsafe
+            {
+                byte[] dataArr = memstream.ToArray();
+                fixed (byte* data = &dataArr[0])
+                {
+                    return Interop.Elementary.elm_image_memfile_set(Handle, data, dataArr.Length, IntPtr.Zero, IntPtr.Zero);
+                }
+            }
         }
 
-        public async Task<bool> LoadAsync(Stream stream, CancellationToken cancellationToken)
+        public Task<bool> LoadAsync(string file, CancellationToken cancellationToken = default(CancellationToken))
         {
-            var tcs = new TaskCompletionSource<bool>();
+            if (file == null)
+                throw new ArgumentNullException("file");
 
+            Interop.Elementary.elm_image_async_open_set(Handle, true);
             Interop.Elementary.elm_image_preload_disabled_set(Handle, false);
 
+            var tcs = new TaskCompletionSource<bool>();
+
             cancellationToken.Register(() =>
             {
                 if (tcs != null && !tcs.Task.IsCompleted)
@@ -252,82 +269,107 @@ namespace ElmSharp
                 }
             });
 
-            MemoryStream memstream = new MemoryStream();
-            await stream.CopyToAsync(memstream);
-
-            unsafe
+            Interop.SmartEvent loadReady = new Interop.SmartEvent(this, Handle, "load,ready");
+            loadReady.On += (s, e) =>
             {
-                byte[] dataArr = memstream.ToArray();
-                fixed (byte* data = &dataArr[0])
+                loadReady.Dispose();
+                LoadingCompleted?.Invoke(this, EventArgs.Empty);
+                if (tcs != null && !tcs.Task.IsCompleted)
                 {
-                    bool ret = Interop.Elementary.elm_image_memfile_set(Handle, data, dataArr.Length, IntPtr.Zero, IntPtr.Zero);
-                    if (!ret)
-                    {
-                        return false;
-                    }
+                    tcs.SetResult(true);
                 }
-            }
+            };
 
-            var evasObj = Interop.Elementary.elm_image_object_get(Handle);
-            Interop.EvasObjectEvent preloadedCallback = new Interop.EvasObjectEvent(this, evasObj, Interop.Evas.ObjectCallbackType.ImagePreloaded);
-            preloadedCallback.On += (s, e) =>
+            Interop.SmartEvent loadError = new Interop.SmartEvent(this, Handle, "load,error");
+            loadError.On += (s, e) =>
             {
-                preloadedCallback.Dispose();
+                loadError.Dispose();
+                LoadingFailed?.Invoke(this, EventArgs.Empty);
                 if (tcs != null && !tcs.Task.IsCompleted)
                 {
-                    tcs.SetResult(true);
+                    tcs.SetResult(false);
                 }
             };
 
-            return await tcs.Task;
-        }
+            bool ret = Interop.Elementary.elm_image_file_set(Handle, file, null);
+            if (!ret)
+            {
+                throw new InvalidOperationException("Failed to set file to Image");
+            }
 
+            return tcs.Task;
+        }
 
-        protected override IntPtr CreateHandle(EvasObject parent)
+        public Task<bool> LoadAsync(Uri uri, CancellationToken cancellationToken = default(CancellationToken))
         {
-            return Interop.Elementary.elm_image_add(parent.Handle);
+            if (uri == null)
+                throw new ArgumentNullException("uri");
+
+            return LoadAsync(uri.IsFile ? uri.LocalPath : uri.AbsoluteUri, cancellationToken);
         }
 
-        void LoadFromFileAsync(string file)
+        public async Task<bool> LoadAsync(Stream stream, CancellationToken cancellationToken = default(CancellationToken))
         {
+            if (stream == null)
+                throw new ArgumentNullException("stream");
+
+            Interop.Elementary.elm_image_async_open_set(Handle, true);
             Interop.Elementary.elm_image_preload_disabled_set(Handle, false);
-            bool ret = Interop.Elementary.elm_image_file_set(Handle, file, null);
-            if (!ret)
-            {
-                throw new InvalidOperationException("Failed to set file to Image");
-            }
 
-            // FIXME: Due to the bug of EFL, the preload callback should be set after elm_image_file_set().
-            var evasObj = Interop.Elementary.elm_image_object_get(Handle);
-            var preloadedCallback = new Interop.EvasObjectEvent(this, evasObj, Interop.Evas.ObjectCallbackType.ImagePreloaded);
-            preloadedCallback.On += (s, e) =>
+            var tcs = new TaskCompletionSource<bool>();
+
+            cancellationToken.Register(() =>
             {
-                preloadedCallback.Dispose();
-                LoadingCompleted?.Invoke(this, EventArgs.Empty);
-            };
-        }
+                if (tcs != null && !tcs.Task.IsCompleted)
+                {
+                    tcs.SetCanceled();
+                }
+            });
 
-        void LoadFromUriAsync(string path)
-        {
-            Interop.Elementary.elm_image_preload_disabled_set(Handle, true);
-            Interop.SmartEvent downloadDone = new Interop.SmartEvent(this, Handle, "download,done");
-            downloadDone.On += (s, e) =>
+            Interop.SmartEvent loadReady = new Interop.SmartEvent(this, Handle, "load,ready");
+            loadReady.On += (s, e) =>
             {
-                downloadDone.Dispose();
+                loadReady.Dispose();
                 LoadingCompleted?.Invoke(this, EventArgs.Empty);
+                if (tcs != null && !tcs.Task.IsCompleted)
+                {
+                    tcs.SetResult(true);
+                }
             };
-            Interop.SmartEvent downloadError = new Interop.SmartEvent(this, Handle, "download,error");
-            downloadError.On += (s, e) =>
+
+            Interop.SmartEvent loadError = new Interop.SmartEvent(this, Handle, "load,error");
+            loadError.On += (s, e) =>
             {
-                downloadError.Dispose();
+                loadError.Dispose();
                 LoadingFailed?.Invoke(this, EventArgs.Empty);
+                if (tcs != null && !tcs.Task.IsCompleted)
+                {
+                    tcs.SetResult(false);
+                }
             };
 
-            bool ret = Interop.Elementary.elm_image_file_set(Handle, path, null);
-            if (!ret)
+            MemoryStream memstream = new MemoryStream();
+            await stream.CopyToAsync(memstream);
+
+            unsafe
             {
-                throw new InvalidOperationException("Failed to set file to Image");
+                byte[] dataArr = memstream.ToArray();
+                fixed (byte* data = &dataArr[0])
+                {
+                    bool ret = Interop.Elementary.elm_image_memfile_set(Handle, data, dataArr.Length, IntPtr.Zero, IntPtr.Zero);
+                    if (!ret)
+                    {
+                        return false;
+                    }
+                }
             }
+
+            return await tcs.Task;
+        }
+
+        protected override IntPtr CreateHandle(EvasObject parent)
+        {
+            return Interop.Elementary.elm_image_add(parent.Handle);
         }
     }
 
index 65c8beb..39073ab 100644 (file)
@@ -17,6 +17,9 @@ internal static partial class Interop
         internal static extern IntPtr elm_image_add(IntPtr obj);
 
         [DllImport(Libraries.Elementary)]
+        internal static extern void elm_image_async_open_set(IntPtr obj, bool async);
+
+        [DllImport(Libraries.Elementary)]
         internal static extern IntPtr elm_image_object_get(IntPtr obj);
 
         [DllImport(Libraries.Elementary)]
@@ -28,7 +31,7 @@ internal static partial class Interop
         [DllImport(Libraries.Elementary)]
         internal static extern bool elm_image_file_set(IntPtr obj, string file, string group);
 
-        [DllImport(Libraries.Elementary)]
+        [DllImport(Libraries.Elementary, EntryPoint = "elm_image_file_get")]
         internal static extern void _elm_image_file_get(IntPtr obj, out IntPtr file, out IntPtr group);
         internal static string elm_image_file_get(IntPtr obj)
         {
index 02c92a5..9ed4011 100644 (file)
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
-  <PropertyGroup>\r
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
-    <ProjectTypeGuids>{2F98DAC9-6F16-457B-AED7-D43CAC379341};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\r
-    <ProjectGuid>{E901BB06-632D-489E-86AC-66AD2EF85BCC}</ProjectGuid>\r
-    <OutputType>Exe</OutputType>\r
-    <AppDesignerFolder>Properties</AppDesignerFolder>\r
-    <RootNamespace>ElmSharp.Test</RootNamespace>\r
-    <AssemblyName>ElmSharp.Test</AssemblyName>\r
-    <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
-    <TargetFrameworkIdentifier>.NETCoreApp</TargetFrameworkIdentifier>\r
-    <TargetFrameworkVersion>v1.0</TargetFrameworkVersion>\r
-    <NuGetTargetMoniker>.NETCoreApp,Version=v1.0</NuGetTargetMoniker>\r
-    <AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>\r
-    <NoStdLib>true</NoStdLib>\r
-    <NoWarn>$(NoWarn);1701;1702</NoWarn>\r
-  </PropertyGroup>\r
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
-    <DebugSymbols>true</DebugSymbols>\r
-    <DebugType>full</DebugType>\r
-    <Optimize>true</Optimize>\r
-    <OutputPath>bin\Debug\</OutputPath>\r
-    <DefineConstants>DEBUG;TRACE</DefineConstants>\r
-    <ErrorReport>prompt</ErrorReport>\r
-    <WarningLevel>4</WarningLevel>\r
-    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\r
-  </PropertyGroup>\r
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
-    <DebugType>pdbonly</DebugType>\r
-    <Optimize>true</Optimize>\r
-    <OutputPath>bin\Release\</OutputPath>\r
-    <DefineConstants>TRACE</DefineConstants>\r
-    <ErrorReport>prompt</ErrorReport>\r
-    <WarningLevel>4</WarningLevel>\r
-    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\r
-  </PropertyGroup>\r
-  <ItemGroup>\r
-    <Compile Include="Properties\AssemblyInfo.cs" />\r
-    <Compile Include="TC\BackgroundTest1.cs" />\r
-    <Compile Include="TC\BackgroundTest2.cs" />\r
-    <Compile Include="TC\BackgroundTest3.cs" />\r
-    <Compile Include="TC\BoxLayoutTest1.cs" />\r
-    <Compile Include="TC\BoxTest1.cs" />\r
-    <Compile Include="TC\ButtonTest1.cs" />\r
-    <Compile Include="TC\CalendarTest1.cs" />\r
-    <Compile Include="TC\CheckTest1.cs" />\r
-    <Compile Include="TC\ColorSelectorTest1.cs" />\r
-    <Compile Include="TC\ContextPopupTest1.cs" />\r
-    <Compile Include="TC\DateTimeSelectorTest1.cs" />\r
-    <Compile Include="TC\EntryTest1.cs" />\r
-    <Compile Include="TC\GenGridTest1.cs" />\r
-    <Compile Include="TC\GenGridTest2.cs" />\r
-    <Compile Include="TC\GenListTest1.cs" />\r
-    <Compile Include="TC\GenListTest2.cs" />\r
-    <Compile Include="TC\GenListTest3.cs" />\r
-    <Compile Include="TC\GenListTest4.cs" />\r
-    <Compile Include="TC\GenListTest6.cs" />\r
-    <Compile Include="TC\PerformanceTest.cs" />\r
-    <Compile Include="TC\GenListTest5.cs" />\r
-    <Compile Include="TC\IconTest1.cs" />\r
-    <Compile Include="TC\ImageTest1.cs" />\r
-    <Compile Include="TC\IndexTest1.cs" />\r
-    <Compile Include="TC\IndexTest2.cs" />\r
-    <Compile Include="TC\LabelTest1.cs" />\r
-    <Compile Include="TC\ListTest1.cs" />\r
-    <Compile Include="TC\NaviframeTest1.cs" />\r
-    <Compile Include="TC\NaviframeTest2.cs" />\r
-    <Compile Include="TC\PanelTest1.cs" />\r
-    <Compile Include="TC\PanelTest2.cs" />\r
-    <Compile Include="TC\PanesTest1.cs" />\r
-    <Compile Include="TC\PolygonTest1.cs" />\r
-    <Compile Include="TC\PopupTest1.cs" />\r
-    <Compile Include="TC\ProgressBarTest1.cs" />\r
-    <Compile Include="TC\RadioTest1.cs" />\r
-    <Compile Include="TC\RectangleTest1.cs" />\r
-    <Compile Include="TC\ScrollerTest1.cs" />\r
-    <Compile Include="TC\ScrollerTest2.cs" />\r
-    <Compile Include="TC\SliderTest1.cs" />\r
-    <Compile Include="TC\SpinnerTest1.cs" />\r
-    <Compile Include="TC\ToolbarTest1.cs" />\r
-    <Compile Include="TestCaseBase.cs" />\r
-    <Compile Include="TestRunner.cs" />\r
-  </ItemGroup>\r
-  <ItemGroup>\r
-    <None Include="ElmSharp.Test.project.json" />\r
-    <None Include="test.sh" />\r
-  </ItemGroup>\r
-  <ItemGroup>\r
-    <ProjectReference Include="..\ElmSharp\ElmSharp.csproj">\r
-      <Project>{7b15af72-70cc-11e6-ae37-eb727f0bd84e}</Project>\r
-      <Name>ElmSharp</Name>\r
-    </ProjectReference>\r
-  </ItemGroup>\r
-  <ItemGroup>\r
-    <Content Include="res\picture.png">\r
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\r
-    </Content>\r
-    <Content Include="shared\res\ElmSharp.Test.png" />\r
-    <Content Include="tizen-manifest.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="BeforeBuild">\r
-  </Target>\r
-  <Target Name="AfterBuild">\r
-  </Target>\r
-  -->\r
-  <PropertyGroup>\r
-    <!-- https://github.com/dotnet/corefxlab/tree/master/samples/NetCoreSample and\r
-       https://docs.microsoft.com/en-us/dotnet/articles/core/tutorials/target-dotnetcore-with-msbuild\r
-    -->\r
-    <!-- We don't use any of MSBuild's resolution logic for resolving the framework, so just set these two\r
-       properties to any folder that exists to skip the GetReferenceAssemblyPaths task (not target) and\r
-       to prevent it from outputting a warning (MSB3644).\r
-    -->\r
-    <_TargetFrameworkDirectories>$(MSBuildThisFileDirectory)</_TargetFrameworkDirectories>\r
-    <_FullFrameworkReferenceAssemblyPaths>$(MSBuildThisFileDirectory)</_FullFrameworkReferenceAssemblyPaths>\r
-    <AutoUnifyAssemblyReferences>true</AutoUnifyAssemblyReferences>\r
-  </PropertyGroup>\r
-  <ProjectExtensions>\r
-    <VisualStudio>\r
-      <FlavorProperties GUID="{2F98DAC9-6F16-457B-AED7-D43CAC379341}" Configuration="Debug|Any CPU">\r
-        <ProjectCorporateFlavorCfg />\r
-      </FlavorProperties>\r
-      <FlavorProperties GUID="{2F98DAC9-6F16-457B-AED7-D43CAC379341}" Configuration="Release|Any CPU">\r
-        <ProjectCorporateFlavorCfg />\r
-      </FlavorProperties>\r
-    </VisualStudio>\r
-  </ProjectExtensions>\r
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectTypeGuids>{2F98DAC9-6F16-457B-AED7-D43CAC379341};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ProjectGuid>{E901BB06-632D-489E-86AC-66AD2EF85BCC}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>ElmSharp.Test</RootNamespace>
+    <AssemblyName>ElmSharp.Test</AssemblyName>
+    <FileAlignment>512</FileAlignment>
+  </PropertyGroup>
+  <PropertyGroup>
+    <TargetFrameworkIdentifier>.NETCoreApp</TargetFrameworkIdentifier>
+    <TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
+    <NuGetTargetMoniker>.NETCoreApp,Version=v1.0</NuGetTargetMoniker>
+    <AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>
+    <NoStdLib>true</NoStdLib>
+    <NoWarn>$(NoWarn);1701;1702</NoWarn>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="TC\BackgroundTest1.cs" />
+    <Compile Include="TC\BackgroundTest2.cs" />
+    <Compile Include="TC\BackgroundTest3.cs" />
+    <Compile Include="TC\BoxLayoutTest1.cs" />
+    <Compile Include="TC\BoxTest1.cs" />
+    <Compile Include="TC\ButtonTest1.cs" />
+    <Compile Include="TC\CalendarTest1.cs" />
+    <Compile Include="TC\CheckTest1.cs" />
+    <Compile Include="TC\ColorSelectorTest1.cs" />
+    <Compile Include="TC\ContextPopupTest1.cs" />
+    <Compile Include="TC\DateTimeSelectorTest1.cs" />
+    <Compile Include="TC\EntryTest1.cs" />
+    <Compile Include="TC\GenGridTest1.cs" />
+    <Compile Include="TC\GenGridTest2.cs" />
+    <Compile Include="TC\GenListTest1.cs" />
+    <Compile Include="TC\GenListTest2.cs" />
+    <Compile Include="TC\GenListTest3.cs" />
+    <Compile Include="TC\GenListTest4.cs" />
+    <Compile Include="TC\GenListTest6.cs" />
+    <Compile Include="TC\PerformanceTest.cs" />
+    <Compile Include="TC\GenListTest5.cs" />
+    <Compile Include="TC\IconTest1.cs" />
+    <Compile Include="TC\ImageTest1.cs" />
+    <Compile Include="TC\IndexTest1.cs" />
+    <Compile Include="TC\IndexTest2.cs" />
+    <Compile Include="TC\LabelTest1.cs" />
+    <Compile Include="TC\ListTest1.cs" />
+    <Compile Include="TC\NaviframeTest1.cs" />
+    <Compile Include="TC\NaviframeTest2.cs" />
+    <Compile Include="TC\PanelTest1.cs" />
+    <Compile Include="TC\PanelTest2.cs" />
+    <Compile Include="TC\PanesTest1.cs" />
+    <Compile Include="TC\PolygonTest1.cs" />
+    <Compile Include="TC\PopupTest1.cs" />
+    <Compile Include="TC\ProgressBarTest1.cs" />
+    <Compile Include="TC\RadioTest1.cs" />
+    <Compile Include="TC\RectangleTest1.cs" />
+    <Compile Include="TC\ScrollerTest1.cs" />
+    <Compile Include="TC\ScrollerTest2.cs" />
+    <Compile Include="TC\SliderTest1.cs" />
+    <Compile Include="TC\SpinnerTest1.cs" />
+    <Compile Include="TC\ToolbarTest1.cs" />
+    <Compile Include="TestCaseBase.cs" />
+    <Compile Include="TestRunner.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="ElmSharp.Test.project.json" />
+    <None Include="test.sh" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\ElmSharp\ElmSharp.csproj">
+      <Project>{7b15af72-70cc-11e6-ae37-eb727f0bd84e}</Project>
+      <Name>ElmSharp</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="res\picture.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="res\TED\app_icn_ted.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="res\TED\large\a.jpg">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="res\TED\large\b.jpg">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="res\TED\large\c.jpg">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="res\TED\large\d.jpg">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="res\TED\large\e.jpg">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="res\TED\large\f.jpg">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="res\TED\large\g.jpg">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="res\TED\thumbnail\a.jpg">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="res\TED\thumbnail\b.jpg">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="res\TED\thumbnail\c.jpg">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="res\TED\thumbnail\d.jpg">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="res\TED\thumbnail\e.jpg">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="res\TED\thumbnail\f.jpg">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="res\TED\thumbnail\g.jpg">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="shared\res\ElmSharp.Test.png" />
+    <Content Include="tizen-manifest.xml" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+  <PropertyGroup>
+    <!-- https://github.com/dotnet/corefxlab/tree/master/samples/NetCoreSample and
+       https://docs.microsoft.com/en-us/dotnet/articles/core/tutorials/target-dotnetcore-with-msbuild
+    -->
+    <!-- We don't use any of MSBuild's resolution logic for resolving the framework, so just set these two
+       properties to any folder that exists to skip the GetReferenceAssemblyPaths task (not target) and
+       to prevent it from outputting a warning (MSB3644).
+    -->
+    <_TargetFrameworkDirectories>$(MSBuildThisFileDirectory)</_TargetFrameworkDirectories>
+    <_FullFrameworkReferenceAssemblyPaths>$(MSBuildThisFileDirectory)</_FullFrameworkReferenceAssemblyPaths>
+    <AutoUnifyAssemblyReferences>true</AutoUnifyAssemblyReferences>
+  </PropertyGroup>
+  <ProjectExtensions>
+    <VisualStudio>
+      <FlavorProperties GUID="{2F98DAC9-6F16-457B-AED7-D43CAC379341}" Configuration="Debug|Any CPU">
+        <ProjectCorporateFlavorCfg />
+      </FlavorProperties>
+      <FlavorProperties GUID="{2F98DAC9-6F16-457B-AED7-D43CAC379341}" Configuration="Release|Any CPU">
+        <ProjectCorporateFlavorCfg />
+      </FlavorProperties>
+    </VisualStudio>
+  </ProjectExtensions>
 </Project>
\ No newline at end of file
index de8f72b..72877e4 100644 (file)
@@ -10,22 +10,222 @@ namespace ElmSharp.Test
         public override string TestName => "ImageTest1";
         public override string TestDescription => "To test basic operation of Image";
 
+        Image image;
+        Label lbInfo;
+
         public override void Run(Window window)
         {
-            Image image = new Image(window)
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Box box = new Box(window);
+            conformant.SetContent(box);
+            box.Show();
+
+            Box buttonBox1 = new Box(window)
             {
-                IsFixedAspect = false
+                IsHorizontal = true,
+                AlignmentX = -1,
+                AlignmentY = 0,
             };
-            image.Load(Path.Combine(TestRunner.ResourceDir,  "picture.png"));
-            image.Clicked += (e, o) =>
+            buttonBox1.Show();
+
+            Box buttonBox2 = new Box(window)
             {
-                Console.WriteLine("Image has been clicked. (IsFixedAspect = {0}", image.IsFixedAspect);
-                image.IsFixedAspect = image.IsFixedAspect == true?false:true;
+                IsHorizontal = true,
+                AlignmentX = -1,
+                AlignmentY = 0,
+            };
+            buttonBox2.Show();
+
+            Button btnFile1 = new Button(window)
+            {
+                Text = "File1",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            btnFile1.Show();
+
+            Button btnFile2 = new Button(window)
+            {
+                Text = "File2",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            btnFile2.Show();
+
+            Button btnUri1 = new Button(window)
+            {
+                Text = "Uri",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            btnUri1.Show();
+
+            Button btnStream1 = new Button(window)
+            {
+                Text = "Strm",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
             };
+            btnStream1.Show();
+
+            buttonBox1.PackEnd(btnFile1);
+            buttonBox1.PackEnd(btnFile2);
+            buttonBox1.PackEnd(btnUri1);
+            buttonBox1.PackEnd(btnStream1);
+
+
+            Button btnFileAsync1 = new Button(window)
+            {
+                Text = "FileA1",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            btnFileAsync1.Show();
+
+            Button btnFileAsync2 = new Button(window)
+            {
+                Text = "FileA2",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            btnFileAsync2.Show();
+
+            Button btnUriAsync1 = new Button(window)
+            {
+                Text = "UriA",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            btnUriAsync1.Show();
+
+            Button btnStreamAsync1 = new Button(window)
+            {
+                Text = "StrmA",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            btnStreamAsync1.Show();
+
+            buttonBox2.PackEnd(btnFileAsync1);
+            buttonBox2.PackEnd(btnFileAsync2);
+            buttonBox2.PackEnd(btnUriAsync1);
+            buttonBox2.PackEnd(btnStreamAsync1);
+
 
+            lbInfo = new Label(window)
+            {
+                Color = Color.White,
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1
+            };
+            lbInfo.Show();
+
+            image = new Image(window)
+            {
+                IsFixedAspect = true,
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
             image.Show();
-            image.Resize(500, 500);
-            image.Move(100,100);
+            image.Load(Path.Combine(TestRunner.ResourceDir, "picture.png"));
+            image.Clicked += (s, e) =>
+            {
+                Console.WriteLine("Image has been clicked. (IsFixedAspect = {0}", image.IsFixedAspect);
+                image.IsFixedAspect = image.IsFixedAspect == true ? false : true;
+            };
+
+            btnFile1.Clicked += (s, e) => LoadFile("TED/large/a.jpg");
+            btnFile2.Clicked += (s, e) => LoadFile("TED/large/b.jpg");
+            btnUri1.Clicked += (s, e) => LoadUri("http://pe.tedcdn.com/images/ted/2e306b9655267cee35e45688ace775590b820510_615x461.jpg");
+            btnStream1.Clicked += (s, e) => LoadStream(new FileStream(Path.Combine(TestRunner.ResourceDir, "TED/large/c.jpg"), FileMode.Open));
+
+            btnFileAsync1.Clicked += (s, e) => LoadFileAsync("TED/large/d.jpg");
+            btnFileAsync2.Clicked += (s, e) => LoadFileAsync("TED/large/e.jpg");
+            btnUriAsync1.Clicked += (s, e) => LoadUriAsync("http://pe.tedcdn.com/images/ted/2e306b9655267cee35e45688ace775590b820510_615x461.jpg");
+            btnStreamAsync1.Clicked += (s, e) => LoadStreamAsync(new FileStream(Path.Combine(TestRunner.ResourceDir, "TED/large/f.jpg"), FileMode.Open));
+            box.PackEnd(buttonBox1);
+            box.PackEnd(buttonBox2);
+            box.PackEnd(lbInfo);
+            box.PackEnd(image);
+        }
+
+        void LoadFile(string file)
+        {
+            bool ret = image.Load(Path.Combine(TestRunner.ResourceDir, file));
+            if (ret)
+                UpdateLabelText(lbInfo, image.File);
+            else
+                UpdateLabelText(lbInfo, "Loading Failed.");
+        }
+
+        void LoadUri(string uri)
+        {
+            bool ret = image.Load(uri);
+            if (ret)
+                UpdateLabelText(lbInfo, image.File);
+            else
+                UpdateLabelText(lbInfo, "Loading Failed.");
+        }
+
+        void LoadStream(Stream stream)
+        {
+            bool ret = image.Load(stream);
+            if (ret)
+                UpdateLabelText(lbInfo, image.File);
+            else
+                UpdateLabelText(lbInfo, "Loading Failed.");
+        }
+
+        async void LoadFileAsync(string file)
+        {
+            var ret = await image.LoadAsync(Path.Combine(TestRunner.ResourceDir, file));
+            if (ret)
+                UpdateLabelText(lbInfo, image.File);
+            else
+                UpdateLabelText(lbInfo, "Loading Failed.");
+        }
+
+        async void LoadUriAsync(string uri)
+        {
+            var ret = await image.LoadAsync(uri);
+            if (ret)
+                UpdateLabelText(lbInfo, image.File);
+            else
+                UpdateLabelText(lbInfo, "Loading Failed.");
+        }
+
+        async void LoadStreamAsync(Stream stream)
+        {
+            var ret = await image.LoadAsync(stream);
+            if (ret)
+                UpdateLabelText(lbInfo, image.File);
+            else
+                UpdateLabelText(lbInfo, "Loading Failed.");
+        }
+
+        void UpdateLabelText(Label lable, string text)
+        {
+            lable.Text = "<span color=#ffffff font_size=20>" + text + "</span>";
         }
     }
 }
diff --git a/test/ElmSharp.Test/res/TED/app_icn_ted.png b/test/ElmSharp.Test/res/TED/app_icn_ted.png
new file mode 100755 (executable)
index 0000000..ab726c8
Binary files /dev/null and b/test/ElmSharp.Test/res/TED/app_icn_ted.png differ
diff --git a/test/ElmSharp.Test/res/TED/large/a.jpg b/test/ElmSharp.Test/res/TED/large/a.jpg
new file mode 100755 (executable)
index 0000000..ff18439
Binary files /dev/null and b/test/ElmSharp.Test/res/TED/large/a.jpg differ
diff --git a/test/ElmSharp.Test/res/TED/large/b.jpg b/test/ElmSharp.Test/res/TED/large/b.jpg
new file mode 100755 (executable)
index 0000000..e34e60b
Binary files /dev/null and b/test/ElmSharp.Test/res/TED/large/b.jpg differ
diff --git a/test/ElmSharp.Test/res/TED/large/c.jpg b/test/ElmSharp.Test/res/TED/large/c.jpg
new file mode 100755 (executable)
index 0000000..ae2a56c
Binary files /dev/null and b/test/ElmSharp.Test/res/TED/large/c.jpg differ
diff --git a/test/ElmSharp.Test/res/TED/large/d.jpg b/test/ElmSharp.Test/res/TED/large/d.jpg
new file mode 100755 (executable)
index 0000000..bb7d72a
Binary files /dev/null and b/test/ElmSharp.Test/res/TED/large/d.jpg differ
diff --git a/test/ElmSharp.Test/res/TED/large/e.jpg b/test/ElmSharp.Test/res/TED/large/e.jpg
new file mode 100755 (executable)
index 0000000..d35a60d
Binary files /dev/null and b/test/ElmSharp.Test/res/TED/large/e.jpg differ
diff --git a/test/ElmSharp.Test/res/TED/large/f.jpg b/test/ElmSharp.Test/res/TED/large/f.jpg
new file mode 100755 (executable)
index 0000000..238d722
Binary files /dev/null and b/test/ElmSharp.Test/res/TED/large/f.jpg differ
diff --git a/test/ElmSharp.Test/res/TED/large/g.jpg b/test/ElmSharp.Test/res/TED/large/g.jpg
new file mode 100755 (executable)
index 0000000..873c9f3
Binary files /dev/null and b/test/ElmSharp.Test/res/TED/large/g.jpg differ
diff --git a/test/ElmSharp.Test/res/TED/thumbnail/a.jpg b/test/ElmSharp.Test/res/TED/thumbnail/a.jpg
new file mode 100755 (executable)
index 0000000..4d16594
Binary files /dev/null and b/test/ElmSharp.Test/res/TED/thumbnail/a.jpg differ
diff --git a/test/ElmSharp.Test/res/TED/thumbnail/b.jpg b/test/ElmSharp.Test/res/TED/thumbnail/b.jpg
new file mode 100755 (executable)
index 0000000..f3dc3dd
Binary files /dev/null and b/test/ElmSharp.Test/res/TED/thumbnail/b.jpg differ
diff --git a/test/ElmSharp.Test/res/TED/thumbnail/c.jpg b/test/ElmSharp.Test/res/TED/thumbnail/c.jpg
new file mode 100755 (executable)
index 0000000..a0a4c1a
Binary files /dev/null and b/test/ElmSharp.Test/res/TED/thumbnail/c.jpg differ
diff --git a/test/ElmSharp.Test/res/TED/thumbnail/d.jpg b/test/ElmSharp.Test/res/TED/thumbnail/d.jpg
new file mode 100755 (executable)
index 0000000..4dfda7c
Binary files /dev/null and b/test/ElmSharp.Test/res/TED/thumbnail/d.jpg differ
diff --git a/test/ElmSharp.Test/res/TED/thumbnail/e.jpg b/test/ElmSharp.Test/res/TED/thumbnail/e.jpg
new file mode 100755 (executable)
index 0000000..0d4ded3
Binary files /dev/null and b/test/ElmSharp.Test/res/TED/thumbnail/e.jpg differ
diff --git a/test/ElmSharp.Test/res/TED/thumbnail/f.jpg b/test/ElmSharp.Test/res/TED/thumbnail/f.jpg
new file mode 100755 (executable)
index 0000000..a3fc744
Binary files /dev/null and b/test/ElmSharp.Test/res/TED/thumbnail/f.jpg differ
diff --git a/test/ElmSharp.Test/res/TED/thumbnail/g.jpg b/test/ElmSharp.Test/res/TED/thumbnail/g.jpg
new file mode 100755 (executable)
index 0000000..33c46c1
Binary files /dev/null and b/test/ElmSharp.Test/res/TED/thumbnail/g.jpg differ