summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/ecore/Ecore.h13
-rw-r--r--src/lib/ecore/Ecore_Common.h14
-rw-r--r--src/lib/ecore/Ecore_Legacy.h4
-rw-r--r--src/lib/ecore/ecore_exe_eo.h4
-rw-r--r--src/lib/ecore/ecore_internal.h33
-rw-r--r--src/lib/ecore/ecore_main.c22
-rw-r--r--src/lib/ecore/efl_core_proc_env.c6
-rw-r--r--src/lib/ecore/efl_exe.c35
-rw-r--r--src/lib/ecore/efl_exe.eo12
-rw-r--r--src/lib/ecore/efl_filter_model.c35
-rw-r--r--src/lib/ecore/efl_loop_model.c36
-rw-r--r--src/lib/ecore/efl_loop_model.eo1
-rw-r--r--src/lib/ecore_audio/ecore_audio.c2
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_in.c13
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c34
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_out.c9
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_out_pulse.c125
-rw-r--r--src/lib/ecore_audio/ecore_audio_private.h2
-rw-r--r--src/lib/ecore_buffer/bq_mgr_protocol.h60
-rw-r--r--src/lib/ecore_cocoa/Ecore_Cocoa.h36
-rw-r--r--src/lib/ecore_cocoa/ecore_cocoa_cnp.m61
-rw-r--r--src/lib/ecore_cocoa/meson.build2
-rw-r--r--src/lib/ecore_con/ecore_con_url.c5
-rw-r--r--src/lib/ecore_con/efl_net_control-connman.c9
-rw-r--r--src/lib/ecore_con/efl_net_control_manager.eo2
-rw-r--r--src/lib/ecore_con/efl_net_dialer_websocket.c6
-rw-r--r--src/lib/ecore_con/efl_net_server_unix.c68
-rw-r--r--src/lib/ecore_con/efl_net_ssl_conn-openssl.c18
-rw-r--r--src/lib/ecore_evas/Ecore_Evas.h227
-rw-r--r--src/lib/ecore_evas/ecore_evas.c362
-rw-r--r--src/lib/ecore_evas/ecore_evas_fallback_selection.c115
-rw-r--r--src/lib/ecore_evas/ecore_evas_private.h53
-rw-r--r--src/lib/ecore_evas/meson.build3
-rw-r--r--src/lib/ecore_imf/Ecore_IMF.h2
-rw-r--r--src/lib/ecore_input_evas/ecore_input_evas.c4
-rw-r--r--src/lib/ecore_wayland/ecore_wl_dnd.c1
-rw-r--r--src/lib/ecore_wayland/ivi-application-client-protocol.h42
-rw-r--r--src/lib/ecore_wayland/session-recovery-client-protocol.h4
-rw-r--r--src/lib/ecore_wayland/xdg-shell-client-protocol.h42
-rw-r--r--src/lib/ecore_win32/Ecore_Win32.h47
-rw-r--r--src/lib/ecore_win32/ecore_win32_clipboard.c224
-rw-r--r--src/lib/ecore_win32/ecore_win32_event.c197
-rw-r--r--src/lib/ecore_wl2/Ecore_Wl2.h29
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_dnd.c2
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_input.c6
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_internal.h10
-rw-r--r--src/lib/ecore_x/Ecore_X.h9
-rw-r--r--src/lib/ecore_x/ecore_x_fixes.c20
-rw-r--r--src/lib/ecore_x/ecore_x_selection.c8
-rw-r--r--src/lib/ecore_x/ecore_x_vsync.c2
-rw-r--r--src/lib/ector/Ector.h2
-rw-r--r--src/lib/ector/software/ector_software_buffer.c8
-rw-r--r--src/lib/edje/Edje.h2
-rw-r--r--src/lib/edje/Edje_Common.h36
-rw-r--r--src/lib/edje/Edje_Edit.h122
-rw-r--r--src/lib/edje/Edje_Eo.h1
-rw-r--r--src/lib/edje/Edje_Legacy.h9
-rw-r--r--src/lib/edje/Efl_Layout.h1
-rw-r--r--src/lib/edje/edje_cache.c9
-rw-r--r--src/lib/edje/edje_calc.c506
-rw-r--r--src/lib/edje/edje_data.c143
-rw-r--r--src/lib/edje/edje_edit.c9
-rw-r--r--src/lib/edje/edje_entry.c8
-rw-r--r--src/lib/edje/edje_legacy.c47
-rw-r--r--src/lib/edje/edje_load.c162
-rw-r--r--src/lib/edje/edje_lua.c20
-rw-r--r--src/lib/edje/edje_lua2.c2
-rw-r--r--src/lib/edje/edje_match.c10
-rw-r--r--src/lib/edje/edje_message_queue.c1
-rw-r--r--src/lib/edje/edje_multisense.c11
-rw-r--r--src/lib/edje/edje_part.c27
-rw-r--r--src/lib/edje/edje_part_invalid.c2
-rw-r--r--src/lib/edje/edje_private.h217
-rw-r--r--src/lib/edje/edje_program.c83
-rw-r--r--src/lib/edje/edje_textblock.c26
-rw-r--r--src/lib/edje/edje_textblock_styles.c4
-rw-r--r--src/lib/edje/edje_util.c17
-rw-r--r--src/lib/edje/efl_canvas_layout.eo10
-rw-r--r--src/lib/edje/efl_canvas_layout_part.eo13
-rw-r--r--src/lib/edje/efl_canvas_layout_part_invalid.eo2
-rw-r--r--src/lib/edje/efl_canvas_layout_part_type_provider.eo20
-rw-r--r--src/lib/edje/efl_canvas_layout_types.eot3
-rw-r--r--src/lib/edje/efl_layout_group.eo2
-rw-r--r--src/lib/edje/meson.build1
-rw-r--r--src/lib/eet/Eet.h2
-rw-r--r--src/lib/eeze/Eeze.h4
-rw-r--r--src/lib/efl/Efl.h95
-rw-r--r--src/lib/efl/interfaces/efl_config.eo3
-rw-r--r--src/lib/efl/interfaces/efl_gfx_hint.eo2
-rw-r--r--src/lib/efl/interfaces/efl_gfx_path.c3
-rw-r--r--src/lib/efl/interfaces/efl_gfx_types.eot28
-rw-r--r--src/lib/efl/interfaces/efl_input_text.eo47
-rw-r--r--src/lib/efl/interfaces/efl_model.eo12
-rw-r--r--src/lib/efl/interfaces/efl_player.eo39
-rw-r--r--src/lib/efl/interfaces/efl_text_font_properties.eo27
-rw-r--r--src/lib/efl/interfaces/efl_text_format.eo15
-rw-r--r--src/lib/efl/interfaces/efl_text_markup.eo3
-rw-r--r--src/lib/efl/interfaces/efl_text_style.eo34
-rw-r--r--src/lib/efl/interfaces/efl_text_types.eot13
-rw-r--r--src/lib/efl/interfaces/efl_types.eot4
-rw-r--r--src/lib/efl/interfaces/efl_ui_draggable.eo12
-rw-r--r--src/lib/efl_canvas_wl/Efl_Canvas_Wl.h61
-rw-r--r--src/lib/efl_canvas_wl/copiedfromweston.x (renamed from src/lib/efl_wl/copiedfromweston.x)0
-rw-r--r--src/lib/efl_canvas_wl/dmabuf.c (renamed from src/lib/efl_wl/dmabuf.c)0
-rw-r--r--src/lib/efl_canvas_wl/dmabuf.h (renamed from src/lib/efl_wl/dmabuf.h)0
-rw-r--r--src/lib/efl_canvas_wl/efl_canvas_wl.c (renamed from src/lib/efl_wl/efl_wl.c)684
-rw-r--r--src/lib/efl_canvas_wl/efl_canvas_wl.eo183
-rw-r--r--src/lib/efl_canvas_wl/efl_canvas_wl_surface.eo68
-rw-r--r--src/lib/efl_canvas_wl/meson.build60
-rw-r--r--src/lib/efl_canvas_wl/x11.x (renamed from src/lib/efl_wl/x11.x)0
-rw-r--r--src/lib/efl_mono/efl_custom_exports_mono.c25
-rw-r--r--src/lib/efl_wl/Efl_Wl.h229
-rw-r--r--src/lib/efl_wl/meson.build32
-rw-r--r--src/lib/efreet/Efreet.h2
-rw-r--r--src/lib/eina/Eina.h7
-rw-r--r--src/lib/eina/eina_abstract_content.c458
-rw-r--r--src/lib/eina/eina_abstract_content.h154
-rw-r--r--src/lib/eina/eina_accessor.h4
-rw-r--r--src/lib/eina/eina_debug.h4
-rw-r--r--src/lib/eina/eina_error.h11
-rw-r--r--src/lib/eina/eina_file.c2
-rw-r--r--src/lib/eina/eina_file_common.c6
-rw-r--r--src/lib/eina/eina_freeq.c221
-rw-r--r--src/lib/eina/eina_freeq.h2
-rw-r--r--src/lib/eina/eina_hamster.h13
-rw-r--r--src/lib/eina/eina_hash.h2
-rw-r--r--src/lib/eina/eina_inarray.c2
-rw-r--r--src/lib/eina/eina_inline_array.x1
-rw-r--r--src/lib/eina/eina_inline_mempool.x4
-rw-r--r--src/lib/eina/eina_inline_value.x5
-rw-r--r--src/lib/eina/eina_iterator.c59
-rw-r--r--src/lib/eina/eina_iterator.h22
-rw-r--r--src/lib/eina/eina_list.h4
-rw-r--r--src/lib/eina/eina_lock.h4
-rw-r--r--src/lib/eina/eina_log.c2
-rw-r--r--src/lib/eina/eina_main.c2
-rw-r--r--src/lib/eina/eina_main.h9
-rw-r--r--src/lib/eina/eina_matrix.c206
-rw-r--r--src/lib/eina/eina_matrix.h77
-rw-r--r--src/lib/eina/eina_promise.c74
-rw-r--r--src/lib/eina/eina_promise.h534
-rw-r--r--src/lib/eina/eina_quad.h1
-rw-r--r--src/lib/eina/eina_quadtree.h12
-rw-r--r--src/lib/eina/eina_rbtree.c10
-rw-r--r--src/lib/eina/eina_rectangle.h11
-rw-r--r--src/lib/eina/eina_safety_checks.h10
-rw-r--r--src/lib/eina/eina_slice.h26
-rw-r--r--src/lib/eina/eina_types.h77
-rw-r--r--src/lib/eina/eina_ustrbuf.h2
-rw-r--r--src/lib/eina/eina_value.c7
-rw-r--r--src/lib/eina/eina_value.h14
-rw-r--r--src/lib/eina/eina_vector.h48
-rw-r--r--src/lib/eina/meson.build5
-rw-r--r--src/lib/eio/Eio_Legacy.h4
-rw-r--r--src/lib/eio/efl_io_manager.eo4
-rw-r--r--src/lib/eldbus/Eldbus.h2
-rw-r--r--src/lib/eldbus/eldbus_service.c5
-rw-r--r--src/lib/elementary/Efl_Ui.h5
-rw-r--r--src/lib/elementary/Elementary.h3
-rw-r--r--src/lib/elementary/efl_access_object.h2
-rw-r--r--src/lib/elementary/efl_text_interactive.eo3
-rw-r--r--src/lib/elementary/efl_ui.eot9
-rw-r--r--src/lib/elementary/efl_ui_calendar_private.h15
-rw-r--r--src/lib/elementary/efl_ui_clock.h2
-rw-r--r--src/lib/elementary/efl_ui_dnd.c870
-rw-r--r--src/lib/elementary/efl_ui_dnd.eo120
-rw-r--r--src/lib/elementary/efl_ui_dnd_container.eo46
-rw-r--r--src/lib/elementary/efl_ui_dnd_types.eot60
-rw-r--r--src/lib/elementary/efl_ui_exact_model.c21
-rw-r--r--src/lib/elementary/efl_ui_focus_manager.c8
-rw-r--r--src/lib/elementary/efl_ui_focus_manager.eo8
-rw-r--r--src/lib/elementary/efl_ui_focus_manager_calc.c105
-rw-r--r--src/lib/elementary/efl_ui_focus_manager_calc.eo19
-rw-r--r--src/lib/elementary/efl_ui_image.c96
-rw-r--r--src/lib/elementary/efl_ui_image.eo4
-rw-r--r--src/lib/elementary/efl_ui_image_zoomable.c103
-rw-r--r--src/lib/elementary/efl_ui_image_zoomable.eo5
-rw-r--r--src/lib/elementary/efl_ui_image_zoomable_private.h2
-rw-r--r--src/lib/elementary/efl_ui_internal_text_interactive.c48
-rw-r--r--src/lib/elementary/efl_ui_layout.c33
-rw-r--r--src/lib/elementary/efl_ui_pager.eo2
-rw-r--r--src/lib/elementary/efl_ui_panel.c21
-rw-r--r--src/lib/elementary/efl_ui_panel_private.h15
-rw-r--r--src/lib/elementary/efl_ui_panes.c4
-rw-r--r--src/lib/elementary/efl_ui_panes.eo4
-rw-r--r--src/lib/elementary/efl_ui_position_manager_list.c1
-rw-r--r--src/lib/elementary/efl_ui_progressbar.c7
-rw-r--r--src/lib/elementary/efl_ui_progressbar.eo5
-rw-r--r--src/lib/elementary/efl_ui_selection.c297
-rw-r--r--src/lib/elementary/efl_ui_selection.eo120
-rw-r--r--src/lib/elementary/efl_ui_selection_manager.c5678
-rw-r--r--src/lib/elementary/efl_ui_selection_manager.eo139
-rw-r--r--src/lib/elementary/efl_ui_selection_types.eot60
-rw-r--r--src/lib/elementary/efl_ui_slider.c44
-rw-r--r--src/lib/elementary/efl_ui_slider.eo4
-rw-r--r--src/lib/elementary/efl_ui_slider_interval.c43
-rw-r--r--src/lib/elementary/efl_ui_slider_interval.eo5
-rw-r--r--src/lib/elementary/efl_ui_spin.c1
-rw-r--r--src/lib/elementary/efl_ui_spin.eo2
-rw-r--r--src/lib/elementary/efl_ui_spin_button.c39
-rw-r--r--src/lib/elementary/efl_ui_spin_button.eo3
-rw-r--r--src/lib/elementary/efl_ui_spotlight_animation_manager.c268
-rw-r--r--src/lib/elementary/efl_ui_spotlight_animation_manager.eo75
-rw-r--r--src/lib/elementary/efl_ui_spotlight_container.c24
-rw-r--r--src/lib/elementary/efl_ui_spotlight_container.eo2
-rw-r--r--src/lib/elementary/efl_ui_spotlight_fade_manager.c213
-rw-r--r--src/lib/elementary/efl_ui_spotlight_fade_manager.eo10
-rw-r--r--src/lib/elementary/efl_ui_spotlight_icon_indicator.c2
-rw-r--r--src/lib/elementary/efl_ui_spotlight_manager.eo8
-rw-r--r--src/lib/elementary/efl_ui_spotlight_plain_manager.c2
-rw-r--r--src/lib/elementary/efl_ui_spotlight_scroll_manager.c23
-rw-r--r--src/lib/elementary/efl_ui_stack.eo1
-rw-r--r--src/lib/elementary/efl_ui_tab_pager.c140
-rw-r--r--src/lib/elementary/efl_ui_tab_pager.eo24
-rw-r--r--src/lib/elementary/efl_ui_tab_pager_private.h1
-rw-r--r--src/lib/elementary/efl_ui_tags.c2
-rw-r--r--src/lib/elementary/efl_ui_textbox.c1005
-rw-r--r--src/lib/elementary/efl_ui_textbox.eo52
-rw-r--r--src/lib/elementary/efl_ui_vg_animation.c23
-rw-r--r--src/lib/elementary/efl_ui_vg_animation.eo91
-rw-r--r--src/lib/elementary/efl_ui_vg_animation_eo.legacy.c8
-rw-r--r--src/lib/elementary/efl_ui_vg_animation_private.h2
-rw-r--r--src/lib/elementary/efl_ui_widget.c224
-rw-r--r--src/lib/elementary/efl_ui_widget_common.c13
-rw-r--r--src/lib/elementary/efl_ui_widget_image.h2
-rw-r--r--src/lib/elementary/efl_ui_widget_part.eo8
-rw-r--r--src/lib/elementary/efl_ui_widget_scrollable_content.eo2
-rw-r--r--src/lib/elementary/efl_ui_win.c313
-rw-r--r--src/lib/elementary/elc_fileselector.c15
-rw-r--r--src/lib/elementary/elc_naviframe.c4
-rw-r--r--src/lib/elementary/elementary_config.h4
-rw-r--r--src/lib/elementary/elm_atspi_bridge.c677
-rw-r--r--src/lib/elementary/elm_box.c21
-rw-r--r--src/lib/elementary/elm_calendar.c13
-rw-r--r--src/lib/elementary/elm_cnp.c245
-rw-r--r--src/lib/elementary/elm_cnp.h2
-rw-r--r--src/lib/elementary/elm_code_diff_widget.h2
-rw-r--r--src/lib/elementary/elm_code_line.h4
-rw-r--r--src/lib/elementary/elm_code_syntax.c24
-rw-r--r--src/lib/elementary/elm_code_text.h2
-rw-r--r--src/lib/elementary/elm_code_widget.c91
-rw-r--r--src/lib/elementary/elm_code_widget_private.h1
-rw-r--r--src/lib/elementary/elm_color_class.h1
-rw-r--r--src/lib/elementary/elm_config.c145
-rw-r--r--src/lib/elementary/elm_config.h114
-rw-r--r--src/lib/elementary/elm_dbus_menu.c1
-rw-r--r--src/lib/elementary/elm_diskselector.h2
-rw-r--r--src/lib/elementary/elm_dnd.c812
-rw-r--r--src/lib/elementary/elm_entry.c4
-rw-r--r--src/lib/elementary/elm_entry.h2
-rw-r--r--src/lib/elementary/elm_focus_item.h4
-rw-r--r--src/lib/elementary/elm_focus_legacy.c10
-rw-r--r--src/lib/elementary/elm_gengrid.c33
-rw-r--r--src/lib/elementary/elm_gengrid.h2
-rw-r--r--src/lib/elementary/elm_genlist.c43
-rw-r--r--src/lib/elementary/elm_genlist.h2
-rw-r--r--src/lib/elementary/elm_grid.c21
-rw-r--r--src/lib/elementary/elm_index.c12
-rw-r--r--src/lib/elementary/elm_interface_scrollable.c28
-rw-r--r--src/lib/elementary/elm_label_eo.c2
-rw-r--r--src/lib/elementary/elm_list.h2
-rw-r--r--src/lib/elementary/elm_main.c2
-rw-r--r--src/lib/elementary/elm_map.h2
-rw-r--r--src/lib/elementary/elm_panel.c21
-rw-r--r--src/lib/elementary/elm_photo.c6
-rw-r--r--src/lib/elementary/elm_photocam.h2
-rw-r--r--src/lib/elementary/elm_priv.h16
-rw-r--r--src/lib/elementary/elm_slider.c2
-rw-r--r--src/lib/elementary/elm_spinner.c1
-rw-r--r--src/lib/elementary/elm_table.c21
-rw-r--r--src/lib/elementary/elm_toolbar.h2
-rw-r--r--src/lib/elementary/elm_transit.c118
-rw-r--r--src/lib/elementary/elm_widget.h2
-rw-r--r--src/lib/elementary/els_box.c2
-rw-r--r--src/lib/elementary/els_cursor.c2
-rw-r--r--src/lib/elementary/meson.build13
-rw-r--r--src/lib/elput/Elput.h2
-rw-r--r--src/lib/elua/Elua.h8
-rw-r--r--src/lib/embryo/Embryo.h146
-rw-r--r--src/lib/emile/emile_base64.c4
-rw-r--r--src/lib/emile/emile_cipher_openssl.c1
-rw-r--r--src/lib/emotion/Emotion.h4
-rw-r--r--src/lib/emotion/emotion_main.c1
-rw-r--r--src/lib/emotion/emotion_private.h1
-rw-r--r--src/lib/emotion/emotion_webcam.c284
-rw-r--r--src/lib/eo/Eo.h10
-rw-r--r--src/lib/eo/eina_types.eot21
-rw-r--r--src/lib/eo/eo.c633
-rw-r--r--src/lib/eo/eo_base_class.c3
-rw-r--r--src/lib/eo/eo_private.h32
-rw-r--r--src/lib/eo/eo_ptr_indirection.c9
-rw-r--r--src/lib/eo/eo_ptr_indirection.x7
-rw-r--r--src/lib/eolian/Eolian.h7
-rw-r--r--src/lib/eolian/Eolian_Aux.h4
-rw-r--r--src/lib/eolian/database_expr.c5
-rw-r--r--src/lib/eolian/database_validate.c8
-rw-r--r--src/lib/eolian/eo_parser.c2
-rw-r--r--src/lib/eolian_cxx/grammar/context.hpp25
-rw-r--r--src/lib/eolian_cxx/grammar/eps.hpp8
-rw-r--r--src/lib/ephysics/EPhysics.h2
-rw-r--r--src/lib/ethumb/Ethumb.h2
-rw-r--r--src/lib/evas/Efl_Canvas.h10
-rw-r--r--src/lib/evas/Evas.h2
-rw-r--r--src/lib/evas/Evas_Common.h123
-rw-r--r--src/lib/evas/Evas_Eo.h335
-rw-r--r--src/lib/evas/Evas_GL.h4
-rw-r--r--src/lib/evas/Evas_Legacy.h985
-rw-r--r--src/lib/evas/cache/evas_cache.h2
-rw-r--r--src/lib/evas/cache/evas_cache_engine_image.c69
-rw-r--r--src/lib/evas/cache/evas_cache_image.c168
-rw-r--r--src/lib/evas/canvas/efl_canvas_image.c60
-rw-r--r--src/lib/evas/canvas/efl_canvas_image.eo2
-rw-r--r--src/lib/evas/canvas/efl_canvas_object.eo6
-rw-r--r--src/lib/evas/canvas/efl_canvas_scene3d.c310
-rw-r--r--src/lib/evas/canvas/efl_canvas_scene3d.eo20
-rw-r--r--src/lib/evas/canvas/efl_canvas_textblock.eo69
-rw-r--r--src/lib/evas/canvas/efl_canvas_vg_container.c4
-rw-r--r--src/lib/evas/canvas/efl_canvas_vg_container_eo.legacy.c6
-rw-r--r--src/lib/evas/canvas/efl_canvas_vg_container_eo.legacy.h32
-rw-r--r--src/lib/evas/canvas/efl_canvas_vg_gradient.c14
-rw-r--r--src/lib/evas/canvas/efl_canvas_vg_gradient_eo.legacy.h21
-rw-r--r--src/lib/evas/canvas/efl_canvas_vg_gradient_linear.c12
-rw-r--r--src/lib/evas/canvas/efl_canvas_vg_gradient_radial.c16
-rw-r--r--src/lib/evas/canvas/efl_canvas_vg_image.c1
-rw-r--r--src/lib/evas/canvas/efl_canvas_vg_node.c20
-rw-r--r--src/lib/evas/canvas/efl_canvas_vg_node_eo.legacy.c10
-rw-r--r--src/lib/evas/canvas/efl_canvas_vg_node_eo.legacy.h31
-rw-r--r--src/lib/evas/canvas/efl_canvas_vg_object.c35
-rw-r--r--src/lib/evas/canvas/efl_canvas_vg_object_eo.legacy.c12
-rw-r--r--src/lib/evas/canvas/efl_canvas_vg_object_eo.legacy.h29
-rw-r--r--src/lib/evas/canvas/efl_canvas_vg_shape.c84
-rw-r--r--src/lib/evas/canvas/efl_canvas_vg_shape_eo.legacy.h54
-rw-r--r--src/lib/evas/canvas/efl_gfx_mapping.c1
-rw-r--r--src/lib/evas/canvas/efl_gfx_vg_value_provider.c8
-rw-r--r--src/lib/evas/canvas/efl_gfx_vg_value_provider.eo2
-rw-r--r--src/lib/evas/canvas/efl_gfx_vg_value_provider.h2
-rw-r--r--src/lib/evas/canvas/efl_input_types.eot17
-rw-r--r--src/lib/evas/canvas/efl_text_cursor.eo21
-rw-r--r--src/lib/evas/canvas/efl_text_formatter.eo7
-rw-r--r--src/lib/evas/canvas/evas_canvas3d_camera.c203
-rw-r--r--src/lib/evas/canvas/evas_canvas3d_camera.eo89
-rw-r--r--src/lib/evas/canvas/evas_canvas3d_eet.c211
-rw-r--r--src/lib/evas/canvas/evas_canvas3d_light.c309
-rw-r--r--src/lib/evas/canvas/evas_canvas3d_light.eo249
-rw-r--r--src/lib/evas/canvas/evas_canvas3d_material.c206
-rw-r--r--src/lib/evas/canvas/evas_canvas3d_material.eo116
-rw-r--r--src/lib/evas/canvas/evas_canvas3d_mesh.c1172
-rw-r--r--src/lib/evas/canvas/evas_canvas3d_mesh.eo421
-rw-r--r--src/lib/evas/canvas/evas_canvas3d_node.c1695
-rw-r--r--src/lib/evas/canvas/evas_canvas3d_node.eo368
-rw-r--r--src/lib/evas/canvas/evas_canvas3d_node_callback.h36
-rw-r--r--src/lib/evas/canvas/evas_canvas3d_object.c101
-rw-r--r--src/lib/evas/canvas/evas_canvas3d_object.eo77
-rw-r--r--src/lib/evas/canvas/evas_canvas3d_primitive.c152
-rw-r--r--src/lib/evas/canvas/evas_canvas3d_primitive.eo130
-rw-r--r--src/lib/evas/canvas/evas_canvas3d_scene.c839
-rw-r--r--src/lib/evas/canvas/evas_canvas3d_scene.eo168
-rw-r--r--src/lib/evas/canvas/evas_canvas3d_texture.c606
-rw-r--r--src/lib/evas/canvas/evas_canvas3d_texture.eo159
-rw-r--r--src/lib/evas/canvas/evas_canvas3d_types.eot293
-rw-r--r--src/lib/evas/canvas/evas_canvas_eo.h2
-rw-r--r--src/lib/evas/canvas/evas_canvas_eo.legacy.h15
-rw-r--r--src/lib/evas/canvas/evas_events.c44
-rw-r--r--src/lib/evas/canvas/evas_events_legacy.c9
-rw-r--r--src/lib/evas/canvas/evas_grid_eo.c2
-rw-r--r--src/lib/evas/canvas/evas_image_eo.c2
-rw-r--r--src/lib/evas/canvas/evas_image_legacy.c35
-rw-r--r--src/lib/evas/canvas/evas_image_private.h8
-rw-r--r--src/lib/evas/canvas/evas_main.c25
-rw-r--r--src/lib/evas/canvas/evas_object_box.c4
-rw-r--r--src/lib/evas/canvas/evas_object_grid.c23
-rw-r--r--src/lib/evas/canvas/evas_object_image.c53
-rw-r--r--src/lib/evas/canvas/evas_object_intercept.c25
-rw-r--r--src/lib/evas/canvas/evas_object_main.c43
-rw-r--r--src/lib/evas/canvas/evas_object_smart.c4
-rw-r--r--src/lib/evas/canvas/evas_object_text.c2
-rw-r--r--src/lib/evas/canvas/evas_object_textblock.c1181
-rw-r--r--src/lib/evas/canvas/evas_render.c102
-rw-r--r--src/lib/evas/canvas/evas_table_eo.c2
-rw-r--r--src/lib/evas/canvas/evas_textblock_legacy.h6
-rw-r--r--src/lib/evas/canvas/evas_vg_private.h1
-rw-r--r--src/lib/evas/canvas/meson.build24
-rw-r--r--src/lib/evas/common/evas_convert_gry_8.c4
-rw-r--r--src/lib/evas/common/evas_font_draw.c2
-rw-r--r--src/lib/evas/common/evas_image.h1
-rw-r--r--src/lib/evas/common/evas_image_main.c12
-rw-r--r--src/lib/evas/common3d/meson.build2
-rw-r--r--src/lib/evas/common3d/primitives/meson.build5
-rw-r--r--src/lib/evas/common3d/primitives/primitive_common.c203
-rw-r--r--src/lib/evas/common3d/primitives/primitive_common.h62
-rw-r--r--src/lib/evas/common3d/primitives/solids_of_revolution/cone.c140
-rw-r--r--src/lib/evas/common3d/primitives/solids_of_revolution/cylinder.c136
-rw-r--r--src/lib/evas/common3d/primitives/solids_of_revolution/meson.build6
-rw-r--r--src/lib/evas/common3d/primitives/solids_of_revolution/sphere.c189
-rw-r--r--src/lib/evas/common3d/primitives/solids_of_revolution/torus.c67
-rw-r--r--src/lib/evas/common3d/primitives/surfaces/meson.build4
-rw-r--r--src/lib/evas/common3d/primitives/surfaces/surface.c91
-rw-r--r--src/lib/evas/common3d/primitives/surfaces/terrain.c86
-rw-r--r--src/lib/evas/common3d/primitives/tabulated_primitives/cube.c57
-rw-r--r--src/lib/evas/common3d/primitives/tabulated_primitives/meson.build4
-rw-r--r--src/lib/evas/common3d/primitives/tabulated_primitives/square.c18
-rw-r--r--src/lib/evas/common3d/save_load/evas_model_load.c82
-rw-r--r--src/lib/evas/common3d/save_load/evas_model_load_save_common.c230
-rw-r--r--src/lib/evas/common3d/save_load/evas_model_load_save_common.h62
-rw-r--r--src/lib/evas/common3d/save_load/evas_model_save.c34
-rw-r--r--src/lib/evas/common3d/save_load/meson.build6
-rw-r--r--src/lib/evas/filters/evas_filter.c2
-rw-r--r--src/lib/evas/filters/evas_filter_parser.c46
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture.c23
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture.eo17
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_custom.c25
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_custom.eo32
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_double_tap.c13
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_double_tap.eo3
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_events.eo13
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_flick.c13
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_flick.eo3
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_long_press.c5
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_long_press.eo11
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_long_tap.c23
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_long_tap.eo15
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_manager.c592
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_manager.eo25
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_momentum.c13
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_momentum.eo3
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_private.h111
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_recognizer.c139
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_recognizer.eo37
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_recognizer_custom.c37
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_recognizer_custom.eo28
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_recognizer_double_tap.c175
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_recognizer_double_tap.eo14
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_recognizer_flick.c289
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_recognizer_flick.eo2
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_recognizer_long_press.c143
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_recognizer_long_press.eo13
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_recognizer_long_tap.c176
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_recognizer_long_tap.eo26
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_recognizer_momentum.c273
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_recognizer_momentum.eo2
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_recognizer_rotate.c269
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_recognizer_rotate.eo12
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_recognizer_tap.c92
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_recognizer_tap.eo2
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_recognizer_triple_tap.c174
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_recognizer_triple_tap.eo14
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_recognizer_zoom.c255
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_recognizer_zoom.eo2
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_rotate.c17
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_rotate.eo28
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_tap.c13
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_tap.eo3
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_touch.c110
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_touch.eo35
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_triple_tap.c13
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_triple_tap.eo3
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_types.eot51
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_zoom.c18
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_zoom.eo4
-rw-r--r--src/lib/evas/gesture/meson.build16
-rw-r--r--src/lib/evas/include/evas_3d_utils.h1698
-rw-r--r--src/lib/evas/include/evas_common_private.h3
-rw-r--r--src/lib/evas/include/evas_inline.x2
-rw-r--r--src/lib/evas/include/evas_private.h513
-rw-r--r--src/lib/evas/meson.build25
-rw-r--r--src/lib/evas/vg/evas_vg_cache.c10
-rw-r--r--src/lib/evil/evil_locale.h2
-rw-r--r--src/lib/evil/evil_main.h2
-rw-r--r--src/lib/evil/evil_mman.h2
-rw-r--r--src/lib/evil/evil_time.h4
-rw-r--r--src/lib/evil/evil_util.c28
-rw-r--r--src/lib/evil/evil_util.h18
472 files changed, 13874 insertions, 27056 deletions
diff --git a/src/lib/ecore/Ecore.h b/src/lib/ecore/Ecore.h
index 7818faf907..294fe0e5a2 100644
--- a/src/lib/ecore/Ecore.h
+++ b/src/lib/ecore/Ecore.h
@@ -6,7 +6,7 @@
6/** 6/**
7 * @page ecore_main Ecore 7 * @page ecore_main Ecore
8 * @date 2000 (created) 8 * @date 2000 (created)
9 * @section toc Table of Contents 9 * @section ecore_toc Table of Contents
10 * @li @ref ecore_main_intro 10 * @li @ref ecore_main_intro
11 * @li @ref ecore_main_compiling 11 * @li @ref ecore_main_compiling
12 * @li @ref ecore_main_next_steps 12 * @li @ref ecore_main_next_steps
@@ -45,15 +45,16 @@
45 * this is very simple. You simply have to compile your application 45 * this is very simple. You simply have to compile your application
46 * with the appropriate compiler flags that the @p pkg-config script 46 * with the appropriate compiler flags that the @p pkg-config script
47 * outputs. Note that each module is separate in pkg-config. For 47 * outputs. Note that each module is separate in pkg-config. For
48 * example using @ref Ecore_Evas_Group: 48 * example using @c Ecore_Evas:
49 *
49 * Compiling C or C++ files into object files: 50 * Compiling C or C++ files into object files:
50 * @verbatim 51 * @code
51 * gcc -c -o main.o main.c `pkg-config --cflags ecore ecore-evas` 52 * gcc -c -o main.o main.c `pkg-config --cflags ecore ecore-evas`
52 * @endverbatim 53 * @endcode
53 * Linking object files into a binary executable: 54 * Linking object files into a binary executable:
54 * @verbatim 55 * @code
55 * gcc -o my_application main.o `pkg-config --libs ecore ecore-evas` 56 * gcc -o my_application main.o `pkg-config --libs ecore ecore-evas`
56 * @endverbatim 57 * @endcode
57 * See @ref pkgconfig 58 * See @ref pkgconfig
58 * 59 *
59 * @section ecore_main_next_steps Next Steps 60 * @section ecore_main_next_steps Next Steps
diff --git a/src/lib/ecore/Ecore_Common.h b/src/lib/ecore/Ecore_Common.h
index 443a05880c..4ee0dd768b 100644
--- a/src/lib/ecore/Ecore_Common.h
+++ b/src/lib/ecore/Ecore_Common.h
@@ -2732,16 +2732,12 @@ EAPI double ecore_throttle_get(void);
2732 * @{ 2732 * @{
2733 */ 2733 */
2734 2734
2735/** 2735/** Defines the timing sources for animators. */
2736 * @enum _Ecore_Animator_Source 2736typedef enum
2737 * Defines the timing sources for animators.
2738 */
2739enum _Ecore_Animator_Source /* Timing sources for animators */
2740{ 2737{
2741 ECORE_ANIMATOR_SOURCE_TIMER, /**< The default system clock/timer based animator that ticks every "frametime" seconds */ 2738 ECORE_ANIMATOR_SOURCE_TIMER, /**< The default system clock/timer based animator that ticks every "frametime" seconds */
2742 ECORE_ANIMATOR_SOURCE_CUSTOM /**< A custom animator trigger that you need to call ecore_animator_custom_tick() to make it tick */ 2739 ECORE_ANIMATOR_SOURCE_CUSTOM /**< A custom animator trigger that you need to call ecore_animator_custom_tick() to make it tick */
2743}; 2740} Ecore_Animator_Source;
2744typedef enum _Ecore_Animator_Source Ecore_Animator_Source;
2745 2741
2746/** 2742/**
2747 * @typedef Ecore_Timeline_Cb Ecore_Timeline_Cb 2743 * @typedef Ecore_Timeline_Cb Ecore_Timeline_Cb
@@ -2798,7 +2794,7 @@ typedef enum
2798 * @warning Too small a value may cause performance issues and too high a 2794 * @warning Too small a value may cause performance issues and too high a
2799 * value may cause your animation to seem "jerky". 2795 * value may cause your animation to seem "jerky".
2800 * 2796 *
2801 * @note The default @p frametime value is 1/30th of a second. 2797 * @note The default @p frametime value is 1/60th of a second.
2802 */ 2798 */
2803EAPI void ecore_animator_frametime_set(double frametime); 2799EAPI void ecore_animator_frametime_set(double frametime);
2804 2800
@@ -2950,7 +2946,7 @@ EAPI double ecore_animator_pos_map_n(double pos, Ecore_Pos_Map map, int v_size,
2950 * on the animator source. The default source is the system clock timer 2946 * on the animator source. The default source is the system clock timer
2951 * source - ECORE_ANIMATOR_SOURCE_TIMER. This source uses the system clock 2947 * source - ECORE_ANIMATOR_SOURCE_TIMER. This source uses the system clock
2952 * to tick over every N seconds (specified by ecore_animator_frametime_set(), 2948 * to tick over every N seconds (specified by ecore_animator_frametime_set(),
2953 * with the default being 1/30th of a second unless set otherwise). You can 2949 * with the default being 1/60th of a second unless set otherwise). You can
2954 * set a custom tick source by setting the source to 2950 * set a custom tick source by setting the source to
2955 * ECORE_ANIMATOR_SOURCE_CUSTOM and then drive it yourself based on some input 2951 * ECORE_ANIMATOR_SOURCE_CUSTOM and then drive it yourself based on some input
2956 * tick source (like another application via ipc, some vertical blanking 2952 * tick source (like another application via ipc, some vertical blanking
diff --git a/src/lib/ecore/Ecore_Legacy.h b/src/lib/ecore/Ecore_Legacy.h
index 9c951f5a93..d39ecb66f1 100644
--- a/src/lib/ecore/Ecore_Legacy.h
+++ b/src/lib/ecore/Ecore_Legacy.h
@@ -100,6 +100,10 @@ EAPI int ecore_poller_poller_interval_get(const Ecore_Poller *obj);
100 * @{ 100 * @{
101 */ 101 */
102 102
103/**
104 * @struct Ecore_Animator
105 * Opaque handle to manage Ecore Animator objects.
106 */
103typedef struct _Ecore_Animator Ecore_Animator; 107typedef struct _Ecore_Animator Ecore_Animator;
104 108
105/** 109/**
diff --git a/src/lib/ecore/ecore_exe_eo.h b/src/lib/ecore/ecore_exe_eo.h
index fa8ecb026a..70b2c12ee0 100644
--- a/src/lib/ecore/ecore_exe_eo.h
+++ b/src/lib/ecore/ecore_exe_eo.h
@@ -4,6 +4,10 @@
4#ifndef _ECORE_EXE_EO_CLASS_TYPE 4#ifndef _ECORE_EXE_EO_CLASS_TYPE
5#define _ECORE_EXE_EO_CLASS_TYPE 5#define _ECORE_EXE_EO_CLASS_TYPE
6 6
7/**
8 * @struct Ecore_Exe
9 * Opaque handle to manage Ecore Exe objects.
10 */
7typedef Eo Ecore_Exe; 11typedef Eo Ecore_Exe;
8 12
9#endif 13#endif
diff --git a/src/lib/ecore/ecore_internal.h b/src/lib/ecore/ecore_internal.h
index 32a9472188..9f6e55eb24 100644
--- a/src/lib/ecore/ecore_internal.h
+++ b/src/lib/ecore/ecore_internal.h
@@ -129,6 +129,39 @@ _efl_composite_lookup(const Efl_Class *self, Eo *parent, Efl_Model *view, unsign
129 EFL_COMPOSITE_REMEMBER_RETURN(remember, view); 129 EFL_COMPOSITE_REMEMBER_RETURN(remember, view);
130} 130}
131 131
132/* Result from eina_future_all_* is an EINA_VALUE_TYPE_ARRAY that contain Eina_Value of
133 Eo Model. It is expected that children slice get return an EINA_VALUE_TYPE_ARRAY that
134 contain Eo Model directly.
135*/
136static inline Eina_Value
137_efl_future_all_repack(Eo *o EINA_UNUSED, void *data EINA_UNUSED, const Eina_Value v)
138{
139 unsigned int i, len;
140 Eina_Value created = EINA_VALUE_EMPTY;
141 Eina_Value r = EINA_VALUE_EMPTY;
142
143 eina_value_array_setup(&r, EINA_VALUE_TYPE_OBJECT, 4);
144
145 EINA_VALUE_ARRAY_FOREACH(&v, len, i, created)
146 {
147 Eo *target = NULL;
148
149 if (eina_value_type_get(&created) != EINA_VALUE_TYPE_OBJECT)
150 goto on_error;
151
152 target = eina_value_object_get(&created);
153 if (!target) goto on_error;
154
155 eina_value_array_append(&r, target);
156 }
157
158 return r;
159
160 on_error:
161 eina_value_flush(&r);
162 return eina_value_error_init(EFL_MODEL_ERROR_UNKNOWN);
163}
164
132#undef EAPI 165#undef EAPI
133#define EAPI 166#define EAPI
134 167
diff --git a/src/lib/ecore/ecore_main.c b/src/lib/ecore/ecore_main.c
index 7e84d9d231..fc35331f3f 100644
--- a/src/lib/ecore/ecore_main.c
+++ b/src/lib/ecore/ecore_main.c
@@ -316,6 +316,16 @@ _gfd_events_from_fdh(Ecore_Fd_Handler *fdh)
316} 316}
317#endif 317#endif
318 318
319
320static void
321_ecore_main_pre_idle_exit(void)
322{
323 // even if we never go idle, keep up flushing some of our freeq away
324 // on every idle exit which may happen if we even never called idlers
325 // for now an idea but dont enforce
326// eina_freeq_reduce(eina_freeq_main_get(), 128);
327}
328
319#ifdef HAVE_LIBUV 329#ifdef HAVE_LIBUV
320static void 330static void
321_ecore_main_uv_poll_cb(uv_poll_t *handle, int status, int events) 331_ecore_main_uv_poll_cb(uv_poll_t *handle, int status, int events)
@@ -332,6 +342,7 @@ _ecore_main_uv_poll_cb(uv_poll_t *handle, int status, int events)
332 DBG("not IDLE anymore"); 342 DBG("not IDLE anymore");
333 _ecore_main_uv_idling = EINA_FALSE; 343 _ecore_main_uv_idling = EINA_FALSE;
334 eina_file_statgen_next(); 344 eina_file_statgen_next();
345 _ecore_main_pre_idle_exit();
335 efl_event_callback_call(obj, EFL_LOOP_EVENT_IDLE_EXIT, NULL); 346 efl_event_callback_call(obj, EFL_LOOP_EVENT_IDLE_EXIT, NULL);
336 _ecore_animator_run_reset(); 347 _ecore_animator_run_reset();
337 } 348 }
@@ -532,11 +543,7 @@ _ecore_main_idler_all_call(Eo *loop, Efl_Loop_Data *pd)
532{ 543{
533 if (pd->idlers) 544 if (pd->idlers)
534 efl_event_callback_call(loop, EFL_LOOP_EVENT_IDLE, NULL); 545 efl_event_callback_call(loop, EFL_LOOP_EVENT_IDLE, NULL);
535 // just spin in an idler until the free queue is empty freeing 84 items 546 eina_freeq_reduce(eina_freeq_main_get(), 256);
536 // from the free queue each time.for now this seems like an ok balance
537 // between going in and out of a reduce func with mutexes around it
538 // vs blocking mainloop for too long. this number is up for discussion
539 eina_freeq_reduce(eina_freeq_main_get(), 84);
540} 547}
541 548
542#ifdef HAVE_SYS_EPOLL_H 549#ifdef HAVE_SYS_EPOLL_H
@@ -797,6 +804,7 @@ _ecore_main_gsource_dispatch(GSource *source EINA_UNUSED,
797 { 804 {
798 _ecore_animator_run_reset(); 805 _ecore_animator_run_reset();
799 eina_file_statgen_next(); 806 eina_file_statgen_next();
807 _ecore_main_pre_idle_exit();
800 efl_event_callback_call(obj, EFL_LOOP_EVENT_IDLE_EXIT, NULL); 808 efl_event_callback_call(obj, EFL_LOOP_EVENT_IDLE_EXIT, NULL);
801 ecore_idling = 0; 809 ecore_idling = 0;
802 } 810 }
@@ -812,6 +820,7 @@ _ecore_main_gsource_dispatch(GSource *source EINA_UNUSED,
812 { 820 {
813 _ecore_animator_run_reset(); 821 _ecore_animator_run_reset();
814 eina_file_statgen_next(); 822 eina_file_statgen_next();
823 _ecore_main_pre_idle_exit();
815 efl_event_callback_call(obj, EFL_LOOP_EVENT_IDLE_EXIT, NULL); 824 efl_event_callback_call(obj, EFL_LOOP_EVENT_IDLE_EXIT, NULL);
816 ecore_idling = 0; 825 ecore_idling = 0;
817 } 826 }
@@ -872,6 +881,7 @@ _ecore_main_loop_timer_run(uv_timer_t *timer EINA_UNUSED)
872 { 881 {
873 _ecore_main_uv_idling = EINA_FALSE; 882 _ecore_main_uv_idling = EINA_FALSE;
874 eina_file_statgen_next(); 883 eina_file_statgen_next();
884 _ecore_main_pre_idle_exit();
875 efl_event_callback_call(obj, EFL_LOOP_EVENT_IDLE_EXIT, NULL); 885 efl_event_callback_call(obj, EFL_LOOP_EVENT_IDLE_EXIT, NULL);
876 _ecore_animator_run_reset(); 886 _ecore_animator_run_reset();
877 } 887 }
@@ -2250,6 +2260,7 @@ _ecore_main_loop_uv_prepare(uv_prepare_t *handle EINA_UNUSED)
2250 if (_ecore_main_uv_idling) 2260 if (_ecore_main_uv_idling)
2251 { 2261 {
2252 eina_file_statgen_next(); 2262 eina_file_statgen_next();
2263 _ecore_main_pre_idle_exit();
2253 efl_event_callback_call(obj, EFL_LOOP_EVENT_IDLE_EXIT, NULL); 2264 efl_event_callback_call(obj, EFL_LOOP_EVENT_IDLE_EXIT, NULL);
2254 _ecore_animator_run_reset(); 2265 _ecore_animator_run_reset();
2255 _ecore_main_uv_idling = EINA_FALSE; 2266 _ecore_main_uv_idling = EINA_FALSE;
@@ -2481,6 +2492,7 @@ process_all: //-*********************************************************
2481 { 2492 {
2482 _ecore_animator_run_reset(); // XXX: 2493 _ecore_animator_run_reset(); // XXX:
2483 eina_file_statgen_next(); 2494 eina_file_statgen_next();
2495 _ecore_main_pre_idle_exit();
2484 efl_event_callback_call(obj, EFL_LOOP_EVENT_IDLE_EXIT, NULL); 2496 efl_event_callback_call(obj, EFL_LOOP_EVENT_IDLE_EXIT, NULL);
2485 } 2497 }
2486 // call the fd handler per fd that became alive... 2498 // call the fd handler per fd that became alive...
diff --git a/src/lib/ecore/efl_core_proc_env.c b/src/lib/ecore/efl_core_proc_env.c
index a4ee9d75f9..3b21015048 100644
--- a/src/lib/ecore/efl_core_proc_env.c
+++ b/src/lib/ecore/efl_core_proc_env.c
@@ -68,6 +68,12 @@ _sync(Efl_Core_Env *obj, Efl_Core_Proc_Env_Data *pd)
68 break; 68 break;
69 } 69 }
70 } 70 }
71
72 if (values)
73 {
74 free(values[0]);
75 free(values);
76 }
71 } 77 }
72 } 78 }
73 EINA_LIST_FOREACH(existing_keys, n, key) 79 EINA_LIST_FOREACH(existing_keys, n, key)
diff --git a/src/lib/ecore/efl_exe.c b/src/lib/ecore/efl_exe.c
index b2c6341523..c5a2f57343 100644
--- a/src/lib/ecore/efl_exe.c
+++ b/src/lib/ecore/efl_exe.c
@@ -69,6 +69,7 @@ struct _Efl_Exe_Data
69 } fd; 69 } fd;
70#endif 70#endif
71 Eina_Bool exit_called : 1; 71 Eina_Bool exit_called : 1;
72 Eina_Bool exit_signalled : 1;
72 Eina_Bool run : 1; 73 Eina_Bool run : 1;
73}; 74};
74 75
@@ -269,10 +270,10 @@ _efl_exe_signal(Eo *obj EINA_UNUSED, Efl_Exe_Data *pd, Efl_Exe_Signal sig)
269 270
270 switch (sig) 271 switch (sig)
271 { 272 {
272 case EFL_EXE_SIGNAL_INT: s = SIGINT; break; 273 case EFL_EXE_SIGNAL_INT: s = SIGINT; pd->exit_signalled = EINA_TRUE; break;
273 case EFL_EXE_SIGNAL_QUIT: s = SIGQUIT; break; 274 case EFL_EXE_SIGNAL_QUIT: s = SIGQUIT; pd->exit_signalled = EINA_TRUE; break;
274 case EFL_EXE_SIGNAL_TERM: s = SIGTERM; break; 275 case EFL_EXE_SIGNAL_TERM: s = SIGTERM; pd->exit_signalled = EINA_TRUE; break;
275 case EFL_EXE_SIGNAL_KILL: s = SIGKILL; break; 276 case EFL_EXE_SIGNAL_KILL: s = SIGKILL; pd->exit_signalled = EINA_TRUE; break;
276 case EFL_EXE_SIGNAL_CONT: s = SIGCONT; break; 277 case EFL_EXE_SIGNAL_CONT: s = SIGCONT; break;
277 case EFL_EXE_SIGNAL_STOP: s = SIGSTOP; break; 278 case EFL_EXE_SIGNAL_STOP: s = SIGSTOP; break;
278 case EFL_EXE_SIGNAL_HUP: s = SIGHUP; break; 279 case EFL_EXE_SIGNAL_HUP: s = SIGHUP; break;
@@ -552,7 +553,18 @@ _efl_exe_efl_task_run(Eo *obj, Efl_Exe_Data *pd)
552 int except[2] = { 0, -1 }; 553 int except[2] = { 0, -1 };
553 except[0] = pd->fd.exited_write; 554 except[0] = pd->fd.exited_write;
554 eina_file_close_from(3, except); 555 eina_file_close_from(3, except);
555 556#ifdef HAVE_PRCTL
557 if ((pd->flags & EFL_EXE_FLAGS_TERM_WITH_PARENT))
558 {
559 prctl(PR_SET_PDEATHSIG, SIGTERM);
560 }
561#elif defined(HAVE_PROCCTL)
562 if ((pd->flags & EFL_EXE_FLAGS_TERM_WITH_PARENT))
563 {
564 int sig = SIGTERM;
565 procctl(P_PID, 0, PROC_PDEATHSIG_CTL, &sig);
566 }
567#endif
556 // actually execute! 568 // actually execute!
557 _exec(cmd, pd->flags, td->flags); 569 _exec(cmd, pd->flags, td->flags);
558 // we couldn't exec... uh oh. HAAAAAAAALP! 570 // we couldn't exec... uh oh. HAAAAAAAALP!
@@ -570,6 +582,7 @@ _efl_exe_efl_task_end(Eo *obj EINA_UNUSED, Efl_Exe_Data *pd)
570#ifdef _WIN32 582#ifdef _WIN32
571#else 583#else
572 if (pd->pid == -1) return; 584 if (pd->pid == -1) return;
585 pd->exit_signalled = EINA_TRUE;
573 kill(pd->pid, SIGINT); 586 kill(pd->pid, SIGINT);
574#endif 587#endif
575} 588}
@@ -580,6 +593,16 @@ _efl_exe_exit_signal_get(const Eo *obj EINA_UNUSED, Efl_Exe_Data *pd)
580 return pd->exit_signal; 593 return pd->exit_signal;
581} 594}
582 595
596EOLIAN static int
597_efl_exe_pid_get(const Eo *obj EINA_UNUSED, Efl_Exe_Data *pd)
598{
599#ifndef _WIN32
600 if (pd->pid != -1)
601 return pd->pid;
602#endif
603 return 0;
604}
605
583EOLIAN static Efl_Object * 606EOLIAN static Efl_Object *
584_efl_exe_efl_object_constructor(Eo *obj, Efl_Exe_Data *pd) 607_efl_exe_efl_object_constructor(Eo *obj, Efl_Exe_Data *pd)
585{ 608{
@@ -602,7 +625,7 @@ _efl_exe_efl_object_destructor(Eo *obj, Efl_Exe_Data *pd)
602{ 625{
603#ifdef _WIN32 626#ifdef _WIN32
604#else 627#else
605 if (!pd->exit_called) 628 if ((!pd->exit_called) && (!pd->exit_signalled))
606 ERR("Exe being destroyed while child has not exited yet."); 629 ERR("Exe being destroyed while child has not exited yet.");
607 if (pd->fd.exited_read >= 0) 630 if (pd->fd.exited_read >= 0)
608 { 631 {
diff --git a/src/lib/ecore/efl_exe.eo b/src/lib/ecore/efl_exe.eo
index 23b68935e4..c4cc2d7ebf 100644
--- a/src/lib/ecore/efl_exe.eo
+++ b/src/lib/ecore/efl_exe.eo
@@ -18,7 +18,8 @@ enum @beta Efl.Exe_Flags {
18 [[Flags to customize process behavior.]] 18 [[Flags to customize process behavior.]]
19 none = 0, [[No special flags.]] 19 none = 0, [[No special flags.]]
20 group_leader = 1, [[Process will be executed in its own session.]] 20 group_leader = 1, [[Process will be executed in its own session.]]
21 hide_io = 4 [[All console IO will be hidden.]] 21 hide_io = 4, [[All console IO will be hidden.]]
22 term_with_parent = 8, [[Makes child receive SIGTERM when parent dies.]]
22} 23}
23 24
24class @beta Efl.Exe extends Efl.Task implements Efl.Io.Reader, Efl.Io.Writer, Efl.Io.Closer, Efl.Core.Command_Line 25class @beta Efl.Exe extends Efl.Task implements Efl.Io.Reader, Efl.Io.Writer, Efl.Io.Closer, Efl.Core.Command_Line
@@ -51,6 +52,15 @@ class @beta Efl.Exe extends Efl.Task implements Efl.Io.Reader, Efl.Io.Writer, Ef
51 sig: int; [[The exit signal, or -1 if no exit signal happened.]] 52 sig: int; [[The exit signal, or -1 if no exit signal happened.]]
52 } 53 }
53 } 54 }
55 @property pid {
56 [[The pid of the process, which is only accessible after the object has been finalized.
57 @since 1.24
58 ]]
59 get { }
60 values {
61 pid: int; [[The pid, or 0 on failure.]]
62 }
63 }
54 @property env { 64 @property env {
55 [[If $env is $NULL then the process created by this object is 65 [[If $env is $NULL then the process created by this object is
56 going to inherit the environment of this process. 66 going to inherit the environment of this process.
diff --git a/src/lib/ecore/efl_filter_model.c b/src/lib/ecore/efl_filter_model.c
index cc18dca89b..4ef3316947 100644
--- a/src/lib/ecore/efl_filter_model.c
+++ b/src/lib/ecore/efl_filter_model.c
@@ -314,39 +314,6 @@ _filter_remove_array(Eo *o EINA_UNUSED, void *data, const Eina_Value v)
314 return eina_value_object_init(target); 314 return eina_value_object_init(target);
315} 315}
316 316
317/* Result from eina_future_all_array is an EINA_VALUE_TYPE_ARRAY that contain Eina_Value of
318 Eo Model. It is expected that children slice get return an EINA_VALUE_TYPE_ARRAY that
319 contain Eo Model directly.
320*/
321static Eina_Value
322_filter_cleanup_array(Eo *o EINA_UNUSED, void *data EINA_UNUSED, const Eina_Value v)
323{
324 unsigned int i, len;
325 Eina_Value created = EINA_VALUE_EMPTY;
326 Eina_Value r = EINA_VALUE_EMPTY;
327
328 eina_value_array_setup(&r, EINA_VALUE_TYPE_OBJECT, 4);
329
330 EINA_VALUE_ARRAY_FOREACH(&v, len, i, created)
331 {
332 Eo *target = NULL;
333
334 if (eina_value_type_get(&created) != EINA_VALUE_TYPE_OBJECT)
335 goto on_error;
336
337 target = eina_value_object_get(&created);
338 if (!target) goto on_error;
339
340 eina_value_array_append(&r, target);
341 }
342
343 return r;
344
345 on_error:
346 eina_value_flush(&r);
347 return eina_value_error_init(EFL_MODEL_ERROR_UNKNOWN);
348}
349
350static Eina_Future * 317static Eina_Future *
351_efl_filter_model_efl_model_children_slice_get(Eo *obj, Efl_Filter_Model_Data *pd, 318_efl_filter_model_efl_model_children_slice_get(Eo *obj, Efl_Filter_Model_Data *pd,
352 unsigned int start, unsigned int count) 319 unsigned int start, unsigned int count)
@@ -389,7 +356,7 @@ _efl_filter_model_efl_model_children_slice_get(Eo *obj, Efl_Filter_Model_Data *p
389 } 356 }
390 r[i] = EINA_FUTURE_SENTINEL; 357 r[i] = EINA_FUTURE_SENTINEL;
391 358
392 f = efl_future_then(obj, eina_future_all_array(r), .success = _filter_cleanup_array); 359 f = efl_future_then(obj, eina_future_all_array(r), .success = _efl_future_all_repack);
393 free(r); 360 free(r);
394 free(mapping); 361 free(mapping);
395 362
diff --git a/src/lib/ecore/efl_loop_model.c b/src/lib/ecore/efl_loop_model.c
index d3e52a63fb..88d8574285 100644
--- a/src/lib/ecore/efl_loop_model.c
+++ b/src/lib/ecore/efl_loop_model.c
@@ -108,6 +108,42 @@ _efl_loop_model_efl_model_property_ready_get(Eo *obj, void *pd EINA_UNUSED, cons
108 return efl_future_then(obj, f); 108 return efl_future_then(obj, f);
109} 109}
110 110
111static Eina_Value
112_unpack_from_array(void *data EINA_UNUSED, Eina_Value v, const Eina_Future *f EINA_UNUSED)
113{
114 Eo *object = NULL;
115
116 if (eina_value_type_get(&v) == EINA_VALUE_TYPE_ERROR) return v;
117 if (eina_value_type_get(&v) != EINA_VALUE_TYPE_ARRAY) return eina_value_error_init(EINVAL);
118 if (eina_value_array_count(&v) != 1) return eina_value_error_init(EINVAL);
119
120 eina_value_array_get(&v, 0, &object);
121
122 return eina_value_object_init(object);
123}
124
125static Eina_Future *
126_efl_loop_model_efl_model_children_index_get(Eo *obj, void *pd EINA_UNUSED, Eina_Iterator *indexes)
127{
128 Eina_Future *r;
129 Eina_Array futures;
130 unsigned int idx;
131
132 eina_array_step_set(&futures, sizeof (Eina_Array), 8);
133
134 EINA_ITERATOR_FOREACH(indexes, idx)
135 eina_array_push(&futures, eina_future_then(efl_model_children_slice_get(obj, idx, 1), _unpack_from_array, NULL));
136 eina_iterator_free(indexes);
137
138 r = efl_future_then(obj, eina_future_all_iterator(eina_array_iterator_new(&futures)),
139 .success = _efl_future_all_repack,
140 .success_type = EINA_VALUE_TYPE_ARRAY);
141
142 eina_array_flush(&futures);
143
144 return r;
145}
146
111static void 147static void
112_noref_death(void *data EINA_UNUSED, const Efl_Event *event) 148_noref_death(void *data EINA_UNUSED, const Efl_Event *event)
113{ 149{
diff --git a/src/lib/ecore/efl_loop_model.eo b/src/lib/ecore/efl_loop_model.eo
index 2285b56f1b..06af337ecf 100644
--- a/src/lib/ecore/efl_loop_model.eo
+++ b/src/lib/ecore/efl_loop_model.eo
@@ -20,5 +20,6 @@ abstract Efl.Loop_Model extends Efl.Loop_Consumer implements Efl.Model
20 Efl.Object.invalidate; 20 Efl.Object.invalidate;
21 Efl.Model.property_ready_get; 21 Efl.Model.property_ready_get;
22 Efl.Model.property { get; set; } 22 Efl.Model.property { get; set; }
23 Efl.Model.children_index_get;
23 } 24 }
24} 25}
diff --git a/src/lib/ecore_audio/ecore_audio.c b/src/lib/ecore_audio/ecore_audio.c
index 1c0345ed73..be2e40c74c 100644
--- a/src/lib/ecore_audio/ecore_audio.c
+++ b/src/lib/ecore_audio/ecore_audio.c
@@ -144,6 +144,7 @@ ecore_audio_pulse_lib_load(void)
144 goto err; \ 144 goto err; \
145 } 145 }
146 SYM(pa_context_new); 146 SYM(pa_context_new);
147 SYM(pa_context_unref);
147 SYM(pa_context_connect); 148 SYM(pa_context_connect);
148 SYM(pa_context_set_sink_input_volume); 149 SYM(pa_context_set_sink_input_volume);
149 SYM(pa_context_get_state); 150 SYM(pa_context_get_state);
@@ -155,6 +156,7 @@ ecore_audio_pulse_lib_load(void)
155 SYM(pa_stream_connect_playback); 156 SYM(pa_stream_connect_playback);
156 SYM(pa_stream_disconnect); 157 SYM(pa_stream_disconnect);
157 SYM(pa_stream_drain); 158 SYM(pa_stream_drain);
159 SYM(pa_stream_flush);
158 SYM(pa_stream_cork); 160 SYM(pa_stream_cork);
159 SYM(pa_stream_write); 161 SYM(pa_stream_write);
160 SYM(pa_stream_begin_write); 162 SYM(pa_stream_begin_write);
diff --git a/src/lib/ecore_audio/ecore_audio_obj_in.c b/src/lib/ecore_audio/ecore_audio_obj_in.c
index b2a8f912c3..64ce45ba54 100644
--- a/src/lib/ecore_audio/ecore_audio_obj_in.c
+++ b/src/lib/ecore_audio/ecore_audio_obj_in.c
@@ -155,7 +155,10 @@ _ecore_audio_in_ecore_audio_vio_set(Eo *eo_obj, Ecore_Audio_Input *obj, Ecore_Au
155 Ecore_Audio_Object *ea_obj = efl_data_scope_get(eo_obj, ECORE_AUDIO_CLASS); 155 Ecore_Audio_Object *ea_obj = efl_data_scope_get(eo_obj, ECORE_AUDIO_CLASS);
156 156
157 if (ea_obj->vio) 157 if (ea_obj->vio)
158 _free_vio(ea_obj); 158 {
159 ERR("VIO already set!");
160 _free_vio(ea_obj);
161 }
159 162
160 obj->seekable = obj->seekable_prev; 163 obj->seekable = obj->seekable_prev;
161 164
@@ -184,9 +187,15 @@ _ecore_audio_in_efl_object_constructor(Eo *eo_obj, Ecore_Audio_Input *obj)
184EOLIAN static void 187EOLIAN static void
185_ecore_audio_in_efl_object_destructor(Eo *eo_obj, Ecore_Audio_Input *obj) 188_ecore_audio_in_efl_object_destructor(Eo *eo_obj, Ecore_Audio_Input *obj)
186{ 189{
190 Ecore_Audio_Object *ea_obj = efl_data_scope_get(eo_obj, ECORE_AUDIO_CLASS);
187 if(obj->output) 191 if(obj->output)
188 ecore_audio_obj_out_input_detach(obj->output, eo_obj); 192 {
193 if (!ecore_audio_obj_out_input_detach(obj->output, eo_obj))
194 ERR("Failed to detach output %p!", obj->output);
195 }
189 196
197 if (ea_obj->vio)
198 _free_vio(ea_obj);
190 efl_destructor(efl_super(eo_obj, MY_CLASS)); 199 efl_destructor(efl_super(eo_obj, MY_CLASS));
191} 200}
192 201
diff --git a/src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c b/src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c
index bebfba59d2..dc4bd4578d 100644
--- a/src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c
+++ b/src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c
@@ -135,15 +135,6 @@ _ecore_audio_in_sndfile_ecore_audio_format_get(const Eo *eo_obj, Ecore_Audio_In_
135 return obj->format;; 135 return obj->format;;
136} 136}
137 137
138static void _free_vio(Ecore_Audio_Object *ea_obj)
139{
140 if (ea_obj->vio->free_func)
141 ea_obj->vio->free_func(ea_obj->vio->data);
142
143 free(ea_obj->vio);
144 ea_obj->vio = NULL;
145}
146
147EOLIAN static void 138EOLIAN static void
148_ecore_audio_in_sndfile_ecore_audio_vio_set(Eo *eo_obj, Ecore_Audio_In_Sndfile_Data *obj, Ecore_Audio_Vio *vio, void *data, efl_key_data_free_func free_func) 139_ecore_audio_in_sndfile_ecore_audio_vio_set(Eo *eo_obj, Ecore_Audio_In_Sndfile_Data *obj, Ecore_Audio_Vio *vio, void *data, efl_key_data_free_func free_func)
149{ 140{
@@ -156,27 +147,25 @@ _ecore_audio_in_sndfile_ecore_audio_vio_set(Eo *eo_obj, Ecore_Audio_In_Sndfile_D
156 obj->handle = NULL; 147 obj->handle = NULL;
157 } 148 }
158 149
159 eina_stringshare_replace(&ea_obj->source, "VIO"); 150 if (vio)
160 151 eina_stringshare_replace(&ea_obj->source, "VIO");
161 if (!ea_obj->source) 152 else
162 return; 153 eina_stringshare_replace(&ea_obj->source, NULL);
163 if (ea_obj->vio)
164 _free_vio(ea_obj);
165 154
166 in_obj->seekable = EINA_FALSE; 155 in_obj->seekable = EINA_FALSE;
156 ecore_audio_obj_vio_set(efl_super(eo_obj, MY_CLASS), vio, data, free_func);
167 157
168 if (!vio) 158 if (!vio)
169 return; 159 return;
170
171 ea_obj->vio = calloc(1, sizeof(Ecore_Audio_Vio_Internal));
172 ea_obj->vio->vio = vio;
173 ea_obj->vio->data = data;
174 ea_obj->vio->free_func = free_func;
175 in_obj->seekable = (vio->seek != NULL); 160 in_obj->seekable = (vio->seek != NULL);
176 161
177 obj->handle = ESF_CALL(sf_open_virtual)(&vio_wrapper, SFM_READ, &obj->sfinfo, eo_obj); 162 obj->handle = ESF_CALL(sf_open_virtual)(&vio_wrapper, SFM_READ, &obj->sfinfo, eo_obj);
178 163
179 if (!obj->handle) { 164 if (!obj->handle) {
165 if (ea_obj->vio->free_func)
166 ea_obj->vio->free_func(ea_obj->vio->data);
167 free(ea_obj->vio);
168 ea_obj->vio = NULL;
180 eina_stringshare_del(ea_obj->source); 169 eina_stringshare_del(ea_obj->source);
181 ea_obj->source = NULL; 170 ea_obj->source = NULL;
182 return; 171 return;
@@ -201,14 +190,9 @@ _ecore_audio_in_sndfile_ecore_audio_vio_set(Eo *eo_obj, Ecore_Audio_In_Sndfile_D
201EOLIAN static void 190EOLIAN static void
202_ecore_audio_in_sndfile_efl_object_destructor(Eo *eo_obj, Ecore_Audio_In_Sndfile_Data *obj) 191_ecore_audio_in_sndfile_efl_object_destructor(Eo *eo_obj, Ecore_Audio_In_Sndfile_Data *obj)
203{ 192{
204 Ecore_Audio_Object *ea_obj = efl_data_scope_get(eo_obj, ECORE_AUDIO_CLASS);
205
206 if (obj->handle) 193 if (obj->handle)
207 ESF_CALL(sf_close)(obj->handle); 194 ESF_CALL(sf_close)(obj->handle);
208 195
209 if (ea_obj->vio)
210 _free_vio(ea_obj);
211
212 efl_destructor(efl_super(eo_obj, MY_CLASS)); 196 efl_destructor(efl_super(eo_obj, MY_CLASS));
213} 197}
214 198
diff --git a/src/lib/ecore_audio/ecore_audio_obj_out.c b/src/lib/ecore_audio/ecore_audio_obj_out.c
index 7e1d39beca..7a51e8c73d 100644
--- a/src/lib/ecore_audio/ecore_audio_obj_out.c
+++ b/src/lib/ecore_audio/ecore_audio_obj_out.c
@@ -118,7 +118,10 @@ _ecore_audio_out_ecore_audio_vio_set(Eo *eo_obj, Ecore_Audio_Output *_pd EINA_UN
118 Ecore_Audio_Object *ea_obj = efl_data_scope_get(eo_obj, ECORE_AUDIO_CLASS); 118 Ecore_Audio_Object *ea_obj = efl_data_scope_get(eo_obj, ECORE_AUDIO_CLASS);
119 119
120 if (ea_obj->vio) 120 if (ea_obj->vio)
121 _free_vio(ea_obj); 121 {
122 ERR("VIO already set!");
123 _free_vio(ea_obj);
124 }
122 125
123 if (!vio) 126 if (!vio)
124 return; 127 return;
@@ -144,11 +147,13 @@ _ecore_audio_out_efl_object_destructor(Eo *eo_obj, Ecore_Audio_Output *obj)
144{ 147{
145 Eina_List *cur, *tmp; 148 Eina_List *cur, *tmp;
146 Eo *in; 149 Eo *in;
150 Ecore_Audio_Object *ea_obj = efl_data_scope_get(eo_obj, ECORE_AUDIO_CLASS);
147 151
148 EINA_LIST_FOREACH_SAFE(obj->inputs, cur, tmp, in) { 152 EINA_LIST_FOREACH_SAFE(obj->inputs, cur, tmp, in) {
149 ecore_audio_obj_out_input_detach(eo_obj, in); 153 ecore_audio_obj_out_input_detach(eo_obj, in);
150 } 154 }
151 155 if (ea_obj->vio)
156 _free_vio(ea_obj);
152 efl_destructor(efl_super(eo_obj, MY_CLASS)); 157 efl_destructor(efl_super(eo_obj, MY_CLASS));
153} 158}
154 159
diff --git a/src/lib/ecore_audio/ecore_audio_obj_out_pulse.c b/src/lib/ecore_audio/ecore_audio_obj_out_pulse.c
index 5d61e0eb3e..edcc924acb 100644
--- a/src/lib/ecore_audio/ecore_audio_obj_out_pulse.c
+++ b/src/lib/ecore_audio/ecore_audio_obj_out_pulse.c
@@ -25,27 +25,19 @@ extern pa_mainloop_api functable;
25#define MY_CLASS ECORE_AUDIO_OUT_PULSE_CLASS 25#define MY_CLASS ECORE_AUDIO_OUT_PULSE_CLASS
26#define MY_CLASS_NAME "Ecore_Audio_Out_Pulse" 26#define MY_CLASS_NAME "Ecore_Audio_Out_Pulse"
27 27
28struct _Ecore_Audio_Pulse_Class {
29 pa_mainloop_api *api;
30 pa_context *context;
31 pa_context_state_t state;
32 Ecore_Job *state_job;
33 Eina_List *outputs;
34};
35
36static struct _Ecore_Audio_Pulse_Class class_vars = {
37 .api = &functable,
38};
39
40struct _Ecore_Audio_Out_Pulse_Data 28struct _Ecore_Audio_Out_Pulse_Data
41{ 29{
42 char *foo; 30 pa_mainloop_api *api;
31 pa_context *context;
32 pa_context_state_t state;
33 Ecore_Job *state_job;
34 Eina_List *outputs;
43}; 35};
44 36
45typedef struct _Ecore_Audio_Out_Pulse_Data Ecore_Audio_Out_Pulse_Data; 37typedef struct _Ecore_Audio_Out_Pulse_Data Ecore_Audio_Out_Pulse_Data;
46 38
47EOLIAN static void 39EOLIAN static void
48_ecore_audio_out_pulse_ecore_audio_volume_set(Eo *eo_obj, Ecore_Audio_Out_Pulse_Data *_pd EINA_UNUSED, double volume) 40_ecore_audio_out_pulse_ecore_audio_volume_set(Eo *eo_obj, Ecore_Audio_Out_Pulse_Data *pd, double volume)
49{ 41{
50 Eo *in; 42 Eo *in;
51 pa_stream *stream = NULL; 43 pa_stream *stream = NULL;
@@ -65,7 +57,7 @@ _ecore_audio_out_pulse_ecore_audio_volume_set(Eo *eo_obj, Ecore_Audio_Out_Pulse_
65 EINA_LIST_FOREACH(out_obj->inputs, input, in) { 57 EINA_LIST_FOREACH(out_obj->inputs, input, in) {
66 stream = efl_key_data_get(in, "pulse_data"); 58 stream = efl_key_data_get(in, "pulse_data");
67 idx = EPA_CALL(pa_stream_get_index)(stream); 59 idx = EPA_CALL(pa_stream_get_index)(stream);
68 EPA_CALL(pa_operation_unref)(EPA_CALL(pa_context_set_sink_input_volume)(class_vars.context, idx, &pa_volume, NULL, NULL)); 60 EPA_CALL(pa_operation_unref)(EPA_CALL(pa_context_set_sink_input_volume)(pd->context, idx, &pa_volume, NULL, NULL));
69 } 61 }
70} 62}
71 63
@@ -114,6 +106,7 @@ static Eina_Bool _input_attach_internal(Eo *eo_obj, Eo *in)
114 pa_stream *stream; 106 pa_stream *stream;
115 Eina_Bool ret = EINA_FALSE; 107 Eina_Bool ret = EINA_FALSE;
116 Ecore_Audio_Object *ea_obj = efl_data_scope_get(eo_obj, ECORE_AUDIO_CLASS); 108 Ecore_Audio_Object *ea_obj = efl_data_scope_get(eo_obj, ECORE_AUDIO_CLASS);
109 Ecore_Audio_Out_Pulse_Data *pd = efl_data_scope_get(eo_obj, MY_CLASS);
117 110
118 if (!EPA_LOAD()) return EINA_FALSE; 111 if (!EPA_LOAD()) return EINA_FALSE;
119 ret = ecore_audio_obj_out_input_attach(efl_super(eo_obj, MY_CLASS), in); 112 ret = ecore_audio_obj_out_input_attach(efl_super(eo_obj, MY_CLASS), in);
@@ -128,7 +121,7 @@ static Eina_Bool _input_attach_internal(Eo *eo_obj, Eo *in)
128 121
129 ss.rate = ss.rate * speed; 122 ss.rate = ss.rate * speed;
130 123
131 stream = EPA_CALL(pa_stream_new)(class_vars.context, name, &ss, NULL); 124 stream = EPA_CALL(pa_stream_new)(pd->context, name, &ss, NULL);
132 if (!stream) { 125 if (!stream) {
133 ERR("Could not create stream"); 126 ERR("Could not create stream");
134 ecore_audio_obj_out_input_detach(efl_super(eo_obj, MY_CLASS), in); 127 ecore_audio_obj_out_input_detach(efl_super(eo_obj, MY_CLASS), in);
@@ -151,18 +144,27 @@ static Eina_Bool _input_attach_internal(Eo *eo_obj, Eo *in)
151 144
152static void _delayed_attach_cb(void *data, const Efl_Event *event) 145static void _delayed_attach_cb(void *data, const Efl_Event *event)
153{ 146{
154 Eo *in = data; 147 efl_event_callback_del(event->object, ECORE_AUDIO_OUT_PULSE_EVENT_CONTEXT_READY, _delayed_attach_cb, data);
155 efl_event_callback_del(event->object, ECORE_AUDIO_OUT_PULSE_EVENT_CONTEXT_READY, _delayed_attach_cb, in);
156 148
157 _input_attach_internal(event->object, in); 149 _input_attach_internal(event->object, data);
150}
151
152static Eina_Bool
153_is_input_attached(Eo *eo_obj, Eo *in)
154{
155 Ecore_Audio_Output *out_obj = efl_data_scope_get(eo_obj, ECORE_AUDIO_OUT_CLASS);
156 if (!out_obj->inputs) return EINA_FALSE;
157 return !!eina_list_data_find(out_obj->inputs, in);
158} 158}
159 159
160EOLIAN static Eina_Bool 160EOLIAN static Eina_Bool
161_ecore_audio_out_pulse_ecore_audio_out_input_attach(Eo *eo_obj, Ecore_Audio_Out_Pulse_Data *_pd EINA_UNUSED, Eo *in) 161_ecore_audio_out_pulse_ecore_audio_out_input_attach(Eo *eo_obj, Ecore_Audio_Out_Pulse_Data *pd, Eo *in)
162{ 162{
163 Eina_Bool retval = EINA_TRUE; 163 Eina_Bool retval = EINA_TRUE;
164 164
165 if (class_vars.state != PA_CONTEXT_READY) { 165 if (_is_input_attached(eo_obj, in)) return EINA_TRUE;
166
167 if (pd->state != PA_CONTEXT_READY) {
166 DBG("Delaying input_attach because PA context is not ready."); 168 DBG("Delaying input_attach because PA context is not ready.");
167 efl_event_callback_add(eo_obj, ECORE_AUDIO_OUT_PULSE_EVENT_CONTEXT_READY, _delayed_attach_cb, in); 169 efl_event_callback_add(eo_obj, ECORE_AUDIO_OUT_PULSE_EVENT_CONTEXT_READY, _delayed_attach_cb, in);
168 } else { 170 } else {
@@ -180,16 +182,32 @@ static void _drain_cb(pa_stream *stream, int success EINA_UNUSED, void *data EIN
180} 182}
181 183
182EOLIAN static Eina_Bool 184EOLIAN static Eina_Bool
183_ecore_audio_out_pulse_ecore_audio_out_input_detach(Eo *eo_obj, Ecore_Audio_Out_Pulse_Data *_pd EINA_UNUSED, Eo *in) 185_ecore_audio_out_pulse_ecore_audio_out_input_detach(Eo *eo_obj, Ecore_Audio_Out_Pulse_Data *pd, Eo *in)
184{ 186{
185 pa_stream *stream = NULL; 187 pa_stream *stream = NULL;
186 Eina_Bool ret2 = EINA_FALSE; 188 Eina_Bool ret2 = EINA_FALSE;
187 pa_operation *op; 189 pa_operation *op;
188 190
189 if (!EPA_LOAD()) return EINA_FALSE; 191 if (!EPA_LOAD())
192 {
193 ERR("Failed to load PA!");
194 return EINA_FALSE;
195 }
196 if (!_is_input_attached(eo_obj, in))
197 {
198 ERR("Input object passed is not currently attached to this output!");
199 return EINA_FALSE;
200 }
201 if (pd->state != PA_CONTEXT_READY)
202 efl_event_callback_del(in, ECORE_AUDIO_OUT_PULSE_EVENT_CONTEXT_READY, _delayed_attach_cb, pd);
203 else
204 efl_event_callback_del(in, ECORE_AUDIO_IN_EVENT_IN_SAMPLERATE_CHANGED, _update_samplerate_cb, eo_obj);
190 ret2 = ecore_audio_obj_out_input_detach(efl_super(eo_obj, MY_CLASS), in); 205 ret2 = ecore_audio_obj_out_input_detach(efl_super(eo_obj, MY_CLASS), in);
191 if (!ret2) 206 if (!ret2)
192 return EINA_FALSE; 207 {
208 ERR("Super call failed for ecore_audio_obj_out_input_detach!");
209 return EINA_FALSE;
210 }
193 211
194 stream = efl_key_data_get(in, "pulse_data"); 212 stream = efl_key_data_get(in, "pulse_data");
195 213
@@ -197,7 +215,12 @@ _ecore_audio_out_pulse_ecore_audio_out_input_detach(Eo *eo_obj, Ecore_Audio_Out_
197 op = EPA_CALL(pa_stream_drain) (stream, _drain_cb, NULL); 215 op = EPA_CALL(pa_stream_drain) (stream, _drain_cb, NULL);
198 if (!op) 216 if (!op)
199 { 217 {
200 ERR("Failed to drain PulseAudio stream."); 218 op = EPA_CALL(pa_stream_flush)(stream, _drain_cb, NULL);
219 if (!op)
220 {
221 EPA_CALL(pa_stream_disconnect)(stream);
222 EPA_CALL(pa_stream_unref)(stream);
223 }
201 return EINA_FALSE; 224 return EINA_FALSE;
202 } 225 }
203 226
@@ -205,67 +228,69 @@ _ecore_audio_out_pulse_ecore_audio_out_input_detach(Eo *eo_obj, Ecore_Audio_Out_
205 return EINA_TRUE; 228 return EINA_TRUE;
206} 229}
207 230
208static void _state_cb(pa_context *context, void *data EINA_UNUSED) 231static void _state_cb(pa_context *context, void *data)
209{ 232{
210 Eina_List *out, *tmp; 233 Eina_List *out, *tmp;
211 Eo *eo_obj; 234 Eo *eo_obj;
212 pa_context_state_t state; 235 pa_context_state_t state;
236 Ecore_Audio_Out_Pulse_Data *pd = data;
213 237
214 if (!EPA_LOAD()) return; 238 if (!EPA_LOAD()) return;
215 state = EPA_CALL(pa_context_get_state)(context); 239 state = EPA_CALL(pa_context_get_state)(context);
216 class_vars.state = state; 240 pd->state = state;
217 241
218 //ref everything in the list to be sure... 242 //ref everything in the list to be sure...
219 EINA_LIST_FOREACH(class_vars.outputs, out, eo_obj) { 243 EINA_LIST_FOREACH(pd->outputs, out, eo_obj) {
220 efl_ref(eo_obj); 244 efl_ref(eo_obj);
221 } 245 }
222 // the callback here can delete things in the list.. 246 // the callback here can delete things in the list..
223 if (state == PA_CONTEXT_READY) { 247 if (state == PA_CONTEXT_READY) {
224 DBG("PA context ready."); 248 DBG("PA context ready.");
225 EINA_LIST_FOREACH(class_vars.outputs, out, eo_obj) { 249 EINA_LIST_FOREACH(pd->outputs, out, eo_obj) {
226 efl_event_callback_call(eo_obj, ECORE_AUDIO_OUT_PULSE_EVENT_CONTEXT_READY, NULL); 250 efl_event_callback_call(eo_obj, ECORE_AUDIO_OUT_PULSE_EVENT_CONTEXT_READY, NULL);
227 } 251 }
228 } else if ((state == PA_CONTEXT_FAILED) || (state == PA_CONTEXT_TERMINATED)) { 252 } else if ((state == PA_CONTEXT_FAILED) || (state == PA_CONTEXT_TERMINATED)) {
229 DBG("PA context fail."); 253 DBG("PA context fail.");
230 EINA_LIST_FOREACH(class_vars.outputs, out, eo_obj) { 254 EINA_LIST_FOREACH(pd->outputs, out, eo_obj) {
231 efl_event_callback_call(eo_obj, ECORE_AUDIO_OUT_PULSE_EVENT_CONTEXT_FAIL, NULL); 255 efl_event_callback_call(eo_obj, ECORE_AUDIO_OUT_PULSE_EVENT_CONTEXT_FAIL, NULL);
232 } 256 }
233 } else { 257 } else {
234 DBG("Connection state %i", state); 258 DBG("Connection state %i", state);
235 } 259 }
236 // now unref everything safely 260 // now unref everything safely
237 EINA_LIST_FOREACH_SAFE(class_vars.outputs, out, tmp, eo_obj) { 261 EINA_LIST_FOREACH_SAFE(pd->outputs, out, tmp, eo_obj) {
238 efl_unref(eo_obj); 262 efl_unref(eo_obj);
239 } 263 }
240} 264}
241 265
242static void _state_job(void *data EINA_UNUSED) 266static void _state_job(void *data)
243{ 267{
244 if ((class_vars.state == PA_CONTEXT_FAILED) || 268 Ecore_Audio_Out_Pulse_Data *pd = data;
245 (class_vars.state == PA_CONTEXT_TERMINATED)) 269 if ((pd->state == PA_CONTEXT_FAILED) ||
270 (pd->state == PA_CONTEXT_TERMINATED))
246 { 271 {
247 Eo *eo_obj; 272 Eo *eo_obj;
248 Eina_List *out, *tmp; 273 Eina_List *out, *tmp;
249 274
250 DBG("PA context fail."); 275 DBG("PA context fail.");
251 //ref everything in the list to be sure... 276 //ref everything in the list to be sure...
252 EINA_LIST_FOREACH(class_vars.outputs, out, eo_obj) { 277 EINA_LIST_FOREACH(pd->outputs, out, eo_obj) {
253 efl_ref(eo_obj); 278 efl_ref(eo_obj);
254 } 279 }
255 // the callback here can delete things in the list.. 280 // the callback here can delete things in the list..
256 EINA_LIST_FOREACH(class_vars.outputs, out, eo_obj) { 281 EINA_LIST_FOREACH(pd->outputs, out, eo_obj) {
257 efl_event_callback_call(eo_obj, ECORE_AUDIO_OUT_PULSE_EVENT_CONTEXT_FAIL, NULL); 282 efl_event_callback_call(eo_obj, ECORE_AUDIO_OUT_PULSE_EVENT_CONTEXT_FAIL, NULL);
258 } 283 }
259 // now unref everything safely 284 // now unref everything safely
260 EINA_LIST_FOREACH_SAFE(class_vars.outputs, out, tmp, eo_obj) { 285 EINA_LIST_FOREACH_SAFE(pd->outputs, out, tmp, eo_obj) {
261 efl_unref(eo_obj); 286 efl_unref(eo_obj);
262 } 287 }
263 } 288 }
264 class_vars.state_job = NULL; 289 pd->state_job = NULL;
265} 290}
266 291
267EOLIAN static Eo * 292EOLIAN static Eo *
268_ecore_audio_out_pulse_efl_object_constructor(Eo *eo_obj, Ecore_Audio_Out_Pulse_Data *_pd EINA_UNUSED) 293_ecore_audio_out_pulse_efl_object_constructor(Eo *eo_obj, Ecore_Audio_Out_Pulse_Data *pd)
269{ 294{
270 int argc; 295 int argc;
271 char **argv, *disp = NULL; 296 char **argv, *disp = NULL;
@@ -274,10 +299,11 @@ _ecore_audio_out_pulse_efl_object_constructor(Eo *eo_obj, Ecore_Audio_Out_Pulse_
274 299
275 if (!EPA_LOAD()) return NULL; 300 if (!EPA_LOAD()) return NULL;
276 eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS)); 301 eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS));
302 pd->api = &functable;
277 303
278 out_obj->need_writer = EINA_FALSE; 304 out_obj->need_writer = EINA_FALSE;
279 305
280 if (!class_vars.context) { 306 if (!pd->context) {
281 307
282 // if we're in a wayland world rather than x11... but DISPLAY also set... 308 // if we're in a wayland world rather than x11... but DISPLAY also set...
283 if (getenv("WAYLAND_DISPLAY")) disp = getenv("DISPLAY"); 309 if (getenv("WAYLAND_DISPLAY")) disp = getenv("DISPLAY");
@@ -310,9 +336,9 @@ _ecore_audio_out_pulse_efl_object_constructor(Eo *eo_obj, Ecore_Audio_Out_Pulse_
310 ecore_app_args_get(&argc, &argv); 336 ecore_app_args_get(&argc, &argv);
311 if (!argc) { 337 if (!argc) {
312 DBG("Could not get program name, pulse outputs will be named ecore_audio"); 338 DBG("Could not get program name, pulse outputs will be named ecore_audio");
313 class_vars.context = EPA_CALL(pa_context_new)(class_vars.api, "ecore_audio"); 339 pd->context = EPA_CALL(pa_context_new)(pd->api, "ecore_audio");
314 } else { 340 } else {
315 class_vars.context = EPA_CALL(pa_context_new)(class_vars.api, basename(argv[0])); 341 pd->context = EPA_CALL(pa_context_new)(pd->api, basename(argv[0]));
316 } 342 }
317 // if we had a display value and a displayenv buffer then let's restore 343 // if we had a display value and a displayenv buffer then let's restore
318 // the previous value content of DISPLAY as we duplicated it above and 344 // the previous value content of DISPLAY as we duplicated it above and
@@ -327,21 +353,22 @@ _ecore_audio_out_pulse_efl_object_constructor(Eo *eo_obj, Ecore_Audio_Out_Pulse_
327 // free up our temporary local DISPLAY env sring copy if we have it 353 // free up our temporary local DISPLAY env sring copy if we have it
328 if (disp) free(disp); 354 if (disp) free(disp);
329 355
330 EPA_CALL(pa_context_set_state_callback)(class_vars.context, _state_cb, NULL); 356 EPA_CALL(pa_context_set_state_callback)(pd->context, _state_cb, pd);
331 EPA_CALL(pa_context_connect)(class_vars.context, NULL, PA_CONTEXT_NOFLAGS, NULL); 357 EPA_CALL(pa_context_connect)(pd->context, NULL, PA_CONTEXT_NOFLAGS, NULL);
332 } 358 }
333 359
334 class_vars.outputs = eina_list_append(class_vars.outputs, eo_obj); 360 pd->outputs = eina_list_append(pd->outputs, eo_obj);
335 if (class_vars.state_job) ecore_job_del(class_vars.state_job); 361 pd->state_job = ecore_job_add(_state_job, pd);
336 class_vars.state_job = ecore_job_add(_state_job, NULL);
337 362
338 return eo_obj; 363 return eo_obj;
339} 364}
340 365
341EOLIAN static void 366EOLIAN static void
342_ecore_audio_out_pulse_efl_object_destructor(Eo *eo_obj, Ecore_Audio_Out_Pulse_Data *_pd EINA_UNUSED) 367_ecore_audio_out_pulse_efl_object_destructor(Eo *eo_obj, Ecore_Audio_Out_Pulse_Data *pd)
343{ 368{
344 class_vars.outputs = eina_list_remove(class_vars.outputs, eo_obj); 369 pd->outputs = eina_list_remove(pd->outputs, eo_obj);
370 ecore_job_del(pd->state_job);
371 EPA_CALL(pa_context_unref)(pd->context);
345 efl_destructor(efl_super(eo_obj, MY_CLASS)); 372 efl_destructor(efl_super(eo_obj, MY_CLASS));
346} 373}
347 374
diff --git a/src/lib/ecore_audio/ecore_audio_private.h b/src/lib/ecore_audio/ecore_audio_private.h
index 03947b120f..f406f4a1e7 100644
--- a/src/lib/ecore_audio/ecore_audio_private.h
+++ b/src/lib/ecore_audio/ecore_audio_private.h
@@ -168,6 +168,7 @@ struct _Ecore_Audio_Lib_Pulse
168 Eina_Module *mod; 168 Eina_Module *mod;
169 169
170 pa_context *(*pa_context_new) (pa_mainloop_api *mainloop, const char *name); 170 pa_context *(*pa_context_new) (pa_mainloop_api *mainloop, const char *name);
171 pa_context *(*pa_context_unref) (pa_context *c);
171 int (*pa_context_connect) (pa_context *c, const char *server, pa_context_flags_t flags, const pa_spawn_api *api); 172 int (*pa_context_connect) (pa_context *c, const char *server, pa_context_flags_t flags, const pa_spawn_api *api);
172 pa_operation *(*pa_context_set_sink_input_volume) (pa_context *c, uint32_t idx, const pa_cvolume *volume, pa_context_success_cb_t cb, void *userdata); 173 pa_operation *(*pa_context_set_sink_input_volume) (pa_context *c, uint32_t idx, const pa_cvolume *volume, pa_context_success_cb_t cb, void *userdata);
173 pa_context_state_t (*pa_context_get_state) (pa_context *c); 174 pa_context_state_t (*pa_context_get_state) (pa_context *c);
@@ -179,6 +180,7 @@ struct _Ecore_Audio_Lib_Pulse
179 int (*pa_stream_connect_playback) (pa_stream *s, const char *dev, const pa_buffer_attr *attr, pa_stream_flags_t flags, const pa_cvolume *volume, pa_stream *sync_stream); 180 int (*pa_stream_connect_playback) (pa_stream *s, const char *dev, const pa_buffer_attr *attr, pa_stream_flags_t flags, const pa_cvolume *volume, pa_stream *sync_stream);
180 int (*pa_stream_disconnect) (pa_stream *s); 181 int (*pa_stream_disconnect) (pa_stream *s);
181 pa_operation *(*pa_stream_drain) (pa_stream *s, pa_stream_success_cb_t cb, void *userdata); 182 pa_operation *(*pa_stream_drain) (pa_stream *s, pa_stream_success_cb_t cb, void *userdata);
183 pa_operation *(*pa_stream_flush) (pa_stream *s, pa_stream_success_cb_t cb, void *userdata);
182 pa_operation *(*pa_stream_cork) (pa_stream *s, int b, pa_stream_success_cb_t cb, void *userdata); 184 pa_operation *(*pa_stream_cork) (pa_stream *s, int b, pa_stream_success_cb_t cb, void *userdata);
183 int (*pa_stream_write) (pa_stream *p, const void *data, size_t nbytes, pa_free_cb_t free_cb, int64_t offset, pa_seek_mode_t seek); 185 int (*pa_stream_write) (pa_stream *p, const void *data, size_t nbytes, pa_free_cb_t free_cb, int64_t offset, pa_seek_mode_t seek);
184 int (*pa_stream_begin_write) (pa_stream *p, void **data, size_t *nbytes); 186 int (*pa_stream_begin_write) (pa_stream *p, void **data, size_t *nbytes);
diff --git a/src/lib/ecore_buffer/bq_mgr_protocol.h b/src/lib/ecore_buffer/bq_mgr_protocol.h
index 7cf9ad9380..79d785d8ca 100644
--- a/src/lib/ecore_buffer/bq_mgr_protocol.h
+++ b/src/lib/ecore_buffer/bq_mgr_protocol.h
@@ -75,25 +75,10 @@ bq_mgr_create_provider(struct bq_mgr *bq_mgr, const char *name)
75} 75}
76 76
77struct bq_consumer_listener { 77struct bq_consumer_listener {
78 /**
79 * connected - (none)
80 */
81 void (*connected)(void *data, 78 void (*connected)(void *data,
82 struct bq_consumer *bq_consumer); 79 struct bq_consumer *bq_consumer);
83 /**
84 * disconnected - (none)
85 */
86 void (*disconnected)(void *data, 80 void (*disconnected)(void *data,
87 struct bq_consumer *bq_consumer); 81 struct bq_consumer *bq_consumer);
88 /**
89 * buffer_attached - (none)
90 * @buffer: (none)
91 * @engine: (none)
92 * @width: (none)
93 * @height: (none)
94 * @format: (none)
95 * @flags: (none)
96 */
97 void (*buffer_attached)(void *data, 82 void (*buffer_attached)(void *data,
98 struct bq_consumer *bq_consumer, 83 struct bq_consumer *bq_consumer,
99 struct bq_buffer *buffer, 84 struct bq_buffer *buffer,
@@ -102,17 +87,6 @@ struct bq_consumer_listener {
102 int32_t height, 87 int32_t height,
103 int32_t format, 88 int32_t format,
104 uint32_t flags); 89 uint32_t flags);
105 /**
106 * set_buffer_id - (none)
107 * @buffer: (none)
108 * @id: (none)
109 * @offset0: (none)
110 * @stride0: (none)
111 * @offset1: (none)
112 * @stride1: (none)
113 * @offset2: (none)
114 * @stride2: (none)
115 */
116 void (*set_buffer_id)(void *data, 90 void (*set_buffer_id)(void *data,
117 struct bq_consumer *bq_consumer, 91 struct bq_consumer *bq_consumer,
118 struct bq_buffer *buffer, 92 struct bq_buffer *buffer,
@@ -123,17 +97,6 @@ struct bq_consumer_listener {
123 int32_t stride1, 97 int32_t stride1,
124 int32_t offset2, 98 int32_t offset2,
125 int32_t stride2); 99 int32_t stride2);
126 /**
127 * set_buffer_fd - (none)
128 * @buffer: (none)
129 * @fd: (none)
130 * @offset0: (none)
131 * @stride0: (none)
132 * @offset1: (none)
133 * @stride1: (none)
134 * @offset2: (none)
135 * @stride2: (none)
136 */
137 void (*set_buffer_fd)(void *data, 100 void (*set_buffer_fd)(void *data,
138 struct bq_consumer *bq_consumer, 101 struct bq_consumer *bq_consumer,
139 struct bq_buffer *buffer, 102 struct bq_buffer *buffer,
@@ -144,18 +107,9 @@ struct bq_consumer_listener {
144 int32_t stride1, 107 int32_t stride1,
145 int32_t offset2, 108 int32_t offset2,
146 int32_t stride2); 109 int32_t stride2);
147 /**
148 * buffer_detached - (none)
149 * @buffer: (none)
150 */
151 void (*buffer_detached)(void *data, 110 void (*buffer_detached)(void *data,
152 struct bq_consumer *bq_consumer, 111 struct bq_consumer *bq_consumer,
153 struct bq_buffer *buffer); 112 struct bq_buffer *buffer);
154 /**
155 * add_buffer - (none)
156 * @buffer: (none)
157 * @serial: (none)
158 */
159 void (*add_buffer)(void *data, 113 void (*add_buffer)(void *data,
160 struct bq_consumer *bq_consumer, 114 struct bq_consumer *bq_consumer,
161 struct bq_buffer *buffer, 115 struct bq_buffer *buffer,
@@ -206,27 +160,13 @@ enum bq_provider_error {
206#endif /* BQ_PROVIDER_ERROR_ENUM */ 160#endif /* BQ_PROVIDER_ERROR_ENUM */
207 161
208struct bq_provider_listener { 162struct bq_provider_listener {
209 /**
210 * connected - (none)
211 * @queue_size: (none)
212 * @width: (none)
213 * @height: (none)
214 */
215 void (*connected)(void *data, 163 void (*connected)(void *data,
216 struct bq_provider *bq_provider, 164 struct bq_provider *bq_provider,
217 int32_t queue_size, 165 int32_t queue_size,
218 int32_t width, 166 int32_t width,
219 int32_t height); 167 int32_t height);
220 /**
221 * disconnected - (none)
222 */
223 void (*disconnected)(void *data, 168 void (*disconnected)(void *data,
224 struct bq_provider *bq_provider); 169 struct bq_provider *bq_provider);
225 /**
226 * add_buffer - (none)
227 * @buffer: (none)
228 * @serial: (none)
229 */
230 void (*add_buffer)(void *data, 170 void (*add_buffer)(void *data,
231 struct bq_provider *bq_provider, 171 struct bq_provider *bq_provider,
232 struct bq_buffer *buffer, 172 struct bq_buffer *buffer,
diff --git a/src/lib/ecore_cocoa/Ecore_Cocoa.h b/src/lib/ecore_cocoa/Ecore_Cocoa.h
index 36f17b490b..a545d584d7 100644
--- a/src/lib/ecore_cocoa/Ecore_Cocoa.h
+++ b/src/lib/ecore_cocoa/Ecore_Cocoa.h
@@ -196,22 +196,6 @@ struct _Ecore_Cocoa_Event_Window_Destroy
196 Ecore_Cocoa_Object *cocoa_window; /**< Handler of the Cocoa window */ 196 Ecore_Cocoa_Object *cocoa_window; /**< Handler of the Cocoa window */
197}; 197};
198 198
199/**
200 * @typedef Ecore_Cocoa_Cnp_Type
201 * Type used to interact with the Cocoa pasteboard.
202 * It holds types that can apply to a context.
203 * @since 1.18
204 */
205typedef enum
206{
207 ECORE_COCOA_CNP_TYPE_UNKNOWN = 0, /**< Undefined type */
208 ECORE_COCOA_CNP_TYPE_STRING = (1 << 0), /**< String type (pure text) */
209 ECORE_COCOA_CNP_TYPE_MARKUP = (1 << 1), /**< Elementary markup */
210 ECORE_COCOA_CNP_TYPE_IMAGE = (1 << 2), /**< Image (all formats) */
211 ECORE_COCOA_CNP_TYPE_HTML = (1 << 3) /**< HTML */
212} Ecore_Cocoa_Cnp_Type;
213
214
215/*============================================================================* 199/*============================================================================*
216 * Core * 200 * Core *
217 *============================================================================*/ 201 *============================================================================*/
@@ -561,27 +545,22 @@ EAPI void ecore_cocoa_terminate_cb_set(Ecore_Cocoa_Terminate_Cb cb)
561 * Sets the clipboard of Cocoa (NSPasteboard) 545 * Sets the clipboard of Cocoa (NSPasteboard)
562 * @param data The contents to be set in the clipboard 546 * @param data The contents to be set in the clipboard
563 * @param size The size in bytes of @c data 547 * @param size The size in bytes of @c data
564 * @param type 548 * @param mime_type The type of object to set the data
565 * @return EINA_TRUE on success, EINA_FALSE on failure 549 * @return EINA_TRUE on success, EINA_FALSE on failure
566 */ 550 */
567EAPI Eina_Bool ecore_cocoa_clipboard_set(const void *data, 551EAPI Eina_Bool ecore_cocoa_clipboard_set(const void *data,
568 int size, 552 int size,
569 Ecore_Cocoa_Cnp_Type type); 553 const char *mime_type);
570 554
571/* 555/*
572 * Gets the contents of the Cocoa clipboard 556 * Gets the contents of the Cocoa clipboard
573 * @param size Pointer used to retrieve the size of the received contents 557 * @param size Pointer used to retrieve the size of the received contents
574 * @param type The type of object to retrieve from the clipboard 558 * @param mime_type The type of object to retrieve from the clipboard
575 * @param retrieved_types The types of objects retrieved from the clipboard
576 * @return The data retrieved from the clipboard. NULL on failure 559 * @return The data retrieved from the clipboard. NULL on failure
577 * 560 *
578 * If @c type was ECORE_COCOA_CNP_TYPE_STRING or ECORE_COCOA_CNP_TYPE_MARKUP,
579 * @c retrieved_types will contain ECORE_COCOA_CNP_TYPE_STRING and the data
580 * will be a C string (char*) that must be freed after use.
581 */ 561 */
582EAPI void *ecore_cocoa_clipboard_get(int *size, 562EAPI void *ecore_cocoa_clipboard_get(int *size,
583 Ecore_Cocoa_Cnp_Type type, 563 const char *mime_type)
584 Ecore_Cocoa_Cnp_Type *retrieved_types)
585 EINA_WARN_UNUSED_RESULT; 564 EINA_WARN_UNUSED_RESULT;
586 565
587/* 566/*
@@ -589,6 +568,11 @@ EAPI void *ecore_cocoa_clipboard_get(int *size,
589 */ 568 */
590EAPI void ecore_cocoa_clipboard_clear(void); 569EAPI void ecore_cocoa_clipboard_clear(void);
591 570
571/*
572 * Returns true when the clipboard contains data that can be received.
573 */
574EAPI Eina_Bool ecore_cocoa_clipboard_exists(void);
575
592#endif /* EFL_BETA_API_SUPPORT */ 576#endif /* EFL_BETA_API_SUPPORT */
593 577
594#ifdef __cplusplus 578#ifdef __cplusplus
diff --git a/src/lib/ecore_cocoa/ecore_cocoa_cnp.m b/src/lib/ecore_cocoa/ecore_cocoa_cnp.m
index c5fd22e99d..fabfc8c5a5 100644
--- a/src/lib/ecore_cocoa/ecore_cocoa_cnp.m
+++ b/src/lib/ecore_cocoa/ecore_cocoa_cnp.m
@@ -9,16 +9,17 @@
9#import "ecore_cocoa_app.h" 9#import "ecore_cocoa_app.h"
10 10
11EAPI Eina_Bool 11EAPI Eina_Bool
12ecore_cocoa_clipboard_set(const void *data, 12ecore_cocoa_clipboard_set(const void *data,
13 int size, 13 int size,
14 Ecore_Cocoa_Cnp_Type type) 14 const char *raw_mime_type)
15{ 15{
16 NSMutableArray *objects; 16 NSMutableArray *objects;
17 NSString *str = nil; 17 NSString *str = nil;
18 BOOL ok = YES; 18 BOOL ok = YES;
19 NSString *mime_type = [NSString stringWithUTF8String:raw_mime_type];
19 20
20 objects = [[NSMutableArray alloc] init]; 21 objects = [[NSMutableArray alloc] init];
21 if (type & ECORE_COCOA_CNP_TYPE_STRING) 22 if ([mime_type hasPrefix:@"text/"])
22 { 23 {
23 str = [[NSString alloc] initWithBytes: data 24 str = [[NSString alloc] initWithBytes: data
24 length: size 25 length: size
@@ -26,18 +27,9 @@ ecore_cocoa_clipboard_set(const void *data,
26 if (str) 27 if (str)
27 [objects addObject: str]; 28 [objects addObject: str];
28 } 29 }
29 if (type & ECORE_COCOA_CNP_TYPE_MARKUP) 30 else
30 { 31 {
31 WRN("Markup CNP: NOT IMPLEMENTED"); 32 ERR("Mimetype %s is not handled yet", raw_mime_type);
32 }
33
34 if (type & ECORE_COCOA_CNP_TYPE_IMAGE)
35 {
36 WRN("Image CNP: NOT IMPLEMENTED");
37 }
38 if (type & ECORE_COCOA_CNP_TYPE_HTML)
39 {
40 WRN("HTML CNP: NOT IMPLEMENTED");
41 } 33 }
42 34
43 /* Write to pasteboard */ 35 /* Write to pasteboard */
@@ -54,35 +46,45 @@ ecore_cocoa_clipboard_set(const void *data,
54 return (ok) ? EINA_TRUE : EINA_FALSE; 46 return (ok) ? EINA_TRUE : EINA_FALSE;
55} 47}
56 48
49EAPI Eina_Bool
50ecore_cocoa_clipboard_exists(void)
51{
52 NSDictionary *options;
53 NSPasteboard *pb;
54 NSArray *items;
55 NSMutableArray *classes;
56
57 classes = [[NSMutableArray alloc] init];
58 [classes addObject: [NSString class]]; // we only support strings for now
59 pb = [NSPasteboard generalPasteboard];
60 options = [NSDictionary dictionary];
61 return [pb canReadItemWithDataConformingToTypes: classes];
62}
57 63
58EAPI void * 64EAPI void *
59ecore_cocoa_clipboard_get(int *size, 65ecore_cocoa_clipboard_get(int *size,
60 Ecore_Cocoa_Cnp_Type type, 66 const char *raw_mime_type)
61 Ecore_Cocoa_Cnp_Type *retrieved_types)
62{ 67{
63 NSMutableArray *classes; 68 NSMutableArray *classes;
64 void *data; 69 void *data = NULL;
65 NSDictionary *options; 70 NSDictionary *options;
66 NSPasteboard *pb; 71 NSPasteboard *pb;
67 NSArray *items; 72 NSArray *items;
68 unsigned int len; 73 unsigned int len;
69 BOOL string_class = NO; 74 BOOL string_class = NO;
70 Ecore_Cocoa_Cnp_Type types = 0; 75 NSString *mime_type = [NSString stringWithUTF8String:raw_mime_type];
71 76
72 classes = [[NSMutableArray alloc] init]; 77 classes = [[NSMutableArray alloc] init];
73 78
74 if (type & ECORE_COCOA_CNP_TYPE_STRING) 79 if ([mime_type hasPrefix:@"text/"])
75 { 80 {
76 string_class = YES; 81 string_class = YES;
77 [classes addObject: [NSString class]]; 82 [classes addObject: [NSString class]];
78 } 83 }
79 if (type & ECORE_COCOA_CNP_TYPE_IMAGE) 84 else
80 {
81 WRN("Image CNP: NOT IMPLEMENTED");
82 }
83 if (type & ECORE_COCOA_CNP_TYPE_HTML)
84 { 85 {
85 WRN("HTML CNP: NOT IMPLEMENTED"); 86 ERR("Mimetype %s is not handled yet", raw_mime_type);
87 goto fail;
86 } 88 }
87 89
88 if ([classes count] <= 0) 90 if ([classes count] <= 0)
@@ -120,7 +122,6 @@ ecore_cocoa_clipboard_get(int *size,
120 (const char *)data, len); 122 (const char *)data, len);
121 goto remove_fail; 123 goto remove_fail;
122 } 124 }
123 types |= ECORE_COCOA_CNP_TYPE_STRING;
124 125
125#if 0 126#if 0
126 if (type & ECORE_COCOA_CNP_TYPE_MARKUP) 127 if (type & ECORE_COCOA_CNP_TYPE_MARKUP)
@@ -139,7 +140,7 @@ ecore_cocoa_clipboard_get(int *size,
139#endif 140#endif
140 } 141 }
141 142
142 if (!types) 143 if (!data)
143 { 144 {
144 ERR("No types retrieved!"); 145 ERR("No types retrieved!");
145 goto remove_fail; 146 goto remove_fail;
@@ -148,14 +149,12 @@ ecore_cocoa_clipboard_get(int *size,
148 [classes removeAllObjects]; 149 [classes removeAllObjects];
149 150
150 if (size) *size = len; 151 if (size) *size = len;
151 if (retrieved_types) *retrieved_types = types;
152 return data; 152 return data;
153 153
154remove_fail: 154remove_fail:
155 [classes removeAllObjects]; 155 [classes removeAllObjects];
156fail: 156fail:
157 if (size) *size = 0; 157 if (size) *size = 0;
158 if (retrieved_types) *retrieved_types = 0;
159 return NULL; 158 return NULL;
160} 159}
161 160
diff --git a/src/lib/ecore_cocoa/meson.build b/src/lib/ecore_cocoa/meson.build
index b7aca40031..7b7bdcfc0b 100644
--- a/src/lib/ecore_cocoa/meson.build
+++ b/src/lib/ecore_cocoa/meson.build
@@ -21,8 +21,6 @@ evas_include_directories = [
21 include_directories(join_paths('..', 'evas')), 21 include_directories(join_paths('..', 'evas')),
22 include_directories(join_paths('..', 'evas','canvas')), 22 include_directories(join_paths('..', 'evas','canvas')),
23 include_directories(join_paths('..', 'evas','common')), 23 include_directories(join_paths('..', 'evas','common')),
24 include_directories(join_paths('..', 'evas','common3d')),
25 include_directories(join_paths('..', 'evas','common3d', 'save_load')),
26 include_directories(join_paths('..', 'evas','include')), 24 include_directories(join_paths('..', 'evas','include')),
27 include_directories(join_paths('..', 'evas','filters')) 25 include_directories(join_paths('..', 'evas','filters'))
28] 26]
diff --git a/src/lib/ecore_con/ecore_con_url.c b/src/lib/ecore_con/ecore_con_url.c
index c92af111c9..ec1e5b1a0c 100644
--- a/src/lib/ecore_con/ecore_con_url.c
+++ b/src/lib/ecore_con/ecore_con_url.c
@@ -1419,3 +1419,8 @@ ecore_con_url_verbose_set(Ecore_Con_Url *url_con,
1419 } 1419 }
1420 _c->curl_easy_setopt(curl_easy, CURLOPT_VERBOSE, (long)url_con->verbose); 1420 _c->curl_easy_setopt(curl_easy, CURLOPT_VERBOSE, (long)url_con->verbose);
1421} 1421}
1422
1423/**
1424 * @}
1425 */
1426
diff --git a/src/lib/ecore_con/efl_net_control-connman.c b/src/lib/ecore_con/efl_net_control-connman.c
index 8334d4d0b2..ceb3541f31 100644
--- a/src/lib/ecore_con/efl_net_control-connman.c
+++ b/src/lib/ecore_con/efl_net_control-connman.c
@@ -212,6 +212,7 @@ _efl_net_control_agent_request_input(const Eldbus_Service_Interface *service, co
212 Efl_Net_Control_Agent_Request_Input event = { }; 212 Efl_Net_Control_Agent_Request_Input event = { };
213 Efl_Net_Control_Agent_Request_Input_Information *info; 213 Efl_Net_Control_Agent_Request_Input_Information *info;
214 Eldbus_Message_Iter *array, *entry; 214 Eldbus_Message_Iter *array, *entry;
215 Eina_Array infos;
215 const char *path; 216 const char *path;
216 217
217 DBG("Agent %p requested input %s", o, eldbus_message_path_get(msg)); 218 DBG("Agent %p requested input %s", o, eldbus_message_path_get(msg));
@@ -231,6 +232,8 @@ _efl_net_control_agent_request_input(const Eldbus_Service_Interface *service, co
231 if (!eldbus_message_arguments_get(msg, "oa{sv}", &path, &array)) 232 if (!eldbus_message_arguments_get(msg, "oa{sv}", &path, &array))
232 goto err; 233 goto err;
233 234
235 eina_array_step_set(&infos, sizeof (Eina_Array), 4);
236 event.informational = eina_array_accessor_new(&infos);
234 event.access_point = _efl_net_control_access_point_find(pd, path); 237 event.access_point = _efl_net_control_access_point_find(pd, path);
235 238
236 while (eldbus_message_iter_get_and_next(array, 'e', &entry)) 239 while (eldbus_message_iter_get_and_next(array, 'e', &entry))
@@ -261,7 +264,7 @@ _efl_net_control_agent_request_input(const Eldbus_Service_Interface *service, co
261 { 264 {
262 info = _efl_net_control_agent_informational_get(name, var); 265 info = _efl_net_control_agent_informational_get(name, var);
263 if (info) 266 if (info)
264 event.informational = eina_list_append(event.informational, info); 267 eina_array_push(&infos, info);
265 else 268 else
266 WRN("Unknown field name '%s'", name); 269 WRN("Unknown field name '%s'", name);
267 } 270 }
@@ -270,7 +273,9 @@ _efl_net_control_agent_request_input(const Eldbus_Service_Interface *service, co
270 pd->agent_request_input.msg = eldbus_message_ref((Eldbus_Message *)msg); 273 pd->agent_request_input.msg = eldbus_message_ref((Eldbus_Message *)msg);
271 efl_event_callback_call(o, EFL_NET_CONTROL_MANAGER_EVENT_AGENT_REQUEST_INPUT, &event); 274 efl_event_callback_call(o, EFL_NET_CONTROL_MANAGER_EVENT_AGENT_REQUEST_INPUT, &event);
272 275
273 EINA_LIST_FREE(event.informational, info) free(info); 276 eina_accessor_free(event.informational);
277 while ((info = eina_array_pop(&infos))) free(info);
278 eina_array_flush(&infos);
274 279
275 return NULL; /* reply later */ 280 return NULL; /* reply later */
276 281
diff --git a/src/lib/ecore_con/efl_net_control_manager.eo b/src/lib/ecore_con/efl_net_control_manager.eo
index 3c84235bf7..eb0a61477b 100644
--- a/src/lib/ecore_con/efl_net_control_manager.eo
+++ b/src/lib/ecore_con/efl_net_control_manager.eo
@@ -36,7 +36,7 @@ struct @beta Efl.Net.Control.Agent_Request_Input {
36 access_point: Efl.Net.Control.Access_Point; [[The access point which triggered this request.]] 36 access_point: Efl.Net.Control.Access_Point; [[The access point which triggered this request.]]
37 fields: Efl.Net.Control.Agent_Request_Input_Field; [[Bitwise OR of fields present in this request.]] 37 fields: Efl.Net.Control.Agent_Request_Input_Field; [[Bitwise OR of fields present in this request.]]
38 passphrase_type: string; [[Extra detail for the passphrase field, such as wep, psk, response (IEEE802.X GTC/OTP), string...]] 38 passphrase_type: string; [[Extra detail for the passphrase field, such as wep, psk, response (IEEE802.X GTC/OTP), string...]]
39 informational: list<Efl.Net.Control.Agent_Request_Input_Information>; [[Such as the previous passphrase, VPN host]] 39 informational: accessor<Efl.Net.Control.Agent_Request_Input_Information>; [[Such as the previous passphrase, VPN host]]
40} 40}
41 41
42struct @beta Efl.Net.Control.Agent_Error { 42struct @beta Efl.Net.Control.Agent_Error {
diff --git a/src/lib/ecore_con/efl_net_dialer_websocket.c b/src/lib/ecore_con/efl_net_dialer_websocket.c
index e6672e600c..a16579cfc6 100644
--- a/src/lib/ecore_con/efl_net_dialer_websocket.c
+++ b/src/lib/ecore_con/efl_net_dialer_websocket.c
@@ -86,14 +86,12 @@ _efl_net_dialer_websocket_close_reason_check(Efl_Net_Dialer_Websocket_Close_Reas
86 case EFL_NET_DIALER_WEBSOCKET_CLOSE_REASON_TOO_BIG: 86 case EFL_NET_DIALER_WEBSOCKET_CLOSE_REASON_TOO_BIG:
87 case EFL_NET_DIALER_WEBSOCKET_CLOSE_REASON_MISSING_EXTENSION: 87 case EFL_NET_DIALER_WEBSOCKET_CLOSE_REASON_MISSING_EXTENSION:
88 case EFL_NET_DIALER_WEBSOCKET_CLOSE_REASON_SERVER_ERROR: 88 case EFL_NET_DIALER_WEBSOCKET_CLOSE_REASON_SERVER_ERROR:
89 case EFL_NET_DIALER_WEBSOCKET_CLOSE_REASON_IANA_REGISTRY_START:
90 case EFL_NET_DIALER_WEBSOCKET_CLOSE_REASON_IANA_REGISTRY_END:
91 case EFL_NET_DIALER_WEBSOCKET_CLOSE_REASON_PRIVATE_START:
92 case EFL_NET_DIALER_WEBSOCKET_CLOSE_REASON_PRIVATE_END:
93 return EINA_TRUE; 89 return EINA_TRUE;
94 case EFL_NET_DIALER_WEBSOCKET_CLOSE_REASON_NO_REASON: 90 case EFL_NET_DIALER_WEBSOCKET_CLOSE_REASON_NO_REASON:
95 case EFL_NET_DIALER_WEBSOCKET_CLOSE_REASON_ABRUPTLY: 91 case EFL_NET_DIALER_WEBSOCKET_CLOSE_REASON_ABRUPTLY:
96 return EINA_FALSE; 92 return EINA_FALSE;
93 default:
94 break;
97 } 95 }
98 96
99 if ((r >= EFL_NET_DIALER_WEBSOCKET_CLOSE_REASON_IANA_REGISTRY_START) && 97 if ((r >= EFL_NET_DIALER_WEBSOCKET_CLOSE_REASON_IANA_REGISTRY_START) &&
diff --git a/src/lib/ecore_con/efl_net_server_unix.c b/src/lib/ecore_con/efl_net_server_unix.c
index 226d557c29..37d2c7302d 100644
--- a/src/lib/ecore_con/efl_net_server_unix.c
+++ b/src/lib/ecore_con/efl_net_server_unix.c
@@ -45,53 +45,61 @@
45typedef struct _Efl_Net_Server_Unix_Data 45typedef struct _Efl_Net_Server_Unix_Data
46{ 46{
47 unsigned int leading_directories_create_mode; 47 unsigned int leading_directories_create_mode;
48 Eina_Bool leading_directories_create; 48#ifdef BIND_HANG_WORKAROUND
49 Eina_Bool unlink_before_bind; 49 int lock_fd;
50 Eina_Bool have_lock_fd : 1;
51#endif
52 Eina_Bool leading_directories_create : 1;
53 Eina_Bool unlink_before_bind : 1;
50} Efl_Net_Server_Unix_Data; 54} Efl_Net_Server_Unix_Data;
51 55
52#ifdef BIND_HANG_WORKAROUND 56#ifdef BIND_HANG_WORKAROUND
53static Eina_Error 57static int
54_efl_net_server_unix_bind_hang_lock_workaround(const char *address, Eina_Bool lock) 58_efl_net_server_unix_bind_hang_lock_workaround(const char *address, Eina_Bool lock, int lockfile_fd)
55{ 59{
56 size_t addrlen; 60 size_t addrlen;
57 char *lockfile; 61 char *lockfile;
58 int lockfile_fd, ret; 62 int ret;
59 Eina_Error err = 0;
60
61 if (strncmp(address, "abstract:", strlen("abstract:")) == 0) return err;
62 63
63 addrlen = strlen(address); 64 addrlen = strlen(address);
64 lockfile = malloc(addrlen + 1 + 5); 65 lockfile = malloc(addrlen + 1 + 5);
65 if (!lockfile) return err; 66 if (!lockfile) return -1;
66 67
67 strcpy(lockfile, address); 68 strcpy(lockfile, address);
68 strncpy(lockfile + addrlen, ".lock", 6); 69 strncpy(lockfile + addrlen, ".lock", 6);
70 if (lock)
71 {
69#ifdef HAVE_OPEN_CLOEXEC 72#ifdef HAVE_OPEN_CLOEXEC
70 lockfile_fd = open(lockfile, O_RDWR | O_CREAT | O_TRUNC | O_CLOEXEC, 73 lockfile_fd = open(lockfile, O_RDWR | O_CREAT | O_TRUNC | O_CLOEXEC,
71 S_IRUSR | S_IWUSR); 74 S_IRUSR | S_IWUSR);
72 if (lockfile_fd < 0) return err; 75 if (lockfile_fd < 0) return -1;
73#else 76#else
74 lockfile_fd = open(lockfile, O_RDWR | O_CREAT | O_TRUNC, 77 lockfile_fd = open(lockfile, O_RDWR | O_CREAT | O_TRUNC,
75 S_IRUSR | S_IWUSR); 78 S_IRUSR | S_IWUSR);
76 if (lockfile_fd < 0) return err; 79 if (lockfile_fd < 0) return -1;
77 eina_file_close_on_exec(lockfile_fd, EINA_TRUE); 80 eina_file_close_on_exec(lockfile_fd, EINA_TRUE);
78#endif 81#endif
82 }
79 83
80 errno = 0; 84 errno = 0;
81 if (lock) 85 if (lock)
82 { 86 {
83 ret = flock(lockfile_fd, LOCK_EX | LOCK_NB); 87 ret = flock(lockfile_fd, LOCK_EX | LOCK_NB);
84 if ((ret != 0) && (errno == EWOULDBLOCK)) 88 if ((ret != 0) && (errno == EWOULDBLOCK))
85 err = EADDRINUSE; 89 {
90 close(lockfile_fd);
91 lockfile_fd = -1;
92 }
86 } 93 }
87 else 94 else
88 { 95 {
89 flock(lockfile_fd, LOCK_UN | LOCK_NB); 96 flock(lockfile_fd, LOCK_UN | LOCK_NB);
90 unlink(lockfile); 97 unlink(lockfile);
98 close(lockfile_fd);
99 lockfile_fd = -1;
91 } 100 }
92 close(lockfile_fd);
93 free(lockfile); 101 free(lockfile);
94 return err; 102 return lockfile_fd;
95} 103}
96#endif 104#endif
97 105
@@ -107,7 +115,13 @@ _efl_net_server_unix_efl_object_destructor(Eo *o, Efl_Net_Server_Unix_Data *pd E
107 { 115 {
108 unlink(address); 116 unlink(address);
109#ifdef BIND_HANG_WORKAROUND 117#ifdef BIND_HANG_WORKAROUND
110 _efl_net_server_unix_bind_hang_lock_workaround(address, EINA_FALSE); 118 if ((pd->have_lock_fd) && (pd->lock_fd >= 0))
119 {
120 _efl_net_server_unix_bind_hang_lock_workaround
121 (address, EINA_FALSE, pd->lock_fd);
122 pd->lock_fd = -1;
123 pd->have_lock_fd = EINA_FALSE;
124 }
111#endif 125#endif
112 } 126 }
113 } 127 }
@@ -173,8 +187,18 @@ _efl_net_server_unix_bind(Eo *o, Efl_Net_Server_Unix_Data *pd)
173 } 187 }
174 188
175#ifdef BIND_HANG_WORKAROUND 189#ifdef BIND_HANG_WORKAROUND
176 if (_efl_net_server_unix_bind_hang_lock_workaround(address, EINA_TRUE)) 190 if (addr.sun_path[0] != '\0')
177 goto error; 191 {
192 pd->lock_fd = _efl_net_server_unix_bind_hang_lock_workaround
193 (addr.sun_path, EINA_TRUE, -1);
194 if (pd->lock_fd < 0)
195 {
196 err = EADDRINUSE;
197 goto error;
198 }
199 pd->have_lock_fd = EINA_TRUE;
200 unlink(addr.sun_path);
201 }
178#endif 202#endif
179 r = bind(fd, (struct sockaddr *)&addr, addrlen); 203 r = bind(fd, (struct sockaddr *)&addr, addrlen);
180 if (r != 0) 204 if (r != 0)
diff --git a/src/lib/ecore_con/efl_net_ssl_conn-openssl.c b/src/lib/ecore_con/efl_net_ssl_conn-openssl.c
index fc8fb2e95f..8e7339c2ea 100644
--- a/src/lib/ecore_con/efl_net_ssl_conn-openssl.c
+++ b/src/lib/ecore_con/efl_net_ssl_conn-openssl.c
@@ -152,12 +152,18 @@ __efl_net_socket_bio_get(void)
152 if (efl_net_socket_bio) return efl_net_socket_bio; 152 if (efl_net_socket_bio) return efl_net_socket_bio;
153 efl_net_socket_bio = BIO_meth_new(0x400 /* 0x400 means source & sink */, 153 efl_net_socket_bio = BIO_meth_new(0x400 /* 0x400 means source & sink */,
154 "efl_net_socket wrapper"); 154 "efl_net_socket wrapper");
155 BIO_meth_set_write(efl_net_socket_bio, efl_net_socket_bio_write); 155 if (!efl_net_socket_bio) return NULL;
156 BIO_meth_set_read(efl_net_socket_bio, efl_net_socket_bio_read); 156 if (!BIO_meth_set_write(efl_net_socket_bio, efl_net_socket_bio_write)
157 BIO_meth_set_puts(efl_net_socket_bio, efl_net_socket_bio_puts); 157 || !BIO_meth_set_read(efl_net_socket_bio, efl_net_socket_bio_read)
158 BIO_meth_set_ctrl(efl_net_socket_bio, efl_net_socket_bio_ctrl); 158 || !BIO_meth_set_puts(efl_net_socket_bio, efl_net_socket_bio_puts)
159 BIO_meth_set_create(efl_net_socket_bio, efl_net_socket_bio_create); 159 || !BIO_meth_set_ctrl(efl_net_socket_bio, efl_net_socket_bio_ctrl)
160 BIO_meth_set_destroy(efl_net_socket_bio, efl_net_socket_bio_destroy); 160 || !BIO_meth_set_create(efl_net_socket_bio, efl_net_socket_bio_create)
161 || !BIO_meth_set_destroy(efl_net_socket_bio, efl_net_socket_bio_destroy))
162 {
163 BIO_meth_free(efl_net_socket_bio);
164 efl_net_socket_bio = NULL;
165 return NULL;
166 }
161 // FIXME: some day we need to clean up, but for now a singleton alloc is ok 167 // FIXME: some day we need to clean up, but for now a singleton alloc is ok
162 // BIO_meth_free(efl_net_socket_bio); 168 // BIO_meth_free(efl_net_socket_bio);
163 return efl_net_socket_bio; 169 return efl_net_socket_bio;
diff --git a/src/lib/ecore_evas/Ecore_Evas.h b/src/lib/ecore_evas/Ecore_Evas.h
index d59900d788..f53586a866 100644
--- a/src/lib/ecore_evas/Ecore_Evas.h
+++ b/src/lib/ecore_evas/Ecore_Evas.h
@@ -1003,8 +1003,8 @@ EAPI int ecore_evas_aux_hint_id_get(const Ecore_Evas *ee, const cha
1003 * @see eecore_evas_callback_msg_handle_set() 1003 * @see eecore_evas_callback_msg_handle_set()
1004 * 1004 *
1005 * This is a list of examples of these functions: 1005 * This is a list of examples of these functions:
1006 * @li @ref ecore_evas_extn_socket_example 1006 * @li ecore_evas_extn_socket_example
1007 * @li @ref ecore_evas_extn_plug_example 1007 * @li ecore_evas_extn_plug_example
1008 */ 1008 */
1009EAPI void ecore_evas_msg_parent_send(Ecore_Evas *ee, int msg_domain, int msg_id, void *data, int size); 1009EAPI void ecore_evas_msg_parent_send(Ecore_Evas *ee, int msg_domain, int msg_id, void *data, int size);
1010 1010
@@ -1637,7 +1637,7 @@ EAPI Ecore_Cocoa_Window *ecore_evas_cocoa_window_get(const Ecore_Evas *ee);
1637/** 1637/**
1638 * @brief Create an Ecore_Evas window using the drm engine. 1638 * @brief Create an Ecore_Evas window using the drm engine.
1639 * 1639 *
1640 * @param disp_name Name of the Wayland display to connect to. 1640 * @param device Name of the Wayland display to connect to.
1641 * @param parent (Unused) 1641 * @param parent (Unused)
1642 * @param x Horizontal position of the Ecore_Evas window. 1642 * @param x Horizontal position of the Ecore_Evas window.
1643 * @param y Vertical position of the Ecore_Evas window. 1643 * @param y Vertical position of the Ecore_Evas window.
@@ -1657,7 +1657,7 @@ EAPI Ecore_Evas *ecore_evas_drm_new(const char *device, unsigned int parent,
1657/** 1657/**
1658 * @brief Create an Ecore_Evas window using the drm engine with GL support. 1658 * @brief Create an Ecore_Evas window using the drm engine with GL support.
1659 * 1659 *
1660 * @param disp_name Name of the Wayland display to connect to. 1660 * @param device Name of the Wayland display to connect to.
1661 * @param parent (Unused) 1661 * @param parent (Unused)
1662 * @param x Horizontal position of the Ecore_Evas window. 1662 * @param x Horizontal position of the Ecore_Evas window.
1663 * @param y Vertical position of the Ecore_Evas window. 1663 * @param y Vertical position of the Ecore_Evas window.
@@ -2033,10 +2033,7 @@ EAPI Ecore_Evas *ecore_evas_cocoa_new(Ecore_Cocoa_Window *parent,
2033 * @brief Creates a new @c Ecore_Evas canvas bound to the Evas 2033 * @brief Creates a new @c Ecore_Evas canvas bound to the Evas
2034 * @b psl1ght engine. 2034 * @b psl1ght engine.
2035 * 2035 *
2036 * @param parent ID of the parent window this Ecore_Evas window belongs 2036 * @param name Deprecated.
2037 * to, or 0 if this is a top-level window.
2038 * @param x Horizontal position of window, in pixels
2039 * @param y Vertical position of window, in pixels
2040 * @param w Width of the canvas, in pixels. 2037 * @param w Width of the canvas, in pixels.
2041 * @param h Height of the canvas, in pixels. 2038 * @param h Height of the canvas, in pixels.
2042 * 2039 *
@@ -3186,7 +3183,7 @@ typedef void (*Ecore_Evas_Vnc_Client_Disconnected_Cb)(void *data, Ecore_Evas *ee
3186 * @param port The port number to start the VNC server. Use @c -1 to set the default VNC port (5900) 3183 * @param port The port number to start the VNC server. Use @c -1 to set the default VNC port (5900)
3187 * @param accept_cb A callback used to accept a new client. If @c NULL all clients will be accepted. 3184 * @param accept_cb A callback used to accept a new client. If @c NULL all clients will be accepted.
3188 * @param disc_cb A callback used to inform that a client has disconnected. It may be @c NULL. 3185 * @param disc_cb A callback used to inform that a client has disconnected. It may be @c NULL.
3189 * @param data Data to pass to @a accept_cb and @disc_cb 3186 * @param data Data to pass to @p accept_cb and @p disc_cb
3190 * @return an Evas_Object that take everything under it to represent the view of the client. 3187 * @return an Evas_Object that take everything under it to represent the view of the client.
3191 * 3188 *
3192 * @see ecore_evas_vnc_stop() 3189 * @see ecore_evas_vnc_stop()
@@ -3203,7 +3200,6 @@ EAPI Evas_Object *ecore_evas_vnc_start(Ecore_Evas *ee, const char *addr, int por
3203/** 3200/**
3204 * @brief Sets a callback for building new Evas. 3201 * @brief Sets a callback for building new Evas.
3205 * 3202 *
3206 * @param ee The Ecore_Evas to set callbacks on
3207 * @param func The function to call 3203 * @param func The function to call
3208 * 3204 *
3209 * A call to this function will set a callback on an Ecore_Evas, causing 3205 * A call to this function will set a callback on an Ecore_Evas, causing
@@ -3669,6 +3665,216 @@ EAPI unsigned long ecore_evas_pixmap_colormap_get(const Ecore_Evas *ee);
3669 */ 3665 */
3670EAPI int ecore_evas_pixmap_depth_get(const Ecore_Evas *ee); 3666EAPI int ecore_evas_pixmap_depth_get(const Ecore_Evas *ee);
3671 3667
3668typedef enum {
3669 ECORE_EVAS_SELECTION_BUFFER_SELECTION_BUFFER = 0, /**< Stores selected / highlighted selection */
3670 ECORE_EVAS_SELECTION_BUFFER_COPY_AND_PASTE_BUFFER = 1, /**< Stores copied things (Ctrl + C) */
3671 ECORE_EVAS_SELECTION_BUFFER_DRAG_AND_DROP_BUFFER = 2, /**< Stores dragged things while drag and drop is happening. */
3672 ECORE_EVAS_SELECTION_BUFFER_LAST = 3,
3673} Ecore_Evas_Selection_Buffer;
3674
3675/**
3676 * @brief Callback called when the content of one of the selection buffers changes.
3677 *
3678 * @param[in] ee The Ecore_Evas that handles this selection.
3679 * @param[in] selection The selection buffer that has changed.
3680 */
3681typedef void (*Ecore_Evas_Selection_Changed_Cb)(Ecore_Evas *ee, unsigned int seat, Ecore_Evas_Selection_Buffer selection);
3682
3683/**
3684 * @brief Sets a callback for Ecore_Evas to be called when a selection buffer changes.
3685 *
3686 * @param[in] ee The Ecore_Evas to set the callback on.
3687 * @param[in] cb The function to call.
3688 *
3689 * A call to this function will set a callback on an Ecore_Evas, causing
3690 * @p func to be called whenever @p ee selections change.
3691 * Only one such callback can exist for each Ecore_Evas. Calling this method multiple
3692 * times overwrites previous functions. Use a NULL @p func to stop being notified.
3693 *
3694 * @warning If and when this function is called depends on the underlying
3695 * windowing system.
3696 */
3697EAPI void ecore_evas_callback_selection_changed_set(Ecore_Evas *ee, Ecore_Evas_Selection_Changed_Cb cb);
3698
3699/**
3700 * @brief Sets the content of the specified selection buffer.
3701 *
3702 * @param[in] ee The Ecore_Evas to set the selection buffer on.
3703 * @param[in] buffer The selection buffer to set.
3704 * @param[in] content Content to set to the selection buffer. The Eina_Content specifies the MIME type of the data.
3705 * Ownership of the content is transferred.
3706 *
3707 * @note Only ECORE_EVAS_SELECTION_BUFFER_SELECTION_BUFFER and ECORE_EVAS_SELECTION_BUFFER_COPY_AND_PASTE_BUFFER
3708 * buffers can be set. Drag and drop operations use a different set of methods.
3709 */
3710EAPI Eina_Bool ecore_evas_selection_set(Ecore_Evas *ee, unsigned int seat, Ecore_Evas_Selection_Buffer buffer, Eina_Content *content);
3711
3712/**
3713 * @brief Checks if the specified selection buffer has content.
3714 *
3715 * @param[in] ee The ecore evas to query
3716 * @param[in] buffer Which selection buffer to ask
3717 *
3718 * @return EINA_TRUE if there is an available selection for the specified buffer.
3719 *
3720 * EINA_TRUE is also returned when the selection is in the window associated with @p ee
3721 *
3722 * @note Due to the asynchronous nature of selection buffers, this method might not return
3723 * the right result when invoked from the selection callback set with ecore_evas_callback_selection_changed_set.
3724 */
3725EAPI Eina_Bool ecore_evas_selection_exists(Ecore_Evas *ee, unsigned int seat, Ecore_Evas_Selection_Buffer buffer);
3726
3727/**
3728 * @brief Retrieves the content of the specified selection buffer.
3729 *
3730 * @param[in] ee The ecore evas to query.
3731 * @param[in] buffer Selection buffer to retrieve.
3732 * @param[in] acceptable_types MIME types which are acceptable for the returned Eina_Content.
3733 * The iterator contains plain strings (char *). Ownership is transferred for the iterator but not for the strings.
3734 * This is convenient for the usual case of a hard-coded array of strings, since the iterator can be generated
3735 * on the fly, used and forgotten.
3736 *
3737 * @return An Eina_Future containing an Eina_Content which has one of the types in @p acceptable_type.
3738 * An error is delivered when no matching type is found or when the requested selection buffer is empty.
3739 *
3740 * This method is time consuming, therefore, it is recommended to verify the existence of a selection
3741 * using ecore_evas_selection_exists before calling it.
3742 */
3743EAPI Eina_Future* ecore_evas_selection_get(Ecore_Evas *ee, unsigned int seat, Ecore_Evas_Selection_Buffer buffer, Eina_Iterator *acceptable_types);
3744
3745/**
3746 * @brief This method is called when the mouse pointer enters or exits the specified window while
3747 * performing a drag operation.
3748 *
3749 * @param[in] ee The Ecore Evas the drag operation started on.
3750 * @param[in] p Position (in window coordinates) where the event occurred.
3751 * @param[in] inside @c EINA_TRUE if the pointer just entered this window. @c EINA_FALSE if it has just exited.
3752 *
3753 * Set this callback using ecore_evas_callback_drop_state_changed_set.
3754 */
3755typedef void (*Ecore_Evas_Drag_Finished_Cb)(Ecore_Evas *ee, unsigned int seat, void *data, Eina_Bool accepted);
3756
3757/**
3758 * @brief Starts a new drag operation.
3759 *
3760 * @param[in] ee The Ecore Evas the drag operation started on.
3761 * @param[in] content The content to delivery at the drop site (ownership is transferred).
3762 * The Eina_Content has data and its associated MIME type, plus a list of alternate types that can be provided.
3763 * @param[in] drag_rep An Ecore_Evas used as a visual representation of the content being dragged.
3764 * It must have the same type as @p ee. This is the transparent object dragged along the mouse pointer to indicate that
3765 * a drag operation is in progress.
3766 * @p terminate_cb will be called when @p drag_rep is not needed anymore and it must be disposed of.
3767 * Use @p data to convey @p drag_rep to @p terminate_cb. For example, if @p drag_rep is owned by an Efl_Window, @p data
3768 * can point to that window.
3769 * @param[in] action Action the target application should perform upon receiving this content. It is entirely up to the
3770 * target application to honor (or even understand) this request.
3771 * @return @c EINA_TRUE if the drag operation has been successfully started.
3772 *
3773 * This method must be called when a drag operation is initiated in order to provide the necessary information.
3774 */
3775EAPI Eina_Bool ecore_evas_drag_start(Ecore_Evas *ee, unsigned int seat, Eina_Content *content, Ecore_Evas *drag_rep,
3776 const char* action, Ecore_Evas_Drag_Finished_Cb terminate_cb, void *data);
3777
3778/**
3779 * @brief Cancels an ongoing drag operation.
3780 *
3781 * @param[in] ee The Ecore Evas the drag operation started on.
3782 * @return @c EINA_TRUE if the drag operation has been successfully cancelled.
3783 *
3784 * The initiator of a drag operation can call this method to abort it.
3785 */
3786EAPI Eina_Bool ecore_evas_drag_cancel(Ecore_Evas *ee, unsigned int seat);
3787
3788/**
3789 * @brief This method is called when the mouse pointer enters or exits the specified window while
3790 * performing a drag operation.
3791 *
3792 * @param[in] ee The Ecore Evas the drag operation started on.
3793 * @param[in] p Position (in window coordinates) where the event occurred.
3794 * @param[in] inside @c EINA_TRUE if the pointer just entered this window. @c EINA_FALSE if it has just exited.
3795 *
3796 * Set this callback using ecore_evas_callback_drop_state_changed_set.
3797 */
3798typedef void (*Ecore_Evas_Drag_State_Changed_Cb)(Ecore_Evas *ee, unsigned int seat, Eina_Position2D p, Eina_Bool inside);
3799
3800/**
3801 * @brief Sets the method (callback) to call when the mouse pointer enters or exits the specified window while
3802 * performing a drag operation.
3803 *
3804 * @param[in] ee The Ecore Evas the drag operation started on.
3805 * @param[in] cb Method to call when the events are received.
3806 *
3807 * Only one such callback can exist for each Ecore_Evas. Calling this method multiple
3808 * times overwrites previous functions. Use a NULL @p cb func to stop being notified.
3809 */
3810EAPI void ecore_evas_callback_drop_state_changed_set(Ecore_Evas *ee, Ecore_Evas_Drag_State_Changed_Cb cb);
3811
3812/**
3813 * @brief This method is called when the mouse pointer moves over the specified window while
3814 * performing a drag operation.
3815 *
3816 * @param[in] ee The Ecore Evas the drag operation started on.
3817 * @param[in] p Position (in window coordinates) where the event occurred.
3818 *
3819 * Set this callback using ecore_evas_callback_drop_motion_set.
3820 */
3821
3822typedef void (*Ecore_Evas_Drag_Motion_Cb)(Ecore_Evas *ee, unsigned int seat, Eina_Position2D p);
3823/**
3824 * @brief Sets the method (callback) to call when the mouse pointer moves over the specified window while
3825 * performing a drag operation.
3826 *
3827 * @param[in] ee The Ecore Evas the drag operation started on.
3828 * @param[in] cb Method to call when the events are received.
3829 *
3830 * Only one such callback can exist for each Ecore_Evas. Calling this method multiple
3831 * times overwrites previous functions. Use a NULL @p cb func to stop being notified.
3832 */
3833EAPI void ecore_evas_callback_drop_motion_set(Ecore_Evas *ee, Ecore_Evas_Drag_Motion_Cb cb);
3834
3835/**
3836 * @brief This method is called when the mouse pointer is released over the specified window while
3837 * performing a drag operation (thus dropping the dragged content over the window).
3838 *
3839 * @param[in] ee The Ecore Evas the drag operation started on.
3840 * @param[in] p Position (in window coordinates) where the event occurred.
3841 *
3842 * The dropped data can be retrieved using ecore_evas_selection_get and the
3843 * ECORE_EVAS_SELECTION_BUFFER_DRAG_AND_DROP_BUFFER buffer.
3844 *
3845 * Set this callback using ecore_evas_callback_drop_drop_set.
3846 */
3847typedef void (*Ecore_Evas_Drop_Cb)(Ecore_Evas *ee, unsigned int seat, Eina_Position2D p, const char *action);
3848
3849/**
3850 * @brief Sets the method (callback) to call when the mouse pointer is released over the specified window while
3851 * performing a drag operation (thus dropping the dragged content over the window).
3852 *
3853 * @param[in] ee The Ecore Evas the drag operation started on.
3854 * @param[in] cb Method to call when the events are received.
3855 *
3856 * Only one such callback can exist for each Ecore_Evas. Calling this method multiple
3857 * times overwrites previous functions. Use a NULL @p cb func to stop being notified.
3858 */
3859EAPI void ecore_evas_callback_drop_drop_set(Ecore_Evas *ee, Ecore_Evas_Drop_Cb cb);
3860
3861/**
3862 * @brief Retrieves the list of types the data currently being dragged can be automatically converted to.
3863 *
3864 * @param[in] ee The Ecore Evas the drag operation started on.
3865 * @return
3866 *
3867 * This can be used in any of the drag and drop callbacks (Ecore_Evas_Drag_State_Changed_Cb, Ecore_Evas_Drag_Motion_Cb
3868 * and Ecore_Evas_Drop_Cb) to check if the data being dragged is acceptable and give the user some early feedback
3869 * before the data is actually dropped on the window.
3870 *
3871 * This is functionally equivalent to calling ecore_evas_selection_get and examining the available types in the
3872 * returned Eina_Content, but much faster since the actual data does not have to be asynchronously requested to the
3873 * initiator application.
3874 */
3875EAPI Eina_Accessor* ecore_evas_drop_available_types_get(Ecore_Evas *ee, unsigned int seat);
3876
3877
3672/** 3878/**
3673 * @} 3879 * @}
3674 */ 3880 */
@@ -3685,3 +3891,4 @@ EAPI int ecore_evas_pixmap_depth_get(const Ecore_Evas *ee);
3685#define EAPI 3891#define EAPI
3686 3892
3687#endif 3893#endif
3894
diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c
index d3c26ddb19..75a0de18a6 100644
--- a/src/lib/ecore_evas/ecore_evas.c
+++ b/src/lib/ecore_evas/ecore_evas.c
@@ -652,6 +652,10 @@ ecore_evas_init(void)
652 iface.del = _ecore_evas_animator_del; 652 iface.del = _ecore_evas_animator_del;
653 ecore_evas_object_animator_init(&iface); 653 ecore_evas_object_animator_init(&iface);
654 654
655 ecore_evas_no_matching_type = eina_error_msg_register("No fitting type could be found");
656 ecore_evas_no_selection = eina_error_msg_register("No selection available");
657 ecore_evas_request_replaced = eina_error_msg_register("Selection request replaced");
658
655 return _ecore_evas_init_count; 659 return _ecore_evas_init_count;
656 660
657 shutdown_ecore: 661 shutdown_ecore:
@@ -2818,7 +2822,7 @@ ecore_evas_shadow_geometry_get(const Ecore_Evas *ee, int *l, int *r, int *t, int
2818 if (b) *b = ee->shadow.b; 2822 if (b) *b = ee->shadow.b;
2819} 2823}
2820 2824
2821EAPI void 2825EAPI void
2822ecore_evas_pointer_xy_get(const Ecore_Evas *ee, Evas_Coord *x, Evas_Coord *y) 2826ecore_evas_pointer_xy_get(const Ecore_Evas *ee, Evas_Coord *x, Evas_Coord *y)
2823{ 2827{
2824 if (x) *x = 0; 2828 if (x) *x = 0;
@@ -2828,7 +2832,7 @@ ecore_evas_pointer_xy_get(const Ecore_Evas *ee, Evas_Coord *x, Evas_Coord *y)
2828 IFE; 2832 IFE;
2829} 2833}
2830 2834
2831EAPI Eina_Bool 2835EAPI Eina_Bool
2832ecore_evas_pointer_warp(const Ecore_Evas *ee, Evas_Coord x, Evas_Coord y) 2836ecore_evas_pointer_warp(const Ecore_Evas *ee, Evas_Coord x, Evas_Coord y)
2833{ 2837{
2834 ECORE_EVAS_CHECK(ee, EINA_FALSE); 2838 ECORE_EVAS_CHECK(ee, EINA_FALSE);
@@ -2905,7 +2909,7 @@ ecore_evas_pixmap_visual_get(const Ecore_Evas *ee)
2905 return NULL; 2909 return NULL;
2906} 2910}
2907 2911
2908EAPI unsigned long 2912EAPI unsigned long
2909ecore_evas_pixmap_colormap_get(const Ecore_Evas *ee) 2913ecore_evas_pixmap_colormap_get(const Ecore_Evas *ee)
2910{ 2914{
2911 ECORE_EVAS_CHECK(ee, 0); 2915 ECORE_EVAS_CHECK(ee, 0);
@@ -2932,7 +2936,7 @@ ecore_evas_pixmap_colormap_get(const Ecore_Evas *ee)
2932 return 0; 2936 return 0;
2933} 2937}
2934 2938
2935EAPI int 2939EAPI int
2936ecore_evas_pixmap_depth_get(const Ecore_Evas *ee) 2940ecore_evas_pixmap_depth_get(const Ecore_Evas *ee)
2937{ 2941{
2938 ECORE_EVAS_CHECK(ee, 0); 2942 ECORE_EVAS_CHECK(ee, 0);
@@ -3524,6 +3528,9 @@ _ecore_evas_free(Ecore_Evas *ee)
3524 free(iface); 3528 free(iface);
3525 3529
3526 ee->engine.ifaces = NULL; 3530 ee->engine.ifaces = NULL;
3531
3532 if (ee->fallback_interface)
3533 fallback_selection_shutdown(ee);
3527 free(ee); 3534 free(ee);
3528} 3535}
3529 3536
@@ -3542,7 +3549,7 @@ _ecore_evas_idle_timeout_update(Ecore_Evas *ee)
3542{ 3549{
3543 if (ee->engine.idle_flush_timer) 3550 if (ee->engine.idle_flush_timer)
3544 ecore_timer_del(ee->engine.idle_flush_timer); 3551 ecore_timer_del(ee->engine.idle_flush_timer);
3545 ee->engine.idle_flush_timer = 3552 ee->engine.idle_flush_timer =
3546 ecore_timer_loop_add(IDLE_FLUSH_TIME, _ecore_evas_cb_idle_flush, ee); 3553 ecore_timer_loop_add(IDLE_FLUSH_TIME, _ecore_evas_cb_idle_flush, ee);
3547} 3554}
3548 3555
@@ -4007,7 +4014,7 @@ ecore_evas_software_x11_pixmap_new(const char *disp_name, Ecore_X_Window parent,
4007 4014
4008} 4015}
4009 4016
4010EAPI Ecore_X_Pixmap 4017EAPI Ecore_X_Pixmap
4011ecore_evas_software_x11_pixmap_get(const Ecore_Evas *ee) 4018ecore_evas_software_x11_pixmap_get(const Ecore_Evas *ee)
4012{ 4019{
4013 Ecore_Evas_Interface_Software_X11 *iface; 4020 Ecore_Evas_Interface_Software_X11 *iface;
@@ -4082,7 +4089,7 @@ ecore_evas_gl_x11_pixmap_new(const char *disp_name, Ecore_X_Window parent, int x
4082 4089
4083} 4090}
4084 4091
4085EAPI Ecore_X_Pixmap 4092EAPI Ecore_X_Pixmap
4086ecore_evas_gl_x11_pixmap_get(const Ecore_Evas *ee) 4093ecore_evas_gl_x11_pixmap_get(const Ecore_Evas *ee)
4087{ 4094{
4088 Ecore_Evas_Interface_Gl_X11 *iface; 4095 Ecore_Evas_Interface_Gl_X11 *iface;
@@ -5449,3 +5456,344 @@ _ecore_evas_animator_thaw(Ecore_Animator *in)
5449 EINA_INLIST_GET(animator)); 5456 EINA_INLIST_GET(animator));
5450 _ticking_start(ee); 5457 _ticking_start(ee);
5451} 5458}
5459
5460EAPI void
5461ecore_evas_callback_selection_changed_set(Ecore_Evas *ee, Ecore_Evas_Selection_Changed_Cb func)
5462{
5463 ECORE_EVAS_CHECK(ee);
5464 ee->func.fn_selection_changed = func;
5465}
5466
5467static Ecore_Evas_Selection_Seat_Buffers*
5468_fetch_selection_buffers_of_seat(Ecore_Evas *ee, unsigned int seat, Eina_Bool create)
5469{
5470 Ecore_Evas_Selection_Seat_Buffers *buffers;
5471 if (!ee->selection_buffers)
5472 ee->selection_buffers = eina_hash_int32_new(free);
5473
5474 buffers = eina_hash_find(ee->selection_buffers, &seat);
5475
5476 if (!buffers && create)
5477 {
5478 buffers = calloc(1, sizeof(Ecore_Evas_Selection_Seat_Buffers));
5479 buffers->seat = seat;
5480 eina_hash_add(ee->selection_buffers, &seat, buffers);
5481 }
5482 return buffers;
5483}
5484
5485static Eina_Bool
5486_deliver_cb(Ecore_Evas *ee, unsigned int seat, Ecore_Evas_Selection_Buffer buffer, const char *type, Eina_Rw_Slice *slice)
5487{
5488 Ecore_Evas_Selection_Seat_Buffers *buffers;
5489 Eina_Content *content;
5490 Eina_Content *converted = NULL;
5491 Eina_Bool result = EINA_FALSE;
5492
5493 INF("Delivery request on seat %d in buffer %d", seat, buffer);
5494
5495 buffers = _fetch_selection_buffers_of_seat(ee, seat, EINA_FALSE);
5496 EINA_SAFETY_ON_NULL_GOTO(buffers, free_everything);
5497 content = buffers->selection_buffer[buffer];
5498 EINA_SAFETY_ON_NULL_GOTO(content, free_everything);
5499 if (!eina_streq(type, eina_content_type_get(content)))
5500 converted = eina_content_convert(content, type);
5501 else
5502 converted = content;
5503
5504 EINA_SAFETY_ON_NULL_GOTO(converted, free_everything);
5505 *slice = eina_slice_dup(eina_content_data_get(converted));
5506 result = EINA_TRUE;
5507
5508 if (buffer == ECORE_EVAS_SELECTION_BUFFER_DRAG_AND_DROP_BUFFER)
5509 {
5510 ee->drag.accepted = EINA_TRUE;
5511 }
5512
5513free_everything:
5514 if (converted && content && !eina_streq(type, eina_content_type_get(content)))
5515 eina_content_free(converted);
5516
5517 return result;
5518}
5519
5520static void
5521_cancel_cb(Ecore_Evas *ee, unsigned int seat, Ecore_Evas_Selection_Buffer buffer)
5522{
5523 Ecore_Evas_Selection_Seat_Buffers *buffers;
5524
5525 INF("Cancel request on seat %d in buffer %d", seat, buffer);
5526
5527 buffers = _fetch_selection_buffers_of_seat(ee, seat, EINA_FALSE);
5528 EINA_SAFETY_ON_FALSE_RETURN(buffers);
5529 EINA_SAFETY_ON_FALSE_RETURN(buffers->selection_buffer[buffer]);
5530 eina_content_free(buffers->selection_buffer[buffer]);
5531 buffers->selection_buffer[buffer] = NULL;
5532
5533 if (buffer == ECORE_EVAS_SELECTION_BUFFER_DRAG_AND_DROP_BUFFER)
5534 {
5535 ee->drag.rep = NULL;
5536 if (ee->drag.free)
5537 ee->drag.free(ee, seat, ee->drag.data, EINA_FALSE);
5538 ee->drag.free = NULL;
5539 }
5540}
5541
5542#define CALL(call) (ee->engine.func->fn_ ##call ? : fallback_ ##call)
5543
5544static Eina_Array*
5545_iterator_to_array(Eina_Iterator *iter, const char *existing_type)
5546{
5547 Eina_Array *ret = eina_array_new(10);
5548 const char *type;
5549
5550 if (existing_type)
5551 eina_array_push(ret, existing_type);
5552
5553 EINA_ITERATOR_FOREACH(iter, type)
5554 {
5555 eina_array_push(ret, type);
5556 }
5557 eina_iterator_free(iter);
5558
5559 return ret;
5560}
5561
5562EAPI Eina_Bool
5563ecore_evas_selection_set(Ecore_Evas *ee, unsigned int seat, Ecore_Evas_Selection_Buffer buffer, Eina_Content *content)
5564{
5565 EINA_SAFETY_ON_NULL_RETURN_VAL(ee, EINA_FALSE);
5566 EINA_SAFETY_ON_FALSE_RETURN_VAL(buffer >= 0 && buffer < ECORE_EVAS_SELECTION_BUFFER_LAST, EINA_FALSE);
5567 Eina_Iterator *available_type = NULL;
5568 Eina_Bool success;
5569 Ecore_Evas_Selection_Seat_Buffers *buffers;
5570
5571 INF("Selection set on seat %d in buffer %d", seat, buffer);
5572
5573 if (buffer == ECORE_EVAS_SELECTION_BUFFER_DRAG_AND_DROP_BUFFER)
5574 {
5575 ERR("You cannot set a selection with this API, please use the API to start a drag operation");
5576 return EINA_FALSE;
5577 }
5578
5579 buffers = _fetch_selection_buffers_of_seat(ee, seat, EINA_TRUE);
5580
5581 if (content)
5582 available_type = eina_content_possible_conversions(content);
5583
5584 success = CALL(selection_claim)(ee, seat, buffer, _iterator_to_array(available_type, content ? eina_content_type_get(content) : NULL), content ? _deliver_cb : NULL, content ? _cancel_cb : NULL);
5585 if (success)
5586 {
5587 EINA_SAFETY_ON_FALSE_RETURN_VAL(buffers->selection_buffer[buffer] == NULL, EINA_FALSE);
5588 //keep this after the claim, the claim might call cancel, which would overwrite this.
5589 buffers->selection_buffer[buffer] = content;
5590 }
5591 else if (content)
5592 {
5593 eina_content_free(content);
5594 }
5595
5596 return success;
5597}
5598
5599EAPI Eina_Bool
5600ecore_evas_selection_exists(Ecore_Evas *ee, unsigned int seat, Ecore_Evas_Selection_Buffer buffer)
5601{
5602 EINA_SAFETY_ON_NULL_RETURN_VAL(ee, EINA_FALSE);
5603 EINA_SAFETY_ON_FALSE_RETURN_VAL(buffer >= 0 && buffer < ECORE_EVAS_SELECTION_BUFFER_LAST, EINA_FALSE);
5604 Ecore_Evas_Selection_Seat_Buffers *buffers;
5605
5606 INF("Exists request on seat %d in buffer %d", seat, buffer);
5607
5608 buffers = _fetch_selection_buffers_of_seat(ee, seat, EINA_TRUE);
5609 if (buffers->selection_buffer[buffer])
5610 return EINA_TRUE;
5611 else
5612 {
5613 return CALL(selection_has_owner)(ee, seat, buffer);
5614 }
5615}
5616
5617static Eina_Array*
5618_iterator_to_array_stringshared(Eina_Iterator *iter)
5619{
5620 Eina_Array *ret = eina_array_new(10);
5621 const char *type;
5622
5623 EINA_ITERATOR_FOREACH(iter, type)
5624 {
5625 eina_array_push(ret, eina_stringshare_add(type));
5626 }
5627 eina_iterator_free(iter);
5628
5629 return ret;
5630}
5631
5632EAPI Eina_Future*
5633ecore_evas_selection_get(Ecore_Evas *ee, unsigned int seat, Ecore_Evas_Selection_Buffer buffer, Eina_Iterator *acceptable_types)
5634{
5635 EINA_SAFETY_ON_NULL_RETURN_VAL(ee, NULL);
5636 EINA_SAFETY_ON_FALSE_RETURN_VAL(buffer >= 0 && buffer < ECORE_EVAS_SELECTION_BUFFER_LAST, NULL);
5637
5638 INF("Selection get request on seat %d in buffer %d", seat, buffer);
5639
5640 return CALL(selection_request)(ee, seat, buffer, _iterator_to_array_stringshared(acceptable_types));
5641}
5642
5643EAPI Eina_Bool
5644ecore_evas_drag_start(Ecore_Evas *ee, unsigned int seat, Eina_Content *content, Ecore_Evas *drag_rep, const char* action, Ecore_Evas_Drag_Finished_Cb terminate_cb, void *data)
5645{
5646 EINA_SAFETY_ON_NULL_RETURN_VAL(ee, EINA_FALSE);
5647 EINA_SAFETY_ON_NULL_RETURN_VAL(content, EINA_FALSE);
5648 Eina_Iterator *available_type = eina_content_possible_conversions(content);
5649 Eina_Bool success;
5650 Ecore_Evas_Selection_Seat_Buffers *buffers;
5651
5652 INF("Drag start on seat %d", seat);
5653
5654 buffers = _fetch_selection_buffers_of_seat(ee, seat, EINA_TRUE);
5655 success = CALL(dnd_start)(ee, seat, _iterator_to_array(available_type, eina_content_type_get(content)), drag_rep, _deliver_cb, _cancel_cb, action);
5656 EINA_SAFETY_ON_FALSE_RETURN_VAL(buffers->selection_buffer[ECORE_EVAS_SELECTION_BUFFER_DRAG_AND_DROP_BUFFER] == NULL, EINA_FALSE);
5657 //keep this after the claim, the claim might call cancel, which would overwrite this.
5658 buffers->selection_buffer[ECORE_EVAS_SELECTION_BUFFER_DRAG_AND_DROP_BUFFER] = content;
5659
5660 ee->drag.rep = drag_rep;
5661 ee->drag.free = terminate_cb;
5662 ee->drag.data = data;
5663 ee->drag.accepted = EINA_FALSE;
5664
5665 return success;
5666}
5667
5668EAPI Eina_Bool
5669ecore_evas_drag_cancel(Ecore_Evas *ee, unsigned int seat)
5670{
5671 EINA_SAFETY_ON_NULL_RETURN_VAL(ee, EINA_FALSE);
5672
5673 INF("Drag cancel on seat %d", seat);
5674
5675 return CALL(dnd_stop)(ee, seat);
5676}
5677
5678EAPI void
5679ecore_evas_callback_drop_motion_set(Ecore_Evas *ee, Ecore_Evas_Drag_Motion_Cb cb)
5680{
5681 ECORE_EVAS_CHECK(ee);
5682 ee->func.fn_dnd_motion = cb;
5683}
5684
5685EAPI void
5686ecore_evas_callback_drop_state_changed_set(Ecore_Evas *ee, Ecore_Evas_Drag_State_Changed_Cb cb)
5687{
5688 ECORE_EVAS_CHECK(ee);
5689 ee->func.fn_dnd_state_change = cb;
5690}
5691
5692EAPI void
5693ecore_evas_callback_drop_drop_set(Ecore_Evas *ee, Ecore_Evas_Drop_Cb cb)
5694{
5695 ECORE_EVAS_CHECK(ee);
5696 ee->func.fn_dnd_drop = cb;
5697}
5698
5699typedef struct {
5700 Eina_Array *available_mime_types;
5701 Eina_Position2D pos;
5702} Ecore_Evas_Active_Dnd;
5703
5704static void
5705_ecore_evas_active_dnd_free(Ecore_Evas_Active_Dnd *dnd)
5706{
5707 eina_array_free(dnd->available_mime_types);
5708 free(dnd);
5709}
5710
5711EAPI void
5712ecore_evas_dnd_enter(Ecore_Evas *ee, unsigned int seat, Eina_Iterator *available_types, Eina_Position2D pos)
5713{
5714 Eina_Stringshare *s;
5715 Ecore_Evas_Active_Dnd *dnd;
5716
5717 ECORE_EVAS_CHECK(ee);
5718 if (!ee->active_drags)
5719 {
5720 ee->active_drags = eina_hash_int32_new((Eina_Free_Cb)_ecore_evas_active_dnd_free);
5721 }
5722
5723 dnd = calloc(1, sizeof(Ecore_Evas_Active_Dnd));
5724 dnd->available_mime_types = eina_array_new(5);
5725 eina_hash_add(ee->active_drags, &seat, dnd);
5726
5727 EINA_ITERATOR_FOREACH(available_types, s)
5728 {
5729 eina_array_push(dnd->available_mime_types, s);
5730 }
5731 eina_iterator_free(available_types);
5732
5733 if (ee->func.fn_dnd_state_change)
5734 ee->func.fn_dnd_state_change(ee, seat, pos, EINA_TRUE);
5735}
5736
5737EAPI void
5738ecore_evas_dnd_position_set(Ecore_Evas *ee, unsigned int seat, Eina_Position2D pos)
5739{
5740 Ecore_Evas_Active_Dnd *dnd;
5741
5742 ECORE_EVAS_CHECK(ee);
5743 EINA_SAFETY_ON_NULL_RETURN(ee->active_drags);
5744 dnd = eina_hash_find(ee->active_drags, &seat);
5745 EINA_SAFETY_ON_NULL_RETURN(dnd);
5746 dnd->pos = pos;
5747 if (ee->func.fn_dnd_motion)
5748 ee->func.fn_dnd_motion(ee, seat, pos);
5749}
5750
5751EAPI void
5752ecore_evas_dnd_leave(Ecore_Evas *ee, unsigned int seat, Eina_Position2D pos)
5753{
5754 Ecore_Evas_Active_Dnd *dnd;
5755
5756 ECORE_EVAS_CHECK(ee);
5757 EINA_SAFETY_ON_NULL_RETURN(ee->active_drags);
5758 dnd = eina_hash_find(ee->active_drags, &seat);
5759 EINA_SAFETY_ON_NULL_RETURN(dnd);
5760
5761 if (ee->func.fn_dnd_state_change)
5762 ee->func.fn_dnd_state_change(ee, seat, pos, EINA_FALSE);
5763 eina_hash_del(ee->active_drags, &seat, dnd);
5764 if (eina_hash_population(ee->active_drags) == 0)
5765 {
5766 eina_hash_free(ee->active_drags);
5767 ee->active_drags = NULL;
5768 }
5769}
5770
5771EAPI Eina_Position2D
5772ecore_evas_dnd_pos_get(Ecore_Evas *ee, unsigned int seat)
5773{
5774 Ecore_Evas_Active_Dnd *dnd;
5775
5776 ECORE_EVAS_CHECK_GOTO(ee, err);
5777 EINA_SAFETY_ON_NULL_RETURN_VAL(ee->active_drags, EINA_POSITION2D(0, 0));
5778 dnd = eina_hash_find(ee->active_drags, &seat);
5779 EINA_SAFETY_ON_NULL_RETURN_VAL(dnd, EINA_POSITION2D(0, 0));
5780
5781 return dnd->pos;
5782err:
5783 return EINA_POSITION2D(0, 0);
5784}
5785
5786EAPI Eina_Accessor*
5787ecore_evas_drop_available_types_get(Ecore_Evas *ee, unsigned int seat)
5788{
5789 Ecore_Evas_Active_Dnd *dnd;
5790
5791 ECORE_EVAS_CHECK_GOTO(ee, err);
5792 EINA_SAFETY_ON_NULL_RETURN_VAL(ee->active_drags, NULL);
5793 dnd = eina_hash_find(ee->active_drags, &seat);
5794 EINA_SAFETY_ON_NULL_RETURN_VAL(dnd, NULL);
5795
5796 return eina_array_accessor_new(dnd->available_mime_types);
5797err:
5798 return NULL;
5799}
diff --git a/src/lib/ecore_evas/ecore_evas_fallback_selection.c b/src/lib/ecore_evas/ecore_evas_fallback_selection.c
new file mode 100644
index 0000000000..b3f59c7921
--- /dev/null
+++ b/src/lib/ecore_evas/ecore_evas_fallback_selection.c
@@ -0,0 +1,115 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#include <Ecore.h>
6#include "ecore_private.h"
7#include "Ecore_Evas.h"
8#include "ecore_evas_private.h"
9#include <Efl_Core.h>
10
11typedef struct {
12 Ecore_Evas_Selection_Callbacks callbacks[ECORE_EVAS_SELECTION_BUFFER_LAST];
13 int seat;
14} Ecore_Evas_Fallback_Selection_Data;
15
16static Ecore_Evas_Fallback_Selection_Data data[ECORE_EVAS_SELECTION_BUFFER_LAST];
17
18void
19fallback_selection_shutdown(Ecore_Evas *ee)
20{
21 for (int i = 0; i < ECORE_EVAS_SELECTION_BUFFER_LAST; ++i)
22 {
23 if (data->callbacks[i].cancel)
24 data->callbacks[i].cancel(ee, data->seat, i);
25 }
26}
27
28Eina_Bool
29fallback_selection_claim(Ecore_Evas *ee, unsigned int seat, Ecore_Evas_Selection_Buffer selection, Eina_Array *available_types, Ecore_Evas_Selection_Internal_Delivery delivery, Ecore_Evas_Selection_Internal_Cancel cancel)
30{
31 Ecore_Evas_Selection_Callbacks *callbacks = &data->callbacks[selection];
32
33 if (callbacks->cancel)
34 {
35 callbacks->cancel(ee, data->seat, selection);
36 eina_array_free(callbacks->available_types);
37 }
38
39 callbacks->delivery = delivery;
40 callbacks->cancel = cancel;
41 callbacks->available_types = available_types;
42 data->seat = seat;
43
44 if (ee->func.fn_selection_changed)
45 ee->func.fn_selection_changed(ee, seat, selection);
46
47 return EINA_TRUE;
48}
49
50Eina_Bool
51fallback_selection_has_owner(Ecore_Evas *ee EINA_UNUSED, unsigned int seat EINA_UNUSED, Ecore_Evas_Selection_Buffer selection EINA_UNUSED)
52{
53 return EINA_FALSE; //if the real selection buffer does not contain it, then we dont know it either.
54}
55
56Eina_Stringshare*
57available_types(Eina_Array *acceptable_types, Eina_Array *available_types)
58{
59 unsigned int found_type_id = INT_MAX;
60 Eina_Stringshare *found_type = NULL;
61 Eina_Stringshare *type;
62
63 for (unsigned int i = 0; i < eina_array_count_get(acceptable_types); ++i)
64 {
65 unsigned int out = -1;
66
67 type = eina_array_data_get(acceptable_types, i);
68
69 if (!eina_array_find(available_types, type, &out))
70 continue;
71 if (out >= found_type_id)
72 continue;
73 found_type_id = out;
74 found_type = type;
75 eina_stringshare_del(type);
76 }
77 eina_array_free(acceptable_types);
78
79 return found_type;
80}
81
82Eina_Future*
83fallback_selection_request(Ecore_Evas *ee EINA_UNUSED, unsigned int seat, Ecore_Evas_Selection_Buffer selection, Eina_Array *acceptable_type)
84{
85 Ecore_Evas_Selection_Callbacks callbacks = data->callbacks[selection];
86 Eina_Content *result;
87 Eina_Stringshare *serving_type;
88 Eina_Rw_Slice slice_data;
89 Eina_Value value;
90
91 if (!callbacks.delivery)
92 return eina_future_resolved(efl_loop_future_scheduler_get(efl_main_loop_get()), eina_value_int_init(0));
93
94 serving_type = available_types(acceptable_type, callbacks.available_types);
95 if (!serving_type)
96 return NULL; //Silent return cause we cannot deliver a good type
97
98 EINA_SAFETY_ON_FALSE_RETURN_VAL(callbacks.delivery(ee, seat, selection, serving_type, &slice_data), NULL);
99 result = eina_content_new(eina_rw_slice_slice_get(slice_data), serving_type);
100 value = eina_value_content_init(result);
101 eina_content_free(result);
102
103 return eina_future_resolved(efl_loop_future_scheduler_get(efl_main_loop_get()), value);
104}
105Eina_Bool
106fallback_dnd_start(Ecore_Evas *ee EINA_UNUSED, unsigned int seat EINA_UNUSED, Eina_Array *available_types EINA_UNUSED, Ecore_Evas *drag_rep EINA_UNUSED, Ecore_Evas_Selection_Internal_Delivery delivery EINA_UNUSED, Ecore_Evas_Selection_Internal_Cancel cancel EINA_UNUSED, const char* action EINA_UNUSED)
107{
108 return EINA_FALSE;
109}
110
111Eina_Bool
112fallback_dnd_stop(Ecore_Evas *ee EINA_UNUSED, unsigned int seat EINA_UNUSED)
113{
114 return EINA_FALSE;
115}
diff --git a/src/lib/ecore_evas/ecore_evas_private.h b/src/lib/ecore_evas/ecore_evas_private.h
index 474b7a35ed..6fb2c988b5 100644
--- a/src/lib/ecore_evas/ecore_evas_private.h
+++ b/src/lib/ecore_evas/ecore_evas_private.h
@@ -33,6 +33,10 @@
33 33
34EAPI extern int _ecore_evas_log_dom; 34EAPI extern int _ecore_evas_log_dom;
35 35
36EAPI Eina_Error ecore_evas_no_matching_type;
37EAPI Eina_Error ecore_evas_no_selection;
38EAPI Eina_Error ecore_evas_request_replaced;
39
36#ifdef ECORE_EVAS_DEFAULT_LOG_COLOR 40#ifdef ECORE_EVAS_DEFAULT_LOG_COLOR
37# undef ECORE_EVAS_DEFAULT_LOG_COLOR 41# undef ECORE_EVAS_DEFAULT_LOG_COLOR
38#endif 42#endif
@@ -78,6 +82,13 @@ typedef struct _Ecore_Evas_Interface Ecore_Evas_Interface;
78typedef struct _Ecore_Evas_Aux_Hint Ecore_Evas_Aux_Hint; 82typedef struct _Ecore_Evas_Aux_Hint Ecore_Evas_Aux_Hint;
79typedef struct _Ecore_Evas_Cursor Ecore_Evas_Cursor; 83typedef struct _Ecore_Evas_Cursor Ecore_Evas_Cursor;
80 84
85typedef Eina_Bool (*Ecore_Evas_Selection_Internal_Delivery)(Ecore_Evas *ee, unsigned int seat, Ecore_Evas_Selection_Buffer buffer, const char *type, Eina_Rw_Slice *slice);
86typedef void (*Ecore_Evas_Selection_Internal_Cancel)(Ecore_Evas *ee, unsigned int seat, Ecore_Evas_Selection_Buffer buffer);
87typedef struct {
88 Ecore_Evas_Selection_Internal_Delivery delivery;
89 Ecore_Evas_Selection_Internal_Cancel cancel;
90 Eina_Array *available_types;
91} Ecore_Evas_Selection_Callbacks;
81/* Engines interfaces */ 92/* Engines interfaces */
82struct _Ecore_Evas_Engine_Func 93struct _Ecore_Evas_Engine_Func
83{ 94{
@@ -171,6 +182,12 @@ struct _Ecore_Evas_Engine_Func
171 Eina_Bool (*fn_prepare)(Ecore_Evas *ee); 182 Eina_Bool (*fn_prepare)(Ecore_Evas *ee);
172 183
173 double (*fn_last_tick_get)(Ecore_Evas *ee); 184 double (*fn_last_tick_get)(Ecore_Evas *ee);
185
186 Eina_Bool (*fn_selection_claim)(Ecore_Evas *ee, unsigned int seat, Ecore_Evas_Selection_Buffer selection, Eina_Array *available_types, Ecore_Evas_Selection_Internal_Delivery delivery, Ecore_Evas_Selection_Internal_Cancel cancel);
187 Eina_Bool (*fn_selection_has_owner)(Ecore_Evas *ee, unsigned int seat, Ecore_Evas_Selection_Buffer selection);
188 Eina_Future* (*fn_selection_request)(Ecore_Evas *ee, unsigned int seat, Ecore_Evas_Selection_Buffer selection, Eina_Array *acceptable_types); // a future containing a Eina_Content, type must be in acceptable_types
189 Eina_Bool (*fn_dnd_start)(Ecore_Evas *ee, unsigned int seat, Eina_Array *available_types, Ecore_Evas *drag_rep, Ecore_Evas_Selection_Internal_Delivery delivery, Ecore_Evas_Selection_Internal_Cancel cancel, const char *action);
190 Eina_Bool (*fn_dnd_stop)(Ecore_Evas *ee, unsigned int seat);
174}; 191};
175 192
176struct _Ecore_Evas_Interface 193struct _Ecore_Evas_Interface
@@ -202,6 +219,11 @@ struct _Ecore_Evas_Cursor {
202 int pos_y; 219 int pos_y;
203}; 220};
204 221
222typedef struct {
223 unsigned int seat;
224 Eina_Content *selection_buffer[ECORE_EVAS_SELECTION_BUFFER_LAST];
225} Ecore_Evas_Selection_Seat_Buffers;
226
205struct _Ecore_Evas 227struct _Ecore_Evas
206{ 228{
207 EINA_INLIST; 229 EINA_INLIST;
@@ -224,6 +246,8 @@ struct _Ecore_Evas
224 246
225 Eina_List *vnc_server; /* @since 1.19 */ 247 Eina_List *vnc_server; /* @since 1.19 */
226 248
249 Eina_Hash *selection_buffers;
250
227 struct { 251 struct {
228 int x, y, w, h; 252 int x, y, w, h;
229 } req; 253 } req;
@@ -259,7 +283,7 @@ struct _Ecore_Evas
259 Eina_Bool supported; // indicate that the underlying window system supports window manager rotation protocol 283 Eina_Bool supported; // indicate that the underlying window system supports window manager rotation protocol
260 Eina_Bool app_set; // indicate that the ee supports window manager rotation protocol 284 Eina_Bool app_set; // indicate that the ee supports window manager rotation protocol
261 Eina_Bool win_resize; // indicate that the ee will be resized by the WM 285 Eina_Bool win_resize; // indicate that the ee will be resized by the WM
262 int angle; // rotation value which is decided by the WM 286 int angle; // rotation value which is decided by the WM
263 int w, h; // window size to rotate 287 int w, h; // window size to rotate
264 int preferred_rot; // preferred rotation hint 288 int preferred_rot; // preferred rotation hint
265 int *available_rots; // array of avaialable rotation values 289 int *available_rots; // array of avaialable rotation values
@@ -323,6 +347,10 @@ struct _Ecore_Evas
323 void (*fn_focus_device_out) (Ecore_Evas *ee, Efl_Input_Device *seat); 347 void (*fn_focus_device_out) (Ecore_Evas *ee, Efl_Input_Device *seat);
324 void (*fn_device_mouse_in) (Ecore_Evas *ee, Efl_Input_Device *mouse); 348 void (*fn_device_mouse_in) (Ecore_Evas *ee, Efl_Input_Device *mouse);
325 void (*fn_device_mouse_out) (Ecore_Evas *ee, Efl_Input_Device *mouse); 349 void (*fn_device_mouse_out) (Ecore_Evas *ee, Efl_Input_Device *mouse);
350 void (*fn_selection_changed) (Ecore_Evas *ee, unsigned int seat, Ecore_Evas_Selection_Buffer selection);
351 void (*fn_dnd_motion) (Ecore_Evas *ee, unsigned int seat, Eina_Position2D p);
352 void (*fn_dnd_state_change) (Ecore_Evas *ee, unsigned int seat, Eina_Position2D p, Eina_Bool inside);
353 void (*fn_dnd_drop)(Ecore_Evas *ee, unsigned int seat, Eina_Position2D p, const char *action);
326 } func; 354 } func;
327 355
328 Ecore_Evas_Engine engine; 356 Ecore_Evas_Engine engine;
@@ -353,6 +381,14 @@ struct _Ecore_Evas
353 unsigned char rotation_changed : 1; 381 unsigned char rotation_changed : 1;
354 } delayed; 382 } delayed;
355 383
384 Eina_Hash *active_drags;
385 struct {
386 Ecore_Evas *rep;
387 void *data;
388 Ecore_Evas_Drag_Finished_Cb free;
389 Eina_Bool accepted;
390 } drag;
391
356 int refcount; 392 int refcount;
357//#define ECORE_EVAS_ASYNC_RENDER_DEBUG 1 /* TODO: remove me */ 393//#define ECORE_EVAS_ASYNC_RENDER_DEBUG 1 /* TODO: remove me */
358#ifdef ECORE_EVAS_ASYNC_RENDER_DEBUG 394#ifdef ECORE_EVAS_ASYNC_RENDER_DEBUG
@@ -374,6 +410,7 @@ struct _Ecore_Evas
374 unsigned char first_frame : 1; 410 unsigned char first_frame : 1;
375 unsigned char self_del : 1; 411 unsigned char self_del : 1;
376 unsigned char evas_dying : 1; 412 unsigned char evas_dying : 1;
413 unsigned char fallback_interface : 1;
377}; 414};
378 415
379struct _Ecore_Evas_Aux_Hint 416struct _Ecore_Evas_Aux_Hint
@@ -486,6 +523,20 @@ EAPI Eina_Bool ecore_evas_render(Ecore_Evas *ee);
486EAPI Evas *ecore_evas_evas_new(Ecore_Evas *ee, int w, int h); 523EAPI Evas *ecore_evas_evas_new(Ecore_Evas *ee, int w, int h);
487EAPI void ecore_evas_done(Ecore_Evas *ee, Eina_Bool single_window); 524EAPI void ecore_evas_done(Ecore_Evas *ee, Eina_Bool single_window);
488 525
526EAPI void ecore_evas_dnd_position_set(Ecore_Evas *ee, unsigned int seat, Eina_Position2D pos);
527EAPI void ecore_evas_dnd_leave(Ecore_Evas *ee, unsigned int seat, Eina_Position2D pos);
528EAPI void ecore_evas_dnd_enter(Ecore_Evas *ee, unsigned int seat, Eina_Iterator *available_types, Eina_Position2D pos);
529EAPI Eina_Position2D ecore_evas_dnd_pos_get(Ecore_Evas *ee, unsigned int seat);
530
531
532void fallback_selection_init(Ecore_Evas *ee);
533void fallback_selection_shutdown(Ecore_Evas *ee);
534Eina_Bool fallback_selection_claim(Ecore_Evas *ee, unsigned int seat, Ecore_Evas_Selection_Buffer selection, Eina_Array *available_types, Ecore_Evas_Selection_Internal_Delivery delivery, Ecore_Evas_Selection_Internal_Cancel cancel);
535Eina_Bool fallback_selection_has_owner(Ecore_Evas *ee, unsigned int seat, Ecore_Evas_Selection_Buffer selection);
536Eina_Future* fallback_selection_request(Ecore_Evas *ee, unsigned int seat, Ecore_Evas_Selection_Buffer selection, Eina_Array *acceptable_type);
537Eina_Bool fallback_dnd_start(Ecore_Evas *ee, unsigned int seat, Eina_Array *available_types, Ecore_Evas *drag_rep, Ecore_Evas_Selection_Internal_Delivery delivery, Ecore_Evas_Selection_Internal_Cancel cancel, const char* action);
538Eina_Bool fallback_dnd_stop(Ecore_Evas *ee, unsigned int seat);
539
489#ifdef IPA_YLNO_ESU_LANRETNI_MLE 540#ifdef IPA_YLNO_ESU_LANRETNI_MLE
490EAPI Ecore_Evas *_wayland_shm_new(const char *disp_name, Ecore_Window parent, int x, int y, int w, int h, Eina_Bool frame); 541EAPI Ecore_Evas *_wayland_shm_new(const char *disp_name, Ecore_Window parent, int x, int y, int w, int h, Eina_Bool frame);
491EAPI Ecore_Evas *_wayland_egl_new(const char *disp_name, Ecore_Window parent, int x, int y, int w, int h, Eina_Bool frame, const int *opt); 542EAPI Ecore_Evas *_wayland_egl_new(const char *disp_name, Ecore_Window parent, int x, int y, int w, int h, Eina_Bool frame, const int *opt);
diff --git a/src/lib/ecore_evas/meson.build b/src/lib/ecore_evas/meson.build
index c0fb459a56..890e3c42b3 100644
--- a/src/lib/ecore_evas/meson.build
+++ b/src/lib/ecore_evas/meson.build
@@ -23,7 +23,8 @@ ecore_evas_src = [
23 'ecore_evas_cocoa.h', 23 'ecore_evas_cocoa.h',
24 'ecore_evas_win32.h', 24 'ecore_evas_win32.h',
25 'ecore_evas_x11.h', 25 'ecore_evas_x11.h',
26 'ecore_evas_util.c' 26 'ecore_evas_util.c',
27 'ecore_evas_fallback_selection.c'
27] 28]
28 29
29 30
diff --git a/src/lib/ecore_imf/Ecore_IMF.h b/src/lib/ecore_imf/Ecore_IMF.h
index 4cfb488e56..70b4bc85eb 100644
--- a/src/lib/ecore_imf/Ecore_IMF.h
+++ b/src/lib/ecore_imf/Ecore_IMF.h
@@ -47,7 +47,7 @@ extern "C" {
47 * @defgroup Ecore_IMF_Context_Group Ecore Input Method Context Functions 47 * @defgroup Ecore_IMF_Context_Group Ecore Input Method Context Functions
48 * @ingroup Ecore_IMF_Lib_Group 48 * @ingroup Ecore_IMF_Lib_Group
49 * 49 *
50 * @section intro Introduction 50 * @section ecore_imf_intro Introduction
51 * 51 *
52 * Functions that operate on Ecore Input Method Context objects. 52 * Functions that operate on Ecore Input Method Context objects.
53 53
diff --git a/src/lib/ecore_input_evas/ecore_input_evas.c b/src/lib/ecore_input_evas/ecore_input_evas.c
index bd2f0d1868..8f26737778 100644
--- a/src/lib/ecore_input_evas/ecore_input_evas.c
+++ b/src/lib/ecore_input_evas/ecore_input_evas.c
@@ -845,10 +845,14 @@ EAPI int
845ecore_event_evas_shutdown(void) 845ecore_event_evas_shutdown(void)
846{ 846{
847 size_t i; 847 size_t i;
848 Ecore_Event_Last *eel;
848 849
849 if (--_ecore_event_evas_init_count != 0) 850 if (--_ecore_event_evas_init_count != 0)
850 return _ecore_event_evas_init_count; 851 return _ecore_event_evas_init_count;
851 852
853 EINA_LIST_FREE(_last_events, eel)
854 free(eel);
855
852 eina_hash_free(_window_hash); 856 eina_hash_free(_window_hash);
853 _window_hash = NULL; 857 _window_hash = NULL;
854 for (i = 0; i < sizeof(ecore_event_evas_handlers) / sizeof(Ecore_Event_Handler *); i++) 858 for (i = 0; i < sizeof(ecore_event_evas_handlers) / sizeof(Ecore_Event_Handler *); i++)
diff --git a/src/lib/ecore_wayland/ecore_wl_dnd.c b/src/lib/ecore_wayland/ecore_wl_dnd.c
index 35760f849d..09f6c9c9a9 100644
--- a/src/lib/ecore_wayland/ecore_wl_dnd.c
+++ b/src/lib/ecore_wayland/ecore_wl_dnd.c
@@ -410,7 +410,6 @@ ecore_wl_dnd_drag_types_set(Ecore_Wl_Input *input, const char **types_offered)
410 /* add these types to the data source */ 410 /* add these types to the data source */
411 for (type = types_offered; *type; type++) 411 for (type = types_offered; *type; type++)
412 { 412 {
413 if (!*type) continue;
414 t = wl_array_add(&input->data_types, sizeof(*t)); 413 t = wl_array_add(&input->data_types, sizeof(*t));
415 if (t) 414 if (t)
416 { 415 {
diff --git a/src/lib/ecore_wayland/ivi-application-client-protocol.h b/src/lib/ecore_wayland/ivi-application-client-protocol.h
index 84fecd84ef..7f825772df 100644
--- a/src/lib/ecore_wayland/ivi-application-client-protocol.h
+++ b/src/lib/ecore_wayland/ivi-application-client-protocol.h
@@ -44,59 +44,45 @@ extern const struct wl_interface ivi_application_interface;
44#ifndef IVI_SURFACE_WARNING_CODE_ENUM 44#ifndef IVI_SURFACE_WARNING_CODE_ENUM
45#define IVI_SURFACE_WARNING_CODE_ENUM 45#define IVI_SURFACE_WARNING_CODE_ENUM
46/** 46/**
47 * ivi_surface_warning_code - possible warning codes returned by ivi 47 * @brief Possible warning codes returned by ivi compositor
48 * compositor
49 * @IVI_SURFACE_WARNING_CODE_INVALID_WL_SURFACE: wl_surface is invalid
50 * @IVI_SURFACE_WARNING_CODE_IVI_ID_IN_USE: ivi_id is in use and can not
51 * be shared
52 * 48 *
53 * These define all possible warning codes returned by ivi compositor on 49 * These define all possible warning codes returned by ivi compositor on
54 * server-side warnings. invalid_wl_surface: - wl_surface already has a 50 * server-side warnings.
55 * another role. - wl_surface is destroyed before the ivi_surface is
56 * destroyed. ivi_id_in_use: ivi_id is already assigned by another
57 * application.
58 */ 51 */
59enum ivi_surface_warning_code { 52enum ivi_surface_warning_code {
60 IVI_SURFACE_WARNING_CODE_INVALID_WL_SURFACE = 1, 53 IVI_SURFACE_WARNING_CODE_INVALID_WL_SURFACE = 1, /**< Surface is invalid. */
61 IVI_SURFACE_WARNING_CODE_IVI_ID_IN_USE = 2, 54 IVI_SURFACE_WARNING_CODE_IVI_ID_IN_USE = 2, /**< ivi_id is in use and cannot be shared. */
62}; 55};
63#endif /* IVI_SURFACE_WARNING_CODE_ENUM */ 56#endif /* IVI_SURFACE_WARNING_CODE_ENUM */
64 57
65/** 58/**
66 * ivi_surface - application interface to surface in ivi compositor 59 * @brief Application interface to surface in ivi compositor
67 * @visibility: visibility of surface in ivi compositor has changed
68 * @warning: server-side warning detected
69 *
70 *
71 */ 60 */
72struct ivi_surface_listener { 61struct ivi_surface_listener {
73 /** 62 /**
74 * visibility - visibility of surface in ivi compositor has 63 * @brief Visibility of surface in ivi compositor has
75 * changed 64 * changed
76 * @visibility: (none)
77 * 65 *
78 * The new visibility state is provided in argument visibility. 66 * The new visibility state is provided in argument @p visibility.
79 * If visibility is 0, the surface has become invisible. If 67 * If @p visibility is 0, the surface has become invisible. If
80 * visibility is not 0, the surface has become visible. 68 * @p visibility is not 0, the surface has become visible.
81 */ 69 */
82 void (*visibility)(void *data, 70 void (*visibility)(void *data,
83 struct ivi_surface *ivi_surface, 71 struct ivi_surface *ivi_surface,
84 int32_t visibility); 72 int32_t visibility);
85 /** 73 /**
86 * warning - server-side warning detected 74 * @brief Server-side warning detected
87 * @warning_code: (none)
88 * @warning_text: (none)
89 * 75 *
90 * The ivi compositor encountered warning while processing a 76 * The ivi compositor encountered warning while processing a
91 * request by this application. The warning is defined by argument 77 * request by this application. The warning is defined by argument
92 * warning_code and optional warning_text. If the warning is 78 * @p warning_code and optional @p warning_text. If the warning is
93 * detected, client