Merge branch 'master' into devs/hermet/lottie

This commit is contained in:
Hermet Park 2019-12-09 15:43:00 +09:00
commit 31a8f10418
44 changed files with 2147 additions and 1378 deletions

View File

@ -1,7 +1,7 @@
#!/bin/sh
mkdir build-bootstrap-native
meson --prefix=/usr/ --libdir=/usr/lib -Dbuild-examples=false -Dbuild-tests=false -Dbindings="" build-bootstrap-native
meson --prefix=/usr/ --libdir=/usr/lib -Dbuild-examples=false -Dbuild-tests=false -Dbindings=cxx build-bootstrap-native
ninja -C build-bootstrap-native install
rm -rf build-bootstrap-native
ldconfig

View File

@ -6,22 +6,22 @@ set -e
if [ "$DISTRO" != "" ] ; then
# Normal build test of all targets
OPTS=" -Decore-imf-loaders-disabler=scim,ibus -Dbindings=luajit"
# Why do we need to disable the imf loaders here?
OPTS=" -Decore-imf-loaders-disabler=scim,ibus"
MONO_LINUX_COPTS=" -Dbindings=luajit,mono -Dmono-beta=true"
MONO_LINUX_COPTS=" -Dbindings=luajit,cxx,mono -Dmono-beta=true"
WAYLAND_LINUX_COPTS=" -Dwl=true -Ddrm=true -Dopengl=es-egl -Dwl-deprecated=true -Ddrm-deprecated=true"
# TODO:
# - Enable C++ bindings: -Dbindings=luajit,cxx
# - No libelogind, Xgesture packages in fedora 30 repo
# - No libelogind package in fedora 30 repo
# - RPM fusion repo for xine and libvlc
ENABLED_LINUX_COPTS=" -Dfb=true -Dsdl=true -Dbuffer=true -Dbuild-id=travis-build \
-Ddebug-threads=true -Dglib=true -Dg-mainloop=true -Dxpresent=true -Dxgesture=false -Dxinput22=true \
-Ddebug-threads=true -Dglib=true -Dg-mainloop=true -Dxpresent=true -Dxinput22=true \
-Devas-loaders-disabler=json -Decore-imf-loaders-disabler= -Demotion-loaders-disabler=libvlc,xine \
-Demotion-generic-loaders-disabler=vlc -Dharfbuzz=true -Dpixman=true -Dhyphen=true \
-Dvnc-server=true -Dbindings=luajit -Delogind=false -Dinstall-eo-files=true -Dphysics=true"
-Dvnc-server=true -Dbindings=luajit,cxx,mono -Delogind=false -Dinstall-eo-files=true -Dphysics=true"
# Enabled png, jpeg evas loader for in tree edje file builds
DISABLED_LINUX_COPTS=" -Daudio=false -Davahi=false -Dx11=false -Dphysics=false -Deeze=false \
@ -39,7 +39,7 @@ if [ "$DISTRO" != "" ] ; then
MINGW_COPTS="--cross-file .ci/cross_toolchain.txt -Davahi=false -Deeze=false -Dsystemd=false \
-Dpulseaudio=false -Dx11=false -Dopengl=none -Dlibmount=false \
-Devas-loaders-disabler=json,pdf,ps,raw,svg,rsvg -Dbindings=luajit \
-Devas-loaders-disabler=json,pdf,ps,raw,svg,rsvg \
-Dharfbuzz=true -Dpixman=true -Dembedded-lz4=false "
if [ "$1" = "default" ]; then
@ -109,6 +109,6 @@ else
export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig:/usr/local/Cellar/libffi/$LIBFFI_VER/lib/pkgconfig"
export CC="ccache gcc"
travis_fold meson meson
mkdir build && meson build -Dopengl=full -Decore-imf-loaders-disabler=scim,ibus -Dx11=false -Davahi=false -Dbindings=luajit -Deeze=false -Dsystemd=false -Dnls=false -Dcocoa=true -Demotion-loaders-disabler=gstreamer1,libvlc,xine
mkdir build && meson build -Dopengl=full -Decore-imf-loaders-disabler=scim,ibus -Dx11=false -Davahi=false -Deeze=false -Dsystemd=false -Dnls=false -Dcocoa=true -Demotion-loaders-disabler=gstreamer1,libvlc,xine
travis_endfold meson
fi

View File

@ -150,12 +150,6 @@ option('xpresent',
description : 'X11 XPresent extension support in efl'
)
option('xgesture',
type : 'boolean',
value : false,
description : 'X11 XGesture support in efl'
)
option('xinput2',
type : 'boolean',
value : true,
@ -203,7 +197,7 @@ option('ecore-imf-loaders-disabler',
type : 'array',
description : 'List of input methods to disable in efl',
choices : ['xim', 'ibus', 'scim'],
value : ['scim']
value : ['ibus']
)
option('emotion-loaders-disabler',

View File

@ -514,10 +514,11 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
"blur { 3, ox = 1, oy = 1, color = 'black' }"
"blend { color = 'lime' }";
o = code = efl_add(EFL_UI_TEXT_EDITABLE_CLASS, win,
efl_ui_text_scrollable_set(efl_added, 1),
efl_text_multiline_set(efl_added, 1));
efl_event_callback_add(o, EFL_UI_TEXT_EVENT_CHANGED_USER, _code_changed_hack, win);
o = code = efl_add(EFL_UI_TEXT_CLASS, win,
efl_ui_text_scrollable_set(efl_added, EINA_TRUE),
efl_text_interactive_editable_set(efl_added, EINA_TRUE),
efl_text_multiline_set(efl_added, EINA_TRUE));
efl_event_callback_add(o, EFL_TEXT_INTERACTIVE_EVENT_CHANGED_USER, _code_changed_hack, win);
// Insert filter code inside style string: DEFAULT='blah blah <here>'
efl_gfx_filter_program_set(o, code_filter, "code");

View File

@ -17,7 +17,6 @@
# include <elm_general.h>
# include <efl_text_interactive.eo.h>
# include <efl_ui_text.eo.h>
# include <efl_ui_text_editable.eo.h>
# include <efl_ui_text_async.eo.h>
#define NUM_ITEMS 400

View File

@ -0,0 +1,652 @@
/**
* Example of Evas' vector graphics object and API.
*
* @verbatim
* gcc -o efl-canvas-vg-simple efl-canvas-vg-simple.c `pkg-config --libs --cflags evas ecore ecore-evas eina ector eo efl` -lm
* @endverbatim
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#else
#define PACKAGE_EXAMPLES_DIR "."
#endif
#define WIDTH 600
#define HEIGHT 800
#include <Eo.h>
#include <Efl.h>
#include <Evas.h>
#include <Ecore.h>
#include <Ecore_Evas.h>
#include <Eina.h>
struct example_data
{
Ecore_Evas *ee;
Evas *evas;
Efl_Canvas_Rectangle *bg;
Efl_VG *vg;
Eina_List *shape_list;
};
static struct example_data d;
Ecore_Animator *animator;
/* These data strings follows an SVG-like convention for describing the
* nodes of a path. 'M x,y' indicates a move-to operation that sets
* where to start drawing. 'L x,y' draws a straight line that ends at
* the given point. 'C x1,y1 x2,y2 x,y' defines a Bezier curve's two
* control points and the x,y coordinate where the curve ends. 'Z' marks
* the end of the path.
*/
static const char *batman = "M 256,213 C 245,181 206,187 234,262 147,181 169,71.2 233,18 220,56 235,81 283,88 285,78.7 286,69.3 288,60 289,61.3 290,62.7 291,64 291,64 297,63 300,63 303,63 309,64 309,64 310,62.7 311,61.3 312,60 314,69.3 315,78.7 317,88 365,82 380,56 367,18 431,71 453,181 366,262 394,187 356,181 344,213 328,185 309,184 300,284 291,184 272,185 256,213 Z";
static const char *morph1[2] = {"M 0,0 L 0,0 L 100,0 L 100,0 L 100,100 L 100,100 L 0,100 L 0,100 L 0,0",
"M 0,0 L 50,-80 L 100,0 L 180,50 L 100,100 L 50,180 L 0,100 L -80,50 L 0,0"};
static void _main_menu();
static void _main_menu_key_handle(void *data EINA_UNUSED, const Efl_Event *ev);
static const char *main_menu = \
"Main Menu:\n"
"\t1 - Basic Shape test\n"
"\t2 - Interpolation\n"
"\t3 - Gradient\n"
"\te - Exit\n"
"\th - Print help\n";
static const char *basic_shape_menu = \
"Basic Shape Menu:\n"
"\tup - Increase Stroke Width by 0.5\n"
"\tdown - Decrease Stroke Width by 0.5\n"
"\tr - +10 degree rotation\n"
"\tR - -10 degree rotation\n"
"\ts - +(.1, .1) scale\n"
"\tS - -(.1, .1) scale\n"
"\tt - +(10,10) translation\n"
"\tT - +(10,10) translation\n"
"\td - Reset path data\n"
"\te - Exit\n"
"\tb - Back to Main Menu\n"
"\th - Print help\n";
static const char *interpolation_menu = \
"Interpolation Menu:\n"
"\te - Exit\n"
"\tb - Back to Main Menu\n"
"\th - print help\n";
static const char *gradient_menu = \
"Gradient Menu:\n"
"\te - Exit\n"
"\tb - Back to Main Menu\n"
"\th - print help\n";
static void
_on_delete(Ecore_Evas *ee EINA_UNUSED)
{
if (animator) ecore_animator_del(animator);
ecore_main_loop_quit();
}
static void
_canvas_resize_cb(Ecore_Evas *ee)
{
int w, h;
ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
efl_gfx_entity_geometry_set(d.bg, EINA_RECT(0, 0, w, h));
efl_gfx_entity_geometry_set(d.vg, EINA_RECT(0, 0, w, h));
}
static void
reset_test()
{
if(d.vg) efl_del(d.vg);
d.shape_list = eina_list_free(d.shape_list);
d.vg = efl_add(EFL_CANVAS_VG_OBJECT_CLASS, d.evas,
efl_canvas_object_key_focus_set(efl_added, EINA_TRUE),
efl_gfx_entity_visible_set(efl_added, EINA_TRUE));
_canvas_resize_cb(d.ee);
}
// 2. Basic shape Test Case START
/* Applies a matrix transformation to a shape. If there is already a
* matrix transformation applied, the new tranformation is matrix
* multiplied with the existing one so both transformations are used.
*/
static void
_added_transformation(Efl_VG *shape, Eina_Matrix3 *m)
{
Eina_Matrix3 new_m;
const Eina_Matrix3 *old_m;
old_m = efl_canvas_vg_node_transformation_get(shape);
if (old_m)
{
eina_matrix3_compose(m, old_m, &new_m);
efl_canvas_vg_node_transformation_set(shape, &new_m);
}
else
{
efl_canvas_vg_node_transformation_set(shape, m);
}
}
/*
* Applies various modifications to the canvas objects as directed by
* the user.
*/
static void
_basic_shape_key_handle(void *data EINA_UNUSED, const Efl_Event *ev)
{
Efl_VG *shape;
Eina_List *l;
Eina_Matrix3 m;
double stroke_w;
if (!strcmp(efl_input_key_sym_get(ev->info) , "h"))
{
/* h - Print help */
puts(basic_shape_menu);
}
else if (!strcmp(efl_input_key_sym_get(ev->info) , "e"))
{
/* e - Exit */
_on_delete(d.ee);
}
else if (!strcmp(efl_input_key_sym_get(ev->info) , "b"))
{
/* b - Back to Main Menu */
_main_menu();
}
else if (!strcmp(efl_input_key_sym_get(ev->info) , "Up"))
{
/* up - Increase Stroke Width by 0.5 */
EINA_LIST_FOREACH(d.shape_list, l, shape)
{
stroke_w = efl_gfx_shape_stroke_width_get(shape);
efl_gfx_shape_stroke_width_set(shape, stroke_w + 0.5);
efl_gfx_path_commit(shape);
}
}
else if (!strcmp(efl_input_key_sym_get(ev->info) , "Down"))
{
/* down - Decrease Stroke Width by 0.5 */
EINA_LIST_FOREACH(d.shape_list, l, shape)
{
stroke_w = efl_gfx_shape_stroke_width_get(shape);
if (stroke_w <= 0.5) stroke_w = 1;
efl_gfx_shape_stroke_width_set(shape, stroke_w - 0.5);
efl_gfx_path_commit(shape);
}
}
else if (!strcmp(efl_input_key_sym_get(ev->info) , "r"))
{
/* r - Rotate the shapes +10 degrees */
eina_matrix3_identity(&m);
eina_matrix3_rotate(&m, 10.0 * 2 * 3.141 / 360.0);
EINA_LIST_FOREACH(d.shape_list, l, shape)
{
_added_transformation(shape, &m);
}
}
else if (!strcmp(efl_input_key_sym_get(ev->info) , "R"))
{
/* R - Rotate the shapes -10 degrees */
eina_matrix3_identity(&m);
eina_matrix3_rotate(&m, -10.0 * 2 * 3.141 / 360.0);
EINA_LIST_FOREACH(d.shape_list, l, shape)
{
_added_transformation(shape, &m);
}
}
else if (!strcmp(efl_input_key_sym_get(ev->info) , "s"))
{
/* s - Scale the shapes +(.1, .1) */
eina_matrix3_identity(&m);
eina_matrix3_scale(&m, 1.1, 1.1);
EINA_LIST_FOREACH(d.shape_list, l, shape)
{
_added_transformation(shape, &m);
}
}
else if (!strcmp(efl_input_key_sym_get(ev->info) , "S"))
{
/* S - Scale the shapes -(.1, .1) */
eina_matrix3_identity(&m);
eina_matrix3_scale(&m, .9, .9);
EINA_LIST_FOREACH(d.shape_list, l, shape)
{
_added_transformation(shape, &m);
}
}
else if (!strcmp(efl_input_key_sym_get(ev->info) , "t"))
{
/* t - Translate the shapes +(10,10) */
eina_matrix3_identity(&m);
eina_matrix3_translate(&m, 10, 10);
EINA_LIST_FOREACH(d.shape_list, l, shape)
{
_added_transformation(shape, &m);
}
}
else if (!strcmp(efl_input_key_sym_get(ev->info) , "T"))
{
/* T - Translate the shapes +(10,10) */
eina_matrix3_identity(&m);
eina_matrix3_translate(&m, -10, -10);
EINA_LIST_FOREACH(d.shape_list, l, shape)
{
_added_transformation(shape, &m);
}
}
else if (!strcmp(efl_input_key_sym_get(ev->info) , "d"))
{
/* d - Reset path data */
EINA_LIST_FOREACH(d.shape_list, l, shape)
{
efl_gfx_path_reset(shape);
}
}
}
/* Create several different geometric objects - a line, rectangle,
* circle, and arc, each with distinct style and placement.
*/
static void
_1_basic_shape_test()
{
Efl_VG *container, *shape, *new_shape;
reset_test();
efl_event_callback_add(d.vg, EFL_EVENT_KEY_DOWN, _basic_shape_key_handle, NULL);
puts(basic_shape_menu);
container = efl_add(EFL_CANVAS_VG_CONTAINER_CLASS, d.vg);
// Line
shape = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, container,
efl_gfx_path_append_move_to(efl_added, 0, 0), // Move strating point path
efl_gfx_path_append_line_to(efl_added, 100, 0), // Add line form move point
efl_gfx_shape_stroke_color_set(efl_added, 255, 0, 0, 255),
efl_gfx_shape_stroke_width_set(efl_added, 5),
efl_canvas_vg_node_origin_set(efl_added, 50, 50),
efl_gfx_shape_stroke_cap_set(efl_added, EFL_GFX_CAP_ROUND)); // Set stroke cap
d.shape_list = eina_list_append(d.shape_list, shape);
new_shape = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, container,
efl_gfx_path_copy_from(efl_added, shape), // Path duplicate.
efl_gfx_shape_stroke_color_set(efl_added, 0, 100, 0, 100),
efl_gfx_path_append_line_to(efl_added, 100, 50),
efl_canvas_vg_node_origin_set(efl_added, 200, 50),
efl_gfx_shape_stroke_cap_set(efl_added, EFL_GFX_CAP_SQUARE));
d.shape_list = eina_list_append(d.shape_list, new_shape);
new_shape = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, container,
efl_gfx_path_copy_from(efl_added, shape),
efl_gfx_shape_stroke_color_set(efl_added, 0, 0, 255, 255),
efl_gfx_path_append_line_to(efl_added, 50, 50),
efl_canvas_vg_node_origin_set(efl_added, 350, 50),
efl_gfx_shape_stroke_cap_set(efl_added, EFL_GFX_CAP_ROUND),
efl_gfx_shape_stroke_join_set(efl_added, EFL_GFX_JOIN_ROUND)); // Set stroke join
d.shape_list = eina_list_append(d.shape_list, new_shape);
// Rect
shape = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, container,
efl_gfx_path_append_rect(efl_added, 0, 0, 100 , 100, 10, 10), // Draw Rectangle
efl_gfx_shape_stroke_color_set(efl_added, 255, 0, 0, 255),
efl_gfx_shape_stroke_width_set(efl_added, 5),
efl_canvas_vg_node_origin_set(efl_added, 50, 150));
d.shape_list = eina_list_append(d.shape_list, shape);
new_shape = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, container,
efl_gfx_path_copy_from(efl_added, shape),
efl_gfx_shape_stroke_color_set(efl_added, 0, 0, 0, 0),
efl_gfx_color_set(efl_added, 0, 0, 100, 100), // Set fill color.
efl_canvas_vg_node_origin_set(efl_added, 200, 150));
d.shape_list = eina_list_append(d.shape_list, new_shape);
new_shape = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, container,
efl_gfx_path_copy_from(efl_added, shape),
efl_gfx_shape_stroke_color_set(efl_added, 100, 0, 0, 100),
efl_gfx_color_set(efl_added, 0, 100, 100, 100),
efl_canvas_vg_node_origin_set(efl_added, 350, 150));
d.shape_list = eina_list_append(d.shape_list, new_shape);
// Circle
shape = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, container,
efl_gfx_path_append_circle(efl_added, 50, 50, 50), //Draw Circle
efl_gfx_shape_stroke_color_set(efl_added, 255, 0, 0, 255),
efl_gfx_shape_stroke_width_set(efl_added, 5),
efl_canvas_vg_node_origin_set(efl_added, 50, 300));
d.shape_list = eina_list_append(d.shape_list, shape);
new_shape = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, container,
efl_gfx_path_copy_from(efl_added, shape),
efl_gfx_shape_stroke_color_set(efl_added, 0, 0, 0, 0),
efl_gfx_color_set(efl_added, 0, 0, 255, 255),
efl_canvas_vg_node_origin_set(efl_added, 200, 300));
d.shape_list = eina_list_append(d.shape_list, new_shape);
new_shape = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, container,
efl_gfx_path_copy_from(efl_added, shape),
efl_gfx_shape_stroke_color_set(efl_added, 150, 0, 0, 150),
efl_gfx_color_set(efl_added, 0, 0, 200, 200),
efl_canvas_vg_node_origin_set(efl_added, 350, 300));
d.shape_list = eina_list_append(d.shape_list, new_shape);
// Arc
shape = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, container,
efl_gfx_path_append_arc(efl_added, 0, 0, 100, 100, 45, -200), // Draw Arc
efl_gfx_path_append_line_to(efl_added, 50, 50),
efl_gfx_shape_stroke_cap_set(efl_added, EFL_GFX_CAP_ROUND),
efl_gfx_shape_stroke_color_set(efl_added, 255, 0, 0, 255),
efl_gfx_shape_stroke_width_set(efl_added, 5),
efl_canvas_vg_node_origin_set(efl_added, 50, 450));
d.shape_list = eina_list_append(d.shape_list, shape);
new_shape = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, container,
efl_gfx_path_append_arc(efl_added, 0, 0, 100, 100, 90, 200),
efl_gfx_shape_stroke_color_set(efl_added, 0, 0, 0, 0),
efl_gfx_color_set(efl_added, 0, 0, 200, 200),
efl_canvas_vg_node_origin_set(efl_added, 200, 450));
d.shape_list = eina_list_append(d.shape_list, new_shape);
new_shape = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, container,
efl_gfx_path_append_arc(efl_added, 0, 0, 100, 100, 90, 200),
efl_gfx_path_append_line_to(efl_added, 50, 50),
efl_gfx_shape_stroke_color_set(efl_added, 0, 0, 0, 0),
efl_gfx_color_set(efl_added, 0, 0, 200, 200),
efl_canvas_vg_node_origin_set(efl_added, 350, 450));
d.shape_list = eina_list_append(d.shape_list, new_shape);
efl_canvas_vg_object_root_node_set(d.vg, container);
}
// 2. Basic shape Test Case END
// 2. Interpolation Test Case START
static void
_interpolation_key_handle(void *data EINA_UNUSED, const Efl_Event *ev)
{
if (!strcmp(efl_input_key_sym_get(ev->info) , "h"))
{
/* h - Print help */
puts(basic_shape_menu);
}
else if (!strcmp(efl_input_key_sym_get(ev->info) , "e"))
{
/* e - Exit */
_on_delete(d.ee);
}
else if (!strcmp(efl_input_key_sym_get(ev->info) , "b"))
{
/* b - Back to main menu */
_main_menu();
}
}
static int anim_index = 0;
static Eina_Bool
_interpolation_keyframe(void *data EINA_UNUSED, double pos)
{
int next = (anim_index == 1) ? 0 : 1;
// Reset Base Object's path
efl_gfx_path_reset(eina_list_nth(d.shape_list, 2));
// Set Path that interpolated from 'from' Object and 'to' Object.
efl_gfx_path_interpolate(eina_list_nth(d.shape_list, 2),
eina_list_nth(d.shape_list, anim_index),
eina_list_nth(d.shape_list, next),
ecore_animator_pos_map(pos, ECORE_POS_MAP_SINUSOIDAL, 0.0, 0.0));
if (pos == 1.0)
{
anim_index = (anim_index == 1) ? 0 : 1;
animator = ecore_animator_timeline_add(1, _interpolation_keyframe, NULL);
}
return EINA_TRUE;
}
static void
_2_interpolation_test()
{
anim_index = 0;
Efl_VG *shape;
reset_test();
efl_event_callback_add(d.vg, EFL_EVENT_KEY_DOWN, _interpolation_key_handle, NULL);
animator = ecore_animator_timeline_add(1, _interpolation_keyframe, NULL);
puts(interpolation_menu);
//Interpolation 'from' and 'to' Object
shape = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, d.vg,
efl_gfx_path_append_svg_path(efl_added, morph1[0]), // Set SVG path
efl_gfx_shape_stroke_color_set(efl_added, 255, 0, 0, 255),
efl_gfx_shape_stroke_width_set(efl_added, 5),
efl_canvas_vg_node_origin_set(efl_added, 100, 100)
);
d.shape_list = eina_list_append(d.shape_list, shape);
shape = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, d.vg,
efl_gfx_path_append_svg_path(efl_added, morph1[1]), // Set SVG path
efl_gfx_shape_stroke_color_set(efl_added, 0, 0, 255, 255),
efl_gfx_shape_stroke_width_set(efl_added, 10),
efl_canvas_vg_node_origin_set(efl_added, 150, 150));
d.shape_list = eina_list_append(d.shape_list, shape);
// Base Object
shape = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, d.vg);
d.shape_list = eina_list_append(d.shape_list, shape);
efl_canvas_vg_object_root_node_set(d.vg, shape);
}
// 2. Interpolation Test Case END
// 3. Gradient Test Case START
static void
_gradient_key_handle(void *data EINA_UNUSED, const Efl_Event *ev)
{
if (!strcmp(efl_input_key_sym_get(ev->info) , "h"))
{
/* h - Print help */
puts(basic_shape_menu);
}
else if (!strcmp(efl_input_key_sym_get(ev->info) , "e"))
{
/* e - Exit */
_on_delete(d.ee);
}
else if (!strcmp(efl_input_key_sym_get(ev->info) , "b"))
{
/* b - Back to main menu */
_main_menu();
}
}
static void
_3_gradient_test()
{
Efl_VG *container, *shape;
Efl_Canvas_Vg_Gradient *grad_fill, *grad_stroke;
reset_test();
efl_event_callback_add(d.vg, EFL_EVENT_KEY_DOWN, _gradient_key_handle, NULL);
puts(gradient_menu);
container = efl_add(EFL_CANVAS_VG_CONTAINER_CLASS, d.vg);
// Rect Shape
shape = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, container,
efl_gfx_path_append_rect(efl_added, 0, 0, 100 , 100, 10, 10),
efl_gfx_shape_stroke_color_set(efl_added, 255, 0, 0, 255),
efl_gfx_shape_stroke_width_set(efl_added, 5),
efl_canvas_vg_node_origin_set(efl_added, 50, 50));
//Make Linear gradient for fill
grad_stroke = efl_add(EFL_CANVAS_VG_GRADIENT_LINEAR_CLASS, container,
efl_gfx_gradient_linear_start_set(efl_added, 0, 0),
efl_gfx_gradient_linear_end_set(efl_added, 100, 100),
efl_gfx_entity_visible_set(efl_added, EINA_TRUE));
//Make Stops
float pa;
Efl_Gfx_Gradient_Stop stops[2];
stops[0].offset = 0;
pa = 100.0 / 255.0;
stops[0].r = (int)(255.0 * pa);
stops[0].g = 0;
stops[0].b = 0;
stops[0].a = 100;
stops[1].offset = 1;
pa = 200.0 / 255;
stops[1].r = 0;
stops[1].g = 0;
stops[1].b = (int)(255.0 * pa);
stops[1].a = 200.0;
efl_gfx_gradient_stop_set(grad_stroke, stops, 2);
//Set Gradient
efl_canvas_vg_shape_stroke_fill_set(shape, grad_stroke);
shape = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, container,
efl_gfx_path_append_rect(efl_added, 0, 0, 100 , 100, 10, 10),
efl_gfx_shape_stroke_width_set(efl_added, 5),
efl_gfx_color_set(efl_added, 0, 0, 100, 100),
efl_canvas_vg_node_origin_set(efl_added, 50, 200));
//Make Radial Gradient for Stroke
grad_fill = efl_add(EFL_CANVAS_VG_GRADIENT_RADIAL_CLASS, container,
efl_gfx_gradient_radial_center_set(efl_added, 50, 50),
efl_gfx_gradient_radial_focal_set(efl_added, 10, 10),
efl_gfx_gradient_radial_radius_set(efl_added, 100),
efl_gfx_entity_visible_set(efl_added, EINA_TRUE));
//Make Stops
stops[0].offset = 0;
pa = 100.0 / 255.0;
stops[0].r = (int)(255.0 * pa);
stops[0].g = 0;
stops[0].b = 0;
stops[0].a = 100;
stops[1].offset = 1;
pa = 100.0 / 255;
stops[1].r = 0;
stops[1].g = (int)(255.0 * pa);
stops[1].b = 0;
stops[1].a = 100.0;
efl_gfx_gradient_stop_set(grad_fill, stops, 2);
//Set Gradient
efl_canvas_vg_shape_fill_set(shape, grad_fill);
efl_canvas_vg_object_root_node_set(d.vg, container);
}
// 3. Gradient Test Case END
// Main Menu START
static void
_main_menu()
{
Efl_VG *shape;
if (animator) ecore_animator_del(animator);
animator = NULL;
if(d.vg) efl_del(d.vg);
if(d.bg) efl_del(d.bg);
d.bg = efl_add(EFL_CANVAS_RECTANGLE_CLASS, d.evas,
efl_gfx_color_set(efl_added, 255, 255, 255, 255),
efl_gfx_entity_visible_set(efl_added, EINA_TRUE),
efl_canvas_object_key_focus_set(efl_added, EINA_TRUE),
efl_event_callback_add(efl_added, EFL_EVENT_KEY_DOWN, _main_menu_key_handle, NULL));
// Create the initial screen - Yellow color bat
// Make Efl.Canvas.Vg.Object object
d.vg = efl_add(EFL_CANVAS_VG_OBJECT_CLASS, d.evas,
efl_gfx_entity_visible_set(efl_added, EINA_TRUE));
// Make Efl.Canvas.Vg.Shape
shape = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, d.vg,
efl_gfx_path_append_svg_path(efl_added, batman), // Set SVG path
efl_gfx_shape_stroke_color_set(efl_added, 255, 0, 0, 255), // Set Stroke color
efl_gfx_shape_stroke_width_set(efl_added, 5), // Set Stroke width
efl_gfx_color_set(efl_added, 255, 255, 0, 255), // Set Fill color
efl_canvas_vg_node_origin_set(efl_added, 25, 100)); // Set Position
// Set the root node of Efl.Canvas.Vg.Object
// The Efl.Canvas.Vg.Object searches and renders
// Efl.Canvas.Vg.Node(Shape, Container, etc...) from set root node.
efl_canvas_vg_object_root_node_set(d.vg, shape);
_canvas_resize_cb(d.ee);
puts(main_menu);
}
static void
_main_menu_key_handle(void *data EINA_UNUSED, const Efl_Event *ev)
{
if (!strcmp(efl_input_key_sym_get(ev->info) , "h"))
{
/* h - Help menu */
puts(main_menu);
}
else if (!strcmp(efl_input_key_sym_get(ev->info) , "e"))
{
/* e - Exit */
_on_delete(d.ee);
}
else if (!strcmp(efl_input_key_sym_get(ev->info) , "1"))
{
/* 1 - Basic Shape test */
_1_basic_shape_test();
}
else if (!strcmp(efl_input_key_sym_get(ev->info) , "2"))
{
/* 2 - Interpolation */
_2_interpolation_test();
}
else if (!strcmp(efl_input_key_sym_get(ev->info) , "3"))
{
/* 3 - Gradient */
_3_gradient_test();
}
}
// Main Menu END
int
main(void)
{
if (!ecore_evas_init())
return EXIT_FAILURE;
d.ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL);
if (!d.ee)
goto error;
ecore_evas_callback_delete_request_set(d.ee, _on_delete);
ecore_evas_callback_resize_set(d.ee, _canvas_resize_cb);
ecore_evas_show(d.ee);
d.evas = ecore_evas_get(d.ee);
_main_menu();
ecore_main_loop_begin();
ecore_evas_shutdown();
return 0;
error:
ecore_evas_shutdown();
return -1;
}

View File

@ -51,6 +51,7 @@ examples = [
'evas-vg-simple',
'evas-vg-json',
'efl-canvas-animation',
'efl-canvas-vg-simple',
]
foreach example : examples

View File

@ -2713,15 +2713,11 @@ struct _Ecore_X_Event_Gesture_Notify_Group
int group_id;
};
EAPI Eina_Bool ecore_x_gesture_supported(void);
EAPI Eina_Bool ecore_x_gesture_events_select(Ecore_X_Window win, Ecore_X_Gesture_Event_Mask mask);
EAPI Ecore_X_Gesture_Event_Mask ecore_x_gesture_events_selected_get(Ecore_X_Window win);
EAPI Eina_Bool ecore_x_gesture_event_grab(Ecore_X_Window win, Ecore_X_Gesture_Event_Type type, int num_fingers);
EAPI Eina_Bool ecore_x_gesture_event_ungrab(Ecore_X_Window win, Ecore_X_Gesture_Event_Type type, int num_fingers);
EINA_DEPRECATED EAPI Eina_Bool ecore_x_gesture_supported(void);
EINA_DEPRECATED EAPI Eina_Bool ecore_x_gesture_events_select(Ecore_X_Window win, Ecore_X_Gesture_Event_Mask mask);
EINA_DEPRECATED EAPI Ecore_X_Gesture_Event_Mask ecore_x_gesture_events_selected_get(Ecore_X_Window win);
EINA_DEPRECATED EAPI Eina_Bool ecore_x_gesture_event_grab(Ecore_X_Window win, Ecore_X_Gesture_Event_Type type, int num_fingers);
EINA_DEPRECATED EAPI Eina_Bool ecore_x_gesture_event_ungrab(Ecore_X_Window win, Ecore_X_Gesture_Event_Type type, int num_fingers);
EAPI void ecore_x_e_illume_indicator_state_set(Ecore_X_Window win, Ecore_X_Illume_Indicator_State state);
EAPI Ecore_X_Illume_Indicator_State ecore_x_e_illume_indicator_state_get(Ecore_X_Window win);

View File

@ -61,9 +61,6 @@ static int _ecore_x_event_fixes_selection_id = 0;
#ifdef ECORE_XDAMAGE
static int _ecore_x_event_damage_id = 0;
#endif /* ifdef ECORE_XDAMAGE */
#ifdef ECORE_XGESTURE
static int _ecore_x_event_gesture_id = 0;
#endif /* ifdef ECORE_XGESTURE */
#ifdef ECORE_XKB
static int _ecore_x_event_xkb_id = 0;
#endif /* ifdef ECORE_XKB */
@ -408,10 +405,6 @@ _ecore_x_init2(void)
int damage_base = 0;
int damage_err_base = 0;
#endif /* ifdef ECORE_XDAMAGE */
#ifdef ECORE_XGESTURE
int gesture_base = 0;
int gesture_err_base = 0;
#endif /* ifdef ECORE_XGESTURE */
#ifdef ECORE_XKB
int xkb_base = 0;
#endif /* ifdef ECORE_XKB */
@ -470,12 +463,6 @@ _ecore_x_init2(void)
ECORE_X_EVENT_HANDLERS_GROW(damage_base, XDamageNumberEvents);
#endif /* ifdef ECORE_XDAMAGE */
#ifdef ECORE_XGESTURE
if (XGestureQueryExtension(_ecore_x_disp, &gesture_base, &gesture_err_base))
_ecore_x_event_gesture_id = gesture_base;
ECORE_X_EVENT_HANDLERS_GROW(gesture_base, GestureNumberEvents);
#endif /* ifdef ECORE_XGESTURE */
#ifdef ECORE_XKB
{
int dummy;
@ -577,20 +564,6 @@ _ecore_x_init2(void)
_ecore_x_event_handlers[_ecore_x_event_xkb_id] = _ecore_x_event_handle_xkb;
#endif /* ifdef ECORE_XKB */
#ifdef ECORE_XGESTURE
if (_ecore_x_event_gesture_id)
{
_ecore_x_event_handlers[_ecore_x_event_gesture_id + GestureNotifyFlick] = _ecore_x_event_handle_gesture_notify_flick;
_ecore_x_event_handlers[_ecore_x_event_gesture_id + GestureNotifyPan] = _ecore_x_event_handle_gesture_notify_pan;
_ecore_x_event_handlers[_ecore_x_event_gesture_id + GestureNotifyPinchRotation] = _ecore_x_event_handle_gesture_notify_pinchrotation;
_ecore_x_event_handlers[_ecore_x_event_gesture_id + GestureNotifyTap] = _ecore_x_event_handle_gesture_notify_tap;
_ecore_x_event_handlers[_ecore_x_event_gesture_id + GestureNotifyTapNHold] = _ecore_x_event_handle_gesture_notify_tapnhold;
_ecore_x_event_handlers[_ecore_x_event_gesture_id + GestureNotifyHold] = _ecore_x_event_handle_gesture_notify_hold;
_ecore_x_event_handlers[_ecore_x_event_gesture_id + GestureNotifyGroup] = _ecore_x_event_handle_gesture_notify_group;
}
#endif /* ifdef ECORE_XGESTURE */
ECORE_X_EVENT_ANY = ecore_event_type_new();
ECORE_X_EVENT_MOUSE_IN = ecore_event_type_new();
ECORE_X_EVENT_MOUSE_OUT = ecore_event_type_new();
@ -691,7 +664,6 @@ _ecore_x_init2(void)
_ecore_x_present_init();
_ecore_x_dpms_init();
_ecore_x_randr_init();
_ecore_x_gesture_init();
_ecore_x_input_init();
_ecore_x_events_init();

View File

@ -2466,188 +2466,6 @@ _ecore_x_event_handle_generic_event(XEvent *event)
data);
}
#ifdef ECORE_XGESTURE
void
_ecore_x_event_handle_gesture_notify_flick(XEvent *xevent)
{
XGestureNotifyFlickEvent *xfe;
Ecore_X_Event_Gesture_Notify_Flick *e;
_ecore_x_last_event_mouse_move = EINA_FALSE;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
xfe = (XGestureNotifyFlickEvent *)xevent;
e = calloc(1, sizeof(Ecore_X_Event_Gesture_Notify_Flick));
if (!e)
return;
e->win = xfe->window;
e->time = xfe->time;
e->subtype = xfe->kind;
e->num_fingers = xfe->num_finger;
e->distance = xfe->distance;
e->duration = xfe->duration;
e->direction = xfe->direction;
e->angle = XFixedToDouble(xfe->angle);
ecore_event_add(ECORE_X_EVENT_GESTURE_NOTIFY_FLICK, e, NULL, NULL);
}
void
_ecore_x_event_handle_gesture_notify_pan(XEvent *xevent)
{
XGestureNotifyPanEvent *xpe;
Ecore_X_Event_Gesture_Notify_Pan *e;
_ecore_x_last_event_mouse_move = EINA_FALSE;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
xpe = (XGestureNotifyPanEvent *)xevent;
e = calloc(1, sizeof(Ecore_X_Event_Gesture_Notify_Pan));
if (!e)
return;
e->win = xpe->window;
e->time = xpe->time;
e->subtype = xpe->kind;
e->num_fingers = xpe->num_finger;
e->dx = xpe->dx;
e->dy = xpe->dy;
e->distance = xpe->distance;
e->duration = xpe->duration;
e->direction = xpe->direction;
ecore_event_add(ECORE_X_EVENT_GESTURE_NOTIFY_PAN, e, NULL, NULL);
}
void
_ecore_x_event_handle_gesture_notify_pinchrotation(XEvent *xevent)
{
XGestureNotifyPinchRotationEvent *xpre;
Ecore_X_Event_Gesture_Notify_PinchRotation *e;
_ecore_x_last_event_mouse_move = EINA_FALSE;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
xpre = (XGestureNotifyPinchRotationEvent *)xevent;
e = calloc(1, sizeof(Ecore_X_Event_Gesture_Notify_PinchRotation));
if (!e)
return;
e->win = xpre->window;
e->time = xpre->time;
e->subtype = xpre->kind;
e->num_fingers = xpre->num_finger;
e->distance = xpre->distance;
e->cx = xpre->cx;
e->cy = xpre->cy;
e->zoom = XFixedToDouble(xpre->zoom);
e->angle = XFixedToDouble(xpre->angle);
ecore_event_add(ECORE_X_EVENT_GESTURE_NOTIFY_PINCHROTATION, e, NULL, NULL);
}
void
_ecore_x_event_handle_gesture_notify_tap(XEvent *xevent)
{
XGestureNotifyTapEvent *xte;
Ecore_X_Event_Gesture_Notify_Tap *e;
_ecore_x_last_event_mouse_move = EINA_FALSE;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
xte = (XGestureNotifyTapEvent *)xevent;
e = calloc(1, sizeof(Ecore_X_Event_Gesture_Notify_Tap));
if (!e)
return;
e->win = xte->window;
e->time = xte->time;
e->subtype = xte->kind;
e->num_fingers = xte->num_finger;
e->cx = xte->cx;
e->cy = xte->cy;
e->tap_repeat = xte->tap_repeat;
e->interval = xte->interval;
ecore_event_add(ECORE_X_EVENT_GESTURE_NOTIFY_TAP, e, NULL, NULL);
}
void
_ecore_x_event_handle_gesture_notify_tapnhold(XEvent *xevent)
{
XGestureNotifyTapNHoldEvent *xthe;
Ecore_X_Event_Gesture_Notify_TapNHold *e;
_ecore_x_last_event_mouse_move = EINA_FALSE;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
xthe = (XGestureNotifyTapNHoldEvent *)xevent;
e = calloc(1, sizeof(Ecore_X_Event_Gesture_Notify_TapNHold));
if (!e)
return;
e->win = xthe->window;
e->time = xthe->time;
e->subtype = xthe->kind;
e->num_fingers = xthe->num_finger;
e->cx = xthe->cx;
e->cy = xthe->cy;
e->interval = xthe->interval;
e->hold_time = xthe->holdtime;
ecore_event_add(ECORE_X_EVENT_GESTURE_NOTIFY_TAPNHOLD, e, NULL, NULL);
}
void
_ecore_x_event_handle_gesture_notify_hold(XEvent *xevent)
{
XGestureNotifyHoldEvent *xhe;
Ecore_X_Event_Gesture_Notify_Hold *e;
_ecore_x_last_event_mouse_move = EINA_FALSE;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
xhe = (XGestureNotifyHoldEvent *)xevent;
e = calloc(1, sizeof(Ecore_X_Event_Gesture_Notify_Hold));
if (!e)
return;
e->win = xhe->window;
e->time = xhe->time;
e->subtype = xhe->kind;
e->num_fingers = xhe->num_finger;
e->cx = xhe->cx;
e->cy = xhe->cy;
e->hold_time = xhe->holdtime;
ecore_event_add(ECORE_X_EVENT_GESTURE_NOTIFY_HOLD, e, NULL, NULL);
}
void
_ecore_x_event_handle_gesture_notify_group(XEvent *xevent)
{
XGestureNotifyGroupEvent *xge;
Ecore_X_Event_Gesture_Notify_Group *e;
_ecore_x_last_event_mouse_move = EINA_FALSE;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
xge = (XGestureNotifyGroupEvent *)xevent;
e = calloc(1, sizeof(Ecore_X_Event_Gesture_Notify_Group));
if (!e)
return;
e->win = xge->window;
e->time = xge->time;
e->subtype = xge->kind;
e->num_groups = xge->num_group;
e->group_id = xge->groupid;
ecore_event_add(ECORE_X_EVENT_GESTURE_NOTIFY_GROUP, e, NULL, NULL);
}
#endif /* ifdef ECORE_XGESTURE */
#ifdef ECORE_XKB
void

View File

@ -4,84 +4,30 @@
#include "ecore_x_private.h"
static Eina_Bool _gesture_available = EINA_FALSE;
#ifdef ECORE_XGESTURE
static int _gesture_major, _gesture_minor, _gesture_patch;
int _gesture_version;
#endif /* ifdef ECORE_XGESTURE */
void
_ecore_x_gesture_init(void)
{
#ifdef ECORE_XGESTURE
_gesture_major = 0;
_gesture_minor = 0;
_gesture_patch = 0;
_gesture_version = 0;
if (XGestureQueryVersion(_ecore_x_disp, &_gesture_major, &_gesture_minor, &_gesture_patch))
{
_gesture_version = (_gesture_major << 16) | _gesture_minor;
_gesture_available = EINA_TRUE;
}
else
_gesture_available = EINA_FALSE;
#else /* ifdef ECORE_XGESTURE */
_gesture_available = EINA_FALSE;
#endif /* ifdef ECORE_XGESTURE */
}
/*
* @brief Query whether gesture is available or not.
*
* @return @c EINA_TRUE, if extension is available, @c EINA_FALSE otherwise.
*
* @deprecated
*/
EAPI Eina_Bool
ecore_x_gesture_supported(void)
{
return _gesture_available;
return EINA_FALSE;
}
EAPI Eina_Bool
ecore_x_gesture_events_select(Ecore_X_Window win,
Ecore_X_Gesture_Event_Mask mask)
{
#ifdef ECORE_XGESTURE
if (!_gesture_available)
return EINA_FALSE;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
XGestureSelectEvents(_ecore_x_disp, win, mask);
if (_ecore_xlib_sync) ecore_x_sync();
return EINA_TRUE;
#else /* ifdef ECORE_XGESTURE */
(void) win;
(void) mask;
return EINA_FALSE;
#endif /* ifdef ECORE_XGESTURE */
}
EAPI Ecore_X_Gesture_Event_Mask
ecore_x_gesture_events_selected_get(Ecore_X_Window win)
{
#ifdef ECORE_XGESTURE
Ecore_X_Gesture_Event_Mask mask;
if (!_gesture_available)
return ECORE_X_GESTURE_EVENT_MASK_NONE;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (GestureSuccess != XGestureGetSelectedEvents(_ecore_x_disp, win, (Mask *)&mask))
mask = ECORE_X_GESTURE_EVENT_MASK_NONE;
if (_ecore_xlib_sync) ecore_x_sync();
return mask;
#else /* ifdef ECORE_XGESTURE */
(void) win;
return ECORE_X_GESTURE_EVENT_MASK_NONE;
#endif /* ifdef ECORE_XGESTURE */
}
EAPI Eina_Bool
@ -89,21 +35,7 @@ ecore_x_gesture_event_grab(Ecore_X_Window win,
Ecore_X_Gesture_Event_Type type,
int num_fingers)
{
#ifdef ECORE_XGESTURE
Eina_Bool ret;
if (!_gesture_available)
return EINA_FALSE;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ret = (GestureGrabSuccess == XGestureGrabEvent(_ecore_x_disp, win, type, num_fingers, CurrentTime));
if (_ecore_xlib_sync) ecore_x_sync();
return ret;
#else /* ifdef ECORE_XGESTURE */
(void) win;
(void) type;
(void) num_fingers;
return EINA_FALSE;
#endif /* ifdef ECORE_XGESTURE */
}
EAPI Eina_Bool
@ -111,21 +43,5 @@ ecore_x_gesture_event_ungrab(Ecore_X_Window win,
Ecore_X_Gesture_Event_Type type,
int num_fingers)
{
#ifdef ECORE_XGESTURE
Eina_Bool ret;
if (!_gesture_available)
return EINA_FALSE;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ret = (GestureUngrabSuccess == XGestureUngrabEvent(_ecore_x_disp, win, type, num_fingers, CurrentTime));
if (_ecore_xlib_sync) ecore_x_sync();
return ret;
#else /* ifdef ECORE_XGESTURE */
(void) win;
(void) type;
(void) num_fingers;
return EINA_FALSE;
#endif /* ifdef ECORE_XGESTURE */
}

View File

@ -44,10 +44,6 @@
#ifdef ECORE_XDAMAGE
#include <X11/extensions/Xdamage.h>
#endif /* ifdef ECORE_XDAMAGE */
#ifdef ECORE_XGESTURE
#include <X11/extensions/gesture.h>
#include <X11/extensions/gestureproto.h>
#endif /* ifdef ECORE_XGESTURE */
#ifdef ECORE_XDPMS
#include <X11/extensions/dpms.h>
#endif /* ifdef ECORE_XDPMS */
@ -248,15 +244,6 @@ void _ecore_x_event_handle_client_message(XEvent *xevent);
void _ecore_x_event_handle_mapping_notify(XEvent *xevent);
void _ecore_x_event_handle_shape_change(XEvent *xevent);
void _ecore_x_event_handle_screensaver_notify(XEvent *xevent);
#ifdef ECORE_XGESTURE
void _ecore_x_event_handle_gesture_notify_flick(XEvent *xevent);
void _ecore_x_event_handle_gesture_notify_pan(XEvent *xevent);
void _ecore_x_event_handle_gesture_notify_pinchrotation(XEvent *xevent);
void _ecore_x_event_handle_gesture_notify_tap(XEvent *xevent);
void _ecore_x_event_handle_gesture_notify_tapnhold(XEvent *xevent);
void _ecore_x_event_handle_gesture_notify_hold(XEvent *xevent);
void _ecore_x_event_handle_gesture_notify_group(XEvent *xevent);
#endif /* ifdef ECORE_XGESTURE */
void _ecore_x_event_handle_sync_counter(XEvent *xevent);
void _ecore_x_event_handle_sync_alarm(XEvent *xevent);
#ifdef ECORE_XRANDR

View File

@ -61,10 +61,6 @@ if get_option('xpresent')
ecore_x_checks += [['Xpresent', 'Xpresent.h', 'Xpresent', 'XPresentQueryExtension']]
endif
if get_option('xgesture')
ecore_x_checks += [['Xgesture', 'gesture.h', 'Xgesture', 'XGestureQueryExtension']]
endif
if get_option('xinput2')
ecore_x_checks += [['Xi2', 'XInput2.h', 'Xi', 'XIQueryDevice']]
endif

View File

@ -146,7 +146,6 @@ typedef Efl_Gfx_Path_Command_Type Efl_Gfx_Path_Command;
#include "interfaces/efl_ui_draggable.eo.h"
#include "interfaces/efl_ui_scrollable.eo.h"
#include "interfaces/efl_ui_scrollbar.eo.h"
#include "interfaces/efl_ui_text_selectable.eo.h"
#include "interfaces/efl_ui_container_selectable.eo.h"
#include "interfaces/efl_ui_zoom.eo.h"
@ -213,6 +212,7 @@ typedef Efl_Gfx_Path_Command_Type Efl_Gfx_Path_Command;
#include "interfaces/efl_text_format.eo.h"
#include "interfaces/efl_text_markup.eo.h"
#include "interfaces/efl_text_markup_util.eo.h"
#include "interfaces/efl_input_text.eo.h"
/**
* @brief Get a proxy object referring to a part of an object.

View File

@ -1,5 +1,5 @@
import efl_gfx_types;
interface @beta Efl.Gfx.Arrangement
interface Efl.Gfx.Arrangement
{
[[
This interface provides methods for manipulating how contents are arranged within a container,

View File

@ -0,0 +1,274 @@
enum @beta Efl.Input_Text.Panel_Layout_Type
{
[[Input panel (virtual keyboard) layout types.
Type of input panel (virtual keyboard) to use - this is a hint and may not provide exactly what is desired.
]]
normal, [[Default layout.]]
number, [[Number layout.]]
email, [[Email layout.]]
url, [[URL layout.]]
phonenumber, [[Phone Number layout.]]
ip, [[IP layout.]]
month, [[Month layout.]]
numberonly, [[Number Only layout.]]
invalid, [[Never use this.]]
hex, [[Hexadecimal layout.]]
terminal, [[Command-line terminal layout including esc, alt, ctrl key, so on (no auto-correct, no auto-capitalization).]]
password, [[Like normal, but no auto-correct, no auto-capitalization etc.]]
datetime, [[Date and time layout
@since 1.8]]
emoticon, [[Emoticon layout
@since 1.10]]
voice [[Voice layout, but if the IME does not support voice layout, then normal layout will be shown.
@since 1.19]]
}
enum @beta Efl.Input_Text.Panel_Language_Type
{
[[Input panel (virtual keyboard) language modes.
]]
automatic, [[Automatic]]
alphabet [[Alphabet]]
}
enum @beta Efl.Input_Text.Capitalize_Type
{
[[Autocapitalization Types.
Choose method of auto-capitalization.
]]
none, [[No auto-capitalization when typing.]]
word, [[Autocapitalize each word typed.]]
sentence, [[Autocapitalize the start of each sentence.]]
allcharacter [[Autocapitalize all letters.]]
}
enum @beta Efl.Input_Text.Panel_Return_Key_Type
{
[["Return" Key types on the input panel (virtual keyboard).
]]
default, [[Default.]]
done, [[Done.]]
go, [[Go.]]
join, [[Join.]]
login, [[Login.]]
next, [[Next.]]
search, [[Search string or magnifier icon.]]
send, [[Send.]]
signin [[Sign-in
@since 1.8]]
}
enum @beta Efl.Input_Text.Panel_Return_Key_State
{
[["Return" Key state on the input panel (virtual keyboard).
]]
auto, [[The return key on input panel is disabled when the entry has no text,
if entry has text, return key is enabled.
]]
enabled, [[The return key on input panel is enabled.]]
disabled, [[The return key on input panel is disabled.]]
}
enum @beta Efl.Input_Text.Hints_Type
{
[[Enumeration that defines the types of Input Hints.
@since 1.12
]]
none = 0, [[No active hints
@since 1.12]]
auto_complete = 1 << 0, [[Suggest word auto completion
@since 1.12]]
sensitive_data = 1 << 1, [[Typed text should not be stored.
@since 1.12]]
autofill_credit_card_expiration_date = 0x100, [[ Autofill hint for a credit card expiration date
@since 1.21]]
autofill_credit_card_expiration_day = 0x200, [[Autofill hint for a credit card expiration day
@since 1.21]]
autofill_credit_card_expiration_month = 0x300, [[ Autofill hint for a credit card expiration month
@since 1.21]]
autofill_credit_card_expiration_year = 0x400, [[ Autofill hint for a credit card expiration year
@since 1.21]]
autofill_credit_card_number = 0x500, [[ Autofill hint for a credit card number
@since 1.21]]
autofill_email_address = 0x600, [[ Autofill hint for an email address
@since 1.21]]
autofill_name = 0x700, [[ Autofill hint for a user's real name
@since 1.21]]
autofill_phone = 0x800, [[ Autofill hint for a phone number
@since 1.21]]
autofill_postal_address = 0x900, [[ Autofill hint for a postal address
@since 1.21]]
autofill_postal_code = 0xA00, [[ Autofill hint for a postal code
@since 1.21]]
autofill_id = 0xB00 [[ Autofill hint for a user's ID
@since 1.21]]
}
interface @beta Efl.Input_Text {
[[All the functionality relating to input hints
]]
methods {
@property input_panel_show_on_demand {
[[Set/Get the attribute to show the input panel in case of only a user's explicit Mouse Up event.
It doesn't request to show the input panel even though it has focus.]]
set {
}
get {
}
values {
ondemand: bool; [[If $true, the input panel will be shown in case of only Mouse up event.
(Focus event will be ignored.)
]]
}
}
// FIXME: I don't understand why this is needed in addition to Layout
@property input_panel_language {
[[The language mode of the input panel.
This API can be used if you want to show the alphabet keyboard mode.]]
set {
}
get {
}
values {
lang: Efl.Input_Text.Panel_Language_Type; [[Language to be set to the input panel.]]
}
}
// FIXME: What is this?
@property input_panel_layout_variation {
[[The input panel layout variation of the entry.]]
set {
}
get {
}
values {
variation: int; [[Layout variation type.]]
}
}
// FIXME: input_capitalize/capitalization ?
@property autocapitalization {
[[The autocapitalization type on the immodule.]]
set {
}
get {
}
values {
autocapital_type: Efl.Input_Text.Capitalize_Type; [[The type of autocapitalization.]]
}
}
// FIXME: rename
@property predictable {
[[Whether the entry should allow predictive text.]]
set {
}
get {
}
values {
prediction: bool; [[Whether the entry should allow predictive text.]]
}
}
// FIXME: I agree with Mike, looks bad
@property input_hint {
[[The input hint which allows input methods to fine-tune their behavior.]]
set {
}
get {
}
values {
hints: Efl.Input_Text.Hints_Type; [[Input hint.]]
}
}
@property input_panel_layout {
[[The input panel layout of the entry.]]
set {
}
get {
}
values {
layout: Efl.Input_Text.Panel_Layout_Type(Efl.Input_Text.Panel_Layout_Type.invalid); [[Layout type.]]
}
}
@property input_panel_return_key_type {
[[The "return" key type. This type is used to set string or icon on the "return" key of the input panel.
An input panel displays the string or icon associated with this type.]]
set {
}
get {
}
values {
return_key_type: Efl.Input_Text.Panel_Return_Key_Type; [[The type of "return" key on the input panel.]]
}
}
// FIXME: shouldn't this be "autoshow" or something?
@property input_panel_autoshow {
[[The attribute to show the input panel automatically.]]
set {
}
get {
}
values {
enabled: bool; [[If $true, the input panel is appeared when entry is clicked or has a focus.]]
}
}
@property input_panel_return_key_state {
[[State for the return key on the input panel see @Efl.Input_Text.Panel_Return_Key_State.]]
set {
}
get {
}
values {
state: Efl.Input_Text.Panel_Return_Key_State; [[Enable state for return key, see @Efl.Input_Text.Panel_Return_Key_State.]]
}
}
input_panel_show {
[[Show the input panel (virtual keyboard) based on the input panel property of entry such as layout, autocapital types and so on.
Note that input panel is shown or hidden automatically according to the focus state of entry widget.
This API can be used in the case of manually controlling by using @.input_panel_autoshow.set(en, $false).
]]
}
input_panel_hide {
[[Hide the input panel (virtual keyboard).
Note that input panel is shown or hidden automatically according to the focus state of entry widget.
This API can be used in the case of manually controlling by using @.input_panel_autoshow.set(en, $false).
]]
}
@property input_panel_imdata {
[[Set/Get the input panel-specific data to deliver to the input panel.
This API is used by applications to deliver specific data to the input panel.
The data format MUST be negotiated by both application and the input panel.
The size and format of data are defined by the input panel.
]]
values {
value: slice<ubyte>; [[The specific data to be set/get to the input panel.]]
}
}
}
}

View File

@ -25,6 +25,7 @@
#include "interfaces/efl_text_style.eo.c"
#include "interfaces/efl_text_format.eo.c"
#include "interfaces/efl_text_markup.eo.c"
#include "interfaces/efl_input_text.eo.c"
#include "interfaces/efl_gfx_entity.eo.c"
#include "interfaces/efl_gfx_buffer.eo.c"
@ -72,7 +73,6 @@
#include "interfaces/efl_ui_scrollable.eo.c"
#include "interfaces/efl_ui_scrollbar.eo.c"
#include "interfaces/efl_ui_container_selectable.eo.c"
#include "interfaces/efl_ui_text_selectable.eo.c"
#include "interfaces/efl_ui_zoom.eo.c"

View File

@ -10,7 +10,7 @@ enum Efl.Text_Bidirectional_Type {
inherit [[Inherit text type]]
}
struct @beta Efl.Ui.Text_Change_Info {
struct @beta Efl.Text_Change_Info {
[[This structure includes all the information about content changes.
It's meant to be used to implement undo/redo.
@ -22,4 +22,11 @@ struct @beta Efl.Ui.Text_Change_Info {
merge: bool; [[$true if can be merged with the previous one. Used for example with insertion when something is already selected]]
}
struct @beta Efl.Text_Range {
[[This structure includes text position range (from/to).
]]
start: int; [[The start postion.]]
end: int; [[The end position.]]
}
struct @extern @beta Efl.Text_Attribute_Handle; [[EFL text annotations data structure]]

View File

@ -1,13 +0,0 @@
interface @beta Efl.Ui.Text_Selectable
{
[[Efl UI text selectable interface]]
event_c_prefix: efl_ui;
events {
selection,paste: void; [[Called when selection is pasted]]
selection,copy: void; [[Called when selection is copied]]
selection,cut: void; [[Called when selection is cut]]
selection,start: void; [[Called at selection start]]
selection,changed: void; [[Called when selection is changed]]
selection,cleared: void; [[Called when selection is cleared]]
}
}

View File

@ -10,7 +10,6 @@ pub_legacy_eo_files = [
'efl_ui_scrollable.eo',
'efl_ui_scrollbar.eo',
'efl_ui_container_selectable.eo',
'efl_ui_text_selectable.eo',
'efl_ui_zoom.eo',
]
@ -94,6 +93,7 @@ pub_eo_files = [
'efl_gfx_text_class.eo',
'efl_gfx_size_class.eo',
'efl_cached_item.eo',
'efl_input_text.eo',
]
foreach eo_file : pub_eo_files

View File

@ -227,7 +227,6 @@ typedef void (*Context_Item_Clicked_Cb)(void *data, Eo *obj, void *event_info);
# include <efl_text_interactive.eo.h>
# include <efl_ui_text.eo.h>
# include <efl_ui_text_editable.eo.h>
# include <efl_ui_text_async.eo.h>
# include <efl_ui_animation_view.eo.h>

View File

@ -13,11 +13,11 @@ interface @beta Efl.Text_Interactive extends Efl.Text, Efl.Text_Font,
}
}
@property selection_allowed {
[[Whether or not selection is allowed on this object]]
[[Whether or not selection is allowed on this object.]]
set {}
get {}
values {
allowed: bool; [[$true if enabled, $false otherwise]]
allowed: bool; [[$true if enabled, $false otherwise.]]
}
}
@property selection_cursors {
@ -50,11 +50,34 @@ interface @beta Efl.Text_Interactive extends Efl.Text, Efl.Text_Font,
if not, the entry is read-only and no user input is allowed.]]
}
}
select_none {
all_unselect {
[[Clears the selection.]]
}
all_select {
[[Select all the content.]]
}
@property have_selection {
[[Whether the entry have a selected text.
]]
get {
}
values {
selected: bool; [[If $true, entry have selected text, $false otherwise.]]
}
}
}
events {
text,selection,changed: void; [[The selection on the object has changed. Query using @.selection_cursors]]
preedit,changed: void; [[Called when entry preedit changed.]]
have_selection,changed: bool; [[Called when @.have_selection property value changed.]]
selection,changed: Efl.Text_Range; [[Called when selection has changed. Query using @.selection_cursors.]]
redo,request: void; [[Called when redo is requested]]
undo,request: void; [[Called when undo is requested]]
changed,user: Efl.Text_Change_Info; [[The content has changed due to user interaction.]]
// FIXME: efl_ui_text doesn't support anchor callbacks yet.
//anchor,down: Elm.Entry_Anchor_Info; [[Called on anchor down]]
//anchor,hover,opened: Elm.Entry_Anchor_Hover_Info; [[Called when hover opened]]
//anchor,in: Elm.Entry_Anchor_Info; [[Called on anchor in]]
//anchor,out: Elm.Entry_Anchor_Info; [[Called on anchor out]]
//anchor,up: Elm.Entry_Anchor_Info; [[called on anchor up]]
}
}

View File

@ -46,7 +46,7 @@ class Efl.Ui.Alert_Popup extends Efl.Ui.Popup
}
}
parts {
title @beta: Efl.Ui.Alert_Popup_Part_Title; [[The title text of Alert Popup.]]
title : Efl.Ui.Alert_Popup_Part_Title; [[The title text of Alert Popup.]]
}
implements {
Efl.Object.constructor;

View File

@ -1,4 +1,4 @@
class @beta Efl.Ui.Alert_Popup_Part_Title extends Efl.Ui.Layout_Part_Text
class Efl.Ui.Alert_Popup_Part_Title extends Efl.Ui.Layout_Part_Text
{
[[Efl UI Alert Popup internal part class]]
data: null;

View File

@ -200,7 +200,7 @@ field_create(Eo *obj, Efl_Ui_Clock_Type field_type)
field_obj = efl_add(EFL_UI_TEXT_CLASS,obj,
efl_text_multiline_set(efl_added, EINA_FALSE),
efl_text_interactive_editable_set(efl_added, EINA_FALSE),
efl_ui_text_input_panel_enabled_set(efl_added, EINA_FALSE),
efl_input_text_input_panel_autoshow_set(efl_added, EINA_FALSE),
efl_ui_text_context_menu_disabled_set(efl_added, EINA_TRUE));
}
evas_object_data_set(field_obj, "_field_type", (void *)field_type);

View File

@ -53,6 +53,12 @@ class Efl.Ui.Collection extends Efl.Ui.Layout_Base implements
}
@property position_manager @beta {
[[Position manager object that handles placement of items.]]
get {
values {
position_manager : Efl.Ui.Position_Manager.Entity; [[A borrowed handle to the item container.]]
}
}
set { }
values {
position_manager : Efl.Ui.Position_Manager.Entity @move; [[Ownership is passed to the item container.]]
}

View File

@ -2302,7 +2302,7 @@ _efl_ui_collection_view_focus_manager_efl_ui_focus_manager_request_move(Eo *obj,
new_id = efl_ui_position_manager_entity_relative_item(cpd->manager,
item_id,
direction);
if (new_id == -1)
if (new_id < 0)
{
new_item = NULL;
}
@ -2326,7 +2326,7 @@ _efl_ui_collection_view_focus_manager_efl_ui_focus_manager_request_move(Eo *obj,
_assert_item_available(new_item, new_id, cpd);
}
#else
uint64_t search_index = new_id;
uint64_t search_index = (uint64_t)new_id;
lookup = (void*) eina_rbtree_inline_lookup(cpd->cache, &search_index,
sizeof (new_id), _cache_tree_lookup,
NULL);

View File

@ -37,6 +37,12 @@ class Efl.Ui.Collection_View extends Efl.Ui.Layout_Base implements
}
@property position_manager @beta {
[[Position manager object that handles placement of items.]]
get {
values {
position_manager : Efl.Ui.Position_Manager.Entity; [[ A borrowed reference to the manager. ]]
}
}
set { }
values {
position_manager : Efl.Ui.Position_Manager.Entity @move; [[The objects ownership is passed to the item container.]]
}

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
class @beta Efl.Ui.Internal.Text.Interactive extends Efl.Canvas.Text implements Efl.Text_Interactive
class @beta Efl.Ui.Internal.Text.Interactive extends Efl.Canvas.Text implements Efl.Text_Interactive, Efl.Input_Text
{
[[An internal object in charge of the interactive aspect of the text widget.
@ -11,6 +11,23 @@ class @beta Efl.Ui.Internal.Text.Interactive extends Efl.Canvas.Text implements
Efl.Text_Interactive.selection_allowed { get; set; }
Efl.Text_Interactive.selection_cursors { get; }
Efl.Text_Interactive.editable { get; set; }
Efl.Text_Interactive.select_none;
Efl.Text_Interactive.all_unselect;
Efl.Text_Interactive.all_select;
Efl.Text_Interactive.have_selection {get; }
Efl.Text.text { set; }
Efl.Text_Markup.markup { set; }
Efl.Input_Text.input_panel_show_on_demand { get; set; }
Efl.Input_Text.input_panel_language { get; set; }
Efl.Input_Text.input_panel_layout_variation { get; set; }
Efl.Input_Text.autocapitalization { get; set; }
Efl.Input_Text.input_panel_return_key_state { get; set; }
Efl.Input_Text.predictable { get; set; }
Efl.Input_Text.input_hint { get; set; }
Efl.Input_Text.input_panel_layout { get; set; }
Efl.Input_Text.input_panel_return_key_type { get; set; }
Efl.Input_Text.input_panel_autoshow { get; set; }
Efl.Input_Text.input_panel_show;
Efl.Input_Text.input_panel_hide;
Efl.Input_Text.input_panel_imdata { get; set; }
}
}

View File

@ -32,6 +32,12 @@ class @beta Efl.Ui.Spotlight.Container extends Efl.Ui.Widget implements Efl.Pack
[[This object defines how sub-widgets are rendered and animated.
If it is not set, only the active sub-widget is shown and transitions are instantaneous (not animated).
]]
get {
values {
spotlight_manager : Efl.Ui.Spotlight.Manager; [[The Spotlight Manager object or $NULL.]]
}
}
set { }
values {
spotlight_manager : Efl.Ui.Spotlight.Manager @move; [[The Spotlight Manager object or $NULL.]]
}
@ -42,6 +48,12 @@ class @beta Efl.Ui.Spotlight.Container extends Efl.Ui.Widget implements Efl.Pack
When this object is set, it is immediately updated to reflect the current state of the widget.
Its location inside the container is controlled by the @.spotlight_manager.
]]
get {
values {
indicator : Efl.Ui.Spotlight.Indicator; [[The Indicator object or $NULL.]]
}
}
set { }
values {
indicator : Efl.Ui.Spotlight.Indicator @move; [[The Indicator object or $NULL.]]
}

View File

@ -472,7 +472,7 @@ _mouse_clicked_signal_cb(void *data EINA_UNUSED,
{
Efl_Ui_Tags_Data *sd = efl_data_scope_get(obj, EFL_UI_TAGS_CLASS);
if (sd->editable) efl_ui_text_input_panel_show(sd->entry);
if (sd->editable) efl_input_text_input_panel_show(sd->entry);
efl_event_callback_call(obj, EFL_INPUT_EVENT_CLICKED, NULL);
}
@ -758,7 +758,7 @@ _view_init(Evas_Object *obj, Efl_Ui_Tags_Data *sd)
efl_text_multiline_set(efl_added, EINA_FALSE),
efl_text_set(efl_added, ""),
efl_ui_text_cnp_mode_set(efl_added, EFL_UI_SELECTION_FORMAT_MARKUP),
efl_ui_text_input_panel_enabled_set(efl_added, EINA_FALSE),
efl_input_text_input_panel_autoshow_set(efl_added, EINA_FALSE),
efl_text_interactive_editable_set(efl_added, EINA_TRUE),
efl_composite_attach(obj, efl_added));

File diff suppressed because it is too large Load Diff

View File

@ -1,97 +1,12 @@
/* FIXME - Text object must stop using Context_Item_Clicked_Cb! */
/* Legacy-only function pointer types, for the legacy EO classes (genlist, etc...) */
type @beta @extern Context_Item_Clicked_Cb: __undefined_type; [[Evas smart callback type]]
struct @beta Efl.Ui.Validate_Content_Info
{
[[Validate content information.]]
text: string; [[Validate content text]]
signal: string; [[Validate content signal]]
}
enum @beta Efl.Ui.Autocapital_Type
{
[[Autocapitalization Types.
Choose method of auto-capitalization.
]]
none, [[No auto-capitalization when typing.]]
word, [[Autocapitalize each word typed.]]
sentence, [[Autocapitalize the start of each sentence.]]
allcharacter [[Autocapitalize all letters.]]
}
enum @beta Efl.Ui.Input_Panel_Language_Type
{
[[Input panel (virtual keyboard) language modes.
]]
automatic, [[Automatic]]
alphabet [[Alphabet]]
}
enum @beta Efl.Ui.Input_Hints
{
[[Enumeration that defines the types of Input Hints.]]
none = 0, [[No active hints.]]
auto_complete = 1 << 0, [[Suggest word auto completion.]]
sensitive_data = 1 << 1, [[Typed text should not be stored.]]
}
enum @beta Efl.Ui.Input_Panel_Layout
{
[[Input panel (virtual keyboard) layout types.
Type of input panel (virtual keyboard) to use - this is a hint and may not provide exactly what is desired.
]]
normal, [[Default layout.]]
number, [[Number layout.]]
email, [[Email layout.]]
url, [[URL layout.]]
phonenumber, [[Phone Number layout.]]
ip, [[IP layout.]]
month, [[Month layout.]]
numberonly, [[Number Only layout.]]
invalid, [[Never use this.]]
hex, [[Hexadecimal layout.]]
terminal, [[Command-line terminal layout including esc, alt, ctrl key, so on (no auto-correct, no auto-capitalization).]]
password, [[Like normal, but no auto-correct, no auto-capitalization etc.]]
datetime, [[Date and time layout.]]
emoticon, [[Emoticon layout.]]
voice [[Voice layout, but if the IME does not support voice layout, then normal layout will be shown.]]
}
enum @beta Efl.Ui.Input_Panel_Return_Key_Type
{
[["Return" Key types on the input panel (virtual keyboard).
]]
default, [[Default.]]
done, [[Done.]]
go, [[Go.]]
join, [[Join.]]
login, [[Login.]]
next, [[Next.]]
search, [[Search string or magnifier icon.]]
send, [[Send.]]
signin [[Sign-in.]]
}
enum @beta Efl.Ui.Icon_Type
{
[[Icon types.]]
none, [[Icon has no type set.]]
file, [[Icon is of type file.]]
standard [[Icon is of type standard.]]
}
class @beta Efl.Ui.Text extends Efl.Ui.Layout_Base implements Efl.Input.Clickable,
Efl.Access.Text, Efl.Access.Editable.Text, Efl.File,
Efl.Ui.Text_Selectable
Efl.Access.Text, Efl.Access.Editable.Text, Efl.File, Efl.Input_Text
composites
Efl.Text_Interactive, Efl.Text_Markup
{
[[A flexible text widget which can be static (as a label) or editable by
the user (as a text entry). It provides all sorts of editing facilities
like automatic scrollbars, virtual keyboard, clipboard, configurable
context menus, password mode or autocapitalization, for example.]]
context menus or autocapitalization, for example.]]
methods {
@property scrollable {
[[Enable or disable scrolling in the widget.
@ -104,20 +19,6 @@ class @beta Efl.Ui.Text extends Efl.Ui.Layout_Base implements Efl.Input.Clickabl
scroll: bool; [[$true to enable scrolling. Default is $false.]]
}
}
@property input_panel_show_on_demand {
[[The attribute to show the input panel in case of only a user's explicit Mouse Up event.
It doesn't request to show the input panel even though it has focus.
]]
set {
}
get {
}
values {
ondemand: bool; [[If $true, the input panel will be shown in case of only Mouse up event.
(Focus event will be ignored.)
]]
}
}
@property context_menu_disabled {
[[This disables the entry's contextual (longpress) menu.]]
set {
@ -144,19 +45,6 @@ class @beta Efl.Ui.Text extends Efl.Ui.Layout_Base implements Efl.Input.Clickabl
format: Efl.Ui.Selection_Format; [[Format for copy & paste.]]
}
}
@property input_panel_language {
[[The language mode of the input panel.
This API can be used if you want to show the alphabet keyboard mode.
]]
set {
}
get {
}
values {
lang: Efl.Ui.Input_Panel_Language_Type; [[Language to be set to the input panel.]]
}
}
@property selection_handler_disabled {
[[This disables the entry's selection handlers.]]
set {
@ -167,117 +55,7 @@ class @beta Efl.Ui.Text extends Efl.Ui.Layout_Base implements Efl.Input.Clickabl
disabled: bool; [[If $true, the selection handlers are disabled.]]
}
}
@property input_panel_layout_variation {
[[Set the input panel layout variation of the entry
]]
set {
}
get {
}
values {
variation: int; [[Layout variation type.]]
}
}
@property autocapital_type {
[[Set the autocapitalization type on the immodule.]]
set {
}
get {
}
values {
autocapital_type: Efl.Ui.Autocapital_Type; [[The type of autocapitalization.]]
}
}
@property password_mode {
[[Sets the entry to password mode.
In password mode entries are implicitly single line and the display of
any text inside them is replaced with asterisks (*).
]]
set {
}
get {
}
values {
password: bool; [[If true, password mode is enabled.]]
}
}
@property input_panel_return_key_disabled {
[[Set the return key on the input panel to be disabled.]]
set {
}
get {
}
values {
disabled: bool; [[The state to put in in: $true for
disabled, $false for enabled.]]
}
}
@property prediction_allow {
[[Whether the entry should allow predictive text.]]
set {
}
get {
}
values {
prediction: bool; [[Whether the entry should allow predictive text.]]
}
}
@property input_hint {
[[Sets the input hint which allows input methods to fine-tune their behavior.]]
set {
}
get {
}
values {
hints: Efl.Ui.Input_Hints; [[Input hint.]]
}
}
@property input_panel_layout {
[[Set the input panel layout of the entry.]]
set {
}
get {
}
values {
layout: Efl.Ui.Input_Panel_Layout(Efl.Ui.Input_Panel_Layout.invalid); [[Layout type.]]
}
}
@property input_panel_return_key_type {
[[Set the "return" key type. This type is used to set string or icon on the "return" key of the input panel.
An input panel displays the string or icon associated with this type.
]]
set {
}
get {
}
values {
return_key_type: Efl.Ui.Input_Panel_Return_Key_Type; [[The type of "return" key on the input panel.]]
}
}
@property input_panel_enabled {
[[Sets the attribute to show the input panel automatically.]]
set {
}
get {
}
values {
enabled: bool; [[If $true, the input panel is appeared when entry is clicked or has a focus.]]
}
}
@property input_panel_return_key_autoenabled {
[[Whether the return key on the input panel is disabled automatically when entry has no text.
If $enabled is $true, the return key on input panel is disabled when the entry has no text.
The return key on the input panel is automatically enabled when the entry has text.
]]
set {
}
values {
enabled: bool(false); [[If $true, the return key is automatically disabled when the entry has no text.]]
}
}
@property item_factory {
[[The factory that provides item in the text e.g.
"emoticon/happy" or "href=file://image.jpg" etc.
@ -297,80 +75,15 @@ class @beta Efl.Ui.Text extends Efl.Ui.Layout_Base implements Efl.Input.Clickabl
[[Creates and returns a new cursor for the text.]]
return: Efl.Text.Cursor @move; [[Text cursor.]]
}
input_panel_show {
[[Show the input panel (virtual keyboard) based on the input panel property of entry such as layout,
autocapital types and so on.
Note that input panel is shown or hidden automatically according to the focus state of entry widget.
This API can be used in the case of manually controlling by using @.input_panel_enabled.set(en, $false).
]]
}
selection_copy {
[[This executes a "copy" action on the selected text in the entry.]]
}
context_menu_clear {
[[This clears and frees the items in a entry's contextual (longpress)
menu.
See also @.context_menu_item_add.
]]
}
input_panel_imdata_set {
[[Set the input panel-specific data to deliver to the input panel.
This API is used by applications to deliver specific data to the input panel.
The data format MUST be negotiated by both application and the input panel.
The size and format of data are defined by the input panel.
]]
params {
@in data: const(void_ptr); [[The specific data to be set to the input panel.]]
@in len: int; [[The length of data, in bytes, to send to the input panel.]]
}
}
input_panel_imdata_get @const {
[[Get the specific data of the current input panel.]]
params {
@inout data: void; [[The specific data to be obtained from the input panel.]]
@out len: int; [[The length of data.]]
}
}
selection_paste {
[[This executes a "paste" action in the entry.]]
}
input_panel_hide {
[[Hide the input panel (virtual keyboard).
Note that input panel is shown or hidden automatically according to the focus state of entry widget.
This API can be used in the case of manually controlling by using @.input_panel_enabled.set(en, $false)
]]
}
cursor_selection_end {
[[This ends a selection within the entry as though
the user had just released the mouse button while making a selection.]]
}
selection_cut {
[[This executes a "cut" action on the selected text in the entry.]]
}
context_menu_item_add {
[[This adds an item to the entry's contextual menu.
A longpress on an entry will make the contextual menu show up unless this
has been disabled with @.context_menu_disabled.set.
By default this menu provides a few options like enabling selection mode,
which is useful on embedded devices that need to be explicit about it.
When a selection exists it also shows the copy and cut actions.
With this function, developers can add other options to this menu to
perform any action they deem necessary.
]]
params {
@in label: string @optional; [[The item's text label.]]
@in icon_file: string @optional; [[The item's icon file.]]
@in icon_type: Efl.Ui.Icon_Type; [[The item's icon type.]]
@in func: Context_Item_Clicked_Cb @optional; [[The callback to execute when the item is clicked.]]
@in data: const(void_ptr) @optional; [[The data to associate with the item for related functions.]]
}
}
}
implements {
Efl.Object.constructor;
@ -389,6 +102,7 @@ class @beta Efl.Ui.Text extends Efl.Ui.Layout_Base implements Efl.Input.Clickabl
Efl.Ui.Focus.Object.on_focus_update;
Efl.Ui.Widget.interest_region { get; }
Efl.Ui.Widget.disabled {set;}
Efl.Text_Format.password {set;}
//Efl.Ui.Widget.widget_sub_object_del;
//Elm.Interface_Scrollable.policy { set; }
//Elm.Interface_Scrollable.bounce_allow { set; }
@ -423,23 +137,10 @@ class @beta Efl.Ui.Text extends Efl.Ui.Layout_Base implements Efl.Input.Clickabl
Efl.Part.part_get;
}
events {
selection,paste: void; [[Called when selection is pasted.]]
selection,copy: void; [[Called when selection is copied.]]
selection,cut: void; [[Called when selection is cut.]]
changed: void; [[Called when entry changes]]
/* 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: Efl.Ui.Validate_Content_Info; [[Called when validating]]
context,open: void; [[Called when context menu was opened]]
preedit,changed: void; [[Called when entry preedit changed]]
press: void; [[Called when entry pressed]]
redo,request: void; [[Called when redo is requested]]
undo,request: void; [[Called when undo is requested]]
aborted: void; [[Called when entry is aborted]]
// FIXME: efl_ui_text doesn't support anchor callbacks yet.
//anchor,down: Elm.Entry_Anchor_Info; [[Called on anchor down]]
//anchor,hover,opened: Elm.Entry_Anchor_Hover_Info; [[Called when hover opened]]
//anchor,in: Elm.Entry_Anchor_Info; [[Called on anchor in]]
//anchor,out: Elm.Entry_Anchor_Info; [[Called on anchor out]]
//anchor,up: Elm.Entry_Anchor_Info; [[called on anchor up]]
cursor,changed,manual: void; [[Called on manual cursor change]]
}
}

View File

@ -1128,12 +1128,15 @@ elm_widget_focus_region_show(Eo *obj)
if (_elm_scrollable_is(o) && !elm_widget_disabled_get(o))
{
Evas_Coord sx, sy;
elm_interface_scrollable_content_region_get(o, &sx, &sy, NULL, NULL);
Evas_Coord vx, vy;
// Get the object's on_focus_region position relative to the scroller.
elm_interface_scrollable_content_region_get(o, &sx, &sy, NULL, NULL);
elm_interface_scrollable_content_viewport_geometry_get(o, &vx, &vy, NULL, NULL);
// Get the object's on_focus_region position relative to the pan in the scroller.
Evas_Coord rx, ry;
rx = ox + r.x - px + sx;
ry = oy + r.y - py + sy;
rx = ox + r.x - vx + sx;
ry = oy + r.y - vy + sy;
switch (_elm_config->focus_autoscroll_mode)
{

View File

@ -58,9 +58,9 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] =
}
SIG_FWD(CHANGED, ELM_FILESELECTOR_ENTRY_EVENT_CHANGED)
SIG_FWD(PRESS, ELM_FILESELECTOR_ENTRY_EVENT_PRESS)
SIG_FWD(SELECTION_PASTE, EFL_UI_EVENT_SELECTION_PASTE)
SIG_FWD(SELECTION_COPY, EFL_UI_EVENT_SELECTION_COPY)
SIG_FWD(SELECTION_CUT, EFL_UI_EVENT_SELECTION_CUT)
SIG_FWD(SELECTION_PASTE, EFL_UI_TEXT_EVENT_SELECTION_PASTE)
SIG_FWD(SELECTION_COPY, EFL_UI_TEXT_EVENT_SELECTION_COPY)
SIG_FWD(SELECTION_CUT, EFL_UI_TEXT_EVENT_SELECTION_CUT)
#undef SIG_FWD
#define SIG_FWD(name, event) \
@ -249,9 +249,9 @@ _elm_fileselector_entry_efl_canvas_group_group_add(Eo *obj, Elm_Fileselector_Ent
SIG_FWD(CHANGED, ELM_ENTRY_EVENT_CHANGED);
SIG_FWD(ACTIVATED, ELM_ENTRY_EVENT_ACTIVATED);
SIG_FWD(PRESS, ELM_ENTRY_EVENT_PRESS);
SIG_FWD(SELECTION_PASTE, EFL_UI_EVENT_SELECTION_PASTE);
SIG_FWD(SELECTION_COPY, EFL_UI_EVENT_SELECTION_COPY);
SIG_FWD(SELECTION_CUT, EFL_UI_EVENT_SELECTION_CUT);
SIG_FWD(SELECTION_PASTE, EFL_UI_TEXT_EVENT_SELECTION_PASTE);
SIG_FWD(SELECTION_COPY, EFL_UI_TEXT_EVENT_SELECTION_COPY);
SIG_FWD(SELECTION_CUT, EFL_UI_TEXT_EVENT_SELECTION_CUT);
#undef SIG_FWD
#define SIG_FWD(name, event) \
evas_object_smart_callback_add(priv->entry, event, _##name##_fwd, obj)

View File

@ -2417,6 +2417,7 @@ _elm_code_widget_efl_canvas_group_group_add(Eo *obj, Elm_Code_Widget_Data *pd)
gridrows = elm_box_add(scroller);
evas_object_size_hint_weight_set(gridrows, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set(gridrows, EVAS_HINT_FILL, 0.0);
elm_box_align_set(gridrows, 0.0, 0.0);
elm_object_content_set(scroller, gridrows);
pd->gridbox = gridrows;

View File

@ -1588,7 +1588,7 @@ _paste_cb(void *data,
if (!sd) return;
efl_event_callback_legacy_call
(data, EFL_UI_EVENT_SELECTION_PASTE, NULL);
(data, EFL_UI_TEXT_EVENT_SELECTION_PASTE, NULL);
sd->selection_asked = EINA_TRUE;
@ -1643,7 +1643,7 @@ _cut_cb(void *data,
if (!sd) return;
efl_event_callback_legacy_call
(data, EFL_UI_EVENT_SELECTION_CUT, NULL);
(data, EFL_UI_TEXT_EVENT_SELECTION_CUT, NULL);
/* Store it */
sd->sel_mode = EINA_FALSE;
if (!_elm_config->desktop_entry)
@ -1667,7 +1667,7 @@ _copy_cb(void *data,
if (!sd) return;
efl_event_callback_legacy_call
(data, EFL_UI_EVENT_SELECTION_COPY, NULL);
(data, EFL_UI_TEXT_EVENT_SELECTION_COPY, NULL);
sd->sel_mode = EINA_FALSE;
if (!_elm_config->desktop_entry)
{
@ -2338,8 +2338,10 @@ _entry_selection_start_signal_cb(void *data,
{
if (entry != data) elm_entry_select_none(entry);
}
Eina_Bool b_value = EINA_TRUE;
efl_event_callback_legacy_call
(data, EFL_UI_EVENT_SELECTION_START, NULL);
(data, EFL_TEXT_INTERACTIVE_EVENT_HAVE_SELECTION_CHANGED, &b_value);
elm_object_focus_set(data, EINA_TRUE);
}
@ -2382,8 +2384,12 @@ _entry_selection_changed_signal_cb(void *data,
if (!sd) return;
sd->have_selection = EINA_TRUE;
Efl_Text_Range range = {0};
//FIXME how to get selection range in legacy !?
range.start = 0;
range.end = 0;
efl_event_callback_legacy_call
(data, EFL_UI_EVENT_SELECTION_CHANGED, NULL);
(data, EFL_TEXT_INTERACTIVE_EVENT_SELECTION_CHANGED, &range);
// XXX: still try primary selection even if on wl in case it's
// supported
// if (!_entry_win_is_wl(data))
@ -2405,8 +2411,9 @@ _entry_selection_cleared_signal_cb(void *data,
if (!sd->have_selection) return;
sd->have_selection = EINA_FALSE;
Eina_Bool b_value = sd->have_selection;
efl_event_callback_legacy_call
(data, EFL_UI_EVENT_SELECTION_CLEARED, NULL);
(data, EFL_TEXT_INTERACTIVE_EVENT_HAVE_SELECTION_CHANGED, &b_value);
// XXX: still try primary selection even if on wl in case it's
// supported
// if (!_entry_win_is_wl(data))
@ -2447,7 +2454,7 @@ _entry_paste_request_signal_cb(void *data,
// supported
// if ((type == ELM_SEL_TYPE_PRIMARY) && _entry_win_is_wl(data)) return;
efl_event_callback_legacy_call
(data, EFL_UI_EVENT_SELECTION_PASTE, NULL);
(data, EFL_UI_TEXT_EVENT_SELECTION_PASTE, NULL);
top = _entry_win_get(data);
if (top)
@ -4442,8 +4449,11 @@ _elm_entry_select_none(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
edje_object_signal_emit(sd->entry_edje, "elm,state,select,off", "elm");
}
if (sd->have_selection)
efl_event_callback_legacy_call
(obj, EFL_UI_EVENT_SELECTION_CLEARED, NULL);
{
Eina_Bool b_value = sd->have_selection;
efl_event_callback_legacy_call
(obj, EFL_TEXT_INTERACTIVE_EVENT_HAVE_SELECTION_CHANGED, &b_value);
}
sd->have_selection = EINA_FALSE;
edje_object_part_text_select_none(sd->entry_edje, "elm.text");

View File

@ -9,7 +9,7 @@ _efl_canvas_animation_duration_set(Eo *eo_obj EINA_UNUSED,
Efl_Canvas_Animation_Data *pd,
double sec)
{
EINA_SAFETY_ON_FALSE_RETURN(sec > 0.0);
EINA_SAFETY_ON_FALSE_RETURN(sec >= 0.0);
pd->duration = sec;
}
@ -146,7 +146,7 @@ _efl_canvas_animation_efl_object_constructor(Eo *obj, Efl_Canvas_Animation_Data
EOLIAN static void
_efl_canvas_animation_default_duration_set(double animation_time)
{
EINA_SAFETY_ON_FALSE_RETURN(animation_time > 0.0);
EINA_SAFETY_ON_FALSE_RETURN(animation_time >= 0.0);
_default_animation_time = animation_time;
}

View File

@ -43,7 +43,15 @@ _animator_cb(void *data, const Efl_Event *ev EINA_UNUSED)
duration = efl_animation_duration_get(pd->in->animation) / pd->in->speed;
elapsed_time = current - pd->in->run_start_time;
vector = elapsed_time / duration;
if (EINA_DBL_EQ(duration, 0))
{
if (pd->in->speed < 0.0)
vector = -1.0;
else
vector = 1.0;
}
else
vector = elapsed_time / duration;
/* When animation player starts, _animator_cb() is called immediately so
* both elapsed time and progress are 0.0.

View File

@ -106,7 +106,7 @@ EAPI void evas_object_vg_viewbox_align_get(const Efl_VG *obj, double *align_x, d
* It takes the ownership of the root node.
*
* @param[in] obj The object.
* @param[in] root Root node of the VG canvas.
* @param[in] root Root node(Efl_Canvas_Vg_Container) of the VG canvas.
*
* @ingroup Evas_Object_Vg_Group
*/

View File

@ -2351,9 +2351,7 @@ evas_object_text_font_source_get(const Eo *obj)
EAPI void
evas_object_text_font_set(Eo *obj, const char *font, Evas_Font_Size size)
{
/*Condition for legacy object*/
EINA_SAFETY_ON_NULL_RETURN(font);
EINA_SAFETY_ON_TRUE_RETURN(size <= 0);
if (!font || size <= 0) return; /*Condition for legacy object*/
efl_text_font_family_set((Eo *) obj, font);
efl_text_font_size_set((Eo *) obj, size);

View File

@ -16,6 +16,11 @@ foreach mod_name : mods
mod_deps = []
if loader_disabler.contains(mod_name) == false
if mod_name == 'ibus'
if get_option('glib') == false
error('Need glib enabled if ibus is enabled')
endif
endif
mod_install_dir = join_paths(dir_package_modules, mod_name, version_name)
subdir(mod_name)
module_files += join_paths(mod_install_dir, 'lib'+mod_name+'.'+sys_mod_extension)

View File

@ -42,8 +42,50 @@ EFL_START_TEST(efl_canvas_animation_default_value)
}
EFL_END_TEST
static void
_duration_zero_anim_running_cb(void *data, const Efl_Event *event)
{
double animation_speed = *((double*) data);
double animation_running_position = *((double*) event->info);
if (animation_speed > 0.0)
ck_assert(EINA_DBL_EQ(animation_running_position, 1.0));
else
ck_assert(EINA_DBL_EQ(animation_running_position, 0.0));
}
static void
helper_inc_int(void *data, const Efl_Event *event EINA_UNUSED)
{
int *called = (int*) data;
*called+=1;
}
EFL_START_TEST(efl_canvas_animation_duration_zero)
{
int running = 0;
Evas *evas = EVAS_TEST_INIT_EVAS();
Efl_Canvas_Rectangle *obj = efl_add(EFL_CANVAS_RECTANGLE_CLASS, evas);
Efl_Canvas_Animation *animation = efl_add(EFL_CANVAS_ANIMATION_CLASS, evas, efl_animation_duration_set(efl_added, 0.0));
double animation_speed = 1.0;
efl_event_callback_add(obj, EFL_CANVAS_OBJECT_ANIMATION_EVENT_ANIMATION_PROGRESS_UPDATED, _duration_zero_anim_running_cb, &animation_speed);
efl_event_callback_add(obj, EFL_CANVAS_OBJECT_ANIMATION_EVENT_ANIMATION_PROGRESS_UPDATED, helper_inc_int , &running);
efl_canvas_object_animation_start(obj, animation, animation_speed, 0.0);
ck_assert(EINA_DBL_EQ(efl_canvas_object_animation_progress_get(obj), -1.0));
ck_assert_int_eq(running, 1);
running = 0;
animation_speed = -1.0;
efl_canvas_object_animation_start(obj, animation, animation_speed, 0.0);
ck_assert(EINA_DBL_EQ(efl_canvas_object_animation_progress_get(obj), -1.0));
ck_assert_int_eq(running, 1);
}
EFL_END_TEST
void efl_test_canvas_animation(TCase *tc)
{
tcase_add_test(tc, efl_canvas_animation_negative_double_checking);
tcase_add_test(tc, efl_canvas_animation_default_value);
tcase_add_test(tc, efl_canvas_animation_duration_zero);
}