aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunsuChoi <jsuya.choi@samsung.com>2019-04-04 13:12:58 +0900
committerJunsuChoi <jsuya.choi@samsung.com>2019-04-04 13:12:58 +0900
commit7669ee7cd76097f35f40fe2005221010fc1b8da4 (patch)
treebf19028e77b63211e28fb46496095b6fb9c728cf
parentefl_ui_animation: don't access a null pointer. (diff)
parentautotools: add another entry test file to dist (diff)
downloadefl-devs/jsuya/lottie.tar.gz
Merge branch 'master' into devs/jsuya/lottiedevs/jsuya/lottie
-rw-r--r--configure.ac22
-rw-r--r--header_checks/meson.build1
-rw-r--r--src/Makefile_Efl_Mono.am2
-rw-r--r--src/Makefile_Elementary.am5
-rw-r--r--src/bin/elementary/test_ui_pager.c30
-rw-r--r--src/bin/elementary/test_ui_pager_scroll.c72
-rw-r--r--src/bindings/mono/efl_mono/efl_all.cs47
-rw-r--r--src/bindings/mono/efl_mono/efl_csharp_application.cs210
-rw-r--r--src/bindings/mono/eina_mono/eina_accessor.cs21
-rw-r--r--src/bindings/mono/eina_mono/eina_array.cs50
-rw-r--r--src/bindings/mono/eina_mono/eina_binbuf.cs12
-rw-r--r--src/bindings/mono/eina_mono/eina_common.cs13
-rw-r--r--src/bindings/mono/eina_mono/eina_config.cs25
-rw-r--r--src/bindings/mono/eina_mono/eina_container_common.cs131
-rw-r--r--src/bindings/mono/eina_mono/eina_error.cs15
-rw-r--r--src/bindings/mono/eina_mono/eina_hash.cs26
-rw-r--r--src/bindings/mono/eina_mono/eina_inarray.cs49
-rw-r--r--src/bindings/mono/eina_mono/eina_inlist.cs26
-rw-r--r--src/bindings/mono/eina_mono/eina_iterator.cs13
-rw-r--r--src/bindings/mono/eina_mono/eina_list.cs24
-rw-r--r--src/bindings/mono/eina_mono/eina_log.cs35
-rw-r--r--src/bindings/mono/eina_mono/eina_promises.cs62
-rw-r--r--src/bindings/mono/eina_mono/eina_slice.cs11
-rw-r--r--src/bindings/mono/eina_mono/eina_strbuf.cs24
-rw-r--r--src/bindings/mono/eina_mono/eina_stringshare.cs7
-rw-r--r--src/bindings/mono/eina_mono/eina_value.cs567
-rw-r--r--src/bindings/mono/eldbus_mono/eldbus_common.cs301
-rw-r--r--src/bindings/mono/eldbus_mono/eldbus_config.cs5
-rw-r--r--src/bindings/mono/eldbus_mono/eldbus_connection.cs59
-rw-r--r--src/bindings/mono/eldbus_mono/eldbus_message.cs46
-rw-r--r--src/bindings/mono/eldbus_mono/eldbus_object.cs36
-rw-r--r--src/bindings/mono/eldbus_mono/eldbus_pending.cs4
-rw-r--r--src/bindings/mono/eldbus_mono/eldbus_proxy.cs23
-rw-r--r--src/bindings/mono/eldbus_mono/eldbus_service.cs4
-rw-r--r--src/bindings/mono/eo_mono/FunctionWrapper.cs27
-rw-r--r--src/bindings/mono/eo_mono/FunctionWrapper_Unix.cs10
-rw-r--r--src/bindings/mono/eo_mono/FunctionWrapper_Windows.cs10
-rw-r--r--src/bindings/mono/eo_mono/NativeModule.cs10
-rw-r--r--src/bindings/mono/eo_mono/NativeModule_Unix.cs12
-rw-r--r--src/bindings/mono/eo_mono/NativeModule_Windows.cs11
-rw-r--r--src/bindings/mono/eo_mono/iwrapper.cs506
-rw-r--r--src/bindings/mono/eo_mono/workaround.cs129
-rw-r--r--src/lib/ecore/Ecore_Common.h2
-rw-r--r--src/lib/ecore/ecore.c13
-rw-r--r--src/lib/ecore/efl_exe.eo2
-rw-r--r--src/lib/ecore_cocoa/Ecore_Cocoa.h2
-rw-r--r--src/lib/ecore_con/ecore_con.c5
-rw-r--r--src/lib/ecore_con/ecore_con_local.c2
-rw-r--r--src/lib/ecore_con/ecore_con_socks.c5
-rw-r--r--src/lib/ecore_con/ecore_con_url_curl.c2
-rw-r--r--src/lib/ecore_con/efl_net_dialer_http.eo2
-rw-r--r--src/lib/ecore_con/meson.build5
-rw-r--r--src/lib/ecore_wl2/Ecore_Wl2.h4
-rw-r--r--src/lib/ecore_x/Ecore_X.h2
-rw-r--r--src/lib/ector/Ector.h2
-rw-r--r--src/lib/edje/Edje_Legacy.h2
-rw-r--r--src/lib/edje/edje_convert.h6
-rw-r--r--src/lib/edje/efl_layout_calc.eo2
-rw-r--r--src/lib/edje/efl_layout_signal.eo2
-rw-r--r--src/lib/eet/Eet.h2
-rw-r--r--src/lib/efl/interfaces/efl_file.eo36
-rw-r--r--src/lib/efl/interfaces/efl_pack_layout.eo4
-rw-r--r--src/lib/eina/eina_promise.h6
-rw-r--r--src/lib/eio/efl_io_manager.eo2
-rw-r--r--src/lib/eio/efl_io_model.c36
-rw-r--r--src/lib/eio/eio_monitor_poll.c5
-rw-r--r--src/lib/elementary/efl_page_indicator.c13
-rw-r--r--src/lib/elementary/efl_page_indicator_icon.c20
-rw-r--r--src/lib/elementary/efl_page_transition.c11
-rw-r--r--src/lib/elementary/efl_page_transition_scroll.c20
-rw-r--r--src/lib/elementary/efl_ui_focus_manager.eo2
-rw-r--r--src/lib/elementary/efl_ui_image.eo6
-rw-r--r--src/lib/elementary/efl_ui_layout.eo4
-rw-r--r--src/lib/elementary/efl_ui_layout_base.eo4
-rw-r--r--src/lib/elementary/efl_ui_pager.c68
-rw-r--r--src/lib/elementary/efl_ui_widget.eo2
-rw-r--r--src/lib/elementary/efl_ui_widget_common.h2
-rw-r--r--src/lib/elementary/elc_naviframe_common.h30
-rw-r--r--src/lib/elementary/elm_config.h8
-rw-r--r--src/lib/elementary/elm_entry.c4
-rw-r--r--src/lib/elementary/elm_image_legacy.h2
-rw-r--r--src/lib/elementary/elm_naviframe_eo.legacy.h30
-rw-r--r--src/lib/elementary/elm_need.h2
-rw-r--r--src/lib/elementary/elm_priv.h2
-rw-r--r--src/lib/elementary/elm_sys_notify_eo.h2
-rw-r--r--src/lib/elementary/elm_sys_notify_eo.legacy.h2
-rw-r--r--src/lib/elementary/elm_widget_item_eo.legacy.h106
-rw-r--r--src/lib/elput/Elput.h4
-rw-r--r--src/lib/emile/emile_image.h4
-rw-r--r--src/lib/emotion/Emotion.h8
-rw-r--r--src/lib/eo/Eo.h4
-rw-r--r--src/lib/eo/efl_object.eo2
-rw-r--r--src/lib/eo/eo_internal.h2
-rw-r--r--src/lib/eolian/Eolian.h2
-rw-r--r--src/lib/eolian/Eolian_Aux.h2
-rw-r--r--src/lib/eolian/eo_lexer.h2
-rw-r--r--src/lib/ephysics/EPhysics.h10
-rw-r--r--src/lib/escape/sys/mman.h2
-rw-r--r--src/lib/ethumb_client/Ethumb_Client.h2
-rw-r--r--src/lib/evas/Evas_Common.h2
-rw-r--r--src/lib/evas/Evas_Legacy.h2
-rw-r--r--src/lib/evas/canvas/efl_canvas_animation.eo2
-rw-r--r--src/lib/evas/canvas/evas_callbacks.c5
-rw-r--r--src/lib/evas/canvas/evas_object_image.c8
-rw-r--r--src/lib/evas/common/evas_text_utils.h2
-rw-r--r--src/lib/evil/evil_dlfcn.h8
-rw-r--r--src/lib/evil/evil_stdlib.h2
-rw-r--r--src/lib/evil/sys/mman.h2
-rw-r--r--src/tests/ecore/efl_app_test_loop.c7
-rw-r--r--src/tests/ecore/efl_app_test_promise.c5
-rw-r--r--src/tests/efl_check.h23
-rw-r--r--src/tests/efl_mono/Eina.cs6
-rw-r--r--src/tests/elementary/efl_ui_suite.c1
-rw-r--r--src/tests/elementary/efl_ui_suite.h1
-rw-r--r--src/tests/elementary/efl_ui_test_callback.c45
-rw-r--r--src/tests/elementary/elm_test_fileselector.c80
-rw-r--r--src/tests/elementary/meson.build1
117 files changed, 2367 insertions, 1063 deletions
diff --git a/configure.ac b/configure.ac
index dfa1bf0bd4..aab7b7fb29 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3259,7 +3259,7 @@ EFL_EVAL_PKGS([ECORE_CON])
### Checks for header files
-AC_CHECK_HEADERS([ws2tcpip.h netdb.h sys/filio.h])
+AC_CHECK_HEADERS([netdb.h sys/filio.h])
if test "x${ac_cv_header_netdb_h}" = "xno" && test "x${have_windows}" = "xno"; then
AC_MSG_ERROR([netdb.h is requested to have Ecore_Con. Exiting...])
@@ -3267,18 +3267,19 @@ fi
### Checks for types
-have_ipv6="no"
-AC_CHECK_TYPES([struct ipv6_mreq],
- [have_ipv6="yes"],
- [have_ipv6="no"],
- [[
+if test "x${have_win32}" = "xyes" ; then
+ have_ipv6="yes"
+else
+ have_ipv6="no"
+ AC_CHECK_TYPES([struct ipv6_mreq],
+ [have_ipv6="yes"],
+ [have_ipv6="no"],
+ [[
#ifdef HAVE_NETINET_IN_H
# include <netinet/in.h>
#endif
-#ifdef HAVE_WS2TCPIP_H
-# include <ws2tcpip.h>
-#endif
-]])
+ ]])
+fi
AC_DEFINE_IF([HAVE_IPV6],
[test "x${have_ipv6}" = "xyes"],
@@ -4117,7 +4118,6 @@ EFL_ADD_FEATURE([ECORE_AUDIO], [wasapiaudio])
EFL_LIB_END_OPTIONAL([Ecore_Audio])
AM_CONDITIONAL([HAVE_ECORE_AUDIO_PULSE], [test "x${want_pulseaudio}" = "xyes"])
AM_CONDITIONAL([HAVE_ECORE_AUDIO_SNDFILE], [test "x${want_sndfile}" = "xyes"])
-AM_CONDITIONAL([HAVE_ECORE_AUDIO_WASASPI], [test "x${want_wasapiaudio}" = "xyes"])
#### End of Ecore_Audio
diff --git a/header_checks/meson.build b/header_checks/meson.build
index 48eeb89d2a..42d638fc6a 100644
--- a/header_checks/meson.build
+++ b/header_checks/meson.build
@@ -52,7 +52,6 @@ header_checks = [
'langinfo.h',
'locale.h',
'uv.h',
- 'ws2tcpip.h',
'crt_externs.h'
]
diff --git a/src/Makefile_Efl_Mono.am b/src/Makefile_Efl_Mono.am
index 7cdfc1d726..d8c9dc55ab 100644
--- a/src/Makefile_Efl_Mono.am
+++ b/src/Makefile_Efl_Mono.am
@@ -206,6 +206,8 @@ $(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)) \
+$(evas_gesture_eolian_pub_files:%.eo=%.eo.cs) \
+$(evas_gesture_eolian_type_files:%.eot=%.eot.cs) \
lib/evas/canvas/efl_canvas_image.eo.cs \
$(evas_canvas_eolian_type_files:%.eot=%.eot.cs) \
lib/eo/eina_types.eot.cs \
diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am
index aad2090017..9a36cbe910 100644
--- a/src/Makefile_Elementary.am
+++ b/src/Makefile_Elementary.am
@@ -1819,6 +1819,8 @@ edje_external_elementary_module_la_LIBTOOLFLAGS = --tag=disable-static
testfilesdir = $(datadir)/elementary/
testfiles_DATA = \
+ tests/elementary/testfile_entry.txt \
+ tests/elementary/testfile_entry2.txt \
tests/elementary/testfile.txt \
tests/elementary/testfile-windows.txt \
tests/elementary/testfile-withblanks.txt \
@@ -1944,6 +1946,7 @@ tests_elementary_efl_ui_suite_SOURCES = \
tests/elementary/efl_ui_build.c \
tests/elementary/elm_test_init.c \
tests/elementary/efl_ui_test_atspi.c \
+ tests/elementary/efl_ui_test_callback.c \
tests/elementary/efl_ui_test_focus_common.c \
tests/elementary/efl_ui_test_focus_common.h \
tests/elementary/efl_ui_test_focus.c \
@@ -2014,4 +2017,4 @@ lib/elementary/elm_code_widget_undo.c \
lib/elementary/config_embed
lib/elementary/elm_default_config.x:
- lib/elementary/config_embed $(abs_top_srcdir)/data/elementary/config/standard/base.src.in $@
+ $(top_srcdir)/src/lib/elementary/config_embed $(abs_top_srcdir)/data/elementary/config/standard/base.src.in $@
diff --git a/src/bin/elementary/test_ui_pager.c b/src/bin/elementary/test_ui_pager.c
index 32bc1d775a..78fb1b598e 100644
--- a/src/bin/elementary/test_ui_pager.c
+++ b/src/bin/elementary/test_ui_pager.c
@@ -36,8 +36,7 @@ typedef enum _Pack_Type {
PACK_BEFORE,
PACK_AFTER,
PACK_AT,
- UNPACK_AT,
- CLEAR
+ UNPACK_AT
} Pack_Type;
typedef struct _Params {
@@ -219,7 +218,7 @@ static void pack_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
Eo *page = NULL, *curr_page;
int index, cnt;
- if ((param->type != UNPACK_AT) && (param->type != CLEAR)) {
+ if (param->type != UNPACK_AT) {
index = efl_content_count(pager);
switch (index % 3) {
@@ -261,12 +260,10 @@ static void pack_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
break;
case UNPACK_AT:
index = efl_ui_range_value_get(param->unpack_sp);
- page = efl_pack_unpack_at(pager, index);
+ page = efl_pack_content_get(pager, index);
+ efl_pack_unpack(pager, page);
efl_del(page);
break;
- case CLEAR:
- efl_pack_clear(pager);
- break;
}
cnt = efl_content_count(pager);
@@ -590,25 +587,6 @@ static void pack_cb(void *data,
efl_pack_end(box, in_box2);
efl_pack_end(in_box2, btn);
efl_pack_end(in_box2, sp2);
-
- // Clear
- pack_param = calloc(1, sizeof(Pack_Params));
- if (!pack_param) return;
-
- pack_param->pager = pager;
- pack_param->pack_sp = sp1;
- pack_param->unpack_sp = sp2;
- pack_param->unpack_btn = btn;
- pack_param->type = CLEAR;
-
- efl_add(EFL_UI_BUTTON_CLASS, box,
- efl_text_set(efl_added, "Clear"),
- efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED,
- pack_btn_cb, pack_param),
- efl_event_callback_add(efl_added, EFL_EVENT_DEL,
- pack_btn_del_cb, pack_param),
- efl_pack_end(box, efl_added));
-
}
static void current_page_cb(void *data,
diff --git a/src/bin/elementary/test_ui_pager_scroll.c b/src/bin/elementary/test_ui_pager_scroll.c
index 8df58c6570..30a4306f63 100644
--- a/src/bin/elementary/test_ui_pager_scroll.c
+++ b/src/bin/elementary/test_ui_pager_scroll.c
@@ -36,8 +36,7 @@ typedef enum _Pack_Type {
PACK_BEFORE,
PACK_AFTER,
PACK_AT,
- UNPACK_AT,
- CLEAR
+ UNPACK_AT
} Pack_Type;
typedef struct _Params {
@@ -241,7 +240,7 @@ static void pack_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
Eo *page = NULL, *curr_page;
int index, cnt;
- if ((param->type != UNPACK_AT) && (param->type != CLEAR)) {
+ if (param->type != UNPACK_AT) {
index = efl_content_count(pager);
switch (index % 3) {
@@ -283,12 +282,10 @@ static void pack_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
break;
case UNPACK_AT:
index = efl_ui_range_value_get(param->unpack_sp);
- page = efl_pack_unpack_at(pager, index);
+ page = efl_pack_content_get(pager, index);
+ efl_pack_unpack(pager, page);
efl_del(page);
break;
- case CLEAR:
- efl_pack_clear(pager);
- break;
}
cnt = efl_content_count(pager);
@@ -356,11 +353,13 @@ static void next_block_check_cb(void *data, const Efl_Event *ev)
efl_ui_pager_scroll_block_set(pager, prev, next);
}
-static void loop_radio_cb(void *data, const Efl_Event *ev)
+static void loop_check_cb(void *data, const Efl_Event *ev)
{
Eo *pager = data;
int state = efl_ui_nstate_value_get(ev->object);
+ //FIXME use other widget (i.e. radio) than check
+ // since loop might not be enabled according to the number of items
efl_ui_pager_loop_mode_set(pager, state);
}
@@ -702,24 +701,6 @@ static void pack_cb(void *data,
efl_pack_end(box, in_box2);
efl_pack_end(in_box2, btn);
efl_pack_end(in_box2, sp2);
-
- // Clear
- pack_param = calloc(1, sizeof(Pack_Params));
- if (!pack_param) return;
-
- pack_param->pager = pager;
- pack_param->pack_sp = sp1;
- pack_param->unpack_sp = sp2;
- pack_param->unpack_btn = btn;
- pack_param->type = CLEAR;
-
- efl_add(EFL_UI_BUTTON_CLASS, box,
- efl_text_set(efl_added, "Clear"),
- efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED,
- pack_btn_cb, pack_param),
- efl_event_callback_add(efl_added, EFL_EVENT_DEL,
- pack_btn_del_cb, pack_param),
- efl_pack_end(box, efl_added));
}
static void current_page_cb(void *data,
@@ -817,8 +798,7 @@ static void loop_cb(void *data EINA_UNUSED,
Params *params = (Params *)data;
Evas_Object *navi = params->navi;
Eo *pager = params->pager;
- Eo *btn, *box, *rd;
- Efl_Ui_Pager_Loop loop;
+ Eo *btn, *box;
btn = efl_add(EFL_UI_BUTTON_CLASS, navi,
efl_text_set(efl_added, "Back"),
@@ -830,35 +810,13 @@ static void loop_cb(void *data EINA_UNUSED,
elm_naviframe_item_push(navi, "Loop", btn, NULL,
efl_added, NULL));
- rd = efl_add(EFL_UI_RADIO_CLASS, box,
- efl_ui_radio_state_value_set(efl_added, EFL_UI_PAGER_LOOP_DISABLED),
- efl_text_set(efl_added, "Disabled"),
- efl_gfx_hint_weight_set(efl_added, 1, 0),
- efl_event_callback_add(efl_added, EFL_UI_RADIO_EVENT_CHANGED,
- loop_radio_cb, pager),
- efl_pack(box, efl_added));
-
- rd = efl_add(EFL_UI_RADIO_CLASS, box,
- efl_ui_radio_state_value_set(efl_added, EFL_UI_PAGER_LOOP_ENABLED),
- efl_ui_radio_group_add(efl_added, rd),
- efl_text_set(efl_added, "Enabled"),
- efl_gfx_hint_weight_set(efl_added, 1, 0),
- efl_event_callback_add(efl_added, EFL_UI_RADIO_EVENT_CHANGED,
- loop_radio_cb, pager),
- efl_pack(box, efl_added));
-
- loop = efl_ui_pager_loop_mode_get(pager);
-
- efl_ui_nstate_value_set(rd, loop);
-
- if (loop == EFL_UI_PAGER_LOOP_DISABLED)
- {
- Eina_Bool ret = efl_ui_pager_loop_mode_set(pager, EFL_UI_PAGER_LOOP_ENABLED);
- if (!ret)
- elm_object_disabled_set(rd, EINA_TRUE);
- else
- efl_ui_pager_loop_mode_set(pager, EFL_UI_PAGER_LOOP_DISABLED);
- }
+ efl_add(EFL_UI_CHECK_CLASS, box,
+ efl_ui_widget_style_set(efl_added, "toggle"),
+ efl_text_set(efl_added, "Loop"),
+ efl_ui_nstate_value_set(efl_added, efl_ui_pager_loop_mode_get(pager)),
+ efl_event_callback_add(efl_added, EFL_UI_CHECK_EVENT_CHANGED,
+ loop_check_cb, pager),
+ efl_pack_end(box, efl_added));
}
static void indicator_cb(void *data EINA_UNUSED,
diff --git a/src/bindings/mono/efl_mono/efl_all.cs b/src/bindings/mono/efl_mono/efl_all.cs
index bf78df1d3d..70b9825b9d 100644
--- a/src/bindings/mono/efl_mono/efl_all.cs
+++ b/src/bindings/mono/efl_mono/efl_all.cs
@@ -6,10 +6,11 @@ using System.Threading;
using static Efl.UnsafeNativeMethods;
-namespace Efl {
-
-static class UnsafeNativeMethods {
+namespace Efl
+{
+static class UnsafeNativeMethods
+{
private delegate void init_func_delegate();
[DllImport(efl.Libs.Ecore)] public static extern void ecore_init();
[DllImport(efl.Libs.Ecore)] public static extern void ecore_shutdown();
@@ -27,39 +28,48 @@ static class UnsafeNativeMethods {
[DllImport(efl.Libs.Elementary)] public static extern void elm_run();
[DllImport(efl.Libs.Elementary)] public static extern void elm_exit();
- static UnsafeNativeMethods() {
+ static UnsafeNativeMethods()
+ {
_evas_init = new Efl.Eo.FunctionWrapper<init_func_delegate>("evas", "evas_init");
}
+
public static void evas_init()
{
_evas_init.Value.Delegate();
}
}
-public static class All {
+public static class All
+{
private static bool InitializedUi = false;
- public static void Init(Efl.Csharp.Components components=Efl.Csharp.Components.Basic) {
+ public static void Init(Efl.Csharp.Components components = Efl.Csharp.Components.Basic)
+ {
Eina.Config.Init();
Efl.Eo.Config.Init();
ecore_init();
evas_init();
eldbus.Config.Init();
- if (components == Efl.Csharp.Components.Ui) {
+ if (components == Efl.Csharp.Components.Ui)
+ {
Efl.Ui.Config.Init();
InitializedUi = true;
}
}
/// <summary>Shutdowns all EFL subsystems.</summary>
- public static void Shutdown() {
+ public static void Shutdown()
+ {
// Try to cleanup everything before actually shutting down.
System.GC.Collect();
System.GC.WaitForPendingFinalizers();
if (InitializedUi)
+ {
Efl.Ui.Config.Shutdown();
+ }
+
eldbus.Config.Shutdown();
evas_shutdown();
ecore_shutdown();
@@ -69,29 +79,38 @@ public static class All {
}
// Placeholder. Will move to elm_config.cs later
-namespace Ui {
+namespace Ui
+{
-public static class Config {
- public static void Init() {
+public static class Config
+{
+ public static void Init()
+ {
// TODO Support elm command line arguments
#if WIN32 // Not a native define, we define it in our build system
// Ecore_Win32 uses OleInitialize, which requires single thread apartments
if (System.Threading.Thread.CurrentThread.GetApartmentState() != ApartmentState.STA)
+ {
throw new InvalidOperationException("UI Applications require STAThreadAttribute in Main()");
+ }
#endif
elm_init(0, IntPtr.Zero);
elm_policy_set((int)Elm.Policy.Quit, (int)Elm.PolicyQuit.LastWindowHidden);
}
- public static void Shutdown() {
+
+ public static void Shutdown()
+ {
elm_shutdown();
}
- public static void Run() {
+ public static void Run()
+ {
elm_run();
}
- public static void Exit() {
+ public static void Exit()
+ {
elm_exit();
}
}
diff --git a/src/bindings/mono/efl_mono/efl_csharp_application.cs b/src/bindings/mono/efl_mono/efl_csharp_application.cs
index 3bac96170d..1e63d62c4a 100644
--- a/src/bindings/mono/efl_mono/efl_csharp_application.cs
+++ b/src/bindings/mono/efl_mono/efl_csharp_application.cs
@@ -3,99 +3,131 @@ using System.Runtime.InteropServices;
using System.Threading;
using static Efl.UnsafeNativeMethods;
-namespace Efl {
- namespace Csharp {
- ///<summary>The components to be initialized.</summary>
- public enum Components {
- ///<summary>Basic components: Eina, Eo, Ecore, Evas and DBus.</summary>
- Basic,
- ///<summary>The same components of <see cref="Efl.Csharp.Components.Basic"/> and the Elementary widget toolkit.</summary>
- Ui,
- }
- /// <summary>
- /// This represents the entry point for the EFL framework
- /// You can use this class to implement the 4 abstract methods which will then be called accordingly
- /// All subsystems of efl are booted up correctly when the abstract methods of this class are called.
- /// </summary>
- /// <remarks>
- /// Calls to efl outside those efl-callbacks or outside the mainloop are not allowed and will lead to issues
- /// </remarks>
- /// <example>
- /// UserApp is the class that implements the Application abstract
- /// <code>
- /// public static void Main() {
- /// UserApp editor = new UserApp();
- /// editor.Launch(editor);
- /// }
- /// </code>
- /// </example>
- public abstract class Application {
- //the initializied components
- private static Components initComponent;
- //what follows are 3 private functions to boot up the internals of efl
- private static void Init(Efl.Csharp.Components component) {
+namespace Efl
+{
+
+namespace Csharp
+{
+
+///<summary>The components to be initialized.</summary>
+public enum Components
+{
+ ///<summary>Basic components: Eina, Eo, Ecore, Evas and DBus.</summary>
+ Basic,
+ ///<summary>The same components of <see cref="Efl.Csharp.Components.Basic"/> and the Elementary widget toolkit.</summary>
+ Ui,
+}
+
+/// <summary>
+/// This represents the entry point for the EFL framework
+/// You can use this class to implement the 4 abstract methods which will then be called accordingly
+/// All subsystems of efl are booted up correctly when the abstract methods of this class are called.
+/// </summary>
+/// <remarks>
+/// Calls to efl outside those efl-callbacks or outside the mainloop are not allowed and will lead to issues
+/// </remarks>
+/// <example>
+/// UserApp is the class that implements the Application abstract
+/// <code>
+/// public static void Main()
+/// {
+/// UserApp editor = new UserApp();
+/// editor.Launch(editor);
+/// }
+/// </code>
+/// </example>
+public abstract class Application
+{
+ //the initializied components
+ private static Components initComponent;
+ //what follows are 3 private functions to boot up the internals of efl
+ private static void Init(Efl.Csharp.Components component)
+ {
Eina.Config.Init();
Efl.Eo.Config.Init();
ecore_init();
evas_init();
eldbus.Config.Init();
- if (component == Components.Ui) {
- // TODO Support elm command line arguments
-#if WIN32 // Not a native define, we define it in our build system
- // Ecore_Win32 uses OleInitialize, which requires single thread apartments
- if (System.Threading.Thread.CurrentThread.GetApartmentState() != ApartmentState.STA)
- throw new InvalidOperationException("UI Applications require STAThreadAttribute in Main()");
+ if (component == Components.Ui)
+ {
+ // TODO Support elm command line arguments
+#if WIN32 // Not a native define, we define it in our build system
+ // Ecore_Win32 uses OleInitialize, which requires single thread apartments
+ if (System.Threading.Thread.CurrentThread.GetApartmentState() != ApartmentState.STA)
+ {
+ throw new InvalidOperationException("UI Applications require STAThreadAttribute in Main()");
+ }
#endif
- elm_init(0, IntPtr.Zero);
+ elm_init(0, IntPtr.Zero);
- elm_policy_set((int)Elm.Policy.Quit, (int)Elm.PolicyQuit.LastWindowHidden);
+ elm_policy_set((int)Elm.Policy.Quit, (int)Elm.PolicyQuit.LastWindowHidden);
}
+
initComponent = component;
- }
- private static void Shutdown() {
+ }
+
+ private static void Shutdown()
+ {
// Try to cleanup everything before actually shutting down.
System.GC.Collect();
System.GC.WaitForPendingFinalizers();
- if (initComponent == Components.Ui) {
- elm_shutdown();
+ if (initComponent == Components.Ui)
+ {
+ elm_shutdown();
}
+
eldbus.Config.Shutdown();
evas_shutdown();
ecore_shutdown();
Efl.Eo.Config.Shutdown();
Eina.Config.Shutdown();
- }
- /// <summary>
- /// Called when the application is started. Arguments from the command line are passed here.
- /// </summary>
- protected abstract void OnInitialize(Eina.Array<System.String> args);
- /// <summary>
- /// Arguments are passed here, Additional calls to this function may occure,
- /// but then the initialization flag is set to false.
- /// </summary>
- /// <remarks>
- /// When Initialize is true then OnInitialize is also called
- /// </remarks>
- protected virtual void OnArguments(Efl.LoopArguments args) { }
- /// <summary>
- /// Called when the application is not going to be displayed, or is not used by a user for some time.
- /// </summary>
- protected virtual void OnPause() { }
- /// <summary>
- /// Called before an application is used again after a call to OnPause().
- /// </summary>
- protected virtual void OnResume() { }
- /// <summary>
- /// Called before starting the shutdown of the application.
- /// </summary>
- protected virtual void OnTerminate() { }
- /// <summary>
- /// This function initializices everything in EFL and runs your application.
- /// This call will result in a call to OnInitialize(), which you application should override.
- /// </summary>
- public void Launch(Efl.Csharp.Components components=Components.Ui) {
+ }
+
+ /// <summary>
+ /// Called when the application is started. Arguments from the command line are passed here.
+ /// </summary>
+ protected abstract void OnInitialize(Eina.Array<System.String> args);
+
+ /// <summary>
+ /// Arguments are passed here, Additional calls to this function may occure,
+ /// but then the initialization flag is set to false.
+ /// </summary>
+ /// <remarks>
+ /// When Initialize is true then OnInitialize is also called
+ /// </remarks>
+ protected virtual void OnArguments(Efl.LoopArguments args)
+ {
+ }
+
+ /// <summary>
+ /// Called when the application is not going to be displayed, or is not used by a user for some time.
+ /// </summary>
+ protected virtual void OnPause()
+ {
+ }
+
+ /// <summary>
+ /// Called before an application is used again after a call to OnPause().
+ /// </summary>
+ protected virtual void OnResume()
+ {
+ }
+
+ /// <summary>
+ /// Called before starting the shutdown of the application.
+ /// </summary>
+ protected virtual void OnTerminate()
+ {
+ }
+
+ /// <summary>
+ /// This function initializices everything in EFL and runs your application.
+ /// This call will result in a call to OnInitialize(), which you application should override.
+ /// </summary>
+ public void Launch(Efl.Csharp.Components components = Components.Ui)
+ {
Init(components);
Efl.App app = Efl.App.AppMain;
Eina.Array<String> command_line = new Eina.Array<String>();
@@ -103,26 +135,32 @@ namespace Efl {
#if EFL_BETA
app.SetCommandArray(command_line);
#endif
- app.ArgumentsEvt += (object sender, LoopArgumentsEvt_Args evt) => {
- if (evt.arg.Initialization) {
- OnInitialize(evt.arg.Argv);
- }
- OnArguments(evt.arg);
+ app.ArgumentsEvt += (object sender, LoopArgumentsEvt_Args evt) =>
+ {
+ if (evt.arg.Initialization)
+ {
+ OnInitialize(evt.arg.Argv);
+ }
+
+ OnArguments(evt.arg);
};
- app.PauseEvt += (object sender, EventArgs e) => {
- OnPause();
+ app.PauseEvt += (object sender, EventArgs e) =>
+ {
+ OnPause();
};
- app.ResumeEvt += (object sender, EventArgs e) => {
- OnResume();
+ app.ResumeEvt += (object sender, EventArgs e) =>
+ {
+ OnResume();
};
- app.TerminateEvt += (object sender, EventArgs e) => {
- OnTerminate();
+ app.TerminateEvt += (object sender, EventArgs e) =>
+ {
+ OnTerminate();
};
app.Begin();
Shutdown();
- }
}
- }
}
+}
+}
diff --git a/src/bindings/mono/eina_mono/eina_accessor.cs b/src/bindings/mono/eina_mono/eina_accessor.cs
index 3f2f71b2b3..31574d552f 100644
--- a/src/bindings/mono/eina_mono/eina_accessor.cs
+++ b/src/bindings/mono/eina_mono/eina_accessor.cs
@@ -7,7 +7,8 @@ using static Eina.TraitFunctions;
using static Eina.AccessorNativeFunctions;
-namespace Eina {
+namespace Eina
+{
internal class AccessorNativeFunctions
{
@@ -43,7 +44,7 @@ public class Accessor<T> : IEnumerable<T>, IDisposable
/// <summary>Create a new accessor wrapping the given pointer.</summary>
/// <param name="handle">The native handle to be wrapped.</param>
/// <param name="owner">Whether this wrapper owns the native accessor.</param>
- public Accessor(IntPtr handle, Ownership owner=Ownership.Managed)
+ public Accessor(IntPtr handle, Ownership owner = Ownership.Managed)
{
Handle = handle;
Ownership = owner;
@@ -53,7 +54,7 @@ public class Accessor<T> : IEnumerable<T>, IDisposable
/// <param name="handle">The native handle to be wrapped.</param>
/// <param name="own">Whether this wrapper owns the native accessor.</param>
/// <param name="ownContent">For compatibility with other EFL# containers. Ignored in acessors.</param>
- public Accessor(IntPtr handle, bool own, bool ownContent=false)
+ public Accessor(IntPtr handle, bool own, bool ownContent = false)
: this(handle, own ? Ownership.Managed : Ownership.Unmanaged)
{
}
@@ -96,13 +97,16 @@ public class Accessor<T> : IEnumerable<T>, IDisposable
public IEnumerator<T> GetEnumerator()
{
if (Handle == IntPtr.Zero)
+ {
throw new ObjectDisposedException(base.GetType().Name);
+ }
+
IntPtr tmp = MemoryNative.Alloc(Marshal.SizeOf(typeof(IntPtr)));
uint position = 0;
try
{
- while(eina_accessor_data_get(Handle, position, tmp))
+ while (eina_accessor_data_get(Handle, position, tmp))
{
IntPtr data = (IntPtr)Marshal.PtrToStructure(tmp, typeof(IntPtr));
yield return Convert(data);
@@ -124,11 +128,12 @@ public class Accessor<T> : IEnumerable<T>, IDisposable
///<summary>Accessor for Inlists.</summary>
public class AccessorInList<T> : Accessor<T>
{
-
/// <summary>Create a new accessor wrapping the given pointer.</summary>
/// <param name="handle">The native handle to be wrapped.</param>
/// <param name="own">Whether this wrapper owns the native accessor.</param>
- public AccessorInList(IntPtr handle, Ownership own): base(handle, own) {}
+ public AccessorInList(IntPtr handle, Ownership own) : base(handle, own)
+ {
+ }
/// <summary>Convert the native data into managed. This is used when returning the data through a
/// <see cref="System.Collections.Generic.IEnumerator&lt;T&gt;"/>.</summary>
@@ -146,7 +151,9 @@ public class AccessorInArray<T> : Accessor<T>
/// <summary>Create a new accessor wrapping the given pointer.</summary>
/// <param name="handle">The native handle to be wrapped.</param>
/// <param name="own">Whether this wrapper owns the native accessor.</param>
- public AccessorInArray(IntPtr handle, Ownership own): base(handle, own) {}
+ public AccessorInArray(IntPtr handle, Ownership own) : base(handle, own)
+ {
+ }
/// <summary>Convert the native data into managed. This is used when returning the data through a
/// <see cref="System.Collections.Generic.IEnumerator&lt;T&gt;"/>.</summary>
diff --git a/src/bindings/mono/eina_mono/eina_array.cs b/src/bindings/mono/eina_mono/eina_array.cs
index f4dd49d69e..106af08226 100644
--- a/src/bindings/mono/eina_mono/eina_array.cs
+++ b/src/bindings/mono/eina_mono/eina_array.cs
@@ -7,7 +7,8 @@ using System.Collections.Generic;
using static Eina.TraitFunctions;
using static Eina.ArrayNativeFunctions;
-namespace Eina {
+namespace Eina
+{
public static class ArrayNativeFunctions
{
@@ -64,7 +65,9 @@ public class Array<T> : IEnumerable<T>, IDisposable
Own = true;
OwnContent = true;
if (Handle == IntPtr.Zero)
+ {
throw new SEHException("Could not alloc array");
+ }
}
internal bool InternalPush(IntPtr ele)
@@ -99,6 +102,11 @@ public class Array<T> : IEnumerable<T>, IDisposable
public Array(IntPtr handle, bool own)
{
+ if (handle == IntPtr.Zero)
+ {
+ throw new ArgumentNullException("Handle can't be null");
+ }
+
Handle = handle;
Own = own;
OwnContent = own;
@@ -106,6 +114,11 @@ public class Array<T> : IEnumerable<T>, IDisposable
public Array(IntPtr handle, bool own, bool ownContent)
{
+ if (handle == IntPtr.Zero)
+ {
+ throw new ArgumentNullException("Handle can't be null");
+ }
+
Handle = handle;
Own = own;
OwnContent = ownContent;
@@ -121,19 +134,23 @@ public class Array<T> : IEnumerable<T>, IDisposable
IntPtr h = Handle;
Handle = IntPtr.Zero;
if (h == IntPtr.Zero)
+ {
return;
+ }
if (OwnContent)
{
int len = (int)eina_array_count_custom_export_mono(h);
- for(int i = 0; i < len; ++i)
+ for (int i = 0; i < len; ++i)
{
NativeFree<T>(eina_array_data_get_custom_export_mono(h, (uint)i));
}
}
if (Own)
+ {
eina_array_free(h);
+ }
}
public void Dispose()
@@ -159,7 +176,7 @@ public class Array<T> : IEnumerable<T>, IDisposable
if (OwnContent)
{
int len = Length;
- for(int i = 0; i < len; ++i)
+ for (int i = 0; i < len; ++i)
{
NativeFree<T>(InternalDataGet(i));
}
@@ -180,7 +197,7 @@ public class Array<T> : IEnumerable<T>, IDisposable
public int Count()
{
- return (int) eina_array_count_custom_export_mono(Handle);
+ return (int)eina_array_count_custom_export_mono(Handle);
}
public void SetOwnership(bool ownAll)
@@ -200,7 +217,10 @@ public class Array<T> : IEnumerable<T>, IDisposable
IntPtr ele = ManagedToNativeAlloc(val);
var r = InternalPush(ele);
if (!r)
+ {
NativeFree<T>(ele);
+ }
+
return r;
}
@@ -208,7 +228,9 @@ public class Array<T> : IEnumerable<T>, IDisposable
// public void Add(T val)
// {
// if (!Push(val))
-// throw;
+// {
+// throw;
+// }
// }
public T Pop()
@@ -216,7 +238,10 @@ public class Array<T> : IEnumerable<T>, IDisposable
IntPtr ele = InternalPop();
var r = NativeToManaged<T>(ele);
if (OwnContent && ele != IntPtr.Zero)
+ {
NativeFree<T>(ele);
+ }
+
return r;
}
@@ -235,7 +260,10 @@ public class Array<T> : IEnumerable<T>, IDisposable
{
IntPtr ele = InternalDataGet(idx); // TODO: check bondaries ??
if (OwnContent && ele != IntPtr.Zero)
+ {
NativeFree<T>(ele);
+ }
+
ele = ManagedToNativeAlloc(val);
InternalDataSet(idx, ele);
}
@@ -256,18 +284,24 @@ public class Array<T> : IEnumerable<T>, IDisposable
{
int len = Length;
var managed = new T[len];
- for(int i = 0; i < len; ++i)
+ for (int i = 0; i < len; ++i)
{
managed[i] = DataGet(i);
}
+
return managed;
}
public bool Append(T[] values)
{
- foreach(T v in values)
+ foreach (T v in values)
+ {
if (!Push(v))
+ {
return false;
+ }
+ }
+
return true;
}
@@ -280,7 +314,7 @@ public class Array<T> : IEnumerable<T>, IDisposable
public IEnumerator<T> GetEnumerator()
{
int len = Length;
- for(int i = 0; i < len; ++i)
+ for (int i = 0; i < len; ++i)
{
yield return DataGet(i);
}
diff --git a/src/bindings/mono/eina_mono/eina_binbuf.cs b/src/bindings/mono/eina_mono/eina_binbuf.cs
index 20a4c2d0ce..24fdaee5b1 100644
--- a/src/bindings/mono/eina_mono/eina_binbuf.cs
+++ b/src/bindings/mono/eina_mono/eina_binbuf.cs
@@ -3,7 +3,8 @@
using System;
using System.Runtime.InteropServices;
-namespace Eina {
+namespace Eina
+{
public class Binbuf : IDisposable
{
@@ -43,7 +44,7 @@ public class Binbuf : IDisposable
public int Length
{
- get { return (int) GetLength(); }
+ get { return (int)GetLength(); }
}
private void InitNew()
@@ -51,7 +52,9 @@ public class Binbuf : IDisposable
Handle = eina_binbuf_new();
Own = true;
if (Handle == IntPtr.Zero)
+ {
throw new SEHException("Could not alloc binbuf");
+ }
}
public Binbuf()
@@ -98,7 +101,8 @@ public class Binbuf : IDisposable
{
IntPtr h = Handle;
Handle = IntPtr.Zero;
- if (Own && h != IntPtr.Zero) {
+ if (Own && h != IntPtr.Zero)
+ {
eina_binbuf_free(Handle);
}
}
@@ -180,7 +184,9 @@ public class Binbuf : IDisposable
{
var ptr = eina_binbuf_string_get(Handle);
if (ptr == IntPtr.Zero)
+ {
return null;
+ }
var size = (int)(this.GetLength());
byte[] mArray = new byte[size];
diff --git a/src/bindings/mono/eina_mono/eina_common.cs b/src/bindings/mono/eina_mono/eina_common.cs
index c9c10de160..199b92bc06 100644
--- a/src/bindings/mono/eina_mono/eina_common.cs
+++ b/src/bindings/mono/eina_mono/eina_common.cs
@@ -6,6 +6,7 @@ using System.Runtime.InteropServices;
namespace Eina
{
+
namespace Callbacks
{
@@ -41,7 +42,8 @@ internal static class NativeCustomExportFunctions
}
/// <summary>Wrapper around native memory DllImport'd functions</summary>
-public static class MemoryNative {
+public static class MemoryNative
+{
public static void Free(IntPtr ptr)
{
NativeCustomExportFunctions.efl_mono_native_free(ptr);
@@ -122,7 +124,9 @@ public static class StringConversion
public static IntPtr ManagedStringToNativeUtf8Alloc(string managedString)
{
if (managedString == null)
+ {
return IntPtr.Zero;
+ }
byte[] strbuf = Encoding.UTF8.GetBytes(managedString);
IntPtr native = MemoryNative.Alloc(strbuf.Length + 1);
@@ -134,11 +138,15 @@ public static class StringConversion
public static string NativeUtf8ToManagedString(IntPtr pNativeData)
{
if (pNativeData == IntPtr.Zero)
+ {
return null;
+ }
int len = 0;
while (Marshal.ReadByte(pNativeData, len) != 0)
+ {
++len;
+ }
byte[] strbuf = new byte[len];
Marshal.Copy(pNativeData, strbuf, 0, strbuf.Length);
@@ -147,7 +155,8 @@ public static class StringConversion
}
/// <summary>Enum to handle resource ownership between managed and unmanaged code.</summary>
-public enum Ownership {
+public enum Ownership
+{
/// <summary> The resource is owned by the managed code. It should free the handle on disposal.</summary>
Managed,
/// <summary> The resource is owned by the unmanaged code. It won't be freed on disposal.</summary>
diff --git a/src/bindings/mono/eina_mono/eina_config.cs b/src/bindings/mono/eina_mono/eina_config.cs
index ee0bb5bd0e..9f3028f62d 100644
--- a/src/bindings/mono/eina_mono/eina_config.cs
+++ b/src/bindings/mono/eina_mono/eina_config.cs
@@ -3,18 +3,24 @@
using System;
using System.Runtime.InteropServices;
-namespace Eina {
+namespace Eina
+{
-public class Config {
+public class Config
+{
[DllImport(efl.Libs.Eina)] private static extern int eina_init();
[DllImport(efl.Libs.Eina)] private static extern int eina_shutdown();
- public static void Init() {
+ public static void Init()
+ {
if (eina_init() == 0)
+ {
throw (new Efl.EflException("Failed to initialize Eina"));
+ }
}
- public static int Shutdown() {
+ public static int Shutdown()
+ {
return eina_shutdown();
}
@@ -24,15 +30,15 @@ public class Config {
/// Wrapper class for pointers that need some cleanup afterwards
/// like strings.
/// </summary>
-public class DisposableIntPtr : IDisposable {
-
+public class DisposableIntPtr : IDisposable
+{
public IntPtr Handle { get; set; }
private bool ShouldFree;
private bool Disposed;
/// <summary>Wraps a new ptr what will be freed based on the
/// value of shouldFree</summary>
- public DisposableIntPtr(IntPtr ptr, bool shouldFree=false)
+ public DisposableIntPtr(IntPtr ptr, bool shouldFree = false)
{
Handle = ptr;
ShouldFree = shouldFree;
@@ -46,9 +52,11 @@ public class DisposableIntPtr : IDisposable {
protected virtual void Dispose(bool disposing)
{
- if (!Disposed && ShouldFree) {
+ if (!Disposed && ShouldFree)
+ {
MemoryNative.Free(this.Handle);
}
+
Disposed = true;
}
@@ -57,4 +65,5 @@ public class DisposableIntPtr : IDisposable {
Dispose(false);
}
}
+
}
diff --git a/src/bindings/mono/eina_mono/eina_container_common.cs b/src/bindings/mono/eina_mono/eina_container_common.cs
index 3eddb2aa31..73a3a0f46a 100644
--- a/src/bindings/mono/eina_mono/eina_container_common.cs
+++ b/src/bindings/mono/eina_mono/eina_container_common.cs
@@ -11,9 +11,15 @@ using static Eina.InarrayNativeFunctions;
using static Eina.InlistNativeFunctions;
using static Eina.NativeCustomExportFunctions;
-namespace Eina {
+namespace Eina
+{
-public enum ElementType { NumericType, StringType, ObjectType };
+public enum ElementType
+{
+ NumericType,
+ StringType,
+ ObjectType
+};
[StructLayout(LayoutKind.Sequential)]
public struct InlistMem
@@ -82,13 +88,18 @@ public class StringElementTraits : IBaseElementTraits<string>
public void NativeFree(IntPtr nat)
{
if (nat != IntPtr.Zero)
+ {
MemoryNative.Free(nat);
+ }
}
public void NativeFreeInlistNodeElement(IntPtr nat)
{
if (nat == IntPtr.Zero)
+ {
return;
+ }
+
var val = Marshal.PtrToStructure<IntPtr>
(nat + Marshal.SizeOf<InlistMem>());
NativeFree(val);
@@ -97,9 +108,15 @@ public class StringElementTraits : IBaseElementTraits<string>
public void NativeFreeInlistNode(IntPtr nat, bool freeElement)
{
if (nat == IntPtr.Zero)
+ {
return;
+ }
+
if (freeElement)
+ {
NativeFreeInlistNodeElement(nat);
+ }
+
MemoryNative.Free(nat);
}
@@ -115,7 +132,10 @@ public class StringElementTraits : IBaseElementTraits<string>
public string NativeToManaged(IntPtr nat)
{
if (nat == IntPtr.Zero)
+ {
return default(string);
+ }
+
return StringConversion.NativeUtf8ToManagedString(nat);
}
@@ -126,6 +146,7 @@ public class StringElementTraits : IBaseElementTraits<string>
Eina.Log.Error("Null pointer for Inlist node.");
return default(string);
}
+
IntPtr ptr_location = nat + Marshal.SizeOf<InlistMem>();
return NativeToManaged(Marshal.ReadIntPtr(ptr_location));
}
@@ -134,10 +155,16 @@ public class StringElementTraits : IBaseElementTraits<string>
public string NativeToManagedInplace(IntPtr nat)
{
if (nat == IntPtr.Zero)
+ {
return default(string);
+ }
+
nat = Marshal.ReadIntPtr(nat);
if (nat == IntPtr.Zero)
+ {
return default(string);
+ }
+
return NativeToManaged(nat);
}
@@ -180,7 +207,10 @@ public class EflObjectElementTraits<T> : IBaseElementTraits<T>
{
IntPtr h = ((Efl.Eo.IWrapper)man).NativeHandle;
if (h == IntPtr.Zero)
+ {
return h;
+ }
+
return Efl.Eo.Globals.efl_ref(h);
}
@@ -204,19 +234,26 @@ public class EflObjectElementTraits<T> : IBaseElementTraits<T>
public void NativeFree(IntPtr nat)
{
if (nat != IntPtr.Zero)
+ {
Efl.Eo.Globals.efl_unref(nat);
+ }
}
public void NativeFreeRef(IntPtr nat, bool unrefs)
{
if (unrefs)
+ {
NativeFree(nat);
+ }
}
public void NativeFreeInlistNodeElement(IntPtr nat)
{
if (nat == IntPtr.Zero)
+ {
return;
+ }
+
var val = Marshal.PtrToStructure<IntPtr>
(nat + Marshal.SizeOf<InlistMem>());
NativeFree(val);
@@ -225,9 +262,15 @@ public class EflObjectElementTraits<T> : IBaseElementTraits<T>
public void NativeFreeInlistNode(IntPtr nat, bool freeElement)
{
if (nat == IntPtr.Zero)
+ {
return;
+ }
+
if (freeElement)
+ {
NativeFreeInlistNodeElement(nat);
+ }
+
MemoryNative.Free(nat);
}
@@ -243,14 +286,20 @@ public class EflObjectElementTraits<T> : IBaseElementTraits<T>
public T NativeToManaged(IntPtr nat)
{
if (nat == IntPtr.Zero)
+ {
return default(T);
- return (T) Activator.CreateInstance(concreteType, Efl.Eo.Globals.efl_ref(nat));
+ }
+
+ return (T)Activator.CreateInstance(concreteType, Efl.Eo.Globals.efl_ref(nat));
}
public T NativeToManagedRef(IntPtr nat)
{
if (nat == IntPtr.Zero)
+ {
return default(T);
+ }
+
return NativeToManaged(nat);
}
@@ -261,6 +310,7 @@ public class EflObjectElementTraits<T> : IBaseElementTraits<T>
Eina.Log.Error("Null pointer for Inlist node.");
return default(T);
}
+
IntPtr ptr_location = nat + Marshal.SizeOf<InlistMem>();
return NativeToManaged(Marshal.ReadIntPtr(ptr_location));
}
@@ -269,10 +319,16 @@ public class EflObjectElementTraits<T> : IBaseElementTraits<T>
public T NativeToManagedInplace(IntPtr nat)
{
if (nat == IntPtr.Zero)
+ {
return default(T);
+ }
+
nat = Marshal.ReadIntPtr(nat);
if (nat == IntPtr.Zero)
+ {
return default(T);
+ }
+
return NativeToManaged(nat);
}
@@ -355,6 +411,7 @@ public abstract class PrimitiveElementTraits<T>
Eina.Log.Error("Null pointer on primitive/struct container.");
return default(T);
}
+
return PrimitiveConversion.PointerToManaged<T>(nat);
}
@@ -371,7 +428,7 @@ public abstract class PrimitiveElementTraits<T>
private int PrimitiveCompareCb(IntPtr ptr1, IntPtr ptr2)
{
- var m1 = (IComparable) NativeToManaged(ptr1);
+ var m1 = (IComparable)NativeToManaged(ptr1);
var m2 = NativeToManaged(ptr2);
return m1.CompareTo(m2);
}
@@ -379,7 +436,10 @@ public abstract class PrimitiveElementTraits<T>
public IntPtr EinaCompareCb()
{
if (dlgt == null)
+ {
dlgt = new Eina_Compare_Cb(PrimitiveCompareCb);
+ }
+
return Marshal.GetFunctionPointerForDelegate(dlgt);
}
@@ -406,10 +466,16 @@ abstract public class Primitive32ElementTraits<T> : PrimitiveElementTraits<T>, I
public Primitive32ElementTraits()
{
if (int32Traits == null)
+ {
if (typeof(T) == typeof(Int32)) // avoid infinite recursion
+ {
int32Traits = (IBaseElementTraits<Int32>)this;
+ }
else
+ {
int32Traits = TraitFunctions.GetTypeTraits<Int32>();
+ }
+ }
}
public abstract void ManagedToNativeCopyTo(T man, IntPtr mem);
@@ -438,10 +504,16 @@ abstract public class Primitive64ElementTraits<T> : PrimitiveElementTraits<T>, I
public Primitive64ElementTraits()
{
if (int64Traits == null)
+ {
if (typeof(T) == typeof(Int64)) // avoid infinite recursion
+ {
int64Traits = (IBaseElementTraits<Int64>)this;
+ }
else
+ {
int64Traits = TraitFunctions.GetTypeTraits<Int64>();
+ }
+ }
}
public abstract void ManagedToNativeCopyTo(T man, IntPtr mem);
@@ -471,6 +543,7 @@ public class IntElementTraits : Primitive32ElementTraits<int>, IBaseElementTrait
arr[0] = man;
Marshal.Copy(arr, 0, mem, 1);
}
+
override public int NativeToManagedInlistNode(IntPtr nat)
{
if (nat == IntPtr.Zero)
@@ -478,6 +551,7 @@ public class IntElementTraits : Primitive32ElementTraits<int>, IBaseElementTrait
Eina.Log.Error("Null pointer for Inlist node.");
return default(int);
}
+
IntPtr loc = nat + Marshal.SizeOf<InlistMem>();
var v = new int[1];
Marshal.Copy(loc, v, 0, 1);
@@ -493,6 +567,7 @@ public class CharElementTraits : Primitive32ElementTraits<char>, IBaseElementTra
arr[0] = man;
Marshal.Copy(arr, 0, mem, 1);
}
+
override public char NativeToManagedInlistNode(IntPtr nat)
{
if (nat == IntPtr.Zero)
@@ -500,12 +575,14 @@ public class CharElementTraits : Primitive32ElementTraits<char>, IBaseElementTra
Eina.Log.Error("Null pointer for Inlist node.");
return default(char);
}
+
IntPtr loc = nat + Marshal.SizeOf<InlistMem>();
var v = new char[1];
Marshal.Copy(loc, v, 0, 1);
return v[0];
}
}
+
public class LongElementTraits : Primitive64ElementTraits<long>, IBaseElementTraits<long>
{
override public void ManagedToNativeCopyTo(long man, IntPtr mem)
@@ -514,6 +591,7 @@ public class LongElementTraits : Primitive64ElementTraits<long>, IBaseElementTra
arr[0] = man;
Marshal.Copy(arr, 0, mem, 1);
}
+
override public long NativeToManagedInlistNode(IntPtr nat)
{
if (nat == IntPtr.Zero)
@@ -521,6 +599,7 @@ public class LongElementTraits : Primitive64ElementTraits<long>, IBaseElementTra
Eina.Log.Error("Null pointer for Inlist node.");
return default(long);
}
+
IntPtr loc = nat + Marshal.SizeOf<InlistMem>();
var v = new long[1];
Marshal.Copy(loc, v, 0, 1);
@@ -536,6 +615,7 @@ public class ShortElementTraits : Primitive32ElementTraits<short>, IBaseElementT
arr[0] = man;
Marshal.Copy(arr, 0, mem, 1);
}
+
override public short NativeToManagedInlistNode(IntPtr nat)
{
if (nat == IntPtr.Zero)
@@ -543,6 +623,7 @@ public class ShortElementTraits : Primitive32ElementTraits<short>, IBaseElementT
Eina.Log.Error("Null pointer for Inlist node.");
return default(short);
}
+
IntPtr loc = nat + Marshal.SizeOf<InlistMem>();
var v = new short[1];
Marshal.Copy(loc, v, 0, 1);
@@ -558,6 +639,7 @@ public class FloatElementTraits : Primitive32ElementTraits<float>, IBaseElementT
arr[0] = man;
Marshal.Copy(arr, 0, mem, 1);
}
+
override public float NativeToManagedInlistNode(IntPtr nat)
{
if (nat == IntPtr.Zero)
@@ -565,6 +647,7 @@ public class FloatElementTraits : Primitive32ElementTraits<float>, IBaseElementT
Eina.Log.Error("Null pointer for Inlist node.");
return default(float);
}
+
IntPtr loc = nat + Marshal.SizeOf<InlistMem>();
var v = new float[1];
Marshal.Copy(loc, v, 0, 1);
@@ -580,6 +663,7 @@ public class DoubleElementTraits : Primitive64ElementTraits<double>, IBaseElemen
arr[0] = man;
Marshal.Copy(arr, 0, mem, 1);
}
+
override public double NativeToManagedInlistNode(IntPtr nat)
{
if (nat == IntPtr.Zero)
@@ -587,6 +671,7 @@ public class DoubleElementTraits : Primitive64ElementTraits<double>, IBaseElemen
Eina.Log.Error("Null pointer for Inlist node.");
return default(double);
}
+
IntPtr loc = nat + Marshal.SizeOf<InlistMem>();
var v = new double[1];
Marshal.Copy(loc, v, 0, 1);
@@ -602,6 +687,7 @@ public class ByteElementTraits : Primitive32ElementTraits<byte>, IBaseElementTra
arr[0] = man;
Marshal.Copy(arr, 0, mem, 1);
}
+
override public byte NativeToManagedInlistNode(IntPtr nat)
{
if (nat == IntPtr.Zero)
@@ -609,6 +695,7 @@ public class ByteElementTraits : Primitive32ElementTraits<byte>, IBaseElementTra
Eina.Log.Error("Null pointer for Inlist node.");
return default(byte);
}
+
IntPtr loc = nat + Marshal.SizeOf<InlistMem>();
var v = new byte[1];
Marshal.Copy(loc, v, 0, 1);
@@ -631,11 +718,17 @@ public static class TraitFunctions
public static Eina.ElementType GetElementTypeCode(System.Type type)
{
if (IsEflObject(type))
+ {
return ElementType.ObjectType;
+ }
else if (IsString(type))
+ {
return ElementType.StringType;
+ }
else
+ {
return ElementType.NumericType;
+ }
}
private static IDictionary<System.Type, object> register = new Dictionary<System.Type, object>();
@@ -643,7 +736,9 @@ public static class TraitFunctions
private static System.Type AsEflInstantiableType(System.Type type)
{
if (!IsEflObject(type))
+ {
return null;
+ }
if (type.IsInterface)
{
@@ -663,32 +758,55 @@ public static class TraitFunctions
{
System.Type concrete = AsEflInstantiableType(type);
if (concrete == null || !type.IsAssignableFrom(concrete))
+ {
throw new Exception("Failed to get a suitable concrete class for this type.");
+ }
+
traits = new EflObjectElementTraits<T>(concrete);
}
else if (IsString(type))
+ {
traits = new StringElementTraits();
+ }
else if (type.IsValueType)
{
if (type == typeof(int))
+ {
traits = new IntElementTraits();
+ }
else if (type == typeof(char))
+ {
traits = new CharElementTraits();
+ }
else if (type == typeof(long))
+ {
traits = new LongElementTraits();
+ }
else if (type == typeof(short))
+ {
traits = new ShortElementTraits();
+ }
else if (type == typeof(float))
+ {
traits = new FloatElementTraits();
+ }
else if (type == typeof(double))
+ {
traits = new DoubleElementTraits();
+ }
else if (type == typeof(byte))
+ {
traits = new ByteElementTraits();
+ }
else
+ {
throw new Exception("No traits registered for this type");
+ }
}
else
+ {
throw new Exception("No traits registered for this type");
+ }
register[type] = traits;
return traits;
@@ -704,8 +822,11 @@ public static class TraitFunctions
{
object traits;
if (!register.TryGetValue(typeof(T), out traits))
+ {
traits = RegisterTypeTraits<T>();
- return (IBaseElementTraits<T>) traits;
+ }
+
+ return (IBaseElementTraits<T>)traits;
}
// //
diff --git a/src/bindings/mono/eina_mono/eina_error.cs b/src/bindings/mono/eina_mono/eina_error.cs
index 07760fd395..0247cb64db 100644
--- a/src/bindings/mono/eina_mono/eina_error.cs
+++ b/src/bindings/mono/eina_mono/eina_error.cs
@@ -3,7 +3,8 @@
using System;
using System.Runtime.InteropServices;
-namespace Eina {
+namespace Eina
+{
public struct Error : IComparable<Error>
{
@@ -21,19 +22,26 @@ public struct Error : IComparable<Error>
public static Error ENOENT = new Error(2);
public static Error ECANCELED = new Error(125);
- public Error(int value) { code = value; }
+ public Error(int value)
+ {
+ code = value;
+ }
+
static public implicit operator Error(int val)
{
return new Error(val);
}
+
static public implicit operator int(Error error)
{
return error.code;
}
+
public int CompareTo(Error err)
{
return code.CompareTo(err.code);
}
+
public override string ToString()
{
return "Eina.Error(" + code + ")";
@@ -80,7 +88,9 @@ public struct Error : IComparable<Error>
public static void Raise(Error e)
{
if (e != 0)
+ {
throw (new Efl.EflException(MsgGet(e)));
+ }
}
public static void Clear()
@@ -93,4 +103,5 @@ public struct Error : IComparable<Error>
return eina_error_msg_register(msg);
}
}
+
}
diff --git a/src/bindings/mono/eina_mono/eina_hash.cs b/src/bindings/mono/eina_mono/eina_hash.cs
index 95de7c5cb2..9659a809fd 100644
--- a/src/bindings/mono/eina_mono/eina_hash.cs
+++ b/src/bindings/mono/eina_mono/eina_hash.cs
@@ -137,8 +137,10 @@ public class Hash<TKey, TValue> : IEnumerable<KeyValuePair<TKey, TValue>>, IDi
public bool OwnKey {get; set;}
public bool OwnValue {get; set;}
- public int Count {
- get {
+ public int Count
+ {
+ get
+ {
return Population();
}
}
@@ -179,10 +181,14 @@ public class Hash<TKey, TValue> : IEnumerable<KeyValuePair<TKey, TValue>>, IDi
IntPtr h = Handle;
Handle = IntPtr.Zero;
if (h == IntPtr.Zero)
+ {
return;
+ }
if (Own)
+ {
eina_hash_free(h);
+ }
}
public void Dispose()
@@ -218,7 +224,9 @@ public class Hash<TKey, TValue> : IEnumerable<KeyValuePair<TKey, TValue>>, IDi
OwnValue = ownValue;
if (ownValue)
+ {
eina_hash_free_cb_set(Handle, EinaFreeCb<TValue>());
+ }
}
public void SetOwnership(bool ownAll)
@@ -289,7 +297,9 @@ public class Hash<TKey, TValue> : IEnumerable<KeyValuePair<TKey, TValue>>, IDi
//NativeFreeRef<TKey>(nk);
FreeNativeIndirection<TKey>(gchnk, ForceRefKey<TKey>());
if (found == IntPtr.Zero)
+ {
throw new KeyNotFoundException();
+ }
return NativeToManaged<TValue>(IndirectNative<TValue>(found, false));
}
@@ -305,6 +315,7 @@ public class Hash<TKey, TValue> : IEnumerable<KeyValuePair<TKey, TValue>>, IDi
val = default(TValue);
return false;
}
+
val = NativeToManaged<TValue>(IndirectNative<TValue>(found, false));
return true;
}
@@ -334,8 +345,12 @@ public class Hash<TKey, TValue> : IEnumerable<KeyValuePair<TKey, TValue>>, IDi
NativeFree<TValue>(nv);
return false;
}
+
if (OwnValue)
+ {
NativeFree<TValue>(old);
+ }
+
return true;
}
@@ -355,7 +370,7 @@ public class Hash<TKey, TValue> : IEnumerable<KeyValuePair<TKey, TValue>>, IDi
return GCHandle.ToIntPtr(gch);
}
- else if(IsEflObject(typeof(T)) && forceRef)
+ else if (IsEflObject(typeof(T)) && forceRef)
{
GCHandle gch = GCHandle.Alloc(new byte[Marshal.SizeOf<IntPtr>()], GCHandleType.Pinned);
IntPtr pin = gch.AddrOfPinnedObject();
@@ -369,6 +384,7 @@ public class Hash<TKey, TValue> : IEnumerable<KeyValuePair<TKey, TValue>>, IDi
return ManagedToNativeAlloc(value);
}
}
+
private static IntPtr GetNativePtr<T>(IntPtr gchptr, bool forceRef)
{
if (forceRef)
@@ -383,6 +399,7 @@ public class Hash<TKey, TValue> : IEnumerable<KeyValuePair<TKey, TValue>>, IDi
return gchptr;
}
}
+
private static void FreeNativeIndirection<T>(IntPtr gchptr, bool forceRef)
{
if (forceRef)
@@ -416,7 +433,9 @@ public class Hash<TKey, TValue> : IEnumerable<KeyValuePair<TKey, TValue>>, IDi
FreeNativeIndirection<TKey>(gchnk, ForceRefKey<TKey>());
FreeNativeIndirection<TValue>(gchnv, false);
if (OwnValue || old != IntPtr.Zero)
+ {
NativeFree<TValue>(old);
+ }
}
public TValue this[TKey key]
@@ -494,4 +513,3 @@ public class Hash<TKey, TValue> : IEnumerable<KeyValuePair<TKey, TValue>>, IDi
}
}
-
diff --git a/src/bindings/mono/eina_mono/eina_inarray.cs b/src/bindings/mono/eina_mono/eina_inarray.cs
index a99acc8371..987b46600f 100644
--- a/src/bindings/mono/eina_mono/eina_inarray.cs
+++ b/src/bindings/mono/eina_mono/eina_inarray.cs
@@ -7,7 +7,8 @@ using System.Collections.Generic;
using static Eina.TraitFunctions;
using static Eina.InarrayNativeFunctions;
-namespace Eina {
+namespace Eina
+{
public static class InarrayNativeFunctions
{
@@ -86,7 +87,9 @@ public class Inarray<T> : IEnumerable<T>, IDisposable
Own = true;
OwnContent = true;
if (Handle == IntPtr.Zero)
+ {
throw new SEHException("Could not alloc inarray");
+ }
}
public Inarray()
@@ -123,19 +126,23 @@ public class Inarray<T> : IEnumerable<T>, IDisposable
IntPtr h = Handle;
Handle = IntPtr.Zero;
if (h == IntPtr.Zero)
+ {
return;
+ }
if (OwnContent)
{
uint len = eina_inarray_count(h);
- for(uint i = 0; i < len; ++i)
+ for (uint i = 0; i < len; ++i)
{
NativeFreeInplace<T>(eina_inarray_nth(h, i));
}
}
if (Own)
+ {
eina_inarray_free(h);
+ }
}
public void Dispose()
@@ -176,7 +183,7 @@ public class Inarray<T> : IEnumerable<T>, IDisposable
public int Count()
{
- return (int) eina_inarray_count(Handle);
+ return (int)eina_inarray_count(Handle);
}
public void SetOwnership(bool ownAll)
@@ -201,7 +208,10 @@ public class Inarray<T> : IEnumerable<T>, IDisposable
var r = eina_inarray_push(Handle, ind);
if (r == -1)
+ {
NativeFreeInplace<T>(ele);
+ }
+
ResidueFreeInplace<T>(ele);
gch.Free();
return r;
@@ -211,7 +221,9 @@ public class Inarray<T> : IEnumerable<T>, IDisposable
// public void Add(T val)
// {
// if (!Push(val))
-// throw;
+// {
+// throw;
+// }
// }
public T Pop()
@@ -219,7 +231,10 @@ public class Inarray<T> : IEnumerable<T>, IDisposable
IntPtr ele = eina_inarray_pop(Handle);
var r = NativeToManagedInplace<T>(ele);
if (OwnContent && ele != IntPtr.Zero)
+ {
NativeFreeInplace<T>(ele);
+ }
+
return r;
}
@@ -244,7 +259,10 @@ public class Inarray<T> : IEnumerable<T>, IDisposable
var r = eina_inarray_insert_at(Handle, idx, ind);
if (!r)
+ {
NativeFreeInplace<T>(ele);
+ }
+
ResidueFreeInplace<T>(ele);
return r;
}
@@ -253,9 +271,15 @@ public class Inarray<T> : IEnumerable<T>, IDisposable
{
var old = eina_inarray_nth(Handle, idx);
if (old == IntPtr.Zero)
+ {
return false;
+ }
+
if (OwnContent)
+ {
NativeFreeInplace<T>(old);
+ }
+
var ele = IntPtr.Zero;
GCHandle gch = GCHandle.Alloc(ele, GCHandleType.Pinned);
IntPtr ind = gch.AddrOfPinnedObject();
@@ -283,9 +307,14 @@ public class Inarray<T> : IEnumerable<T>, IDisposable
{
IntPtr ele = eina_inarray_nth(Handle, idx);
if (ele == IntPtr.Zero)
+ {
return false;
+ }
+
if (OwnContent)
+ {
NativeFreeInplace<T>(ele);
+ }
return eina_inarray_remove_at(Handle, idx);
}
@@ -299,18 +328,24 @@ public class Inarray<T> : IEnumerable<T>, IDisposable
{
int len = Length;
var managed = new T[len];
- for(int i = 0; i < len; ++i)
+ for (int i = 0; i < len; ++i)
{
managed[i] = At(i);
}
+
return managed;
}
public bool Append(T[] values)
{
- foreach(T v in values)
+ foreach (T v in values)
+ {
if (Push(v) == -1)
+ {
return false;
+ }
+ }
+
return true;
}
@@ -327,7 +362,7 @@ public class Inarray<T> : IEnumerable<T>, IDisposable
public IEnumerator<T> GetEnumerator()
{
int len = Length;
- for(int i = 0; i < len; ++i)
+ for (int i = 0; i < len; ++i)
{
yield return At(i);
}
diff --git a/src/bindings/mono/eina_mono/eina_inlist.cs b/src/bindings/mono/eina_mono/eina_inlist.cs
index 0bf09d0b85..0cc9bae6a0 100644
--- a/src/bindings/mono/eina_mono/eina_inlist.cs
+++ b/src/bindings/mono/eina_mono/eina_inlist.cs
@@ -8,7 +8,8 @@ using static Eina.TraitFunctions;
using static Eina.InlistNativeFunctions;
using Eina.Callbacks;
-namespace Eina {
+namespace Eina
+{
public static class InlistNativeFunctions
{
@@ -111,11 +112,16 @@ public class Inlist<T> : IEnumerable<T>, IDisposable
private IntPtr InternalAt(int idx)
{
if (idx < 0)
+ {
return IntPtr.Zero;
+ }
IntPtr curr = Handle;
for (int n = 0; n != idx && curr != IntPtr.Zero; ++n)
+ {
curr = InternalNext(curr);
+ }
+
return curr;
}
@@ -159,11 +165,13 @@ public class Inlist<T> : IEnumerable<T>, IDisposable
IntPtr h = Handle;
Handle = IntPtr.Zero;
if (h == IntPtr.Zero)
+ {
return;
+ }
if (OwnContent)
{
- for(IntPtr curr = h; curr != IntPtr.Zero; curr = InternalNext(curr))
+ for (IntPtr curr = h; curr != IntPtr.Zero; curr = InternalNext(curr))
{
NativeFreeInlistNodeElement<T>(curr);
}
@@ -212,7 +220,7 @@ public class Inlist<T> : IEnumerable<T>, IDisposable
public int Count()
{
- return (int) eina_inlist_count(Handle);
+ return (int)eina_inlist_count(Handle);
}
public void Clean()
@@ -248,7 +256,10 @@ public class Inlist<T> : IEnumerable<T>, IDisposable
{
IntPtr node = InternalAt(idx);
if (node == IntPtr.Zero)
+ {
throw new IndexOutOfRangeException();
+ }
+
return NativeToManagedInlistNode<T>(node);
}
@@ -256,7 +267,9 @@ public class Inlist<T> : IEnumerable<T>, IDisposable
{
IntPtr old = InternalAt(idx);
if (old == IntPtr.Zero)
+ {
throw new IndexOutOfRangeException();
+ }
IntPtr new_node = ManagedToNativeAllocInlistNode(val);
@@ -282,17 +295,20 @@ public class Inlist<T> : IEnumerable<T>, IDisposable
{
var managed = new T[Count()];
int i = 0;
- for(IntPtr curr = Handle; curr != IntPtr.Zero; ++i, curr = InternalNext(curr))
+ for (IntPtr curr = Handle; curr != IntPtr.Zero; ++i, curr = InternalNext(curr))
{
managed[i] = NativeToManagedInlistNode<T>(curr);
}
+
return managed;
}
public void AppendArray(T[] values)
{
foreach (T v in values)
+ {
Append(v);
+ }
}
@@ -303,7 +319,7 @@ public class Inlist<T> : IEnumerable<T>, IDisposable
public IEnumerator<T> GetEnumerator()
{
- for(IntPtr curr = Handle; curr != IntPtr.Zero; curr = InternalNext(curr))
+ for (IntPtr curr = Handle; curr != IntPtr.Zero; curr = InternalNext(curr))
{
yield return NativeToManagedInlistNode<T>(curr);
}
diff --git a/src/bindings/mono/eina_mono/eina_iterator.cs b/src/bindings/mono/eina_mono/eina_iterator.cs
index 56ebab3f0c..c8f61410ce 100644
--- a/src/bindings/mono/eina_mono/eina_iterator.cs
+++ b/src/bindings/mono/eina_mono/eina_iterator.cs
@@ -7,7 +7,8 @@ using System.Collections.Generic;
using static Eina.TraitFunctions;
using static Eina.IteratorNativeFunctions;
-namespace Eina {
+namespace Eina
+{
public static class IteratorNativeFunctions
{
@@ -58,18 +59,22 @@ public class Iterator<T> : IEnumerable<T>, IDisposable
var h = Handle;
Handle = IntPtr.Zero;
if (h == IntPtr.Zero)
+ {
return;
+ }
if (OwnContent)
{
- for(IntPtr data; eina_iterator_next(h, out data);)
+ for (IntPtr data; eina_iterator_next(h, out data);)
{
NativeFree<T>(data);
}
}
if (Own)
+ {
eina_iterator_free(h);
+ }
}
public void Dispose()
@@ -114,7 +119,9 @@ public class Iterator<T> : IEnumerable<T>, IDisposable
res = NativeToManaged<T>(data);
if (OwnContent)
+ {
NativeFree<T>(data);
+ }
return true;
}
@@ -131,7 +138,7 @@ public class Iterator<T> : IEnumerable<T>, IDisposable
public IEnumerator<T> GetEnumerator()
{
- for(T curr; Next(out curr);)
+ for (T curr; Next(out curr);)
{
yield return curr;
}
diff --git a/src/bindings/mono/eina_mono/eina_list.cs b/src/bindings/mono/eina_mono/eina_list.cs
index 8ad4a2f6cf..fe956508b8 100644
--- a/src/bindings/mono/eina_mono/eina_list.cs
+++ b/src/bindings/mono/eina_mono/eina_list.cs
@@ -8,7 +8,8 @@ using static Eina.TraitFunctions;
using static Eina.ListNativeFunctions;
using Eina.Callbacks;
-namespace Eina {
+namespace Eina
+{
public static class ListNativeFunctions
{
@@ -175,18 +176,22 @@ public class List<T> : IEnumerable<T>, IDisposable
IntPtr h = Handle;
Handle = IntPtr.Zero;
if (h == IntPtr.Zero)
+ {
return;
+ }
if (OwnContent)
{
- for(IntPtr curr = h; curr != IntPtr.Zero; curr = InternalNext(curr))
+ for (IntPtr curr = h; curr != IntPtr.Zero; curr = InternalNext(curr))
{
NativeFree<T>(InternalDataGet(curr));
}
}
if (Own)
+ {
eina_list_free(h);
+ }
}
public void Dispose()
@@ -221,7 +226,7 @@ public class List<T> : IEnumerable<T>, IDisposable
public int Count()
{
- return (int) eina_list_count_custom_export_mono(Handle);
+ return (int)eina_list_count_custom_export_mono(Handle);
}
public void Append(T val)
@@ -274,9 +279,15 @@ public class List<T> : IEnumerable<T>, IDisposable
{
IntPtr pos = eina_list_nth_list(Handle, (uint)idx);
if (pos == IntPtr.Zero)
+ {
throw new IndexOutOfRangeException();
+ }
+
if (OwnContent)
+ {
NativeFree<T>(InternalDataGet(pos));
+ }
+
IntPtr ele = ManagedToNativeAlloc(val);
InternalDataSet(pos, ele);
}
@@ -314,17 +325,20 @@ public class List<T> : IEnumerable<T>, IDisposable
{
var managed = new T[Count()];
int i = 0;
- for(IntPtr curr = Handle; curr != IntPtr.Zero; curr = InternalNext(curr), ++i)
+ for (IntPtr curr = Handle; curr != IntPtr.Zero; curr = InternalNext(curr), ++i)
{
managed[i] = NativeToManaged<T>(InternalDataGet(curr));
}
+
return managed;
}
public void AppendArray(T[] values)
{
foreach (T v in values)
+ {
Append(v);
+ }
}
@@ -340,7 +354,7 @@ public class List<T> : IEnumerable<T>, IDisposable
public IEnumerator<T> GetEnumerator()
{
- for(IntPtr curr = Handle; curr != IntPtr.Zero; curr = InternalNext(curr))
+ for (IntPtr curr = Handle; curr != IntPtr.Zero; curr = InternalNext(curr))
{
yield return NativeToManaged<T>(InternalDataGet(curr));
}
diff --git a/src/bindings/mono/eina_mono/eina_log.cs b/src/bindings/mono/eina_mono/eina_log.cs
index c17f02b8e5..56882b9000 100644
--- a/src/bindings/mono/eina_mono/eina_log.cs
+++ b/src/bindings/mono/eina_mono/eina_log.cs
@@ -5,7 +5,9 @@ using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
using System.Diagnostics.Contracts;
-namespace Eina { // Manual wrappers around eina functions
+namespace Eina
+{
+// Manual wrappers around eina functions
public class Log
{
@@ -55,44 +57,54 @@ public class Log
static Log()
{
- const String name="mono";
- const String color="\033[32;1m";
+ const String name = "mono";
+ const String color = "\033[32;1m";
// Maybe move this check outside when other eina stuff get support?
domain = eina_log_domain_register(name, color);
if (domain < 0)
- Console.WriteLine("Error: Couldn't register Eina log domain for name {0}.", name);
+ {
+ Console.WriteLine("Error: Couldn't register Eina log domain for name {0}.", name);
+ }
else
- Info($"Registered mono domain with number {domain}");
+ {
+ Info($"Registered mono domain with number {domain}");
+ }
}
private static void EnsureDomainRegistered()
{
if (domain < 0)
- throw new InvalidOperationException("Log domain is not registered.");
+ {
+ throw new InvalidOperationException("Log domain is not registered.");
+ }
}
- public static void Critical(String message, [CallerLineNumber] int line=0, [CallerFilePath] string file=null, [CallerMemberName] string member = null)
+ public static void Critical(String message, [CallerLineNumber] int line = 0, [CallerFilePath] string file = null, [CallerMemberName] string member = null)
{
EnsureDomainRegistered();
eina_log_print(domain, Level.Critical, file, member, line, message);
}
- public static void Error(String message, [CallerLineNumber] int line=0, [CallerFilePath] string file=null, [CallerMemberName] string member = null)
+
+ public static void Error(String message, [CallerLineNumber] int line = 0, [CallerFilePath] string file = null, [CallerMemberName] string member = null)
{
EnsureDomainRegistered();
eina_log_print(domain, Level.Error, file, member, line, message);
}
- public static void Warning(String message, [CallerLineNumber] int line=0, [CallerFilePath] string file=null, [CallerMemberName] string member = null)
+
+ public static void Warning(String message, [CallerLineNumber] int line = 0, [CallerFilePath] string file = null, [CallerMemberName] string member = null)
{
EnsureDomainRegistered();
eina_log_print(domain, Level.Warning, file, member, line, message);
}
- public static void Info(String message, [CallerLineNumber] int line=0, [CallerFilePath] string file=null, [CallerMemberName] string member = null)
+
+ public static void Info(String message, [CallerLineNumber] int line = 0, [CallerFilePath] string file = null, [CallerMemberName] string member = null)
{
EnsureDomainRegistered();
eina_log_print(domain, Level.Info, file, member, line, message);
}
- public static void Debug(String message, [CallerLineNumber] int line=0, [CallerFilePath] string file=null, [CallerMemberName] string member = null)
+
+ public static void Debug(String message, [CallerLineNumber] int line = 0, [CallerFilePath] string file = null, [CallerMemberName] string member = null)
{
EnsureDomainRegistered();
eina_log_print(domain, Level.Debug, file, member, line, message);
@@ -108,4 +120,5 @@ public class Log
return eina_log_level_get();
}
}
+
}
diff --git a/src/bindings/mono/eina_mono/eina_promises.cs b/src/bindings/mono/eina_mono/eina_promises.cs
index 176a8835ae..c7b68fe7a9 100644
--- a/src/bindings/mono/eina_mono/eina_promises.cs
+++ b/src/bindings/mono/eina_mono/eina_promises.cs
@@ -6,9 +6,11 @@ using System.Linq;
using static Eina.EinaNative.PromiseNativeMethods;
-namespace Eina {
+namespace Eina
+{
-namespace EinaNative {
+namespace EinaNative
+{
static internal class PromiseNativeMethods
{
@@ -80,7 +82,7 @@ public class Promise : IDisposable
/// Currently, creating a promise directly uses the Main Loop scheduler the source of notifications (i.e. the
/// future callbacks will be called mainly from a loop iteration).
/// </summary>
- public Promise(CancelCb cancelCb=null)
+ public Promise(CancelCb cancelCb = null)
{
Efl.Loop loop = Efl.App.AppMain;
@@ -90,10 +92,13 @@ public class Promise : IDisposable
IntPtr cb_data = IntPtr.Zero;
// A safety clean callback to mark this wrapper as invalid
- CancelCb safetyCb = () => {
+ CancelCb safetyCb = () =>
+ {
Handle = IntPtr.Zero;
if (cancelCb != null)
+ {
cancelCb();
+ }
};
CleanupHandle = GCHandle.Alloc(safetyCb);
@@ -105,14 +110,21 @@ public class Promise : IDisposable
private static void NativeCancelCb(IntPtr data, IntPtr dead)
{
if (data == IntPtr.Zero)
+ {
return;
+ }
GCHandle handle = GCHandle.FromIntPtr(data);
CancelCb cb = handle.Target as CancelCb;
if (cb != null)
+ {
cb();
+ }
else
+ {
Eina.Log.Info("Null promise CancelCb found");
+ }
+
handle.Free();
}
@@ -144,7 +156,9 @@ public class Promise : IDisposable
private void SanityChecks()
{
if (this.Handle == IntPtr.Zero)
+ {
throw new ObjectDisposedException(GetType().Name);
+ }
}
/// <summary>
@@ -200,7 +214,8 @@ public class Future
/// </summary>
public Future(IntPtr handle)
{
- Handle = ThenRaw(handle, (Eina.Value value) => {
+ Handle = ThenRaw(handle, (Eina.Value value) =>
+ {
Handle = IntPtr.Zero;
return value;
});
@@ -212,12 +227,16 @@ public class Future
/// Optionally a resolved callback may be provided. If so, it will be chained
/// before the returned future.
/// </summary>
- public Future(Promise promise, ResolvedCb cb=null)
+ public Future(Promise promise, ResolvedCb cb = null)
{
IntPtr intermediate = eina_future_new(promise.Handle);
- Handle = ThenRaw(intermediate, (Eina.Value value) => {
+ Handle = ThenRaw(intermediate, (Eina.Value value) =>
+ {
if (cb != null)
+ {
value = cb(value);
+ }
+
Handle = IntPtr.Zero;
return value;
});
@@ -226,7 +245,9 @@ public class Future
private void SanityChecks()
{
if (this.Handle == IntPtr.Zero)
+ {
throw new ObjectDisposedException(GetType().Name);
+ }
}
/// <summary>
@@ -266,14 +287,20 @@ public class Future
desc.data = GCHandle.ToIntPtr(handle);
return eina_future_then_from_desc(previous, desc);
}
+
private static Eina.ValueNative NativeResolvedCb(IntPtr data, Eina.ValueNative value, IntPtr dead_future)
{
GCHandle handle = GCHandle.FromIntPtr(data);
ResolvedCb cb = handle.Target as ResolvedCb;
if (cb != null)
+ {
value = cb(value);
+ }
else
+ {
Eina.Log.Warning("Failed to get future callback.");
+ }
+
handle.Free();
return value;
}
@@ -308,14 +335,18 @@ public class Future
for (int j = 0; j <= i; j++)
{
if (descs[i].data == IntPtr.Zero)
+ {
continue;
+ }
GCHandle handle = GCHandle.FromIntPtr(descs[i].data);
handle.Free();
}
+
Eina.Log.Error($"Failed to create native future description for callbacks. Error: {e.ToString()}");
return null;
}
+
return new Future(eina_future_chain_array(Handle, descs));
}
}
@@ -341,17 +372,24 @@ public class FutureMarshaler : ICustomMarshaler
{
Future f = managedObj as Future;
if (f == null)
+ {
return IntPtr.Zero;
+ }
+
return f.Handle;
}
///<summary>Not implemented. The code receiving the native data is in charge of releasing it.</summary>
///<param name="pNativeData">The native pointer to be released.</param>
- public void CleanUpNativeData(IntPtr pNativeData) { }
+ public void CleanUpNativeData(IntPtr pNativeData)
+ {
+ }
///<summary>Not implemented. The runtime takes care of releasing it.</summary>
///<param name="managedObj">The managed object to be cleaned.</param>
- public void CleanUpManagedData(object managedObj) { }
+ public void CleanUpManagedData(object managedObj)
+ {
+ }
///<summary>Size of the native data size returned</summary>
///<returns>The size of the data.</returns>
@@ -363,9 +401,13 @@ public class FutureMarshaler : ICustomMarshaler
///<summary>Gets an instance of this marshaller.</summary>
///<param name="cookie">A name that could be used to customize the returned marshaller. Currently not used.</param>
///<returns>The <see cref="Eina.FutureMarshaler"/> instance that will marshall the data.</returns>
- public static ICustomMarshaler GetInstance(string cookie) {
+ public static ICustomMarshaler GetInstance(string cookie)
+ {
if (marshaler == null)
+ {
marshaler = new FutureMarshaler();
+ }
+
return marshaler;
}
diff --git a/src/bindings/mono/eina_mono/eina_slice.cs b/src/bindings/mono/eina_mono/eina_slice.cs
index 649ffc5d98..cb6249c019 100644
--- a/src/bindings/mono/eina_mono/eina_slice.cs
+++ b/src/bindings/mono/eina_mono/eina_slice.cs
@@ -3,7 +3,8 @@
using System;
using System.Runtime.InteropServices;
-namespace Eina {
+namespace Eina
+{
public interface ISliceBase
{
@@ -21,8 +22,8 @@ public struct Slice : ISliceBase
public int Length
{
- get { return (int) Len; }
- set { Len = (UIntPtr) value; }
+ get { return (int)Len; }
+ set { Len = (UIntPtr)value; }
}
public Slice(IntPtr mem, UIntPtr len)
@@ -47,8 +48,8 @@ public struct RwSlice : ISliceBase
public int Length
{
- get { return (int) Len; }
- set { Len = (UIntPtr) value; }
+ get { return (int)Len; }
+ set { Len = (UIntPtr)value; }
}
public RwSlice(IntPtr mem, UIntPtr len)
diff --git a/src/bindings/mono/eina_mono/eina_strbuf.cs b/src/bindings/mono/eina_mono/eina_strbuf.cs
index 9d7a982abb..5b25ff15de 100644
--- a/src/bindings/mono/eina_mono/eina_strbuf.cs
+++ b/src/bindings/mono/eina_mono/eina_strbuf.cs
@@ -5,8 +5,10 @@ using static Eina.EinaNative.StrbufNativeMethods;
namespace Eina
{
+
namespace EinaNative
{
+
static internal class StrbufNativeMethods
{
[DllImport(efl.Libs.Eina)]
@@ -48,7 +50,7 @@ public class Strbuf : IDisposable
private bool Disposed;
///<summary>Creates a new Strbuf. By default its lifetime is managed.</summary>
- public Strbuf(Ownership ownership=Ownership.Managed)
+ public Strbuf(Ownership ownership = Ownership.Managed)
{
this.Handle = eina_strbuf_new();
this.Ownership = ownership;
@@ -89,9 +91,11 @@ public class Strbuf : IDisposable
return;
}
- if (!Disposed && (Handle != IntPtr.Zero)) {
+ if (!Disposed && (Handle != IntPtr.Zero))
+ {
eina_strbuf_free(Handle);
}
+
Disposed = true;
}
@@ -115,7 +119,10 @@ public class Strbuf : IDisposable
public void Reset()
{
if (Disposed)
+ {
throw new ObjectDisposedException(base.GetType().Name);
+ }
+
eina_strbuf_reset(Handle);
}
@@ -123,7 +130,10 @@ public class Strbuf : IDisposable
public bool Append(string text)
{
if (Disposed)
+ {
throw new ObjectDisposedException(base.GetType().Name);
+ }
+
return eina_strbuf_append(Handle, text);
}
@@ -131,7 +141,10 @@ public class Strbuf : IDisposable
public bool AppendEscaped(string text)
{
if (Disposed)
+ {
throw new ObjectDisposedException(base.GetType().Name);
+ }
+
return eina_strbuf_append_escaped(Handle, text);
}
@@ -139,7 +152,10 @@ public class Strbuf : IDisposable
public bool Append(char c)
{
if (Disposed)
+ {
throw new ObjectDisposedException(base.GetType().Name);
+ }
+
return eina_strbuf_append_char(Handle, c);
}
@@ -147,10 +163,12 @@ public class Strbuf : IDisposable
public string Steal()
{
if (Disposed)
+ {
throw new ObjectDisposedException(base.GetType().Name);
+ }
+
return eina_strbuf_string_steal(Handle);
}
}
} // namespace eina
-
diff --git a/src/bindings/mono/eina_mono/eina_stringshare.cs b/src/bindings/mono/eina_mono/eina_stringshare.cs
index 83ea31ee6d..3b41bfbe3f 100644
--- a/src/bindings/mono/eina_mono/eina_stringshare.cs
+++ b/src/bindings/mono/eina_mono/eina_stringshare.cs
@@ -4,9 +4,11 @@ using System;
using System.Runtime.InteropServices;
-namespace Eina {
+namespace Eina
+{
-public class Stringshare {
+public class Stringshare
+{
[DllImport(efl.Libs.Eina)] public static extern System.IntPtr
eina_stringshare_add_length(string str, System.UInt32 slen);
[DllImport(efl.Libs.Eina)] public static extern System.IntPtr
@@ -16,4 +18,3 @@ public class Stringshare {
}
}
-
diff --git a/src/bindings/mono/eina_mono/eina_value.cs b/src/bindings/mono/eina_mono/eina_value.cs
index eedf478f8b..742dc4d366 100644
--- a/src/bindings/mono/eina_mono/eina_value.cs
+++ b/src/bindings/mono/eina_mono/eina_value.cs
@@ -14,9 +14,11 @@ using static Eina.EinaNative.UnsafeNativeMethods;
using static Eina.TraitFunctions;
-namespace Eina {
+namespace Eina
+{
-namespace EinaNative {
+namespace EinaNative
+{
// Structs to be passed from/to C when dealing with containers and
// optional values.
@@ -36,8 +38,8 @@ struct Value_List
}
[SuppressUnmanagedCodeSecurityAttribute]
-static internal class UnsafeNativeMethods {
-
+static internal class UnsafeNativeMethods
+{
[DllImport(efl.Libs.Eina)]
internal static extern IntPtr eina_value_new(IntPtr type);
@@ -526,13 +528,24 @@ public struct ValueNative
public class SetItemFailedException : Exception
{
/// <summary> Default constructor.</summary>
- public SetItemFailedException() : base () { }
+ public SetItemFailedException() : base()
+ {
+ }
+
/// <summary> Most commonly used contructor.</summary>
- public SetItemFailedException(string msg) : base(msg) { }
+ public SetItemFailedException(string msg) : base(msg)
+ {
+ }
+
/// <summary> Wraps an inner exception.</summary>
- public SetItemFailedException(string msg, Exception inner) : base(msg, inner) { }
+ public SetItemFailedException(string msg, Exception inner) : base(msg, inner)
+ {
+ }
+
/// <summary> Serializable constructor.</summary>
- protected SetItemFailedException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ protected SetItemFailedException(SerializationInfo info, StreamingContext context) : base(info, context)
+ {
+ }
}
/// <summary>Exception for methods that must have been called on a container.</summary>
@@ -540,18 +553,30 @@ public class SetItemFailedException : Exception
public class InvalidValueTypeException: Exception
{
/// <summary> Default constructor.</summary>
- public InvalidValueTypeException() : base () { }
+ public InvalidValueTypeException() : base()
+ {
+ }
+
/// <summary> Most commonly used contructor.</summary>
- public InvalidValueTypeException(string msg) : base(msg) { }
+ public InvalidValueTypeException(string msg) : base(msg)
+ {
+ }
+
/// <summary> Wraps an inner exception.</summary>
- public InvalidValueTypeException(string msg, Exception inner) : base(msg, inner) { }
+ public InvalidValueTypeException(string msg, Exception inner) : base(msg, inner)
+ {
+ }
+
/// <summary> Serializable constructor.</summary>
- protected InvalidValueTypeException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ protected InvalidValueTypeException(SerializationInfo info, StreamingContext context) : base(info, context)
+ {
+ }
}
/// <summary>Managed-side Enum to represent Eina_Value_Type constants</summary>
-public enum ValueType {
+public enum ValueType
+{
/// <summary>Signed 8 bit integer. Same as 'sbyte'</summary>
SByte,
/// <summary>Unsigned 8 bit integer. Same as 'byte'</summary>
@@ -592,10 +617,12 @@ public enum ValueType {
Empty,
}
-static class ValueTypeMethods {
+static class ValueTypeMethods
+{
public static bool IsNumeric(this ValueType val)
{
- switch (val) {
+ switch (val)
+ {
case ValueType.SByte:
case ValueType.Byte:
case ValueType.Short:
@@ -616,7 +643,8 @@ static class ValueTypeMethods {
public static bool IsString(this ValueType val)
{
- switch(val) {
+ switch (val)
+ {
case ValueType.String:
return true;
default:
@@ -626,7 +654,8 @@ static class ValueTypeMethods {
public static bool IsContainer(this ValueType val)
{
- switch(val) {
+ switch (val)
+ {
case ValueType.Array:
case ValueType.List:
case ValueType.Hash:
@@ -649,7 +678,8 @@ static class ValueTypeMethods {
/// <summary>Returns the Marshal.SizeOf for the given ValueType native structure.</summary>
public static int MarshalSizeOf(this ValueType val)
{
- switch (val) {
+ switch (val)
+ {
case ValueType.Array:
return Marshal.SizeOf(typeof(EinaNative.Value_Array));
case ValueType.List:
@@ -659,6 +689,7 @@ static class ValueTypeMethods {
}
}
}
+
static class ValueTypeBridge
{
private static Dictionary<ValueType, IntPtr> ManagedToNative = new Dictionary<ValueType, IntPtr>();
@@ -668,7 +699,9 @@ static class ValueTypeBridge
public static ValueType GetManaged(IntPtr native)
{
if (!TypesLoaded)
+ {
LoadTypes();
+ }
return NativeToManaged[native];
}
@@ -676,7 +709,9 @@ static class ValueTypeBridge
public static IntPtr GetNative(ValueType valueType)
{
if (!TypesLoaded)
+ {
LoadTypes();
+ }
return ManagedToNative[valueType];
}
@@ -779,14 +814,20 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
internal IntPtr Handle { get; set;}
+
/// <summary> Whether this wrapper owns (can free) the native value. </summary>
public Ownership Ownership { get; protected set;}
+
private bool Disposed;
+
/// <summary> Whether this is an Optional value (meaning it can have a value or not). </summary>
- public bool Optional {
- get {
+ public bool Optional
+ {
+ get
+ {
return GetValueType() == Eina.ValueType.Optional;
}
+
/* protected set {
// Should we expose this?
// Something like {
@@ -795,23 +836,32 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
// }
} */
}
+
/// <summary> Whether this wrapper is actually empty/uninitialized (zeroed). This is different from an empty optional value. </summary>
- public bool Empty {
- get {
+ public bool Empty
+ {
+ get
+ {
SanityChecks();
return GetValueType() == Eina.ValueType.Empty;
}
}
/// <summary> Whether this optional value is empty. </summary>
- public bool OptionalEmpty {
- get {
+ public bool OptionalEmpty
+ {
+ get
+ {
OptionalSanityChecks();
bool empty;
if (!eina_value_optional_empty_is_wrapper(this.Handle, out empty))
+ {
throw new System.InvalidOperationException("Couldn't get the empty information");
+ }
else
+ {
return empty;
+ }
}
}
@@ -826,12 +876,14 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
}
// Constructor to be used by the "FromContainerDesc" methods.
- private Value() {
+ private Value()
+ {
this.Handle = Alloc();
this.Ownership = Ownership.Managed;
}
- public Value(IntPtr handle, Ownership ownership=Ownership.Managed) {
+ public Value(IntPtr handle, Ownership ownership = Ownership.Managed)
+ {
this.Handle = handle;
this.Ownership = ownership;
}
@@ -840,11 +892,15 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
public Value(ValueType type)
{
if (type.IsContainer())
+ {
throw new ArgumentException("To use container types you must provide a subtype");
+ }
this.Handle = Alloc();
if (this.Handle == IntPtr.Zero)
+ {
throw new OutOfMemoryException("Failed to allocate memory for Eina.Value");
+ }
// Initialize to EINA_VALUE_EMPTY before performing any other operation on this value.
MemoryNative.Memset(this.Handle, 0, eina_value_sizeof());
@@ -854,10 +910,12 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
}
/// <summary>Constructor for container values, like Array, Hash.</summary>
- public Value(ValueType containerType, ValueType subtype, uint step=0)
+ public Value(ValueType containerType, ValueType subtype, uint step = 0)
{
if (!containerType.IsContainer())
+ {
throw new ArgumentException("First type must be a container type.");
+ }
this.Handle = Alloc();
this.Ownership = Ownership.Managed;
@@ -870,7 +928,9 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
{
Handle = Alloc();
if (!eina_value_copy(v.Handle, this.Handle))
+ {
throw new System.InvalidOperationException("Failed to copy value to managed memory.");
+ }
Disposed = false;
Ownership = Ownership.Managed;
@@ -880,10 +940,13 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
public Value(ValueNative value)
{
IntPtr tmp = IntPtr.Zero;
- try {
+ try
+ {
this.Handle = Alloc();
if (value.Type == IntPtr.Zero) // Got an EINA_VALUE_EMPTY by value.
+ {
MemoryNative.Memset(this.Handle, 0, Marshal.SizeOf(typeof(ValueNative)));
+ }
else
{
// We allocate this intermediate ValueNative using malloc to allow freeing with
@@ -895,14 +958,22 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
// Copy is used to deep copy the pointed payload (e.g. strings) inside this struct, so we can own this value.
if (!eina_value_copy(tmp, this.Handle))
+ {
throw new System.InvalidOperationException("Failed to copy value to managed memory.");
+ }
}
- } catch {
+ }
+ catch
+ {
Free(this.Handle);
throw;
- } finally {
+ }
+ finally
+ {
if (tmp != IntPtr.Zero)
+ {
MemoryNative.Free(tmp);
+ }
}
this.Ownership = Ownership.Managed;
@@ -912,77 +983,99 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
public Value(byte x) : this(ValueType.Byte)
{
if (!Set(x))
+ {
throw new InvalidOperationException("Couldn't set value.");
+ }
}
/// <summary>Type-specific constructor, for convenience.</summary>
public Value(sbyte x) : this(ValueType.SByte)
{
if (!Set(x))
+ {
throw new InvalidOperationException("Couldn't set value.");
+ }
}
/// <summary>Type-specific constructor, for convenience.</summary>
public Value(short x) : this(ValueType.Short)
{
if (!Set(x))
+ {
throw new InvalidOperationException("Couldn't set value.");
+ }
}
/// <summary>Type-specific constructor, for convenience.</summary>
public Value(ushort x) : this(ValueType.UShort)
{
if (!Set(x))
+ {
throw new InvalidOperationException("Couldn't set value.");
+ }
}
/// <summary>Type-specific constructor, for convenience.</summary>
public Value(int x) : this(ValueType.Int32)
{
if (!Set(x))
+ {
throw new InvalidOperationException("Couldn't set value.");
+ }
}
/// <summary>Type-specific constructor, for convenience.</summary>
public Value(uint x) : this(ValueType.UInt32)
{
if (!Set(x))
+ {
throw new InvalidOperationException("Couldn't set value.");
+ }
}
/// <summary>Type-specific constructor, for convenience.</summary>
public Value(long x) : this(ValueType.Long)
{
if (!Set(x))
+ {
throw new InvalidOperationException("Couldn't set value.");
+ }
}
/// <summary>Type-specific constructor, for convenience.</summary>
public Value(ulong x) : this(ValueType.ULong)
{
if (!Set(x))
+ {
throw new InvalidOperationException("Couldn't set value.");
+ }
}
/// <summary>Type-specific constructor, for convenience.</summary>
public Value(float x) : this(ValueType.Float)
{
if (!Set(x))
+ {
throw new InvalidOperationException("Couldn't set value.");
+ }
}
/// <summary>Type-specific constructor, for convenience.</summary>
public Value(double x) : this(ValueType.Double)
{
if (!Set(x))
+ {
throw new InvalidOperationException("Couldn't set value.");
+ }
}
/// <summary>Type-specific constructor, for convenience.</summary>
public Value(string x) : this(ValueType.String)
{
if (!Set(x))
+ {
throw new InvalidOperationException("Couldn't set value.");
+ }
}
/// <summary>Implicit conversion from managed value to native struct representation.</summary>
@@ -1002,7 +1095,10 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
{
var v = new Eina.Value(ValueType.Byte);
if (!v.Set(x))
+ {
throw new InvalidOperationException("Couldn't set value.");
+ }
+
return v;
}
@@ -1011,7 +1107,10 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
{
byte b;
if (!v.Get(out b))
+ {
throw new InvalidOperationException("Couldn't get value.");
+ }
+
return b;
}
@@ -1020,7 +1119,10 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
{
var v = new Eina.Value(ValueType.SByte);
if (!v.Set(x))
+ {
throw new InvalidOperationException("Couldn't set value.");
+ }
+
return v;
}
@@ -1029,7 +1131,10 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
{
sbyte b;
if (!v.Get(out b))
+ {
throw new InvalidOperationException("Couldn't get value.");
+ }
+
return b;
}
@@ -1038,7 +1143,10 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
{
var v = new Eina.Value(ValueType.Short);
if (!v.Set(x))
+ {
throw new InvalidOperationException("Couldn't set value.");
+ }
+
return v;
}
@@ -1047,7 +1155,10 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
{
short b;
if (!v.Get(out b))
+ {
throw new InvalidOperationException("Couldn't get value.");
+ }
+
return b;
}
@@ -1056,7 +1167,10 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
{
var v = new Eina.Value(ValueType.UShort);
if (!v.Set(x))
+ {
throw new InvalidOperationException("Couldn't set value.");
+ }
+
return v;
}
@@ -1065,7 +1179,10 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
{
ushort b;
if (!v.Get(out b))
+ {
throw new InvalidOperationException("Couldn't get value.");
+ }
+
return b;
}
@@ -1074,7 +1191,10 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
{
var v = new Eina.Value(ValueType.Int32);
if (!v.Set(x))
+ {
throw new InvalidOperationException("Couldn't set value.");
+ }
+
return v;
}
@@ -1083,7 +1203,10 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
{
int b;
if (!v.Get(out b))
+ {
throw new InvalidOperationException("Couldn't get value.");
+ }
+
return b;
}
@@ -1092,7 +1215,10 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
{
var v = new Eina.Value(ValueType.UInt32);
if (!v.Set(x))
+ {
throw new InvalidOperationException("Couldn't set value.");
+ }
+
return v;
}
@@ -1101,7 +1227,10 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
{
uint b;
if (!v.Get(out b))
+ {
throw new InvalidOperationException("Couldn't get value.");
+ }
+
return b;
}
@@ -1110,7 +1239,10 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
{
var v = new Eina.Value(ValueType.Long);
if (!v.Set(x))
+ {
throw new InvalidOperationException("Couldn't set value.");
+ }
+
return v;
}
@@ -1119,7 +1251,10 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
{
long b;
if (!v.Get(out b))
+ {
throw new InvalidOperationException("Couldn't get value.");
+ }
+
return b;
}
@@ -1128,7 +1263,10 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
{
var v = new Eina.Value(ValueType.ULong);
if (!v.Set(x))
+ {
throw new InvalidOperationException("Couldn't set value.");
+ }
+
return v;
}
@@ -1137,7 +1275,10 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
{
ulong b;
if (!v.Get(out b))
+ {
throw new InvalidOperationException("Couldn't get value.");
+ }
+
return b;
}
@@ -1146,7 +1287,10 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
{
var v = new Eina.Value(ValueType.Float);
if (!v.Set(x))
+ {
throw new InvalidOperationException("Couldn't set value.");
+ }
+
return v;
}
@@ -1155,7 +1299,10 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
{
float b;
if (!v.Get(out b))
+ {
throw new InvalidOperationException("Couldn't get value.");
+ }
+
return b;
}
@@ -1164,7 +1311,10 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
{
var v = new Eina.Value(ValueType.Double);
if (!v.Set(x))
+ {
throw new InvalidOperationException("Couldn't set value.");
+ }
+
return v;
}
@@ -1173,7 +1323,10 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
{
double b;
if (!v.Get(out b))
+ {
throw new InvalidOperationException("Couldn't get value.");
+ }
+
return b;
}
@@ -1182,7 +1335,10 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
{
var v = new Eina.Value(ValueType.String);
if (!v.Set(x))
+ {
throw new InvalidOperationException("Couldn't set value.");
+ }
+
return v;
}
@@ -1191,7 +1347,10 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
{
string b;
if (!v.Get(out b))
+ {
throw new InvalidOperationException("Couldn't get value.");
+ }
+
return b;
}
@@ -1237,15 +1396,18 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
/// <summary>Actually free the wrapped eina value. Can be called from Dispose() or through the GC.</summary>
protected virtual void Dispose(bool disposing)
{
- if (this.Ownership == Ownership.Unmanaged) {
+ if (this.Ownership == Ownership.Unmanaged)
+ {
Disposed = true;
return;
}
- if (!Disposed && (Handle != IntPtr.Zero)) {
+ if (!Disposed && (Handle != IntPtr.Zero))
+ {
// No need to call flush as eina_value_free already calls it for us.
Free(this.Handle);
}
+
Disposed = true;
}
@@ -1256,10 +1418,15 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
}
/// <summary>Returns the native handle wrapped by this object.</summary>
- public IntPtr NativeHandle {
- get {
+ public IntPtr NativeHandle
+ {
+ get
+ {
if (Disposed)
+ {
throw new ObjectDisposedException(base.GetType().Name);
+ }
+
return this.Handle;
}
}
@@ -1268,14 +1435,18 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
public bool Setup(ValueType type)
{
if (Disposed)
+ {
throw new ObjectDisposedException(base.GetType().Name);
+ }
// Can't call setup with Empty value type (would give an eina error)
if (type == Eina.ValueType.Empty)
{
// Need to cleanup as it may point to payload outside the underlying Eina_Value (like arrays and strings).
if (!Empty)
+ {
eina_value_flush_wrapper(this.Handle);
+ }
MemoryNative.Memset(this.Handle, 0, eina_value_sizeof());
@@ -1283,15 +1454,19 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
}
if (type.IsContainer())
+ {
throw new ArgumentException("To setup a container you must provide a subtype.");
+ }
return eina_value_setup_wrapper(this.Handle, ValueTypeBridge.GetNative(type));
}
- public bool Setup(ValueType containerType, ValueType subtype, uint step=0) {
+ public bool Setup(ValueType containerType, ValueType subtype, uint step = 0)
+ {
IntPtr native_subtype = ValueTypeBridge.GetNative(subtype);
bool ret = false;
- switch (containerType) {
+ switch (containerType)
+ {
case ValueType.Array:
ret = eina_value_array_setup_wrapper(this.Handle, native_subtype, step);
break;
@@ -1306,22 +1481,29 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
private void SanityChecks()
{
if (Disposed)
+ {
throw new ObjectDisposedException(GetType().Name);
+ }
}
- private void ContainerSanityChecks(int targetIndex=-1)
+ private void ContainerSanityChecks(int targetIndex = -1)
{
SanityChecks();
uint size = 0;
ValueType type = GetValueType();
if (!type.IsContainer())
+ {
throw new InvalidValueTypeException("Value type must be a container");
+ }
if (targetIndex == -1) // Some methods (e.g. append) don't care about size
+ {
return;
+ }
- switch (type) {
+ switch (type)
+ {
case ValueType.Array:
size = eina_value_array_count_wrapper(this.Handle);
break;
@@ -1331,8 +1513,10 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
}
if (targetIndex >= size)
+ {
throw new System.ArgumentOutOfRangeException(
$"Index {targetIndex} is larger than max array index {size-1}");
+ }
}
private void OptionalSanityChecks()
@@ -1341,7 +1525,9 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
ValueType type = GetValueType();
if (!type.IsOptional())
+ {
throw new InvalidValueTypeException("Value is not an Optional one");
+ }
}
/// <summary>Get a ValueNative struct with the *value* pointed by this Eina.Value.</summary>
@@ -1356,13 +1542,18 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
SanityChecks();
if (this.Optional)
+ {
return eina_value_optional_pset(this.Handle,
ValueTypeBridge.GetNative(ValueType.Byte),
ref value);
+ }
if (!GetValueType().IsNumeric())
+ {
throw (new ArgumentException(
"Trying to set numeric value on a non-numeric Eina.Value"));
+ }
+
return eina_value_set_wrapper_uchar(this.Handle, value);
}
@@ -1371,13 +1562,18 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
SanityChecks();
if (this.Optional)
+ {
return eina_value_optional_pset(this.Handle,
ValueTypeBridge.GetNative(ValueType.SByte),
ref value);
+ }
if (!GetValueType().IsNumeric())
+ {
throw (new ArgumentException(
"Trying to set numeric value on a non-numeric Eina.Value"));
+ }
+
return eina_value_set_wrapper_char(this.Handle, value);
}
@@ -1386,13 +1582,18 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
SanityChecks();
if (this.Optional)
+ {
return eina_value_optional_pset(this.Handle,
ValueTypeBridge.GetNative(ValueType.Short),
ref value);
+ }
if (!GetValueType().IsNumeric())
+ {
throw (new ArgumentException(
"Trying to set numeric value on a non-numeric Eina.Value"));
+ }
+
return eina_value_set_wrapper_short(this.Handle, value);
}
@@ -1401,13 +1602,18 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
SanityChecks();
if (this.Optional)
+ {
return eina_value_optional_pset(this.Handle,
ValueTypeBridge.GetNative(ValueType.UShort),
ref value);
+ }
if (!GetValueType().IsNumeric())
+ {
throw (new ArgumentException(
"Trying to set numeric value on a non-numeric Eina.Value"));
+ }
+
return eina_value_set_wrapper_ushort(this.Handle, value);
}
@@ -1417,13 +1623,18 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
SanityChecks();
if (this.Optional)
+ {
return eina_value_optional_pset(this.Handle,
ValueTypeBridge.GetNative(ValueType.UInt32),
ref value);
+ }
if (!GetValueType().IsNumeric())
+ {
throw (new ArgumentException(
"Trying to set numeric value on a non-numeric Eina.Value"));
+ }
+
return eina_value_set_wrapper_uint(this.Handle, value);
}
@@ -1433,13 +1644,18 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
SanityChecks();
if (this.Optional)
+ {
return eina_value_optional_pset(this.Handle,
ValueTypeBridge.GetNative(ValueType.Int32),
ref value);
+ }
if (!GetValueType().IsNumeric())
+ {
throw (new ArgumentException(
"Trying to set numeric value on a non-numeric Eina.Value"));
+ }
+
return eina_value_set_wrapper_int(this.Handle, value);
}
@@ -1449,13 +1665,18 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
SanityChecks();
if (this.Optional)
+ {
return eina_value_optional_pset(this.Handle,
ValueTypeBridge.GetNative(ValueType.ULong),
ref value);
+ }
if (!GetValueType().IsNumeric())
+ {
throw (new ArgumentException(
"Trying to set numeric value on a non-numeric Eina.Value"));
+ }
+
return eina_value_set_wrapper_ulong(this.Handle, value);
}
@@ -1465,13 +1686,18 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
SanityChecks();
if (this.Optional)
+ {
return eina_value_optional_pset(this.Handle,
ValueTypeBridge.GetNative(ValueType.Long),
ref value);
+ }
if (!GetValueType().IsNumeric())
+ {
throw (new ArgumentException(
"Trying to set numeric value on a non-numeric Eina.Value"));
+ }
+
return eina_value_set_wrapper_long(this.Handle, value);
}
@@ -1481,13 +1707,17 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
SanityChecks();
if (this.Optional)
+ {
return eina_value_optional_pset(this.Handle,
ValueTypeBridge.GetNative(ValueType.Float),
ref value);
+ }
if (!GetValueType().IsNumeric())
+ {
throw (new ArgumentException(
"Trying to set numeric value on a non-numeric Eina.Value"));
+ }
return eina_value_set_wrapper_float(this.Handle, value);
}
@@ -1498,13 +1728,18 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
SanityChecks();
if (this.Optional)
+ {
return eina_value_optional_pset(this.Handle,
ValueTypeBridge.GetNative(ValueType.Double),
ref value);
+ }
if (!GetValueType().IsNumeric())
+ {
throw (new ArgumentException(
"Trying to set numeric value on a non-numeric Eina.Value"));
+ }
+
return eina_value_set_wrapper_double(this.Handle, value);
}
@@ -1514,13 +1749,18 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
SanityChecks();
if (this.Optional)
+ {
return eina_value_optional_pset(this.Handle,
ValueTypeBridge.GetNative(ValueType.String),
ref value);
+ }
if (!GetValueType().IsString())
+ {
throw (new ArgumentException(
"Trying to set non-string value on a string Eina.Value"));
+ }
+
// No need to worry about ownership as eina_value_set will copy the passed string.
return eina_value_set_wrapper_string(this.Handle, value);
}
@@ -1533,9 +1773,11 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
int error_code = value;
if (this.Optional)
+ {
return eina_value_optional_pset(this.Handle,
ValueTypeBridge.GetNative(ValueType.Error),
ref error_code);
+ }
return eina_value_set_wrapper_int(this.Handle, error_code);
}
@@ -1549,20 +1791,28 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
IntPtr ptr_val = MemoryNative.Alloc(subtype.MarshalSizeOf());
IntPtr native_type = ValueTypeBridge.GetNative(subtype);
- try {
- switch (subtype) {
+ try
+ {
+ switch (subtype)
+ {
// PSet on Container types require an Eina_Value_<Container>, which is the structure
// that contains subtype, etc.
case ValueType.Array:
EinaNative.Value_Array value_array;
if (!eina_value_get_wrapper(value.Handle, out value_array))
+ {
return false;
+ }
+
Marshal.StructureToPtr(value_array, ptr_val, false);
break;
case ValueType.List:
EinaNative.Value_List value_list;
if (!eina_value_get_wrapper(value.Handle, out value_list))
+ {
return false;
+ }
+
Marshal.StructureToPtr(value_list, ptr_val, false);
break;
default:
@@ -1570,7 +1820,9 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
}
return eina_value_optional_pset(this.Handle, native_type, ptr_val);
- } finally {
+ }
+ finally
+ {
MemoryNative.Free(ptr_val);
}
}
@@ -1580,9 +1832,13 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
{
SanityChecks();
if (this.Optional)
+ {
return eina_value_optional_pget(this.Handle, out value);
+ }
else
+ {
return eina_value_get_wrapper(this.Handle, out value);
+ }
}
/// <summary>Gets the currently stored value as a sbyte.</summary>
@@ -1590,9 +1846,13 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
{
SanityChecks();
if (this.Optional)
+ {
return eina_value_optional_pget(this.Handle, out value);
+ }
else
+ {
return eina_value_get_wrapper(this.Handle, out value);
+ }
}
/// <summary>Gets the currently stored value as a short.</summary>
@@ -1600,9 +1860,13 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
{
SanityChecks();
if (this.Optional)
+ {
return eina_value_optional_pget(this.Handle, out value);
+ }
else
+ {
return eina_value_get_wrapper(this.Handle, out value);
+ }
}
/// <summary>Gets the currently stored value as an ushort.</summary>
@@ -1610,9 +1874,13 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
{
SanityChecks();
if (this.Optional)
+ {
return eina_value_optional_pget(this.Handle, out value);
+ }
else
+ {
return eina_value_get_wrapper(this.Handle, out value);
+ }
}
/// <summary>Gets the currently stored value as an int.</summary>
@@ -1620,9 +1888,13 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
{
SanityChecks();
if (this.Optional)
+ {
return eina_value_optional_pget(this.Handle, out value);
+ }
else
+ {
return eina_value_get_wrapper(this.Handle, out value);
+ }
}
/// <summary>Gets the currently stored value as an uint.</summary>
@@ -1630,9 +1902,13 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
{
SanityChecks();
if (this.Optional)
+ {
return eina_value_optional_pget(this.Handle, out value);
+ }
else
+ {
return eina_value_get_wrapper(this.Handle, out value);
+ }
}
/// <summary>Gets the currently stored value as a long.</summary>
@@ -1640,9 +1916,13 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
{
SanityChecks();
if (this.Optional)
+ {
return eina_value_optional_pget(this.Handle, out value);
+ }
else
+ {
return eina_value_get_wrapper(this.Handle, out value);
+ }
}
/// <summary>Gets the currently stored value as an ulong.</summary>
@@ -1650,9 +1930,13 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
{
SanityChecks();
if (this.Optional)
+ {
return eina_value_optional_pget(this.Handle, out value);
+ }
else
+ {
return eina_value_get_wrapper(this.Handle, out value);
+ }
}
/// <summary>Gets the currently stored value as a float.</summary>
@@ -1660,9 +1944,13 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
{
SanityChecks();
if (this.Optional)
+ {
return eina_value_optional_pget(this.Handle, out value);
+ }
else
+ {
return eina_value_get_wrapper(this.Handle, out value);
+ }
}
/// <summary>Gets the currently stored value as a double.</summary>
@@ -1670,9 +1958,13 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
{
SanityChecks();
if (this.Optional)
+ {
return eina_value_optional_pget(this.Handle, out value);
+ }
else
+ {
return eina_value_get_wrapper(this.Handle, out value);
+ }
}
/// <summary>Gets the currently stored value as a string.</summary>
@@ -1680,15 +1972,20 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
{
SanityChecks();
IntPtr output = IntPtr.Zero;
- if (this.Optional) {
- if (!eina_value_optional_pget(this.Handle, out output)) {
+ if (this.Optional)
+ {
+ if (!eina_value_optional_pget(this.Handle, out output))
+ {
value = String.Empty;
return false;
}
- } else if (!eina_value_get_wrapper(this.Handle, out output)) {
+ }
+ else if (!eina_value_get_wrapper(this.Handle, out output))
+ {
value = String.Empty;
return false;
}
+
value = StringConversion.NativeUtf8ToManagedString(output);
return true;
}
@@ -1700,9 +1997,13 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
bool ret;
int intermediate; // It seems out doesn't play well with implicit operators...
if (this.Optional)
+ {
ret = eina_value_optional_pget(this.Handle, out intermediate);
+ }
else
+ {
ret = eina_value_get_wrapper(this.Handle, out intermediate);
+ }
value = intermediate;
@@ -1716,24 +2017,33 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
value = null;
if (!this.Optional)
+ {
throw new InvalidValueTypeException("Values can only be retreived");
+ }
IntPtr nativeType = eina_value_optional_type_get_wrapper(this.Handle);
ValueType managedType = ValueTypeBridge.GetManaged(nativeType);
- switch (managedType) {
+ switch (managedType)
+ {
case ValueType.Array:
Eina.EinaNative.Value_Array array_desc;
if (!eina_value_optional_pget(this.Handle, out array_desc))
+ {
return false;
+ }
+
value = Value.FromArrayDesc(array_desc);
break;
case ValueType.List:
Eina.EinaNative.Value_List list_desc;
if (!eina_value_optional_pget(this.Handle, out list_desc))
+ {
return false;
+ }
+
value = Value.FromListDesc(list_desc);
break;
}
@@ -1745,7 +2055,10 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
public ValueType GetValueType()
{
if (Disposed)
+ {
throw new ObjectDisposedException(base.GetType().Name);
+ }
+
IntPtr native_type = eina_value_type_get_wrapper(this.Handle);
return ValueTypeBridge.GetManaged(native_type);
}
@@ -1755,7 +2068,9 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
public bool ConvertTo(Value target)
{
if (target == null)
+ {
return false;
+ }
SanityChecks();
@@ -1766,7 +2081,10 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
public int CompareTo(Value other)
{
if (other == null)
+ {
return 1;
+ }
+
SanityChecks();
other.SanityChecks();
return eina_value_compare_wrapper(this.Handle, other.Handle);
@@ -1780,20 +2098,27 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
public override bool Equals(object obj)
{
if (obj == null)
+ {
return false;
+ }
Value v = obj as Value;
if (v == null)
+ {
return false;
+ }
return this.Equals(v);
}
public bool Equals(Value other)
{
- try {
+ try
+ {
return this.CompareTo(other) == 0;
- } catch (ObjectDisposedException) {
+ }
+ catch (ObjectDisposedException)
+ {
return false;
}
}
@@ -1806,7 +2131,9 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
public static bool operator==(Value x, Value y)
{
if (object.ReferenceEquals(x, null))
+ {
return object.ReferenceEquals(y, null);
+ }
return x.Equals(y);
}
@@ -1814,21 +2141,30 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
public static bool operator!=(Value x, Value y)
{
if (object.ReferenceEquals(x, null))
+ {
return !object.ReferenceEquals(y, null);
+ }
+
return !x.Equals(y);
}
public static bool operator>(Value x, Value y)
{
if (object.ReferenceEquals(x, null) || object.ReferenceEquals(y, null))
+ {
return false;
+ }
+
return x.CompareTo(y) > 0;
}
public static bool operator<(Value x, Value y)
{
if (object.ReferenceEquals(x, null) || object.ReferenceEquals(y, null))
+ {
return false;
+ }
+
return x.CompareTo(y) < 0;
}
@@ -1851,25 +2187,32 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
}
// Container methods methods
- public int Count() {
+ public int Count()
+ {
ContainerSanityChecks();
- switch(GetValueType()) {
+ switch (GetValueType())
+ {
case ValueType.Array:
return (int)eina_value_array_count_wrapper(this.Handle);
case ValueType.List:
return (int)eina_value_list_count_wrapper(this.Handle);
}
+
return -1;
}
- public bool Append(object o) {
+
+ public bool Append(object o)
+ {
ContainerSanityChecks();
- switch (GetValueSubType()) {
+ switch (GetValueSubType())
+ {
case ValueType.SByte:
{
sbyte b = Convert.ToSByte(o);
return eina_value_container_append_wrapper_char(this.Handle, b);
}
+
case ValueType.Byte:
{
byte b = Convert.ToByte(o);
@@ -1881,6 +2224,7 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
short b = Convert.ToInt16(o);
return eina_value_container_append_wrapper_short(this.Handle, b);
}
+
case ValueType.UShort:
{
ushort b = Convert.ToUInt16(o);
@@ -1892,6 +2236,7 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
int x = Convert.ToInt32(o);
return eina_value_container_append_wrapper_int(this.Handle, x);
}
+
case ValueType.UInt32:
{
uint x = Convert.ToUInt32(o);
@@ -1904,6 +2249,7 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
long x = Convert.ToInt64(o);
return eina_value_container_append_wrapper_long(this.Handle, x);
}
+
case ValueType.ULong:
case ValueType.UInt64:
{
@@ -1916,6 +2262,7 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
float x = Convert.ToSingle(o);
return eina_value_container_append_wrapper_float(this.Handle, x);
}
+
case ValueType.Double:
{
double x = Convert.ToDouble(o);
@@ -1928,21 +2275,25 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
return eina_value_container_append_wrapper_string(this.Handle, x);
}
}
+
return false;
}
public object this[int i]
{
- get {
+ get
+ {
ContainerSanityChecks(i);
- switch (GetValueSubType()) {
+ switch (GetValueSubType())
+ {
case ValueType.SByte:
{
sbyte ret = default(sbyte);
eina_value_container_get_wrapper(this.Handle, i, out ret);
return ret;
}
+
case ValueType.Byte:
{
byte ret = default(byte);
@@ -1956,6 +2307,7 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
eina_value_container_get_wrapper(this.Handle, i, out ret);
return ret;
}
+
case ValueType.UShort:
{
ushort ret = default(ushort);
@@ -1969,6 +2321,7 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
eina_value_container_get_wrapper(this.Handle, i, out ret);
return ret;
}
+
case ValueType.UInt32:
{
uint ret = default(uint);
@@ -1983,6 +2336,7 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
eina_value_container_get_wrapper(this.Handle, i, out ret);
return ret;
}
+
case ValueType.ULong:
case ValueType.UInt64:
{
@@ -1997,6 +2351,7 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
eina_value_container_get_wrapper(this.Handle, i, out ret);
return ret;
}
+
case ValueType.Double:
{
double ret = default(double);
@@ -2012,87 +2367,95 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
eina_value_container_get_wrapper(this.Handle, i, out ptr);
return Eina.StringConversion.NativeUtf8ToManagedString(ptr);
}
+
default:
throw new InvalidOperationException("Subtype not supported.");
}
}
- set {
+ set
+ {
ContainerSanityChecks(i);
- switch (GetValueSubType()) {
+ switch (GetValueSubType())
+ {
case ValueType.SByte:
{
sbyte v = Convert.ToSByte(value);
eina_value_container_set_wrapper_char(this.Handle, i, v);
+ break;
}
- break;
+
case ValueType.Byte:
{
byte v = Convert.ToByte(value);
eina_value_container_set_wrapper_uchar(this.Handle, i, v);
+ break;
}
- break;
case ValueType.Short:
{
short x = Convert.ToInt16(value);
eina_value_container_set_wrapper_short(this.Handle, i, x);
+ break;
}
- break;
+
case ValueType.UShort:
{
ushort x = Convert.ToUInt16(value);
eina_value_container_set_wrapper_ushort(this.Handle, i, x);
+ break;
}
- break;
case ValueType.Int32:
{
int x = Convert.ToInt32(value);
eina_value_container_set_wrapper_int(this.Handle, i, x);
+ break;
}
- break;
+
case ValueType.UInt32:
{
uint x = Convert.ToUInt32(value);
eina_value_container_set_wrapper_uint(this.Handle, i, x);
+ break;
}
- break;
case ValueType.Long:
case ValueType.Int64:
{
long x = Convert.ToInt64(value);
eina_value_container_set_wrapper_long(this.Handle, i, x);
+ break;
}
- break;
+
case ValueType.ULong:
case ValueType.UInt64:
{
ulong x = Convert.ToUInt64(value);
eina_value_container_set_wrapper_ulong(this.Handle, i, x);
+ break;
}
- break;
case ValueType.Float:
{
float x = Convert.ToSingle(value);
eina_value_container_set_wrapper_float(this.Handle, i, x);
+ break;
}
- break;
+
case ValueType.Double:
{
double x = Convert.ToDouble(value);
eina_value_container_set_wrapper_double(this.Handle, i, x);
+ break;
}
- break;
case ValueType.String:
{
string x = Convert.ToString(value);
eina_value_container_set_wrapper_string(this.Handle, i, x);
+ break;
}
- break;
}
}
}
@@ -2103,7 +2466,8 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
IntPtr native_subtype = IntPtr.Zero;
- switch (GetValueType()) {
+ switch (GetValueType())
+ {
case ValueType.Array:
native_subtype = eina_value_array_subtype_get_wrapper(this.Handle);
break;
@@ -2111,86 +2475,113 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
native_subtype = eina_value_list_subtype_get_wrapper(this.Handle);
break;
}
+
return ValueTypeBridge.GetManaged(native_subtype);
}
}
/// <summary> Custom marshaler to convert value pointers to managed values and back,
/// without changing ownership.</summary>
-public class ValueMarshaler : ICustomMarshaler {
-
+public class ValueMarshaler : ICustomMarshaler
+{
/// <summary>Creates a managed value from a C pointer, whitout taking ownership of it.</summary>
- public object MarshalNativeToManaged(IntPtr pNativeData) {
+ public object MarshalNativeToManaged(IntPtr pNativeData)
+ {
return new Value(pNativeData, Ownership.Unmanaged);
}
/// <summary>Retrieves the C pointer from a given managed value,
/// keeping the managed ownership.</summary>
- public IntPtr MarshalManagedToNative(object managedObj) {
- try {
+ public IntPtr MarshalManagedToNative(object managedObj)
+ {
+ try
+ {
Value v = (Value)managedObj;
return v.Handle;
- } catch (InvalidCastException) {
+ }
+ catch (InvalidCastException)
+ {
return IntPtr.Zero;
}
}
- public void CleanUpNativeData(IntPtr pNativeData) {
+ public void CleanUpNativeData(IntPtr pNativeData)
+ {
}
- public void CleanUpManagedData(object managedObj) {
+ public void CleanUpManagedData(object managedObj)
+ {
}
- public int GetNativeDataSize() {
+ public int GetNativeDataSize()
+ {
return -1;
}
- public static ICustomMarshaler GetInstance(string cookie) {
- if (marshaler == null) {
+ public static ICustomMarshaler GetInstance(string cookie)
+ {
+ if (marshaler == null)
+ {
marshaler = new ValueMarshaler();
}
+
return marshaler;
}
+
static private ValueMarshaler marshaler;
}
/// <summary> Custom marshaler to convert value pointers to managed values and back,
/// also transferring the ownership to the other side.</summary>
-public class ValueMarshalerOwn : ICustomMarshaler {
+public class ValueMarshalerOwn : ICustomMarshaler
+{
/// <summary>Creates a managed value from a C pointer, taking the ownership.</summary>
- public object MarshalNativeToManaged(IntPtr pNativeData) {
+ public object MarshalNativeToManaged(IntPtr pNativeData)
+ {
return new Value(pNativeData, Ownership.Managed);
}
/// <summary>Retrieves the C pointer from a given managed value,
/// transferring the ownership to the unmanaged side, which should release it
/// when not needed. </summary>
- public IntPtr MarshalManagedToNative(object managedObj) {
- try {
+ public IntPtr MarshalManagedToNative(object managedObj)
+ {
+ try
+ {
Value v = (Value)managedObj;
v.ReleaseOwnership();
return v.Handle;
- } catch (InvalidCastException) {
+ }
+ catch (InvalidCastException)
+ {
return IntPtr.Zero;
}
}
- public void CleanUpNativeData(IntPtr pNativeData) {
+ public void CleanUpNativeData(IntPtr pNativeData)
+ {
}
- public void CleanUpManagedData(object managedObj) {
+ public void CleanUpManagedData(object managedObj)
+ {
}
- public int GetNativeDataSize() {
+ public int GetNativeDataSize()
+ {
return -1;
}
- public static ICustomMarshaler GetInstance(string cookie) {
- if (marshaler == null) {
+ public static ICustomMarshaler GetInstance(string cookie)
+ {
+ if (marshaler == null)
+ {
marshaler = new ValueMarshalerOwn();
}
+
return marshaler;
}
+
static private ValueMarshalerOwn marshaler;
}
+
}
diff --git a/src/bindings/mono/eldbus_mono/eldbus_common.cs b/src/bindings/mono/eldbus_mono/eldbus_common.cs
index 30e3b0be8e..39c2d039d6 100644
--- a/src/bindings/mono/eldbus_mono/eldbus_common.cs
+++ b/src/bindings/mono/eldbus_mono/eldbus_common.cs
@@ -5,7 +5,8 @@ using System.Runtime.InteropServices;
using static eldbus.EldbusMessageNativeFunctions;
-namespace eldbus {
+namespace eldbus
+{
public static class Timeout
{
@@ -26,6 +27,7 @@ public struct ObjectPath
{
return new ObjectPath(str);
}
+
public static implicit operator string(ObjectPath path)
{
return path.value;
@@ -46,6 +48,7 @@ public struct SignatureString
{
return new SignatureString(str);
}
+
public static implicit operator string(SignatureString sig)
{
return sig.value;
@@ -66,6 +69,7 @@ public struct UnixFd
{
return new UnixFd(fd);
}
+
public static implicit operator Int32(UnixFd unix_fd)
{
return unix_fd.value;
@@ -75,23 +79,107 @@ public struct UnixFd
public static class Argument
{
- public class ByteType { public const char Code = 'y'; public const string Signature = "y"; }
- public class BooleanType { public const char Code = 'b'; public const string Signature = "b"; }
- public class Int16Type { public const char Code = 'n'; public const string Signature = "n"; }
- public class UInt16Type { public const char Code = 'q'; public const string Signature = "q"; }
- public class Int32Type { public const char Code = 'i'; public const string Signature = "i"; }
- public class UInt32Type { public const char Code = 'u'; public const string Signature = "u"; }
- public class Int64Type { public const char Code = 'x'; public const string Signature = "x"; }
- public class UInt64Type { public const char Code = 't'; public const string Signature = "t"; }
- public class DoubleType { public const char Code = 'd'; public const string Signature = "d"; }
- public class StringType { public const char Code = 's'; public const string Signature = "s"; }
- public class ObjectPathType { public const char Code = 'o'; public const string Signature = "o"; }
- public class SignatureType { public const char Code = 'g'; public const string Signature = "g"; }
- public class ArrayType { public const char Code = 'a'; public const string Signature = "a"; }
- public class StructType { public const char Code = 'r'; public const string Signature = "r"; }
- public class VariantType { public const char Code = 'v'; public const string Signature = "v"; }
- public class DictEntryType { public const char Code = 'e'; public const string Signature = "e"; }
- public class UnixFdType { public const char Code = 'h'; public const string Signature = "h"; }
+ public class ByteType
+ {
+ public const char Code = 'y';
+ public const string Signature = "y";
+ }
+
+ public class BooleanType
+ {
+ public const char Code = 'b';
+ public const string Signature = "b";
+ }
+
+ public class Int16Type
+ {
+ public const char Code = 'n';
+ public const string Signature = "n";
+ }
+
+ public class UInt16Type
+ {
+ public const char Code = 'q';
+ public const string Signature = "q";
+ }
+
+ public class Int32Type
+ {
+ public const char Code = 'i';
+ public const string Signature = "i";
+ }
+
+ public class UInt32Type
+ {
+ public const char Code = 'u';
+ public const string Signature = "u";
+ }
+
+ public class Int64Type
+ {
+ public const char Code = 'x';
+ public const string Signature = "x";
+ }
+
+ public class UInt64Type
+ {
+ public const char Code = 't';
+ public const string Signature = "t";
+ }
+
+ public class DoubleType
+ {
+ public const char Code = 'd';
+ public const string Signature = "d";
+ }
+
+ public class StringType
+ {
+ public const char Code = 's';
+ public const string Signature = "s";
+ }
+
+ public class ObjectPathType
+ {
+ public const char Code = 'o';
+ public const string Signature = "o";
+ }
+
+ public class SignatureType
+ {
+ public const char Code = 'g';
+ public const string Signature = "g";
+ }
+
+ public class ArrayType
+ {
+ public const char Code = 'a';
+ public const string Signature = "a";
+ }
+
+ public class StructType
+ {
+ public const char Code = 'r';
+ public const string Signature = "r";
+ }
+
+ public class VariantType
+ {
+ public const char Code = 'v';
+ public const string Signature = "v";
+ }
+
+ public class DictEntryType
+ {
+ public const char Code = 'e';
+ public const string Signature = "e";
+ }
+
+ public class UnixFdType
+ {
+ public const char Code = 'h';
+ public const string Signature = "h";
+ }
// public static readonly ByteType ByteT = new ByteType();
// public static readonly BooleanType BooleanT = new BooleanType();
@@ -135,13 +223,17 @@ public abstract class BasicMessageArgument
public void AppendTo(eldbus.Message msg)
{
if (!InternalAppendTo(msg))
+ {
throw new SEHException("Eldbus: could not append basic type to eldbus.Message");
+ }
}
public void AppendTo(eldbus.MessageIterator iter)
{
if (!InternalAppendTo(iter))
+ {
throw new SEHException("Eldbus: could not append basic type to eldbus.MessageIterator");
+ }
}
public abstract char TypeCode {get;}
@@ -219,8 +311,15 @@ public class ByteMessageArgument : BasicMessageArgument
value = arg;
}
- public override char TypeCode { get { return Argument.ByteType.Code; } }
- public override string Signature { get { return Argument.ByteType.Signature; } }
+ public override char TypeCode
+ {
+ get { return Argument.ByteType.Code; }
+ }
+
+ public override string Signature
+ {
+ get { return Argument.ByteType.Signature; }
+ }
protected override bool InternalAppendTo(eldbus.Message msg)
{
@@ -242,8 +341,15 @@ public class BoolMessageArgument : BasicMessageArgument
value = Convert.ToInt32(arg);
}
- public override char TypeCode { get { return Argument.BooleanType.Code; } }
- public override string Signature { get { return Argument.ByteType.Signature; } }
+ public override char TypeCode
+ {
+ get { return Argument.BooleanType.Code; }
+ }
+
+ public override string Signature
+ {
+ get { return Argument.ByteType.Signature; }
+ }
protected override bool InternalAppendTo(eldbus.Message msg)
{
@@ -265,8 +371,15 @@ public class Int16MessageArgument : BasicMessageArgument
value = arg;
}
- public override char TypeCode { get { return Argument.Int16Type.Code; } }
- public override string Signature { get { return Argument.ByteType.Signature; } }
+ public override char TypeCode
+ {
+ get { return Argument.Int16Type.Code; }
+ }
+
+ public override string Signature
+ {
+ get { return Argument.ByteType.Signature; }
+ }
protected override bool InternalAppendTo(eldbus.Message msg)
{
@@ -288,8 +401,15 @@ public class UInt16MessageArgument : BasicMessageArgument
value = arg;
}
- public override char TypeCode { get { return Argument.UInt16Type.Code; } }
- public override string Signature { get { return Argument.ByteType.Signature; } }
+ public override char TypeCode
+ {
+ get { return Argument.UInt16Type.Code; }
+ }
+
+ public override string Signature
+ {
+ get { return Argument.ByteType.Signature; }
+ }
protected override bool InternalAppendTo(eldbus.Message msg)
{
@@ -311,8 +431,15 @@ public class Int32MessageArgument : BasicMessageArgument
value = arg;
}
- public override char TypeCode { get { return Argument.Int32Type.Code; } }
- public override string Signature { get { return Argument.ByteType.Signature; } }
+ public override char TypeCode
+ {
+ get { return Argument.Int32Type.Code; }
+ }
+
+ public override string Signature
+ {
+ get { return Argument.ByteType.Signature; }
+ }
protected override bool InternalAppendTo(eldbus.Message msg)
{
@@ -334,8 +461,15 @@ public class UInt32MessageArgument : BasicMessageArgument
value = arg;
}
- public override char TypeCode { get { return Argument.UInt32Type.Code; } }
- public override string Signature { get { return Argument.ByteType.Signature; } }
+ public override char TypeCode
+ {
+ get { return Argument.UInt32Type.Code; }
+ }
+
+ public override string Signature
+ {
+ get { return Argument.ByteType.Signature; }
+ }
protected override bool InternalAppendTo(eldbus.Message msg)
{
@@ -357,8 +491,15 @@ public class Int64MessageArgument : BasicMessageArgument
value = arg;
}
- public override char TypeCode { get { return Argument.Int64Type.Code; } }
- public override string Signature { get { return Argument.ByteType.Signature; } }
+ public override char TypeCode
+ {
+ get { return Argument.Int64Type.Code; }
+ }
+
+ public override string Signature
+ {
+ get { return Argument.ByteType.Signature; }
+ }
protected override bool InternalAppendTo(eldbus.Message msg)
{
@@ -380,8 +521,15 @@ public class UInt64MessageArgument : BasicMessageArgument
value = arg;
}
- public override char TypeCode { get { return Argument.UInt64Type.Code; } }
- public override string Signature { get { return Argument.ByteType.Signature; } }
+ public override char TypeCode
+ {
+ get { return Argument.UInt64Type.Code; }
+ }
+
+ public override string Signature
+ {
+ get { return Argument.ByteType.Signature; }
+ }
protected override bool InternalAppendTo(eldbus.Message msg)
{
@@ -403,8 +551,15 @@ public class DoubleMessageArgument : BasicMessageArgument
value = arg;
}
- public override char TypeCode { get { return Argument.DoubleType.Code; } }
- public override string Signature { get { return Argument.ByteType.Signature; } }
+ public override char TypeCode
+ {
+ get { return Argument.DoubleType.Code; }
+ }
+
+ public override string Signature
+ {
+ get { return Argument.ByteType.Signature; }
+ }
protected override bool InternalAppendTo(eldbus.Message msg)
{
@@ -439,32 +594,53 @@ public abstract class StringLikeMessageArgument : BasicMessageArgument
public class StringMessageArgument : StringLikeMessageArgument
{
- public StringMessageArgument(string arg)
- : base(arg)
- {}
+ public StringMessageArgument(string arg) : base(arg)
+ {
+ }
+
+ public override char TypeCode
+ {
+ get { return Argument.StringType.Code; }
+ }
- public override char TypeCode { get { return Argument.StringType.Code; } }
- public override string Signature { get { return Argument.ByteType.Signature; } }
+ public override string Signature
+ {
+ get { return Argument.ByteType.Signature; }
+ }
}
public class ObjectPathMessageArgument : StringLikeMessageArgument
{
- public ObjectPathMessageArgument(ObjectPath arg)
- : base(arg.value)
- {}
+ public ObjectPathMessageArgument(ObjectPath arg) : base(arg.value)
+ {
+ }
- public override char TypeCode { get { return Argument.ObjectPathType.Code; } }
- public override string Signature { get { return Argument.ByteType.Signature; } }
+ public override char TypeCode
+ {
+ get { return Argument.ObjectPathType.Code; }
+ }
+
+ public override string Signature
+ {
+ get { return Argument.ByteType.Signature; }
+ }
}
public class SignatureMessageArgument : StringLikeMessageArgument
{
- public SignatureMessageArgument(SignatureString arg)
- : base(arg.value)
- {}
+ public SignatureMessageArgument(SignatureString arg) : base(arg.value)
+ {
+ }
+
+ public override char TypeCode
+ {
+ get { return Argument.SignatureType.Code; }
+ }
- public override char TypeCode { get { return Argument.SignatureType.Code; } }
- public override string Signature { get { return Argument.ByteType.Signature; } }
+ public override string Signature
+ {
+ get { return Argument.ByteType.Signature; }
+ }
}
public class UnixFdMessageArgument : BasicMessageArgument
@@ -476,8 +652,15 @@ public class UnixFdMessageArgument : BasicMessageArgument
value = arg.value;
}
- public override char TypeCode { get { return Argument.UnixFdType.Code; } }
- public override string Signature { get { return Argument.ByteType.Signature; } }
+ public override char TypeCode
+ {
+ get { return Argument.UnixFdType.Code; }
+ }
+
+ public override string Signature
+ {
+ get { return Argument.ByteType.Signature; }
+ }
protected override bool InternalAppendTo(eldbus.Message msg)
{
@@ -497,7 +680,10 @@ public static class Common
public static void RaiseNullHandle()
{
if (NullHandleError == 0)
+ {
NullHandleError = Eina.Error.Register("Eldbus: null handle");
+ }
+
Eina.Error.Raise(NullHandleError);
}
@@ -511,7 +697,10 @@ public static class Common
public static Eldbus_Message_Cb GetMessageCbWrapper()
{
if (message_cb_wrapper == null)
+ {
message_cb_wrapper = new Eldbus_Message_Cb(MessageCbWrapper);
+ }
+
return message_cb_wrapper;
}
@@ -532,7 +721,7 @@ public static class Common
msg = new eldbus.Message(msg_hdl, false);
pending = new eldbus.Pending(pending_hdl, false);
}
- catch(Exception e)
+ catch (Exception e)
{
Eina.Log.Error("Eldbus: could not convert Eldbus_Message_Cb parameters. Exception: " + e.ToString());
return;
@@ -542,7 +731,7 @@ public static class Common
{
dlgt(msg, pending);
}
- catch(Exception e)
+ catch (Exception e)
{
Eina.Log.Error("Eldbus: Eldbus_Message_Cb delegate error. Exception: " + e.ToString());
}
@@ -553,5 +742,3 @@ public static class Common
}
}
-
-
diff --git a/src/bindings/mono/eldbus_mono/eldbus_config.cs b/src/bindings/mono/eldbus_mono/eldbus_config.cs
index c5bae0767b..08d2386f9b 100644
--- a/src/bindings/mono/eldbus_mono/eldbus_config.cs
+++ b/src/bindings/mono/eldbus_mono/eldbus_config.cs
@@ -3,7 +3,8 @@
using System;
using System.Runtime.InteropServices;
-namespace eldbus {
+namespace eldbus
+{
public static class Config
{
@@ -13,7 +14,9 @@ public static class Config
public static void Init()
{
if (eldbus_init() == 0)
+ {
throw new Efl.EflException("Failed to initialize Eldbus");
+ }
}
public static void Shutdown()
diff --git a/src/bindings/mono/eldbus_mono/eldbus_connection.cs b/src/bindings/mono/eldbus_mono/eldbus_connection.cs
index bef7f29acb..24a1ad9aff 100644
--- a/src/bindings/mono/eldbus_mono/eldbus_connection.cs
+++ b/src/bindings/mono/eldbus_mono/eldbus_connection.cs
@@ -5,8 +5,8 @@ using System.Runtime.InteropServices;
using static eldbus.EldbusConnectionNativeFunctions;
-namespace eldbus {
-
+namespace eldbus
+{
public static class EldbusConnectionNativeFunctions
{
@@ -155,10 +155,14 @@ public class Connection : IDisposable
IntPtr h = Handle;
Handle = IntPtr.Zero;
if (h == IntPtr.Zero)
+ {
return;
+ }
if (Own)
+ {
eldbus_connection_unref(h);
+ }
}
public void Dispose()
@@ -184,15 +188,19 @@ public class Connection : IDisposable
CheckHandle();
if (msg == null)
+ {
throw new ArgumentNullException("msg");
+ }
IntPtr cb_wrapper = (dlgt == null ? IntPtr.Zero : eldbus.Common.GetMessageCbWrapperPtr());
IntPtr cb_data = (dlgt == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(dlgt));
var pending_hdl = eldbus_connection_send(Handle, msg.Handle, cb_wrapper, cb_data, timeout);
- if(pending_hdl == IntPtr.Zero)
+ if (pending_hdl == IntPtr.Zero)
+ {
throw new SEHException("Eldbus: could not get `Pending' object from eldbus_connection_send");
+ }
msg.Ref();
@@ -204,7 +212,10 @@ public class Connection : IDisposable
CheckHandle();
var ptr = eldbus_connection_unique_name_get(Handle);
if (ptr == IntPtr.Zero)
+ {
return null;
+ }
+
return Eina.StringConversion.NativeUtf8ToManagedString(ptr);
}
@@ -213,15 +224,19 @@ public class Connection : IDisposable
CheckHandle();
if (bus == null)
+ {
throw new ArgumentNullException("bus");
+ }
IntPtr cb_wrapper = (dlgt == null ? IntPtr.Zero : eldbus.Common.GetMessageCbWrapperPtr());
IntPtr cb_data = (dlgt == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(dlgt));
var pending_hdl = eldbus_name_request(Handle, bus, flags, cb_wrapper, cb_data);
- if(pending_hdl == IntPtr.Zero)
+ if (pending_hdl == IntPtr.Zero)
+ {
throw new SEHException("Eldbus: could not get `Pending' object from eldbus_name_request");
+ }
return new eldbus.Pending(pending_hdl, false);
}
@@ -231,15 +246,19 @@ public class Connection : IDisposable
CheckHandle();
if (bus == null)
+ {
throw new ArgumentNullException("bus");
+ }
IntPtr cb_wrapper = (dlgt == null ? IntPtr.Zero : eldbus.Common.GetMessageCbWrapperPtr());
IntPtr cb_data = (dlgt == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(dlgt));
var pending_hdl = eldbus_name_release(Handle, bus, cb_wrapper, cb_data);
- if(pending_hdl == IntPtr.Zero)
+ if (pending_hdl == IntPtr.Zero)
+ {
throw new SEHException("Eldbus: could not get `Pending' object from eldbus_name_release");
+ }
return new eldbus.Pending(pending_hdl, false);
}
@@ -249,15 +268,19 @@ public class Connection : IDisposable
CheckHandle();
if (bus == null)
+ {
throw new ArgumentNullException("bus");
+ }
IntPtr cb_wrapper = (dlgt == null ? IntPtr.Zero : eldbus.Common.GetMessageCbWrapperPtr());
IntPtr cb_data = (dlgt == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(dlgt));
var pending_hdl = eldbus_name_owner_get(Handle, bus, cb_wrapper, cb_data);
- if(pending_hdl == IntPtr.Zero)
+ if (pending_hdl == IntPtr.Zero)
+ {
throw new SEHException("Eldbus: could not get `Pending' object from eldbus_name_owner_get");
+ }
return new eldbus.Pending(pending_hdl, false);
}
@@ -267,15 +290,19 @@ public class Connection : IDisposable
CheckHandle();
if (bus == null)
+ {
throw new ArgumentNullException("bus");
+ }
IntPtr cb_wrapper = (dlgt == null ? IntPtr.Zero : eldbus.Common.GetMessageCbWrapperPtr());
IntPtr cb_data = (dlgt == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(dlgt));
var pending_hdl = eldbus_name_owner_has(Handle, bus, cb_wrapper, cb_data);
- if(pending_hdl == IntPtr.Zero)
+ if (pending_hdl == IntPtr.Zero)
+ {
throw new SEHException("Eldbus: could not get `Pending' object from eldbus_name_owner_has");
+ }
return new eldbus.Pending(pending_hdl, false);
}
@@ -289,8 +316,10 @@ public class Connection : IDisposable
var pending_hdl = eldbus_names_list(Handle, cb_wrapper, cb_data);
- if(pending_hdl == IntPtr.Zero)
+ if (pending_hdl == IntPtr.Zero)
+ {
throw new SEHException("Eldbus: could not get `Pending' object from eldbus_names_list");
+ }
return new eldbus.Pending(pending_hdl, false);
}
@@ -304,8 +333,10 @@ public class Connection : IDisposable
var pending_hdl = eldbus_names_activatable_list(Handle, cb_wrapper, cb_data);
- if(pending_hdl == IntPtr.Zero)
+ if (pending_hdl == IntPtr.Zero)
+ {
throw new SEHException("Eldbus: could not get `Pending' object from eldbus_names_activatable_list");
+ }
return new eldbus.Pending(pending_hdl, false);
}
@@ -319,8 +350,10 @@ public class Connection : IDisposable
var pending_hdl = eldbus_hello(Handle, cb_wrapper, cb_data);
- if(pending_hdl == IntPtr.Zero)
+ if (pending_hdl == IntPtr.Zero)
+ {
throw new SEHException("Eldbus: could not get `Pending' object from eldbus_hello");
+ }
return new eldbus.Pending(pending_hdl, false);
}
@@ -330,15 +363,19 @@ public class Connection : IDisposable
CheckHandle();
if (bus == null)
+ {
throw new ArgumentNullException("bus");
+ }
IntPtr cb_wrapper = (dlgt == null ? IntPtr.Zero : eldbus.Common.GetMessageCbWrapperPtr());
IntPtr cb_data = (dlgt == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(dlgt));
var pending_hdl = eldbus_name_start(Handle, bus, flags, cb_wrapper, cb_data);
- if(pending_hdl == IntPtr.Zero)
+ if (pending_hdl == IntPtr.Zero)
+ {
throw new SEHException("Eldbus: could not get `Pending' object from eldbus_name_start");
+ }
return new eldbus.Pending(pending_hdl, false);
}
diff --git a/src/bindings/mono/eldbus_mono/eldbus_message.cs b/src/bindings/mono/eldbus_mono/eldbus_message.cs
index a8c96ffe7a..4e2c154e6a 100644
--- a/src/bindings/mono/eldbus_mono/eldbus_message.cs
+++ b/src/bindings/mono/eldbus_mono/eldbus_message.cs
@@ -5,7 +5,8 @@ using System.Runtime.InteropServices;
using static eldbus.EldbusMessageNativeFunctions;
-namespace eldbus {
+namespace eldbus
+{
public static class EldbusMessageNativeFunctions
{
@@ -223,10 +224,14 @@ public class Message : IDisposable
IntPtr h = Handle;
Handle = IntPtr.Zero;
if (h == IntPtr.Zero)
+ {
return;
+ }
if (Own)
+ {
eldbus_message_unref(h);
+ }
}
public void Dispose()
@@ -251,7 +256,10 @@ public class Message : IDisposable
{
var ptr = eldbus_message_method_call_new(dest, path, iface, method);
if (ptr == IntPtr.Zero)
+ {
throw new SEHException("Eldbus: could not get `Message' object from eldbus_message_method_call_new");
+ }
+
return new eldbus.Message(ptr, true);
}
@@ -259,7 +267,10 @@ public class Message : IDisposable
{
var ptr = eldbus_message_signal_new(path, _interface, name);
if (ptr == IntPtr.Zero)
+ {
throw new SEHException("Eldbus: could not get `Message' object from eldbus_message_signal_new");
+ }
+
return new eldbus.Message(ptr, true);
}
@@ -322,7 +333,10 @@ public class Message : IDisposable
CheckHandle();
var ptr = eldbus_message_error_new(Handle, error_name, error_msg);
if (ptr == IntPtr.Zero)
+ {
throw new SEHException("Eldbus: could not get `Message' object from eldbus_message_error_new");
+ }
+
return new eldbus.Message(ptr, false);
}
@@ -331,7 +345,10 @@ public class Message : IDisposable
CheckHandle();
var ptr = eldbus_message_method_return_new(Handle);
if (ptr == IntPtr.Zero)
+ {
throw new SEHException("Eldbus: could not get `Message' object from eldbus_message_method_return_new");
+ }
+
return new eldbus.Message(ptr, false);
}
@@ -459,7 +476,10 @@ public class Message : IDisposable
CheckHandle();
var ptr = eldbus_message_iter_get(Handle);
if (ptr == IntPtr.Zero)
+ {
throw new SEHException("Eldbus: could not get `MessageIterator' object from eldbus_message_iter_get");
+ }
+
return new eldbus.MessageIterator(ptr, IntPtr.Zero);
}
}
@@ -514,12 +534,18 @@ public class MessageIterator
IntPtr new_iter = IntPtr.Zero;
if (signature[0] == 'v')
+ {
new_iter = eldbus_message_iter_container_new(Handle, 'v', signature.Substring(1));
+ }
else if (!eldbus_message_iter_arguments_append(Handle, signature, out new_iter))
+ {
throw new SEHException("Eldbus: could not append container type");
+ }
if (new_iter == IntPtr.Zero)
+ {
throw new SEHException("Eldbus: could not get `MessageIterator' object from eldbus_message_iter_arguments_append");
+ }
return new eldbus.MessageIterator(new_iter, Handle);
}
@@ -531,7 +557,9 @@ public class MessageIterator
IntPtr new_iter = eldbus_message_iter_container_new(Handle, type, contained_signature);
if (new_iter == IntPtr.Zero)
+ {
throw new SEHException("Eldbus: could not get `MessageIterator' object from eldbus_message_iter_container_new");
+ }
return new eldbus.MessageIterator(new_iter, Handle);
}
@@ -541,10 +569,14 @@ public class MessageIterator
CheckHandle();
if (Parent == IntPtr.Zero)
+ {
throw new SEHException("Eldbus: can not close MessageIterator open container without a parent");
+ }
if (!eldbus_message_iter_container_close(Parent, Handle))
+ {
throw new SEHException("Eldbus: could not close MessageIterator");
+ }
Handle = IntPtr.Zero;
Parent = IntPtr.Zero;
@@ -654,7 +686,10 @@ public class MessageIterator
IntPtr hdl = IntPtr.Zero;
bool r = eldbus_message_iter_get_and_next(Handle, typecode, out hdl);
if (hdl == IntPtr.Zero)
+ {
throw new SEHException("Eldbus: could not get argument");
+ }
+
iter = new eldbus.MessageIterator(hdl, Handle);
return r;
@@ -665,7 +700,10 @@ public class MessageIterator
CheckHandle();
IntPtr hdl = IntPtr.Zero;
if (!eldbus_message_iter_arguments_get(Handle, signatue, out hdl) || hdl == IntPtr.Zero)
+ {
throw new SEHException("Eldbus: could not get argument");
+ }
+
iter = new eldbus.MessageIterator(hdl, Handle);
return Next();
@@ -764,7 +802,10 @@ public class MessageIterator
CheckHandle();
IntPtr hdl = IntPtr.Zero;
if (!eldbus_message_iter_arguments_get(Handle, signatue, out hdl) || hdl == IntPtr.Zero)
+ {
throw new SEHException("Eldbus: could not get argument");
+ }
+
iter = new eldbus.MessageIterator(hdl, Handle);
}
@@ -789,7 +830,9 @@ public class MessageIterator
CheckHandle();
if (!eldbus_message_iter_fixed_array_get(Handle, type_code, out value, out n_elements))
+ {
throw new SEHException("Eldbus: could not get fixed array");
+ }
}
public void GetFixedArray(out byte[] array)
@@ -880,4 +923,3 @@ public class MessageIterator
}
}
-
diff --git a/src/bindings/mono/eldbus_mono/eldbus_object.cs b/src/bindings/mono/eldbus_mono/eldbus_object.cs
index 7b48743dd3..1e9af69709 100644
--- a/src/bindings/mono/eldbus_mono/eldbus_object.cs
+++ b/src/bindings/mono/eldbus_mono/eldbus_object.cs
@@ -7,8 +7,8 @@ using static eldbus.EldbusObjectNativeFunctions;
using IntPtr = System.IntPtr;
-namespace eldbus {
-
+namespace eldbus
+{
public static class EldbusObjectNativeFunctions
{
@@ -112,16 +112,26 @@ public class Object : System.IDisposable
public Object(eldbus.Connection conn, string bus, string path)
{
if (conn == null)
+ {
throw new System.ArgumentNullException("conn");
+ }
+
if (bus == null)
+ {
throw new System.ArgumentNullException("bus");
+ }
+
if (path == null)
+ {
throw new System.ArgumentNullException("path");
+ }
var handle = eldbus_object_get(conn.Handle, bus, path);
if (handle == IntPtr.Zero)
+ {
throw new SEHException("Eldbus: could not get `Object' object from eldbus_object_get");
+ }
InitNew(handle, true);
}
@@ -136,10 +146,14 @@ public class Object : System.IDisposable
IntPtr h = Handle;
Handle = IntPtr.Zero;
if (h == IntPtr.Zero)
+ {
return;
+ }
if (Own)
+ {
eldbus_object_unref(h);
+ }
}
public void Dispose()
@@ -166,7 +180,9 @@ public class Object : System.IDisposable
var conn = eldbus_object_connection_get(Handle);
if (conn == IntPtr.Zero)
+ {
throw new SEHException("Eldbus: could not get `Connection' object from eldbus_object_connection_get");
+ }
return new eldbus.Connection(conn, false);
}
@@ -202,7 +218,9 @@ public class Object : System.IDisposable
CheckHandle();
if (msg == null)
+ {
throw new System.ArgumentNullException("msg");
+ }
IntPtr cb_wrapper = dlgt == null ? IntPtr.Zero : eldbus.Common.GetMessageCbWrapperPtr();
IntPtr cb_data = dlgt == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(dlgt);
@@ -210,7 +228,9 @@ public class Object : System.IDisposable
var pending_hdl = eldbus_object_send(Handle, msg.Handle, cb_wrapper, cb_data, timeout);
if (pending_hdl == IntPtr.Zero)
+ {
throw new SEHException("Eldbus: could not get `Pending' object from eldbus_object_send");
+ }
return new eldbus.Pending(pending_hdl, false);
}
@@ -222,7 +242,9 @@ public class Object : System.IDisposable
var hdl = eldbus_object_method_call_new(Handle, _interface, member);
if (hdl == IntPtr.Zero)
+ {
throw new SEHException("Eldbus: could not get `Message' object from eldbus_object_method_call_new");
+ }
return new eldbus.Message(hdl, false);
}
@@ -237,7 +259,9 @@ public class Object : System.IDisposable
var pending_hdl = eldbus_object_peer_ping(Handle, cb_wrapper, cb_data);
if (pending_hdl == IntPtr.Zero)
+ {
throw new SEHException("Eldbus: could not get `Pending' object from eldbus_object_peer_ping");
+ }
return new eldbus.Pending(pending_hdl, false);
}
@@ -252,7 +276,9 @@ public class Object : System.IDisposable
var pending_hdl = eldbus_object_peer_machine_id_get(Handle, cb_wrapper, cb_data);
if (pending_hdl == IntPtr.Zero)
+ {
throw new SEHException("Eldbus: could not get `Pending' object from eldbus_object_peer_machine_id_get");
+ }
return new eldbus.Pending(pending_hdl, false);
}
@@ -267,7 +293,9 @@ public class Object : System.IDisposable
var pending_hdl = eldbus_object_introspect(Handle, cb_wrapper, cb_data);
if (pending_hdl == IntPtr.Zero)
+ {
throw new SEHException("Eldbus: could not get `Pending' object from eldbus_object_introspect");
+ }
return new eldbus.Pending(pending_hdl, false);
}
@@ -282,12 +310,12 @@ public class Object : System.IDisposable
var pending_hdl = eldbus_object_managed_objects_get(Handle, cb_wrapper, cb_data);
if (pending_hdl == IntPtr.Zero)
+ {
throw new SEHException("Eldbus: could not get `Pending' object from eldbus_object_managed_objects_get");
+ }
return new eldbus.Pending(pending_hdl, false);
}
-
}
-
}
diff --git a/src/bindings/mono/eldbus_mono/eldbus_pending.cs b/src/bindings/mono/eldbus_mono/eldbus_pending.cs
index 906630ecbb..fbd8f35be9 100644
--- a/src/bindings/mono/eldbus_mono/eldbus_pending.cs
+++ b/src/bindings/mono/eldbus_mono/eldbus_pending.cs
@@ -5,7 +5,8 @@ using System.Runtime.InteropServices;
using static eldbus.EldbusPendingNativeFunctions;
-namespace eldbus {
+namespace eldbus
+{
public static class EldbusPendingNativeFunctions
{
@@ -108,4 +109,3 @@ public class Pending
}
}
-
diff --git a/src/bindings/mono/eldbus_mono/eldbus_proxy.cs b/src/bindings/mono/eldbus_mono/eldbus_proxy.cs
index ea44ca5db5..0fab5ebcab 100644
--- a/src/bindings/mono/eldbus_mono/eldbus_proxy.cs
+++ b/src/bindings/mono/eldbus_mono/eldbus_proxy.cs
@@ -5,7 +5,8 @@ using System.Runtime.InteropServices;
using static eldbus.EldbusProxyNativeFunctions;
-namespace eldbus {
+namespace eldbus
+{
public static class EldbusProxyNativeFunctions
{
@@ -104,10 +105,14 @@ public class Proxy : IDisposable
IntPtr h = Handle;
Handle = IntPtr.Zero;
if (h == IntPtr.Zero)
+ {
return;
+ }
if (Own)
+ {
eldbus_proxy_unref(h);
+ }
}
public void Dispose()
@@ -133,7 +138,10 @@ public class Proxy : IDisposable
CheckHandle();
var ptr = eldbus_proxy_object_get(Handle);
if (ptr == IntPtr.Zero)
+ {
throw new SEHException("Eldbus: could not get `Object' object from eldbus_proxy_object_get");
+ }
+
return new eldbus.Object(ptr, false);
}
@@ -149,11 +157,16 @@ public class Proxy : IDisposable
CheckHandle();
if (member == null)
+ {
throw new ArgumentNullException("member");
+ }
var ptr = eldbus_proxy_method_call_new(Handle, member);
if (ptr == IntPtr.Zero)
+ {
throw new SEHException("Eldbus: could not get `Message' object from eldbus_proxy_method_call_new");
+ }
+
return new eldbus.Message(ptr, false);
}
@@ -162,7 +175,9 @@ public class Proxy : IDisposable
CheckHandle();
if (msg == null)
+ {
throw new ArgumentNullException("msg");
+ }
IntPtr cb_wrapper = dlgt == null ? IntPtr.Zero : eldbus.Common.GetMessageCbWrapperPtr();
IntPtr cb_data = dlgt == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(dlgt);
@@ -170,7 +185,9 @@ public class Proxy : IDisposable
var pending_hdl = eldbus_proxy_send(Handle, msg.Handle, cb_wrapper, cb_data, timeout);
if (pending_hdl == IntPtr.Zero)
+ {
throw new SEHException("Eldbus: could not get `Pending' object from eldbus_proxy_send");
+ }
return new eldbus.Pending(pending_hdl, false);
}
@@ -180,7 +197,10 @@ public class Proxy : IDisposable
CheckHandle();
var ptr = eldbus_proxy_send_and_block(Handle, msg.Handle, timeout);
if (ptr == IntPtr.Zero)
+ {
throw new SEHException("Eldbus: could not get `Message' object from eldbus_proxy_send_and_block");
+ }
+
return new eldbus.Message(ptr, true);
}
@@ -205,4 +225,3 @@ public class Proxy : IDisposable
}
}
-
diff --git a/src/bindings/mono/eldbus_mono/eldbus_service.cs b/src/bindings/mono/eldbus_mono/eldbus_service.cs
index 33c3acb194..6e089720e1 100644
--- a/src/bindings/mono/eldbus_mono/eldbus_service.cs
+++ b/src/bindings/mono/eldbus_mono/eldbus_service.cs
@@ -5,7 +5,8 @@ using System.Runtime.InteropServices;
using static eldbus.EldbusServiceNativeFunctions;
-namespace eldbus {
+namespace eldbus
+{
public static class EldbusServiceNativeFunctions
{
@@ -65,4 +66,3 @@ public static class EldbusServiceNativeFunctions
}
}
-
diff --git a/src/bindings/mono/eo_mono/FunctionWrapper.cs b/src/bindings/mono/eo_mono/FunctionWrapper.cs
index 5aa4030a2f..bdbca77d93 100644
--- a/src/bindings/mono/eo_mono/FunctionWrapper.cs
+++ b/src/bindings/mono/eo_mono/FunctionWrapper.cs
@@ -1,7 +1,11 @@
using System;
using System.Runtime.InteropServices;
-namespace Efl { namespace Eo {
+namespace Efl
+{
+
+namespace Eo
+{
///<summary>Class to load functions pointers from a native module.
///
@@ -51,14 +55,20 @@ public class FunctionWrapper<T> // NOTE: When supporting C# >=7.3, add a where T
private static FunctionLoadResult<T> LazyInitialization(NativeModule module, string functionName)
{
if (module.Module == IntPtr.Zero)
+ {
return new FunctionLoadResult<T>(FunctionLoadResultKind.LibraryNotFound);
+ }
else
{
IntPtr funcptr = FunctionInterop.LoadFunctionPointer(module.Module, functionName);
if (funcptr == IntPtr.Zero)
+ {
return new FunctionLoadResult<T>(FunctionLoadResultKind.FunctionNotFound);
+ }
else
+ {
return new FunctionLoadResult<T>(Marshal.GetDelegateForFunctionPointer<T>(funcptr));
+ }
}
}
@@ -66,7 +76,7 @@ public class FunctionWrapper<T> // NOTE: When supporting C# >=7.3, add a where T
///<param name="moduleName">The name of the module containing the function.</param>
///<param name="functionName">The name of the function to search for.</param>
public FunctionWrapper(string moduleName, string functionName)
- : this (new NativeModule(moduleName), functionName)
+ : this(new NativeModule(moduleName), functionName)
{
}
@@ -95,7 +105,8 @@ public class FunctionWrapper<T> // NOTE: When supporting C# >=7.3, add a where T
}
///<summary>The outcome of the function load process.</summary>
-public enum FunctionLoadResultKind {
+public enum FunctionLoadResultKind
+{
///<summary>Function was loaded successfully.</summary>
Success,
///<summary>Library was not found.</summary>
@@ -116,9 +127,13 @@ public class FunctionLoadResult<T>
///Throws InvalidOperationException if trying to access while not loaded.</summary>
public T Delegate
{
- get {
+ get
+ {
if (_Delegate == null)
+ {
throw new InvalidOperationException($"Trying to get Delegate while not loaded. Load result: {Kind}");
+ }
+
return _Delegate;
}
}
@@ -139,4 +154,6 @@ public class FunctionLoadResult<T>
}
}
-} }
+}
+
+}
diff --git a/src/bindings/mono/eo_mono/FunctionWrapper_Unix.cs b/src/bindings/mono/eo_mono/FunctionWrapper_Unix.cs
index 845f8239e0..13a3cac865 100644
--- a/src/bindings/mono/eo_mono/FunctionWrapper_Unix.cs
+++ b/src/bindings/mono/eo_mono/FunctionWrapper_Unix.cs
@@ -1,7 +1,11 @@
using System;
using System.Runtime.InteropServices;
-namespace Efl { namespace Eo {
+namespace Efl
+{
+
+namespace Eo
+{
public partial class FunctionInterop
{
@@ -21,4 +25,6 @@ public partial class FunctionInterop
}
}
-} }
+}
+
+}
diff --git a/src/bindings/mono/eo_mono/FunctionWrapper_Windows.cs b/src/bindings/mono/eo_mono/FunctionWrapper_Windows.cs
index 3cdd80cf2f..dcf2091b71 100644
--- a/src/bindings/mono/eo_mono/FunctionWrapper_Windows.cs
+++ b/src/bindings/mono/eo_mono/FunctionWrapper_Windows.cs
@@ -1,7 +1,11 @@
using System;
using System.Runtime.InteropServices;
-namespace Efl { namespace Eo {
+namespace Efl
+{
+
+namespace Eo
+{
public partial class FunctionInterop
{
@@ -12,4 +16,6 @@ public partial class FunctionInterop
=> FunctionInterop.GetProcAddress(nativeLibraryHandle, functionName);
}
-} }
+}
+
+}
diff --git a/src/bindings/mono/eo_mono/NativeModule.cs b/src/bindings/mono/eo_mono/NativeModule.cs
index 400f24fb87..41f663e282 100644
--- a/src/bindings/mono/eo_mono/NativeModule.cs
+++ b/src/bindings/mono/eo_mono/NativeModule.cs
@@ -1,6 +1,10 @@
using System;
-namespace Efl { namespace Eo {
+namespace Efl
+{
+
+namespace Eo
+{
///<summary>Wraps a native module that was opened with dlopen/LoadLibrary.</summary>
public partial class NativeModule : IDisposable
@@ -35,4 +39,6 @@ public partial class NativeModule : IDisposable
}
}
-} }
+}
+
+}
diff --git a/src/bindings/mono/eo_mono/NativeModule_Unix.cs b/src/bindings/mono/eo_mono/NativeModule_Unix.cs
index 8783895b14..e63b9ba111 100644
--- a/src/bindings/mono/eo_mono/NativeModule_Unix.cs
+++ b/src/bindings/mono/eo_mono/NativeModule_Unix.cs
@@ -1,7 +1,11 @@
using System;
using System.Runtime.InteropServices;
-namespace Efl { namespace Eo {
+namespace Efl
+{
+
+namespace Eo
+{
public partial class NativeModule
{
@@ -60,11 +64,11 @@ public partial class NativeModule
}
}
}
+
return r;
}
}
+}
-
-
-} }
+}
diff --git a/src/bindings/mono/eo_mono/NativeModule_Windows.cs b/src/bindings/mono/eo_mono/NativeModule_Windows.cs
index 889adc0949..1db8340cba 100644
--- a/src/bindings/mono/eo_mono/NativeModule_Windows.cs
+++ b/src/bindings/mono/eo_mono/NativeModule_Windows.cs
@@ -1,7 +1,11 @@
using System;
using System.Runtime.InteropServices;
-namespace Efl { namespace Eo {
+namespace Efl
+{
+
+namespace Eo
+{
public class partial NativeModule
{
@@ -9,7 +13,6 @@ public class partial NativeModule
public static extern IntPtr LoadLibrary(string libFilename);
}
+}
-
-
-} }
+}
diff --git a/src/bindings/mono/eo_mono/iwrapper.cs b/src/bindings/mono/eo_mono/iwrapper.cs
index 3120dbbbf7..43835aabd7 100644
--- a/src/bindings/mono/eo_mono/iwrapper.cs
+++ b/src/bindings/mono/eo_mono/iwrapper.cs
@@ -9,12 +9,17 @@ using System.Threading;
using static Eina.NativeCustomExportFunctions;
using EoG = Efl.Eo.Globals;
-namespace Efl { namespace Eo {
+namespace Efl
+{
-public class Globals {
+namespace Eo
+{
+public class Globals
+{
/// <summary>Represents the type of the native Efl_Class.</summary>
- public enum EflClassType {
+ public enum EflClassType
+ {
/// <summary>Regular EFL classes.</summary>
Regular = 0,
/// <summary>Non-instantiable efl classes (i.e. Abstracts).</summary>
@@ -175,27 +180,27 @@ public class Globals {
[DllImport(efl.Libs.Evil)] public static extern IntPtr dlerror();
public delegate bool efl_event_callback_priority_add_delegate(
- System.IntPtr obj,
- IntPtr desc,
- short priority,
- Efl.EventCb cb,
- System.IntPtr data);
+ System.IntPtr obj,
+ IntPtr desc,
+ short priority,
+ Efl.EventCb cb,
+ System.IntPtr data);
[DllImport(efl.Libs.Eo)] public static extern bool efl_event_callback_priority_add(
- System.IntPtr obj,
- IntPtr desc,
- short priority,
- Efl.EventCb cb,
- System.IntPtr data);
+ System.IntPtr obj,
+ IntPtr desc,
+ short priority,
+ Efl.EventCb cb,
+ System.IntPtr data);
public delegate bool efl_event_callback_del_delegate(
- System.IntPtr obj,
- IntPtr desc,
- Efl.EventCb cb,
- System.IntPtr data);
+ System.IntPtr obj,
+ IntPtr desc,
+ Efl.EventCb cb,
+ System.IntPtr data);
[DllImport(efl.Libs.Eo)] public static extern bool efl_event_callback_del(
- System.IntPtr obj,
- IntPtr desc,
- Efl.EventCb cb,
- System.IntPtr data);
+ System.IntPtr obj,
+ IntPtr desc,
+ Efl.EventCb cb,
+ System.IntPtr data);
public const int RTLD_NOW = 2;
@@ -205,14 +210,17 @@ public class Globals {
{
return v.Value;
}
+
public static U GetParamHelper<U>(U v)
{
return v;
}
+
public static bool ParamHelperCheck<T>(Nullable<T> v) where T : struct
{
return v.HasValue;
}
+
public static bool ParamHelperCheck<U>(U v)
{
return v != null;
@@ -230,9 +238,9 @@ public class Globals {
description.class_destructor = IntPtr.Zero;
class_initializer init = (IntPtr kls) =>
- {
- return Globals.class_initializer_call(kls, type);
- };
+ {
+ return Globals.class_initializer_call(kls, type);
+ };
description.class_initializer = Marshal.GetFunctionPointerForDelegate(init);
@@ -243,12 +251,18 @@ public class Globals {
Eina.Log.Debug($"Going to register new class named {class_name}");
IntPtr klass = EoG.call_efl_class_new(description_ptr, base_klass, interface_list);
- if(klass == IntPtr.Zero)
+ if (klass == IntPtr.Zero)
+ {
Eina.Log.Error("klass was not registered");
+ }
else
+ {
Eina.Log.Debug("Registered class successfully");
+ }
+
return klass;
}
+
public static List<IntPtr> get_efl_interfaces(System.Type type)
{
System.Type base_type = type.BaseType;
@@ -260,29 +274,35 @@ public class Globals {
{
if (!System.Array.Exists(base_ifaces, element => element == iface))
{
- var attrs = System.Attribute.GetCustomAttributes(iface);
- foreach (var attr in attrs)
- {
- if (attr is Efl.Eo.NativeClass) {
- ifaces_lst.Add(((Efl.Eo.NativeClass)attr).GetEflClass());
- break;
- }
- }
+ var attrs = System.Attribute.GetCustomAttributes(iface);
+ foreach (var attr in attrs)
+ {
+ if (attr is Efl.Eo.NativeClass)
+ {
+ ifaces_lst.Add(((Efl.Eo.NativeClass)attr).GetEflClass());
+ break;
+ }
+ }
}
}
+
return ifaces_lst;
}
+
private static Efl.Eo.NativeClass get_native_class(System.Type type)
{
var attrs = System.Attribute.GetCustomAttributes(type);
foreach (var attr in attrs)
{
- if (attr is Efl.Eo.NativeClass) {
+ if (attr is Efl.Eo.NativeClass)
+ {
return (Efl.Eo.NativeClass)attr;
}
}
+
return null;
}
+
public static byte class_initializer_call(IntPtr klass, System.Type type)
{
Eina.Log.Debug($"called with 0x{klass.ToInt64():x} {type}");
@@ -301,7 +321,7 @@ public class Globals {
if (!System.Array.Exists(base_interfaces, element => element == iface))
{
var nc = get_native_class(iface);
- if(nc != null)
+ if (nc != null)
{
var moredescs = nc.GetEoOps(type);
Eina.Log.Debug($"adding {moredescs.Count} more descs to registration");
@@ -311,13 +331,14 @@ public class Globals {
}
}
- IntPtr descs_ptr = Marshal.AllocHGlobal(Marshal.SizeOf(descs[0])*count);
+ IntPtr descs_ptr = Marshal.AllocHGlobal(Marshal.SizeOf(descs[0]) * count);
IntPtr ptr = descs_ptr;
- for(int i = 0; i != count; ++i)
+ for (int i = 0; i != count; ++i)
{
Marshal.StructureToPtr(descs[i], ptr, false);
ptr = IntPtr.Add(ptr, Marshal.SizeOf(descs[0]));
}
+
Efl_Object_Ops ops;
ops.descs = descs_ptr;
ops.count = (UIntPtr)count;
@@ -327,74 +348,80 @@ public class Globals {
//EoKlass = klass;
}
else
+ {
Eina.Log.Debug("nativeClass == null");
+ }
return 1;
}
+
public static IntPtr call_efl_class_new(IntPtr desc, IntPtr bk, List<IntPtr> il = null)
{
IntPtr nul = IntPtr.Zero;
int iface_list_count = (il == null ? 0 : il.Count);
- switch(iface_list_count)
- {
- default: return nul;
- case 0: return EoG.efl_class_new(desc, bk, nul);
- case 1: return EoG.efl_class_new(desc, bk, il[0], nul);
- case 2: return EoG.efl_class_new(desc, bk, il[0], il[1], nul);
- case 3: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], nul);
- case 4: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], nul);
- case 5: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], nul);
- case 6: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], nul);
- case 7: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], nul);
- case 8: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], nul);
- case 9: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], nul);
- case 10: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], nul);
- case 11: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], nul);
- case 12: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], nul);
- case 13: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], nul);
- case 14: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], nul);
- case 15: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], nul);
- case 16: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], nul);
- case 17: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], nul);
- case 18: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], nul);
- case 19: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], nul);
- case 20: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], nul);
- case 21: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], nul);
- case 22: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], nul);
- case 23: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], nul);
- case 24: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], nul);
- case 25: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], nul);
- case 26: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], nul);
- case 27: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], nul);
- case 28: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], nul);
- case 29: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], nul);
- case 30: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], nul);
- case 31: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], nul);
- case 32: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], nul);
- case 33: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], nul);
- case 34: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], nul);
- case 35: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], nul);
- case 36: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], nul);
- case 37: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], nul);
- case 38: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], nul);
- case 39: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], il[38], nul);
- case 40: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], il[38], il[39], nul);
- case 41: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], il[38], il[39], il[40], nul);
- case 42: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], il[38], il[39], il[40], il[41], nul);
- case 43: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], il[38], il[39], il[40], il[41], il[42], nul);
- case 44: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], il[38], il[39], il[40], il[41], il[42], il[43], nul);
- case 45: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], il[38], il[39], il[40], il[41], il[42], il[43], il[44], nul);
- case 46: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], il[38], il[39], il[40], il[41], il[42], il[43], il[44], il[45], nul);
- case 47: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], il[38], il[39], il[40], il[41], il[42], il[43], il[44], il[45], il[46], nul);
- case 48: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], il[38], il[39], il[40], il[41], il[42], il[43], il[44], il[45], il[46], il[47], nul);
+ switch (iface_list_count)
+ {
+ default: return nul;
+ case 0: return EoG.efl_class_new(desc, bk, nul);
+ case 1: return EoG.efl_class_new(desc, bk, il[0], nul);
+ case 2: return EoG.efl_class_new(desc, bk, il[0], il[1], nul);
+ case 3: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], nul);
+ case 4: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], nul);
+ case 5: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], nul);
+ case 6: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], nul);
+ case 7: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], nul);
+ case 8: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], nul);
+ case 9: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], nul);
+ case 10: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], nul);
+ case 11: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], nul);
+ case 12: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], nul);
+ case 13: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], nul);
+ case 14: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], nul);
+ case 15: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], nul);
+ case 16: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], nul);
+ case 17: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], nul);
+ case 18: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], nul);
+ case 19: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], nul);
+ case 20: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], nul);
+ case 21: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], nul);
+ case 22: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], nul);
+ case 23: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], nul);
+ case 24: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], nul);
+ case 25: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], nul);
+ case 26: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], nul);
+ case 27: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], nul);
+ case 28: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], nul);
+ case 29: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], nul);
+ case 30: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], nul);
+ case 31: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], nul);
+ case 32: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], nul);
+ case 33: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], nul);
+ case 34: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], nul);
+ case 35: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], nul);
+ case 36: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], nul);
+ case 37: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], nul);
+ case 38: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], nul);
+ case 39: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], il[38], nul);
+ case 40: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], il[38], il[39], nul);
+ case 41: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], il[38], il[39], il[40], nul);
+ case 42: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], il[38], il[39], il[40], il[41], nul);
+ case 43: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], il[38], il[39], il[40], il[41], il[42], nul);
+ case 44: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], il[38], il[39], il[40], il[41], il[42], il[43], nul);
+ case 45: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], il[38], il[39], il[40], il[41], il[42], il[43], il[44], nul);
+ case 46: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], il[38], il[39], il[40], il[41], il[42], il[43], il[44], il[45], nul);
+ case 47: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], il[38], il[39], il[40], il[41], il[42], il[43], il[44], il[45], il[46], nul);
+ case 48: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], il[38], il[39], il[40], il[41], il[42], il[43], il[44], il[45], il[46], il[47], nul);
}
}
+
public static IntPtr instantiate_start(IntPtr klass, Efl.Object parent)
{
Eina.Log.Debug($"Instantiating from klass 0x{klass.ToInt64():x}");
System.IntPtr parent_ptr = System.IntPtr.Zero;
- if(parent != null)
+ if (parent != null)
+ {
parent_ptr = parent.NativeHandle;
+ }
System.IntPtr eo = Efl.Eo.Globals._efl_add_internal_start("file", 0, klass, parent_ptr, 1, 0);
if (eo == System.IntPtr.Zero)
@@ -407,38 +434,43 @@ public class Globals {
return eo;
}
- public static IntPtr instantiate_end(IntPtr eo) {
+ public static IntPtr instantiate_end(IntPtr eo)
+ {
Eina.Log.Debug("calling efl_add_internal_end");
eo = Efl.Eo.Globals._efl_add_end(eo, 1, 0);
Eina.Log.Debug($"efl_add_end returned eo 0x{eo.ToInt64():x}");
return eo;
}
+
public static void data_set(Efl.Eo.IWrapper obj)
{
- Eina.Log.Debug($"Calling data_scope_get with obj {obj.NativeHandle.ToInt64():x} and klass {obj.NativeClass.ToInt64():x}");
- IntPtr pd = Efl.Eo.Globals.efl_data_scope_get(obj.NativeHandle, obj.NativeClass);
- {
- GCHandle gch = GCHandle.Alloc(obj);
- EolianPD epd;
- epd.pointer = GCHandle.ToIntPtr(gch);
- Marshal.StructureToPtr(epd, pd, false);
- }
+ Eina.Log.Debug($"Calling data_scope_get with obj {obj.NativeHandle.ToInt64():x} and klass {obj.NativeClass.ToInt64():x}");
+ IntPtr pd = Efl.Eo.Globals.efl_data_scope_get(obj.NativeHandle, obj.NativeClass);
+ {
+ GCHandle gch = GCHandle.Alloc(obj);
+ EolianPD epd;
+ epd.pointer = GCHandle.ToIntPtr(gch);
+ Marshal.StructureToPtr(epd, pd, false);
+ }
}
+
public static Efl.Eo.IWrapper data_get(IntPtr pd)
{
EolianPD epd = (EolianPD)Marshal.PtrToStructure(pd, typeof(EolianPD));
- if(epd.pointer != IntPtr.Zero)
+ if (epd.pointer != IntPtr.Zero)
{
GCHandle gch = GCHandle.FromIntPtr(epd.pointer);
return (Efl.Eo.IWrapper)gch.Target;
}
else
+ {
return null;
+ }
}
public static void free_dict_values(Dictionary<String, IntPtr> dict)
{
- foreach(IntPtr ptr in dict.Values)
+ foreach (IntPtr ptr in dict.Values)
{
Eina.MemoryNative.Free(ptr);
}
@@ -446,7 +478,7 @@ public class Globals {
public static void free_stringshare_values(Dictionary<String, IntPtr> dict)
{
- foreach(IntPtr ptr in dict.Values)
+ foreach (IntPtr ptr in dict.Values)
{
Eina.Stringshare.eina_stringshare_del(ptr);
}
@@ -467,36 +499,45 @@ public class Globals {
// Flag to be passed to the cancell callback
bool fulfilled = false;
- future.Then((Eina.Value received) => {
- lock (future)
+ future.Then((Eina.Value received) =>
+ {
+ lock (future)
+ {
+ // Convert an failed Future to a failed Task.
+ if (received.GetValueType() == Eina.ValueType.Error)
{
- // Convert an failed Future to a failed Task.
- if (received.GetValueType() == Eina.ValueType.Error)
+ Eina.Error err;
+ received.Get(out err);
+ if (err == Eina.Error.ECANCELED)
{
- Eina.Error err;
- received.Get(out err);
- if (err == Eina.Error.ECANCELED)
- tcs.SetCanceled();
- else
- tcs.TrySetException(new Efl.FutureException(received));
+ tcs.SetCanceled();
}
else
{
- // Will mark the returned task below as completed.
- tcs.SetResult(received);
+ tcs.TrySetException(new Efl.FutureException(received));
}
- fulfilled = true;
- return received;
}
+ else
+ {
+ // Will mark the returned task below as completed.
+ tcs.SetResult(received);
+ }
+
+ fulfilled = true;
+ return received;
+ }
});
// Callback to be called when the token is cancelled.
- token.Register(() => {
- lock (future)
+ token.Register(() =>
+ {
+ lock (future)
+ {
+ // Will trigger the Then callback above with an Eina.Error
+ if (!fulfilled)
{
- // Will trigger the Then callback above with an Eina.Error
- if (!fulfilled)
- future.Cancel();
+ future.Cancel();
}
+ }
});
return tcs.Task;
@@ -534,6 +575,7 @@ public interface IWrapper
{
get;
}
+
/// <summary>Pointer to internal Eo class.</summary>
IntPtr NativeClass
{
@@ -547,11 +589,14 @@ public static class ClassRegister
{
System.Type t;
if (Efl.Eo.ClassRegister.typeFromKlass.TryGetValue(klass, out t))
+ {
return t;
+ }
// If it isn't on the dictionary then it is a Native binding class
IntPtr namePtr = Efl.Eo.Globals.efl_class_name_get(klass);
- if (namePtr == IntPtr.Zero) {
+ if (namePtr == IntPtr.Zero)
+ {
throw new System.InvalidOperationException($"Could not get Native class name. Handle: {klass}");
}
@@ -574,16 +619,23 @@ public static class ClassRegister
foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
{
if (assembly == curr_asm)
+ {
continue;
+ }
t = assembly.GetType(name);
if (t != null)
+ {
break;
+ }
}
- if (t == null) {
+
+ if (t == null)
+ {
throw new System.InvalidOperationException($"Could not find the C# binding class for the EFL class: {name}");
}
}
+
AddToKlassTypeBiDictionary(klass, t); // Cache it in the dictionary
return t;
}
@@ -592,11 +644,14 @@ public static class ClassRegister
{
IntPtr klass;
if (klassFromType.TryGetValue(objectType, out klass))
+ {
return klass;
+ }
// Check if it is a Native binding class
klass = GetNativeKlassPtr(objectType);
- if (klass != IntPtr.Zero) {
+ if (klass != IntPtr.Zero)
+ {
// Add to the dictionary cache
AddToKlassTypeBiDictionary(klass, objectType);
return klass;
@@ -605,7 +660,10 @@ public static class ClassRegister
// Unregistered Inherited class, let's register it
IntPtr baseKlass = GetNativeBaseKlassPtr(objectType);
if (baseKlass == IntPtr.Zero)
+ {
throw new System.InvalidOperationException($"Could not get base C# binding class for Inherited type: {objectType.FullName}");
+ }
+
return RegisterKlass(baseKlass, objectType);
}
@@ -613,18 +671,23 @@ public static class ClassRegister
{
IntPtr klass;
if (klassFromType.TryGetValue(objectType, out klass))
+ {
return klass;
+ }
return RegisterKlass(baseKlass, objectType);
}
private static IntPtr RegisterKlass(IntPtr baseKlass, System.Type objectType)
{
- lock (klassAllocLock) {
+ lock (klassAllocLock)
+ {
IntPtr newKlass = Efl.Eo.Globals.register_class(objectType.FullName, baseKlass, objectType);
- if (newKlass == IntPtr.Zero) {
+ if (newKlass == IntPtr.Zero)
+ {
throw new System.InvalidOperationException($"Failed to register class '{objectType.FullName}'");
}
+
AddToKlassTypeBiDictionary(newKlass, objectType);
return newKlass;
}
@@ -636,15 +699,20 @@ public static class ClassRegister
{
var ptr = GetNativeKlassPtr(t);
if (ptr != IntPtr.Zero)
+ {
return ptr;
+ }
}
+
throw new System.InvalidOperationException($"Class '{objectType.FullName}' is not an Efl object");
}
private static IntPtr GetNativeKlassPtr(System.Type objectType)
{
if (objectType == null)
+ {
return IntPtr.Zero;
+ }
if (objectType.IsInterface)
{
@@ -653,15 +721,20 @@ public static class ClassRegister
objectType = assembly.GetType(objectType.FullName + "Concrete");
if (objectType == null)
+ {
return IntPtr.Zero;
+ }
}
var method = objectType.GetMethod("GetEflClassStatic",
System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic);
if (method == null)
+ {
return IntPtr.Zero;
- return (IntPtr) (method.Invoke(null, null));
+ }
+
+ return (IntPtr)(method.Invoke(null, null));
}
public static void AddToKlassTypeBiDictionary(IntPtr klassPtr, System.Type objectType)
@@ -699,6 +772,7 @@ public class MarshalTest<T, U> : ICustomMarshaler
Eina.Log.Debug("MarshalTest.GetInstace cookie " + cookie);
return new MarshalTest<T, U>();
}
+
public void CleanUpManagedData(object ManagedObj)
{
//Eina.Log.Warning("MarshalTest.CleanUpManagedData not implemented");
@@ -723,7 +797,10 @@ public class MarshalTest<T, U> : ICustomMarshaler
Eina.Log.Debug("MarshalTest.MarshallManagedToNative");
var r = ((IWrapper)ManagedObj).NativeHandle;
if (typeof(U) == typeof(OwnTag))
+ {
Efl.Eo.Globals.efl_ref(r);
+ }
+
return r;
}
@@ -731,9 +808,12 @@ public class MarshalTest<T, U> : ICustomMarshaler
{
Eina.Log.Debug("MarshalTest.MarshalNativeToManaged");
if (typeof(U) != typeof(OwnTag))
+ {
Efl.Eo.Globals.efl_ref(pNativeData);
+ }
+
return Activator.CreateInstance(typeof(T), new System.Object[] {pNativeData});
-// return null;
+ //return null;
}
}
@@ -745,6 +825,7 @@ public class MarshalEflClass : ICustomMarshaler
Eina.Log.Debug("MarshalTest.GetInstance cookie " + cookie);
return new MarshalEflClass();
}
+
public void CleanUpManagedData(object ManagedObj)
{
}
@@ -763,8 +844,11 @@ public class MarshalEflClass : ICustomMarshaler
{
Eina.Log.Debug("MarshalTest.MarshallManagedToNative");
if (ManagedObj == null)
+ {
return IntPtr.Zero;
- var t = (System.Type) ManagedObj;
+ }
+
+ var t = (System.Type)ManagedObj;
return Efl.Eo.ClassRegister.GetKlass(t);
}
@@ -772,194 +856,255 @@ public class MarshalEflClass : ICustomMarshaler
{
Eina.Log.Debug("MarshalTest.MarshalNativeToManaged");
if (pNativeData == IntPtr.Zero)
+ {
return null;
+ }
+
return Efl.Eo.ClassRegister.GetManagedType(pNativeData);
}
}
-public class StringPassOwnershipMarshaler : ICustomMarshaler {
- public object MarshalNativeToManaged(IntPtr pNativeData) {
+public class StringPassOwnershipMarshaler : ICustomMarshaler
+{
+ public object MarshalNativeToManaged(IntPtr pNativeData)
+ {
var ret = Eina.StringConversion.NativeUtf8ToManagedString(pNativeData);
Eina.MemoryNative.Free(pNativeData);
return ret;
}
- public IntPtr MarshalManagedToNative(object managedObj) {
+ public IntPtr MarshalManagedToNative(object managedObj)
+ {
return Eina.MemoryNative.StrDup((string)managedObj);
}
- public void CleanUpNativeData(IntPtr pNativeData) {
+ public void CleanUpNativeData(IntPtr pNativeData)
+ {
// No need to cleanup. C will take care of it.
}
- public void CleanUpManagedData(object managedObj) {
+ public void CleanUpManagedData(object managedObj)
+ {
}
- public int GetNativeDataSize() {
+ public int GetNativeDataSize()
+ {
return -1;
}
- public static ICustomMarshaler GetInstance(string cookie) {
- if (marshaler == null) {
+ public static ICustomMarshaler GetInstance(string cookie)
+ {
+ if (marshaler == null)
+ {
marshaler = new StringPassOwnershipMarshaler();
}
+
return marshaler;
}
+
static private StringPassOwnershipMarshaler marshaler;
}
-public class StringKeepOwnershipMarshaler: ICustomMarshaler {
- public object MarshalNativeToManaged(IntPtr pNativeData) {
+public class StringKeepOwnershipMarshaler: ICustomMarshaler
+{
+ public object MarshalNativeToManaged(IntPtr pNativeData)
+ {
return Eina.StringConversion.NativeUtf8ToManagedString(pNativeData);
}
- public IntPtr MarshalManagedToNative(object managedObj) {
+ public IntPtr MarshalManagedToNative(object managedObj)
+ {
return Eina.StringConversion.ManagedStringToNativeUtf8Alloc((string)managedObj);
}
- public void CleanUpNativeData(IntPtr pNativeData) {
+ public void CleanUpNativeData(IntPtr pNativeData)
+ {
// No need to free. The Native side will keep the ownership.
}
- public void CleanUpManagedData(object managedObj) {
+ public void CleanUpManagedData(object managedObj)
+ {
}
- public int GetNativeDataSize() {
+ public int GetNativeDataSize()
+ {
return -1;
}
- public static ICustomMarshaler GetInstance(string cookie) {
- if (marshaler == null) {
+ public static ICustomMarshaler GetInstance(string cookie)
+ {
+ if (marshaler == null)
+ {
marshaler = new StringKeepOwnershipMarshaler();
}
+
return marshaler;
}
+
static private StringKeepOwnershipMarshaler marshaler;
}
-public class StringsharePassOwnershipMarshaler : ICustomMarshaler {
- public object MarshalNativeToManaged(IntPtr pNativeData) {
+public class StringsharePassOwnershipMarshaler : ICustomMarshaler
+{
+ public object MarshalNativeToManaged(IntPtr pNativeData)
+ {
var ret = Eina.StringConversion.NativeUtf8ToManagedString(pNativeData);
Eina.Stringshare.eina_stringshare_del(pNativeData);
return ret;
}
- public IntPtr MarshalManagedToNative(object managedObj) {
+ public IntPtr MarshalManagedToNative(object managedObj)
+ {
return Eina.Stringshare.eina_stringshare_add((string)managedObj);
}
- public void CleanUpNativeData(IntPtr pNativeData) {
+ public void CleanUpNativeData(IntPtr pNativeData)
+ {
// No need to free as it's for own() parameters.
}
- public void CleanUpManagedData(object managedObj) {
+ public void CleanUpManagedData(object managedObj)
+ {
}
- public int GetNativeDataSize() {
+ public int GetNativeDataSize()
+ {
return -1;
}
- public static ICustomMarshaler GetInstance(string cookie) {
- if (marshaler == null) {
+ public static ICustomMarshaler GetInstance(string cookie)
+ {
+ if (marshaler == null)
+ {
marshaler = new StringsharePassOwnershipMarshaler();
}
+
return marshaler;
}
+
static private StringsharePassOwnershipMarshaler marshaler;
}
-public class StringshareKeepOwnershipMarshaler : ICustomMarshaler {
- public object MarshalNativeToManaged(IntPtr pNativeData) {
+public class StringshareKeepOwnershipMarshaler : ICustomMarshaler
+{
+ public object MarshalNativeToManaged(IntPtr pNativeData)
+ {
return Eina.StringConversion.NativeUtf8ToManagedString(pNativeData);
}
- public IntPtr MarshalManagedToNative(object managedObj) {
+ public IntPtr MarshalManagedToNative(object managedObj)
+ {
return Eina.Stringshare.eina_stringshare_add((string)managedObj);
}
- public void CleanUpNativeData(IntPtr pNativeData) {
+ public void CleanUpNativeData(IntPtr pNativeData)
+ {
// No need to free, as the native side will keep ownership.
}
- public void CleanUpManagedData(object managedObj) {
+ public void CleanUpManagedData(object managedObj)
+ {
}
- public int GetNativeDataSize() {
+ public int GetNativeDataSize()
+ {
return -1;
}
- public static ICustomMarshaler GetInstance(string cookie) {
- if (marshaler == null) {
+ public static ICustomMarshaler GetInstance(string cookie)
+ {
+ if (marshaler == null)
+ {
marshaler = new StringshareKeepOwnershipMarshaler();
}
+
return marshaler;
}
+
static private StringshareKeepOwnershipMarshaler marshaler;
}
-public class StrbufPassOwnershipMarshaler : ICustomMarshaler {
- public object MarshalNativeToManaged(IntPtr pNativeData) {
+public class StrbufPassOwnershipMarshaler : ICustomMarshaler
+{
+ public object MarshalNativeToManaged(IntPtr pNativeData)
+ {
return new Eina.Strbuf(pNativeData, Eina.Ownership.Managed);
}
- public IntPtr MarshalManagedToNative(object managedObj) {
+ public IntPtr MarshalManagedToNative(object managedObj)
+ {
Eina.Strbuf buf = managedObj as Eina.Strbuf;
buf.ReleaseOwnership();
return buf.Handle;
}
- public void CleanUpNativeData(IntPtr pNativeData) {
+ public void CleanUpNativeData(IntPtr pNativeData)
+ {
// No need to cleanup. C will take care of it.
}
- public void CleanUpManagedData(object managedObj) {
+ public void CleanUpManagedData(object managedObj)
+ {
}
- public int GetNativeDataSize() {
+ public int GetNativeDataSize()
+ {
return -1;
}
- public static ICustomMarshaler GetInstance(string cookie) {
- if (marshaler == null) {
+ public static ICustomMarshaler GetInstance(string cookie)
+ {
+ if (marshaler == null)
+ {
marshaler = new StrbufPassOwnershipMarshaler();
}
+
return marshaler;
}
+
static private StrbufPassOwnershipMarshaler marshaler;
}
-public class StrbufKeepOwnershipMarshaler: ICustomMarshaler {
- public object MarshalNativeToManaged(IntPtr pNativeData) {
+public class StrbufKeepOwnershipMarshaler: ICustomMarshaler
+{
+ public object MarshalNativeToManaged(IntPtr pNativeData)
+ {
return new Eina.Strbuf(pNativeData, Eina.Ownership.Unmanaged);
}
- public IntPtr MarshalManagedToNative(object managedObj) {
+ public IntPtr MarshalManagedToNative(object managedObj)
+ {
Eina.Strbuf buf = managedObj as Eina.Strbuf;
return buf.Handle;
}
- public void CleanUpNativeData(IntPtr pNativeData) {
+ public void CleanUpNativeData(IntPtr pNativeData)
+ {
// No need to free. The Native side will keep the ownership.
}
- public void CleanUpManagedData(object managedObj) {
+ public void CleanUpManagedData(object managedObj)
+ {
}
- public int GetNativeDataSize() {
+ public int GetNativeDataSize()
+ {
return -1;
}
- public static ICustomMarshaler GetInstance(string cookie) {
- if (marshaler == null) {
+ public static ICustomMarshaler GetInstance(string cookie)
+ {
+ if (marshaler == null)
+ {
marshaler = new StrbufKeepOwnershipMarshaler();
}
+
return marshaler;
}
+
static private StrbufKeepOwnershipMarshaler marshaler;
}
-
-
} // namespace eo
/// <summary>General exception for errors inside the binding.</summary>
@@ -981,7 +1126,10 @@ public class FutureException : EflException
public FutureException(Eina.Value value) : base("Future failed.")
{
if (value.GetValueType() != Eina.ValueType.Error)
+ {
throw new ArgumentException("FutureException must receive an Eina.Value with Eina.Error.");
+ }
+
Eina.Error err;
value.Get(out err);
Error = err;
diff --git a/src/bindings/mono/eo_mono/workaround.cs b/src/bindings/mono/eo_mono/workaround.cs
index b1f9d9fea7..1ef9ef0aba 100644
--- a/src/bindings/mono/eo_mono/workaround.cs
+++ b/src/bindings/mono/eo_mono/workaround.cs
@@ -51,28 +51,35 @@ public struct EolianPD
}
#pragma warning disable 0169
+
public struct EvasObjectBoxLayout
{
IntPtr o;
IntPtr priv;
IntPtr user_data;
};
+
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Ansi)]
public struct EvasObjectBoxData
{
}
-public struct EvasObjectBoxOption {
+
+public struct EvasObjectBoxOption
+{
IntPtr obj;
[MarshalAsAttribute(UnmanagedType.U1)] bool max_reached;
[MarshalAsAttribute(UnmanagedType.U1)] bool min_reached;
Evas.Coord alloc_size;
};
+
#pragma warning restore 0169
-namespace Efl {
+namespace Efl
+{
[StructLayout(LayoutKind.Sequential)]
-public struct EventDescription {
+public struct EventDescription
+{
public IntPtr Name;
[MarshalAs(UnmanagedType.U1)] public bool Unfreezable;
[MarshalAs(UnmanagedType.U1)] public bool Legacy_is;
@@ -94,12 +101,15 @@ public struct EventDescription {
{
IntPtr data = Efl.Eo.FunctionInterop.LoadFunctionPointer(module, name);
- if (data == IntPtr.Zero) {
+ if (data == IntPtr.Zero)
+ {
string error = Eina.StringConversion.NativeUtf8ToManagedString(Efl.Eo.Globals.dlerror());
throw new Exception(error);
}
+
descriptions.Add(name, data);
}
+
return descriptions[name];
}
};
@@ -107,7 +117,8 @@ public struct EventDescription {
public delegate void EventCb(System.IntPtr data, ref Event.NativeStruct evt);
[StructLayout(LayoutKind.Sequential)]
-public struct TextCursorCursor {
+public struct TextCursorCursor
+{
IntPtr obj;
UIntPtr pos; // UIntPtr to automatically change size_t between 32/64
IntPtr node;
@@ -115,7 +126,8 @@ public struct TextCursorCursor {
}
[StructLayout(LayoutKind.Sequential)]
-public struct TextAnnotateAnnotation {
+public struct TextAnnotateAnnotation
+{
IntPtr list;
IntPtr obj;
IntPtr start_node;
@@ -125,9 +137,11 @@ public struct TextAnnotateAnnotation {
public delegate void SignalCb(IntPtr data, IntPtr obj, IntPtr emission, IntPtr source);
-namespace Access {
+namespace Access
+{
-public struct ActionData {
+public struct ActionData
+{
public IntPtr name;
public IntPtr action;
public IntPtr param;
@@ -138,16 +152,25 @@ public struct ActionData {
} // namespace Efl
-namespace Evas {
+namespace Evas
+{
-public struct Coord {
+public struct Coord
+{
int val;
- public Coord(int value) { val = value; }
- static public implicit operator Coord(int val) {
+ public Coord(int value)
+ {
+ val = value;
+ }
+
+ static public implicit operator Coord(int val)
+ {
return new Coord(val);
}
- static public implicit operator int(Coord coord) {
+
+ static public implicit operator int(Coord coord)
+ {
return coord.val;
}
}
@@ -155,44 +178,44 @@ public struct Coord {
/* Copied from Evas_Legacy.h */
public enum TextStyleType
{
- ///<summary> plain, standard text.</summary>
- Plain = 0,
- ///<summary> text with shadow underneath.</summary>
- Shadow,
- ///<summary> text with an outline.</summary>
- Outline,
- ///<summary> text with a soft outline.</summary>
- SoftOutline,
- ///<summary> text with a glow effect.</summary>
- Glow,
- ///<summary> text with both outline and shadow effects.</summary>
- OutlineShadow,
- ///<summary> text with (far) shadow underneath.</summary>
- FarShadow,
- ///<summary> text with outline and soft shadow effects combined.</summary>
- OutlineSoftShadow,
- ///<summary> text with (soft) shadow underneath.</summary>
- SoftShadow,
- ///<summary> text with (far soft) shadow underneath.</summary>
- FarSoftShadow,
-
- // Shadow direction modifiers
- ///<summary> shadow growing to bottom right.</summary>
- ShadowDirectionBottomRight = 0 /* 0 >> 4 */,
- ///<summary> shadow growing to the bottom.</summary>
- ShadowDirectionBottom= 16 /* 1 >> 4 */,
- ///<summary> shadow growing to bottom left.</summary>
- ShadowDirectionBottomLeft = 32 /* 2 >> 4 */,
- ///<summary> shadow growing to the left.</summary>
- ShadowDirectionLeft = 48 /* 3 >> 4 */,
- ///<summary> shadow growing to top left.</summary>
- ShadowDirectionTopLeft = 64 /* 4 >> 4 */,
- ///<summary> shadow growing to the top.</summary>
- ShadowDirectionTop = 80 /* 5 >> 4 */,
- ///<summary> shadow growing to top right.</summary>
- ShadowDirectionTopRight = 96 /* 6 >> 4 */,
- ///<summary> shadow growing to the right.</summary>
- ShadowDirectionRight = 112 /* 7 >> 4 */
+ ///<summary> plain, standard text.</summary>
+ Plain = 0,
+ ///<summary> text with shadow underneath.</summary>
+ Shadow,
+ ///<summary> text with an outline.</summary>
+ Outline,
+ ///<summary> text with a soft outline.</summary>
+ SoftOutline,
+ ///<summary> text with a glow effect.</summary>
+ Glow,
+ ///<summary> text with both outline and shadow effects.</summary>
+ OutlineShadow,
+ ///<summary> text with (far) shadow underneath.</summary>
+ FarShadow,
+ ///<summary> text with outline and soft shadow effects combined.</summary>
+ OutlineSoftShadow,
+ ///<summary> text with (soft) shadow underneath.</summary>
+ SoftShadow,
+ ///<summary> text with (far soft) shadow underneath.</summary>
+ FarSoftShadow,
+
+ // Shadow direction modifiers
+ ///<summary> shadow growing to bottom right.</summary>
+ ShadowDirectionBottomRight = 0 /* 0 >> 4 */,
+ ///<summary> shadow growing to the bottom.</summary>
+ ShadowDirectionBottom = 16 /* 1 >> 4 */,
+ ///<summary> shadow growing to bottom left.</summary>
+ ShadowDirectionBottomLeft = 32 /* 2 >> 4 */,
+ ///<summary> shadow growing to the left.</summary>
+ ShadowDirectionLeft = 48 /* 3 >> 4 */,
+ ///<summary> shadow growing to top left.</summary>
+ ShadowDirectionTopLeft = 64 /* 4 >> 4 */,
+ ///<summary> shadow growing to the top.</summary>
+ ShadowDirectionTop = 80 /* 5 >> 4 */,
+ ///<summary> shadow growing to top right.</summary>
+ ShadowDirectionTopRight = 96 /* 6 >> 4 */,
+ ///<summary> shadow growing to the right.</summary>
+ ShadowDirectionRight = 112 /* 7 >> 4 */
};
} // namespace Evas
@@ -201,8 +224,8 @@ public enum TextStyleType
public delegate int Eina_Compare_Cb(IntPtr a, IntPtr b);
public delegate void ElmInterfaceScrollableCb(IntPtr obj, IntPtr data);
public delegate void ElmInterfaceScrollableMinLimitCb(IntPtr obj,
- [MarshalAsAttribute(UnmanagedType.U1)]bool w,
- [MarshalAsAttribute(UnmanagedType.U1)]bool h);
+ [MarshalAsAttribute(UnmanagedType.U1)]bool w,
+ [MarshalAsAttribute(UnmanagedType.U1)]bool h);
public delegate void ElmInterfaceScrollableResizeCb(IntPtr obj, Evas.Coord w, Evas.Coord h);
[return: MarshalAsAttribute(UnmanagedType.U1)]
public delegate bool ElmMultibuttonentryItemFilterCb(IntPtr obj, IntPtr item_label, IntPtr item_data, IntPtr data);
diff --git a/src/lib/ecore/Ecore_Common.h b/src/lib/ecore/Ecore_Common.h
index 6b0d94974b..1530036e63 100644
--- a/src/lib/ecore/Ecore_Common.h
+++ b/src/lib/ecore/Ecore_Common.h
@@ -67,7 +67,7 @@ EAPI int ecore_shutdown(void);
* should call ecore_init() first, then register your callback on
* @c EFL_LOOP_EVENT_ARGUMENTS and finally call ecore_init_ex().
*
- * Once you are shuting down your program, you should symetrically
+ * Once you are shuting down your program, you should symmetrically
* call ecore_shutdown_ex().
*/
EAPI unsigned int ecore_init_ex(int argc, char **argv);
diff --git a/src/lib/ecore/ecore.c b/src/lib/ecore/ecore.c
index 1c8c6ec960..ceb3021019 100644
--- a/src/lib/ecore/ecore.c
+++ b/src/lib/ecore/ecore.c
@@ -571,10 +571,13 @@ ecore_fork_reset(void)
EINA_LIST_FOREACH_SAFE(_thread_cb, l, ln, call)
{
- if (call->suspend || call->sync) continue;
- if (call->cb.async != (Ecore_Cb)&_ecore_thread_join) continue;
- _thread_cb = eina_list_remove_list(_thread_cb, l);
- free(call);
+ //if something is supsend, then the mainloop will be blocked until until thread is calling ecore_thread_main_loop_end()
+ //if something tries to join a thread as callback, ensure that we remove this
+ if (call->suspend || (call->cb.async == (Ecore_Cb)&_ecore_thread_join))
+ {
+ _thread_cb = eina_list_remove_list(_thread_cb, l);
+ free(call);
+ }
}
if (_thread_cb) ecore_pipe_write(_thread_call, &wakeup, sizeof (int));
}
@@ -686,7 +689,7 @@ ecore_thread_main_loop_begin(void)
return ++_thread_loop;
}
- order = malloc(sizeof (Ecore_Safe_Call));
+ order = calloc(1, sizeof (Ecore_Safe_Call));
if (!order) return -1;
eina_lock_take(&_thread_id_lock);
diff --git a/src/lib/ecore/efl_exe.eo b/src/lib/ecore/efl_exe.eo
index 9f72137ed4..cd71af6a0c 100644
--- a/src/lib/ecore/efl_exe.eo
+++ b/src/lib/ecore/efl_exe.eo
@@ -44,7 +44,7 @@ class @beta Efl.Exe extends Efl.Task implements Efl.Io.Reader, Efl.Io.Writer, Ef
}
@property env {
[[ If $env is $null then the process created by this object is
- going to inherit the enviroment of this process.
+ going to inherit the environment of this process.
In case $env is not $null then the environment variables declared
in this object will represent the environment passed to the new process.
diff --git a/src/lib/ecore_cocoa/Ecore_Cocoa.h b/src/lib/ecore_cocoa/Ecore_Cocoa.h
index e0baf8c6d2..36f17b490b 100644
--- a/src/lib/ecore_cocoa/Ecore_Cocoa.h
+++ b/src/lib/ecore_cocoa/Ecore_Cocoa.h
@@ -47,7 +47,7 @@ typedef struct _Ecore_Cocoa_Screen Ecore_Cocoa_Screen;
/**
* @typedef Ecore_Cocoa_Object
- * Opaque handler to refer to an objective-c object (aka id)
+ * Opaque handler to refer to an objective-c object (a.k.a. id)
* @since 1.18
*/
typedef void Ecore_Cocoa_Object;
diff --git a/src/lib/ecore_con/ecore_con.c b/src/lib/ecore_con/ecore_con.c
index 7c6e93e62f..a781025d7b 100644
--- a/src/lib/ecore_con/ecore_con.c
+++ b/src/lib/ecore_con/ecore_con.c
@@ -38,11 +38,8 @@
# include <systemd/sd-daemon.h>
#endif
-#ifdef HAVE_WS2TCPIP_H
-# include <ws2tcpip.h>
-#endif
-
#ifdef _WIN32
+# include <ws2tcpip.h>
# include <Evil.h>
#endif
diff --git a/src/lib/ecore_con/ecore_con_local.c b/src/lib/ecore_con/ecore_con_local.c
index e91819ec42..5fed0b711e 100644
--- a/src/lib/ecore_con/ecore_con_local.c
+++ b/src/lib/ecore_con/ecore_con_local.c
@@ -17,7 +17,7 @@
# include <systemd/sd-daemon.h>
#endif
-#ifdef HAVE_WS2TCPIP_H
+#ifdef _WIN32
# include <ws2tcpip.h>
#endif
diff --git a/src/lib/ecore_con/ecore_con_socks.c b/src/lib/ecore_con/ecore_con_socks.c
index 8138b26525..08f5585381 100644
--- a/src/lib/ecore_con/ecore_con_socks.c
+++ b/src/lib/ecore_con/ecore_con_socks.c
@@ -34,11 +34,8 @@
# include <net/if.h>
#endif
-#ifdef HAVE_WS2TCPIP_H
-# include <ws2tcpip.h>
-#endif
-
#ifdef _WIN32
+# include <ws2tcpip.h>
# include <Evil.h>
#endif
diff --git a/src/lib/ecore_con/ecore_con_url_curl.c b/src/lib/ecore_con/ecore_con_url_curl.c
index e0d5f93c6b..6e8d9e73c3 100644
--- a/src/lib/ecore_con/ecore_con_url_curl.c
+++ b/src/lib/ecore_con/ecore_con_url_curl.c
@@ -8,7 +8,7 @@
#include <sys/types.h>
#include <unistd.h>
-#ifdef HAVE_WS2TCPIP_H
+#ifdef _WIN32
# include <ws2tcpip.h>
#endif
diff --git a/src/lib/ecore_con/efl_net_dialer_http.eo b/src/lib/ecore_con/efl_net_dialer_http.eo
index ae06b397fa..f5a6fac38d 100644
--- a/src/lib/ecore_con/efl_net_dialer_http.eo
+++ b/src/lib/ecore_con/efl_net_dialer_http.eo
@@ -72,7 +72,7 @@ class @beta Efl.Net.Dialer_Http extends Efl.Loop_Consumer implements Efl.Net.Dia
- If @Efl.Net.Dialer_Http_Primary_Mode.auto, then
@Efl.Net.Dialer_Http_Primary_Mode.download or
@Efl.Net.Dialer_Http_Primary_Mode.upload will be
- choosen based on the @.method: if "PUT", then it's
+ chosen based on the @.method: if "PUT", then it's
upload, otherwise it's download.
- If @Efl.Net.Dialer_Http_Primary_Mode.upload, applying
diff --git a/src/lib/ecore_con/meson.build b/src/lib/ecore_con/meson.build
index 743904285c..eacf16f720 100644
--- a/src/lib/ecore_con/meson.build
+++ b/src/lib/ecore_con/meson.build
@@ -2,10 +2,7 @@ ecore_con_deps = []
ecore_con_pub_deps = [eina, eo, efl, ecore]
if sys_windows == true
- ipv6 = cc.compiles('''
- #include <ws2tcpip.h>
- struct ipv6_mreq tmp;
- ''')
+ ipv6 = true
else
ipv6 = cc.compiles('''
#include <netinet/in.h>
diff --git a/src/lib/ecore_wl2/Ecore_Wl2.h b/src/lib/ecore_wl2/Ecore_Wl2.h
index 5d3ccfb2fc..d2fc4048d1 100644
--- a/src/lib/ecore_wl2/Ecore_Wl2.h
+++ b/src/lib/ecore_wl2/Ecore_Wl2.h
@@ -1482,7 +1482,7 @@ EAPI Ecore_Wl2_Offer* ecore_wl2_dnd_selection_get(Ecore_Wl2_Input *input);
*
* @param types a null-terminated array of mimetypes supported by the client
*
- * @return serial of request on sucess, 0 on failure
+ * @return serial of request on success, 0 on failure
*
* @ingroup Ecore_Wl2_Dnd_Group
* @since 1.17
@@ -1494,7 +1494,7 @@ EAPI uint32_t ecore_wl2_dnd_selection_set(Ecore_Wl2_Input *input, const char **t
*
* @param input the input to clear
*
- * @return serial of request on sucess, 0 on failure
+ * @return serial of request on success, 0 on failure
*
* @ingroup Ecore_Wl2_Dnd_Group
* @since 1.17
diff --git a/src/lib/ecore_x/Ecore_X.h b/src/lib/ecore_x/Ecore_X.h
index cb55dfa3ee..223bc912ae 100644
--- a/src/lib/ecore_x/Ecore_X.h
+++ b/src/lib/ecore_x/Ecore_X.h
@@ -2763,7 +2763,7 @@ EAPI Eina_Bool ecore_x_window_keygrab_unset(Ecore_X_
//this API for keyrouter protocol
EAPI void ecore_x_e_keyrouter_set(Ecore_X_Window root, Eina_Bool on); /**< @since 1.15 */ //Key router set keyrouter flag using this
-EAPI Eina_Bool ecore_x_e_keyrouter_get(Ecore_X_Window root); /**< @since 1.15 */ //Client check the existance of keyrouter using this
+EAPI Eina_Bool ecore_x_e_keyrouter_get(Ecore_X_Window root); /**< @since 1.15 */ //Client check the existence of keyrouter using this
#ifdef EFL_BETA_API_SUPPORT
// XXX: FIXME: re-evaluate this after looking at xdg foreign in wayland
diff --git a/src/lib/ector/Ector.h b/src/lib/ector/Ector.h
index 729f4e5280..01a71d6e6e 100644
--- a/src/lib/ector/Ector.h
+++ b/src/lib/ector/Ector.h
@@ -100,7 +100,7 @@ typedef Eo Ector_Renderer;
/**
* @typedef Ector_Colorspace
- * The definiton of colorspace.
+ * The definition of colorspace.
*/
// FIXME: Enable this when we have merged Emile
/* typedef Evas_Colorspace Ector_Colorspace; */
diff --git a/src/lib/edje/Edje_Legacy.h b/src/lib/edje/Edje_Legacy.h
index 5f0b6b41d8..52b3075629 100644
--- a/src/lib/edje/Edje_Legacy.h
+++ b/src/lib/edje/Edje_Legacy.h
@@ -426,7 +426,7 @@ EAPI int edje_object_freeze(Evas_Object *obj);
*
* This function thaws the given Edje object.
*
- * @note If sucessive freezes were done, an equal number of thaws will be
+ * @note If successive freezes were done, an equal number of thaws will be
* required.
*
* See also @ref edje_object_freeze()
diff --git a/src/lib/edje/edje_convert.h b/src/lib/edje/edje_convert.h
index be7bac45eb..e199d1bcad 100644
--- a/src/lib/edje/edje_convert.h
+++ b/src/lib/edje/edje_convert.h
@@ -193,13 +193,13 @@ Edje_Part_Collection *_edje_collection_convert(Edje_File *file,
Old_Edje_Part_Collection *oedc);
/**
- * Convert old Edje part descripton into new format.
+ * Convert old Edje part description into new format.
*
* @param type The edje par description common type
* @param ce an edje collection directory entry
- * @param the old edje part descripton
+ * @param the old edje part description
*
- * @return a new edje part descripton common
+ * @return a new edje part description common
*/
Edje_Part_Description_Common *_edje_description_convert(int type,
Edje_Part_Collection_Directory_Entry *ce,
diff --git a/src/lib/edje/efl_layout_calc.eo b/src/lib/edje/efl_layout_calc.eo
index 8864691313..c022dca900 100644
--- a/src/lib/edje/efl_layout_calc.eo
+++ b/src/lib/edje/efl_layout_calc.eo
@@ -90,7 +90,7 @@ interface Efl.Layout.Calc
This function thaws (in other words "unfreezes") the given layout
object.
- Note: If sucessive freezes were done, an equal number of thaws will
+ Note: If successive freezes were done, an equal number of thaws will
be required.
See also @.calc_freeze.
diff --git a/src/lib/edje/efl_layout_signal.eo b/src/lib/edje/efl_layout_signal.eo
index df2f234bc9..1b49fd1fd0 100644
--- a/src/lib/edje/efl_layout_signal.eo
+++ b/src/lib/edje/efl_layout_signal.eo
@@ -9,7 +9,7 @@
*/
function EflLayoutSignalCb {
- [[EflLayoutSignalCb function that is called when a specifc pair of signal/emision is triggered
+ [[EflLayoutSignalCb function that is called when a specifc pair of signal/emission is triggered
@since 1.22
]]
diff --git a/src/lib/eet/Eet.h b/src/lib/eet/Eet.h
index fdace0f720..25babe1578 100644
--- a/src/lib/eet/Eet.h
+++ b/src/lib/eet/Eet.h
@@ -1467,7 +1467,7 @@ eet_data_image_header_read_cipher(Eet_File *ef,
/**
* @ingroup Eet_File_Image_Group
- * @brief Gets the colorspace Eet can decode into of a given eet image ressource.
+ * @brief Gets the colorspace Eet can decode into of a given eet image resource.
*
* @param ef A valid eet file handle opened for reading.
* @param name Name of the entry. eg: "/base/file_i_want".
diff --git a/src/lib/efl/interfaces/efl_file.eo b/src/lib/efl/interfaces/efl_file.eo
index 6711dfb579..7d1ee49114 100644
--- a/src/lib/efl/interfaces/efl_file.eo
+++ b/src/lib/efl/interfaces/efl_file.eo
@@ -1,5 +1,4 @@
import eina_types;
-import efl_gfx_types;
mixin Efl.File requires Efl.Object {
[[Efl file interface
@@ -10,23 +9,21 @@ mixin Efl.File requires Efl.Object {
@property mmap {
set {
[[Set the mmaped file from where an object will fetch the real
- data (it must be an Eina_File).
+ data (it must be an @Eina.File).
If mmap is set during object construction, the object will automatically
call @.load during the finalize phase of construction.
-
- ]]
+ ]]
return: Eina.Error; [[0 on success, error code otherwise]]
}
get {
[[Get the mmaped file from where an object will fetch the real
- data (it must be an Eina_File).
-
- ]]
+ data (it must be an @Eina.File).
+ ]]
}
values {
- f: ptr(const(Eina.File)); [[The handle to an Eina_File that will be used]]
+ f: ptr(const(Eina.File)); [[The handle to the @Eina.File that will be used]]
}
}
@property file {
@@ -42,7 +39,8 @@ mixin Efl.File requires Efl.Object {
get {
[[Retrieve the file path from where an object is to fetch the data.
- You must not modify the strings on the returned pointers.]]
+ You must not modify the strings on the returned pointers.
+ ]]
}
values {
file: string; [[The file path.]]
@@ -60,15 +58,16 @@ mixin Efl.File requires Efl.Object {
[[Get the previously-set key which corresponds to the target data within a file.
Some filetypes can contain multiple data streams which are indexed by
- a key. Use this property for such cases.
+ a key. Use this property for such cases (See for example @Efl.Ui.Image or
+ @Efl.Ui.Layout).
- You must not modify the strings on the returned pointers.]]
+ You must not modify the strings on the returned pointers.
+ ]]
}
values {
- key: string; [[The group that the image belongs to, in case
- it's an EET(including Edje case) file. This can be used
- as a key inside evas image cache if this is a normal image
- file not eet file.]]
+ key: string; [[The group that the data belongs to. See the class documentation
+ for particular implementations of this interface to see how this
+ property is used.]]
}
}
@property loaded {
@@ -77,7 +76,7 @@ mixin Efl.File requires Efl.Object {
]]
}
values {
- loaded: bool; [[True if the object is loaded, otherwise false.]]
+ loaded: bool; [[$true if the object is loaded, $false otherwise.]]
}
}
@@ -89,9 +88,10 @@ mixin Efl.File requires Efl.Object {
open the file and call @.mmap.set on the object using the opened file handle.
Calling @.load on an object which has already performed file operations based on
- the currently set properties will have no effect.]]
+ the currently set properties will have no effect.
+ ]]
- return: Eina.Error; [[0 on success, error code otherwise]]
+ return: Eina.Error; [[0 on success, error code otherwise]]
}
unload {
diff --git a/src/lib/efl/interfaces/efl_pack_layout.eo b/src/lib/efl/interfaces/efl_pack_layout.eo
index 2760886705..19bda9a6b8 100644
--- a/src/lib/efl/interfaces/efl_pack_layout.eo
+++ b/src/lib/efl/interfaces/efl_pack_layout.eo
@@ -17,9 +17,9 @@ interface @beta Efl.Pack_Layout
[[Implementation of this container's layout algorithm.
EFL will call this function whenever the contents of this
- container need to be re-layed out on the canvas.
+ container need to be re-laid out on the canvas.
- This can be overriden to implement custom layout behaviours.
+ This can be overriden to implement custom layout behaviors.
]]
}
}
diff --git a/src/lib/eina/eina_promise.h b/src/lib/eina/eina_promise.h
index 428da12afa..9de125463e 100644
--- a/src/lib/eina/eina_promise.h
+++ b/src/lib/eina/eina_promise.h
@@ -52,7 +52,7 @@ typedef struct _Eina_Future_Cb_Log_Desc Eina_Future_Cb_Log_Desc;
*
* @return An Eina_Value to pass to the next Eina_Future in the chain (if any).
* If there is no need to convert the received value, it's @b recommended
- * to pass-thru @p value argument. If you need to convert to a different type
+ * to passthrough @p value argument. If you need to convert to a different type
* or generate a new value, use @c eina_value_setup() on @b another Eina_Value
* and return it. By returning a promise Eina_Value (eina_promise_as_value()) the
* whole chain will wait until the promise is resolved in
@@ -205,7 +205,7 @@ typedef void (*Eina_Promise_Cancel_Cb) (void *data, const Eina_Promise *dead_pro
* @param[in] value The operation result
* @return An Eina_Value to pass to the next Eina_Future in the chain (if any).
* If there is no need to convert the received value, it's @b recommended
- * to pass-thru @p value argument. If you need to convert to a different type
+ * to passthrough @p value argument. If you need to convert to a different type
* or generate a new value, use @c eina_value_setup() on @b another Eina_Value
* and return it. By returning a promise Eina_Value (eina_promise_as_value()) the
* whole chain will wait until the promise is resolved in
@@ -302,7 +302,7 @@ struct _Eina_Future_Cb_Easy_Desc {
* may also return a non-error, in this case the next future in chain will receive a regular
* value, which may call its @c success.
*
- * If this function is not provided, then it will pass thru the error to the next error handler.
+ * If this function is not provided, then it will passthrough the error to the next error handler.
*
* It may be called with @c EINVAL if @c success_type is provided and doesn't
* match the received type.
diff --git a/src/lib/eio/efl_io_manager.eo b/src/lib/eio/efl_io_manager.eo
index 2ce5fbe978..b81ba4cc29 100644
--- a/src/lib/eio/efl_io_manager.eo
+++ b/src/lib/eio/efl_io_manager.eo
@@ -109,7 +109,7 @@ class @beta Efl.Io.Manager extends Efl.Loop_Consumer
[[Closes an open Eina.File.]]
params {
@in file: ptr(Eina.File); [[Eina file handle]]
- // Here we're just interested whether the promise was fullfilled or not. No value needed.
+ // Here we're just interested whether the promise was fulfilled or not. No value needed.
}
return: future<int> @owned; [[Close return code]]
}
diff --git a/src/lib/eio/efl_io_model.c b/src/lib/eio/efl_io_model.c
index f023ea7597..300dac0e21 100644
--- a/src/lib/eio/efl_io_model.c
+++ b/src/lib/eio/efl_io_model.c
@@ -57,6 +57,21 @@ _eio_file_error_cb(void *data, Eio_File *handler, int error)
pd->request.move = NULL;
}
+
+static Eina_Bool
+_already_added(Efl_Io_Model_Data *pd, const char *path)
+{
+ Efl_Io_Model_Info *mi;
+ Eina_List *node;
+
+ EINA_LIST_FOREACH(pd->files, node, mi)
+ {
+ if (!strcmp(mi->path, path))
+ return EINA_TRUE;
+ }
+ return EINA_FALSE;
+}
+
/**
* Callbacks
* Ecore Events
@@ -78,6 +93,9 @@ _efl_model_evt_added_ecore_cb(void *data, int type, void *event)
if (ev->monitor != pd->monitor) return EINA_TRUE;
+ if (_already_added(pd, ev->filename))
+ return EINA_TRUE;
+
obj = pd->self;
path = ecore_file_dir_get(ev->filename);
@@ -704,6 +722,8 @@ _efl_io_model_children_list(void *data, Eina_Array *entries)
{
Efl_Io_Model_Info *mi;
+ if (_already_added(pd, info->path)) continue;
+
if (pd->filter.cb)
{
if (!pd->filter.cb(pd->filter.data, obj, info))
@@ -733,18 +753,6 @@ _efl_io_model_children_list(void *data, Eina_Array *entries)
efl_event_callback_call(obj, EFL_MODEL_EVENT_CHILDREN_COUNT_CHANGED, NULL);
}
-static Eina_Value
-_efl_io_model_children_list_on(Eo *o EINA_UNUSED, void *data, const Eina_Value v)
-{
- Efl_Io_Model_Data *pd = data;
-
- // Now that we have listed the content of the directory,
- // we can whatch over it
- _efl_io_model_efl_model_monitor_add(pd);
-
- return v;
-}
-
static void
_efl_io_model_children_list_cleanup(Eo *o EINA_UNUSED, void *data, const Eina_Future *dead_future EINA_UNUSED)
{
@@ -787,8 +795,10 @@ _efl_io_model_efl_model_children_count_get(const Eo *obj, Efl_Io_Model_Data *pd)
f = efl_io_manager_direct_ls(iom, pd->path, EINA_FALSE,
(void*) obj, _efl_io_model_children_list, NULL);
+ //start monitoring before listing is done
+ //we will filter later on if we already published a file or not
+ _efl_io_model_efl_model_monitor_add(pd);
pd->request.listing = efl_future_then(obj, f,
- .success = _efl_io_model_children_list_on,
.free = _efl_io_model_children_list_cleanup,
.data = pd);
}
diff --git a/src/lib/eio/eio_monitor_poll.c b/src/lib/eio/eio_monitor_poll.c
index 2788aee84e..55cdff6fbf 100644
--- a/src/lib/eio/eio_monitor_poll.c
+++ b/src/lib/eio/eio_monitor_poll.c
@@ -196,7 +196,7 @@ _eio_monitor_fallback_heavy_cb(void *data, Ecore_Thread *thread)
}
cmp->version = backend->version;
- if (ecore_thread_check(thread)) break;
+ if (thread && ecore_thread_check(thread)) break;
}
if (it) eina_iterator_free(it);
@@ -346,6 +346,9 @@ eio_monitor_fallback_add(Eio_Monitor *monitor)
backend->parent = monitor;
monitor->backend = backend;
monitor->fallback = EINA_TRUE;
+
+ //ensure this is initialized here
+ _eio_monitor_fallback_heavy_cb(backend, NULL);
backend->work = ecore_thread_run(_eio_monitor_fallback_heavy_cb,
_eio_monitor_fallback_end_cb,
_eio_monitor_fallback_cancel_cb,
diff --git a/src/lib/elementary/efl_page_indicator.c b/src/lib/elementary/efl_page_indicator.c
index 6b0be267b2..57cd2bf9f9 100644
--- a/src/lib/elementary/efl_page_indicator.c
+++ b/src/lib/elementary/efl_page_indicator.c
@@ -43,14 +43,6 @@ _efl_page_indicator_unpack(Eo *obj EINA_UNUSED,
}
EOLIAN static void
-_efl_page_indicator_unpack_all(Eo *obj EINA_UNUSED,
- Efl_Page_Indicator_Data *pd)
-{
- pd->cnt = 0;
- pd->curr_idx = -1;
-}
-
-EOLIAN static void
_efl_page_indicator_bind(Eo *obj EINA_UNUSED,
Efl_Page_Indicator_Data *pd,
Eo *pager,
@@ -80,7 +72,6 @@ EOAPI EFL_VOID_FUNC_BODYV(efl_page_indicator_pack,
EFL_FUNC_CALL(index), int index)
EOAPI EFL_VOID_FUNC_BODYV(efl_page_indicator_unpack,
EFL_FUNC_CALL(index), int index)
-EOAPI EFL_VOID_FUNC_BODY(efl_page_indicator_unpack_all)
#define EFL_PAGE_INDICATOR_EXTRA_OPS \
EFL_OBJECT_OP_FUNC(efl_page_indicator_update, \
@@ -88,8 +79,6 @@ EOAPI EFL_VOID_FUNC_BODY(efl_page_indicator_unpack_all)
EFL_OBJECT_OP_FUNC(efl_page_indicator_pack, \
_efl_page_indicator_pack), \
EFL_OBJECT_OP_FUNC(efl_page_indicator_unpack, \
- _efl_page_indicator_unpack), \
- EFL_OBJECT_OP_FUNC(efl_page_indicator_unpack_all, \
- _efl_page_indicator_unpack_all)
+ _efl_page_indicator_unpack)
#include "efl_page_indicator.eo.c"
diff --git a/src/lib/elementary/efl_page_indicator_icon.c b/src/lib/elementary/efl_page_indicator_icon.c
index 55326cfdd6..3c9c54e75e 100644
--- a/src/lib/elementary/efl_page_indicator_icon.c
+++ b/src/lib/elementary/efl_page_indicator_icon.c
@@ -110,22 +110,6 @@ _efl_page_indicator_icon_unpack(Eo *obj,
}
EOLIAN static void
-_efl_page_indicator_icon_unpack_all(Eo *obj,
- Efl_Page_Indicator_Icon_Data *pd)
-{
- Eo *item;
-
- EINA_LIST_FREE(pd->items, item)
- {
- efl_del(item);
- }
-
- pd->curr = NULL;
-
- efl_page_indicator_unpack_all(efl_super(obj, MY_CLASS));
-}
-
-EOLIAN static void
_efl_page_indicator_icon_efl_page_indicator_bind(Eo *obj,
Efl_Page_Indicator_Icon_Data *pd,
Eo *pager,
@@ -184,8 +168,6 @@ _efl_page_indicator_icon_efl_page_indicator_bind(Eo *obj,
EFL_OBJECT_OP_FUNC(efl_page_indicator_pack, \
_efl_page_indicator_icon_pack), \
EFL_OBJECT_OP_FUNC(efl_page_indicator_unpack, \
- _efl_page_indicator_icon_unpack), \
- EFL_OBJECT_OP_FUNC(efl_page_indicator_unpack_all, \
- _efl_page_indicator_icon_unpack_all)
+ _efl_page_indicator_icon_unpack)
#include "efl_page_indicator_icon.eo.c"
diff --git a/src/lib/elementary/efl_page_transition.c b/src/lib/elementary/efl_page_transition.c
index f6d73a2c10..3740a6996d 100644
--- a/src/lib/elementary/efl_page_transition.c
+++ b/src/lib/elementary/efl_page_transition.c
@@ -72,14 +72,6 @@ _efl_page_transition_pack(Eo *obj EINA_UNUSED,
}
EOLIAN static void
-_efl_page_transition_unpack_all(Eo *obj EINA_UNUSED,
- Efl_Page_Transition_Data *pd EINA_UNUSED,
- int index EINA_UNUSED)
-{
-
-}
-
-EOLIAN static void
_efl_page_transition_curr_page_change(Eo *obj EINA_UNUSED,
Efl_Page_Transition_Data *pd EINA_UNUSED,
int diff EINA_UNUSED)
@@ -102,7 +94,6 @@ EOAPI EFL_VOID_FUNC_BODYV(efl_page_transition_update,
EFL_FUNC_CALL(move), double move)
EOAPI EFL_VOID_FUNC_BODYV(efl_page_transition_pack,
EFL_FUNC_CALL(index), int index)
-EOAPI EFL_VOID_FUNC_BODY(efl_page_transition_unpack_all)
EOAPI EFL_VOID_FUNC_BODYV(efl_page_transition_curr_page_change,
EFL_FUNC_CALL(diff), int diff)
EOAPI EFL_VOID_FUNC_BODYV(efl_page_transition_page_size_set,
@@ -118,8 +109,6 @@ EOAPI EFL_FUNC_BODYV(efl_page_transition_loop_set, Eina_Bool, 0,
_efl_page_transition_update), \
EFL_OBJECT_OP_FUNC(efl_page_transition_pack, \
_efl_page_transition_pack), \
- EFL_OBJECT_OP_FUNC(efl_page_transition_unpack_all, \
- _efl_page_transition_unpack_all), \
EFL_OBJECT_OP_FUNC(efl_page_transition_curr_page_change, \
_efl_page_transition_curr_page_change), \
EFL_OBJECT_OP_FUNC(efl_page_transition_page_size_set, \
diff --git a/src/lib/elementary/efl_page_transition_scroll.c b/src/lib/elementary/efl_page_transition_scroll.c
index 3908710cc6..5c5cb9aa11 100644
--- a/src/lib/elementary/efl_page_transition_scroll.c
+++ b/src/lib/elementary/efl_page_transition_scroll.c
@@ -413,24 +413,6 @@ _efl_page_transition_scroll_pack(Eo *obj,
}
EOLIAN static void
-_efl_page_transition_scroll_unpack_all(Eo *obj EINA_UNUSED,
- Efl_Page_Transition_Scroll_Data *pd)
-{
- Eina_List *list;
- Page_Info *pi;
-
- EINA_LIST_FOREACH(pd->page_infos, list, pi)
- {
- efl_pack_unpack(pi->obj, pi->content);
-
- pi->content_num = -1;
- pi->content = NULL;
- pi->visible = EINA_FALSE;
- }
- return;
-}
-
-EOLIAN static void
_efl_page_transition_scroll_curr_page_change(Eo *obj EINA_UNUSED,
Efl_Page_Transition_Scroll_Data *pd,
int diff)
@@ -674,8 +656,6 @@ _efl_page_transition_scroll_efl_object_invalidate(Eo *obj,
_efl_page_transition_scroll_update), \
EFL_OBJECT_OP_FUNC(efl_page_transition_pack, \
_efl_page_transition_scroll_pack), \
- EFL_OBJECT_OP_FUNC(efl_page_transition_unpack_all, \
- _efl_page_transition_scroll_unpack_all), \
EFL_OBJECT_OP_FUNC(efl_page_transition_curr_page_change, \
_efl_page_transition_scroll_curr_page_change), \
EFL_OBJECT_OP_FUNC(efl_page_transition_page_size_set, \
diff --git a/src/lib/elementary/efl_ui_focus_manager.eo b/src/lib/elementary/efl_ui_focus_manager.eo
index 523c5d3902..29740a3322 100644
--- a/src/lib/elementary/efl_ui_focus_manager.eo
+++ b/src/lib/elementary/efl_ui_focus_manager.eo
@@ -205,6 +205,6 @@ interface Efl.Ui.Focus.Manager {
flush,pre: void; [[After this event, the manager object will calculate relations in the graph. Can be used to add / remove children in a lazy fashion.]]
coords,dirty: void; [[Cached relationship calculation results have been invalidated.]]
manager_focus,changed : Efl.Ui.Focus.Object; [[The manager_focus property has changed. The previously focused object is passed as an event argument.]]
- dirty_logic_freeze,changed : bool; [[Called when this focus manager is frozen or thawed, even_info beeing $true indicates that it is now frozen, $false indicates that it is thawed.]]
+ dirty_logic_freeze,changed : bool; [[Called when this focus manager is frozen or thawed, even_info being $true indicates that it is now frozen, $false indicates that it is thawed.]]
}
}
diff --git a/src/lib/elementary/efl_ui_image.eo b/src/lib/elementary/efl_ui_image.eo
index cae449fa06..5202850d36 100644
--- a/src/lib/elementary/efl_ui_image.eo
+++ b/src/lib/elementary/efl_ui_image.eo
@@ -23,7 +23,11 @@ class @beta Efl.Ui.Image extends Efl.Ui.Widget implements Efl.Ui.Clickable, Efl.
Efl.Layout.Calc,
Efl.Layout.Group, Efl.Layout.Signal
{
- [[ Efl UI image class]]
+ [[Efl UI image class
+
+ When loading images from a file, the @Efl.File.key property can be used to access different
+ streams. For example, when accessing Evas image caches.
+ ]]
event_prefix: efl_ui_image;
methods {
@property scalable {
diff --git a/src/lib/elementary/efl_ui_layout.eo b/src/lib/elementary/efl_ui_layout.eo
index 8738f3dce8..bdc81db9c2 100644
--- a/src/lib/elementary/efl_ui_layout.eo
+++ b/src/lib/elementary/efl_ui_layout.eo
@@ -4,6 +4,10 @@ class Efl.Ui.Layout extends Efl.Ui.Layout_Base implements Efl.File
{
[[Elementary layout class
+ When loading layouts from a file, use the @Efl.File.key property to specify
+ the group that the data belongs to, in case it's an EET file
+ (including Edje files).
+
@since 1.22
]]
data: null;
diff --git a/src/lib/elementary/efl_ui_layout_base.eo b/src/lib/elementary/efl_ui_layout_base.eo
index 6efea7b274..a3401c865e 100644
--- a/src/lib/elementary/efl_ui_layout_base.eo
+++ b/src/lib/elementary/efl_ui_layout_base.eo
@@ -32,8 +32,8 @@ abstract Efl.Ui.Layout_Base extends Efl.Ui.Widget implements Efl.Container,
]]
set {
return: Eina.Error;
- [[Whether the style was successfully applied or not, see
- the values of Efl.Ui.Theme.Apply_Error for more information.]]
+ [[Whether the theme was successfully applied or not, see
+ the Efl.Ui.Theme.Apply_Error subset of @Eina.Error for more information.]]
}
get {
}
diff --git a/src/lib/elementary/efl_ui_pager.c b/src/lib/elementary/efl_ui_pager.c
index 0ce1488d8c..bf81d1ac91 100644
--- a/src/lib/elementary/efl_ui_pager.c
+++ b/src/lib/elementary/efl_ui_pager.c
@@ -784,59 +784,20 @@ _efl_ui_pager_loop_mode_get(const Eo *obj EINA_UNUSED,
return pd->loop;
}
-static void
-_unpack_all(Efl_Ui_Pager_Data *pd,
- Eina_Bool clear)
-{
- Eo *subobj;
-
- pd->cnt = 0;
- pd->curr.page = -1;
- pd->curr.pos = 0.0;
-
- if (pd->transition)
- {
- efl_page_transition_unpack_all(pd->transition);
- }
- else
- {
- subobj = eina_list_nth(pd->content_list, pd->curr.page);
- efl_pack_unpack(pd->page_box, subobj);
- }
-
- if (clear)
- {
- EINA_LIST_FREE(pd->content_list, subobj)
- evas_object_del(subobj);
- }
- else
- {
- EINA_LIST_FREE(pd->content_list, subobj)
- efl_canvas_object_clipper_set(subobj, NULL);
- }
-
- if (pd->indicator)
- {
- efl_page_indicator_unpack_all(pd->indicator);
- }
-}
-
EOLIAN static Eina_Bool
_efl_ui_pager_efl_pack_pack_clear(Eo *obj EINA_UNUSED,
- Efl_Ui_Pager_Data *pd)
+ Efl_Ui_Pager_Data *pd EINA_UNUSED)
{
- _unpack_all(pd, EINA_TRUE);
-
- return EINA_TRUE;
+ ERR("Soon to be implemented");
+ return EINA_FALSE;
}
EOLIAN static Eina_Bool
_efl_ui_pager_efl_pack_unpack_all(Eo *obj EINA_UNUSED,
- Efl_Ui_Pager_Data *pd)
+ Efl_Ui_Pager_Data *pd EINA_UNUSED)
{
- _unpack_all(pd, EINA_FALSE);
-
- return EINA_TRUE;
+ ERR("Soon to be implemented");
+ return EINA_FALSE;
}
static void
@@ -892,19 +853,12 @@ _efl_ui_pager_efl_pack_unpack(Eo *obj,
}
EOLIAN static Efl_Gfx_Entity *
-_efl_ui_pager_efl_pack_linear_pack_unpack_at(Eo *obj,
- Efl_Ui_Pager_Data *pd,
- int index)
+_efl_ui_pager_efl_pack_linear_pack_unpack_at(Eo *obj EINA_UNUSED,
+ Efl_Ui_Pager_Data *pd EINA_UNUSED,
+ int index EINA_UNUSED)
{
- if (!EINA_DBL_EQ(pd->curr.pos, 0.0)) return NULL;
-
- if ((index >= pd->cnt) || (index < 0)) return NULL;
-
- Efl_Gfx_Entity *subobj = eina_list_nth(pd->content_list, index);
-
- _unpack(obj, pd, subobj, index);
-
- return subobj;
+ ERR("Soon to be implemented");
+ return NULL;
}
diff --git a/src/lib/elementary/efl_ui_widget.eo b/src/lib/elementary/efl_ui_widget.eo
index 981ef4ca29..e765ddea8c 100644
--- a/src/lib/elementary/efl_ui_widget.eo
+++ b/src/lib/elementary/efl_ui_widget.eo
@@ -151,7 +151,7 @@ abstract Efl.Ui.Widget extends Efl.Canvas.Group implements Efl.Access.Object,
[[Can only be called during construction, before finalize.]]
return: Eina.Error;
[[Whether the style was successfully applied or not, see
- the values of Efl.Ui.Theme.Apply_Error for more information.]]
+ the Efl.Ui.Theme.Apply_Error subset of @Eina.Error for more information.]]
}
get {
[[Returns the current style of a widget.]]
diff --git a/src/lib/elementary/efl_ui_widget_common.h b/src/lib/elementary/efl_ui_widget_common.h
index 0e538cbed5..3d232b85c0 100644
--- a/src/lib/elementary/efl_ui_widget_common.h
+++ b/src/lib/elementary/efl_ui_widget_common.h
@@ -6,7 +6,7 @@
*
* This iterator contains also the canvas objects which are part of the widgets,
* be aware that the construction of this tree is internal and might change heavily
- * inbetween versions.
+ * between versions.
*
* @param obj The widget which is the root of the subtree.
*
diff --git a/src/lib/elementary/elc_naviframe_common.h b/src/lib/elementary/elc_naviframe_common.h
index 525f995c8c..453587e048 100644
--- a/src/lib/elementary/elc_naviframe_common.h
+++ b/src/lib/elementary/elc_naviframe_common.h
@@ -23,7 +23,35 @@ EAPI Evas_Object *elm_naviframe_add(Evas_Object *parent);
EAPI void elm_naviframe_item_title_enabled_set(Elm_Object_Item *it, Eina_Bool enabled, Eina_Bool transition);
-Elm_Object_Item *elm_naviframe_item_push(Evas_Object *obj, const char *title_label, Evas_Object *prev_btn, Evas_Object *next_btn, Evas_Object *content, const char *item_style);
+/**
+ * @brief Push a new item to the top of the naviframe stack (and show it).
+ *
+ * The item pushed becomes one page of the naviframe, this item will be deleted
+ * when it is popped.
+ *
+ * When push transition animation is in progress, pop operation is blocked
+ * until push is complete.
+ *
+ * The following styles are available for this item: "default"
+ *
+ * @param[in] obj The object.
+ * @param[in] title_label The label in the title area. The name of the title
+ * label part is "elm.text.title"
+ * @param[in] prev_btn The button to go to the previous item. If it is NULL,
+ * then naviframe will create a back button automatically. The name of the
+ * prev_btn part is "elm.swallow.prev_btn"
+ * @param[in] next_btn The button to go to the next item. Or It could be just
+ * an extra function button. The name of the next_btn part is
+ * "elm.swallow.next_btn"
+ * @param[in] content The main content object. The name of content part is
+ * "elm.swallow.content"
+ * @param[in] item_style The current item style name. @c NULL would be default.
+ *
+ * @return The created item or @c NULL upon failure.
+ *
+ * @ingroup Elm_Naviframe_Group
+ */
+EAPI Elm_Object_Item *elm_naviframe_item_push(Evas_Object *obj, const char *title_label, Evas_Object *prev_btn, Evas_Object *next_btn, Evas_Object *content, const char *item_style);
/**
* @brief Simple version of item_push.
diff --git a/src/lib/elementary/elm_config.h b/src/lib/elementary/elm_config.h
index 260d1dfa49..284757c334 100644
--- a/src/lib/elementary/elm_config.h
+++ b/src/lib/elementary/elm_config.h
@@ -1675,8 +1675,8 @@ EAPI Eina_Bool elm_config_vsync_get(void);
EAPI void elm_config_vsync_set(Eina_Bool enabled);
/**
- * Get the configure flag that will define if a window agressively drop its
- * ressource when minimized.
+ * Get the configure flag that will define if a window aggressively drop its
+ * resources when minimized.
*
* @return if it does.
*
@@ -1685,8 +1685,8 @@ EAPI void elm_config_vsync_set(Eina_Bool enabled);
EAPI Eina_Bool elm_config_agressive_withdrawn_get(void);
/**
- * Set the configure flag that will make a window agressively drop its
- * ressource when minimized.
+ * Set the configure flag that will make a window aggressively drop its
+ * resources when minimized.
*
* @param enabled This should be @c EINA_TRUE if enabled, or @c EINA_FALSE if
* not.
diff --git a/src/lib/elementary/elm_entry.c b/src/lib/elementary/elm_entry.c
index 5543504a3d..b229596c4a 100644
--- a/src/lib/elementary/elm_entry.c
+++ b/src/lib/elementary/elm_entry.c
@@ -4984,8 +4984,8 @@ _elm_entry_file_text_format_set(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd, Elm_Tex
EAPI Eina_Bool
elm_entry_file_set(Evas_Object *obj, const char *file, Elm_Text_Format format)
{
- Eina_Bool ret;
- ELM_ENTRY_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ ELM_ENTRY_DATA_GET_OR_RETURN_VAL(obj, sd, ret);
ELM_SAFE_FREE(sd->delay_write, ecore_timer_del);
if (sd->auto_save) _save_do(obj);
elm_obj_entry_file_text_format_set(obj, format);
diff --git a/src/lib/elementary/elm_image_legacy.h b/src/lib/elementary/elm_image_legacy.h
index a53e063a5c..d09060f969 100644
--- a/src/lib/elementary/elm_image_legacy.h
+++ b/src/lib/elementary/elm_image_legacy.h
@@ -434,7 +434,7 @@ EAPI Elm_Image_Orient elm_image_orient_get(const Evas_Object *obj);
*
* @note Be careful to not manipulate it, as it is under control of elementary.
*
- * @warning It doesn't gurantee the inlined object must be a type of Evas_Object_Image.
+ * @warning It doesn't guarantee the inlined object must be a type of Evas_Object_Image.
* It would be one of @c Evas_Object_Image or @c Edje_Object depending
on image file type.
*
diff --git a/src/lib/elementary/elm_naviframe_eo.legacy.h b/src/lib/elementary/elm_naviframe_eo.legacy.h
index 155e7513fd..995cbb1582 100644
--- a/src/lib/elementary/elm_naviframe_eo.legacy.h
+++ b/src/lib/elementary/elm_naviframe_eo.legacy.h
@@ -176,36 +176,6 @@ EAPI Efl_Canvas_Object *elm_naviframe_item_pop(Elm_Naviframe *obj);
EAPI Elm_Widget_Item *elm_naviframe_item_insert_before(Elm_Naviframe *obj, Elm_Widget_Item *before, const char *title_label, Efl_Canvas_Object *prev_btn, Efl_Canvas_Object *next_btn, Efl_Canvas_Object *content, const char *item_style);
/**
- * @brief Push a new item to the top of the naviframe stack (and show it).
- *
- * The item pushed becomes one page of the naviframe, this item will be deleted
- * when it is popped.
- *
- * When push transition animation is in progress, pop operation is blocked
- * until push is complete.
- *
- * The following styles are available for this item: "default"
- *
- * @param[in] obj The object.
- * @param[in] title_label The label in the title area. The name of the title
- * label part is "elm.text.title"
- * @param[in] prev_btn The button to go to the previous item. If it is NULL,
- * then naviframe will create a back button automatically. The name of the
- * prev_btn part is "elm.swallow.prev_btn"
- * @param[in] next_btn The button to go to the next item. Or It could be just
- * an extra function button. The name of the next_btn part is
- * "elm.swallow.next_btn"
- * @param[in] content The main content object. The name of content part is
- * "elm.swallow.content"
- * @param[in] item_style The current item style name. @c NULL would be default.
- *
- * @return The created item or @c NULL upon failure.
- *
- * @ingroup Elm_Naviframe_Group
- */
-EAPI Elm_Widget_Item *elm_naviframe_item_push(Elm_Naviframe *obj, const char *title_label, Efl_Canvas_Object *prev_btn, Efl_Canvas_Object *next_btn, Efl_Canvas_Object *content, const char *item_style);
-
-/**
* @brief Simple version of item_promote.
*
* @param[in] obj The object.
diff --git a/src/lib/elementary/elm_need.h b/src/lib/elementary/elm_need.h
index 84bba748c3..ad290dbf04 100644
--- a/src/lib/elementary/elm_need.h
+++ b/src/lib/elementary/elm_need.h
@@ -58,7 +58,7 @@ EAPI Eina_Bool elm_need_e_dbus(void) EINA_DEPRECATED;
/**
* Request that your elementary application needs eldbus
*
- * This initializes the eldbus (aka v2) library when called and if
+ * This initializes the eldbus (a.k.a. v2) library when called and if
* support exists it returns @c EINA_TRUE, otherwise returns
* @c EINA_FALSE. This must be called before any eldbus calls.
*
diff --git a/src/lib/elementary/elm_priv.h b/src/lib/elementary/elm_priv.h
index a1bd8be552..54c32cf9a6 100644
--- a/src/lib/elementary/elm_priv.h
+++ b/src/lib/elementary/elm_priv.h
@@ -875,14 +875,12 @@ EOAPI void efl_page_transition_page_size_set(Eo *obj, Eina_Size2D sz);
EOAPI void efl_page_transition_padding_size_set(Eo *obj, int padding);
EOAPI void efl_page_transition_update(Eo *obj, double pos);
EOAPI void efl_page_transition_pack(Eo *obj, int index);
-EOAPI void efl_page_transition_unpack_all(Eo *obj);
EOAPI void efl_page_transition_curr_page_change(Eo *obj, int diff);
EOAPI Eina_Bool efl_page_transition_loop_set(Eo *obj, Efl_Ui_Pager_Loop loop);
EOAPI void efl_page_indicator_update(Eo *obj, double pos);
EOAPI void efl_page_indicator_pack(Eo *obj, int index);
EOAPI void efl_page_indicator_unpack(Eo *obj, int index);
-EOAPI void efl_page_indicator_unpack_all(Eo *obj);
Eina_Bool _elm_config_accel_preference_parse(const char *pref, Eina_Stringshare **accel, int *gl_depth, int *gl_stencil, int *gl_msaa);
diff --git a/src/lib/elementary/elm_sys_notify_eo.h b/src/lib/elementary/elm_sys_notify_eo.h
index 247fef9bc3..0f1f194f07 100644
--- a/src/lib/elementary/elm_sys_notify_eo.h
+++ b/src/lib/elementary/elm_sys_notify_eo.h
@@ -78,7 +78,7 @@ EWAPI const Efl_Class *elm_sys_notify_class_get(void);
/**
* @brief Set the notifications server to be used.
*
- * @note This is an advanced function that should be used only to fullfill very
+ * @note This is an advanced function that should be used only to fulfill very
* specific purposes. Use elm_need_sys_notify() which activates the default
* available notification servers.
*
diff --git a/src/lib/elementary/elm_sys_notify_eo.legacy.h b/src/lib/elementary/elm_sys_notify_eo.legacy.h
index a56667357d..74dafc8182 100644
--- a/src/lib/elementary/elm_sys_notify_eo.legacy.h
+++ b/src/lib/elementary/elm_sys_notify_eo.legacy.h
@@ -71,7 +71,7 @@ typedef struct _Elm_Sys_Notify_Action_Invoked
/**
* @brief Set the notifications server to be used.
*
- * @note This is an advanced function that should be used only to fullfill very
+ * @note This is an advanced function that should be used only to fulfill very
* specific purposes. Use elm_need_sys_notify() which activates the default
* available notification servers.
*
diff --git a/src/lib/elementary/elm_widget_item_eo.legacy.h b/src/lib/elementary/elm_widget_item_eo.legacy.h
index d1fc974928..2937be3df0 100644
--- a/src/lib/elementary/elm_widget_item_eo.legacy.h
+++ b/src/lib/elementary/elm_widget_item_eo.legacy.h
@@ -4,6 +4,18 @@
#ifndef _ELM_WIDGET_ITEM_EO_CLASS_TYPE
#define _ELM_WIDGET_ITEM_EO_CLASS_TYPE
+/**
+ * @typedef Elm_Widget_Item
+ * An Elementary widget item handle.
+ * This is a sub component of an Elementary widget and it is the same as
+ * Elementary object item, Elm_Object_Item.
+ * Common functions for Elementary widget item are provided on this page.
+ * Each Elementary widget also provides its own functions to use Elementary
+ * widget item.
+ * For more details about how Elementary widget item is used with Elementary
+ * widget, please refer each Elementary widget's documents.
+ * @ingroup Elm_General
+ */
typedef Eo Elm_Widget_Item;
#endif
@@ -26,7 +38,7 @@ typedef Eo Elm_Widget_Item;
*
* @return @c false on failure, @c true on success
*
- * @ingroup Elm_Object_Item_Group
+ * @ingroup Elm_General
*/
EAPI Eina_Bool elm_object_item_tooltip_window_mode_set(Elm_Widget_Item *obj, Eina_Bool disable);
@@ -41,7 +53,7 @@ EAPI Eina_Bool elm_object_item_tooltip_window_mode_set(Elm_Widget_Item *obj, Ein
*
* @return If @c true, size restrictions are disabled
*
- * @ingroup Elm_Object_Item_Group
+ * @ingroup Elm_General
*/
EAPI Eina_Bool elm_object_item_tooltip_window_mode_get(const Elm_Widget_Item *obj);
@@ -57,7 +69,7 @@ EAPI Eina_Bool elm_object_item_tooltip_window_mode_get(const Elm_Widget_Item *ob
* @param[in] obj The object.
* @param[in] style The theme style used/to use (default, transparent, ...)
*
- * @ingroup Elm_Object_Item_Group
+ * @ingroup Elm_General
*/
EAPI void elm_object_item_tooltip_style_set(Elm_Widget_Item *obj, const char *style);
@@ -74,7 +86,7 @@ EAPI void elm_object_item_tooltip_style_set(Elm_Widget_Item *obj, const char *st
*
* @return The theme style used/to use (default, transparent, ...)
*
- * @ingroup Elm_Object_Item_Group
+ * @ingroup Elm_General
*/
EAPI const char *elm_object_item_tooltip_style_get(const Elm_Widget_Item *obj);
@@ -94,7 +106,7 @@ EAPI const char *elm_object_item_tooltip_style_get(const Elm_Widget_Item *obj);
* @param[in] obj The object.
* @param[in] cursor The cursor type's name
*
- * @ingroup Elm_Object_Item_Group
+ * @ingroup Elm_General
*/
EAPI void elm_object_item_cursor_set(Elm_Widget_Item *obj, const char *cursor);
@@ -115,7 +127,7 @@ EAPI void elm_object_item_cursor_set(Elm_Widget_Item *obj, const char *cursor);
*
* @return The cursor type's name
*
- * @ingroup Elm_Object_Item_Group
+ * @ingroup Elm_General
*/
EAPI const char *elm_object_item_cursor_get(const Elm_Widget_Item *obj);
@@ -135,7 +147,7 @@ EAPI const char *elm_object_item_cursor_get(const Elm_Widget_Item *obj);
* @param[in] style The theme style to use/in use (e.g. $"default",
* $"transparent", etc)
*
- * @ingroup Elm_Object_Item_Group
+ * @ingroup Elm_General
*/
EAPI void elm_object_item_cursor_style_set(Elm_Widget_Item *obj, const char *style);
@@ -155,7 +167,7 @@ EAPI void elm_object_item_cursor_style_set(Elm_Widget_Item *obj, const char *sty
*
* @return The theme style to use/in use (e.g. $"default", $"transparent", etc)
*
- * @ingroup Elm_Object_Item_Group
+ * @ingroup Elm_General
*/
EAPI const char *elm_object_item_cursor_style_get(const Elm_Widget_Item *obj);
@@ -174,7 +186,7 @@ EAPI const char *elm_object_item_cursor_style_get(const Elm_Widget_Item *obj);
* provided by the rendering engine, @c false to have them searched on the
* widget's theme, as well.
*
- * @ingroup Elm_Object_Item_Group
+ * @ingroup Elm_General
*/
EAPI void elm_object_item_cursor_engine_only_set(Elm_Widget_Item *obj, Eina_Bool engine_only);
@@ -194,7 +206,7 @@ EAPI void elm_object_item_cursor_engine_only_set(Elm_Widget_Item *obj, Eina_Bool
* rendering engine, @c false to have them searched on the widget's theme, as
* well.
*
- * @ingroup Elm_Object_Item_Group
+ * @ingroup Elm_General
*/
EAPI Eina_Bool elm_object_item_cursor_engine_only_get(const Elm_Widget_Item *obj);
@@ -209,7 +221,7 @@ EAPI Eina_Bool elm_object_item_cursor_engine_only_get(const Elm_Widget_Item *obj
* @param[in] part The content part name (NULL for the default content)
* @param[in] content The content of the object item
*
- * @ingroup Elm_Object_Item_Group
+ * @ingroup Elm_General
*/
EAPI void elm_object_item_part_content_set(Elm_Widget_Item *obj, const char *part, Efl_Canvas_Object *content);
@@ -225,7 +237,7 @@ EAPI void elm_object_item_part_content_set(Elm_Widget_Item *obj, const char *par
*
* @return The content of the object item
*
- * @ingroup Elm_Object_Item_Group
+ * @ingroup Elm_General
*/
EAPI Efl_Canvas_Object *elm_object_item_part_content_get(const Elm_Widget_Item *obj, const char *part);
@@ -238,7 +250,7 @@ EAPI Efl_Canvas_Object *elm_object_item_part_content_get(const Elm_Widget_Item *
* @param[in] part The text part name (NULL for the default label)
* @param[in] label Text of the label
*
- * @ingroup Elm_Object_Item_Group
+ * @ingroup Elm_General
*/
EAPI void elm_object_item_part_text_set(Elm_Widget_Item *obj, const char *part, const char *label);
@@ -252,7 +264,7 @@ EAPI void elm_object_item_part_text_set(Elm_Widget_Item *obj, const char *part,
*
* @return Text of the label
*
- * @ingroup Elm_Object_Item_Group
+ * @ingroup Elm_General
*/
EAPI const char *elm_object_item_part_text_get(const Elm_Widget_Item *obj, const char *part);
@@ -266,7 +278,7 @@ EAPI const char *elm_object_item_part_text_get(const Elm_Widget_Item *obj, const
*
* @since 1.10
*
- * @ingroup Elm_Object_Item_Group
+ * @ingroup Elm_General
*/
EAPI void elm_object_item_focus_set(Elm_Widget_Item *obj, Eina_Bool focused);
@@ -279,7 +291,7 @@ EAPI void elm_object_item_focus_set(Elm_Widget_Item *obj, Eina_Bool focused);
*
* @since 1.10
*
- * @ingroup Elm_Object_Item_Group
+ * @ingroup Elm_General
*/
EAPI Eina_Bool elm_object_item_focus_get(const Elm_Widget_Item *obj);
@@ -291,7 +303,7 @@ EAPI Eina_Bool elm_object_item_focus_get(const Elm_Widget_Item *obj);
*
* @since 1.9
*
- * @ingroup Elm_Object_Item_Group
+ * @ingroup Elm_General
*/
EAPI void elm_object_item_style_set(Elm_Widget_Item *obj, const char *style);
@@ -304,7 +316,7 @@ EAPI void elm_object_item_style_set(Elm_Widget_Item *obj, const char *style);
*
* @since 1.9
*
- * @ingroup Elm_Object_Item_Group
+ * @ingroup Elm_General
*/
EAPI const char *elm_object_item_style_get(const Elm_Widget_Item *obj);
@@ -323,7 +335,7 @@ EAPI const char *elm_object_item_style_get(const Elm_Widget_Item *obj);
* @param[in] disable @c true, if the widget item is disabled, @c false if it's
* enabled (or on errors)
*
- * @ingroup Elm_Object_Item_Group
+ * @ingroup Elm_General
*/
EAPI void elm_object_item_disabled_set(Elm_Widget_Item *obj, Eina_Bool disable);
@@ -343,7 +355,7 @@ EAPI void elm_object_item_disabled_set(Elm_Widget_Item *obj, Eina_Bool disable);
* @return @c true, if the widget item is disabled, @c false if it's enabled
* (or on errors)
*
- * @ingroup Elm_Object_Item_Group
+ * @ingroup Elm_General
*/
EAPI Eina_Bool elm_object_item_disabled_get(const Elm_Widget_Item *obj);
@@ -356,7 +368,7 @@ EAPI Eina_Bool elm_object_item_disabled_get(const Elm_Widget_Item *obj);
*
* @since 1.8
*
- * @ingroup Elm_Object_Item_Group
+ * @ingroup Elm_General
*/
EAPI const Eina_List *elm_object_item_access_order_get(Elm_Widget_Item *obj);
@@ -368,7 +380,7 @@ EAPI const Eina_List *elm_object_item_access_order_get(Elm_Widget_Item *obj);
*
* @since 1.8
*
- * @ingroup Elm_Object_Item_Group
+ * @ingroup Elm_General
*/
EAPI void elm_object_item_access_order_set(Elm_Widget_Item *obj, Eina_List *objs);
@@ -382,7 +394,7 @@ EAPI void elm_object_item_access_order_set(Elm_Widget_Item *obj, Eina_List *objs
*
* @return The widget object
*
- * @ingroup Elm_Object_Item_Group
+ * @ingroup Elm_General
*/
EAPI Efl_Canvas_Object *elm_object_item_widget_get(const Elm_Widget_Item *obj);
@@ -399,7 +411,7 @@ EAPI Efl_Canvas_Object *elm_object_item_widget_get(const Elm_Widget_Item *obj);
* @param[in] obj The object.
* @param[in] text The text to set in the content.
*
- * @ingroup Elm_Object_Item_Group
+ * @ingroup Elm_General
*/
EAPI void elm_object_item_tooltip_text_set(Elm_Widget_Item *obj, const char *text);
@@ -415,7 +427,7 @@ EAPI void elm_object_item_tooltip_text_set(Elm_Widget_Item *obj, const char *tex
* @ref elm_object_item_tooltip_content_cb_set
* @param[in] obj The object.
*
- * @ingroup Elm_Object_Item_Group
+ * @ingroup Elm_General
*/
EAPI void elm_object_item_tooltip_unset(Elm_Widget_Item *obj);
@@ -430,7 +442,7 @@ EAPI void elm_object_item_tooltip_unset(Elm_Widget_Item *obj);
* See: elm_object_cursor_unset() See: @ref elm_object_item_cursor_set
* @param[in] obj The object.
*
- * @ingroup Elm_Object_Item_Group
+ * @ingroup Elm_General
*/
EAPI void elm_object_item_cursor_unset(Elm_Widget_Item *obj);
@@ -445,7 +457,7 @@ EAPI void elm_object_item_cursor_unset(Elm_Widget_Item *obj);
*
* @return Content object
*
- * @ingroup Elm_Object_Item_Group
+ * @ingroup Elm_General
*/
EAPI Efl_Canvas_Object *elm_object_item_part_content_unset(Elm_Widget_Item *obj, const char *part);
@@ -466,7 +478,7 @@ EAPI Efl_Canvas_Object *elm_object_item_part_content_unset(Elm_Widget_Item *obj,
*
* @since 1.8
*
- * @ingroup Elm_Object_Item_Group
+ * @ingroup Elm_General
*/
EAPI void elm_object_item_signal_callback_add(Elm_Widget_Item *obj, const char *emission, const char *source, Elm_Object_Item_Signal_Cb func, void *data);
@@ -491,7 +503,7 @@ EAPI void elm_object_item_signal_callback_add(Elm_Widget_Item *obj, const char *
*
* @since 1.8
*
- * @ingroup Elm_Object_Item_Group
+ * @ingroup Elm_General
*/
EAPI void *elm_object_item_signal_callback_del(Elm_Widget_Item *obj, const char *emission, const char *source, Elm_Object_Item_Signal_Cb func);
@@ -507,7 +519,7 @@ EAPI void *elm_object_item_signal_callback_del(Elm_Widget_Item *obj, const char
* @param[in] emission The signal's name.
* @param[in] source The signal's source.
*
- * @ingroup Elm_Object_Item_Group
+ * @ingroup Elm_General
*/
EAPI void elm_object_item_signal_emit(Elm_Widget_Item *obj, const char *emission, const char *source);
@@ -518,7 +530,7 @@ EAPI void elm_object_item_signal_emit(Elm_Widget_Item *obj, const char *emission
* @param[in] txt The text that describes the widget to people with poor or no
* vision
*
- * @ingroup Elm_Object_Item_Group
+ * @ingroup Elm_General
*/
EAPI void elm_object_item_access_info_set(Elm_Widget_Item *obj, const char *txt);
@@ -531,7 +543,7 @@ EAPI void elm_object_item_access_info_set(Elm_Widget_Item *obj, const char *txt)
*
* @since 1.8
*
- * @ingroup Elm_Object_Item_Group
+ * @ingroup Elm_General
*/
EAPI Efl_Canvas_Object *elm_object_item_access_object_get(const Elm_Widget_Item *obj);
@@ -556,7 +568,7 @@ EAPI Efl_Canvas_Object *elm_object_item_access_object_get(const Elm_Widget_Item
*
* @since 1.8
*
- * @ingroup Elm_Object_Item_Group
+ * @ingroup Elm_General
*/
EAPI void elm_object_item_domain_translatable_part_text_set(Elm_Widget_Item *obj, const char *part, const char *domain, const char *label);
@@ -574,7 +586,7 @@ EAPI void elm_object_item_domain_translatable_part_text_set(Elm_Widget_Item *obj
*
* @since 1.8
*
- * @ingroup Elm_Object_Item_Group
+ * @ingroup Elm_General
*/
EAPI const char *elm_object_item_translatable_part_text_get(const Elm_Widget_Item *obj, const char *part);
@@ -599,7 +611,7 @@ EAPI const char *elm_object_item_translatable_part_text_get(const Elm_Widget_Ite
*
* @since 1.8
*
- * @ingroup Elm_Object_Item_Group
+ * @ingroup Elm_General
*/
EAPI void elm_object_item_domain_part_text_translatable_set(Elm_Widget_Item *obj, const char *part, const char *domain, Eina_Bool translatable);
@@ -631,7 +643,7 @@ EAPI void elm_object_item_domain_part_text_translatable_set(Elm_Widget_Item *obj
*
* @since 1.8
*
- * @ingroup Elm_Object_Item_Group
+ * @ingroup Elm_General
*/
EAPI Efl_Canvas_Object *elm_object_item_track(Elm_Widget_Item *obj);
@@ -647,7 +659,7 @@ EAPI Efl_Canvas_Object *elm_object_item_track(Elm_Widget_Item *obj);
*
* @since 1.8
*
- * @ingroup Elm_Object_Item_Group
+ * @ingroup Elm_General
*/
EAPI void elm_object_item_untrack(Elm_Widget_Item *obj);
@@ -670,7 +682,7 @@ EAPI void elm_object_item_untrack(Elm_Widget_Item *obj);
*
* @since 1.8
*
- * @ingroup Elm_Object_Item_Group
+ * @ingroup Elm_General
*/
EAPI int elm_object_item_track_get(const Elm_Widget_Item *obj);
@@ -683,7 +695,7 @@ EAPI int elm_object_item_track_get(const Elm_Widget_Item *obj);
* @param[in] obj The object.
* @param[in] del_cb The function called
*
- * @ingroup Elm_Object_Item_Group
+ * @ingroup Elm_General
*/
EAPI void elm_object_item_del_cb_set(Elm_Widget_Item *obj, Evas_Smart_Cb del_cb);
@@ -707,7 +719,7 @@ EAPI void elm_object_item_del_cb_set(Elm_Widget_Item *obj, Evas_Smart_Cb del_cb)
* receives as the first parameter the given @c data, and @c event_info is the
* item.
*
- * @ingroup Elm_Object_Item_Group
+ * @ingroup Elm_General
*/
EAPI void elm_object_item_tooltip_content_cb_set(Elm_Widget_Item *obj, Elm_Tooltip_Item_Content_Cb func, const void *data, Evas_Smart_Cb del_cb);
@@ -720,7 +732,7 @@ EAPI void elm_object_item_tooltip_content_cb_set(Elm_Widget_Item *obj, Elm_Toolt
*
* @since 1.8
*
- * @ingroup Elm_Object_Item_Group
+ * @ingroup Elm_General
*/
EAPI Efl_Canvas_Object *elm_object_item_access_register(Elm_Widget_Item *obj);
@@ -728,7 +740,7 @@ EAPI Efl_Canvas_Object *elm_object_item_access_register(Elm_Widget_Item *obj);
*
* @since 1.8
*
- * @ingroup Elm_Object_Item_Group
+ * @ingroup Elm_General
*/
EAPI void elm_object_item_access_unregister(Elm_Widget_Item *obj);
@@ -736,7 +748,7 @@ EAPI void elm_object_item_access_unregister(Elm_Widget_Item *obj);
*
* @since 1.8
*
- * @ingroup Elm_Object_Item_Group
+ * @ingroup Elm_General
*/
EAPI void elm_object_item_access_order_unset(Elm_Widget_Item *obj);
@@ -752,7 +764,7 @@ EAPI void elm_object_item_access_order_unset(Elm_Widget_Item *obj);
*
* @since 1.16
*
- * @ingroup Elm_Object_Item_Group
+ * @ingroup Elm_General
*/
EAPI Efl_Canvas_Object *elm_object_item_focus_next_object_get(const Elm_Widget_Item *obj, Elm_Focus_Direction dir);
@@ -765,7 +777,7 @@ EAPI Efl_Canvas_Object *elm_object_item_focus_next_object_get(const Elm_Widget_I
*
* @since 1.16
*
- * @ingroup Elm_Object_Item_Group
+ * @ingroup Elm_General
*/
EAPI void elm_object_item_focus_next_object_set(Elm_Widget_Item *obj, Efl_Canvas_Object *next, Elm_Focus_Direction dir);
@@ -779,7 +791,7 @@ EAPI void elm_object_item_focus_next_object_set(Elm_Widget_Item *obj, Efl_Canvas
*
* @since 1.16
*
- * @ingroup Elm_Object_Item_Group
+ * @ingroup Elm_General
*/
EAPI Elm_Widget_Item *elm_object_item_focus_next_item_get(const Elm_Widget_Item *obj, Elm_Focus_Direction dir);
@@ -792,7 +804,7 @@ EAPI Elm_Widget_Item *elm_object_item_focus_next_item_get(const Elm_Widget_Item
*
* @since 1.16
*
- * @ingroup Elm_Object_Item_Group
+ * @ingroup Elm_General
*/
EAPI void elm_object_item_focus_next_item_set(Elm_Widget_Item *obj, Elm_Widget_Item *next_item, Elm_Focus_Direction dir);
diff --git a/src/lib/elput/Elput.h b/src/lib/elput/Elput.h
index 495fa06cbe..14a706949d 100644
--- a/src/lib/elput/Elput.h
+++ b/src/lib/elput/Elput.h
@@ -271,7 +271,7 @@ EAPI const Eina_List *elput_manager_seats_get(Elput_Manager *manager);
* input manager. Setting a window on the input manager is done so that
* when we raise events (mouse movement, keyboard key, etc) then this
* window is passed to the event structure as the window which the event
- * occured on.
+ * occurred on.
*
* @param manager
* @param window
@@ -522,7 +522,7 @@ EAPI Eina_Bool elput_touch_drag_enabled_get(Elput_Device *device);
* @param device
* @param enabled
*
- * @return EINA_TRUE on sucess, EINA_FALSE otherwise
+ * @return EINA_TRUE on success, EINA_FALSE otherwise
*
* @ingroup Elput_Touch_Group
* @since 1.19
diff --git a/src/lib/emile/emile_image.h b/src/lib/emile/emile_image.h
index 8877a6008e..d524d5247f 100644
--- a/src/lib/emile/emile_image.h
+++ b/src/lib/emile/emile_image.h
@@ -155,7 +155,7 @@ typedef struct _Emile_Image_Property Emile_Image_Property;
/**
* @enum _Emile_Action
* @typedef Emile_Action
- * What action emile is refering to.
+ * What action emile is referring to.
* @since 1.19
*/
typedef enum _Emile_Action
@@ -221,7 +221,7 @@ struct _Emile_Image_Load_Opts
int smooth;
/* This should have never been part of this structure, but we keep it
- for ABI/API compability with Evas_Loader */
+ for ABI/API compatibility with Evas_Loader */
Emile_Image_Scale_Hint scale_hint;
} scale_load;
double dpi;
diff --git a/src/lib/emotion/Emotion.h b/src/lib/emotion/Emotion.h
index d8eb052f93..e67d9a2026 100644
--- a/src/lib/emotion/Emotion.h
+++ b/src/lib/emotion/Emotion.h
@@ -236,7 +236,7 @@ enum _Emotion_Vis
/**
* @enum Emotion_Suspend
*
- * Used for emotion pipeline ressource management.
+ * Used for emotion pipeline resource management.
*
* @see emotion_object_suspend_set()
* @see emotion_object_suspend_get()
@@ -246,7 +246,7 @@ enum _Emotion_Vis
typedef enum
{
EMOTION_WAKEUP, /**< pipeline is up and running */
- EMOTION_SLEEP, /**< turn off hardware ressource usage like overlay */
+ EMOTION_SLEEP, /**< turn off hardware resource usage like overlay */
EMOTION_DEEP_SLEEP, /**< destroy the pipeline, but keep full resolution pixels output around */
EMOTION_HIBERNATE /**< destroy the pipeline, and keep half resolution or object resolution if lower */
} Emotion_Suspend;
@@ -370,7 +370,7 @@ EAPI extern Emotion_Version *emotion_version;
*/
/**
- * @defgroup Emotion_Ressource Video ressource management
+ * @defgroup Emotion_Ressource Video resource management
*/
/**
@@ -1181,7 +1181,7 @@ EAPI Eina_Bool emotion_object_vis_supported (const Evas_Object *obj,
* Picture in Picture is needed. And most application just have a few video stream that really
* deserve high frame rate, high quality output. That's why this call is for.
*
- * Please note that if Emotion can't acquire a priviledged hardware ressource, it will fallback
+ * Please note that if Emotion can't acquire a priviledged hardware resource, it will fallback
* to the no-priority path. This work on the first asking first get basis system.
*
* @see emotion_object_priority_get()
diff --git a/src/lib/eo/Eo.h b/src/lib/eo/Eo.h
index f5fb5eef09..63e4c6b89a 100644
--- a/src/lib/eo/Eo.h
+++ b/src/lib/eo/Eo.h
@@ -359,7 +359,7 @@ typedef struct _Efl_Future_Cb_Desc {
* @param value The operation result
* @return An Eina_Value to pass to the next Eina_Future in the chain (if any).
* If there is no need to convert the received value, it's @b recommended
- * to pass-thru @p value argument. If you need to convert to a different type
+ * to passthrough @p value argument. If you need to convert to a different type
* or generate a new value, use @c eina_value_setup() on @b another Eina_Value
* and return it. By returning a promise Eina_Value (eina_promise_as_value()) the
* whole chain will wait until the promise is resolved in
@@ -378,7 +378,7 @@ typedef struct _Efl_Future_Cb_Desc {
* may also return a non-error, in which case the next future in the chain will receive a regular
* value, which may call its @c success.
*
- * If this function is not provided, then it will pass thru the error to the next error handler.
+ * If this function is not provided, then it will passthrough the error to the next error handler.
*
* It may be called with @c EINVAL if @c success_type is provided and doesn't
* match the received type.
diff --git a/src/lib/eo/efl_object.eo b/src/lib/eo/efl_object.eo
index 9e71ad8db0..cb0a92e70c 100644
--- a/src/lib/eo/efl_object.eo
+++ b/src/lib/eo/efl_object.eo
@@ -235,7 +235,7 @@ abstract Efl.Object
Use this method to delay expensive operations until user configuration
has finished, to avoid building the object in a "default" state in the
constructor, just to have to throw it all away because a user
- configuration (a property being set, for example) requires a diferent
+ configuration (a property being set, for example) requires a different
state.
This is the last call inside efl_add() and will set @.finalized to $true
once it returns.
diff --git a/src/lib/eo/eo_internal.h b/src/lib/eo/eo_internal.h
index 7c57e9839c..9e2980914a 100644
--- a/src/lib/eo/eo_internal.h
+++ b/src/lib/eo/eo_internal.h
@@ -47,7 +47,7 @@ EAPI void ___efl_ref2_reset(const Eo *obj_id);
#define EFL_CLASS_SIMPLE_CLASS(FUNC, NAME, ABSTRACT_CLASS) \
static const Efl_Class_Description FUNC ##_realized_class_desc = { \
EO_VERSION, \
- #NAME"_Realized", \
+ NAME "_Realized", \
EFL_CLASS_TYPE_REGULAR, \
0, NULL, NULL, NULL \
}; \
diff --git a/src/lib/eolian/Eolian.h b/src/lib/eolian/Eolian.h
index 20979ec99b..c60272ef56 100644
--- a/src/lib/eolian/Eolian.h
+++ b/src/lib/eolian/Eolian.h
@@ -2566,7 +2566,7 @@ eolian_typedecl_namespaces_get(const Eolian_Typedecl *tp)
EAPI Eina_Stringshare *eolian_typedecl_free_func_get(const Eolian_Typedecl *tp);
/*
- * @breif Get the function object for this function pointer type.
+ * @brief Get the function object for this function pointer type.
*
* @param[in] tp the type.
* @return the function or NULL;
diff --git a/src/lib/eolian/Eolian_Aux.h b/src/lib/eolian/Eolian_Aux.h
index 4313d49d6d..a3c90fe744 100644
--- a/src/lib/eolian/Eolian_Aux.h
+++ b/src/lib/eolian/Eolian_Aux.h
@@ -105,7 +105,7 @@ EAPI size_t eolian_aux_class_callables_get(const Eolian_Class *klass, Eina_List
/**
* @brief Get all implementations of a function in a state.
*
- * Given a function and a childen hierarchy from
+ * Given a function and a children hierarchy from
* eolian_aux_state_class_children_find(), this will func
* all implementations of that function in the system. This
* is useful for various utilities. You need to free the list
diff --git a/src/lib/eolian/eo_lexer.h b/src/lib/eolian/eo_lexer.h
index 90a79c2158..9a510e1894 100644
--- a/src/lib/eolian/eo_lexer.h
+++ b/src/lib/eolian/eo_lexer.h
@@ -212,7 +212,7 @@ int eo_lexer_get (Eo_Lexer *ls);
int eo_lexer_lookahead (Eo_Lexer *ls);
/* "throws" an error, with a custom message and custom token */
void eo_lexer_lex_error (Eo_Lexer *ls, const char *msg, int token);
-/* like above, but uses the lexstate->t.token, aka current token */
+/* like above, but uses the lexstate->t.token, a.k.a. current token */
void eo_lexer_syntax_error (Eo_Lexer *ls, const char *msg);
/* turns the token into a string, writes into the given buffer */
void eo_lexer_token_to_str (int token, char *buf);
diff --git a/src/lib/ephysics/EPhysics.h b/src/lib/ephysics/EPhysics.h
index 2311975aab..cc5d221156 100644
--- a/src/lib/ephysics/EPhysics.h
+++ b/src/lib/ephysics/EPhysics.h
@@ -446,7 +446,7 @@ EAPI double ephysics_quaternion_angle_get(const EPhysics_Quaternion *quat1, cons
* Return the length of the quaternion.
*
* @param quat Quaternion to get length of.
- * @return The lenght of @p quat or @c 0 on error.
+ * @return The length of @p quat or @c 0 on error.
*
* @ingroup EPhysics_Quaternion
*/
@@ -457,7 +457,7 @@ EAPI double ephysics_quaternion_length_get(const EPhysics_Quaternion *quat);
* Return the length squared of the quaternion.
*
* @param quat Quaternion to get length of.
- * @return The lenght of @p quat or @c 0 on error.
+ * @return The length of @p quat or @c 0 on error.
*
* @ingroup EPhysics_Quaternion
*/
@@ -489,7 +489,7 @@ EAPI double ephysics_quaternion_length2_get(const EPhysics_Quaternion *quat);
* @ref ephysics_shape_save(). With that shapes can be done or visualized
* on design applications.
*
- * @note Using primitive shapes has better perfomance than generic shapes.
+ * @note Using primitive shapes has better performance than generic shapes.
* @note For now, only convex shapes are supported.
*
*/
@@ -2435,11 +2435,11 @@ EAPI double ephysics_body_soft_body_drag_coefficient_get(const EPhysics_Body *bo
*
* While dragging a soft body the user may want to freeze a specific trimesh
* face, after calling this function EPhysics will do freeze the @p triangle
- * untill it gets a call to unset it with
+ * until it gets a call to unset it with
* ephysics_body_soft_body_dragging_unset().
*
* @note Freezing a specific trimesh face means no forces are applied to it, no
- * gravity enforced, that's @p triangle will have no mass untill it dragging
+ * gravity enforced, that's @p triangle will have no mass until it dragging
* gets unset.
*
* @param body The body of interest.
diff --git a/src/lib/escape/sys/mman.h b/src/lib/escape/sys/mman.h
index aebbbc98db..6c328c4add 100644
--- a/src/lib/escape/sys/mman.h
+++ b/src/lib/escape/sys/mman.h
@@ -122,7 +122,7 @@ EAPI void *mmap(void *addr,
* Unmaps a mapped view of a file from the calling process's
* address space. @p addr is the pointer to the base address.
* This value must be identical to the value returned by a
- * previous call to mmap(). The parameter @p len is unsed.
+ * previous call to mmap(). The parameter @p len is unused.
*
* Conformity: None.
*
diff --git a/src/lib/ethumb_client/Ethumb_Client.h b/src/lib/ethumb_client/Ethumb_Client.h
index c8d90b230d..ecf8f07c01 100644
--- a/src/lib/ethumb_client/Ethumb_Client.h
+++ b/src/lib/ethumb_client/Ethumb_Client.h
@@ -112,7 +112,7 @@ typedef void (*Ethumb_Client_Generate_Cb)(void *data, Ethumb_Client *client, int
* @param data extra context given to ethumb_client_thumb_exists().
*
* During the execution of the callback the state of the @p client is
- * temporarily realy restored to what it was when the call to
+ * temporarily really restored to what it was when the call to
* ethumb_client_thumb_exists() was done.
*/
typedef void (*Ethumb_Client_Thumb_Exists_Cb)(void *data, Ethumb_Client *client, Ethumb_Exists *thread, Eina_Bool exists);
diff --git a/src/lib/evas/Evas_Common.h b/src/lib/evas/Evas_Common.h
index 661d7f5c6b..9eb765f330 100644
--- a/src/lib/evas/Evas_Common.h
+++ b/src/lib/evas/Evas_Common.h
@@ -1032,7 +1032,7 @@ EAPI const Eina_List *evas_device_list(Evas *e, const Evas_Device *dev);
* @param e The canvas to find the device on
* @param name The name of the device.
*
- * Gets the first ocurrence of a device named as @p name
+ * Gets the first occurrence of a device named as @p name
* on Evas @p e list of devices.
*
* @return the device or NULL if an error occurred, no name was provided,
diff --git a/src/lib/evas/Evas_Legacy.h b/src/lib/evas/Evas_Legacy.h
index 1c5dcb4331..d909b7a375 100644
--- a/src/lib/evas/Evas_Legacy.h
+++ b/src/lib/evas/Evas_Legacy.h
@@ -5183,7 +5183,7 @@ EAPI int evas_object_image_load_scale_down_get(const Evas_Object *obj);
EAPI void evas_object_image_load_head_skip_set(Evas_Object *obj, Eina_Bool skip);
/**
- * @breif Get the load option to skip header loads before preload
+ * @brief Get the load option to skip header loads before preload
*
* This gets the heade skip value set by evas_object_image_load_head_skip_set()
*
diff --git a/src/lib/evas/canvas/efl_canvas_animation.eo b/src/lib/evas/canvas/efl_canvas_animation.eo
index ca55a3e1e1..4198ccf592 100644
--- a/src/lib/evas/canvas/efl_canvas_animation.eo
+++ b/src/lib/evas/canvas/efl_canvas_animation.eo
@@ -62,7 +62,7 @@ class @beta Efl.Canvas.Animation extends Efl.Object implements Efl.Playable
get {
}
values {
- interpolator: Efl.Interpolator; [[Interpolator which indicates interpolation fucntion. Efl_Interpolator is required.]]
+ interpolator: Efl.Interpolator; [[Interpolator which indicates interpolation function. Efl_Interpolator is required.]]
}
}
animation_apply {
diff --git a/src/lib/evas/canvas/evas_callbacks.c b/src/lib/evas/canvas/evas_callbacks.c
index f5dbb15353..dcd3338dd6 100644
--- a/src/lib/evas/canvas/evas_callbacks.c
+++ b/src/lib/evas/canvas/evas_callbacks.c
@@ -831,6 +831,11 @@ _check_event_catcher_add(void *data, const Efl_Event *event)
{
obj->callback_mask |= (((uint64_t)1) << type);
}
+ else if (array[i].desc == EFL_GFX_ENTITY_EVENT_VISIBILITY_CHANGED)
+ {
+ obj->callback_mask |= (((uint64_t)1) << EVAS_CALLBACK_SHOW);
+ obj->callback_mask |= (((uint64_t)1) << EVAS_CALLBACK_HIDE);
+ }
}
}
diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c
index 1d0e128dd1..5beeb4b0ce 100644
--- a/src/lib/evas/canvas/evas_object_image.c
+++ b/src/lib/evas/canvas/evas_object_image.c
@@ -709,6 +709,8 @@ _efl_canvas_image_internal_efl_gfx_buffer_buffer_update_add(Eo *eo_obj, Evas_Ima
{
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
Eina_Rectangle *r;
+ Eo *eo_obj2;
+ Eina_List *l;
int x, y, w, h;
int cnt;
@@ -767,6 +769,12 @@ _efl_canvas_image_internal_efl_gfx_buffer_buffer_update_add(Eo *eo_obj, Evas_Ima
o->changed = EINA_TRUE;
evas_object_change(eo_obj, obj);
+
+ EINA_LIST_FOREACH(obj->proxy->proxies, l, eo_obj2)
+ {
+ Evas_Object_Protected_Data *obj2 = efl_data_scope_get(eo_obj2, EFL_CANVAS_OBJECT_CLASS);
+ evas_object_change(eo_obj2, obj2);
+ }
}
EOLIAN static void
diff --git a/src/lib/evas/common/evas_text_utils.h b/src/lib/evas/common/evas_text_utils.h
index 36039568fa..09c51e0c5e 100644
--- a/src/lib/evas/common/evas_text_utils.h
+++ b/src/lib/evas/common/evas_text_utils.h
@@ -68,7 +68,7 @@ struct _Evas_Text_Props
#define EVAS_TP_SZLEN_ONE 1
// special case textprop for ONE char! should use this for textgrid but
-// we have to modify every bit of code that usea a textprop to go thru a
+// we have to modify every bit of code that usea a textprop to go through a
// getter or setter etc. etc.
struct _Evas_Text_Props_One
{
diff --git a/src/lib/evil/evil_dlfcn.h b/src/lib/evil/evil_dlfcn.h
index 1c05b1f235..af18ed1ff9 100644
--- a/src/lib/evil/evil_dlfcn.h
+++ b/src/lib/evil/evil_dlfcn.h
@@ -61,7 +61,7 @@ x * This header provides functions to load and unload dynamic-link
/**
* @typedef Dl_info
- * @brief A structure that stores infomation of a calling process.
+ * @brief A structure that stores information of a calling process.
* This typedef is defined only when _GNU_SOURCE was defined before
* including dlfcn.h.
*/
@@ -69,7 +69,7 @@ typedef struct Dl_info Dl_info;
/**
* @struct Dl_info
- * @brief A structure that stores infomation of a calling process.
+ * @brief A structure that stores information of a calling process.
* This structure is defined only when _GNU_SOURCE was defined before
* including dlfcn.h.
*/
@@ -148,7 +148,7 @@ EAPI void *dlopen(const char* path, int mode);
* @brief Close a dynamic-link library.
*
* @param handle Handle that references a dynamic-link library.
- * @return O on sucess, -1 otherwise.
+ * @return O on success, -1 otherwise.
*
* Release a reference to the dynamic-link library referenced
* by @p handle. If the reference count drops to 0, the handle is
@@ -173,7 +173,7 @@ EAPI int dlclose(void* handle);
*
* @param handle Handle that references a dynamic-link library.
* @param symbol @c NULL-terminated string.
- * @return O on sucess, NULL otherwise.
+ * @return O on success, NULL otherwise.
*
* Return the address of the code or data location specified by the
* string @p symbol. @p handle references a library that contains
diff --git a/src/lib/evil/evil_stdlib.h b/src/lib/evil/evil_stdlib.h
index 6e0b27cdda..34c9f7c65f 100644
--- a/src/lib/evil/evil_stdlib.h
+++ b/src/lib/evil/evil_stdlib.h
@@ -97,7 +97,7 @@ EAPI int mkstemps(char *__template, int suffixlen);
* by @p resolved_name. The buffer is at most @c PATH_MAX bytes long.
* If @p resolved_name is @c NULL, malloc() is used to allocate a
* buffer of sufficient length to hold the path name. In that case, it
- * is the responsability of the caller to free this buffer with free().
+ * is the responsibility of the caller to free this buffer with free().
*
* That function can be used to obtain the absolute path name for
* relative paths (relPath) that include "./" or "../" in their names.
diff --git a/src/lib/evil/sys/mman.h b/src/lib/evil/sys/mman.h
index 0a36ebf416..93b6bd4914 100644
--- a/src/lib/evil/sys/mman.h
+++ b/src/lib/evil/sys/mman.h
@@ -130,7 +130,7 @@ EAPI void *mmap(void *addr,
* Unmaps a mapped view of a file from the calling process's
* address space. @p addr is the pointer to the base address.
* This value must be identical to the value returned by a
- * previous call to mmap(). The parameter @p len is unsed.
+ * previous call to mmap(). The parameter @p len is unused.
*
* Conformity: None.
*
diff --git a/src/tests/ecore/efl_app_test_loop.c b/src/tests/ecore/efl_app_test_loop.c
index 88b4dd2fd5..7b8dafccf3 100644
--- a/src/tests/ecore/efl_app_test_loop.c
+++ b/src/tests/ecore/efl_app_test_loop.c
@@ -93,8 +93,15 @@ EFL_START_TEST(efl_app_test_efl_loop_concentric)
}
EFL_END_TEST
+EFL_START_TEST(efl_loop_test_realized_name)
+{
+ ck_assert_str_eq(efl_class_name_get(efl_loop_realized_class_get()), "Efl.Loop_Realized");
+}
+EFL_END_TEST
+
void efl_app_test_efl_loop(TCase *tc)
{
tcase_add_test(tc, efl_app_test_efl_loop_register);
tcase_add_test(tc, efl_app_test_efl_loop_concentric);
+ tcase_add_test(tc, efl_loop_test_realized_name);
}
diff --git a/src/tests/ecore/efl_app_test_promise.c b/src/tests/ecore/efl_app_test_promise.c
index 276629754a..91d3f802d7 100644
--- a/src/tests/ecore/efl_app_test_promise.c
+++ b/src/tests/ecore/efl_app_test_promise.c
@@ -1131,6 +1131,7 @@ EFL_START_TEST(efl_test_promise_null)
fail_unless(ctx.did);
ecore_shutdown();
+ eina_log_print_cb_set(NULL, NULL);
}
EFL_END_TEST
@@ -1152,6 +1153,7 @@ EFL_START_TEST(efl_test_promise_reject_resolve_null)
eina_promise_reject(NULL, DEFAULT_ERROR);
fail_unless(ctx.did);
ecore_shutdown();
+ eina_log_print_cb_set(NULL, NULL);
}
EFL_END_TEST
@@ -1236,6 +1238,7 @@ EFL_START_TEST(efl_test_future_null)
ck_assert_ptr_eq(f, NULL);
ck_assert_int_eq(easy_cb_calls, 2);
ecore_shutdown();
+ eina_log_print_cb_set(NULL, NULL);
}
EFL_END_TEST
@@ -1280,6 +1283,7 @@ EFL_START_TEST(efl_test_future_all_null)
ck_assert_ptr_eq(f, NULL);
ecore_shutdown();
ck_assert_int_eq(cb_called, len);
+ eina_log_print_cb_set(NULL, NULL);
}
EFL_END_TEST
@@ -1311,6 +1315,7 @@ EFL_START_TEST(efl_test_future_race_null)
ck_assert_ptr_eq(f, NULL);
ecore_shutdown();
ck_assert_int_eq(cb_called, len);
+ eina_log_print_cb_set(NULL, NULL);
}
EFL_END_TEST
diff --git a/src/tests/efl_check.h b/src/tests/efl_check.h
index d5b0d2fcc2..e4f3e7a202 100644
--- a/src/tests/efl_check.h
+++ b/src/tests/efl_check.h
@@ -53,6 +53,20 @@
eina_log_abort_on_critical_set(___val); \
} while (0)
+#define EXPECT_ERROR_START \
+ do { \
+ DISABLE_ABORT_ON_CRITICAL_START; \
+ Eina_Bool expect_error_start = EINA_FALSE; \
+ do { \
+ eina_log_print_cb_set(_efl_test_expect_error, &expect_error_start); \
+ } while(0)
+
+
+#define EXPECT_ERROR_END \
+ ck_assert_int_eq(expect_error_start, EINA_TRUE); \
+ DISABLE_ABORT_ON_CRITICAL_END; \
+ } while(0)
+
typedef struct _Efl_Test_Case Efl_Test_Case;
struct _Efl_Test_Case
{
@@ -62,6 +76,15 @@ struct _Efl_Test_Case
static int timeout_pid = 0;
+EINA_UNUSED static void
+_efl_test_expect_error(const Eina_Log_Domain *d EINA_UNUSED, Eina_Log_Level level, const char *file EINA_UNUSED, const char *fnc, int line EINA_UNUSED, const char *fmt EINA_UNUSED, void *data, va_list args EINA_UNUSED)
+{
+ Eina_Bool *error = (Eina_Bool*) data;
+ if (level == EINA_LOG_LEVEL_ERR) *error = EINA_TRUE;
+
+ printf("EXPECTED ERROR %s\n", fnc);
+}
+
static void
_efl_tests_list(const Efl_Test_Case *etc)
{
diff --git a/src/tests/efl_mono/Eina.cs b/src/tests/efl_mono/Eina.cs
index 8b7f1a9672..6a07e2f288 100644
--- a/src/tests/efl_mono/Eina.cs
+++ b/src/tests/efl_mono/Eina.cs
@@ -460,6 +460,12 @@ class TestEinaArray
Test.Assert(a.Handle != IntPtr.Zero);
}
+ public static void create_array_from_null()
+ {
+ Test.AssertRaises<ArgumentNullException>(() => new Eina.Array<int>(IntPtr.Zero, false));
+ Test.AssertRaises<ArgumentNullException>(() => new Eina.Array<int>(IntPtr.Zero, false, false));
+ }
+
public static void push_int()
{
var a = new Eina.Array<int>();
diff --git a/src/tests/elementary/efl_ui_suite.c b/src/tests/elementary/efl_ui_suite.c
index 097f432e8a..a1ba34f1f4 100644
--- a/src/tests/elementary/efl_ui_suite.c
+++ b/src/tests/elementary/efl_ui_suite.c
@@ -10,6 +10,7 @@ static const Efl_Test_Case etc[] = {
//{ "elm_focus_sub", elm_test_focus_sub},
//{ "elm_widget_focus", elm_test_widget_focus},
{ "efl_ui_atspi", efl_ui_test_atspi},
+ { "efl_ui_callback", efl_ui_test_callback},
{ "efl_ui_focus", efl_ui_test_focus},
{ "efl_ui_focus_sub", efl_ui_test_focus_sub},
{ "efl_ui_box", efl_ui_test_box},
diff --git a/src/tests/elementary/efl_ui_suite.h b/src/tests/elementary/efl_ui_suite.h
index 3755a0e56f..5282949eb5 100644
--- a/src/tests/elementary/efl_ui_suite.h
+++ b/src/tests/elementary/efl_ui_suite.h
@@ -29,6 +29,7 @@ void efl_ui_test_atspi(TCase *tc);
void efl_ui_test_image_zoomable(TCase *tc);
void efl_ui_test_layout(TCase *tc);
void efl_ui_test_image(TCase *tc);
+void efl_ui_test_callback(TCase *tc);
void efl_ui_test_focus(TCase *tc);
void efl_ui_test_focus_sub(TCase *tc);
diff --git a/src/tests/elementary/efl_ui_test_callback.c b/src/tests/elementary/efl_ui_test_callback.c
new file mode 100644
index 0000000000..35f625455f
--- /dev/null
+++ b/src/tests/elementary/efl_ui_test_callback.c
@@ -0,0 +1,45 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
+#include <Efl_Ui.h>
+#include <Elementary.h>
+#include "elm_suite.h"
+
+static Eo *win;
+
+static void
+callback_setup()
+{
+ win = win_add();
+
+ efl_gfx_entity_size_set(win, EINA_SIZE2D(500, 50));
+}
+
+static void
+_btn_visibility_change(void *data EINA_UNUSED, const Efl_Event *ev)
+{
+ Eina_Bool *flag = data;
+ Eina_Bool *visible = ev->info;
+
+ if (!(*visible))
+ *flag = EINA_TRUE;
+}
+
+EFL_START_TEST(efl_ui_callback_visibility)
+{
+ Eina_Bool check = EINA_FALSE;
+ Eo *box = efl_add(EFL_UI_BOX_CLASS, win,
+ efl_content_set(win, efl_added));
+ efl_event_callback_add(box, EFL_GFX_ENTITY_EVENT_VISIBILITY_CHANGED, _btn_visibility_change, &check);
+ efl_gfx_entity_visible_set(box, EINA_FALSE);
+
+ ck_assert_int_eq(check, EINA_TRUE);
+}
+EFL_END_TEST
+
+void efl_ui_test_callback(TCase *tc)
+{
+ tcase_add_checked_fixture(tc, callback_setup, NULL);
+ tcase_add_test(tc, efl_ui_callback_visibility);
+}
diff --git a/src/tests/elementary/elm_test_fileselector.c b/src/tests/elementary/elm_test_fileselector.c
index a2df980a30..23cea7c133 100644
--- a/src/tests/elementary/elm_test_fileselector.c
+++ b/src/tests/elementary/elm_test_fileselector.c
@@ -6,6 +6,44 @@
#include <Elementary.h>
#include "elm_suite.h"
+
+EFL_START_TEST(elm_fileselector_legacy_type_check)
+{
+ Evas_Object *win, *fileselector;
+ const char *type;
+
+ win = win_add(NULL, "fileselector", ELM_WIN_BASIC);
+
+ fileselector = elm_fileselector_add(win);
+
+ type = elm_object_widget_type_get(fileselector);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "Elm_Fileselector"));
+
+ type = evas_object_type_get(fileselector);
+ ck_assert(type != NULL);
+ ck_assert(!strcmp(type, "elm_fileselector"));
+
+}
+EFL_END_TEST
+
+EFL_START_TEST(elm_atspi_role_get)
+{
+ Evas_Object *win, *fileselector;
+ Efl_Access_Role role;
+
+ win = win_add(NULL, "fileselector", ELM_WIN_BASIC);
+
+ fileselector = elm_fileselector_add(win);
+ role = efl_access_object_role_get(fileselector);
+
+ ck_assert(role == EFL_ACCESS_ROLE_FILE_CHOOSER);
+
+}
+EFL_END_TEST
+
+#if 0
+
static Eina_Bool
timer_expired_cb(void *user_data)
{
@@ -45,42 +83,6 @@ fileselector_test_helper_wait_flag(double in, Eina_Bool *done)
return !did_timeout;
}
-
-EFL_START_TEST(elm_fileselector_legacy_type_check)
-{
- Evas_Object *win, *fileselector;
- const char *type;
-
- win = win_add(NULL, "fileselector", ELM_WIN_BASIC);
-
- fileselector = elm_fileselector_add(win);
-
- type = elm_object_widget_type_get(fileselector);
- ck_assert(type != NULL);
- ck_assert(!strcmp(type, "Elm_Fileselector"));
-
- type = evas_object_type_get(fileselector);
- ck_assert(type != NULL);
- ck_assert(!strcmp(type, "elm_fileselector"));
-
-}
-EFL_END_TEST
-
-EFL_START_TEST(elm_atspi_role_get)
-{
- Evas_Object *win, *fileselector;
- Efl_Access_Role role;
-
- win = win_add(NULL, "fileselector", ELM_WIN_BASIC);
-
- fileselector = elm_fileselector_add(win);
- role = efl_access_object_role_get(fileselector);
-
- ck_assert(role == EFL_ACCESS_ROLE_FILE_CHOOSER);
-
-}
-EFL_END_TEST
-
static void
_ready_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
@@ -90,6 +92,7 @@ _ready_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED
ecore_main_loop_quit();
}
+
EFL_START_TEST(elm_fileselector_selected)
{
Evas_Object *win, *fileselector;
@@ -143,10 +146,13 @@ EFL_START_TEST(elm_fileselector_selected)
}
EFL_END_TEST
+#endif
+
void elm_test_fileselector(TCase *tc)
{
tcase_add_test(tc, elm_fileselector_legacy_type_check);
tcase_add_test(tc, elm_atspi_role_get);
- tcase_add_test(tc, elm_fileselector_selected);
+ //FIXME this should be reenabled when issues on travis are fixed with this.
+ //tcase_add_test(tc, elm_fileselector_selected);
}
diff --git a/src/tests/elementary/meson.build b/src/tests/elementary/meson.build
index 987913aef2..51120beca8 100644
--- a/src/tests/elementary/meson.build
+++ b/src/tests/elementary/meson.build
@@ -120,6 +120,7 @@ efl_ui_suite_src = [
'suite_helpers.h',
'elm_test_init.c',
'efl_ui_test_atspi.c',
+ 'efl_ui_test_callback.c',
'efl_ui_test_focus_common.c',
'efl_ui_test_focus_common.h',
'efl_ui_test_focus.c',