2017-08-03 01:23:21 -07:00
|
|
|
/*
|
|
|
|
Edje signaling interface.
|
|
|
|
|
|
|
|
Note: This API must be manually bound in other languages as this uses function
|
2019-03-22 08:25:22 -07:00
|
|
|
pointers! This is by design, to keep the API simple.
|
2017-08-03 01:23:21 -07:00
|
|
|
|
|
|
|
If function pointers really become allowed in EO this needs to be altered to
|
|
|
|
match that.
|
|
|
|
*/
|
|
|
|
|
2019-02-06 10:48:43 -08:00
|
|
|
function EflLayoutSignalCb {
|
2019-04-02 02:32:05 -07:00
|
|
|
[[EflLayoutSignalCb function that is called when a specifc pair of signal/emission is triggered
|
2019-03-22 08:25:22 -07:00
|
|
|
|
|
|
|
@since 1.22
|
|
|
|
]]
|
2019-02-06 10:48:43 -08:00
|
|
|
params {
|
|
|
|
@in object: Efl.Layout.Signal; [[The object the callback is being triggered from.]]
|
|
|
|
@in emission: string; [[The name component of the signal.]]
|
|
|
|
@in source: string; [[The source of a signal used as context.]]
|
|
|
|
}
|
|
|
|
};
|
2017-08-03 01:23:21 -07:00
|
|
|
|
efl: apply the stabilzed column of the efl api board
Summary:
The project https://phab.enlightenment.org/tag/efl_api/ has been used in
the last few weeks to figure out which classes can be stablized and
which cannot. This commit moves those dedicated classes outside beta.
And makes them stable.
ref T7601
ref T7600
ref T7599
ref T7598
ref T7597
ref T7596
ref T7594
ref T7593
ref T7591
ref T7590
ref T7589
ref T7588
ref T7583
ref T7582
ref T7581
ref T7576
ref T7570
ref T7567
ref T7564
ref T7563
ref T7560
ref T7559
ref T7672
ref T7584
ref T7577
ref T7571
ref T7558
ref T7555
ref T7554
ref T7553
ref T7512
ref T7511
Depends on D8272
Reviewers: cedric, stefan_schmidt, zmike, segfaultxavi
Reviewed By: segfaultxavi
Subscribers: #reviewers, #committers
Tags: #efl
Maniphest Tasks: T7672, T7601, T7600, T7599, T7598, T7597, T7596, T7594, T7593, T7591, T7590, T7589, T7588, T7584, T7583, T7582, T7581, T7577, T7576, T7571, T7570, T7567, T7564, T7563, T7560, T7559, T7558, T7555, T7554, T7553, T7512, T7511
Differential Revision: https://phab.enlightenment.org/D8273
2019-03-09 04:44:17 -08:00
|
|
|
interface Efl.Layout.Signal
|
2017-08-03 01:23:21 -07:00
|
|
|
{
|
|
|
|
[[Layouts asynchronous messaging and signaling interface.
|
2019-03-22 08:25:22 -07:00
|
|
|
|
|
|
|
@since 1.22
|
2017-08-03 01:23:21 -07:00
|
|
|
]]
|
|
|
|
methods {
|
|
|
|
// FIXME: There is no message_handler in EO!
|
|
|
|
message_send {
|
|
|
|
[[Sends an (Edje) message to a given Edje object
|
|
|
|
|
|
|
|
This function sends an Edje message to obj and to all of its child
|
|
|
|
objects, if it has any (swallowed objects are one kind of child
|
|
|
|
object). Only a few types are supported:
|
|
|
|
- int,
|
|
|
|
- float/double,
|
|
|
|
- string/stringshare,
|
|
|
|
- arrays of int, float, double or strings.
|
|
|
|
|
|
|
|
Messages can go both ways, from code to theme, or theme to code.
|
|
|
|
|
|
|
|
The id argument as a form of code and theme defining a common
|
|
|
|
interface on message communication. One should define the same IDs on
|
|
|
|
both code and EDC declaration, to individualize messages (binding
|
|
|
|
them to a given context).
|
|
|
|
]]
|
|
|
|
params {
|
|
|
|
@in id: int; [[A identification number for the message to be sent]]
|
2017-09-22 11:16:06 -07:00
|
|
|
@in msg: const(any_value); [[The message's payload]]
|
2017-08-03 01:23:21 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
signal_callback_add {
|
|
|
|
[[Adds a callback for an arriving Edje signal, emitted by
|
|
|
|
a given Edje object.
|
|
|
|
|
|
|
|
Edje signals are one of the communication interfaces between code and
|
|
|
|
a given Edje object's theme. With signals, one can communicate two
|
|
|
|
string values at a time, which are:
|
|
|
|
- "emission" value: the name of the signal, in general
|
|
|
|
- "source" value: a name for the signal's context, in general
|
|
|
|
|
|
|
|
Signals can go both ways, from code to theme, or theme to code.
|
|
|
|
|
|
|
|
Though there are those common uses for the two strings, one is free
|
|
|
|
to use them however they like.
|
|
|
|
|
|
|
|
Signal callback registration is powerful, in the way that blobs may
|
|
|
|
be used to match multiple signals at once. All the "*?[\" set of
|
|
|
|
$fnmatch() operators can be used, both for emission and source.
|
|
|
|
|
|
|
|
Edje has internal signals it will emit, automatically, on various
|
|
|
|
actions taking place on group parts. For example, the mouse cursor
|
|
|
|
being moved, pressed, released, etc., over a given part's area, all
|
|
|
|
generate individual signals.
|
|
|
|
|
|
|
|
With something like emission = "mouse,down,*", source = "button.*"
|
|
|
|
where "button.*" is the pattern for the names of parts implementing
|
|
|
|
buttons on an interface, you'd be registering for notifications on
|
|
|
|
events of mouse buttons being pressed down on either of those parts
|
|
|
|
(those events all have the "mouse,down," common prefix on their
|
|
|
|
names, with a suffix giving the button number). The actual emission
|
|
|
|
and source strings of an event will be passed in as the emission and
|
|
|
|
source parameters of the callback function (e.g. "mouse,down,2" and
|
|
|
|
"button.close"), for each of those events.
|
|
|
|
|
|
|
|
See also the Edje Data Collection Reference for EDC files.
|
|
|
|
|
|
|
|
See @.signal_emit on how to emit signals from code to a an object
|
|
|
|
See @.signal_callback_del.
|
|
|
|
]]
|
|
|
|
params {
|
|
|
|
@in emission: string; [[The signal's "emission" string]]
|
|
|
|
@in source: string; [[The signal's "source" string]]
|
2019-02-06 10:48:43 -08:00
|
|
|
@in func: EflLayoutSignalCb;
|
2017-08-03 01:23:21 -07:00
|
|
|
[[The callback function to be executed when the signal is emitted.]]
|
|
|
|
}
|
|
|
|
return: bool; [[$true in case of success, $false in case of error.]]
|
|
|
|
}
|
|
|
|
signal_callback_del {
|
|
|
|
[[Removes a signal-triggered callback from an object.
|
|
|
|
|
|
|
|
This function removes a callback, previously attached to the emission
|
|
|
|
of a signal, from the object obj. The parameters emission, source
|
|
|
|
and func must match exactly those passed to a previous call to
|
|
|
|
@.signal_callback_add().
|
|
|
|
|
|
|
|
See @.signal_callback_add.
|
|
|
|
]]
|
|
|
|
params {
|
|
|
|
@in emission: string; [[The signal's "emission" string]]
|
|
|
|
@in source: string; [[The signal's "source" string]]
|
2019-02-06 10:48:43 -08:00
|
|
|
@in func: EflLayoutSignalCb;
|
2017-08-03 01:23:21 -07:00
|
|
|
[[The callback function to be executed when the signal is emitted.]]
|
|
|
|
}
|
|
|
|
return: bool; [[$true in case of success, $false in case of error.]]
|
|
|
|
}
|
|
|
|
signal_emit {
|
|
|
|
[[Sends/emits an Edje signal to this layout.
|
|
|
|
|
|
|
|
This function sends a signal to the object. An Edje program, at the
|
|
|
|
EDC specification level, can respond to a signal by having declared
|
|
|
|
matching "signal" and "source" fields on its block.
|
|
|
|
|
|
|
|
See also the Edje Data Collection Reference for EDC files.
|
|
|
|
|
|
|
|
See @.signal_callback_add() for more on Edje signals.
|
|
|
|
]]
|
|
|
|
params {
|
|
|
|
@in emission: string; [[The signal's "emission" string]]
|
|
|
|
@in source: string; [[The signal's "source" string]]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
signal_process {
|
|
|
|
[[Processes an object's messages and signals queue.
|
|
|
|
|
|
|
|
This function goes through the object message queue processing the
|
|
|
|
pending messages for this specific Edje object. Normally they'd be
|
|
|
|
processed only at idle time.
|
|
|
|
|
|
|
|
If $recurse is $true, this function will be called recursively on all
|
|
|
|
subobjects.
|
|
|
|
]]
|
|
|
|
// FIXME: Should be $true by default!
|
|
|
|
params {
|
|
|
|
recurse: bool @optional; [[Whether to process messages on children
|
|
|
|
objects.]]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|