2017-11-23 17:01:25 -08:00
|
|
|
using System;
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
using System.Runtime.CompilerServices;
|
|
|
|
|
|
|
|
class TestMain
|
|
|
|
{
|
|
|
|
static int WIDTH = 320;
|
|
|
|
static int HEIGHT = 240;
|
|
|
|
|
|
|
|
|
|
|
|
static void Main(string[] args)
|
|
|
|
{
|
|
|
|
efl.All.Init();
|
|
|
|
|
2018-05-02 21:02:11 -07:00
|
|
|
efl.Loop loop = new efl.Loop();
|
2017-11-23 17:01:25 -08:00
|
|
|
|
|
|
|
EcoreEvas ecore_evas = new EcoreEvas();
|
|
|
|
|
|
|
|
eina.Size2D size = new eina.Size2D();
|
|
|
|
eina.Position2D pos = new eina.Position2D();
|
|
|
|
|
2018-05-02 21:02:11 -07:00
|
|
|
efl.canvas.IObject canvas = ecore_evas.canvas;
|
2017-11-23 17:01:25 -08:00
|
|
|
canvas.SetVisible(true);
|
|
|
|
|
2018-05-02 21:02:11 -07:00
|
|
|
efl.canvas.Rectangle bg = new efl.canvas.Rectangle(canvas);
|
2017-11-23 17:01:25 -08:00
|
|
|
bg.SetColor(255, 255, 255, 255);
|
|
|
|
pos.X = 0;
|
|
|
|
pos.Y = 0;
|
|
|
|
bg.SetPosition(pos);
|
|
|
|
size.W = WIDTH;
|
|
|
|
size.H = HEIGHT;
|
|
|
|
bg.SetSize(size);
|
|
|
|
bg.SetVisible(true);
|
|
|
|
|
|
|
|
string path = args[0];
|
2018-05-02 21:02:11 -07:00
|
|
|
evas.Image logo = new evas.Image(canvas);
|
2017-11-23 17:01:25 -08:00
|
|
|
logo.SetFillAuto(true);
|
|
|
|
|
|
|
|
// TODO add preloaded support (depends on events)
|
|
|
|
|
|
|
|
logo.SetFile(path, null);
|
|
|
|
size.W = WIDTH / 2;
|
|
|
|
size.H = HEIGHT / 2;
|
|
|
|
logo.SetSize(size);
|
|
|
|
|
|
|
|
// TODO add a bunch of key/mouse handlers
|
|
|
|
|
|
|
|
logo.SetVisible(true);
|
|
|
|
|
|
|
|
int[] pixels = new int[(WIDTH/4) * (HEIGHT / 4)];
|
|
|
|
System.Random generator = new System.Random();
|
|
|
|
for (int i = 0; i < pixels.Length; i++) {
|
|
|
|
pixels[i] = generator.Next();
|
|
|
|
}
|
|
|
|
|
2018-05-02 21:02:11 -07:00
|
|
|
evas.Image noise_img = new evas.Image(canvas);
|
2017-11-23 17:01:25 -08:00
|
|
|
size.W = WIDTH / 4;
|
|
|
|
size.H = HEIGHT / 4;
|
|
|
|
noise_img.SetSize(size);
|
|
|
|
// FIXME Add a way to set the pixels.
|
|
|
|
// noise_img.data_set(pixels);
|
|
|
|
noise_img.SetFillAuto(true);
|
|
|
|
pos.X = WIDTH * 5 / 8;
|
|
|
|
pos.Y = HEIGHT / 8;
|
|
|
|
noise_img.SetPosition(pos);
|
|
|
|
noise_img.SetVisible(true);
|
|
|
|
Console.WriteLine("Creating noise image with sizez %d, %d", WIDTH/4, HEIGHT/4);
|
|
|
|
|
2018-05-02 21:02:11 -07:00
|
|
|
efl.canvas.Proxy proxy_img = new efl.canvas.Proxy(canvas);
|
2017-11-23 17:01:25 -08:00
|
|
|
proxy_img.SetSource(noise_img);
|
|
|
|
pos.X = WIDTH / 2;
|
|
|
|
pos.Y = HEIGHT / 2;
|
|
|
|
proxy_img.SetPosition(pos);
|
|
|
|
size.W = WIDTH / 2;
|
|
|
|
size.H = HEIGHT / 2;
|
|
|
|
proxy_img.SetSize(size);
|
|
|
|
proxy_img.SetVisible(true);
|
|
|
|
|
|
|
|
loop.Begin();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|