From aa4930cd311460c6bb7f1939949c6da51bf375fe Mon Sep 17 00:00:00 2001 From: WonYoung Choi Date: Thu, 20 Oct 2016 22:43:58 +0900 Subject: Fix ImageLoading to use new smart callbacks 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 --- .editorconfig | 8 + .gitattributes | 14 ++ ElmSharp.Test/ElmSharp.Test.csproj | 45 ++++++ ElmSharp.Test/TC/ImageTest1.cs | 216 ++++++++++++++++++++++++++- ElmSharp.Test/res/TED/app_icn_ted.png | Bin 0 -> 1636 bytes ElmSharp.Test/res/TED/large/a.jpg | Bin 0 -> 157336 bytes ElmSharp.Test/res/TED/large/b.jpg | Bin 0 -> 144472 bytes ElmSharp.Test/res/TED/large/c.jpg | Bin 0 -> 151950 bytes ElmSharp.Test/res/TED/large/d.jpg | Bin 0 -> 114345 bytes ElmSharp.Test/res/TED/large/e.jpg | Bin 0 -> 112488 bytes ElmSharp.Test/res/TED/large/f.jpg | Bin 0 -> 191628 bytes ElmSharp.Test/res/TED/large/g.jpg | Bin 0 -> 158625 bytes ElmSharp.Test/res/TED/thumbnail/a.jpg | Bin 0 -> 163029 bytes ElmSharp.Test/res/TED/thumbnail/b.jpg | Bin 0 -> 136017 bytes ElmSharp.Test/res/TED/thumbnail/c.jpg | Bin 0 -> 122669 bytes ElmSharp.Test/res/TED/thumbnail/d.jpg | Bin 0 -> 189362 bytes ElmSharp.Test/res/TED/thumbnail/e.jpg | Bin 0 -> 131158 bytes ElmSharp.Test/res/TED/thumbnail/f.jpg | Bin 0 -> 110933 bytes ElmSharp.Test/res/TED/thumbnail/g.jpg | Bin 0 -> 118634 bytes ElmSharp/ElmSharp/Image.cs | 190 ++++++++++++++--------- ElmSharp/Interop/Interop.Elementary.Image.cs | 5 +- packaging/elm-sharp.spec | 2 +- 22 files changed, 396 insertions(+), 84 deletions(-) create mode 100644 .editorconfig create mode 100644 .gitattributes create mode 100755 ElmSharp.Test/res/TED/app_icn_ted.png create mode 100755 ElmSharp.Test/res/TED/large/a.jpg create mode 100755 ElmSharp.Test/res/TED/large/b.jpg create mode 100755 ElmSharp.Test/res/TED/large/c.jpg create mode 100755 ElmSharp.Test/res/TED/large/d.jpg create mode 100755 ElmSharp.Test/res/TED/large/e.jpg create mode 100755 ElmSharp.Test/res/TED/large/f.jpg create mode 100755 ElmSharp.Test/res/TED/large/g.jpg create mode 100755 ElmSharp.Test/res/TED/thumbnail/a.jpg create mode 100755 ElmSharp.Test/res/TED/thumbnail/b.jpg create mode 100755 ElmSharp.Test/res/TED/thumbnail/c.jpg create mode 100755 ElmSharp.Test/res/TED/thumbnail/d.jpg create mode 100755 ElmSharp.Test/res/TED/thumbnail/e.jpg create mode 100755 ElmSharp.Test/res/TED/thumbnail/f.jpg create mode 100755 ElmSharp.Test/res/TED/thumbnail/g.jpg diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..ed9502e --- /dev/null +++ b/.editorconfig @@ -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 index 0000000..3400ba9 --- /dev/null +++ b/.gitattributes @@ -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 diff --git a/ElmSharp.Test/ElmSharp.Test.csproj b/ElmSharp.Test/ElmSharp.Test.csproj index 02c92a5..ce757f4 100644 --- a/ElmSharp.Test/ElmSharp.Test.csproj +++ b/ElmSharp.Test/ElmSharp.Test.csproj @@ -99,6 +99,51 @@ PreserveNewest + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + diff --git a/ElmSharp.Test/TC/ImageTest1.cs b/ElmSharp.Test/TC/ImageTest1.cs index de8f72b..72877e4 100644 --- a/ElmSharp.Test/TC/ImageTest1.cs +++ b/ElmSharp.Test/TC/ImageTest1.cs @@ -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 = "" + text + ""; } } } diff --git a/ElmSharp.Test/res/TED/app_icn_ted.png b/ElmSharp.Test/res/TED/app_icn_ted.png new file mode 100755 index 0000000..ab726c8 Binary files /dev/null and b/ElmSharp.Test/res/TED/app_icn_ted.png differ diff --git a/ElmSharp.Test/res/TED/large/a.jpg b/ElmSharp.Test/res/TED/large/a.jpg new file mode 100755 index 0000000..ff18439 Binary files /dev/null and b/ElmSharp.Test/res/TED/large/a.jpg differ diff --git a/ElmSharp.Test/res/TED/large/b.jpg b/ElmSharp.Test/res/TED/large/b.jpg new file mode 100755 index 0000000..e34e60b Binary files /dev/null and b/ElmSharp.Test/res/TED/large/b.jpg differ diff --git a/ElmSharp.Test/res/TED/large/c.jpg b/ElmSharp.Test/res/TED/large/c.jpg new file mode 100755 index 0000000..ae2a56c Binary files /dev/null and b/ElmSharp.Test/res/TED/large/c.jpg differ diff --git a/ElmSharp.Test/res/TED/large/d.jpg b/ElmSharp.Test/res/TED/large/d.jpg new file mode 100755 index 0000000..bb7d72a Binary files /dev/null and b/ElmSharp.Test/res/TED/large/d.jpg differ diff --git a/ElmSharp.Test/res/TED/large/e.jpg b/ElmSharp.Test/res/TED/large/e.jpg new file mode 100755 index 0000000..d35a60d Binary files /dev/null and b/ElmSharp.Test/res/TED/large/e.jpg differ diff --git a/ElmSharp.Test/res/TED/large/f.jpg b/ElmSharp.Test/res/TED/large/f.jpg new file mode 100755 index 0000000..238d722 Binary files /dev/null and b/ElmSharp.Test/res/TED/large/f.jpg differ diff --git a/ElmSharp.Test/res/TED/large/g.jpg b/ElmSharp.Test/res/TED/large/g.jpg new file mode 100755 index 0000000..873c9f3 Binary files /dev/null and b/ElmSharp.Test/res/TED/large/g.jpg differ diff --git a/ElmSharp.Test/res/TED/thumbnail/a.jpg b/ElmSharp.Test/res/TED/thumbnail/a.jpg new file mode 100755 index 0000000..4d16594 Binary files /dev/null and b/ElmSharp.Test/res/TED/thumbnail/a.jpg differ diff --git a/ElmSharp.Test/res/TED/thumbnail/b.jpg b/ElmSharp.Test/res/TED/thumbnail/b.jpg new file mode 100755 index 0000000..f3dc3dd Binary files /dev/null and b/ElmSharp.Test/res/TED/thumbnail/b.jpg differ diff --git a/ElmSharp.Test/res/TED/thumbnail/c.jpg b/ElmSharp.Test/res/TED/thumbnail/c.jpg new file mode 100755 index 0000000..a0a4c1a Binary files /dev/null and b/ElmSharp.Test/res/TED/thumbnail/c.jpg differ diff --git a/ElmSharp.Test/res/TED/thumbnail/d.jpg b/ElmSharp.Test/res/TED/thumbnail/d.jpg new file mode 100755 index 0000000..4dfda7c Binary files /dev/null and b/ElmSharp.Test/res/TED/thumbnail/d.jpg differ diff --git a/ElmSharp.Test/res/TED/thumbnail/e.jpg b/ElmSharp.Test/res/TED/thumbnail/e.jpg new file mode 100755 index 0000000..0d4ded3 Binary files /dev/null and b/ElmSharp.Test/res/TED/thumbnail/e.jpg differ diff --git a/ElmSharp.Test/res/TED/thumbnail/f.jpg b/ElmSharp.Test/res/TED/thumbnail/f.jpg new file mode 100755 index 0000000..a3fc744 Binary files /dev/null and b/ElmSharp.Test/res/TED/thumbnail/f.jpg differ diff --git a/ElmSharp.Test/res/TED/thumbnail/g.jpg b/ElmSharp.Test/res/TED/thumbnail/g.jpg new file mode 100755 index 0000000..33c46c1 Binary files /dev/null and b/ElmSharp.Test/res/TED/thumbnail/g.jpg differ diff --git a/ElmSharp/ElmSharp/Image.cs b/ElmSharp/ElmSharp/Image.cs index d90cd49..20b13e9 100644 --- a/ElmSharp/ElmSharp/Image.cs +++ b/ElmSharp/ElmSharp/Image.cs @@ -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 LoadAsync(Stream stream, CancellationToken cancellationToken) + public Task LoadAsync(string file, CancellationToken cancellationToken = default(CancellationToken)) { - var tcs = new TaskCompletionSource(); + 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(); + 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 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 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(); + + 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); } } diff --git a/ElmSharp/Interop/Interop.Elementary.Image.cs b/ElmSharp/Interop/Interop.Elementary.Image.cs index 65c8beb..39073ab 100644 --- a/ElmSharp/Interop/Interop.Elementary.Image.cs +++ b/ElmSharp/Interop/Interop.Elementary.Image.cs @@ -16,6 +16,9 @@ internal static partial class Interop [DllImport(Libraries.Elementary)] 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); @@ -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) { diff --git a/packaging/elm-sharp.spec b/packaging/elm-sharp.spec index 89d5e41..34587e6 100644 --- a/packaging/elm-sharp.spec +++ b/packaging/elm-sharp.spec @@ -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 -- cgit v1.2.3