aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/Makefile_Efl.am2
-rw-r--r--src/Makefile_Elementary.am1
-rw-r--r--src/Makefile_Elua.am15
-rw-r--r--src/Makefile_Eolian.am1
-rw-r--r--src/bin/edje/edje_pick.c4
-rw-r--r--src/bin/edje/edje_player.c4
-rw-r--r--src/bin/edje/edje_watch.c3
-rw-r--r--src/bin/efreet/efreet_desktop_cache_create.c4
-rw-r--r--src/bin/efreet/efreet_icon_cache_create.c4
-rw-r--r--src/bin/efreet/efreet_mime_cache_create.c4
-rw-r--r--src/bin/efreet/efreetd_ipc.c4
-rw-r--r--src/bin/elementary/meson.build1
-rw-r--r--src/bin/elementary/test.c14
-rw-r--r--src/bin/elementary/test_evas_mask.c6
-rw-r--r--src/bin/elementary/test_image.c7
-rw-r--r--src/bin/elementary/test_ui_image.c671
-rw-r--r--src/bin/elementary/test_ui_table.c2
-rw-r--r--src/bin/embryo/embryo_cc_sc1.c4
-rw-r--r--src/bindings/luajit/eolian.lua5
-rw-r--r--src/examples/evas/Makefile.examples1
-rw-r--r--src/examples/evas/evas-images5.c15
-rw-r--r--src/examples/evas/evas-images6.c98
-rw-r--r--src/examples/evas/meson.build1
-rw-r--r--src/examples/evas/resources/images/scale_down.png0
-rw-r--r--src/lib/ecore_con/efl_net_control_manager.eo10
-rw-r--r--src/lib/ecore_con/efl_net_dialer.eo2
-rw-r--r--src/lib/ecore_con/efl_net_socket_ssl.eo2
-rw-r--r--src/lib/ecore_con/efl_net_ssl_context.eo2
-rw-r--r--src/lib/ecore_evas/ecore_evas.c4
-rw-r--r--src/lib/ecore_file/ecore_file.c1
-rw-r--r--src/lib/ecore_file/ecore_file_monitor_win32.c14
-rw-r--r--src/lib/ecore_file/ecore_file_private.h4
-rw-r--r--src/lib/edje/edje_private.h5
-rw-r--r--src/lib/efl/Efl.h6
-rw-r--r--src/lib/efl/interfaces/efl_canvas_scene.eo2
-rw-r--r--src/lib/efl/interfaces/efl_gfx_buffer.eo4
-rw-r--r--src/lib/efl/interfaces/efl_gfx_orientable.eo44
-rw-r--r--src/lib/efl/interfaces/efl_interfaces_main.c2
-rw-r--r--src/lib/efl/interfaces/efl_orientation.eo57
-rw-r--r--src/lib/efl/interfaces/efl_pack_table.eo33
-rw-r--r--src/lib/efl/interfaces/efl_ui_direction.eo4
-rw-r--r--src/lib/efl/interfaces/efl_ui_format.eo4
-rw-r--r--src/lib/efl/interfaces/meson.build2
-rw-r--r--src/lib/efreet/efreet_desktop.c3
-rw-r--r--src/lib/efreet/efreet_trash.c8
-rw-r--r--src/lib/efreet/efreet_uri.c4
-rw-r--r--src/lib/eina/eina_config.h.in20
-rw-r--r--src/lib/eina/eina_inline_cpu.x10
-rw-r--r--src/lib/eina/meson.build12
-rw-r--r--src/lib/eio/eio_dir.c4
-rw-r--r--src/lib/eio/eio_inline_helper.x8
-rw-r--r--src/lib/eio/eio_monitor_win32.c2
-rw-r--r--src/lib/eio/eio_private.h4
-rw-r--r--src/lib/eio/eio_single.c5
-rw-r--r--src/lib/elementary/efl_ui_clock.eo2
-rw-r--r--src/lib/elementary/efl_ui_image.c90
-rw-r--r--src/lib/elementary/efl_ui_image.eo5
-rw-r--r--src/lib/elementary/efl_ui_image_zoomable.c158
-rw-r--r--src/lib/elementary/efl_ui_image_zoomable.eo3
-rw-r--r--src/lib/elementary/efl_ui_image_zoomable_private.h5
-rw-r--r--src/lib/elementary/efl_ui_internal_text_scroller.eo4
-rw-r--r--src/lib/elementary/efl_ui_layout.c2
-rw-r--r--src/lib/elementary/efl_ui_layout_base.eo3
-rw-r--r--src/lib/elementary/efl_ui_pager.eo4
-rw-r--r--src/lib/elementary/efl_ui_radio.eo2
-rw-r--r--src/lib/elementary/efl_ui_scroll_manager.eo2
-rw-r--r--src/lib/elementary/efl_ui_table.c54
-rw-r--r--src/lib/elementary/efl_ui_table.eo15
-rw-r--r--src/lib/elementary/efl_ui_table_private.h2
-rw-r--r--src/lib/elementary/efl_ui_text.eo2
-rw-r--r--src/lib/elementary/efl_ui_textpath.c86
-rw-r--r--src/lib/elementary/efl_ui_textpath.eo4
-rw-r--r--src/lib/elementary/efl_ui_textpath_eo.legacy.h4
-rw-r--r--src/lib/elementary/efl_ui_widget.eo10
-rw-r--r--src/lib/elementary/efl_ui_widget_image.h3
-rw-r--r--src/lib/elementary/efl_ui_win.eo8
-rw-r--r--src/lib/elementary/elm_entry.c9
-rw-r--r--src/lib/elementary/elm_font.c4
-rw-r--r--src/lib/elementary/elm_interface_scrollable.eo48
-rw-r--r--src/lib/elementary/elm_main.c1
-rw-r--r--src/lib/elua/elua_private.h4
-rw-r--r--src/lib/embryo/embryo_time.c2
-rw-r--r--src/lib/eo/efl_object.eo6
-rw-r--r--src/lib/eolian/Eolian.h10
-rw-r--r--src/lib/eolian/database_function_parameter_api.c7
-rw-r--r--src/lib/eolian/eo_lexer.h5
-rw-r--r--src/lib/eolian/eo_parser.c11
-rw-r--r--src/lib/eolian/eolian_database.h1
-rw-r--r--src/lib/ephysics/ephysics_private.h4
-rw-r--r--src/lib/ethumb/ethumb.c4
-rw-r--r--src/lib/evas/cache/evas_cache_image.c4
-rw-r--r--src/lib/evas/cache/evas_preload.c3
-rw-r--r--src/lib/evas/canvas/efl_canvas_image_internal.eo5
-rw-r--r--src/lib/evas/canvas/evas_async_events.c3
-rw-r--r--src/lib/evas/canvas/evas_font_dir.c2
-rw-r--r--src/lib/evas/canvas/evas_image_private.h3
-rw-r--r--src/lib/evas/canvas/evas_main.c4
-rw-r--r--src/lib/evas/canvas/evas_object_image.c94
-rw-r--r--src/lib/evas/common/evas_image_scalecache.c4
-rw-r--r--src/lib/evas/common/evas_scale_sample.c255
-rw-r--r--src/lib/evas/common/language/evas_language_utils.c4
-rw-r--r--src/lib/evas/file/evas_path.c2
-rw-r--r--src/lib/evas/gesture/meson.build3
-rw-r--r--src/lib/evas/include/evas_common_private.h4
-rw-r--r--src/modules/evas/engines/software_generic/evas_engine.c4
-rw-r--r--src/modules/evas/engines/software_generic/evas_native_dmabuf.c2
-rw-r--r--src/modules/evas/engines/software_generic/evas_native_tbm.c2
-rw-r--r--src/modules/evas/image_loaders/bmp/evas_image_load_bmp.c4
-rw-r--r--src/modules/evas/image_loaders/generic/evas_image_load_generic.c4
-rw-r--r--src/modules/evas/image_loaders/ico/evas_image_load_ico.c4
-rw-r--r--src/modules/evas/image_loaders/jp2k/evas_image_load_jp2k.c4
-rw-r--r--src/modules/evas/image_loaders/pmaps/evas_image_load_pmaps.c4
-rw-r--r--src/modules/evas/image_loaders/png/evas_image_load_png.c4
-rw-r--r--src/modules/evas/image_loaders/psd/evas_image_load_psd.c4
-rw-r--r--src/modules/evas/image_loaders/tga/evas_image_load_tga.c4
-rw-r--r--src/modules/evas/image_loaders/tiff/evas_image_load_tiff.c4
-rw-r--r--src/modules/evas/image_loaders/wbmp/evas_image_load_wbmp.c4
-rw-r--r--src/modules/evas/image_loaders/webp/evas_image_load_webp.c4
-rw-r--r--src/modules/evas/image_loaders/xpm/evas_image_load_xpm.c4
-rw-r--r--src/modules/evas/image_savers/png/evas_image_save_png.c4
-rw-r--r--src/scripts/elua/apps/README-docgen.md9
-rw-r--r--src/scripts/elua/apps/docgen/doctree.lua1427
-rw-r--r--src/scripts/elua/apps/docgen/keyref.lua41
-rw-r--r--src/scripts/elua/apps/docgen/mono.lua614
-rw-r--r--src/scripts/elua/apps/docgen/stats.lua274
-rw-r--r--src/scripts/elua/apps/docgen/util.lua50
-rw-r--r--src/scripts/elua/apps/docgen/writer.lua397
-rw-r--r--src/scripts/elua/apps/gendoc.lua1804
-rwxr-xr-xsrc/scripts/elua/apps/gendoc.sh38
-rw-r--r--src/scripts/pyolian/eolian.py6
-rw-r--r--src/scripts/pyolian/eolian_lib.py4
-rwxr-xr-xsrc/scripts/pyolian/test_eolian.py1
-rw-r--r--src/tests/elementary/efl_ui_test_table.c17
-rw-r--r--src/tests/eolian/data/null.eo12
-rw-r--r--src/tests/eolian/eolian_parsing.c51
135 files changed, 1341 insertions, 5591 deletions
diff --git a/src/Makefile_Efl.am b/src/Makefile_Efl.am
index f62bced764..a4f53e039a 100644
--- a/src/Makefile_Efl.am
+++ b/src/Makefile_Efl.am
@@ -48,7 +48,7 @@ efl_eolian_files = \
lib/efl/interfaces/efl_gfx_blur.eo \
lib/efl/interfaces/efl_gfx_hint.eo \
lib/efl/interfaces/efl_model.eo \
- lib/efl/interfaces/efl_orientation.eo \
+ lib/efl/interfaces/efl_gfx_orientable.eo \
lib/efl/interfaces/efl_container.eo \
lib/efl/interfaces/efl_content.eo \
lib/efl/interfaces/efl_gfx_arrangement.eo \
diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am
index 71bd3e553b..7023d6b950 100644
--- a/src/Makefile_Elementary.am
+++ b/src/Makefile_Elementary.am
@@ -1364,6 +1364,7 @@ bin/elementary/test_icon.c \
bin/elementary/test_icon_desktops.c \
bin/elementary/test_icon_animated.c \
bin/elementary/test_image.c \
+bin/elementary/test_ui_image.c \
bin/elementary/test_index.c \
bin/elementary/test_inwin.c \
bin/elementary/test_label.c \
diff --git a/src/Makefile_Elua.am b/src/Makefile_Elua.am
index 069a33c0ef..f172a228b9 100644
--- a/src/Makefile_Elua.am
+++ b/src/Makefile_Elua.am
@@ -57,21 +57,10 @@ include Makefile_Elua_Helper.am
endif
eluaapps_files = \
- scripts/elua/apps/lualian.lua \
- scripts/elua/apps/gendoc.lua \
- scripts/elua/apps/gendoc.sh \
- scripts/elua/apps/README-docgen.md
+ scripts/elua/apps/lualian.lua
EXTRA_DIST2 += $(eluaapps_files)
-eluadocgen_files = \
- scripts/elua/apps/docgen/doctree.lua \
- scripts/elua/apps/docgen/keyref.lua \
- scripts/elua/apps/docgen/stats.lua \
- scripts/elua/apps/docgen/util.lua \
- scripts/elua/apps/docgen/writer.lua
-
-EXTRA_DIST2 += $(eluadocgen_files)
eluamodules_files = \
scripts/elua/modules/benchmark.lua \
scripts/elua/modules/getopt.lua \
@@ -108,8 +97,6 @@ eluaappsdir = $(datadir)/elua/apps
eluaapps_DATA = $(eluaapps_files)
eluamodulesdir = $(datadir)/elua/modules
eluamodules_DATA = $(eluamodules_files)
-eluadocgendir = $(datadir)/elua/apps/docgen
-eluadocgen_DATA = $(eluadocgen_files)
eluaeinadir = $(eluamodulesdir)/eina
eluaeina_DATA = $(eluaeina_files)
eluacoredir = $(datadir)/elua/core
diff --git a/src/Makefile_Eolian.am b/src/Makefile_Eolian.am
index 876a2f01ac..0336b7f5c2 100644
--- a/src/Makefile_Eolian.am
+++ b/src/Makefile_Eolian.am
@@ -92,7 +92,6 @@ tests/eolian/data/nmsp1_class1.eo \
tests/eolian/data/nmsp1_nmsp11_class2.eo \
tests/eolian/data/nmsp2_class1.eo \
tests/eolian/data/no_nmsp.eo \
-tests/eolian/data/null.eo \
tests/eolian/data/object_impl.eo \
tests/eolian/data/object_impl_add.eo \
tests/eolian/data/override.eo \
diff --git a/src/bin/edje/edje_pick.c b/src/bin/edje/edje_pick.c
index 2079d92cee..3967443556 100644
--- a/src/bin/edje/edje_pick.c
+++ b/src/bin/edje/edje_pick.c
@@ -11,10 +11,6 @@
#include <ctype.h>
#include <Ecore_Getopt.h>
-#ifdef _WIN32
-# include <Evil.h>
-#endif
-
#include "edje_cc.h"
#include "edje_private.h"
diff --git a/src/bin/edje/edje_player.c b/src/bin/edje/edje_player.c
index 34c1de1685..d3ae0c9aeb 100644
--- a/src/bin/edje/edje_player.c
+++ b/src/bin/edje/edje_player.c
@@ -10,10 +10,6 @@
#include <fcntl.h>
#include <ctype.h>
-#ifdef _WIN32
-# include <Evil.h>
-#endif
-
#include <Evas.h>
#include <Ecore.h>
#include <Ecore_Getopt.h>
diff --git a/src/bin/edje/edje_watch.c b/src/bin/edje/edje_watch.c
index 7c049a609a..785d941364 100644
--- a/src/bin/edje/edje_watch.c
+++ b/src/bin/edje/edje_watch.c
@@ -6,9 +6,6 @@
# include <sys/wait.h>
#endif
-#ifdef _WIN32
-# include <Evil.h>
-#endif
#include <Eina.h>
#include <Ecore.h>
#include <Eio.h>
diff --git a/src/bin/efreet/efreet_desktop_cache_create.c b/src/bin/efreet/efreet_desktop_cache_create.c
index c749ffe4ee..ec7553dcc8 100644
--- a/src/bin/efreet/efreet_desktop_cache_create.c
+++ b/src/bin/efreet/efreet_desktop_cache_create.c
@@ -12,6 +12,10 @@
#include <libgen.h>
+#ifdef _WIN32
+# include <evil_private.h> /* fcntl realpath */
+#endif
+
#include <Eina.h>
#include <Eet.h>
#include <Ecore.h>
diff --git a/src/bin/efreet/efreet_icon_cache_create.c b/src/bin/efreet/efreet_icon_cache_create.c
index 5fe2fe3ff0..9f3141b8f9 100644
--- a/src/bin/efreet/efreet_icon_cache_create.c
+++ b/src/bin/efreet/efreet_icon_cache_create.c
@@ -10,6 +10,10 @@
#include <sys/resource.h>
#endif
+#ifdef _WIN32
+# include <evil_private.h> /* fcntl */
+#endif
+
#include <Eina.h>
#include <Eet.h>
#include <Ecore.h>
diff --git a/src/bin/efreet/efreet_mime_cache_create.c b/src/bin/efreet/efreet_mime_cache_create.c
index 68e30179ee..56fa592a2b 100644
--- a/src/bin/efreet/efreet_mime_cache_create.c
+++ b/src/bin/efreet/efreet_mime_cache_create.c
@@ -13,6 +13,10 @@
#include <libgen.h>
#include <ctype.h>
+#ifdef _WIN32
+# include <evil_private.h> /* fcntl */
+#endif
+
#include <Eina.h>
#include <Eet.h>
#include <Ecore.h>
diff --git a/src/bin/efreet/efreetd_ipc.c b/src/bin/efreet/efreetd_ipc.c
index 533a33bc75..949569b729 100644
--- a/src/bin/efreet/efreetd_ipc.c
+++ b/src/bin/efreet/efreetd_ipc.c
@@ -2,6 +2,10 @@
# include <config.h>
#endif
+#ifdef _WIN32
+# include <evil_private.h> /* setenv */
+#endif
+
#include <Ecore.h>
#include <Ecore_Ipc.h>
diff --git a/src/bin/elementary/meson.build b/src/bin/elementary/meson.build
index 0f7fa3d340..cfc5071ea2 100644
--- a/src/bin/elementary/meson.build
+++ b/src/bin/elementary/meson.build
@@ -79,6 +79,7 @@ elementary_test_src = [
'test_icon_desktops.c',
'test_icon_animated.c',
'test_image.c',
+ 'test_ui_image.c',
'test_index.c',
'test_inwin.c',
'test_label.c',
diff --git a/src/bin/elementary/test.c b/src/bin/elementary/test.c
index 146d7ef902..80af598173 100644
--- a/src/bin/elementary/test.c
+++ b/src/bin/elementary/test.c
@@ -310,6 +310,13 @@ void test_image_prescale(void *data, Evas_Object *obj, void *event_info);
void test_remote_image(void *data, Evas_Object *obj, void *event_info);
void test_click_image(void *data, Evas_Object *obj, void *event_info);
void test_load_image(void *data, Evas_Object *obj, void *event_info);
+void test_ui_image(void *data, Evas_Object *obj, void *event_info);
+void test_ui_image_scale_type(void *data, Evas_Object *obj, void *event_info);
+void test_ui_image_swallow_align(void *data, Evas_Object *obj, void *event_info);
+void test_ui_image_prescale(void *data, Evas_Object *obj, void *event_info);
+void test_remote_ui_image(void *data, Evas_Object *obj, void *event_info);
+void test_click_ui_image(void *data, Evas_Object *obj, void *event_info);
+void test_load_ui_image(void *data, Evas_Object *obj, void *event_info);
void test_external_button(void *data, Evas_Object *obj, void *event_info);
void test_external_slider(void *data, Evas_Object *obj, void *event_info);
void test_external_scroller(void *data, Evas_Object *obj, void *event_info);
@@ -820,6 +827,13 @@ add_tests:
ADD_TEST(NULL, "Images", "Image Click", test_click_image);
ADD_TEST(NULL, "Images", "Image Async Load", test_load_image);
ADD_TEST(NULL, "Images", "Image Prescale", test_image_prescale);
+ ADD_TEST_EO(NULL, "Images", "EFL.UI.Image", test_ui_image);
+ ADD_TEST_EO(NULL, "Images", "EFL.UI.Image Scale Type", test_ui_image_scale_type);
+ ADD_TEST_EO(NULL, "Images", "EFL.UI.Image Align", test_ui_image_swallow_align);
+ ADD_TEST_EO(NULL, "Images", "EFL.UI.Image Remote", test_remote_ui_image);
+ ADD_TEST_EO(NULL, "Images", "EFL.UI.Image Click", test_click_ui_image);
+ ADD_TEST_EO(NULL, "Images", "EFL.UI.Image Async Load", test_load_ui_image);
+ ADD_TEST_EO(NULL, "Images", "EFL.UI.Image Prescale", test_ui_image_prescale);
ADD_TEST(NULL, "Images", "Slideshow", test_slideshow);
ADD_TEST(NULL, "Images", "Video", test_video);
diff --git a/src/bin/elementary/test_evas_mask.c b/src/bin/elementary/test_evas_mask.c
index 223d657b4c..b432ee0225 100644
--- a/src/bin/elementary/test_evas_mask.c
+++ b/src/bin/elementary/test_evas_mask.c
@@ -93,12 +93,12 @@ _toggle_map(void *data, const Efl_Event *ev EINA_UNUSED)
static void
_rotate_win(void *data, const Efl_Event *ev EINA_UNUSED)
{
- //Efl_Orient orient;
+ //Efl_Gfx_Orientation orient;
Eo *win = data;
// FIXME: This is not implemented???
- //orient = efl_orientation_get(win);
- //efl_orientation_set(win, (orient + 90) % 360);
+ //orient = efl_gfx_orientation_get(win);
+ //efl_gfx_orientation_set(win, (orient + 90) % 360);
elm_win_rotation_set(win, (elm_win_rotation_get(win) + 90) % 360);
}
diff --git a/src/bin/elementary/test_image.c b/src/bin/elementary/test_image.c
index 986767b1bb..18ae4dbcef 100644
--- a/src/bin/elementary/test_image.c
+++ b/src/bin/elementary/test_image.c
@@ -232,12 +232,13 @@ test_image_swallow_align(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
static void
_download_start_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
- Evas_Object *win = data, *txt;
+ Evas_Object *win = data, *txt, *im;
const char *url = NULL;
char buf[4096] = {0};
txt = evas_object_data_get(win, "txt");
- elm_image_file_get(txt, &url, NULL);
+ im = evas_object_data_get(win, "im");
+ elm_image_file_get(im, &url, NULL);
snprintf(buf, sizeof(buf) - 1, "Remote image download started:\n%s", url);
elm_object_text_set(txt, buf);
printf("%s\n", buf);
@@ -677,7 +678,7 @@ test_image_prescale(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *
hbox = elm_box_add(win);
elm_box_horizontal_set(hbox, EINA_TRUE);
- evas_object_size_hint_weight_set(hbox, EVAS_HINT_EXPAND, EVAS_HINT_FILL);
+ evas_object_size_hint_weight_set(hbox, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(hbox, EVAS_HINT_FILL, EVAS_HINT_FILL);
rd = elm_radio_add(win);
diff --git a/src/bin/elementary/test_ui_image.c b/src/bin/elementary/test_ui_image.c
new file mode 100644
index 0000000000..8c2ffbd65e
--- /dev/null
+++ b/src/bin/elementary/test_ui_image.c
@@ -0,0 +1,671 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+#include <Elementary.h>
+#include <Efl_Ui.h>
+
+static const struct {
+ Efl_Gfx_Orientation orient;
+ const char *name;
+} images_orient[] = {
+ { EFL_GFX_ORIENTATION_NONE, "None" },
+ { EFL_GFX_ORIENTATION_RIGHT, "Rotate 90" },
+ { EFL_GFX_ORIENTATION_DOWN, "Rotate 180" },
+ { EFL_GFX_ORIENTATION_LEFT, "Rotate 270" },
+ { EFL_GFX_ORIENTATION_FLIP_HORIZONTAL, "Horizontal Flip" },
+ { EFL_GFX_ORIENTATION_FLIP_VERTICAL, "Vertical Flip" },
+ { 0, NULL }
+};
+
+static Eo *
+win_add(const char *name, const char *title)
+{
+ return efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
+ efl_ui_win_name_set(efl_added, name),
+ efl_ui_win_autodel_set(efl_added, EINA_TRUE),
+ efl_text_set(efl_added, title));
+}
+
+static Eo *
+img_add(Eo *win, const char *file)
+{
+ char buf[PATH_MAX];
+ Eo *im;
+
+ im = efl_add(EFL_UI_IMAGE_CLASS, win,
+ efl_gfx_hint_weight_set(efl_added, 1.0, 1.0),
+ efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_TRUE)
+ );
+ if (file)
+ {
+ snprintf(buf, sizeof(buf), "%s%s", elm_app_data_dir_get(), file);
+ efl_file_simple_load(im, buf, NULL);
+ }
+ efl_key_data_set(win, "im", im);
+ return im;
+}
+
+static void
+my_im_ch(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ Eo *win = data;
+ Eo *im = efl_key_data_get(win, "im");
+ Eo *rdg = efl_key_data_get(win, "rdg");
+ Efl_Gfx_Orientation v = efl_ui_radio_state_value_get(efl_ui_radio_selected_object_get(rdg));
+
+ efl_gfx_orientation_set(im, v);
+ fprintf(stderr, "Set %i and got %i\n",
+ v, efl_gfx_orientation_get(im));
+}
+
+void
+test_ui_image(void *data EINA_UNUSED, Eo *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+ Eo *win, *box, *im, *rd, *rdg = NULL;
+ int i;
+
+ win = win_add("image test", "Image Test");
+
+ box = efl_add(EFL_UI_BOX_CLASS, win);
+ efl_gfx_hint_weight_set(box, 1.0, 1.0);
+ efl_content_set(win, box);
+
+ im = img_add(win, "/images/logo.png");
+ efl_pack(box, im);
+
+ for (i = 0; images_orient[i].name; ++i)
+ {
+ rd = efl_add(EFL_UI_RADIO_CLASS, win);
+ efl_gfx_hint_fill_set(rd, EINA_TRUE, EINA_TRUE);
+ efl_gfx_hint_weight_set(rd, 1.0, 0.0);
+ efl_ui_radio_state_value_set(rd, images_orient[i].orient);
+ efl_text_set(rd, images_orient[i].name);
+ efl_pack(box, rd);
+ efl_event_callback_add(rd, EFL_UI_RADIO_EVENT_CHANGED, my_im_ch, win);
+ if (!rdg)
+ {
+ rdg = rd;
+ efl_key_data_set(win, "rdg", rdg);
+ }
+ else
+ {
+ efl_ui_radio_group_add(rd, rdg);
+ }
+ }
+
+ efl_gfx_entity_size_set(win, EINA_SIZE2D(320, 480));
+}
+
+
+static void
+im_align_cb(void *data, Eo *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+ double h,v;
+ Eo *win = data;
+ Eo *im = efl_key_data_get(win, "im");
+ Eo *h_sl = efl_key_data_get(win, "h_sl");
+ Eo *v_sl = efl_key_data_get(win, "v_sl");
+
+ h = elm_slider_value_get(h_sl);
+ v = elm_slider_value_get(v_sl);
+ efl_gfx_hint_align_set(im, h, v);
+ efl_gfx_hint_align_get(im, &h, &v);
+ printf("align %.3f %.3f\n", h, v);
+}
+
+static const struct {
+ Efl_Gfx_Image_Scale_Type scale_type;
+ const char *name;
+} images_scale_type[] = {
+ { EFL_GFX_IMAGE_SCALE_TYPE_NONE, "None" },
+ { EFL_GFX_IMAGE_SCALE_TYPE_FILL, "Fill" },
+ { EFL_GFX_IMAGE_SCALE_TYPE_FIT_INSIDE, "Fit Inside" },
+ { EFL_GFX_IMAGE_SCALE_TYPE_FIT_OUTSIDE, "Fit Outside" },
+ { EFL_GFX_IMAGE_SCALE_TYPE_TILE, "Tile" },
+ { 0, NULL }
+};
+
+static void
+my_im_scale_ch(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ Eo *win = data;
+ Eo *im = efl_key_data_get(win, "im");
+ Eo *rdg = efl_key_data_get(win, "rdg");
+ int v = efl_ui_radio_state_value_get(efl_ui_radio_selected_object_get(rdg));
+
+ efl_gfx_image_scale_type_set(im, images_scale_type[v].scale_type);
+ fprintf(stderr, "Set %d[%s] and got %d\n",
+ images_scale_type[v].scale_type, images_scale_type[v].name, efl_gfx_image_scale_type_get(im));
+}
+
+void
+test_ui_image_scale_type(void *data EINA_UNUSED, Eo *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+ Eo *win, *box, *im, *rd, *rdg = NULL;
+ int i;
+
+ win = win_add("image test scale type", "Image Test Scale Type");
+
+ box = efl_add(EFL_UI_BOX_CLASS, win);
+ efl_gfx_hint_weight_set(box, 1.0, 1.0);
+ efl_content_set(win, box);
+
+ im = efl_add(EFL_UI_IMAGE_CLASS, win);
+ char buf[PATH_MAX];
+ snprintf(buf, sizeof(buf), "%s/images/logo.png", elm_app_data_dir_get());
+ elm_image_file_set(im, buf, NULL);
+ efl_gfx_hint_weight_set(im, 1.0, 1.0);
+ efl_gfx_hint_fill_set(im, EINA_TRUE, EINA_TRUE);
+ efl_pack(box, im);
+
+ efl_key_data_set(win, "im", im);
+
+ for (i = 0; images_scale_type[i].name; ++i)
+ {
+ rd = efl_add(EFL_UI_RADIO_CLASS, win);
+ efl_gfx_hint_fill_set(rd, EINA_TRUE, EINA_TRUE);
+ efl_gfx_hint_weight_set(rd, 1.0, 0.0);
+ efl_ui_radio_state_value_set(rd, i);
+ efl_text_set(rd, images_scale_type[i].name);
+ efl_pack(box, rd);
+ efl_event_callback_add(rd, EFL_UI_RADIO_EVENT_CHANGED, my_im_scale_ch, win);
+ if (!rdg)
+ {
+ rdg = rd;
+ efl_key_data_set(win, "rdg", rdg);
+ }
+ else
+ {
+ efl_ui_radio_group_add(rd, rdg);
+ }
+ }
+
+ efl_gfx_entity_size_set(win, EINA_SIZE2D(320, 480));
+}
+
+void
+test_ui_image_swallow_align(void *data EINA_UNUSED, Eo *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+ Eo *win, *box, *im, *ly, *sl;
+ char buf[PATH_MAX];
+
+ win = win_add("image align", "Test Align Inside Layout");
+
+ box = efl_add(EFL_UI_BOX_CLASS, win);
+ efl_gfx_hint_weight_set(box, 1.0, 1.0);
+ efl_content_set(win, box);
+
+ ly = efl_add(EFL_UI_LAYOUT_CLASS, win);
+ snprintf(buf, sizeof(buf), "%s/objects/test.edj", elm_app_data_dir_get());
+ efl_file_simple_load(ly, buf, "image_align");
+ efl_gfx_hint_weight_set(ly, 1.0, 1.0);
+ efl_gfx_hint_fill_set(ly, EINA_TRUE, EINA_TRUE);
+ efl_pack(box, ly);
+
+ im = img_add(win, "/images/logo.png");
+ efl_gfx_hint_weight_set(im, 0, 0);
+ efl_gfx_hint_fill_set(im, EINA_FALSE, EINA_FALSE);
+ efl_content_set(efl_part(ly, "swallow"), im);
+
+ sl = elm_slider_add(win);
+ elm_slider_value_set(sl, 0.5);
+ efl_text_set(sl, "Horiz Align");
+ efl_gfx_hint_weight_set(sl, 1.0, 0.0);
+ evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_smart_callback_add(sl, "changed", im_align_cb, win);
+ efl_pack(box, sl);
+ evas_object_show(sl);
+ efl_key_data_set(win, "h_sl", sl);
+
+ sl = elm_slider_add(win);
+ elm_slider_value_set(sl, 0.5);
+ efl_text_set(sl, "Vert Align");
+ efl_gfx_hint_weight_set(sl, 1.0, 0.0);
+ evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_smart_callback_add(sl, "changed", im_align_cb, win);
+ efl_pack(box, sl);
+ evas_object_show(sl);
+ efl_key_data_set(win, "v_sl", sl);
+
+ efl_gfx_entity_size_set(win, EINA_SIZE2D(300, 600));
+}
+
+static void
+_download_start_cb(void *data, Eo *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+ Eo *win = data, *txt, *im;
+ const char *url = NULL;
+ char buf[4096] = {0};
+
+ txt = efl_key_data_get(win, "txt");
+ im = efl_key_data_get(win, "im");
+ url = efl_file_get(im);
+ snprintf(buf, sizeof(buf) - 1, "Remote image download started:\n%s", url);
+ efl_text_set(txt, buf);
+ printf("%s\n", buf);
+ fflush(stdout);
+}
+
+static void
+_download_progress_cb(void *data EINA_UNUSED, Eo *obj EINA_UNUSED, void *event_info)
+{
+ Elm_Image_Progress *p = event_info;
+ Eo *win = data, *txt;
+ char buf[4096] = {0};
+
+ txt = efl_key_data_get(win, "txt");
+ snprintf(buf, sizeof(buf) - 1, "Remote image download progress %.2f/%.2f.", p->now, p->total);
+ efl_text_set(txt, buf);
+ printf("%s\n", buf);
+ fflush(stdout);
+}
+
+static void
+_download_done_cb(void *data, Eo *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+ Eo *win = data, *txt;
+ char buf[4096] = {0};
+
+ txt = efl_key_data_get(win, "txt");
+ snprintf(buf, sizeof(buf) - 1, "Remote image download done.");
+ efl_text_set(txt, buf);
+ printf("%s\n", buf);
+ fflush(stdout);
+
+ evas_object_hide(txt);
+}
+
+static void
+_download_error_cb(void *data, Eo *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+ Eo *win = data, *txt;
+ char buf[4096] = {0};
+
+ txt = efl_key_data_get(win, "txt");
+ snprintf(buf, sizeof(buf) - 1, "Remote image download failed.");
+ efl_text_set(txt, buf);
+ printf("%s\n", buf);
+ fflush(stdout);
+
+}
+
+static void
+_url_activate_cb(void *data, Eo *obj, void *event_info EINA_UNUSED)
+{
+ Eo *win = data, *txt, *im;
+ const char *url;
+
+ im = efl_key_data_get(win, "im");
+ txt = efl_key_data_get(win, "txt");
+
+ url = elm_object_text_get(obj);
+ elm_image_file_set(im, url, NULL);
+
+ evas_object_show(txt);
+}
+
+void
+test_remote_ui_image(void *data EINA_UNUSED, Eo *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+ Eo *win, *box, *im, *rd, *rdg = NULL, *box2, *o;
+ int i;
+
+ win = win_add("image test", "Image Test");
+
+ box = efl_add(EFL_UI_BOX_CLASS, win);
+ efl_gfx_hint_weight_set(box, 1.0, 1.0);
+ efl_content_set(win, box);
+
+ o = efl_add(EFL_UI_TEXT_CLASS, box, efl_text_interactive_editable_set(efl_added, EINA_FALSE));
+ efl_text_wrap_set(o, EFL_TEXT_FORMAT_WRAP_MIXED);
+ efl_gfx_hint_weight_set(o, 1.0, 1.0);
+ efl_gfx_hint_fill_set(o, EINA_TRUE, EINA_TRUE);
+ efl_pack(box, o);
+ efl_key_data_set(win, "txt", o);
+ evas_object_hide(o);
+
+ im = o = img_add(win, NULL);
+ efl_pack(box, o);
+
+ evas_object_smart_callback_add(im, "download,start", _download_start_cb, win);
+ evas_object_smart_callback_add(im, "download,progress", _download_progress_cb, win);
+ evas_object_smart_callback_add(im, "download,done", _download_done_cb, win);
+ evas_object_smart_callback_add(im, "download,error", _download_error_cb, win);
+
+ for (i = 0; images_orient[i].name; ++i)
+ {
+ rd = efl_add(EFL_UI_RADIO_CLASS, win);
+ efl_gfx_hint_fill_set(rd, EINA_TRUE, EINA_TRUE);
+ efl_gfx_hint_weight_set(rd, 1.0, 0.0);
+ efl_ui_radio_state_value_set(rd, images_orient[i].orient);
+ efl_text_set(rd, images_orient[i].name);
+ efl_pack(box, rd);
+ efl_event_callback_add(rd, EFL_UI_RADIO_EVENT_CHANGED, my_im_ch, win);
+ if (!rdg)
+ {
+ rdg = rd;
+ efl_key_data_set(win, "rdg", rdg);
+ }
+ else
+ {
+ efl_ui_radio_group_add(rd, rdg);
+ }
+ }
+
+ box2 = o = efl_add(EFL_UI_BOX_CLASS, box);
+ efl_ui_direction_set(o, EFL_UI_DIR_RIGHT);
+ efl_gfx_hint_weight_set(o, 1.0, 0);
+ efl_gfx_hint_fill_set(o, EINA_TRUE, EINA_TRUE);
+
+ o = efl_add(EFL_UI_TEXT_CLASS, box2,
+ efl_text_interactive_editable_set(efl_added, EINA_FALSE)
+ );
+ efl_text_set(o, "URL:");
+ efl_pack(box2, o);
+
+ o = elm_entry_add(box2);
+ elm_entry_scrollable_set(o, 1);
+ elm_entry_single_line_set(o, 1);
+ efl_gfx_hint_weight_set(o, 1.0, 0);
+ evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ //elm_entry_entry_set(o, "http://41.media.tumblr.com/29f1ecd4f98aaff73fb21f479b450d4c/tumblr_mqsxdciQmB1rrju89o1_1280.jpg");
+ elm_entry_entry_set(o, "http://68.media.tumblr.com/d14765b2cc4ec25d1e7d640f3ec77a40/tumblr_ohtpjtRNlm1rrju89o1_500.jpg");
+ evas_object_smart_callback_add(o, "activated", _url_activate_cb, win);
+ evas_object_show(o);
+ efl_pack(box2, o);
+
+ efl_pack(box, box2);
+
+ // set file now
+ _url_activate_cb(win, o, NULL);
+
+ efl_gfx_entity_size_set(win, EINA_SIZE2D(320, 480));
+}
+
+static void
+_img_clicked_cb(void *data EINA_UNUSED, Eo *obj, void *event_info EINA_UNUSED)
+{
+ fprintf(stderr, "%p - clicked\n", obj);
+}
+
+void
+test_click_ui_image(void *data EINA_UNUSED, Eo *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+ Eo *win, *box, *im, *label;
+
+ win = win_add("image test", "Image Test");
+ elm_win_focus_highlight_enabled_set(win, EINA_TRUE);
+
+ box = efl_add(EFL_UI_BOX_CLASS, win);
+ efl_gfx_hint_weight_set(box, 1.0, 1.0);
+ efl_content_set(win, box);
+
+ im = img_add(win, "/images/logo.png");
+ elm_object_focus_allow_set(im, EINA_TRUE);
+ evas_object_smart_callback_add(im, "clicked", _img_clicked_cb, im);
+ efl_pack(box, im);
+ elm_object_focus_set(im, EINA_TRUE);
+
+ label = efl_add(EFL_UI_TEXT_CLASS, win, efl_text_interactive_editable_set(efl_added, EINA_FALSE));
+ efl_text_set(label, "<b>Press Return/Space/KP_Return key on image to transit.</b>");
+ efl_gfx_hint_weight_set(label, 0.0, 0.0);
+ efl_gfx_hint_fill_set(label, EINA_TRUE, EINA_TRUE);
+ efl_pack(box, label);
+
+ efl_gfx_entity_size_set(win, EINA_SIZE2D(320, 480));
+}
+
+#define STATUS_SET(obj, fmt) do { \
+ efl_text_set(obj, fmt); \
+ fprintf(stderr, "%s\n", fmt); fflush(stderr); \
+ } while (0)
+
+static void
+_img_load_open_cb(void *data, Eo *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+ Eo *status_text = data;
+
+ STATUS_SET(status_text, "Async file open done.");
+}
+
+static void
+_img_load_ready_cb(void *data, Eo *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+ Eo *status_text = data;
+
+ STATUS_SET(status_text, "Image is ready to show.");
+}
+
+static void
+_img_load_error_cb(void *data, Eo *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+ Eo *status_text = data;
+
+ STATUS_SET(status_text, "Async file load failed.");
+}
+
+static void
+_img_load_cancel_cb(void *data, Eo *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+ Eo *status_text = data;
+
+ STATUS_SET(status_text, "Async file open has been cancelled.");
+}
+
+static void
+_create_image(Eo *data, Eina_Bool async, Eina_Bool preload, Eina_Bool logo)
+{
+ Eo *win = data;
+ Eo *im, *status_text;
+ Eo *box = efl_key_data_get(win, "box");
+ char buf[PATH_MAX] = {0};
+
+ im = img_add(win, NULL);
+ elm_image_async_open_set(im, async);
+ elm_image_preload_disabled_set(im, preload);
+
+ efl_pack_begin(box, im);
+
+ status_text = efl_key_data_get(win, "phld");
+ if (!status_text)
+ {
+ status_text = efl_add(EFL_UI_TEXT_CLASS, win, efl_text_interactive_editable_set(efl_added, EINA_FALSE));
+ efl_gfx_hint_weight_set(status_text, 1.0, 0);
+ efl_gfx_hint_fill_set(status_text, EINA_TRUE, EINA_TRUE);
+ efl_key_data_set(win, "phld", status_text);
+ efl_pack_after(box, status_text, im);
+ }
+
+ evas_object_smart_callback_add(im, "load,open", _img_load_open_cb, status_text);
+ evas_object_smart_callback_add(im, "load,ready", _img_load_ready_cb, status_text);
+ evas_object_smart_callback_add(im, "load,error", _img_load_error_cb, status_text);
+ evas_object_smart_callback_add(im, "load,cancel", _img_load_cancel_cb, status_text);
+
+ STATUS_SET(status_text, "Loading image...");
+ if (!logo)
+ snprintf(buf, sizeof(buf) - 1, "%s/images/insanely_huge_test_image.jpg", elm_app_data_dir_get());
+ else
+ snprintf(buf, sizeof(buf) - 1, "%s/images/logo.png", elm_app_data_dir_get());
+ efl_file_simple_load(im, buf, NULL);
+}
+
+static void
+_reload_clicked(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ Eo *win = data;
+ Eo *im = efl_key_data_get(win, "im");
+ Eo *chk1 = efl_key_data_get(win, "chk1");
+ Eo *chk2 = efl_key_data_get(win, "chk2");
+ Eina_Bool async = efl_ui_check_selected_get(chk1);
+ Eina_Bool preload = efl_ui_check_selected_get(chk2);
+ Eina_Bool logo = EINA_FALSE;
+ const char *file = NULL;
+
+ file = efl_file_get(im);
+ logo = (file && strstr(file, "logo"));
+
+ efl_del(im);
+ _create_image(win, async, preload, logo);
+}
+
+static void
+_switch_clicked(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ Eo *win = data;
+ Eo *im = efl_key_data_get(win, "im");
+ Eo *chk1 = efl_key_data_get(win, "chk1");
+ Eo *chk2 = efl_key_data_get(win, "chk2");
+ Eina_Bool async = efl_ui_check_selected_get(chk1);
+ Eina_Bool preload = efl_ui_check_selected_get(chk2);
+ char buf[PATH_MAX] = {0};
+ Eina_Bool logo = EINA_FALSE;
+ const char *file = NULL;
+
+ file = efl_file_get(im);
+ logo = (file && strstr(file, "logo"));
+
+ if (logo)
+ {
+ snprintf(buf, sizeof(buf) - 1, "%s/images/insanely_huge_test_image.jpg", elm_app_data_dir_get());
+ }
+ else
+ {
+ snprintf(buf, sizeof(buf) - 1, "%s/images/logo.png", elm_app_data_dir_get());
+ }
+
+ elm_image_async_open_set(im, async);
+ elm_image_preload_disabled_set(im, preload);
+ efl_file_simple_load(im, buf, NULL);
+}
+
+void
+test_load_ui_image(void *data EINA_UNUSED, Eo *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+ Eo *win, *box, *hbox, *label, *chk1, *chk2, *bt;
+
+ win = win_add("image test", "Image Test");
+
+ box = efl_add(EFL_UI_BOX_CLASS, win);
+ efl_gfx_arrangement_content_align_set(box, 0.5, 1.0);
+ efl_gfx_hint_weight_set(box, 1.0, 1.0);
+ efl_content_set(win, box);
+ efl_key_data_set(win, "box", box);
+
+ _create_image(win, EINA_FALSE, EINA_FALSE, EINA_FALSE);
+
+ hbox = efl_add(EFL_UI_BOX_CLASS, win);
+ efl_ui_direction_set(hbox, EFL_UI_DIR_RIGHT);
+ efl_gfx_arrangement_content_align_set(hbox, 0, 0.5);
+ efl_gfx_hint_weight_set(hbox, 1.0, 0.0);
+ efl_gfx_hint_fill_set(hbox, EINA_TRUE, EINA_FALSE);
+ {
+ label = efl_add(EFL_UI_TEXT_CLASS, win,
+ efl_text_set(efl_added, "Async load options:"),
+ efl_gfx_hint_weight_set(efl_added, 0.0, 0.0),
+ efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE),
+ efl_text_interactive_editable_set(efl_added, EINA_FALSE)
+ );
+ efl_pack(hbox, label);
+
+ chk1 = efl_add(EFL_UI_CHECK_CLASS, hbox,
+ efl_text_set(efl_added, "Async file open"),
+ efl_gfx_hint_weight_set(efl_added, 0.0, 0.0),
+ efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE)
+ );
+ efl_pack(hbox, chk1);
+ efl_key_data_set(win, "chk1", chk1);
+
+ chk2 = efl_add(EFL_UI_CHECK_CLASS, hbox,
+ efl_text_set(efl_added, "Disable preload"),
+ efl_gfx_hint_weight_set(efl_added, 0.0, 0.0),
+ efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE)
+ );
+ efl_pack(hbox, chk2);
+ efl_key_data_set(win, "chk2", chk2);
+ }
+ efl_pack(box, hbox);
+
+ hbox = efl_add(EFL_UI_BOX_CLASS, win);
+ efl_ui_direction_set(hbox, EFL_UI_DIR_RIGHT);
+ efl_gfx_arrangement_content_align_set(hbox, 0.5, 0.5);
+ efl_gfx_hint_weight_set(hbox, 1.0, 0.0);
+ efl_gfx_hint_fill_set(hbox, EINA_TRUE, EINA_FALSE),
+ efl_gfx_hint_align_set(hbox, 0.5, 0.0);
+ {
+ bt = efl_add(EFL_UI_BUTTON_CLASS, win,
+ efl_text_set(efl_added, "Image Reload"),
+ efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _reload_clicked, win)
+ );
+ efl_pack(hbox, bt);
+
+ bt = efl_add(EFL_UI_BUTTON_CLASS, win,
+ efl_text_set(efl_added, "Image Switch"),
+ efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _switch_clicked, win)
+ );
+ efl_pack(hbox, bt);
+ }
+ efl_pack(box, hbox);
+
+ efl_gfx_entity_size_set(win, EINA_SIZE2D(320, 480));
+}
+
+static void
+_cb_prescale_radio_changed(void *data, const Efl_Event *ev)
+{
+ Eo *o_bg = data;
+ int size;
+ size = efl_ui_radio_state_value_get(efl_ui_radio_selected_object_get(ev->object));
+ //FIXME
+ elm_image_prescale_set(o_bg, size);
+}
+
+void
+test_ui_image_prescale(void *data EINA_UNUSED, Eo *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+ Eo *win, *im;
+ Eo *box, *hbox;
+ Eo *rd, *rdg;
+
+ win = win_add("image-prescale", "Image Prescale Test");
+
+ box = efl_add(EFL_UI_BOX_CLASS, win);
+ efl_content_set(win, box);
+
+ im = img_add(win, "/images/plant_01.jpg");
+ efl_pack(box, im);
+
+ hbox = efl_add(EFL_UI_BOX_CLASS, win);
+ efl_ui_direction_set(hbox, EFL_UI_DIR_RIGHT);
+ efl_gfx_hint_weight_set(hbox, 1.0, 1.0);
+ efl_gfx_hint_fill_set(hbox, EINA_TRUE, EINA_TRUE);
+
+ rd = efl_add(EFL_UI_RADIO_CLASS, win);
+ efl_ui_radio_state_value_set(rd, 50);
+ efl_text_set(rd, "50");
+ efl_gfx_hint_weight_set(rd, 1.0, 1.0);
+ efl_event_callback_add(rd, EFL_UI_RADIO_EVENT_CHANGED, _cb_prescale_radio_changed, im);
+ efl_pack(hbox, rd);
+ rdg = rd;
+
+ rd = efl_add(EFL_UI_RADIO_CLASS, win);
+ efl_ui_radio_state_value_set(rd, 100);
+ efl_ui_radio_group_add(rd, rdg);
+ efl_text_set(rd, "100");
+ efl_gfx_hint_weight_set(rd, 1.0, 1.0);
+ efl_event_callback_add(rd, EFL_UI_RADIO_EVENT_CHANGED, _cb_prescale_radio_changed, im);
+ efl_pack(hbox, rd);
+
+ rd = efl_add(EFL_UI_RADIO_CLASS, win);
+ efl_ui_radio_state_value_set(rd, 200);
+ efl_ui_radio_group_add(rd, rdg);
+ efl_text_set(rd, "200");
+ efl_gfx_hint_weight_set(rd, 1.0, 1.0);
+ efl_event_callback_add(rd, EFL_UI_RADIO_EVENT_CHANGED, _cb_prescale_radio_changed, im);
+ efl_pack(hbox, rd);
+
+ elm_radio_value_set(rdg, 200);
+
+ efl_pack(box, hbox);
+
+ efl_gfx_entity_size_set(win, EINA_SIZE2D(320, 320));
+}
diff --git a/src/bin/elementary/test_ui_table.c b/src/bin/elementary/test_ui_table.c
index 6d52887d69..dab64ddc27 100644
--- a/src/bin/elementary/test_ui_table.c
+++ b/src/bin/elementary/test_ui_table.c
@@ -648,7 +648,7 @@ test_ui_table_linear(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
efl_gfx_entity_visible_set(f, 1);
efl_pack_table_columns_set(table, 4);
- efl_pack_table_direction_set(table, EFL_UI_DIR_RIGHT, EFL_UI_DIR_DOWN);
+ efl_ui_direction_set(table, EFL_UI_DIR_RIGHT);
efl_gfx_hint_weight_set(table, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_object_content_set(f, table);
efl_gfx_entity_visible_set(table, 1);
diff --git a/src/bin/embryo/embryo_cc_sc1.c b/src/bin/embryo/embryo_cc_sc1.c
index 7c8283f0c9..0d88863bae 100644
--- a/src/bin/embryo/embryo_cc_sc1.c
+++ b/src/bin/embryo/embryo_cc_sc1.c
@@ -36,10 +36,6 @@
#include <unistd.h>
#include <sys/stat.h>
-#ifdef _WIN32
-# include <Evil.h>
-#endif
-
#include <Eina.h>
#include "embryo_cc_sc.h"
diff --git a/src/bindings/luajit/eolian.lua b/src/bindings/luajit/eolian.lua
index 20118af15f..34da82c27b 100644
--- a/src/bindings/luajit/eolian.lua
+++ b/src/bindings/luajit/eolian.lua
@@ -370,7 +370,6 @@ ffi.cdef [[
const Eolian_Expression *eolian_parameter_default_value_get(const Eolian_Function_Parameter *param);
const Eolian_Documentation *eolian_parameter_documentation_get(const Eolian_Function_Parameter *param);
Eina_Bool eolian_parameter_is_nonull(const Eolian_Function_Parameter *param_desc);
- Eina_Bool eolian_parameter_is_nullable(const Eolian_Function_Parameter *param_desc);
Eina_Bool eolian_parameter_is_optional(const Eolian_Function_Parameter *param_desc);
const Eolian_Type *eolian_function_return_type_get(const Eolian_Function *function_id, Eolian_Function_Type ftype);
const Eolian_Expression *eolian_function_return_default_value_get(const Eolian_Function *foo_id, Eolian_Function_Type ftype);
@@ -1268,10 +1267,6 @@ ffi.metatype("Eolian_Function_Parameter", {
return eolian.eolian_parameter_is_nonull(self) ~= 0
end,
- is_nullable = function(self)
- return eolian.eolian_parameter_is_nullable(self) ~= 0
- end,
-
is_optional = function(self)
return eolian.eolian_parameter_is_optional(self) ~= 0
end
diff --git a/src/examples/evas/Makefile.examples b/src/examples/evas/Makefile.examples
index e2e6f75565..78e255c001 100644
--- a/src/examples/evas/Makefile.examples
+++ b/src/examples/evas/Makefile.examples
@@ -16,6 +16,7 @@ EXAMPLES= evas-aspect-hints \
evas-images3 \
evas-images4 \
evas-images5 \
+ evas-images6 \
evas-init-shutdown \
evas-map-utils \
evas-object-manipulation \
diff --git a/src/examples/evas/evas-images5.c b/src/examples/evas/evas-images5.c
index ed8a4e5541..7632b7fde1 100644
--- a/src/examples/evas/evas-images5.c
+++ b/src/examples/evas/evas-images5.c
@@ -76,6 +76,7 @@ _on_keydown(void *data EINA_UNUSED,
void *einfo)
{
Evas_Event_Key_Down *ev = einfo;
+ Efl_Gfx_Orientation orient = efl_gfx_orientation_get(d.img);
if (strcmp(ev->key, "h") == 0) /* print help */
{
@@ -109,25 +110,25 @@ _on_keydown(void *data EINA_UNUSED,
switch (key_val)
{
case 0:
- efl_orientation_set(d.img, EFL_ORIENT_0);
+ efl_gfx_orientation_set(d.img, EFL_GFX_ORIENTATION_UP | (orient & EFL_GFX_ORIENTATION_FLIP_BITMASK));
break;
case 1:
- efl_orientation_set(d.img, EFL_ORIENT_90);
+ efl_gfx_orientation_set(d.img, EFL_GFX_ORIENTATION_RIGHT | (orient & EFL_GFX_ORIENTATION_FLIP_BITMASK));
break;
case 2:
- efl_orientation_set(d.img, EFL_ORIENT_180);
+ efl_gfx_orientation_set(d.img, EFL_GFX_ORIENTATION_DOWN | (orient & EFL_GFX_ORIENTATION_FLIP_BITMASK));
break;
case 3:
- efl_orientation_set(d.img, EFL_ORIENT_270);
+ efl_gfx_orientation_set(d.img, EFL_GFX_ORIENTATION_LEFT | (orient & EFL_GFX_ORIENTATION_FLIP_BITMASK));
break;
case 4:
- efl_orientation_flip_set(d.img, EFL_FLIP_HORIZONTAL);
+ efl_gfx_orientation_set(d.img, (orient & EFL_GFX_ORIENTATION_ROTATION_BITMASK) | EFL_GFX_ORIENTATION_FLIP_HORIZONTAL);
break;
case 5:
- efl_orientation_flip_set(d.img, EFL_FLIP_VERTICAL);
+ efl_gfx_orientation_set(d.img, (orient & EFL_GFX_ORIENTATION_ROTATION_BITMASK) | EFL_GFX_ORIENTATION_FLIP_VERTICAL);
break;
case 6:
- efl_orientation_flip_set(d.img, EFL_FLIP_NONE);
+ efl_gfx_orientation_set(d.img, (orient & EFL_GFX_ORIENTATION_ROTATION_BITMASK));
break;
}
}
diff --git a/src/examples/evas/evas-images6.c b/src/examples/evas/evas-images6.c
new file mode 100644
index 0000000000..ac09b4486e
--- /dev/null
+++ b/src/examples/evas/evas-images6.c
@@ -0,0 +1,98 @@
+/**
+ * Example of handling events for image objects in Evas.
+ *
+ * You'll need at least one engine built for it (excluding the buffer
+ * one) and the png image loader/saver also built. See stdout/stderr
+ * for output.
+ *
+ * @verbatim
+ * gcc -o evas-images6 evas-images6.c `pkg-config --libs --cflags evas ecore ecore-evas`
+ * @endverbatim
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#else
+#define PACKAGE_EXAMPLES_DIR "."
+#endif
+
+#include <Ecore.h>
+#include <Ecore_Evas.h>
+#include <stdio.h>
+#include <errno.h>
+#include "evas-common.h"
+
+#define WIDTH (960)
+#define HEIGHT (540)
+
+static const char *img_path = PACKAGE_EXAMPLES_DIR EVAS_IMAGE_FOLDER "/scale_down.png";
+
+struct test_data
+{
+ Ecore_Evas *ee;
+ Evas *evas;
+ Evas_Object *bg, *img;
+};
+
+static struct test_data d = {0};
+
+
+static void
+_on_destroy(Ecore_Evas *ee EINA_UNUSED)
+{
+ ecore_main_loop_quit();
+}
+
+/* Keep the example's window size in sync with the background image's size */
+static void
+_canvas_resize_cb(Ecore_Evas *ee)
+{
+ int w, h;
+
+ ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
+ evas_object_resize(d.bg, w, h);
+}
+
+int
+main(void)
+{
+ if (!ecore_evas_init())
+ return EXIT_FAILURE;
+
+ /* this will give you a window with an Evas canvas under the first
+ * engine available */
+ d.ee = ecore_evas_new(NULL, 10, 10, WIDTH, HEIGHT, NULL);
+ if (!d.ee)
+ goto error;
+
+ ecore_evas_callback_destroy_set(d.ee, _on_destroy);
+ ecore_evas_callback_resize_set(d.ee, _canvas_resize_cb);
+ ecore_evas_show(d.ee);
+
+ /* the canvas pointer, de facto */
+ d.evas = ecore_evas_get(d.ee);
+
+ d.bg = evas_object_rectangle_add(d.evas);
+ evas_object_color_set(d.bg, 255, 255, 255, 255); /* white bg */
+ evas_object_move(d.bg, 0, 0); /* at canvas' origin */
+ evas_object_resize(d.bg, WIDTH, HEIGHT); /* covers full canvas */
+ evas_object_show(d.bg);
+
+ d.img = evas_object_image_filled_add(d.evas);
+ evas_object_image_file_set(d.img, img_path, NULL);
+ evas_object_image_load_scale_down_set(d.img, 2);
+ evas_object_resize(d.img, WIDTH, HEIGHT);
+ evas_object_show(d.img);
+
+ ecore_main_loop_begin();
+
+ ecore_evas_free(d.ee);
+ ecore_evas_shutdown();
+ return 0;
+
+error:
+ fprintf(stderr, "error: Requires at least one Evas engine built and linked"
+ " to ecore-evas for this example to run properly.\n");
+ ecore_evas_shutdown();
+ return -1;
+}
diff --git a/src/examples/evas/meson.build b/src/examples/evas/meson.build
index e196a99a84..9671502a81 100644
--- a/src/examples/evas/meson.build
+++ b/src/examples/evas/meson.build
@@ -29,6 +29,7 @@ examples = [
'evas-images3',
'evas-images4',
'evas-images5',
+ 'evas-images6',
'evas-images',
'evas-init-shutdown',
'evas-map-aa',
diff --git a/src/examples/evas/resources/images/scale_down.png b/src/examples/evas/resources/images/scale_down.png
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/src/examples/evas/resources/images/scale_down.png
diff --git a/src/lib/ecore_con/efl_net_control_manager.eo b/src/lib/ecore_con/efl_net_control_manager.eo
index cfb729b9db..fb2fabf29c 100644
--- a/src/lib/ecore_con/efl_net_control_manager.eo
+++ b/src/lib/ecore_con/efl_net_control_manager.eo
@@ -193,11 +193,11 @@ class @beta Efl.Net.Control.Manager extends Efl.Loop_Consumer {
agent_reply {
[[If event "agent_request_input" was emitted, this will reply with the requested data]]
params {
- name: string @nullable; [[If @Efl.Net.Control.Agent_Request_Input_Field.name was present, this should contain the network name or the 'ssid' parameter should be used.]]
- @cref ssid: Eina.Slice @nullable; [[If @Efl.Net.Control.Agent_Request_Input_Field.ssid was present, this should contain the network SSID or the 'name' parameter should be used.]]
- username: string @nullable; [[If @Efl.Net.Control.Agent_Request_Input_Field.username was present, this should contain the identity or username]]
- passphrase: string @nullable; [[If @Efl.Net.Control.Agent_Request_Input_Field.passphrase was present, this should contain the password or passphrase, more details on how it should be interpreted was given in Efl.Net.Control.Agent_Request_Input.passphrase_type.]]
- wps: string @nullable; [[If @Efl.Net.Control.Agent_Request_Input_Field.wps was present, this should contain the WPS PIN or an empty string "" to use the WPS push button instead.]]
+ name: string; [[If @Efl.Net.Control.Agent_Request_Input_Field.name was present, this should contain the network name or the 'ssid' parameter should be used.]]
+ @cref ssid: Eina.Slice; [[If @Efl.Net.Control.Agent_Request_Input_Field.ssid was present, this should contain the network SSID or the 'name' parameter should be used.]]
+ username: string; [[If @Efl.Net.Control.Agent_Request_Input_Field.username was present, this should contain the identity or username]]
+ passphrase: string; [[If @Efl.Net.Control.Agent_Request_Input_Field.passphrase was present, this should contain the password or passphrase, more details on how it should be interpreted was given in Efl.Net.Control.Agent_Request_Input.passphrase_type.]]
+ wps: string; [[If @Efl.Net.Control.Agent_Request_Input_Field.wps was present, this should contain the WPS PIN or an empty string "" to use the WPS push button instead.]]
}
}
}
diff --git a/src/lib/ecore_con/efl_net_dialer.eo b/src/lib/ecore_con/efl_net_dialer.eo
index 02770dca46..fce38973f7 100644
--- a/src/lib/ecore_con/efl_net_dialer.eo
+++ b/src/lib/ecore_con/efl_net_dialer.eo
@@ -109,7 +109,7 @@ interface @beta Efl.Net.Dialer extends Efl.Net.Socket {
}
events {
- /* FIXME: Might be NULL, but @nullable does not work on event types */
+ /* tag nullable once supported by eolian */
dialer,resolved: string; [[Notifies @.address_dial was resolved to
@Efl.Net.Socket.address_remote.
diff --git a/src/lib/ecore_con/efl_net_socket_ssl.eo b/src/lib/ecore_con/efl_net_socket_ssl.eo
index 9fb0031473..31fcb309f5 100644
--- a/src/lib/ecore_con/efl_net_socket_ssl.eo
+++ b/src/lib/ecore_con/efl_net_socket_ssl.eo
@@ -75,7 +75,7 @@ class @beta Efl.Net.Socket_Ssl extends Efl.Loop_Consumer implements Efl.Net.Sock
It's only used if @.hostname_verify is $true.
]]
values {
- hostname_override: string @nullable; [[Hostname for this socket]]
+ hostname_override: string; [[Hostname for this socket]]
}
}
}
diff --git a/src/lib/ecore_con/efl_net_ssl_context.eo b/src/lib/ecore_con/efl_net_ssl_context.eo
index 2557a03552..26fd68f1de 100644
--- a/src/lib/ecore_con/efl_net_ssl_context.eo
+++ b/src/lib/ecore_con/efl_net_ssl_context.eo
@@ -122,7 +122,7 @@ class @beta Efl.Net.Ssl.Context extends Efl.Object {
It's only used if @.hostname_verify is $true.
]]
values {
- hostname: string @nullable; [[Hostname for this socket]]
+ hostname: string; [[Hostname for this socket]]
}
}
}
diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c
index 86020876ef..3d4698f599 100644
--- a/src/lib/ecore_evas/ecore_evas.c
+++ b/src/lib/ecore_evas/ecore_evas.c
@@ -18,10 +18,6 @@
# include <sys/mman.h>
#endif
-#ifdef _WIN32
-# include <Evil.h>
-#endif
-
#include <Ecore.h>
#include "ecore_private.h"
#include <Ecore_Input.h>
diff --git a/src/lib/ecore_file/ecore_file.c b/src/lib/ecore_file/ecore_file.c
index 4780350de0..ab8b07f1ce 100644
--- a/src/lib/ecore_file/ecore_file.c
+++ b/src/lib/ecore_file/ecore_file.c
@@ -10,6 +10,7 @@
#ifdef _WIN32
# include <direct.h>
+# include <evil_private.h> /* mkdir realpath */
#endif
#ifdef HAVE_FEATURES_H
diff --git a/src/lib/ecore_file/ecore_file_monitor_win32.c b/src/lib/ecore_file/ecore_file_monitor_win32.c
index 8a0f92dca7..59f5f88470 100644
--- a/src/lib/ecore_file/ecore_file_monitor_win32.c
+++ b/src/lib/ecore_file/ecore_file_monitor_win32.c
@@ -6,12 +6,14 @@
# include <config.h>
#endif
-# define WIN32_LEAN_AND_MEAN
-# include <windows.h>
-# undef WIN32_LEAN_AND_MEAN
-# include <process.h>
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
+#include <process.h>
-# include "ecore_file_private.h"
+#include <evil_private.h> /* evil_wchar_to_char */
+
+#include "ecore_file_private.h"
typedef struct _Ecore_File_Monitor_Win32 Ecore_File_Monitor_Win32;
@@ -191,7 +193,7 @@ _ecore_file_monitor_win32_cb(void *data, Ecore_Win32_Handler *wh EINA_UNUSED)
else
event = ECORE_FILE_EVENT_CREATED_FILE;
break;
- default:
+ default:
fprintf(stderr, "unknown event\n");
event = ECORE_FILE_EVENT_NONE;
break;
diff --git a/src/lib/ecore_file/ecore_file_private.h b/src/lib/ecore_file/ecore_file_private.h
index 9a02fffd6d..01ea0a4f11 100644
--- a/src/lib/ecore_file/ecore_file_private.h
+++ b/src/lib/ecore_file/ecore_file_private.h
@@ -5,10 +5,6 @@
# include <features.h>
#endif
-#ifdef _WIN32
-# include <Evil.h>
-#endif
-
#ifdef HAVE_ESCAPE
# include <Escape.h>
#endif
diff --git a/src/lib/edje/edje_private.h b/src/lib/edje/edje_private.h
index 0e6f68f564..c7d093ae28 100644
--- a/src/lib/edje/edje_private.h
+++ b/src/lib/edje/edje_private.h
@@ -1,3 +1,4 @@
+
#ifndef _EDJE_PRIVATE_H
#define _EDJE_PRIVATE_H
@@ -35,10 +36,6 @@
#include <lauxlib.h>
#include <setjmp.h>
-#ifdef _WIN32
-# include <Evil.h>
-#endif
-
// auto_unref
#define EFL_CANVAS_OBJECT_PROTECTED
#define EFL_LAYOUT_CALC_PROTECTED
diff --git a/src/lib/efl/Efl.h b/src/lib/efl/Efl.h
index c0651a861a..553f5901a7 100644
--- a/src/lib/efl/Efl.h
+++ b/src/lib/efl/Efl.h
@@ -90,12 +90,12 @@ typedef Efl_Gfx_Path_Command_Type Efl_Gfx_Path_Command;
#include "interfaces/efl_gfx_image.eo.h"
#include "interfaces/efl_gfx_frame_controller.eo.h"
#include "interfaces/efl_gfx_image_load_controller.eo.h"
+#include "interfaces/efl_gfx_orientable.eo.h"
#include "interfaces/efl_part.eo.h"
#include "interfaces/efl_playable.eo.h"
#include "interfaces/efl_player.eo.h"
#include "interfaces/efl_text.eo.h"
#include "interfaces/efl_text_types.eot.h"
-#include "interfaces/efl_orientation.eo.h"
#include "interfaces/efl_ui_i18n.eo.h"
#include "interfaces/efl_ui_direction.eo.h"
#include "interfaces/efl_ui_direction_readonly.eo.h"
@@ -113,10 +113,6 @@ typedef Efl_Gfx_Path_Command_Type Efl_Gfx_Path_Command;
#include "interfaces/efl_screen.eo.h"
-#define EFL_ORIENT_0 EFL_ORIENT_UP
-#define EFL_ORIENT_90 EFL_ORIENT_RIGHT
-#define EFL_ORIENT_180 EFL_ORIENT_DOWN
-#define EFL_ORIENT_270 EFL_ORIENT_LEFT
/* Core interface */
#include "interfaces/efl_interpolator.eo.h"
diff --git a/src/lib/efl/interfaces/efl_canvas_scene.eo b/src/lib/efl/interfaces/efl_canvas_scene.eo
index fd1a8180d9..44539d3581 100644
--- a/src/lib/efl/interfaces/efl_canvas_scene.eo
+++ b/src/lib/efl/interfaces/efl_canvas_scene.eo
@@ -235,7 +235,7 @@ interface Efl.Canvas.Scene
object,focus,in: Efl.Input.Focus; [[Called when object got focus]]
object,focus,out: Efl.Input.Focus; [[Called when object lost focus]]
render,pre: void; [[Called when pre render happens]]
- /* FIXME: event_info can be NULL, but @nullable tag does not work on events yet */
+ /* tag nullable once supported by eolian */
render,post @beta: Efl.Gfx.Event.Render_Post; [[Called when post render happens]]
device,changed @beta : Efl.Input.Device; [[Called when input device changed]]
device,added @beta: Efl.Input.Device; [[Called when input device was added]]
diff --git a/src/lib/efl/interfaces/efl_gfx_buffer.eo b/src/lib/efl/interfaces/efl_gfx_buffer.eo
index 074dd7843a..38da6c8266 100644
--- a/src/lib/efl/interfaces/efl_gfx_buffer.eo
+++ b/src/lib/efl/interfaces/efl_gfx_buffer.eo
@@ -174,7 +174,7 @@ interface @beta Efl.Gfx.Buffer
$slice should not be the return value of @.buffer_managed_get.
]]
params {
- @cref slice: Eina.Slice @nullable; [[If $null, allocates an empty buffer]]
+ @cref slice: Eina.Slice; [[If $null, allocates an empty buffer]]
@in size: Eina.Size2D; [[The size in pixels.]]
@in stride: int @optional; [[If 0, automatically guessed from the $width.]]
@in cspace: Efl.Gfx.Colorspace @optional; [[argb8888 by default.]]
@@ -199,7 +199,7 @@ interface @beta Efl.Gfx.Buffer
internally.
]]
params {
- @cref slice: Eina.Slice @nullable; [[If $null, detaches the previous buffer.]]
+ @cref slice: Eina.Slice; [[If $null, detaches the previous buffer.]]
@in size: Eina.Size2D; [[The size in pixels.]]
@in stride: int @optional; [[If 0, automatically guessed from the $width.]]
@in cspace: Efl.Gfx.Colorspace @optional; [[argb8888 by default.]]
diff --git a/src/lib/efl/interfaces/efl_gfx_orientable.eo b/src/lib/efl/interfaces/efl_gfx_orientable.eo
new file mode 100644
index 0000000000..0c4d191727
--- /dev/null
+++ b/src/lib/efl/interfaces/efl_gfx_orientable.eo
@@ -0,0 +1,44 @@
+parse efl_ui_direction;
+
+enum @beta Efl.Gfx.Orientation
+{
+ [[An orientation type, to rotate and flip images.
+
+ This is similar to EXIF's orientation.
+ Directional values ($up, $down, $left, $right) indicate the final direction in
+ which the top of the image will be facing (e.g. a picture of a house will have
+ its roof pointing to the right if the $right orientation is used).
+ Flipping values ($flip_horizontal and $flip_vertical) can be additionaly added
+ to produce a mirroring in each axis.
+ Not to be confused with @Efl.Ui.Dir which is meant for widgets, rather
+ than images and canvases. This enum is used to rotate images, videos and
+ the like.
+ ]]
+ none = 0, [[Default, same as up, do not rotate.]]
+ up = 0, [[Orient up, do not rotate.]]
+ right = 1, [[Orient right, rotate 90 degrees clock-wise.]]
+ down = 2, [[Orient down, rotate 180 degrees.]]
+ left = 3, [[Orient left, rotate 270 degrees clock-wise.]]
+ rotation_bitmask = 3, [[Bitmask that can be used to isolate rotation values, that is, $none, $up, $down, $left and $right.]]
+ flip_horizontal = 4, [[Mirror horizontally. Can be added to the other values.]]
+ flip_vertical = 8, [[Mirror vertically. Can be added to the other values.]]
+ flip_bitmask = 12 [[Bitmask that can be used to isolate flipping values, that is, $flip_vertical and $flip_horizontal.]]
+}
+
+interface @beta Efl.Gfx.Orientable
+{
+ [[Interface for objects which can be oriented.]]
+ c_prefix: efl_gfx_orientation;
+ methods {
+ @property orientation {
+ [[Control the orientation (rotation and flipping) of a given object.
+
+ This can be used to set the rotation on an image or a window, for
+ instance.
+ ]]
+ values {
+ dir: Efl.Gfx.Orientation(Efl.Gfx.Orientation.none); [[The final orientation of the object.]]
+ }
+ }
+ }
+}
diff --git a/src/lib/efl/interfaces/efl_interfaces_main.c b/src/lib/efl/interfaces/efl_interfaces_main.c
index 4d7927f6f8..b01587cdda 100644
--- a/src/lib/efl/interfaces/efl_interfaces_main.c
+++ b/src/lib/efl/interfaces/efl_interfaces_main.c
@@ -32,6 +32,7 @@
#include "interfaces/efl_gfx_stack.eo.c"
#include "interfaces/efl_gfx_fill.eo.c"
#include "interfaces/efl_gfx_view.eo.c"
+#include "interfaces/efl_gfx_orientable.eo.c"
#include "interfaces/efl_gfx_text_class.eo.c"
#include "interfaces/efl_gfx_size_class.eo.c"
@@ -59,7 +60,6 @@
#include "interfaces/efl_gfx_arrangement.eo.c"
#include "interfaces/efl_model.eo.c"
#include "interfaces/efl_interpolator.eo.c"
-#include "interfaces/efl_orientation.eo.c"
#include "interfaces/efl_ui_i18n.eo.c"
#include "interfaces/efl_ui_direction.eo.c"
#include "interfaces/efl_ui_drag.eo.c"
diff --git a/src/lib/efl/interfaces/efl_orientation.eo b/src/lib/efl/interfaces/efl_orientation.eo
deleted file mode 100644
index e874dcfdb7..0000000000
--- a/src/lib/efl/interfaces/efl_orientation.eo
+++ /dev/null
@@ -1,57 +0,0 @@
-parse efl_ui_direction;
-
-enum @beta Efl.Orient
-{
- [[An orientation type, to rotate visual objects.
-
- Not to be confused with @Efl.Ui.Dir which is meant for widgets, rather
- than images and canvases. This enum is used to rotate images, videos and
- the like.
-
- See also @Efl.Orientation.
- ]]
- none = 0, [[Default, same as up]]
- up = 0, [[Orient up, do not rotate.]]
- right = 90, [[Orient right, rotate 90 degrees counter clock-wise.]]
- down = 180, [[Orient down, rotate 180 degrees.]]
- left = 270, [[Orient left, rotate 90 degrees clock-wise.]]
-}
-
-enum @beta Efl.Flip
-{
- [[A flip type, to flip visual objects.
-
- See also @Efl.Orientation.
- ]]
- none = 0, [[No flip]]
- horizontal = 1, [[Flip image horizontally]]
- vertical = 2 [[Flip image vertically]]
-}
-
-interface @beta Efl.Orientation
-{
- [[Efl orientation interface]]
- methods {
- @property orientation {
- [[Control the orientation of a given object.
-
- This can be used to set the rotation on an image or a window, for
- instance.
- ]]
- values {
- dir: Efl.Orient(Efl.Orient.none); [[The rotation angle (CCW), see @Efl.Orient.]]
- }
- }
- @property flip {
- [[Control the flip of the given image
-
- Use this function to change how your image is to be
- flipped: vertically or horizontally or transpose
- or traverse.
- ]]
- values {
- flip: Efl.Flip; [[Flip method]]
- }
- }
- }
-}
diff --git a/src/lib/efl/interfaces/efl_pack_table.eo b/src/lib/efl/interfaces/efl_pack_table.eo
index c94bd334d3..9214eb7c65 100644
--- a/src/lib/efl/interfaces/efl_pack_table.eo
+++ b/src/lib/efl/interfaces/efl_pack_table.eo
@@ -1,8 +1,10 @@
-import efl_ui_direction;
-
interface @beta Efl.Pack_Table extends Efl.Pack
{
- [[2D containers aligned on a table with rows and columns]]
+ [[Interface for 2D containers which arrange their elements on a table with rows and columns.
+
+ Elements can be positioned on a specific row and column, or they can be simply added to
+ the table using @Efl.Pack.pack and the container will chose where to put them.
+ ]]
c_prefix: efl_pack;
methods {
pack_table {
@@ -61,32 +63,23 @@ interface @beta Efl.Pack_Table extends Efl.Pack
}
}
@property table_columns {
- [[Gird columns property]]
- set { [[Specifies limit for linear adds - if direction is horizontal]] }
+ [[Specifies the amount of columns the table will have when the fill direction is horizontal.
+ If it is vertical, the amount of columns depends on the amount of cells added and @.table_rows.
+ ]]
+ set {}
get {}
values {
- cols: int; [[Number of columns]]
+ cols: int; [[Amount of columns.]]
}
}
@property table_rows {
- [[Table rows property]]
- set { [[Specifies limit for linear adds - if direction is vertical]] }
- get {}
- values {
- rows: int; [[Number of rows]]
- }
- }
- @property table_direction {
- [[Primary and secondary up/left/right/down directions for linear apis.
-
- Default is horizontal and vertical.
- This overrides @Efl.Ui.Direction.direction.
+ [[Specifies the amount of rows the table will have when the fill direction is vertical.
+ If it is horizontal, the amount of rows depends on the amount of cells added and @.table_columns.
]]
set {}
get {}
values {
- primary: Efl.Ui.Dir(Efl.Ui.Dir.horizontal); [[Primary direction]]
- secondary: Efl.Ui.Dir(Efl.Ui.Dir.vertical); [[Secondary direction]]
+ rows: int; [[Amount of rows.]]
}
}
}
diff --git a/src/lib/efl/interfaces/efl_ui_direction.eo b/src/lib/efl/interfaces/efl_ui_direction.eo
index a75872eb85..5e6706b67d 100644
--- a/src/lib/efl/interfaces/efl_ui_direction.eo
+++ b/src/lib/efl/interfaces/efl_ui_direction.eo
@@ -1,13 +1,13 @@
// FIXME: Documentation lacks proper references due to cyclic imports.
// FIXME: What about AnyRTL? And other strange directions?
-parse efl_orientation;
+parse efl_gfx_orientable;
enum @beta Efl.Ui.Dir
{
[[Direction for UI objects and layouts.
- Not to be confused with @Efl.Orient which is for images and canvases. This
+ Not to be confused with @Efl.Gfx.Orientation which is for images and canvases. This
enum is used to define how widgets should expand and orient themselves,
not to rotate images.
diff --git a/src/lib/efl/interfaces/efl_ui_format.eo b/src/lib/efl/interfaces/efl_ui_format.eo
index 8f59d858af..c7b6aba841 100644
--- a/src/lib/efl/interfaces/efl_ui_format.eo
+++ b/src/lib/efl/interfaces/efl_ui_format.eo
@@ -18,7 +18,7 @@ mixin @beta Efl.Ui.Format
]]
}
values {
- func: Efl.Ui.Format_Func_Cb @nullable; [[The format function callback]]
+ func: Efl.Ui.Format_Func_Cb; [[The format function callback]]
}
}
@property format_string {
@@ -35,7 +35,7 @@ mixin @beta Efl.Ui.Format
as in $"%.0f %%".
]]
values {
- units: string @nullable; [[The format string for $obj's units label.]]
+ units: string; [[The format string for $obj's units label.]]
}
}
}
diff --git a/src/lib/efl/interfaces/meson.build b/src/lib/efl/interfaces/meson.build
index d29af1cd6d..a88a6b78b4 100644
--- a/src/lib/efl/interfaces/meson.build
+++ b/src/lib/efl/interfaces/meson.build
@@ -64,7 +64,7 @@ pub_eo_files = [
'efl_gfx_hint.eo',
'efl_model.eo',
'efl_interpolator.eo',
- 'efl_orientation.eo',
+ 'efl_gfx_orientable.eo',
'efl_container.eo',
'efl_content.eo',
'efl_pack.eo',
diff --git a/src/lib/efreet/efreet_desktop.c b/src/lib/efreet/efreet_desktop.c
index 949fd567fc..e56d06c908 100644
--- a/src/lib/efreet/efreet_desktop.c
+++ b/src/lib/efreet/efreet_desktop.c
@@ -2,8 +2,9 @@
# include <config.h>
#endif
+/* TODO : have to look why sockets must be init */
#ifdef _WIN32
-# include <Evil.h>
+# include <evil_private.h> /* evil_sockets_init|shutdown */
#endif
#include <Ecore_File.h>
diff --git a/src/lib/efreet/efreet_trash.c b/src/lib/efreet/efreet_trash.c
index 42a2acdd29..04a4a6cda4 100644
--- a/src/lib/efreet/efreet_trash.c
+++ b/src/lib/efreet/efreet_trash.c
@@ -7,6 +7,14 @@
#include <libgen.h>
#include <errno.h>
+#ifdef _WIN32
+# ifndef WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+# endif
+# include <windows.h> /* GetCurrentProcessId */
+# undef WIN32_LEAN_AND_MEAN
+#endif
+
#include <Ecore_File.h>
/* define macros and variable for using the eina logging system */
diff --git a/src/lib/efreet/efreet_uri.c b/src/lib/efreet/efreet_uri.c
index 36a090f60f..9f468ce5df 100644
--- a/src/lib/efreet/efreet_uri.c
+++ b/src/lib/efreet/efreet_uri.c
@@ -8,10 +8,6 @@
#define _POSIX_HOST_NAME_MAX 255
#endif
-#ifdef _WIN32
-# include <Evil.h>
-#endif
-
/* define macros and variable for using the eina logging system */
#define EFREET_MODULE_LOG_DOM /* no logging in this file */
diff --git a/src/lib/eina/eina_config.h.in b/src/lib/eina/eina_config.h.in
index c040cc5341..7f81542a36 100644
--- a/src/lib/eina/eina_config.h.in
+++ b/src/lib/eina/eina_config.h.in
@@ -23,6 +23,14 @@
# include <Exotic.h>
#endif
+#ifdef __has_builtin
+# define EINA_HAS_BUILTIN(x) __has_builtin(x)
+#elif (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)))
+# define EINA_HAS_BUILTIN(x) 1
+#else
+# define EINA_HAS_BUILTIN(x) 0 // Compatibility for the rest of the world
+#endif
+
#ifdef EINA_MAGIC_DEBUG
# undef EINA_MAGIC_DEBUG
#endif
@@ -90,17 +98,23 @@
#ifdef EINA_HAVE_BSWAP16
# undef EINA_HAVE_BSWAP16
#endif
-@EINA_CONFIGURE_HAVE_BSWAP16@
+#if EINA_HAS_BUILTIN(__builtin_bswap16)
+# define EINA_HAVE_BSWAP16
+#endif
#ifdef EINA_HAVE_BSWAP32
# undef EINA_HAVE_BSWAP32
#endif
-@EINA_CONFIGURE_HAVE_BSWAP32@
+#if EINA_HAS_BUILTIN(__builtin_bswap32)
+# define EINA_HAVE_BSWAP32
+#endif
#ifdef EINA_HAVE_BSWAP64
# undef EINA_HAVE_BSWAP64
#endif
-@EINA_CONFIGURE_HAVE_BSWAP64@
+#if EINA_HAS_BUILTIN(__builtin_bswap64)
+# define EINA_HAVE_BSWAP64
+#endif
#ifdef EINA_HAVE_BYTESWAP_H
# undef EINA_HAVE_BYTESWAP_H
diff --git a/src/lib/eina/eina_inline_cpu.x b/src/lib/eina/eina_inline_cpu.x
index d26bdcce7c..035e5b188b 100644
--- a/src/lib/eina/eina_inline_cpu.x
+++ b/src/lib/eina/eina_inline_cpu.x
@@ -27,18 +27,10 @@
# include <byteswap.h>
#endif
-#ifdef __has_builtin
-# define EINA_HAS_BUILTIN(x) __has_builtin(x)
-#elif (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)))
-# define EINA_HAS_BUILTIN(x) 1
-#else
-# define EINA_HAS_BUILTIN(x) 0 // Compatibility for the rest of the world
-#endif
-
static inline unsigned short
eina_swap16(unsigned short x)
{
-#if defined EINA_HAVE_BSWAP16 && EINA_HAS_BUILTIN(__builtin_bswap16)
+#if defined EINA_HAVE_BSWAP16
return __builtin_bswap16(x);
#elif defined _MSC_VER /* Windows. Apparently in <stdlib.h>. */
return _byteswap_ushort(x);
diff --git a/src/lib/eina/meson.build b/src/lib/eina/meson.build
index bfb484e877..e4bce4fc96 100644
--- a/src/lib/eina/meson.build
+++ b/src/lib/eina/meson.build
@@ -326,18 +326,6 @@ if cc.has_header('byteswap.h')
eina_config.set('EINA_HAVE_BYTESWAP_H', '1')
endif
-if cc.has_header_symbol('byteswap.h', 'bswap_16')
- eina_config.set('EINA_HAVE_BSWAP16', '1')
-endif
-
-if cc.has_header_symbol('byteswap.h', 'bswap_32')
- eina_config.set('EINA_HAVE_BSWAP32', '1')
-endif
-
-if cc.has_header_symbol('byteswap.h', 'bswap_64')
- eina_config.set('EINA_HAVE_BSWAP64', '1')
-endif
-
if cc.has_header_symbol('pthread.h', 'pthread_spin_init')
eina_config.set('EINA_HAVE_POSIX_SPINLOCK', '1')
endif
diff --git a/src/lib/eio/eio_dir.c b/src/lib/eio/eio_dir.c
index 68412b6f8a..22544c9df7 100644
--- a/src/lib/eio/eio_dir.c
+++ b/src/lib/eio/eio_dir.c
@@ -17,6 +17,10 @@
* if not, see <http://www.gnu.org/licenses/>.
*/
+#ifdef _WIN32
+# include <evil_private.h> /* mkdir */
+#endif
+
#include "eio_private.h"
#include "Eio.h"
diff --git a/src/lib/eio/eio_inline_helper.x b/src/lib/eio/eio_inline_helper.x
index 7c4f61fa7a..b95d72c32d 100644
--- a/src/lib/eio/eio_inline_helper.x
+++ b/src/lib/eio/eio_inline_helper.x
@@ -90,12 +90,20 @@ eio_file_is_dir(const Eina_Stat *st)
* @return EINA_TRUE if the path is a length.
*
* This function tell you if the stated path is a length or not.
+ *
+ * @note On Windows, this function returns always #EINA_FALSE.
*/
static inline Eina_Bool
eio_file_is_lnk(const Eina_Stat *st)
{
+#ifdef _WIN32
+ /* no symbolic links on Windows */
+ return EINA_FALSE;
+ (void)st;
+#else
if (!st) return EINA_FALSE;
return (S_ISLNK(st->mode)) ? EINA_TRUE : EINA_FALSE;
+#endif
}
/**
diff --git a/src/lib/eio/eio_monitor_win32.c b/src/lib/eio/eio_monitor_win32.c
index 6755e9f531..a2c45de75c 100644
--- a/src/lib/eio/eio_monitor_win32.c
+++ b/src/lib/eio/eio_monitor_win32.c
@@ -17,6 +17,8 @@
* if not, see <http://www.gnu.org/licenses/>.
*/
+#include <evil_private.h> /* evil_wchar_to_char evil_last_error_get */
+
#include "eio_private.h"
#include "Eio.h"
diff --git a/src/lib/eio/eio_private.h b/src/lib/eio/eio_private.h
index a6cd4ccab5..36d784752d 100644
--- a/src/lib/eio/eio_private.h
+++ b/src/lib/eio/eio_private.h
@@ -31,10 +31,6 @@
# include <features.h>
#endif
-#ifdef _WIN32
-# include <Evil.h>
-#endif
-
#include <Ecore.h>
#include "Eio.h"
diff --git a/src/lib/eio/eio_single.c b/src/lib/eio/eio_single.c
index fb8e8264fc..1701f1006e 100644
--- a/src/lib/eio/eio_single.c
+++ b/src/lib/eio/eio_single.c
@@ -18,6 +18,11 @@
* License along with this library;
* if not, see <http://www.gnu.org/licenses/>.
*/
+
+#ifdef _WIN32
+# include <evil_private.h> /* mkdir */
+#endif
+
#include "eio_private.h"
#include "Eio.h"
diff --git a/src/lib/elementary/efl_ui_clock.eo b/src/lib/elementary/efl_ui_clock.eo
index e2c7fdec6e..abc7b5e48f 100644
--- a/src/lib/elementary/efl_ui_clock.eo
+++ b/src/lib/elementary/efl_ui_clock.eo
@@ -95,7 +95,7 @@ class @beta Efl.Ui.Clock extends Efl.Ui.Layout_Base
*/
set {} get {}
values {
- fmt: string @nullable; [[The clock format.]]
+ fmt: string; [[The clock format.]]
}
}
@property pause {
diff --git a/src/lib/elementary/efl_ui_image.c b/src/lib/elementary/efl_ui_image.c
index 8fde088c88..6f46398348 100644
--- a/src/lib/elementary/efl_ui_image.c
+++ b/src/lib/elementary/efl_ui_image.c
@@ -807,8 +807,7 @@ _efl_ui_image_sizing_eval(Evas_Object *obj)
//Retained way. Nothing does, if either way hasn't been changed.
if (!sd->edje)
{
- efl_orientation_set(sd->img, sd->orient);
- efl_orientation_flip_set(sd->img, sd->flip);
+ efl_gfx_orientation_set(sd->img, sd->orient);
}
if (sd->img)
@@ -1365,7 +1364,7 @@ _efl_ui_image_efl_gfx_image_load_controller_load_size_get(const Eo *obj EINA_UNU
}
EOLIAN static void
-_efl_ui_image_efl_orientation_orientation_set(Eo *obj, Efl_Ui_Image_Data *sd, Efl_Orient orient)
+_efl_ui_image_efl_gfx_orientable_orientation_set(Eo *obj, Efl_Ui_Image_Data *sd, Efl_Gfx_Orientation orient)
{
if (sd->edje) return;
if (sd->orient == orient) return;
@@ -1374,29 +1373,12 @@ _efl_ui_image_efl_orientation_orientation_set(Eo *obj, Efl_Ui_Image_Data *sd, Ef
_efl_ui_image_sizing_eval(obj);
}
-EOLIAN static Efl_Orient
-_efl_ui_image_efl_orientation_orientation_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd)
+EOLIAN static Efl_Gfx_Orientation
+_efl_ui_image_efl_gfx_orientable_orientation_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd)
{
return sd->orient;
}
-
-EOLIAN static void
-_efl_ui_image_efl_orientation_flip_set(Eo *obj, Efl_Ui_Image_Data *sd, Efl_Flip flip)
-{
- if (sd->edje) return;
- if (sd->flip == flip) return;
-
- sd->flip = flip;
- _efl_ui_image_sizing_eval(obj);
-}
-
-EOLIAN static Efl_Flip
-_efl_ui_image_efl_orientation_flip_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd)
-{
- return sd->flip;
-}
-
/**
* Turns on editing through drag and drop and copy and paste.
*/
@@ -2134,57 +2116,25 @@ elm_image_preload_disabled_set(Evas_Object *obj, Eina_Bool disable)
}
EAPI void
-elm_image_orient_set(Evas_Object *obj, Elm_Image_Orient orient)
-{
- Efl_Orient dir;
- Efl_Flip flip;
+elm_image_orient_set(Evas_Object *obj, Elm_Image_Orient elm_orient)
+{
+ // This array takes an Elm_Image_Orient and turns it into an Efl_Gfx_Orientation
+ static const Efl_Gfx_Orientation efl_orient[8] = {
+ EFL_GFX_ORIENTATION_NONE,
+ EFL_GFX_ORIENTATION_RIGHT,
+ EFL_GFX_ORIENTATION_DOWN,
+ EFL_GFX_ORIENTATION_LEFT,
+ EFL_GFX_ORIENTATION_FLIP_HORIZONTAL,
+ EFL_GFX_ORIENTATION_FLIP_VERTICAL,
+ EFL_GFX_ORIENTATION_LEFT | EFL_GFX_ORIENTATION_FLIP_VERTICAL,
+ EFL_GFX_ORIENTATION_RIGHT | EFL_GFX_ORIENTATION_FLIP_VERTICAL
+ };
EFL_UI_IMAGE_CHECK(obj);
EFL_UI_IMAGE_DATA_GET(obj, sd);
- sd->image_orient = orient;
-
- switch (orient)
- {
- case EVAS_IMAGE_ORIENT_0:
- dir = EFL_ORIENT_0;
- flip = EFL_FLIP_NONE;
- break;
- case EVAS_IMAGE_ORIENT_90:
- dir = EFL_ORIENT_90;
- flip = EFL_FLIP_NONE;
- break;
- case EVAS_IMAGE_ORIENT_180:
- dir = EFL_ORIENT_180;
- flip = EFL_FLIP_NONE;
- break;
- case EVAS_IMAGE_ORIENT_270:
- dir = EFL_ORIENT_270;
- flip = EFL_FLIP_NONE;
- break;
- case EVAS_IMAGE_FLIP_HORIZONTAL:
- dir = EFL_ORIENT_0;
- flip = EFL_FLIP_HORIZONTAL;
- break;
- case EVAS_IMAGE_FLIP_VERTICAL:
- dir = EFL_ORIENT_0;
- flip = EFL_FLIP_VERTICAL;
- break;
- case EVAS_IMAGE_FLIP_TRANSVERSE:
- dir = EFL_ORIENT_270;
- flip = EFL_FLIP_HORIZONTAL;
- break;
- case EVAS_IMAGE_FLIP_TRANSPOSE:
- dir = EFL_ORIENT_270;
- flip = EFL_FLIP_VERTICAL;
- break;
- default:
- dir = EFL_ORIENT_0;
- flip = EFL_FLIP_NONE;
- break;
- }
-
- efl_orientation_set(obj, dir);
- efl_orientation_flip_set(obj, flip);
+ EINA_SAFETY_ON_FALSE_RETURN(elm_orient >= 0 && elm_orient < 8);
+ sd->image_orient = elm_orient;
+ efl_gfx_orientation_set(obj, efl_orient[elm_orient]);
}
EAPI Elm_Image_Orient
diff --git a/src/lib/elementary/efl_ui_image.eo b/src/lib/elementary/efl_ui_image.eo
index 5202850d36..f80e2c356e 100644
--- a/src/lib/elementary/efl_ui_image.eo
+++ b/src/lib/elementary/efl_ui_image.eo
@@ -19,7 +19,7 @@ struct @beta Efl.Ui.Image_Error
class @beta Efl.Ui.Image extends Efl.Ui.Widget implements Efl.Ui.Clickable, Efl.Ui.Draggable,
Efl.File, Efl.Gfx.Image, Efl.Gfx.Image_Load_Controller, Efl.Player, Efl.Gfx.View,
Efl.Access.Component, Efl.Access.Widget.Action, Efl.Gfx.Color,
- Efl.Orientation,
+ Efl.Gfx.Orientable,
Efl.Layout.Calc,
Efl.Layout.Group, Efl.Layout.Signal
{
@@ -100,8 +100,7 @@ class @beta Efl.Ui.Image extends Efl.Ui.Widget implements Efl.Ui.Clickable, Efl.
Efl.Gfx.Image_Load_Controller.load_size { get; set; }
Efl.Gfx.Image.smooth_scale { get; set; }
Efl.Gfx.Image.scale_type { get; set; }
- Efl.Orientation.orientation { get; set; }
- Efl.Orientation.flip { get; set; }
+ Efl.Gfx.Orientable.orientation { get; set; }
Efl.Player.playable { get; }
Efl.Player.play { get; set; }
Efl.Layout.Signal.signal_emit;
diff --git a/src/lib/elementary/efl_ui_image_zoomable.c b/src/lib/elementary/efl_ui_image_zoomable.c
index f8c3f4ac9e..108ab5651f 100644
--- a/src/lib/elementary/efl_ui_image_zoomable.c
+++ b/src/lib/elementary/efl_ui_image_zoomable.c
@@ -622,8 +622,7 @@ _grid_create(Evas_Object *obj)
g->grid[tn].img =
evas_object_image_add(evas_object_evas_get(obj));
evas_object_image_load_orientation_set(g->grid[tn].img, EINA_TRUE);
- efl_orientation_set(g->grid[tn].img, sd->orient);
- efl_orientation_flip_set(g->grid[tn].img, sd->flip);
+ efl_gfx_orientation_set(g->grid[tn].img, sd->orient);
evas_object_image_scale_hint_set
(g->grid[tn].img, EVAS_IMAGE_SCALE_HINT_DYNAMIC);
evas_object_pass_events_set(g->grid[tn].img, EINA_TRUE);
@@ -1322,8 +1321,7 @@ _orient_apply(Eo *obj, Efl_Ui_Image_Zoomable_Data *sd)
}
}
- efl_orientation_set(sd->img, sd->orient);
- efl_orientation_flip_set(sd->img, sd->flip);
+ efl_gfx_orientation_set(sd->img, sd->orient);
evas_object_image_size_get(sd->img, &iw, &ih);
sd->size.imw = iw;
sd->size.imh = ih;
@@ -1333,8 +1331,8 @@ _orient_apply(Eo *obj, Efl_Ui_Image_Zoomable_Data *sd)
}
EOLIAN static void
-_efl_ui_image_zoomable_efl_orientation_orientation_set(Eo *obj, Efl_Ui_Image_Zoomable_Data *sd,
- Efl_Orient orient)
+_efl_ui_image_zoomable_efl_gfx_orientable_orientation_set(Eo *obj, Efl_Ui_Image_Zoomable_Data *sd,
+ Efl_Gfx_Orientation orient)
{
if (sd->orient == orient) return;
@@ -1342,27 +1340,12 @@ _efl_ui_image_zoomable_efl_orientation_orientation_set(Eo *obj, Efl_Ui_Image_Zoo
_orient_apply(obj, sd);
}
-EOLIAN static Efl_Orient
-_efl_ui_image_zoomable_efl_orientation_orientation_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Data *sd)
+EOLIAN static Efl_Gfx_Orientation
+_efl_ui_image_zoomable_efl_gfx_orientable_orientation_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Data *sd)
{
return sd->orient;
}
-EOLIAN static void
-_efl_ui_image_zoomable_efl_orientation_flip_set(Eo *obj, Efl_Ui_Image_Zoomable_Data *sd, Efl_Flip flip)
-{
- if (sd->flip == flip) return;
-
- sd->flip = flip;
- _orient_apply(obj, sd);
-}
-
-EOLIAN static Efl_Flip
-_efl_ui_image_zoomable_efl_orientation_flip_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Data *sd)
-{
- return sd->flip;
-}
-
static void
_efl_ui_image_zoomable_bar_read_and_update(Eo *obj)
{
@@ -2073,8 +2056,7 @@ _img_proxy_set(Evas_Object *obj, Efl_Ui_Image_Zoomable_Data *sd,
tz = sd->zoom;
sd->zoom = 0.0;
elm_photocam_zoom_set(obj, tz);
- sd->orient = EFL_ORIENT_NONE;
- sd->flip = EFL_FLIP_NONE;
+ sd->orient = EFL_GFX_ORIENTATION_NONE;
sd->orientation_changed = EINA_FALSE;
return 0;
@@ -2159,8 +2141,7 @@ _internal_file_set(Eo *obj, Efl_Ui_Image_Zoomable_Data *sd, Evas_Load_Error *ret
tz = sd->zoom;
sd->zoom = 0.0;
elm_photocam_zoom_set(obj, tz);
- sd->orient = EFL_ORIENT_NONE;
- sd->flip = EFL_FLIP_NONE;
+ sd->orient = EFL_GFX_ORIENTATION_NONE;
sd->orientation_changed = EINA_FALSE;
if (ret) *ret = evas_object_image_load_error_get(sd->img);
@@ -3191,95 +3172,54 @@ elm_photocam_add(Evas_Object *parent)
return elm_legacy_add(EFL_UI_IMAGE_ZOOMABLE_LEGACY_CLASS, parent);
}
-static inline void
-_evas_orient_to_eo_orient_flip(const Evas_Image_Orient evas_orient,
- Efl_Orient *orient, Efl_Flip *flip)
-{
- switch (evas_orient) {
- case EVAS_IMAGE_ORIENT_NONE:
- *orient = EFL_ORIENT_NONE;
- *flip = EFL_FLIP_NONE;
- break;
- case EVAS_IMAGE_ORIENT_90:
- *orient = EFL_ORIENT_90;
- *flip = EFL_FLIP_NONE;
- break;
- case EVAS_IMAGE_ORIENT_180:
- *orient = EFL_ORIENT_180;
- *flip = EFL_FLIP_NONE;
- break;
- case EVAS_IMAGE_ORIENT_270:
- *orient = EFL_ORIENT_270;
- *flip = EFL_FLIP_NONE;
- break;
- case EVAS_IMAGE_FLIP_HORIZONTAL:
- *orient = EFL_ORIENT_NONE;
- *flip = EFL_FLIP_HORIZONTAL;
- break;
- case EVAS_IMAGE_FLIP_VERTICAL:
- *orient = EFL_ORIENT_NONE;
- *flip = EFL_FLIP_VERTICAL;
- break;
- case EVAS_IMAGE_FLIP_TRANSVERSE:
- *orient = EFL_ORIENT_270;
- *flip = EFL_FLIP_HORIZONTAL;
- break;
- case EVAS_IMAGE_FLIP_TRANSPOSE:
- *orient = EFL_ORIENT_270;
- *flip = EFL_FLIP_VERTICAL;
- break;
- default:
- *orient = EFL_ORIENT_NONE;
- *flip = EFL_FLIP_NONE;
- break;
- }
+static inline Efl_Gfx_Orientation
+_evas_orient_to_efl_orient(const Evas_Image_Orient evas_orient)
+{
+ // This array takes an Elm_Image_Orient and turns it into an Efl_Gfx_Orientation
+ static const Efl_Gfx_Orientation efl_orient[8] = {
+ EFL_GFX_ORIENTATION_NONE,
+ EFL_GFX_ORIENTATION_RIGHT,
+ EFL_GFX_ORIENTATION_DOWN,
+ EFL_GFX_ORIENTATION_LEFT,
+ EFL_GFX_ORIENTATION_FLIP_HORIZONTAL,
+ EFL_GFX_ORIENTATION_FLIP_VERTICAL,
+ EFL_GFX_ORIENTATION_LEFT | EFL_GFX_ORIENTATION_FLIP_VERTICAL,
+ EFL_GFX_ORIENTATION_RIGHT | EFL_GFX_ORIENTATION_FLIP_VERTICAL
+ };
+ EINA_SAFETY_ON_FALSE_RETURN_VAL(evas_orient >= 0 && evas_orient < 8, EFL_GFX_ORIENTATION_NONE);
+ return efl_orient[evas_orient];
}
static inline Evas_Image_Orient
-_eo_orient_flip_to_evas_orient(Efl_Orient orient, Efl_Flip flip)
-{
- switch (flip)
- {
- default:
- case EFL_FLIP_NONE:
- switch (orient)
- {
- default:
- case EFL_ORIENT_0: return EVAS_IMAGE_ORIENT_0;
- case EFL_ORIENT_90: return EVAS_IMAGE_ORIENT_90;
- case EFL_ORIENT_180: return EVAS_IMAGE_ORIENT_180;
- case EFL_ORIENT_270: return EVAS_IMAGE_ORIENT_270;
- }
- case EFL_FLIP_HORIZONTAL:
- switch (orient)
- {
- default:
- case EFL_ORIENT_0: return EVAS_IMAGE_FLIP_HORIZONTAL;
- case EFL_ORIENT_90: return EVAS_IMAGE_FLIP_TRANSPOSE;
- case EFL_ORIENT_180: return EVAS_IMAGE_FLIP_VERTICAL;
- case EFL_ORIENT_270: return EVAS_IMAGE_FLIP_TRANSVERSE;
- }
- case EFL_FLIP_VERTICAL:
- switch (orient)
- {
- default:
- case EFL_ORIENT_0: return EVAS_IMAGE_FLIP_VERTICAL;
- case EFL_ORIENT_90: return EVAS_IMAGE_FLIP_TRANSVERSE;
- case EFL_ORIENT_180: return EVAS_IMAGE_FLIP_HORIZONTAL;
- case EFL_ORIENT_270: return EVAS_IMAGE_FLIP_TRANSPOSE;
- }
- }
+_efl_orient_to_evas_orient(Efl_Gfx_Orientation efl_orient)
+{
+ // This array takes an Efl_Gfx_Orientation and turns it into an Elm_Image_Orient
+ static const Evas_Image_Orient evas_orient[16] = {
+ EVAS_IMAGE_ORIENT_NONE, // EFL_GFX_ORIENTATION_NONE
+ EVAS_IMAGE_ORIENT_90, // EFL_GFX_ORIENTATION_RIGHT
+ EVAS_IMAGE_ORIENT_180, // EFL_GFX_ORIENTATION_DOWN
+ EVAS_IMAGE_ORIENT_270, // EFL_GFX_ORIENTATION_LEFT
+ EVAS_IMAGE_FLIP_HORIZONTAL, // EFL_GFX_ORIENTATION_NONE + FLIP_HOR
+ EVAS_IMAGE_FLIP_TRANSPOSE, // EFL_GFX_ORIENTATION_RIGHT + FLIP_HOR
+ EVAS_IMAGE_FLIP_VERTICAL, // EFL_GFX_ORIENTATION_DOWN + FLIP_HOR
+ EVAS_IMAGE_FLIP_TRANSVERSE, // EFL_GFX_ORIENTATION_LEFT + FLIP_HOR
+ EVAS_IMAGE_FLIP_VERTICAL, // EFL_GFX_ORIENTATION_NONE + FLIP_VER
+ EVAS_IMAGE_FLIP_TRANSVERSE, // EFL_GFX_ORIENTATION_RIGHT + FLIP_VER
+ EVAS_IMAGE_FLIP_HORIZONTAL, // EFL_GFX_ORIENTATION_DOWN + FLIP_VER
+ EVAS_IMAGE_FLIP_TRANSPOSE, // EFL_GFX_ORIENTATION_LEFT + FLIP_VER
+ EVAS_IMAGE_ORIENT_180, // EFL_GFX_ORIENTATION_NONE + FLIP_HOR + FLIP_VER
+ EVAS_IMAGE_ORIENT_270, // EFL_GFX_ORIENTATION_RIGHT + FLIP_HOR + FLIP_VER
+ EVAS_IMAGE_ORIENT_0, // EFL_GFX_ORIENTATION_DOWN + FLIP_HOR + FLIP_VER
+ EVAS_IMAGE_ORIENT_90 // EFL_GFX_ORIENTATION_LEFT + FLIP_HOR + FLIP_VER
+ };
+ EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_orient >= 0 && efl_orient < 16, EVAS_IMAGE_ORIENT_NONE);
+ return evas_orient[efl_orient];
}
EAPI void
elm_photocam_image_orient_set(Eo *obj, Evas_Image_Orient evas_orient)
{
- Efl_Orient orient;
- Efl_Flip flip;
-
- _evas_orient_to_eo_orient_flip(evas_orient, &orient, &flip);
- efl_orientation_set(obj, orient);
- efl_orientation_flip_set(obj, flip);
+ efl_gfx_orientation_set(obj, _evas_orient_to_efl_orient(evas_orient));
}
EAPI Evas_Image_Orient
@@ -3287,7 +3227,7 @@ elm_photocam_image_orient_get(const Eo *obj)
{
ELM_PHOTOCAM_CHECK(obj) EVAS_IMAGE_ORIENT_NONE;
EFL_UI_IMAGE_ZOOMABLE_DATA_GET(obj, sd);
- return _eo_orient_flip_to_evas_orient(sd->orient, sd->flip);
+ return _efl_orient_to_evas_orient(sd->orient);
}
EAPI Evas_Object*
diff --git a/src/lib/elementary/efl_ui_image_zoomable.eo b/src/lib/elementary/efl_ui_image_zoomable.eo
index fccf57f21c..4f66bda9b0 100644
--- a/src/lib/elementary/efl_ui_image_zoomable.eo
+++ b/src/lib/elementary/efl_ui_image_zoomable.eo
@@ -65,8 +65,7 @@ class @beta Efl.Ui.Image_Zoomable extends Efl.Ui.Image implements Efl.Ui.Zoom,
Efl.Access.Widget.Action.elm_actions { get; }
Efl.File.load;
Efl.File.file { get; set; }
- Efl.Orientation.orientation { get; set; }
- Efl.Orientation.flip { get; set; }
+ Efl.Gfx.Orientable.orientation { get; set; }
Efl.Layout.Group.group_size_min { get; }
Efl.Layout.Group.group_size_max { get; }
Efl.Layout.Signal.signal_callback_add;
diff --git a/src/lib/elementary/efl_ui_image_zoomable_private.h b/src/lib/elementary/efl_ui_image_zoomable_private.h
index 7ccbf2553c..8bf1dffd72 100644
--- a/src/lib/elementary/efl_ui_image_zoomable_private.h
+++ b/src/lib/elementary/efl_ui_image_zoomable_private.h
@@ -128,9 +128,8 @@ struct _Efl_Ui_Image_Zoomable_Data
int cur_frame;
int frame_count;
- Eina_List *grids;
- Efl_Orient orient;
- Efl_Flip flip;
+ Eina_List *grids;
+ Efl_Gfx_Orientation orient;
Eina_Bool main_load_pending : 1;
Eina_Bool longpressed : 1;
diff --git a/src/lib/elementary/efl_ui_internal_text_scroller.eo b/src/lib/elementary/efl_ui_internal_text_scroller.eo
index 4e20e9bea7..b18c008d76 100644
--- a/src/lib/elementary/efl_ui_internal_text_scroller.eo
+++ b/src/lib/elementary/efl_ui_internal_text_scroller.eo
@@ -38,8 +38,8 @@ class @beta Efl.Ui.Internal_Text_Scroller extends Efl.Ui.Scroller
This should be called upon constructing the object.
]]
params {
- text_obj: Efl.Canvas.Text @nullable; [[The text object to query]]
- text_table: Efl.Ui.Table @nullable; [[The table container of
+ text_obj: Efl.Canvas.Text; [[The text object to query]]
+ text_table: Efl.Ui.Table; [[The table container of
the $text_obj]]
}
}
diff --git a/src/lib/elementary/efl_ui_layout.c b/src/lib/elementary/efl_ui_layout.c
index fa47bc1d1f..0260ae5d6a 100644
--- a/src/lib/elementary/efl_ui_layout.c
+++ b/src/lib/elementary/efl_ui_layout.c
@@ -2614,7 +2614,7 @@ _efl_ui_layout_base_automatic_theme_rotation_get(const Eo *obj EINA_UNUSED, Efl_
}
EOLIAN static void
-_efl_ui_layout_base_theme_rotation_apply(Eo *obj, Efl_Ui_Layout_Data *pd EINA_UNUSED, Efl_Orient orientation)
+_efl_ui_layout_base_theme_rotation_apply(Eo *obj, Efl_Ui_Layout_Data *pd EINA_UNUSED, int orientation)
{
char prefix[4], buf[128];
diff --git a/src/lib/elementary/efl_ui_layout_base.eo b/src/lib/elementary/efl_ui_layout_base.eo
index 1923bddefa..54a646c1bb 100644
--- a/src/lib/elementary/efl_ui_layout_base.eo
+++ b/src/lib/elementary/efl_ui_layout_base.eo
@@ -1,5 +1,4 @@
import efl_ui;
-import efl_orientation;
abstract Efl.Ui.Layout_Base extends Efl.Ui.Widget implements Efl.Container,
Efl.Ui.Factory_Bind,
@@ -53,7 +52,7 @@ abstract Efl.Ui.Layout_Base extends Efl.Ui.Widget implements Efl.Container,
theme_rotation_apply @beta {
[[Apply a new rotation value to this object.]]
params {
- orientation : Efl.Orient; [[The new rotation value.]]
+ orientation : int; [[The new rotation angle, in degrees.]]
}
}
}
diff --git a/src/lib/elementary/efl_ui_pager.eo b/src/lib/elementary/efl_ui_pager.eo
index 7879132d26..7389fd8e08 100644
--- a/src/lib/elementary/efl_ui_pager.eo
+++ b/src/lib/elementary/efl_ui_pager.eo
@@ -27,7 +27,7 @@ class @beta Efl.Ui.Pager extends Efl.Ui.Layout_Base implements Efl.Pack_Linear
[[Set a page transition effect]]
}
values {
- transition: Efl.Page.Transition @nullable; [[transition effect]]
+ transition: Efl.Page.Transition; [[transition effect]]
}
}
@property indicator {
@@ -40,7 +40,7 @@ class @beta Efl.Ui.Pager extends Efl.Ui.Layout_Base implements Efl.Pack_Linear
[[Set a page indicator]]
}
values {
- indicator: Efl.Page.Indicator @nullable; [[indicator class]]
+ indicator: Efl.Page.Indicator; [[indicator class]]
}
}
@property current_page {
diff --git a/src/lib/elementary/efl_ui_radio.eo b/src/lib/elementary/efl_ui_radio.eo
index 5fd6136543..8dabfc7cfc 100644
--- a/src/lib/elementary/efl_ui_radio.eo
+++ b/src/lib/elementary/efl_ui_radio.eo
@@ -33,7 +33,7 @@ class @beta Efl.Ui.Radio extends Efl.Ui.Check implements Efl.Access.Widget.Actio
]]
}
values {
- valuep: ptr(int) @nullable; [[Pointer to the integer to modify]]
+ valuep: ptr(int); [[Pointer to the integer to modify]]
}
}
@property selected_object {
diff --git a/src/lib/elementary/efl_ui_scroll_manager.eo b/src/lib/elementary/efl_ui_scroll_manager.eo
index e948fe6bc9..3733e81369 100644
--- a/src/lib/elementary/efl_ui_scroll_manager.eo
+++ b/src/lib/elementary/efl_ui_scroll_manager.eo
@@ -17,7 +17,7 @@ class @beta Efl.Ui.Scroll.Manager extends Efl.Object implements
set {
}
values {
- pan: Efl.Ui.Pan @nullable; [[Pan object]]
+ pan: Efl.Ui.Pan; [[Pan object]]
}
}
}
diff --git a/src/lib/elementary/efl_ui_table.c b/src/lib/elementary/efl_ui_table.c
index 208dedd80a..3c92dcb2d0 100644
--- a/src/lib/elementary/efl_ui_table.c
+++ b/src/lib/elementary/efl_ui_table.c
@@ -90,7 +90,7 @@ _efl_ui_table_last_position_get(Eo * obj, Efl_Ui_Table_Data *pd, int *last_col,
efl_pack_table_size_get(obj, &req_cols, &req_rows);
- if (efl_ui_dir_is_horizontal(pd->dir1, EINA_TRUE))
+ if (efl_ui_dir_is_horizontal(pd->fill_dir, EINA_TRUE))
{
EINA_INLIST_REVERSE_FOREACH(EINA_INLIST_GET(pd->items), gi)
{
@@ -220,8 +220,7 @@ _efl_ui_table_efl_object_constructor(Eo *obj, Efl_Ui_Table_Data *pd)
efl_access_object_access_type_set(obj, EFL_ACCESS_TYPE_SKIPPED);
efl_access_object_role_set(obj, EFL_ACCESS_ROLE_FILLER);
- pd->dir1 = EFL_UI_DIR_RIGHT;
- pd->dir2 = EFL_UI_DIR_DOWN;
+ pd->fill_dir = EFL_UI_DIR_RIGHT;
pd->last_col = -1;
pd->last_row = -1;
pd->req_cols = 0;
@@ -622,24 +621,13 @@ _efl_ui_table_efl_pack_table_table_contents_get(Eo *obj EINA_UNUSED, Efl_Ui_Tabl
EOLIAN static void
_efl_ui_table_efl_ui_direction_direction_set(Eo *obj, Efl_Ui_Table_Data *pd, Efl_Ui_Dir dir)
{
- if (pd->dir1 == dir)
+ if (pd->fill_dir == dir)
return;
if (dir == EFL_UI_DIR_DEFAULT)
dir = EFL_UI_DIR_RIGHT;
- pd->dir1 = dir;
-
- /* if both directions are either horizontal or vertical, need to adjust
- * secondary direction (dir2) */
- if (efl_ui_dir_is_horizontal(pd->dir1, EINA_TRUE) ==
- efl_ui_dir_is_horizontal(pd->dir2, EINA_FALSE))
- {
- if (efl_ui_dir_is_horizontal(pd->dir1, EINA_TRUE))
- pd->dir2 = EFL_UI_DIR_DOWN;
- else
- pd->dir2 = EFL_UI_DIR_RIGHT;
- }
+ pd->fill_dir = dir;
efl_pack_layout_request(obj);
}
@@ -647,37 +635,7 @@ _efl_ui_table_efl_ui_direction_direction_set(Eo *obj, Efl_Ui_Table_Data *pd, Efl
EOLIAN static Efl_Ui_Dir
_efl_ui_table_efl_ui_direction_direction_get(const Eo *obj EINA_UNUSED, Efl_Ui_Table_Data *pd)
{
- return pd->dir1;
-}
-
-EOLIAN static void
-_efl_ui_table_efl_pack_table_table_direction_set(Eo *obj, Efl_Ui_Table_Data *pd, Efl_Ui_Dir primary, Efl_Ui_Dir secondary)
-{
- if ((pd->dir1 == primary) && (pd->dir2 == secondary))
- return;
-
- pd->dir1 = primary;
- pd->dir2 = secondary;
-
- if (efl_ui_dir_is_horizontal(pd->dir1, EINA_TRUE) ==
- efl_ui_dir_is_horizontal(pd->dir2, EINA_FALSE))
- {
- ERR("specified two directions in the same axis, secondary directions "
- " is reset to a valid default");
- if (efl_ui_dir_is_horizontal(pd->dir1, EINA_TRUE))
- pd->dir2 = EFL_UI_DIR_DOWN;
- else
- pd->dir2 = EFL_UI_DIR_RIGHT;
- }
-
- efl_pack_layout_request(obj);
-}
-
-EOLIAN static void
-_efl_ui_table_efl_pack_table_table_direction_get(const Eo *obj EINA_UNUSED, Efl_Ui_Table_Data *pd, Efl_Ui_Dir *primary, Efl_Ui_Dir *secondary)
-{
- if (primary) *primary = pd->dir1;
- if (secondary) *secondary = pd->dir2;
+ return pd->fill_dir;
}
EOLIAN static void
@@ -770,7 +728,7 @@ _efl_ui_table_efl_pack_pack(Eo *obj, Efl_Ui_Table_Data *pd, Efl_Gfx_Entity *subo
_efl_ui_table_last_position_get(obj, pd, &last_col, &last_row);
- if (efl_ui_dir_is_horizontal(pd->dir1, EINA_TRUE))
+ if (efl_ui_dir_is_horizontal(pd->fill_dir, EINA_TRUE))
{
last_col++;
if (pd->req_cols && (last_col >= pd->req_cols))
diff --git a/src/lib/elementary/efl_ui_table.eo b/src/lib/elementary/efl_ui_table.eo
index be5840bce2..463508bfbd 100644
--- a/src/lib/elementary/efl_ui_table.eo
+++ b/src/lib/elementary/efl_ui_table.eo
@@ -1,7 +1,19 @@
class @beta Efl.Ui.Table extends Efl.Ui.Widget implements Efl.Pack_Table, Efl.Pack_Layout,
Efl.Ui.Direction, Efl.Gfx.Arrangement
{
- [[Efl UI table class]]
+ [[Widget container that arranges its elements in a grid.
+
+ The amount of rows and columns can be controlled with @Efl.Pack_Table.table_rows
+ and @Efl.Pack_Table.table_columns, and elements can be manually positioned with
+ @Efl.Pack_Table.pack_table.
+ Additionally, a fill direction can be defined with @Efl.Ui.Direction.direction and
+ elements added with @Efl.Pack.pack. Elements are then added following this direction
+ (horizontal or vertical) and when the amount of columns or rows has been reached,
+ a step is taken in the orthogonal direction.
+ In this second case there is no need to define both the amount of columns and rows,
+ as the table will expand as needed.
+ The default fill direction is @Efl.Ui.Dir.right.
+ ]]
methods {
@property homogeneous {
[[Control homogeneous mode.
@@ -39,7 +51,6 @@ class @beta Efl.Ui.Table extends Efl.Ui.Widget implements Efl.Pack_Table, Efl.Pa
Efl.Pack_Table.table_size { get; set; }
Efl.Pack_Table.table_columns { get; set; }
Efl.Pack_Table.table_rows { get; set; }
- Efl.Pack_Table.table_direction { get; set; }
Efl.Pack_Layout.layout_update;
Efl.Pack_Layout.layout_request;
}
diff --git a/src/lib/elementary/efl_ui_table_private.h b/src/lib/elementary/efl_ui_table_private.h
index 5b1e193646..8d134ece73 100644
--- a/src/lib/elementary/efl_ui_table_private.h
+++ b/src/lib/elementary/efl_ui_table_private.h
@@ -36,7 +36,7 @@ struct _Efl_Ui_Table_Data
int cols, rows;
int req_cols, req_rows; // requested - 0 means infinite
int last_col, last_row; // only used by pack api
- Efl_Ui_Dir dir1, dir2; // must be orthogonal (H,V or V,H)
+ Efl_Ui_Dir fill_dir; // direction in which cells are added when using pack()
struct {
double h, v;
Eina_Bool scalable: 1;
diff --git a/src/lib/elementary/efl_ui_text.eo b/src/lib/elementary/efl_ui_text.eo
index 626280afc2..4ebb3faec8 100644
--- a/src/lib/elementary/efl_ui_text.eo
+++ b/src/lib/elementary/efl_ui_text.eo
@@ -360,7 +360,7 @@ class @beta Efl.Ui.Text extends Efl.Ui.Layout_Base implements Efl.Ui.Clickable,
}
events {
changed: void; [[Called when entry changes]]
- /* FIXME: Sometimes it can be NULL but @nullable does not work on events */
+ /* can be NULL, tag nullable once Eolian supports it */
changed,user: Efl.Ui.Text_Change_Info;
[[The text object has changed due to user interaction]]
validate: Elm.Validate_Content; [[Called when validating]]
diff --git a/src/lib/elementary/efl_ui_textpath.c b/src/lib/elementary/efl_ui_textpath.c
index 10165607c7..f9c906ab1a 100644
--- a/src/lib/elementary/efl_ui_textpath.c
+++ b/src/lib/elementary/efl_ui_textpath.c
@@ -17,7 +17,6 @@
#define MY_CLASS_NAME "Efl.Ui.Textpath"
#define SLICE_DEFAULT_NO 99
-
typedef struct _Efl_Ui_Textpath_Point Efl_Ui_Textpath_Point;
typedef struct _Efl_Ui_Textpath_Line Efl_Ui_Textpath_Line;
typedef struct _Efl_Ui_Textpath_Segment Efl_Ui_Textpath_Segment;
@@ -77,6 +76,12 @@ struct _Efl_Ui_Textpath_Data
Efl_Ui_Textpath_Data *sd = efl_data_scope_get(o, EFL_UI_TEXTPATH_CLASS)
static inline double
+_rad_to_deg(double rad)
+{
+ return 180 * rad / M_PI;
+}
+
+static inline double
_deg_to_rad(double angle)
{
return angle / 180 * M_PI;
@@ -576,6 +581,79 @@ _textpath_text_set_internal(Eo *obj, Efl_Ui_Textpath_Data *pd, const char *part,
return ret;
}
+static void
+_path_start_angle_adjust(Eo *obj, Efl_Ui_Textpath_Data *pd)
+{
+ Eina_Rect r;
+ Efl_Ui_Textpath_Segment *seg;
+ Eina_Vector2 first, last;
+ int remained_w, len;
+ double rad, t, offset_angle;
+
+ if (pd->direction != EFL_UI_TEXTPATH_DIRECTION_CW_CENTER &&
+ pd->direction != EFL_UI_TEXTPATH_DIRECTION_CCW_CENTER)
+ return;
+
+ r = efl_gfx_entity_geometry_get(pd->text_obj);
+ remained_w = r.w;
+
+ EINA_INLIST_FOREACH(pd->segments, seg)
+ {
+ if (remained_w <= 0)
+ break;
+
+ len = seg->length;
+ if (remained_w < len)
+ {
+ t = remained_w / (double)len;
+ eina_bezier_point_at(&seg->bezier, t, &last.x, &last.y);
+ }
+
+ if (remained_w == r.w)
+ eina_bezier_point_at(&seg->bezier, 0, &first.x, &first.y);
+
+ remained_w -= len;
+ }
+
+ first.x -= (pd->circle.x + r.x);
+ first.y -= (pd->circle.y + r.y);
+ last.x -= (pd->circle.x + r.x);
+ last.y -= (pd->circle.y + r.y);
+
+ eina_vector2_normalize(&first, &first);
+ eina_vector2_normalize(&last, &last);
+ rad = acos(eina_vector2_dot_product(&first, &last));
+ if (rad == 0) return;
+
+ offset_angle = _rad_to_deg(rad);
+ if (r.w > pd->total_length / 2)
+ offset_angle = 360 - offset_angle;
+ offset_angle /= 2.0;
+
+ efl_gfx_path_reset(obj);
+ if (pd->direction == EFL_UI_TEXTPATH_DIRECTION_CW_CENTER)
+ {
+ efl_gfx_path_append_arc(obj,
+ pd->circle.x - pd->circle.radius,
+ pd->circle.y - pd->circle.radius,
+ pd->circle.radius * 2,
+ pd->circle.radius * 2,
+ pd->circle.start_angle + offset_angle,
+ -360);
+ }
+ else
+ {
+ efl_gfx_path_append_arc(obj,
+ pd->circle.x - pd->circle.radius,
+ pd->circle.y - pd->circle.radius,
+ pd->circle.radius * 2,
+ pd->circle.radius * 2,
+ pd->circle.start_angle - offset_angle,
+ 360);
+ }
+ _path_data_get(obj, pd, EINA_TRUE);
+}
+
EOLIAN static void
_efl_ui_textpath_efl_canvas_group_group_calculate(Eo *obj EINA_UNUSED, Efl_Ui_Textpath_Data *pd)
{
@@ -677,7 +755,7 @@ _efl_ui_textpath_efl_gfx_entity_position_set(Eo *obj, Efl_Ui_Textpath_Data *pd,
{
efl_gfx_entity_position_set(efl_super(obj, MY_CLASS), pos);
_path_data_get(obj, pd, EINA_FALSE);
- _sizing_eval(pd);
+ _text_draw(pd);
}
EOLIAN static void
@@ -702,7 +780,8 @@ _efl_ui_textpath_circle_set(Eo *obj, Efl_Ui_Textpath_Data *pd, double x, double
pd->direction = direction;
efl_gfx_path_reset(obj);
- if (direction == EFL_UI_TEXTPATH_DIRECTION_CW)
+ if (direction == EFL_UI_TEXTPATH_DIRECTION_CW ||
+ direction == EFL_UI_TEXTPATH_DIRECTION_CW_CENTER)
{
efl_gfx_path_append_arc(obj, x - radius, y - radius, radius * 2,
radius * 2, start_angle, -360);
@@ -714,6 +793,7 @@ _efl_ui_textpath_circle_set(Eo *obj, Efl_Ui_Textpath_Data *pd, double x, double
}
_path_data_get(obj, pd, EINA_TRUE);
+ _path_start_angle_adjust(obj, pd);
_sizing_eval(pd);
}
diff --git a/src/lib/elementary/efl_ui_textpath.eo b/src/lib/elementary/efl_ui_textpath.eo
index b403d149f5..4a56b490a3 100644
--- a/src/lib/elementary/efl_ui_textpath.eo
+++ b/src/lib/elementary/efl_ui_textpath.eo
@@ -1,7 +1,9 @@
enum @beta Efl.Ui.Textpath_Direction {
[[Textpath direction]]
cw, [[Clockwise]]
- ccw [[Counter-clockwise]]
+ ccw, [[Counter-clockwise]]
+ cw_center, [[Clockwise, middle of text will be at start angle @since 1.23]]
+ ccw_center [[Counter-clockwise, middle of text will be at start angle @since 1.23]]
}
class @beta Efl.Ui.Textpath extends Efl.Ui.Layout_Base implements Efl.Text, Efl.Gfx.Path
diff --git a/src/lib/elementary/efl_ui_textpath_eo.legacy.h b/src/lib/elementary/efl_ui_textpath_eo.legacy.h
index dad8d9e120..5fe981a2d8 100644
--- a/src/lib/elementary/efl_ui_textpath_eo.legacy.h
+++ b/src/lib/elementary/efl_ui_textpath_eo.legacy.h
@@ -18,7 +18,9 @@ typedef Eo Efl_Ui_Textpath;
typedef enum
{
EFL_UI_TEXTPATH_DIRECTION_CW = 0, /**< Clockwise */
- EFL_UI_TEXTPATH_DIRECTION_CCW /**< Counter-clockwise */
+ EFL_UI_TEXTPATH_DIRECTION_CCW, /**< Counter-clockwise */
+ EFL_UI_TEXTPATH_DIRECTION_CW_CENTER, /**< Clockwise, middle of text will be at start angle @since 1.23 */
+ EFL_UI_TEXTPATH_DIRECTION_CCW_CENTER /**< Counter-clockwise, middle of text will be at start angle @since 1.23 */
} Efl_Ui_Textpath_Direction;
diff --git a/src/lib/elementary/efl_ui_widget.eo b/src/lib/elementary/efl_ui_widget.eo
index ece49ef4f6..1c2f85abf9 100644
--- a/src/lib/elementary/efl_ui_widget.eo
+++ b/src/lib/elementary/efl_ui_widget.eo
@@ -53,8 +53,8 @@ abstract Efl.Ui.Widget extends Efl.Canvas.Group implements Efl.Access.Object,
[[Returns the current cursor name.]]
}
values {
- cursor: string @nullable; [[The cursor name, defined either
- by the display system or the theme.]]
+ cursor: string; [[The cursor name, defined either
+ by the display system or the theme.]]
}
}
@property cursor_style @beta {
@@ -104,7 +104,7 @@ abstract Efl.Ui.Widget extends Efl.Canvas.Group implements Efl.Access.Object,
[[Sets the new resize object for this widget.]]
}
values {
- sobj: Efl.Canvas.Object @nullable;
+ sobj: Efl.Canvas.Object;
[[A canvas object (often a @Efl.Canvas.Layout object).]]
}
}
@@ -216,7 +216,7 @@ abstract Efl.Ui.Widget extends Efl.Canvas.Group implements Efl.Access.Object,
get {
}
values {
- parent: Efl.Ui.Widget @nullable; [[Widget parent object]]
+ parent: Efl.Ui.Widget; [[Widget parent object]]
}
}
@@ -231,7 +231,7 @@ abstract Efl.Ui.Widget extends Efl.Canvas.Group implements Efl.Access.Object,
out loud, instead $txt will be read out.
]]
values {
- txt: string @nullable; [[Accessibility text description.]]
+ txt: string; [[Accessibility text description.]]
}
}
on_access_activate @protected @beta {
diff --git a/src/lib/elementary/efl_ui_widget_image.h b/src/lib/elementary/efl_ui_widget_image.h
index 7a959d4cc6..8f3c67c4fd 100644
--- a/src/lib/elementary/efl_ui_widget_image.h
+++ b/src/lib/elementary/efl_ui_widget_image.h
@@ -65,8 +65,7 @@ struct _Efl_Ui_Image_Data
int cur_frame;
Elm_Image_Orient image_orient; // to support EAPI
- Efl_Orient orient;
- Efl_Flip flip;
+ Efl_Gfx_Orientation orient;
struct {
Ecore_Thread *th;
diff --git a/src/lib/elementary/efl_ui_win.eo b/src/lib/elementary/efl_ui_win.eo
index 33a4be6510..1a3e3a4db3 100644
--- a/src/lib/elementary/efl_ui_win.eo
+++ b/src/lib/elementary/efl_ui_win.eo
@@ -303,7 +303,7 @@ class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Access.W
type @Efl.Canvas.Image or @Efl.Ui.Image are allowed.
]]
values {
- icon: Efl.Canvas.Object @nullable;
+ icon: Efl.Canvas.Object;
[[The image object to use for an icon.]]
}
}
@@ -314,7 +314,7 @@ class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Access.W
the object to use for the window icon.
]]
values {
- icon: const(Efl.Canvas.Object) @nullable;
+ icon: const(Efl.Canvas.Object);
[[The Evas image object to use for an icon.]]
}
}
@@ -444,7 +444,7 @@ class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Access.W
get {
}
values {
- name: string @nullable; [[Window name]]
+ name: string; [[Window name]]
}
}
@property win_type @beta {
@@ -797,7 +797,7 @@ class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Access.W
get {
}
values {
- style: string @nullable; [[The name of the focus highlight style.]]
+ style: string; [[The name of the focus highlight style.]]
}
}
@property focus_highlight_animate {
diff --git a/src/lib/elementary/elm_entry.c b/src/lib/elementary/elm_entry.c
index 207c10368d..37e75245dc 100644
--- a/src/lib/elementary/elm_entry.c
+++ b/src/lib/elementary/elm_entry.c
@@ -925,7 +925,14 @@ _elm_entry_efl_ui_widget_theme_apply(Eo *obj, Elm_Entry_Data *sd)
edje_object_part_text_style_user_push(sd->entry_edje, "elm.text", stl_user);
eina_stringshare_del(stl_user);
- cursor_pos = sd->cursor_pos;
+ cursor_pos = edje_object_part_text_cursor_pos_get
+ (sd->entry_edje, "elm.text", EDJE_CURSOR_MAIN);
+
+ if (cursor_pos != sd->cursor_pos)
+ {
+ sd->cursor_pos = cursor_pos;
+ sd->cur_changed = EINA_TRUE;
+ }
elm_object_text_set(obj, t);
eina_stringshare_del(t);
diff --git a/src/lib/elementary/elm_font.c b/src/lib/elementary/elm_font.c
index cffaa5a291..f5c37c28b7 100644
--- a/src/lib/elementary/elm_font.c
+++ b/src/lib/elementary/elm_font.c
@@ -2,10 +2,6 @@
# include "elementary_config.h"
#endif
-#ifdef _WIN32
-# include <Evil.h>
-#endif
-
#include <Elementary.h>
#include "elm_priv.h"
diff --git a/src/lib/elementary/elm_interface_scrollable.eo b/src/lib/elementary/elm_interface_scrollable.eo
index f8c2a2dbfd..77f2422864 100644
--- a/src/lib/elementary/elm_interface_scrollable.eo
+++ b/src/lib/elementary/elm_interface_scrollable.eo
@@ -287,7 +287,7 @@ mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrol
[[Set the callback to run when the content has been moved up.]]
}
values {
- scroll_up_cb: Elm_Interface_Scrollable_Cb @nullable; [[The callback]]
+ scroll_up_cb: Elm_Interface_Scrollable_Cb; [[The callback]]
}
}
@property hbar_drag_cb {
@@ -295,7 +295,7 @@ mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrol
[[Set the callback to run when the horizontal scrollbar is dragged.]]
}
values {
- hbar_drag_cb: Elm_Interface_Scrollable_Cb @nullable; [[The callback]]
+ hbar_drag_cb: Elm_Interface_Scrollable_Cb; [[The callback]]
}
}
@property drag_start_cb {
@@ -303,7 +303,7 @@ mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrol
[[Set the callback to run when dragging of the contents has started.]]
}
values {
- drag_start_cb: Elm_Interface_Scrollable_Cb @nullable; [[The callback]]
+ drag_start_cb: Elm_Interface_Scrollable_Cb; [[The callback]]
}
}
@property freeze {
@@ -319,7 +319,7 @@ mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrol
[[When the viewport is resized, the callback is called.]]
}
values {
- viewport_resize_cb: Elm_Interface_Scrollable_Resize_Cb @nullable; [[The callback]]
+ viewport_resize_cb: Elm_Interface_Scrollable_Resize_Cb; [[The callback]]
}
}
@property scroll_left_cb {
@@ -327,7 +327,7 @@ mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrol
[[Set the callback to run when the content has been moved to the left]]
}
values {
- scroll_left_cb: Elm_Interface_Scrollable_Cb @nullable; [[The callback]]
+ scroll_left_cb: Elm_Interface_Scrollable_Cb; [[The callback]]
}
}
@property vbar_press_cb {
@@ -335,7 +335,7 @@ mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrol
[[Set the callback to run when the vertical scrollbar is pressed.]]
}
values {
- vbar_press_cb: Elm_Interface_Scrollable_Cb @nullable; [[The callback]]
+ vbar_press_cb: Elm_Interface_Scrollable_Cb; [[The callback]]
}
}
@property hbar_press_cb {
@@ -343,7 +343,7 @@ mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrol
[[Set the callback to run when the horizontal scrollbar is pressed.]]
}
values {
- hbar_press_cb: Elm_Interface_Scrollable_Cb @nullable; [[The callback]]
+ hbar_press_cb: Elm_Interface_Scrollable_Cb; [[The callback]]
}
}
@property hbar_unpress_cb {
@@ -351,7 +351,7 @@ mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrol
[[Set the callback to run when the horizontal scrollbar is unpressed.]]
}
values {
- hbar_unpress_cb: Elm_Interface_Scrollable_Cb @nullable; [[The callback]]
+ hbar_unpress_cb: Elm_Interface_Scrollable_Cb; [[The callback]]
}
}
@property drag_stop_cb {
@@ -359,7 +359,7 @@ mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrol
[[Set the callback to run when dragging of the contents has stopped.]]
}
values {
- drag_stop_cb: Elm_Interface_Scrollable_Cb @nullable; [[The callback]]
+ drag_stop_cb: Elm_Interface_Scrollable_Cb; [[The callback]]
}
}
@property extern_pan {
@@ -367,7 +367,7 @@ mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrol
set {
}
values {
- pan: Efl.Canvas.Object @nullable; [[Pan object]]
+ pan: Efl.Canvas.Object; [[Pan object]]
}
}
@property page_change_cb {
@@ -375,7 +375,7 @@ mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrol
[[Set the callback to run when the visible page changes.]]
}
values {
- page_change_cb: Elm_Interface_Scrollable_Cb @nullable; [[The callback]]
+ page_change_cb: Elm_Interface_Scrollable_Cb; [[The callback]]
}
}
@property hold {
@@ -391,7 +391,7 @@ mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrol
[[Set the callback to run when the scrolling animation has started.]]
}
values {
- animate_start_cb: Elm_Interface_Scrollable_Cb @nullable; [[The callback]]
+ animate_start_cb: Elm_Interface_Scrollable_Cb; [[The callback]]
}
}
@property scroll_down_cb {
@@ -399,7 +399,7 @@ mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrol
[[Set the callback to run when the content has been moved down.]]
}
values {
- scroll_down_cb: Elm_Interface_Scrollable_Cb @nullable; [[The callback]]
+ scroll_down_cb: Elm_Interface_Scrollable_Cb; [[The callback]]
}
}
@property page_relative {
@@ -416,7 +416,7 @@ mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrol
[[Set the callback to run when the content has been moved.]]
}
values {
- scroll_cb: Elm_Interface_Scrollable_Cb @nullable; [[The callback]]
+ scroll_cb: Elm_Interface_Scrollable_Cb; [[The callback]]
}
}
@property animate_stop_cb {
@@ -424,7 +424,7 @@ mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrol
[[Set the callback to run when the scrolling animation has stopped.]]
}
values {
- animate_stop_cb: Elm_Interface_Scrollable_Cb @nullable; [[The callback]]
+ animate_stop_cb: Elm_Interface_Scrollable_Cb; [[The callback]]
}
}
@property content_min_limit_cb {
@@ -432,7 +432,7 @@ mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrol
set {
}
values {
- min_limit_cb: Elm_Interface_Scrollable_Min_Limit_Cb @nullable; [[The callback]]
+ min_limit_cb: Elm_Interface_Scrollable_Min_Limit_Cb; [[The callback]]
}
}
@property scroll_right_cb {
@@ -440,7 +440,7 @@ mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrol
[[Set the callback to run when the content has been moved to the right.]]
}
values {
- scroll_right_cb: Elm_Interface_Scrollable_Cb @nullable; [[The callback]]
+ scroll_right_cb: Elm_Interface_Scrollable_Cb; [[The callback]]
}
}
@property scrollable_content {
@@ -448,7 +448,7 @@ mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrol
set {
}
values {
- content: Efl.Canvas.Object @nullable; [[Content object]]
+ content: Efl.Canvas.Object; [[Content object]]
}
}
@property edge_left_cb {
@@ -456,7 +456,7 @@ mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrol
[[Set the callback to run when the left edge of the content has been reached.]]
}
values {
- edge_left_cb: Elm_Interface_Scrollable_Cb @nullable; [[The callback]]
+ edge_left_cb: Elm_Interface_Scrollable_Cb; [[The callback]]
}
}
@property vbar_drag_cb {
@@ -464,7 +464,7 @@ mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrol
[[Set the callback to run when the horizontal scrollbar is dragged.]]
}
values {
- vbar_drag_cb: Elm_Interface_Scrollable_Cb @nullable; [[The callback]]
+ vbar_drag_cb: Elm_Interface_Scrollable_Cb; [[The callback]]
}
}
@property vbar_unpress_cb {
@@ -472,7 +472,7 @@ mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrol
[[Set the callback to run when the horizontal scrollbar is unpressed.]]
}
values {
- vbar_unpress_cb: Elm_Interface_Scrollable_Cb @nullable; [[The callback]]
+ vbar_unpress_cb: Elm_Interface_Scrollable_Cb; [[The callback]]
}
}
@property edge_bottom_cb {
@@ -480,7 +480,7 @@ mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrol
[[Set the callback to run when the bottom edge of the content has been reached.]]
}
values {
- edge_bottom_cb: Elm_Interface_Scrollable_Cb @nullable; [[The callback]]
+ edge_bottom_cb: Elm_Interface_Scrollable_Cb; [[The callback]]
}
}
@property edge_right_cb {
@@ -488,7 +488,7 @@ mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrol
[[Set the callback to run when the right edge of the content has been reached.]]
}
values {
- edge_right_cb: Elm_Interface_Scrollable_Cb @nullable; [[The callback]]
+ edge_right_cb: Elm_Interface_Scrollable_Cb; [[The callback]]
}
}
@property edge_top_cb {
@@ -496,7 +496,7 @@ mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrol
[[Set the callback to run when the top edge of the content has been reached.]]
}
values {
- edge_top_cb: Elm_Interface_Scrollable_Cb @nullable; [[The callback]]
+ edge_top_cb: Elm_Interface_Scrollable_Cb; [[The callback]]
}
}
@property objects {
diff --git a/src/lib/elementary/elm_main.c b/src/lib/elementary/elm_main.c
index 4bb77acf45..5aff10ae95 100644
--- a/src/lib/elementary/elm_main.c
+++ b/src/lib/elementary/elm_main.c
@@ -12,7 +12,6 @@
#ifdef _WIN32
# include <direct.h> /* getcwd */
-# include <Evil.h>
#endif
#include <Emotion.h>
diff --git a/src/lib/elua/elua_private.h b/src/lib/elua/elua_private.h
index f4392f604b..6ecd7a80f0 100644
--- a/src/lib/elua/elua_private.h
+++ b/src/lib/elua/elua_private.h
@@ -20,10 +20,6 @@
#include <Eina.h>
#include <Ecore.h>
-#ifdef _WIN32
-#include <Evil.h>
-#endif
-
#include <lua.h>
#include <lualib.h>
#include <lauxlib.h>
diff --git a/src/lib/embryo/embryo_time.c b/src/lib/embryo/embryo_time.c
index be32be7a14..ac4a71754d 100644
--- a/src/lib/embryo/embryo_time.c
+++ b/src/lib/embryo/embryo_time.c
@@ -6,7 +6,7 @@
#include <time.h>
#ifdef _WIN32
-# include <Evil.h>
+# include <evil_private.h> /* setenv unsetenv */
#endif
#ifdef HAVE_EXOTIC
diff --git a/src/lib/eo/efl_object.eo b/src/lib/eo/efl_object.eo
index a63343ac9a..84a5558677 100644
--- a/src/lib/eo/efl_object.eo
+++ b/src/lib/eo/efl_object.eo
@@ -91,7 +91,7 @@ abstract Efl.Object
get {
}
values {
- parent: Efl.Object @nullable; [[The new parent.]]
+ parent: Efl.Object; [[The new parent.]]
}
}
@property name {
@@ -108,7 +108,7 @@ abstract Efl.Object
get {
}
values {
- name: string @nullable; [[The name.]]
+ name: string; [[The name.]]
}
}
@property comment {
@@ -123,7 +123,7 @@ abstract Efl.Object
get {
}
values {
- comment: string @nullable; [[The comment.]]
+ comment: string; [[The comment.]]
}
}
debug_name_override {
diff --git a/src/lib/eolian/Eolian.h b/src/lib/eolian/Eolian.h
index 3715ed1eaf..2f5346eb7b 100644
--- a/src/lib/eolian/Eolian.h
+++ b/src/lib/eolian/Eolian.h
@@ -1792,16 +1792,6 @@ EAPI const Eolian_Documentation *eolian_parameter_documentation_get(const Eolian
EAPI Eina_Bool eolian_parameter_is_nonull(const Eolian_Function_Parameter *param_desc);
/*
- * @brief Indicates if a parameter is nullable.
- *
- * @param[in] param_desc parameter handle
- * @return EINA_TRUE if nullable, EINA_FALSE otherwise
- *
- * @ingroup Eolian
- */
-EAPI Eina_Bool eolian_parameter_is_nullable(const Eolian_Function_Parameter *param_desc);
-
-/*
* @brief Indicates if a parameter is optional.
*
* @param[in] param_desc parameter handle
diff --git a/src/lib/eolian/database_function_parameter_api.c b/src/lib/eolian/database_function_parameter_api.c
index 87f1ed34c1..265c98ee1c 100644
--- a/src/lib/eolian/database_function_parameter_api.c
+++ b/src/lib/eolian/database_function_parameter_api.c
@@ -41,13 +41,6 @@ eolian_parameter_is_nonull(const Eolian_Function_Parameter *param)
}
EAPI Eina_Bool
-eolian_parameter_is_nullable(const Eolian_Function_Parameter *param)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(param, EINA_FALSE);
- return param->nullable;
-}
-
-EAPI Eina_Bool
eolian_parameter_is_optional(const Eolian_Function_Parameter *param)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(param, EINA_FALSE);
diff --git a/src/lib/eolian/eo_lexer.h b/src/lib/eolian/eo_lexer.h
index 4fec039de2..cc8fc9ce8b 100644
--- a/src/lib/eolian/eo_lexer.h
+++ b/src/lib/eolian/eo_lexer.h
@@ -21,7 +21,10 @@ enum Tokens
};
/* all keywords in eolian, they can still be used as names (they're TOK_VALUE)
- * they just fill in the "kw" field of the token */
+ * they just fill in the "kw" field of the token
+ *
+ * reserved for the future: @nullable
+ */
#define KEYWORDS KW(class), KW(const), KW(enum), KW(return), KW(struct), \
\
KW(abstract), KW(c_prefix), KW(composite), KW(constructor), KW(constructors), \
diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c
index 80d89e558b..3a75555fce 100644
--- a/src/lib/eolian/eo_parser.c
+++ b/src/lib/eolian/eo_parser.c
@@ -907,7 +907,7 @@ parse_param(Eo_Lexer *ls, Eina_List **params, Eina_Bool allow_inout,
Eina_Bool is_vals)
{
Eina_Bool has_nonull = EINA_FALSE, has_optional = EINA_FALSE,
- has_nullable = EINA_FALSE, has_owned = EINA_FALSE;
+ has_owned = EINA_FALSE;
Eina_Bool cref = (ls->t.kw == KW_at_cref);
Eolian_Function_Parameter *par = calloc(1, sizeof(Eolian_Function_Parameter));
par->param_dir = EOLIAN_IN_PARAM;
@@ -956,8 +956,6 @@ parse_param(Eo_Lexer *ls, Eina_List **params, Eina_Bool allow_inout,
for (;;) switch (ls->t.kw)
{
case KW_at_nonull:
- if (has_nullable)
- eo_lexer_syntax_error(ls, "both nullable and nonull specified");
CASE_LOCK(ls, nonull, "nonull qualifier")
par->nonull = EINA_TRUE;
eo_lexer_get(ls);
@@ -967,13 +965,6 @@ parse_param(Eo_Lexer *ls, Eina_List **params, Eina_Bool allow_inout,
par->optional = EINA_TRUE;
eo_lexer_get(ls);
break;
- case KW_at_nullable:
- if (has_nonull)
- eo_lexer_syntax_error(ls, "both nullable and nonull specified");
- CASE_LOCK(ls, nullable, "nullable qualifier");
- par->nullable = EINA_TRUE;
- eo_lexer_get(ls);
- break;
case KW_at_owned:
CASE_LOCK(ls, owned, "owned qualifier");
par->type->owned = EINA_TRUE;
diff --git a/src/lib/eolian/eolian_database.h b/src/lib/eolian/eolian_database.h
index f2dceba007..f51f4269c9 100644
--- a/src/lib/eolian/eolian_database.h
+++ b/src/lib/eolian/eolian_database.h
@@ -252,7 +252,6 @@ struct _Eolian_Function_Parameter
Eolian_Documentation *doc;
Eolian_Parameter_Dir param_dir;
Eina_Bool nonull :1; /* True if this argument cannot be NULL - deprecated */
- Eina_Bool nullable :1; /* True if this argument is nullable */
Eina_Bool optional :1; /* True if this argument is optional */
};
diff --git a/src/lib/ephysics/ephysics_private.h b/src/lib/ephysics/ephysics_private.h
index ded1d14011..26e3a4df13 100644
--- a/src/lib/ephysics/ephysics_private.h
+++ b/src/lib/ephysics/ephysics_private.h
@@ -1,10 +1,6 @@
#ifndef _EPHYSICS_PRIVATE_H
#define _EPHYSICS_PRIVATE_H
-#ifdef _WIN32
-# include <Evil.h>
-#endif
-
#pragma GCC diagnostic push
#pragma GCC system_header
diff --git a/src/lib/ethumb/ethumb.c b/src/lib/ethumb/ethumb.c
index e3afb74bc9..bbfe3a01c5 100644
--- a/src/lib/ethumb/ethumb.c
+++ b/src/lib/ethumb/ethumb.c
@@ -51,10 +51,6 @@
# define PATH_MAX 4096
#endif
-#ifdef _WIN32
-# include <Evil.h>
-#endif
-
#include <Eina.h>
#include <eina_safety_checks.h>
#include <Evas.h>
diff --git a/src/lib/evas/cache/evas_cache_image.c b/src/lib/evas/cache/evas_cache_image.c
index adc38a86ec..593f801efc 100644
--- a/src/lib/evas/cache/evas_cache_image.c
+++ b/src/lib/evas/cache/evas_cache_image.c
@@ -8,10 +8,6 @@
#include <sys/stat.h>
#include <errno.h>
-#ifdef _WIN32
-# include <Evil.h>
-#endif
-
#include "evas_common_private.h"
#include "evas_private.h"
diff --git a/src/lib/evas/cache/evas_preload.c b/src/lib/evas/cache/evas_preload.c
index 921b03c6f4..b2b2e98fad 100644
--- a/src/lib/evas/cache/evas_preload.c
+++ b/src/lib/evas/cache/evas_preload.c
@@ -1,9 +1,6 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
-#ifdef _WIN32
-# include <Evil.h>
-#endif
#ifdef __linux__
# include <sys/syscall.h>
#endif
diff --git a/src/lib/evas/canvas/efl_canvas_image_internal.eo b/src/lib/evas/canvas/efl_canvas_image_internal.eo
index c0b9093557..96ccc32d22 100644
--- a/src/lib/evas/canvas/efl_canvas_image_internal.eo
+++ b/src/lib/evas/canvas/efl_canvas_image_internal.eo
@@ -1,7 +1,7 @@
abstract @beta Efl.Canvas.Image_Internal extends Efl.Canvas.Object implements Efl.Canvas.Filter.Internal,
Efl.Gfx.Image, Efl.Gfx.Buffer,
Efl.Gfx.Fill, Efl.Gfx.View,
- Efl.Orientation, Efl.File_Save
+ Efl.Gfx.Orientable, Efl.File_Save
{
[[Efl canvas internal image class]]
data: Evas_Image_Data;
@@ -11,8 +11,7 @@ abstract @beta Efl.Canvas.Image_Internal extends Efl.Canvas.Object implements Ef
Efl.Object.finalize;
Efl.Object.debug_name_override;
Efl.File_Save.save;
- Efl.Orientation.orientation { get; set; }
- Efl.Orientation.flip { get; set; }
+ Efl.Gfx.Orientable.orientation { get; set; }
Efl.Gfx.Image.smooth_scale { get; set; }
Efl.Gfx.Image.ratio { get; }
Efl.Gfx.Image.border { get; set; }
diff --git a/src/lib/evas/canvas/evas_async_events.c b/src/lib/evas/canvas/evas_async_events.c
index c27c23b459..9e19c3d38d 100644
--- a/src/lib/evas/canvas/evas_async_events.c
+++ b/src/lib/evas/canvas/evas_async_events.c
@@ -7,7 +7,8 @@
#ifdef _WIN32
# include <winsock2.h>
-#endif /* ! _WIN32 */
+# include <evil_private.h> /* fcntl */
+#endif
#include <fcntl.h>
diff --git a/src/lib/evas/canvas/evas_font_dir.c b/src/lib/evas/canvas/evas_font_dir.c
index bee08dd143..3d4c7b9c5e 100644
--- a/src/lib/evas/canvas/evas_font_dir.c
+++ b/src/lib/evas/canvas/evas_font_dir.c
@@ -3,7 +3,7 @@
#endif
#ifdef _WIN32
-# include <Evil.h>
+# include <evil_private.h> /* evil_path_is_absolute */
#endif
#include <Eet.h>
diff --git a/src/lib/evas/canvas/evas_image_private.h b/src/lib/evas/canvas/evas_image_private.h
index 5a4f3771a2..e5b6805442 100644
--- a/src/lib/evas/canvas/evas_image_private.h
+++ b/src/lib/evas/canvas/evas_image_private.h
@@ -115,8 +115,7 @@ struct _Evas_Image_Data
Efl_Gfx_Image_Scale_Hint scale_hint;
Efl_Gfx_Image_Content_Hint content_hint;
- Efl_Flip flip_value;
- Efl_Orient orient_value;
+ Efl_Gfx_Orientation orient_value;
struct {
short w, h;
diff --git a/src/lib/evas/canvas/evas_main.c b/src/lib/evas/canvas/evas_main.c
index 029e8ee0d3..27f6a4af4f 100644
--- a/src/lib/evas/canvas/evas_main.c
+++ b/src/lib/evas/canvas/evas_main.c
@@ -10,6 +10,10 @@
#include "eo_internal.h"
+#ifdef _WIN32
+# include <evil_private.h> /* evil_init evil_shutdown */
+#endif
+
#include <Ecore.h>
#define EFL_INTERNAL_UNSTABLE
diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c
index dd8041b35a..788b96a48e 100644
--- a/src/lib/evas/canvas/evas_object_image.c
+++ b/src/lib/evas/canvas/evas_object_image.c
@@ -411,83 +411,41 @@ _evas_image_orientation_set(Eo *eo_obj, Evas_Image_Data *o, Evas_Image_Orient or
evas_object_change(eo_obj, obj);
}
-static Evas_Image_Orient
-_get_image_orient_from_orient_flip(Efl_Orient orient, Efl_Flip flip)
-{
- switch (orient)
- {
- case EFL_ORIENT_0:
- if (flip == EFL_FLIP_HORIZONTAL)
- return EVAS_IMAGE_FLIP_HORIZONTAL;
- else if (flip == EFL_FLIP_VERTICAL)
- return EVAS_IMAGE_FLIP_VERTICAL;
- else
- return EVAS_IMAGE_ORIENT_0;
-
- case EFL_ORIENT_90:
- if (flip == EFL_FLIP_HORIZONTAL)
- return EVAS_IMAGE_FLIP_TRANSPOSE;
- else if (flip == EFL_FLIP_VERTICAL)
- return EVAS_IMAGE_FLIP_TRANSVERSE;
- else
- return EVAS_IMAGE_ORIENT_90;
-
- case EFL_ORIENT_180:
- if (flip == EFL_FLIP_HORIZONTAL)
- return EVAS_IMAGE_FLIP_VERTICAL;
- else if (flip == EFL_FLIP_VERTICAL)
- return EVAS_IMAGE_FLIP_HORIZONTAL;
- else
- return EVAS_IMAGE_ORIENT_180;
-
- case EFL_ORIENT_270:
- if (flip == EFL_FLIP_HORIZONTAL)
- return EVAS_IMAGE_FLIP_TRANSVERSE;
- else if (flip == EFL_FLIP_VERTICAL)
- return EVAS_IMAGE_FLIP_TRANSPOSE;
- else
- return EVAS_IMAGE_ORIENT_270;
-
- default:
- return EVAS_IMAGE_ORIENT_NONE;
- }
-}
-
EOLIAN static void
-_efl_canvas_image_internal_efl_orientation_orientation_set(Eo *obj, Evas_Image_Data *o, Efl_Orient dir)
-{
- Evas_Image_Orient orient;
-
- o->orient_value = dir;
- orient = _get_image_orient_from_orient_flip(dir, o->flip_value);
+_efl_canvas_image_internal_efl_gfx_orientable_orientation_set(Eo *obj, Evas_Image_Data *o, Efl_Gfx_Orientation efl_orient)
+{
+ // This array takes an Efl_Gfx_Orientation and turns it into an Elm_Image_Orient
+ static const Evas_Image_Orient evas_orient[16] = {
+ EVAS_IMAGE_ORIENT_NONE, // EFL_GFX_ORIENTATION_NONE
+ EVAS_IMAGE_ORIENT_90, // EFL_GFX_ORIENTATION_RIGHT
+ EVAS_IMAGE_ORIENT_180, // EFL_GFX_ORIENTATION_DOWN
+ EVAS_IMAGE_ORIENT_270, // EFL_GFX_ORIENTATION_LEFT
+ EVAS_IMAGE_FLIP_HORIZONTAL, // EFL_GFX_ORIENTATION_NONE + FLIP_HOR
+ EVAS_IMAGE_FLIP_TRANSPOSE, // EFL_GFX_ORIENTATION_RIGHT + FLIP_HOR
+ EVAS_IMAGE_FLIP_VERTICAL, // EFL_GFX_ORIENTATION_DOWN + FLIP_HOR
+ EVAS_IMAGE_FLIP_TRANSVERSE, // EFL_GFX_ORIENTATION_LEFT + FLIP_HOR
+ EVAS_IMAGE_FLIP_VERTICAL, // EFL_GFX_ORIENTATION_NONE + FLIP_VER
+ EVAS_IMAGE_FLIP_TRANSVERSE, // EFL_GFX_ORIENTATION_RIGHT + FLIP_VER
+ EVAS_IMAGE_FLIP_HORIZONTAL, // EFL_GFX_ORIENTATION_DOWN + FLIP_VER
+ EVAS_IMAGE_FLIP_TRANSPOSE, // EFL_GFX_ORIENTATION_LEFT + FLIP_VER
+ EVAS_IMAGE_ORIENT_180, // EFL_GFX_ORIENTATION_NONE + FLIP_HOR + FLIP_VER
+ EVAS_IMAGE_ORIENT_270, // EFL_GFX_ORIENTATION_RIGHT + FLIP_HOR + FLIP_VER
+ EVAS_IMAGE_ORIENT_0, // EFL_GFX_ORIENTATION_DOWN + FLIP_HOR + FLIP_VER
+ EVAS_IMAGE_ORIENT_90 // EFL_GFX_ORIENTATION_LEFT + FLIP_HOR + FLIP_VER
+ };
+ EINA_SAFETY_ON_FALSE_RETURN(efl_orient >= 0 && efl_orient < 16);
- _evas_image_orientation_set(obj, o, orient);
+ o->orient_value = efl_orient;
+ _evas_image_orientation_set(obj, o, evas_orient[efl_orient]);
}
-EOLIAN static Efl_Orient
-_efl_canvas_image_internal_efl_orientation_orientation_get(const Eo *obj EINA_UNUSED, Evas_Image_Data *o)
+EOLIAN static Efl_Gfx_Orientation
+_efl_canvas_image_internal_efl_gfx_orientable_orientation_get(const Eo *obj EINA_UNUSED, Evas_Image_Data *o)
{
return o->orient_value;
}
EOLIAN static void
-_efl_canvas_image_internal_efl_orientation_flip_set(Eo *obj, Evas_Image_Data *o, Efl_Flip flip)
-{
- Evas_Image_Orient orient;
-
- o->flip_value = flip;
- orient = _get_image_orient_from_orient_flip(o->orient_value, flip);
-
- _evas_image_orientation_set(obj, o, orient);
-}
-
-EOLIAN static Efl_Flip
-_efl_canvas_image_internal_efl_orientation_flip_get(const Eo *obj EINA_UNUSED, Evas_Image_Data *o)
-{
- return o->flip_value;
-}
-
-EOLIAN static void
_efl_canvas_image_internal_efl_object_dbg_info_get(Eo *eo_obj, Evas_Image_Data *o, Efl_Dbg_Info *root)
{
efl_dbg_info_get(efl_super(eo_obj, MY_CLASS), root);
diff --git a/src/lib/evas/common/evas_image_scalecache.c b/src/lib/evas/common/evas_image_scalecache.c
index 5bf8e892da..5ca64b1897 100644
--- a/src/lib/evas/common/evas_image_scalecache.c
+++ b/src/lib/evas/common/evas_image_scalecache.c
@@ -3,7 +3,7 @@
#endif
#ifdef _WIN32
-# include <Evil.h>
+# include <windows.h>
#endif
#include <assert.h>
@@ -32,7 +32,7 @@ struct _ScaleitemKey
int src_x, src_y;
unsigned int src_w, src_h;
unsigned int dst_w, dst_h;
- Eina_Bool smooth : 1;
+ Eina_Bool smooth : 1;
};
struct _Scaleitem
diff --git a/src/lib/evas/common/evas_scale_sample.c b/src/lib/evas/common/evas_scale_sample.c
index d043ba3414..c201dfb292 100644
--- a/src/lib/evas/common/evas_scale_sample.c
+++ b/src/lib/evas/common/evas_scale_sample.c
@@ -100,31 +100,37 @@ static void
_evas_common_scale_rgba_sample_scale_nomask(int y,
int dst_clip_w, int dst_clip_h, int dst_w,
DATA32 **row_ptr, int *lin_ptr,
- DATA32 *dptr, RGBA_Gfx_Func func, unsigned int mul_col)
+ DATA32 *dptr, RGBA_Gfx_Func func, unsigned int mul_col,
+ DATA32 *srcptr, int src_w)
{
- DATA32 *buf, *dst_ptr;
+ DATA32 *buf;
int x;
/* a scanline buffer */
- buf = alloca(dst_clip_w * sizeof(DATA32));
+ if (!srcptr)
+ buf = alloca(dst_clip_w * sizeof(DATA32));
dptr = dptr + dst_w * y;
for (; y < dst_clip_h; y++)
{
- dst_ptr = buf;
- for (x = 0; x < dst_clip_w; x++)
+ if (!srcptr)
{
- DATA32 *ptr;
+ DATA32 *dst_ptr = buf;
+ for (x = 0; x < dst_clip_w; x++)
+ {
+ DATA32 *ptr;
- ptr = row_ptr[y] + lin_ptr[x];
- *dst_ptr = *ptr;
- dst_ptr++;
+ ptr = row_ptr[y] + lin_ptr[x];
+ *dst_ptr = *ptr;
+ dst_ptr++;
+ }
}
/* * blend here [clip_w *] buf -> dptr * */
- func(buf, NULL, mul_col, dptr, dst_clip_w);
+ func(srcptr ?: buf, NULL, mul_col, dptr, dst_clip_w);
dptr += dst_w;
+ if (srcptr) srcptr += src_w;
}
}
@@ -135,9 +141,10 @@ _evas_common_scale_rgba_sample_scale_mask(int y,
int mask_x, int mask_y,
DATA32 **row_ptr, int *lin_ptr, RGBA_Image *mask_ie,
DATA32 *dptr, RGBA_Gfx_Func func, RGBA_Gfx_Func func2,
- unsigned int mul_col)
+ unsigned int mul_col,
+ DATA32 *srcptr, int src_w)
{
- DATA32 *buf, *dst_ptr;
+ DATA32 *buf;
int x;
/* clamp/map to mask geometry */
@@ -158,25 +165,34 @@ _evas_common_scale_rgba_sample_scale_mask(int y,
{
DATA8 *mask;
- dst_ptr = buf;
mask = mask_ie->image.data8
+ ((dst_clip_y - mask_y + y) * mask_ie->cache_entry.w)
+ (dst_clip_x - mask_x);
- for (x = 0; x < dst_clip_w; x++)
+ if (!srcptr)
{
- DATA32 *ptr;
+ DATA32 *dst_ptr = buf;
+ for (x = 0; x < dst_clip_w; x++)
+ {
+ DATA32 *ptr;
- ptr = row_ptr[y] + lin_ptr[x];
- *dst_ptr = *ptr;
- dst_ptr++;
+ ptr = row_ptr[y] + lin_ptr[x];
+ *dst_ptr = *ptr;
+ dst_ptr++;
+ }
}
/* * blend here [clip_w *] buf -> dptr * */
- if (mul_col != 0xFFFFFFFF) func2(buf, NULL, mul_col, buf, dst_clip_w);
- func(buf, mask, 0, dptr, dst_clip_w);
+ if (mul_col != 0xFFFFFFFF)
+ {
+ func2(srcptr ?: buf, NULL, mul_col, buf, dst_clip_w);
+ func(buf, mask, 0, dptr, dst_clip_w);
+ }
+ else
+ func(srcptr ?: buf, mask, 0, dptr, dst_clip_w);
dptr += dst_w;
+ if (srcptr) srcptr += src_w;
}
}
@@ -185,10 +201,8 @@ evas_common_scale_rgba_sample_draw(RGBA_Image *src, RGBA_Image *dst, int dst_cli
{
int x, y;
int *lin_ptr;
- DATA32 *buf, *dptr;
DATA32 **row_ptr;
DATA32 *ptr, *dst_ptr, *src_data, *dst_data;
- DATA8 *mask;
int src_w, src_h, dst_w, dst_h;
RGBA_Gfx_Func func, func2 = NULL;
@@ -337,58 +351,28 @@ evas_common_scale_rgba_sample_draw(RGBA_Image *src, RGBA_Image *dst, int dst_cli
}
else
func = evas_common_gfx_func_composite_pixel_mask_span_get(src->cache_entry.flags.alpha, src->cache_entry.flags.alpha_sparse, dst->cache_entry.flags.alpha, dst_clip_w, render_op);
-
- /* clamp/map to mask geometry */
- if (EINA_UNLIKELY(dst_clip_x < mask_x))
- dst_clip_x = mask_x;
- if (EINA_UNLIKELY(dst_clip_y < mask_y))
- dst_clip_y = mask_y;
- if (EINA_UNLIKELY(dst_clip_x + dst_clip_w > mask_x + (int)mask_ie->cache_entry.w))
- dst_clip_w = mask_x + mask_ie->cache_entry.w - dst_clip_x;
- if (EINA_UNLIKELY(dst_clip_y + dst_clip_h > mask_y + (int)mask_ie->cache_entry.h))
- dst_clip_h = mask_y + mask_ie->cache_entry.h - dst_clip_y;
}
if ((dst_region_w == src_region_w) && (dst_region_h == src_region_h))
{
ptr = src_data + (((dst_clip_y - dst_region_y) + src_region_y) * src_w) + ((dst_clip_x - dst_region_x) + src_region_x);
- /* image masking */
- if (mask_ie)
- {
- if (mul_col != 0xffffffff)
- buf = alloca(dst_clip_w * sizeof(DATA32));
- for (y = 0; y < dst_clip_h; y++)
- {
- mask = mask_ie->image.data8
- + ((dst_clip_y - mask_y + y) * mask_ie->cache_entry.w)
- + (dst_clip_x - mask_x);
-
- /* * blend here [clip_w *] ptr -> dst_ptr * */
- if (mul_col != 0xffffffff)
- {
- func2(ptr, NULL, mul_col, buf, dst_clip_w);
- func(buf, mask, 0, dst_ptr, dst_clip_w);
- }
- else
- func(ptr, mask, 0, dst_ptr, dst_clip_w);
-
- ptr += src_w;
- dst_ptr += dst_w;
- }
- }
+ if (mask_ie)
+ _evas_common_scale_rgba_sample_scale_mask(0,
+ dst_clip_x, dst_clip_y, dst_clip_w, dst_clip_h,
+ dst_w, mask_x, mask_y,
+ NULL, NULL,
+ mask_ie, dst_ptr,
+ func, func2, mul_col,
+ ptr, src_w);
else
- {
- for (y = 0; y < dst_clip_h; y++)
- {
- /* * blend here [clip_w *] ptr -> dst_ptr * */
- func(ptr, NULL, mul_col, dst_ptr, dst_clip_w);
-
- ptr += src_w;
- dst_ptr += dst_w;
- }
- }
+ _evas_common_scale_rgba_sample_scale_nomask(0,
+ dst_clip_w, dst_clip_h, dst_w,
+ NULL, NULL,
+ dst_ptr,
+ func, mul_col,
+ ptr, src_w);
}
else
{
@@ -403,56 +387,21 @@ evas_common_scale_rgba_sample_draw(RGBA_Image *src, RGBA_Image *dst, int dst_cli
row_ptr[y] = src_data + (((((y + dst_clip_y - dst_region_y) * src_region_h) / dst_region_h)
+ src_region_y) * src_w);
- /* scale to dst */
- dptr = dst_ptr;
-
- /* a scanline buffer */
- buf = alloca(dst_clip_w * sizeof(DATA32));
-
- /* image masking */
if (mask_ie)
- {
- for (y = 0; y < dst_clip_h; y++)
- {
- dst_ptr = buf;
- mask = mask_ie->image.data8
- + ((dst_clip_y - mask_y + y) * mask_ie->cache_entry.w)
- + (dst_clip_x - mask_x);
-
- for (x = 0; x < dst_clip_w; x++)
- {
- ptr = row_ptr[y] + lin_ptr[x];
- *dst_ptr = *ptr;
- dst_ptr++;
- }
-
- /* * blend here [clip_w *] buf -> dptr * */
- if (mul_col != 0xffffffff)
- func2(buf, NULL, mul_col, buf, dst_clip_w);
- func(buf, mask, 0, dptr, dst_clip_w);
-
- dptr += dst_w;
- }
- }
+ _evas_common_scale_rgba_sample_scale_mask(0,
+ dst_clip_x, dst_clip_y, dst_clip_w, dst_clip_h,
+ dst_w, mask_x, mask_y,
+ row_ptr, lin_ptr,
+ mask_ie, dst_ptr,
+ func, func2, mul_col,
+ NULL, 0);
else
- {
- for (y = 0; y < dst_clip_h; y++)
- {
- dst_ptr = buf;
-
- for (x = 0; x < dst_clip_w; x++)
- {
- ptr = row_ptr[y] + lin_ptr[x];
- *dst_ptr = *ptr;
- dst_ptr++;
- }
-
- /* * blend here [clip_w *] buf -> dptr * */
- func(buf, NULL, mul_col, dptr, dst_clip_w);
-
- dptr += dst_w;
- }
- }
+ _evas_common_scale_rgba_sample_scale_nomask(0,
+ dst_clip_w, dst_clip_h, dst_w,
+ row_ptr, lin_ptr,
+ dst_ptr,
+ func, mul_col,
+ NULL, 0);
}
}
@@ -466,10 +415,9 @@ scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst,
{
int x, y;
int *lin_ptr;
- DATA32 *buf = NULL, *dptr;
+ DATA32 *dptr;
DATA32 **row_ptr;
DATA32 *ptr, *dst_ptr, *src_data, *dst_data;
- DATA8 *mask;
int dst_clip_x, dst_clip_y, dst_clip_w, dst_clip_h;
int src_w, src_h, dst_w, dst_h, mask_x, mask_y;
RGBA_Gfx_Func func, func2 = NULL;
@@ -614,15 +562,6 @@ scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst,
func = evas_common_gfx_func_composite_pixel_mask_span_get(src->cache_entry.flags.alpha, src->cache_entry.flags.alpha_sparse, dst->cache_entry.flags.alpha, dst_clip_w, dc->render_op);
if (dc->mul.use)
func2 = evas_common_gfx_func_composite_pixel_color_span_get(src->cache_entry.flags.alpha, src->cache_entry.flags.alpha_sparse, dc->mul.col, dst->cache_entry.flags.alpha, dst_clip_w, EVAS_RENDER_COPY);
- /* clamp/map to mask geometry */
- if (EINA_UNLIKELY(dst_clip_x < mask_x))
- dst_clip_x = mask_x;
- if (EINA_UNLIKELY(dst_clip_y < mask_y))
- dst_clip_y = mask_y;
- if (EINA_UNLIKELY(dst_clip_x + dst_clip_w > mask_x + (int)mask_ie->cache_entry.w))
- dst_clip_w = mask_x + mask_ie->cache_entry.w - dst_clip_x;
- if (EINA_UNLIKELY(dst_clip_y + dst_clip_h > mask_y + (int)mask_ie->cache_entry.h))
- dst_clip_h = mask_y + mask_ie->cache_entry.h - dst_clip_y;
}
if ((dst_region_w == src_region_w) && (dst_region_h == src_region_h))
@@ -651,44 +590,24 @@ scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst,
# endif
#endif
{
+ int mul_col = dc->mul.use ? dc->mul.col : 0xffffffff;
ptr = src_data + ((dst_clip_y - dst_region_y + src_region_y) * src_w) + (dst_clip_x - dst_region_x) + src_region_x;
- /* image masking */
if (mask_ie)
- {
- if (dc->mul.use)
- buf = alloca(dst_clip_w * sizeof(DATA32));
-
- for (y = 0; y < dst_clip_h; y++)
- {
- mask = mask_ie->image.data8
- + ((dst_clip_y - mask_y + y) * mask_ie->cache_entry.w)
- + (dst_clip_x - mask_x);
-
- /* * blend here [clip_w *] ptr -> dst_ptr * */
- if (dc->mul.use)
- {
- func2(ptr, NULL, dc->mul.col, buf, dst_clip_w);
- func(buf, mask, 0, dst_ptr, dst_clip_w);
- }
- else
- func(ptr, mask, 0, dst_ptr, dst_clip_w);
-
- ptr += src_w;
- dst_ptr += dst_w;
- }
- }
+ _evas_common_scale_rgba_sample_scale_mask(0,
+ dst_clip_x, dst_clip_y, dst_clip_w, dst_clip_h,
+ dst_w, mask_x, mask_y,
+ NULL, NULL,
+ mask_ie, dst_ptr,
+ func, func2, mul_col,
+ ptr, src_w);
else
- {
- for (y = 0; y < dst_clip_h; y++)
- {
- /* * blend here [clip_w *] ptr -> dst_ptr * */
- func(ptr, NULL, dc->mul.col, dst_ptr, dst_clip_w);
-
- ptr += src_w;
- dst_ptr += dst_w;
- }
- }
+ _evas_common_scale_rgba_sample_scale_nomask(0,
+ dst_clip_w, dst_clip_h, dst_w,
+ NULL, NULL,
+ dst_ptr,
+ func, mul_col,
+ ptr, src_w);
}
}
else
@@ -767,7 +686,8 @@ scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst,
dst_clip_w, dst_clip_h >> 1, dst_w,
dc->clip.mask_x, dc->clip.mask_y,
row_ptr, lin_ptr, dc->clip.mask,
- dptr, func, func2, mul_col);
+ dptr, func, func2, mul_col,
+ NULL, 0);
}
else
@@ -775,7 +695,8 @@ scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst,
_evas_common_scale_rgba_sample_scale_nomask(0,
dst_clip_w, dst_clip_h >> 1, dst_w,
row_ptr, lin_ptr,
- dptr, func, mul_col);
+ dptr, func, mul_col,
+ NULL, 0);
}
msg = eina_thread_queue_wait(main_queue, &ref);
@@ -793,7 +714,8 @@ scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst,
dst_clip_w, dst_clip_h, dst_w,
dc->clip.mask_x, dc->clip.mask_y,
row_ptr, lin_ptr, dc->clip.mask,
- dptr, func, func2, mul_col);
+ dptr, func, func2, mul_col,
+ NULL, 0);
}
else
@@ -801,7 +723,8 @@ scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst,
_evas_common_scale_rgba_sample_scale_nomask(0,
dst_clip_w, dst_clip_h, dst_w,
row_ptr, lin_ptr,
- dptr, func, mul_col);
+ dptr, func, mul_col,
+ NULL, 0);
}
}
}
@@ -844,13 +767,15 @@ _evas_common_scale_sample_thread(void *data EINA_UNUSED,
todo->mask_x, todo->mask_y,
todo->row_ptr, todo->lin_ptr, todo->mask8,
todo->dptr, todo->func, todo->func2,
- todo->mul_col);
+ todo->mul_col,
+ NULL, 0);
else
_evas_common_scale_rgba_sample_scale_nomask(h,
todo->dst_clip_w, todo->dst_clip_h,
todo->dst_w,
todo->row_ptr, todo->lin_ptr,
- todo->dptr, todo->func, todo->mul_col);
+ todo->dptr, todo->func, todo->mul_col,
+ NULL, 0);
}
end:
diff --git a/src/lib/evas/common/language/evas_language_utils.c b/src/lib/evas/common/language/evas_language_utils.c
index 5a8e173e5f..4862a1e913 100644
--- a/src/lib/evas/common/language/evas_language_utils.c
+++ b/src/lib/evas/common/language/evas_language_utils.c
@@ -29,10 +29,6 @@
# define dgettext(domain, x) (x)
#endif
-#ifdef _WIN32
-# include <Evil.h>
-#endif
-
#include <Eina.h>
#include "evas_language_utils.h"
diff --git a/src/lib/evas/file/evas_path.c b/src/lib/evas/file/evas_path.c
index 19eabe4835..ef3d439018 100644
--- a/src/lib/evas/file/evas_path.c
+++ b/src/lib/evas/file/evas_path.c
@@ -17,7 +17,7 @@
#include <sys/param.h>
#ifdef _WIN32
-# include <Evil.h>
+# include <evil_private.h> /* evil_path_is_absolute */
#endif
#include "evas_common_private.h"
diff --git a/src/lib/evas/gesture/meson.build b/src/lib/evas/gesture/meson.build
index 04cb753fcd..9854e6f94d 100644
--- a/src/lib/evas/gesture/meson.build
+++ b/src/lib/evas/gesture/meson.build
@@ -21,6 +21,7 @@ pub_eo_files = [
]
evas_gesture_eo_files = pub_eo_files
+pub_evas_eo_files += files(pub_eo_files)
foreach eo_file : pub_eo_files
pub_eo_file_target += custom_target('eolian_gen_' + eo_file,
@@ -29,7 +30,7 @@ foreach eo_file : pub_eo_files
depfile : eo_file + '.d',
install : true,
install_dir : join_paths(dir_package_include, 'gesture'),
- command : eolian_gen + [ '-I', meson.current_source_dir(), eolian_include_directories,
+ command : eolian_gen + ['-I', meson.current_source_dir(), eolian_include_directories,
'-o', 'h:' + join_paths(meson.current_build_dir(), eo_file + '.h'),
'-o', 'c:' + join_paths(meson.current_build_dir(), eo_file + '.c'),
'-o', 'd:' + join_paths(meson.current_build_dir(), eo_file + '.d'),
diff --git a/src/lib/evas/include/evas_common_private.h b/src/lib/evas/include/evas_common_private.h
index 53c9fef2ec..825d83ab77 100644
--- a/src/lib/evas/include/evas_common_private.h
+++ b/src/lib/evas/include/evas_common_private.h
@@ -24,10 +24,6 @@
#include <stdint.h>
#include <unistd.h>
-#ifdef _WIN32
-# include <Evil.h>
-#endif
-
#ifdef HAVE_ESCAPE
# include <Escape.h>
#endif
diff --git a/src/modules/evas/engines/software_generic/evas_engine.c b/src/modules/evas/engines/software_generic/evas_engine.c
index 79f9a7b95b..6ae8224e47 100644
--- a/src/modules/evas/engines/software_generic/evas_engine.c
+++ b/src/modules/evas/engines/software_generic/evas_engine.c
@@ -14,6 +14,10 @@
# include <dlfcn.h> /* dlopen,dlclose,etc */
#endif
+#ifdef _WIN32
+# include <evil_private.h> /* dlsym */
+#endif
+
#if defined HAVE_DLSYM
# define EVAS_GL 1
# define EVAS_GL_NO_GL_H_CHECK 1
diff --git a/src/modules/evas/engines/software_generic/evas_native_dmabuf.c b/src/modules/evas/engines/software_generic/evas_native_dmabuf.c
index 6033c1c95b..c71e1b2276 100644
--- a/src/modules/evas/engines/software_generic/evas_native_dmabuf.c
+++ b/src/modules/evas/engines/software_generic/evas_native_dmabuf.c
@@ -4,6 +4,8 @@
#if defined HAVE_DLSYM && ! defined _WIN32
# include <dlfcn.h> /* dlopen,dlclose,etc */
+#elif _WIN32
+# include <evil_private.h> /* dlopen dlclose dlsym */
#else
# warning native_dmabuf should not get compiled if dlsym is not found on the system!
#endif
diff --git a/src/modules/evas/engines/software_generic/evas_native_tbm.c b/src/modules/evas/engines/software_generic/evas_native_tbm.c
index 696a728824..2827e80d02 100644
--- a/src/modules/evas/engines/software_generic/evas_native_tbm.c
+++ b/src/modules/evas/engines/software_generic/evas_native_tbm.c
@@ -4,6 +4,8 @@
#if defined HAVE_DLSYM && ! defined _WIN32
# include <dlfcn.h> /* dlopen,dlclose,etc */
+#elif _WIN32
+# include <evil_private.h> /* dlopen dlclose dlsym */
#else
# warning native_tbm should not get compiled if dlsym is not found on the system!
#endif
diff --git a/src/modules/evas/image_loaders/bmp/evas_image_load_bmp.c b/src/modules/evas/image_loaders/bmp/evas_image_load_bmp.c
index a003a92687..43dac5b06c 100644
--- a/src/modules/evas/image_loaders/bmp/evas_image_load_bmp.c
+++ b/src/modules/evas/image_loaders/bmp/evas_image_load_bmp.c
@@ -4,10 +4,6 @@
#include <stdio.h>
-#ifdef _WIN32
-# include <Evil.h>
-#endif
-
#include <math.h>
#include "evas_common_private.h"
diff --git a/src/modules/evas/image_loaders/generic/evas_image_load_generic.c b/src/modules/evas/image_loaders/generic/evas_image_load_generic.c
index 594c6b66a7..ec4917ffc0 100644
--- a/src/modules/evas/image_loaders/generic/evas_image_load_generic.c
+++ b/src/modules/evas/image_loaders/generic/evas_image_load_generic.c
@@ -2,10 +2,6 @@
# include "config.h"
#endif
-#ifdef _WIN32
-# include <Evil.h>
-#endif
-
#include "evas_common_private.h"
#include "evas_private.h"
diff --git a/src/modules/evas/image_loaders/ico/evas_image_load_ico.c b/src/modules/evas/image_loaders/ico/evas_image_load_ico.c
index 53ce8e83c2..520ef06aa8 100644
--- a/src/modules/evas/image_loaders/ico/evas_image_load_ico.c
+++ b/src/modules/evas/image_loaders/ico/evas_image_load_ico.c
@@ -4,10 +4,6 @@
#include <stdio.h>
-#ifdef _WIN32
-# include <Evil.h>
-#endif
-
#include "evas_common_private.h"
#include "evas_private.h"
diff --git a/src/modules/evas/image_loaders/jp2k/evas_image_load_jp2k.c b/src/modules/evas/image_loaders/jp2k/evas_image_load_jp2k.c
index 6b9e4ecc31..dd9af05acf 100644
--- a/src/modules/evas/image_loaders/jp2k/evas_image_load_jp2k.c
+++ b/src/modules/evas/image_loaders/jp2k/evas_image_load_jp2k.c
@@ -4,10 +4,6 @@
#include <stdio.h>
-#ifdef _WIN32
-# include <Evil.h>
-#endif
-
#include <openjpeg.h>
#include "Evas_Loader.h"
diff --git a/src/modules/evas/image_loaders/pmaps/evas_image_load_pmaps.c b/src/modules/evas/image_loaders/pmaps/evas_image_load_pmaps.c
index f70606a307..b9c383c90b 100644
--- a/src/modules/evas/image_loaders/pmaps/evas_image_load_pmaps.c
+++ b/src/modules/evas/image_loaders/pmaps/evas_image_load_pmaps.c
@@ -2,10 +2,6 @@
# include <config.h>
#endif
-#ifdef _WIN32
-# include <Evil.h>
-#endif
-
#include "evas_common_private.h"
#include "evas_private.h"
diff --git a/src/modules/evas/image_loaders/png/evas_image_load_png.c b/src/modules/evas/image_loaders/png/evas_image_load_png.c
index 2cc0f52242..087c908b63 100644
--- a/src/modules/evas/image_loaders/png/evas_image_load_png.c
+++ b/src/modules/evas/image_loaders/png/evas_image_load_png.c
@@ -6,10 +6,6 @@
#include <png.h>
#include <setjmp.h>
-#ifdef _WIN32
-# include <Evil.h>
-#endif
-
#include "evas_common_private.h"
#include "evas_private.h"
diff --git a/src/modules/evas/image_loaders/psd/evas_image_load_psd.c b/src/modules/evas/image_loaders/psd/evas_image_load_psd.c
index c1306b1d70..d8f15b3dd9 100644
--- a/src/modules/evas/image_loaders/psd/evas_image_load_psd.c
+++ b/src/modules/evas/image_loaders/psd/evas_image_load_psd.c
@@ -19,10 +19,6 @@
# include <netinet/in.h>
#endif
-#ifdef _WIN32
-# include <Evil.h>
-#endif
-
#include "evas_common_private.h"
#include "evas_private.h"
diff --git a/src/modules/evas/image_loaders/tga/evas_image_load_tga.c b/src/modules/evas/image_loaders/tga/evas_image_load_tga.c
index a62c9f0826..344c363ed2 100644
--- a/src/modules/evas/image_loaders/tga/evas_image_load_tga.c
+++ b/src/modules/evas/image_loaders/tga/evas_image_load_tga.c
@@ -6,10 +6,6 @@
#include <sys/types.h>
#include <fcntl.h>
-#ifdef _WIN32
-# include <Evil.h>
-#endif
-
#include "evas_common_private.h"
#include "evas_private.h"
diff --git a/src/modules/evas/image_loaders/tiff/evas_image_load_tiff.c b/src/modules/evas/image_loaders/tiff/evas_image_load_tiff.c
index d7e564d75c..e07206b51e 100644
--- a/src/modules/evas/image_loaders/tiff/evas_image_load_tiff.c
+++ b/src/modules/evas/image_loaders/tiff/evas_image_load_tiff.c
@@ -7,10 +7,6 @@
#include <unistd.h>
#include <tiffio.h>
-#ifdef _WIN32
-# include <Evil.h>
-#endif
-
#include "evas_common_private.h"
#include "evas_private.h"
diff --git a/src/modules/evas/image_loaders/wbmp/evas_image_load_wbmp.c b/src/modules/evas/image_loaders/wbmp/evas_image_load_wbmp.c
index 4a3ae77a32..af539a041b 100644
--- a/src/modules/evas/image_loaders/wbmp/evas_image_load_wbmp.c
+++ b/src/modules/evas/image_loaders/wbmp/evas_image_load_wbmp.c
@@ -4,10 +4,6 @@
#include <stdio.h>
-#ifdef _WIN32
-# include <Evil.h>
-#endif
-
#include "evas_common_private.h"
#include "evas_private.h"
diff --git a/src/modules/evas/image_loaders/webp/evas_image_load_webp.c b/src/modules/evas/image_loaders/webp/evas_image_load_webp.c
index aa0a6ca9d1..e3f97bb77a 100644
--- a/src/modules/evas/image_loaders/webp/evas_image_load_webp.c
+++ b/src/modules/evas/image_loaders/webp/evas_image_load_webp.c
@@ -6,10 +6,6 @@
#include <string.h>
#include <webp/decode.h>
-#ifdef _WIN32
-# include <Evil.h>
-#endif
-
#include "evas_common_private.h"
#include "evas_private.h"
diff --git a/src/modules/evas/image_loaders/xpm/evas_image_load_xpm.c b/src/modules/evas/image_loaders/xpm/evas_image_load_xpm.c
index 0fa150dd5d..4bf08b5a8d 100644
--- a/src/modules/evas/image_loaders/xpm/evas_image_load_xpm.c
+++ b/src/modules/evas/image_loaders/xpm/evas_image_load_xpm.c
@@ -2,10 +2,6 @@
# include <config.h>
#endif
-#ifdef _WIN32
-# include <Evil.h>
-#endif
-
#include "evas_common_private.h"
#include "evas_private.h"
diff --git a/src/modules/evas/image_savers/png/evas_image_save_png.c b/src/modules/evas/image_savers/png/evas_image_save_png.c
index bd6b5c31a1..1aeec12c8a 100644
--- a/src/modules/evas/image_savers/png/evas_image_save_png.c
+++ b/src/modules/evas/image_savers/png/evas_image_save_png.c
@@ -6,10 +6,6 @@
#include <png.h>
#include <setjmp.h>
-#ifdef _WIN32
-# include <Evil.h>
-#endif
-
#include "evas_common_private.h"
#include "evas_private.h"
diff --git a/src/scripts/elua/apps/README-docgen.md b/src/scripts/elua/apps/README-docgen.md
deleted file mode 100644
index 9b501ddfc2..0000000000
--- a/src/scripts/elua/apps/README-docgen.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# docgen
-
-This is the upcoming documentation generator for EFL. It takes documentation
-described in Eo files and turns it into a DokuWiki structure (with possibility
-of adapting it to other systems later on).
-
-Use the supplied build.sh script to generate. By default, it assumes that a
-directory called "dokuwiki" is present in the current directory, so symlink
-your dokuwiki setup into it (or change the path).
diff --git a/src/scripts/elua/apps/docgen/doctree.lua b/src/scripts/elua/apps/docgen/doctree.lua
deleted file mode 100644
index 45171ca255..0000000000
--- a/src/scripts/elua/apps/docgen/doctree.lua
+++ /dev/null
@@ -1,1427 +0,0 @@
-local util = require("util")
-
-local eolian = require("eolian")
-
-local keyref = require("docgen.keyref")
-local dutil = require("docgen.util")
-
--- writer has to be loaded late to prevent cycles
-local writer
-
-local M = {}
-local eos = eolian:new()
-
-local get_cache = function(o, nm)
- local ret = o[nm]
- if not ret then
- ret = {}
- o[nm] = ret
- return ret, false
- end
- return ret, true
-end
-
-local matches_filter = function(obj)
- local ns = obj:nspaces_get()
- if #ns and (ns[1] == "efl" or ns[1] == "eina") then
- return true
- end
-
- return false
-end
-
-M.Node = util.Object:clone {
- scope = {
- UNKNOWN = eolian.object_scope.UNKNOWN,
- PUBLIC = eolian.object_scope.PUBLIC,
- PRIVATE = eolian.object_scope.PRIVATE,
- PROTECTED = eolian.object_scope.PROTECTED
- },
-
- __ctor = function(self, obj)
- self._obj = obj
- assert(self._obj)
- end,
-
- name_get = function(self)
- return self._obj:name_get()
- end,
-
- short_name_get = function(self)
- return self._obj:short_name_get()
- end,
-
- namespaces_get = function(self)
- return self._obj:namespaces_get():to_array()
- end,
-
- nspaces_get = function(self, root)
- local tbl = self:namespaces_get()
- -- temporary workaround
- if type(tbl) ~= "table" then
- tbl = tbl:to_array()
- end
- for i = 1, #tbl do
- tbl[i] = tbl[i]:lower()
- end
-
- tbl[#tbl + 1] = self:short_name_get():lower()
- if root ~= nil then
- tbl[#tbl + 1] = not not root
- end
- return tbl
- end
-}
-local Node = M.Node
-
-local gen_doc_refd = function(str)
- if not writer then
- writer = require("docgen.writer")
- end
- if not str then
- return nil
- end
- local pars = eolian.documentation_string_split(str)
- for i = 1, #pars do
- pars[i] = writer.Buffer():write_par(pars[i]):finish()
- end
- return table.concat(pars, "\n\n")
-end
-
-local add_since = function(str, since)
- if not writer then
- writer = require("docgen.writer")
- end
- if not since then
- return str
- end
- local buf = writer.Buffer()
- if not str then
- buf:write_i("Since " .. since)
- return buf:finish()
- end
- buf:write_raw(str)
- buf:write_nl(2)
- buf:write_i("Since " .. since)
- return buf:finish()
-end
-
-M.Doc = Node:clone {
- -- duplicate ctor to disable assertion
- __ctor = function(self, obj)
- self._obj = obj
- end,
-
- summary_get = function(self)
- if not self._obj then
- return nil
- end
- return self._obj:summary_get()
- end,
-
- description_get = function(self)
- if not self._obj then
- return nil
- end
- return self._obj:description_get()
- end,
-
- since_get = function(self)
- if not self._obj then
- return nil
- end
- return self._obj:since_get()
- end,
-
- brief_get = function(self, doc2)
- if not self._obj and (not doc2 or not doc2._obj) then
- return "No description supplied."
- end
- local doc1, doc2 = self._obj, doc2 and doc2._obj or nil
- if not doc1 then
- doc1, doc2 = doc2, doc1
- end
- return gen_doc_refd(doc1:summary_get())
- end,
-
- full_get = function(self, doc2, write_since)
- if not self._obj and (not doc2 or not doc2._obj) then
- return "No description supplied."
- end
- local doc1, doc2 = self._obj, doc2 and doc2._obj or nil
- if not doc1 then
- doc1, doc2 = doc2, doc1
- end
- local sum1 = doc1:summary_get()
- local desc1 = doc1:description_get()
- local edoc = ""
- local since
- if doc2 then
- local sum2 = doc2:summary_get()
- local desc2 = doc2:description_get()
- if not desc2 then
- if sum2 then edoc = "\n\n" .. sum2 end
- else
- edoc = "\n\n" .. sum2 .. "\n\n" .. desc2
- end
- if write_since then
- since = doc2:since_get()
- end
- end
- if not since and write_since then
- since = doc1:since_get()
- end
- if not desc1 then
- return add_since(gen_doc_refd(sum1 .. edoc), since)
- end
- return add_since(gen_doc_refd(sum1 .. "\n\n" .. desc1 .. edoc), since)
- end,
-
- exists = function(self)
- return not not self._obj
- end
-}
-
-local revh = {}
-
-local class_type_str = {
- [eolian.class_type.REGULAR] = "class",
- [eolian.class_type.ABSTRACT] = "class",
- [eolian.class_type.MIXIN] = "mixin",
- [eolian.class_type.INTERFACE] = "interface"
-}
-
-M.Class = Node:clone {
- -- class types
- UNKNOWN = eolian.class_type.UNKNOWN,
- REGULAR = eolian.class_type.REGULAR,
- ABSTRACT = eolian.class_type.ABSTRACT,
- MIXIN = eolian.class_type.MIXIN,
- INTERFACE = eolian.class_type.INTERFACE,
-
- type_get = function(self)
- return self._obj:type_get()
- end,
-
- type_str_get = function(self)
- return class_type_str[self:type_get()]
- end,
-
- theme_str_get = function(self)
- return ({
- [eolian.class_type.REGULAR] = "regular",
- [eolian.class_type.ABSTRACT] = "abstract",
- [eolian.class_type.MIXIN] = "mixin",
- [eolian.class_type.INTERFACE] = "interface"
- })[self:type_get()]
- end,
-
- doc_get = function(self)
- return M.Doc(self._obj:documentation_get())
- end,
-
- legacy_prefix_get = function(self)
- return self._obj:legacy_prefix_get()
- end,
-
- eo_prefix_get = function(self)
- return self._obj:eo_prefix_get()
- end,
-
- inherits_get = function(self)
- local ret = self._cache_inhc
- if ret then
- return ret
- end
- ret = {}
- for cl in self._obj:inherits_get() do
- ret[#ret + 1] = M.Class(cl)
- end
- self._cache_inhc = ret
- return ret
- end,
-
- children_get = function(self)
- return revh[self:name_get()] or {}
- end,
-
- functions_get = function(self, ft)
- local ret = self._cache_funcs
- if ret then
- return ret
- end
- ret = {}
- self._cache_funcs = ret
- for fn in self._obj:functions_get(ft) do
- ret[#ret + 1] = M.Function(fn)
- end
- return ret
- end,
-
- function_by_name_get = function(self, fn, ft)
- local fun = self._cache_func
- if fun then
- return fun
- end
- fun = M.Function(self._obj:function_by_name_get(fn, ft))
- self._cache_func = fun
- return fun
- end,
-
- events_get = function(self)
- local ret = {}
- for ev in self._obj:events_get() do
- ret[#ret + 1] = M.Event(ev)
- end
- return ret
- end,
-
- implements_get = function(self)
- local ret = {}
- for impl in self._obj:implements_get() do
- ret[#ret + 1] = M.Implement(impl)
- end
- return ret
- end,
-
- c_get_function_name_get = function(self)
- return self._obj:c_get_function_name_get()
- end,
-
- nspaces_get = function(self, root)
- return M.Node.nspaces_get(self, root)
- end,
-
- is_same = function(self, other)
- return self._obj == other._obj
- end,
-
- -- static getters
-
- by_name_get = function(name)
- local stor = get_cache(M.Class, "_cache_bn")
- local ret = stor[name]
- if ret then
- return ret
- end
- local v = eos:class_by_name_get(name)
- if not v then
- return nil
- end
- ret = M.Class(v)
- stor[name] = ret
- return ret
- end,
-
- by_file_get = function(name)
- local stor = get_cache(M.Class, "_cache_bf")
- local ret = stor[name]
- if ret then
- return ret
- end
- local v = eos:class_by_file_get(name)
- if not v then
- return nil
- end
- ret = M.Class(v)
- stor[name] = ret
- return ret
- end,
-
- all_get = function()
- local ret, had = get_cache(M.Class, "_cache_all")
- if not had then
- -- FIXME: unit
- for cl in eos:classes_get() do
- local cls = M.Class(cl)
- if matches_filter(cls) then
- ret[#ret + 1] = cls
- end
- end
- end
- return ret
- end
-}
-
-local func_type_str = {
- [eolian.function_type.PROPERTY] = "property",
- [eolian.function_type.PROP_GET] = "property",
- [eolian.function_type.PROP_SET] = "property",
- [eolian.function_type.METHOD] = "method"
-}
-
-local ffi = require("ffi")
-
-M.Function = Node:clone {
- -- function types
- UNRESOLVED = eolian.function_type.UNRESOLVED,
- PROPERTY = eolian.function_type.PROPERTY,
- PROP_SET = eolian.function_type.PROP_SET,
- PROP_GET = eolian.function_type.PROP_GET,
- METHOD = eolian.function_type.METHOD,
- FUNCTION_POINTER = eolian.function_type.FUNCTION_POINTER,
-
- type_get = function(self)
- return self._obj:type_get()
- end,
-
- type_str_get = function(self)
- return func_type_str[self:type_get()]
- end,
-
- scope_get = function(self, ft)
- return self._obj:scope_get(ft)
- end,
-
- full_c_name_get = function(self, ft, legacy)
- return self._obj:full_c_name_get(ft, legacy)
- end,
-
- legacy_get = function(self, ft)
- return self._obj:legacy_get(ft)
- end,
-
- implement_get = function(self)
- return M.Implement(self._obj:implement_get())
- end,
-
- is_legacy_only = function(self, ft)
- return self._obj:is_legacy_only(ft)
- end,
-
- is_class = function(self)
- return self._obj:is_class()
- end,
-
- is_beta = function(self)
- return self._obj:is_beta()
- end,
-
- is_constructor = function(self, klass)
- return self._obj:is_constructor(klass.class)
- end,
-
- is_function_pointer = function(self)
- return self._obj:is_function_pointer()
- end,
-
- property_keys_get = function(self, ft)
- local ret = {}
- for par in self._obj:property_keys_get(ft) do
- ret[#ret + 1] = M.Parameter(par)
- end
- return ret
- end,
-
- property_values_get = function(self, ft)
- local ret = {}
- for par in self._obj:property_values_get(ft) do
- ret[#ret + 1] = M.Parameter(par)
- end
- return ret
- end,
-
- parameters_get = function(self)
- local ret = {}
- for par in self._obj:parameters_get() do
- ret[#ret + 1] = M.Parameter(par)
- end
- return ret
- end,
-
- return_type_get = function(self, ft)
- local v = self._obj:return_type_get(ft)
- if not v then
- return nil
- end
- return M.Type(v)
- end,
-
- return_default_value_get = function(self, ft)
- local v = self._obj:return_default_value_get(ft)
- if not v then
- return nil
- end
- return M.Expression(v)
- end,
-
- return_doc_get = function(self, ft)
- return M.Doc(self._obj:return_documentation_get(ft))
- end,
-
- return_is_warn_unused = function(self, ft)
- return self._obj:return_is_warn_unused(ft)
- end,
-
- is_const = function(self)
- return self._obj:is_const()
- end,
-
- nspaces_get = function(self, cl, root)
- local tbl = cl:nspaces_get()
- tbl[#tbl + 1] = self:type_str_get()
- tbl[#tbl + 1] = self:name_get():lower()
- if root ~= nil then
- tbl[#tbl + 1] = not not root
- end
- return tbl
- end,
-
- is_same = function(self, other)
- return self._obj == other._obj
- end,
-
- id_get = function(self)
- return tonumber(ffi.cast("uintptr_t", self._obj))
- end
-}
-
-M.Parameter = Node:clone {
- UNKNOWN = eolian.parameter_dir.UNKNOWN,
- IN = eolian.parameter_dir.IN,
- OUT = eolian.parameter_dir.OUT,
- INOUT = eolian.parameter_dir.INOUT,
-
- direction_get = function(self)
- return self._obj:direction_get()
- end,
-
- direction_name_get = function(self)
- local dir_to_str = {
- [self.IN] = "in",
- [self.OUT] = "out",
- [self.INOUT] = "inout"
- }
- return assert(dir_to_str[self:direction_get()],
- "unknown parameter direction")
- end,
-
- type_get = function(self)
- local v = self._obj:type_get()
- if not v then
- return nil
- end
- return M.Type(v)
- end,
-
- default_value_get = function(self)
- local v = self._obj:default_value_get()
- if not v then
- return nil
- end
- return M.Expression(v)
- end,
-
- doc_get = function(self)
- return M.Doc(self._obj:documentation_get())
- end,
-
- is_nonull = function(self)
- return self._obj:is_nonull()
- end,
-
- is_nullable = function(self)
- return self._obj:is_nullable()
- end,
-
- is_optional = function(self)
- return self._obj:is_optional()
- end,
-
- is_same = function(self, other)
- return self._obj == other._obj
- end
-}
-
-M.Event = Node:clone {
- type_get = function(self)
- local v = self._obj:type_get()
- if not v then
- return nil
- end
- return M.Type(v)
- end,
-
- doc_get = function(self)
- return M.Doc(self._obj:documentation_get())
- end,
-
- scope_get = function(self)
- return self._obj:scope_get()
- end,
-
- c_name_get = function(self)
- return self._obj:c_name_get()
- end,
-
- is_beta = function(self)
- return self._obj:is_beta()
- end,
-
- is_hot = function(self)
- return self._obj:is_hot()
- end,
-
- is_restart = function(self)
- return self._obj:is_restart()
- end,
-
- nspaces_get = function(self, cl, root)
- local tbl = cl:nspaces_get()
- tbl[#tbl + 1] = "event"
- tbl[#tbl + 1] = self:name_get():lower():gsub(",", "_")
- if root ~= nil then
- tbl[#tbl + 1] = not not root
- end
- return tbl
- end
-}
-
-M.StructField = Node:clone {
- doc_get = function(self)
- return M.Doc(self._obj:documentation_get())
- end,
-
- type_get = function(self)
- local v = self._obj:type_get()
- if not v then
- return nil
- end
- return M.Type(v)
- end
-}
-
-M.EnumField = Node:clone {
- c_name_get = function(self)
- return self._obj:c_name_get()
- end,
-
- doc_get = function(self)
- return M.Doc(self._obj:documentation_get())
- end,
-
- value_get = function(self, force)
- local v = self._obj:value_get(force)
- if not v then
- return nil
- end
- return M.Expression(v)
- end
-}
-
-local wrap_type_attrs = function(tp, str)
- if tp:is_const() then
- str = "const(" .. str .. ")"
- end
- -- TODO: implement new ownership system into docs
- --if tp:is_own() then
- -- str = "own(" .. str .. ")"
- --end
- local ffunc = tp:free_func_get()
- if ffunc then
- str = "free(" .. str .. ", " .. ffunc .. ")"
- end
- if tp:is_ptr() then
- str = "ptr(" .. str .. ")"
- end
- return str
-end
-
-M.Type = Node:clone {
- UNKNOWN = eolian.type_type.UNKNOWN,
- VOID = eolian.type_type.VOID,
- REGULAR = eolian.type_type.REGULAR,
- CLASS = eolian.type_type.CLASS,
- UNDEFINED = eolian.type_type.UNDEFINED,
-
- type_get = function(self)
- return self._obj:type_get()
- end,
-
- file_get = function(self)
- return self._obj:file_get()
- end,
-
- base_type_get = function(self)
- local v = self._obj:base_type_get()
- if not v then
- return nil
- end
- return M.Type(v)
- end,
-
- next_type_get = function(self)
- local v = self._obj:next_type_get()
- if not v then
- return nil
- end
- return M.Type(v)
- end,
-
- typedecl_get = function(self)
- local v = self._obj:typedecl_get()
- if not v then
- return nil
- end
- return M.Typedecl(v)
- end,
-
- aliased_base_get = function(self)
- local v = self._obj:aliased_base_get()
- if not v then
- return nil
- end
- return M.Type(v)
- end,
-
- class_get = function(self)
- return self._obj:class_get()
- end,
-
- is_owned = function(self)
- return self._obj:is_owned()
- end,
-
- is_const = function(self)
- return self._obj:is_const()
- end,
-
- is_ptr = function(self)
- return self._obj:is_ptr()
- end,
-
- c_type_get = function(self)
- return self._obj:c_type_get(eolian.c_type_type.DEFAULT)
- end,
-
- free_func_get = function(self)
- return self._obj:free_func_get()
- end,
-
- -- utils
-
- serialize = function(self)
- local tpt = self:type_get()
- if tpt == self.UNKNOWN then
- error("unknown type: " .. self:name_get())
- elseif tpt == self.VOID then
- return wrap_type_attrs(self, "void")
- elseif tpt == self.UNDEFINED then
- return wrap_type_attrs(self, "__undefined_type")
- elseif tpt == self.REGULAR or tpt == self.CLASS then
- local stp = self:base_type_get()
- if stp then
- local stypes = {}
- while stp do
- stypes[#stypes + 1] = stp:serialize()
- stp = stp:next_type_get()
- end
- return wrap_type_attrs(self, self:name_get() .. "<"
- .. table.concat(stypes, ", ") .. ">")
- end
- return wrap_type_attrs(self, self:name_get())
- end
- error("unhandled type type: " .. tpt)
- end
-}
-
-M.type_cstr_get = function(tp, suffix)
- tp = tp or "void"
- local ct = (type(tp) == "string") and tp or tp:c_type_get()
- if not suffix then
- return ct
- end
- if ct:sub(#ct) == "*" then
- return ct .. suffix
- else
- return ct .. " " .. suffix
- end
-end
-
-local add_typedecl_attrs = function(tp, buf)
- if tp:is_extern() then
- buf[#buf + 1] = "@extern "
- end
- local ffunc = tp:free_func_get()
- if ffunc then
- buf[#buf + 1] = "@free("
- buf[#buf + 1] = ffunc
- buf[#buf + 1] = ") "
- end
-end
-
-M.Typedecl = Node:clone {
- UNKNOWN = eolian.typedecl_type.UNKNOWN,
- STRUCT = eolian.typedecl_type.STRUCT,
- STRUCT_OPAQUE = eolian.typedecl_type.STRUCT_OPAQUE,
- ENUM = eolian.typedecl_type.ENUM,
- ALIAS = eolian.typedecl_type.ALIAS,
- FUNCTION_POINTER = eolian.typedecl_type.FUNCTION_POINTER,
-
- type_get = function(self)
- return self._obj:type_get()
- end,
-
- type_str_get = function(self)
- local strs = {
- [eolian.typedecl_type.STRUCT] = "struct",
- [eolian.typedecl_type.STRUCT_OPAQUE] = "struct",
- [eolian.typedecl_type.ENUM] = "enum",
- [eolian.typedecl_type.ALIAS] = "alias"
- }
- return strs[self:type_get()]
- end,
-
- struct_fields_get = function(self)
- local ret = {}
- for fl in self._obj:struct_fields_get() do
- ret[#ret + 1] = M.StructField(fl)
- end
- return ret
- end,
-
- struct_field_get = function(self, name)
- local v = self._obj:struct_field_get(name)
- if not v then
- return nil
- end
- return M.StructField(v)
- end,
-
- enum_fields_get = function(self)
- local ret = {}
- for fl in self._obj:enum_fields_get() do
- ret[#ret + 1] = M.EnumField(fl)
- end
- return ret
- end,
-
- enum_field_get = function(self, name)
- local v = self._obj:enum_field_get(name)
- if not v then
- return nil
- end
- return M.EnumField(v)
- end,
-
- enum_legacy_prefix_get = function(self)
- return self._obj:enum_legacy_prefix_get()
- end,
-
- doc_get = function(self)
- return M.Doc(self._obj:documentation_get())
- end,
-
- file_get = function(self)
- return self._obj:file_get()
- end,
-
- base_type_get = function(self)
- local v = self._obj:base_type_get()
- if not v then
- return nil
- end
- return M.Type(v)
- end,
-
- aliased_base_get = function(self)
- local v = self._obj:aliased_base_get()
- if not v then
- return nil
- end
- return M.Type(v)
- end,
-
- is_extern = function(self)
- return self._obj:is_extern()
- end,
-
- c_type_get = function(self)
- return self._obj:c_type_get()
- end,
-
- free_func_get = function(self)
- return self._obj:free_func_get()
- end,
-
- function_pointer_get = function(self)
- local v = self._obj:function_pointer_get()
- if not v then
- return nil
- end
- return M.Function(v)
- end,
-
- nspaces_get = function(self, root)
- return M.Node.nspaces_get(self, root)
- end,
-
- -- static getters
-
- all_aliases_get = function()
- local ret = {}
- for tp in eos:aliases_get() do
- local tpo = M.Typedecl(tp)
- if matches_filter(tpo) then
- ret[#ret + 1] = tpo
- end
- end
- return ret
- end,
-
- all_structs_get = function()
- local ret = {}
- for tp in eos:structs_get() do
- local tpo = M.Typedecl(tp)
- if matches_filter(tpo) then
- ret[#ret + 1] = tpo
- end
- end
- return ret
- end,
-
- all_enums_get = function()
- local ret = {}
- for tp in eos:enums_get() do
- local tpo = M.Typedecl(tp)
- local tpn = tpo:nspaces_get()
- if matches_filter(tpo) then
- ret[#ret + 1] = tpo
- end
- end
- return ret
- end,
-
- aliases_by_file_get = function(fn)
- local ret = {}
- for tp in eos:aliases_by_file_get(fn) do
- ret[#ret + 1] = M.Typedecl(tp)
- end
- return ret
- end,
-
- structs_by_file_get = function(fn)
- local ret = {}
- for tp in eos:struts_by_file_get(fn) do
- ret[#ret + 1] = M.Typedecl(tp)
- end
- return ret
- end,
-
- enums_by_file_get = function(fn)
- local ret = {}
- for tp in eeos:enums_by_file_get(fn) do
- ret[#ret + 1] = M.Typedecl(tp)
- end
- return ret
- end,
-
- alias_by_name_get = function(tn)
- local v = eos:alias_by_name_get(tn)
- if not v then
- return nil
- end
- return M.Typedecl(v)
- end,
-
- struct_by_name_get = function(tn)
- local v = eos:struct_by_name_get(tn)
- if not v then
- return nil
- end
- return M.Typedecl(v)
- end,
-
- enum_by_name_get = function(tn)
- local v = eos:enum_by_name_get(tn)
- if not v then
- return nil
- end
- return M.Typedecl(v)
- end,
-
- -- utils
-
- serialize = function(self)
- local tpt = self:type_get()
- if tpt == self.UNKNOWN then
- error("unknown typedecl: " .. self:name_get())
- elseif tpt == self.STRUCT or
- tpt == self.STRUCT_OPAQUE then
- local buf = { "struct " }
- add_typedecl_attrs(self, buf)
- buf[#buf + 1] = self:name_get()
- if tpt == self.STRUCT_OPAQUE then
- buf[#buf + 1] = ";"
- return table.concat(buf)
- end
- local fields = self:struct_fields_get()
- if #fields == 0 then
- buf[#buf + 1] = " {}"
- return table.concat(buf)
- end
- buf[#buf + 1] = " {\n"
- for i, fld in ipairs(fields) do
- buf[#buf + 1] = " "
- buf[#buf + 1] = fld:name_get()
- buf[#buf + 1] = ": "
- buf[#buf + 1] = fld:type_get():serialize()
- buf[#buf + 1] = ";\n"
- end
- buf[#buf + 1] = "}"
- return table.concat(buf)
- elseif tpt == self.ENUM then
- local buf = { "enum " }
- add_typedecl_attrs(self, buf)
- buf[#buf + 1] = self:name_get()
- local fields = self:enum_fields_get()
- if #fields == 0 then
- buf[#buf + 1] = " {}"
- return table.concat(buf)
- end
- buf[#buf + 1] = " {\n"
- for i, fld in ipairs(fields) do
- buf[#buf + 1] = " "
- buf[#buf + 1] = fld:name_get()
- local val = fld:value_get()
- if val then
- buf[#buf + 1] = ": "
- buf[#buf + 1] = val:serialize()
- end
- if i == #fields then
- buf[#buf + 1] = "\n"
- else
- buf[#buf + 1] = ",\n"
- end
- end
- buf[#buf + 1] = "}"
- return table.concat(buf)
- elseif tpt == self.ALIAS then
- local buf = { "type " }
- add_typedecl_attrs(self, buf)
- buf[#buf + 1] = self:name_get()
- buf[#buf + 1] = ": "
- buf[#buf + 1] = self:base_type_get():serialize()
- buf[#buf + 1] = ";"
- return table.concat(buf)
- elseif tpt == self.FUNCTION_POINTER then
- return "TODO"
- end
- error("unhandled typedecl type: " .. tpt)
- end,
-
- serialize_c = function(self, ns)
- local tpt = self:type_get()
- if tpt == self.UNKNOWN then
- error("unknown typedecl: " .. self:name_get())
- elseif tpt == self.STRUCT or
- tpt == self.STRUCT_OPAQUE then
- local buf = { "typedef struct " }
- local fulln = self:name_get():gsub("%.", "_");
- keyref.add(fulln, ns, "c")
- buf[#buf + 1] = "_" .. fulln;
- if tpt == self.STRUCT_OPAQUE then
- buf[#buf + 1] = " " .. fulln .. ";"
- return table.concat(buf)
- end
- local fields = self:struct_fields_get()
- if #fields == 0 then
- buf[#buf + 1] = " {} " .. fulln .. ";"
- return table.concat(buf)
- end
- buf[#buf + 1] = " {\n"
- for i, fld in ipairs(fields) do
- buf[#buf + 1] = " "
- buf[#buf + 1] = M.type_cstr_get(fld:type_get(), fld:name_get())
- buf[#buf + 1] = ";\n"
- end
- buf[#buf + 1] = "} " .. fulln .. ";"
- return table.concat(buf)
- elseif tpt == self.ENUM then
- local buf = { "typedef enum" }
- local fulln = self:name_get():gsub("%.", "_");
- keyref.add(fulln, ns, "c")
- local fields = self:enum_fields_get()
- if #fields == 0 then
- buf[#buf + 1] = " {} " .. fulln .. ";"
- return table.concat(buf)
- end
- buf[#buf + 1] = " {\n"
- for i, fld in ipairs(fields) do
- buf[#buf + 1] = " "
- local cn = fld:c_name_get()
- buf[#buf + 1] = cn
- keyref.add(cn, ns, "c")
- local val = fld:value_get()
- if val then
- buf[#buf + 1] = " = "
- local ev = val:eval_enum()
- local lit = ev:to_literal()
- buf[#buf + 1] = lit
- local ser = val:serialize()
- if ser and ser ~= lit then
- buf[#buf + 1] = " /* " .. ser .. " */"
- end
- end
- if i == #fields then
- buf[#buf + 1] = "\n"
- else
- buf[#buf + 1] = ",\n"
- end
- end
- buf[#buf + 1] = "} " .. fulln .. ";"
- return table.concat(buf)
- elseif tpt == self.ALIAS then
- local fulln = self:name_get():gsub("%.", "_");
- keyref.add(fulln, ns, "c")
- return "typedef "
- .. M.type_cstr_get(self:base_type_get(), fulln) .. ";"
- elseif tpt == self.FUNCTION_POINTER then
- return "TODO"
- end
- error("unhandled typedecl type: " .. tpt)
- end
-}
-
-M.Variable = Node:clone {
- UNKNOWN = eolian.variable_type.UNKNOWN,
- CONSTANT = eolian.variable_type.CONSTANT,
- GLOBAL = eolian.variable_type.GLOBAL,
-
- type_get = function(self)
- return self._obj:type_get()
- end,
-
- type_str_get = function(self)
- local strs = {
- [eolian.variable_type.CONSTANT] = "constant",
- [eolian.variable_type.GLOBAL] = "global"
- }
- return strs[self:type_get()]
- end,
-
- doc_get = function(self)
- return M.Doc(self._obj:documentation_get())
- end,
-
- file_get = function(self)
- return self._obj:file_get()
- end,
-
- base_type_get = function(self)
- local v = self._obj:base_type_get()
- if not v then
- return nil
- end
- return M.Type(v)
- end,
-
- value_get = function(self)
- local v = self._obj:value_get()
- if not v then
- return nil
- end
- return M.Expression(v)
- end,
-
- is_extern = function(self)
- return self._obj:is_extern()
- end,
-
- nspaces_get = function(self, root)
- return M.Node.nspaces_get(self, root)
- end,
-
- serialize = function(self)
- local buf = {}
- if self:type_get() == self.GLOBAL then
- buf[#buf + 1] = "var "
- else
- buf[#buf + 1] = "const "
- end
- if self:is_extern() then
- buf[#buf + 1] = "@extern "
- end
- buf[#buf + 1] = self:name_get()
- buf[#buf + 1] = ": "
- buf[#buf + 1] = self:base_type_get():serialize()
- local val = self:value_get()
- if val then
- buf[#buf + 1] = " = "
- buf[#buf + 1] = val:serialize()
- end
- buf[#buf + 1] = ";"
- return table.concat(buf)
- end,
-
- serialize_c = function(self, ns)
- local buf = {}
- local bt = self:base_type_get()
- local fulln = self:name_get():gsub("%.", "_"):upper()
- keyref.add(fulln, ns, "c")
- if self:type_get() == self.GLOBAL then
- local ts = bt:c_type_get()
- buf[#buf + 1] = ts
- if ts:sub(#ts) ~= "*" then
- buf[#buf + 1] = " "
- end
- buf[#buf + 1] = fulln
- local val = self:value_get()
- if val then
- buf[#buf + 1] = " = "
- local vt = val:eval_type(bt)
- local lv = vt:to_literal()
- local sv = val:serialize()
- buf[#buf + 1] = lv
- if lv ~= sv then
- buf[#buf + 1] = "/* " .. sv .. " */"
- end
- end
- buf[#buf + 1] = ";"
- else
- buf[#buf + 1] = "#define "
- buf[#buf + 1] = fulln
- buf[#buf + 1] = " "
- local val = self:value_get()
- local vt = val:eval_type(bt)
- local lv = vt:to_literal()
- local sv = val:serialize()
- buf[#buf + 1] = lv
- if lv ~= sv then
- buf[#buf + 1] = "/* " .. sv .. " */"
- end
- end
- return table.concat(buf)
- end,
-
- -- static getters
-
- all_globals_get = function()
- local ret = {}
- for v in eos:globals_get() do
- ret[#ret + 1] = M.Variable(v)
- end
- return ret
- end,
-
- all_constants_get = function()
- local ret = {}
- for v in eos:constants_get() do
- ret[#ret + 1] = M.Variable(v)
- end
- return ret
- end,
-
- globals_by_file_get = function(fn)
- local ret = {}
- for v in eos:globals_by_file_get(fn) do
- ret[#ret + 1] = M.Variable(v)
- end
- return ret
- end,
-
- constants_by_file_get = function(fn)
- local ret = {}
- for v in eos:constants_by_file_get(fn) do
- ret[#ret + 1] = M.Variable(v)
- end
- return ret
- end,
-
- global_by_name_get = function(vn)
- local v = eos:global_by_name_get(vn)
- if not v then
- return nil
- end
- return M.Variable(v)
- end,
-
- constant_by_name_get = function(vn)
- local v = eos:constant_by_name_get(vn)
- if not v then
- return nil
- end
- return M.Variable(v)
- end
-}
-
-M.Expression = Node:clone {
- eval_enum = function(self)
- return self._obj:eval(eolian.expression_mask.INT)
- end,
-
- eval_type = function(self, tp)
- return self._obj:eval_type(tp.type)
- end,
-
- serialize = function(self)
- return self._obj:serialize()
- end
-}
-
-M.Implement = Node:clone {
- class_get = function(self)
- local ccl = self._cache_cl
- if ccl then
- return ccl
- end
- -- so that we don't re-instantiate, it gets cached over there too
- ccl = M.Class.by_name_get(self._obj:class_get():name_get())
- self._cache_cl = ccl
- return ccl
- end,
-
- function_get = function(self)
- local func, tp = self._cache_func, self._cache_tp
- if func then
- return func, tp
- end
- func, tp = self._obj:function_get()
- func = M.Function(func)
- self._cache_func, self._cache_tp = func, tp
- return func, tp
- end,
-
- doc_get = function(self, ftype, inh)
- return M.Doc(self._obj:documentation_get(ftype))
- end,
-
- fallback_doc_get = function(self, inh)
- local ig, is = self:is_prop_get(), self:is_prop_set()
- if ig and not is then
- return self:doc_get(M.Function.PROP_GET, inh)
- elseif is and not ig then
- return self:doc_get(M.Function.PROP_SET, inh)
- end
- return nil
- end,
-
- is_auto = function(self, ftype)
- return self._obj:is_auto(ftype)
- end,
-
- is_empty = function(self, ftype)
- return self._obj:is_empty(ftype)
- end,
-
- is_pure_virtual = function(self, ftype)
- return self._obj:is_pure_virtual(ftype)
- end,
-
- is_prop_get = function(self)
- return self._obj:is_prop_get()
- end,
-
- is_prop_set = function(self)
- return self._obj:is_prop_set()
- end,
-
- is_overridden = function(self, cl)
- return cl.class ~= self._obj:class_get()
- end
-}
-
-M.DocTokenizer = util.Object:clone {
- UNKNOWN = eolian.doc_token_type.UNKNOWN,
- TEXT = eolian.doc_token_type.TEXT,
- REF = eolian.doc_token_type.REF,
- MARK_NOTE = eolian.doc_token_type.MARK_NOTE,
- MARK_WARNING = eolian.doc_token_type.MARK_WARNING,
- MARK_REMARK = eolian.doc_token_type.MARK_REMARK,
- MARK_TODO = eolian.doc_token_type.MARK_TODO,
- MARKUP_MONOSPACE = eolian.doc_token_type.MARKUP_MONOSPACE,
-
- __ctor = function(self, str)
- self.tok = eolian.doc_token_init()
- self.str = str
- assert(self.str)
- assert(self.tok)
- end,
-
- tokenize = function(self)
- self.str = eolian.documentation_tokenize(self.str, self.tok)
- return not not self.str
- end,
-
- text_get = function(self)
- return self.tok:text_get()
- end,
-
- type_get = function(self)
- return self.tok:type_get()
- end,
-
- ref_resolve = function(self, root)
- -- FIXME: unit
- local tp, d1, d2 = self.tok:ref_resolve(eos)
- local reft = eolian.object_type
- local ret = {}
- if tp == reft.CLASS or tp == reft.FUNCTION or tp == reft.EVENT then
- if not class_type_str[d1:type_get()] then
- error("unknown class type for class '"
- .. d1:name_get() .. "'")
- end
- elseif tp == reft.TYPEDECL then
- elseif tp == reft.ENUM_FIELD or tp == reft.STRUCT_FIELD then
- -- TODO: point to field
- elseif tp == reft.VARIABLE then
- else
- error("invalid reference '" .. self:text_get() .. "'")
- end
- for tok in d1:name_get():gmatch("[^%.]+") do
- ret[#ret + 1] = tok:lower()
- end
- if tp == reft.FUNCTION then
- ret[#ret + 1] = func_type_str[d2:type_get()]
- ret[#ret + 1] = d2:name_get():lower()
- elseif tp == reft.EVENT then
- ret[#ret + 1] = "event"
- ret[#ret + 1] = d2:name_get():lower()
- end
- if root ~= nil then
- ret[#ret + 1] = not not root
- end
- return ret
- end
-}
-
-M.scan_directory = function(dir)
- if not dir then
- if not eos:system_directory_add() then
- error("failed scanning system directory")
- end
- return
- end
- if not eos:directory_add(dir) then
- error("failed scanning directory: " .. dir)
- end
-end
-
-M.parse = function(st)
- if not eos:all_eot_files_parse() then
- error("failed parsing eo type files")
- end
- if st and st:match("%.") then
- if not eos:file_parse(st:gsub("%.", "_"):lower() .. ".eo") then
- error("failed parsing eo file")
- end
- else
- if not eos:all_eo_files_parse() then
- error("failed parsing eo files")
- end
- end
- -- build reverse inheritance hierarchy
- for cl in eos:classes_get() do
- local cln = cl:name_get()
- for icl in cl:inherits_get() do
- local t = revh[icl]
- if not t then
- t = {}
- revh[icl] = t
- end
- t[#t + 1] = M.Class.by_name_get(cl:name_get())
- end
- end
-end
-
-return M
diff --git a/src/scripts/elua/apps/docgen/keyref.lua b/src/scripts/elua/apps/docgen/keyref.lua
deleted file mode 100644
index 56311d9742..0000000000
--- a/src/scripts/elua/apps/docgen/keyref.lua
+++ /dev/null
@@ -1,41 +0,0 @@
-local M = {}
-
-local key_refs = {}
-
-M.add = function(key, link, lang)
- local rfs = key_refs[lang]
- if not rfs then
- key_refs[lang] = {}
- rfs = key_refs[lang]
- end
- rfs[key] = link
-end
-
-M.build = function()
- local writer = require("docgen.writer")
- local dutil = require("docgen.util")
- for lang, rfs in pairs(key_refs) do
- local f = writer.Writer({ "ref", lang, "keyword-list" })
- local arr = {}
- for refn, v in pairs(rfs) do
- arr[#arr + 1] = refn
- local rf = writer.Writer({ "ref", lang, "key", refn })
- v[#v + 1] = true
- rf:write_include(rf.INCLUDE_PAGE, v)
- rf:finish()
- end
- table.sort(arr)
- f:write_raw(table.concat(arr, "\n"))
- f:write_nl()
- f:finish()
- local lf = writer.Writer({ "ref", lang, "keyword-link" })
- lf:write_raw("/", dutil.path_join(
- dutil.nspace_to_path(dutil.get_root_ns()),
- "ref", lang, "key", "{FNAME}"
- ))
- lf:write_nl()
- lf:finish()
- end
-end
-
-return M
diff --git a/src/scripts/elua/apps/docgen/mono.lua b/src/scripts/elua/apps/docgen/mono.lua
deleted file mode 100644
index dbe98de171..0000000000
--- a/src/scripts/elua/apps/docgen/mono.lua
+++ /dev/null
@@ -1,614 +0,0 @@
-
-local writer = require("docgen.writer")
-local dtree = require("docgen.doctree")
-
-local M = {}
-
-local propt_to_type = {
- [dtree.Function.PROPERTY] = "(get, set)",
- [dtree.Function.PROP_GET] = "(get)",
- [dtree.Function.PROP_SET] = "(set)",
-}
-
-local verbs = {
- "add",
- "get",
- "is",
- "del",
- "thaw",
- "freeze",
- "save",
- "wait",
- "eject",
- "raise",
- "lower",
- "load",
- "dup",
- "reset",
- "unload",
- "close",
- "set",
- "interpolate",
- "has",
- "grab",
- "check",
- "find",
- "ungrab",
- "unset",
- "clear",
- "pop",
- "new",
- "peek",
- "push",
- "update",
- "show",
- "move",
- "hide",
- "calculate",
- "resize",
- "attach",
- "pack",
- "unpack",
- "emit",
- "call",
- "append"
-}
-
-local not_verbs = {
- "below",
- "above",
- "name",
- "unfreezable",
- "value",
- "r",
- "g",
- "b",
- "a",
- "finalize",
- "destructor",
- "to",
- "circle",
- "rect",
- "path",
- "commands",
- "type",
- "colorspace",
- "op",
- "type",
- "properties",
- "status",
- "status",
- "relative",
- "ptr",
- "pair",
- "pos",
- "end"
-}
-
-local get_class_name = function(cls)
- local words = {}
- local klass = cls:name_get()
- for word in string.gmatch(klass, "%a+") do
- words[#words+1] = word
- end
- for i = 1, #words -1 do
- words[i] = string.lower(words[i])
- end
- return table.concat(words, '.')
-end
-
-local get_mono_type
-get_mono_type = function(tp)
- if not tp then
- return "void "
- end
-
- tpt = tp:type_get()
- tpdecl = tp:typedecl_get()
-
- if tpt == tp.REGULAR then
- if tp:name_get() == "string" then
- return "System.String"
- elseif tp:name_get() == "list" then
- ntp = tp:base_type_get()
- --assert(btp ~= nil)
- --ntp = btp:next_type_get()
- return "eina.List<" .. get_mono_type(ntp) .. ">"
- elseif tpdecl then
- --print("typedecl type is ", tp:name_get())
- tpt = tpdecl:type_get()
- return get_class_name(tp) --tp:name_get()
- else
- --print("regular type is ", tp:name_get())
- return tp:name_get()
- end
- elseif tpt == tp.CLASS then
- return get_class_name(tp)
- else
- return "unknown"
- end
-end
-
-
-local is_verb = function(word)
- for i = 1, #verbs do
- if verbs[i] == word then
- return true
- end
- end
- return false
-end
-
-local mono_method_name_get = function(f, ftype)
- local cn = f:name_get(ftype)
-
- local words = {}
-
- for word in string.gmatch(cn, "%a+") do
- words[#words+1] = word
- end
-
- if #words > 1 and is_verb(words[#words]) then
- local tmp = words[#words]
- words[#words] = words[1]
- words[1] = tmp
- end
-
- for i = 1, #words do
- words[i] = words[i]:gsub("^%l", string.upper)
- end
-
- if ftype == f.PROP_GET then
- table.insert(words, 1, "Get")
- elseif ftype == f.PROP_SET then
- table.insert(words, 1, "Set")
- end
-
- return table.concat(words)
-end
-
-local gen_mono_param = function(par, out)
- local part = par:type_get()
- out = out or (par:direction_get() == par.OUT)
- if out then
- out = "out "
- else
- out = ""
- end
-
- return out .. get_mono_type(par:type_get()) .. ' ' .. par:name_get()
- --local tstr = part:c_type_get()
- --return out .. dtree.type_cstr_get(tstr, par:name_get())
-end
-
-local get_func_mono_sig_part = function(cn, tp)
- return get_mono_type(tp) .. " " .. cn
-end
-
-local find_parent_impl
-find_parent_impl = function(fulln, cl)
- for i, pcl in ipairs(cl:inherits_get()) do
- for j, impl in ipairs(pcl:implements_get()) do
- if impl:name_get() == fulln then
- --if get_class_name(impl) == fulln then
- return impl, pcl
- end
- end
- local pimpl, pcl = find_parent_impl(fulln, pcl)
- if pimpl then
- return pimpl, pcl
- end
- end
- return nil, cl
-end
-
-local find_parent_briefdoc
-find_parent_briefdoc = function(fulln, cl)
- local pimpl, pcl = find_parent_impl(fulln, cl)
- if not pimpl then
- return dtree.Doc():brief_get()
- end
- local pdoc = pimpl:doc_get(dtree.Function.METHOD, true)
- local pdocf = pimpl:fallback_doc_get(true)
- if not pdoc:exists() and (not pdocf or not pdocf:exists()) then
- return find_parent_briefdoc(fulln, pcl)
- end
- return pdoc:brief_get(pdocf)
-end
-
-
-local write_description = function(f, impl, func, cl)
- local over = impl:is_overridden(cl)
- local bdoc
-
- local doc = impl:doc_get(func.METHOD, true)
- local docf = impl:fallback_doc_get(true)
- if over and (not doc:exists() and (not docf or not docf:exists())) then
- bdoc = find_parent_briefdoc(impl:name_get(), cl)
- else
- bdoc = doc:brief_get(docf)
- end
- if bdoc ~= "No description supplied." then
- f:write_raw(bdoc)
- end
-end
-
-local write_scope = function(f, func)
- local ftt = {
- [func.scope.PROTECTED] = "protected",
- [func.scope.PRIVATE] = "private"
- }
- if func:is_class() then
- f:write_raw(" ")
- f:write_m("class")
- end
- if func:type_get() == func.PROPERTY then
- local ft1, ft2 = ftt[func:scope_get(func.PROP_GET)],
- ftt[func:scope_get(func.PROP_SET)]
- if ft1 and ft1 == ft2 then
- f:write_raw(" ")
- f:write_m(ft1)
- elseif ft1 or ft2 then
- local s = ""
- if ft1 then
- s = s .. ft1 .. " get" .. (ft2 and ", " or "")
- end
- if ft2 then
- s = s .. ft2 .. " set"
- end
- f:write_raw(" ")
- f:write_m(s)
- end
- else
- local ft = ftt[func:scope_get(func:type_get())]
- if ft then
- f:write_raw(" ")
- f:write_m(ft)
- end
- end
-end
-
-local write_function = function(f, func, cl)
- local llbuf = writer.Buffer()
- llbuf:write_link(func:nspaces_get(cl, true), func:name_get())
- f:write_b(llbuf:finish())
-
- local pt = propt_to_type[func:type_get()]
- if pt then
- f:write_raw(" ")
- local llbuf = writer.Buffer()
- llbuf:write_b(pt)
- f:write_i(llbuf:finish())
- end
-end
-
-local gen_func_mono_sig = function(f, ftype)
- ftype = ftype or f.METHOD
- assert(ftype ~= f.PROPERTY)
-
- local cn = mono_method_name_get(f, ftype)
- local rtype = f:return_type_get(ftype)
- local prefix = ""
- local suffix = ""
-
- if f:is_class() then
- prefix = "static "
- elseif f:is_const() or ftype == f.PROP_GET then
- suffix = " const"
- end
-
- if f:type_get() == f.METHOD then
- local pars = f:parameters_get()
- local cnrt = get_func_mono_sig_part(cn, rtype)
- for i = 1, #pars do
- pars[i] = gen_mono_param(pars[i])
- end
- return prefix .. cnrt .. "(" .. table.concat(pars, ", ") .. ")" .. suffix .. ";"
- end
-
- local keys = f:property_keys_get(ftype)
- local vals = f:property_values_get(ftype)
-
- if ftype == f.PROP_SET then
- local cnrt = get_func_mono_sig_part(cn, rtype)
- local pars = {}
- for i, par in ipairs(keys) do
- pars[#pars + 1] = gen_mono_param(par)
- end
- for i, par in ipairs(vals) do
- pars[#pars + 1] = gen_mono_param(par)
- end
- return cnrt .. "(" .. table.concat(pars, ", ") .. ");"
- end
-
- -- getters
- local cnrt
- if not rtype then
- if #vals == 1 then
- cnrt = get_func_mono_sig_part(cn, vals[1]:type_get())
- table.remove(vals, 1)
- else
- cnrt = get_func_mono_sig_part(cn)
- end
- else
- cnrt = get_func_mono_sig_part(cn, rtype)
- end
- local pars = {}
- for i, par in ipairs(keys) do
- pars[#pars + 1] = gen_mono_param(par)
- end
- for i, par in ipairs(vals) do
- --print('parameter is value for get, so out')
- pars[#pars + 1] = gen_mono_param(par, true)
- end
-
- return cnrt .. "(" .. table.concat(pars, ", ") .. ");"
-end
-
-local build_functable = function(f, tcl, tbl)
- if #tbl == 0 then
- return
- end
- local nt = {}
- for i, implt in ipairs(tbl) do
- local lbuf = writer.Buffer()
-
- local cl, impl = unpack(implt)
- local func = impl:function_get()
-
- local wt = {}
- wt[0] = cl
- wt[1] = func
- wt[2] = impl
-
- nt[#nt + 1] = wt
- end
-
- local get_best_scope = function(f)
- local ft = f:type_get()
- if ft == f.PROPERTY then
- local fs1, fs2 = f:scope_get(f.PROP_GET), f:scope_get(f.PROP_SET)
- if fs1 == f.scope.PUBLIC or fs2 == f.scope.PUBLIC then
- return f.scope.PUBLIC
- elseif fs1 == f.scope.PROTECTED or fs2 == f.scope.PROTECTED then
- return f.scope.PROTECTED
- else
- return f.scope.PRIVATE
- end
- else
- return f:scope_get(ft)
- end
- end
- table.sort(nt, function(v1, v2)
- local cl1, cl2 = v1[0], v2[0]
- if cl1 ~= cl2 then
- return cl1:name_get() < cl2:name_get()
- end
-
- local f1, f2 = v1[1], v2[1]
- local f1s, f2s = get_best_scope(f1), get_best_scope(f2)
- if f1s ~= f2s then
- if f1s ~= f1.scope.PROTECED then
- -- public funcs go first, private funcs go last
- return f1s == f1.scope.PUBLIC
- else
- -- protected funcs go second
- return f2s == f2.scope.PRIVATE
- end
- end
- return f1:name_get() < f2:name_get()
- end)
-
- return nt
-end
-
-local find_callables
-find_callables = function(cl, omeths, events, written)
- for i, pcl in ipairs(cl:inherits_get()) do
- for j, impl in ipairs(pcl:implements_get()) do
- local func = impl:function_get()
- local fid = func:id_get()
- if not written[fid] then
- omeths[#omeths + 1] = { pcl, impl }
- written[fid] = true
- end
- end
- for i, ev in ipairs(pcl:events_get()) do
- local evid = ev:name_get()
- if not written[evid] then
- events[#events + 1] = { pcl, ev }
- written[evid] = true
- end
- end
- find_callables(pcl, omeths, events, written)
- end
-end
-
-M.build_inherits = function(cl, t, lvl)
- t = t or {}
- lvl = lvl or 0
- local lbuf = writer.Buffer()
- if lvl > 0 then
- local cln = cl:nspaces_get(true)
- cln[#cln] = nil
- cln[#cln] = cln[#cln] .. "_mono"
- cln = ":" .. 'develop:api' .. ":"
- .. table.concat(cln, ":")
- lbuf:write_raw("[[", cln, "|", get_class_name(cl), "]]")
- --lbuf:write_link(cl:nspaces_get(true), cl:name_get())
- lbuf:write_raw(" ")
- lbuf:write_i("(" .. cl:type_str_get() .. ")")
-
- t[#t + 1] = { lvl - 1, lbuf:finish() }
- end
-
- for i, acl in ipairs(cl:inherits_get()) do
- M.build_inherits(acl, t, lvl + 1)
- end
- return t
-end
-
-M.build_inherit_summary = function(cl, buf)
- buf = buf or writer.Buffer()
- buf:write_raw(" => ")
-
- local cln = cl:nspaces_get(true)
- cln[#cln] = nil
- cln[#cln] = cln[#cln] .. "_mono"
- cln = ":" .. 'develop:api' .. ":"
- .. table.concat(cln, ":")
- buf:write_raw("[[", cln, "|", get_class_name(cl), "]]")
- buf:write_raw(" ")
- buf:write_i("(" .. cl:type_str_get() .. ")")
-
- local inherits = cl:inherits_get()
- if #inherits ~= 0 then
- M.build_inherit_summary(inherits[1], buf)
- end
- return buf
-end
-
-M.write_inherit_functable = function(f, tcl, tbl)
- if #tbl == 0 then
- return
- end
- local nt = build_functable(t, tcl, tbl)
-
- local prevcl = tcl
- for i, wt in ipairs(nt) do
- local cl = wt[0]
- local func = wt[1]
- local impl = wt[2]
-
- local ocl = impl:class_get()
- local func = impl:function_get()
-
- -- class grouping for inheritance
- if cl ~= prevcl then
- prevcl = cl
- f:write_raw("^ ")
- f:write_link(cl:nspaces_get(true), cl:name_get())
- f:write_raw(" ^^^")
- f:write_nl()
- end
-
- -- scope
- f:write_raw("| ")
- write_scope(f, func)
- f:write_raw(" | ")
- -- function
- write_function(f, func, cl)
- f:write_raw(" | ")
- -- description
- write_description(f, impl, func, cl)
- f:write_raw(" |")
- f:write_nl()
- end
- f:write_nl()
-end
-
-M.write_functable = function(f, tcl, tbl)
- if #tbl == 0 then
- return
- end
- local nt = build_functable(t, tcl, tbl)
-
- local wrote = false
- for i, wt in ipairs(nt) do
- local cl = wt[0]
- local func = wt[1]
- local impl = wt[2]
-
- local ocl = impl:class_get()
- local func = impl:function_get()
- local over = impl:is_overridden(cl)
-
- -- function
- write_function(f, func, cl)
- -- scope
- write_scope(f, func)
-
- -- overrides
- if over then
- -- TODO: possibly also mention which part of a property was
- -- overridden and where, get/set override point might differ!
- -- but we get latest doc every time so it's ok for now
- local llbuf = writer.Buffer()
- llbuf:write_raw(" [Overridden from ")
- llbuf:write_link(ocl:nspaces_get(true), ocl:name_get())
- llbuf:write_raw("]")
- f:write_i(llbuf:finish())
- end
-
- -- description
- f:write_br(true)
- f:write_raw("> ")
- write_description(f, impl, func, cl)
-
- -- code snippets
- f:write_nl()
- local codes = {}
- if func:type_get() ~= dtree.Function.PROPERTY then
- codes[#codes + 1] = gen_func_mono_sig(func, func:type_get())
- else
- codes[#codes + 1] = gen_func_mono_sig(func, dtree.Function.PROP_GET)
- codes[#codes + 1] = gen_func_mono_sig(func, dtree.Function.PROP_SET)
- end
- f:write_code(table.concat(codes, "\n"), "c")
- f:write_br(true)
- end
- f:write_nl()
-end
-
-M.build_class = function(cl)
- local cln = cl:nspaces_get()
- local fulln = cl:name_get()
- --table.insert(cln, "mono")
- cln[#cln] = cln[#cln] .. "_mono"
- --printgen("Generating (MONO) class: " .. fulln .. " in ns ", unpack(cln))
- local f = writer.Writer(cln, fulln .. " (mono)")
- f:write_h(cl:name_get() .. " (" .. cl:type_str_get() .. ")", 1)
-
- f:write_h("Description", 2)
- f:write_raw(cl:doc_get():full_get(nil, true))
- f:write_nl(2)
-
- f:write_editable(cln, "description")
- f:write_nl()
-
- local inherits = cl:inherits_get()
- if #inherits ~= 0 then
- f:write_h("Inheritance", 2)
-
- f:write_raw(M.build_inherit_summary(inherits[1]):finish())
- f:write_nl()
-
- f:write_folded("Full hierarchy", function()
- f:write_list(M.build_inherits(cl))
- end)
- f:write_nl()
- end
-
- local written = {}
- local ievs = {}
- local meths, omeths = {}, {}
- for i, impl in ipairs(cl:implements_get()) do
- local func = impl:function_get()
- written[func:id_get()] = true
- meths[#meths + 1] = { cl, impl }
- end
- find_callables(cl, omeths, ievs, written)
-
- f:write_h("Members", 2)
- M.write_functable(f, cl, meths, true)
- if #omeths ~= 0 then
- f:write_h("Inherited", 3)
- end
- M.write_inherit_functable(f, cl, omeths, false)
-
- f:finish()
-end
-
-return M
-
-
diff --git a/src/scripts/elua/apps/docgen/stats.lua b/src/scripts/elua/apps/docgen/stats.lua
deleted file mode 100644
index 9659f86dcd..0000000000
--- a/src/scripts/elua/apps/docgen/stats.lua
+++ /dev/null
@@ -1,274 +0,0 @@
-local is_verbose = false
-
-local M = {}
-
-local stats = {}
-
-local stats_pd = function(n)
- local ret = 0
- if n == 0 then
- return 1
- end
- while (n ~= 0) do
- n = math.floor(n / 10)
- ret = ret + 1
- end
- return ret
-end
-
-local fcol = 30
-local ncol = 0
-
-local get_percent = function(sv, svu)
- return (sv == 0) and 100 or math.floor(((sv - svu) / sv) * 100 + 0.5)
-end
-
-local print_stat = function(printname, statname)
- local sv = stats[statname] or 0
- local svu = stats[statname .. "_undoc"] or 0
- local percent = get_percent(sv, svu)
- local tb = (" "):rep(math.max(0, fcol - #printname - 1) + ncol - stats_pd(sv))
- local dtb = (" "):rep(ncol - stats_pd(sv - svu))
- local ptb = (" "):rep(3 - stats_pd(percent))
- print(("%s:%s%d (documented: %s%d or %s%d%%)")
- :format(printname, tb, sv, dtb, sv - svu, ptb, percent))
-end
-
-local get_secstats = function(...)
- local sv, svu = 0, 0
- for i, v in ipairs({ ... }) do
- sv = sv + (stats[v] or 0)
- svu = svu + (stats[v .. "_undoc"] or 0)
- end
- return sv - svu, sv, get_percent(sv, svu)
-end
-
-M.print = function()
- for k, v in pairs(stats) do
- ncol = math.max(ncol, stats_pd(v))
- end
-
- print(("=== CLASS SECTION: %d out of %d (%d%%) ===\n")
- :format(get_secstats("class", "interface", "mixin", "event")))
- print_stat("Classes", "class")
- print_stat("Interfaces", "interface")
- print_stat("Mixins", "mixin")
- print_stat("Events", "event")
-
- print(("\n=== FUNCTION SECTION: %d out of %d (%d%%) ===\n")
- :format(get_secstats("method", "param", "mret",
- "getter", "gret", "gkey", "gvalue",
- "setter", "sret", "skey", "svalue")))
- print_stat("Methods", "method")
- print_stat(" Method params", "param")
- print_stat(" Method returns", "mret")
- print_stat("Getters", "getter")
- print_stat(" Getter returns", "gret")
- print_stat(" Getter keys", "gkey")
- print_stat(" Getter values", "gvalue")
- print_stat("Setters", "setter")
- print_stat(" Setter returns", "sret")
- print_stat(" Setter keys", "skey")
- print_stat(" Setter values", "svalue")
-
- print(("\n=== TYPE SECTION: %d out of %d (%d%%) ===\n")
- :format(get_secstats("alias", "struct", "sfield", "enum", "efield")))
- print_stat("Aliases", "alias")
- print_stat("Structs", "struct")
- print_stat("Struct fields", "sfield")
- print_stat("Enums", "enum")
- print_stat("Enum fields", "efield")
-
- print(("\n=== VARIABLE SECTION: %d out of %d (%d%%) ===\n")
- :format(get_secstats("constant", "global")))
- print_stat("Constants", "constant")
- print_stat("Globals", "global")
-
- local sv, svu = 0, 0
- for k, v in pairs(stats) do
- if k:match(".*_undoc$") then
- svu = svu + v
- else
- sv = sv + v
- end
- end
- print(("\n=== TOTAL: %d out of %d (%d%%) ===")
- :format(sv - svu, sv, get_percent(sv, svu)))
-end
-
-local stat_incr = function(name, missing)
- if not stats[name] then
- stats[name], stats[name .. "_undoc"] = 0, 0
- end
- stats[name] = stats[name] + 1
- if missing then
- stats[name .. "_undoc"] = stats[name .. "_undoc"] + 1
- end
-end
-
-local print_missing = function(name, tp)
- if not is_verbose then
- return
- end
- print(tp .. " '" .. name .. "'" .. " missing documentation")
-end
-
-M.check_class = function(cl)
- local ct = cl:type_str_get()
- if not ct then
- return
- end
- if not cl:doc_get():exists() then
- print_missing(cl:name_get(), ct)
- stat_incr(ct, true)
- else
- stat_incr(ct, false)
- end
-
- for i, ev in ipairs(cl:events_get()) do
- if not ev:doc_get():exists() then
- print_missing(cl:name_get() .. "." .. ev:name_get(), "event")
- stat_incr("event", true)
- else
- stat_incr("event", false)
- end
- end
-end
-
-M.check_method = function(fn, cl)
- local fulln = cl:name_get() .. "." .. fn:name_get()
- if fn:return_type_get(fn.METHOD) then
- if not fn:return_doc_get(fn.METHOD):exists() then
- print_missing(fulln, "method return")
- stat_incr("mret", true)
- else
- stat_incr("mret", false)
- end
- end
- if not fn:implement_get():doc_get(fn.METHOD):exists() then
- print_missing(fulln, "method")
- stat_incr("method", true)
- else
- stat_incr("method", false)
- end
- for i, p in ipairs(fn:parameters_get()) do
- if not p:doc_get():exists() then
- print_missing(fulln .. "." .. p:name_get(), "method parameter")
- stat_incr("param", true)
- else
- stat_incr("param", false)
- end
- end
-end
-
-M.check_property = function(fn, cl, ft)
- local pfxs = {
- [fn.PROP_GET] = "g",
- [fn.PROP_SET] = "s",
- }
- local pfx = pfxs[ft]
-
- local fulln = cl:name_get() .. "." .. fn:name_get()
- if fn:return_type_get(ft) then
- if not fn:return_doc_get(ft):exists() then
- print_missing(fulln, pfx .. "etter return")
- stat_incr(pfx .. "ret", true)
- else
- stat_incr(pfx .. "ret", false)
- end
- end
-
- local pimp = fn:implement_get()
-
- if not pimp:doc_get(fn.PROPERTY):exists() and not pimp:doc_get(ft):exists() then
- print_missing(fulln, pfx .. "etter")
- stat_incr(pfx .. "etter", true)
- else
- stat_incr(pfx .. "etter", false)
- end
-
- for i, p in ipairs(fn:property_keys_get(ft)) do
- if not p:doc_get():exists() then
- print_missing(fulln .. "." .. p:name_get(), pfx .. "etter key")
- stat_incr(pfx .. "key", true)
- else
- stat_incr(pfx .. "key", false)
- end
- end
-
- for i, p in ipairs(fn:property_values_get(ft)) do
- if not p:doc_get():exists() then
- print_missing(fulln .. "." .. p:name_get(), pfx .. "etter value")
- stat_incr(pfx .. "value", true)
- else
- stat_incr(pfx .. "value", false)
- end
- end
-end
-
-M.check_alias = function(v)
- if not v:doc_get():exists() then
- print_missing(v:name_get(), "alias")
- stat_incr("alias", true)
- else
- stat_incr("alias", false)
- end
-end
-
-M.check_struct = function(v)
- if not v:doc_get():exists() then
- print_missing(v:name_get(), "struct")
- stat_incr("struct", true)
- else
- stat_incr("struct", false)
- end
- for i, fl in ipairs(v:struct_fields_get()) do
- if not fl:doc_get():exists() then
- print_missing(v:name_get() .. "." .. fl:name_get(), "struct field")
- stat_incr("sfield", true)
- else
- stat_incr("sfield", false)
- end
- end
-end
-
-M.check_enum = function(v)
- if not v:doc_get():exists() then
- print_missing(v:name_get(), "enum")
- stat_incr("enum", true)
- else
- stat_incr("enum", false)
- end
- for i, fl in ipairs(v:enum_fields_get()) do
- if not fl:doc_get():exists() then
- print_missing(v:name_get() .. "." .. fl:name_get(), "enum field")
- stat_incr("efield", true)
- else
- stat_incr("efield", false)
- end
- end
-end
-
-M.check_constant = function(v)
- if not v:doc_get():exists() then
- print_missing(v:name_get(), "constant")
- stat_incr("constant", true)
- else
- stat_incr("constant", false)
- end
-end
-
-M.check_global = function(v)
- if not v:doc_get():exists() then
- print_missing(v:name_get(), "global")
- stat_incr("global", true)
- else
- stat_incr("global", false)
- end
-end
-
-M.init = function(verbose)
- is_verbose = verbose
-end
-
-return M
diff --git a/src/scripts/elua/apps/docgen/util.lua b/src/scripts/elua/apps/docgen/util.lua
deleted file mode 100644
index 65968ac3e7..0000000000
--- a/src/scripts/elua/apps/docgen/util.lua
+++ /dev/null
@@ -1,50 +0,0 @@
-local cutil = require("cutil")
-local ffi = require("ffi")
-
-local M = {}
-
-local doc_root, root_ns
-
-local path_sep, rep_sep = "/", "\\"
-if ffi.os == "Windows" then
- path_sep, rep_sep = rep_sep, path_sep
-end
-
-M.path_join = function(...)
- return (table.concat({ ... }, path_sep):gsub(rep_sep, path_sep))
-end
-
-M.path_to_nspace = function(p)
- return p:gsub(rep_sep, ":"):gsub(path_sep, ":"):lower()
-end
-
-M.nspace_to_path = function(ns)
- return ns:gsub(":", path_sep):gsub(rep_sep, path_sep):lower()
-end
-
-M.make_page = function(path, ext)
- return M.path_join(doc_root, path .. "." .. ext)
-end
-
-M.get_root_ns = function()
- return root_ns
-end
-
-M.mkdir_r = function(dirn)
- assert(cutil.file_mkpath(M.path_join(doc_root, dirn)))
-end
-
-M.mkdir_p = function(path)
- M.mkdir_r(path:match("(.+)" .. path_sep .. "([^" .. path_sep .. "]+)"))
-end
-
-M.rm_root = function()
- cutil.file_rmrf(doc_root)
-end
-
-M.init = function(root, rns)
- doc_root = root:gsub(rep_sep, path_sep)
- root_ns = rns
-end
-
-return M
diff --git a/src/scripts/elua/apps/docgen/writer.lua b/src/scripts/elua/apps/docgen/writer.lua
deleted file mode 100644
index 2aeadf8da7..0000000000
--- a/src/scripts/elua/apps/docgen/writer.lua
+++ /dev/null
@@ -1,397 +0,0 @@
-local util = require("util")
-
-local dutil = require("docgen.util")
-local dtree = require("docgen.doctree")
-
-local M = {}
-
-local root_nspace, features
-
-M.has_feature = function(fname)
- if not features then
- return false
- end
- return not not features[fname]
-end
-
-local allowed_incflags = {
- noheader = { "noheader", "showheader" },
- firstseconly = { "firstseconly", "fullpage" },
- readmore = { "readmore", "noreadmore" },
- footer = { "footer", "nofooter" },
- link = { "link", "nolink" },
- permalink = { "permalink", "nopermalink" },
- date = { "date", "nodate" },
- mdate = { "mdate", "nomdate" },
- user = { "user", "nouser" },
- comments = { "comments", "nocomments" },
- linkbacks = { "linkbacks", "nolinkbacks" },
- tags = { "tags", "notags" },
- editbutton = { "editbtn", "noeditbtn" },
- redirect = { "redirect", "noredirect" },
- indent = { "indent", "noindent" },
- linkonly = { "linkonly", "nolinkonly" },
- title = { "title", "notitle" },
- pageexists = { "pageexists", "nopageexists" },
- parlink = { "parlink", "noparlink" },
- order = { { "id", "title", "created", "modified", "indexmenu", "custom" } },
- rsort = { "rsort", "sort" },
- depth = 0,
- inline = true,
- beforeeach = "",
- aftereach = ""
-}
-
-local writers = {}
-
-local Buffer = {
- __ctor = function(self)
- self.buf = {}
- end,
-
- write_raw = function(self, ...)
- for i, v in ipairs({ ... }) do
- self.buf[#self.buf + 1] = v
- end
- return self
- end,
-
- finish = function(self)
- self.result = table.concat(self.buf)
- self.buf = {}
- return self.result
- end
-}
-
-local write_include = function(self, tp, name, flags)
- local it_to_tp = {
- [self.INCLUDE_PAGE] = "page",
- [self.INCLUDE_SECTION] = "section",
- [self.INCLUDE_NAMESPACE] = "namespace",
- [self.INCLUDE_TAG] = "tagtopic"
- }
- if type(name) == "table" then
- if name[#name] == true then
- name[#name] = nil
- name = ":" .. root_nspace .. ":"
- .. table.concat(name, ":")
- elseif name[#name] == false then
- name[#name] = nil
- name = ":" .. root_nspace .. "-include:"
- .. table.concat(name, ":")
- else
- name = table.concat(name, ":")
- end
- end
- self:write_raw("{{", it_to_tp[tp], ">", name);
- if flags then
- if tp == self.INCLUDE_SECTION and flags.section then
- self:write_raw("#", flags.section)
- end
- flags.section = nil
- local flstr = {}
- for k, v in pairs(flags) do
- local allow = allowed_incflags[k]
- if allow ~= nil then
- if type(allow) == "boolean" then
- flstr[#flstr + 1] = k
- elseif type(allow) == "number" or type(allow) == "string" then
- if type(v) ~= type(allow) then
- error("invalid value type for flag " .. k)
- end
- flstr[#flstr + 1] = k .. "=" .. v
- elseif type(allow) == "table" then
- if type(allow[1]) == "table" then
- local valid = false
- for i, vv in ipairs(allow[1]) do
- if v == vv then
- flstr[#flstr + 1] = k .. "=" .. v
- valid = true
- break
- end
- end
- if not valid then
- error("invalid value " .. v .. " for flag " .. k)
- end
- elseif type(allow[1]) == "string" and
- type(allow[2]) == "string" then
- if v then
- flstr[#flstr + 1] = allow[1]
- else
- flstr[#flstr + 1] = allow[2]
- end
- end
- end
- else
- error("invalid include flag: " .. tostring(k))
- end
- end
- flstr = table.concat(flstr, "&")
- if #flstr > 0 then
- self:write_raw("&", flstr)
- end
- end
- self:write_raw("}}")
- self:write_nl()
- return self
-end
-
-M.set_backend = function(bend)
- M.Writer = assert(writers[bend], "invalid generation backend")
- M.Buffer = M.Writer:clone(Buffer)
-end
-
-writers["dokuwiki"] = util.Object:clone {
- INCLUDE_PAGE = 0,
- INCLUDE_SECTION = 1,
- INCLUDE_NAMESPACE = 2,
- INCLUDE_TAG = 3,
-
- __ctor = function(self, path, title)
- local subs
- if type(path) == "table" then
- subs = dutil.path_join(unpack(path))
- else
- subs = dutil.nspace_to_path(path)
- end
- dutil.mkdir_p(subs)
- self.file = assert(io.open(dutil.make_page(subs, "txt"), "w"))
- if title then
- if M.has_feature("title") then
- self:write_raw("~~Title: ", title, "~~")
- self:write_nl()
- else
- self:write_h(title, 1)
- end
- end
- end,
-
- write_raw = function(self, ...)
- self.file:write(...)
- return self
- end,
-
- write_nl = function(self, n)
- self:write_raw(("\n"):rep(n or 1))
- return self
- end,
-
- write_h = function(self, heading, level, nonl)
- local s = ("="):rep(7 - level)
- self:write_raw(s, " ", heading, " ", s, "\n")
- if not nonl then
- self:write_nl()
- end
- return self
- end,
-
- write_include = function(self, tp, name, flags)
- return write_include(self, tp, name, flags)
- end,
-
- write_editable = function(self, ns, name)
- ns[#ns + 1] = name
- ns[#ns + 1] = false
- self:write_include(self.INCLUDE_PAGE, ns, {
- date = false, user = false, link = false
- })
- -- restore the table for later reuse
- -- the false gets deleted by write_include
- ns[#ns] = nil
- end,
-
- write_inherited = function(self, ns)
- ns[#ns + 1] = true
- self:write_include(self.INCLUDE_PAGE, ns, {
- editbutton = false, date = false, user = false, link = false
- })
- end,
-
- write_fmt = function(self, fmt1, fmt2, ...)
- self:write_raw(fmt1, ...)
- self:write_raw(fmt2)
- return self
- end,
-
- write_b = function(self, ...)
- self:write_fmt("**", "**", ...)
- return self
- end,
-
- write_i = function(self, ...)
- self:write_fmt("//", "//", ...)
- return self
- end,
-
- write_u = function(self, ...)
- self:write_fmt("__", "__", ...)
- return self
- end,
-
- write_s = function(self, ...)
- self:write_fmt("<del>", "</del>", ...)
- return self
- end,
-
- write_m = function(self, ...)
- self:write_fmt("''", "''", ...)
- return self
- end,
-
- write_sub = function(self, ...)
- self:write_fmt("<sub>", "</sub>", ...)
- return self
- end,
-
- write_sup = function(self, ...)
- self:write_fmt("<sup>", "</sup>", ...)
- return self
- end,
-
- write_br = function(self, nl)
- self:write_raw("\\\\", nl and "\n" or " ")
- return self
- end,
-
- write_pre_inline = function(self, ...)
- self:write_fmt("%%", "%%", ...)
- return self
- end,
-
- write_pre = function(self, ...)
- self:write_fmt("<nowiki>\n", "\n</nowiki>", ...)
- return self
- end,
-
- write_code = function(self, str, lang)
- lang = lang and (" " .. lang) or ""
- self:write_raw("<code" .. lang .. ">\n", str, "\n</code>\n")
- end,
-
- write_link = function(self, target, title)
- if type(target) == "table" then
- if target[#target] == false then
- target[#target] = nil
- target = ":" .. root_nspace .. "-include:"
- .. table.concat(target, ":")
- else
- target[#target] = nil
- target = ":" .. root_nspace .. ":"
- .. table.concat(target, ":")
- end
- end
- if not title then
- self:write_raw("[[", target:lower(), "|", target, "]]")
- return
- end
- target = target:lower()
- if type(title) == "string" then
- self:write_raw("[[", target, "|", title, "]]")
- return self
- end
- self:write_raw("[[", target, "|")
- title(self)
- self:write_raw("]]")
- return self
- end,
-
- write_table = function(self, titles, tbl)
- if titles then
- self:write_raw("^ ", table.concat(titles, " ^ "), " ^\n")
- end
- for i, v in ipairs(tbl) do
- self:write_raw("| ", table.concat(v, " | "), " |\n")
- end
- return self
- end,
-
- write_list = function(self, tbl, ord)
- local prec = ord and "-" or "*"
- for i, v in ipairs(tbl) do
- local lvl, str = 1, v
- if type(v) == "table" then
- lvl, str = v[1] + 1, v[2]
- end
- local pbeg, pend = str:match("([^\n]+)\n(.+)")
- if not pbeg then
- pbeg = str
- end
- self:write_raw((" "):rep(lvl), prec, " ", str, "\n")
- if pend then
- self:write_raw(pend, "\n")
- end
- end
- return self
- end,
-
- write_par = function(self, str)
- local tokp = dtree.DocTokenizer(str)
- local notetypes = M.has_feature("notes") and {
- [tokp.MARK_NOTE] = "<note>\n",
- [tokp.MARK_WARNING] = "<note warning>\n",
- [tokp.MARK_REMARK] = "<note tip>\n",
- [tokp.MARK_TODO] = "<note>\n**TODO:** "
- } or {}
- local hasraw, hasnote = false, false
- while tokp:tokenize() do
- local tp = tokp:type_get()
- local tag = notetypes[tp]
- if tag then
- self:write_raw(tag)
- hasnote = true
- else
- if not hasraw then
- self:write_raw("%%")
- hasraw = true
- end
- if tp == tokp.REF then
- local reft = tokp:ref_resolve(true)
- local str = tokp:text_get()
- if str:sub(1, 1) == "[" then
- str = str:sub(2, #str - 1)
- end
- self:write_raw("%%")
- self:write_link(reft, str)
- self:write_raw("%%")
- else
- local str = tokp:text_get()
- assert(str, "internal tokenizer error")
- -- replace possible %% chars
- str = str:gsub("%%%%", "%%%%<nowiki>%%%%</nowiki>%%%%")
- if tp == tokp.MARKUP_MONOSPACE then
- self:write_raw("%%''" .. str .. "''%%")
- else
- self:write_raw(str)
- end
- end
- end
- end
- self:write_raw("%%")
- if hasnote then
- self:write_raw("\n</note>")
- end
- return self
- end,
-
- write_folded = function(self, title, func)
- if M.has_feature("folds") then
- self:write_raw("++++ ", title, " |\n\n")
- end
- func(self)
- if M.has_feature("folds") then
- self:write_raw("\n\n++++")
- end
- return self
- end,
-
- finish = function(self)
- self.file:close()
- end
-}
-
-M.init = function(root_ns, ftrs)
- root_nspace = root_ns
- features = ftrs
-end
-
-return M
diff --git a/src/scripts/elua/apps/gendoc.lua b/src/scripts/elua/apps/gendoc.lua
deleted file mode 100644
index 36c47e2af3..0000000000
--- a/src/scripts/elua/apps/gendoc.lua
+++ /dev/null
@@ -1,1804 +0,0 @@
-local getopt = require("getopt")
-
-local serializer = require("serializer")
-
-local stats = require("docgen.stats")
-local dutil = require("docgen.util")
-local writer = require("docgen.writer")
-local keyref = require("docgen.keyref")
-local dtree = require("docgen.doctree")
-local mono = require("docgen.mono")
-
-local printgen = function() end
-
-local propt_to_type = {
- [dtree.Function.PROPERTY] = "(get, set)",
- [dtree.Function.PROP_GET] = "(get)",
- [dtree.Function.PROP_SET] = "(set)",
-}
-
-local gen_cparam = function(par, out)
- local part = par:type_get()
- out = out or (par:direction_get() == par.OUT)
- local tstr = part:c_type_get()
- if out then
- tstr = dtree.type_cstr_get(tstr, "*")
- end
- return dtree.type_cstr_get(tstr, par:name_get())
-end
-
-local get_func_csig_part = function(cn, tp)
- if not tp then
- return "void " .. cn
- end
- return dtree.type_cstr_get(tp, cn)
-end
-
-local gen_func_csig = function(f, ftype)
- ftype = ftype or f.METHOD
- assert(ftype ~= f.PROPERTY)
-
- local cn = f:full_c_name_get(ftype)
- local rtype = f:return_type_get(ftype)
-
- local fparam = "Eo *obj"
- if f:is_class() then
- fparam = "Efl_Class *klass"
- elseif f:is_const() or ftype == f.PROP_GET then
- fparam = "const Eo *obj"
- end
-
- if f:type_get() == f.METHOD then
- local pars = f:parameters_get()
- local cnrt = get_func_csig_part(cn, rtype)
- for i = 1, #pars do
- pars[i] = gen_cparam(pars[i])
- end
- table.insert(pars, 1, fparam);
- return cnrt .. "(" .. table.concat(pars, ", ") .. ");"
- end
-
- local keys = f:property_keys_get(ftype)
- local vals = f:property_values_get(ftype)
-
- if ftype == f.PROP_SET then
- local cnrt = get_func_csig_part(cn, rtype)
- local pars = {}
- for i, par in ipairs(keys) do
- pars[#pars + 1] = gen_cparam(par)
- end
- for i, par in ipairs(vals) do
- pars[#pars + 1] = gen_cparam(par)
- end
- table.insert(pars, 1, fparam);
- return cnrt .. "(" .. table.concat(pars, ", ") .. ");"
- end
-
- -- getters
- local cnrt
- if not rtype then
- if #vals == 1 then
- cnrt = get_func_csig_part(cn, vals[1]:type_get())
- table.remove(vals, 1)
- else
- cnrt = get_func_csig_part(cn)
- end
- else
- cnrt = get_func_csig_part(cn, rtype)
- end
- local pars = {}
- for i, par in ipairs(keys) do
- pars[#pars + 1] = gen_cparam(par)
- end
- for i, par in ipairs(vals) do
- pars[#pars + 1] = gen_cparam(par, true)
- end
- table.insert(pars, 1, fparam);
- return cnrt .. "(" .. table.concat(pars, ", ") .. ");"
-end
-
-local gen_func_namesig = function(fn, cl, buf, isprop, isget, isset)
- if isprop then
- buf[#buf + 1] = "@property "
- end
- buf[#buf + 1] = fn:name_get()
- buf[#buf + 1] = " "
- if fn:is_beta() then
- buf[#buf + 1] = "@beta "
- end
- if not isprop then
- if fn:scope_get(fn.METHOD) == fn.scope.PROTECTED then
- buf[#buf + 1] = "@protected "
- end
- elseif isget and isset then
- if fn:scope_get(fn.PROP_GET) == fn.scope.PROTECTED and
- fn:scope_get(fn.PROP_SET) == fn.scope.PROTECTED then
- buf[#buf + 1] = "@protected "
- end
- end
- if fn:is_class() then
- buf[#buf + 1] = "@class "
- end
- if fn:is_const() then
- buf[#buf + 1] = "@const "
- end
-end
-
-local gen_func_param = function(fp, buf, nodir)
- -- TODO: default value
- buf[#buf + 1] = " "
- local dirs = {
- [dtree.Parameter.IN] = "@in ",
- [dtree.Parameter.OUT] = "@out ",
- [dtree.Parameter.INOUT] = "@inout ",
- }
- if not nodir then buf[#buf + 1] = dirs[fp:direction_get()] end
- buf[#buf + 1] = fp:name_get()
- buf[#buf + 1] = ": "
- buf[#buf + 1] = fp:type_get():serialize()
- local dval = fp:default_value_get()
- if dval then
- buf[#buf + 1] = " ("
- buf[#buf + 1] = dval:serialize()
- buf[#buf + 1] = ")"
- end
- if fp:is_nonull() then
- buf[#buf + 1] = " @nonull"
- end
- if fp:is_nullable() then
- buf[#buf + 1] = " @nullable"
- end
- if fp:is_optional() then
- buf[#buf + 1] = " @optional"
- end
- buf[#buf + 1] = ";\n"
-end
-
-local gen_func_return = function(fp, ftype, buf, indent)
- local rett = fp:return_type_get(ftype)
- if not rett then
- return
- end
- buf[#buf + 1] = indent and (" "):rep(indent) or " "
- buf[#buf + 1] = "return: "
- buf[#buf + 1] = rett:serialize()
- local dval = fp:return_default_value_get(ftype)
- if dval then
- buf[#buf + 1] = " ("
- buf[#buf + 1] = dval:serialize()
- buf[#buf + 1] = ")"
- end
- if fp:return_is_warn_unused(ftype) then
- buf[#buf + 1] = " @warn_unused"
- end
- buf[#buf + 1] = ";\n"
-end
-
-local gen_method_sig = function(fn, cl)
- local buf = {}
- gen_func_namesig(fn, cl, buf, false, false, false)
-
- local fimp = fn:implement_get()
-
- if fimp:is_pure_virtual(fn.METHOD) then
- buf[#buf + 1] = "@pure_virtual "
- end
- buf[#buf + 1] = "{"
- local params = fn:parameters_get()
- local rtp = fn:return_type_get(fn.METHOD)
- if #params == 0 and not rtp then
- buf[#buf + 1] = "}"
- return table.concat(buf)
- end
- buf[#buf + 1] = "\n"
- if #params > 0 then
- buf[#buf + 1] = " params {\n"
- for i, fp in ipairs(params) do
- gen_func_param(fp, buf)
- end
- buf[#buf + 1] = " }\n"
- end
- gen_func_return(fn, fn.METHOD, buf)
- buf[#buf + 1] = "}"
- return table.concat(buf)
-end
-
-local eovals_check_same = function(a1, a2)
- if #a1 ~= #a2 then return false end
- for i, v in ipairs(a1) do
- if v ~= a2[i] then return false end
- end
- return true
-end
-
-local gen_prop_keyvals = function(tbl, kword, buf, indent)
- local ind = indent and (" "):rep(indent) or " "
- if #tbl == 0 then return end
- buf[#buf + 1] = " "
- buf[#buf + 1] = ind
- buf[#buf + 1] = kword
- buf[#buf + 1] = " {\n"
- for i, v in ipairs(tbl) do
- buf[#buf + 1] = ind
- gen_func_param(v, buf, true)
- end
- buf[#buf + 1] = " "
- buf[#buf + 1] = ind
- buf[#buf + 1] = "}\n"
-end
-
-local gen_prop_sig = function(fn, cl)
- local buf = {}
- local fnt = fn:type_get()
- local isget = (fnt == fn.PROPERTY or fnt == fn.PROP_GET)
- local isset = (fnt == fn.PROPERTY or fnt == fn.PROP_SET)
- gen_func_namesig(fn, cl, buf, true, isget, isset)
-
- local pimp = fn:implement_get()
-
- local gvirt = pimp:is_pure_virtual(fn.PROP_GET)
- local svirt = pimp:is_pure_virtual(fn.PROP_SET)
-
- if (not isget or gvirt) and (not isset or svirt) then
- buf[#buf + 1] = "@pure_virtual "
- end
-
- local gkeys = isget and fn:property_keys_get(fn.PROP_GET) or {}
- local skeys = isset and fn:property_keys_get(fn.PROP_SET) or {}
- local gvals = isget and fn:property_values_get(fn.PROP_GET) or {}
- local svals = isget and fn:property_values_get(fn.PROP_SET) or {}
- local grtt = isget and fn:return_type_get(fn.PROP_GET) or nil
- local srtt = isset and fn:return_type_get(fn.PROP_SET) or nil
-
- local keys_same = eovals_check_same(gkeys, skeys)
- local vals_same = eovals_check_same(gvals, svals)
-
- buf[#buf + 1] = "{\n"
-
- if isget then
- buf[#buf + 1] = " get "
- if fn:scope_get(fn.PROP_GET) == fn.scope.PROTECTED and
- fn:scope_get(fn.PROP_SET) ~= fn.scope.PROTECTED then
- buf[#buf + 1] = "@protected "
- end
- buf[#buf + 1] = "{"
- if (#gkeys == 0 or keys_same) and (#gvals == 0 or vals_same) and
- (not grtt or grtt == srtt) then
- buf[#buf + 1] = "}\n"
- else
- buf[#buf + 1] = "\n"
- if not keys_same then gen_prop_keyvals(gkeys, "keys", buf) end
- if not vals_same then gen_prop_keyvals(gvals, "values", buf) end
- if grtt ~= srtt then
- gen_func_return(fn, fn.PROP_GET, buf, 2)
- end
- buf[#buf + 1] = " }\n"
- end
- end
-
- if isset then
- buf[#buf + 1] = " set "
- if fn:scope_get(fn.PROP_SET) == fn.scope.PROTECTED and
- fn:scope_get(fn.PROP_GET) ~= fn.scope.PROTECTED then
- buf[#buf + 1] = "@protected "
- end
- buf[#buf + 1] = "{"
- if (#skeys == 0 or keys_same) and (#svals == 0 or vals_same) and
- (not srtt or grtt == srtt) then
- buf[#buf + 1] = "}\n"
- else
- buf[#buf + 1] = "\n"
- if not keys_same then gen_prop_keyvals(skeys, "keys", buf) end
- if not vals_same then gen_prop_keyvals(svals, "values", buf) end
- if grtt ~= srtt then
- gen_func_return(fn, fn.PROP_SET, buf, 2)
- end
- buf[#buf + 1] = " }\n"
- end
- end
-
- if keys_same then gen_prop_keyvals(gkeys, "keys", buf, 0) end
- if vals_same then gen_prop_keyvals(gvals, "values", buf, 0) end
-
- buf[#buf + 1] = "}"
- return table.concat(buf)
-end
-
--- builders
-
-local nspaces_group = function(ns)
- if #ns <= 2 then
- return ns[1]
- end
-
- if ns[1] == "efl" and (ns[2] == "class" or ns[2] == "interface" or
- ns[2] == "object" or ns[2] == "promise") then
- return ns[1]
- end
-
- return ns[1] .. "." .. ns[2]
-end
-
-local nspaces_filter = function(items, ns)
- local out = {}
-
- for _, item in ipairs(items) do
- local group = nspaces_group(item:nspaces_get())
- if group == ns then out[#out + 1] = item end
- end
-
- return out
-end
-
-local build_method, build_property, build_event
-
-local build_reftable = function(f, title, ctype, t, iscl)
- if not t or #t == 0 then
- return
- end
-
- local nt = {}
- for i, v in ipairs(t) do
- nt[#nt + 1] = {
- writer.Buffer():write_link(
- iscl and v:nspaces_get(true)
- or dtree.Node.nspaces_get(v, true),
- v:name_get()
- ):finish(),
- v:doc_get():brief_get()
- }
- end
- table.sort(nt, function(v1, v2) return v1[1] < v2[1] end)
- f:write_table({ title, "Brief description" }, nt)
-end
-
-local build_ref_group = function(f, ns, classlist, aliases, structs, enums, consts, globals)
- local classes = {}
- local ifaces = {}
- local mixins = {}
-
- for i, cl in ipairs(classlist) do
- local tp = cl:type_get()
- if tp == dtree.Class.REGULAR or tp == dtree.Class.ABSTRACT then
- classes[#classes + 1] = cl
- elseif tp == dtree.Class.MIXIN then
- mixins[#mixins + 1] = cl
- elseif tp == dtree.Class.INTERFACE then
- ifaces[#ifaces + 1] = cl
- end
- end
-
- local title = ns:gsub("(%l)(%w*)", function(a,b) return a:upper()..b end) --string.sub(ns, 1, 1):upper() .. string.sub(ns, 2):lower()
- f:write_h(title, 2)
-
- build_reftable(f, "Classes", "class", classes, true)
- build_reftable(f, "Interfaces", "interface", ifaces, true)
- build_reftable(f, "Mixins", "mixin", mixins, true)
-
- build_reftable(f, "Aliases", "alias", aliases)
- build_reftable(f, "Structures", "struct", structs)
- build_reftable(f, "Enums", "enum", enums)
- build_reftable(f, "Constants", "constant", consts)
- build_reftable(f, "Globals", "global", globals)
-
- f:write_nl()
-end
-
-local build_ref = function()
- local f = writer.Writer("start", "EFL Reference")
- printgen("Generating reference...")
-
- f:write_editable({ "reference" }, "general")
- f:write_nl()
-
- local classlist = dtree.Class.all_get()
- local aliases = dtree.Typedecl.all_aliases_get()
- local structs = dtree.Typedecl.all_structs_get()
- local enums = dtree.Typedecl.all_enums_get()
- local consts = dtree.Variable.all_constants_get()
- local globals = dtree.Variable.all_globals_get()
-
- grouped = {}
- groups = {}
- for i, cl in ipairs(classlist) do
- local ns = cl:nspaces_get()
- local name = nspaces_group(cl:nspaces_get())
-
- local group = grouped[name]
- if not group then
- group = {}
- grouped[name] = group
- groups[#groups + 1] = name
- end
-
- group[#group + 1] = cl
- end
- table.sort(groups)
-
- for _, ns in ipairs(groups) do
- build_ref_group(f, ns, grouped[ns], nspaces_filter(aliases, ns), nspaces_filter(structs, ns),
- nspaces_filter(enums, ns), nspaces_filter(consts, ns), nspaces_filter(globals, ns))
- end
-
- f:finish()
-end
-
-local build_inherits
-build_inherits = function(cl, t, lvl)
- t = t or {}
- lvl = lvl or 0
- local lbuf = writer.Buffer()
- if lvl > 0 then
- lbuf:write_link(cl:nspaces_get(true), cl:name_get())
- lbuf:write_raw(" ")
- lbuf:write_i("(" .. cl:type_str_get() .. ")")
-
- t[#t + 1] = { lvl - 1, lbuf:finish() }
- end
-
- for i, acl in ipairs(cl:inherits_get()) do
- build_inherits(acl, t, lvl + 1)
- end
- return t
-end
-
-local build_inherit_summary
-build_inherit_summary = function(cl, buf)
- buf = buf or writer.Buffer()
- buf:write_raw(" => ")
-
- buf:write_link(cl:nspaces_get(true), cl:name_get())
- buf:write_raw(" ")
- buf:write_i("(" .. cl:type_str_get() .. ")")
-
- local inherits = cl:inherits_get()
- if #inherits ~= 0 then
- build_inherit_summary(inherits[1], buf)
- end
- return buf
-end
-
-local default_theme_light = {
- classes = {
- regular = {
- style = "filled",
- color = "black",
- fill_color = "white",
- font_color = "black",
- primary_color = "black",
- primary_fill_color = "gray",
- primary_font_color = "black"
- },
- abstract = {
- style = "filled",
- color = "black",
- fill_color = "white",
- font_color = "black",
- primary_color = "black",
- primary_fill_color = "gray",
- primary_font_color = "black"
- },
- mixin = {
- style = "filled",
- color = "blue",
- fill_color = "white",
- font_color = "black",
- primary_color = "blue",
- primary_fill_color = "skyblue",
- primary_font_color = "black"
- },
- interface = {
- style = "filled",
- color = "cornflowerblue",
- fill_color = "white",
- font_color = "black",
- primary_color = "cornflowerblue",
- primary_fill_color = "azure",
- primary_font_color = "black"
- }
- },
- node = {
- shape = "box"
- },
- edge = {
- color = "black"
- },
- bg_color = "transparent",
- rank_dir = "TB",
- size = "6"
-}
-
-local default_theme_dark = {
- classes = {
- regular = {
- style = "filled",
- color = "gray15",
- fill_color = "gray15",
- font_color = "white",
- primary_color = "gray15",
- primary_fill_color = "black",
- primary_font_color = "white"
- },
- abstract = {
- style = "filled",
- color = "gray15",
- fill_color = "gray15",
- font_color = "white",
- primary_color = "gray15",
- primary_fill_color = "black",
- primary_font_color = "white"
- },
- mixin = {
- style = "filled",
- color = "deepskyblue",
- fill_color = "gray15",
- font_color = "white",
- primary_color = "deepskyblue",
- primary_fill_color = "deepskyblue4",
- primary_font_color = "white"
- },
- interface = {
- style = "filled",
- color = "cornflowerblue",
- fill_color = "gray15",
- font_color = "white",
- primary_color = "cornflowerblue",
- primary_fill_color = "dodgerblue4",
- primary_font_color = "white"
- }
- },
- node = {
- shape = "box"
- },
- edge = {
- color = "gray35"
- },
- bg_color = "transparent",
- rank_dir = "TB",
- size = "6"
-}
-
-local current_theme = default_theme_dark
-
-local validate_ctheme = function(tb, name)
- if type(tb.classes[name]) ~= "table" then
- return false
- end
- local t = tb.classes[name]
- if type(t.style) ~= "string" then
- return false
- end
- if type(t.color) ~= "string" then
- return false
- end
- if type(t.fill_color) ~= "string" then
- return false
- end
- if type(t.font_color) ~= "string" then
- return false
- end
- if not t.primary_color then
- t.primary_color = t.color
- end
- if not t.primary_fill_color then
- t.primary_fill_color = t.fill_color
- end
- if not t.primary_font_color then
- t.primary_font_color = t.font_color
- end
- if type(t.primary_color) ~= "string" then
- return false
- end
- if type(t.primary_fill_color) ~= "string" then
- return false
- end
- if type(t.primary_font_color) ~= "string" then
- return false
- end
- return true
-end
-
-local validate_theme = function(tb)
- if type(tb) ~= "table" then
- return false
- end
- if type(tb.classes) ~= "table" then
- return false
- end
- if not tb.node then
- tb.node = current_theme.node
- end
- if not tb.edge then
- tb.edge = current_theme.edge
- end
- if not tb.bg_color then
- tb.bg_color = current_theme.bg_color
- end
- if not tb.rank_dir then
- tb.rank_dir = current_theme.rank_dir
- end
- if not tb.size then
- tb.size = current_theme.size
- end
- if type(tb.node) ~= "table" then
- return false
- end
- if type(tb.edge) ~= "table" then
- return false
- end
- if type(tb.bg_color) ~= "string" then
- return false
- end
- if type(tb.rank_dir) ~= "string" then
- return false
- end
- if type(tb.size) ~= "string" then
- return false
- end
- if not validate_ctheme(tb, "regular") then
- return false
- end
- if not validate_ctheme(tb, "abstract") then
- return false
- end
- if not validate_ctheme(tb, "mixin") then
- return false
- end
- if not validate_ctheme(tb, "interface") then
- return false
- end
- return true
-end
-
-local set_theme = function(tname)
- local tf = io.open(tname)
- if tf then
- local cont = tf:read("*all")
- tf:close()
- local tb, err = serializer.deserialize(cont)
- if not tb then
- error("error parsing theme '" .. tname .. "': " .. err)
- end
- if not validate_theme(tb) then
- error("invalid theme '" .. tname .. "'")
- end
- current_theme = tb
- else
- error("theme '" .. tname .. "' does not exist")
- end
-end
-
-local find_parent_impl
-find_parent_impl = function(fulln, cl)
- for i, pcl in ipairs(cl:inherits_get()) do
- for j, impl in ipairs(pcl:implements_get()) do
- if impl:name_get() == fulln then
- return impl, pcl
- end
- end
- local pimpl, pcl = find_parent_impl(fulln, pcl)
- if pimpl then
- return pimpl, pcl
- end
- end
- return nil, cl
-end
-
-local find_parent_briefdoc
-find_parent_briefdoc = function(fulln, cl)
- local pimpl, pcl = find_parent_impl(fulln, cl)
- if not pimpl then
- return dtree.Doc():brief_get()
- end
- local pdoc = pimpl:doc_get(dtree.Function.METHOD, true)
- local pdocf = pimpl:fallback_doc_get(true)
- if not pdoc:exists() and (not pdocf or not pdocf:exists()) then
- return find_parent_briefdoc(fulln, pcl)
- end
- return pdoc:brief_get(pdocf)
-end
-
-local build_functable = function(f, tcl, tbl)
- if #tbl == 0 then
- return
- end
- local nt = {}
- for i, implt in ipairs(tbl) do
- local lbuf = writer.Buffer()
-
- local cl, impl = unpack(implt)
- local func = impl:function_get()
-
- local wt = {}
- wt[0] = cl
- wt[1] = func
- wt[2] = impl
-
- nt[#nt + 1] = wt
- end
-
- local get_best_scope = function(f)
- local ft = f:type_get()
- if ft == f.PROPERTY then
- local fs1, fs2 = f:scope_get(f.PROP_GET), f:scope_get(f.PROP_SET)
- if fs1 == f.scope.PUBLIC or fs2 == f.scope.PUBLIC then
- return f.scope.PUBLIC
- elseif fs1 == f.scope.PROTECTED or fs2 == f.scope.PROTECTED then
- return f.scope.PROTECTED
- else
- return f.scope.PRIVATE
- end
- else
- return f:scope_get(ft)
- end
- end
- table.sort(nt, function(v1, v2)
- local cl1, cl2 = v1[0], v2[0]
- if cl1 ~= cl2 then
- return cl1:name_get() < cl2:name_get()
- end
-
- local f1, f2 = v1[1], v2[1]
- local f1s, f2s = get_best_scope(f1), get_best_scope(f2)
- if f1s ~= f2s then
- if f1s ~= f1.scope.PROTECED then
- -- public funcs go first, private funcs go last
- return f1s == f1.scope.PUBLIC
- else
- -- protected funcs go second
- return f2s == f2.scope.PRIVATE
- end
- end
- return f1:name_get() < f2:name_get()
- end)
-
- return nt
-end
-
-local write_description = function(f, impl, func, cl)
- local over = impl:is_overridden(cl)
- local bdoc
-
- local doc = impl:doc_get(func.METHOD, true)
- local docf = impl:fallback_doc_get(true)
- if over and (not doc:exists() and (not docf or not docf:exists())) then
- bdoc = find_parent_briefdoc(impl:name_get(), cl)
- else
- bdoc = doc:brief_get(docf)
- end
- if bdoc ~= "No description supplied." then
- f:write_raw(bdoc)
- end
-end
-
-local write_function = function(f, func, cl)
- local llbuf = writer.Buffer()
- llbuf:write_link(func:nspaces_get(cl, true), func:name_get())
- f:write_b(llbuf:finish())
-
- local pt = propt_to_type[func:type_get()]
- if pt then
- f:write_raw(" ")
- local llbuf = writer.Buffer()
- llbuf:write_b(pt)
- f:write_i(llbuf:finish())
- end
-end
-
-local write_scope = function(f, func)
- local ftt = {
- [func.scope.PROTECTED] = "protected",
- [func.scope.PRIVATE] = "private"
- }
- if func:is_class() then
- f:write_raw(" ")
- f:write_m("class")
- end
- if func:type_get() == func.PROPERTY then
- local ft1, ft2 = ftt[func:scope_get(func.PROP_GET)],
- ftt[func:scope_get(func.PROP_SET)]
- if ft1 and ft1 == ft2 then
- f:write_raw(" ")
- f:write_m(ft1)
- elseif ft1 or ft2 then
- local s = ""
- if ft1 then
- s = s .. ft1 .. " get" .. (ft2 and ", " or "")
- end
- if ft2 then
- s = s .. ft2 .. " set"
- end
- f:write_raw(" ")
- f:write_m(s)
- end
- else
- local ft = ftt[func:scope_get(func:type_get())]
- if ft then
- f:write_raw(" ")
- f:write_m(ft)
- end
- end
-end
-
-local write_functable = function(f, tcl, tbl)
- if #tbl == 0 then
- return
- end
- local nt = build_functable(t, tcl, tbl)
-
- local wrote = false
- for i, wt in ipairs(nt) do
- local cl = wt[0]
- local func = wt[1]
- local impl = wt[2]
-
- local ocl = impl:class_get()
- local func = impl:function_get()
- local over = impl:is_overridden(cl)
-
- -- function
- write_function(f, func, cl)
- -- scope
- write_scope(f, func)
-
- -- overrides
- if over then
- -- TODO: possibly also mention which part of a property was
- -- overridden and where, get/set override point might differ!
- -- but we get latest doc every time so it's ok for now
- local llbuf = writer.Buffer()
- llbuf:write_raw(" [Overridden from ")
- llbuf:write_link(ocl:nspaces_get(true), ocl:name_get())
- llbuf:write_raw("]")
- f:write_i(llbuf:finish())
- end
-
- -- description
- f:write_br(true)
- f:write_raw("> ")
- write_description(f, impl, func, cl)
-
- -- code snippets
- f:write_nl()
- local codes = {}
- if func:type_get() ~= dtree.Function.PROPERTY then
- codes[#codes + 1] = gen_func_csig(func, func:type_get())
- else
- codes[#codes + 1] = gen_func_csig(func, dtree.Function.PROP_GET)
- codes[#codes + 1] = gen_func_csig(func, dtree.Function.PROP_SET)
- end
- f:write_code(table.concat(codes, "\n"), "c")
- f:write_br(true)
-
- if cl == tcl then
- if impl:is_prop_get() or impl:is_prop_set() then
- build_property(impl, cl)
- else
- build_method(impl, cl)
- end
- end
- end
- f:write_nl()
-end
-
-local write_inherit_functable = function(f, tcl, tbl)
- if #tbl == 0 then
- return
- end
- local nt = build_functable(t, tcl, tbl)
-
- local prevcl = tcl
- for i, wt in ipairs(nt) do
- local cl = wt[0]
- local func = wt[1]
- local impl = wt[2]
-
- local ocl = impl:class_get()
- local func = impl:function_get()
-
- -- class grouping for inheritance
- if cl ~= prevcl then
- prevcl = cl
- f:write_raw("^ ")
- f:write_link(cl:nspaces_get(true), cl:name_get())
- f:write_raw(" ^^^")
- f:write_nl()
- end
-
- -- scope
- f:write_raw("| ")
- write_scope(f, func)
- f:write_raw(" | ")
- -- function
- write_function(f, func, cl)
- f:write_raw(" | ")
- -- description
- write_description(f, impl, func, cl)
- f:write_raw(" |")
- f:write_nl()
- end
- f:write_nl()
-end
-
--- finds all stuff that is callable on a class, respecting
--- overrides and not duplicating, does a depth-first search
-local find_callables
-find_callables = function(cl, omeths, events, written)
- for i, pcl in ipairs(cl:inherits_get()) do
- for j, impl in ipairs(pcl:implements_get()) do
- local func = impl:function_get()
- local fid = func:id_get()
- if not written[fid] then
- omeths[#omeths + 1] = { pcl, impl }
- written[fid] = true
- end
- end
- for i, ev in ipairs(pcl:events_get()) do
- local evid = ev:name_get()
- if not written[evid] then
- events[#events + 1] = { pcl, ev }
- written[evid] = true
- end
- end
- find_callables(pcl, omeths, events, written)
- end
-end
-
-local build_evcsig = function(ev)
- local csbuf = { ev:c_name_get(), "(" }
- csbuf[#csbuf + 1] = dtree.type_cstr_get(ev:type_get())
- if ev:is_beta() then
- csbuf[#csbuf + 1] = ", @beta"
- end
- if ev:is_hot() then
- csbuf[#csbuf + 1] = ", @hot"
- end
- if ev:is_restart() then
- csbuf[#csbuf + 1] = ", @restart"
- end
- csbuf[#csbuf + 1] = ")";
- return table.concat(csbuf)
-end
-
-local build_evtable = function(f, tcl, tbl, newm)
- if #tbl == 0 then
- return
- end
- local nt = {}
- for i, evt in ipairs(tbl) do
- local lbuf = writer.Buffer()
- local evn
- local cl, ev
- if not newm then
- cl, ev = evt[1], evt[2]
- else
- cl, ev = tcl, evt
- end
-
- local wt = {}
- wt[0] = cl
- wt[1] = ev
- wt[2] = ev:name_get()
-
- nt[#nt + 1] = wt
- end
-
- table.sort(nt, function(v1, v2)
- if v1[0] ~= v2[0] then
- return v1[0]:name_get() < v2[0]:name_get()
- end
-
- return v1[2] < v2[2]
- end)
-
- return nt
-end
-
-local write_event_scope = function(f, ev)
- local ett = {
- [ev.scope.PROTECTED] = "protected",
- [ev.scope.PRIVATE] = "private"
- }
- local ets = ett[ev:scope_get()]
- if ets then
- f:write_raw(" ")
- f:write_m(ets)
- end
-end
-
-local write_evtable = function(f, tcl, tbl)
- if #tbl == 0 then
- return
- end
- local nt = build_evtable(f, tcl, tbl, true)
- for i, wt in ipairs(nt) do
- local evn
- local cl, ev = wt[0], wt[1]
-
- local llbuf = writer.Buffer()
- llbuf:write_link(ev:nspaces_get(cl, true), wt[2])
- f:write_b(llbuf:finish())
-
- -- scope
- write_event_scope(f, ev)
-
- -- description
- local bdoc = ev:doc_get():brief_get()
- if bdoc ~= "No description supplied." then
- f:write_br(true)
- f:write_raw("> ")
- f:write_raw(bdoc)
- end
-
- f:write_nl()
- f:write_code(build_evcsig(ev), "c");
- f:write_br()
-
- if cl == tcl then
- build_event(ev, cl)
- end
- end
-end
-
-
-local write_inherit_evtable = function(f, tcl, tbl)
- if #tbl == 0 then
- return
- end
- local nt = build_evtable(f, tcl, tbl, false)
- local prevcl
- for i, wt in ipairs(nt) do
- local evn
- local cl, ev = wt[0], wt[1]
-
- if cl ~= prevcl then
- prevcl = cl
- f:write_raw("^ ")
- f:write_link(cl:nspaces_get(true), cl:name_get())
- f:write_raw(" ^^^")
- f:write_nl()
- end
-
- f:write_raw("| ")
- -- scope
- write_event_scope(f, ev)
- f:write_raw(" | ")
-
- local llbuf = writer.Buffer()
- llbuf:write_link(ev:nspaces_get(cl, true), wt[2])
- f:write_b(llbuf:finish())
-
- f:write_raw(" | ")
- local bdoc = ev:doc_get():brief_get()
- if bdoc ~= "No description supplied." then
- f:write_raw(bdoc)
- end
-
- f:write_raw(" |")
- f:write_nl()
- end
-end
-
-local build_class = function(cl)
- local cln = cl:nspaces_get()
- local fulln = cl:name_get()
- local f = writer.Writer(cln, fulln)
- printgen("Generating class: " .. fulln)
-
- mono.build_class(cl)
-
- f:write_h(cl:name_get() .. " (" .. cl:type_str_get() .. ")", 1)
-
- f:write_h("Description", 2)
- f:write_raw(cl:doc_get():full_get(nil, true))
- f:write_nl(2)
-
- f:write_editable(cln, "description")
- f:write_nl()
-
- local inherits = cl:inherits_get()
- if #inherits ~= 0 then
- f:write_h("Inheritance", 2)
-
- f:write_raw(build_inherit_summary(inherits[1]):finish())
- f:write_nl()
-
- f:write_folded("Full hierarchy", function()
- f:write_list(build_inherits(cl))
- end)
- f:write_nl()
- end
-
- local written = {}
- local ievs = {}
- local meths, omeths = {}, {}
- for i, impl in ipairs(cl:implements_get()) do
- local func = impl:function_get()
- written[func:id_get()] = true
- meths[#meths + 1] = { cl, impl }
- end
- find_callables(cl, omeths, ievs, written)
-
- f:write_h("Members", 2)
- write_functable(f, cl, meths, true)
- if #omeths ~= 0 then
- f:write_h("Inherited", 3)
- end
- write_inherit_functable(f, cl, omeths, false)
-
- f:write_h("Events", 2)
- write_evtable(f, cl, cl:events_get(), true)
- if #ievs ~= 0 then
- f:write_h("Inherited", 3)
- end
- write_inherit_evtable(f, cl, ievs, false)
-
- f:finish()
-end
-
-local build_classes = function()
- for i, cl in ipairs(dtree.Class.all_get()) do
- build_class(cl)
- end
-end
-
-local write_tsigs = function(f, tp, ns)
- f:write_h("Signature", 2)
- f:write_code(tp:serialize())
- f:write_nl()
-
- f:write_h("C signature", 2)
- f:write_code(tp:serialize_c(ns), "c")
- f:write_nl()
-end
-
-local build_alias = function(tp)
- local ns = dtree.Node.nspaces_get(tp)
- local fulln = tp:name_get()
- local f = writer.Writer(ns, fulln)
- printgen("Generating alias: " .. fulln)
-
- f:write_h("Description", 2)
- f:write_raw(tp:doc_get():full_get(nil, true))
- f:write_nl(2)
-
- f:write_editable(ns, "description")
- f:write_nl()
-
- write_tsigs(f, tp, ns)
-
- f:finish()
-end
-
-local build_struct = function(tp)
- local ns = dtree.Node.nspaces_get(tp)
- local fulln = tp:name_get()
- local f = writer.Writer(ns, fulln)
- printgen("Generating struct: " .. fulln)
-
- f:write_h("Description", 2)
- f:write_raw(tp:doc_get():full_get(nil, true))
- f:write_nl(2)
-
- f:write_editable(ns, "description")
- f:write_nl()
-
- f:write_h("Fields", 2)
-
- f:write_editable(ns, "fields")
- f:write_nl()
-
- local arr = {}
- for i, fl in ipairs(tp:struct_fields_get()) do
- local buf = writer.Buffer()
- buf:write_b(fl:name_get())
- buf:write_raw(" - ", fl:doc_get():full_get())
- arr[#arr + 1] = buf:finish()
- end
- f:write_list(arr)
- f:write_nl()
-
- write_tsigs(f, tp, ns)
-
- f:finish()
-end
-
-local build_enum = function(tp)
- local ns = dtree.Node.nspaces_get(tp)
- local fulln = tp:name_get()
- local f = writer.Writer(ns, fulln)
- printgen("Generating enum: " .. fulln)
-
- f:write_h("Description", 2)
- f:write_raw(tp:doc_get():full_get(nil, true))
- f:write_nl(2)
-
- f:write_editable(ns, "description")
- f:write_nl()
-
- f:write_h("Fields", 2)
-
- f:write_editable(ns, "fields")
- f:write_nl()
-
- local arr = {}
- for i, fl in ipairs(tp:enum_fields_get()) do
- local buf = writer.Buffer()
- buf:write_b(fl:name_get())
- buf:write_raw(" - ", fl:doc_get():full_get())
- arr[#arr + 1] = buf:finish()
- end
- f:write_list(arr)
- f:write_nl()
-
- write_tsigs(f, tp, ns)
-
- f:finish()
-end
-
-local build_variable = function(v, constant)
- local ns = v:nspaces_get()
- local fulln = v:name_get()
- local f = writer.Writer(ns, fulln)
- printgen("Generating variable: " .. fulln)
-
- f:write_h("Description", 2)
- f:write_raw(v:doc_get():full_get(nil, true))
- f:write_nl(2)
-
- f:write_editable(ns, "description")
- f:write_nl()
-
- write_tsigs(f, v, ns)
-
- f:finish()
-end
-
-local build_typedecls = function()
- for i, tp in ipairs(dtree.Typedecl.all_aliases_get()) do
- build_alias(tp)
- end
-
- for i, tp in ipairs(dtree.Typedecl.all_structs_get()) do
- build_struct(tp)
- end
-
- for i, tp in ipairs(dtree.Typedecl.all_enums_get()) do
- build_enum(tp)
- end
-end
-
-local build_variables = function()
- for i, v in ipairs(dtree.Variable.all_constants_get()) do
- build_variable(v, true)
- end
-
- for i, v in ipairs(dtree.Variable.all_globals_get()) do
- build_variable(v, false)
- end
-end
-
-local build_parlist = function(f, pl, nodir)
- local params = {}
- for i, p in ipairs(pl) do
- local buf = writer.Buffer()
- buf:write_b(p:name_get())
- if not nodir then
- buf:write_raw(" ")
- buf:write_i("(", p:direction_name_get(), ")")
- end
- buf:write_raw(" - ", p:doc_get():full_get())
- params[#params + 1] = buf:finish()
- end
- f:write_list(params)
-end
-
-local build_vallist = function(f, pg, ps, title)
- if #pg == #ps then
- local same = true
- for i = 1, #pg do
- if not pg[i]:is_same(ps[i]) then
- same = false
- break
- end
- end
- if same then ps = {} end
- end
- if #pg > 0 or #ps > 0 then
- f:write_h(title, 2)
- if #pg > 0 then
- if #ps > 0 then
- f:write_h("Getter", 3)
- end
- build_parlist(f, pg, true)
- end
- if #ps > 0 then
- if #pg > 0 then
- f:write_h("Setter", 3)
- end
- build_parlist(f, ps, true)
- end
- end
-end
-
-local find_parent_doc
-find_parent_doc = function(fulln, cl, ftype)
- local pimpl, pcl = find_parent_impl(fulln, cl)
- if not pimpl then
- return dtree.Doc()
- end
- local pdoc = pimpl:doc_get(ftype)
- if not pdoc:exists() then
- return find_parent_doc(fulln, pcl, ftype)
- end
- return pdoc
-end
-
-local write_inherited_from = function(f, impl, cl, over, prop)
- if not over then
- return
- end
- local buf = writer.Buffer()
- buf:write_raw("Overridden from ")
- local pimpl, pcl = find_parent_impl(impl:name_get(), cl)
- buf:write_link(
- impl:function_get():nspaces_get(pcl, true), impl:name_get()
- )
- if prop then
- buf:write_raw(" ")
- local lbuf = writer.Buffer()
- lbuf:write_raw("(")
- if impl:is_prop_get() then
- lbuf:write_raw("get")
- if impl:is_prop_set() then
- lbuf:write_raw(", ")
- end
- end
- if impl:is_prop_set() then
- lbuf:write_raw("set")
- end
- lbuf:write_raw(")")
- buf:write_b(lbuf:finish())
- end
- buf:write_raw(".")
- f:write_i(buf:finish())
-end
-
-local impls_of = {}
-
-local get_all_impls_of
-get_all_impls_of = function(tbl, cl, fn, got)
- local cfn = cl:name_get()
- if got[cfn] then
- return
- end
- got[cfn] = true
- for i, imp in ipairs(cl:implements_get()) do
- local ofn = imp:function_get()
- if ofn:is_same(fn) then
- tbl[#tbl + 1] = cl
- break
- end
- end
- for i, icl in ipairs(cl:children_get()) do
- get_all_impls_of(tbl, icl, fn, got)
- end
-end
-
-local write_ilist = function(f, impl, cl)
- local fn = impl:function_get()
- local fnn = fn:name_get()
- local ocl = fn:implement_get():class_get()
- local onm = ocl:name_get() .. "." .. fnn
- local imps = impls_of[onm]
- if not imps then
- imps = {}
- impls_of[onm] = imps
- get_all_impls_of(imps, ocl, fn, {})
- end
-
- f:write_h("Implemented by", 2)
- local t = {}
- for i, icl in ipairs(imps) do
- local buf = writer.Buffer()
- local cfn = icl:name_get() .. "." .. fnn
- if icl:is_same(cl) then
- buf:write_b(cfn)
- else
- buf:write_link(fn:nspaces_get(icl, true), cfn)
- end
- t[#t + 1] = buf:finish()
- end
- f:write_list(t)
-end
-
-build_method = function(impl, cl)
- local over = impl:is_overridden(cl)
- local fn = impl:function_get()
- local mns = fn:nspaces_get(cl)
- local methn = cl:name_get() .. "." .. fn:name_get()
- local f = writer.Writer(mns, methn)
- printgen("Generating method: " .. methn)
-
- local doc = impl:doc_get(fn.METHOD)
- if over and not doc:exists() then
- doc = find_parent_doc(impl:name_get(), cl, fn.METHOD)
- end
-
- f:write_h("Description", 2)
- f:write_raw(doc:full_get(nil, true))
- f:write_nl()
-
- f:write_editable(mns, "description")
- f:write_nl()
-
- write_inherited_from(f, impl, cl, over, false)
-
- f:write_h("Signature", 2)
- f:write_code(gen_method_sig(fn, cl))
- f:write_nl()
-
- f:write_h("C signature", 2)
- f:write_code(gen_func_csig(fn, nil), "c")
- f:write_nl()
-
- local pars = fn:parameters_get()
- if #pars > 0 then
- f:write_h("Parameters", 2)
- build_parlist(f, pars)
- f:write_nl()
- end
-
- write_ilist(f, impl, cl)
- f:write_nl()
-
- f:finish()
-end
-
-build_property = function(impl, cl)
- local over = impl:is_overridden(cl)
- local fn = impl:function_get()
- local pns = fn:nspaces_get(cl)
- local propn = cl:name_get() .. "." .. fn:name_get()
- local f = writer.Writer(pns, propn)
- printgen("Generating property: " .. propn)
-
- local pimp = fn:implement_get()
-
- local isget = pimp:is_prop_get()
- local isset = pimp:is_prop_set()
-
- local doc = impl:doc_get(fn.PROPERTY)
- local gdoc = impl:doc_get(fn.PROP_GET)
- local sdoc = impl:doc_get(fn.PROP_SET)
-
- if over then
- if not doc:exists() then
- doc = find_parent_doc(impl:name_get(), cl, fn.PROPERTY)
- end
- if isget and not gdoc:exists() then
- gdoc = find_parent_doc(impl:name_get(), cl, fn.PROP_GET)
- end
- if isset and not sdoc:exists() then
- sdoc = find_parent_doc(impl:name_get(), cl, fn.PROP_SET)
- end
- end
-
- if isget and isset then
- f:write_h("Description", 2)
- if doc:exists() or (not gdoc:exists() and not sdoc:exists()) then
- f:write_raw(doc:full_get(nil, true))
- end
- if (isget and gdoc:exists()) or (isset and sdoc:exists()) then
- f:write_nl(2)
- end
- f:write_nl()
- f:write_editable(pns, "description")
- f:write_nl()
- end
-
- local pgkeys = isget and fn:property_keys_get(fn.PROP_GET) or {}
- local pskeys = isset and fn:property_keys_get(fn.PROP_SET) or {}
- build_vallist(f, pgkeys, pskeys, "Keys")
-
- local pgvals = isget and fn:property_values_get(fn.PROP_GET) or {}
- local psvals = isset and fn:property_values_get(fn.PROP_SET) or {}
- build_vallist(f, pgvals, psvals, "Values")
-
- if isget and gdoc:exists() then
- if isset then
- f:write_h("Getter", 3)
- else
- f:write_h("Description", 2)
- end
- f:write_raw(gdoc:full_get(nil, true))
- if isset and sdoc:exists() then
- f:write_nl(2)
- end
- if isset then
- f:write_nl()
- f:write_editable(pns, "getter_description")
- f:write_nl()
- end
- end
-
- if isset and sdoc:exists() then
- if isget then
- f:write_h("Setter", 3)
- else
- f:write_h("Description", 2)
- end
- f:write_raw(sdoc:full_get(nil, true))
- if isget then
- f:write_nl()
- f:write_editable(pns, "getter_description")
- f:write_nl()
- end
- end
-
- f:write_nl()
- if not isget or not isset then
- f:write_nl()
- f:write_br()
- f:write_editable(pns, "description")
- f:write_nl()
- end
-
- write_inherited_from(f, impl, cl, over, true)
-
- f:write_h("Signature", 2)
- f:write_code(gen_prop_sig(fn, cl))
- f:write_nl()
-
- f:write_h("C signature", 2)
- local codes = {}
- if isget then
- codes[#codes + 1] = gen_func_csig(fn, fn.PROP_GET)
- end
- if isset then
- codes[#codes + 1] = gen_func_csig(fn, fn.PROP_SET)
- end
- f:write_code(table.concat(codes, "\n"), "c")
- f:write_nl()
-
- write_ilist(f, impl, cl)
- f:write_nl()
-
- f:finish()
-end
-
-local build_event_example = function(ev)
- local evcn = ev:c_name_get()
- local evcnl = evcn:lower()
-
- local dtype = "Data *"
-
- local tbl = { "static void\n" }
- tbl[#tbl + 1] = "on_"
- tbl[#tbl + 1] = evcnl
- tbl[#tbl + 1] = "(void *data, const Efl_Event *event)\n{\n "
- tbl[#tbl + 1] = dtree.type_cstr_get(ev:type_get(), "info = event->info;\n")
- tbl[#tbl + 1] = " Eo *obj = event->object;\n "
- tbl[#tbl + 1] = dtree.type_cstr_get(dtype, "d = data;\n\n")
- tbl[#tbl + 1] = " /* event hander code */\n}\n\n"
- tbl[#tbl + 1] = "static void\nsetup_event_handler(Eo *obj, "
- tbl[#tbl + 1] = dtree.type_cstr_get(dtype, "d")
- tbl[#tbl + 1] = ")\n{\n"
- tbl[#tbl + 1] = " efl_event_callback_add(obj, "
- tbl[#tbl + 1] = evcn
- tbl[#tbl + 1] = ", on_"
- tbl[#tbl + 1] = evcnl
- tbl[#tbl + 1] = ", d);\n}\n"
-
- return table.concat(tbl)
-end
-
-build_event = function(ev, cl)
- local evn = ev:nspaces_get(cl)
- local evnm = cl:name_get() .. ": " .. ev:name_get()
- local f = writer.Writer(evn, evnm)
- printgen("Generating event: " .. evnm)
-
- f:write_h("Description", 2)
- f:write_raw(ev:doc_get():full_get(nil, true))
- f:write_nl()
-
- f:write_editable(evn, "description")
- f:write_nl()
-
- f:write_h("Signature", 2)
- local buf = { ev:name_get() }
-
- if ev:scope_get() == ev.scope.PRIVATE then
- buf[#buf + 1] = " @private"
- elseif ev:scope_get() == ev.scope.PROTECTED then
- buf[#buf + 1] = " @protected"
- end
-
- if ev:is_beta() then
- buf[#buf + 1] = " @beta"
- end
- if ev:is_hot() then
- buf[#buf + 1] = " @hot"
- end
- if ev:is_restart() then
- buf[#buf + 1] = " @restart"
- end
-
- local etp = ev:type_get()
- if etp then
- buf[#buf + 1] = ": "
- buf[#buf + 1] = etp:serialize()
- end
-
- buf[#buf + 1] = ";"
- f:write_code(table.concat(buf))
- f:write_nl()
-
- f:write_h("C information", 2)
- f:write_code(build_evcsig(ev), "c")
- f:write_nl()
-
- f:write_h("C usage", 2)
- f:write_code(build_event_example(ev), "c")
- f:write_nl()
-
- f:finish()
-end
-
-local build_stats_keyref = function()
- for i, cl in ipairs(dtree.Class.all_get()) do
- stats.check_class(cl)
- keyref.add(cl:name_get():gsub("%.", "_"), cl:nspaces_get(), "c")
- for i, imp in ipairs(cl:implements_get()) do
- -- TODO: handle doc overrides in stats system
- if not imp:is_overridden(cl) then
- local func = imp:function_get()
- local fns = func:nspaces_get(cl)
- if imp:is_prop_get() or imp:is_prop_set() then
- if imp:is_prop_get() then
- stats.check_property(func, cl, func.PROP_GET)
- keyref.add(func:full_c_name_get(func.PROP_GET), fns, "c")
- end
- if imp:is_prop_set() then
- stats.check_property(func, cl, func.PROP_SET)
- keyref.add(func:full_c_name_get(func.PROP_SET), fns, "c")
- end
- else
- stats.check_method(func, cl)
- keyref.add(func:full_c_name_get(func.METHOD), fns, "c")
- end
- end
- end
- for i, ev in ipairs(cl:events_get()) do
- keyref.add(ev:c_name_get(), ev:nspaces_get(cl), "c")
- end
- end
- for i, tp in ipairs(dtree.Typedecl.all_aliases_get()) do
- stats.check_alias(tp)
- end
- for i, tp in ipairs(dtree.Typedecl.all_structs_get()) do
- stats.check_struct(tp)
- end
- for i, tp in ipairs(dtree.Typedecl.all_enums_get()) do
- stats.check_enum(tp)
- end
- for i, v in ipairs(dtree.Variable.all_constants_get()) do
- stats.check_constant(v)
- end
- for i, v in ipairs(dtree.Variable.all_globals_get()) do
- stats.check_global(v)
- end
-end
-
-getopt.parse {
- args = arg,
- descs = {
- { category = "General" },
- { "h", "help", nil, help = "Show this message.", metavar = "CATEGORY",
- callback = getopt.help_cb(io.stdout)
- },
- { "v", "verbose", false, help = "Be verbose." },
- { "p", "print-gen", false, help = "Print what is being generated." },
-
- { category = "Generator" },
- { "r", "root", true, help = "Root path of the docs." },
- { "n", "namespace", true, help = "Root namespace of the docs." },
- { nil, "graph-theme", true, help = "Optional graph theme." },
- { nil, "graph-theme-light", false, help = "Use light builtin graph theme." },
- { nil, "disable-notes", false, help = "Disable notes plugin usage." },
- { nil, "disable-folded", false, help = "Disable folded plugin usage." },
- { nil, "disable-title", false, help = "Disable title plugin usage." },
- { "m", "use-markdown", false,
- help = "Generate Markdown instead of DokuWiki syntax." },
- { nil, "pass", true, help = "The pass to run (optional) "
- .. "(rm, ref, clist, classes, types, vars, stats or class name)." }
- },
- error_cb = function(parser, msg)
- io.stderr:write(msg, "\n")
- getopt.help(parser, io.stderr)
- end,
- done_cb = function(parser, opts, args)
- if opts["h"] then
- return
- end
- if opts["p"] then
- printgen = function(...) print(...) end
- end
- if opts["graph-theme-dark"] then
- current_theme = default_theme_light
- end
- if opts["graph-theme"] then
- set_theme(opts["graph-theme"])
- end
- local rootns = (not opts["n"] or opts["n"] == "")
- and "develop:api" or opts["n"]
- local dr
- if not opts["r"] or opts["r"] == "" then
- dr = "dokuwiki/data/pages"
- else
- dr = opts["r"]
- end
- dr = dutil.path_join(dr, dutil.nspace_to_path(rootns))
- dutil.init(dr, rootns)
- writer.set_backend("dokuwiki")
- if #args == 0 then
- dtree.scan_directory()
- else
- for i, p in ipairs(args) do
- dtree.scan_directory(p)
- end
- end
-
- local st = opts["pass"]
-
- dtree.parse(st)
-
- if st == "clist" then
- for i, cl in ipairs(dtree.Class.all_get()) do
- print(cl:name_get())
- end
- return
- end
-
- local wfeatures = {
- notes = not opts["disable-notes"],
- folds = not opts["disable-folded"],
- title = not opts["disable-title"]
- }
- writer.init(rootns, wfeatures)
- if not st or st == "rm" then
- dutil.rm_root()
- dutil.mkdir_r(nil)
- end
- if not st or st == "ref" then
- build_ref()
- end
- if not st or st == "classes" then
- build_classes()
- end
- if st and st:match("%.") then
- local cl = dtree.Class.by_name_get(st)
- if cl then
- build_class(cl)
- end
- end
- if not st or st == "types" then
- build_typedecls()
- end
- if not st or st == "vars" then
- build_variables()
- end
-
- if not st or st == "stats" then
- stats.init(not not opts["v"])
- build_stats_keyref()
- keyref.build()
- -- newline if printing what's being generated
- printgen()
- stats.print()
- end
- end
-}
-
-return true
diff --git a/src/scripts/elua/apps/gendoc.sh b/src/scripts/elua/apps/gendoc.sh
deleted file mode 100755
index f14fcfda6e..0000000000
--- a/src/scripts/elua/apps/gendoc.sh
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/sh
-# a parallel doc generation script
-cd "$(dirname "$(realpath "$0")")";
-
-# exit on failure
-set -e
-
-gendoc() {
- elua gendoc.lua --pass $@
-}
-
-gendoc rm $@
-gendoc ref $@
-
-# limit jobs otherwise stuff starts complaining in eldbus etc
-MAXJ=192
-
-I=0
-for cl in $(gendoc clist $@); do
- gendoc "$cl" $@ &
- I=$(($I + 1))
- if [ $I -gt $MAXJ ]; then
- I=0
- # wait for the batch to finish
- wait
- fi
-done
-
-gendoc types $@ &
-gendoc vars $@ &
-
-# wait for all remaining stuff to finish
-wait
-
-# final results
-gendoc stats $@
-
-exit 0
diff --git a/src/scripts/pyolian/eolian.py b/src/scripts/pyolian/eolian.py
index 4dce2e6d4b..bd92075565 100644
--- a/src/scripts/pyolian/eolian.py
+++ b/src/scripts/pyolian/eolian.py
@@ -963,7 +963,7 @@ class Function(Object):
class Function_Parameter(Object):
def __repr__(self):
return "<eolian.Function_Parameter '{0.name}', type={0.type}," \
- " optional={0.is_optional}, nullable={0.is_nullable}>".format(self)
+ " optional={0.is_optional}>".format(self)
@cached_property
def direction(self):
@@ -979,10 +979,6 @@ class Function_Parameter(Object):
return bool(lib.eolian_parameter_is_nonull(self))
@cached_property
- def is_nullable(self):
- return bool(lib.eolian_parameter_is_nullable(self))
-
- @cached_property
def is_optional(self):
return bool(lib.eolian_parameter_is_optional(self))
diff --git a/src/scripts/pyolian/eolian_lib.py b/src/scripts/pyolian/eolian_lib.py
index 622486ebdf..4fe2dc54fb 100644
--- a/src/scripts/pyolian/eolian_lib.py
+++ b/src/scripts/pyolian/eolian_lib.py
@@ -403,10 +403,6 @@ lib.eolian_parameter_documentation_get.restype = c_void_p
lib.eolian_parameter_is_nonull.argtypes = (c_void_p,)
lib.eolian_parameter_is_nonull.restype = c_bool
-# EAPI Eina_Bool eolian_parameter_is_nullable(const Eolian_Function_Parameter *param_desc);
-lib.eolian_parameter_is_nullable.argtypes = (c_void_p,)
-lib.eolian_parameter_is_nullable.restype = c_bool
-
# EAPI Eina_Bool eolian_parameter_is_optional(const Eolian_Function_Parameter *param_desc);
lib.eolian_parameter_is_optional.argtypes = (c_void_p,)
lib.eolian_parameter_is_optional.restype = c_bool
diff --git a/src/scripts/pyolian/test_eolian.py b/src/scripts/pyolian/test_eolian.py
index 3695330cc6..2a59349386 100755
--- a/src/scripts/pyolian/test_eolian.py
+++ b/src/scripts/pyolian/test_eolian.py
@@ -381,7 +381,6 @@ class TestEolianFunction(unittest.TestCase):
self.assertEqual(p.name, 'add')
self.assertIsNone(p.default_value)
self.assertFalse(p.is_nonull) # TODO is correct ?? 'add' can be null?
- self.assertFalse(p.is_nullable)
self.assertFalse(p.is_optional)
self.assertEqual(p.type.name, 'double')
self.assertIsInstance(p.documentation, eolian.Documentation)
diff --git a/src/tests/elementary/efl_ui_test_table.c b/src/tests/elementary/efl_ui_test_table.c
index 476be61159..a1761f1613 100644
--- a/src/tests/elementary/efl_ui_test_table.c
+++ b/src/tests/elementary/efl_ui_test_table.c
@@ -488,7 +488,6 @@ EFL_START_TEST (efl_ui_table_properties)
double h, v;
Eina_Bool b;
Eina_Bool homogeneoush, homogeneousv;
- Efl_Ui_Dir dirh, dirv;
//align test
efl_gfx_arrangement_content_align_get(layout, &h, &v);
@@ -524,20 +523,12 @@ EFL_START_TEST (efl_ui_table_properties)
ck_assert_int_eq(b, 1);
//direction test
- efl_pack_table_direction_get(layout, &dirh, &dirv);
- ck_assert_int_eq(dirh, EFL_UI_DIR_RIGHT);
- ck_assert_int_eq(dirv, EFL_UI_DIR_DOWN);
-
- efl_pack_table_direction_set(layout, EFL_UI_DIR_VERTICAL, EFL_UI_DIR_HORIZONTAL);
- efl_pack_table_direction_get(layout, &dirh, &dirv);
- ck_assert_int_eq(dirh, EFL_UI_DIR_VERTICAL);
- ck_assert_int_eq(dirv, EFL_UI_DIR_HORIZONTAL);
+ ck_assert_int_eq(efl_ui_direction_get(layout), EFL_UI_DIR_RIGHT);
- efl_pack_table_direction_set(layout, EFL_UI_DIR_RIGHT, EFL_UI_DIR_RIGHT);
- efl_pack_table_direction_get(layout, &dirh, &dirv);
- ck_assert_int_eq(dirh, EFL_UI_DIR_RIGHT);
- ck_assert_int_eq(dirv, EFL_UI_DIR_DOWN);
+ efl_ui_direction_set(layout, EFL_UI_DIR_VERTICAL);
+ ck_assert_int_eq(efl_ui_direction_get(layout), EFL_UI_DIR_VERTICAL);
+ efl_ui_direction_set(layout, EFL_UI_DIR_RIGHT);
ck_assert_int_eq(efl_ui_direction_get(layout), EFL_UI_DIR_RIGHT);
efl_ui_direction_set(layout, EFL_UI_DIR_DEFAULT);
diff --git a/src/tests/eolian/data/null.eo b/src/tests/eolian/data/null.eo
deleted file mode 100644
index ad872e0ace..0000000000
--- a/src/tests/eolian/data/null.eo
+++ /dev/null
@@ -1,12 +0,0 @@
-class Null {
- methods {
- foo {
- params {
- x: ptr(char);
- y: ptr(char) @nullable;
- z: ptr(char) @optional;
- w: ptr(char) @optional @nullable;
- }
- }
- }
-}
diff --git a/src/tests/eolian/eolian_parsing.c b/src/tests/eolian/eolian_parsing.c
index 8711fdf319..2fbb1b52b0 100644
--- a/src/tests/eolian/eolian_parsing.c
+++ b/src/tests/eolian/eolian_parsing.c
@@ -1010,56 +1010,6 @@ EFL_START_TEST(eolian_free_func)
}
EFL_END_TEST
-EFL_START_TEST(eolian_null)
-{
- const Eolian_Class *class;
- const Eolian_Function *func;
- const Eolian_Function_Parameter *param;
- const Eolian_Unit *unit;
- Eina_Iterator *iter;
-
- Eolian_State *eos = eolian_state_new();
-
- /* Parsing */
- fail_if(!eolian_state_directory_add(eos, TESTS_SRC_DIR"/data"));
- fail_if(!(unit = eolian_state_file_parse(eos, "null.eo")));
-
- fail_if(!(class = eolian_unit_class_by_name_get(unit, "Null")));
- fail_if(!(func = eolian_class_function_by_name_get(class, "foo", EOLIAN_METHOD)));
-
- fail_if(!(iter = eolian_function_parameters_get(func)));
-
- /* no qualifiers */
- fail_if(!(eina_iterator_next(iter, (void**)&param)));
- fail_if(strcmp(eolian_parameter_name_get(param), "x"));
- fail_if(eolian_parameter_is_nullable(param));
- fail_if(eolian_parameter_is_optional(param));
-
- /* nullable */
- fail_if(!(eina_iterator_next(iter, (void**)&param)));
- fail_if(strcmp(eolian_parameter_name_get(param), "y"));
- fail_if(!eolian_parameter_is_nullable(param));
- fail_if(eolian_parameter_is_optional(param));
-
- /* optional */
- fail_if(!(eina_iterator_next(iter, (void**)&param)));
- fail_if(strcmp(eolian_parameter_name_get(param), "z"));
- fail_if(eolian_parameter_is_nullable(param));
- fail_if(!eolian_parameter_is_optional(param));
-
- /* both */
- fail_if(!(eina_iterator_next(iter, (void**)&param)));
- fail_if(strcmp(eolian_parameter_name_get(param), "w"));
- fail_if(!eolian_parameter_is_nullable(param));
- fail_if(!eolian_parameter_is_optional(param));
-
- fail_if(eina_iterator_next(iter, (void**)&param));
- eina_iterator_free(iter);
-
- eolian_state_free(eos);
-}
-EFL_END_TEST
-
EFL_START_TEST(eolian_import)
{
const Eolian_Class *class;
@@ -1654,7 +1604,6 @@ void eolian_parsing_test(TCase *tc)
tcase_add_test(tc, eolian_enum);
tcase_add_test(tc, eolian_class_funcs);
tcase_add_test(tc, eolian_free_func);
- tcase_add_test(tc, eolian_null);
tcase_add_test(tc, eolian_import);
tcase_add_test(tc, eolian_docs);
tcase_add_test(tc, eolian_function_types);