summaryrefslogtreecommitdiff
path: root/src/examples/evas/evas_mono_image.cs
diff options
context:
space:
mode:
authorHermet Park <hermetpark@gmail.com>2019-03-11 16:05:08 +0900
committerHermet Park <hermetpark@gmail.com>2019-03-11 16:05:08 +0900
commit43e122d1de10c8c89d835101cc66794a14de8c84 (patch)
treef91e3da2638caa8ae2499fa28f73718a0ecc249a /src/examples/evas/evas_mono_image.cs
parent2538e19e77ef839a2fd1177890bb15016b9e8ab1 (diff)
parent23d0076346e64456280bd9b9c2d1d2659d065fd2 (diff)
Merge branch 'master' into devs/hermet/lottie
Diffstat (limited to 'src/examples/evas/evas_mono_image.cs')
-rw-r--r--src/examples/evas/evas_mono_image.cs93
1 files changed, 0 insertions, 93 deletions
diff --git a/src/examples/evas/evas_mono_image.cs b/src/examples/evas/evas_mono_image.cs
deleted file mode 100644
index 865aa42..0000000
--- a/src/examples/evas/evas_mono_image.cs
+++ /dev/null
@@ -1,93 +0,0 @@
1using System;
2using System.Runtime.CompilerServices;
3
4class TestMain
5{
6 static int WIDTH = 320;
7 static int HEIGHT = 240;
8
9 Evas.Image image;
10
11
12 static string ImagePath([CallerFilePath] string folder="")
13 {
14 return System.IO.Path.GetDirectoryName(folder);
15 }
16
17 public TestMain(Evas.Image image)
18 {
19 this.image = image;
20 }
21
22 static void Main(string[] args)
23 {
24 Efl.All.Init();
25
26 Efl.Loop loop = new Efl.Loop();
27
28 EcoreEvas ecore_evas = new EcoreEvas();
29 Eina.Size2D size = new Eina.Size2D();
30
31 Efl.Canvas.Object canvas = ecore_evas.canvas;
32 canvas.SetVisible(true);
33
34 Efl.Object parent = canvas.GetParent();
35 System.Diagnostics.Debug.Assert(parent.NativeHandle != IntPtr.Zero);
36
37 Efl.Canvas.Rectangle bg = new Efl.Canvas.Rectangle(canvas);
38 bg.SetColor(255, 255, 255, 255);
39 size.W = WIDTH;
40 size.H = HEIGHT;
41 bg.SetSize(size);
42 bg.SetVisible(true);
43
44 string valid_path = args[0];
45 Evas.Image image = new Evas.Image(canvas);
46 image.SetFile(valid_path, null);
47
48 /* FIXME evas-image uses error handling code from
49 * evas_object_image_load_error_get, which seems to be not available
50 * Efl.image.load.State state = image.load_error_get(); */
51
52 // FIXME missing move
53 Eina.Rect rect = new Eina.Rect();
54
55 rect.X = 0;
56 rect.Y = 0;
57 rect.W = WIDTH / 2;
58 rect.H = HEIGHT / 2;
59 image.SetFill(rect);
60
61 size.W = WIDTH / 2;
62 size.H = HEIGHT / 2;
63 image.SetSize(size);
64 image.SetVisible(true);
65
66 rect = image.GetFill();
67 rect.Y -= 50;
68 rect.W += 100;
69 image.SetFill(rect);
70
71 TestMain listener = new TestMain(image);
72
73 // TODO handle key events in order to alter the image like the C
74 // example. Meanwhile, just set some w fill
75 /* EventListener callback = new EventListener(); */
76
77 /* bg.key_focus_set(true); */
78 /* bg.event_callback_priority_add(Evas.Callback_Type.Key_down, */
79 /* Efl.Callback_Priority.Default, */
80 /* callback, null); */
81
82 loop.Begin();
83
84 Efl.All.Shutdown();
85 }
86
87 public void on_key_down(object sender, EventArgs e)
88 {
89 Console.WriteLine("on_key_down called");
90 }
91}
92
93