Summary:
The Encoding key is no longer required, all desktop files are assumed to
be UTF-8 encoded. See details at:
https://standards.freedesktop.org/desktop-entry-spec/1.1/apc.html
Fix various typos and misspellings
lintian, Debian's package checker, uses strings to check for common typos
in compiled binaries. This change fixes the ones it identified in 1.20.6.
Reviewers: cedric
Reviewed By: cedric
Subscribers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D5584
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
This resolves a few issues and brings back the experimental features.
Also, disable some of the ugliest experiments:
- manual function overrides,
- define APIs only in eo_cxx namespace
Some APIs are generated behind EFL_CXXPERIMENT (eg. event_name_cb_add or
some weak pointer stuff). I believe they are useful but would like to
make sure there are no serious drawbacks with generating those.
It's VERY hacky, but works as expected: no leak, no extra unref. This is
a lucky case of simply overriding efl_part() implementation in C++,
without having to modify the declaration.
This is part of the experimental stuff.
Allows calling C functions without using ._eo_ptr() explicitly. Probably
not super useful, assuming the interfaces are done :)
I'll hide some controversial features behind this, until we come to an
agreement with @felipealmeida and people who actually know C++ (iow: not
just me^^).
Features protected:
- easy wref (using -> without locking)
- xxx_event_cb_add() functions in object classes
- instantiate(obj) to create a new object
- add as a synonym for instantiate (both in efl::eo)
When I first implemented the Efl.Container interface I made a mistake of
mixing "single slot" content API's with "multiple children" content
API's. This should fix that, by separating API's that are for a single
part and those that deal with a list of children.
Efl.Content: Single slot. This will be used a lot by efl_part()
objects, and for the default content of widgets (eg. the window
content).
Efl.Container: Multiple children. Used by lists, boxes, layouts
(edje/elm), etc...
I didn't see any class that implemented both interfaces (note: Layout
implements Container and Button implements Content, so technically
Button implements both through inheritance).
For now the eo_prefix is not changed in Efl.Container. I wonder if it
should be reset (to efl_container) or not. This would only affect the C
API.
Ref T5328
Note: this is C only, not legacy only.
The problem is that bindings will hold a strong reference to the window,
which will then die "under the rug" if autodel is enabled. This then
leads to at least ERR if not crashes.
Note:
elm_policy needs to support autodel and quit on last del only for C
applications. Bindings will require some other mechanism that doesn't
break all assumptions wrt. references.
The fix is not complete. We need to make efl_part() work nicely in C++:
- Get the refs work properly (maybe without auto-del)
- Generate the parts from the EO file as methods on the object
Final form should be close to:
slider.indicator().format_string_set("%1.2f");
Where everything autocompletes nicely :)
Summary:
9d2dcd92 requires elocation to build.
cxx examples still broken due to elm cleanup
Test Plan: make examples
Reviewers: jpeg, felipealmeida
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D5426
make examples now builds all c++ examples but some of them are in fact
empty skeletons. Those either need some c++ love or the final eo api to
be ready (eg. menu, popup, ...).
I removed some examples that don't have an exact equivalent in EO since
the widget is legacy only.
This is more of an experiment than anything else.
@felipealmeida I would like to know what you think.
Notes:
- events still need a better API (event_add isn't part of the object
definition...).
- references are an issue, when you want to actually delete an object.
This isn't meant to be installed. The canvas API in EO is based around
the interfaces Efl.Canvas and the widget Efl.Ui.Win. Anything else is
not EO (eg: ecore_evas, evas, ...)
Note: evas_canvas3d is the last remaining thing that is installed along
EO files, but those are all beta APIs.
Summary:
Currently user ask for the root_node from the evas_vg object and then attach its tree by setting the root node as parent.
With this change this process will be explicit. user has to set the root node to the evas_vg object and the object will take the ownership
of the tree. User can query the current vg_tree by root_node_get api.
Test Plan:
Fixed the test app to reflects this change.
Reviewers: jpeg, cedric
Reviewed By: jpeg, cedric
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D5347
Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
eina_strbuf_append_strftime()
eina_strbuf_insert_strftime()
eina_strbuf_prepend_strftime() - macro
We need these functions for implementing generic format function
interface especially for calander.
Ref T6204
Summary: We should define the windows version before including evil.
Test Plan: Run make examples on windows newer than XP.
Reviewers: vtorri
Subscribers: jenkins, cedric, jpeg
Tags: #efl, #windows
Differential Revision: https://phab.enlightenment.org/D5261
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
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.
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
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
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>
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.
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
Introduced with commit 13da5e980e
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);
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
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
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
Summary: ecore_main_fd_handler_add is not working on Windows
Reviewers: vtorri, raster
Subscribers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D4470
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
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
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
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>
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>
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.
This was broken since over a year. Happened during the automatic eo4
migration in f21ade6123.
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);
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
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
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
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>
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>
This fixes all warnings for "make examples" for:
-Wunused-parameter
-Wshadow
-Wformat-security
-Wenum-conversion
Some remaining warnings include:
-Wdeprecated-delcarations
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
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
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.
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.
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
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
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>
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".
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.
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.
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.
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).
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.
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.
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).
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.
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
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
Summary:
Since eina_model was dropped some years ago.
Also a few other points where related stuff is just commented out.
Reviewers: iscaro, barbieri
Reviewed By: barbieri
Subscribers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D4442
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).
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?
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.
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.
In commit 5929f0311d this was removed. While
the commits intend was to remove the cxx variant of this example only.
Bring this back so examples are building again.
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
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).
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>
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.
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.
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.
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.
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.
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.
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.
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)
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 :-)
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.
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.
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.
Remove codegen_example_generated.h from codegen_example_SOURCES
and let it only on nodist_codegen_example_SOURCES and
on BUILT_SOURCES.
Also add dependency between codegen_example.c
and codegen_example_generated.h since it's required
to compile.
Avoid the following build error:
CODEGEN codegen_example_generated.c
codegen_example.c:26:39: fatal error: codegen_example_generated.h:
No such file or directory
compilation terminated.
Makefile:4960: recipe for target 'codegen_example.o' failed
Fix missing dependency.
Get rid of the following error:
/usr/bin/ld: ecore_evas_vnc.o: undefined reference
to symbol 'ECORE_EVENT_MOUSE_BUTTON_UP'
src/lib/ecore_input/.libs/libecore_input.so.1: error adding symbols:
DSO missing from command line
collect2: error: ld returned 1 exit status
Makefile:2306: recipe for target 'ecore_evas_vnc' failed
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
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.
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 :)
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.
so efreet mime was loading a bunch of mime type info files, parsing
them on startup and allocating memory to store all this mime info -
globs, mimetype strings and more. all a big waste of memory as its
allocated on the heap per process where its the SAME data files loaded
every time.
so make an efreet mime cache file and a tool to create it from mime
files. mmap this file with all the hashes/strings in it so all that
data is mmaped once in memory and shared between all processes and it
is only paged in on demand - as actually read/needed so if your
process doesnt need to know about mime stuff.. it wont touch it anyway.
this saves about 240-300k or so of memory in my tests. this has not
covered the mime MAGIC files which still consume memory and are on the
heap. this is more complex so it will take more time to come up with a
nice file format for the data that is nicely mmaped etc.
@optimize
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
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.
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.
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.
At some point we lost the \ after track_example_01 and in combination with the
commented out line right afterwards we lost all examples coming after this line.
This just surfaced with JPs latest commit when I did a distcheck build but was
there for a longer time. We now make sure all disabled examples are moved out of
the multi-line list.
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
The edje text example covers the translation functionality which need the mo
and po files during edje_cc compilation. Further more the folder need to be
writable to create the new mo/po files.
We need to ensure that this is the case during a distcheck which is read only
on the source tree.
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).
In commit 3340745c65 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.
Missing parenthesis have been leading to an out of bound access here.
Summary: @fix
Reviewers: stefan_schmidt
Subscribers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D4069
evas-images5.c:19:0: warning: "EFL_BETA_API_SUPPORT" redefined
#define EFL_BETA_API_SUPPORT
^
In file included from evas-images5.c:14:0:
../../../config.h:360:0: note: this is the location of the previous definition
#define EFL_BETA_API_SUPPORT 1
We should only define it when we are not using config.h
My recent removal of the EFL_EO_API_SUPPORT define brought some trouble to the
evas 3d examples. The problem was that there was no uniform usage of including
config.h and thus it worked fine in some constellations abut not in others. This
patch should fix the known problems and brings back EFL_EO_API_SUPPORT until we
are removing it from the whole code base.
Reported by Simotek when testing the latest snapshot:
Were getting closer, "/usr/bin/mkdir -p /usr/share/elua/examples" should
be "/usr/bin/mkdir -p
/home/abuild/rpmbuild/BUILDROOT/efl-1.17.99.48545-1.x86_64/usr/share/elua/examples"
We are using cos() and sin() in the efl_thread examples here but never linked
to the math lib. Ubuntu 14.04 on Travis CI errored out with this:
/usr/bin/ld: efl_thread_1.o: undefined reference to symbol 'cos@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libm.so.6: error adding symbols: DSO missing from command line
This allows apps to set the objects min size with hint_min,
while letting the rest of EFL define the minimum size with
rstricted_min.
I don't like the property names much...
The ecore_audio examples have been disabled and now do not compile right now.
But as they are disabled they never land in the tarball and thus we error out
with files not aviavle for install. Found by the OpenSUSE build service. Thanks
Simotek for reporting.
[ 2172s] /home/abuild/rpmbuild/BUILD/efl-1.17.99.47400/install-sh: ecore_audio_custom.c does not
exist.
This reverts commit 546ff7bbba.
It seems that eo_del() is useful and removing it was creating bugs.
The issue is that the way we defined parents in eo, both the parent and
the programmer share a reference to the object. When we eo_unref() that
reference as the programmer, eo has no way to know it's this specific
reference we are freeing, and not a general one, so in some
circumstances, for example:
eo_ref(child);
eo_unref(child); // trying to delete here
eo_unref(container); // container is deleted here
eo_unref(child); // child already has 0 refs before this point.
We would have an issue with references and objects being freed too soon
and in general, issue with the references.
Having eo_del() solves that, because this one explicitly unparents if
there is a parent, meaning the reference ownership is explicitly taken
by the programmer.
eo_del() is essentially a convenience function around "check if has
parent, and if so unparent, otherwise, unref". Which should be used when
you want to delete an object although it has a parent, and is equivalent
to eo_unref() when it doesn't have one.
The legacy Eio_File factory functions are replaced by an Eo object
called Eo_Job that return promises wrapping the async file operations.
With this commit, the legacy Eio callbacks are replaced by the following
Eo/Promises counterparts :
* Done_Cb -> Promise then success callback
* Error_Cb -> Promise then error callback
* Main_Cb -> Promise progress callback
* Filter_Cb -> Job object event (more below)
Events are used to deliver and get the filter data. To differentiate
between the named and direct versions, they come in "filter,direct" and
"filter,name" versions.
Monitors were wrapped inside a new class Eo_Sentry.
The user creates a sentry object and adds monitoring targets to it,
listening to events on it.
The sentry event info is composed of two strings. The source string
is the path being monitored, i.e. the one passed to eio_sentry_add, and
the trigger string is the path that actually triggered the event, e.g.
a new file created in a monitored directory.
In commit 75a53ece10 obj was changed to object.
As one can claerly see though make examples have not been run to verify this
change. Catch up in examples with this rename.
We used to have eo_del() as the mirrored action to eo_add(). No longer,
now you just always eo_unref() to delete an object. This change makes it
so the reference of the parent is shared with the reference the
programmer has. So eo_parent_set(obj, NULL) can free an object, and so
does eo_unref() (even if there is a parent).
This means Eo no longer complains if you have a parent during deletion.
Fix commit 3e8db298f7 the namepsace changed but
only a few files have been fixed for this. Many files did still not compile
with make examples. I fixed some more but stopped at the cxx files with the hope
that the original author would actually do this.
Due to dependencies from elementary codegen on the edj files triggered by the
generation of .h and .c, we actually need to provide the edj as it would
otherwise to build edje_cc prior to any make dist.
As the edje file was added after in the git repository, you may have some
timestamp issue to fix before doing a make dist. Try touch on all codegen_example
files.
T3588