Commit Graph

770 Commits

Author SHA1 Message Date
Subodh Kumar c321def5fc eina: same expression on both statement.
Summary:
Comparing with same expression is avoided.
@fix

Reviewers: cedric

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D5268

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2017-10-09 16:36:57 -07:00
Cedric BAIL cbbc077dae eio: migrate example to use Eina_Future. 2017-10-05 14:21:23 -07:00
Cedric BAIL ef40a607fa evas: remove evas_canvas3d_texture_file_set and efl_file_set instead. 2017-10-05 11:36:23 -07:00
Cedric BAIL 6e45ee2e4f ecore_con: simplify Efl.Net.Server.Ssl by inheriting from Efl.Net.Server.Tcp. 2017-09-29 16:01:02 -07:00
Cedric BAIL d2e75c40d0 ecore_con: add an intermediate Efl.Net.Server.Ip 2017-09-29 14:12:03 -07:00
Jean-Philippe Andre 76acfa1a6c examples: Fix C++ bg example
This is not nice yet... part API needs to be improved in C++.
2017-09-26 22:00:02 +09:00
Jean-Philippe Andre 7d39dcc23e elm: Remove range "span_size" API in EO
Reasons:
 - This API has been confused with the min size of the widget, resulting
   in badly laid out applications.
 - The EO API was not very nice (Range is about numbers, the Gfx size
   hint in a part is really ugly).

While I understand the value of this API and how it can be used in
scalable applications, it is in fact not absolutely necessary.
Alternatively to that span size, the widget min size can already be
defined from the application side, or the widget can simply be expanded
to fill in its parent.

This can obviously be reinstated later if the need arises for EO. For
now, keep this feature as legacy-only.
2017-09-21 12:27:34 +09:00
Jean-Philippe Andre 429cbf8cdb elm: Fix invalid uses of Efl.Orientation
I think this closes the orientation vs. direction problem.
RTL vs. AnyRTL is not fully handled yet but this becomes a
widget-per-widget issue (eg. should a box in a RTL locale be mirrored if
set to horizontal?).

Fixes T5870
2017-09-19 18:53:35 +09:00
Jean-Philippe Andre 7c541a7453 animation2: fix compile instruction
Summary:
without it, it was failing with following error
/usr/bin/ld: /tmp/ccnjRcVr.o: undefined reference to symbol 'evas_object_move'
//usr/lib64/libevas.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

Test Plan: just try to compile it with and without.

Reviewers: jpeg

Reviewed By: jpeg

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5182
2017-09-19 17:00:35 +09:00
Stefan Schmidt 6edeb1ce5e examples: cxx: fix examples for new size_set function signature
This no longer takes two parameters. Update to the new signature.
2017-09-19 08:32:43 +02:00
Jean-Philippe Andre a0bfb3098d evas: Use Eina.Slice on the stack (gfx.buffer) 2017-09-19 10:51:48 +09:00
Jean-Philippe Andre c6d8d60fb6 evas: Use Eina.Size2D for gfx.buffer
For consistency.
2017-09-19 10:51:48 +09:00
Bryce Harrington 8e1f446efc examples: document the evas-vg-simple example
Summary:
Fill in the intro section and the first test mode.  (Docs for second
mode will be forthcoming.)

Also drop some of the generic comments that are already explained better
in some of the basic examples.

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>

Reviewers: cedric

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D5201

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-09-18 11:18:43 -07:00
Jean-Philippe Andre 25cd37fdca efl: Use Eina.Size2D for size hint combined min
For this patch I decided to add a pseudo legacy wrapper as the function
is called in a very large number of places. Fixing all those calls to
use the size2d form is a lot of work and a greater risk of b0rking
something.
2017-09-18 16:33:33 +09:00
Jean-Philippe Andre b331ec013e efl: Use Eina.Size2D for Efl.Gfx.size
Big patch as a lot of things call or reimplement size_set. Hopefully I
got it right... fingers crossed.
2017-09-18 13:34:50 +09:00
Jean-Philippe Andre 065fbec948 efl: Use Eina.Position2D for Efl.Gfx.position
Note: This is a little bit more cumbersome in some places but in most
it's more convenient than (x,y).
2017-09-18 13:22:54 +09:00
Jean-Philippe Andre b0fc2825e5 efl: Introduce Eina.Rect and switch EO APIs to it
It's a complex struct but defined in EO as a simple struct. ABI-wise
it's equivalent to Eina_Rectangle. Some macros that use Eina_Rectangle
also work on Eina_Rect out of the box, most of the code dealing with
x,y,w,h will require no modifications either.

But Eina_Rect provides direct access to a size or position 2d component,
as well as the usual x,y,w,h. The field "rect" is provided as a
convenience for code dealing with both Eina_Rectangle and Eina_Rect. We
may or may not require it.

Note: Size2D could use unsigned values but I have spotted a few places
in the code that actually use -1 to indicate invalid size (as opposed to
0x0).

@feature
2017-09-18 13:22:52 +09:00
Felipe Magno de Almeida 3a742b9ad0 eolian-cxx: Fix example after disambiguation patch of C++ binding 2017-09-14 15:06:33 -03:00
Stefan Schmidt 06070eb220 examples/evas: fix recent build break from rectangle change
Introduced with commit 13da5e980eb43288b9b9f502cb6a7a000e1f26ea

A compile before pushing would have been great, again.
Having the same name for two variables is something no compiler likes.

evas-map-utils-eo.c:74:8: error: conflicting types for ‘r’
    int r, g, b, a, f;
        ^
evas-map-utils-eo.c:73:19: note: previous declaration of ‘r’ was here
    Eina_Rectangle r;
                   ^
evas-map-utils-eo.c:93:31: error: ‘h’ undeclared (first use in this function)
    efl_gfx_size_get(o, NULL, &h);
                               ^
evas-map-utils-eo.c:93:31: note: each undeclared identifier is reported only once for each function it appears in
evas-map-utils-eo.c:108:25: error: ‘w’ undeclared (first use in this function)
    efl_gfx_size_get(o, &w, &h);
2017-09-13 14:42:34 +02:00
Jean-Philippe Andre 7c352bed15 efl_gfx: Use Eina.Rectangle for geometry (EO)
This saves a few lines already (without even having the proper helpers
for stack rectangles).
2017-09-13 18:03:34 +09:00
Daniel Zaoui 6f259fc2b3 Examples: fix C++ examples
The examples have not been updated after the last C++ changes.
2017-09-11 21:13:15 +03:00
Felipe Magno de Almeida 4f2d0c7215 eo-cxx: Require instantiate keyword for constructors calling efl_add to avoid ambiguity 2017-09-08 11:47:29 +09:00
Guilherme Iscaro 9487eaeaeb Eina_Promise/Eina_Future: Add example and tests. 2017-09-04 10:24:00 -03:00
Jean-Philippe Andre ce534a75bd js: Fix some js examples usage of orient API
This was not tested. How to test js?
2017-08-23 15:24:37 +09:00
Bryce Harrington 6a5216930c examples: Improve error message text from Evas examples
Reviewers: cedric, devilhorns

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D5103
2017-08-18 09:47:45 -04:00
Bryce Harrington 5d9fa924a3 examples/evas: Fix sp. of 'Coult' in warning
Reviewers: cedric

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D5102
2017-08-18 09:46:48 -04:00
Guilherme Iscaro 2e8b23213f Elm Examples: Fix undefined function references.
They were renamed by 599bb616ec5

Signed-off-by: Jean-Philippe Andre <jp.andre@samsung.com>
2017-08-17 10:33:53 +09:00
Jean-Philippe Andre 43a2cc600b evas: Modify wheel events direction to bool (EO)
The orientation was overkill here. We only want a bool.

Ref T5870
2017-08-10 14:42:08 +09:00
Bryce Harrington 751829a17f examples: Correct the comments for key handling
Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5076
2017-08-09 12:21:42 +09:00
Bryce Harrington 686be2a56f examples: Fix sp. exemple_data
Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5075
2017-08-09 12:21:42 +09:00
Bryce Harrington b748fcda1a examples: Fix grammar - 'forcely' is not a word
Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5077
2017-08-08 15:28:20 +09:00
Jean-Philippe Andre e30760342d elm: Rename elm_layout to Efl.Ui.Layout
Some names have not been changed, hopefully making a distinction
between legacy APIs and internal code (elm_layout_blah) and valid EO
usages.

This means many internal functions are still elm_layout_ as their
sole purpose is to support the legacy API.

Ref T5315
2017-08-08 13:25:58 +09:00
Stefan Schmidt 28a80845f6 examples: fix build break after efl_ui_panes change
In commit 40945d985967e58d6e6c00ecfd6292a8d67b83b5 it was renamed but
the examples not updated.
2017-08-07 12:39:10 +02:00
Jean-Philippe Andre 1c6fd800e8 edje: Move signal APIs to an interface
This interface will be used by elm_layout as well.

Ref T5315
2017-08-04 11:52:16 +09:00
Guilherme Iscaro d25ce7f021 Ecore_Conn: Enable CLOEXEC by default.
This flag should be enabled by default in order to avoid socket leaks.
2017-07-27 16:54:34 +02:00
Stefan Schmidt 266b40d398 examples: elm_icon: remove no-op deprecated function call for icon lookup
The function is deprecated and actually a no-op already. Better make
sure we do not promote deprecated functions in our won examples.
2017-07-14 14:06:34 +02:00
Bryce Harrington cd15ad79ff examples: Move introduction to Ecore-Evas to evas-transparent.c
Summary:
The evas-transparent.c example is quite short, and so will allow for
more detailed explanation of setting up Ecore-Evas.  Then
evas-object-manipulation.c can focus more on the explanation of objects
in Ecore-Evas.

Reviewers: cedric

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D5011
2017-07-11 11:29:07 +09:00
Bryce Harrington 7c0b47b1d0 examples: Flesh out the evas-object-manipulation example
Summary:
This is one of the basic examples that introduces Ecore-Evas, so needs
to be more detailed in commentary than other examples.  It also points
out the use of the legacy API and directs the reader to the Eo example
where appropriate.

Reviewers: cedric

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D5008
2017-07-10 17:02:20 +09:00
smohanty aad1937ef5 evas/vg: rewrite the vg example with more test cases
basic shape, stroke, transformation, interpolation test cases added

Reviewers: jpeg

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D4992
2017-06-29 17:39:11 +09:00
Vincent Torri e5739173a0 examples/net: Fix compilation on Windows 2017-06-20 14:34:52 +09:00
Vincent Torri f9fc623244 examples/net: Fix compilation on Windows (no getline)
Thnaks @vtorri who authored this patch
2017-06-20 14:18:36 +09:00
Jean-Philippe Andre ea4aa58464 examples/net: Use PRIi64 where appropriate
Fixes a warning on Windows. Thanks @vtorri
2017-06-20 14:16:40 +09:00
Jean-Philippe Andre e06f4bdab9 cxx examples: Fix button example 00
Text part API has changed.
2017-06-20 14:09:57 +09:00
Cedric BAIL a130800334 evas: batman use legacy API only. 2017-06-19 14:08:54 -07:00
smohanty b435a0792c evas/vg: Fixed the build issue in evas_vg_simple example
Reviewers: jpeg, vtorri

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4980

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-06-19 14:08:54 -07:00
Lauro Moura 7f96a0237e js: Update after many elm/efl.ui changes
- Win.Standard
- Photocam to Image.Zoomable rename
- Widget namespace changes (elm -> efl.ui)
- setText/setPartText changes (see 3eb649b18)
2017-06-19 17:36:41 -03:00
Jeeyong Um 37cd6824ed example: Add missing definition to invoke EO API 2017-06-19 13:19:30 +09:00
Andrii Kroitor 0d2d0f67e8 examples: fix ecore_exe_child example to work properly on Windows
Summary: ecore_main_fd_handler_add is not working on Windows

Reviewers: vtorri, raster

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4470
2017-06-15 12:18:42 +09:00
Jean-Philippe Andre 34063c362c evas: Rename device Class to Type, remove Sub_Class
1. The word "class" is a pain point with many languages where
   it's a keyword. Type is a little better. Also, the property
   was already named "device_type" and not "device_class".

2. Remove Efl.Input.Device.Sub_Class
   It's not used inside EFL upstream codebase, and unlikely to
   be used anywhere else (even in Tizen).

Hopefully no one used the Efl_ enum types. So far only the Evas_
types should be in used.

Ref T5540
2017-06-12 15:21:55 +09:00
Jean-Philippe Andre 165f8ac32e evas: Remove device "parent", "name" and "description" properties
Those are now merged with Efl.Object parent, name and comment.
The reasoning is that only seats can be parent devices; And name
and description are not only name clashes but also not extremely
useful anyway.

Tested with VNC.

Fixes T5540
2017-06-12 15:17:50 +09:00
Bryce Harrington aa9f161802 examples: Flesh out the evas-buffer-simple example
Summary:
This serves as an early example for new Evas programmers to introduce
the buffer engine as well as very basic canvas usage, so we're going
into a lot more detail for both of those than we'll do in subsequent
examples.

Reviewers: cedric

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D4950
2017-06-09 12:09:54 +09:00
Bryce Harrington 8110e09a8b evas/examples: add intro for evas-event-filter.c example
Reviewers: cedric

Reviewed By: cedric

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D4907

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-06-05 12:07:57 -07:00
Bryce Harrington 223b3f6437 evas/examples: fix minor typo 'whe'
Reviewers: cedric

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D4906

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-06-05 12:07:57 -07:00
Bryce Harrington 669170b8d0 examples/evas: add tutorial commentary for evas-init-shutdown
Summary:
This is the most basic of the Evas examples and serves as the starting
point for new Evas users.  Since this targets neophytes, we can afford
to be much more detailed in commentary.

Reviewers: cedric

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D4904

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-06-05 12:07:57 -07:00
Bryce Harrington 60e02d4d4f examples/evas: add a README
Summary:
Categorize the examples by topic, and identify certain examples as
introductory; these can be commented more verbosely than the other
examples.

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>

Reviewers: cedric

Reviewed By: cedric

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D4903

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-06-05 12:07:56 -07:00
Al Poole 285f10407f examples: fix efl_net_control_example.c on BSD.
Reviewers: cedric, stefan_schmidt

Subscribers: stefan_schmidt, jpeg

Differential Revision: https://phab.enlightenment.org/D4868

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-06-05 12:04:43 -07:00
Stefan Schmidt e55719cef1 examples: edje: make sure we use the edje_object_language_set legacy API
The EO based edje_obj_language_set API is now longer available since a
rework of this API. Also make sure a used parameter is not marked as
unused.
2017-06-02 09:21:49 +02:00
Jean-Philippe Andre ebf459fa2a examples: Test API efl_input_device_children_iterate
While the API seems to work fine, I am not 100% sure the device
names are properly assigned.

Run ecore_evas_cursor_example or ecore_evas_vnc_example and
then connect to the VNC server locally or remotely.
2017-05-24 16:06:18 +09:00
Amitesh Singh 7e7719a346 rename elm_button to Efl.Ui.Button
ref T5323

Signed-off-by: Amitesh Singh <amitesh.sh@samsung.com>
2017-05-22 17:28:47 +09:00
Jean-Philippe Andre 77c20000d8 c++: Fix examples as Win.Standard was removed 2017-05-17 15:43:58 +09:00
Stefan Schmidt 425a0b2e39 examples: evas: fix else block by adding needed parenthesis
This was broken since over a year. Happened during the automatic eo4
migration in f21ade6123b9053fca8d1632644c48525a99d6e0.

Thanks goes to the gcc warning misleading-indentation:

evas-3d-shadows.c:163:4: warning: this ‘else’ clause does not guard... [-Wmisleading-indentation]
    else
    ^~~~
evas-3d-shadows.c:165:6: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘else’
      evas_canvas3d_node_look_at_set(scene->mediator, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 3.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 5.0, 0.0);
2017-05-16 21:58:35 +02:00
Bryce Harrington 770a31371a examples/evas: Fix weird use of word synchrony in comment
Summary: 'keep in sync' is more familiar programmer jargon.

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4876
2017-05-12 14:42:29 +09:00
Jean-Philippe Andre ad3a612250 evas map: Rename raw_coord to coord_absolute
This is more in line with the other "absolute" APIs.
2017-05-12 12:02:24 +09:00
Jean-Philippe Andre 0e9201f523 evas map: Introduce new API for maps (Efl.Gfx.Map)
This implements an entirely new API model for Evas Map by relying
on high-level transformations on the object rather than an external
Evas_Map structure that needs to be constantly updated manually.

The implementation relies on Evas_Map.

To rotate an object all you need to do now is
  efl_gfx_map_rotate(obj, 45.0, NULL, 0.5, 0.5);

Or with a C++ syntax:
  obj.rotate(45.0, NULL, 0.5, 0.5);

Or even simply (with default arguments):
  obj.rotate(45.0);

The map transformation functions are:
 - rotate
 - rotate_3d
 - rotate_quat
 - zoom
 - translate (new!)
 - perspective_3d
 - lightning_3d

@feature
2017-05-11 17:54:00 +09:00
Jean-Philippe Andre 1529016f9c evas examples: Fix invalid assumption about proxy
In the map examples, the map image UV size was based on the image
source geometry, rather than the image geometry itself.

In the example, this affects how the glass is mirrored. Before this
patch, the reflection is a single line stretched. EFL 1.18 and 1.19
seem to have the same issue, while 1.17 simply fails to show any
reflection. 1.16 fails miserably and the entire window is black.

If the original code was correct, then I believe that map and/or
proxy rendering have been modified in a way that affects the meaning
of those image UV parameters. But this seems like the regression (if
it is one) is in fact quite old.

@fix
2017-05-11 17:53:51 +09:00
Bryce Harrington fbd7313f67 examples/evas: Improve linespacing consistency
Summary:
Also fixes a handful of obvious indentation irregularities,
including some reformatting of some printf() multi-line indents that
commit a71b770b did not properly adjust.

No functional code changes.

Reviewers: cedric

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D4864
2017-05-10 11:03:38 +02:00
Bryce Harrington e253649f1c examples/evas: streamline the intro description statement for examples
Summary:
For people browing through the examples, having the opening statement be
concise and consistent will help them more quickly find what they're
looking for.

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>

Test Plan:
Some of the examples had identical opening statements (e.g. the image
object examples).  I've tried to give each a unique description defining
what they are demonstrating, but you may want to doublecheck I got these
correct.  Of particular note, to me evas-images5.c looks like just a
fixup to evas-images4.c, so I'm not sure what makes these two distinct.

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4861

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-05-08 15:26:07 -07:00
Bryce Harrington 71f4be1901 examples: use printf instead of fprintf(stdout, ...)
Summary:
Applies same change as e8355c93 for evas, to the remaining examples.
This uses the shell command-line:

    src/examples/evas$ grep -sr 'fprintf(stdout' . | cut -d: -f1 \
        | uniq | xargs sed -i "s/fprintf(stdout/printf(/"

Note that use of the "fprintf(stdout" construct can generate warnings
when -Wformat-security is enabled, if the fprintf statement has no
format arguments, so in addition to the stylistic simplification this
also helps quell those spurious warnings.

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4836

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-05-08 15:14:29 -07:00
Bryce Harrington 5f4ea5ddce examples/evas: Fix missing space before -lm in compilation directions
Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4835
2017-05-03 12:03:40 +02:00
Bryce Harrington 24498073b7 examples/evas: fix spelling
Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4807

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-04-25 16:28:44 -07:00
Jeeyong Um f8760a6813 edje_cc: introduce "Anchors" - easy way to set parts relationship
Test Plan: compile src/examples/edc-anchors.c and run

Reviewers: zmike, raster, cedric, jpeg

Reviewed By: raster, jpeg

Subscribers: raster, barbieri, zmike, SanghyeonLee, taxi2se, Jaehyun_Cho

Differential Revision: https://phab.enlightenment.org/D4775

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-04-25 16:25:15 -07:00
Jean-Philippe Andre 7e7ff5059e examples: Fix most trivial warnings
This fixes all warnings for "make examples" for:
 -Wunused-parameter
 -Wshadow
 -Wformat-security
 -Wenum-conversion

Some remaining warnings include:
 -Wdeprecated-delcarations
2017-04-20 17:44:57 +09:00
Bryce Harrington b847d3124b examples/evas: Use printf instead of fprintf(stdout, ...)
Summary:
Applies the correction purely mechanically using the following shell
command-line:

    src/examples/evas$ grep -sr 'fprintf(stdout' . | cut -d: -f1 | uniq | \
        xargs sed -i "s/fprintf(stdout/printf(/"

This fixes a few warnings about lack of a format string:

    warning: format not a string literal and no format arguments [-Wformat-security]
        fprintf(stdout, commands);

Reviewers: cedric

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D4691
2017-04-20 17:31:58 +09:00
Cedric BAIL c4dae329e8 ecore: use new API eina_file_close_on_exec in example too. 2017-04-18 16:57:36 -07:00
Shinwoo Kim 0b833586d6 ecore_input: add API to get name of joystick.
Summary:
The Ecore_Event_Joystick would be not enough information on user side.
Because the button index such as ECORE_EVENT_JOYSTICK_BUTTON_SELECT/START/META,
etc could be mapped to different button for different named joystick.

Test Plan: Using example

Reviewers: raster, cedric, jpeg

Reviewed By: raster

Differential Revision: https://phab.enlightenment.org/D4669
2017-04-13 14:53:48 +09:00
Cedric BAIL 74dce2ca6c ecore_evas: fix use of new VNC API in example. 2017-04-12 15:13:19 -07:00
Gustavo Sverzut Barbieri 5136fa380f implement efl_net_{socket,dialer,server}_windows
This is the local socket for windows, analogous to AF_UNIX.

`Efl_Net_Socket_Windows` is the base class doing `ReadFile()` and
`WriteFile()` using overlapped I/O, as well as the close procedure
(`FlushFileBuffers()`, `DisconnectNamedPipe()` and
`CloseHandle()`). These are done on top of an existing HANDLE that is
set by `Efl_Net_Dialer_Windows` (from `CreateFile()`) or
`Efl_Net_Server_Windows` (from `CreateNamedPipe()`).

The overlapped I/O will return immediately, either with operation
completed or `ERROR_IO_PENDING`, which means the kernel will execute
that asynchronously and will later `SetEvent(overlapped.hEvent)` which
is an event we wait on our main loop. That `overlapped` handle must
exist during the call lifetime, thus cannot be bound to `pd`, as we
may call `CancelIo()` but there is no guarantee the memory won't be
touched, in that case we keep the overlapped around, but without an
associated object.

Windows provides no notification "can read without blocking" or
non-blocking calls that returns partial data. The way to go is to use
these overlapped I/O, with an initial `ReadFile()` to an internal
buffer, once that operation finishes, we callback the user to says
there is something to read (`efl_io_reader_can_read_set()`) and wait
until `efl_io_reader_read()` is called to consume the available data,
then `ReadFile()` is called again to read more data to the same
internal buffer.

Likewise, there is no "can write without blocking" or non-blocking
calls that sends only partial data. The way to go is to get user bytes
in `efl_io_writer_write()` and copy them in an internal buffer, then
call `WriteFile()` on that and inform the user nothing else can be
written until that operation completes
(`efl_io_writer_can_write_set()`).

This is cumbersome since we say we "sent" stuff when we actually
didn't, it's still in our internal buffer (`pd->send.bytes`), but
nonetheless the kernel and the other peer may be adding even more
buffers, in this case we need to do a best effort to get it
delivery. A particular case is troublesome: `write() -> close()`, this
may result in `WriteFile()` pending, in this case we wait using
`GetOverlappedResult()`, *this is nasty and may block*, but it's the
only way I see to cope with such common use case.

Other operations, like ongoing `ReadFile()` or `ConnectNamedPipe()`
will be canceled using `CancelIo()`.

Q: Why no I/O Completion Port (IOCP) was used? Why no
   CreateThreadpoolIo()? These perform much better!

A: These will call back from secondary threads, but in EFL we must
   report back to the user in order to process incoming data or get
   more data to send. That is, we serialize everything to the main
   thread, making it impossible to use the benefits of IOCP and
   similar such as CreateThreadpoolIo(). Since we'd need to wakeup the
   main thread anyways, using `OVERLAPPED.hEvent` with
   `ecore_main_win32_handler_add()` does the job as we expect.

Thanks to Vincent Torri (vtorri) for his help getting this code done
with an example on how to do the NamedPipe handling on Windows.
2017-03-29 12:44:19 -03:00
Gustavo Sverzut Barbieri 62e2e21b26 ecore_con_*_example: compile on win32.
- win32 doesn't provide getline().
 - _write() exists, use _write_() instead
2017-03-29 12:44:19 -03:00
Gustavo Sverzut Barbieri c7d8151463 ecore_ipc_client_example: win32 doesn't provide getline(). 2017-03-29 12:44:19 -03:00
Gustavo Sverzut Barbieri 874c1062b0 efl_net_dialer_unix_example: read in loop while "can_read".
While in UNIX we use 'select()/poll()' to query for read fds and this
will eventually callback with "can_read" event, use the loop to match
other implementations where can_read keeps true if not all data was
read.
2017-03-29 12:44:19 -03:00
Carsten Haitzler 9fb1d8418b fix ecore con client exmaple to match cmdline help output for options 2017-03-29 16:49:03 +09:00
Carsten Haitzler 2be8857184 fix ecore con server exmaple to match cmdline help output for options 2017-03-29 16:28:21 +09:00
Jean Guyomarc'h 6349db601b eldbus: don't abs() an unsigned value
clang complained about abs() being used on an unsigned integer.
Calling abs() is actually unnecessary.
2017-03-09 23:16:16 +01:00
Jean Guyomarc'h 58cb4fb34c eio: fix printf format error 2017-03-09 23:16:16 +01:00
Lauro Moura a9823de428 js: Update examples, including window api changes.
Window now inherits from Container instead of Pack.

Also removed some deprecated stuff.
2017-02-22 18:56:30 -03:00
Bryce Harrington a3c79cea43 examples: Use printf instead of fprintf(stdout, ...)
Summary:
Also fix warning about lack of a format string:

    warning: format not a string literal and no format arguments [-Wformat-security]
         fprintf(stdout, commands);

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>

Reviewers: cedric, jpeg

Reviewed By: jpeg

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4673
2017-02-21 10:46:28 +09:00
Shinwoo Kim 3a35dab1ca ecore_input: add API to set/get deadzone of joystick event for an axis.
Summary:
The axis type joystick event could occur without user's control if joystick is too sensitive.
The deadzone prevents this unnecessary event. The default value is 200.
The event value for an axis is a signed integer between -32767 and +32767.

Test Plan: Using example

Reviewers: raster, cedric, jpeg

Reviewed By: jpeg

Subscribers: stefan_schmidt

Differential Revision: https://phab.enlightenment.org/D4654
2017-02-15 13:03:02 +09:00
Larry Jr 376c865ad7 efl: add efl_model and efl_ui_view classes
Efl.Model.Container and Efl.Model.Item to efl/interfaces are used
to create Efl.Model objects with predefined property values.
This is useful to any situation where we want an Efl.Model with
explicit defined property values.

Efl.Ui.View and Efl.Ui.Factory are used to connect Efl.Models with
Widgets, Elm.Layout and Efl.Ui.Image has changed to use news interfaces

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-02-06 15:26:21 -08:00
Jerome Pinot b199ca0453 edje_example: fix compile instruction 2017-02-05 21:56:18 +09:00
Bruno Dilly 56e71a0b38 edje: change seat signals
Use seat names as prefix, not as suffix, following
a top-down approach and avoiding issues
with applications that may be receiving
doubled signals (legacy + suffixed).

So instead of "mouse,in,seat1" signal will be
"seat,seat1,mouse,in".
2017-02-01 17:19:32 -02:00
Felipe Magno de Almeida 75eeed28e8 cxx: Modify how to generate C++ headers and allow cyclic dependencies
Allow cyclic dependencies in generated C++ headers by changing order
of includes and creating forward declarations.
2017-01-18 22:47:04 -02:00
Cedric BAIL 5017edad17 ecore_con: use the right type for prototype. 2017-01-06 15:58:46 -08:00
Cedric BAIL 11699a0894 cxx: fix example with recent change. 2017-01-06 15:58:46 -08:00
Bruno Dilly f6e91c3e30 examples/edje: add seat filtering example
4 widgets:
 * seat1 only
 * seat2 only
 * seat1 + seat2
 * any seat
2016-12-21 23:03:33 -02:00
Guilherme Iscaro 421ac7a949 Ecore Evas: Add a new cursor example.
This example sets the cursor image of each available mouse and
report its position every one second.
2016-12-20 18:34:39 -02:00
Gustavo Sverzut Barbieri d66def5bff efl_io_buffer: adopt read-only and read-write buffers.
todo--, allow buffer backing store to be provided by Eina_Slice
(rdonly) or Eina_Rw_Slice (rdwr).
2016-12-19 16:50:58 -02:00
Gustavo Sverzut Barbieri 1d86cbfab4 more eo simplified to use Eina_Slice instead of pointer to.
Working directly with Eina_Slice is easier than a pointer to it,
requires no validation of the pointers and is cheap since it's just
putting together size_t + void*.

However we can't hint the user of 'const(Eina.Slice)' properties as
Eolian is incorrectly generating getters as:

   const Eina_Slice class_property_get(...)

which is makes compilers complain about ignored qualifiers:

   ../src/lib/ecore/efl_io_copier.eo.h:329:7: warning: 'const' type qualifier on return type has no effect [-Wignored-qualifiers]

Leave some TODO so @q66 can fix those.
2016-12-19 15:30:56 -02:00
Gustavo Sverzut Barbieri 8c2013d090 Efl.Io.{Queue,Buffer,Buffered_Stream}: slice_get is now a property.
Previously we couldn't return a slice, instead required the user to
pass a slice and we'd fill it since Eolian couldn't generate fallbacks
for structures.

Since @q66 fixed eolian, we can now return the structure itself as
initially wanted, ditching some TODO from the code.
2016-12-19 15:30:56 -02:00
Bruno Dilly 6979be8215 edje/examples: add example of use_custom_seat_names flag
Since seat names defined on evas will depend on evas backends,
maybe udev rules, etc, we aren't able to demonstrate it
without manually setting another name for such seats
with efl_input_devices_name_set(). Otherwise
we wouldn't have guarantees it would match
names on EDC.
2016-12-19 14:58:35 -02:00
Bruno Dilly d11a8d3682 edje/examples: add example for focus actions
Just a regular (non multiseat) focus example for
actions FOCUS_SET and FOCUS_OBJECT
2016-12-19 14:58:35 -02:00
Bruno Dilly 1a60462fad examples/edje: add dynamic seats example
It's an example of how themes can be implemented even if the number
of seats using the UI is unknown, and how it can be done
using scripts or C code.
2016-12-19 14:58:35 -02:00
Bruno Dilly 1c5ef34f5e edje: support action seats on edje_edit 2016-12-19 14:58:35 -02:00
Bruno Dilly 138dcdeb6f edje: accept optional seat parameter on FOCUS_OBJECT
If not provided, FOCUS_OBJECT action will keep acting
over default seat.

Also include a usage on edje-multiseat test
(actually no example was exercising this action).
2016-12-19 14:58:35 -02:00
Bruno Dilly 9e6d5cf4fa examples/edje: add multiseat example 2016-12-19 14:58:35 -02:00
Guilherme Iscaro 8e5c3cf839 Evas: Add event filter example.
This example exercises the new seat event filter API.
2016-12-12 14:59:22 -02:00
Gustavo Sverzut Barbieri f5d08a4f8f efl_net: add Efl.Net.Ip_Address
This is a string parser, serializer and asynchronous resolver.

It's purpose is to convert to and from the strings we use in our
dialers and servers, such as "127.0.0.1:1234" or "[::1]:1234",
properties allow to check the family, port, address bytes (slice) and
even get a struct sockaddr pointer to use with bind()/connect() in
outside code.

It will also offer some utilities present in netinet/in.h in an easy
to use way, after all IN6_IS_ADDR_LOOPBACK() works one way, while
there is no IN_LOOPBACK and comparing with INADDR_LOOPBACK will lead
to errors since it's in network order.

Last but not least, it will do asynchronous resolve of host and port
names using an internal thread and getaddrinfo(). The results are
delivered using a Future with an array of objects.
2016-12-12 02:30:33 -02:00
Gustavo Sverzut Barbieri 128fe49e8e yoda-style inactivity timeout.
s/inactivity_timeout/timeout_inactivity/g so it matches the EFL names
with scope first, like timeout_connect, etc.
2016-12-12 02:30:33 -02:00
Gustavo Sverzut Barbieri 815d40c4bc efl_net: spell check s/revogation/revocation/g
Sorry, in pt_BR it's revoGar... so I did misspell :-)
2016-12-12 02:30:33 -02:00
Gustavo Sverzut Barbieri e8d70e91d9 ecore_con_server_example: add --socket-activated 2016-12-10 08:44:06 -02:00
Gustavo Sverzut Barbieri 4894549670 ecore_con_server_example: add tcp+ssl, upgrades a live client.
add a new -t/--type=tcp+ssl, there you can send "Upgrade: SSL\n" to
request the server to start the handshake.

This can be paired with the ecore_con_client_example, there you can
type:

   Upgrade: SSL\n
   STARTTLS\n

The second is a dialer local command to upgrade it to SSL, matching
what the server expects.
2016-12-10 08:44:06 -02:00
Gustavo Sverzut Barbieri e2d8c0bf28 ecore_con_client_example: allow tcp->ssl upgrades.
The example now offers --type=tcp+ssl, in this case it won't send a
"hello!" message to avoid messing with the handshake. Once the client
(dialer) receives the user command STARTTLS
(--starttls-local-command), then it will upgrade the connection.

Usually in real life you need to send some command to server, such as
upgrade, STARTTLS and then upgrade... unless you connect to a SSL-only
server (ie: ecore_con_server_example --type=ssl).
2016-12-10 08:44:06 -02:00
Gustavo Sverzut Barbieri 0ec3aa034e ecore_con_server_example: show client errors. 2016-12-08 16:00:01 -02:00
Gustavo Sverzut Barbieri c5f1b3f476 ecore_con_client_example: allow no-ssl verify and print errors.
allow to not verify server certificate or hostname, so we can test
with local, self-signed certificates.

Also print errors, so we can say that the server handshake failed.
2016-12-08 16:00:01 -02:00
Gustavo Sverzut Barbieri 36273ec57f ecore_con_server_example: allow more features and protocols to be used.
Instead of a single SSL connection, allow for local, tcp and udp,
optional flush and delete-after-write (--single-message) and echo
mode.

Very similar to ecore_ipc_server_example.c
2016-12-08 11:40:45 -02:00
Gustavo Sverzut Barbieri 2f0b1d7955 ecore_con_client_example: allow more features and protocols to be used.
Instead of a single SSL connection, allow for local, tcp and udp,
optional flush and delete-after-write (--single-message).

Very similar to ecore_ipc_client_example.c
2016-12-08 11:40:45 -02:00
Bruno Dilly ff8fb25f32 examples/evas: use new API for key modifiers per seat 2016-12-06 17:09:03 -02:00
Bruno Dilly 207e2fdb42 evas: add example for multiseat events
Also useful to make some tests / debugging.
2016-11-30 16:49:25 -02:00
Gustavo Sverzut Barbieri c13af29797 ecore_con_url_headers_example: allow POST data. 2016-11-29 16:03:13 -02:00
Vitalii Vorobiov 78137cc16a example: update edje-edit-part-box to use not deprecated functions
since box/table item API is deprecated and replaced with new API, it is important
to use them in example as well

Fixes T4931
2016-11-28 17:00:24 +02:00
Felipe Magno de Almeida 600b5e6edd elementary-cxx: Fix filemvc wrong usage of Efl_Future 2016-11-28 12:32:18 -02:00
Gustavo Sverzut Barbieri ac385e4998 efl_net_{socket,dialer,server}_simple: easy to use, buffered network sockets.
The low level I/O primitives are powerful but adds some complexity to
use, for bi-directional streaming communication one ends creating two
Efl.Io.Queue and two Efl.Io.Copier to pipe data to socket when it can
operate.

Then encapsulate the socket using the new Efl.Io.Buffered_Stream, this
will allow the socket, be a dialer or a server client, to be operated
as a single handle that internally carries about the buffering for
you.

As one can see in the examples, compared to their "manual"
alternatives they are very easy to use, ressembling
Ecore_Con_Server/Ecore_Con_Client, but also offers line-based
delimiters and the possibility to let the socket to handle queueing
for you in case you received partial messages (just do not
read/clear/discard the received data).
2016-11-25 17:27:32 -02:00
Gustavo Sverzut Barbieri c9e4ad0a44 efl_io_buffered_stream: wraps an I/O object and make it easy to use.
Since all other efl.io objects are low-level, the recommended approach
is to use an efl.io.copier. However when dealing with in-memory,
bi-directional comms like talking to a socket, we always end with 2
queues, 2 copiers and the annoying setup that is being replicated in
ecore_ipc, efl_debug and so on.

This class is the base to make it simpler. Other classes such as
Efl.Net.Socket.Simple, Efl.Net.Dialer.Simple and Efl.Net.Server.Simple
will use it to provide simpler code to users.

I guess we can call EFL+EO Java now?
2016-11-25 17:27:32 -02:00
Gustavo Sverzut Barbieri 16ad93554a ecore_ipc_server_example: test "write & del" using -m/--single-message
An use case is to send some message and delete the handle, all data
should be sent to client.
2016-11-23 12:57:10 -02:00
Gustavo Sverzut Barbieri 48694ac1cd ecore_ipc_client_example: test "write & del" using -m/--single-message
An use case is to send some message and delete the handle, all data
should be sent to server.
2016-11-23 12:57:10 -02:00
Gustavo Sverzut Barbieri 6aef6645e1 ecore_ipc_server_example: delete clients when they disconnect.
if a client disconnect we must delete them explicitly.
2016-11-22 21:58:14 -02:00
Gustavo Sverzut Barbieri 79edf18a9f ecore_ipc_client_example: better lifecycle management.
If the server is gone, immediately delete it, this exercises deleting
the server from inside its event.

Then, if the server was already deleted, do not do it again.

Also remove the shadow variable, keep only the global scope.
2016-11-22 21:56:41 -02:00
Gustavo Sverzut Barbieri 079e173291 add ecore_ipc_{client,server}_example.
Ecore_Ipc lacked examples so we can explore its API (and check if it
work :-P)
2016-11-22 19:50:11 -02:00
Cedric Bail 87fe6ed0b5 elementary_cxx: fix examples to use the new API. 2016-11-21 16:03:27 -08:00
Gustavo Sverzut Barbieri 696e59caec ecore_file_download_example: allow cancel.
If we ^C to cancel the main loop, then abort the download, this allows
using one more API in the example and provides more correct code.
2016-11-21 19:47:35 -02:00
Gustavo Sverzut Barbieri 8e14389e0b ecore_file_download_example: check the correct file size.
when downloading DST_MIME, check its size, not DST's.
2016-11-21 19:47:35 -02:00
Gustavo Sverzut Barbieri 42337f7f5b ecore_file_download_example: also unlink DST_MIME.
ecore_file_download() will refuse to download if file already exists,
then we must unlink DST_MIME as done with DST before we try to
download, otherwise it won't work on the second time.
2016-11-21 19:47:35 -02:00
Bruno Dilly 3a095c830a efl: add getter for input device's seat
Since this code will be required in many use cases
of the multiseat feature, including examples.

Reviewers: iscaro, barbieri, cedric

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D4385
2016-11-09 11:02:38 -02:00
Gustavo Sverzut Barbieri 0e0cac8577 efl_net_session and efl_net_control for ConnMan
These are objects to allow control of networking devices
(efl_net_control) as well as an application to request for
connectivity (efl_net_session).

They are loosely based on ConnMan.org, which we already use in
Enlightenment Window Manager via DBus access with Eldbus. However they
do not map 1:1 as the goal was to expose a viable subset of controls
but in a simple and general way, thus nome strings were converted to
enums, some arrays of strings were converted to bitwise flags, some
names were made more general, such as "service" was turned into
"access point" so it doesn't generate confusion with other "network
services" (ie: http server), or "favorite" that was renamed to
"remembered". Some behavior are slightly different (yet able to be
implemented on top), such as "Service.MoveBefore" and "MoveAfter" were
converted to a numeric "priority", calculated from service's list
index, changing the priority will reoder the list and thus generate
the MoveBefore and MoveAfter DBus commands.

ConnMan was chosen not only because we already use it, but because its
DBus API is sane and simple, with the server doing almost all that we
need. This is visible in the efl_net_session, which is completely done
in the server and do not require any extra work on our side -- aside
from talking DBus and converting to Eo, which is a major work :-D

   NOTE: ConnMan doesn't use FreeDesktop.Org DBus interfaces such as
         Properties and ObjectManager, thus we cannot use
         eldbus_model_object.

There are two examples added:

 - efl_net_session_example: monitors the connection available for an
   application and try to connect. You need a connman compiled with
   session_policy_local and a configuration file explained in
   https://github.com/aldebaran/connman/blob/master/doc/session-policy-format.txt
   to get a connection if nothing is connected. Otherwise it will just
   monitor the connectivity state.

 - efl_net_control_example: monitors, plays the agent and configure
   the network details. It can enable/disable technologies, connect to
   access points (services) and configure them. It's quite extensive
   as allows testing all of ConnMan's DBus API except P2P (Peers).
2016-11-08 22:40:34 -02:00
Guilherme Iscaro f1b1d1354a Ecore Evas VNC: add client disconnected callback.
Summary:
Ecore Evas VNC: Properly unregister the region push hook callback.

This callback must be unregistered when the VNC server is deleted.

Reviewers: bdilly, barbieri, cedric

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4384

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2016-11-07 14:44:40 -08:00
Cedric BAIL 413e6f592b elementary: update example to use Efl_Future. 2016-11-07 11:10:49 -08:00
Guilherme Iscaro df889fec9e VNC Example: Add support to Ecore_Evas FB engine. 2016-11-04 18:29:42 -02:00
Bruno Dilly 843579e166 examples/edje: add example of entry - editable text
Not trivial to be done imo, so it deserves an example.
2016-11-04 18:01:57 -02:00
Bruno Dilly ea8ecbd04e examples/edje: Fix build instructions and titles
Fix a few c&p errors
2016-11-04 18:01:57 -02:00
Gustavo Sverzut Barbieri 2485941816 examples/eldbus/dbusmodel.c improve situation, far from correct.
it was using old API, updated, but still doesn't work as expected,
lots of warnings from children being left alive, all proxies are
reporting no properties...

when model dies, all children proxies should die as well, otherwise we
get on console:

```
CRI:eldbus lib/eldbus/eldbus_core.c:215 eldbus_shutdown() Alive TYPE_SYSTEM connection
ERR:eldbus lib/eldbus/eldbus_core.c:175 print_live_connection() conn=0x8219230 alive object=0x8276d50 net.connman of bus=net.connman
...
```

Also, all proxies are reporting no properties "(no properties yet)",
likely they are missing to fetch such... even if "--wait" to let it
run, no asynchronous properties are delivered, at least not triggering
EFL_MODEL_EVENT_PROPERTIES_CHANGED.
2016-11-04 13:19:57 -02:00
Bruno Dilly d0aa248cd3 examples/edje: cosmetic fixes in a couple examples
Fix usage messages, remove unused defines
2016-11-03 18:47:32 -02:00
Gustavo Sverzut Barbieri c5eeb87b50 efl_net_server support systemd socket activation.
It includes extensive verifications to avoid mistakes and usage of
incorrect sockets.
2016-11-01 16:37:04 -02:00
Bruno Dilly 3d1b7cad6b examples/ecore: add example / test for wayland multiseat 2016-11-01 16:06:19 -02:00
Gustavo Sverzut Barbieri 418637624d efl_net_server_example: oops, do not assume all servers are Efl.Net.Server.Fd
SSL server is not an Fd, it contains one internally, but that's
hidden. So call proper methods.
2016-11-01 10:46:38 -02:00
Gustavo Sverzut Barbieri 1ee201e078 efl_net_{server,dialer}_ssl: TCP + SSL easy to use.
in the previous commit we're manually upgrading an existing TCP socket
to SSL. It is desired since some protocols need to negotiate, like
STARTTLS and the likes

Now we offer 2 classes that does autostart SSL once the socket is
ready.
2016-11-01 01:31:56 -02:00
Gustavo Sverzut Barbieri 973f2c29b5 efl_net_socket_ssl: initial SSL wrapper.
This is the first step towards SSL connections on top of sockets, with
an example on how to upgrade a dialer and a server client using TCP.
2016-10-31 19:39:33 -02:00
Gustavo Sverzut Barbieri 9daddebf09 efl_io_copier_example: add AF_UNIX support. 2016-10-26 19:16:29 -02:00
Gustavo Sverzut Barbieri fc2b980421 addded efl_net_{socket,dialer,server}_unix
This introduces AF_UNIX server and dialer, these are not available on
Windows as in that platform we'll create a custom class for native
'local' communication.

In the future we can add a wrapper class Efl.Net.Local that will use
the class for each platform, but won't expose its details.

For instance, if we ever expose 'credentials' (which I didn't because
they are not portable), then it doesn't make sense to try to match
that on Windows. The 'Efl.Net.Local' would just stick to the basics:
Reader, Writer and Closer APIs.
2016-10-26 19:01:03 -02:00
Gustavo Sverzut Barbieri 8e47bb8e0e efl_io_copier_example: allow udp as input/source.
now that we have a 'bind', let's use the given address as bind and
dial to `0.0.0.0` or `::`. This allows the dialer to receive data at
the given address and make the example useful.
2016-10-26 12:46:09 -02:00
Gustavo Sverzut Barbieri 54de9e211f efl_net_dialer_udp_example: add missing print of groups. 2016-10-26 12:24:48 -02:00
Lauro Moura 2bd1553c8e efl_js: Update JS examples
Changing imports, functions, etc.

Also export "cast" function for all eolian_js generated classes.
2016-10-25 12:23:34 -02:00
Gustavo Sverzut Barbieri d4c6db251a efl_net_*_udp: make UDP usable, including multicast.
This was a huge work, but now UDP is usable as seen in the examples.

Instead of relying on 'connect()', just do 'sendto()' and 'recvfrom()'
as they are universal. Multicast address can only be connected in
IPv4, IPv6 wasn't working and I'm not sure the IPv4 is portable to
other platforms.

Dialer will auto-join multicast groups is the dialed address is
one. Multicast properties such as time to live (hops) and loopback can
be configured. When joining multicast groups, the local
address/interface can be configured by 'IP@IFACE' format, with
'@IFACE' being optional.

Dialers will now auto-bind, so it can receive data as dialers are
expected to be bi-directional. One can manually specify the binding
address if there is such need.

Since datagrams must be read in their full size, otherwise the
remaining bits are dropped, expose next_datagram_size_query() in both
Efl.Net.Socket.Udp and Efl.Net.Server.Udp.Client.

To finalize UDP for real we need to introduce an 'Efl_Net_Ip_Address'
structure to serve as both IPv4 and IPv6 and expose 'sendto()' and
'recvfrom()'. These will come later as this commit is already too big.
2016-10-25 10:11:48 -02:00
Gustavo Sverzut Barbieri b71a7a6a58 efl_* examples: improve usability of boolean options.
Instead of using 'bool', which requires a parameter to be useful, make
them toggle of the default value.

Adapt names to make more sense in that context.
2016-10-22 11:55:45 -02:00
Gustavo Sverzut Barbieri 38502d2df4 efl_net_*_udp: expose SO_DONTROUTE.
It's common to have protocols that are restricted to local network
only, thus allow exposing SO_DONTROUTE to avoid mistakes.
2016-10-22 11:46:19 -02:00
Gustavo Sverzut Barbieri c7fc1dce01 efl_io_copier: add inactivity_timeout.
This is handful to error the copier with ETIMEDOUT if there are no
reads or writes in the given amount of time.

Since copiers are usable to download data or handle network clients,
it's easy to set a timeout and disconnect, let's say UDP clients that
are gone.
2016-10-22 10:52:22 -02:00
Gustavo Sverzut Barbieri 787c745520 efl_net_server_udp: initial UDP server.
This is the initial UDP server that works similarly to the TCP one,
however under the hood it's widely different since the socket is
reused for all "clients", thus needs a new Efl.Net.Server.Udp.Client
(Efl.Net.Socket) as Efl.Net.Socket.Udp exposes the fd and options such
as 'cork', which would interfere in other clients.

The main socket will read the packets and find an existing client to
feed it. If no client exists, then it will create one if not overr
limit. Since there is no kernel-queuing as done by listen()/accept(),
the 'no reject' case will just accept the client anyway.

Next commits will improve UDP server handling with some advanced
features:

 - join multicast groups
 - bind to a specific interface (SO_BINDTODEVICE)
 - block packets going out of local network (SO_DONTROUTE)
 - specify priorities (SO_PRIORITY)
2016-10-21 13:33:27 -02:00
Gustavo Sverzut Barbieri dd1c574b86 efl_net_dialer_udp_example: be more 'correct' using events to read/write.
instead of blindly reading and writing, which can lead to hangs due no
server, let's use can_read and can_write to do the operations, this
won't let us believe we can read when we can't.

it's also the recommended approach, so let's show that in the examples
so users don't copy&paste incorrect stuff :-)
2016-10-21 13:33:27 -02:00
Gustavo Sverzut Barbieri 696392f5c6 efl_net_server_example: improve error messages (show text). 2016-10-21 00:16:37 -02:00
Gustavo Sverzut Barbieri 134f01671a efl_net_server_tcp: allow IPv4 over IPv6 sockets.
Sometimes we want to handle both IPv4 and IPv6 in the same socket,
instead of spawning 2 servers, one for each protocol. That is achieved
by means of disabling IPV6_V6ONLY socket option, present in most
recent platforms.
2016-10-20 18:49:41 -02:00
Gustavo Sverzut Barbieri b36e2c65f6 efl_net_dialer_udp: "connect" to an UDP server to send and receive data.
Like existing ecore_con code, this does not use SOCKSv5 UDP
proxy. It's kinda cumbersome to add since requires a keep alive TCP
connection to the server, a second UDP channel and framing around the
original UDP frame.

Added UDP_CORK (if present) to match TCP_UDP present in TCP sockets,
this allows one to execute multiple write() calls that will result in
a single datagram, generated when CORK becomes FALSE again.

The efl_io_copier_example.c now accepts this as output. There is no
input UDP as there is no way to notify the server of a connection
(since such thing doesn't exit), usually servers react after a
datagram is received, replying to the source.
2016-10-18 19:04:00 -02:00
Stefan Schmidt 1900d09300 examples: eolian_cxx: adapt code generation to changed eolian_gen commandline
The commandline options have changed for eolian_gen to generate the code. Adapt
the makefile helpers to fix the build break in examples
2016-10-14 12:38:46 +02:00
Jean-Philippe Andre 2767152140 evas: Move clip_unset to legacy, remove group_clip
Similarly to group_color_set, group_clip_[un]set should not
exist and should be a result of efl_super and inheritance.

This patch also removes clip_unset from the EO API and keeps
only clip_set(NULL). The reason is that it will avoid bad overrides
of clip_unset() vs. clip_unset(NULL). This also simplifies the code
a bit. Ideally we should be able to reintroduce clip_unset in EO
if we can have a "@final" tag (like java's final keyword), to
prevent overrides.
2016-10-12 11:25:56 +09:00
Guilherme Iscaro f8c98fe158 Eet example: Add the correct variable in the hash. 2016-10-10 14:20:48 -03:00
Subhransu Mohanty 9fc443aafe evas/vg: renamed the legacy vg shape apis
Reviewers: Hermet, cedric, jpeg

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4284
2016-10-05 11:07:12 +09:00
Bruno Dilly 3f730b47f9 examples/ecore: add example suffix to ecore_evas_vnc
Make its name similar to all the other example
files on this folder.
2016-09-28 14:42:58 -03:00
Stefan Schmidt 1bbd108ccb examples: emotion: fix event naming after convert to EFL Canvas Object
In commit 7b90e1147442d6a8023422400bffd77e2815fe0b the event names changed
but examples have not been updated.
2016-09-22 11:43:34 +02:00
Hermet Park ed0c9fd123 edje example: fix broken batman svg resource.
correct missing '/' at the end of svg tag.
2016-09-19 23:40:14 +09:00
Gustavo Sverzut Barbieri 388ec0fb62 efl_io and efl_net examples: fix O_CLOEXEC on windows.
use the efl_io_closer_close_on_exec_set() to use a simple boolean
instead of a flag that may be undefined on some platforms, such as
windows.
2016-09-16 07:42:24 -03:00
Gustavo Sverzut Barbieri 349b106125 efl_io_closer: add close_on_exec and close_on_destructor properties.
the purpose of these properties are to make it more uniform the
handling of these auto-close behavior.
2016-09-12 13:18:28 -03:00
Cedric BAIL d959ed3686 eio: finish port to new efl_io_manager API. 2016-09-09 16:22:55 -07:00
Cedric BAIL 13b5e221ce ecore: shutup unused arguments warning. 2016-09-09 16:22:55 -07:00
Jean-Philippe Andre 6aa5609208 evas: Switch EO APIs to Eina_Slice for gfx buffers (map)
This adds a plane and eina slice argument to the map/unmap
functions, instead of void_ptr + length.
2016-09-06 16:54:53 +09:00
Tom Hacohen b00564d698 Rename efl_self to efl_added
It has been discussed on the ML (thread: "[RFC] rename efl_self") and
IRC, and has been decided we should rename it to this in order to avoid
confusion with the already established meaning of self which is very
similar to what we were using it for, but didn't have complete overlap.

Kudos to Marcel Hollerbach for initiating the discussion and
fighting for it until he convinced a significant mass. :)

This commit breaks API, and depending on compiler potentially ABI.

@feature
2016-09-05 16:59:56 +01:00
Gustavo Sverzut Barbieri 394b9411ce efl_net_dialer_websocket: EFL now does WebSocket!
The Efl.Net.Dialer.Websocket is just like other Efl.Net.Dialers: you
can dial, you can close, monitor connected/address resolved and so
on. And you can use WebSocket primitives and events such as
text_send(), binary_send(), ping() and close_request() (since
WebSockets use a close process where you should state a close
reason). See efl_net_dialer_websocket_example.c

Even if WebSocket is a message-based protocol (like "packets" from
UDP), you can use efl_net_dialer_websocket_streaming_mode_set() to
tell it to handle text or binary messages as a stream. Then all the
Efl.Io.Reader and Efl.Io.Writer APIs work as expected, see
efl_io_copier_example.c updates.
2016-09-02 00:08:50 -03:00
Jean-Philippe Andre e6f6b94ccc evas events: Fix axis input values
This adds support for distance, pressure, tilt and twist.
Not entirely sure if normalized & raw (x,y) should be exposed
in the eo interface. Also not sure what to do with tilt_x/y
(as used by libinput) or touch/tool width "major/minor" vs.
radius x/y.

Add debug logs in the example, including the distance.
I can't test most of these values due to a lack of compatible
hardware, but the most basic features seem to work :)
2016-09-01 11:57:43 +09:00
Tom Hacohen d0bc249ead Efl object: Rename Eo_Event -> Efl_Event.
This is the last step of the Eo renaming efforts.
2016-08-30 13:34:10 +01:00
Jean-Philippe Andre 2fc0d8ef41 evas3d examples: Add EFL_EO_API_SUPPORT where needed
I might have broken this in a previous commit in evas headers,
but the thing is that beta does not imply eo api, so both are
still required.
2016-08-26 11:44:11 +09:00
Gustavo Sverzut Barbieri cfe460c69a efl_io_queue_example: use eina_slice_endswith().
make the code more readable and clear. Also document when the line may
miss a trailing line delimiter in the slice.
2016-08-23 21:30:18 -03:00
Gustavo Sverzut Barbieri 8c23ab0685 efl_io_queue: basic class to interact with Efl.Io interfaces.
The use of low-level interfaces such as Efl.Io.Reader and
Efl.Io.Writer are not that user-friendly as they can handle partial
data.

Classes such as Efl.Io.Copier makes them easy to use, but they need a
reader (source) or writer (destination) and in our examples we used
fixed buffers or some existing streams (stdin/stdout/stderr,
networking...).

However, if interactively we need to produce some data to be sent,
such as implementing some networking protocols, we'd have to write our
own Efl.Io.Reader and Efl.Io.Writer classes to handle the buffering.

Not anymore! With Efl.Io.Queue you can write stuff to it and it will
buffer to memory. Once stuff is read, it will automatically remove
those bytes from buffer.
2016-08-23 20:17:13 -03:00
Gustavo Sverzut Barbieri 06983d8673 efl_io_copier_example: set loop as parent for Efl.Net.Dialer.Tcp
although it was working, the correct way is to set a loop provider as
Efl.Net.Dialer.Tcp object.
2016-08-23 20:17:13 -03:00
Gustavo Sverzut Barbieri c4d09a7a34 examples: add efl_io_copier_simple_example.c
a simpler example to be listed in wiki.
2016-08-23 12:05:37 -03:00
Gustavo Sverzut Barbieri fdad382158 fixup: http 2016-08-22 19:24:13 -03:00
Gustavo Sverzut Barbieri f33bab2648 fixup: http 2016-08-22 18:51:38 -03:00
Gustavo Sverzut Barbieri fe07b8cdab WIP: efl.net: Introduce Efl.Net.Dialer.Http
This class implements the Efl.Net.Dialer interface using libcurl to
perform HTTP requests. That means it's an Efl.Net.Dialer,
Efl.Net.Socket, Efl.Io.Reader, Efl.Io.Writer and Efl.Io.Closer, thus
being usable with Efl.Io.Copier as demonstrated in the
efl_io_copier_example.c
2016-08-22 18:25:15 -03:00
Gustavo Sverzut Barbieri b0b6757bc5 efl.net: socket, server and dialer for TCP.
Efl.Net.Server defines how to accept new connections, doing the
bind(), listen() and accept() for protocols such as TCP.

Efl.Net.Dialer defines to to reach a server.

Both are based on Efl.Net.Socket as communication interface that is
based on Efl.Io.Reader, Efl.Io.Writer and Efl.Io.Closer, thus being
usable with code such as Efl.Io.Copier.

The Server will emit an event "client,add" with the established
Socket, which is a child and can be closed by both the server or the
user.

The Dialer extends the Socket and allows for creating one given an
address, that will be resolved and connected.

TCP is the initial implementation so we an validate the
interfaces. UDP, Unix-Local and SSL will come later as derivate
classes.

The examples are documented and should cover the basic principles:

 - efl_io_copier_example can accept "tcp://IP:PORT" and will work as a
   "netcat", can send data from socket, file or stdin to a socket,
   file, stdout or stderr.

 - efl_net_server_example listens for connections and can either reply
   "Hello World!" and take some data or work as an echo-server,
   looping back all received data to the user.

More complex interactions that require a "chat" between client and
server will be covered with new classes later, such as a queue that
empties itself once data is read.
2016-08-22 18:25:14 -03:00
Gustavo Sverzut Barbieri d0f0bd20a0 efl.io: introduce basic interfaces and classes.
These interfaces allows generic operations on objects that can store
or provide data, such as a file or a buffer.

With well defined interfaces and events we can create code such as
Efl.Io.Copier, that will link a source with a destination and
progressively copy data as they appear.
2016-08-22 18:25:14 -03:00
Lauro Moura 4d2bcc8304 eolian_cxx: Fix behavior with explicit void return
Only perform the single value/return type substitution on properties if the
void return type is implicit (i.e. NULL return from function_return_type_get),
following the eolian-C implementation as we use the generated headers.

Also update example after Eo-Efl changes.
2016-08-17 20:54:27 -03:00
Tom Hacohen 25588b5ae3 Eo: Finish the renaming of Eo to the EFL.
This renames all the rest of the API to the EFL namespace except for
Eo_Event that will follow soon.

Obviously breaks both API and ABI.
2016-08-15 15:07:42 +01:00
Tom Hacohen 8d31721145 Change the EFL to follow the new Eo rename. 2016-08-11 17:04:43 +01:00
Jean-Philippe Andre 7b00751c16 examples: Fix button theme
A program was not handling the various states properly.
2016-08-08 20:41:51 +09:00
Jean-Philippe Andre da21656ee2 examples: Fix path to edj theme files (theme examples)
A bit complex but should work in most cases (installed & not)
2016-08-08 18:15:53 +09:00
jinwoo.shin 2af4b3ffca Fix memory leak issue on genlist_example_02
Summary: The realized items list should be freed by either eina_list_free() or EINA_LIST_FREE when it is no longer needed

Reviewers: cedric, jpeg

Reviewed By: jpeg

Subscribers: minkyu

Differential Revision: https://phab.enlightenment.org/D4193
2016-07-29 11:08:09 +09:00
Subhransu Mohanty 4f4def2776 example/edje: updated vg example with interpolation usecase
Reviewers: cedric, jpeg

Reviewed By: jpeg

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4191
2016-07-26 14:19:59 +09:00
Subhransu Mohanty 5d0de920de example/evas: update evas vg example.
Reviewers: cedric, jpeg

Reviewed By: jpeg

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4189
2016-07-26 14:19:59 +09:00
Jean-Philippe Andre cd960b436a evas: Add a textblock to the image proxy example
This is to show that proxies can proxy more than just other
images, and also this was done to test D4159 (alternatively
changed into the previous commit).
2016-07-19 14:43:45 +09:00
Stefan Schmidt 80f1366ebe examples: edje: remove executable bit from svg files
These are plain data files, no need for an executable bit here.
2016-07-07 14:22:54 +02:00
Subhransu Mohanty dce2f75dd8 svg/example: updated svg example with gradient svg files
Reviewers: cedric, Hermet, jpeg

Reviewed By: jpeg

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4139
2016-07-07 11:52:37 +09:00
Jean-Philippe Andre fe898ab879 evas: Add 2 EO examples for maps
Those are copy & paste & eo-ified versions of the legacy
samples. I did not touch the other legacy APIs, only maps.
2016-06-29 10:38:31 +09:00
Hermet Park 3c24d6709f edje/example: add a missing closing bracket in svg. 2016-06-25 12:37:59 +09:00
Subhransu Mohanty 3fe9e370a7 svg/example: upload the correct svg file
Reviewers: cedric, jpeg

Reviewed By: jpeg

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4088
2016-06-24 15:16:03 +09:00
Stefan Schmidt 08e5923015 examples: emotion: make sure all callbacks are actually setup
In commit 3340745c65ef8b8361dc6eff5e746f7ce1104378 the callback array got
removed letting all callback functions around as unused. Somehow the setup
of all these callbacks have gone missing over various refactors.
2016-06-23 14:07:29 +02:00