summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiep Ha <thiepha@gmail.com>2017-12-11 16:16:56 +0900
committerThiep Ha <thiepha@gmail.com>2017-12-11 16:19:25 +0900
commit02693b45c4b06830de240d1660da7190b28a04a5 (patch)
treecbb580d240ab7ac4236787c65296d337cd3ba09b
parentbe963e06be038ca0d19d841d5d23275683456c6b (diff)
downloadefl-02693b45c4b06830de240d1660da7190b28a04a5.tar.gz
sel_manager: change api to beta
-rw-r--r--src/Makefile_Elementary.am2
-rw-r--r--src/lib/efl/interfaces/efl_dnd.eo17
-rw-r--r--src/lib/efl/interfaces/efl_dnd_types.eot6
-rw-r--r--src/lib/efl/interfaces/efl_selection.eo9
-rw-r--r--src/lib/efl/interfaces/efl_selection_types.eot18
-rw-r--r--src/lib/elementary/efl_selection_manager.c7
-rw-r--r--src/lib/elementary/efl_selection_manager.eo28
7 files changed, 46 insertions, 41 deletions
diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am
index 095dcba34a..abc87bb025 100644
--- a/src/Makefile_Elementary.am
+++ b/src/Makefile_Elementary.am
@@ -89,7 +89,6 @@ elm_public_eolian_files = \
lib/elementary/elm_code_widget.eo \
lib/elementary/efl_cnp.eo \
lib/elementary/efl_ui_dnd.eo \
- lib/elementary/efl_selection_manager.eo \
$(NULL)
#lib/elementary/efl_ui_dnd_drag.eo
#lib/elementary/efl_ui_dnd_drop.eo
@@ -122,6 +121,7 @@ elm_private_eolian_files = \
lib/elementary/efl_ui_focus_parent_provider_gen.eo \
tests/elementary/focus_test.eo \
tests/elementary/focus_test_sub_main.eo \
+ lib/elementary/efl_selection_manager.eo \
$(NULL)
# Legacy classes - not part of public EO API
diff --git a/src/lib/efl/interfaces/efl_dnd.eo b/src/lib/efl/interfaces/efl_dnd.eo
index 51b1ebea72..750fe308de 100644
--- a/src/lib/efl/interfaces/efl_dnd.eo
+++ b/src/lib/efl/interfaces/efl_dnd.eo
@@ -13,14 +13,14 @@ interface Efl.Dnd (Efl.Selection) {
]]
params {
@in format: Efl.Selection.Format; [[The data format]]
- @in buf: const(void_ptr);
+ @in buf: const(void_ptr); //same for selection with slice
@in len: int; [[The data's length.]]
@in action: Efl.Selection.Action; [[Action when data is transferred]]
@in icon_func: Efl.Dnd.Drag_Icon_Create; [[Function pointer to create icon]]
@in seat: uint @optional; [[Specified seat for multiple seats case.]]
}
}
- drag_action_set {
+ drag_action_set { //CHECKING
[[This sets the action for the drag]]
params {
@in action: Efl.Selection.Action; [[Drag action]]
@@ -33,27 +33,28 @@ interface Efl.Dnd (Efl.Selection) {
@in seat: uint @optional; [[Specified seat for multiple seats case.]]
}
}
- drag_item_container_add {
+ drag_item_container_add { //drag_item_callback //property
[[This registers a drag for items in a container. Many items can be
dragged at a time. During dragging, there are three events emitted:
EFL_DND_EVENT_DRAG_POS, EFL_DND_EVENT_DRAG_ACCEPT, EFL_DND_EVENT_DRAG_DONE.]]
params {
- @in time_to_drag: double; [[Time since mouse down happens to drag starts]]
+ @in time_to_drag: double; [[Time since mouse down happens to drag starts]] //drag_delay: property
@in anim_durataion: double; [[animation duration]]
+ //@in anim_durataion: double; [[animation duration]] //just config
@in data_func: Efl.Dnd.Drag_Data_Get; [[Data and its format]]
@in item_func: Efl.Dnd.Item_Get; [[Item to determine drag start]]
@in icon_func: Efl.Dnd.Drag_Icon_Create; [[Icon used during drag]]
- @in icon_list_func: Efl.Dnd.Drag_Icon_List_Create; [[Icons used for animations]]
+ @in icon_list_func: Efl.Dnd.Drag_Icon_List_Create; [[Icons used for animations CHECKING ]]
@in seat: uint @optional; [[Specified seat for multiple seats case.]]
}
}
- drag_item_container_del {
+ drag_item_container_del { //remove
[[Remove drag function of items in the container object.]]
params {
@in seat: uint @optional; [[Specified seat for multiple seats case.]]
}
}
- drop_target_add {
+ drop_target_add { //change to property (keys: format, seat, value: boolean)
[[There are four events emitted: EFL_DND_EVENT_DRAG_ENTER, EFL_DND_EVENT_DRAG_LEAVE,
EFL_DND_EVENT_DRAG_POS, EFL_DND_EVENT_DRAG_DROP.]]
params {
@@ -61,7 +62,7 @@ interface Efl.Dnd (Efl.Selection) {
@in seat: uint @optional; [[Specified seat for multiple seats case.]]
}
}
- drop_target_del {
+ drop_target_del { //remove
params {
@in format: Efl.Selection.Format; [[Accepted data format]]
@in seat: uint @optional; [[Specified seat for multiple seats case.]]
diff --git a/src/lib/efl/interfaces/efl_dnd_types.eot b/src/lib/efl/interfaces/efl_dnd_types.eot
index 8941abb554..014f7a58a2 100644
--- a/src/lib/efl/interfaces/efl_dnd_types.eot
+++ b/src/lib/efl/interfaces/efl_dnd_types.eot
@@ -4,10 +4,13 @@ function Efl.Dnd.Drag_Icon_Create {
[[Function pointer for creating icon at the drag side.]]
params {
@in win: ptr(Eo); [[The window to create the objects relative to]]
+ //@in drag_obj: Efl.Gfx;
+ //Eina_Position2D
@out xoff: int; [[A return coordinate for the X offset at which to place the drag icon object relative to the source drag object]]
@out yoff: int; [[A return coordinate for the Y offset at which to place the drag icon object relative to the source drag object]]
}
- return: ptr(Eo); [[The drag icon object]]
+ return: ptr(Eo); //Eo
+ //return: Efl.Gfx; [[The drag icon object]] //Efl.Canvas.Object
};
function Efl.Dnd.Drag_Data_Get {
@@ -15,6 +18,7 @@ function Efl.Dnd.Drag_Data_Get {
params {
@in obj: ptr(Eo); [[The container object]]
@out format: Efl.Selection.Format; [[Data format]]
+ //Eina_Slice
@out buf: void_ptr; [[Data]]
@out len: int; [[The data's length]]
@out action: Efl.Selection.Action; [[The drag action]]
diff --git a/src/lib/efl/interfaces/efl_selection.eo b/src/lib/efl/interfaces/efl_selection.eo
index eaa71f6cd5..ef08625b3a 100644
--- a/src/lib/efl/interfaces/efl_selection.eo
+++ b/src/lib/efl/interfaces/efl_selection.eo
@@ -9,6 +9,7 @@ interface Efl.Selection {
params {
@in type: Efl.Selection.Type; [[Selection Type]]
@in format: Efl.Selection.Format; [[Selection Format]]
+ //@in data: Eina.Slice;
@in buf: const(void_ptr);
@in len: int; [[The buffer's length.]]
//@in seat: Efl.Input.Device @optional;[[Specified seat for multiple seats case.]]
@@ -31,18 +32,14 @@ interface Efl.Selection {
@in seat: uint @optional; [[Specified seat for multiple seats case.]]
}
}
+ //selection_has { //change to property selection_owner
has_owner {
params {
+ //@in type: Efl.Selection.Type (Efl.Selection.Type.clipboard);
@in seat: uint @optional; [[Specified seat for multiple seats case.]]
}
return: bool;
}
- /*selection_loss_feedback { //name!!!
- params {
- @in type: Efl.Selection.Type; [[Selection type]]
- }
- return: future<generic_value>; [[Future of selection that is ready]]
- }*/
}
implements {
}
diff --git a/src/lib/efl/interfaces/efl_selection_types.eot b/src/lib/efl/interfaces/efl_selection_types.eot
index a02f57b77f..55ec751913 100644
--- a/src/lib/efl/interfaces/efl_selection_types.eot
+++ b/src/lib/efl/interfaces/efl_selection_types.eot
@@ -20,20 +20,13 @@ enum Efl.Selection.Format
html = 0x10 [[Raw HTML-like data (eg. webkit)]]
}
-struct Efl.Cnp.Selection
-{
- [[EFL Cnp selection]]
- data: void_ptr; [[data]]
- length: int; [[length]]
-}
-
enum Efl.Selection.Action
{
[[Defines the kind of action associated with the drop data]]
unknown, [[Action type is unknown]]
copy, [[Copy the data]]
move, [[Move the data]]
- private, [[Pricate action type]]
+ private, [[Private action type]]
ask, [[Ask the user what to do]]
list, [[List the data]]
link, [[Link the data]]
@@ -46,16 +39,19 @@ struct Efl.Selection.Data
x: int; [[The coordinates of the drop (DND operations only)]]
y: int; [[The coordinates of the drop (DND operations only)]]
format: Efl.Selection.Format; [[The format of the selection]]
+ //data: Eina.Slice;
data: void_ptr; [[The selection data, type determined by format member]]
+ //len: uint; [[The length of the selection data]]
len: int; [[The length of the selection data]]
action: Efl.Selection.Action; [[The action to perform with the data @since 1.8]]
- item: Efl.Object; [[item under the drag position. It is only available for container]]
+ //hovered_item: Efl.Object; [[item under the drag position. It is only available for container (CHECKING]]
+ item: Efl.Object; [[item under the drag position. It is only available for container (CHECKING]]
}
-function Efl.Selection.Data_Ready {
+function Efl.Selection.Data_Ready { //FIXME: promise
[[Function pointer for getting selection]]
params {
- @in obj: ptr(Eo);
+ @in obj: ptr(Eo); //CHECKING
@in seldata: ptr(Efl.Selection.Data);
}
};
diff --git a/src/lib/elementary/efl_selection_manager.c b/src/lib/elementary/efl_selection_manager.c
index 0be1509ddb..98e56059cb 100644
--- a/src/lib/elementary/efl_selection_manager.c
+++ b/src/lib/elementary/efl_selection_manager.c
@@ -31,6 +31,10 @@ static void _cont_obj_mouse_move_cb(void *data, Evas *e, Evas_Object *obj, void
static void _cont_obj_mouse_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
static void _item_container_del_internal(Sel_Manager_Drag_Container *dc, Eina_Bool full);
+void efl_selection_manager_drop_target_del(Eo *obj, Efl_Object *target_obj, Efl_Selection_Format format, unsigned int seat);
+void efl_selection_manager_selection_clear(Eo *obj, Efl_Object *owner, Efl_Selection_Type type, unsigned int seat);
+void efl_selection_manager_drag_start(Eo *obj, Efl_Object *drag_obj, Efl_Selection_Format format, const void *buf, int len, Efl_Selection_Action action, void *icon_func_data, Efl_Dnd_Drag_Icon_Create icon_func, Eina_Free_Cb icon_func_free_cb, unsigned int seat);
+
#ifdef HAVE_ELEMENTARY_X
static Ecore_X_Atom _x11_dnd_action_rev_map(Efl_Selection_Action action);
static Ecore_X_Window _x11_xwin_get(Evas_Object *obj);
@@ -4318,6 +4322,7 @@ _efl_selection_manager_selection_set(Eo *obj, Efl_Selection_Manager_Data *pd,
Efl_Object *owner, Efl_Selection_Type type,
Efl_Selection_Format format,
const void *buf, int len, unsigned int seat)
+ //Eina_Slice *data, unsigned int seat)
{
ERR("In");
Sel_Manager_Seat_Selection *seat_sel;
@@ -4688,7 +4693,7 @@ _efl_selection_manager_drop_item_container_add(Eo *obj, Efl_Selection_Manager_Da
dropable->is_container = EINA_TRUE;
dropable->item_func = item_func;
dropable->item_func_data = item_func_data;
- efl_selection_manager_drop_target_add(obj, cont, format, seat);
+ _efl_selection_manager_drop_target_add(obj, pd, cont, format, seat);
}
EOLIAN static void
diff --git a/src/lib/elementary/efl_selection_manager.eo b/src/lib/elementary/efl_selection_manager.eo
index a4078f2dd0..c4be1d0dc4 100644
--- a/src/lib/elementary/efl_selection_manager.eo
+++ b/src/lib/elementary/efl_selection_manager.eo
@@ -1,17 +1,18 @@
class Efl.Selection.Manager (Efl.Object, Efl.Selection, Efl.Dnd) {
methods {
- selection_set {
+ selection_set @beta {
params {
@in owner: Efl.Object; [[Seleciton owner]]
@in type: Efl.Selection.Type; [[Selection Type]]
@in format: Efl.Selection.Format; [[Selection Format]]
+ //@in data: Eina.Slice;
@in buf: const(void_ptr);
@in len: int; [[The buffer's length.]]
//@in seat: Efl.Input.Device @optional;[[Specified seat for multiple seats case.]]
@in seat: uint @optional;[[Specified seat for multiple seats case.]]
}
}
- selection_get {
+ selection_get @beta {
params {
@in request: Efl.Object; [[Seleciton owner]]
@in type: Efl.Selection.Type; [[Selection Type]]
@@ -21,7 +22,7 @@ class Efl.Selection.Manager (Efl.Object, Efl.Selection, Efl.Dnd) {
@in seat: uint @optional;[[Specified seat for multiple seats case.]]
}
}
- selection_clear {
+ selection_clear @beta {
params {
@in owner: Efl.Object; [[Seleciton owner]]
@in type: Efl.Selection.Type; [[Selection Type]]
@@ -29,7 +30,7 @@ class Efl.Selection.Manager (Efl.Object, Efl.Selection, Efl.Dnd) {
@in seat: uint @optional; [[Specified seat for multiple seats case.]]
}
}
- selection_has_owner {
+ selection_has_owner @beta {
[[Check if the request object has selection or not]]
params {
@in request: Efl.Object; [[the request object]]
@@ -37,7 +38,7 @@ class Efl.Selection.Manager (Efl.Object, Efl.Selection, Efl.Dnd) {
}
return: bool; [[EINA_TRUE if the request object has selection, otherwise, EINA_FALSE]]
}
- drag_start {
+ drag_start @beta {
[[This starts a drag and drop process at the drag side.
During dragging, there are three events emitted as belows:
- EFL_DND_EVENT_DRAG_POS
@@ -47,6 +48,7 @@ class Efl.Selection.Manager (Efl.Object, Efl.Selection, Efl.Dnd) {
params {
@in drag_obj: Efl.Object; [[The drag object]]
@in format: Efl.Selection.Format; [[The data format]]
+ //@in data: Eina.Slice;
@in buf: const(void_ptr);
@in len: int; [[The data's length.]]
@in action: Efl.Selection.Action; [[Action when data is transferred]]
@@ -55,7 +57,7 @@ class Efl.Selection.Manager (Efl.Object, Efl.Selection, Efl.Dnd) {
@in seat: uint @optional; [[Specified seat for multiple seats case.]]
}
}
- drag_action_set {
+ drag_action_set @beta {
[[This sets the action for the drag]]
params {
@in action: Efl.Selection.Action; [[Drag action]]
@@ -63,7 +65,7 @@ class Efl.Selection.Manager (Efl.Object, Efl.Selection, Efl.Dnd) {
@in seat: uint @optional; [[Specified seat for multiple seats case.]]
}
}
- drag_cancel {
+ drag_cancel @beta {
[[This cancels the on-going drag]]
params {
@in drag_obj: Efl.Object; [[The drag object]]
@@ -71,7 +73,7 @@ class Efl.Selection.Manager (Efl.Object, Efl.Selection, Efl.Dnd) {
@in seat: uint @optional; [[Specified seat for multiple seats case.]]
}
}
- drag_item_container_add {
+ drag_item_container_add @beta {
[[This registers a drag for items in a container. Many items can be
dragged at a time. During dragging, there are three events emitted:
EFL_DND_EVENT_DRAG_POS, EFL_DND_EVENT_DRAG_ACCEPT, EFL_DND_EVENT_DRAG_DONE.]]
@@ -90,7 +92,7 @@ class Efl.Selection.Manager (Efl.Object, Efl.Selection, Efl.Dnd) {
@in seat: uint @optional; [[Specified seat for multiple seats case]]
}
}
- drag_item_container_del {
+ drag_item_container_del @beta {
[[Remove drag function of items in the container object.]]
params {
@in cont: Efl.Object; [[Container object]]
@@ -98,7 +100,7 @@ class Efl.Selection.Manager (Efl.Object, Efl.Selection, Efl.Dnd) {
@in seat: uint @optional; [[Specified seat for multiple seats case]]
}
}
- drop_target_add {
+ drop_target_add @beta {
[[There are four events emitted: EFL_DND_DROP_DRAG_ENTER, EFL_DND_DROP_DRAG_LEAVE,
EFL_DND_DROP_DRAG_POS, EFL_DND_DROP_DRAG_DROP.]]
params {
@@ -109,7 +111,7 @@ class Efl.Selection.Manager (Efl.Object, Efl.Selection, Efl.Dnd) {
}
return: bool; [[$true on success, $false otherwise]]
}
- drop_target_del {
+ drop_target_del @beta {
params {
@in target_obj: Efl.Object; [[The drop target]]
@in format: Efl.Selection.Format; [[Accepted data format]]
@@ -117,7 +119,7 @@ class Efl.Selection.Manager (Efl.Object, Efl.Selection, Efl.Dnd) {
@in seat: uint @optional; [[Specified seat for multiple seats case.]]
}
}
- drop_item_container_add {
+ drop_item_container_add @beta {
params {
@in cont: Efl.Object; [[Container object]]
@in format: Efl.Selection.Format; [[Accepted data formats]]
@@ -126,7 +128,7 @@ class Efl.Selection.Manager (Efl.Object, Efl.Selection, Efl.Dnd) {
@in seat: uint @optional; [[Specified seat for multiple seats case.]]
}
}
- drop_item_container_del {
+ drop_item_container_del @beta {
params {
@in cont: Efl.Object; [[Container object]]
//@in seat: Efl.Input.Device @optional; [[Specified seat for multiple seats case.]]