--- /dev/null
+bin/
+obj/
+*.exe
+*.dll
+*.csproj.user
+*.xproj.user
+*.lock.json
+.vs/
--- /dev/null
+<?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
+ <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>\r
+ <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>\r
+ </PropertyGroup>\r
+ <Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />\r
+ <PropertyGroup Label="Globals">\r
+ <ProjectGuid>ce20dbb2-ef5f-4563-9005-ffbec044aa20</ProjectGuid>\r
+ <RootNamespace>ElmSharpTest</RootNamespace>\r
+ <BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>\r
+ <OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>\r
+ </PropertyGroup>\r
+\r
+ <PropertyGroup>\r
+ <SchemaVersion>2.0</SchemaVersion>\r
+ </PropertyGroup>\r
+ <Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />\r
+</Project>
\ No newline at end of file
--- /dev/null
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("EflSharpTest")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyProduct("EflSharpTest")]
+[assembly: AssemblyCopyright("Copyright © Microsoft 2016")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("2e1a161a-baa9-40ef-a8b4-082ce7c813b8")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
--- /dev/null
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+ class BackgroundTest1 : TestCaseBase
+ {
+ public override string TestName => "BackgroundTest1";
+ public override string TestDescription => "To test basic operation of Background";
+
+ public override void Run(Window window)
+ {
+ Background bg1 = new Background(window)
+ {
+ Color = Color.Orange
+ };
+
+ Background bg2 = new Background(window) {
+ File = "/opt/home/owner/res/tizen.png",
+ BackgroundOption = BackgroundOptions.Tile
+ };
+
+ Show(bg1, 0, 0, 100, 100);
+ Show(bg2, 100, 100, 500, 500);
+ }
+
+ void Show(Background bg, int x, int y, int w, int h)
+ {
+ bg.Show();
+ bg.Move(x, y);
+ bg.Resize(w, h);
+ }
+ }
+}
--- /dev/null
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+ public class BackgroundTest2 : TestCaseBase
+ {
+ public override string TestName => "BackgroundTest2";
+ public override string TestDescription => "To test basic operation of Background";
+
+ public override void Run(Window window)
+ {
+ Background bg1 = new Background(window)
+ {
+ Color = Color.Orange
+ };
+
+ Background bg2 = new Background(window)
+ {
+ Color = new Color(255, 255, 255, 100)
+ };
+ Show(bg1, 0, 0, 500, 500);
+ Show(bg2, 100, 100, 500, 500);
+
+ Console.WriteLine("bg1.Color : {0}", bg1.Color.ToString());
+ Console.WriteLine("bg2.Color : {0}", bg2.Color.ToString());
+ }
+
+ void Show(Background bg, int x, int y, int w, int h)
+ {
+ bg.Show();
+ bg.Move(x, y);
+ bg.Resize(w, h);
+ }
+ }
+}
--- /dev/null
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+ public class BackgroundTest3 : TestCaseBase
+ {
+ public override string TestName => "BackgroundTest3";
+ public override string TestDescription => "To test basic operation of Background";
+
+ public override void Run(Window window)
+ {
+
+ Conformant conformant = new Conformant(window);
+ conformant.Show();
+
+ Box box = new Box(window)
+ {
+ AlignmentY = -1,
+ AlignmentX = -1,
+ WeightX = 1,
+ WeightY = 1,
+ };
+ box.Show();
+ conformant.SetContent(box);
+ Background bg = new Background(window)
+ {
+ AlignmentY = -1,
+ AlignmentX = -1,
+ WeightX = 1,
+ WeightY = 1,
+ };
+ bg.Show();
+ box.PackEnd(bg);
+ Slider red = new Slider(window)
+ {
+ Minimum = 0,
+ Maximum = 255,
+ Text = "Red",
+ AlignmentX = -1,
+ WeightX = 1
+ };
+ Slider green = new Slider(window)
+ {
+ Minimum = 0,
+ Maximum = 255,
+ Text = "Green",
+ AlignmentX = -1,
+ WeightX = 1
+ };
+ Slider blue = new Slider(window)
+ {
+ Minimum = 0,
+ Maximum = 255,
+ Text = "Blue",
+ AlignmentX = -1,
+ WeightX = 1
+ };
+ Slider alpha = new Slider(window)
+ {
+ Minimum = 0,
+ Maximum = 255,
+ Text = "Alpha",
+ AlignmentX = -1,
+ WeightX = 1
+ };
+ red.Show();
+ green.Show();
+ blue.Show();
+ alpha.Show();
+ box.PackEnd(red);
+ box.PackEnd(green);
+ box.PackEnd(blue);
+ box.PackEnd(alpha);
+ red.Value = 255;
+ green.Value = 255;
+ blue.Value = 255;
+ alpha.Value = 255;
+
+ bg.Color = new Color(255, 255, 255, 255);
+
+ EventHandler handler = (s, e) =>
+ {
+ bg.Color = new Color((int)red.Value, (int)green.Value, (int)blue.Value, (int)alpha.Value);
+ };
+
+ red.ValueChanged += handler;
+ green.ValueChanged += handler;
+ blue.ValueChanged += handler;
+ alpha.ValueChanged += handler;
+ }
+ }
+}
--- /dev/null
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+ class BoxTest1 : TestCaseBase
+ {
+ public override string TestName => "BoxTest1";
+ public override string TestDescription => "To test basic operation of Box";
+
+ public override void Run(Window window)
+ {
+ Conformant conformant = new Conformant(window);
+ conformant.Show();
+ Box box = new Box(window);
+ conformant.SetContent(box);
+ box.Show();
+
+ Button button1 = new Button(window) {
+ Text = "Button 1",
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1
+ };
+ Button button2 = new Button(window) {
+ Text = "Button 2",
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1
+ };
+ Button button3 = new Button(window) {
+ Text = "Button 3",
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1
+ };
+
+ box.PackEnd(button1);
+ box.PackEnd(button2);
+ box.PackEnd(button3);
+
+ button1.Show();
+ button2.Show();
+ button3.Show();
+
+ button1.Clicked += Button1_Clicked;
+ button2.Clicked += Button1_Clicked;
+ button3.Clicked += Button1_Clicked;
+ }
+
+ private void Button1_Clicked(object sender, EventArgs e)
+ {
+ Console.WriteLine("{0} Clicked!", ((Button)sender).Text);
+ }
+ }
+}
--- /dev/null
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+ class ButtonTest1 : TestCaseBase
+ {
+ public override string TestName => "ButtonTest1";
+ public override string TestDescription => "To test basic operation of Button";
+
+ public override void Run(Window window)
+ {
+ Button button1 = new Button(window) {
+ Text = "Button 1",
+
+ };
+
+ button1.Clicked += (s, e) =>
+ {
+ Console.WriteLine("Button1 Clicked!");
+ };
+
+ button1.Pressed += (s, e) =>
+ {
+ Console.WriteLine("Button1 Pressed!");
+ };
+
+ button1.Released += (s, e) =>
+ {
+ Console.WriteLine("Button1 Released!");
+ };
+
+ button1.Repeated += (s, e) =>
+ {
+ Console.WriteLine("Button1 Repeated!");
+ };
+
+ button1.Show();
+ button1.Resize(500, 100);
+ button1.Move(0, 0);
+ }
+
+ }
+}
\ No newline at end of file
--- /dev/null
+using System;
+using System.Collections.Generic;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+ class CalendarTest1 : TestCaseBase
+ {
+ public override string TestName => "CalendarTest1";
+ public override string TestDescription => "To test basic operation of Calendar";
+
+ public override void Run(Window window)
+ {
+ Background bg = new Background(window);
+ bg.Color = Color.White;
+ bg.Move(0, 0);
+ bg.Resize(window.ScreenSize.Width, window.ScreenSize.Height);
+ bg.Show();
+
+ Calendar calendar = new Calendar(window)
+ {
+ FirstDayOfWeek = DayOfWeek.Monday,
+ WeekDayNames = new List<string>() { "S", "M", "T", "W", "T", "F", "S" }
+ };
+
+ Label label1 = new Label(window) {
+ Text = string.Format("WeekDayLabel.Count={0}", calendar.WeekDayNames.Count),
+ };
+
+ Label label2 = new Label(window) {
+ Text = string.Format("WeekDayLabel.FirstDayOfWeek={0}", calendar.FirstDayOfWeek),
+ };
+
+ Label label3 = new Label(window) {
+ Text = string.Format("WeekDayLabel.SelectedDate={0}", calendar.SelectedDate),
+ };
+
+ calendar.DateChanged += (object sender, DateChangedEventArgs e) =>
+ {
+ label1.Text = string.Format("Old.Day={0}, Month={1}, Year={2}", e.OldDate.Day, e.OldDate.Month, e.OldDate.Year);
+ label2.Text = string.Format("New.Day={0}, Month={1}, Year={2}", e.NewDate.Day, e.NewDate.Month, e.NewDate.Year);
+ };
+
+ calendar.DisplayedMonthChanged += (object sender, DisplayedMonthChangedEventArgs e) =>
+ {
+ label3.Text = string.Format("Old Month={0}, New Month={1}", e.OldMonth, e.NewMonth);
+ };
+
+ calendar.Resize(600, 600);
+ calendar.Move(0, 300);
+ calendar.Show();
+
+ label1.Resize(600, 100);
+ label1.Move(0, 0);
+ label1.Show();
+
+ label2.Resize(600, 100);
+ label2.Move(0, 100);
+ label2.Show();
+
+ label3.Resize(600, 100);
+ label3.Move(0, 200);
+ label3.Show();
+ }
+
+ }
+}
\ No newline at end of file
--- /dev/null
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+ class CheckTest1 : TestCaseBase
+ {
+ public override string TestName => "CheckTest1";
+ public override string TestDescription => "To test basic operation of Check";
+
+ public override void Run(Window window)
+ {
+ Background bg = new Background(window);
+ bg.Color = Color.White;
+ bg.Move(0, 0);
+ bg.Resize(window.ScreenSize.Width, window.ScreenSize.Height);
+ bg.Show();
+
+ Check check = new Check(window)
+ {
+ Text = "This is Check",
+ Style = "default",
+ };
+
+ Label label1 = new Label(window) {
+ Text = string.Format("IsChecked ={0}, Style={1}", check.IsChecked, check.Style),
+ };
+
+ Label label2 = new Label(window);
+
+ Label label3 = new Label(window);
+
+ check.StateChanged += (object sender, CheckStateChangedEventArgs e) =>
+ {
+ check.Style = check.Style == "default" ? "on&off": "default";
+ label1.Text = string.Format("IsChecked ={0}, Style={1}", check.IsChecked, check.Style);
+ label2.Text = string.Format("OldState={0}", e.OldState);
+ label3.Text = string.Format("NewState={0}", e.NewState);
+ };
+
+ check.Resize(600, 100);
+ check.Move(0, 300);
+ check.Show();
+
+ label1.Resize(600, 100);
+ label1.Move(0, 0);
+ label1.Show();
+
+ label2.Resize(600, 100);
+ label2.Move(0, 100);
+ label2.Show();
+
+ label3.Resize(600, 100);
+ label3.Move(0, 200);
+ label3.Show();
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+ class ColorSelectorTest1 : TestCaseBase
+ {
+ public override string TestName => "ColorSelectorTest1";
+ public override string TestDescription => "To test basic operation of ColorSelector";
+
+ public override void Run(Window window)
+ {
+ Background bg = new Background(window);
+ bg.Color = Color.White;
+ bg.Move(0, 0);
+ bg.Resize(window.ScreenSize.Width, window.ScreenSize.Height);
+ bg.Show();
+
+ ColorSelector cs = new ColorSelector(window);
+
+ Label label1 = new Label(window) {
+ Text = string.Format("Selected Color={0}", cs.SelectedColor),
+ };
+
+ Label label2 = new Label(window);
+
+ Label label3 = new Label(window);
+
+ cs.ColorChanged += (object sender, ColorChangedEventArgs e) =>
+ {
+ label1.Text = string.Format("Selected Color={0}", cs.SelectedColor);
+ label2.Text = string.Format("Old Color={0}", e.OldColor);
+ label3.Text = string.Format("New Color={0}", e.NewColor);
+ };
+
+ cs.Resize(600, 600);
+ cs.Move(0, 300);
+ cs.Show();
+
+ label1.Resize(600, 100);
+ label1.Move(0, 0);
+ label1.Show();
+
+ label2.Resize(600, 100);
+ label2.Move(0, 100);
+ label2.Show();
+
+ label3.Resize(600, 100);
+ label3.Move(0, 200);
+ label3.Show();
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+ public class ContextPopupTest1 : TestCaseBase
+ {
+ public override string TestName => "ContextPopupTest1";
+ public override string TestDescription => "To test basic operation of ContextPopup";
+ private int _count = 0;
+ public override void Run(Window window)
+ {
+ Background bg = new Background(window);
+ bg.Color = Color.White;
+ bg.Move(0, 0);
+ bg.Resize(window.ScreenSize.Width, window.ScreenSize.Height);
+ bg.Show();
+
+ ContextPopup ctxPopup = new ContextPopup(bg)
+ {
+ IsHorizontal = false,
+ AutoHide = false,
+ };
+
+ for (int i = 0; i < 5; i++)
+ {
+ ctxPopup.Append(string.Format("{0} item", _count++));
+ }
+
+ ctxPopup.Dismissed += (e, o) => {
+ Console.WriteLine("Dismissed");
+ };
+ ctxPopup.Show();
+
+ bool ctxPopupVisible = true;
+ string dismissCaption = "Dismiss ContextPopup!";
+ string showCaption = "Show ContextPopup!";
+
+ Button button = new Button(window) {
+ Text = dismissCaption
+ };
+ button.Clicked += (E, o) =>
+ {
+ if(ctxPopupVisible)
+ {
+ ctxPopup.Dismiss();
+ }
+ else
+ {
+ ctxPopup.Show();
+ }
+ ctxPopupVisible = !ctxPopupVisible;
+ button.Text = ctxPopupVisible?dismissCaption:showCaption;
+ };
+ button.Move(200, 100);
+ button.Resize(500, 100);
+ button.Show();
+ }
+ }
+}
--- /dev/null
+using System;
+using System.Collections.Generic;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+ class DateTimeSelectorTest1 : TestCaseBase
+ {
+ public override string TestName => "DateTimeSelectorTest1";
+ public override string TestDescription => "To test basic operation of DateTimeSelector";
+
+ public override void Run(Window window)
+ {
+ Background bg = new Background(window);
+ bg.Color = Color.White;
+ bg.Move(0, 0);
+ bg.Resize(window.ScreenSize.Width, window.ScreenSize.Height);
+ bg.Show();
+
+ DateTimeSelector dateTime = new DateTimeSelector(window)
+ {
+ MinimumDateTime = new DateTime(2015,1,1),
+ MaximumDateTime = DateTime.Now,
+ DateTime = DateTime.Now
+ };
+
+ Label label1 = new Label(window);
+
+ Label label2 = new Label(window);
+
+ Label label3 = new Label(window) {
+ Text = string.Format("Current DateTime={0}", dateTime.DateTime),
+ };
+
+ dateTime.DateTimeChanged += (object sender, DateChangedEventArgs e) =>
+ {
+ label1.Text = string.Format("Old DateTime={0}", e.OldDate);
+ label2.Text = string.Format("New DateTime={0}", e.NewDate);
+ label3.Text = string.Format("Current DateTime={0}", dateTime.DateTime);
+ };
+
+ dateTime.Resize(600, 600);
+ dateTime.Move(0, 300);
+ dateTime.Show();
+
+ label1.Resize(600, 100);
+ label1.Move(0, 0);
+ label1.Show();
+
+ label2.Resize(600, 100);
+ label2.Move(0, 100);
+ label2.Show();
+
+ label3.Resize(600, 100);
+ label3.Move(0, 200);
+ label3.Show();
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+ class EntryTest1 : TestCaseBase
+ {
+ public override string TestName => "EntryTest1";
+ public override string TestDescription => "To test basic operation of Entry";
+
+ public override void Run(Window window)
+ {
+ Background bg = new Background(window)
+ {
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1,
+ Color = Color.White
+ };
+ bg.Show();
+ window.AddResizeObject(bg);
+
+ Conformant conformant = new Conformant(window);
+ conformant.Show();
+ Box box = new Box(window);
+ conformant.SetContent(box);
+ box.Show();
+
+ Entry entry1 = new Entry(window)
+ {
+ AlignmentX = -1,
+ AlignmentY = 0,
+ WeightX = 1,
+ WeightY = 1,
+ IsSingleLine = true,
+ };
+ entry1.SetPartText("guide", "<span color=#999999>Single Line</span>");
+
+ Entry entry2 = new Entry(window)
+ {
+ AlignmentX = -1,
+ AlignmentY = 0,
+ WeightX = 1,
+ WeightY = 1,
+ IsPassword = true
+ };
+ entry2.SetPartText("guide", "<span color=#999999>Password</span>");
+
+ box.PackEnd(entry1);
+ box.PackEnd(entry2);
+
+ entry1.Show();
+ entry2.Show();
+ }
+ }
+}
--- /dev/null
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+ public class GenGridTest1 : TestCaseBase
+ {
+ public override string TestName => "GenGridTest1";
+ public override string TestDescription => "To test basic operation of GenGrid";
+
+ public override void Run(Window window)
+ {
+ Conformant conformant = new Conformant(window);
+ conformant.Show();
+ GenGrid grid = new GenGrid(window)
+ {
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1,
+ ItemAlignmentX = -1,
+ ItemAlignmentY = -1,
+ ItemWidth = window.ScreenSize.Width / 3,
+ ItemHeight = window.ScreenSize.Width / 3,
+ };
+
+ GenItemClass defaultClass = new GenItemClass("default")
+ {
+ GetTextHandler = (obj, part) =>
+ {
+ Color item = (Color)obj;
+ return String.Format("#{0:X}{1:X}{2:X}", item.R, item.G, item.B);
+ },
+ GetContentHandler = (obj, part) =>
+ {
+ Color item = (Color)obj;
+ Console.WriteLine("{0} part create requested", part);
+ if (part == "elm.swallow.icon")
+ {
+ var colorbox = new Rectangle(window)
+ {
+ Color = item
+ };
+ return colorbox;
+ }
+ return null;
+ }
+
+ };
+
+ var rnd = new Random();
+ for (int i = 0; i < 102; i++)
+ {
+ int r = rnd.Next(255);
+ int g = rnd.Next(255);
+ int b = rnd.Next(255);
+ Color color = Color.FromRgb(r, g, b);
+ grid.Append(defaultClass, color);
+ }
+ grid.Show();
+ conformant.SetContent(grid);
+ }
+
+ private void List_ItemSelected(object sender, GenListItemEventArgs e)
+ {
+ Console.WriteLine("{0} Item was selected", (string)(e.Item.Data));
+ }
+ }
+}
--- /dev/null
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+ public class GenGridTest2 : TestCaseBase
+ {
+ public override string TestName => "GenGridTest2";
+ public override string TestDescription => "To test basic operation of GenGrid";
+
+ public override void Run(Window window)
+ {
+ Conformant conformant = new Conformant(window);
+ conformant.Show();
+ GenGrid grid = new GenGrid(window)
+ {
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1,
+ ItemAlignmentX = -1,
+ ItemAlignmentY = -1,
+ ItemWidth = window.ScreenSize.Width / 3,
+ ItemHeight = window.ScreenSize.Width / 3,
+ };
+
+ GenItemClass defaultClass = new GenItemClass("default")
+ {
+ GetTextHandler = (obj, part) =>
+ {
+ Color item = (Color)obj;
+ return String.Format("#{0:X}{1:X}{2:X}", item.R, item.G, item.B);
+ },
+ GetContentHandler = (obj, part) =>
+ {
+ Color item = (Color)obj;
+ if (part == "elm.swallow.icon")
+ {
+ var colorbox = new Rectangle(window)
+ {
+ Color = item
+ };
+ return colorbox;
+ }
+ return null;
+ }
+
+ };
+
+ GenGridItem firstitem = null;
+ GenGridItem lastitem = null;
+
+ var rnd = new Random();
+ for (int i = 0; i < 102; i++)
+ {
+ int r = rnd.Next(255);
+ int g = rnd.Next(255);
+ int b = rnd.Next(255);
+ Color color = Color.FromRgb(r, g, b);
+ var item = grid.Append(defaultClass, color);
+ if (i == 0)
+ firstitem = item;
+ if (i == 101)
+ lastitem = item;
+ }
+ grid.Show();
+ Box box = new Box(window)
+ {
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1,
+ };
+ box.Show();
+ conformant.SetContent(box);
+
+ box.PackEnd(grid);
+
+ Button first = new Button(window)
+ {
+ Text = "First",
+ AlignmentX = -1,
+ WeightX = 1,
+ };
+ Button last = new Button(window)
+ {
+ Text = "Last",
+ AlignmentX = -1,
+ WeightX = 1,
+ };
+ first.Clicked += (s, e) =>
+ {
+ grid.ScrollTo(firstitem, ScrollToPosition.In, true);
+ };
+ last.Clicked += (s, e) =>
+ {
+ grid.ScrollTo(lastitem, ScrollToPosition.In, true);
+ };
+ first.Show();
+ last.Show();
+
+ box.PackEnd(first);
+ box.PackEnd(last);
+ grid.ItemActivated += Grid_ItemActivated;
+ grid.ItemSelected += Grid_ItemSelected;
+ grid.ItemUnselected += Grid_ItemUnselected;
+ grid.ItemRealized += Grid_ItemRealized;
+ grid.ItemUnrealized += Grid_ItemUnrealized;
+ grid.ItemPressed += Grid_ItemPressed;
+ grid.ItemReleased += Grid_ItemReleased;
+ grid.ItemLongPressed += Grid_ItemLongPressed;
+ grid.ItemDoubleClicked += Grid_ItemDoubleClicked;
+ }
+
+ private void Grid_ItemDoubleClicked(object sender, GenGridItemEventArgs e)
+ {
+ Color color = (Color)e.Item.Data;
+ Console.WriteLine("#{0:X}{1:X}{2:X} is Double clicked", color.R, color.G, color.B);
+ }
+
+ private void Grid_ItemLongPressed(object sender, GenGridItemEventArgs e)
+ {
+ Color color = (Color)e.Item.Data;
+ Console.WriteLine("#{0:X}{1:X}{2:X} is LongPressed", color.R, color.G, color.B);
+ }
+
+ private void Grid_ItemReleased(object sender, GenGridItemEventArgs e)
+ {
+ Color color = (Color)e.Item.Data;
+ Console.WriteLine("#{0:X}{1:X}{2:X} is Released", color.R, color.G, color.B);
+ }
+
+ private void Grid_ItemPressed(object sender, GenGridItemEventArgs e)
+ {
+ Color color = (Color)e.Item.Data;
+ Console.WriteLine("#{0:X}{1:X}{2:X} is Pressed", color.R, color.G, color.B);
+ }
+
+ private void Grid_ItemUnselected(object sender, GenGridItemEventArgs e)
+ {
+ Color color = (Color)e.Item.Data;
+ Console.WriteLine("#{0:X}{1:X}{2:X} is Unselected", color.R, color.G, color.B);
+ }
+
+ private void Grid_ItemRealized(object sender, GenGridItemEventArgs e)
+ {
+ Color color = (Color)e.Item.Data;
+ Console.WriteLine("#{0:X}{1:X}{2:X} is Realized", color.R, color.G, color.B);
+ }
+
+ private void Grid_ItemUnrealized(object sender, GenGridItemEventArgs e)
+ {
+ Color color = (Color)e.Item.Data;
+ Console.WriteLine("#{0:X}{1:X}{2:X} is Unrealized", color.R, color.G, color.B);
+ }
+
+ private void Grid_ItemSelected(object sender, GenGridItemEventArgs e)
+ {
+ Color color = (Color)e.Item.Data;
+ Console.WriteLine("#{0:X}{1:X}{2:X} is Selected", color.R, color.G, color.B);
+ }
+
+ private void Grid_ItemActivated(object sender, GenGridItemEventArgs e)
+ {
+ Color color = (Color)e.Item.Data;
+ Console.WriteLine("#{0:X}{1:X}{2:X} is Activated", color.R, color.G, color.B);
+ }
+ }
+}
--- /dev/null
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+ class GenListTest1 : TestCaseBase
+ {
+ public override string TestName => "GenListTest1";
+ public override string TestDescription => "To test basic operation of GenList";
+
+ public override void Run(Window window)
+ {
+ Conformant conformant = new Conformant(window);
+ conformant.Show();
+ GenList list = new GenList(window)
+ {
+ Homogeneous = true,
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1
+ };
+
+ GenItemClass defaultClass = new GenItemClass("default")
+ {
+ GetTextHandler = (obj, part) =>
+ {
+ return string.Format("{0} - {1}",(string)obj, part);
+ }
+ };
+
+ for (int i = 0; i < 100; i++)
+ {
+ list.Append(defaultClass, string.Format("{0} Item", i));
+ }
+ list.Show();
+ list.ItemSelected += List_ItemSelected; ;
+ conformant.SetContent(list);
+ }
+
+ private void List_ItemSelected(object sender, GenListItemEventArgs e)
+ {
+ Console.WriteLine("{0} Item was selected", (string)(e.Item.Data));
+ }
+ }
+}
--- /dev/null
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+ class GenListTest2 : TestCaseBase
+ {
+ public override string TestName => "GenListTest2";
+ public override string TestDescription => "To test ScrollTo operation of GenList";
+
+ public override void Run(Window window)
+ {
+ Conformant conformant = new Conformant(window);
+ conformant.Show();
+ Box box = new Box(window)
+ {
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1,
+ };
+ box.Show();
+ conformant.SetContent(box);
+
+
+ GenList list = new GenList(window)
+ {
+ Homogeneous = true,
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1
+ };
+
+ GenItemClass defaultClass = new GenItemClass("default")
+ {
+ GetTextHandler = (obj, part) =>
+ {
+ return string.Format("{0} - {1}", (string)obj, part);
+ }
+ };
+ GenListItem[] items = new GenListItem[100];
+ for (int i = 0; i < 100; i++)
+ {
+ items[i] = list.Append(defaultClass, string.Format("{0} Item", i));
+ }
+ list.Show();
+ list.ItemSelected += List_ItemSelected;
+
+ box.PackEnd(list);
+ Button first = new Button(window)
+ {
+ Text = "First",
+ AlignmentX = -1,
+ WeightX = 1,
+ };
+ Button last = new Button(window)
+ {
+ Text = "last",
+ AlignmentX = -1,
+ WeightX = 1,
+ };
+ first.Clicked += (s, e) =>
+ {
+ list.ScrollTo(items[0], ScrollToPosition.In, true);
+ };
+ last.Clicked += (s, e) =>
+ {
+ list.ScrollTo(items[99], ScrollToPosition.In, true);
+ };
+ first.Show();
+ last.Show();
+ box.PackEnd(first);
+ box.PackEnd(last);
+
+ }
+
+ private void List_ItemSelected(object sender, GenListItemEventArgs e)
+ {
+ Console.WriteLine("{0} Item was selected", (string)(e.Item.Data));
+ }
+ }
+}
--- /dev/null
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+ class GenListTest3 : TestCaseBase
+ {
+ public override string TestName => "GenListTest3";
+ public override string TestDescription => "To test group operation of GenList";
+
+ public override void Run(Window window)
+ {
+ Conformant conformant = new Conformant(window);
+ conformant.Show();
+ GenList list = new GenList(window)
+ {
+ Homogeneous = false,
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1
+ };
+
+ GenItemClass groupClass = new GenItemClass("group_index")
+ {
+ GetTextHandler = (obj, part) =>
+ {
+ return string.Format("{0} - {1}", (string)obj, part);
+ }
+ };
+
+ GenListItem[] groups = new GenListItem[10];
+
+ for (int i = 0; i< 10; i++)
+ {
+ groups[i] = list.Append(groupClass, string.Format("{0}", i) , GenListItemType.Group);
+ }
+
+
+ GenItemClass defaultClass = new GenItemClass("default")
+ {
+ GetTextHandler = (obj, part) =>
+ {
+ return string.Format("{0} - {1}", (string)obj, part);
+ },
+ GetContentHandler = (obj, part) =>
+ {
+ Console.WriteLine("{0} - {1}", (string)obj, part);
+ return null;
+ }
+ };
+
+ GenItemClass fullyCustomizeClass = new GenItemClass("full")
+ {
+ GetContentHandler = (obj, part) =>
+ {
+ Console.WriteLine("{0} part create requested", part);
+ var btn = new Button(window) {
+ Text = "Button in List",
+ AlignmentX = -1,
+ WeightX = 1,
+ };
+ return btn;
+ }
+ };
+
+ for (int j = 0; j < 10; j++)
+ {
+ for (int i = 0; i < 20; i++)
+ {
+ list.Append( j == 0 ? fullyCustomizeClass : defaultClass, string.Format("{0} Item", i), GenListItemType.Normal, groups[j]);
+ }
+ }
+
+ list.Show();
+ list.ItemSelected += List_ItemSelected; ;
+ conformant.SetContent(list);
+ }
+
+ private void List_ItemSelected(object sender, GenListItemEventArgs e)
+ {
+ Console.WriteLine("{0} Item was selected", (string)(e.Item.Data));
+ }
+ }
+}
--- /dev/null
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+ class GenListTest4 : TestCaseBase
+ {
+ public override string TestName => "GenListTest4";
+ public override string TestDescription => "To test Append/Prepend/InsertBefore operation of GenList";
+
+ public override void Run(Window window)
+ {
+ Conformant conformant = new Conformant(window);
+ conformant.Show();
+ GenList list = new GenList(window)
+ {
+ Homogeneous = true,
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1
+ };
+
+ GenItemClass defaultClass = new GenItemClass("default")
+ {
+ GetTextHandler = (obj, part) =>
+ {
+ return string.Format("{0} - {1}", (string)obj, part);
+ }
+ };
+
+ GenListItem[] items = new GenListItem[100];
+ for (int i = 0; i < 100; i++)
+ {
+ if (i < 30)
+ {
+ items[i] = list.Append(defaultClass, string.Format("{0} Item", i));
+ }
+ else if (i < 60)
+ {
+ items[i] = list.Prepend(defaultClass, string.Format("{0} Item", i));
+ }else
+ {
+ items[i] = list.InsertBefore(defaultClass, string.Format("{0} Item", i), items[50]);
+ }
+ }
+ list.Show();
+ list.ItemSelected += List_ItemSelected; ;
+ conformant.SetContent(list);
+ }
+
+ private void List_ItemSelected(object sender, GenListItemEventArgs e)
+ {
+ Console.WriteLine("{0} Item was selected", (string)(e.Item.Data));
+ }
+ }
+}
--- /dev/null
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+ public class GenListTest5 : TestCaseBase
+ {
+ public override string TestName => "GenListTest5";
+ public override string TestDescription => "To test event operation of GenList";
+
+ public override void Run(Window window)
+ {
+ Conformant conformant = new Conformant(window);
+ conformant.Show();
+ GenList list = new GenList(window)
+ {
+ Homogeneous = true,
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1
+ };
+
+ GenItemClass defaultClass = new GenItemClass("default")
+ {
+ GetTextHandler = (obj, part) =>
+ {
+ return string.Format("{0} - {1}", (string)obj, part);
+ }
+ };
+
+ for (int i = 0; i < 100; i++)
+ {
+ list.Append(defaultClass, string.Format("{0} Item", i));
+ }
+ list.Show();
+ list.ItemSelected += List_ItemSelected; ;
+ list.ItemActivated += List_ItemActivated;
+ list.ItemUnselected += List_ItemUnselected;
+ list.ItemPressed += List_ItemPressed;
+ list.ItemRealized += List_ItemRealized;
+ list.ItemReleased += List_ItemReleased;
+ list.ItemUnrealized += List_ItemUnrealized;
+ list.ItemLongPressed += List_ItemLongPressed;
+ list.ItemDoubleClicked += List_ItemDoubleClicked;
+ conformant.SetContent(list);
+ }
+
+ private void List_ItemDoubleClicked(object sender, GenListItemEventArgs e)
+ {
+ Console.WriteLine("{0} Item was double clicked", (string)(e.Item.Data));
+ }
+
+ private void List_ItemLongPressed(object sender, GenListItemEventArgs e)
+ {
+ Console.WriteLine("{0} Item was Long pressed", (string)(e.Item.Data));
+ }
+
+ private void List_ItemUnrealized(object sender, GenListItemEventArgs e)
+ {
+ Console.WriteLine("{0} Item was unrealzed", (string)(e.Item.Data));
+ }
+
+ private void List_ItemReleased(object sender, GenListItemEventArgs e)
+ {
+ Console.WriteLine("{0} Item was released", (string)(e.Item.Data));
+ }
+
+ private void List_ItemRealized(object sender, GenListItemEventArgs e)
+ {
+ Console.WriteLine("{0} Item was Realized", (string)(e.Item.Data));
+ }
+
+ private void List_ItemPressed(object sender, GenListItemEventArgs e)
+ {
+ Console.WriteLine("{0} Item was Pressed", (string)(e.Item.Data));
+ }
+
+ private void List_ItemUnselected(object sender, GenListItemEventArgs e)
+ {
+ Console.WriteLine("{0} Item was unselected", (string)(e.Item.Data));
+ }
+
+ private void List_ItemActivated(object sender, GenListItemEventArgs e)
+ {
+ Console.WriteLine("{0} Item was Activated", (string)(e.Item.Data));
+ }
+
+ private void List_ItemSelected(object sender, GenListItemEventArgs e)
+ {
+ Console.WriteLine("{0} Item was selected", (string)(e.Item.Data));
+ }
+ }
+}
--- /dev/null
+using System;
+using ElmSharp;
+using System.Collections.Generic;
+
+namespace ElmSharp.Test
+{
+ public class IconTest1 : TestCaseBase
+ {
+ public override string TestName => "IconTest1";
+ public override string TestDescription => "To test basic operation of Icon";
+
+ public override void Run(Window window)
+ {
+ Background bg = new Background(window)
+ {
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1,
+ Color = Color.White
+ };
+ bg.Show();
+ window.AddResizeObject(bg);
+
+ Conformant conformant = new Conformant(window);
+ conformant.Show();
+ Scroller scroller = new Scroller(window);
+ scroller.Show();
+ conformant.SetContent(scroller);
+ Box box = new Box(window);
+ box.Show();
+ scroller.SetContent(box);
+
+ List<string> iconList = new List<string>{ "home", "close", "apps", "arrow_up", "arrow_down", "arrow_left", "arrow_right", "chat", "clock", "delete", "edit", "refresh", "folder", "file",
+ "menu/home", "menu/close", "menu/apps", "menu/arrow_up", "menu/arrow_down", "menu/arrow_left", "menu/arrow_right", "menu/chat", "menu/clock", "menu/delete", "menu/edit", "menu/refresh", "menu/folder",
+ "menu/file", "media_player/forward", "media_player/info", "media_player/next", "media_player/pause", "media_player/play", "media_player/prev", "media_player/rewind", "media_player/stop"};
+
+ foreach (var iconName in iconList)
+ {
+ Label label = new Label(window)
+ {
+ Text = iconName,
+ };
+ Icon icon = new Icon(window)
+ {
+ IconLookupOrder = IconLookupOrder.ThemeFirst,
+ StandardIconName = iconName,
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1,
+ MinimumHeight = 100,
+ MinimumWidth = 100,
+ };
+ icon.Show();
+ label.Show();
+ box.PackEnd(icon);
+ box.PackEnd(label);
+ }
+
+
+ }
+ }
+}
--- /dev/null
+using System;
+using ElmSharp;
+using System.Collections.Generic;
+
+namespace ElmSharp.Test
+{
+ class IndexTest1 : TestCaseBase
+ {
+ Dictionary<IndexItem, GenListItem> _indexTable = new Dictionary<IndexItem, GenListItem>();
+ public override string TestName => "IndexTest1";
+ public override string TestDescription => "To test group operation of Index";
+ public override void Run(Window window)
+ {
+ Conformant conformant = new Conformant(window);
+ conformant.Show();
+ Box box = new Box(window)
+ {
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1,
+ IsHorizontal = true,
+ };
+ box.Show();
+ GenList list = new GenList(window)
+ {
+ Homogeneous = false,
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1
+ };
+ list.Show();
+ Index index = new Index(window)
+ {
+ IsHorizontal = false,
+ AlignmentY = -1,
+ WeightY = 1,
+ MinimumWidth = 100,
+ AutoHide = false,
+ Style = "fastscroll"
+ };
+ index.Show();
+
+ GenItemClass groupClass = new GenItemClass("group_index")
+ {
+ GetTextHandler = (obj, part) =>
+ {
+ return string.Format("{0} - {1}", (string)obj, part);
+ }
+ };
+
+ GenListItem[] groups = new GenListItem[10];
+
+ for (int i = 0; i < 10; i++)
+ {
+ groups[i] = list.Append(groupClass, string.Format("{0}", i), GenListItemType.Group);
+ var indexitem = index.Append(string.Format("{0}", i));
+ indexitem.Selected += (s, e) =>
+ {
+ Console.WriteLine("Index selected : {0}", ((IndexItem)s).Text);
+ list.ScrollTo(_indexTable[(IndexItem)s], ScrollToPosition.In, true);
+ };
+ _indexTable[indexitem] = groups[i];
+ }
+
+ GenItemClass defaultClass = new GenItemClass("default")
+ {
+ GetTextHandler = (obj, part) =>
+ {
+ return string.Format("{0} - {1}", (string)obj, part);
+ }
+ };
+
+ for (int j = 0; j < 10; j++)
+ {
+ for (int i = 0; i < 20; i++)
+ {
+ list.Append(defaultClass, string.Format("{0} Item", i), GenListItemType.Normal, groups[j]);
+ }
+ }
+
+ list.ItemSelected += List_ItemSelected;
+ index.Update(0);
+ box.PackEnd(list);
+ box.PackEnd(index);
+ conformant.SetContent(box);
+ }
+
+ private void List_ItemSelected(object sender, GenListItemEventArgs e)
+ {
+ Console.WriteLine("{0} Item was selected", (string)(e.Item.Data));
+ }
+ }
+}
--- /dev/null
+using System;
+using ElmSharp;
+using System.Collections.Generic;
+
+namespace ElmSharp.Test
+{
+ public class IndexTest2 : TestCaseBase
+ {
+ Dictionary<IndexItem, int> _indexTable = new Dictionary<IndexItem, int>();
+
+ public override string TestName => "IndexTest2";
+ public override string TestDescription => "To test basic operation of Index";
+ public override void Run(Window window)
+ {
+ Conformant conformant = new Conformant(window);
+ conformant.Show();
+ Box outterBox = new Box(window)
+ {
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1,
+ IsHorizontal = false,
+ };
+ outterBox.Show();
+ Scroller scroller = new Scroller(window)
+ {
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1,
+ ScrollBlock = ScrollBlock.Vertical,
+ HorizontalPageScrollLimit = 1,
+ };
+ scroller.SetPageSize(1.0, 1.0);
+ scroller.Show();
+
+ Box box = new Box(window)
+ {
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1,
+ IsHorizontal = true,
+ };
+ box.Show();
+ scroller.SetContent(box);
+
+ Index index = new Index(window)
+ {
+ IsHorizontal = true,
+ Style = "pagecontrol",
+ AlignmentX = -1,
+ WeightX = 1,
+ MinimumHeight = 200,
+ };
+ index.Show();
+
+ var rnd = new Random();
+ for (int i = 0; i < 10; i++)
+ {
+ int r = rnd.Next(255);
+ int g = rnd.Next(255);
+ int b = rnd.Next(255);
+ Color color = Color.FromRgb(r, g, b);
+ Rectangle colorBox = new Rectangle(window)
+ {
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1,
+ Color = color,
+ MinimumWidth = window.ScreenSize.Width,
+ };
+ colorBox.Show();
+ Console.WriteLine("Height = {0}", colorBox.Geometry.Height);
+ box.PackEnd(colorBox);
+ var item = index.Append(string.Format("{0}", i));
+ item.Selected += (s, e) =>
+ {
+ scroller.ScrollTo(_indexTable[(IndexItem)s], 0, true);
+ };
+ _indexTable[item] = i;
+ }
+
+ conformant.SetContent(outterBox);
+ outterBox.PackEnd(scroller);
+
+ Button prev = new Button(window)
+ {
+ AlignmentX = -1,
+ WeightX = 1,
+ Text = "Prev"
+ };
+ Button next = new Button(window)
+ {
+ AlignmentX = -1,
+ WeightX = 1,
+ Text = "next"
+ };
+ prev.Clicked += (s, e) =>
+ {
+ scroller.ScrollTo(scroller.HorizontalPageIndex > 0 ? scroller.HorizontalPageIndex - 1 : 0, scroller.VerticalPageIndex, true);
+ };
+ next.Clicked += (s, e) =>
+ {
+ scroller.ScrollTo(scroller.HorizontalPageIndex + 1, scroller.VerticalPageIndex, true);
+ };
+ prev.Show();
+ next.Show();
+ outterBox.PackEnd(prev);
+ outterBox.PackEnd(next);
+ outterBox.PackEnd(index);
+
+ scroller.DragStart += Scroller_DragStart;
+ scroller.DragStop += Scroller_DragStop;
+ }
+
+ private void Scroller_DragStop(object sender, EventArgs e)
+ {
+ Console.WriteLine("Drag stop");
+ }
+
+ private void Scroller_DragStart(object sender, EventArgs e)
+ {
+ Console.WriteLine("Drag start");
+ }
+ }
+}
--- /dev/null
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+ class LabelTest1 : TestCaseBase
+ {
+ public override string TestName => "LabelTest1";
+ public override string TestDescription => "To test basic operation of Label";
+
+ public override void Run(Window window)
+ {
+ Background bg = new Background(window);
+ bg.Color = Color.White;
+ bg.Move(0, 0);
+ bg.Resize(window.ScreenSize.Width, window.ScreenSize.Height);
+ bg.Show();
+
+ Label label1 = new Label(window);
+ label1.Text = "Label Test!!!";
+
+ label1.Show();
+ label1.Resize(200, 30);
+ label1.Move(0, 0);
+ }
+
+ }
+}
--- /dev/null
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+ public class ListTest1 : TestCaseBase
+ {
+ public override string TestName => "ListTest1";
+ public override string TestDescription => "To test basic operation of List";
+ private int _count = 0;
+ public override void Run(Window window)
+ {
+ Conformant conformant = new Conformant(window);
+ conformant.Show();
+ Box box = new Box(window)
+ {
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1,
+ };
+ box.Show();
+ conformant.SetContent(box);
+
+ List list = new List(window)
+ {
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1
+ };
+
+ for (int i = 0; i < 5; i++)
+ {
+ list.Append(string.Format("{0} item", _count++));
+ }
+
+ list.ItemSelected += List_Selected;
+ list.ItemUnselected += List_Unselected;
+ list.ItemActivated += List_ItemActivated;
+ list.ItemDoubleClicked += List_ItemDoubleClicked;
+ list.ItemLongPressed += List_ItemLongPressed;
+ list.Update();
+ list.Show();
+
+ box.PackEnd(list);
+ Button append = new Button(window)
+ {
+ Text = "Append",
+ AlignmentX = -1,
+ WeightX = 1,
+ };
+ Button prepend = new Button(window)
+ {
+ Text = "Prepend",
+ AlignmentX = -1,
+ WeightX = 1,
+ };
+ append.Clicked += (s, e) =>
+ {
+ list.Append(string.Format("{0} item", _count++));
+ list.Update();
+ };
+ prepend.Clicked += (s, e) =>
+ {
+ list.Prepend(string.Format("{0} item", _count++));
+ list.Update();
+ };
+ append.Show();
+ prepend.Show();
+ box.PackEnd(append);
+ box.PackEnd(prepend);
+ }
+
+ private void List_ItemLongPressed(object sender, ListItemEventArgs e)
+ {
+ Console.WriteLine("{0} item was long pressed", e.Item.Text);
+ }
+
+ private void List_ItemDoubleClicked(object sender, ListItemEventArgs e)
+ {
+ Console.WriteLine("{0} item was Double clicked", e.Item.Text);
+ }
+
+ private void List_ItemActivated(object sender, ListItemEventArgs e)
+ {
+ Console.WriteLine("{0} item was Activated", e.Item.Text);
+ }
+
+ private void List_Unselected(object sender, ListItemEventArgs e)
+ {
+ Console.WriteLine("{0} item was unselected", e.Item.Text);
+ }
+
+ private void List_Selected(object sender, ListItemEventArgs e)
+ {
+ Console.WriteLine("{0} item was selected", e.Item.Text);
+ }
+ }
+}
--- /dev/null
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+ class NaviframeTest1 : TestCaseBase
+ {
+ public override string TestName => "NaviframeTest1";
+ public override string TestDescription => "Naviframe test";
+
+ public override void Run(Window window)
+ {
+ Conformant conformant = new Conformant(window);
+ conformant.Show();
+
+ Naviframe navi = new Naviframe(window)
+ {
+ PreserveContentOnPop = true,
+ DefaultBackButtonEnabled = true
+ };
+
+ navi.Popped += (s, e) =>
+ {
+ Console.WriteLine("naviframe was popped : " + e.Content.GetType());
+ };
+
+ Rectangle rect1 = new Rectangle(window)
+ {
+ Color = Color.Red,
+ Geometry = new Rect(0, 0, 200, 200)
+ };
+
+ navi.Push(rect1, "First Page");
+
+ Rectangle rect2 = new Rectangle(window)
+ {
+ Color = Color.Blue,
+ Geometry = new Rect(0, 0, 200, 200)
+ };
+
+ navi.Push(rect2, "Second Page");
+ navi.Show();
+ conformant.SetContent(navi);
+ }
+ }
+}
--- /dev/null
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+ public class PanelTest1 : TestCaseBase
+ {
+ public override string TestName => "PanelTest1";
+ public override string TestDescription => "To test basic operation of Panel";
+
+ public override void Run(Window window)
+ {
+ Conformant conformant = new Conformant(window);
+ conformant.Show();
+ Box box = new Box(window);
+ conformant.SetContent(box);
+ box.Show();
+
+ Label label = new Label(window)
+ {
+ Text = "<span color=#ffffff font_size=50>Panel as NonScrollable</span>",
+ AlignmentX = -1,
+ WeightX = 1,
+ };
+ label.Show();
+ box.PackEnd(label);
+
+ Panel panel = new Panel(window)
+ {
+ Direction = PanelDirection.Left,
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1,
+ };
+ panel.SetScrollable(false);
+
+ Rectangle redbox = new Rectangle(window)
+ {
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1,
+ Color = Color.Red,
+ };
+ redbox.Show();
+ panel.SetContent(redbox);
+ panel.Show();
+ panel.IsOpen = true;
+ box.PackEnd(panel);
+
+ Button button1 = new Button(window)
+ {
+ Text = "Toggle open",
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ };
+ Button button2 = new Button(window)
+ {
+ Text = "Toggle direction",
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ };
+ box.PackEnd(button1);
+ box.PackEnd(button2);
+ button1.Show();
+ button2.Show();
+
+ button1.Clicked += (s, e) =>
+ {
+ panel.Toggle();
+ };
+ button2.Clicked += (s, e) =>
+ {
+ panel.Direction = (PanelDirection)((int)(panel.Direction+1) % 4);
+ };
+ }
+
+ }
+}
--- /dev/null
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+ public class PanelTest2 : TestCaseBase
+ {
+ public override string TestName => "PanelTest2";
+ public override string TestDescription => "To test basic operation of Panel";
+
+ public override void Run(Window window)
+ {
+ Conformant conformant = new Conformant(window);
+ conformant.Show();
+ Box box = new Box(window);
+ conformant.SetContent(box);
+ box.Show();
+
+ Label label = new Label(window)
+ {
+ Text = "<span color=#ffffff font_size=50>Panel as Scrollable</span>",
+ AlignmentX = -1,
+ WeightX = 1,
+ };
+ label.Show();
+ box.PackEnd(label);
+
+ Panel panel = new Panel(window)
+ {
+ Direction = PanelDirection.Left,
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1,
+ };
+ panel.SetScrollable(true);
+ panel.SetScrollableArea(1.0);
+
+ Rectangle redbox = new Rectangle(window)
+ {
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1,
+ Color = Color.Red,
+ };
+ redbox.Show();
+ panel.SetContent(redbox);
+ panel.Show();
+ panel.IsOpen = true;
+ box.PackEnd(panel);
+
+ Button button1 = new Button(window)
+ {
+ Text = "Toggle open",
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ };
+ Button button2 = new Button(window)
+ {
+ Text = "Toggle direction",
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ };
+ box.PackEnd(button1);
+ box.PackEnd(button2);
+ button1.Show();
+ button2.Show();
+
+ button1.Clicked += (s, e) =>
+ {
+ panel.Toggle();
+ };
+ button2.Clicked += (s, e) =>
+ {
+ panel.Direction = (PanelDirection)((int)(panel.Direction + 1) % 4);
+ };
+ }
+
+ }
+}
--- /dev/null
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+ public class PanesTest1 : TestCaseBase
+ {
+ public override string TestName => "PanesTest1";
+ public override string TestDescription => "To test basic operation of Panes";
+
+ public override void Run(Window window)
+ {
+ Conformant conformant = new Conformant(window);
+ conformant.Show();
+ Box box = new Box(window);
+ conformant.SetContent(box);
+ box.Show();
+
+ Rectangle redBox = new Rectangle(window)
+ {
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1,
+ Color = Color.Red,
+ };
+ redBox.Show();
+ Rectangle blueBox = new Rectangle(window)
+ {
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1,
+ Color = Color.Blue,
+ };
+ Rectangle greenBox = new Rectangle(window)
+ {
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1,
+ Color = Color.Green,
+ };
+ Panes subPanes = new Panes(window)
+ {
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1,
+ Proportion = 0.3,
+ IsHorizontal = false
+ };
+ subPanes.Show();
+ subPanes.SetPartContent("left", blueBox);
+ subPanes.SetPartContent("right", greenBox);
+ Panes panes = new Panes(window)
+ {
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1,
+ Proportion = 0.1,
+ IsFixed = true,
+ IsHorizontal = true,
+ };
+ panes.SetPartContent("left", redBox);
+ panes.SetPartContent("right", subPanes);
+ panes.Show();
+ box.PackEnd(panes);
+ }
+
+ }
+}
--- /dev/null
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+ public class PopupTest1 : TestCaseBase
+ {
+ public override string TestName => "PopupTest1";
+ public override string TestDescription => "To test basic operation of Popup";
+
+ public override void Run(Window window)
+ {
+ Conformant conformant = new Conformant(window);
+ conformant.Show();
+ Box box = new Box(window);
+ box.Show();
+ Button btn = new Button(window)
+ {
+ AlignmentX = -1,
+ WeightX = 1,
+ Text = "Open"
+ };
+ btn.Show();
+
+ Popup popup = new Popup(window)
+ {
+ Orientation = PopupOrientation.Bottom,
+ Timeout = 5,
+ };
+
+ popup.Dismissed += (s, e) =>
+ {
+ Console.WriteLine("Popup dismissed");
+ };
+
+ popup.ShowAnimationFinished += (s, e) =>
+ {
+ Console.WriteLine("Popup show animation finished");
+ };
+
+ popup.OutsideClicked += (s, e) =>
+ {
+ Console.WriteLine("Popup outside clicked");
+ };
+
+ popup.TimedOut += (s, e) =>
+ {
+ Console.WriteLine("Popup time out");
+ popup.Show();
+ };
+
+ popup.Append("Label1");
+ popup.Append("Label2");
+ popup.Append("Label3");
+
+ btn.Clicked += (s, e) =>
+ {
+ popup.Show();
+ };
+
+ Button close = new Button(popup)
+ {
+ AlignmentX = -1,
+ WeightX = 1,
+ Text = "Close"
+ };
+ popup.SetPartContent("button1", close);
+
+ close.Clicked += (s, e) =>
+ {
+ popup.Hide();
+ };
+
+ box.PackEnd(btn);
+ conformant.SetContent(box);
+ }
+ }
+}
--- /dev/null
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ElmSharp.Test
+{
+ class ProgressBarTest1 : TestCaseBase
+ {
+ public override string TestName => "ProgressBarTest1";
+ public override string TestDescription => "To test basic operation of ProgressBar";
+
+ public override void Run(Window window)
+ {
+ Conformant conformant = new Conformant(window);
+ conformant.Show();
+ Table table = new Table(window);
+ conformant.SetContent(table);
+ table.Show();
+
+ ProgressBar pb1 = new ProgressBar(window)
+ {
+ Text = "ProgressBar Test",
+ UnitFormat = "%.0f %%",
+ Value = 0.1,
+ AlignmentX = -1,
+ AlignmentY = 0,
+ WeightX = 1,
+ WeightY = 1
+ };
+
+ Label lb1 = new Label(window)
+ {
+ AlignmentX = -1,
+ AlignmentY = 0,
+ WeightX = 1,
+ WeightY = 1
+ };
+
+ Button bt1 = new Button(window)
+ {
+ Text = "Increase",
+ AlignmentX = -1,
+ AlignmentY = 0,
+ WeightX = 1,
+ WeightY = 1
+ };
+
+ Button bt2 = new Button(window)
+ {
+ Text = "Decrease",
+ AlignmentX = -1,
+ AlignmentY = 0,
+ WeightX = 1,
+ WeightY = 1
+ };
+
+ table.Pack(pb1, 1, 1, 2, 1);
+ table.Pack(lb1, 1, 2, 2, 1);
+ table.Pack(bt1, 1, 3, 1, 1);
+ table.Pack(bt2, 2, 3, 1, 1);
+
+ pb1.Show();
+ lb1.Show();
+ bt1.Show();
+ bt2.Show();
+
+ bt1.Clicked += (s, e) =>
+ {
+ pb1.Value += 0.1;
+ };
+
+ bt2.Clicked += (s, e) =>
+ {
+ pb1.Value -= 0.1;
+ };
+
+ pb1.ValueChanged += (s, e) =>
+ {
+ lb1.Text = string.Format("Value Changed: {0}", pb1.Value);
+ lb1.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'";
+ };
+ }
+ }
+}
--- /dev/null
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ElmSharp.Test
+{
+ class RadioTest1 : TestCaseBase
+ {
+ public override string TestName => "RadioTest1";
+ public override string TestDescription => "To test basic operation of Radio";
+
+ Label _lb1;
+
+ public override void Run(Window window)
+ {
+ Conformant conformant = new Conformant(window);
+ conformant.Show();
+ Box box = new Box(window);
+ conformant.SetContent(box);
+ box.Show();
+
+ Radio rd1 = new Radio(window)
+ {
+ StateValue = 1,
+ Text = "<span color=#ffffff>Value #1</span>",
+ AlignmentX = -1,
+ AlignmentY = 0,
+ WeightX = 1,
+ WeightY = 1
+ };
+ Radio rd2 = new Radio(window)
+ {
+ StateValue = 2,
+ Text = "<span color=#ffffff>Value #2</span>",
+ AlignmentX = -1,
+ AlignmentY = 0,
+ WeightX = 1,
+ WeightY = 1
+ };
+ Radio rd3 = new Radio(window)
+ {
+ StateValue = 3,
+ Text = "<span color=#ffffff>Value #3</span>",
+ AlignmentX = -1,
+ AlignmentY = 0,
+ WeightX = 1,
+ WeightY = 1
+ };
+ rd2.SetGroup(rd1);
+ rd3.SetGroup(rd2);
+
+ rd1.ValueChanged += OnRadioValueChanged;
+ rd2.ValueChanged += OnRadioValueChanged;
+ rd3.ValueChanged += OnRadioValueChanged;
+
+ _lb1 = new Label(window)
+ {
+ AlignmentX = -1,
+ AlignmentY = 0,
+ WeightX = 1,
+ WeightY = 1
+ };
+
+ box.PackEnd(_lb1);
+ box.PackEnd(rd1);
+ box.PackEnd(rd2);
+ box.PackEnd(rd3);
+
+ _lb1.Show();
+ rd1.Show();
+ rd2.Show();
+ rd3.Show();
+ }
+
+ void OnRadioValueChanged(object sender, EventArgs e)
+ {
+ _lb1.Text = string.Format("Value Changed: {0}", ((Radio)sender).GroupValue);
+ _lb1.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'";
+ }
+ }
+}
--- /dev/null
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+ class RectangleTest1 : TestCaseBase
+ {
+ public override string TestName => "RectangleTest1";
+ public override string TestDescription => "Add one Red Rectangle and one Orange Rectangle";
+
+ public override void Run(Window window)
+ {
+ Rectangle box1 = new Rectangle(window)
+ {
+ Color = Color.Red
+ };
+ box1.Show();
+ box1.Resize(100, 100);
+ box1.Move(0, 0);
+ Rectangle box2 = new Rectangle(window)
+ {
+ Color = Color.Orange
+ };
+ box2.Show();
+ box2.Resize(100, 100);
+ box2.Move(100, 100);
+ }
+ }
+}
--- /dev/null
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+ public class ScrollerTest1 : TestCaseBase
+ {
+ public override string TestName => "ScrollerTest1";
+ public override string TestDescription => "To test basic operation of Scroller";
+
+ public override void Run(Window window)
+ {
+ Conformant conformant = new Conformant(window);
+ conformant.Show();
+ Scroller scroller = new Scroller(window)
+ {
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1,
+ ScrollBlock = ScrollBlock.None,
+ };
+ scroller.Show();
+ conformant.SetContent(scroller);
+
+ Box box = new Box(window)
+ {
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1
+ };
+ box.Show();
+ scroller.SetContent(box);
+
+ var rnd = new Random();
+ for (int i = 0; i < 102; i++)
+ {
+ int r = rnd.Next(255);
+ int g = rnd.Next(255);
+ int b = rnd.Next(255);
+ Color color = Color.FromRgb(r, g, b);
+ Rectangle colorBox = new Rectangle(window)
+ {
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1,
+ Color = color,
+ MinimumHeight = 400,
+ };
+ colorBox.Show();
+ Console.WriteLine("Height = {0}", colorBox.Geometry.Height);
+ box.PackEnd(colorBox);
+ }
+ scroller.Scrolled += Scroller_Scrolled;
+ }
+
+ private void Scroller_Scrolled(object sender, EventArgs e)
+ {
+ Console.WriteLine("Scrolled : {0}x{1}", ((Scroller)sender).CurrentRegion.X, ((Scroller)sender).CurrentRegion.Y);
+ }
+ }
+}
--- /dev/null
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+ public class ScrollerTest2 : TestCaseBase
+ {
+ public override string TestName => "ScrollerTest2";
+ public override string TestDescription => "To test basic operation of Scroller";
+
+ public override void Run(Window window)
+ {
+ Conformant conformant = new Conformant(window);
+ conformant.Show();
+ Box outterBox = new Box(window)
+ {
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1,
+ IsHorizontal = false,
+ };
+ outterBox.Show();
+ Scroller scroller = new Scroller(window)
+ {
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1,
+ ScrollBlock = ScrollBlock.Vertical,
+ HorizontalPageScrollLimit = 1,
+ };
+ scroller.SetPageSize(1.0, 1.0);
+ scroller.Show();
+
+ Box box = new Box(window)
+ {
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1,
+ IsHorizontal = true,
+ };
+ box.Show();
+ scroller.SetContent(box);
+
+ var rnd = new Random();
+ for (int i = 0; i < 102; i++)
+ {
+ int r = rnd.Next(255);
+ int g = rnd.Next(255);
+ int b = rnd.Next(255);
+ Color color = Color.FromRgb(r, g, b);
+ Rectangle colorBox = new Rectangle(window)
+ {
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1,
+ Color = color,
+ MinimumWidth = window.ScreenSize.Width,
+ };
+ colorBox.Show();
+ Console.WriteLine("Height = {0}", colorBox.Geometry.Height);
+ box.PackEnd(colorBox);
+ }
+
+ conformant.SetContent(outterBox);
+ outterBox.PackEnd(scroller);
+
+ Button prev = new Button(window)
+ {
+ AlignmentX = -1,
+ WeightX = 1,
+ Text = "Prev"
+ };
+ Button next = new Button(window)
+ {
+ AlignmentX = -1,
+ WeightX = 1,
+ Text = "next"
+ };
+ prev.Clicked += (s, e) =>
+ {
+ scroller.ScrollTo(scroller.HorizontalPageIndex > 0 ? scroller.HorizontalPageIndex - 1: 0, scroller.VerticalPageIndex, true);
+ };
+ next.Clicked += (s, e) =>
+ {
+ scroller.ScrollTo(scroller.HorizontalPageIndex + 1, scroller.VerticalPageIndex, true);
+ };
+ prev.Show();
+ next.Show();
+ outterBox.PackEnd(prev);
+ outterBox.PackEnd(next);
+
+ scroller.DragStart += Scroller_DragStart;
+ scroller.DragStop += Scroller_DragStop;
+ }
+
+ private void Scroller_DragStop(object sender, EventArgs e)
+ {
+ Console.WriteLine("Drag stop");
+ }
+
+ private void Scroller_DragStart(object sender, EventArgs e)
+ {
+ Console.WriteLine("Drag start");
+ }
+ }
+}
--- /dev/null
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ElmSharp.Test
+{
+ class SliderTest1 : TestCaseBase
+ {
+ public override string TestName => "SliderTest1";
+ public override string TestDescription => "To test basic operation of Slider";
+
+ public override void Run(Window window)
+ {
+ Conformant conformant = new Conformant(window);
+ conformant.Show();
+ Table table = new Table(window);
+ conformant.SetContent(table);
+ table.Show();
+
+ Slider sld1 = new Slider(window)
+ {
+ Text = "Slider Test",
+ UnitFormat = "%1.2f meters",
+ IndicatorFormat = "%1.2f meters",
+ Minimum = 0.0,
+ Maximum = 100.0,
+ Value = 0.1,
+ AlignmentX = -1,
+ AlignmentY = 0.5,
+ WeightX = 1,
+ WeightY = 1
+ };
+
+ Label lb1 = new Label(window)
+ {
+ AlignmentX = -1,
+ AlignmentY = 0,
+ WeightX = 1,
+ WeightY = 1
+ };
+
+ table.Pack(sld1, 1, 1, 2, 1);
+ table.Pack(lb1, 1, 2, 2, 1);
+
+ sld1.Show();
+ lb1.Show();
+
+ sld1.ValueChanged += (s, e) =>
+ {
+ lb1.Text = string.Format("Value Changed: {0}", sld1.Value);
+ lb1.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'";
+ };
+ }
+ }
+}
--- /dev/null
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ElmSharp.Test
+{
+ class SpinnerTest1 : TestCaseBase
+ {
+ public override string TestName => "SpinnerTest1";
+ public override string TestDescription => "To test basic operation of Spinner";
+
+ public override void Run(Window window)
+ {
+ Conformant conformant = new Conformant(window);
+ conformant.Show();
+ Table table = new Table(window);
+ conformant.SetContent(table);
+ table.Show();
+
+ Spinner spn1 = new Spinner(window)
+ {
+ Text = "Slider Test",
+ LabelFormat = "%1.2f Value",
+ Minimum = 1,
+ Maximum = 12,
+ Value = 1.5,
+ Step = 0.5,
+ Interval = 0.5,
+ AlignmentX = -1,
+ AlignmentY = 0.5,
+ WeightX = 1,
+ WeightY = 1
+ };
+ spn1.AddSpecialValue(5, "Five !!!!");
+
+ Label lb1 = new Label(window)
+ {
+ AlignmentX = -1,
+ AlignmentY = 0,
+ WeightX = 1,
+ WeightY = 1
+ };
+
+ table.Pack(spn1, 1, 1, 2, 1);
+ table.Pack(lb1, 1, 2, 2, 1);
+
+ spn1.Show();
+ lb1.Show();
+
+ spn1.ValueChanged += (s, e) =>
+ {
+ lb1.Text = string.Format("Value Changed: {0}", spn1.Value);
+ lb1.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'";
+ };
+ }
+ }
+}
--- /dev/null
+using System;
+using ElmSharp;
+using System.Collections.Generic;
+
+namespace ElmSharp.Test
+{
+ public class ToolbarTest1 : TestCaseBase
+ {
+ Dictionary<ToolbarItem, int> _itemTable = new Dictionary<ToolbarItem, int>();
+ Dictionary<int, ToolbarItem> _reverseItemTable = new Dictionary<int, ToolbarItem>();
+ int currentItemIndex = 0;
+ public override string TestName => "ToolbarTest1";
+ public override string TestDescription => "To test basic operation of Toolbar";
+ public override void Run(Window window)
+ {
+ Conformant conformant = new Conformant(window);
+ conformant.Show();
+ Box outterBox = new Box(window)
+ {
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1,
+ IsHorizontal = false,
+ };
+ outterBox.Show();
+
+ Toolbar toolbar = new Toolbar(window)
+ {
+ AlignmentX = -1,
+ WeightX = 1,
+ ShrinkMode = ToolbarShrinkMode.Scroll
+ };
+
+ toolbar.Show();
+ outterBox.PackEnd(toolbar);
+
+
+ Scroller scroller = new Scroller(window)
+ {
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1,
+ ScrollBlock = ScrollBlock.Vertical,
+ HorizontalPageScrollLimit = 1,
+ };
+ scroller.SetPageSize(1.0, 1.0);
+ scroller.Show();
+
+ Box box = new Box(window)
+ {
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1,
+ IsHorizontal = true,
+ };
+ box.Show();
+ scroller.SetContent(box);
+
+ var rnd = new Random();
+ for (int i = 0; i < 5; i++)
+ {
+ int r = rnd.Next(255);
+ int g = rnd.Next(255);
+ int b = rnd.Next(255);
+ Color color = Color.FromRgb(r, g, b);
+ Rectangle colorBox = new Rectangle(window)
+ {
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1,
+ Color = color,
+ MinimumWidth = window.ScreenSize.Width,
+ };
+ colorBox.Show();
+ box.PackEnd(colorBox);
+ ToolbarItem item = toolbar.Append(string.Format("{0} Item", i), "home");
+ _itemTable[item] = i;
+ _reverseItemTable[i] = item;
+ item.Selected += (s, e) =>
+ {
+ scroller.ScrollTo(_itemTable[(ToolbarItem)s], 0, true);
+ };
+ }
+ scroller.Scrolled += (s, e) =>
+ {
+ if (scroller.HorizontalPageIndex != currentItemIndex)
+ {
+ currentItemIndex = scroller.HorizontalPageIndex;
+ _reverseItemTable[currentItemIndex].IsSelected = true;
+ }
+ };
+ conformant.SetContent(outterBox);
+ outterBox.PackEnd(scroller);
+ }
+ }
+}
--- /dev/null
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+ public abstract class TestCaseBase
+ {
+ public abstract string TestName { get; }
+ public abstract string TestDescription { get; }
+ public abstract void Run(Window window);
+ }
+}
--- /dev/null
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+using System.Linq;
+using System.Reflection;
+using System.Collections.Generic;
+
+namespace ElmSharp.Test
+{
+ public class TestRunner
+ {
+ public TestRunner()
+ {
+ }
+
+ public void Run(string[] args)
+ {
+ Elementary.Initialize();
+
+ EcoreSynchronizationContext.Initialize();
+
+ Window window = new Window("TestWindow");
+ window.Show();
+ window.KeyGrab(EvasKeyEventArgs.PlatformBackButtonName, false);
+ window.KeyUp += (s, e) =>
+ {
+ if (e.KeyName == EvasKeyEventArgs.PlatformBackButtonName)
+ {
+ EcoreMainloop.Quit();
+ }
+ };
+
+ var testCases = GetTestCases();
+ TestCaseBase theTest = null;
+
+ if (args.Count() > 0)
+ {
+ theTest = testCases.Where((testCase) => testCase.TestName == args[0] || testCase.GetType().ToString() == args[0]).FirstOrDefault();
+ }
+
+ if (theTest != null)
+ {
+ theTest.Run(window);
+ EcoreMainloop.Begin();
+ } else
+ {
+ foreach (var test in testCases)
+ {
+ Console.WriteLine("{0}", test.TestName);
+ }
+ }
+
+ Elementary.Shutdown();
+ }
+
+ private IEnumerable<TestCaseBase> GetTestCases()
+ {
+ Assembly asm = typeof(TestRunner).GetTypeInfo().Assembly;
+ Type testCaseType = typeof(TestCaseBase);
+
+ var tests = from test in asm.GetTypes()
+ where testCaseType.IsAssignableFrom(test) && !test.GetTypeInfo().IsInterface && !test.GetTypeInfo().IsAbstract
+ select Activator.CreateInstance(test) as TestCaseBase;
+
+ return from test in tests
+ orderby test.TestName
+ select test;
+ }
+
+ internal static void UIExit()
+ {
+ EcoreMainloop.Quit();
+ }
+
+ static void Main(string[] args)
+ {
+ TestRunner testRunner = new TestRunner();
+ testRunner.Run(args);
+ }
+ }
+}
--- /dev/null
+{
+ "version": "1.0.0-*",
+ "buildOptions": {
+ "emitEntryPoint": true
+ },
+ "dependencies": {
+ "ElmSharp": "1.0.0"
+ },
+ "frameworks": {
+ "netcoreapp1.0": {
+ "imports": "dnxcore50",
+ "dependencies": {
+ "Microsoft.NETCore.App": {
+ "type": "platform",
+ "version": "1.0.0"
+ }
+ }
+ },
+ "net45": {}
+ }
+}
--- /dev/null
+#!/bin/bash
+
+TARGET_USER=owner
+TARGET_DIR=/home/$TARGET_USER/elmsharp_test
+TARGET_RES_DIR=/home/$TARGET_USER/res
+
+TO_COPY_FILES="bin/Debug"
+
+exit_on_error() {
+ if [ $1 -ne "0" ]
+ then
+ exit $1
+ fi
+}
+
+sdb_cmd() {
+ sdb shell su -l $TARGET_USER -c "$1"
+}
+
+usage() {
+ echo "Usage: $0 [options] [testcase]"
+ echo " Options:"
+ echo " -h, --help Show this usages message"
+ echo " -b, --build Build test cases"
+ echo " -i, --install Install test cases to target device"
+ echo " -r, --install-res Install resource files for test cases to target device"
+}
+
+build() {
+ xbuild ElmSharpTest.csproj
+ exit_on_error $?
+}
+
+install() {
+ echo "install"
+ sdb root on
+ sdb_cmd "rm -fr $TARGET_DIR"
+ sdb_cmd "mkdir -p $TARGET_DIR"
+ sdb push $TO_COPY_FILES/*.dll $TARGET_DIR
+ sdb push $TO_COPY_FILES/*.exe $TARGET_DIR
+ exit_on_error $?
+}
+
+install_res() {
+ sdb root on
+ sdb_cmd "rm -fr $TARGET_RES_DIR"
+ sdb_cmd "mkdir -p $TARGET_RES_DIR"
+ sdb push $TO_COPY_FILES/res $TARGET_RES_DIR
+ exit_on_error $?
+}
+
+run() {
+ sdb root on
+ sdb_cmd "MONO_TRACE_LISTENER=Console.Error mono $TARGET_DIR/ElmSharpTest.exe $1"
+ exit_on_error $?
+}
+
+OPTS=`getopt -o hbir --long help,build,install,install-res -n 'test' -- "$@"`
+if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; usage; exit 1 ; fi
+eval set -- "$OPTS"
+
+FLAG_HELP=false
+FLAG_BUILD=false
+FLAG_INSTALL=false
+FLAG_INSTALL_RES=false
+
+while true; do
+ case "$1" in
+ -h|--help) FLAG_HELP=true; shift ;;
+ -b|--build) FLAG_BUILD=true; shift ;;
+ -i|--install) FLAG_INSTALL=true; shift ;;
+ -r|--install-res) FLAG_INSTALL_RES=true; shift ;;
+ --) shift; break ;;
+ *) break ;;
+ esac
+done
+
+if $FLAG_HELP; then usage; exit 1; fi
+
+if $FLAG_BUILD; then build; fi
+if $FLAG_INSTALL; then install; fi
+if $FLAG_INSTALL_RES; then install_res; fi
+
+run $@
+
--- /dev/null
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
--- /dev/null
+<manifest>
+ <request>
+ <domain name="_"/>
+ </request>
+</manifest>
--- /dev/null
+%{!?dotnet_assembly_path: %define dotnet_assembly_path /opt/usr/share/dotnet.tizen/framework}
+%{!?dotnet_core_path: %define dotnet_core_path %{_datadir}/tizen.net/ref}
+
+%if 0%{?tizen_build_devel_mode}
+%define BUILDCONF Debug
+%else
+%define BUILDCONF Release
+%endif
+
+Name: elm-sharp
+Summary: C# Binding for Elementary
+Version: 1.0.0
+Release: 1
+Group: Development/Libraries
+License: Apache-2.0
+URL: https://www.tizen.org
+Source0: %{name}-%{version}.tar.gz
+Source1: %{name}.manifest
+
+# .NETCore
+%if 0%{?_with_corefx}
+AutoReqProv: no
+BuildRequires: corefx-managed-32b-ref
+%endif
+
+BuildRequires: dotnet-build-tools
+
+%description
+C# Binding for Elementary
+
+%prep
+%setup -q
+cp %{SOURCE1} .
+
+%define Assemblies ElmSharp
+
+%build
+dotnet-gbs build %{Assemblies} \
+%if 0%{?_with_corefx}
+ --CoreFxPath=%{dotnet_core_path} \
+%endif
+ --Configuration=%{BUILDCONF} \
+ --DotnetAssemblyPath=%{dotnet_assembly_path}
+
+dotnet-gbs pack %{Assemblies} --PackageVersion=%{version}
+
+%install
+mkdir -p %{buildroot}%{dotnet_assembly_path}
+dotnet-gbs install %{Assemblies} \
+ --Configuration=%{BUILDCONF} \
+ --InstallPath=%{buildroot}%{dotnet_assembly_path}
+
+mkdir -p %{buildroot}/nuget
+install -p -m 644 .nuget/*.nupkg %{buildroot}/nuget
+
+%files
+%manifest %{name}.manifest
+%license LICENSE
+%attr(644,root,root) %{dotnet_assembly_path}/*.dll
+
+%package devel
+Summary: Development package for %{name}
+Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+AutoReqProv: no
+
+%description devel
+Development package for %{name}
+
+%files devel
+%{dotnet_assembly_path}/devel/*
+
+%package nuget
+Summary: NuGet package for %{name}
+Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description nuget
+NuGet package for %{name}
+
+%files nuget
+/nuget/*.nupkg
--- /dev/null
+<?xml version="1.0"?>
+<package>
+ <metadata>
+ <id>ElmSharp</id>
+ <version>$version$</version>
+ <authors>Tizen Developers</authors>
+ <description>C# Binding for Elementary</description>
+ </metadata>
+</package>
--- /dev/null
+<?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
+ <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>\r
+ <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>\r
+ </PropertyGroup>\r
+ <Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />\r
+ <PropertyGroup Label="Globals">\r
+ <ProjectGuid>ba32f892-baaa-43ef-b9b8-bcf022c54321</ProjectGuid>\r
+ <RootNamespace>ElmSharp</RootNamespace>\r
+ <BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>\r
+ <OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>\r
+ </PropertyGroup>\r
+\r
+ <PropertyGroup>\r
+ <SchemaVersion>2.0</SchemaVersion>\r
+ </PropertyGroup>\r
+ <Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />\r
+</Project>
\ No newline at end of file
--- /dev/null
+using System;
+
+namespace ElmSharp
+{
+ public class Background : Layout
+ {
+ public Background(EvasObject parent) : base(parent)
+ {
+ }
+
+ public override Color Color
+ {
+ get
+ {
+ int r;
+ int g;
+ int b;
+ Interop.Elementary.elm_bg_color_get(Handle, out r, out g, out b);
+ Color value = base.Color;
+ return new Color(r, g, b, value.A);
+ }
+ set
+ {
+ base.Color = value;
+ Interop.Elementary.elm_bg_color_set(Handle, value.R, value.G, value.B);
+ }
+ }
+
+ public string File
+ {
+ get
+ {
+ return Interop.Elementary.BackgroundFileGet(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_bg_file_set(Handle, value, IntPtr.Zero);
+ }
+ }
+
+ public BackgroundOptions BackgroundOption
+ {
+ get
+ {
+ return (BackgroundOptions) Interop.Elementary.elm_bg_option_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_bg_option_set(Handle, (Interop.Elementary.BackgroundOptions) value);
+ }
+ }
+
+ internal override IntPtr CreateHandle(EvasObject parent)
+ {
+ return Interop.Elementary.elm_bg_add(parent.Handle);
+ }
+ }
+
+ public enum BackgroundOptions
+ {
+ Center,
+ Scale,
+ Stretch,
+ Tile
+ }
+}
--- /dev/null
+using System;
+
+namespace ElmSharp
+{
+ public class Box : Container
+ {
+ private Interop.Elementary.BoxLayoutCallback _layoutCallback;
+
+ public Box(EvasObject parent) : base(parent) { }
+ public bool IsHorizontal
+ {
+ get
+ {
+ return Interop.Elementary.elm_box_horizontal_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_box_horizontal_set(Handle, value);
+ }
+ }
+
+ public void PackEnd(EvasObject content)
+ {
+ Interop.Elementary.elm_box_pack_end(Handle, content);
+ AddChild(content);
+ }
+
+ public void PackStart(EvasObject content)
+ {
+ Interop.Elementary.elm_box_pack_start(Handle, content);
+ AddChild(content);
+ }
+
+ public void PackAfter(EvasObject content, EvasObject after)
+ {
+ Interop.Elementary.elm_box_pack_after(Handle, content, after);
+ AddChild(content);
+ }
+
+ public void UnPack(EvasObject content)
+ {
+ Interop.Elementary.elm_box_unpack(Handle, content);
+ RemoveChild(content);
+ }
+
+ public void UnPackAll()
+ {
+ Interop.Elementary.elm_box_unpack_all(Handle);
+ ClearChildren();
+ }
+
+ public void SetLayoutCallback(Action action)
+ {
+ _layoutCallback = (obj, priv, data) =>
+ {
+ action();
+ };
+ Interop.Elementary.elm_box_layout_set(Handle, _layoutCallback, IntPtr.Zero, null);
+ }
+
+ internal override IntPtr CreateHandle(EvasObject parent)
+ {
+ return Interop.Elementary.elm_box_add(parent);
+ }
+ }
+}
--- /dev/null
+using System;
+
+namespace ElmSharp
+{
+ public class Button : Layout
+ {
+ private Interop.SmartEvent _clicked;
+ private Interop.SmartEvent _repeated;
+ private Interop.SmartEvent _pressed;
+ private Interop.SmartEvent _released;
+
+ public Button(EvasObject parent) : base(parent)
+ {
+ _clicked = new Interop.SmartEvent(this, Handle, "clicked");
+ _repeated = new Interop.SmartEvent(this, Handle, "repeated");
+ _pressed = new Interop.SmartEvent(this, Handle, "pressed");
+ _released = new Interop.SmartEvent(this, Handle, "unpressed");
+
+ _clicked.On += (sender, e) =>
+ {
+ Clicked?.Invoke(this, EventArgs.Empty);
+ };
+
+ _repeated.On += (sender, e) =>
+ {
+ Repeated?.Invoke(this, EventArgs.Empty);
+ };
+
+ _pressed.On += (sender, e) =>
+ {
+ Pressed?.Invoke(this, EventArgs.Empty);
+ };
+
+ _released.On += (sender, e) =>
+ {
+ Released?.Invoke(this, EventArgs.Empty);
+ };
+ }
+
+ public event EventHandler Clicked;
+
+ public event EventHandler Repeated;
+
+ public event EventHandler Pressed;
+
+ public event EventHandler Released;
+
+ public bool AutoRepeat
+ {
+ get
+ {
+ return !Interop.Elementary.elm_button_autorepeat_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_button_autorepeat_set(Handle, value);
+ }
+ }
+
+ public double AutoRepeatInitialTime
+ {
+ get
+ {
+ return Interop.Elementary.elm_button_autorepeat_initial_timeout_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_button_autorepeat_initial_timeout_set(Handle, value);
+ }
+ }
+
+ public double AutoRepeatGapTimeout
+ {
+ get
+ {
+ return Interop.Elementary.elm_button_autorepeat_gap_timeout_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_button_autorepeat_gap_timeout_set(Handle, value);
+ }
+ }
+
+ internal override IntPtr CreateHandle(EvasObject parent)
+ {
+ return Interop.Elementary.elm_button_add(parent.Handle);
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.InteropServices;
+
+namespace ElmSharp
+{
+ public class Calendar : Layout
+ {
+ private Interop.SmartEvent _changed;
+ private DateTime _cacheSelectedDate;
+ private Interop.SmartEvent _displayedMonthChanged;
+ private int _cacheDisplayedMonth;
+
+ public Calendar(EvasObject parent) : base(parent)
+ {
+ _changed = new Interop.SmartEvent(this, Handle, "changed");
+ _changed.On += (sender, e) =>
+ {
+ DateTime selectedDate = SelectedDate;
+ DateChanged?.Invoke(this, new DateChangedEventArgs(_cacheSelectedDate, selectedDate));
+ _cacheSelectedDate = selectedDate;
+ };
+
+ _displayedMonthChanged = new Interop.SmartEvent(this, Handle, "display,changed");
+ _displayedMonthChanged.On += (sender, e) =>
+ {
+ int currentDisplayedMonth = SelectedDate.Month;
+ DisplayedMonthChanged?.Invoke(this, new DisplayedMonthChangedEventArgs(_cacheDisplayedMonth, currentDisplayedMonth));
+ _cacheDisplayedMonth = currentDisplayedMonth;
+ };
+ }
+
+ public event EventHandler<DateChangedEventArgs> DateChanged;
+
+ public event EventHandler<DisplayedMonthChangedEventArgs> DisplayedMonthChanged;
+
+ public int MinimumYear
+ {
+ get
+ {
+ int minimumYear;
+ int unused;
+ Interop.Elementary.elm_calendar_min_max_year_get(Handle, out minimumYear, out unused);
+ return minimumYear;
+ }
+ set
+ {
+ int maximumYear;
+ int unused;
+ Interop.Elementary.elm_calendar_min_max_year_get(Handle, out unused, out maximumYear);
+ Interop.Elementary.elm_calendar_min_max_year_set(Handle, value, maximumYear);
+ }
+ }
+
+ public int MaximumYear
+ {
+ get
+ {
+ int maximumYear;
+ int unused;
+ Interop.Elementary.elm_calendar_min_max_year_get(Handle, out unused, out maximumYear);
+ return maximumYear;
+ }
+ set
+ {
+ int minimumYear;
+ int unused;
+ Interop.Elementary.elm_calendar_min_max_year_get(Handle, out minimumYear, out unused);
+ Interop.Elementary.elm_calendar_min_max_year_set(Handle, minimumYear, value);
+ }
+ }
+
+ public DayOfWeek FirstDayOfWeek
+ {
+ get
+ {
+ return (DayOfWeek)Interop.Elementary.elm_calendar_first_day_of_week_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_calendar_first_day_of_week_set(Handle, (int)value);
+ }
+ }
+
+ public IReadOnlyList<string> WeekDayNames
+ {
+ get
+ {
+ IntPtr stringArrayPtr = Interop.Elementary.elm_calendar_weekdays_names_get(Handle);
+ string[] stringArray;
+ IntPtrToStringArray(stringArrayPtr, 7, out stringArray);
+ return stringArray;
+ }
+ set
+ {
+ if (value != null && value.Count == 7)
+ {
+ Interop.Elementary.elm_calendar_weekdays_names_set(Handle, value.ToArray());
+ }
+ }
+ }
+
+ public DateTime SelectedDate
+ {
+ get
+ {
+ var tm = new Interop.Elementary.tm();
+ Interop.Elementary.elm_calendar_selected_time_get(Handle, out tm);
+ return ConvertToDateTime(tm);
+ }
+ set
+ {
+ var tm = ConvertToTM(value);
+ Interop.Elementary.elm_calendar_selected_time_set(Handle, ref tm);
+ _cacheSelectedDate = value;
+ }
+ }
+
+ public double Interval
+ {
+ get
+ {
+ return Interop.Elementary.elm_calendar_interval_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_calendar_interval_set(Handle, value);
+ }
+ }
+
+ internal override IntPtr CreateHandle(EvasObject parent)
+ {
+ return Interop.Elementary.elm_calendar_add(parent.Handle);
+ }
+
+ private static DateTime ConvertToDateTime(Interop.Elementary.tm tm)
+ {
+ DateTime date = new DateTime(tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec);
+ return date;
+ }
+
+ private static Interop.Elementary.tm ConvertToTM(DateTime date)
+ {
+ Interop.Elementary.tm tm = new Interop.Elementary.tm();
+ tm.tm_sec = date.Second;
+ tm.tm_min = date.Minute;
+ tm.tm_hour = date.Hour;
+ tm.tm_mday = date.Day;
+ tm.tm_mon = date.Month - 1;
+ tm.tm_year = date.Year - 1900;
+ tm.tm_wday = (int)date.DayOfWeek;
+ tm.tm_yday = date.DayOfYear;
+ tm.tm_isdst = date.IsDaylightSavingTime() ? 1 : 0;
+ return tm;
+ }
+
+ static private void IntPtrToStringArray(IntPtr unmanagedArray, int size, out string[] managedArray)
+ {
+ managedArray = new string[size];
+ IntPtr[] IntPtrArray = new IntPtr[size];
+
+ Marshal.Copy(unmanagedArray, IntPtrArray, 0, size);
+
+ for (int iterator = 0; iterator < size; iterator++)
+ {
+ managedArray[iterator] = Marshal.PtrToStringAnsi(IntPtrArray[iterator]);
+ }
+ }
+ }
+}
--- /dev/null
+using System;
+
+namespace ElmSharp
+{
+ public class Check : Layout
+ {
+ private Interop.SmartEvent _changed;
+ private bool _currentState;
+
+ public Check(EvasObject parent) : base(parent)
+ {
+ _changed = new Interop.SmartEvent(this, Handle, "changed");
+ _changed.On += (sender, e) =>
+ {
+ StateChanged?.Invoke(this, new CheckStateChangedEventArgs(_currentState, IsChecked));
+ };
+ }
+
+ public event EventHandler<CheckStateChangedEventArgs> StateChanged;
+
+ public bool IsChecked
+ {
+ get
+ {
+ _currentState = Interop.Elementary.elm_check_state_get(Handle);
+ return _currentState;
+ }
+ set
+ {
+ Interop.Elementary.elm_check_state_set(Handle, value);
+ }
+ }
+
+ internal override IntPtr CreateHandle(EvasObject parent)
+ {
+ return Interop.Elementary.elm_check_add(parent.Handle);
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+using System;
+
+namespace ElmSharp
+{
+ public class CheckStateChangedEventArgs : EventArgs
+ {
+ public bool OldState { get; private set; }
+
+ public bool NewState { get; private set; }
+
+ public CheckStateChangedEventArgs(bool oldState, bool newState)
+ {
+ this.OldState = oldState;
+ this.NewState = newState;
+ }
+ }
+}
--- /dev/null
+using System;
+using System.Globalization;
+
+namespace ElmSharp
+{
+ public struct Color
+ {
+ readonly int _a;
+ readonly int _r;
+ readonly int _g;
+ readonly int _b;
+
+ public int A
+ {
+ get { return _a; }
+ }
+
+ public int R
+ {
+ get { return _r; }
+ }
+
+ public int G
+ {
+ get { return _g; }
+ }
+
+ public int B
+ {
+ get { return _b; }
+ }
+
+ public Color(int r, int g, int b) : this(r, g, b, 255)
+ {
+ }
+
+ public Color(int r, int g, int b, int a)
+ {
+ _r = Clamp(r, 0, 255);
+ _g = Clamp(g, 0, 255);
+ _b = Clamp(b, 0, 255);
+ _a = Clamp(a, 0, 255);
+ }
+
+ public override int GetHashCode()
+ {
+ int hashcode = _r.GetHashCode();
+ hashcode = (hashcode * 397) ^ _g.GetHashCode();
+ hashcode = (hashcode * 397) ^ _b.GetHashCode();
+ hashcode = (hashcode * 397) ^ _a.GetHashCode();
+ return hashcode;
+ }
+
+ public override bool Equals(object obj)
+ {
+ if (obj is Color)
+ {
+ return EqualsInner(this, (Color)obj);
+ }
+ return base.Equals(obj);
+ }
+
+ static bool EqualsInner(Color color1, Color color2)
+ {
+ return color1._r == color2._r && color1._g == color2._g && color1._b == color2._b && color1._a == color2._a;
+ }
+
+ public override string ToString()
+ {
+ return string.Format(CultureInfo.InvariantCulture, "[Color: R={0}, G={1}, B={2}, A={3}]", R, G, B, A);
+ }
+
+ public static Color FromHex(string hex)
+ {
+ hex = hex.Replace("#", "");
+ switch (hex.Length)
+ {
+ case 3: //#rgb => ffrrggbb
+ hex = string.Format("ff{0}{1}{2}{3}{4}{5}", hex[0], hex[0], hex[1], hex[1], hex[2], hex[2]);
+ break;
+ case 4: //#argb => aarrggbb
+ hex = string.Format("{0}{1}{2}{3}{4}{5}{6}{7}", hex[0], hex[0], hex[1], hex[1], hex[2], hex[2], hex[3], hex[3]);
+ break;
+ case 6: //#rrggbb => ffrrggbb
+ hex = string.Format("ff{0}", hex);
+ break;
+ }
+ return FromUint(Convert.ToUInt32(hex.Replace("#", ""), 16));
+ }
+
+ public static Color FromUint(uint argb)
+ {
+ return FromRgba((byte)((argb & 0x00ff0000) >> 0x10), (byte)((argb & 0x0000ff00) >> 0x8), (byte)(argb & 0x000000ff), (byte)((argb & 0xff000000) >> 0x18));
+ }
+
+ public static Color FromRgba(int r, int g, int b, int a)
+ {
+ return new Color(r, g, b, a);
+ }
+
+ public static Color FromRgb(int r, int g, int b)
+ {
+ return FromRgba(r, g, b, 255);
+ }
+
+ internal static int Clamp(int self, int min, int max)
+ {
+ return Math.Min(max, Math.Max(self, min));
+ }
+
+ #region Color Definitions
+ public static readonly Color Transparent = FromRgba(0, 0, 0, 0);
+ public static readonly Color Aqua = FromRgb(0, 255, 255);
+ public static readonly Color Black = FromRgb(0, 0, 0);
+ public static readonly Color Blue = FromRgb(0, 0, 255);
+ public static readonly Color Fuchsia = FromRgb(255, 0, 255);
+ public static readonly Color Gray = FromRgb(128, 128, 128);
+ public static readonly Color Green = FromRgb(0, 128, 0);
+ public static readonly Color Lime = FromRgb(0, 255, 0);
+ public static readonly Color Maroon = FromRgb(128, 0, 0);
+ public static readonly Color Navy = FromRgb(0, 0, 128);
+ public static readonly Color Olive = FromRgb(128, 128, 0);
+ public static readonly Color Orange = FromRgb(255, 165, 0);
+ public static readonly Color Purple = FromRgb(128, 0, 128);
+ public static readonly Color Pink = FromRgb(255, 102, 255);
+ public static readonly Color Red = FromRgb(255, 0, 0);
+ public static readonly Color Silver = FromRgb(192, 192, 192);
+ public static readonly Color Teal = FromRgb(0, 128, 128);
+ public static readonly Color White = FromRgb(255, 255, 255);
+ public static readonly Color Yellow = FromRgb(255, 255, 0);
+ #endregion
+ }
+}
--- /dev/null
+using System;
+
+namespace ElmSharp
+{
+ public class ColorChangedEventArgs : EventArgs
+ {
+ public Color OldColor { get; private set; }
+
+ public Color NewColor { get; private set; }
+
+ public ColorChangedEventArgs(Color oldColor, Color newColor)
+ {
+ this.OldColor = oldColor;
+ this.NewColor = newColor;
+ }
+ }
+}
--- /dev/null
+using System;
+
+namespace ElmSharp
+{
+ public enum ColorSelectorMode
+ {
+ Palette,
+ Components,
+ Both,
+ Picker,
+ Plane,
+ PallettePlane,
+ All
+ }
+
+ public class ColorSelector : Layout
+ {
+ private readonly Interop.SmartEvent<ColorChangedEventArgs> _changed;
+ private Color _currentColor;
+
+ public ColorSelector(EvasObject parent) : base(parent)
+ {
+ _changed = new Interop.SmartEvent<ColorChangedEventArgs>(this, Handle, "changed", (data, obj, info) =>
+ {
+ return new ColorChangedEventArgs(_currentColor, SelectedColor);
+ });
+ }
+
+ public event EventHandler<ColorChangedEventArgs> ColorChanged
+ {
+ add { _changed.On += value; }
+ remove { _changed.On -= value; }
+ }
+
+ public Color SelectedColor
+ {
+ get
+ {
+ int r, g, b, a;
+ Interop.Elementary.elm_colorselector_color_get(Handle, out r, out g, out b, out a);
+ _currentColor = new Color(r, g, b, a);
+ return _currentColor;
+ }
+ set
+ {
+ Interop.Elementary.elm_colorselector_color_set(Handle, value.R, value.G, value.B, value.A);
+ _currentColor = new Color(value.R, value.G, value.B, value.A);
+ }
+ }
+
+ public ColorSelectorMode Mode
+ {
+ get
+ {
+ return (ColorSelectorMode) Interop.Elementary.elm_colorselector_mode_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_colorselector_mode_set(Handle, (Interop.Elementary.Elm_Colorselector_Mode)value);
+ }
+ }
+
+ public string PaletteName
+ {
+ get
+ {
+ return Interop.Elementary.elm_colorselector_palette_name_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_colorselector_palette_name_set(Handle, value);
+ }
+ }
+
+ internal override IntPtr CreateHandle(EvasObject parent)
+ {
+ return Interop.Elementary.elm_colorselector_add(parent.Handle);
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+using System;
+
+namespace ElmSharp
+{
+ public class Conformant : Widget
+ {
+ public Conformant(Window parent) : base(parent)
+ {
+ Interop.Evas.evas_object_size_hint_weight_set(Handle, 1.0, 1.0);
+ Interop.Elementary.elm_win_conformant_set(parent.Handle, true);
+ Interop.Elementary.elm_win_resize_object_add(parent.Handle, Handle);
+ }
+
+ internal override IntPtr CreateHandle(EvasObject parent)
+ {
+ return Interop.Elementary.elm_conformant_add(parent.Handle);
+ }
+ }
+}
--- /dev/null
+using System;
+using System.Collections.Generic;
+
+namespace ElmSharp
+{
+ public abstract class Container : Widget
+ {
+ HashSet<EvasObject> _children = new HashSet<EvasObject>();
+
+ public Container(EvasObject parent) : base(parent)
+ {
+ }
+
+ internal void AddChild(EvasObject obj)
+ {
+ _children.Add(obj);
+ obj.Deleted += OnChildDeleted;
+ }
+
+ internal void RemoveChild(EvasObject obj)
+ {
+ _children.Remove(obj);
+ }
+
+ internal void ClearChildren()
+ {
+ _children.Clear();
+ }
+
+ void OnChildDeleted(object sender, EventArgs a)
+ {
+ _children.Remove((EvasObject)sender);
+ }
+ }
+}
--- /dev/null
+using System;
+using System.Collections.Generic;
+
+namespace ElmSharp
+{
+ public enum ContextPopupDirection
+ {
+ Down,
+ Right,
+ Left,
+ Up,
+ Unknown
+ }
+
+ public class ContextPopup : Layout
+ {
+ HashSet<ContextPopupItem> _children = new HashSet<ContextPopupItem>();
+ Interop.SmartEvent _dismissed;
+ Interop.Evas.SmartCallback _onSelected;
+
+ public ContextPopup(EvasObject parent) : base(parent)
+ {
+ _dismissed = new Interop.SmartEvent(this, Handle, "dismissed");
+ _dismissed.On += (sender, e) =>
+ {
+ Dismissed?.Invoke(this, EventArgs.Empty);
+ };
+ _onSelected = (data, obj, info) =>
+ {
+ ContextPopupItem item = ItemObject.GetItemById((int)data) as ContextPopupItem;
+ item?.SendSelected();
+ };
+ }
+
+ public event EventHandler Dismissed;
+
+ public ContextPopupDirection Direction
+ {
+ get
+ {
+ return (ContextPopupDirection)Interop.Elementary.elm_ctxpopup_direction_get(Handle);
+ }
+ }
+
+ public bool IsHorizontal
+ {
+ get
+ {
+ return Interop.Elementary.elm_ctxpopup_horizontal_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_box_horizontal_set(Handle, value);
+ }
+ }
+
+ public bool AutoHide
+ {
+ get
+ {
+ return !Interop.Elementary.elm_ctxpopup_auto_hide_disabled_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_ctxpopup_auto_hide_disabled_set(Handle, !value);
+ }
+ }
+
+ public void SetDirectionPriorty(ContextPopupDirection first, ContextPopupDirection second, ContextPopupDirection third, ContextPopupDirection fourth)
+ {
+ Interop.Elementary.elm_ctxpopup_direction_priority_set(Handle, (int)first, (int)second, (int)third, (int)fourth);
+ }
+
+ public ContextPopupItem Append(string label)
+ {
+ return Append(label, null);
+ }
+
+ public ContextPopupItem Append(string label, EvasObject icon)
+ {
+ ContextPopupItem item = new ContextPopupItem(label, icon);
+ item.Handle = Interop.Elementary.elm_ctxpopup_item_append(Handle, label, icon, _onSelected, (IntPtr)item.Id);
+ AddInternal(item);
+ return item;
+ }
+
+ public void Dismiss()
+ {
+ Interop.Elementary.elm_ctxpopup_dismiss(Handle);
+ }
+
+ public bool IsAvailableDirection(ContextPopupDirection direction)
+ {
+ return Interop.Elementary.elm_ctxpopup_direction_available_get(Handle, (int)direction);
+ }
+
+ internal override IntPtr CreateHandle(EvasObject parent)
+ {
+ return Interop.Elementary.elm_ctxpopup_add(parent.Handle);
+ }
+
+ void AddInternal(ContextPopupItem item)
+ {
+ _children.Add(item);
+ item.Deleted += Item_Deleted;
+ }
+
+ void Item_Deleted(object sender, EventArgs e)
+ {
+ _children.Remove((ContextPopupItem)sender);
+ }
+ }
+}
--- /dev/null
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ElmSharp
+{
+ public class ContextPopupItem : ItemObject
+ {
+ internal ContextPopupItem(string text, EvasObject icon) : base(IntPtr.Zero)
+ {
+ Text = text;
+ Icon = icon;
+ }
+
+ public string Text { get; internal set; }
+ public EvasObject Icon { get; internal set; }
+ public event EventHandler Selected;
+
+ internal void SendSelected()
+ {
+ Selected?.Invoke(this, EventArgs.Empty);
+ }
+ }
+}
--- /dev/null
+using System;
+
+namespace ElmSharp
+{
+ public class DateChangedEventArgs : EventArgs
+ {
+ public DateTime OldDate { get; private set; }
+
+ public DateTime NewDate { get; private set; }
+
+ public DateChangedEventArgs(DateTime oldDate, DateTime newDate)
+ {
+ this.OldDate = oldDate;
+ this.NewDate = newDate;
+ }
+ }
+}
--- /dev/null
+using System;
+
+namespace ElmSharp
+{
+ public enum DateTimeFieldType
+ {
+ Year,
+ Month,
+ Date,
+ Hour,
+ Minute,
+ AmPm
+ }
+
+ public class DateTimeSelector : Layout
+ {
+ Interop.SmartEvent _changed;
+ DateTime _cacheDateTime;
+
+ public DateTimeSelector(EvasObject parent) : base(parent)
+ {
+ _changed = new Interop.SmartEvent(this, Handle, "changed");
+ _changed.On += (s, e) =>
+ {
+ DateTime newDateTime = DateTime;
+ DateTimeChanged?.Invoke(this, new DateChangedEventArgs(_cacheDateTime, newDateTime));
+ DateTime = newDateTime;
+ };
+ }
+
+ public event EventHandler<DateChangedEventArgs> DateTimeChanged;
+
+ public string Format
+ {
+ get
+ {
+ return Interop.Elementary.elm_datetime_format_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_datetime_format_set(Handle, value);
+ }
+ }
+
+ public DateTime MaximumDateTime
+ {
+ get
+ {
+ var tm = new Interop.Elementary.tm();
+ Interop.Elementary.elm_datetime_value_max_get(Handle, ref tm);
+ return ConvertToDateTime(tm);
+ }
+ set
+ {
+ var tm = ConvertToTM(value);
+ Interop.Elementary.elm_datetime_value_max_set(Handle, ref tm);
+ }
+ }
+
+ public DateTime MinimumDateTime
+ {
+ get
+ {
+ var tm = new Interop.Elementary.tm();
+ Interop.Elementary.elm_datetime_value_min_get(Handle, ref tm);
+ return ConvertToDateTime(tm);
+ }
+ set
+ {
+ var tm = ConvertToTM(value);
+ Interop.Elementary.elm_datetime_value_min_set(Handle, ref tm);
+ }
+ }
+
+ public DateTime DateTime
+ {
+ get
+ {
+ var tm = new Interop.Elementary.tm();
+ Interop.Elementary.elm_datetime_value_get(Handle, ref tm);
+ return ConvertToDateTime(tm);
+ }
+ set
+ {
+ var tm = ConvertToTM(value);
+ Interop.Elementary.elm_datetime_value_set(Handle, ref tm);
+ _cacheDateTime = value;
+ }
+ }
+
+ public bool IsFieldVisible(DateTimeFieldType type)
+ {
+ return Interop.Elementary.elm_datetime_field_visible_get(Handle, (int) type);
+ }
+
+ public void SetFieldLimit(DateTimeFieldType type, int minimum, int maximum)
+ {
+ Interop.Elementary.elm_datetime_field_limit_set(Handle, (int)type, minimum, maximum);
+ }
+
+ public void SetFieldVisible(DateTimeFieldType type, bool visible)
+ {
+ Interop.Elementary.elm_datetime_field_visible_set(Handle, (int)type, visible);
+ }
+
+ internal override IntPtr CreateHandle(EvasObject parent)
+ {
+ return Interop.Elementary.elm_datetime_add(parent.Handle);
+ }
+
+ DateTime ConvertToDateTime(Interop.Elementary.tm tm)
+ {
+ DateTime date = new DateTime(tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec);
+ return date;
+ }
+
+ Interop.Elementary.tm ConvertToTM(DateTime date)
+ {
+ Interop.Elementary.tm tm = new Interop.Elementary.tm();
+ tm.tm_sec = date.Second;
+ tm.tm_min = date.Minute;
+ tm.tm_hour = date.Hour;
+ tm.tm_mday = date.Day;
+ tm.tm_mon = date.Month - 1;
+ tm.tm_year = date.Year - 1900;
+ tm.tm_wday = (int)date.DayOfWeek;
+ tm.tm_yday = date.DayOfYear;
+ tm.tm_isdst = date.IsDaylightSavingTime() ? 1 : 0;
+ return tm;
+ }
+ }
+}
--- /dev/null
+using System;
+
+namespace ElmSharp
+{
+ public class DisplayedMonthChangedEventArgs : EventArgs
+ {
+ public int OldMonth { get; private set; }
+
+ public int NewMonth { get; private set; }
+
+ public DisplayedMonthChangedEventArgs(int oldMonth, int newMonth)
+ {
+ this.OldMonth = oldMonth;
+ this.NewMonth = newMonth;
+ }
+ }
+}
--- /dev/null
+using System;
+using System.Collections.Generic;
+
+namespace ElmSharp
+{
+ public static class EcoreMainloop
+ {
+ static readonly Dictionary<int, Func<bool>> _taskMap = new Dictionary<int, Func<bool>>();
+ static readonly Object _taskLock = new Object();
+ static int _newTaskId = 0;
+
+
+ static Interop.Ecore.EcoreTaskCallback _nativeHandler;
+
+ static EcoreMainloop()
+ {
+ Interop.Ecore.ecore_init();
+ Interop.Ecore.ecore_main_loop_glib_integrate();
+ _nativeHandler = NativeHandler;
+ }
+
+ public static void Begin()
+ {
+ Interop.Ecore.ecore_main_loop_begin();
+ }
+
+ public static void Quit()
+ {
+ Interop.Ecore.ecore_main_loop_quit();
+ }
+
+ public static void Post(Action task)
+ {
+ int id = RegistHandler(() => { task(); return false; });
+ Interop.Ecore.ecore_idler_add(_nativeHandler, (IntPtr)id);
+ }
+
+ public static void PostAndWakeUp(Action task)
+ {
+ int id = RegistHandler(() => { task(); return false; });
+ Interop.Ecore.ecore_main_loop_thread_safe_call_async(_nativeHandler, (IntPtr)id);
+ }
+
+ public static void Send(Action task)
+ {
+ int id = RegistHandler(() => { task(); return false; });
+ Interop.Ecore.ecore_main_loop_thread_safe_call_sync(_nativeHandler, (IntPtr)id);
+ }
+
+ public static IntPtr AddTimer(double interval, Func<bool> handler)
+ {
+ int id = RegistHandler(handler);
+ return Interop.Ecore.ecore_timer_add(interval, _nativeHandler, (IntPtr)id);
+ }
+
+ public static void RemoveTimer(IntPtr id)
+ {
+ int taskId = (int)Interop.Ecore.ecore_timer_del(id);
+ _taskMap.Remove(taskId);
+ }
+
+ static int RegistHandler(Func<bool> task)
+ {
+ int taskId;
+ lock (_taskLock)
+ {
+ taskId = _newTaskId++;
+ }
+ _taskMap[taskId] = task;
+ return taskId;
+ }
+
+ static bool NativeHandler(IntPtr user_data)
+ {
+ int task_id = (int)user_data;
+ Func<bool> userAction = null;
+ _taskMap.TryGetValue(task_id, out userAction);
+ if (userAction != null)
+ {
+ _taskMap.Remove(task_id);
+ return userAction();
+ }
+ return false;
+ }
+
+ }
+}
--- /dev/null
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System.Threading;
+
+namespace ElmSharp
+{
+
+ /// <summary>
+ /// Provides a synchronization context for the efl application.
+ /// </summary>
+ public class EcoreSynchronizationContext : SynchronizationContext
+ {
+ /// <summary>
+ /// Initializes a new instance of the EcoreSynchronizationContext class.
+ /// </summary>
+ public EcoreSynchronizationContext()
+ {
+ }
+
+ /// <summary>
+ /// Initilizes a new EcoreSynchronizationContext and install into current thread
+ /// </summary>
+ /// <remarks>
+ /// It is equivalent
+ /// <code>
+ /// SetSynchronizationContext(new EcoreSynchronizationContext());
+ /// </code>
+ /// </remarks>
+ public static void Initialize()
+ {
+ SetSynchronizationContext(new EcoreSynchronizationContext());
+ }
+
+ /// <summary>
+ /// Dispatches an asynchronous message to a Ecore main loop.
+ /// </summary>
+ /// <param name="d"><see cref="System.Threading.SendOrPostCallback"/>The SendOrPostCallback delegate to call.</param>
+ /// <param name="state"><see cref="System.Object"/>The object passed to the delegate.</param>
+ /// <remarks>
+ /// The Post method starts an asynchronous request to post a message.</remarks>
+ public override void Post(SendOrPostCallback d, object state)
+ {
+ EcoreMainloop.PostAndWakeUp(() =>
+ {
+ d(state);
+ });
+ }
+
+ /// <summary>
+ /// Dispatches a synchronous message to a Ecore main loop
+ /// </summary>
+ /// <param name="d"><see cref="System.Threading.SendOrPostCallback"/>The SendOrPostCallback delegate to call.</param>
+ /// <param name="state"><see cref="System.Object"/>The object passed to the delegate.</param>
+ /// <remarks>
+ /// The Send method starts a synchronous request to send a message.</remarks>
+ public override void Send(SendOrPostCallback d, object state)
+ {
+ EcoreMainloop.Send(() =>
+ {
+ d(state);
+ });
+ }
+ }
+}
--- /dev/null
+using System;
+
+namespace ElmSharp
+{
+ public class EdjeObject
+ {
+ IntPtr _edjeHandle;
+
+ internal EdjeObject(IntPtr handle)
+ {
+ _edjeHandle = handle;
+ }
+
+ public EdjeTextPartObject this[string part]
+ {
+ get
+ {
+ if (Interop.Elementary.edje_object_part_exists(_edjeHandle, part))
+ {
+ return new EdjeTextPartObject(_edjeHandle, part);
+ }
+ return null;
+ }
+ }
+
+ public void EmitSignal(string emission, string source)
+ {
+ Interop.Elementary.edje_object_signal_emit(_edjeHandle, emission, source);
+ }
+ }
+
+ public class EdjeTextPartObject
+ {
+ string _part;
+ IntPtr _edjeHandle;
+
+ internal EdjeTextPartObject(IntPtr edjeHandle, string part)
+ {
+ _edjeHandle = edjeHandle;
+ _part = part;
+ }
+
+ public string Name { get { return _part; } }
+
+ public string Text {
+ get
+ {
+ return Interop.Elementary.edje_object_part_text_get(_edjeHandle, _part);
+ }
+ set
+ {
+ Interop.Elementary.edje_object_part_text_set(_edjeHandle, _part, value);
+ }
+ }
+
+ public string TextStyle
+ {
+ get
+ {
+ return Interop.Elementary.edje_object_part_text_style_user_peek(_edjeHandle, _part);
+ }
+ set
+ {
+ if (value == null)
+ {
+ Interop.Elementary.edje_object_part_text_style_user_pop(_edjeHandle, _part);
+ }
+ else
+ {
+ Interop.Elementary.edje_object_part_text_style_user_push(_edjeHandle, _part, value);
+ }
+ }
+ }
+
+ public Rect Geometry
+ {
+ get
+ {
+ int x, y, w, h;
+ Interop.Elementary.edje_object_part_geometry_get(_edjeHandle, _part, out x, out y, out w, out h);
+ return new Rect(x, y, w, h);
+ }
+ }
+
+ public Size TextBlockNativeSize
+ {
+ get
+ {
+ int w;
+ int h;
+ IntPtr part = Interop.Elementary.edje_object_part_object_get(_edjeHandle, _part);
+ Interop.Evas.evas_object_textblock_size_native_get(part, out w, out h);
+ return new Size(w, h);
+ }
+ }
+
+ public Size TextBlockFormattedSize
+ {
+ get
+ {
+ int w;
+ int h;
+ IntPtr part = Interop.Elementary.edje_object_part_object_get(_edjeHandle, _part);
+ Interop.Evas.evas_object_textblock_size_formatted_get(part, out w, out h);
+ return new Size(w, h);
+ }
+ }
+ }
+}
--- /dev/null
+using System;
+
+namespace ElmSharp
+{
+ public static class Elementary
+ {
+ public static void Initialize()
+ {
+ Interop.Elementary.elm_init(0, null);
+ }
+
+ public static void Shutdown()
+ {
+ Interop.Elementary.elm_shutdown();
+ }
+ }
+}
--- /dev/null
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ElmSharp
+{
+ public enum InputPanelLayout
+ {
+ /// <summary>
+ /// InputPanel layout type default.
+ /// </summary>
+ Normal,
+
+ /// <summary>
+ /// InputPanel layout type number.
+ /// </summary>
+ Number,
+
+ /// <summary>
+ /// InputPanel layout type email.
+ /// </summary>
+ Email,
+
+ /// <summary>
+ /// InputPanel layout type url.
+ /// </summary>
+ Url,
+
+ /// <summary>
+ /// InputPanel layout type phone.
+ /// </summary>
+ PhoneNumber,
+
+ /// <summary>
+ /// InputPanel layout type ip.
+ /// </summary>
+ Ip,
+
+ /// <summary>
+ /// InputPanel layout type month.
+ /// </summary>
+ Month,
+
+ /// <summary>
+ /// InputPanel layout type number.
+ /// </summary>
+ NumberOnly,
+
+ /// <summary>
+ /// InputPanel layout type error type. Do not use it directly!
+ /// </summary>
+ Invalid,
+
+ /// <summary>
+ /// InputPanel layout type hexadecimal.
+ /// </summary>
+ Hex,
+
+ /// <summary>
+ /// InputPanel layout type terminal type, esc, alt, ctrl, etc.
+ /// </summary>
+ Terminal,
+
+ /// <summary>
+ /// InputPanel layout type password.
+ /// </summary>
+ Password,
+
+ /// <summary>
+ /// Keyboard layout type date and time.
+ /// </summary>
+ DateTime,
+
+ /// <summary>
+ /// InputPanel layout type emoticons.
+ /// </summary>
+ Emoticon
+ }
+
+ public enum InputPanelReturnKeyType
+ {
+ Default,
+ Done,
+ Go,
+ Join,
+ Login,
+ Next,
+ Search,
+ Send,
+ Signin
+ }
+
+ public class Entry : Layout
+ {
+ Interop.SmartEvent _clicked;
+ Interop.SmartEvent _changedByUser;
+ Interop.SmartEvent _cursorChanged;
+ Interop.SmartEvent _activated;
+
+ public Entry(EvasObject parent) : base(parent)
+ {
+ _clicked = new Interop.SmartEvent(this, Handle, "clicked");
+ _clicked.On += (s, e) => Clicked?.Invoke(this, EventArgs.Empty);
+
+ _changedByUser = new Interop.SmartEvent(this, Handle, "changed,user");
+ _changedByUser.On += (s, e) => ChangedByUser?.Invoke(this, EventArgs.Empty);
+
+ _cursorChanged = new Interop.SmartEvent(this, Handle, "cursor,changed");
+ _cursorChanged.On += (s, e) => CursorChanged?.Invoke(this, EventArgs.Empty);
+
+ _activated = new Interop.SmartEvent(this, Handle, "activated");
+ _activated.On += (s, e) => Activated?.Invoke(this, EventArgs.Empty);
+ }
+
+ public event EventHandler Activated;
+
+ public event EventHandler Clicked;
+
+ public event EventHandler ChangedByUser;
+
+ public event EventHandler CursorChanged;
+
+ public bool IsSingleLine
+ {
+ get
+ {
+ return Interop.Elementary.elm_entry_single_line_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_entry_single_line_set(Handle, value);
+ }
+ }
+
+ public bool IsPassword
+ {
+ get
+ {
+ return Interop.Elementary.elm_entry_password_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_entry_password_set(Handle, value);
+ }
+ }
+
+ public bool IsEditable
+ {
+ get
+ {
+ return Interop.Elementary.elm_entry_editable_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_entry_editable_set(Handle, value);
+ }
+ }
+
+ public bool IsEmpty
+ {
+ get
+ {
+ return Interop.Elementary.elm_entry_is_empty(Handle);
+ }
+ }
+
+ public new string Text
+ {
+ get
+ {
+ return Interop.Elementary.elm_entry_entry_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_entry_entry_set(Handle, value);
+ }
+ }
+
+ public string TextStyle
+ {
+ get
+ {
+ return Interop.Elementary.elm_entry_text_style_user_peek(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_entry_text_style_user_push(Handle, value);
+ }
+ }
+
+ public int CursorPosition
+ {
+ get
+ {
+ return Interop.Elementary.elm_entry_cursor_pos_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_entry_cursor_pos_set(Handle, value);
+ }
+ }
+
+ public static string ConvertMarkupToUtf8(string markup)
+ {
+ return Interop.Elementary.elm_entry_markup_to_utf8(markup);
+ }
+
+ public bool MoveCursorNext()
+ {
+ return Interop.Elementary.elm_entry_cursor_next(Handle);
+ }
+
+ public bool MoveCursorPrev()
+ {
+ return Interop.Elementary.elm_entry_cursor_prev(Handle);
+ }
+
+ public bool MoveCursorUp()
+ {
+ return Interop.Elementary.elm_entry_cursor_up(Handle);
+ }
+
+ public bool MoveCursorDown()
+ {
+ return Interop.Elementary.elm_entry_cursor_down(Handle);
+ }
+
+ public void MoveCursorBegin()
+ {
+ Interop.Elementary.elm_entry_cursor_begin_set(Handle);
+ }
+
+ public void MoveCursorEnd()
+ {
+ Interop.Elementary.elm_entry_cursor_end_set(Handle);
+ }
+
+ public void MoveCursorLineBegin()
+ {
+ Interop.Elementary.elm_entry_cursor_line_begin_set(Handle);
+ }
+
+ public void MoveCursorLineEnd()
+ {
+ Interop.Elementary.elm_entry_cursor_line_end_set(Handle);
+ }
+
+ public void SetInputPanelLayout(InputPanelLayout layout)
+ {
+ Interop.Elementary.elm_entry_input_panel_layout_set(Handle, (Interop.Elementary.InputPanelLayout)layout);
+ }
+
+ public void SetInputPanelEnabled(bool enabled)
+ {
+ Interop.Elementary.elm_entry_input_panel_enabled_set(Handle, true);
+ }
+
+ public void SetInputPanelReturnKeyType(InputPanelReturnKeyType keyType)
+ {
+ Interop.Elementary.elm_entry_input_panel_return_key_type_set(Handle, (Interop.Elementary.ReturnKeyType)keyType);
+ }
+
+ internal override IntPtr CreateHandle(EvasObject parent)
+ {
+ return Interop.Elementary.elm_entry_add(parent.Handle);
+ }
+ }
+}
--- /dev/null
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace ElmSharp
+{
+ public class EvasKeyEventArgs : EventArgs
+ {
+ public const string PlatformBackButtonName = "XF86Back";
+ public const string PlatformMenuButtonName = "XF86Menu";
+ public const string PlatformHomeButtonName = "XF86Home";
+
+ public string KeyName { get; private set; }
+
+ static public EvasKeyEventArgs Create(IntPtr data, IntPtr obj, IntPtr info)
+ {
+ EvasEventKeyDown evt = (EvasEventKeyDown)Marshal.PtrToStructure(info, typeof(EvasEventKeyDown));
+ return new EvasKeyEventArgs() { KeyName = evt.keyname };
+ }
+
+ [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
+ struct EvasEventKeyDown
+ {
+ public string keyname;
+ public IntPtr data;
+ public IntPtr modifiers;
+ public IntPtr locks;
+ public string key;
+ public string str;
+ public string compose;
+ public IntPtr event_flags;
+ public IntPtr dev;
+ public uint keycode;
+ };
+
+ }
+}
--- /dev/null
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ElmSharp
+{
+ public class EvasMap
+ {
+ IntPtr _evasMap;
+ bool _ownership;
+
+ public EvasMap(int count)
+ {
+ _evasMap = Interop.Evas.evas_map_new(count);
+ _ownership = true;
+ }
+
+ internal EvasMap(IntPtr handle)
+ {
+ _evasMap = handle;
+ _ownership = false;
+ }
+
+ ~EvasMap()
+ {
+ if (_ownership)
+ {
+ Interop.Evas.evas_map_free(_evasMap);
+ }
+ }
+
+ internal IntPtr Handle
+ {
+ get
+ {
+ return _evasMap;
+ }
+ }
+
+ public void PopulatePoints(EvasObject obj, int z)
+ {
+ Interop.Evas.evas_map_util_points_populate_from_object_full(_evasMap, obj, z);
+ }
+
+ public void PopulatePoints(Rect geometry, int z)
+ {
+ Interop.Evas.evas_map_util_points_populate_from_geometry(_evasMap, geometry.X, geometry.Y, geometry.Width, geometry.Height, z);
+ }
+
+ public void Rotate3D(double dx, double dy, double dz, int cx, int cy, int cz)
+ {
+ Interop.Evas.evas_map_util_3d_rotate(_evasMap, dx, dy, dz, cx, cy, cz);
+ }
+
+ public void SetPointCoordinate(int idx, Point3D point)
+ {
+ Interop.Evas.evas_map_point_coord_set(_evasMap, idx, point.X, point.Y, point.Z);
+ }
+
+ public Point3D GetPointCoordinate(int idx)
+ {
+ Point3D point;
+ Interop.Evas.evas_map_point_coord_get(_evasMap, idx, out point.X, out point.Y, out point.Z);
+ return point;
+ }
+
+ public void Zoom(double x, double y, int cx, int cy)
+ {
+ Interop.Evas.evas_map_util_zoom(_evasMap, x, y, cx, cy);
+ }
+ }
+}
--- /dev/null
+using System;
+using System.Diagnostics;
+
+namespace ElmSharp
+{
+ public abstract class EvasObject
+ {
+ internal IntPtr Handle { get; set; }
+ internal EvasObject Parent { get; set; }
+
+ Interop.EvasObjectEvent _deleted;
+ Interop.EvasObjectEvent<EvasKeyEventArgs> _keyup;
+ Interop.EvasObjectEvent<EvasKeyEventArgs> _keydown;
+ Interop.EvasObjectEvent _moved;
+ Interop.EvasObjectEvent _resized;
+
+ internal EvasObject(EvasObject parent) : this()
+ {
+ Debug.Assert(parent == null || parent.IsRealized);
+ Realize(parent);
+ }
+
+ protected EvasObject()
+ {
+ OnInstantiated();
+ }
+
+ public event EventHandler Deleted;
+ public event EventHandler<EvasKeyEventArgs> KeyUp;
+ public event EventHandler<EvasKeyEventArgs> KeyDown;
+ public event EventHandler Moved
+ {
+ add { _moved.On += value; }
+ remove { _moved.On -= value; }
+ }
+ public event EventHandler Resized
+ {
+ add { _resized.On += value; }
+ remove { _resized.On -= value; }
+ }
+
+ public bool IsRealized { get { return Handle != IntPtr.Zero; } }
+
+ public double WeightX
+ {
+ get
+ {
+ return Interop.Evas.GetWeightX(Handle);
+ }
+ set
+ {
+ Interop.Evas.SetWeightX(Handle, value);
+ }
+ }
+
+ public double WeightY
+ {
+ get
+ {
+ return Interop.Evas.GetWeightY(Handle);
+ }
+ set
+ {
+ Interop.Evas.SetWeightY(Handle, value);
+ }
+ }
+
+ public double AlignmentX
+ {
+ get
+ {
+ return Interop.Evas.GetAlignX(Handle);
+ }
+ set
+ {
+ Interop.Evas.SetAlignX(Handle, value);
+ }
+ }
+
+ public double AlignmentY
+ {
+ get
+ {
+ return Interop.Evas.GetAlignY(Handle);
+ }
+ set
+ {
+ Interop.Evas.SetAlignY(Handle, value);
+ }
+ }
+
+ public int MinimumWidth
+ {
+ get
+ {
+ int w, h;
+ Interop.Evas.evas_object_size_hint_min_get(Handle, out w, out h);
+ return w;
+ }
+ set
+ {
+ int h = MinimumHeight;
+ Interop.Evas.evas_object_size_hint_min_set(Handle, value, h);
+ }
+ }
+
+ public int MinimumHeight
+ {
+ get
+ {
+ int w, h;
+ Interop.Evas.evas_object_size_hint_min_get(Handle, out w, out h);
+ return h;
+ }
+ set
+ {
+ int w = MinimumWidth;
+ Interop.Evas.evas_object_size_hint_min_set(Handle, w, value);
+ }
+ }
+
+ public bool IsVisible
+ {
+ get
+ {
+ return Interop.Evas.evas_object_visible_get(Handle);
+ }
+ }
+
+ public Rect Geometry
+ {
+ get
+ {
+ int x, y, w, h;
+ Interop.Evas.evas_object_geometry_get(Handle, out x, out y, out w, out h);
+ Rect rect = new Rect(x, y, w, h);
+ return rect;
+ }
+ set
+ {
+ Interop.Evas.evas_object_geometry_set(Handle, value.X, value.Y, value.Width, value.Height);
+ }
+ }
+
+ public virtual Color Color
+ {
+ get
+ {
+ int r, g, b, a;
+ Interop.Evas.evas_object_color_get(Handle, out r, out g, out b, out a);
+ return Color.FromRgba(r, g, b, a);
+ }
+ set
+ {
+ Interop.Evas.SetPremultipliedColor(Handle, value.R, value.G, value.B, value.A);
+ }
+ }
+
+ public bool IsMapEnabled
+ {
+ get
+ {
+ return Interop.Evas.evas_object_map_enable_get(Handle);
+ }
+ set
+ {
+ Interop.Evas.evas_object_map_enable_set(Handle, value);
+ }
+ }
+
+ public EvasMap EvasMap
+ {
+ get
+ {
+ IntPtr evasMap = Interop.Evas.evas_object_map_get(Handle);
+ return new EvasMap(evasMap);
+ }
+ set
+ {
+ Interop.Evas.evas_object_map_set(Handle, value.Handle);
+ }
+ }
+
+ public void SetClip(EvasObject clip)
+ {
+ Interop.Evas.evas_object_clip_set(Handle, clip);
+ }
+
+ public void SetAlignment(double x, double y)
+ {
+ Interop.Evas.evas_object_size_hint_align_set(Handle, x, y);
+ }
+
+ public void SetWeight(double x, double y)
+ {
+ Interop.Evas.evas_object_size_hint_weight_set(Handle, x, y);
+ }
+
+ ~EvasObject()
+ {
+ Unrealize();
+ }
+
+ public void Show()
+ {
+ Interop.Evas.evas_object_show(Handle);
+ }
+
+ public void Hide()
+ {
+ Interop.Evas.evas_object_hide(Handle);
+ }
+
+ public void Resize(int w, int h)
+ {
+ Interop.Evas.evas_object_resize(Handle, w, h);
+ }
+
+ public void Move(int x, int y)
+ {
+ Interop.Evas.evas_object_move(Handle, x, y);
+ }
+
+ public void Lower()
+ {
+ Interop.Evas.evas_object_lower(Handle);
+ }
+
+ public void MakeInvalidate()
+ {
+ Deleted?.Invoke(this, EventArgs.Empty);
+ OnInvalidate();
+ Handle = IntPtr.Zero;
+ _deleted = null;
+ }
+
+ public static implicit operator IntPtr(EvasObject obj)
+ {
+ if (obj == null)
+ return IntPtr.Zero;
+ return obj.Handle;
+ }
+
+ public bool KeyGrab(string keyname, bool exclusive)
+ {
+ return Interop.Evas.evas_object_key_grab(Handle, keyname, 0, 0, exclusive);
+ }
+
+ public void KeyUngrab(string keyname)
+ {
+ Interop.Evas.evas_object_key_ungrab(Handle, keyname, 0, 0);
+ }
+
+ public void MarkChanged()
+ {
+ Interop.Evas.evas_object_smart_changed(Handle);
+ }
+
+ protected virtual void OnInvalidate()
+ {
+ }
+
+ internal virtual void OnInstantiated()
+ {
+ }
+
+ internal virtual void OnRealized()
+ {
+ }
+
+ internal virtual void OnUnrealize()
+ {
+ }
+
+ internal abstract IntPtr CreateHandle(EvasObject parent);
+
+ public void Realize(EvasObject parent)
+ {
+ if(!IsRealized)
+ {
+ Parent = parent;
+ Handle = CreateHandle(parent);
+ Debug.Assert(Handle != IntPtr.Zero);
+ OnRealized();
+ _deleted = new Interop.EvasObjectEvent(this, Handle, Interop.Evas.ObjectCallbackType.Del);
+ _keydown = new Interop.EvasObjectEvent<EvasKeyEventArgs>(this, Handle, Interop.Evas.ObjectCallbackType.KeyDown, EvasKeyEventArgs.Create);
+ _keyup = new Interop.EvasObjectEvent<EvasKeyEventArgs>(this, Handle, Interop.Evas.ObjectCallbackType.KeyUp, EvasKeyEventArgs.Create);
+ _moved = new Interop.EvasObjectEvent(this, Handle, Interop.Evas.ObjectCallbackType.Move);
+ _resized = new Interop.EvasObjectEvent(this, Handle, Interop.Evas.ObjectCallbackType.Resize);
+
+ _deleted.On += (s, e) => MakeInvalidate();
+ _keydown.On += (s, e) => KeyDown?.Invoke(this, e);
+ _keyup.On += (s, e) => KeyUp?.Invoke(this, e);
+
+ }
+ }
+
+ public void Unrealize()
+ {
+ if (IsRealized)
+ {
+ OnUnrealize();
+ Interop.Evas.evas_object_del(Handle);
+ Handle = IntPtr.Zero;
+ Parent = null;
+ _deleted = null;
+ }
+ }
+ }
+}
--- /dev/null
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ElmSharp
+{
+ public enum GenGridSelectionMode
+ {
+ Default = 0,
+ Always,
+ None,
+ DisplayOnly,
+ }
+
+ public class GenGridItemEventArgs : EventArgs
+ {
+ public GenGridItem Item { get; set; }
+
+ internal static GenGridItemEventArgs CreateFromSmartEvent(IntPtr data, IntPtr obj, IntPtr info)
+ {
+ GenGridItem item = ItemObject.GetItemByHandle(info) as GenGridItem;
+ return new GenGridItemEventArgs() { Item = item };
+ }
+ }
+
+ public class GenGrid : Layout
+ {
+ HashSet<GenGridItem> _children = new HashSet<GenGridItem>();
+
+ Interop.SmartEvent<GenGridItemEventArgs> _selected;
+ Interop.SmartEvent<GenGridItemEventArgs> _unselected;
+ Interop.SmartEvent<GenGridItemEventArgs> _activated;
+ Interop.SmartEvent<GenGridItemEventArgs> _pressed;
+ Interop.SmartEvent<GenGridItemEventArgs> _released;
+ Interop.SmartEvent<GenGridItemEventArgs> _doubleClicked;
+ Interop.SmartEvent<GenGridItemEventArgs> _realized;
+ Interop.SmartEvent<GenGridItemEventArgs> _unrealized;
+ Interop.SmartEvent<GenGridItemEventArgs> _longpressed;
+
+ public GenGrid(EvasObject parent) : base(parent)
+ {
+ InitializeSmartEvent();
+ }
+
+ public event EventHandler<GenGridItemEventArgs> ItemSelected;
+ public event EventHandler<GenGridItemEventArgs> ItemUnselected;
+ public event EventHandler<GenGridItemEventArgs> ItemPressed;
+ public event EventHandler<GenGridItemEventArgs> ItemReleased;
+ public event EventHandler<GenGridItemEventArgs> ItemActivated;
+ public event EventHandler<GenGridItemEventArgs> ItemDoubleClicked;
+ public event EventHandler<GenGridItemEventArgs> ItemRealized;
+ public event EventHandler<GenGridItemEventArgs> ItemUnrealized;
+ public event EventHandler<GenGridItemEventArgs> ItemLongPressed;
+
+ public double ItemAlignmentX
+ {
+ get
+ {
+ double align;
+ Interop.Elementary.elm_gengrid_align_get(Handle, out align, IntPtr.Zero);
+ return align;
+ }
+ set
+ {
+ double aligny = ItemAlignmentY;
+ Interop.Elementary.elm_gengrid_align_set(Handle, value, aligny);
+ }
+ }
+
+ public double ItemAlignmentY
+ {
+ get
+ {
+ double align;
+ Interop.Elementary.elm_gengrid_align_get(Handle, IntPtr.Zero, out align);
+ return align;
+ }
+ set
+ {
+ double alignx = ItemAlignmentX;
+ Interop.Elementary.elm_gengrid_align_set(Handle, alignx, value);
+ }
+ }
+
+ public bool FillItems
+ {
+ get
+ {
+ return Interop.Elementary.elm_gengrid_filled_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_gengrid_filled_set(Handle, value);
+ }
+ }
+
+ public bool MultipleSelection
+ {
+ get
+ {
+ return Interop.Elementary.elm_gengrid_multi_select_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_gengrid_multi_select_set(Handle, value);
+ }
+ }
+
+ public int ItemWidth
+ {
+ get
+ {
+ int width;
+ Interop.Elementary.elm_gengrid_item_size_get(Handle, out width, IntPtr.Zero);
+ return width;
+ }
+ set
+ {
+ int height = ItemHeight;
+ Interop.Elementary.elm_gengrid_item_size_set(Handle, value, height);
+
+ }
+ }
+
+ public int ItemHeight
+ {
+ get
+ {
+ int height;
+ Interop.Elementary.elm_gengrid_item_size_get(Handle, IntPtr.Zero, out height);
+ return height;
+ }
+ set
+ {
+ int width = ItemWidth;
+ Interop.Elementary.elm_gengrid_item_size_set(Handle, width, value);
+ }
+ }
+
+ public GenGridSelectionMode SelectionMode
+ {
+ get
+ {
+ return (GenGridSelectionMode)Interop.Elementary.elm_gengrid_select_mode_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_gengrid_select_mode_set(Handle, (int)value);
+ }
+ }
+
+ public bool IsHorizontal
+ {
+ get
+ {
+ return Interop.Elementary.elm_gengrid_horizontal_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_gengrid_horizontal_set(Handle, value);
+ }
+ }
+
+ public GenGridItem Append(GenItemClass itemClass, object data)
+ {
+ GenGridItem item = new GenGridItem(data, itemClass);
+ IntPtr handle = Interop.Elementary.elm_gengrid_item_append(Handle, itemClass.UnmanagedPtr, (IntPtr)item.Id, null, (IntPtr)item.Id);
+ item.Handle = handle;
+ AddInternal(item);
+ return item;
+ }
+
+ public GenGridItem Prepend(GenItemClass itemClass, object data)
+ {
+ GenGridItem item = new GenGridItem(data, itemClass);
+ IntPtr handle = Interop.Elementary.elm_gengrid_item_prepend(Handle, itemClass.UnmanagedPtr, (IntPtr)item.Id, null, (IntPtr)item.Id);
+ item.Handle = handle;
+ AddInternal(item);
+ return item;
+ }
+
+ public GenGridItem InsertBefore(GenItemClass itemClass, object data, GenGridItem before)
+ {
+ GenGridItem item = new GenGridItem(data, itemClass);
+ IntPtr handle = Interop.Elementary.elm_gengrid_item_insert_before(Handle, itemClass.UnmanagedPtr, (IntPtr)item.Id, before, null, (IntPtr)item.Id);
+ item.Handle = handle;
+ AddInternal(item);
+ return item;
+ }
+
+ public void ScrollTo(GenGridItem item, ScrollToPosition position, bool animated)
+ {
+ if (animated)
+ {
+ Interop.Elementary.elm_gengrid_item_bring_in(item.Handle, (int)position);
+ }
+ else
+ {
+ Interop.Elementary.elm_gengrid_item_show(item.Handle, (int)position);
+ }
+ }
+
+ public void UpdateRealizedItems()
+ {
+ Interop.Elementary.elm_gengrid_realized_items_update(Handle);
+ }
+
+ internal override IntPtr CreateHandle(EvasObject parent)
+ {
+ return Interop.Elementary.elm_gengrid_add(parent);
+ }
+
+ void InitializeSmartEvent()
+ {
+ _selected = new Interop.SmartEvent<GenGridItemEventArgs>(this, Handle, "selected", GenGridItemEventArgs.CreateFromSmartEvent);
+ _unselected = new Interop.SmartEvent<GenGridItemEventArgs>(this, Handle, "unselected", GenGridItemEventArgs.CreateFromSmartEvent);
+ _activated = new Interop.SmartEvent<GenGridItemEventArgs>(this, Handle, "activated", GenGridItemEventArgs.CreateFromSmartEvent);
+ _pressed = new Interop.SmartEvent<GenGridItemEventArgs>(this, Handle, "pressed", GenGridItemEventArgs.CreateFromSmartEvent);
+ _released = new Interop.SmartEvent<GenGridItemEventArgs>(this, Handle, "released", GenGridItemEventArgs.CreateFromSmartEvent);
+ _doubleClicked = new Interop.SmartEvent<GenGridItemEventArgs>(this, Handle, "clicked,double", GenGridItemEventArgs.CreateFromSmartEvent);
+ _realized = new Interop.SmartEvent<GenGridItemEventArgs>(this, Handle, "realized", GenGridItemEventArgs.CreateFromSmartEvent);
+ _unrealized = new Interop.SmartEvent<GenGridItemEventArgs>(this, Handle, "unrealized", GenGridItemEventArgs.CreateFromSmartEvent);
+ _longpressed = new Interop.SmartEvent<GenGridItemEventArgs>(this, Handle, "longpressed", GenGridItemEventArgs.CreateFromSmartEvent);
+
+ _selected.On += (s, e) => { ItemSelected?.Invoke(this, e); };
+ _unselected.On += (s, e) => { ItemUnselected?.Invoke(this, e); };
+ _activated.On += (s, e) => { ItemActivated?.Invoke(this, e); };
+ _pressed.On += (s, e) => { ItemPressed?.Invoke(this, e); };
+ _released.On += (s, e) => { ItemReleased?.Invoke(this, e); };
+ _doubleClicked.On += (s, e) => { ItemDoubleClicked?.Invoke(this, e); };
+ _realized.On += (s, e) => { ItemRealized?.Invoke(this, e); };
+ _unrealized.On += (s, e) => { ItemUnrealized?.Invoke(this, e); };
+ _longpressed.On += (s, e) => { ItemLongPressed?.Invoke(this, e); };
+
+ }
+
+ void AddInternal(GenGridItem item)
+ {
+ _children.Add(item);
+ item.Deleted += Item_Deleted;
+ }
+
+ void Item_Deleted(object sender, EventArgs e)
+ {
+ _children.Remove((GenGridItem)sender);
+ }
+ }
+}
--- /dev/null
+using System;
+
+namespace ElmSharp
+{
+ public class GenGridItem : GenItem
+ {
+ internal GenGridItem(object data, GenItemClass itemClass) : base(data, itemClass)
+ {
+ }
+
+ public override bool IsSelected
+ {
+ get
+ {
+ return Interop.Elementary.elm_gengrid_item_selected_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_gengrid_item_selected_set(Handle, value);
+ }
+ }
+
+ public override void Update()
+ {
+ Interop.Elementary.elm_gengrid_item_update(Handle);
+ }
+ }
+}
--- /dev/null
+using System;
+
+namespace ElmSharp
+{
+ public abstract class GenItem : ItemObject
+ {
+ internal GenItem(object data, GenItemClass itemClass) : base(IntPtr.Zero)
+ {
+ Data = data;
+ ItemClass = ItemClass;
+ }
+
+ public GenItemClass ItemClass { get; private set; }
+ public object Data { get; private set; }
+ public abstract bool IsSelected { get; set; }
+ public abstract void Update();
+ protected override void OnInvalidate()
+ {
+ Data = null;
+ ItemClass = null;
+ }
+ }
+}
--- /dev/null
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.InteropServices;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ElmSharp
+{
+ public class GenItemClass : IDisposable
+ {
+ public delegate string GetTextDelegate(object data, string part);
+ public delegate EvasObject GetContentDelegate(object data, string part);
+ public delegate void DeleteDelegate(object data);
+
+ private ItemClass _itemClass;
+ private IntPtr _unmanagedPtr = IntPtr.Zero;
+ private string _style;
+
+ public GenItemClass(string style)
+ {
+ _style = style;
+ _itemClass = new ItemClass()
+ {
+ refCount = 1,
+ deleteMe = 0,
+ itemStyle = style,
+ textCallback = GetTextCallback,
+ contentCallback = GetContentCallback,
+ stateCallback = null,
+ delCallback = DelCallback,
+ };
+ }
+
+ ~GenItemClass()
+ {
+ Dispose(false);
+ }
+
+ public string ItemStyle { get { return _style; } }
+ public GetTextDelegate GetTextHandler { get; set; }
+ public GetContentDelegate GetContentHandler { get; set; }
+ public DeleteDelegate DeleteHandler { get; set; }
+
+ internal IntPtr UnmanagedPtr
+ {
+ get
+ {
+ if (_unmanagedPtr == IntPtr.Zero)
+ {
+ _unmanagedPtr = Marshal.AllocHGlobal(Marshal.SizeOf(_itemClass));
+ Marshal.StructureToPtr(_itemClass, _unmanagedPtr, false);
+ }
+ return _unmanagedPtr;
+ }
+ }
+
+ protected virtual void Dispose(bool disposing)
+ {
+ if (_unmanagedPtr != IntPtr.Zero)
+ {
+ Marshal.FreeHGlobal(_unmanagedPtr);
+ _unmanagedPtr = IntPtr.Zero;
+ }
+ }
+
+ /// <summary>
+ /// Releases all resources used by the class.
+ /// </summary>
+ public void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+
+ private string GetTextCallback(IntPtr data, IntPtr obj, IntPtr part)
+ {
+ GenItem item = ItemObject.GetItemById((int)data) as GenItem;
+ return GetTextHandler?.Invoke(item?.Data, Marshal.PtrToStringAnsi(part));
+ }
+ private IntPtr GetContentCallback(IntPtr data, IntPtr obj, IntPtr part)
+ {
+ GenItem item = ItemObject.GetItemById((int)data) as GenItem;
+ return GetContentHandler?.Invoke(item?.Data, Marshal.PtrToStringAnsi(part));
+ }
+ private void DelCallback(IntPtr data, IntPtr obj)
+ {
+ GenItem item = ItemObject.GetItemById((int)data) as GenItem;
+ DeleteHandler?.Invoke(item?.Data);
+ }
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal class ItemClass
+ {
+ public delegate string GetTextCallback(IntPtr data, IntPtr obj, IntPtr part);
+ public delegate IntPtr GetContentCallback(IntPtr data, IntPtr obj, IntPtr part);
+ public delegate int GetStateCallback(IntPtr data, IntPtr obj, IntPtr part);
+ public delegate void DelCallback(IntPtr data, IntPtr obj);
+ public delegate int FilterCallback(IntPtr data, IntPtr obj, IntPtr key);
+
+ public readonly int version;
+ public uint refCount;
+ public int deleteMe;
+ public string itemStyle;
+ public readonly string decorateItemStyle;
+ public readonly string decorateAllItemStyle;
+ public GetTextCallback textCallback;
+ public GetContentCallback contentCallback;
+ public GetStateCallback stateCallback;
+ public DelCallback delCallback;
+ public FilterCallback filterCallback;
+ }
+
+}
--- /dev/null
+using System;
+using System.Collections.Generic;
+
+namespace ElmSharp
+{
+ public enum GenListItemType
+ {
+ Normal = 0,
+ Tree = (1 << 0),
+ Group = (1 << 1),
+ }
+
+ public enum GenListMode
+ {
+ Compress = 0,
+ Scroll,
+ Limit,
+ Expand
+ }
+
+ public class GenListItemEventArgs : EventArgs
+ {
+ public GenListItem Item { get; set; }
+
+ internal static GenListItemEventArgs CreateFromSmartEvent(IntPtr data, IntPtr obj, IntPtr info)
+ {
+ GenListItem item = ItemObject.GetItemByHandle(info) as GenListItem;
+ return new GenListItemEventArgs() { Item = item };
+ }
+ }
+
+ public enum ScrollToPosition
+ {
+ None = 0, // Scrolls to nowhere
+ In = (1 << 0), // Scrolls to the nearest viewport
+ Top = (1 << 1), // Scrolls to the top of the viewport
+ Middle = (1 << 2), // Scrolls to the middle of the viewport
+ Bottom = (1 << 3) // Scrolls to the bottom of the viewport
+ }
+
+ public class GenList : Layout
+ {
+ HashSet<GenListItem> _children = new HashSet<GenListItem>();
+
+ Interop.SmartEvent<GenListItemEventArgs> _selected;
+ Interop.SmartEvent<GenListItemEventArgs> _unselected;
+ Interop.SmartEvent<GenListItemEventArgs> _activated;
+ Interop.SmartEvent<GenListItemEventArgs> _pressed;
+ Interop.SmartEvent<GenListItemEventArgs> _released;
+ Interop.SmartEvent<GenListItemEventArgs> _doubleClicked;
+ Interop.SmartEvent<GenListItemEventArgs> _expanded;
+ Interop.SmartEvent<GenListItemEventArgs> _realized;
+ Interop.SmartEvent<GenListItemEventArgs> _unrealized;
+ Interop.SmartEvent<GenListItemEventArgs> _longpressed;
+
+ public GenList(EvasObject parent) : base(parent)
+ {
+ InitializeSmartEvent();
+ }
+
+ public bool Homogeneous
+ {
+ get
+ {
+ return Interop.Elementary.elm_genlist_homogeneous_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_genlist_homogeneous_set(Handle, value);
+ }
+ }
+
+ public GenListMode ListMode
+ {
+ get
+ {
+ return (GenListMode)Interop.Elementary.elm_genlist_mode_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_genlist_mode_set(Handle, (int)value);
+ }
+ }
+
+ public event EventHandler<GenListItemEventArgs> ItemSelected;
+ public event EventHandler<GenListItemEventArgs> ItemUnselected;
+ public event EventHandler<GenListItemEventArgs> ItemPressed;
+ public event EventHandler<GenListItemEventArgs> ItemReleased;
+ public event EventHandler<GenListItemEventArgs> ItemActivated;
+ public event EventHandler<GenListItemEventArgs> ItemDoubleClicked;
+ public event EventHandler<GenListItemEventArgs> ItemExpanded;
+ public event EventHandler<GenListItemEventArgs> ItemRealized;
+ public event EventHandler<GenListItemEventArgs> ItemUnrealized;
+ public event EventHandler<GenListItemEventArgs> ItemLongPressed;
+
+ public GenListItem Append(GenItemClass itemClass, object data)
+ {
+ return Append(itemClass, data, GenListItemType.Normal);
+ }
+
+ public GenListItem Append(GenItemClass itemClass, object data, GenListItemType type)
+ {
+ return Append(itemClass, data, type, null);
+ }
+
+ public GenListItem Append(GenItemClass itemClass, object data, GenListItemType type, GenListItem parent)
+ {
+ GenListItem item = new GenListItem(data, itemClass);
+ IntPtr handle = Interop.Elementary.elm_genlist_item_append(Handle, itemClass.UnmanagedPtr, (IntPtr)item.Id, parent, (int)type, null, (IntPtr)item.Id);
+ item.Handle = handle;
+ AddInternal(item);
+ return item;
+ }
+
+ public GenListItem Prepend(GenItemClass itemClass, object data)
+ {
+ return Prepend(itemClass, data, GenListItemType.Normal);
+ }
+
+ public GenListItem Prepend(GenItemClass itemClass, object data, GenListItemType type)
+ {
+ return Prepend(itemClass, data, type, null);
+ }
+
+ public GenListItem Prepend(GenItemClass itemClass, object data, GenListItemType type, GenListItem parent)
+ {
+ GenListItem item = new GenListItem(data, itemClass);
+ IntPtr handle = Interop.Elementary.elm_genlist_item_prepend(Handle, itemClass.UnmanagedPtr, (IntPtr)item.Id, parent, (int)type, null, (IntPtr)item.Id);
+ item.Handle = handle;
+ AddInternal(item);
+ return item;
+ }
+
+ public GenListItem InsertBefore(GenItemClass itemClass, object data, GenListItem before)
+ {
+ return InsertBefore(itemClass, data, before, GenListItemType.Normal);
+ }
+ public GenListItem InsertBefore(GenItemClass itemClass, object data, GenListItem before, GenListItemType type)
+ {
+ return InsertBefore(itemClass, data, before, type, null);
+ }
+ public GenListItem InsertBefore(GenItemClass itemClass, object data, GenListItem before, GenListItemType type, GenListItem parent)
+ {
+ GenListItem item = new GenListItem(data, itemClass);
+ // insert before the `before` list item
+ IntPtr handle = Interop.Elementary.elm_genlist_item_insert_before(
+ Handle, // genlist handle
+ itemClass.UnmanagedPtr, // item class
+ (IntPtr)item.Id, // data
+ parent, // parent
+ before, // before
+ (int)type, // item type
+ null, // select callback
+ (IntPtr)item.Id); // callback data
+ item.Handle = handle;
+ AddInternal(item);
+ return item;
+ }
+
+ public void ScrollTo(GenListItem item, ScrollToPosition position, bool animated)
+ {
+ if (animated)
+ {
+ Interop.Elementary.elm_genlist_item_bring_in(item.Handle, (Interop.Elementary.Elm_Genlist_Item_Scrollto_Type)position);
+ }
+ else
+ {
+ Interop.Elementary.elm_genlist_item_show(item.Handle, (Interop.Elementary.Elm_Genlist_Item_Scrollto_Type)position);
+ }
+ }
+
+ public void UpdateRealizedItems()
+ {
+ Interop.Elementary.elm_genlist_realized_items_update(Handle);
+ }
+
+ internal override IntPtr CreateHandle(EvasObject parent)
+ {
+ return Interop.Elementary.elm_genlist_add(parent);
+ }
+
+ void InitializeSmartEvent()
+ {
+ _selected = new Interop.SmartEvent<GenListItemEventArgs>(this, Handle, "selected", GenListItemEventArgs.CreateFromSmartEvent);
+ _unselected = new Interop.SmartEvent<GenListItemEventArgs>(this, Handle, "unselected", GenListItemEventArgs.CreateFromSmartEvent);
+ _activated = new Interop.SmartEvent<GenListItemEventArgs>(this, Handle, "activated", GenListItemEventArgs.CreateFromSmartEvent);
+ _pressed = new Interop.SmartEvent<GenListItemEventArgs>(this, Handle, "pressed", GenListItemEventArgs.CreateFromSmartEvent);
+ _released = new Interop.SmartEvent<GenListItemEventArgs>(this, Handle, "released", GenListItemEventArgs.CreateFromSmartEvent);
+ _doubleClicked = new Interop.SmartEvent<GenListItemEventArgs>(this, Handle, "clicked,double", GenListItemEventArgs.CreateFromSmartEvent);
+ _expanded = new Interop.SmartEvent<GenListItemEventArgs>(this, Handle, "expanded", GenListItemEventArgs.CreateFromSmartEvent);
+ _realized = new Interop.SmartEvent<GenListItemEventArgs>(this, Handle, "realized", GenListItemEventArgs.CreateFromSmartEvent);
+ _unrealized = new Interop.SmartEvent<GenListItemEventArgs>(this, Handle, "unrealized", GenListItemEventArgs.CreateFromSmartEvent);
+ _longpressed = new Interop.SmartEvent<GenListItemEventArgs>(this, Handle, "longpressed", GenListItemEventArgs.CreateFromSmartEvent);
+
+ _selected.On += (s, e) => { ItemSelected?.Invoke(this, e); };
+ _unselected.On += (s, e) => { ItemUnselected?.Invoke(this, e); };
+ _activated.On += (s, e) => { ItemActivated?.Invoke(this, e); };
+ _pressed.On += (s, e) => { ItemPressed?.Invoke(this, e); };
+ _released.On += (s, e) => { ItemReleased?.Invoke(this, e); };
+ _doubleClicked.On += (s, e) => { ItemDoubleClicked?.Invoke(this, e); };
+ _expanded.On += (s, e) => { ItemExpanded?.Invoke(this, e); };
+ _realized.On += (s, e) => { ItemRealized?.Invoke(this, e); };
+ _unrealized.On += (s, e) => { ItemUnrealized?.Invoke(this, e); };
+ _longpressed.On += (s, e) => { ItemLongPressed?.Invoke(this, e); };
+
+ }
+
+ void AddInternal(GenListItem item)
+ {
+ _children.Add(item);
+ item.Deleted += Item_Deleted;
+ }
+
+ void Item_Deleted(object sender, EventArgs e)
+ {
+ _children.Remove((GenListItem)sender);
+ }
+ }
+}
--- /dev/null
+using System;
+
+namespace ElmSharp
+{
+ public class GenListItem : GenItem
+ {
+ internal GenListItem(object data, GenItemClass itemClass) : base(data, itemClass)
+ {
+ }
+
+ public override bool IsSelected
+ {
+ get
+ {
+ return Interop.Elementary.elm_genlist_item_selected_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_genlist_item_selected_set(Handle, value);
+ }
+ }
+
+ public override void Update()
+ {
+ Interop.Elementary.elm_genlist_item_update(Handle);
+ }
+ }
+}
--- /dev/null
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ElmSharp
+{
+ public enum IconLookupOrder
+ {
+ FreeDesktopFirst = 0,
+ ThemeFirst,
+ FreeDesktopOnly,
+ ThemeOnly
+ }
+ public class Icon : Image
+ {
+ public Icon(EvasObject parent) : base(parent)
+ {
+ }
+
+ public string StandardIconName
+ {
+ get
+ {
+ return Interop.Elementary.elm_icon_standard_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_icon_standard_set(Handle, value);
+ }
+ }
+
+ public IconLookupOrder IconLookupOrder
+ {
+ get
+ {
+ return (IconLookupOrder)Interop.Elementary.elm_icon_order_lookup_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_icon_order_lookup_set(Handle, (int)value);
+ }
+ }
+
+ public void SetThumb(string file, string group)
+ {
+ Interop.Elementary.elm_icon_thumb_set(Handle, file, group);
+ }
+
+ internal override IntPtr CreateHandle(EvasObject parent)
+ {
+ return Interop.Elementary.elm_icon_add(parent);
+ }
+ }
+}
--- /dev/null
+using System;
+using System.IO;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace ElmSharp
+{
+ public class Image : Widget
+ {
+ bool _canScaleUp = true;
+ bool _canScaleDown = true;
+ Interop.SmartEvent _clicked;
+
+ public Image(EvasObject parent) : base(parent)
+ {
+ _clicked = new Interop.SmartEvent(this, Handle, "clicked");
+ _clicked.On += (s, e) =>
+ {
+ Clicked?.Invoke(this, EventArgs.Empty);
+ };
+ }
+
+ public event EventHandler Clicked;
+ public event EventHandler LoadingCompleted;
+ public event EventHandler LoadingFailed;
+
+ public string File
+ {
+ get
+ {
+ return Interop.Elementary.elm_image_file_get(Handle);
+ }
+ }
+
+ public bool IsSmooth
+ {
+ get
+ {
+ return Interop.Elementary.elm_image_smooth_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_image_smooth_set(Handle, value);
+ }
+ }
+
+ public bool IsScaling
+ {
+ get
+ {
+ return !Interop.Elementary.elm_image_no_scale_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_image_no_scale_set(Handle, !value);
+ }
+ }
+
+ public bool CanScaleDown
+ {
+ get
+ {
+ return _canScaleDown;
+ }
+ set
+ {
+ _canScaleDown = value;
+ Interop.Elementary.elm_image_resizable_set(Handle, _canScaleUp, _canScaleDown);
+ }
+ }
+
+ public bool CanScaleUp
+ {
+ get
+ {
+ return _canScaleUp;
+ }
+ set
+ {
+ _canScaleUp = value;
+ Interop.Elementary.elm_image_resizable_set(Handle, _canScaleUp, _canScaleDown);
+ }
+ }
+
+ public bool CanFillOutside
+ {
+ get
+ {
+ return Interop.Elementary.elm_image_fill_outside_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_image_fill_outside_set(Handle, value);
+ }
+ }
+
+ public int PrescaleSize
+ {
+ get
+ {
+ return Interop.Elementary.elm_image_prescale_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_image_prescale_set(Handle, value);
+ }
+ }
+
+ public bool IsFixedAspect
+ {
+ get
+ {
+ return Interop.Elementary.elm_image_aspect_fixed_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_image_aspect_fixed_set(Handle, value);
+ }
+ }
+
+ public bool IsAnimated
+ {
+ get
+ {
+ return Interop.Elementary.elm_image_animated_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_image_animated_set(Handle, value);
+ }
+ }
+
+ public bool IsAnimatedAvailable
+ {
+ get
+ {
+ return Interop.Elementary.elm_image_animated_available_get(Handle);
+ }
+ }
+
+ public bool IsAnimationPlaying
+ {
+ get
+ {
+ return Interop.Elementary.elm_image_animated_play_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_image_animated_play_set(Handle, value);
+ }
+ }
+
+ public bool IsEditable
+ {
+ get
+ {
+ return Interop.Elementary.elm_image_editable_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_image_editable_set(Handle, value);
+ }
+ }
+
+ public Size ObjectSize
+ {
+ get
+ {
+ int w, h;
+ Interop.Elementary.elm_image_object_size_get(Handle, out w, out h);
+ return new Size(w, h);
+ }
+ }
+
+ public bool IsOpaque
+ {
+ get
+ {
+ IntPtr evasObj = Interop.Elementary.elm_image_object_get(Handle);
+ if (evasObj != IntPtr.Zero)
+ {
+ return !Interop.Evas.evas_object_image_alpha_get(evasObj);
+ }
+ return false;
+ }
+ set
+ {
+ IntPtr evasObj = Interop.Elementary.elm_image_object_get(Handle);
+ if (evasObj != IntPtr.Zero)
+ {
+ Interop.Evas.evas_object_image_alpha_set(evasObj, !value);
+ }
+ }
+ }
+
+
+ public ImageOrientation Orientation
+ {
+ get
+ {
+ return (ImageOrientation)Interop.Elementary.elm_image_orient_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_image_orient_set(Handle, (int)value);
+ }
+ }
+
+ public void Load(string file)
+ {
+ 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");
+ }
+
+ LoadingCompleted?.Invoke(this, EventArgs.Empty);
+ }
+
+ public unsafe void Load(byte* img, long size)
+ {
+ bool ret = Interop.Elementary.elm_image_memfile_set(Handle, img, size, IntPtr.Zero, IntPtr.Zero);
+ if (!ret)
+ {
+ Console.WriteLine("Failed to set memory buffer to Image");
+ }
+
+ LoadingCompleted?.Invoke(this, EventArgs.Empty);
+ }
+
+ public void LoadAsync(Uri uri)
+ {
+ if (uri.IsFile)
+ LoadFromFileAsync(uri.LocalPath);
+ else
+ LoadFromUriAsync(uri.AbsoluteUri);
+ }
+
+ public async Task<bool> LoadAsync(Stream stream, CancellationToken cancellationToken)
+ {
+ var tcs = new TaskCompletionSource<bool>();
+
+ Interop.Elementary.elm_image_preload_disabled_set(Handle, false);
+
+ cancellationToken.Register(() =>
+ {
+ if (tcs != null && !tcs.Task.IsCompleted)
+ {
+ tcs.SetCanceled();
+ }
+ });
+
+ MemoryStream memstream = new MemoryStream();
+ await stream.CopyToAsync(memstream);
+
+ unsafe
+ {
+ 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;
+ }
+ }
+ }
+
+ 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) =>
+ {
+ preloadedCallback.Dispose();
+ if (tcs != null && !tcs.Task.IsCompleted)
+ {
+ tcs.SetResult(true);
+ }
+ };
+
+ return await tcs.Task;
+ }
+
+
+ internal override IntPtr CreateHandle(EvasObject parent)
+ {
+ return Interop.Elementary.elm_image_add(parent.Handle);
+ }
+
+ void LoadFromFileAsync(string file)
+ {
+ 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) =>
+ {
+ preloadedCallback.Dispose();
+ LoadingCompleted?.Invoke(this, EventArgs.Empty);
+ };
+ }
+
+ 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) =>
+ {
+ downloadDone.Dispose();
+ LoadingCompleted?.Invoke(this, EventArgs.Empty);
+ };
+ Interop.SmartEvent downloadError = new Interop.SmartEvent(this, Handle, "download,error");
+ downloadError.On += (s, e) =>
+ {
+ downloadError.Dispose();
+ LoadingFailed?.Invoke(this, EventArgs.Empty);
+ };
+
+ bool ret = Interop.Elementary.elm_image_file_set(Handle, path, null);
+ if (!ret)
+ {
+ throw new InvalidOperationException("Failed to set file to Image");
+ }
+ }
+ }
+
+ public enum ImageOrientation : int
+ {
+ None = 0,
+ Rotate90,
+ Rotate180,
+ Rotate270,
+ FlipHorizontal,
+ FlipVertical,
+ FlipTranspose,
+ FlipTransverse
+ }
+}
--- /dev/null
+using System;
+using System.Collections.Generic;
+
+namespace ElmSharp
+{
+ public class Index : Layout
+ {
+ HashSet<IndexItem> _children = new HashSet<IndexItem>();
+ Interop.SmartEvent _delayedChanged;
+
+ public Index(EvasObject parent) : base(parent)
+ {
+ _delayedChanged = new Interop.SmartEvent(this, Handle, "delay,changed");
+ _delayedChanged.On += _delayedChanged_On;
+ }
+
+ public event EventHandler Changed;
+
+ public bool AutoHide
+ {
+ get
+ {
+ return !Interop.Elementary.elm_index_autohide_disabled_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_index_autohide_disabled_set(Handle, !value);
+ }
+ }
+
+ public bool IsHorizontal
+ {
+ get
+ {
+ return Interop.Elementary.elm_index_horizontal_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_index_horizontal_set(Handle, value);
+ }
+ }
+
+ public bool IndicatorVisible
+ {
+ get
+ {
+ return !Interop.Elementary.elm_index_indicator_disabled_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_index_indicator_disabled_set(Handle, !value);
+ }
+ }
+
+ public bool OmitEnabled
+ {
+ get
+ {
+ return Interop.Elementary.elm_index_omit_enabled_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_index_omit_enabled_set(Handle, value);
+ }
+ }
+
+ public IndexItem SelectedItem
+ {
+ get
+ {
+ IntPtr handle = Interop.Elementary.elm_index_selected_item_get(Handle, 0);
+ return ItemObject.GetItemByHandle(handle) as IndexItem;
+ }
+ }
+
+ public IndexItem Append(string label)
+ {
+ IndexItem item = new IndexItem(label);
+ item.Handle = Interop.Elementary.elm_index_item_append(Handle, label, null, (IntPtr)item.Id);
+ return item;
+ }
+
+ public IndexItem Prepend(string label)
+ {
+ IndexItem item = new IndexItem(label);
+ item.Handle = Interop.Elementary.elm_index_item_prepend(Handle, label, null, (IntPtr)item.Id);
+ return item;
+ }
+
+ public IndexItem InsertBefore(string label, IndexItem before)
+ {
+ IndexItem item = new IndexItem(label);
+ item.Handle = Interop.Elementary.elm_index_item_insert_before(Handle, before, label, null, (IntPtr)item.Id);
+ return item;
+ }
+
+ public void Update(int level)
+ {
+ Interop.Elementary.elm_index_level_go(Handle, level);
+ }
+
+ internal override IntPtr CreateHandle(EvasObject parent)
+ {
+ return Interop.Elementary.elm_index_add(parent);
+ }
+
+ void _delayedChanged_On(object sender, EventArgs e)
+ {
+ SelectedItem?.SendSelected();
+ Changed?.Invoke(this, e);
+ }
+
+ void AddInternal(IndexItem item)
+ {
+ _children.Add(item);
+ item.Deleted += Item_Deleted;
+ }
+
+ void Item_Deleted(object sender, EventArgs e)
+ {
+ _children.Remove((IndexItem)sender);
+ }
+ }
+}
--- /dev/null
+using System;
+namespace ElmSharp
+{
+ public class IndexItem : ItemObject
+ {
+ public IndexItem(string text) : base(IntPtr.Zero)
+ {
+ Text = text;
+ }
+
+ public event EventHandler Selected;
+ public string Text { get; private set; }
+
+ public void Select(bool selected)
+ {
+ Interop.Elementary.elm_index_item_selected_set(Handle, selected);
+ }
+ internal void SendSelected()
+ {
+ Selected?.Invoke(this, EventArgs.Empty);
+ }
+
+ }
+}
--- /dev/null
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ElmSharp
+{
+ public class ItemObject
+ {
+ private static Dictionary<int, ItemObject> s_IdToItemTable = new Dictionary<int, ItemObject>();
+ private static Dictionary<IntPtr, ItemObject> s_HandleToItemTable = new Dictionary<IntPtr, ItemObject>();
+ private static int s_globalId = 0;
+
+ Interop.Evas.SmartCallback _deleteCallback;
+ IntPtr _handle = IntPtr.Zero;
+
+ protected ItemObject(IntPtr handle)
+ {
+ _deleteCallback = DeleteCallbackHandler;
+ Id = GetNextId();
+ s_IdToItemTable[Id] = this;
+ Handle = handle;
+ }
+
+ ~ItemObject()
+ {
+ if (Handle != IntPtr.Zero)
+ Interop.Elementary.elm_object_item_del(Handle);
+ }
+
+ public int Id { get; private set; }
+
+ internal IntPtr Handle
+ {
+ get
+ {
+ return _handle;
+ }
+ set
+ {
+ if (_handle == value)
+ return;
+
+ if (_handle != IntPtr.Zero)
+ {
+ UnsetDeleteCallback();
+ }
+ _handle = value;
+ SetDeleteCallback();
+ s_HandleToItemTable[Handle] = this;
+ }
+ }
+
+ internal event EventHandler Deleted;
+
+ public void Delete()
+ {
+ Interop.Elementary.elm_object_item_del(Handle);
+ _handle = IntPtr.Zero;
+ }
+
+ public void SetPartContent(string part, EvasObject content)
+ {
+ SetPartContent(part, content, false);
+ }
+
+ public void SetPartContent(string part, EvasObject content, bool preserveOldContent)
+ {
+ if (preserveOldContent)
+ {
+ Interop.Elementary.elm_object_item_part_content_unset(Handle, part);
+ }
+ Interop.Elementary.elm_object_item_part_content_set(Handle, part, content);
+ }
+
+ public void SetPartText(string part, string text)
+ {
+ Interop.Elementary.elm_object_item_part_text_set(Handle, part, text);
+ }
+
+ public string GetPartText(string part)
+ {
+ return Interop.Elementary.elm_object_item_part_text_get(Handle, part);
+ }
+
+ public static implicit operator IntPtr(ItemObject obj)
+ {
+ if (obj == null)
+ return IntPtr.Zero;
+ return obj.Handle;
+ }
+
+ protected virtual void OnInvalidate() { }
+
+ internal static ItemObject GetItemById(int id)
+ {
+ ItemObject value;
+ s_IdToItemTable.TryGetValue(id, out value);
+ return value;
+ }
+
+ internal static ItemObject GetItemByHandle(IntPtr handle)
+ {
+ ItemObject value;
+ s_HandleToItemTable.TryGetValue(handle, out value);
+ return value;
+ }
+
+ void DeleteCallbackHandler(IntPtr data, IntPtr obj, IntPtr info)
+ {
+ Deleted?.Invoke(this, EventArgs.Empty);
+ OnInvalidate();
+ _handle = IntPtr.Zero;
+ }
+
+ void UnsetDeleteCallback()
+ {
+ Interop.Elementary.elm_object_item_del_cb_set(Handle, null);
+ }
+
+ void SetDeleteCallback()
+ {
+ if (Handle != IntPtr.Zero)
+ Interop.Elementary.elm_object_item_del_cb_set(Handle, _deleteCallback);
+ }
+
+ static int GetNextId()
+ {
+ return s_globalId++;
+ }
+ }
+}
--- /dev/null
+using System;
+
+namespace ElmSharp
+{
+ public class Label : Layout
+ {
+ Interop.SmartEvent _slideCompleted;
+
+ public Label(EvasObject parent) : base(parent)
+ {
+ _slideCompleted = new Interop.SmartEvent(this, Handle, "slide,end");
+ _slideCompleted.On += (s, e) =>
+ {
+ SlideCompleted?.Invoke(this, EventArgs.Empty);
+ };
+ }
+
+ public event EventHandler SlideCompleted;
+
+ public int LineWrapWidth
+ {
+ get
+ {
+ return Interop.Elementary.elm_label_wrap_width_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_label_wrap_width_set(Handle, value);
+ }
+ }
+
+ public WrapType LineWrapType
+ {
+ get
+ {
+ return (WrapType)Interop.Elementary.elm_label_line_wrap_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_label_line_wrap_set(Handle, (int)value);
+ }
+ }
+
+ public LabelSlideMode SlideMode
+ {
+ get
+ {
+ return (LabelSlideMode)Interop.Elementary.elm_label_slide_mode_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_label_slide_mode_set(Handle, (int)value);
+ }
+ }
+
+ public double SlideDuration
+ {
+ get
+ {
+ return Interop.Elementary.elm_label_slide_duration_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_label_slide_duration_set(Handle, value);
+ }
+ }
+
+ public bool IsEllipsis
+ {
+ get
+ {
+ return Interop.Elementary.elm_label_ellipsis_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_label_ellipsis_set(Handle, value);
+ }
+ }
+
+ public void PlaySlide()
+ {
+ Interop.Elementary.elm_label_slide_go(Handle);
+ }
+
+ internal override IntPtr CreateHandle(EvasObject parent)
+ {
+ return Interop.Elementary.elm_label_add(parent.Handle);
+ }
+ }
+
+ public enum LabelSlideMode
+ {
+ None = 0,
+ Auto,
+ Always
+ }
+}
--- /dev/null
+using System;
+
+namespace ElmSharp
+{
+ public class Layout : Widget
+ {
+ Interop.SmartEvent _languageChanged;
+ Interop.SmartEvent _themeChanged;
+
+ IntPtr _edjeHandle;
+
+ public Layout(EvasObject parent) : base(parent)
+ {
+ _languageChanged = new Interop.SmartEvent(this, Handle, "language,changed");
+ _languageChanged.On += (s, e) => {
+ LanguageChanged?.Invoke(this, EventArgs.Empty);
+ };
+
+ _themeChanged = new Interop.SmartEvent(this, Handle, "theme,changed");
+ _themeChanged.On += (s, e) =>
+ {
+ ThemeChanged?.Invoke(this, EventArgs.Empty);
+ };
+ }
+
+ public event EventHandler LanguageChanged;
+
+ public event EventHandler ThemeChanged;
+
+ public EdjeObject EdjeObject
+ {
+ get
+ {
+ if (_edjeHandle == IntPtr.Zero)
+ _edjeHandle = Interop.Elementary.elm_layout_edje_get(Handle);
+ return new EdjeObject(_edjeHandle);
+ }
+ }
+
+ public void SetTheme(string klass, string group, string style)
+ {
+ Interop.Elementary.elm_layout_theme_set(Handle, klass, group, style);
+ }
+
+ public void SetFile(string file, string group)
+ {
+ Interop.Elementary.elm_layout_file_set(Handle, file, group);
+ }
+
+ internal override IntPtr CreateHandle(EvasObject parent)
+ {
+ return Interop.Elementary.elm_layout_add(parent.Handle);
+ }
+ }
+}
--- /dev/null
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace ElmSharp
+{
+ public enum ListMode
+ {
+ Compress = 0,
+ Scroll,
+ Limit,
+ Expand
+ }
+
+ public class ListItemEventArgs : EventArgs
+ {
+ public ListItem Item { get; set; }
+ internal static ListItemEventArgs CreateFromSmartEvent(IntPtr data, IntPtr obj, IntPtr info)
+ {
+ ListItem item = ItemObject.GetItemByHandle(info) as ListItem;
+ return new ListItemEventArgs() { Item = item };
+ }
+ }
+
+ public class List : Layout
+ {
+ HashSet<ListItem> _children = new HashSet<ListItem>();
+ Interop.SmartEvent<ListItemEventArgs> _selected;
+ Interop.SmartEvent<ListItemEventArgs> _unselected;
+ Interop.SmartEvent<ListItemEventArgs> _doubleClicked;
+ Interop.SmartEvent<ListItemEventArgs> _longpressed;
+ Interop.SmartEvent<ListItemEventArgs> _activated;
+
+ public List(EvasObject parent) : base(parent)
+ {
+ _selected = new Interop.SmartEvent<ListItemEventArgs>(this, Handle, "selected", ListItemEventArgs.CreateFromSmartEvent);
+ _unselected = new Interop.SmartEvent<ListItemEventArgs>(this, Handle, "unselected", ListItemEventArgs.CreateFromSmartEvent);
+ _doubleClicked = new Interop.SmartEvent<ListItemEventArgs>(this, Handle, "clicked,double", ListItemEventArgs.CreateFromSmartEvent);
+ _longpressed = new Interop.SmartEvent<ListItemEventArgs>(this, Handle, "longpressed", ListItemEventArgs.CreateFromSmartEvent);
+ _activated = new Interop.SmartEvent<ListItemEventArgs>(this, Handle, "activated", ListItemEventArgs.CreateFromSmartEvent);
+ _selected.On += (s, e) => { ItemSelected?.Invoke(this, e); };
+ _unselected.On += (s, e) => { ItemUnselected?.Invoke(this, e); };
+ _doubleClicked.On += (s, e) => { ItemDoubleClicked?.Invoke(this, e); };
+ _longpressed.On += (s, e) => { ItemLongPressed?.Invoke(this, e); };
+ _activated.On += (s, e) => { ItemActivated?.Invoke(this, e); };
+ }
+
+ public ListMode Mode
+ {
+ get
+ {
+ return (ListMode)Interop.Elementary.elm_list_mode_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_list_mode_set(Handle, (Interop.Elementary.Elm_List_Mode)value);
+ }
+ }
+
+ public ListItem SelectedItem
+ {
+ get
+ {
+ IntPtr item = Interop.Elementary.elm_list_selected_item_get(Handle);
+ return ItemObject.GetItemByHandle(item) as ListItem;
+ }
+ }
+
+ public event EventHandler<ListItemEventArgs> ItemSelected;
+ public event EventHandler<ListItemEventArgs> ItemUnselected;
+ public event EventHandler<ListItemEventArgs> ItemDoubleClicked;
+ public event EventHandler<ListItemEventArgs> ItemLongPressed;
+ public event EventHandler<ListItemEventArgs> ItemActivated;
+
+ public void Update()
+ {
+ Interop.Elementary.elm_list_go(Handle);
+ }
+
+ public ListItem Append(string label)
+ {
+ return Append(label, null, null);
+ }
+
+ public ListItem Append(string label, EvasObject leftIcon, EvasObject rightIcon)
+ {
+ ListItem item = new ListItem(label, leftIcon, rightIcon);
+ item.Handle = Interop.Elementary.elm_list_item_append(Handle, label, leftIcon, rightIcon, null, (IntPtr)item.Id);
+ AddInternal(item);
+ return item;
+ }
+
+ public ListItem Prepend(string label)
+ {
+ return Prepend(label, null, null);
+ }
+
+ public ListItem Prepend(string label, EvasObject leftIcon, EvasObject rigthIcon)
+ {
+ ListItem item = new ListItem(label, leftIcon, rigthIcon);
+ item.Handle = Interop.Elementary.elm_list_item_prepend(Handle, label, leftIcon, rigthIcon, null, (IntPtr)item.Id);
+ AddInternal(item);
+ return item;
+ }
+
+ public void Clear()
+ {
+ Interop.Elementary.elm_list_clear(Handle);
+ foreach (var item in _children)
+ {
+ item.Deleted -= Item_Deleted;
+ }
+ _children.Clear();
+ }
+
+ internal override IntPtr CreateHandle(EvasObject parent)
+ {
+ return Interop.Elementary.elm_list_add(parent);
+ }
+
+ void AddInternal(ListItem item)
+ {
+ _children.Add(item);
+ item.Deleted += Item_Deleted;
+ }
+
+ void Item_Deleted(object sender, EventArgs e)
+ {
+ _children.Remove((ListItem)sender);
+ }
+ }
+}
--- /dev/null
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ElmSharp
+{
+ public class ListItem : ItemObject
+ {
+ internal ListItem(string text, EvasObject leftIcon, EvasObject rightIcon) : base(IntPtr.Zero)
+ {
+ Text = text;
+ LeftIcon = LeftIcon;
+ RightIcon = RightIcon;
+ }
+
+ public string Text { get; internal set; }
+ public EvasObject LeftIcon { get; internal set; }
+ public EvasObject RightIcon { get; internal set; }
+ }
+}
--- /dev/null
+using System;
+
+namespace ElmSharp
+{
+ public class NaviItem : ItemObject
+ {
+ EvasObject _content;
+ bool _isPopped;
+ Interop.Elementary.Elm_Naviframe_Item_Pop_Cb _popped;
+ NaviItem(IntPtr handle, EvasObject content) : base(handle)
+ {
+ _isPopped = false;
+ _content = content;
+ _popped = (d, i) =>
+ {
+ _isPopped = true;
+ Popped?.Invoke(this, EventArgs.Empty);
+ return true;
+ };
+ }
+
+ public event EventHandler Popped;
+
+ public EvasObject Content
+ {
+ get { return _content; }
+ }
+
+ public bool TitleBarVisible
+ {
+ get
+ {
+ return Interop.Elementary.elm_naviframe_item_title_enabled_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_naviframe_item_title_enabled_set(Handle, value, false);
+ }
+ }
+
+ protected override void OnInvalidate()
+ {
+ if (!_isPopped)
+ Popped?.Invoke(this, EventArgs.Empty);
+ }
+
+ internal static NaviItem FromNativeHandle(IntPtr handle, EvasObject content)
+ {
+ return new NaviItem(handle, content);
+ }
+ }
+}
--- /dev/null
+using System;
+using System.Collections.Generic;
+
+namespace ElmSharp
+{
+ public class NaviframeEventArgs : EventArgs
+ {
+ public EvasObject Content { get; set; }
+ }
+ public class Naviframe : Widget
+ {
+ Interop.SmartEvent _transitionFinished;
+ readonly List<NaviItem> _itemStack = new List<NaviItem>();
+ public Naviframe(EvasObject parent) : base(parent)
+ {
+ _transitionFinished = new Interop.SmartEvent(this, Handle, "transition,finished");
+ _transitionFinished.On += (s, e) => AnimationFinished?.Invoke(this, EventArgs.Empty);
+ }
+
+ public event EventHandler<NaviframeEventArgs> Popped;
+ public event EventHandler AnimationFinished;
+ public IReadOnlyList<NaviItem> NavigationStack
+ {
+ get { return _itemStack; }
+ }
+
+ public bool PreserveContentOnPop
+ {
+ get
+ {
+ return Interop.Elementary.elm_naviframe_content_preserve_on_pop_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_naviframe_content_preserve_on_pop_set(Handle, value);
+ }
+ }
+
+ public bool DefaultBackButtonEnabled
+ {
+ get
+ {
+ return Interop.Elementary.elm_naviframe_prev_btn_auto_pushed_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_naviframe_prev_btn_auto_pushed_set(Handle, value);
+ }
+ }
+
+ public NaviItem Push(EvasObject content)
+ {
+ return Push(content, null);
+ }
+ public NaviItem Push(EvasObject content, string title)
+ {
+ IntPtr item = Interop.Elementary.elm_naviframe_item_push(Handle, title, IntPtr.Zero, IntPtr.Zero, content.Handle, null);
+ NaviItem naviItem = NaviItem.FromNativeHandle(item, content);
+ _itemStack.Add(naviItem);
+ naviItem.Popped += (s, e) =>
+ {
+ _itemStack.Remove(naviItem);
+ Popped?.Invoke(this, new NaviframeEventArgs() { Content = naviItem.Content });
+ };
+ return naviItem;
+ }
+
+ public NaviItem InsertBefore(NaviItem before, EvasObject content)
+ {
+ return InsertBefore(before, content);
+ }
+ public NaviItem InsertBefore(NaviItem before, EvasObject content, string title)
+ {
+ IntPtr item = Interop.Elementary.elm_naviframe_item_insert_before(Handle, before, title, IntPtr.Zero, IntPtr.Zero, content, null);
+ NaviItem naviItem = NaviItem.FromNativeHandle(item, content);
+ int idx = _itemStack.IndexOf(before);
+ _itemStack.Insert(idx, naviItem);
+ return naviItem;
+ }
+
+ public void Pop()
+ {
+ Interop.Elementary.elm_naviframe_item_pop(Handle);
+ }
+
+ internal override IntPtr CreateHandle(EvasObject parent)
+ {
+ return Interop.Elementary.elm_naviframe_add(parent.Handle);
+ }
+ }
+}
--- /dev/null
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ElmSharp
+{
+ public enum PanelDirection
+ {
+ /// <summary>
+ /// Top to bottom
+ /// </summary>
+ Top = 0,
+ /// <summary>
+ /// Bottom to top
+ /// </summary>
+ Bottom,
+ /// <summary>
+ /// Left to right
+ /// </summary>
+ Left,
+ /// <summary>
+ /// Right to left
+ /// </summary>
+ Right,
+ }
+
+ public class Panel : Layout
+ {
+ public Panel(EvasObject parent) : base(parent)
+ {
+ }
+
+ public bool IsOpen
+ {
+ get
+ {
+ return !Interop.Elementary.elm_panel_hidden_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_panel_hidden_set(Handle, !value);
+ }
+ }
+
+ public PanelDirection Direction
+ {
+ get
+ {
+ return (PanelDirection)Interop.Elementary.elm_panel_orient_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_panel_orient_set(Handle, (int)value);
+ }
+ }
+
+ public void SetScrollable(bool enable)
+ {
+ Interop.Elementary.elm_panel_scrollable_set(Handle, enable);
+ }
+
+ public void SetScrollableArea(double ratio)
+ {
+ Interop.Elementary.elm_panel_scrollable_content_size_set(Handle, ratio);
+ }
+
+ public void Toggle()
+ {
+ Interop.Elementary.elm_panel_toggle(Handle);
+ }
+
+ internal override IntPtr CreateHandle(EvasObject parent)
+ {
+ return Interop.Elementary.elm_panel_add(parent);
+ }
+ }
+}
--- /dev/null
+using System;
+
+namespace ElmSharp
+{
+ public class Panes : Layout
+ {
+ Interop.SmartEvent _press;
+ Interop.SmartEvent _unpressed;
+ public Panes(EvasObject parent) : base(parent)
+ {
+ _press = new Interop.SmartEvent(this, Handle, "press");
+ _unpressed = new Interop.SmartEvent(this, Handle, "unpressed");
+
+ _press.On += (s, e) => Pressed?.Invoke(this, e);
+ _unpressed.On += (s, e) => Unpressed?.Invoke(this, e);
+ }
+
+ public event EventHandler Pressed;
+ public event EventHandler Unpressed;
+ public bool IsFixed
+ {
+ get
+ {
+ return Interop.Elementary.elm_panes_fixed_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_panes_fixed_set(Handle, value);
+ }
+ }
+
+ public double Proportion
+ {
+ get
+ {
+ return Interop.Elementary.elm_panes_content_left_size_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_panes_content_left_size_set(Handle, value);
+ }
+ }
+
+ public bool IsHorizontal
+ {
+ get
+ {
+ return Interop.Elementary.elm_panes_horizontal_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_panes_horizontal_set(Handle, value);
+ }
+ }
+
+ internal override IntPtr CreateHandle(EvasObject parent)
+ {
+ return Interop.Elementary.elm_panes_add(parent);
+ }
+ }
+}
--- /dev/null
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+
+namespace ElmSharp
+{
+ /// <summary>
+ /// Struct defining a 2-D point as a pair of generic type.
+ /// </summary>
+ public struct Point : IEquatable<Point>
+ {
+ /// <summary>
+ /// Location along the horizontal axis.
+ /// </summary>
+ public int X;
+
+ /// <summary>
+ /// Location along the vertical axis.
+ /// </summary>
+ public int Y;
+
+ /// <summary>
+ /// A human-readable representation of the <see cref="T:Tizen.UI.Point" />.
+ /// </summary>
+ /// <returns>The string is formatted as "{{X={0} Y={1}}}".</returns>
+ public override string ToString()
+ {
+ return string.Format("{{X={0} Y={1}}}", X, Y);
+ }
+
+ /// <summary>
+ /// Returns a hash value for the <see cref="T:Tizen.UI.Point" />.
+ /// </summary>
+ /// <returns>A value intended for efficient insertion and lookup in hashtable-based data structures.</returns>
+ public override int GetHashCode()
+ {
+ unchecked
+ {
+ return X.GetHashCode() ^ (Y.GetHashCode() * 397);
+ }
+ }
+
+ /// <summary>
+ /// Returns true if the X and Y values of this are exactly equal to those in the argument.
+ /// </summary>
+ /// <param name="obj">Another <see cref="T:Tizen.UI.Point" />.</param>
+ /// <returns>True if the X and Y values are equal to those in <paramref name="obj" />. Returns false if <paramref name="obj" /> is not a <see cref="T:Tizen.UI.Point" />.</returns>
+ public override bool Equals(object obj)
+ {
+ if (!(obj is Point))
+ return false;
+
+ return Equals((Point)obj);
+ }
+
+ /// <summary>
+ /// Returns true if the X and Y values of this are exactly equal to those in the argument.
+ /// </summary>
+ /// <param name="other">Another <see cref="T:Tizen.UI.Point" />.</param>
+ /// <returns>True if the X and Y values are equal to those in <paramref name="other" />.</returns>
+ public bool Equals(Point other)
+ {
+ return X.Equals(other.X) && Y.Equals(other.Y);
+ }
+
+ /// <summary>
+ /// Whether the two <see cref="T:Tizen.UI.Point" />s are equal.
+ /// </summary>
+ /// <param name="p1">A <see cref="T:Tizen.UI.Point" /> on the left hand side.</param>
+ /// <param name="p2">A <see cref="T:Tizen.UI.Point" /> on the right hand side.</param>
+ /// <returns>True if the two <see cref="T:Tizen.UI.Point" />s have equal values.</returns>
+ public static bool operator ==(Point p1, Point p2)
+ {
+ return p1.Equals(p2);
+ }
+
+ /// <summary>
+ /// Whether two <see cref="T:Tizen.UI.Point" />s are not equal.
+ /// </summary>
+ /// <param name="p1">A <see cref="T:Tizen.UI.Point" /> on the left hand side.</param>
+ /// <param name="p2">A <see cref="T:Tizen.UI.Point" /> on the right hand side.</param>
+ /// <returns>True if the two <see cref="T:Tizen.UI.Point" />s do not have equal values.</returns>
+ public static bool operator !=(Point p1, Point p2)
+ {
+ return !p1.Equals(p2);
+ }
+ }
+}
--- /dev/null
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+
+namespace ElmSharp
+{
+ /// <summary>
+ /// Struct defining a 3-D point.
+ /// </summary>
+ public struct Point3D : IEquatable<Point3D>
+ {
+ /// <summary>
+ /// The X coordinate of a 3D point.
+ /// </summary>
+ public int X;
+
+ /// <summary>
+ /// The Y coordinate of a 3D point.
+ /// </summary>
+ public int Y;
+
+ /// <summary>
+ /// The Z coordinate of a 3D point.
+ /// </summary>
+ public int Z;
+
+ /// <summary>
+ /// A human-readable representation of the <see cref="T:Tizen.UI.Point3D" />.
+ /// </summary>
+ /// <returns>The string is formatted as "{{X={0} Y={1} Z={2}}}".</returns>
+ public override string ToString()
+ {
+ return string.Format("{{X={0} Y={1} Z={2}}}", X, Y, Z);
+ }
+
+ /// <summary>
+ /// Returns a hash value for the <see cref="T:Tizen.UI.Point3D" />.
+ /// </summary>
+ /// <returns>A value intended for efficient insertion and lookup in hashtable-based data structures.</returns>
+ public override int GetHashCode()
+ {
+ unchecked
+ {
+ int hashCode = X.GetHashCode();
+ hashCode = (hashCode * 397) ^ Y.GetHashCode();
+ hashCode = (hashCode * 397) ^ Z.GetHashCode();
+ return hashCode;
+ }
+ }
+
+ /// <summary>
+ /// Returns true if the X, Y and Z values of this are exactly equal to those in the argument.
+ /// </summary>
+ /// <param name="obj">Another <see cref="T:Tizen.UI.Point3D" />.</param>
+ /// <returns>True if the X, Y and Z values are equal to those in <paramref name="obj" />. Returns false if <paramref name="obj" /> is not a <see cref="T:Tizen.UI.Point" />.</returns>
+ public override bool Equals(object obj)
+ {
+ if (!(obj is Point3D))
+ return false;
+
+ return Equals((Point3D)obj);
+ }
+
+ /// <summary>
+ /// Returns true if the X, Y and Z values of this are exactly equal to those in the argument.
+ /// </summary>
+ /// <param name="other">Another <see cref="T:Tizen.UI.Point3D" />.</param>
+ /// <returns>True if the X, Y and Z values are equal to those in <paramref name="other" />.</returns>
+ public bool Equals(Point3D other)
+ {
+ return X.Equals(other.X) && Y.Equals(other.Y) && Z.Equals(other.Z);
+ }
+
+ /// <summary>
+ /// Whether the two <see cref="T:Tizen.UI.Point3D" />s are equal.
+ /// </summary>
+ /// <param name="p1">A <see cref="T:Tizen.UI.Point3D" /> on the left hand side.</param>
+ /// <param name="p2">A <see cref="T:Tizen.UI.Point3D" /> on the right hand side.</param>
+ /// <returns>True if the two <see cref="T:Tizen.UI.Point3D" />s have equal values.</returns>
+ public static bool operator ==(Point3D p1, Point3D p2)
+ {
+ return p1.Equals(p2);
+ }
+
+ /// <summary>
+ /// Whether two <see cref="T:Tizen.UI.Point3D" />s are not equal.
+ /// </summary>
+ /// <param name="p1">A <see cref="T:Tizen.UI.Point3D" /> on the left hand side.</param>
+ /// <param name="p2">A <see cref="T:Tizen.UI.Point3D" /> on the right hand side.</param>
+ /// <returns>True if the two <see cref="T:Tizen.UI.Point3D" />s do not have equal values.</returns>
+ public static bool operator !=(Point3D p1, Point3D p2)
+ {
+ return !p1.Equals(p2);
+ }
+ }
+}
--- /dev/null
+using System;
+using System.Collections.Generic;
+
+namespace ElmSharp
+{
+ public enum PopupOrientation
+ {
+ Top,
+ Center,
+ Bottom,
+ Left,
+ Right,
+ TopLeft,
+ TopRight,
+ BottomLeft,
+ BottomRight
+ }
+
+ public class Popup : Layout
+ {
+ HashSet<PopupItem> _children = new HashSet<PopupItem>();
+ Interop.SmartEvent _dismissed;
+ Interop.SmartEvent _blockClicked;
+ Interop.SmartEvent _timeout;
+ Interop.SmartEvent _showFinished;
+
+ public Popup(EvasObject parent) : base(parent)
+ {
+ _dismissed = new Interop.SmartEvent(this, Handle, "dismissed");
+ _dismissed.On += (sender, e) =>
+ {
+ Dismissed?.Invoke(this, EventArgs.Empty);
+ };
+
+ _blockClicked = new Interop.SmartEvent(this, Handle, "block,clicked");
+ _blockClicked.On += (sender, e) =>
+ {
+ OutsideClicked?.Invoke(this, EventArgs.Empty);
+ };
+
+ _timeout = new Interop.SmartEvent(this, Handle, "timeout");
+ _timeout.On += (sender, e) =>
+ {
+ TimedOut?.Invoke(this, EventArgs.Empty);
+ };
+
+ _showFinished = new Interop.SmartEvent(this, Handle, "show,finished");
+ _showFinished.On += (sender, e) =>
+ {
+ ShowAnimationFinished?.Invoke(this, EventArgs.Empty);
+ };
+
+ }
+
+ public event EventHandler Dismissed;
+
+ public event EventHandler OutsideClicked;
+
+ public event EventHandler TimedOut;
+
+ public event EventHandler ShowAnimationFinished;
+
+ public PopupOrientation Orientation
+ {
+ get
+ {
+ return (PopupOrientation)Interop.Elementary.elm_popup_orient_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_popup_orient_set(Handle, (int)value);
+ }
+
+ }
+
+ public WrapType ContentTextWrapType
+ {
+ get
+ {
+ return (WrapType)Interop.Elementary.elm_popup_content_text_wrap_type_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_popup_content_text_wrap_type_set(Handle, (int)value);
+ }
+ }
+
+ public double Timeout
+ {
+ get
+ {
+ return Interop.Elementary.elm_popup_timeout_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_popup_timeout_set(Handle, value);
+ }
+ }
+
+ public new double AlignmentX
+ {
+ get
+ {
+ return Interop.Elementary.GetPopupAlignX(Handle);
+ }
+ set
+ {
+ Interop.Elementary.SetPopupAlignX(Handle, value);
+ }
+ }
+
+ public new double AlignmentY
+ {
+ get
+ {
+ return Interop.Elementary.GetPopupAlignY(Handle);
+ }
+ set
+ {
+ Interop.Elementary.SetPopupAlignY(Handle, value);
+ }
+ }
+
+ public PopupItem Append(string label)
+ {
+ return Append(label, null);
+ }
+
+ public PopupItem Append(string label, EvasObject icon)
+ {
+ PopupItem item = new PopupItem(label, icon);
+ item.Handle = Interop.Elementary.elm_popup_item_append(Handle, label, icon, null, (IntPtr)item.Id);
+ AddInternal(item);
+ return item;
+ }
+
+ public void Dismiss()
+ {
+ Interop.Elementary.elm_popup_dismiss(Handle);
+ }
+
+ internal override IntPtr CreateHandle(EvasObject parent)
+ {
+ return Interop.Elementary.elm_popup_add(parent.Handle);
+ }
+
+ void AddInternal(PopupItem item)
+ {
+ _children.Add(item);
+ item.Deleted += Item_Deleted;
+ }
+
+ void Item_Deleted(object sender, EventArgs e)
+ {
+ _children.Remove((PopupItem)sender);
+ }
+ }
+}
--- /dev/null
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ElmSharp
+{
+ public class PopupItem : ItemObject
+ {
+ internal PopupItem(string text, EvasObject icon) : base(IntPtr.Zero)
+ {
+ Text = text;
+ Icon = icon;
+ }
+
+ public string Text { get; internal set; }
+ public EvasObject Icon { get; internal set; }
+ }
+}
--- /dev/null
+using System;
+
+namespace ElmSharp
+{
+ public class ProgressBar : Layout
+ {
+ Interop.SmartEvent _changed;
+
+ public ProgressBar(EvasObject parent) : base(parent)
+ {
+ _changed = new Interop.SmartEvent(this, Handle, "changed");
+ _changed.On += (s, e) =>
+ {
+ ValueChanged?.Invoke(this, EventArgs.Empty);
+ };
+ }
+
+ public event EventHandler ValueChanged;
+
+ public bool IsPulseMode
+ {
+ get
+ {
+ return Interop.Elementary.elm_progressbar_pulse_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_progressbar_pulse_set(Handle, value);
+ }
+ }
+
+ public double Value
+ {
+ get
+ {
+ return Interop.Elementary.elm_progressbar_value_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_progressbar_value_set(Handle, value);
+ }
+ }
+
+ public int SpanSize
+ {
+ get
+ {
+ return Interop.Elementary.elm_progressbar_span_size_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_progressbar_span_size_set(Handle, value);
+ }
+ }
+
+ public bool IsHorizontal
+ {
+ get
+ {
+ return Interop.Elementary.elm_progressbar_horizontal_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_progressbar_horizontal_set(Handle, value);
+ }
+ }
+
+ public bool IsInverted
+ {
+ get
+ {
+ return Interop.Elementary.elm_progressbar_inverted_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_progressbar_inverted_set(Handle, value);
+ }
+ }
+
+ public string UnitFormat
+ {
+ get
+ {
+ return Interop.Elementary.elm_progressbar_unit_format_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_progressbar_unit_format_set(Handle, value);
+ }
+ }
+
+ public void PlayPulse()
+ {
+ Interop.Elementary.elm_progressbar_pulse(Handle, true);
+ }
+
+ public void StopPluse()
+ {
+ Interop.Elementary.elm_progressbar_pulse(Handle, false);
+ }
+
+ internal override IntPtr CreateHandle(EvasObject parent)
+ {
+ return Interop.Elementary.elm_progressbar_add(parent);
+ }
+ }
+}
--- /dev/null
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ElmSharp
+{
+ public class Radio : Layout
+ {
+ Interop.SmartEvent _changed;
+
+ public Radio(EvasObject parent) : base(parent)
+ {
+ _changed = new Interop.SmartEvent(this, Handle, "changed");
+ _changed.On += (s, e) => ValueChanged?.Invoke(this, EventArgs.Empty);
+ }
+
+ public event EventHandler ValueChanged;
+
+ public int StateValue
+ {
+ get
+ {
+ return Interop.Elementary.elm_radio_state_value_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_radio_state_value_set(Handle, value);
+ }
+ }
+
+ public int GroupValue
+ {
+ get
+ {
+ return Interop.Elementary.elm_radio_value_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_radio_value_set(Handle, value);
+ }
+ }
+
+ public void SetGroup(Radio group)
+ {
+ if (group == null)
+ {
+ throw new ArgumentNullException("group");
+ }
+ Interop.Elementary.elm_radio_group_add(Handle, group.Handle);
+ }
+
+ internal override IntPtr CreateHandle(EvasObject parent)
+ {
+ return Interop.Elementary.elm_radio_add(parent);
+ }
+ }
+}
--- /dev/null
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+
+namespace ElmSharp
+{
+ /// <summary>
+ /// A value that represent rectangluar space.
+ /// </summary>
+ public struct Rect : IEquatable<Rect>
+ {
+
+ public Rect(int x, int y, int w, int h)
+ {
+ X = x;
+ Y = y;
+ Width = w;
+ Height = h;
+ }
+ /// <summary>
+ /// Gets or sets the position of this Rectangle on the X axis.
+ /// </summary>
+ public int X { get; set; }
+
+ /// <summary>
+ /// Gets or sets the position of this Rectangle on the Y axis.
+ /// </summary>
+ public int Y { get; set; }
+
+ /// <summary>
+ /// Gets or sets the width of this Rectangle.
+ /// </summary>
+ public int Width { get; set; }
+
+ /// <summary>
+ /// Gets or sets the height of this Rectangle.
+ /// </summary>
+ public int Height { get; set; }
+
+ /// <summary>
+ /// Gets the position of this Rectangle on the X axis.
+ /// </summary>
+ public int Left { get { return X; } }
+
+ /// <summary>
+ /// Gets the extent along the X axis.
+ /// </summary>
+ public int Right { get { return X + Width; } }
+
+ /// <summary>
+ /// Gets the position of this Rectangle on the Y axis.
+ /// </summary>
+ public int Top { get { return Y; } }
+
+ /// <summary>
+ /// Gets the extent along the Y axis.
+ /// </summary>
+ public int Bottom { get { return Y + Height; } }
+
+ /// <summary>
+ /// Gets the Point defined by Rectangle.Left and Rectangle.Top.
+ /// </summary>
+ public Point Location { get { return new Point { X = X, Y = Y }; } }
+
+ /// <summary>
+ /// Gets the extent of the Rectangle along its X and Y axis.
+ /// </summary>
+ public Size Size { get { return new Size { Width = Width, Height = Height }; } }
+
+ /// <summary>
+ /// A human-readable representation of the <see cref="T:Tizen.UI.Rectangle" />.
+ /// </summary>
+ /// <returns>The string is formatted as "{{X={0} Y={1} Width={2} Height={3}}}".</returns>
+ public override string ToString()
+ {
+ return string.Format("{{X={0} Y={1} Width={2} Height={3}}}", X, Y, Width, Height);
+ }
+
+ /// <summary>
+ /// Returns a hash value for the <see cref="T:Tizen.UI.Rectangle" />.
+ /// </summary>
+ /// <returns>A value intended for efficient insertion and lookup in hashtable-based data structures.</returns>
+ public override int GetHashCode()
+ {
+ unchecked
+ {
+ int hashCode = X.GetHashCode();
+ hashCode = (hashCode * 397) ^ Y.GetHashCode();
+ hashCode = (hashCode * 397) ^ Width.GetHashCode();
+ hashCode = (hashCode * 397) ^ Height.GetHashCode();
+ return hashCode;
+ }
+ }
+
+ /// <summary>
+ /// Returns true if the values of this are exactly equal to those in the argument.
+ /// </summary>
+ /// <param name="obj">Another <see cref="T:Tizen.UI.Rectangle" />.</param>
+ /// <returns>True if the values are equal to those in <paramref name="obj" />. Returns false if <paramref name="obj" /> is not a <see cref="T:Tizen.UI.Rectangle" />.</returns>
+ public override bool Equals(object obj)
+ {
+ if (!(obj is Rect))
+ return false;
+
+ return Equals((Rect)obj);
+ }
+
+ /// <summary>
+ /// Returns true if the values of this are exactly equal to those in the argument.
+ /// </summary>
+ /// <param name="other">Another <see cref="T:Tizen.UI.Rectangle" />.</param>
+ /// <returns>True if the values are equal to those in <paramref name="other" />.</returns>
+ public bool Equals(Rect other)
+ {
+ return X.Equals(other.X) && Y.Equals(other.Y) && Width.Equals(other.Width) && Height.Equals(other.Height);
+ }
+
+ /// <summary>
+ /// Whether the two <see cref="T:Tizen.UI.Rectangle" />s are equal.
+ /// </summary>
+ /// <param name="r1">A <see cref="T:Tizen.UI.Rectangle" /> on the left hand side.</param>
+ /// <param name="r2">A <see cref="T:Tizen.UI.Rectangle" /> on the right hand side.</param>
+ /// <returns>True if the two <see cref="T:Tizen.UI.Rectangle" />s have equal values.</returns>
+ public static bool operator ==(Rect r1, Rect r2)
+ {
+ return r1.Equals(r2);
+ }
+
+ /// <summary>
+ /// Whether two <see cref="T:Tizen.UI.Rectangle" />s are not equal.
+ /// </summary>
+ /// <param name="r1">A <see cref="T:Tizen.UI.Rectangle" /> on the left hand side.</param>
+ /// <param name="r2">A <see cref="T:Tizen.UI.Rectangle" /> on the right hand side.</param>
+ /// <returns>True if the two <see cref="T:Tizen.UI.Rectangle" />s do not have equal values.</returns>
+ public static bool operator !=(Rect r1, Rect r2)
+ {
+ return !r1.Equals(r2);
+ }
+ }
+}
--- /dev/null
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+using System.Diagnostics;
+
+namespace ElmSharp
+{
+ /// <summary>
+ /// A view used to draw a solid colored rectangle.
+ /// </summary>
+ public class Rectangle : EvasObject
+ {
+ /// <summary>
+ /// Create a new BoxView widget.
+ /// </summary>
+ public Rectangle(EvasObject parent) : base(parent)
+ {
+ Interop.Evas.evas_object_size_hint_weight_set(Handle, 1.0, 1.0);
+ }
+
+ internal override IntPtr CreateHandle(EvasObject parent)
+ {
+ IntPtr evas = Interop.Evas.evas_object_evas_get(parent.Handle);
+ return Interop.Evas.evas_object_rectangle_add(evas);
+ }
+ }
+}
--- /dev/null
+using System;
+
+namespace ElmSharp
+{
+ public enum ScrollBarVisiblePolicy
+ {
+ Auto = 0,
+ Visible,
+ Invisible
+ }
+
+ public enum ScrollBlock
+ {
+ None = 1,
+ Vertical = 2,
+ Horizontal = 4
+ }
+
+ public class Scroller : Layout
+ {
+ Interop.SmartEvent _scroll;
+ Interop.SmartEvent _dragStart;
+ Interop.SmartEvent _dragStop;
+ Interop.SmartEvent _scrollpage;
+
+ public Scroller(EvasObject parent) : base(parent)
+ {
+ _scroll = new Interop.SmartEvent(this, Handle, "scroll");
+ _dragStart = new Interop.SmartEvent(this, Handle, "scroll,drag,start");
+ _dragStop = new Interop.SmartEvent(this, Handle, "scroll,drag,stop");
+ _scrollpage = new Interop.SmartEvent(this, Handle, "scroll,page,changed");
+ }
+
+ public event EventHandler Scrolled
+ {
+ add
+ {
+ _scroll.On += value;
+ }
+ remove
+ {
+ _scroll.On -= value;
+ }
+ }
+ public event EventHandler DragStart
+ {
+ add
+ {
+ _dragStart.On += value;
+ }
+ remove
+ {
+ _dragStart.On -= value;
+ }
+ }
+ public event EventHandler DragStop
+ {
+ add
+ {
+ _dragStop.On += value;
+ }
+ remove
+ {
+ _dragStop.On -= value;
+ }
+ }
+ public event EventHandler PageScrolled
+ {
+ add
+ {
+ _scrollpage.On += value;
+ }
+ remove
+ {
+ _scrollpage.On -= value;
+ }
+ }
+
+ public Rect CurrentRegion
+ {
+ get
+ {
+ int x, y, w, h;
+ Interop.Elementary.elm_scroller_region_get(Handle, out x, out y, out w, out h);
+ return new Rect(x, y, w, h);
+ }
+ }
+
+ public ScrollBarVisiblePolicy HorizontalScrollBarVisiblePolicy
+ {
+ get
+ {
+ int policy;
+ Interop.Elementary.elm_scroller_policy_get(Handle, out policy, IntPtr.Zero);
+ return (ScrollBarVisiblePolicy)policy;
+ }
+ set
+ {
+ ScrollBarVisiblePolicy v = VerticalScrollBarVisiblePolicy;
+ Interop.Elementary.elm_scroller_policy_set(Handle, (int)value, (int)v);
+ }
+ }
+
+ public ScrollBarVisiblePolicy VerticalScrollBarVisiblePolicy
+ {
+ get
+ {
+ int policy;
+ Interop.Elementary.elm_scroller_policy_get(Handle, IntPtr.Zero, out policy);
+ return (ScrollBarVisiblePolicy)policy;
+ }
+ set
+ {
+ ScrollBarVisiblePolicy h = HorizontalScrollBarVisiblePolicy;
+ Interop.Elementary.elm_scroller_policy_set(Handle, (int)h, (int)value);
+ }
+ }
+
+ public ScrollBlock ScrollBlock
+ {
+ get
+ {
+ return (ScrollBlock)Interop.Elementary.elm_scroller_movement_block_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_scroller_movement_block_set(Handle, (int)value);
+ }
+ }
+
+ public int VerticalPageIndex
+ {
+ get
+ {
+ int v, h;
+ Interop.Elementary.elm_scroller_current_page_get(Handle, out h, out v);
+ return v;
+ }
+ }
+
+ public int HorizontalPageIndex
+ {
+ get
+ {
+ int v, h;
+ Interop.Elementary.elm_scroller_current_page_get(Handle, out h, out v);
+ return h;
+ }
+ }
+
+ public int VerticalPageScrollLimit
+ {
+ get
+ {
+ int v, h;
+ Interop.Elementary.elm_scroller_page_scroll_limit_get(Handle, out h, out v);
+ return v;
+ }
+ set
+ {
+ int h = HorizontalPageScrollLimit;
+ Interop.Elementary.elm_scroller_page_scroll_limit_set(Handle, h, value);
+ }
+ }
+
+ public int HorizontalPageScrollLimit
+ {
+ get
+ {
+ int v, h;
+ Interop.Elementary.elm_scroller_page_scroll_limit_get(Handle, out h, out v);
+ return h;
+ }
+ set
+ {
+ int v = VerticalPageScrollLimit;
+ Interop.Elementary.elm_scroller_page_scroll_limit_set(Handle, value, v);
+ }
+ }
+
+ public void SetPageSize(int width, int height)
+ {
+ Interop.Elementary.elm_scroller_page_size_set(Handle, width, height);
+ }
+
+ public void SetPageSize(double width, double height)
+ {
+ Interop.Elementary.elm_scroller_page_relative_set(Handle, width, height);
+ }
+
+ public void ScrollTo(int horizontalPageIndex, int verticalPageIndex, bool animated)
+ {
+ if (animated)
+ {
+ Interop.Elementary.elm_scroller_page_bring_in(Handle, horizontalPageIndex, verticalPageIndex);
+ }
+ else
+ {
+ Interop.Elementary.elm_scroller_page_show(Handle, horizontalPageIndex, verticalPageIndex);
+ }
+ }
+
+ public void ScrollTo(Rect region, bool animated)
+ {
+ if (animated)
+ {
+ Interop.Elementary.elm_scroller_region_bring_in(Handle, region.X, region.Y, region.Width, region.Height);
+ }
+ else
+ {
+ Interop.Elementary.elm_scroller_region_show(Handle, region.X, region.Y, region.Width, region.Height);
+ }
+ }
+
+ internal override IntPtr CreateHandle(EvasObject parent)
+ {
+ return Interop.Elementary.elm_scroller_add(parent);
+ }
+ }
+}
--- /dev/null
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+
+namespace ElmSharp
+{
+ /// <summary>
+ /// Struct defining height and width as a pair of generic type.
+ /// </summary>
+ public struct Size : IEquatable<Size>
+ {
+ /// <summary>
+ /// Magnitude along the horizontal axis, in platform-defined units.
+ /// </summary>
+ public int Width;
+
+ /// <summary>
+ /// Magnitude along the vertical axis, in platform-specific units.
+ /// </summary>
+ public int Height;
+
+ /// <summary>
+ /// Initializes a new instance of the Size structure from the specified dimensions.
+ /// </summary>
+ /// <param name="width">The width to set</param>
+ /// <param name="height">The height to set</param>
+ public Size(int width, int height)
+ {
+ Width = width;
+ Height = height;
+ }
+
+ /// <summary>
+ /// A human-readable representation of the <see cref="T:Tizen.UI.Size" />.
+ /// </summary>
+ /// <returns>The string is formatted as "{{Width={0} Height={1}}}".</returns>
+ public override string ToString()
+ {
+ return string.Format("{{Width={0} Height={1}}}", Width, Height);
+ }
+
+ /// <summary>
+ /// Returns a hash value for the <see cref="T:Tizen.UI.Size" />.
+ /// </summary>
+ /// <returns>A value intended for efficient insertion and lookup in hashtable-based data structures.</returns>
+ public override int GetHashCode()
+ {
+ unchecked
+ {
+ return Width.GetHashCode() ^ (Height.GetHashCode() * 397);
+ }
+ }
+
+ /// <summary>
+ /// Returns true if the Width and Height values of this are exactly equal to those in the argument.
+ /// </summary>
+ /// <param name="obj">Another <see cref="T:Tizen.UI.Size" />.</param>
+ /// <returns>True if the Width and Height values are equal to those in <paramref name="obj" />. Returns false if <paramref name="obj" /> is not a <see cref="T:Tizen.UI.Size" />.</returns>
+ public override bool Equals(object obj)
+ {
+ if (!(obj is Size))
+ return false;
+
+ return Equals((Size)obj);
+ }
+
+ /// <summary>
+ /// Returns true if the Width and Height values of this are exactly equal to those in the argument.
+ /// </summary>
+ /// <param name="other">Another <see cref="T:Tizen.UI.Size" />.</param>
+ /// <returns>True if the Width and Height values are equal to those in <paramref name="other" />.</returns>
+ public bool Equals(Size other)
+ {
+ return Width.Equals(other.Width) && Height.Equals(other.Height);
+ }
+
+ /// <summary>
+ /// Whether the two <see cref="T:Tizen.UI.Size" />s are equal.
+ /// </summary>
+ /// <param name="s1">A <see cref="T:Tizen.UI.Size" /> on the left hand side.</param>
+ /// <param name="s2">A <see cref="T:Tizen.UI.Size" /> on the right hand side.</param>
+ /// <returns>True if the two <see cref="T:Tizen.UI.Size" />s have equal values.</returns>
+ public static bool operator ==(Size s1, Size s2)
+ {
+ return s1.Equals(s2);
+ }
+
+ /// <summary>
+ /// Whether two <see cref="T:Tizen.UI.Size" />s are not equal.
+ /// </summary>
+ /// <param name="s1">A <see cref="T:Tizen.UI.Size" /> on the left hand side.</param>
+ /// <param name="s2">A <see cref="T:Tizen.UI.Size" /> on the right hand side.</param>
+ /// <returns>True if the two <see cref="T:Tizen.UI.Size" />s do not have equal values.</returns>
+ public static bool operator !=(Size s1, Size s2)
+ {
+ return !s1.Equals(s2);
+ }
+ }
+}
--- /dev/null
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ElmSharp
+{
+ public class Slider : Layout
+ {
+ double _minimum = 0.0;
+ double _maximum = 1.0;
+
+ Interop.SmartEvent _changed;
+ Interop.SmartEvent _delayedChanged;
+ Interop.SmartEvent _dragStarted;
+ Interop.SmartEvent _dragStopped;
+
+ public Slider(EvasObject parent) : base(parent)
+ {
+ _changed = new Interop.SmartEvent(this, Handle, "changed");
+ _changed.On += (s, e) => ValueChanged?.Invoke(this, EventArgs.Empty);
+
+ _delayedChanged = new Interop.SmartEvent(this, Handle, "delay,changed");
+ _delayedChanged.On += (s, e) => DelayedValueChanged?.Invoke(this, EventArgs.Empty);
+
+ _dragStarted = new Interop.SmartEvent(this, Handle, "slider,drag,start");
+ _dragStarted.On += (s, e) => DragStarted?.Invoke(this, EventArgs.Empty);
+
+ _dragStopped = new Interop.SmartEvent(this, Handle, "slider,drag,stop");
+ _dragStopped.On += (s, e) => DragStopped?.Invoke(this, EventArgs.Empty);
+ }
+
+ public event EventHandler ValueChanged;
+
+ public event EventHandler DelayedValueChanged;
+
+ public event EventHandler DragStarted;
+
+ public event EventHandler DragStopped;
+
+ public int SpanSize
+ {
+ get
+ {
+ return Interop.Elementary.elm_slider_span_size_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_slider_span_size_set(Handle, value);
+ }
+ }
+
+ public string UnitFormat
+ {
+ get
+ {
+ return Interop.Elementary.elm_slider_unit_format_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_slider_unit_format_set(Handle, value);
+ }
+ }
+
+ public string IndicatorFormat
+ {
+ get
+ {
+ return Interop.Elementary.elm_slider_indicator_format_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_slider_indicator_format_set(Handle, value);
+ }
+ }
+
+ public bool IsHorizontal
+ {
+ get
+ {
+ return Interop.Elementary.elm_slider_horizontal_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_slider_horizontal_set(Handle, value);
+ }
+ }
+
+ public double Minimum
+ {
+ get
+ {
+ return _minimum;
+ }
+ set
+ {
+ _minimum = value;
+ Interop.Elementary.elm_slider_min_max_set(Handle, _minimum, _maximum);
+ }
+ }
+
+ public double Maximum
+ {
+ get
+ {
+ return _maximum;
+ }
+ set
+ {
+ _maximum = value;
+ Interop.Elementary.elm_slider_min_max_set(Handle, _minimum, _maximum);
+ }
+ }
+
+ public double Value
+ {
+ get
+ {
+ return Interop.Elementary.elm_slider_value_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_slider_value_set(Handle, value);
+ }
+ }
+
+ public double Step
+ {
+ get
+ {
+ return Interop.Elementary.elm_slider_step_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_slider_step_set(Handle, value);
+ }
+ }
+
+ public bool IsInverted
+ {
+ get
+ {
+ return Interop.Elementary.elm_slider_inverted_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_slider_inverted_set(Handle, value);
+ }
+ }
+
+ public bool IsIndicatorVisible
+ {
+ get
+ {
+ return Interop.Elementary.elm_slider_indicator_show_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_slider_indicator_show_set(Handle, value);
+ }
+ }
+
+ internal override IntPtr CreateHandle(EvasObject parent)
+ {
+ return Interop.Elementary.elm_slider_add(parent);
+ }
+ }
+}
--- /dev/null
+using System;
+
+namespace ElmSharp
+{
+ public class Spinner : Layout
+ {
+ double _minimum = 0.0;
+ double _maximum = 100.0;
+
+ Interop.SmartEvent _changed;
+ Interop.SmartEvent _delayedChanged;
+
+ public Spinner(EvasObject parent) : base(parent)
+ {
+ _changed = new Interop.SmartEvent(this, Handle, "changed");
+ _changed.On += (s, e) => ValueChanged?.Invoke(this, EventArgs.Empty);
+
+ _delayedChanged = new Interop.SmartEvent(this, Handle, "delay,changed");
+ _delayedChanged.On += (s, e) => DelayedValueChanged?.Invoke(this, EventArgs.Empty);
+ }
+
+ public event EventHandler ValueChanged;
+
+ public event EventHandler DelayedValueChanged;
+
+ public string LabelFormat
+ {
+ get
+ {
+ return Interop.Elementary.elm_spinner_label_format_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_spinner_label_format_set(Handle, value);
+ }
+ }
+
+ public double Minimum
+ {
+ get
+ {
+ return _minimum;
+ }
+ set
+ {
+ _minimum = value;
+ Interop.Elementary.elm_spinner_min_max_set(Handle, _minimum, _maximum);
+ }
+ }
+
+ public double Maximum
+ {
+ get
+ {
+ return _maximum;
+ }
+ set
+ {
+ _maximum = value;
+ Interop.Elementary.elm_spinner_min_max_set(Handle, _minimum, _maximum);
+ }
+ }
+
+ public double Step
+ {
+ get
+ {
+ return Interop.Elementary.elm_spinner_step_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_spinner_step_set(Handle, value);
+ }
+ }
+
+ public double Value
+ {
+ get
+ {
+ return Interop.Elementary.elm_spinner_value_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_spinner_value_set(Handle, value);
+ }
+ }
+
+ public double Interval
+ {
+ get
+ {
+ return Interop.Elementary.elm_spinner_interval_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_spinner_interval_set(Handle, value);
+ }
+ }
+
+ public double RoundBase
+ {
+ get
+ {
+ return Interop.Elementary.elm_spinner_base_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_spinner_base_set(Handle, value);
+ }
+ }
+
+ public int RoundValue
+ {
+ get
+ {
+ return Interop.Elementary.elm_spinner_round_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_spinner_round_set(Handle, value);
+ }
+ }
+
+ public bool IsWrapEnabled
+ {
+ get
+ {
+ return Interop.Elementary.elm_spinner_wrap_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_spinner_wrap_set(Handle, value);
+ }
+ }
+
+ public bool IsEditable
+ {
+ get
+ {
+ return Interop.Elementary.elm_spinner_editable_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_spinner_editable_set(Handle, value);
+ }
+ }
+
+
+ public void AddSpecialValue(double value, string label)
+ {
+ Interop.Elementary.elm_spinner_special_value_add(Handle, value, label);
+ }
+
+ public void RemoveSpecialValue(double value)
+ {
+ Interop.Elementary.elm_spinner_special_value_del(Handle, value);
+ }
+
+ public string GetSpecialValue(double value)
+ {
+ return Interop.Elementary.elm_spinner_special_value_get(Handle, value);
+ }
+
+ internal override IntPtr CreateHandle(EvasObject parent)
+ {
+ return Interop.Elementary.elm_spinner_add(parent);
+ }
+ }
+}
--- /dev/null
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+
+namespace ElmSharp
+{
+ public class Table : Container
+ {
+ int _paddingX = 0;
+ int _paddingY = 0;
+
+ public Table(EvasObject parent) : base(parent)
+ {
+ }
+
+ public bool Homogeneous
+ {
+ get
+ {
+ return Interop.Elementary.elm_table_homogeneous_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_table_homogeneous_set(Handle, value);
+ }
+ }
+
+ public int PaddingX
+ {
+ get
+ {
+ return _paddingX;
+ }
+ set
+ {
+ _paddingX = value;
+ Interop.Elementary.elm_table_padding_set(Handle, _paddingX, _paddingY);
+ }
+ }
+
+ public int PaddingY
+ {
+ get
+ {
+ return _paddingY;
+ }
+ set
+ {
+ _paddingY = value;
+ Interop.Elementary.elm_table_padding_set(Handle, _paddingX, _paddingY);
+ }
+ }
+
+ public void Pack(EvasObject obj, int col, int row, int colspan, int rowspan)
+ {
+ if (obj == null)
+ throw new ArgumentNullException("obj");
+ Interop.Elementary.elm_table_pack(Handle, obj, col, row, colspan, rowspan);
+ AddChild(obj);
+ }
+
+ public void Unpack(EvasObject obj)
+ {
+ if (obj == null)
+ throw new ArgumentNullException("obj");
+ Interop.Elementary.elm_table_unpack(Handle, obj);
+ RemoveChild(obj);
+ }
+
+ public void Clear()
+ {
+ Interop.Elementary.elm_table_clear(Handle, false);
+ ClearChildren();
+ }
+
+ internal override IntPtr CreateHandle(EvasObject parent)
+ {
+ return Interop.Elementary.elm_table_add(parent);
+ }
+ }
+}
--- /dev/null
+using System;
+using System.Collections.Generic;
+
+namespace ElmSharp
+{
+ public enum ToolbarSelectionMode
+ {
+ Default = 0,
+ Always,
+ None,
+ DisplayOnly,
+ }
+
+ public enum ToolbarShrinkMode
+ {
+ None = 0,
+ Hide,
+ Scroll,
+ Menu,
+ Expand
+ }
+
+ public class ToolbarItemEventArgs : EventArgs {
+ public ToolbarItem Item { get; private set; }
+
+ internal static ToolbarItemEventArgs CreateFromSmartEvent(IntPtr data, IntPtr obj, IntPtr info)
+ {
+ ToolbarItem item = ItemObject.GetItemByHandle(info) as ToolbarItem;
+ return new ToolbarItemEventArgs() { Item = item };
+ }
+ }
+
+ public class Toolbar : Widget
+ {
+ Interop.SmartEvent<ToolbarItemEventArgs> _clicked;
+ Interop.SmartEvent<ToolbarItemEventArgs> _selected;
+ Interop.SmartEvent<ToolbarItemEventArgs> _longpressed;
+ public Toolbar(EvasObject parent) : base(parent)
+ {
+ _selected = new Interop.SmartEvent<ToolbarItemEventArgs>(this, Handle, "selected", ToolbarItemEventArgs.CreateFromSmartEvent);
+ _selected.On += (s, e) =>
+ {
+ if (e.Item != null)
+ {
+ Selected?.Invoke(this, e);
+ e.Item.SendSelected();
+ }
+ };
+ _longpressed = new Interop.SmartEvent<ToolbarItemEventArgs>(this, Handle, "longpressed", ToolbarItemEventArgs.CreateFromSmartEvent);
+ _longpressed.On += (s, e) =>
+ {
+ e.Item?.SendLongPressed();
+ };
+ _clicked = new Interop.SmartEvent<ToolbarItemEventArgs>(this, Handle, "clicked", ToolbarItemEventArgs.CreateFromSmartEvent);
+ _clicked.On += (s, e) =>
+ {
+ e.Item?.SendClicked();
+ };
+ }
+
+ public event EventHandler<ToolbarItemEventArgs> Selected;
+
+ public bool Homogeneous
+ {
+ get
+ {
+ return Interop.Elementary.elm_toolbar_homogeneous_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_toolbar_homogeneous_set(Handle, value);
+ }
+ }
+
+ public ToolbarSelectionMode SelectionMode
+ {
+ get
+ {
+ return (ToolbarSelectionMode)Interop.Elementary.elm_toolbar_select_mode_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_toolbar_select_mode_set(Handle, (int)value);
+ }
+ }
+
+ public ToolbarShrinkMode ShrinkMode
+ {
+ get
+ {
+ return (ToolbarShrinkMode)Interop.Elementary.elm_toolbar_shrink_mode_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_toolbar_shrink_mode_set(Handle, (int)value);
+ }
+ }
+
+ public double ItemAlignment
+ {
+ get
+ {
+ return Interop.Elementary.elm_toolbar_align_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_toolbar_align_set(Handle, value);
+ }
+ }
+
+ public bool TransverseExpansion
+ {
+ get
+ {
+ return Interop.Elementary.elm_toolbar_transverse_expanded_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_toolbar_transverse_expanded_set(Handle, value);
+ }
+ }
+
+ public ToolbarItem Append(string label)
+ {
+ return Append(label, null);
+ }
+ public ToolbarItem Append(string label, string icon)
+ {
+ ToolbarItem item = new ToolbarItem(label, icon);
+ item.Handle = Interop.Elementary.elm_toolbar_item_append(Handle, icon, label, null, (IntPtr)item.Id);
+ return item;
+ }
+
+ public ToolbarItem Prepend(string label)
+ {
+ return Prepend(label, null);
+ }
+
+ public ToolbarItem Prepend(string label, string icon)
+ {
+ ToolbarItem item = new ToolbarItem(label, icon);
+ item.Handle = Interop.Elementary.elm_toolbar_item_prepend(Handle, icon, label, null, (IntPtr)item.Id);
+ return item;
+ }
+
+ public ToolbarItem InsertBefore(ToolbarItem before, string label)
+ {
+ return InsertBefore(before, label);
+ }
+
+ public ToolbarItem InsertBefore(ToolbarItem before, string label, string icon)
+ {
+ ToolbarItem item = new ToolbarItem(label, icon);
+ item.Handle = Interop.Elementary.elm_toolbar_item_insert_before(Handle, before, icon, label, null, (IntPtr)item.Id);
+ return item;
+ }
+
+ public ToolbarItem SelectedItem
+ {
+ get
+ {
+ IntPtr handle = Interop.Elementary.elm_toolbar_selected_item_get(Handle);
+ return ItemObject.GetItemByHandle(handle) as ToolbarItem;
+ }
+ }
+
+ internal override IntPtr CreateHandle(EvasObject parent)
+ {
+ return Interop.Elementary.elm_toolbar_add(parent);
+ }
+ }
+}
--- /dev/null
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ElmSharp
+{
+ public class ToolbarItem : ItemObject
+ {
+ string _icon;
+ string _text;
+ internal ToolbarItem(string text, string icon) : base(IntPtr.Zero)
+ {
+ _text = text;
+ _icon = icon;
+ }
+
+ public string Icon
+ {
+ get
+ {
+ return _icon;
+ }
+ set
+ {
+ _icon = value;
+ Interop.Elementary.elm_toolbar_item_icon_set(Handle, value);
+ }
+ }
+ public string Text
+ {
+ get
+ {
+ return _text;
+ }
+ set
+ {
+ _text = value;
+ SetPartText(null, value);
+ }
+ }
+ public bool Enabled
+ {
+ get
+ {
+ return !Interop.Elementary.elm_object_disabled_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_object_disabled_set(Handle, !value);
+ }
+ }
+ public bool IsSeparator
+ {
+ get
+ {
+ return Interop.Elementary.elm_toolbar_item_separator_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_toolbar_item_separator_set(Handle, value);
+ }
+ }
+ public bool IsSelected
+ {
+ get
+ {
+ return Interop.Elementary.elm_toolbar_item_selected_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_toolbar_item_selected_set(Handle, value);
+ }
+ }
+
+ public event EventHandler Selected;
+ public event EventHandler LongPressed;
+ public event EventHandler Clicked;
+
+ internal void SendSelected()
+ {
+ Selected?.Invoke(this, EventArgs.Empty);
+ }
+ internal void SendLongPressed()
+ {
+ LongPressed?.Invoke(this, EventArgs.Empty);
+ }
+ internal void SendClicked()
+ {
+ Clicked?.Invoke(this, EventArgs.Empty);
+ }
+ }
+}
--- /dev/null
+using System;
+using System.Collections.Generic;
+
+namespace ElmSharp
+{
+ public abstract class Widget : EvasObject
+ {
+ Dictionary<string, EvasObject> _partContents = new Dictionary<string, EvasObject>();
+
+ Interop.SmartEvent _focused;
+ Interop.SmartEvent _unfocused;
+
+ protected Widget()
+ {
+ }
+
+ internal Widget(EvasObject parent) : base(parent)
+ {
+ _focused = new Interop.SmartEvent(this, Handle, "focused");
+ _focused.On += (s, e) => Focused?.Invoke(this, EventArgs.Empty);
+
+ _unfocused = new Interop.SmartEvent(this, Handle, "unfocused");
+ _unfocused.On += (s, e) => Unfocused?.Invoke(this, EventArgs.Empty);
+
+ }
+
+ public event EventHandler Focused;
+
+ public event EventHandler Unfocused;
+
+ public bool IsEnabled
+ {
+ get
+ {
+ return !Interop.Elementary.elm_object_disabled_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_object_disabled_set(Handle, !value);
+ }
+ }
+
+ public string Style
+ {
+ get
+ {
+ return Interop.Elementary.elm_object_style_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_object_style_set(Handle, value);
+ }
+ }
+
+ public bool IsFocused
+ {
+ get
+ {
+ return Interop.Elementary.elm_object_focus_get(Handle);
+ }
+ }
+
+ public string Text
+ {
+ get
+ {
+ return Interop.Elementary.elm_object_part_text_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_object_part_text_set(Handle, IntPtr.Zero, value);
+ }
+ }
+
+ public void SetFocus(bool isFocus)
+ {
+ Interop.Elementary.elm_object_focus_set(Handle, isFocus);
+ }
+
+ public void SetPartContent(string part, EvasObject content)
+ {
+ SetPartContent(part, content, false);
+ }
+
+ public void SetPartContent(string part, EvasObject content, bool preserveOldContent)
+ {
+ if (preserveOldContent)
+ {
+ Interop.Elementary.elm_object_part_content_unset(Handle, part);
+ }
+ Interop.Elementary.elm_object_part_content_set(Handle, part, content);
+
+ _partContents[part ?? "__default__"] = content;
+ }
+
+ public void SetContent(EvasObject content)
+ {
+ SetContent(content, false);
+ }
+
+ public void SetContent(EvasObject content, bool preserveOldContent)
+ {
+ if (preserveOldContent)
+ {
+ Interop.Elementary.elm_object_content_unset(Handle);
+ }
+
+ Interop.Elementary.elm_object_content_set(Handle, content);
+ _partContents["___default__"] = content;
+ }
+
+ public void SetPartText(string part, string text)
+ {
+ Interop.Elementary.elm_object_part_text_set(Handle, part, text);
+ }
+
+ public string GetPartText(string part)
+ {
+ return Interop.Elementary.elm_object_part_text_get(Handle, part);
+ }
+
+ public void SetPartColor(string part, Color color)
+ {
+ Interop.Elementary.elm_object_part_color_set(Handle, part, color.R, color.G, color.B, color.A);
+ }
+ }
+}
--- /dev/null
+using System;
+using System.Collections.Generic;
+
+namespace ElmSharp
+{
+ [Flags]
+ public enum DisplayRotation
+ {
+ Degree_0 = 1,
+ Degree_90 = 2,
+ Degree_180 = 4,
+ Degree_270 = 8
+ };
+
+ public enum StatusBarMode
+ {
+ /// <summary>
+ /// Opacifies the status bar
+ /// </summary>
+ Opaque = 1,
+
+ /// <summary>
+ /// Be translucent the status bar
+ /// </summary>
+ /// <remarks>
+ /// Not supported.
+ /// </remarks>
+ Translucent = 2,
+
+ /// <summary>
+ /// Transparentizes the status bar
+ /// </summary>
+ Transparent = 3,
+ }
+
+ public class Window : Widget
+ {
+ Interop.SmartEvent _deleteRequest;
+ Interop.SmartEvent _rotationChanged;
+ public Window(string name) : this(null, name)
+ {
+ }
+
+ public Window(Window parent, string name)
+ {
+ Name = name;
+ Realize(parent);
+ Interop.Elementary.elm_win_indicator_mode_set(Handle, 2 /* ELM_WIN_INDICATOR_SHOW */);
+
+ _deleteRequest = new Interop.SmartEvent(this, Handle, "delete,request");
+ _rotationChanged = new Interop.SmartEvent(this, Handle, "wm,rotation,changed");
+
+ _deleteRequest.On += (s, e) => CloseRequested?.Invoke(this, EventArgs.Empty);
+ _rotationChanged.On += (s, e) => RotationChanged?.Invoke(this, EventArgs.Empty);
+ }
+
+ public event EventHandler CloseRequested;
+ public event EventHandler RotationChanged;
+
+ public string Name { get; set; }
+
+ public Size ScreenSize
+ {
+ get
+ {
+ int x, y, w, h;
+ Interop.Elementary.elm_win_screen_size_get(Handle, out x, out y, out w, out h);
+ return new Size(w, h);
+ }
+ }
+
+ public int Rotation
+ {
+ get
+ {
+ return Interop.Elementary.elm_win_rotation_get(Handle);
+ }
+ }
+
+ public bool IsRotationSupported
+ {
+ get
+ {
+ return Interop.Elementary.elm_win_wm_rotation_supported_get(Handle);
+ }
+ }
+
+ public DisplayRotation AavailableRotations
+ {
+ get
+ {
+ int[] rotations;
+ Interop.Elementary.elm_win_wm_rotation_available_rotations_get(Handle, out rotations);
+ if (rotations == null)
+ {
+ return 0;
+ }
+ return ConvertToDisplayRotation(rotations);
+ }
+ set
+ {
+ Interop.Elementary.elm_win_wm_rotation_available_rotations_set(Handle, ConvertDegreeArray(value));
+ }
+ }
+
+ public bool AutoDeletion
+ {
+ get
+ {
+ return Interop.Elementary.elm_win_autodel_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_win_autodel_set(Handle, value);
+ }
+ }
+
+ public StatusBarMode StatusBarMode
+ {
+ get
+ {
+ return (StatusBarMode)Interop.Elementary.elm_win_indicator_opacity_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_win_indicator_opacity_set(Handle, (int)value);
+ }
+ }
+
+
+ public void Active()
+ {
+ Interop.Elementary.elm_win_activate(Handle);
+ }
+
+ public void AddResizeObject(EvasObject obj)
+ {
+ Interop.Elementary.elm_win_resize_object_add(Handle, obj);
+ }
+
+ internal override IntPtr CreateHandle(EvasObject parent)
+ {
+ Interop.Elementary.elm_config_accel_preference_set("3d");
+ return Interop.Elementary.elm_win_add(parent != null ? parent.Handle : IntPtr.Zero, Name, 0);
+ }
+
+ static int[] ConvertDegreeArray(DisplayRotation value)
+ {
+ List<int> rotations = new List<int>();
+ if (value.HasFlag(DisplayRotation.Degree_0))
+ rotations.Add(0);
+ if (value.HasFlag(DisplayRotation.Degree_90))
+ rotations.Add(90);
+ if (value.HasFlag(DisplayRotation.Degree_180))
+ rotations.Add(180);
+ if (value.HasFlag(DisplayRotation.Degree_270))
+ rotations.Add(270);
+ return rotations.ToArray();
+ }
+
+ static DisplayRotation ConvertToDisplayRotation(int[] values)
+ {
+ int orientation = 0;
+ foreach (int v in values)
+ {
+ orientation |= (1 << (v / 90));
+ }
+ return (DisplayRotation)orientation;
+ }
+
+ }
+}
--- /dev/null
+using System;
+
+namespace ElmSharp
+{
+ public enum WrapType
+ {
+ None = 0,
+ Char,
+ Word,
+ Mixed
+ }
+}
--- /dev/null
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+ internal static partial class Ecore
+ {
+ internal delegate void EcoreCallback(IntPtr data);
+ internal delegate bool EcoreTaskCallback(IntPtr data);
+
+ [DllImport(Libraries.Ecore)]
+ internal static extern int ecore_init();
+
+ [DllImport(Libraries.Ecore)]
+ internal static extern int ecore_shutdown();
+
+ [DllImport(Libraries.Ecore)]
+ internal static extern void ecore_main_loop_begin();
+
+ [DllImport(Libraries.Ecore)]
+ internal static extern void ecore_main_loop_quit();
+
+ [DllImport(Libraries.Ecore)]
+ internal static extern bool ecore_main_loop_glib_integrate();
+
+ [DllImport(Libraries.Ecore)]
+ internal static extern IntPtr ecore_idler_add(EcoreTaskCallback callback, IntPtr data);
+
+ [DllImport(Libraries.Ecore)]
+ internal static extern void ecore_main_loop_thread_safe_call_async(EcoreTaskCallback callback, IntPtr data);
+
+ [DllImport(Libraries.Ecore)]
+ internal static extern IntPtr ecore_main_loop_thread_safe_call_sync(EcoreTaskCallback callback, IntPtr data);
+
+ [DllImport(Libraries.Ecore)]
+ internal static extern IntPtr ecore_idler_del(IntPtr idler);
+
+ [DllImport(Libraries.Ecore)]
+ internal static extern IntPtr ecore_timer_add(double interval, EcoreTaskCallback callback, IntPtr data);
+
+ [DllImport(Libraries.Ecore)]
+ internal static extern IntPtr ecore_timer_del(IntPtr timer);
+
+
+ }
+
+}
--- /dev/null
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+ internal static partial class Elementary
+ {
+ public enum BackgroundOptions
+ {
+ Center, Scale, Stretch, Tile
+ }
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_bg_add(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_bg_color_set(IntPtr obj, int r, int g, int b);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_bg_color_get(IntPtr obj, out int r, out int g, out int b);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_bg_file_set(IntPtr obj, string file, IntPtr group);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_bg_file_get(IntPtr obj, ref IntPtr file, IntPtr group);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_bg_option_set(IntPtr obj, BackgroundOptions option);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern BackgroundOptions elm_bg_option_get(IntPtr obj);
+
+ internal static string BackgroundFileGet(IntPtr obj)
+ {
+ IntPtr file = IntPtr.Zero;
+ elm_bg_file_get(obj, ref file, IntPtr.Zero);
+ string r = Marshal.PtrToStringAnsi(file);
+ Marshal.FreeHGlobal(file);
+ return r;
+ }
+ }
+}
--- /dev/null
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+ internal static partial class Elementary
+ {
+ public delegate void BoxLayoutCallback(IntPtr obj, IntPtr priv, IntPtr userData);
+ public delegate void BoxDataFreeCallback(IntPtr data);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_box_add(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_box_horizontal_set(IntPtr obj, bool horizontal);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_box_horizontal_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_box_pack_start(IntPtr obj, IntPtr subobj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_box_pack_end(IntPtr obj, IntPtr subobj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_box_pack_after(IntPtr obj, IntPtr subobj, IntPtr after);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_box_unpack(IntPtr obj, IntPtr subobj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_box_unpack_all(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_box_align_set(IntPtr obj, double horizontal, double vertical);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_box_align_get(IntPtr obj, out double horizontal, out double vertical);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_box_align_get(IntPtr obj, IntPtr horizontal, out double vertical);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_box_align_get(IntPtr obj, out double horizontal, IntPtr vertical);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_box_children_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_box_clear(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_box_padding_set(IntPtr obj, int horizontal, int vertical);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_box_padding_get(IntPtr obj, out int horizontal, out int vertical);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_box_layout_set(IntPtr obj, BoxLayoutCallback cb, IntPtr data, BoxDataFreeCallback dataFreeCb);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_box_layout_set(IntPtr obj, BoxLayoutCallback cb, IntPtr data, IntPtr dataFreeCb);
+ }
+}
+
--- /dev/null
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+ internal static partial class Elementary
+ {
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_button_add(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_button_autorepeat_initial_timeout_set(IntPtr obj, double t);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern double elm_button_autorepeat_initial_timeout_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_button_autorepeat_gap_timeout_set(IntPtr obj, double t);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern double elm_button_autorepeat_gap_timeout_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_button_autorepeat_set(IntPtr obj, bool on);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_button_autorepeat_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_radio_add(IntPtr parent);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_radio_group_add(IntPtr obj, IntPtr group);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_radio_state_value_set(IntPtr obj, int value);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern int elm_radio_state_value_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_radio_value_set(IntPtr obj, int value);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern int elm_radio_value_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_radio_selected_object_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_check_add(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_check_state_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_check_state_set(IntPtr obj, bool value);
+ }
+}
--- /dev/null
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+ internal static partial class Elementary
+ {
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_calendar_add(IntPtr parent);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_calendar_weekdays_names_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_calendar_weekdays_names_set(IntPtr obj, string[] weekdays);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_calendar_min_max_year_set(IntPtr obj, int min, int max);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_calendar_min_max_year_get(IntPtr obj, out int min, out int max);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_calendar_selected_time_set(IntPtr obj, ref tm selectedtime);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_calendar_selected_time_get(IntPtr obj, out tm selectedtime);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_calendar_first_day_of_week_set(IntPtr obj, int day);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern int elm_calendar_first_day_of_week_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_calendar_selectable_set(IntPtr obj, int SelectedField);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern int elm_calendar_selectable_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_calendar_displayed_time_get(IntPtr obj, out tm displayedtime);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_calendar_interval_set(IntPtr obj, double interval);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern double elm_calendar_interval_get(IntPtr obj);
+ }
+}
\ No newline at end of file
--- /dev/null
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+ internal static partial class Elementary
+ {
+
+ internal enum Elm_Colorselector_Mode
+ {
+ ELM_COLORSELECTOR_PALETTE = 0, /* Only color palette is displayed. */
+ ELM_COLORSELECTOR_COMPONENTS, /* Only color selector is displayed. */
+ ELM_COLORSELECTOR_BOTH, /* Both Palette and selector is displayed, default.*/
+ ELM_COLORSELECTOR_PICKER, /* Only color picker is displayed. */
+ ELM_COLORSELECTOR_ALL /* All possible color selector is displayed. */
+ };
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_colorselector_add(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_colorselector_color_set(IntPtr obj, int r, int g, int b, int a);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_colorselector_color_get(IntPtr obj, out int r, out int g, out int b, out int a);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_colorselector_palette_name_set(IntPtr obj, string name);
+
+ [DllImport(Libraries.Elementary, EntryPoint = "elm_colorselector_palette_name_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
+ internal static extern IntPtr _elm_colorselector_palette_name_get(IntPtr obj);
+ internal static string elm_colorselector_palette_name_get(IntPtr obj)
+ {
+ var text = _elm_colorselector_palette_name_get(obj);
+ return Marshal.PtrToStringAnsi(text);
+ }
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_colorselector_mode_set(IntPtr obj, Elm_Colorselector_Mode mode);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern Elm_Colorselector_Mode elm_colorselector_mode_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_colorselector_palette_color_add(IntPtr obj, int r, int g, int b, int a);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_colorselector_palette_clear(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_colorselector_palette_selected_item_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_colorselector_palette_item_color_get(IntPtr obj, out int r, out int g, out int b, out int a);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern int elm_colorselector_palette_item_color_set(IntPtr obj, int r, int g, int b, int a);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_colorselector_palette_item_selected_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_colorselector_palette_item_selected_set(IntPtr obj, bool selected);
+
+ }
+}
--- /dev/null
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+ internal static partial class Elementary
+ {
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_ctxpopup_add(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_ctxpopup_horizontal_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_ctxpopup_horizontal_set(IntPtr obj, bool horizontal);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_ctxpopup_auto_hide_disabled_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_ctxpopup_auto_hide_disabled_set(IntPtr obj, bool disabled);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_ctxpopup_hover_parent_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_ctxpopup_hover_parent_set(IntPtr obj, IntPtr parent);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_ctxpopup_direction_available_get(IntPtr obj, int direction);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_ctxpopup_direction_priority_set(IntPtr obj, int first, int second, int third, int fourth);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_ctxpopup_direction_priority_get(IntPtr obj, out int first, out int second, out int third, out int fourth);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern int elm_ctxpopup_direction_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_ctxpopup_dismiss(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_ctxpopup_clear(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_ctxpopup_item_append(IntPtr obj, string label, IntPtr icon, Evas.SmartCallback func, IntPtr data);
+ }
+}
--- /dev/null
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+ internal static partial class Elementary
+ {
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_datetime_add(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_datetime_value_set(IntPtr obj, ref tm newtime);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_datetime_value_get(IntPtr obj, ref tm currtime);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_datetime_format_set(IntPtr obj, string format);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr _elm_datetime_format_get(IntPtr obj);
+
+ internal static string elm_datetime_format_get(IntPtr obj)
+ {
+ var format = _elm_datetime_format_get(obj);
+ return Marshal.PtrToStringAnsi(format);
+ }
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_datetime_value_max_set(IntPtr obj, ref tm maxtime);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_datetime_value_max_get(IntPtr obj, ref tm maxtime);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_datetime_value_min_set(IntPtr obj, ref tm mintime);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_datetime_value_min_get(IntPtr obj, ref tm mintime);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_datetime_field_limit_set(IntPtr obj, int type, int min, int max);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_datetime_field_limit_get(IntPtr obj, int type, out int min, out int max);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_datetime_field_visible_set(IntPtr obj, int type, bool visible);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_datetime_field_visible_get(IntPtr obj, int type);
+
+ [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
+ internal struct tm
+ {
+ public int tm_sec;
+ public int tm_min;
+ public int tm_hour;
+ public int tm_mday;
+ public int tm_mon;
+ public int tm_year;
+ public int tm_wday;
+ public int tm_yday;
+ public int tm_isdst;
+ }
+ internal enum DateTimeFieldType
+ {
+ Year,
+ Month,
+ Date,
+ Hour,
+ Minute,
+ AmPm
+ }
+ }
+}
+
--- /dev/null
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+ internal static partial class Elementary
+ {
+ /// <summary>
+ /// Types of "Enter" keys available for different keyboards layout
+ /// </summary>
+ public enum ReturnKeyType
+ {
+ Default,
+ Done,
+ Go,
+ Join,
+ Login,
+ Next,
+ Search,
+ Send,
+ Signin
+ }
+
+ public enum InputPanelLayout
+ {
+ Normal,
+ Number,
+ Email,
+ Url,
+ PhoneNumber,
+ Ip,
+ Month,
+ NumberOnly,
+ Invalid,
+ Hex,
+ Terminal,
+ Password,
+ DateTime,
+ Emoticon
+ }
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_entry_add(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_entry_editable_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_entry_editable_set(IntPtr obj, bool value);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_entry_single_line_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_entry_single_line_set(IntPtr obj, bool value);
+
+ [DllImport(Libraries.Elementary, EntryPoint = "elm_entry_entry_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
+ internal static extern IntPtr _elm_entry_entry_get(IntPtr obj);
+
+ internal static string elm_entry_entry_get(IntPtr obj)
+ {
+ var text = _elm_entry_entry_get(obj);
+ return Marshal.PtrToStringAnsi(text);
+ }
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_entry_entry_set(IntPtr obj, string value);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_entry_password_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_entry_password_set(IntPtr obj, bool value);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_entry_is_empty(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_entry_cursor_next(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_entry_cursor_prev(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_entry_cursor_up(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_entry_cursor_down(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_entry_cursor_begin_set(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_entry_cursor_end_set(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_entry_cursor_line_begin_set(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_entry_cursor_line_end_set(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern int elm_entry_cursor_pos_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_entry_cursor_pos_set(IntPtr obj, int pos);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern string elm_entry_markup_to_utf8(IntPtr text);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern string elm_entry_markup_to_utf8(string text);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_entry_input_panel_show(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_entry_input_panel_enabled_set(IntPtr obj, bool enabled);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_entry_input_panel_return_key_type_set(IntPtr obj, ReturnKeyType keyType);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_entry_input_panel_layout_set(IntPtr obj, InputPanelLayout layout);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern InputPanelLayout elm_entry_input_panel_layout_get(IntPtr obj);
+
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_entry_text_style_user_pop(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_entry_text_style_user_push(IntPtr obj, string style);
+
+ [DllImport(Libraries.Elementary, EntryPoint = "elm_entry_text_style_user_peek", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
+ internal static extern IntPtr _elm_entry_text_style_user_peek(IntPtr obj);
+
+ internal static string elm_entry_text_style_user_peek(IntPtr obj)
+ {
+ var text = _elm_entry_entry_get(obj);
+ return Marshal.PtrToStringAnsi(text);
+ }
+ }
+}
+
--- /dev/null
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+ internal static partial class Elementary
+ {
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_gengrid_add(IntPtr parent);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_gengrid_align_set(IntPtr obj, double align_x, double align_y);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_gengrid_align_get(IntPtr obj, out double align_x, out double align_y);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_gengrid_align_get(IntPtr obj, IntPtr align_x, out double align_y);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_gengrid_align_get(IntPtr obj, out double align_x, IntPtr align_y);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_gengrid_horizontal_set(IntPtr obj, bool horizontal);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_gengrid_horizontal_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_gengrid_multi_select_set(IntPtr obj, bool multi);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_gengrid_multi_select_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_gengrid_item_append(IntPtr obj, IntPtr itc, IntPtr data, Evas.SmartCallback func, IntPtr func_data);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_gengrid_item_prepend(IntPtr obj, IntPtr itc, IntPtr data, Evas.SmartCallback func, IntPtr func_data);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_gengrid_item_insert_before(IntPtr obj, IntPtr itc, IntPtr data, IntPtr before, Evas.SmartCallback func, IntPtr func_data);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_gengrid_item_class_new();
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_gengrid_item_size_set(IntPtr obj, int w, int h);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_gengrid_item_size_get(IntPtr obj, out int w, out int h);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_gengrid_item_size_get(IntPtr obj, IntPtr w, out int h);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_gengrid_item_size_get(IntPtr obj, out int w, IntPtr h);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_gengrid_filled_set(IntPtr obj, bool fill);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_gengrid_filled_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern int elm_gengrid_item_index_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_gengrid_clear(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_gengrid_item_selected_set(IntPtr obj, bool selected);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_gengrid_item_selected_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern uint elm_gengrid_items_count(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_gengrid_highlight_mode_set(IntPtr obj, bool highlight);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_gengrid_highlight_mode_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_gengrid_item_show(IntPtr obj, int type);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_gengrid_item_bring_in(IntPtr obj, int type);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_gengrid_item_select_mode_set(IntPtr it, int mode);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern int elm_gengrid_item_select_mode_get(IntPtr it);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_gengrid_select_mode_set(IntPtr it, int mode);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern int elm_gengrid_select_mode_get(IntPtr it);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_gengrid_realized_items_update(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_gengrid_item_update(IntPtr obj);
+ }
+}
--- /dev/null
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+ internal static partial class Elementary
+ {
+ internal enum Elm_Genlist_Item_Scrollto_Type
+ {
+ ELM_GENLIST_ITEM_SCROLLTO_NONE = 0, // Scrolls to nowhere
+ ELM_GENLIST_ITEM_SCROLLTO_IN = (1 << 0), // Scrolls to the nearest viewport
+ ELM_GENLIST_ITEM_SCROLLTO_TOP = (1 << 1), // Scrolls to the top of the viewport
+ ELM_GENLIST_ITEM_SCROLLTO_MIDDLE = (1 << 2), // Scrolls to the middle of the viewport
+ ELM_GENLIST_ITEM_SCROLLTO_BOTTOM = (1 << 3) // Scrolls to the bottom of the viewport
+ }
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_genlist_add(IntPtr parent);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_genlist_mode_set(IntPtr obj, int mode);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern int elm_genlist_mode_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_genlist_select_mode_set(IntPtr obj, int mode);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern int elm_genlist_select_mode_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_genlist_item_append(IntPtr obj, IntPtr itc, IntPtr data, IntPtr parent, int type, Evas.SmartCallback func, IntPtr func_data);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_genlist_item_prepend(IntPtr obj, IntPtr itc, IntPtr data, IntPtr parent, int type, Evas.SmartCallback func, IntPtr func_data);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_genlist_item_insert_before(IntPtr obj, IntPtr itc, IntPtr data, IntPtr parent, IntPtr before, int type, Evas.SmartCallback func, IntPtr func_data);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_genlist_item_class_new();
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_genlist_item_class_free(IntPtr itemClass);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_genlist_block_count_set(IntPtr obj, int count);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern int elm_genlist_block_count_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_genlist_homogeneous_set(IntPtr obj, bool homogeneous);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_genlist_homogeneous_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern int elm_genlist_item_index_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern int elm_genlist_item_type_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_genlist_item_parent_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_genlist_realized_items_update(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_genlist_item_update(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_genlist_item_show(IntPtr item, Elm_Genlist_Item_Scrollto_Type type);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_genlist_item_bring_in(IntPtr item, Elm_Genlist_Item_Scrollto_Type type);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern int elm_genlist_items_count(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_genlist_first_item_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_genlist_item_selected_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_genlist_item_selected_set(IntPtr obj, bool selected);
+ }
+}
--- /dev/null
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+ internal static partial class Elementary
+ {
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_image_add(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_image_object_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_image_object_size_get(IntPtr obj, out int w, out int h);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_image_preload_disabled_set(IntPtr obj, bool disabled);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_image_file_set(IntPtr obj, string file, string group);
+
+ [DllImport(Libraries.Elementary)]
+ 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)
+ {
+ IntPtr file;
+ IntPtr group;
+ _elm_image_file_get(obj, out file, out group);
+ return Marshal.PtrToStringAnsi(file);
+ }
+
+ [DllImport(Libraries.Elementary)]
+ internal static unsafe extern bool elm_image_memfile_set(IntPtr obj, byte* img, long size, IntPtr format, IntPtr key);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_image_smooth_set(IntPtr obj, bool smooth);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_image_smooth_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_image_resizable_set(IntPtr obj, bool up, bool down);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_image_resizable_get(IntPtr obj, out bool up, out bool down);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_image_no_scale_set(IntPtr obj, bool no_scale);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_image_no_scale_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_image_aspect_fixed_set(IntPtr obj, bool value);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_image_aspect_fixed_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_image_fill_outside_set(IntPtr obj, bool fill_outside);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_image_fill_outside_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_image_animated_available_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_image_animated_set(IntPtr obj, bool anim);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_image_animated_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_image_animated_play_set(IntPtr obj, bool play);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_image_animated_play_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_image_prescale_set(IntPtr obj, int size);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern int elm_image_prescale_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_image_editable_set(IntPtr obj, bool set);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_image_editable_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern int elm_image_orient_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_image_orient_set(IntPtr obj, int orient);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_icon_add(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_icon_standard_set(IntPtr obj, string name);
+
+ [DllImport(Libraries.Elementary, EntryPoint = "elm_icon_standard_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
+ internal static extern IntPtr _elm_icon_standard_get(IntPtr obj);
+ internal static string elm_icon_standard_get(IntPtr obj)
+ {
+ var text = _elm_icon_standard_get(obj);
+ return Marshal.PtrToStringAnsi(text);
+ }
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_icon_thumb_set(IntPtr obj, string file, string group);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern int elm_icon_order_lookup_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_icon_order_lookup_set(IntPtr obj, int order);
+ }
+}
+
--- /dev/null
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+ internal static partial class Elementary
+ {
+ internal delegate void EventCallback(IntPtr data, IntPtr obj, IntPtr info);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_index_add(IntPtr parent);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_index_autohide_disabled_get(IntPtr index);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_index_autohide_disabled_set(IntPtr index, bool disabled);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_index_horizontal_get(IntPtr index);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_index_horizontal_set(IntPtr index, bool horizontal);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_index_item_append(IntPtr index, string text, EventCallback callback, IntPtr data);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_index_item_prepend(IntPtr index, string text, EventCallback callback, IntPtr data);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_index_selected_item_get(IntPtr index, int level);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_index_item_selected_set(IntPtr item, bool selected);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_index_level_go(IntPtr index, int level);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_index_indicator_disabled_get(IntPtr index);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_index_indicator_disabled_set(IntPtr index, bool disabled);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_index_omit_enabled_get(IntPtr index);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_index_omit_enabled_set(IntPtr index, bool enabled);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_index_item_insert_before(IntPtr obj, IntPtr before, string letter, EventCallback func, IntPtr data);
+ }
+}
--- /dev/null
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+ internal static partial class Elementary
+ {
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_label_add(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_label_slide_mode_set(IntPtr obj, int mode);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern int elm_label_slide_mode_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_label_slide_duration_set(IntPtr obj, double duration);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern double elm_label_slide_duration_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_label_slide_go(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_label_line_wrap_set(IntPtr obj, int wrap);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern int elm_label_line_wrap_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_label_wrap_width_set(IntPtr obj, int w);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern int elm_label_wrap_width_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_label_ellipsis_set(IntPtr obj, bool ellipsis);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_label_ellipsis_get(IntPtr obj);
+ }
+}
--- /dev/null
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+ internal static partial class Elementary
+ {
+ public enum Elm_List_Mode
+ {
+ ELM_LIST_COMPRESS = 0,
+ ELM_LIST_SCROLL,
+ ELM_LIST_LIMIT,
+ ELM_LIST_EXPAND,
+ ELM_LIST_LAST
+ }
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_list_add(IntPtr parent);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_list_item_append(IntPtr obj, string label, IntPtr lefticon, IntPtr righticon, Evas.SmartCallback func, IntPtr data);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_list_item_prepend(IntPtr obj, string label, IntPtr icon, IntPtr end, Evas.SmartCallback func, IntPtr data);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_list_go(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_list_mode_set(IntPtr obj, Elm_List_Mode listMode);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern Elm_List_Mode elm_list_mode_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_list_item_selected_set(IntPtr obj, bool value);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_list_selected_item_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_list_clear(IntPtr obj);
+ }
+}
--- /dev/null
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+ internal static partial class Elementary
+ {
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_naviframe_item_pop_cb_set(IntPtr it, Elm_Naviframe_Item_Pop_Cb func, IntPtr data);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_naviframe_add(IntPtr parent);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_naviframe_prev_btn_auto_pushed_set(IntPtr obj, bool value);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_naviframe_prev_btn_auto_pushed_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_naviframe_item_title_enabled_set(IntPtr item, bool enable, bool transition);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_naviframe_item_title_enabled_get(IntPtr item);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_naviframe_item_push(IntPtr obj, string title, IntPtr prev, IntPtr next, IntPtr content, string style);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_naviframe_item_pop(IntPtr obj);
+
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+ internal delegate bool Elm_Naviframe_Item_Pop_Cb(IntPtr data, IntPtr item);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_naviframe_content_preserve_on_pop_set(IntPtr obj, bool preserve);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_naviframe_content_preserve_on_pop_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_naviframe_item_insert_before(IntPtr naviframe, IntPtr before, string title, IntPtr prev, IntPtr next, IntPtr content, string style);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_naviframe_top_item_get(IntPtr naviframe);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_naviframe_bottom_item_get(IntPtr naviframe);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_naviframe_item_pop_to(IntPtr item);
+ }
+}
--- /dev/null
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+ internal static partial class Elementary
+ {
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_panel_add(IntPtr parent);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_panel_toggle(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_panel_hidden_set(IntPtr obj, bool hidden);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_panel_hidden_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_panel_scrollable_set(IntPtr obj, bool scrollable);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_panel_scrollable_content_size_set(IntPtr obj, double ratio);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_panel_orient_set(IntPtr obj, int orient);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern int elm_panel_orient_get(IntPtr obj);
+ }
+}
--- /dev/null
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+ internal static partial class Elementary
+ {
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_panes_add(IntPtr parent);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_panes_content_left_size_set(IntPtr obj, double size);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern double elm_panes_content_left_size_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_panes_content_right_size_set(IntPtr obj, double size);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern double elm_panes_content_right_size_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_panes_horizontal_set(IntPtr obj, bool horizontal);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_panes_horizontal_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_panes_fixed_set(IntPtr obj, bool fix);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_panes_fixed_get(IntPtr obj);
+ }
+}
--- /dev/null
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+ internal static partial class Elementary
+ {
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_popup_add(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern double elm_popup_timeout_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_popup_timeout_set(IntPtr obj, double timeout);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern double elm_popup_timeout_set(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern int elm_popup_orient_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_popup_orient_set(IntPtr obj, int orient);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern int elm_popup_orient_set(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_popup_allow_events_set(IntPtr obj, bool allow);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_popup_allow_events_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_popup_item_append(IntPtr obj, string label, IntPtr icon, Evas.SmartCallback func, IntPtr data);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_popup_dismiss(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_popup_align_set(IntPtr obj, double horizontal, double vertical);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_popup_align_get(IntPtr obj, out double horizontal, out double vertical);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_popup_align_get(IntPtr obj, IntPtr horizontal, out double vertical);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_popup_align_get(IntPtr obj, out double horizontal, IntPtr vertical);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_popup_content_text_wrap_type_set(IntPtr obj, int type);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern int elm_popup_content_text_wrap_type_get(IntPtr obj);
+
+ internal static double GetPopupAlignX(IntPtr obj)
+ {
+ double x;
+ elm_popup_align_get(obj, out x, IntPtr.Zero);
+ return x;
+ }
+
+ internal static double GetPopupAlignY(IntPtr obj)
+ {
+ double y;
+ elm_popup_align_get(obj, IntPtr.Zero, out y);
+ return y;
+ }
+
+ internal static void SetPopupAlignX(IntPtr obj, double x)
+ {
+ double y = GetPopupAlignY(obj);
+ elm_popup_align_set(obj, x, y);
+ }
+
+ internal static void SetPopupAlignY(IntPtr obj, double y)
+ {
+ double x = GetPopupAlignX(obj);
+ elm_popup_align_set(obj, x, y);
+ }
+ }
+}
--- /dev/null
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+ internal static partial class Elementary
+ {
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_progressbar_add(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_progressbar_pulse_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_progressbar_pulse_set(IntPtr obj, bool pulse);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_progressbar_horizontal_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_progressbar_horizontal_set(IntPtr obj, bool horizontal);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_progressbar_inverted_set(IntPtr obj, bool inverted);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_progressbar_inverted_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_progressbar_value_set(IntPtr obj, double val);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern double elm_progressbar_value_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_progressbar_span_size_set(IntPtr obj, int size);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern int elm_progressbar_span_size_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_progressbar_pulse(IntPtr obj, bool state);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_progressbar_unit_format_set(IntPtr obj, string format);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr _elm_progressbar_unit_format_get(IntPtr obj);
+
+ internal static string elm_progressbar_unit_format_get(IntPtr obj)
+ {
+ var format = _elm_progressbar_unit_format_get(obj);
+ return Marshal.PtrToStringAnsi(format);
+ }
+ }
+}
--- /dev/null
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+ internal static partial class Elementary
+ {
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_interface_scrollable_content_size_get (out int w, out int h);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_interface_scrollable_page_bring_in (int pagenumber_h, int pagenumber_v);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_scroller_add (IntPtr parent);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_scroller_bounce_get(IntPtr obj, out bool h_bounce, out bool v_bounce);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_scroller_bounce_set(IntPtr obj, bool h_bounce, bool v_bounce);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_scroller_child_size_get (IntPtr obj, out int w, out int h);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_scroller_content_min_limit (IntPtr obj, bool w, bool h);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_scroller_current_page_get (IntPtr obj, out int h_pagenumber, out int v_pagenumber);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_scroller_gravity_get(IntPtr obj, out double x, out double y);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_scroller_gravity_set (IntPtr obj, double x, double y);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_scroller_last_page_get (IntPtr obj, out int h_pagenumber, out int v_pagenumber);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_scroller_loop_get(IntPtr obj, out bool loop_h, out bool loop_v);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_scroller_loop_set (IntPtr obj, bool loop_h, bool loop_v);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern int elm_scroller_movement_block_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_scroller_movement_block_set(IntPtr obj, int block);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_scroller_page_bring_in (IntPtr obj, int h_pagenumber, int v_pagenumber);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_scroller_page_relative_get (IntPtr obj, out double h_pagerel, out double v_pagerel);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_scroller_page_relative_set (IntPtr obj, double h_pagerel, double v_pagerel);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_scroller_page_show (IntPtr obj, int h_pagenumber, int v_pagenumber);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_scroller_page_size_get (IntPtr obj, out int h_pagesize, out int v_pagesize);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_scroller_page_size_set (IntPtr obj, int h_pagesize, int v_pagesize);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_scroller_page_snap_get (IntPtr obj, out bool page_h_snap, out bool page_v_snap);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_scroller_page_snap_set (IntPtr obj, bool page_h_snap, bool page_v_snap);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_scroller_policy_get(IntPtr obj, out int policy_h, out int policy_v);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_scroller_policy_get(IntPtr obj, out int policy_h, IntPtr policy_v);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_scroller_policy_get(IntPtr obj, IntPtr policy_h, out int policy_v);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_scroller_policy_set(IntPtr obj, int policy_h, int policy_v);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_scroller_region_bring_in (IntPtr obj, int x, int y, int w, int h);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_scroller_region_get (IntPtr obj, out int x, out int y, out int w, out int h);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_scroller_region_show (IntPtr obj, int x, int y, int w, int h);
+
+ // @TODO uses Elm_Scroller_Single_Direction structure:
+ // internal static extern ElmScrollerSingleDirection elm_scroller_single_direction_get(IntPtr obj);
+ // internal static extern void elm_scroller_single_direction_set(IntPtr obj, ElmScrollerSingleDirection single_dir);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_scroller_step_size_get (IntPtr obj, out int x, out int y);
+
+ [DllImportAttribute(Libraries.Elementary)]
+ internal static extern void elm_scroller_step_size_set (IntPtr obj, int x, int y);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_scroller_wheel_disabled_get (IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_scroller_wheel_disabled_set (IntPtr obj, bool disabled);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_scroller_propagate_events_get (IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_scroller_propagate_events_set (IntPtr obj, bool propagation);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_scroller_page_scroll_limit_get (IntPtr obj, out int page_limit_h_, out int page_limit_v_);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_scroller_page_scroll_limit_set (IntPtr obj, int page_limit_h_, int page_limit_v_);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_object_scroll_lock_y_set(IntPtr obj, bool enable);
+ }
+}
--- /dev/null
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+ internal static partial class Elementary
+ {
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_slider_add(IntPtr parent);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_slider_indicator_show_set(IntPtr obj, bool show);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_slider_indicator_show_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_slider_indicator_format_set(IntPtr obj, string indicator);
+
+ [DllImport(Libraries.Elementary, EntryPoint = "elm_slider_indicator_format_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
+ internal static extern IntPtr _elm_slider_indicator_format_get(IntPtr obj);
+ internal static string elm_slider_indicator_format_get(IntPtr obj)
+ {
+ var text = _elm_slider_indicator_format_get(obj);
+ return Marshal.PtrToStringAnsi(text);
+ }
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_slider_unit_format_set(IntPtr obj, string units);
+
+ [DllImport(Libraries.Elementary, EntryPoint = "elm_slider_unit_format_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
+ internal static extern IntPtr _elm_slider_unit_format_get(IntPtr obj);
+ internal static string elm_slider_unit_format_get(IntPtr obj)
+ {
+ var text = _elm_slider_unit_format_get(obj);
+ return Marshal.PtrToStringAnsi(text);
+ }
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_slider_inverted_set(IntPtr obj, bool inverted);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_slider_inverted_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_slider_horizontal_set(IntPtr obj, bool value);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_slider_horizontal_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_slider_min_max_set(IntPtr obj, double min, double max);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_slider_min_max_get(IntPtr obj, out double min, out double max);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_slider_min_max_get(IntPtr obj, out double min, IntPtr max);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_slider_min_max_get(IntPtr obj, IntPtr min, out double max);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_slider_value_set(IntPtr obj, double val);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern double elm_slider_value_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_slider_span_size_set(IntPtr obj, int size);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern int elm_slider_span_size_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_slider_step_set(IntPtr obj, double step);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern double elm_slider_step_get(IntPtr obj);
+ }
+}
--- /dev/null
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+ internal static partial class Elementary
+ {
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_spinner_add(IntPtr parent);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_spinner_min_max_set(IntPtr obj, double min, double max);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_spinner_min_max_get(IntPtr obj, out double min, IntPtr max);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_spinner_min_max_get(IntPtr obj, IntPtr min, out double max);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_spinner_step_set(IntPtr obj, double step);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern double elm_spinner_step_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_spinner_wrap_set(IntPtr obj, bool wrap);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_spinner_wrap_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_spinner_interval_set(IntPtr obj, double interval);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern double elm_spinner_interval_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_spinner_round_set(IntPtr obj, int rnd);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern int elm_spinner_round_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_spinner_editable_set(IntPtr obj, bool editable);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_spinner_editable_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_spinner_base_set(IntPtr obj, double value);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern double elm_spinner_base_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_spinner_value_set(IntPtr obj, double val);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern double elm_spinner_value_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_spinner_label_format_set(IntPtr obj, string fmt);
+
+ [DllImport(Libraries.Elementary, EntryPoint = "elm_spinner_label_format_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
+ internal static extern IntPtr _elm_spinner_label_format_get(IntPtr obj);
+ internal static string elm_spinner_label_format_get(IntPtr obj)
+ {
+ var text = _elm_spinner_label_format_get(obj);
+ return Marshal.PtrToStringAnsi(text);
+ }
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_spinner_special_value_add(IntPtr obj, double value, string label);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_spinner_special_value_del(IntPtr obj, double value);
+
+ [DllImport(Libraries.Elementary, EntryPoint = "elm_spinner_special_value_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
+ internal static extern IntPtr _elm_spinner_special_value_get(IntPtr obj, double value);
+ internal static string elm_spinner_special_value_get(IntPtr obj, double value)
+ {
+ var text = _elm_spinner_special_value_get(obj, value);
+ return Marshal.PtrToStringAnsi(text);
+ }
+ }
+}
--- /dev/null
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+ internal static partial class Elementary
+ {
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_table_add(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_table_homogeneous_set(IntPtr obj, bool homogeneous);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_table_homogeneous_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_table_padding_set(IntPtr obj, int horizontal, int vertical);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_table_padding_get(IntPtr obj, out int horizontal, out int vertical);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_table_clear (IntPtr obj, bool clear);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_table_unpack (IntPtr obj, IntPtr subobj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_table_pack(IntPtr obj, IntPtr subobj, int column, int row, int colspan, int rowspan);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_table_pack_set(IntPtr subobj, int col, int row, int colspan, int rowspan);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_table_pack_get(IntPtr subobj, out int col, out int row, out int colspan, out int rowspan);
+ }
+}
--- /dev/null
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+ internal static partial class Elementary
+ {
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_toolbar_add(IntPtr parent);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_toolbar_shrink_mode_set(IntPtr obj, int shrink_mode);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern int elm_toolbar_shrink_mode_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_toolbar_item_append(IntPtr obj, string icon, string label, Evas.SmartCallback func, IntPtr data);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_toolbar_item_prepend(IntPtr obj, string icon, string label, Evas.SmartCallback func, IntPtr data);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_toolbar_item_insert_before(IntPtr obj, IntPtr before, string icon, string label, Evas.SmartCallback func, IntPtr data);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_toolbar_transverse_expanded_set(IntPtr obj, bool transverse_expanded);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_toolbar_transverse_expanded_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_toolbar_select_mode_set(IntPtr obj, int mode);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern int elm_toolbar_select_mode_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern double elm_toolbar_align_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_toolbar_align_set(IntPtr obj, double align);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_toolbar_homogeneous_set(IntPtr obj, bool homogeneous);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_toolbar_homogeneous_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_toolbar_item_icon_set(IntPtr obj, string icon);
+
+ [DllImport(Libraries.Elementary, EntryPoint = "elm_toolbar_item_icon_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
+ internal static extern IntPtr _elm_toolbar_item_icon_get(IntPtr obj);
+ internal static string elm_toolbar_item_icon_get(IntPtr obj)
+ {
+ var text = _elm_toolbar_item_icon_get(obj);
+ return Marshal.PtrToStringAnsi(text);
+ }
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_toolbar_first_item_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_toolbar_last_item_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_toolbar_item_selected_set(IntPtr obj, bool selected);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_toolbar_item_selected_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_toolbar_selected_item_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_toolbar_item_separator_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_toolbar_item_separator_set(IntPtr obj, bool separator);
+ }
+}
--- /dev/null
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+ internal static partial class Elementary
+ {
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_win_add(IntPtr parent, string name, int type);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_win_util_standard_add(string name, string title);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_win_activate(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_win_title_set(IntPtr obj, string title);
+
+ [DllImport(Libraries.Elementary, EntryPoint = "elm_win_title_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
+ internal static extern IntPtr _elm_win_title_get(IntPtr obj);
+
+ internal static string elm_win_title_get(IntPtr obj)
+ {
+ var text = _elm_win_title_get(obj);
+ return Marshal.PtrToStringAnsi(text);
+ }
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_win_screen_size_get(IntPtr obj, out int x, out int y, out int w, out int h);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_win_resize_object_del(IntPtr obj, IntPtr subobj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_win_resize_object_add(IntPtr obj, IntPtr subobj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_win_autodel_set(IntPtr obj, bool autodel);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_win_autodel_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_win_indicator_opacity_set(IntPtr obj, int opacity);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern int elm_win_indicator_opacity_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_win_indicator_mode_set(IntPtr obj, int mode);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern int elm_win_indicator_mode_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_win_conformant_set(IntPtr obj, bool conformant);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_win_fullscreen_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_win_fullscreen_set(IntPtr obj, bool fullscreen);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_win_rotation_set(IntPtr obj, int rotation);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern int elm_win_rotation_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_win_wm_rotation_supported_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary, EntryPoint = "elm_win_wm_rotation_available_rotations_set")]
+ internal static extern void _elm_win_wm_rotation_available_rotations_set(IntPtr obj, IntPtr rotations, uint count);
+
+ internal static void elm_win_wm_rotation_available_rotations_set(IntPtr obj, int[] rotations)
+ {
+ IntPtr pRotations = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(int)) * rotations.Length);
+ Marshal.Copy(rotations, 0, pRotations, rotations.Length);
+ _elm_win_wm_rotation_available_rotations_set(obj, pRotations, (uint)rotations.Length);
+ Marshal.FreeHGlobal(pRotations);
+ }
+
+ [DllImport(Libraries.Elementary, EntryPoint = "elm_win_wm_rotation_available_rotations_get")]
+ internal static extern bool _elm_win_wm_rotation_available_rotations_get(IntPtr obj, out IntPtr rotations, out int count);
+
+ internal static bool elm_win_wm_rotation_available_rotations_get(IntPtr obj, out int[] rotations)
+ {
+ IntPtr rotationArrPtr;
+ int count;
+ if (_elm_win_wm_rotation_available_rotations_get(obj, out rotationArrPtr, out count))
+ {
+ rotations = new int[count];
+ Marshal.Copy(rotationArrPtr, rotations, 0, count);
+ Libc.Free(rotationArrPtr);
+ return true;
+ }
+ rotations = null;
+ return false;
+ }
+ }
+}
--- /dev/null
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+ internal static partial class Elementary
+ {
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_config_accel_preference_set(string preference);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_object_tree_dump(IntPtr top);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_object_disabled_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_object_disabled_set(IntPtr obj, bool disabled);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_init(int argc, string[] argv);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool ecore_main_loop_glib_integrate();
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_run();
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_exit();
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_shutdown();
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_app_base_scale_set(double base_scale);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_conformant_add(IntPtr obj);
+
+ [DllImport(Libraries.Elementary, EntryPoint = "elm_object_part_text_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
+ internal static extern IntPtr _elm_object_part_text_get(IntPtr obj, IntPtr part);
+
+ [DllImport(Libraries.Elementary, EntryPoint = "elm_object_part_text_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
+ internal static extern IntPtr _elm_object_part_text_get(IntPtr obj, string part);
+
+ internal static string elm_object_part_text_get(IntPtr obj, string part)
+ {
+ var text = _elm_object_part_text_get(obj, part);
+ return Marshal.PtrToStringAnsi(text);
+ }
+
+ internal static string elm_object_part_text_get(IntPtr obj)
+ {
+ var text = _elm_object_part_text_get(obj, IntPtr.Zero);
+ return Marshal.PtrToStringAnsi(text);
+ }
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_object_item_part_content_set(IntPtr obj, string part, IntPtr content);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_object_item_part_content_unset(IntPtr obj, string part);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_object_item_part_content_set(IntPtr obj, IntPtr part, IntPtr content);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_object_part_content_set(IntPtr obj, string part, IntPtr content);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_object_part_content_set(IntPtr obj, IntPtr part, IntPtr content);
+
+ internal static void elm_object_content_set(IntPtr obj, IntPtr content)
+ {
+ elm_object_part_content_set(obj, IntPtr.Zero, content);
+ }
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_object_part_content_unset(IntPtr obj, string part);
+
+ internal static void elm_object_content_unset(IntPtr obj)
+ {
+ elm_object_part_content_unset(obj, null);
+ }
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_layout_add(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_layout_content_set(IntPtr obj, string swallow, IntPtr content);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_layout_content_unset(IntPtr obj, string swallow);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_layout_text_set(IntPtr obj, string part, string text);
+
+ [DllImport(Libraries.Elementary, EntryPoint = "elm_layout_text_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
+ internal static extern IntPtr _elm_layout_text_get(IntPtr obj, string part);
+
+ internal static string elm_layout_text_get(IntPtr obj, string part)
+ {
+ var text = _elm_layout_text_get(obj, part);
+ return Marshal.PtrToStringAnsi(text);
+ }
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_layout_theme_set(IntPtr obj, string klass, string group, string style);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_layout_file_set(IntPtr obj, string file, string group);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_object_style_set(IntPtr obj, string style);
+
+ [DllImport(Libraries.Elementary, EntryPoint = "elm_object_style_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
+ internal static extern IntPtr _elm_object_style_get(IntPtr obj);
+
+ internal static string elm_object_style_get(IntPtr obj)
+ {
+ var text = _elm_object_style_get(obj);
+ return Marshal.PtrToStringAnsi(text);
+ }
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_object_part_color_set(IntPtr obj, string part, int r, int g, int b, int a);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_object_part_text_set(IntPtr obj, string part, string text);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_object_part_text_set(IntPtr obj, IntPtr part, string text);
+
+ [DllImport(Libraries.Elementary, EntryPoint = "elm_object_item_part_text_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
+ internal static extern IntPtr _elm_object_item_part_text_get(IntPtr obj, string part);
+
+ internal static string elm_object_item_part_text_get(IntPtr obj, string part)
+ {
+ var text = _elm_object_item_part_text_get(obj, part);
+ return Marshal.PtrToStringAnsi(text);
+ }
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_object_item_part_text_set(IntPtr obj, string part, string label);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_object_item_part_text_set(IntPtr obj, IntPtr part, string label);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_object_item_data_get(IntPtr it);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_object_item_data_set(IntPtr it, IntPtr data);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_object_item_del(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_object_item_del_cb_set(IntPtr obj, Interop.Evas.SmartCallback callback);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_object_focus_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_object_focus_set(IntPtr obj, bool focus);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_theme_extension_add(IntPtr obj, string path);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_theme_new();
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_object_theme_set(IntPtr obj, IntPtr theme);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_layout_edje_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool edje_object_part_exists(IntPtr obj, string part);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr edje_object_part_object_get(IntPtr obj, string part);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool edje_object_part_geometry_get(IntPtr obj, string part, out int x, out int y, out int w, out int h);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool edje_object_part_text_set(IntPtr obj, string part, string text);
+
+ [DllImport(Libraries.Elementary, EntryPoint = "edje_object_part_text_get", CharSet = CharSet.Ansi)]
+ internal static extern IntPtr _edje_object_part_text_get(IntPtr obj, string part);
+
+ internal static string edje_object_part_text_get(IntPtr obj, string part)
+ {
+ var text = _edje_object_part_text_get(obj, part);
+ return Marshal.PtrToStringAnsi(text);
+ }
+
+
+ [DllImport(Libraries.Elementary, EntryPoint = "edje_object_part_text_style_user_peek", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
+ internal static extern IntPtr _edje_object_part_text_style_user_peek(IntPtr obj, string part);
+
+ internal static string edje_object_part_text_style_user_peek(IntPtr obj, string part)
+ {
+ var text = _edje_object_part_text_style_user_peek(obj, part);
+ return Marshal.PtrToStringAnsi(text);
+ }
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void edje_object_part_text_style_user_push(IntPtr obj, string part, string style);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void edje_object_part_text_style_user_pop(IntPtr obj, string part);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void edje_object_signal_emit(IntPtr obj, string emission, string source);
+
+ internal static void SetObjectText(IntPtr obj, string text)
+ {
+ elm_object_part_text_set(obj, IntPtr.Zero, text);
+ }
+
+ internal static IntPtr GetPtrToObject(object data)
+ {
+ IntPtr dataPtr = IntPtr.Zero;
+ if (data != null)
+ Marshal.StructureToPtr(data, dataPtr, true);
+ return dataPtr;
+ }
+ }
+}
--- /dev/null
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+ internal static partial class Evas
+ {
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_object_image_file_set(IntPtr obj, string file, string key);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_object_image_alpha_set(IntPtr obj, bool has_alpha);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern bool evas_object_image_alpha_get(IntPtr obj);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern LoadError evas_object_image_load_error_get(IntPtr obj);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_object_image_size_get(IntPtr obj, IntPtr x, out int y);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_object_image_size_get(IntPtr obj, out int x, IntPtr y);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_object_image_size_get(IntPtr obj, out int x, out int y);
+
+ internal enum LoadError
+ {
+ None = 0,
+ Generic = 1,
+ DoesNotExist = 2,
+ PermissionDenied = 3,
+ ResourceAllocationFailed = 4,
+ CorruptFile = 5,
+ UnknownFormat = 6,
+ }
+ }
+}
--- /dev/null
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+ internal static partial class Evas
+ {
+ public enum ObjectCallbackType
+ {
+ MouseIn,
+ MouseOut,
+ MouseDown,
+ MouseUp,
+ MouseMove,
+ MouseWheel,
+ MultiDown,
+ MultiUp,
+ MultiMove,
+ Free,
+ KeyDown,
+ KeyUp,
+ FocusIn,
+ FocusOut,
+ Show,
+ Hide,
+ Move,
+ Resize,
+ Restack,
+ Del,
+ Hold,
+ ChangedSizeHints,
+ ImagePreloaded,
+ CanvasFocusIn,
+ CanvasFocusOut,
+ RenderFlushPre,
+ RenderFlushPost,
+ CanvasObjectFocusIn,
+ CanvasObjectFocusOut,
+ ImageUnloaded,
+ RenderPre,
+ RenderPost,
+ ImageResize,
+ DeviceChanged,
+ AxisUpdate,
+ CanvasViewportResize
+ }
+ internal delegate void EventCallback(IntPtr data, IntPtr evas, IntPtr obj, IntPtr info);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_object_event_callback_add(IntPtr obj, ObjectCallbackType type, EventCallback func, IntPtr data);
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_object_event_callback_del(IntPtr obj, ObjectCallbackType type, EventCallback func);
+
+ public delegate void SmartCallback(IntPtr data, IntPtr obj, IntPtr info);
+
+ public static readonly string BackKeyName = "XF86Back";
+ public static readonly string MenuKeyName = "XF86Menu";
+
+ public enum ButtonFlags
+ {
+ None, DoubleClick, TripleClick
+ }
+
+ [DllImport(Libraries.Evas)]
+ internal static extern bool evas_object_key_grab(IntPtr obj, string keyname, ulong modifier, ulong not_modifier, bool exclusive);
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_object_key_ungrab(IntPtr obj, string keyname, ulong modifier, ulong not_modifier);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern IntPtr evas_object_data_get(IntPtr obj, string keyname) ;
+
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_object_data_set(IntPtr obj, string keyname, IntPtr data);
+
+ [DllImport(Libraries.Evas, EntryPoint = "evas_object_type_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
+ internal static extern IntPtr _evas_object_type_get(IntPtr obj);
+
+ internal static string evas_object_type_get(IntPtr obj)
+ {
+ var text = _evas_object_type_get(obj);
+ return Marshal.PtrToStringAnsi(text);
+ }
+
+ [DllImport(Libraries.Evas)]
+ internal static extern IntPtr evas_object_evas_get(IntPtr obj);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern IntPtr evas_object_image_add(IntPtr obj);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_object_del(IntPtr objectPtr);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_object_show(IntPtr obj);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_object_hide(IntPtr obj);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern bool evas_object_visible_get(IntPtr obj);
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_object_smart_callback_add(IntPtr obj, string eventName, SmartCallback seh, IntPtr data);
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_object_smart_callback_del(IntPtr obj, string eventName, SmartCallback seh);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_object_size_hint_min_set(IntPtr obj, int w, int h);
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_object_size_hint_min_get(IntPtr obj, out int w, out int h);
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_object_size_hint_min_get(IntPtr obj, IntPtr w, out int h);
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_object_size_hint_min_get(IntPtr obj, out int w, IntPtr h);
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_object_size_hint_max_set(IntPtr obj, int w, int h);
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_object_size_hint_max_get(IntPtr obj, out int w, out int h);
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_object_size_hint_max_get(IntPtr obj, IntPtr w, out int h);
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_object_size_hint_max_get(IntPtr obj, out int w, IntPtr h);
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_object_size_hint_weight_get(IntPtr obj, out double x, out double y);
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_object_size_hint_weight_get(IntPtr obj, out double x, IntPtr y);
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_object_size_hint_weight_get(IntPtr obj, IntPtr x, out double y);
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_object_size_hint_align_get(IntPtr obj, out double x, out double y);
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_object_size_hint_align_get(IntPtr obj, out double x, IntPtr y);
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_object_size_hint_align_get(IntPtr obj, IntPtr x, out double y);
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_object_size_hint_weight_set(IntPtr obj, double x, double y);
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_object_size_hint_align_set(IntPtr obj, double x, double y);
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_object_move(IntPtr obj, int x, int y);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_object_resize(IntPtr obj, int w, int h);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_object_geometry_set(IntPtr obj,int x, int y, int w, int h);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_object_geometry_get(IntPtr obj, out int x, out int y, out int w, out int h);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_object_geometry_get(IntPtr obj, out int x, IntPtr y, IntPtr w, IntPtr h);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_object_geometry_get(IntPtr obj, IntPtr x, out int y, IntPtr w, IntPtr h);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_object_geometry_get(IntPtr obj, IntPtr x, IntPtr y, out int w, IntPtr h);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_object_geometry_get(IntPtr obj, IntPtr x, IntPtr y, IntPtr w, out int h);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_object_geometry_get(IntPtr obj, IntPtr x, IntPtr y, out int w, out int h);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_object_geometry_get(IntPtr obj, out int x, out int y, IntPtr w, IntPtr h);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern IntPtr evas_object_smart_members_get(IntPtr obj);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern IntPtr evas_map_new(int count);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_map_util_points_populate_from_object_full(IntPtr map, IntPtr obj, int z);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_map_util_points_populate_from_geometry(IntPtr map, int x, int y, int w, int h, int z);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_map_util_3d_rotate(IntPtr map, double dx, double dy, double dz, int cx, int cy, int cz);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_map_util_zoom(IntPtr map, double x, double y, int cx, int cy);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_map_point_coord_set(IntPtr map, int idx, int x, int y, int z);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_map_point_coord_get(IntPtr map, int idx, out int x, out int y, out int z);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_object_map_enable_set(IntPtr obj, bool enabled);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern bool evas_object_map_enable_get(IntPtr obj);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_object_map_set(IntPtr obj, IntPtr map);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern IntPtr evas_object_map_get(IntPtr obj);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_map_free(IntPtr map);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern IntPtr evas_object_rectangle_add(IntPtr evas);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_object_color_set(IntPtr obj, int r, int g, int b, int a);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_object_color_get(IntPtr obj, out int r, out int g, out int b, out int a);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_object_color_get(IntPtr obj, IntPtr r, IntPtr g, IntPtr b, out int a);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_object_clip_set(IntPtr obj, IntPtr clip);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_object_clip_unset(IntPtr obj);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern IntPtr evas_object_clip_get(IntPtr obj);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_object_lower(IntPtr obj);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_event_feed_mouse_move(IntPtr obj, int x, int y, int timestamp, IntPtr data);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_event_feed_mouse_down(IntPtr obj, int b, ButtonFlags flags, int timestamp, IntPtr data);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_event_feed_mouse_up(IntPtr obj, int b, ButtonFlags flags, int timestamp, IntPtr data);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_event_feed_key_down(IntPtr obj, string keyname, string key, string str, string compose, int timestamp, IntPtr data);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_event_feed_key_up(IntPtr obj, string keyname, string key, string str, string compose, int timestamp, IntPtr data);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void evas_object_ref(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void evas_object_unref(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern int evas_object_ref_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void evas_object_repeat_events_set(IntPtr obj, bool repeat);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_object_textblock_size_native_get(IntPtr obj, out int w, out int h);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_object_textblock_size_formatted_get(IntPtr obj, out int w, out int h);
+
+ [DllImport(Libraries.Evas)]
+ internal static extern void evas_object_smart_changed(IntPtr obj);
+
+ internal static void SetX(IntPtr obj, int x)
+ {
+ int y = GetY(obj);
+ evas_object_move(obj, x, y);
+ }
+
+ internal static void SetY(IntPtr obj, int y)
+ {
+ int x = GetX(obj);
+ evas_object_move(obj, x, y);
+ }
+
+ internal static void SetWidth(IntPtr obj, int w)
+ {
+ int h = GetHeight(obj);
+ evas_object_resize(obj, w, h);
+ }
+
+ internal static void SetHeight(IntPtr obj, int h)
+ {
+ int w = GetWidth(obj);
+ evas_object_resize(obj, w, h);
+ }
+
+ internal static int GetX(IntPtr obj)
+ {
+ int x;
+ evas_object_geometry_get(obj, out x, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero);
+ return x;
+ }
+
+ internal static int GetY(IntPtr obj)
+ {
+ int y;
+ evas_object_geometry_get(obj, IntPtr.Zero, out y, IntPtr.Zero, IntPtr.Zero);
+ return y;
+ }
+
+ internal static int GetWidth(IntPtr obj)
+ {
+ int w;
+ evas_object_geometry_get(obj, IntPtr.Zero, IntPtr.Zero, out w, IntPtr.Zero);
+ return w;
+ }
+
+ internal static int GetHeight(IntPtr obj)
+ {
+ int h;
+ evas_object_geometry_get(obj, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, out h);
+ return h;
+ }
+
+ internal static double GetAlignX(IntPtr obj)
+ {
+ double x;
+ evas_object_size_hint_align_get(obj, out x, IntPtr.Zero);
+ return x;
+ }
+
+ internal static double GetAlignY(IntPtr obj)
+ {
+ double y;
+ evas_object_size_hint_align_get(obj, IntPtr.Zero, out y);
+ return y;
+ }
+
+ internal static void SetAlignX(IntPtr obj, double x)
+ {
+ double y = GetAlignY(obj);
+ evas_object_size_hint_align_set(obj, x, y);
+ }
+
+ internal static void SetAlignY(IntPtr obj, double y)
+ {
+ double x = GetAlignX(obj);
+ evas_object_size_hint_align_set(obj, x, y);
+ }
+
+ internal static double GetWeightX(IntPtr obj)
+ {
+ double x;
+ evas_object_size_hint_weight_get(obj, out x, IntPtr.Zero);
+ return x;
+ }
+
+ internal static double GetWeightY(IntPtr obj)
+ {
+ double y;
+ evas_object_size_hint_weight_get(obj, IntPtr.Zero, out y);
+ return y;
+ }
+
+ internal static void SetWeightX(IntPtr obj, double x)
+ {
+ double y = GetWeightY(obj);
+ evas_object_size_hint_weight_set(obj, x, y);
+ }
+
+ internal static void SetWeightY(IntPtr obj, double y)
+ {
+ double x = GetWeightX(obj);
+ evas_object_size_hint_weight_set(obj, x, y);
+ }
+
+ internal static int GetAlpha(IntPtr obj)
+ {
+ int a;
+ evas_object_color_get(obj, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, out a);
+ return a;
+ }
+
+ internal static void SetAlpha(IntPtr obj, int a)
+ {
+ evas_object_color_set(obj, a, a, a, a);
+ }
+
+ internal static void SetPremultipliedColor(IntPtr obj, int r, int g, int b, int a)
+ {
+ evas_object_color_set(obj, r*a/255, g*a/255, b*a/255, a);
+ }
+ }
+}
--- /dev/null
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+internal static partial class Interop
+{
+ internal class EvasObjectEvent<TEventArgs> : IDisposable where TEventArgs : EventArgs
+ {
+ public delegate TEventArgs SmartEventInfoParser(IntPtr data, IntPtr obj, IntPtr info);
+
+ private bool _disposed = false;
+ private readonly object _sender;
+ private readonly IntPtr _handle;
+ private readonly Evas.ObjectCallbackType _type;
+ private readonly SmartEventInfoParser _parser;
+ private readonly List<NativeCallback> _nativeCallbacks = new List<NativeCallback>();
+
+ public EvasObjectEvent(object sender, IntPtr handle, Evas.ObjectCallbackType type, SmartEventInfoParser parser)
+ {
+ _sender = sender;
+ _handle = handle;
+ _type = type;
+ _parser = parser;
+ }
+
+ public EvasObjectEvent(object sender, IntPtr handle, Evas.ObjectCallbackType type) : this(sender, handle, type, null)
+ {
+ }
+
+ ~EvasObjectEvent()
+ {
+ Dispose(false);
+ }
+
+ private struct NativeCallback
+ {
+ public Evas.EventCallback callback;
+ public EventHandler<TEventArgs> eventHandler;
+ }
+
+ public event EventHandler<TEventArgs> On
+ {
+ add
+ {
+ EventHandler<TEventArgs> handler = value;
+ var cb = new Evas.EventCallback((data, evas, obj, info) =>
+ {
+ TEventArgs ea = _parser == null ? (TEventArgs)EventArgs.Empty : _parser(data, obj, info);
+ handler(_sender, ea);
+ });
+ _nativeCallbacks.Add(new NativeCallback { callback = cb, eventHandler = handler });
+ int i = _nativeCallbacks.Count - 1;
+ Evas.evas_object_event_callback_add(_handle, _type, _nativeCallbacks[i].callback, IntPtr.Zero);
+ }
+
+ remove
+ {
+ EventHandler<TEventArgs> handler = value;
+ var callbacks = _nativeCallbacks.Where(cb => cb.eventHandler == handler);
+ foreach (var cb in callbacks)
+ {
+ Evas.evas_object_event_callback_del(_handle, _type, cb.callback);
+ }
+ }
+ }
+
+ protected virtual void Dispose(bool disposing)
+ {
+ if (!_disposed)
+ {
+ if (disposing)
+ {
+ foreach (var cb in _nativeCallbacks)
+ {
+ Evas.evas_object_event_callback_del(_handle, _type, cb.callback);
+ }
+ }
+ _nativeCallbacks.Clear();
+ _disposed = true;
+ }
+ }
+
+ public void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+ }
+
+ internal class EvasObjectEvent : IDisposable
+ {
+ private bool _disposed = false;
+ private readonly object _sender;
+ private readonly IntPtr _handle;
+ private readonly Evas.ObjectCallbackType _type;
+ private readonly List<NativeCallback> _nativeCallbacks = new List<NativeCallback>();
+
+ public EvasObjectEvent(object sender, IntPtr handle, Evas.ObjectCallbackType type)
+ {
+ _sender = sender;
+ _handle = handle;
+ _type = type;
+ }
+
+ ~EvasObjectEvent()
+ {
+ Dispose(false);
+ }
+
+ private struct NativeCallback
+ {
+ public Evas.EventCallback callback;
+ public EventHandler eventHandler;
+ }
+
+ public event EventHandler On
+ {
+ add
+ {
+ EventHandler handler = value;
+ var cb = new Evas.EventCallback((data, evas, obj, info) =>
+ {
+ handler(_sender, EventArgs.Empty);
+ });
+ _nativeCallbacks.Add(new NativeCallback { callback = cb, eventHandler = handler });
+ int i = _nativeCallbacks.Count - 1;
+ Evas.evas_object_event_callback_add(_handle, _type, _nativeCallbacks[i].callback, IntPtr.Zero);
+ }
+
+ remove
+ {
+ EventHandler handler = value;
+ var callbacks = _nativeCallbacks.Where(cb => cb.eventHandler == handler);
+ foreach (var cb in callbacks)
+ {
+ Evas.evas_object_event_callback_del(_handle, _type, cb.callback);
+ }
+ }
+ }
+
+ protected virtual void Dispose(bool disposing)
+ {
+ if (!_disposed)
+ {
+ if (disposing)
+ {
+ foreach (var cb in _nativeCallbacks)
+ {
+ Evas.evas_object_event_callback_del(_handle, _type, cb.callback);
+ }
+ }
+ _nativeCallbacks.Clear();
+ _disposed = true;
+ }
+ }
+
+ public void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+ }
+}
--- /dev/null
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+ internal static partial class Libc
+ {
+ [DllImport(Libraries.Libc, EntryPoint = "free", CallingConvention = CallingConvention.Cdecl)]
+ internal static extern int Free(IntPtr ptr);
+ }
+}
--- /dev/null
+/// Copyright 2016 by Samsung Electronics, Inc.,
+///
+/// This software is the confidential and proprietary information
+/// of Samsung Electronics, Inc. ("Confidential Information"). You
+/// shall not disclose such Confidential Information and shall use
+/// it only in accordance with the terms of the license agreement
+/// you entered into with Samsung.
+
+
+internal static partial class Interop
+{
+ private static class Libraries
+ {
+ internal const string Libc = "libc.so.6";
+ internal const string Evas = "libevas.so.1";
+ internal const string Elementary = "libelementary.so.1";
+ internal const string Eina = "libeina.so.1";
+ internal const string Ecore = "libecore.so.1";
+ }
+}
--- /dev/null
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+internal static partial class Interop
+{
+ internal class SmartEvent<TEventArgs> : IDisposable where TEventArgs : EventArgs
+ {
+ public delegate TEventArgs SmartEventInfoParser(IntPtr data, IntPtr obj, IntPtr info);
+
+ private readonly object _sender;
+ private readonly string _eventName;
+ private readonly IntPtr _handle;
+ private readonly SmartEventInfoParser _parser;
+ private readonly List<NativeCallback> _nativeCallbacks = new List<NativeCallback>();
+
+ public SmartEvent(object sender, IntPtr handle, string eventName, SmartEventInfoParser parser)
+ {
+ _sender = sender;
+ _eventName = eventName;
+ _handle = handle;
+ _parser = parser;
+ }
+ public SmartEvent(object sender, IntPtr handle, string eventName) : this(sender, handle, eventName, null)
+ {
+ }
+
+ ~SmartEvent()
+ {
+ Dispose(false);
+ }
+
+ private struct NativeCallback
+ {
+ public Interop.Evas.SmartCallback callback;
+ public EventHandler<TEventArgs> eventHandler;
+ }
+
+ public event EventHandler<TEventArgs> On
+ {
+ add
+ {
+ EventHandler<TEventArgs> handler = value;
+ var cb = new Interop.Evas.SmartCallback((d, o, e) =>
+ {
+ TEventArgs ea = _parser == null ? (TEventArgs)EventArgs.Empty : _parser(d, o, e);
+ handler(_sender, ea);
+ });
+ _nativeCallbacks.Add(new NativeCallback { callback = cb, eventHandler = handler });
+ int i = _nativeCallbacks.Count - 1;
+ Interop.Evas.evas_object_smart_callback_add(_handle, _eventName, _nativeCallbacks[i].callback, IntPtr.Zero);
+ }
+
+ remove
+ {
+ EventHandler<TEventArgs> handler = value;
+ var callbacks = _nativeCallbacks.Where(cb => cb.eventHandler == handler);
+ foreach (var cb in callbacks)
+ {
+ Interop.Evas.evas_object_smart_callback_del(_handle, _eventName, cb.callback);
+ }
+ }
+ }
+
+ protected virtual void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ foreach (var cb in _nativeCallbacks)
+ {
+ Evas.evas_object_smart_callback_del(_handle, _eventName, cb.callback);
+ }
+ }
+ _nativeCallbacks.Clear();
+ }
+
+ public void Dispose()
+ {
+ Dispose(true);
+ }
+ }
+
+ internal class SmartEvent : IDisposable
+ {
+ private readonly object _sender;
+ private readonly string _eventName;
+ private readonly IntPtr _handle;
+ private readonly List<NativeCallback> _nativeCallbacks = new List<NativeCallback>();
+
+ public SmartEvent(object sender, IntPtr handle, string eventName)
+ {
+ _sender = sender;
+ _eventName = eventName;
+ _handle = handle;
+ }
+
+ ~SmartEvent()
+ {
+ Dispose(false);
+ }
+
+ private struct NativeCallback
+ {
+ public Interop.Evas.SmartCallback callback;
+ public EventHandler eventHandler;
+ }
+
+ public event EventHandler On
+ {
+ add
+ {
+ EventHandler handler = value;
+ var cb = new Interop.Evas.SmartCallback((d, o, e) =>
+ {
+ handler(_sender, EventArgs.Empty);
+ });
+ _nativeCallbacks.Add(new NativeCallback { callback = cb, eventHandler = handler });
+ int i = _nativeCallbacks.Count - 1;
+ Interop.Evas.evas_object_smart_callback_add(_handle, _eventName, _nativeCallbacks[i].callback, IntPtr.Zero);
+ }
+
+ remove
+ {
+ EventHandler handler = value;
+ var callbacks = _nativeCallbacks.Where(cb => cb.eventHandler == handler);
+ foreach (var cb in callbacks)
+ {
+ Interop.Evas.evas_object_smart_callback_del(_handle, _eventName, cb.callback);
+ }
+ }
+ }
+
+ protected virtual void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ foreach (var cb in _nativeCallbacks)
+ {
+ Evas.evas_object_smart_callback_del(_handle, _eventName, cb.callback);
+ }
+ }
+ _nativeCallbacks.Clear();
+ }
+
+ public void Dispose()
+ {
+ Dispose(true);
+ }
+ }
+}
--- /dev/null
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("EflSharp")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("EflSharp")]
+[assembly: AssemblyCopyright("Copyright © 2016")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("bfb6195c-3271-45e8-96fa-5872fa23c920")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
--- /dev/null
+{
+ "version": "1.0.0-*",
+ "buildOptions": {
+ "keyFile": "ElmSharp.snk",
+ "allowUnsafe": true
+ },
+ "frameworks": {
+ "netcoreapp1.0": {
+ "imports": "dnxcore50",
+ "dependencies": {
+ "NETStandard.Library": "1.6.0"
+ }
+ },
+ "net45": {}
+ }
+}