forked from enlightenment/efl
efl-csharp: Remove legacy Evas bindings.
Summary: Pave the way to correct beta classes handling. Reviewers: vitor.sousa, segfaultxavi, bu5hm4n Reviewed By: vitor.sousa, bu5hm4n Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8004
This commit is contained in:
parent
e7ebf92c92
commit
401f695644
|
@ -1465,7 +1465,6 @@ if test "x${have_windows}" = "xyes"; then
|
|||
else
|
||||
EVIL_DL_MONO="dl"
|
||||
fi
|
||||
ECORE_EVAS_DL_MONO="${DLIB_PREFIX_MONO}ecore_evas${DLIB_SUFFIX_MONO}"
|
||||
EDJE_DL_MONO="${DLIB_PREFIX_MONO}edje${DLIB_SUFFIX_MONO}"
|
||||
ELEMENTARY_DL_MONO="${DLIB_PREFIX_MONO}elementary${DLIB_SUFFIX_MONO}"
|
||||
ELDBUS_DL_MONO="${DLIB_PREFIX_MONO}eldbus${DLIB_SUFFIX_MONO}"
|
||||
|
@ -1477,7 +1476,6 @@ AC_SUBST([EINA_DL_MONO])
|
|||
AC_SUBST([EO_DL_MONO])
|
||||
AC_SUBST([EVAS_DL_MONO])
|
||||
AC_SUBST([EVIL_DL_MONO])
|
||||
AC_SUBST([ECORE_EVAS_DL_MONO])
|
||||
AC_SUBST([EDJE_DL_MONO])
|
||||
AC_SUBST([ELEMENTARY_DL_MONO])
|
||||
AC_SUBST([ELDBUS_DL_MONO])
|
||||
|
|
|
@ -161,7 +161,6 @@ dist-hook:
|
|||
@mkdir -p $(distdir)/static_libs/http-parser/contrib $(distdir)/bindings/luajit/eina
|
||||
@mkdir -p $(distdir)/wayland_protocol $(distdir)/lib/efl_wl/
|
||||
@mkdir -p $(distdir)/modules/evas/engines/software_generic/filters/blur
|
||||
@mkdir -p $(distdir)/bindings/mono/ecore_evas_mono
|
||||
@mkdir -p $(distdir)/bindings/mono/efl_mono
|
||||
@mkdir -p $(distdir)/bindings/mono/eina_mono
|
||||
@mkdir -p $(distdir)/bindings/mono/eldbus_mono
|
||||
|
|
|
@ -36,9 +36,6 @@ efl_eldbus_mono_files = \
|
|||
bindings/mono/eldbus_mono/eldbus_proxy.cs \
|
||||
bindings/mono/eldbus_mono/eldbus_service.cs
|
||||
|
||||
efl_ecore_evas_mono_files = \
|
||||
bindings/mono/ecore_evas_mono/ecore_evas.cs
|
||||
|
||||
# Static C# source files don't go into a _SOURCES var as the dll target
|
||||
# is custom built instead of through _LTLIBRARIES/_LIBRARIES
|
||||
lib_efl_mono_libefl_mono_dll_sources = \
|
||||
|
@ -46,8 +43,7 @@ lib_efl_mono_libefl_mono_dll_sources = \
|
|||
bindings/mono/efl_mono/efl_csharp_application.cs \
|
||||
$(efl_eo_mono_files) \
|
||||
$(efl_eina_mono_files) \
|
||||
$(efl_eldbus_mono_files) \
|
||||
$(efl_ecore_evas_mono_files)
|
||||
$(efl_eldbus_mono_files)
|
||||
|
||||
efl_mono_test_files = \
|
||||
tests/efl_mono/dummy_test_object.eo \
|
||||
|
@ -183,11 +179,7 @@ $(efl_eolian_type_files:%.eot=%.eot.cs) \
|
|||
$(edje_eolian_type_files:%.eot=%.eot.cs) \
|
||||
$(elm_eolian_type_files:%.eot=%.eot.cs) \
|
||||
$(filter-out $(evas_eolian_blacklisted_files),$(evas_canvas_eolian_pub_files:%.eo=%.eo.cs)) \
|
||||
lib/evas/canvas/evas_box.eo.cs \
|
||||
lib/evas/canvas/evas_image.eo.cs \
|
||||
lib/evas/canvas/efl_canvas_image.eo.cs \
|
||||
lib/evas/canvas/evas_table.eo.cs \
|
||||
lib/evas/canvas/evas_text.eo.cs \
|
||||
$(evas_canvas_eolian_type_files:%.eot=%.eot.cs) \
|
||||
lib/eo/eina_types.eot.cs \
|
||||
lib/ecore/efl_loop_timer.eo.cs
|
||||
|
@ -460,7 +452,6 @@ tests_efl_mono_efl_mono_SOURCES = \
|
|||
tests/efl_mono/Eo.cs \
|
||||
tests/efl_mono/EoPromises.cs \
|
||||
tests/efl_mono/Errors.cs \
|
||||
tests/efl_mono/Evas.cs \
|
||||
tests/efl_mono/Events.cs \
|
||||
tests/efl_mono/FunctionPointers.cs \
|
||||
tests/efl_mono/FunctionPointerMarshalling.cs \
|
||||
|
|
|
@ -1,38 +0,0 @@
|
|||
#pragma warning disable 1591
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading;
|
||||
|
||||
public class EcoreEvas
|
||||
{
|
||||
[DllImport(efl.Libs.EcoreEvas)] static extern void ecore_evas_init();
|
||||
// [DllImport(efl.Libs.EcoreEvas)] static extern IntPtr ecore_evas_new([MarshalAs(UnmanagedType.LPStr)] String engine_name, int x, int y, int w, int h
|
||||
// , [MarshalAs(UnmanagedType.LPStr)] String extra_options);
|
||||
[DllImport(efl.Libs.EcoreEvas)] static extern IntPtr ecore_evas_new(IntPtr engine_name, int x, int y, int w, int h
|
||||
, IntPtr extra_options);
|
||||
[DllImport(efl.Libs.EcoreEvas)] static extern IntPtr ecore_evas_get(IntPtr ecore_evas);
|
||||
[DllImport(efl.Libs.EcoreEvas)] static extern IntPtr ecore_evas_show(IntPtr ecore_evas);
|
||||
|
||||
IntPtr handle;
|
||||
public EcoreEvas()
|
||||
{
|
||||
#if WIN32 // Not a native define, we define it in our build system
|
||||
// Ecore_Win32 uses OleInitialize, which requires single thread apartments
|
||||
if (Thread.CurrentThread.GetApartmentState() != ApartmentState.STA)
|
||||
throw new InvalidOperationException("UI Applications require STAThreadAttribute in Main()");
|
||||
#endif
|
||||
ecore_evas_init();
|
||||
handle = ecore_evas_new(IntPtr.Zero, 0, 0, 640, 480, IntPtr.Zero);
|
||||
if(handle == IntPtr.Zero)
|
||||
Eina.Log.Error("Couldn't create a ecore evas");
|
||||
ecore_evas_show(handle);
|
||||
}
|
||||
|
||||
public Efl.Canvas.Object canvas
|
||||
{
|
||||
get { return new Efl.Canvas.Object(ecore_evas_get(handle)); }
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
mono_files += files('ecore_evas.cs')
|
|
@ -12,7 +12,6 @@ public class Libs {
|
|||
public const string Eo = "@EO_DL_MONO@";
|
||||
public const string Evas = "@EVAS_DL_MONO@";
|
||||
public const string Evil = "@EVIL_DL_MONO@";
|
||||
public const string EcoreEvas = "@ECORE_EVAS_DL_MONO@";
|
||||
public const string Edje = "@EDJE_DL_MONO@";
|
||||
public const string Elementary = "@ELEMENTARY_DL_MONO@";
|
||||
public const string Eldbus = "@ELDBUS_DL_MONO@";
|
||||
|
|
|
@ -9,7 +9,6 @@ mono_sublibs = [
|
|||
['Evas', false, ], #
|
||||
['Edje', false, ], #
|
||||
['Eldbus', true, ], #
|
||||
['Ecore_Evas', true, ], #
|
||||
['Elementary', false, ] #
|
||||
]
|
||||
|
||||
|
@ -105,18 +104,6 @@ foreach lib : mono_sublibs
|
|||
endif
|
||||
endforeach
|
||||
|
||||
legacy_evas_required_by_mono = ['evas_box.eo', 'evas_image.eo', 'evas_table.eo', 'evas_text.eo']
|
||||
subdir_file_location = join_paths('..', '..', 'lib', 'evas', 'canvas')
|
||||
foreach mono_gen_file : legacy_evas_required_by_mono
|
||||
mono_generator_target += custom_target('eolian_mono_gen_'+mono_gen_file.underscorify()+'',
|
||||
input : join_paths(subdir_file_location, mono_gen_file),
|
||||
output : [mono_gen_file + '.cs'],
|
||||
command : [eolian_mono_gen, beta_option, '-I', meson.current_source_dir(), eolian_include_directories,
|
||||
'--dllimport', 'evas',
|
||||
'-o', join_paths(meson.current_build_dir(), mono_gen_file + '.cs'),
|
||||
'@INPUT@'])
|
||||
endforeach
|
||||
|
||||
efl_mono_conf_data = configuration_data()
|
||||
efl_mono_conf_data.set('EINA', eina_lib.full_path())
|
||||
efl_mono_conf_data.set('EFL', efl_lib.full_path())
|
||||
|
|
|
@ -221,62 +221,6 @@ $(AM_CPPFLAGS) @EVAS_CFLAGS@
|
|||
|
||||
endif
|
||||
|
||||
if HAVE_CSHARP
|
||||
|
||||
EXTRA_PROGRAMS += \
|
||||
evas/evas_mono_box_csharp \
|
||||
evas/evas_mono_image_csharp \
|
||||
evas/evas_mono_image2_csharp \
|
||||
evas/evas_mono_rectangle_csharp \
|
||||
evas/evas_mono_table_csharp \
|
||||
evas/evas_mono_text_csharp
|
||||
|
||||
|
||||
evas_evas_mono_box_csharp_SOURCES = \
|
||||
evas/evas_mono_box.cs
|
||||
|
||||
evas/evas_mono_box_csharp$(EXEEXT): $(evas_evas_mono_box_csharp_SOURCES) $(am_dirstamp) $(top_builddir)/src/lib/efl_mono/libefl_mono.dll
|
||||
$(AM_V_MCS) $(MCS) $(MCSFLAGS) -r:$(abs_top_builddir)/src/lib/efl_mono/libefl_mono.dll -out:$@ $(filter %.cs, $(^))
|
||||
|
||||
evas_evas_mono_image_csharp_SOURCES = \
|
||||
evas/evas_mono_image.cs
|
||||
|
||||
evas/evas_mono_image_csharp$(EXEEXT): $(evas_evas_mono_image_csharp_SOURCES) $(am_dirstamp) $(top_builddir)/src/lib/efl_mono/libefl_mono.dll
|
||||
@rm -f $@
|
||||
$(AM_V_MCS) $(MCS) $(MCSFLAGS) -r:$(abs_top_builddir)/src/lib/efl_mono/libefl_mono.dll -out:$@ $(filter %.cs, $(^))
|
||||
|
||||
evas_evas_mono_image2_csharp_SOURCES = \
|
||||
evas/evas_mono_image2.cs
|
||||
|
||||
evas/evas_mono_image2_csharp$(EXEEXT): $(evas_evas_mono_image2_csharp_SOURCES) $(am_dirstamp) $(top_builddir)/src/lib/efl_mono/libefl_mono.dll
|
||||
@rm -f $@
|
||||
$(AM_V_MCS) $(MCS) $(MCSFLAGS) -r:$(abs_top_builddir)/src/lib/efl_mono/libefl_mono.dll -out:$@ $(filter %.cs, $(^))
|
||||
|
||||
evas_evas_mono_rectangle_csharp_SOURCES = \
|
||||
evas/evas_mono_rectangle.cs
|
||||
|
||||
evas/evas_mono_rectangle_csharp$(EXEEXT): $(evas_evas_mono_rectangle_csharp_SOURCES) $(am_dirstamp) $(top_builddir)/src/lib/efl_mono/libefl_mono.dll
|
||||
@rm -f $@
|
||||
$(AM_V_MCS) $(MCS) $(MCSFLAGS) -r:$(abs_top_builddir)/src/lib/efl_mono/libefl_mono.dll -out:$@ $(filter %.cs, $(^))
|
||||
|
||||
evas_evas_mono_table_csharp_SOURCES = \
|
||||
evas/evas_mono_table.cs
|
||||
|
||||
evas/evas_mono_table_csharp$(EXEEXT): $(evas_evas_mono_table_csharp_SOURCES) $(am_dirstamp) $(top_builddir)/src/lib/efl_mono/libefl_mono.dll
|
||||
@rm -f $@
|
||||
$(AM_V_MCS) $(MCS) $(MCSFLAGS) -r:$(abs_top_builddir)/src/lib/efl_mono/libefl_mono.dll -out:$@ $(filter %.cs, $(^))
|
||||
|
||||
evas_evas_mono_text_csharp_SOURCES = \
|
||||
evas/evas_mono_text.cs
|
||||
|
||||
evas/evas_mono_text_csharp$(EXEEXT): $(evas_evas_mono_text_csharp_SOURCES) $(am_dirstamp) $(top_builddir)/src/lib/efl_mono/libefl_mono.dll
|
||||
@rm -f $@
|
||||
$(AM_V_MCS) $(MCS) $(MCSFLAGS) -r:$(abs_top_builddir)/src/lib/efl_mono/libefl_mono.dll -out:$@ $(filter %.cs, $(^))
|
||||
|
||||
endif
|
||||
|
||||
|
||||
|
||||
EVAS_SRCS = \
|
||||
evas/evas-aspect-hints.c \
|
||||
evas/evas-box.c \
|
||||
|
|
|
@ -1,73 +0,0 @@
|
|||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
public class MyBox : Evas.Box
|
||||
{
|
||||
public MyBox(Efl.Object parent) : base(parent) {}
|
||||
|
||||
[DllImport("evas")] static extern void evas_obj_box_layout_vertical(IntPtr obj, IntPtr data, IntPtr privdata);
|
||||
[DllImport("evas")] static extern void evas_obj_box_layout_horizontal(IntPtr obj, IntPtr data, IntPtr privdata);
|
||||
[DllImport("evas")] static extern void evas_object_box_layout_horizontal(IntPtr obj, IntPtr data, IntPtr privdata);
|
||||
[DllImport("evas")] static extern IntPtr evas_object_evas_get(IntPtr obj);
|
||||
[DllImport("evas")] static extern void evas_event_freeze(IntPtr obj);
|
||||
[DllImport("evas")] static extern void evas_event_thaw(IntPtr obj);
|
||||
|
||||
override public void CalculateGroup()
|
||||
{
|
||||
IntPtr evas = evas_object_evas_get(NativeHandle);
|
||||
evas_event_freeze(evas);
|
||||
Console.WriteLine("called group_calculate");
|
||||
/* layouting_set(true); */
|
||||
evas_obj_box_layout_vertical(NativeHandle, IntPtr.Zero, IntPtr.Zero);
|
||||
/* layouting_set(false); */
|
||||
/* children_changed_set(false); */
|
||||
evas_event_thaw(evas);
|
||||
}
|
||||
}
|
||||
|
||||
class TestMain
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Efl.All.Init();
|
||||
|
||||
Efl.Loop loop = new Efl.Loop();
|
||||
|
||||
|
||||
EcoreEvas ecore_evas = new EcoreEvas();
|
||||
|
||||
Efl.Canvas.Object canvas = ecore_evas.canvas;
|
||||
canvas.SetVisible(true);
|
||||
|
||||
Efl.Object parent = canvas.GetParent();
|
||||
System.Diagnostics.Debug.Assert(parent.NativeHandle != IntPtr.Zero);
|
||||
|
||||
Evas.Box box = new MyBox(canvas);
|
||||
Eina.Size2D size = new Eina.Size2D();
|
||||
|
||||
size.W = 320;
|
||||
size.H = 240;
|
||||
|
||||
box.SetSize(size);
|
||||
box.SetVisible(true);
|
||||
|
||||
Efl.Canvas.Rectangle rect = new Efl.Canvas.Rectangle(canvas);
|
||||
rect.SetColor(0, 0, 255, 255);
|
||||
size.W = 320;
|
||||
size.H = 120;
|
||||
rect.SetSize(size);
|
||||
rect.SetVisible(true);
|
||||
box.Append(rect);
|
||||
|
||||
Efl.Canvas.Rectangle rect2 = new Efl.Canvas.Rectangle(canvas);
|
||||
rect2.SetColor(0, 255, 0, 255);
|
||||
rect2.SetSize(size);
|
||||
rect2.SetVisible(true);
|
||||
box.Append(rect2);
|
||||
|
||||
loop.Begin();
|
||||
|
||||
Efl.All.Shutdown();
|
||||
}
|
||||
}
|
|
@ -1,93 +0,0 @@
|
|||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
class TestMain
|
||||
{
|
||||
static int WIDTH = 320;
|
||||
static int HEIGHT = 240;
|
||||
|
||||
Evas.Image image;
|
||||
|
||||
|
||||
static string ImagePath([CallerFilePath] string folder="")
|
||||
{
|
||||
return System.IO.Path.GetDirectoryName(folder);
|
||||
}
|
||||
|
||||
public TestMain(Evas.Image image)
|
||||
{
|
||||
this.image = image;
|
||||
}
|
||||
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Efl.All.Init();
|
||||
|
||||
Efl.Loop loop = new Efl.Loop();
|
||||
|
||||
EcoreEvas ecore_evas = new EcoreEvas();
|
||||
Eina.Size2D size = new Eina.Size2D();
|
||||
|
||||
Efl.Canvas.Object canvas = ecore_evas.canvas;
|
||||
canvas.SetVisible(true);
|
||||
|
||||
Efl.Object parent = canvas.GetParent();
|
||||
System.Diagnostics.Debug.Assert(parent.NativeHandle != IntPtr.Zero);
|
||||
|
||||
Efl.Canvas.Rectangle bg = new Efl.Canvas.Rectangle(canvas);
|
||||
bg.SetColor(255, 255, 255, 255);
|
||||
size.W = WIDTH;
|
||||
size.H = HEIGHT;
|
||||
bg.SetSize(size);
|
||||
bg.SetVisible(true);
|
||||
|
||||
string valid_path = args[0];
|
||||
Evas.Image image = new Evas.Image(canvas);
|
||||
image.SetFile(valid_path, null);
|
||||
|
||||
/* FIXME evas-image uses error handling code from
|
||||
* evas_object_image_load_error_get, which seems to be not available
|
||||
* Efl.image.load.State state = image.load_error_get(); */
|
||||
|
||||
// FIXME missing move
|
||||
Eina.Rect rect = new Eina.Rect();
|
||||
|
||||
rect.X = 0;
|
||||
rect.Y = 0;
|
||||
rect.W = WIDTH / 2;
|
||||
rect.H = HEIGHT / 2;
|
||||
image.SetFill(rect);
|
||||
|
||||
size.W = WIDTH / 2;
|
||||
size.H = HEIGHT / 2;
|
||||
image.SetSize(size);
|
||||
image.SetVisible(true);
|
||||
|
||||
rect = image.GetFill();
|
||||
rect.Y -= 50;
|
||||
rect.W += 100;
|
||||
image.SetFill(rect);
|
||||
|
||||
TestMain listener = new TestMain(image);
|
||||
|
||||
// TODO handle key events in order to alter the image like the C
|
||||
// example. Meanwhile, just set some w fill
|
||||
/* EventListener callback = new EventListener(); */
|
||||
|
||||
/* bg.key_focus_set(true); */
|
||||
/* bg.event_callback_priority_add(Evas.Callback_Type.Key_down, */
|
||||
/* Efl.Callback_Priority.Default, */
|
||||
/* callback, null); */
|
||||
|
||||
loop.Begin();
|
||||
|
||||
Efl.All.Shutdown();
|
||||
}
|
||||
|
||||
public void on_key_down(object sender, EventArgs e)
|
||||
{
|
||||
Console.WriteLine("on_key_down called");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,83 +0,0 @@
|
|||
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();
|
||||
|
||||
Efl.Loop loop = new Efl.Loop();
|
||||
|
||||
EcoreEvas ecore_evas = new EcoreEvas();
|
||||
|
||||
Eina.Size2D size = new Eina.Size2D();
|
||||
Eina.Position2D pos = new Eina.Position2D();
|
||||
|
||||
Efl.Canvas.Object canvas = ecore_evas.canvas;
|
||||
canvas.SetVisible(true);
|
||||
|
||||
Efl.Canvas.Rectangle bg = new Efl.Canvas.Rectangle(canvas);
|
||||
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];
|
||||
Evas.Image logo = new Evas.Image(canvas);
|
||||
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();
|
||||
}
|
||||
|
||||
Evas.Image noise_img = new Evas.Image(canvas);
|
||||
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);
|
||||
|
||||
Efl.Canvas.Proxy proxy_img = new Efl.Canvas.Proxy(canvas);
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
using System;
|
||||
|
||||
class TestMain
|
||||
{
|
||||
private static int[,] colors = new int[,] {
|
||||
{255, 0, 0},
|
||||
{0, 255, 0},
|
||||
{0, 0, 255}
|
||||
};
|
||||
|
||||
static void Main(string[] args)
|
||||
{
|
||||
int color_index = 0;
|
||||
|
||||
Efl.All.Init();
|
||||
|
||||
Efl.Loop loop = new Efl.Loop();
|
||||
EcoreEvas ecore_evas = new EcoreEvas();
|
||||
Efl.Canvas.Object canvas = ecore_evas.canvas;
|
||||
canvas.SetVisible(true);
|
||||
|
||||
Efl.Object parent = canvas.GetParent();
|
||||
System.Diagnostics.Debug.Assert(parent.NativeHandle != IntPtr.Zero);
|
||||
|
||||
Efl.Canvas.Rectangle rect = new Efl.Canvas.Rectangle(canvas);
|
||||
rect.SetColor(colors[0, 0], colors[0, 1], colors[0, 2], 255);
|
||||
Eina.Size2D size = new Eina.Size2D();
|
||||
size.W = 640;
|
||||
size.H = 480;
|
||||
rect.SetSize(size);
|
||||
rect.SetVisible(true);
|
||||
|
||||
canvas.KeyDownEvt += (object sender, Efl.Input.InterfaceKeyDownEvt_Args e) => {
|
||||
color_index = (color_index + 1) % 3;
|
||||
Console.WriteLine("Key Down");
|
||||
Console.WriteLine("Got key obj at {0}", e.arg.NativeHandle.ToString("X"));
|
||||
Console.WriteLine("Got key_get() == [{0}]", e.arg.GetKey());
|
||||
rect.SetColor(colors[color_index, 0],
|
||||
colors[color_index, 1],
|
||||
colors[color_index, 2], 255);
|
||||
};
|
||||
|
||||
loop.Begin();
|
||||
|
||||
Efl.All.Shutdown();
|
||||
}
|
||||
}
|
|
@ -1,77 +0,0 @@
|
|||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
class TestMain
|
||||
{
|
||||
static int WIDTH = 100;
|
||||
static int HEIGHT = 150;
|
||||
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Efl.All.Init();
|
||||
|
||||
Efl.Loop loop = new Efl.Loop();
|
||||
|
||||
EcoreEvas ecore_evas = new EcoreEvas();
|
||||
|
||||
Eina.Size2D size = new Eina.Size2D();
|
||||
size.W = WIDTH;
|
||||
size.H = HEIGHT;
|
||||
|
||||
Eina.Size2D hint = new Eina.Size2D();
|
||||
|
||||
Efl.Canvas.Object canvas = ecore_evas.canvas;
|
||||
canvas.SetVisible(true);
|
||||
|
||||
Efl.Object parent = canvas.GetParent();
|
||||
System.Diagnostics.Debug.Assert(parent.NativeHandle != IntPtr.Zero);
|
||||
|
||||
Efl.Canvas.Rectangle bg = new Efl.Canvas.Rectangle(canvas);
|
||||
bg.SetColor(255, 255, 255, 255);
|
||||
bg.SetSize(size);
|
||||
bg.SetVisible(true);
|
||||
|
||||
|
||||
Evas.Table table = new Evas.Table(canvas);
|
||||
table.SetHomogeneous(Evas.ObjectTable.HomogeneousMode.None);
|
||||
table.SetPadding(0, 0);
|
||||
table.SetSize(size);
|
||||
table.SetVisible(true);
|
||||
|
||||
Efl.Canvas.Rectangle rect = new Efl.Canvas.Rectangle(canvas);
|
||||
rect.SetColor(255, 0, 0, 255);
|
||||
hint.W = 100;
|
||||
hint.H = 50;
|
||||
rect.SetHintSizeMin(hint);
|
||||
rect.SetVisible(true);
|
||||
table.Pack(rect, 1, 1, 2, 1);
|
||||
|
||||
rect = new Efl.Canvas.Rectangle(canvas);
|
||||
rect.SetColor(0, 255, 0, 255);
|
||||
hint.W = 50;
|
||||
hint.H = 100;
|
||||
rect.SetHintSizeMin(hint);
|
||||
rect.SetVisible(true);
|
||||
table.Pack(rect, 1, 2, 1, 2);
|
||||
|
||||
rect = new Efl.Canvas.Rectangle(canvas);
|
||||
rect.SetColor(0, 0, 255, 255);
|
||||
hint.W = 50;
|
||||
hint.H = 50;
|
||||
rect.SetHintSizeMin(hint);
|
||||
rect.SetVisible(true);
|
||||
table.Pack(rect, 2, 2, 1, 1);
|
||||
|
||||
rect = new Efl.Canvas.Rectangle(canvas);
|
||||
rect.SetColor(255, 255, 0, 255);
|
||||
rect.SetHintSizeMin(hint);
|
||||
rect.SetVisible(true);
|
||||
table.Pack(rect, 2, 3, 1, 1);
|
||||
|
||||
loop.Begin();
|
||||
|
||||
Efl.All.Shutdown();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,127 +0,0 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
|
||||
static class Extensions
|
||||
{
|
||||
public static IEnumerable<T> Circle<T>(this IEnumerable<T> list, int index=0)
|
||||
{
|
||||
var count = list.Count();
|
||||
index = index % count;
|
||||
|
||||
while (true) {
|
||||
yield return list.ElementAt(index);
|
||||
index = (index + 1) % count;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class TestMain
|
||||
{
|
||||
static int WIDTH = 320;
|
||||
static int HEIGHT = 240;
|
||||
|
||||
private EcoreEvas ecore_evas;
|
||||
private Efl.Canvas.Object canvas;
|
||||
private Efl.Canvas.Rectangle bg;
|
||||
private Evas.Text text;
|
||||
private Evas.Image border;
|
||||
|
||||
public TestMain(String border_file) {
|
||||
ecore_evas = new EcoreEvas();
|
||||
Eina.Size2D size = new Eina.Size2D();
|
||||
Eina.Position2D position = new Eina.Position2D();
|
||||
canvas = ecore_evas.canvas;
|
||||
canvas.SetVisible(true);
|
||||
|
||||
bg = new Efl.Canvas.Rectangle(canvas);
|
||||
bg.SetColor(255, 255, 255, 255);
|
||||
position.X = 0;
|
||||
position.Y = 0;
|
||||
bg.SetPosition(position);
|
||||
size.W = WIDTH;
|
||||
size.H = HEIGHT;
|
||||
bg.SetSize(size);
|
||||
bg.SetVisible(true);
|
||||
bg.SetKeyFocus(true);
|
||||
|
||||
/* ((Efl.Input.Interface)bg).KeyDownEvt += On_KeyDown; */
|
||||
bg.KeyDownEvt += On_KeyDown;
|
||||
|
||||
text = new Evas.Text(canvas);
|
||||
text.SetStyle(Evas.TextStyleType.OutlineSoftShadow);
|
||||
|
||||
text.SetColor(0, 0, 0, 255);
|
||||
text.SetGlowColor(255, 0, 0, 255);
|
||||
text.SetOutlineColor(0, 0, 255, 255);
|
||||
text.SetShadowColor(0, 255,255, 255);
|
||||
text.SetFont("Courier", 30);
|
||||
|
||||
text.SetText("sample text");
|
||||
size.W = 3*WIDTH / 4;
|
||||
size.H = HEIGHT / 4;
|
||||
text.SetSize(size);
|
||||
position.X = WIDTH / 8;
|
||||
position.Y = 3 * HEIGHT / 8;
|
||||
text.SetPosition(position);
|
||||
text.SetVisible(true);
|
||||
|
||||
Efl.Font.Size font_size = 0;
|
||||
String font = String.Empty;
|
||||
text.GetFont(out font, out font_size);
|
||||
Console.WriteLine("Adding text object with font {0} and size {1}", font, size);
|
||||
|
||||
// setup border
|
||||
border = new Evas.Image(canvas);
|
||||
border.SetFile(border_file, null);
|
||||
border.SetBorder(3, 3, 3, 3);
|
||||
border.SetBorderCenterFill(0);
|
||||
|
||||
size.W = 3 * WIDTH / 4 + 3;
|
||||
size.H = HEIGHT / 4 + 3;
|
||||
border.SetSize(size);
|
||||
position.X = WIDTH / 8 - 3;
|
||||
position.Y = 3 * HEIGHT / 8 - 3;
|
||||
border.SetPosition(position);
|
||||
border.SetVisible(true);
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void On_KeyDown(object sender, Efl.Input.InterfaceKeyDownEvt_Args e)
|
||||
{
|
||||
var key = e.arg.GetKey();
|
||||
|
||||
if (key == "h") {
|
||||
Console.WriteLine(commands);
|
||||
} else if (key == "t") {
|
||||
Evas.TextStyleType type = text.GetStyle();
|
||||
type = (Evas.TextStyleType)(((int)type + 1) % 10); // 10 hardcoded from C example
|
||||
text.SetStyle(type);
|
||||
}
|
||||
}
|
||||
|
||||
static string commands = @"commands are:
|
||||
t - change text's current style
|
||||
h - print help";
|
||||
|
||||
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Efl.All.Init();
|
||||
|
||||
String border_path = "./src/examples/evas/resources/images/red.png";
|
||||
|
||||
if (args.Length >= 1)
|
||||
border_path = args[0];
|
||||
|
||||
Efl.Loop loop = new Efl.Loop();
|
||||
TestMain t = new TestMain(border_path);
|
||||
|
||||
loop.Begin();
|
||||
|
||||
Efl.All.Shutdown();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,77 +0,0 @@
|
|||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
public class MyBox : Evas.Box
|
||||
{
|
||||
public MyBox(Efl.Object parent) : base(parent) {}
|
||||
|
||||
[DllImport("evas")] static extern void evas_obj_box_layout_vertical(IntPtr obj, IntPtr data, IntPtr privdata);
|
||||
[DllImport("evas")] static extern void evas_obj_box_layout_horizontal(IntPtr obj, IntPtr data, IntPtr privdata);
|
||||
[DllImport("evas")] static extern void evas_object_box_layout_horizontal(IntPtr obj, IntPtr data, IntPtr privdata);
|
||||
[DllImport("evas")] static extern IntPtr evas_object_evas_get(IntPtr obj);
|
||||
[DllImport("evas")] static extern void evas_event_freeze(IntPtr obj);
|
||||
[DllImport("evas")] static extern void evas_event_thaw(IntPtr obj);
|
||||
|
||||
override public void CalculateGroup()
|
||||
{
|
||||
IntPtr evas = evas_object_evas_get(NativeHandle);
|
||||
evas_event_freeze(evas);
|
||||
Eina.Log.Debug("called group_calculate");
|
||||
// slayouting_set(true);
|
||||
evas_obj_box_layout_vertical(NativeHandle, IntPtr.Zero, IntPtr.Zero);
|
||||
// layouting_set(false);
|
||||
// children_changed_set(false);
|
||||
evas_event_thaw(evas);
|
||||
}
|
||||
}
|
||||
|
||||
namespace TestSuite
|
||||
{
|
||||
|
||||
class TestEvas
|
||||
{
|
||||
/* private static string ImagePath([CallerFilePath] string folder="") */
|
||||
/* { */
|
||||
/* return System.IO.Path.GetDirectoryName(folder); */
|
||||
/* } */
|
||||
|
||||
/* public static void simple_layout() */
|
||||
/* { */
|
||||
/* // efl.Loop loop = new efl.LoopConcrete(); */
|
||||
|
||||
/* EcoreEvas ecore_evas = new EcoreEvas(); */
|
||||
|
||||
/* efl.canvas.Object canvas = ecore_evas.canvas; */
|
||||
/* canvas.visible_set(true); */
|
||||
|
||||
/* efl.Object parent = canvas.parent_get(); */
|
||||
/* Test.Assert(parent.NativeHandle != IntPtr.Zero); */
|
||||
|
||||
/* efl.canvas.Rectangle rect = new efl.canvas.RectangleConcrete(canvas); */
|
||||
/* rect.color_set(255, 255, 255, 255); */
|
||||
/* rect.size_set(640, 480); */
|
||||
/* rect.visible_set(true); */
|
||||
|
||||
/* evas.Box box = new MyBox(canvas); */
|
||||
/* rect.size_set(320, 240); */
|
||||
/* box.visible_set(true); */
|
||||
|
||||
/* efl.canvas.Image image1 = new efl.canvas.ImageConcrete(canvas); */
|
||||
/* image1.file_set(ImagePath() + "/../../examples/elementary/sphere_hunter/score.jpg", ""); */
|
||||
/* image1.hint_min_set(160, 240); */
|
||||
/* image1.visible_set(true); */
|
||||
|
||||
/* efl.canvas.Image image2 = new efl.canvas.ImageConcrete(canvas); */
|
||||
/* image2.file_set(ImagePath() + "/../../examples/evas/shooter/assets/images/bricks.jpg", ""); */
|
||||
/* image2.hint_min_set(160, 120); */
|
||||
/* image2.visible_set(true); */
|
||||
|
||||
/* box.append(image1); */
|
||||
/* box.append(image2); */
|
||||
|
||||
/* // loop.begin(); */
|
||||
/* } */
|
||||
}
|
||||
|
||||
}
|
|
@ -47,7 +47,6 @@ efl_mono_src = [
|
|||
'Eo.cs',
|
||||
'EoPromises.cs',
|
||||
'Errors.cs',
|
||||
'Evas.cs',
|
||||
'Events.cs',
|
||||
'FunctionPointers.cs',
|
||||
'FunctionPointerMarshalling.cs',
|
||||
|
|
Loading…
Reference in New Issue